From 2959b347043ad6b61ed428434349c062a7a09c97 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Jun 2021 12:37:43 +0200 Subject: [PATCH 001/883] 2 port CSI configuration --- openair2/RRC/NR/rrc_gNB_reconfig.c | 41 +++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 88c1154cca..50b8ff308c 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1147,16 +1147,15 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); nzpcsi0->nzp_CSI_RS_ResourceId = 0; NR_CSI_RS_ResourceMapping_t resourceMapping; - resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2; + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; - resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16; - resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; + resourceMapping.frequencyDomainAllocation.choice.row2.size = 1; + resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; resourceMapping.firstOFDMSymbolInTimeDomain = 6; resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; - resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; resourceMapping.density.choice.one = (NULL_t)0; resourceMapping.freqBand.startingRB = 0; @@ -1230,15 +1229,33 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco pucchcsires1->uplinkBandwidthPartId=1; pucchcsires1->pucch_Resource=2; ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); - csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP; - csirep1->reportQuantity.choice.cri_RSRP=(NULL_t)0; + csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; + csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0; csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration)); - csirep1->reportFreqConfiguration->cqi_FormatIndicator = NULL; - csirep1->reportFreqConfiguration->pmi_FormatIndicator=NULL; + csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator)); + *csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; + csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator)); + *csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; csirep1->reportFreqConfiguration->csi_ReportingBand=NULL; csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; - csirep1->codebookConfig=NULL; + csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig)); + csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1; + csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1)); + csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= + calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03; + csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; csirep1->dummy = NULL; csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); From c3627daa22f295ddba197bd37bd3ad256fb0425a Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Jun 2021 16:03:48 +0200 Subject: [PATCH 002/883] update in CSI meas computation, including PMI for 2 port --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 186 ++++++++++-------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 8 +- 2 files changed, 103 insertions(+), 91 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 413a57d2fd..cefcc17e0b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -149,7 +149,7 @@ void nr_schedule_pucch(int Mod_idP, //! Calculating number of bits set -uint8_t number_of_bits_set (uint8_t buf,uint8_t * max_ri){ +uint8_t number_of_bits_set (uint8_t buf){ uint8_t nb_of_bits_set = 0; uint8_t mask = 0xff; uint8_t index = 0; @@ -160,14 +160,13 @@ uint8_t number_of_bits_set (uint8_t buf,uint8_t * max_ri){ mask>>=1; } - *max_ri = 8-index; return nb_of_bits_set; } void compute_rsrp_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, uint8_t nb_resources, - nr_csi_report_t *csi_report){ + nr_csi_report_t *csi_report) { if (NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled == csi_reportconfig->groupBasedBeamReporting.present) { if (NULL != csi_reportconfig->groupBasedBeamReporting.choice.disabled->nrofReportedRS) @@ -199,42 +198,24 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, nr_csi_report_t *csi_report){ struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig; - uint8_t nb_allowed_ri, ri_restriction,ri_bitlen; - uint8_t max_ri = 0; + uint8_t nb_allowed_ri, ri_bitlen; + uint8_t ri_restriction = 0; if (codebookConfig == NULL) { csi_report->csi_meas_bitlen.ri_bitlen=0; - return max_ri; + return ri_restriction; } // codebook type1 single panel if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){ struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two){ - // two antenna ports case - /* From Spec 38.212 - * If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator - * values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6, - * TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause - * 5.2.2.2.1 [6, TS 38.214]. - * - * But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to - * calculate RI for antennas equal or more than two. - * */ - AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present"); ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]; - /* Replace dummy with the nrofCQIsPerReport from the CSIreport - config when equalent ASN structure present */ - if (0==*(csi_reportconfig->dummy)){ - nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri); - ri_bitlen = ceil(log2(nb_allowed_ri)); - } - else{ - nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri); - ri_bitlen = ceil(log2(nb_allowed_ri)); - } + nb_allowed_ri = number_of_bits_set(ri_restriction); + ri_bitlen = ceil(log2(nb_allowed_ri)); + ri_bitlen = ri_bitlen<1?ri_bitlen:1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen; } @@ -242,109 +223,122 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) { // 4 ports - AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present"); ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]; - /* Replace dummy with the nrofCQIsPerReport from the CSIreport - config when equalent ASN structure present*/ - if (0==*(csi_reportconfig->dummy)){ - nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri); - ri_bitlen = ceil(log2(nb_allowed_ri)); - } - else{ - nb_allowed_ri = number_of_bits_set(ri_restriction,&max_ri); - ri_bitlen = ceil(log2(nb_allowed_ri)); - } + nb_allowed_ri = number_of_bits_set(ri_restriction); + ri_bitlen = ceil(log2(nb_allowed_ri)); + ri_bitlen = ri_bitlen<2?ri_bitlen:2; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen; } else { // more than 4 ports - AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present"); ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]; - /* Replace dummy with the nrofCQIsPerReport from the CSIreport - config when equalent ASN structure present */ - if (0==*(csi_reportconfig->dummy)){ - nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0),&max_ri); - ri_bitlen = ceil(log2(nb_allowed_ri)); - } - else{ - nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri); - ri_bitlen = ceil(log2(nb_allowed_ri)); - } + nb_allowed_ri = number_of_bits_set(ri_restriction); + ri_bitlen = ceil(log2(nb_allowed_ri)); + csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen; } } - return max_ri; + return ri_restriction; } else AssertFatal(1==0,"Other configurations not yet implemented\n"); } void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, - uint8_t max_ri, + uint8_t ri_restriction, nr_csi_report_t *csi_report){ struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig; - if (codebookConfig == NULL) { - csi_report->csi_meas_bitlen.li_bitlen=0; - return; + for(int i=0; i<8; i++) { + if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0) + csi_report->csi_meas_bitlen.li_bitlen[i]=0; + else { + // codebook type1 single panel + if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present) + csi_report->csi_meas_bitlen.li_bitlen[i]=ceil(log2(i+1))<2?ceil(log2(i+1)):2; + else + AssertFatal(1==0,"Other configurations not yet implemented\n"); + } } - // codebook type1 single panel - if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){ - /* From Spec 38.212 - * If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator - * values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6, - * TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause - * 5.2.2.2.1 [6, TS 38.214]. - * - * But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to - * calculate RI for antennas equal or more than two. - */ - //! TODO: The bit length of LI is as follows LI = log2(RI), Need to confirm wheather we should consider maximum RI can be reported from ri_restricted - // or we should consider reported RI. If we need to consider reported RI for calculating LI bit length then we need to modify the code. - csi_report->csi_meas_bitlen.li_bitlen=ceil(log2(max_ri))<2?ceil(log2(max_ri)):2; - } - else - AssertFatal(1==0,"Other configurations not yet implemented\n"); } +void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, + uint8_t ri_restriction, + nr_csi_report_t *csi_report){ + + struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig; + for(int i=0; i<8; i++) { + csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=0; + csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=0; + if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0) + return; + else { + if(codebookConfig->codebookType.present == NR_CodebookConfig__codebookType_PR_type1) { + if(codebookConfig->codebookType.choice.type1->subType.present == NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) { + if(codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present == + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { + if (i==0) + csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=2; + if (i==1) + csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=1; + } + else + AssertFatal(1==0,"More than 2 port not yet implemented\n"); + } + else + AssertFatal(1==0,"Type1 Multi-panel Codebook Config not yet implemented\n"); + } + else + AssertFatal(1==0,"Type2 Codebook Config not yet implemented\n"); + } + } +} + void compute_cqi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, - uint8_t max_ri, + uint8_t ri_restriction, nr_csi_report_t *csi_report){ struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig; struct NR_CSI_ReportConfig__reportFreqConfiguration *freq_config = csi_reportconfig->reportFreqConfiguration; if (*freq_config->cqi_FormatIndicator == NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI) { - csi_report->csi_meas_bitlen.cqi_bitlen = 4; - if(codebookConfig != NULL) { - if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present){ - struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; - if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { - if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present > - NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) { - // more than 4 antenna ports - if (max_ri > 4) - csi_report->csi_meas_bitlen.cqi_bitlen += 4; // CQI for second TB + for(int i=0; i<8; i++) { + if ((ri_restriction>>i)&0x01) { + csi_report->csi_meas_bitlen.cqi_bitlen[i] = 4; + if(codebookConfig != NULL) { + if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present){ + struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; + if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { + if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present > + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) { + // more than 4 antenna ports + if (i > 4) + csi_report->csi_meas_bitlen.cqi_bitlen[i] += 4; // CQI for second TB + } + } } } } + else + csi_report->csi_meas_bitlen.cqi_bitlen[i] = 0; } } else AssertFatal(1==0,"Sub-band CQI reporting not yet supported"); } + //!TODO : same function can be written to handle csi_resources void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_info, int UE_id, module_id_t Mod_idP){ uint8_t csi_report_id = 0; uint8_t nb_resources = 0; - uint8_t max_ri = 0; + uint8_t ri_restriction; NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type; NR_CSI_ResourceConfigId_t csi_ResourceConfigId; struct NR_CSI_ResourceConfig *csi_resourceconfig; @@ -417,8 +411,14 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in break; case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI): csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); - max_ri = compute_ri_bitlen(csi_reportconfig, csi_report); - compute_cqi_bitlen(csi_reportconfig, max_ri, csi_report); + ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_cqi_bitlen(csi_reportconfig, ri_restriction, csi_report); + break; + case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI): + csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); + ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_cqi_bitlen(csi_reportconfig, ri_restriction, csi_report); + compute_pmi_bitlen(csi_reportconfig, ri_restriction, csi_report); break; default: AssertFatal(1==0,"Not yet supported CSI report quantity type"); @@ -431,7 +431,8 @@ uint16_t nr_get_csi_bitlen(int Mod_idP, int UE_id, uint8_t csi_report_id) { - uint16_t csi_bitlen =0; + uint16_t csi_bitlen = 0; + uint16_t max_bitlen = 0; NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; L1_RSRP_bitlen_t * CSI_report_bitlen = NULL; CSI_Meas_bitlen_t * csi_meas_bitlen = NULL; @@ -444,7 +445,18 @@ uint16_t nr_get_csi_bitlen(int Mod_idP, (CSI_report_bitlen->nb_ssbri_cri -1 ))); } else{ csi_meas_bitlen = &(UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen); //This might need to be moodif for Aperiodic CSI-RS measurements - csi_bitlen+= (csi_meas_bitlen->cri_bitlen +csi_meas_bitlen->ri_bitlen+csi_meas_bitlen->li_bitlen+csi_meas_bitlen->cqi_bitlen+csi_meas_bitlen->pmi_x1_bitlen+csi_meas_bitlen->pmi_x2_bitlen); + uint16_t temp_bitlen; + for (int i=0; i<8; i++) { + temp_bitlen = (csi_meas_bitlen->cri_bitlen+ + csi_meas_bitlen->ri_bitlen+ + csi_meas_bitlen->li_bitlen[i]+ + csi_meas_bitlen->cqi_bitlen[i]+ + csi_meas_bitlen->pmi_x1_bitlen[i]+ + csi_meas_bitlen->pmi_x2_bitlen[i]); + if(temp_bitlen>max_bitlen) + max_bitlen = temp_bitlen; + } + csi_bitlen += max_bitlen; } return csi_bitlen; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3ef1042eac..0f89d5624f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -469,10 +469,10 @@ typedef struct { typedef struct{ uint8_t cri_bitlen; uint8_t ri_bitlen; - uint8_t li_bitlen; - uint8_t pmi_x1_bitlen; - uint8_t pmi_x2_bitlen; - uint8_t cqi_bitlen; + uint8_t li_bitlen[8]; + uint8_t pmi_x1_bitlen[8]; + uint8_t pmi_x2_bitlen[8]; + uint8_t cqi_bitlen[8]; } CSI_Meas_bitlen_t; typedef struct nr_csi_report { From 9cda0a0cede01d346c13bdffb24d9bfe9f9b828b Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 4 Jun 2021 09:54:01 +0200 Subject: [PATCH 003/883] update in CSI report evaluation including PMI --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 146 ++++++++++++++---- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + 2 files changed, 114 insertions(+), 33 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index cefcc17e0b..8ab42af750 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -284,9 +284,9 @@ void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, if(codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { if (i==0) - csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=2; + csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=2; if (i==1) - csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=1; + csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=1; } else AssertFatal(1==0,"More than 2 port not yet implemented\n"); @@ -338,7 +338,6 @@ void compute_cqi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_info, int UE_id, module_id_t Mod_idP){ uint8_t csi_report_id = 0; uint8_t nb_resources = 0; - uint8_t ri_restriction; NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type; NR_CSI_ResourceConfigId_t csi_ResourceConfigId; struct NR_CSI_ResourceConfig *csi_resourceconfig; @@ -411,14 +410,14 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in break; case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI): csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); - ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); - compute_cqi_bitlen(csi_reportconfig, ri_restriction, csi_report); + csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); break; case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI): csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); - ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); - compute_cqi_bitlen(csi_reportconfig, ri_restriction, csi_report); - compute_pmi_bitlen(csi_reportconfig, ri_restriction, csi_report); + csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); + compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); break; default: AssertFatal(1==0,"Not yet supported CSI report quantity type"); @@ -870,7 +869,8 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, int *cumul_bits, NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type){ - uint8_t cri_ssbri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen; + nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id]; + uint8_t cri_ssbri_bitlen = csi_report->CSI_report_bitlen.cri_ssbri_bitlen; uint16_t curr_payload; /*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report @@ -892,17 +892,17 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, */ int idx = 0; //Since for SSB RSRP reporting in RRC can configure only one ssb resource set per one report config - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.nb_ssbri_cri; + sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits); if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = - *(UE_info->csi_report_template[UE_id][csi_report_id].SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); + *(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); else sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = - *(UE_info->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); + *(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *cumul_bits += cri_ssbri_bitlen; LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); @@ -917,7 +917,7 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; *cumul_bits += 4; } - UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++; + csi_report->nb_of_csi_ssb_report++; LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP, get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP)); @@ -935,33 +935,96 @@ void evaluate_cri_report(uint8_t *payload, sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; } -void evaluate_ri_report(uint8_t *payload, - uint8_t ri_bitlen, - NR_UE_sched_ctrl_t *sched_ctrl){ +int evaluate_ri_report(uint8_t *payload, + uint8_t ri_bitlen, + uint8_t ri_restriction, + int cumul_bits, + NR_UE_sched_ctrl_t *sched_ctrl){ - AssertFatal(1==0,"Evaluation of RI report not yet implemented\n"); + int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? + uint8_t ri_index = pickandreverse_bits(payload, ri_bitlen, cumul_bits); + int count=0; + for (int i=0; i<8; i++) { + if ((ri_restriction>>i)&0x01) { + if(count == ri_index) { + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.ri = i; + LOG_I(MAC,"CSI Reported Rank %d\n", i+1); + return i; + } + count++; + } + } + AssertFatal(1==0, "Decoded ri %d does not correspond to any valid value in ri_restriction %d\n",ri_index,ri_restriction); } void evaluate_cqi_report(uint8_t *payload, - uint8_t cqi_bitlen, - int *cumul_bits, + nr_csi_report_t *csi_report, + int cumul_bits, + uint8_t ri, NR_UE_sched_ctrl_t *sched_ctrl){ //TODO sub-band CQI report not yet implemented int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? - - uint8_t temp_cqi = pickandreverse_bits(payload, 4, *cumul_bits); + int cqi_bitlen = csi_report->csi_meas_bitlen.cqi_bitlen[ri]; + + uint8_t temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; - *cumul_bits += 4; LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); if (cqi_bitlen > 4) { - temp_cqi = pickandreverse_bits(payload, 4, *cumul_bits); + temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi); } } + +uint8_t evaluate_pmi_report(uint8_t *payload, + nr_csi_report_t *csi_report, + int cumul_bits, + uint8_t ri, + NR_UE_sched_ctrl_t *sched_ctrl){ + + int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? + int x1_bitlen = csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]; + int x2_bitlen = csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; + int tot_bitlen = x1_bitlen + x2_bitlen; + + //in case of 2 port CSI configuration x1 is empty and the information bits are in x2 + int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits); + + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x1, + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x2); + + return tot_bitlen; + +} + + +void skip_zero_padding(int *cumul_bits, + nr_csi_report_t *csi_report, + uint8_t ri, + uint16_t max_bitlen) { + + // actual number of reported bits depends on the reported rank + // zero padding bits are added to have a predetermined max bit length to decode + + uint16_t reported_bitlen = csi_report->csi_meas_bitlen.cri_bitlen+ + csi_report->csi_meas_bitlen.ri_bitlen+ + csi_report->csi_meas_bitlen.li_bitlen[ri]+ + csi_report->csi_meas_bitlen.cqi_bitlen[ri]+ + csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]+ + csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; + + cumul_bits+=(max_bitlen-reported_bitlen); + +} + + void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu, frame_t frame, @@ -974,21 +1037,24 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, RC.nrmac[Mod_idP]->common_channels->ServingCellConfigCommon; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; uint8_t *payload = uci_pdu->csi_part1.csi_part1_payload; + uint16_t bitlen = uci_pdu->csi_part1.csi_part1_bit_len; NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type = NR_CSI_ReportConfig__reportQuantity_PR_NOTHING; NR_UE_info_t *UE_info = &(RC.nrmac[Mod_idP]->UE_info); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; int cumul_bits = 0; + int r_index = -1; for (int csi_report_id = 0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++ ) { - UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report = 0; + nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id]; + csi_report->nb_of_csi_ssb_report = 0; uint8_t cri_bitlen = 0; uint8_t ri_bitlen = 0; - uint8_t cqi_bitlen = 0; + uint8_t pmi_bitlen = 0; NR_CSI_ReportConfig_t *csirep = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; int period, offset; csi_period_offset(csirep, NULL, &period, &offset); // verify if report with current id has been scheduled for this frame and slot if ((n_slots_frame*frame + slot - offset)%period == 0) { - reportQuantity_type = UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type; + reportQuantity_type = csi_report->reportQuantity_type; LOG_I(MAC,"SFN/SF:%d/%d reportQuantity type = %d\n",frame,slot,reportQuantity_type); switch(reportQuantity_type){ case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP: @@ -998,18 +1064,32 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, evaluate_rsrp_report(UE_info,sched_ctrl,UE_id,csi_report_id,payload,&cumul_bits,reportQuantity_type); break; case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI: - cri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cri_bitlen; + cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; if(cri_bitlen) evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl); cumul_bits += cri_bitlen; - ri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen; + ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen; if(ri_bitlen) - evaluate_ri_report(payload,ri_bitlen,sched_ctrl); + r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl); cumul_bits += ri_bitlen; - //TODO add zero padding bits when needed - cqi_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen; - if(cqi_bitlen) - evaluate_cqi_report(payload,cqi_bitlen,&cumul_bits,sched_ctrl); + if (r_index != -1) + skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + break; + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI: + cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; + if(cri_bitlen) + evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl); + cumul_bits += cri_bitlen; + ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen; + if(ri_bitlen) + r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl); + cumul_bits += ri_bitlen; + if (r_index != -1) + skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); + pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + cumul_bits += pmi_bitlen; + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); break; default: AssertFatal(1==0, "Invalid or not supported CSI measurement report\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 0f89d5624f..ca8d56a618 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -467,6 +467,7 @@ typedef struct { }L1_RSRP_bitlen_t; typedef struct{ + uint8_t ri_restriction; uint8_t cri_bitlen; uint8_t ri_bitlen; uint8_t li_bitlen[8]; From 4b0883f2e06a7ba503f9aae3eebdb2abb00f9273 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 4 Jun 2021 11:56:15 +0200 Subject: [PATCH 004/883] adding cri_RI_LI_PMI_CQI option --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 8ab42af750..d7480e08e3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -419,6 +419,13 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); break; + case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI): + csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources)); + csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report); + compute_li_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); + compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); + compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report); + break; default: AssertFatal(1==0,"Not yet supported CSI report quantity type"); } @@ -1005,6 +1012,24 @@ uint8_t evaluate_pmi_report(uint8_t *payload, } +int evaluate_li_report(uint8_t *payload, + nr_csi_report_t *csi_report, + int cumul_bits, + uint8_t ri, + NR_UE_sched_ctrl_t *sched_ctrl){ + + int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? + int li_bitlen = csi_report->csi_meas_bitlen.li_bitlen[ri]; + + if (li_bitlen>0) { + int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits); + LOG_I(MAC,"LI %d\n",temp_li); + sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.li = temp_li; + } + return li_bitlen; + +} + void skip_zero_padding(int *cumul_bits, nr_csi_report_t *csi_report, uint8_t ri, @@ -1048,6 +1073,7 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, csi_report->nb_of_csi_ssb_report = 0; uint8_t cri_bitlen = 0; uint8_t ri_bitlen = 0; + uint8_t li_bitlen = 0; uint8_t pmi_bitlen = 0; NR_CSI_ReportConfig_t *csirep = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; int period, offset; @@ -1091,6 +1117,23 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, cumul_bits += pmi_bitlen; evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); break; + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI: + cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; + if(cri_bitlen) + evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl); + cumul_bits += cri_bitlen; + ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen; + if(ri_bitlen) + r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl); + cumul_bits += ri_bitlen; + li_bitlen = evaluate_li_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + cumul_bits += li_bitlen; + if (r_index != -1) + skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); + pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + cumul_bits += pmi_bitlen; + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + break; default: AssertFatal(1==0, "Invalid or not supported CSI measurement report\n"); } From c114c245de046a85082ee393178cdc58569a5b11 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 4 Jun 2021 18:19:54 +0200 Subject: [PATCH 005/883] adding rrc parameter csi-ReportingBand --- openair2/RRC/NR/rrc_gNB_reconfig.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 50b8ff308c..1738575ecb 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1236,7 +1236,12 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco *csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator)); *csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; - csirep1->reportFreqConfiguration->csi_ReportingBand=NULL; + csirep1->reportFreqConfiguration->csi_ReportingBand = calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand)); + csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands14.bits_unused=1; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands14.buf=malloc(1); + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands14.buf[0]=254; csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig)); @@ -1262,7 +1267,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); *csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; csirep1->cqi_Table = NULL; - csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value1; + csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; csirep1->non_PMI_PortIndication = NULL; csirep1->ext1 = NULL; From 4819b14671742eb1291cb956409608c9b86e9cc8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 7 Jun 2021 17:36:16 +0200 Subject: [PATCH 006/883] bitlen for typeI single panel --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 205 +++++++++++++++++- 1 file changed, 203 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index d7480e08e3..5342f82faf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -268,6 +268,202 @@ void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, } +void get_n1n2_o1o2_singlepanel(int *n1, int *n2, int *o1, int *o2, + struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo *morethantwo) { + + // Table 5.2.2.2.1-2 in 38.214 for supported configurations + switch(morethantwo->n1_n2.present){ + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction): + *n1 = 2; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction): + *n1 = 2; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction): + *n1 = 3; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction): + *n1 = 6; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction): + *n1 = 8; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 3; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction): + *n1 = 12; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction): + *n1 = 4; + *n2 = 4; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction): + *n1 = 8; + *n2 = 2; + *o1 = 4; + *o2 = 4; + break; + case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction): + *n1 = 16; + *n2 = 1; + *o1 = 4; + *o2 = 1; + break; + default: + AssertFatal(1==0,"Not supported configuration for n1_n2 in codebook configuration"); + } +} + +void get_x1x2_bitlen_singlepanel(int n1, int n2, int o1, int o2, + int *x1, int *x2, int rank, int codebook_mode) { + + // Table 6.3.1.1.2-1 in 38.212 + switch(rank){ + case 1: + if(n2>1) { + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 2; + } + else { + *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2)); + *x2 = 4; + } + } + else{ + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 2; + } + else { + *x1 = ceil(log2(n1*o1/2)); + *x2 = 4; + } + } + break; + case 2: + if(n1*n2 == 2) { + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + } + else { + *x1 = ceil(log2(n1*o1/2)); + *x2 = 3; + } + *x1 += 1; + } + else { + if(n2>1) { + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 3; + } + else { + *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2)); + *x2 = 3; + } + } + else{ + if (codebook_mode == 1) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + } + else { + *x1 = ceil(log2(n1*o1/2)); + *x2 = 3; + } + } + *x1 += 2; + } + break; + case 3: + case 4: + if(n1*n2 == 2) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + } + else { + if(n1*n2 >= 8) { + *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2)) + 2; + *x2 = 1; + } + else { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)) + 2; + *x2 = 1; + } + } + break; + case 5: + case 6: + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + break; + case 7: + case 8: + if(n1 == 4 && n2 == 1) { + *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2)); + *x2 = 1; + } + else { + if(n1 > 2 && n2 == 2) { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2/2)); + *x2 = 1; + } + else { + *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)); + *x2 = 1; + } + } + break; + default: + AssertFatal(1==0,"Invalid rank in x1 x2 bit length computation\n"); + } +} + + void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, uint8_t ri_restriction, nr_csi_report_t *csi_report){ @@ -288,8 +484,13 @@ void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig, if (i==1) csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=1; } - else - AssertFatal(1==0,"More than 2 port not yet implemented\n"); + else { // more than two + int n1,n2,o1,o2,x1,x2; + get_n1n2_o1o2_singlepanel(&n1,&n2,&o1,&o2,codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo); + get_x1x2_bitlen_singlepanel(n1,n2,o1,o2,&x1,&x2,i+1,codebookConfig->codebookType.choice.type1->codebookMode); + csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=x1; + csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=x2; + } } else AssertFatal(1==0,"Type1 Multi-panel Codebook Config not yet implemented\n"); From 601381cb44676a509e6b0f8188275f4154a57dff Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 8 Jun 2021 08:47:55 +0200 Subject: [PATCH 007/883] another tentative change of configuration for 2 port CSI --- openair2/RRC/NR/rrc_gNB_reconfig.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 1738575ecb..c656c47e67 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1159,7 +1159,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; resourceMapping.density.choice.one = (NULL_t)0; resourceMapping.freqBand.startingRB = 0; - resourceMapping.freqBand.nrofRBs = 104; + resourceMapping.freqBand.nrofRBs = 108; nzpcsi0->resourceMapping = resourceMapping; nzpcsi0->powerControlOffset = 0; nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); @@ -1264,9 +1264,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csirep1->dummy = NULL; csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); - csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); - *csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; - csirep1->cqi_Table = NULL; + //csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); + //*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; + csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table)); + *csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; csirep1->non_PMI_PortIndication = NULL; csirep1->ext1 = NULL; From 3dbf4e94cb0278c4ee8497068428e4189b814779 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Sun, 30 May 2021 23:14:12 +0200 Subject: [PATCH 008/883] handling for UL failure. added do_precoding flag to nr-ru procedures. testing with 2x2 N310. --- executables/nr-gnb.c | 2 +- executables/nr-ru.c | 1 + openair1/PHY/INIT/nr_init_ru.c | 3 +- openair1/PHY/NR_TRANSPORT/nr_ulsch.c | 2 +- openair1/SCHED_NR/nr_ru_procedures.c | 24 +- openair2/COMMON/rrc_messages_types.h | 1 + openair2/ENB_APP/enb_paramdef.h | 6 +- openair2/F1AP/f1ap_cu_ue_context_management.c | 66 ++-- openair2/F1AP/f1ap_du_ue_context_management.c | 31 +- openair2/GNB_APP/gnb_config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 59 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 1 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 7 +- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 +- openair2/RRC/NR/L2_nr_interface.c | 22 +- openair2/RRC/NR/rrc_gNB.c | 291 +++++++++++++++++- openair2/RRC/NR/rrc_gNB_NGAP.c | 16 + openair2/RRC/NR/rrc_gNB_NGAP.h | 4 + targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 80 ++--- 21 files changed, 501 insertions(+), 121 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index ea675eba9e..0665db8810 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -356,7 +356,7 @@ void *nrL1_stats_thread(void *param) { while (!oai_exit) { sleep(1); fd=fopen("nrL1_stats.log","w"); - AssertFatal(fd!=NULL,"Cannot open ngL1_stats.log\n"); + AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n"); dump_nr_I0_stats(fd,gNB); dump_pusch_stats(fd,gNB); // nr_dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx); diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 421ff4ad3e..b75e5c2247 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -2049,6 +2049,7 @@ static void NRRCconfig_RU(void) RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr); RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr); + RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr); if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) { RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt; diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index 8189a7ab34..5de9d7f495 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -138,8 +138,9 @@ int nr_phy_init_RU(RU_t *ru) { ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); for (j=0; jnb_tx; j++) { ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); + AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i); for (re=0; reofdm_symbol_size; re++) - ru->beam_weights[i][p][j][re] = ru->bw_list[j][l_ind]; + ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind]; //printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j); l_ind++; } // for j diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c index 53ff90404b..35169303ec 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c @@ -150,7 +150,7 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) { gNB->ulsch_stats[i].rnti, aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10, aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10); - else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n", + else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d ulsch_noise_power[%d] %d.%d\n", aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10, aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10); diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index c8042ecec3..d858a8a641 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -197,18 +197,17 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+j , 1); start_meas(&ru->txdataF_copy_stats); - if (ru->num_gNB == 1){ - gNB = ru->gNB_list[0]; - cfg = &gNB->gNB_config; + AssertFatal(ru->num_gNB==1,"num_gNB>1, help\n"); + gNB = ru->gNB_list[0]; + cfg = &gNB->gNB_config; - for(i=0; inb_tx; ++i){ - memcpy((void*)&ru->common.txdataF[i][j*fp->ofdm_symbol_size], - (void*)&gNB->common_vars.txdataF[i][j*fp->ofdm_symbol_size + txdataF_offset], - fp->ofdm_symbol_size*sizeof(int32_t)); + for(i=0; inb_tx; ++i){ + memcpy((void*)&ru->common.txdataF[i][j*fp->ofdm_symbol_size], + (void*)&gNB->common_vars.txdataF[i][j*fp->ofdm_symbol_size + txdataF_offset], + fp->ofdm_symbol_size*sizeof(int32_t)); - } + } - }//num_gNB == 1 stop_meas(&ru->txdataF_copy_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+j , 0); @@ -317,6 +316,13 @@ static void *nr_feptx_thread(void *param) { (void*)&ru->gNB_list[0]->common_vars.txdataF[0][txdataF_offset + l*fp->ofdm_symbol_size], (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); } + else if (ru->do_precoding == 0) { + int gNB_tx = ru->gNB_list[0]->frame_parms.nb_antennas_tx; + for (int aa=0;aanb_tx;aa++) + memcpy((void*)&ru->common.txdataF_BF[aa][l*fp->ofdm_symbol_size], + (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], + (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); + } else { bw = ru->beam_weights[0]; for(i=0; isymbols_per_slot>>1; ++i){ diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 64c42eaf0e..220ef60b3d 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -405,6 +405,7 @@ typedef struct NRRrcConfigurationReq_s { uint16_t mcc[PLMN_LIST_MAX_SIZE]; uint16_t mnc[PLMN_LIST_MAX_SIZE]; uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE]; + uint8_t num_plmn; NR_ServingCellConfigCommon_t *scc; NR_ServingCellConfig_t *scd; int ssb_SubcarrierOffset; diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index f26863414c..79e66881b5 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -98,6 +98,7 @@ typedef enum { #define CONFIG_STRING_RU_BF_WEIGHTS_LIST "bf_weights" #define CONFIG_STRING_RU_IF_FREQUENCY "if_freq" #define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset" +#define CONFIG_STRING_RU_DO_PRECODING "do_precoding" #define RU_LOCAL_IF_NAME_IDX 0 #define RU_LOCAL_ADDRESS_IDX 1 @@ -127,7 +128,7 @@ typedef enum { #define RU_BF_WEIGHTS_LIST_IDX 25 #define RU_IF_FREQUENCY 26 #define RU_IF_FREQ_OFFSET 27 - +#define RU_DO_PRECODING 28 /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -160,7 +161,8 @@ typedef enum { {CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \ {CONFIG_STRING_RU_BF_WEIGHTS_LIST, NULL, 0, iptr:NULL, defintarrayval:DEFBFW, TYPE_INTARRAY, 0}, \ {CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \ - {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c index 317f0058b2..da723ba5a3 100644 --- a/openair2/F1AP/f1ap_cu_ue_context_management.c +++ b/openair2/F1AP/f1ap_cu_ue_context_management.c @@ -39,8 +39,10 @@ #include "rrc_extern.h" #include "rrc_eNB_UE_context.h" +#include "openair2/RRC/NR/rrc_gNB_UE_context.h" #include "rrc_eNB_S1AP.h" #include "rrc_eNB_GTPV1U.h" +#include "openair2/RRC/NR/rrc_gNB_NGAP.h" extern f1ap_setup_req_t *f1ap_du_data_from_du; extern f1ap_cudu_inst_t f1ap_cu_inst[MAX_eNB]; @@ -1029,35 +1031,55 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, // F1AP_CriticalityDiagnostics_IE_List } - struct rrc_eNB_ue_context_s *ue_context_p = - rrc_eNB_get_ue_context(RC.rrc[instance], rnti); protocol_ctxt_t ctxt; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, instance, ENB_FLAG_YES, rnti, 0, 0, instance); - if (ue_context_p) { - /* The following is normally done in the function rrc_rx_tx() */ - rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance, - ue_context_p->ue_context.eNB_ue_s1ap_id); + if (RC.nrrrc[instance]->node_type == ngran_gNB_CU) { + struct rrc_gNB_ue_context_s *ue_context_p = + rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti); - rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(instance, ue_context_p); - // erase data of GTP tunnels in UE context - for (int e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) { - ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0; - memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab], - 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab])); - ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0; + if (ue_context_p) { + MessageDef *msg = itti_alloc_new_message(TASK_CU_F1, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE); + NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = ue_context_p->ue_context.gNB_ue_ngap_id; + itti_send_msg_to_task(TASK_NGAP, instance, msg); + + rrc_gNB_remove_ue_context(&ctxt, RC.nrrrc[instance], ue_context_p); + } else { + LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti); } +#ifdef ITTI_SIM + return 0; +#endif - struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids = - rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0, - ue_context_p->ue_context.eNB_ue_s1ap_id); - if (rrc_ue_s1ap_ids) - rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids); - - /* trigger UE release in RRC */ - rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p); } else { - LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti); + struct rrc_eNB_ue_context_s *ue_context_p = + rrc_eNB_get_ue_context(RC.rrc[instance], rnti); + + if (ue_context_p) { + /* The following is normally done in the function rrc_rx_tx() */ + rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(instance, + ue_context_p->ue_context.eNB_ue_s1ap_id); + + rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(instance, ue_context_p); + // erase data of GTP tunnels in UE context + for (int e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) { + ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0; + memset(&ue_context_p->ue_context.enb_gtp_addrs[e_rab], + 0, sizeof(ue_context_p->ue_context.enb_gtp_addrs[e_rab])); + ue_context_p->ue_context.enb_gtp_ebi[e_rab] = 0; + } + + struct rrc_ue_s1ap_ids_s *rrc_ue_s1ap_ids = + rrc_eNB_S1AP_get_ue_ids(RC.rrc[instance], 0, + ue_context_p->ue_context.eNB_ue_s1ap_id); + if (rrc_ue_s1ap_ids) + rrc_eNB_S1AP_remove_ue_ids(RC.rrc[instance], rrc_ue_s1ap_ids); + + /* trigger UE release in RRC */ + rrc_eNB_remove_ue_context(&ctxt, RC.rrc[instance], ue_context_p); + } else { + LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti); + } } pdcp_remove_UE(&ctxt); diff --git a/openair2/F1AP/f1ap_du_ue_context_management.c b/openair2/F1AP/f1ap_du_ue_context_management.c index b79e9feb58..2a26762179 100644 --- a/openair2/F1AP/f1ap_du_ue_context_management.c +++ b/openair2/F1AP/f1ap_du_ue_context_management.c @@ -38,6 +38,8 @@ #include "rrc_extern.h" #include "rrc_eNB_UE_context.h" +#include "openair2/RRC/NR/rrc_gNB_UE_context.h" +#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" // undefine C_RNTI from // openair1/PHY/LTE_TRANSPORT/transport_common.h which @@ -664,11 +666,21 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, rnti, ctxt.rnti); int UE_out_of_sync = 0; - for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) { - if (RC.mac[instance]->UE_info.active[n] == TRUE - && rnti == UE_RNTI(instance, n)) { - UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync; - break; + if (RC.nrrrc[instance]->node_type == ngran_gNB_DU) { + for (int n = 0; n < MAX_MOBILES_PER_GNB; ++n) { + if (RC.nrmac[instance]->UE_info.active[n] == TRUE + && rnti == RC.nrmac[instance]->UE_info.rnti[n]) { + UE_out_of_sync = 0; + break; + } + } + } else { + for (int n = 0; n < MAX_MOBILES_PER_ENB; ++n) { + if (RC.mac[instance]->UE_info.active[n] == TRUE + && rnti == UE_RNTI(instance, n)) { + UE_out_of_sync = RC.mac[instance]->UE_info.UE_sched_ctrl[n].ul_out_of_sync; + break; + } } } @@ -718,6 +730,15 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, } } + if (RC.nrrrc[instance]->node_type == ngran_gNB_DU) { + // struct rrc_gNB_ue_context_s *ue_context_p; + + f1ap_ue_context_release_cplt_t cplt; + cplt.rnti = ctxt.rnti; + DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance, &cplt); + return 0; + } + struct rrc_eNB_ue_context_s *ue_context_p; ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id], ctxt.rnti); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 456d7cd6de..94337ecb58 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1028,7 +1028,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n", PLMNParamList.numelt); - RRC_CONFIGURATION_REQ(msg_p).num_plmn = PLMNParamList.numelt; + NRRRC_CONFIGURATION_REQ(msg_p).num_plmn = PLMNParamList.numelt; for (int l = 0; l < PLMNParamList.numelt; ++l) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index b40e411812..f17c93210e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -55,55 +55,56 @@ #include "nfapi/oai_integration/vendor_ext.h" #include "executables/nr-softmodem.h" +#include +#include + uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 }; void clear_mac_stats(gNB_MAC_INST *gNB) { memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t)); } - +#define MACSTATSSTRLEN 16384 void dump_mac_stats(gNB_MAC_INST *gNB) { NR_UE_info_t *UE_info = &gNB->UE_info; int num = 1; + FILE *fd=fopen("nrMAC_stats.log","w"); + AssertFatal(fd!=NULL,"Cannot open nrMAC_stats.log, error %s\n",strerror(errno)); + char output[MACSTATSSTRLEN]; + memset(output,0,MACSTATSSTRLEN); + int stroff=0; for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { - LOG_I(NR_MAC, "UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n", - UE_id, - UE_info->rnti[UE_id], - num++, - UE_info->num_UEs, - UE_info->UE_sched_ctrl[UE_id].ph, - UE_info->UE_sched_ctrl[UE_id].pcmax); + stroff = sprintf(output,"UE ID %d RNTI %04x (%d/%d)\n", UE_id, UE_info->rnti[UE_id], num++, UE_info->num_UEs); NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0; - LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n", - UE_id, - stats->dlsch_rounds[0], stats->dlsch_rounds[1], - stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, - avg_rsrp, stats->num_rsrp_meas); + stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n", + UE_id, + stats->dlsch_rounds[0], stats->dlsch_rounds[1], + stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, + avg_rsrp, stats->num_rsrp_meas); stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0 ; - LOG_I(NR_MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); - const NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d, PUSCH SNR %2.1f dB, PUCCH SNR %2.1f dB, noise rssi %2.1f dB\n", - UE_id, - stats->ulsch_rounds[0], stats->ulsch_rounds[1], - stats->ulsch_rounds[2], stats->ulsch_rounds[3], - stats->ulsch_errors, - (float) sched_ctrl->pusch_snrx10 / 10, - (float) sched_ctrl->pucch_snrx10 / 10, - (float) (sched_ctrl->raw_rssi - 1280) / 10); - LOG_I(NR_MAC, - "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", - UE_id, - stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); + stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); + stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n", + UE_id, + stats->ulsch_rounds[0], stats->ulsch_rounds[1], + stats->ulsch_rounds[2], stats->ulsch_rounds[3], + stats->ulsch_DTX, + stats->ulsch_errors); + stroff+=sprintf(output+stroff, + "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", + UE_id, + stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); for (int lc_id = 0; lc_id < 63; lc_id++) { if (stats->lc_bytes_tx[lc_id] > 0) - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); if (stats->lc_bytes_rx[lc_id] > 0) - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); } } print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL); + if (stroff>0) fprintf(fd,"%s",output); + fclose(fd); } void clear_nr_nfapi_information(gNB_MAC_INST * gNB, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 5850d26f8b..14ade4fb4b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -574,6 +574,7 @@ void pf_dl(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; + if (sched_ctrl->ul_failure==1) continue; /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bf444f7037..594031f124 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -659,6 +659,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { LOG_D(NR_MAC,"Detected UL Failure on PUSCH, stopping scheduling\n"); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; + nr_mac_eNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } } } else if(sduP) { diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 2d194cd16b..8d17e7100d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -609,6 +609,7 @@ typedef struct { int dlsch_current_bytes; int ulsch_rounds[8]; int ulsch_errors; + int ulsch_DTX; int ulsch_total_bytes_scheduled; int ulsch_total_bytes_rx; int ulsch_current_bytes; diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 8278a494be..9a467aea47 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -890,7 +890,7 @@ boolean_t nr_rrc_pdcp_config_asn1_req( //ctxt_pP->configured != 2 || //srb2add_list == NULL || //drb2add_list != NULL || - drb2release_list != NULL || + //drb2release_list != NULL || //security_modeP != 255 || //kRRCenc != NULL || //kRRCint != NULL || @@ -919,6 +919,10 @@ boolean_t nr_rrc_pdcp_config_asn1_req( if (kRRCint != NULL) { /* todo */ } + + if (drb2release_list != NULL) { + // TODO + } free(kRRCenc); free(kRRCint); @@ -1184,6 +1188,7 @@ static boolean_t pdcp_data_req_drb( if (rb == NULL) { LOG_E(PDCP, "%s:%d:%s: no DRB found (rnti %d, rb_id %ld)\n", __FILE__, __LINE__, __FUNCTION__, rnti, rb_id); + nr_pdcp_manager_unlock(nr_pdcp_ue_manager); return 0; } diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 16b16cd44d..896ea35c46 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -918,7 +918,7 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt if (drb2release_listP != NULL) { LOG_E(RLC, "%s:%d:%s: TODO\n", __FILE__, __LINE__, __FUNCTION__); - exit(1); + //exit(1); } if (srb2add_listP != NULL) { diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index 2f7da79185..bef5c52316 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -361,4 +361,24 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, } return 0; -} \ No newline at end of file +} + +void nr_mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, + const int CC_idP, + const frame_t frameP, + const sub_frame_t subframeP, + const rnti_t rntiP) { + struct rrc_gNB_ue_context_s *ue_context_p = NULL; + ue_context_p = rrc_gNB_get_ue_context( + RC.nrrrc[Mod_instP], + rntiP); + + if (ue_context_p != NULL) { + LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP); + + if(ue_context_p->ue_context.ul_failure_timer == 0) + ue_context_p->ue_context.ul_failure_timer=1; + } else { + LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP); + } +} diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 0920b7ed17..1a1f892c87 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -2770,9 +2770,291 @@ void rrc_gNB_process_dc_overall_timeout(const module_id_t gnb_mod_idP, x2ap_ENDC rrc_remove_nsa_user(rrc, m->rnti); } +unsigned int mask_flip(unsigned int x) { + return((((x>>8) + (x<<8))&0xffff)>>6); +} + +unsigned int get_dl_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + + + int common_band = *rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if (bandNRinfo->bandNR == common_band) { + if (common_band < 257) { // FR1 + switch (common_scs) { + case NR_SubcarrierSpacing_kHz15 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr1 && + bandNRinfo->channelBWs_DL->choice.fr1->scs_15kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr1->scs_15kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz30 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr1 && + bandNRinfo->channelBWs_DL->choice.fr1->scs_30kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr1->scs_30kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz60 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr1 && + bandNRinfo->channelBWs_DL->choice.fr1->scs_60kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr1->scs_60kHz->buf)); + break; + } + } + else { + switch (common_scs) { + case NR_SubcarrierSpacing_kHz60 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr2 && + bandNRinfo->channelBWs_DL->choice.fr2->scs_60kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr2->scs_60kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz120 : + if (bandNRinfo->channelBWs_DL && + bandNRinfo->channelBWs_DL->choice.fr2 && + bandNRinfo->channelBWs_DL->choice.fr2->scs_120kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_DL->choice.fr2->scs_120kHz->buf)); + break; + } + } + } + } + return(0); +} + +unsigned int get_ul_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + + + int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]; + int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if (bandNRinfo->bandNR == common_band) { + if (common_band < 257) { // FR1 + switch (common_scs) { + case NR_SubcarrierSpacing_kHz15 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr1 && + bandNRinfo->channelBWs_UL->choice.fr1->scs_15kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr1->scs_15kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz30 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr1 && + bandNRinfo->channelBWs_UL->choice.fr1->scs_30kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr1->scs_30kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz60 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr1 && + bandNRinfo->channelBWs_UL->choice.fr1->scs_60kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr1->scs_60kHz->buf)); + break; + } + } + else { + switch (common_scs) { + case NR_SubcarrierSpacing_kHz60 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr2 && + bandNRinfo->channelBWs_UL->choice.fr2->scs_60kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr2->scs_60kHz->buf)); + break; + case NR_SubcarrierSpacing_kHz120 : + if (bandNRinfo->channelBWs_UL && + bandNRinfo->channelBWs_UL->choice.fr2 && + bandNRinfo->channelBWs_UL->choice.fr2->scs_120kHz) + return(mask_flip((unsigned int)*(uint16_t*)bandNRinfo->channelBWs_UL->choice.fr2->scs_120kHz->buf)); + break; + } + } + } + } + return(0); +} + +int is_dl_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_band = *rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + if (common_band>256) { + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if (bandNRinfo->bandNR == common_band && !bandNRinfo->pdsch_256QAM_FR2) return (0); + } + } + else if (cap->phy_Parameters.phy_ParametersFR1 && !cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1) return(0); + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through DL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsDownlinkPerCC->list.count;i++) { + if (fs->featureSetsDownlinkPerCC->list.array[i]->supportedSubcarrierSpacingDL == common_scs && + fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL && + *fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL == NR_ModulationOrder_qam256) return(1); + } + } + return(0); +} + +int is_ul_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]; + int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if (bandNRinfo->bandNR == common_band && !bandNRinfo->pusch_256QAM) return (0); + } + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through UL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsUplinkPerCC->list.count;i++) { + if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && + fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL && + *fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL == NR_ModulationOrder_qam256) return(1); + } + } + return(0); +} + +int get_ul_mimo_layersCB(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through UL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsUplinkPerCC->list.count;i++) { + if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && + fs->featureSetsUplinkPerCC->list.array[i]->mimo_CB_PUSCH && + fs->featureSetsUplinkPerCC->list.array[i]->mimo_CB_PUSCH->maxNumberMIMO_LayersCB_PUSCH) + return(1<<*fs->featureSetsUplinkPerCC->list.array[i]->mimo_CB_PUSCH->maxNumberMIMO_LayersCB_PUSCH); + } + } + return(1); +} + +int get_ul_mimo_layers(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through UL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsUplinkPerCC->list.count;i++) { + if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && + fs->featureSetsUplinkPerCC->list.array[i]->maxNumberMIMO_LayersNonCB_PUSCH) + return(1<<*fs->featureSetsUplinkPerCC->list.array[i]->maxNumberMIMO_LayersNonCB_PUSCH); + } + } + return(1); +} + +int get_dl_mimo_layers(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { + int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + if (fs) { + // go through UL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsDownlinkPerCC->list.count;i++) { + if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && + fs->featureSetsDownlinkPerCC->list.array[i]->maxNumberMIMO_LayersPDSCH) + return(2<<*fs->featureSetsDownlinkPerCC->list.array[i]->maxNumberMIMO_LayersPDSCH); + } + } + return(1); +} void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { MessageDef *msg; + rrc_gNB_ue_context_t *ue_context_p = NULL; + FILE *fd=fopen("nrRRCstats.log","w"); + RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[ctxt_pP->module_id]->rrc_ue_head)) { + ctxt_pP->rnti = ue_context_p->ue_id_rnti; + + if (fd) { + if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) { + fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", + ue_context_p->ue_id_rnti, + ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi, + ue_context_p->ue_context.ul_failure_timer); + } else { + fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", + ue_context_p->ue_id_rnti, + ue_context_p->ue_context.ul_failure_timer); + } + + if (ue_context_p->ue_context.UE_Capability_nr) { + fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", + get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), + get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), + is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", + is_ul_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", + get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), + get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), + get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr)); + } + } + if (ue_context_p->ue_context.ul_failure_timer > 0) { + ue_context_p->ue_context.ul_failure_timer++; + + if (ue_context_p->ue_context.ul_failure_timer >= 20000) { + // remove UE after 20 seconds after MAC (or else) has indicated UL failure + LOG_I(RRC, "Removing UE %x instance, because of uplink failure timer timeout\n", + ue_context_p->ue_context.rnti); + if(ue_context_p->ue_context.StatusRrc >= NR_RRC_CONNECTED){ + rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( + ctxt_pP->module_id, + ue_context_p, + NGAP_CAUSE_RADIO_NETWORK, + 30); + }else{ + mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); + rrc_rlc_remove_ue(ctxt_pP); + pdcp_remove_UE(ctxt_pP); + + /* remove RRC UE Context */ + ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); + if (ue_context_p) { + rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p); + LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); + } + } + break; // break RB_FOREACH + } + } + + if (ue_context_p->ue_context.ue_release_timer_rrc > 0) { + ue_context_p->ue_context.ue_release_timer_rrc++; + + if (ue_context_p->ue_context.ue_release_timer_rrc >= ue_context_p->ue_context.ue_release_timer_thres_rrc) { + LOG_I(NR_RRC, "Removing UE %x instance after UE_CONTEXT_RELEASE_Complete (ue_release_timer_rrc timeout)\n", + ue_context_p->ue_context.rnti); + ue_context_p->ue_context.ue_release_timer_rrc = 0; + + mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); + rrc_rlc_remove_ue(ctxt_pP); + pdcp_remove_UE(ctxt_pP); + + /* remove RRC UE Context */ + ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); + if (ue_context_p) { + rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p); + LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); + } + + break; // break RB_FOREACH + } + } + } + + fclose(fd); + /* send a tick to x2ap */ if (is_x2ap_enabled()){ msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_SUBFRAME_PROCESS); @@ -3210,6 +3492,8 @@ rrc_gNB_generate_RRCRelease( size = do_NR_RRCRelease(buffer,rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id)); ue_context_pP->ue_context.ue_reestablishment_timer = 0; ue_context_pP->ue_context.ue_release_timer = 0; + ue_context_pP->ue_context.ul_failure_timer = 0; + ue_context_pP->ue_context.ue_release_timer_rrc = 0; LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate RRCRelease (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -3243,11 +3527,13 @@ rrc_gNB_generate_RRCRelease( itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p); #else if (NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) { + uint8_t *message_buffer = itti_malloc (TASK_RRC_GNB, TASK_CU_F1, size); + memcpy (message_buffer, buffer, size); MessageDef *m = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_RELEASE_CMD); F1AP_UE_CONTEXT_RELEASE_CMD(m).rnti = ctxt_pP->rnti; F1AP_UE_CONTEXT_RELEASE_CMD(m).cause = F1AP_CAUSE_RADIO_NETWORK; F1AP_UE_CONTEXT_RELEASE_CMD(m).cause_value = 10; // 10 = F1AP_CauseRadioNetwork_normal_release - F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container = buffer; + F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container = message_buffer; F1AP_UE_CONTEXT_RELEASE_CMD(m).rrc_container_length = size; itti_send_msg_to_task(TASK_CU_F1, ctxt_pP->module_id, m); } else { @@ -3258,6 +3544,9 @@ rrc_gNB_generate_RRCRelease( size, buffer, PDCP_TRANSMISSION_MODE_CONTROL); + + rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(ctxt_pP->instance, ue_context_pP->ue_context.gNB_ue_ngap_id); + ue_context_pP->ue_context.ue_release_timer_rrc = 1; } #endif } diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 619880da59..dba5a2f2dc 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -735,6 +735,7 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( struct rrc_gNB_ue_context_s *ue_context_p = NULL; protocol_ctxt_t ctxt; memset(&ctxt, 0, sizeof(protocol_ctxt_t)); + ue_initial_id = NGAP_DOWNLINK_NAS (msg_p).ue_initial_id; gNB_ue_ngap_id = NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id; ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, ue_initial_id, gNB_ue_ngap_id); @@ -823,6 +824,7 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( { // rrc_mac_config_req_gNB #ifdef ITTI_SIM + MessageDef *message_p; uint8_t *message_buffer; message_buffer = itti_malloc (TASK_RRC_GNB, TASK_RRC_UE_SIM, length); memcpy (message_buffer, buffer, length); @@ -1174,11 +1176,25 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND( return -1; } else { ue_context_p->ue_context.ue_release_timer_ng = 0; + ue_context_p->ue_context.ue_release_timer_thres_rrc = 1000; PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0); + ctxt.eNB_index = 0; rrc_gNB_generate_RRCRelease(&ctxt, ue_context_p); return 0; } } + +void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE( + instance_t instance, + uint32_t gNB_ue_ngap_id) { + MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_NGAP_GNB, NULL, 0, + "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" ", + gNB_ue_ngap_id); + MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE); + NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = gNB_ue_ngap_id; + itti_send_msg_to_task(TASK_NGAP, instance, msg); +} + //------------------------------------------------------------------------------ /* * Remove UE ids (ue_initial_id and ng_id) from hashtables. diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.h b/openair2/RRC/NR/rrc_gNB_NGAP.h index f13c468f94..8779d62ff6 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.h +++ b/openair2/RRC/NR/rrc_gNB_NGAP.h @@ -129,6 +129,10 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND( instance_t instance ); +void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE( + instance_t instance, + uint32_t gNB_ue_ngap_id); + void rrc_gNB_NGAP_remove_ue_ids( gNB_RRC_INST *const rrc_instance_pP, diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index fd4a830a02..f56e4e6400 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -647,69 +647,57 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp default: AssertFatal(1==0,"Shouldn't be here\n"); } - if (cc>1) { + + samples_received=0; + while (samples_received != nsamps) { + + if (cc>1) { // receive multiple channels (e.g. RF A and RF B) std::vector buff_ptrs; - samples_received=0; - - while (samples_received != nsamps) { - for (int i=0; irx_stream->recv(buff_ptrs,nsamps-samples_received, s->rx_md); - - - if ((s->wait_for_first_pps == 0) && (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE)) - break; - - if ((s->wait_for_first_pps == 1) && (samples_received != nsamps)) { - printf("sleep...\n"); //usleep(100); - } - } - if (samples_received == nsamps) s->wait_for_first_pps=0; - } else { + for (int i=0; irx_stream->recv(buff_ptrs, nsamps, s->rx_md); + } else { // receive a single channel (e.g. from connector RF A) - samples_received=0; - while (samples_received != nsamps) { - samples_received += s->rx_stream->recv((void*)((int32_t*)buff_tmp[0]+samples_received), - nsamps-samples_received, s->rx_md); - - if ((s->wait_for_first_pps == 0) && (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE)) - break; - - if ((s->wait_for_first_pps == 1) && (samples_received != nsamps)) { - printf("sleep...\n"); //usleep(100); - } - } - if (samples_received == nsamps) s->wait_for_first_pps=0; + samples_received += s->rx_stream->recv((void*)((int32_t*)buff_tmp[0]+samples_received), + nsamps-samples_received, s->rx_md); } + if ((s->wait_for_first_pps == 0) && (s->rx_md.error_code!=uhd::rx_metadata_t::ERROR_CODE_NONE)) + break; - // bring RX data into 12 LSBs for softmodem RX - for (int i=0; iwait_for_first_pps == 1) && (samples_received != nsamps)) { + printf("sleep...\n"); //usleep(100); + } + } + if (samples_received == nsamps) s->wait_for_first_pps=0; + + // bring RX data into 12 LSBs for softmodem RX + for (int i=0; irx_md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE) LOG_E(HW, "%s\n", s->rx_md.to_pp_string(true).c_str()); From 3e8bc05bdf7bd5eb7af12b60f300eab9c40b950a Mon Sep 17 00:00:00 2001 From: Eurecom Date: Tue, 1 Jun 2021 09:48:20 +0200 Subject: [PATCH 009/883] testing with 2x2 and 4x4 with N310, small modifications in nr_ru_procedures and usrp_lib.cpp for multiple antennas --- executables/nr-ru.c | 2 + openair1/PHY/INIT/nr_init_ru.c | 56 ++++++++++---------- openair1/SCHED_NR/nr_ru_procedures.c | 26 ++++----- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 18 +++---- 4 files changed, 53 insertions(+), 49 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index b75e5c2247..56d868f62e 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1374,6 +1374,7 @@ void *ru_thread( void *param ) { } } + // At this point, all information for subframe has been received on FH interface res = pullTpool(gNB->resp_L1, gNB->threadPool); syncMsg = (processingData_L1_t *)NotifiedFifoData(res); @@ -1386,6 +1387,7 @@ void *ru_thread( void *param ) { res->key = proc->tti_rx; pushTpool(gNB->threadPool, res); + } printf( "Exiting ru_thread \n"); diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index 5de9d7f495..9d843241f6 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -122,37 +122,39 @@ int nr_phy_init_RU(RU_t *ru) { ru->num_gNB,NUMBER_OF_gNB_MAX); LOG_I(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB); - - int beam_count = 0; - if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1 - for (p=0;pnb_log_antennas;p++) { - //if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0 - beam_count++; - } - AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx)); - - int l_ind = 0; - for (i=0; inum_gNB; i++) { + + if (ru->do_precoding == 1) { + int beam_count = 0; + if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1 for (p=0;pnb_log_antennas;p++) { + //if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0 + beam_count++; + } + AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx)); + + int l_ind = 0; + for (i=0; inum_gNB; i++) { + for (p=0;pnb_log_antennas;p++) { //if ((fp->L_ssb >> (63-p)) & 0x01) { - ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); - for (j=0; jnb_tx; j++) { - ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); - AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i); - for (re=0; reofdm_symbol_size; re++) - ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind]; + ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); + for (j=0; jnb_tx; j++) { + ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); + AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i); + for (re=0; reofdm_symbol_size; re++) + ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind]; //printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j); - l_ind++; - } // for j - //} - } // for p - } //for i - } + l_ind++; + } // for j + //} + } // for p + } //for i + } - ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*)); - for(i=0; i< ru->nb_tx; ++i) { - ru->common.beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t)); - memset(ru->common.beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame); + ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*)); + for(i=0; i< ru->nb_tx; ++i) { + ru->common.beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t)); + memset(ru->common.beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame); + } } } // !=IF5 diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index d858a8a641..c8e047d849 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -302,15 +302,16 @@ static void *nr_feptx_thread(void *param) { ////////////precoding//////////// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 1); - start_meas(&ru->precoding_stats); + if (aa==0 && l==0) start_meas(&ru->precoding_stats); - for(i=0; inb_log_antennas; ++i) { - memcpy((void*) &ru->common.beam_id[i][slot*fp->symbols_per_slot+l], - (void*) &ru->gNB_list[0]->common_vars.beam_id[i][slot*fp->symbols_per_slot+l], - (fp->symbols_per_slot>>1)*sizeof(uint8_t)); + if (ru->do_precoding == 1) { + for(i=0; inb_log_antennas; ++i) { + memcpy((void*) &ru->common.beam_id[i][slot*fp->symbols_per_slot+l], + (void*) &ru->gNB_list[0]->common_vars.beam_id[i][slot*fp->symbols_per_slot+l], + (fp->symbols_per_slot>>1)*sizeof(uint8_t)); + } } - if (ru->nb_tx == 1 && ru->nb_log_antennas == 1) { memcpy((void*)&ru->common.txdataF_BF[0][l*fp->ofdm_symbol_size], (void*)&ru->gNB_list[0]->common_vars.txdataF[0][txdataF_offset + l*fp->ofdm_symbol_size], @@ -318,10 +319,9 @@ static void *nr_feptx_thread(void *param) { } else if (ru->do_precoding == 0) { int gNB_tx = ru->gNB_list[0]->frame_parms.nb_antennas_tx; - for (int aa=0;aanb_tx;aa++) - memcpy((void*)&ru->common.txdataF_BF[aa][l*fp->ofdm_symbol_size], - (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], - (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); + memcpy((void*)&ru->common.txdataF_BF[aa][l*fp->ofdm_symbol_size], + (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], + (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); } else { bw = ru->beam_weights[0]; @@ -337,13 +337,13 @@ static void *nr_feptx_thread(void *param) { txdataF_offset);//here } } - stop_meas(&ru->precoding_stats); + if (aa==0 && l==0) stop_meas(&ru->precoding_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 0); ////////////FEPTX//////////// - start_meas(&ru->ofdm_mod_stats); + if (aa==0 && l==0) start_meas(&ru->ofdm_mod_stats); nr_feptx0(ru,slot,start,fp->symbols_per_slot>>1,aa); - stop_meas(&ru->ofdm_mod_stats); + if (aa==0 && l==0) stop_meas(&ru->ofdm_mod_stats); if (release_thread(&feptx->mutex_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break; diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index f56e4e6400..5f065e406a 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -385,14 +385,14 @@ static int trx_usrp_write(openair0_device *device, #if defined(__x86_64) || defined(__i386__) #ifdef __AVX2__ nsamps2 = (nsamps+7)>>3; - __m256i buff_tx[8][nsamps2]; + __m256i buff_tx[cc<2?2:cc][nsamps2]; #else nsamps2 = (nsamps+3)>>2; - __m128i buff_tx[8][nsamps2]; + __m128i buff_tx[cc<2?2:cc][nsamps2]; #endif #elif defined(__arm__) nsamps2 = (nsamps+3)>>2; - int16x8_t buff_tx[8][nsamps2]; + int16x8_t buff_tx[cc<2?2:cc][nsamps2]; #else #error Unsupported CPU architecture, USRP device cannot be built #endif @@ -523,14 +523,14 @@ void *trx_usrp_write_thread(void * arg){ #if defined(__x86_64) || defined(__i386__) #ifdef __AVX2__ nsamps2 = (nsamps+7)>>3; - __m256i buff_tx[8][nsamps2]; + __m256i buff_tx[cc<2?2:cc][nsamps2]; #else nsamps2 = (nsamps+3)>>2; - __m128i buff_tx[8][nsamps2]; + __m128i buff_tx[cc<2?2:cc][nsamps2]; #endif #elif defined(__arm__) nsamps2 = (nsamps+3)>>2; - int16x8_t buff_tx[8][nsamps2]; + int16x8_t buff_tx[cc<2?2:cc][nsamps2]; #else #error Unsupported CPU architecture, USRP device cannot be built #endif @@ -625,14 +625,14 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp #if defined(__x86_64) || defined(__i386__) #ifdef __AVX2__ nsamps2 = (nsamps+7)>>3; - __m256i buff_tmp[4][nsamps2]; + __m256i buff_tmp[cc<2 ? 2 : cc][nsamps2]; #else nsamps2 = (nsamps+3)>>2; - __m128i buff_tmp[4][nsamps2]; + __m128i buff_tmp[cc<2 ? 2 : cc][nsamps2]; #endif #elif defined(__arm__) nsamps2 = (nsamps+3)>>2; - int16x8_t buff_tmp[4][nsamps2]; + int16x8_t buff_tmp[cc<2 ? 2 : cc][nsamps2]; #endif int rxshift; From 5451db54f1b95a8feeb5b1b2a3b030c7925abcdd Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 9 Jun 2021 15:27:34 +0200 Subject: [PATCH 010/883] RRC configuration for CSI-IM --- openair2/RRC/NR/rrc_gNB_reconfig.c | 40 +++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index f5832e44ce..9727369a2b 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1123,9 +1123,33 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig)); secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig; - csi_MeasConfig->csi_IM_ResourceToAddModList = NULL; + csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList)); + NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0)); + imres0->csi_IM_ResourceId = 0; + imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern)); + imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1; + imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1)); + imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4; + imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6; + imres0->freqBand = calloc(1,sizeof(*imres0->freqBand)); + imres0->freqBand->startingRB = 0; + imres0->freqBand->nrofRBs = 108; + imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset)); + imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; + imres0->periodicityAndOffset->choice.slots320 = 0; + + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0); + + csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList)); + NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0)); + imset0->csi_IM_ResourceSetId = 0; + NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0)); + *res0 = 0; + ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0); + + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0); + csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL; - csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL; csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL; csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); @@ -1212,13 +1236,23 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1); + NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2)); + csires2->csi_ResourceConfigId=2; + csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList; + csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList)); + NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); + *csiim00 = 0; + ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); + csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); csirep1->reportConfigId=0; csirep1->carrier=NULL; csirep1->resourcesForChannelMeasurement=0; - csirep1->csi_IM_ResourcesForInterference=NULL; + csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference)); + *csirep1->csi_IM_ResourcesForInterference=2; csirep1->nzp_CSI_RS_ResourcesForInterference=NULL; csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic)); From 0f5071c166f13af9ce5b6f6a7e05b064fa1aaefd Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 11 Jun 2021 12:06:13 +0200 Subject: [PATCH 011/883] bugfix in zero padding --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ca070e5685..696a05c0bd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1250,8 +1250,7 @@ void skip_zero_padding(int *cumul_bits, csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]+ csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; - cumul_bits+=(max_bitlen-reported_bitlen); - + *cumul_bits+=(max_bitlen-reported_bitlen); } From 71a9ee0c4ecbdec05331473e2d022bd6ff75a4c2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 15 Jun 2021 18:04:06 +0200 Subject: [PATCH 012/883] flexible csi configuration including do_csirs config parameter --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/COMMON/rrc_messages_types.h | 1 + openair2/GNB_APP/gnb_config.c | 2 + openair2/GNB_APP/gnb_paramdef.h | 7 +- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 301 ++++++------ openair2/RRC/NR/nr_rrc_defs.h | 1 + openair2/RRC/NR/nr_rrc_proto.h | 8 +- openair2/RRC/NR/rrc_gNB.c | 1 + openair2/RRC/NR/rrc_gNB_nsa.c | 2 + openair2/RRC/NR/rrc_gNB_reconfig.c | 440 +++++++++++------- 12 files changed, 433 insertions(+), 336 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 54c3a68631..0955588679 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -750,7 +750,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 1c28591aba..e79dc063b3 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -693,7 +693,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 220ef60b3d..ca4011231a 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -411,6 +411,7 @@ typedef struct NRRrcConfigurationReq_s { int ssb_SubcarrierOffset; int pdsch_AntennaPorts; int pusch_AntennaPorts; + int do_CSIRS; int pusch_TargetSNRx10; int pucch_TargetSNRx10; } gNB_RrcConfigurationReq; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 94337ecb58..f0c83715dc 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1045,6 +1045,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; + printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 6d9c9b8342..e2a666c16a 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -116,6 +116,7 @@ typedef enum { #define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset" #define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts" #define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts" +#define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ @@ -140,7 +141,8 @@ typedef enum { {GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_NRCELLID , NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ +{GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_NRCELLID , NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ } #define GNB_GNB_ID_IDX 0 @@ -160,7 +162,8 @@ typedef enum { #define GNB_SSB_SUBCARRIEROFFSET_IDX 14 #define GNB_PDSCH_ANTENNAPORTS_IDX 15 #define GNB_PUSCH_ANTENNAPORTS_IDX 16 -#define GNB_NRCELLID_IDX 17 +#define GNB_DO_CSIRS_IDX 17 +#define GNB_NRCELLID_IDX 18 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 3046bde098..5e5f9e4145 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -376,7 +376,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ssb_SubcarrierOffset, pdsch_AntennaPorts, pusch_AntennaPorts, - scc); + scc); LOG_D(NR_MAC, "%s() %s:%d RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req:%p\n", __FUNCTION__, __FILE__, __LINE__, RC.nrmac[Mod_idP]->if_inst->NR_PHY_config_req); // if in nFAPI mode diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index cdb1045438..ca0c68bf06 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2056,185 +2056,186 @@ void nr_csirs_scheduling(int Mod_idP, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id]; NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; - NR_NZP_CSI_RS_Resource_t *nzpcsi; - int period, offset; - nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; - NR_BWP_Downlink_t *bwp=CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[sched_ctrl->active_bwp->bwp_Id-1]; + if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList != NULL) { - AssertFatal(csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count>0,"NO CSI report configuration available"); + NR_NZP_CSI_RS_Resource_t *nzpcsi; + int period, offset; - for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ - nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; - NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; - csi_period_offset(NULL,nzpcsi,&period,&offset); + nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; + NR_BWP_Downlink_t *bwp=CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[sched_ctrl->active_bwp->bwp_Id-1]; - if((frame*n_slots_frame+slot-offset)%period == 0) { + for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ + nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; + NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; + csi_period_offset(NULL,nzpcsi,&period,&offset); - LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot); + if((frame*n_slots_frame+slot-offset)%period == 0) { - nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; - memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); - dl_tti_csirs_pdu->PDUType = NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE; - dl_tti_csirs_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_csi_rs_pdu)); + LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot); - nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csirs_pdu_rel15 = &dl_tti_csirs_pdu->csi_rs_pdu.csi_rs_pdu_rel15; + nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; + memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); + dl_tti_csirs_pdu->PDUType = NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE; + dl_tti_csirs_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_csi_rs_pdu)); - csirs_pdu_rel15->bwp_size = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); - csirs_pdu_rel15->bwp_start = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); - csirs_pdu_rel15->subcarrier_spacing = bwp->bwp_Common->genericParameters.subcarrierSpacing; - if (bwp->bwp_Common->genericParameters.cyclicPrefix) - csirs_pdu_rel15->cyclic_prefix = *bwp->bwp_Common->genericParameters.cyclicPrefix; - else - csirs_pdu_rel15->cyclic_prefix = 0; + nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csirs_pdu_rel15 = &dl_tti_csirs_pdu->csi_rs_pdu.csi_rs_pdu_rel15; - csirs_pdu_rel15->start_rb = resourceMapping.freqBand.startingRB; - csirs_pdu_rel15->nr_of_rbs = resourceMapping.freqBand.nrofRBs; - csirs_pdu_rel15->csi_type = 1; // NZP-CSI-RS - csirs_pdu_rel15->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain; - if (resourceMapping.firstOFDMSymbolInTimeDomain2) - csirs_pdu_rel15->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2; - csirs_pdu_rel15->cdm_type = resourceMapping.cdm_Type; - csirs_pdu_rel15->freq_density = resourceMapping.density.present; - if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5) - && (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs)) - csirs_pdu_rel15->freq_density--; - csirs_pdu_rel15->scramb_id = nzpcsi->scramblingID; - csirs_pdu_rel15->power_control_offset = nzpcsi->powerControlOffset + 8; - if (nzpcsi->powerControlOffsetSS) - csirs_pdu_rel15->power_control_offset_ss = *nzpcsi->powerControlOffsetSS; - else - csirs_pdu_rel15->power_control_offset_ss = 1; // 0 dB - switch(resourceMapping.frequencyDomainAllocation.present){ - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1: - csirs_pdu_rel15->row = 1; - csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: - csirs_pdu_rel15->row = 2; - csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | - ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: - csirs_pdu_rel15->row = 4; - csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: - csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; - // determining the row of table 7.4.1.5.3-1 in 38.211 - switch(resourceMapping.nrofPorts){ - case NR_CSI_RS_ResourceMapping__nrofPorts_p1: - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p2: - csirs_pdu_rel15->row = 3; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p4: - csirs_pdu_rel15->row = 5; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p8: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { - csirs_pdu_rel15->row = 8; + csirs_pdu_rel15->bwp_size = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); + csirs_pdu_rel15->bwp_start = NRRIV2PRBOFFSET(bwp->bwp_Common->genericParameters.locationAndBandwidth,275); + csirs_pdu_rel15->subcarrier_spacing = bwp->bwp_Common->genericParameters.subcarrierSpacing; + if (bwp->bwp_Common->genericParameters.cyclicPrefix) + csirs_pdu_rel15->cyclic_prefix = *bwp->bwp_Common->genericParameters.cyclicPrefix; + else + csirs_pdu_rel15->cyclic_prefix = 0; + + csirs_pdu_rel15->start_rb = resourceMapping.freqBand.startingRB; + csirs_pdu_rel15->nr_of_rbs = resourceMapping.freqBand.nrofRBs; + csirs_pdu_rel15->csi_type = 1; // NZP-CSI-RS + csirs_pdu_rel15->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain; + if (resourceMapping.firstOFDMSymbolInTimeDomain2) + csirs_pdu_rel15->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2; + csirs_pdu_rel15->cdm_type = resourceMapping.cdm_Type; + csirs_pdu_rel15->freq_density = resourceMapping.density.present; + if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5) + && (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs)) + csirs_pdu_rel15->freq_density--; + csirs_pdu_rel15->scramb_id = nzpcsi->scramblingID; + csirs_pdu_rel15->power_control_offset = nzpcsi->powerControlOffset + 8; + if (nzpcsi->powerControlOffsetSS) + csirs_pdu_rel15->power_control_offset_ss = *nzpcsi->powerControlOffsetSS; + else + csirs_pdu_rel15->power_control_offset_ss = 1; // 0 dB + switch(resourceMapping.frequencyDomainAllocation.present){ + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1: + csirs_pdu_rel15->row = 1; + csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: + csirs_pdu_rel15->row = 2; + csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | + ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: + csirs_pdu_rel15->row = 4; + csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: + csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; + // determining the row of table 7.4.1.5.3-1 in 38.211 + switch(resourceMapping.nrofPorts){ + case NR_CSI_RS_ResourceMapping__nrofPorts_p1: + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p2: + csirs_pdu_rel15->row = 3; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p4: + csirs_pdu_rel15->row = 5; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); - } - else{ - int num_k = 0; - for (int k=0; k<6; k++) - num_k+=(((csirs_pdu_rel15->freq_domain)>>k)&0x01); - if(num_k==4) { - csirs_pdu_rel15->row = 6; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - } - else { - csirs_pdu_rel15->row = 7; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p8: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { + csirs_pdu_rel15->row = 8; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); } - } - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p12: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { - csirs_pdu_rel15->row = 10; + else{ + int num_k = 0; + for (int k=0; k<6; k++) + num_k+=(((csirs_pdu_rel15->freq_domain)>>k)&0x01); + if(num_k==4) { + csirs_pdu_rel15->row = 6; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + } + else { + csirs_pdu_rel15->row = 7; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + } + } + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p12: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { + csirs_pdu_rel15->row = 10; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + } + else { + csirs_pdu_rel15->row = 9; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); + } + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p16: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_pdu_rel15->row = 12; + else + csirs_pdu_rel15->row = 11; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); - } - else { - csirs_pdu_rel15->row = 9; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (1 << csirs_pdu_rel15->symb_l0); - } - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p16: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) - csirs_pdu_rel15->row = 12; - else - csirs_pdu_rel15->row = 11; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p24: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { - csirs_pdu_rel15->row = 14; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); - } - else{ - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { - csirs_pdu_rel15->row = 15; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0); - } - else { - csirs_pdu_rel15->row = 13; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p24: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { + csirs_pdu_rel15->row = 14; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); } - } - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p32: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { - csirs_pdu_rel15->row = 17; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); - } - else{ - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { - csirs_pdu_rel15->row = 18; - for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0); + else{ + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { + csirs_pdu_rel15->row = 15; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0); + } + else { + csirs_pdu_rel15->row = 13; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + } } - else { - csirs_pdu_rel15->row = 16; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p32: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { + csirs_pdu_rel15->row = 17; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); } - } - break; - default: - AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n"); - } - break; - default: - AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); + else{ + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { + csirs_pdu_rel15->row = 18; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= (7 << csirs_pdu_rel15->symb_l0); + } + else { + csirs_pdu_rel15->row = 16; + for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) + vrb_map[rb] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + } + } + break; + default: + AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n"); + } + break; + default: + AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); + } + dl_req->nPDUs++; } - dl_req->nPDUs++; } } } } - bool find_free_CCE(module_id_t module_id, sub_frame_t slot, int UE_id){ diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 5efb2e1e64..d64f3a8eb7 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -447,6 +447,7 @@ typedef struct { int pusch_AntennaPorts; int pusch_TargetSNRx10; int pucch_TargetSNRx10; + int do_CSIRS; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; NR_PDCCH_ConfigSIB1_t *pdcch_ConfigSIB1; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index ff7547832e..a78ee128ff 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -84,15 +84,19 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CellGroupConfig_t *secondaryCellGroup, int scg_id, int servCellIndex, - int n_physical_antenna_ports, + int dl_antenna_ports, + int do_csirs, int initial_csi_index, int uid); +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs); + void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, - int n_physical_antenna_ports, + int dl_antenna_ports, + int do_csirs, int initial_csi_index, int uid); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 1a1f892c87..a3fba59dff 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -330,6 +330,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset; rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts; + rrc->carrier.do_CSIRS = configuration->do_CSIRS; /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); rrc->cell_info_configured = 0; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index e18895e0bd..658b85c245 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -245,6 +245,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, + carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); } else { @@ -253,6 +254,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, + carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); } diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 9727369a2b..05919ce679 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -128,7 +128,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CellGroupConfig_t *secondaryCellGroup, int scg_id, int servCellIndex, - int n_physical_antenna_ports, + int dl_antenna_ports, + int do_csirs, int initial_csi_index, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); @@ -1039,8 +1040,14 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial)); pucchspatial->pucch_SpatialRelationInfoId = 1; pucchspatial->servingCellId = NULL; - pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index; - pucchspatial->referenceSignal.choice.csi_RS_Index = 0; + if(do_csirs) { + pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index; + pucchspatial->referenceSignal.choice.csi_RS_Index = 0; + } + else { + pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index; + pucchspatial->referenceSignal.choice.ssb_Index = 0; + } pucchspatial->pucch_PathlossReferenceRS_Id = 0; pucchspatial->p0_PUCCH_Id = 1; pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0; @@ -1123,76 +1130,56 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig)); secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig; - csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList)); - NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0)); - imres0->csi_IM_ResourceId = 0; - imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern)); - imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1; - imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1)); - imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4; - imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6; - imres0->freqBand = calloc(1,sizeof(*imres0->freqBand)); - imres0->freqBand->startingRB = 0; - imres0->freqBand->nrofRBs = 108; - imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset)); - imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; - imres0->periodicityAndOffset->choice.slots320 = 0; - - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0); - - csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList)); - NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0)); - imset0->csi_IM_ResourceSetId = 0; - NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0)); - *res0 = 0; - ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0); - - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0); + if (do_csirs && dl_antenna_ports > 1) { + csi_MeasConfig->csi_IM_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceToAddModList)); + NR_CSI_IM_Resource_t *imres0 = calloc(1,sizeof(*imres0)); + imres0->csi_IM_ResourceId = 0; + imres0->csi_IM_ResourceElementPattern = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern)); + imres0->csi_IM_ResourceElementPattern->present = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1; + imres0->csi_IM_ResourceElementPattern->choice.pattern1 = calloc(1,sizeof(*imres0->csi_IM_ResourceElementPattern->choice.pattern1)); + imres0->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1 = NR_CSI_IM_Resource__csi_IM_ResourceElementPattern__pattern1__subcarrierLocation_p1_s4; + imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6; + imres0->freqBand = calloc(1,sizeof(*imres0->freqBand)); + imres0->freqBand->startingRB = 0; + imres0->freqBand->nrofRBs = 108; + imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset)); + imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; + imres0->periodicityAndOffset->choice.slots320 = 0; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceToAddModList->list,imres0); + csi_MeasConfig->csi_IM_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_IM_ResourceSetToAddModList)); + NR_CSI_IM_ResourceSet_t *imset0 = calloc(1,sizeof(*imset0)); + imset0->csi_IM_ResourceSetId = 0; + NR_CSI_IM_ResourceId_t *res0 = calloc(1,sizeof(*res0)); + *res0 = 0; + ASN_SEQUENCE_ADD(&imset0->csi_IM_Resources,res0); + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_IM_ResourceSetToAddModList->list,imset0); + } + else { + csi_MeasConfig->csi_IM_ResourceToAddModList = NULL; + csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL; + } csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL; csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL; - csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); - NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0)); - nzpcsirs0->nzp_CSI_ResourceSetId = 0; - NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0)); - *nzpid0 = 0; - ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0); - nzpcsirs0->repetition = NULL; - nzpcsirs0->aperiodicTriggeringOffset = NULL; - nzpcsirs0->trs_Info = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0); + if (do_csirs) { + csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); + NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0)); + nzpcsirs0->nzp_CSI_ResourceSetId = 0; + NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0)); + *nzpid0 = 0; + ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0); + nzpcsirs0->repetition = NULL; + nzpcsirs0->aperiodicTriggeringOffset = NULL; + nzpcsirs0->trs_Info = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0); + } + else + csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL; csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL; - csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); - - NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); - nzpcsi0->nzp_CSI_RS_ResourceId = 0; - NR_CSI_RS_ResourceMapping_t resourceMapping; - resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; - resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.row2.size = 1; - resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4; - resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; - resourceMapping.firstOFDMSymbolInTimeDomain = 6; - resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; - resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; - resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; - resourceMapping.density.choice.one = (NULL_t)0; - resourceMapping.freqBand.startingRB = 0; - resourceMapping.freqBand.nrofRBs = 108; - nzpcsi0->resourceMapping = resourceMapping; - nzpcsi0->powerControlOffset = 0; - nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); - *nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0; - nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; - nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); - nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; - nzpcsi0->periodicityAndOffset->choice.slots320 = 0; - nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); + config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,do_csirs); csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList)); csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL; @@ -1211,18 +1198,21 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0); csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList)); - csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL; - NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0)); - csires0->csi_ResourceConfigId=0; - csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB; - csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB)); - csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList)); - NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0)); - *nzp0 = 0; - ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0); - csires0->bwp_Id = 1; - csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0); + + if (do_csirs) { + csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL; + NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0)); + csires0->csi_ResourceConfigId=0; + csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB; + csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB)); + csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList)); + NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0)); + *nzp0 = 0; + ASN_SEQUENCE_ADD(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0); + csires0->bwp_Id = 1; + csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0); + } NR_CSI_ResourceConfig_t *csires1 = calloc(1,sizeof(*csires1)); csires1->csi_ResourceConfigId=1; @@ -1236,111 +1226,147 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1); - NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2)); - csires2->csi_ResourceConfigId=2; - csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList; - csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList)); - NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); - *csiim00 = 0; - ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); + if (do_csirs && dl_antenna_ports > 1) { + NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2)); + csires2->csi_ResourceConfigId=2; + csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList; + csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList)); + NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); + *csiim00 = 0; + ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); + } - csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); - csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; - NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); - csirep1->reportConfigId=0; - csirep1->carrier=NULL; - csirep1->resourcesForChannelMeasurement=0; - csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference)); - *csirep1->csi_IM_ResourcesForInterference=2; - csirep1->nzp_CSI_RS_ResourcesForInterference=NULL; - csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; - csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic)); - csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; - csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 9 + (20 * uid) % 320; NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1)); pucchcsires1->uplinkBandwidthPartId=1; pucchcsires1->pucch_Resource=2; - ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); - csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; - csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0; - csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration)); - csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator)); - *csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; - csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator)); - *csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; - csirep1->reportFreqConfiguration->csi_ReportingBand = calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand)); - csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7; - csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1; - csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.bits_unused=1; - csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf=malloc(1); - csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf[0]=254; - csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; - csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; - csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig)); - csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1; - csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1)); - csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present=NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= - calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two)); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03; - csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; - csirep1->dummy = NULL; - csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; - csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); - //csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); - //*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; - csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table)); - *csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; - csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; - csirep1->non_PMI_PortIndication = NULL; - csirep1->ext1 = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1); + csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); + csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; + if (dl_antenna_ports > 1) { + NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); + csirep1->reportConfigId=0; + csirep1->carrier=NULL; + csirep1->resourcesForChannelMeasurement=0; + csirep1->csi_IM_ResourcesForInterference=calloc(1,sizeof(*csirep1->csi_IM_ResourcesForInterference)); + *csirep1->csi_IM_ResourcesForInterference=2; + csirep1->nzp_CSI_RS_ResourcesForInterference=NULL; + csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; + csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic)); + csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; + csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 9 + (20 * uid) % 320; + ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); + csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; + csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0; + csirep1->reportFreqConfiguration = calloc(1,sizeof(*csirep1->reportFreqConfiguration)); + csirep1->reportFreqConfiguration->cqi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->cqi_FormatIndicator)); + *csirep1->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; + csirep1->reportFreqConfiguration->pmi_FormatIndicator = calloc(1,sizeof(*csirep1->reportFreqConfiguration->pmi_FormatIndicator)); + *csirep1->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; + csirep1->reportFreqConfiguration->csi_ReportingBand = calloc(1,sizeof(*csirep1->reportFreqConfiguration->csi_ReportingBand)); + csirep1->reportFreqConfiguration->csi_ReportingBand->present = NR_CSI_ReportConfig__reportFreqConfiguration__csi_ReportingBand_PR_subbands7; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.size=1; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.bits_unused=1; + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf=malloc(1); + csirep1->reportFreqConfiguration->csi_ReportingBand->choice.subbands7.buf[0]=254; + csirep1->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; + csirep1->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; + csirep1->codebookConfig=calloc(1,sizeof(*csirep1->codebookConfig)); + csirep1->codebookConfig->codebookType.present = NR_CodebookConfig__codebookType_PR_type1; + csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1)); + csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present= + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= + calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03; + csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; + csirep1->dummy = NULL; + csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; + csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); + //csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); + //*csirep1->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; + csirep1->cqi_Table = calloc(1,sizeof(*csirep1->cqi_Table)); + *csirep1->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; + csirep1->subbandSize = NR_CSI_ReportConfig__subbandSize_value2; + csirep1->non_PMI_PortIndication = NULL; + csirep1->ext1 = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep1); + } - NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2)); - csirep2->reportConfigId=1; - csirep2->carrier=NULL; - csirep2->resourcesForChannelMeasurement=1; - csirep2->csi_IM_ResourcesForInterference=NULL; - csirep2->nzp_CSI_RS_ResourcesForInterference=NULL; - csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; - csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic)); - csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; - csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320; - ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); - csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP; - csirep2->reportQuantity.choice.ssb_Index_RSRP=(NULL_t)0; - csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration)); - csirep2->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; - csirep2->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; - csirep2->reportFreqConfiguration->csi_ReportingBand=NULL; - csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; - csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; - csirep2->codebookConfig= NULL; - - csirep2->dummy = NULL; - csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; - csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled)); - csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); - *csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; - - csirep2->cqi_Table = calloc(1,sizeof(*csirep2->cqi_Table)); - *csirep2->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; - csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1; - csirep2->non_PMI_PortIndication = NULL; - csirep2->ext1 = NULL; - - ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2); + if (do_csirs) { + NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2)); + csirep2->reportConfigId=1; + csirep2->carrier=NULL; + csirep2->resourcesForChannelMeasurement=0; + csirep2->csi_IM_ResourcesForInterference=NULL; + csirep2->nzp_CSI_RS_ResourcesForInterference=NULL; + csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; + csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic)); + csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; + csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320; + ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); + csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP; + csirep2->reportQuantity.choice.cri_RSRP=(NULL_t)0; + csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration)); + csirep2->reportFreqConfiguration->cqi_FormatIndicator = NULL; + csirep2->reportFreqConfiguration->pmi_FormatIndicator=NULL; + csirep2->reportFreqConfiguration->csi_ReportingBand=NULL; + csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; + csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; + csirep2->codebookConfig=NULL; + csirep2->dummy = NULL; + csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; + csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled)); + csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); + *csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; + csirep2->cqi_Table = NULL; + csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1; + csirep2->non_PMI_PortIndication = NULL; + csirep2->ext1 = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2); + } + else{ + NR_CSI_ReportConfig_t *csirep2 = calloc(1,sizeof(*csirep2)); + csirep2->reportConfigId=1; + csirep2->carrier=NULL; + csirep2->resourcesForChannelMeasurement=1; + csirep2->csi_IM_ResourcesForInterference=NULL; + csirep2->nzp_CSI_RS_ResourcesForInterference=NULL; + csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; + csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic)); + csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; + csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 29 + (20 * uid) % 320; + ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); + csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP; + csirep2->reportQuantity.choice.ssb_Index_RSRP=(NULL_t)0; + csirep2->reportFreqConfiguration = calloc(1,sizeof(*csirep2->reportFreqConfiguration)); + csirep2->reportFreqConfiguration->cqi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI; + csirep2->reportFreqConfiguration->pmi_FormatIndicator=NR_CSI_ReportConfig__reportFreqConfiguration__pmi_FormatIndicator_widebandPMI; + csirep2->reportFreqConfiguration->csi_ReportingBand=NULL; + csirep2->timeRestrictionForChannelMeasurements= NR_CSI_ReportConfig__timeRestrictionForChannelMeasurements_configured; + csirep2->timeRestrictionForInterferenceMeasurements=NR_CSI_ReportConfig__timeRestrictionForInterferenceMeasurements_configured; + csirep2->codebookConfig= NULL; + csirep2->dummy = NULL; + csirep2->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; + csirep2->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled)); + csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS = calloc(1,sizeof(*csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS)); + *csirep2->groupBasedBeamReporting.choice.disabled->nrofReportedRS=NR_CSI_ReportConfig__groupBasedBeamReporting__disabled__nrofReportedRS_n1; + csirep2->cqi_Table = calloc(1,sizeof(*csirep2->cqi_Table)); + *csirep2->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1; + csirep2->subbandSize = NR_CSI_ReportConfig__subbandSize_value1; + csirep2->non_PMI_PortIndication = NULL; + csirep2->ext1 = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ReportConfigToAddModList->list,csirep2); + } secondaryCellGroup->spCellConfig->spCellConfigDedicated->sCellDeactivationTimer=NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig=NULL; @@ -1351,11 +1377,65 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco } + +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs) { + + if (do_csirs) { + csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); + NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); + nzpcsi0->nzp_CSI_RS_ResourceId = 0; + NR_CSI_RS_ResourceMapping_t resourceMapping; + switch (dl_antenna_ports) { + case 1: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2; + resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; + resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; + break; + case 2: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; + resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.row2.size = 1; + resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; + break; + default: + AssertFatal(1==0,"Number of ports not yet supported\n"); + } + resourceMapping.firstOFDMSymbolInTimeDomain = 6; + resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; + resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; + resourceMapping.density.choice.one = (NULL_t)0; + resourceMapping.freqBand.startingRB = 0; + resourceMapping.freqBand.nrofRBs = 108; + nzpcsi0->resourceMapping = resourceMapping; + nzpcsi0->powerControlOffset = 0; + nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); + *nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0; + nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; + nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; + nzpcsi0->periodicityAndOffset->choice.slots320 = 0; + nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); + } + else + csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL; +} + + void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, - int n_physical_antenna_ports, + int dl_antenna_ports, + int do_csirs, int initial_csi_index, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); @@ -1369,9 +1449,11 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon secondaryCellGroup, 1, 1, - n_physical_antenna_ports, + dl_antenna_ports, + do_csirs, initial_csi_index, uid); + xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); char scg_buffer[1024]; From 3ca8ee8601a728d0899e1a58fdc660daa7717885 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 16 Jun 2021 10:51:17 +0200 Subject: [PATCH 013/883] some cleanup and fixes --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 44 +++++++++++------------ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 +-- openair2/LAYER2/NR_MAC_gNB/config.c | 3 +- openair2/RRC/NR/nr_rrc_defs.h | 1 - openair2/RRC/NR/nr_rrc_proto.h | 2 -- openair2/RRC/NR/rrc_gNB_nsa.c | 3 -- openair2/RRC/NR/rrc_gNB_reconfig.c | 6 ++-- 7 files changed, 29 insertions(+), 34 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index b1dbc7c7d9..75b48d5823 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -278,20 +278,20 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif - for (int ap=0; apnrOfLayers; ap++) { + for (int nl=0; nlnrOfLayers; nl++) { // DMRS params for this ap - get_Wt(Wt, ap, dmrs_Type); - get_Wf(Wf, ap, dmrs_Type); - delta = get_delta(ap, dmrs_Type); - l_prime = 0; // single symbol ap 0 + get_Wt(Wt, nl, dmrs_Type); + get_Wf(Wf, nl, dmrs_Type); + delta = get_delta(nl, dmrs_Type); + l_prime = 0; // single symbol nl 0 l0 = get_l0(rel15->dlDmrsSymbPos); l_overline = l0; #ifdef DEBUG_DLSCH_MAPPING uint8_t dmrs_symbol = l0+l_prime; - printf("DMRS Type %d params for ap %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n", - 1+dmrs_Type,ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime, l0, dmrs_symbol); + printf("DMRS Type %d params for nl %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n", + 1+dmrs_Type,nl, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime, l0, dmrs_symbol); #endif uint16_t m=0, dmrs_idx=0; @@ -365,7 +365,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, if(ptrs_symbol){ is_ptrs_re = is_ptrs_subcarrier(k, rel15->rnti, - ap, + nl, rel15->dmrsConfigType, rel15->PTRSFreqDensity, rel15->rbSize, @@ -376,12 +376,12 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, /* Map DMRS Symbol */ if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + dmrs_idx, l, k, k_prime, n, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif dmrs_idx++; k_prime++; @@ -390,30 +390,30 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, } /* Map PTRS Symbol */ else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF_precoding[nl])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + ((int16_t*)txdataF_precoding[nl])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif ptrs_idx++; } /* Map DATA Symbol */ else if( (!(dmrs_symbol_map & (1 << l))) || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[nl][m<<1]) >> 15; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[nl][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + m, l, k, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif m++; } /* mute RE */ else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; } if (++k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 55c8021d75..5890c44341 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -94,7 +94,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ nr_generate_pss(gNB->d_pss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_sss(gNB->d_sss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); - if (cfg->carrier_config.num_tx_ant.value <= 4) + if (fp->Lmax == 4) nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); else nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); @@ -212,7 +212,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, //apply the OFDM symbol rotation here for (aa=0; aacarrier_config.num_tx_ant.value; aa++) { - apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size); + apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 5e5f9e4145..95b3f4b7e2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -273,8 +273,9 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts cfg->ssb_table.ssb_mask_list[1].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG; cfg->num_tlv+=2; + // logical antenna ports cfg->carrier_config.num_tx_ant.value = pdsch_AntennaPorts; - AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 13, "pdsch_AntennaPorts in 1...12\n"); + AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 33, "pdsch_AntennaPorts in 1...32\n"); cfg->carrier_config.num_tx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_TX_ANT_TAG; int num_ssb=0; diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index d64f3a8eb7..cbc703f115 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -454,7 +454,6 @@ typedef struct { NR_CellGroupConfig_t *secondaryCellGroup[MAX_NR_RRC_UE_CONTEXTS]; NR_SRB_INFO SI; NR_SRB_INFO Srb0; - int initial_csi_index[MAX_NR_RRC_UE_CONTEXTS]; int p_gNB; } rrc_gNB_carrier_data_t; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index a78ee128ff..b93b5d627b 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -86,7 +86,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int servCellIndex, int dl_antenna_ports, int do_csirs, - int initial_csi_index, int uid); void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs); @@ -97,7 +96,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, int do_csirs, - int initial_csi_index, int uid); void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig, diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index cd557f5113..4056235dfb 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -152,7 +152,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.reconfig->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration; NR_RRCReconfiguration_IEs_t *reconfig_ies=calloc(1,sizeof(NR_RRCReconfiguration_IEs_t)); ue_context_p->ue_context.reconfig->criticalExtensions.choice.rrcReconfiguration = reconfig_ies; - carrier->initial_csi_index[ue_context_p->local_uid + 1] = 0; ue_context_p->ue_context.rb_config = calloc(1,sizeof(NR_RRCReconfiguration_t)); if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1 || get_softmodem_params()->sa == 1){ fill_default_rbconfig(ue_context_p->ue_context.rb_config, @@ -246,7 +245,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, carrier->do_CSIRS, - carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); } else { fill_default_reconfig(carrier->servingcellconfigcommon, @@ -255,7 +253,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, carrier->do_CSIRS, - carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); } ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity; diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index e98fdf1af6..08273c4984 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -130,8 +130,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int servCellIndex, int dl_antenna_ports, int do_csirs, - int initial_csi_index, int uid) { + AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n"); @@ -1236,6 +1236,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00)); *csiim00 = 0; ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00); + csires2->bwp_Id = 1; + csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic; ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2); } @@ -1438,7 +1440,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, int do_csirs, - int initial_csi_index, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(reconfig!=NULL,"reconfig is null\n"); @@ -1453,7 +1454,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon 1, dl_antenna_ports, do_csirs, - initial_csi_index, uid); xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); From 63d0c085a6d686aa33a3dfdf731fcc291b88cdad Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 16 Jun 2021 18:47:03 +0200 Subject: [PATCH 014/883] fixing dlsim ulsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 0955588679..54c3a68631 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -750,7 +750,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index e79dc063b3..1c28591aba 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -693,7 +693,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); From 5d34f4906d62d1e7ef925fe826831edb6fa50b39 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 10:04:03 +0200 Subject: [PATCH 015/883] set mcs from csi report --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 64 ++++++++++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 113 +++++++++--------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 4 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 5 +- 5 files changed, 128 insertions(+), 60 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 14ade4fb4b..a93782090a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -601,7 +601,7 @@ void pf_dl(module_id_t module_id, continue; /* Calculate coeff */ - sched_pdsch->mcs = 9; + set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs]; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index ca0c68bf06..5058ee8d40 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -112,6 +112,20 @@ uint8_t nr_ss_first_symb_idx_scs_120_120_mux3[4] = {4,8,2,6}; uint8_t nr_max_number_of_candidates_per_slot[4] = {44, 36, 22, 20}; uint8_t nr_max_number_of_cces_per_slot[4] = {56, 56, 48, 32}; +// CQI TABLES +// Table 1 (38.214 5.2.2.1-2) +uint16_t cqi_table1[16][2] = {{0,0},{2,78},{2,120},{2,193},{2,308},{2,449},{2,602},{4,378}, + {4,490},{4,616},{6,466},{6,567},{6,666},{6,772},{6,873},{6,948}}; + +// Table 2 (38.214 5.2.2.1-3) +uint16_t cqi_table2[16][2] = {{0,0},{2,78},{2,193},{2,449},{4,378},{4,490},{4,616},{6,466}, + {6,567},{6,666},{6,772},{6,873},{8,711},{8,797},{8,885},{8,948}}; + +// Table 2 (38.214 5.2.2.1-4) +uint16_t cqi_table3[16][2] = {{0,0},{2,30},{2,50},{2,78},{2,120},{2,193},{2,308},{2,449}, + {2,602},{4,378},{4,490},{4,616},{6,466},{6,567},{6,666},{6,772}}; + + static inline uint8_t get_max_candidates(uint8_t scs) { AssertFatal(scs<4, "Invalid PDCCH subcarrier spacing %d\n", scs); return (nr_max_number_of_candidates_per_slot[scs]); @@ -122,6 +136,55 @@ static inline uint8_t get_max_cces(uint8_t scs) { return (nr_max_number_of_cces_per_slot[scs]); } + +void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl, + uint8_t mcs_table_idx) { + + if (sched_ctrl->set_mcs) { + + // TODO for wideband case and multiple TB + int cqi_idx = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb; + uint16_t target_coderate,target_qm; + if (cqi_idx>0) { + int cqi_table = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table; + AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n"); + switch (cqi_table) { + case 0: + target_qm = cqi_table1[cqi_idx][0]; + target_coderate = cqi_table1[cqi_idx][0]; + break; + case 1: + target_qm = cqi_table2[cqi_idx][0]; + target_coderate = cqi_table2[cqi_idx][0]; + break; + case 2: + target_qm = cqi_table3[cqi_idx][0]; + target_coderate = cqi_table3[cqi_idx][0]; + break; + default: + AssertFatal(1==0,"Invalid cqi table index %d\n",cqi_table); + } + int max_mcs = 28; + int R,Qm; + if (mcs_table_idx == 1) + max_mcs = 27; + for (int i=0; i<=max_mcs; i++) { + R = nr_get_code_rate_dl(i, mcs_table_idx); + Qm = nr_get_Qm_dl(i, mcs_table_idx); + if ((Qm == target_qm) && (target_coderate <= R)) { + sched_pdsch->mcs = i; + break; + } + } + } + else // default value + sched_pdsch->mcs = 9; + + sched_ctrl->set_mcs = FALSE; + } +} + NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, NR_BWP_Downlink_t *bwp, NR_SearchSpace_t *ss, @@ -1839,6 +1902,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; memset(sched_ctrl, 0, sizeof(*sched_ctrl)); + sched_ctrl->set_mcs = TRUE; sched_ctrl->ta_frame = 0; sched_ctrl->ta_update = 31; sched_ctrl->ta_apply = false; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 696a05c0bd..7d3985ac28 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -921,37 +921,34 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { idx: resource set index */ - //for all reported SSB - for (idx = 0; idx < nb_of_csi_ssb_report; idx++) { - nr_ssbri_cri = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri; - //extracting the ssb indexes - for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) { - ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[ssb_idx]; - } + nr_ssbri_cri = sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri; + //extracting the ssb indexes + for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) { + ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI[ssb_idx]; + } - //if strongest measured RSRP is configured - strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP); - // including ssb rsrp in mac stats - stats->cumul_rsrp += strongest_ssb_rsrp; - stats->num_rsrp_meas++; - ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp; - LOG_D(MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp); + //if strongest measured RSRP is configured + strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP); + // including ssb rsrp in mac stats + stats->cumul_rsrp += strongest_ssb_rsrp; + stats->num_rsrp_meas++; + ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp; + LOG_D(MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp); - //if current ssb rsrp is greater than better rsrp - if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) { - better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report]; - target_ssb_beam_index = idx * nb_of_csi_ssb_report; - } + //if current ssb rsrp is greater than better rsrp + if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) { + better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report]; + target_ssb_beam_index = idx * nb_of_csi_ssb_report; + } - for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) { - ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); + for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) { + ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); - //if current reported rsrp is greater than better rsrp - if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) { - better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx]; - target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx; - } - } + //if current reported rsrp is greater than better rsrp + if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) { + better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx]; + target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx; + } } @@ -1103,36 +1100,35 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, multiple simultaneous spatial domain receive filter */ - int idx = 0; //Since for SSB RSRP reporting in RRC can configure only one ssb resource set per one report config - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; + sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; - for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { + for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits); if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = + sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = *(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); else - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = + sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = *(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *cumul_bits += cri_ssbri_bitlen; - LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); + LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); } curr_payload = pickandreverse_bits(payload, 7, *cumul_bits); - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP = curr_payload & 0x7f; + sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP = curr_payload & 0x7f; *cumul_bits += 7; - for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { + for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { curr_payload = pickandreverse_bits(payload, 4, *cumul_bits); - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; + sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; *cumul_bits += 4; } csi_report->nb_of_csi_ssb_report++; LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", - sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP, - get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP)); + sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP, + get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP)); } @@ -1141,10 +1137,8 @@ void evaluate_cri_report(uint8_t *payload, int cumul_bits, NR_UE_sched_ctrl_t *sched_ctrl){ - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? - uint8_t temp_cri = pickandreverse_bits(payload, cri_bitlen, cumul_bits); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; } int evaluate_ri_report(uint8_t *payload, @@ -1153,13 +1147,12 @@ int evaluate_ri_report(uint8_t *payload, int cumul_bits, NR_UE_sched_ctrl_t *sched_ctrl){ - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? uint8_t ri_index = pickandreverse_bits(payload, ri_bitlen, cumul_bits); int count=0; for (int i=0; i<8; i++) { if ((ri_restriction>>i)&0x01) { if(count == ri_index) { - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.ri = i; + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri = i; LOG_I(MAC,"CSI Reported Rank %d\n", i+1); return i; } @@ -1174,21 +1167,29 @@ void evaluate_cqi_report(uint8_t *payload, nr_csi_report_t *csi_report, int cumul_bits, uint8_t ri, - NR_UE_sched_ctrl_t *sched_ctrl){ + NR_UE_sched_ctrl_t *sched_ctrl, + long *cqi_Table){ //TODO sub-band CQI report not yet implemented - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? int cqi_bitlen = csi_report->csi_meas_bitlen.cqi_bitlen[ri]; uint8_t temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; + // NR_CSI_ReportConfig__cqi_Table_table1 = 0 + // NR_CSI_ReportConfig__cqi_Table_table2 = 1 + // NR_CSI_ReportConfig__cqi_Table_table3 = 2 + if (cqi_Table) + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table; + else + AssertFatal(1==0,"CQI Table not present in RRC configuration\n"); + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); if (cqi_bitlen > 4) { temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi); } + sched_ctrl->set_mcs = TRUE; } @@ -1198,7 +1199,6 @@ uint8_t evaluate_pmi_report(uint8_t *payload, uint8_t ri, NR_UE_sched_ctrl_t *sched_ctrl){ - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? int x1_bitlen = csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]; int x2_bitlen = csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri]; int tot_bitlen = x1_bitlen + x2_bitlen; @@ -1206,11 +1206,11 @@ uint8_t evaluate_pmi_report(uint8_t *payload, //in case of 2 port CSI configuration x1 is empty and the information bits are in x2 int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x1, - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.pmi_x2); + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1, + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2); return tot_bitlen; @@ -1223,13 +1223,12 @@ int evaluate_li_report(uint8_t *payload, uint8_t ri, NR_UE_sched_ctrl_t *sched_ctrl){ - int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id? int li_bitlen = csi_report->csi_meas_bitlen.li_bitlen[ri]; if (li_bitlen>0) { int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits); LOG_I(MAC,"LI %d\n",temp_li); - sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.li = temp_li; + sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.li = temp_li; } return li_bitlen; @@ -1304,7 +1303,7 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, cumul_bits += ri_bitlen; if (r_index != -1) skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); - evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table); break; case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI: cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; @@ -1319,7 +1318,7 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); cumul_bits += pmi_bitlen; - evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table); break; case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI: cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; @@ -1336,7 +1335,7 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig, skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen); pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); cumul_bits += pmi_bitlen; - evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl); + evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table); break; default: AssertFatal(1==0, "Invalid or not supported CSI measurement report\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 680a6e6dd4..98fb961cc8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -415,6 +415,10 @@ int16_t ssb_index_from_prach(module_id_t module_idP, void find_SSB_and_RO_available(module_id_t module_idP); +void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl, + uint8_t mcs_table_idx); + void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 8d17e7100d..3ab4bb66ea 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -441,6 +441,7 @@ struct CRI_RI_LI_PMI_CQI { uint8_t pmi_x2; uint8_t wb_cqi_1tb; uint8_t wb_cqi_2tb; + uint8_t cqi_table; }; typedef struct CRI_SSB_RSRP { @@ -573,9 +574,9 @@ typedef struct { int pusch_consecutive_dtx_cnt; int pucch_consecutive_dtx_cnt; int ul_failure; - struct CSI_Report CSI_report[MAX_CSI_REPORTS]; + struct CSI_Report CSI_report; bool SR; - + bool set_mcs; /// information about every HARQ process NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES]; /// HARQ processes that are free From 40c51ebc0b9db0ff43ea406643225e86c6a185d5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 10:37:34 +0200 Subject: [PATCH 016/883] tbs computation on the fly in pf_dl --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index a93782090a..16bed9fcd5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -602,7 +602,16 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs]; + const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); + const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); + uint32_t tbs = nr_compute_tbs(Qm, + R, + 1, /* rbSize */ + 10, /* hypothetical number of slots */ + 0, /* N_PRB_DMRS * N_DMRS_SLOT */ + 0 /* N_PRB_oh, 0 for initialBWP */, + 0 /* tb_scaling */, + 1 /* nrOfLayers */) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); From 311b97685e79a421b17ea4da57178ee164631295 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 16 Jun 2021 16:59:04 +0200 Subject: [PATCH 017/883] gNB: add nrOfLayers to sched_pdsch --- openair1/SIMULATION/NR_PHY/dlsim.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 +++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 54c3a68631..17cf1d77dd 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -274,6 +274,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, * configuration */ ps->mcsTableIdx = g_mcsTableIdx; + sched_pdsch->nrOfLayers = g_nrOfLayers; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm, @@ -283,7 +284,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - 1 /* nrOfLayers */) + sched_pdsch->nrOfLayers) >> 3; /* the simulator assumes the HARQ PID is equal to the slot number */ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 16bed9fcd5..8e6ee912f3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -602,6 +602,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); + sched_pdsch->nrOfLayers = 1; const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, @@ -611,7 +612,7 @@ void pf_dl(module_id_t module_id, 0, /* N_PRB_DMRS * N_DMRS_SLOT */ 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - 1 /* nrOfLayers */) >> 3; + sched_pdsch->nrOfLayers) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); @@ -828,7 +829,7 @@ void nr_schedule_ue_spec(module_id_t module_id, const rnti_t rnti = UE_info->rnti[UE_id]; /* POST processing */ - const int nrOfLayers = 1; + const uint8_t nrOfLayers = sched_pdsch->nrOfLayers; const uint16_t R = sched_pdsch->R; const uint8_t Qm = sched_pdsch->Qm; const uint32_t TBS = sched_pdsch->tb_size; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 6e1b99fa6b..56034353ac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -370,6 +370,7 @@ void nr_preprocessor_phytest(module_id_t module_id, nr_set_pdsch_semi_static( scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + sched_pdsch->nrOfLayers = 1; sched_pdsch->mcs = target_dl_mcs; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -380,7 +381,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - 1 /* nrOfLayers */) + sched_pdsch->nrOfLayers) >> 3; /* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */ diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3ab4bb66ea..0c460fcc9b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -383,6 +383,7 @@ typedef struct NR_sched_pdsch { uint8_t mcs; /// TBS-related info + uint8_t nrOfLayers; uint16_t R; uint8_t Qm; uint32_t tb_size; From 39defb49edda1d2b43a424a58dc9e0df1e04cf69 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 10:54:52 +0200 Subject: [PATCH 018/883] passing nroflayers to nr_find_nb_rb --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 +++++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8e6ee912f3..089096d1dc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -491,6 +491,7 @@ bool allocate_dl_retransmission(module_id_t module_id, uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, retInfo->R, + retInfo->nrOfLayers, temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT, retInfo->tb_size, @@ -704,6 +705,7 @@ void pf_dl(module_id_t module_id, + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); nr_find_nb_rb(sched_pdsch->Qm, sched_pdsch->R, + sched_pdsch->nrOfLayers, ps->nrOfSymbols, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, sched_ctrl->num_total_bytes + oh, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5058ee8d40..316a6d4f49 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -284,6 +284,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, bool nr_find_nb_rb(uint16_t Qm, uint16_t R, + uint8_t nrOfLayers, uint16_t nb_symb_sch, uint16_t nb_dmrs_prb, uint32_t bytes, @@ -293,7 +294,7 @@ bool nr_find_nb_rb(uint16_t Qm, { /* is the maximum (not even) enough? */ *nb_rb = nb_rb_max; - *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; + *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3; /* check whether it does not fit, or whether it exactly fits. Some algorithms * might depend on the return value! */ if (bytes > *tbs) @@ -303,7 +304,7 @@ bool nr_find_nb_rb(uint16_t Qm, /* is the minimum enough? */ *nb_rb = 1; - *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; + *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3; if (bytes <= *tbs) return true; @@ -312,7 +313,7 @@ bool nr_find_nb_rb(uint16_t Qm, int hi = nb_rb_max; int lo = 1; for (int p = (hi + lo) / 2; lo + 1 < hi; p = (hi + lo) / 2) { - const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; + const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3; if (bytes == TBS) { hi = p; break; @@ -323,7 +324,7 @@ bool nr_find_nb_rb(uint16_t Qm, } } *nb_rb = hi; - *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; + *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3; /* return whether we could allocate all bytes and stay below nb_rb_max */ return *tbs >= bytes && *nb_rb <= nb_rb_max; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 594031f124..b9b3f336fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -889,6 +889,7 @@ bool allocate_ul_retransmission(module_id_t module_id, uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, retInfo->R, + 1, // layers temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.num_dmrs_symb, retInfo->tb_size, @@ -1146,6 +1147,7 @@ void pf_ul(module_id_t module_id, uint32_t TBS = 0; nr_find_nb_rb(sched_pusch->Qm, sched_pusch->R, + 1, // layers ps->nrOfSymbols, ps->N_PRB_DMRS * ps->num_dmrs_symb, B, diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 98fb961cc8..0c41c1dbdf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -426,6 +426,7 @@ bool find_free_CCE(module_id_t module_id, sub_frame_t slot, int UE_id); bool nr_find_nb_rb(uint16_t Qm, uint16_t R, + uint8_t nrOfLayers, uint16_t nb_symb_sch, uint16_t nb_dmrs_prb, uint32_t bytes, From 5e4d40b1ec16cd72874aa26bf692b08106832a87 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 12:55:43 +0200 Subject: [PATCH 019/883] bugfix in rrc configuration --- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 08273c4984..b3baf2068c 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1247,7 +1247,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; - if (dl_antenna_ports > 1) { + if (do_csirs && dl_antenna_ports > 1) { NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); csirep1->reportConfigId=0; csirep1->carrier=NULL; From 0ec932b57fb4fb16352626e2d1c3c362a7f0aaa5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 13:18:45 +0200 Subject: [PATCH 020/883] nb of layers from CSI Report --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 +++++++++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 089096d1dc..8fcb544f18 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -603,7 +603,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - sched_pdsch->nrOfLayers = 1; + set_dl_nrOfLayers(sched_pdsch,sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 316a6d4f49..0cf70e6ebc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -137,6 +137,15 @@ static inline uint8_t get_max_cces(uint8_t scs) { } +void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl) { + + // for now this should be enough + // if there is not csi report RI is 0 from initialization + sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri + 1; + +} + void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t mcs_table_idx) { diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 0c41c1dbdf..eba95b5cdc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -419,6 +419,9 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t mcs_table_idx); +void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, + NR_UE_sched_ctrl_t *sched_ctrl); + void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); From 549e3a9159497a8ce0051d5be4ef541d1c591bd5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 18:21:25 +0200 Subject: [PATCH 021/883] remove choice in CSI report structure --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 7 ++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 50 +++++++++---------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 7 +-- 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 0cf70e6ebc..6822354ad3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -142,7 +142,7 @@ void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, // for now this should be enough // if there is not csi report RI is 0 from initialization - sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri + 1; + sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1; } @@ -151,12 +151,11 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, uint8_t mcs_table_idx) { if (sched_ctrl->set_mcs) { - // TODO for wideband case and multiple TB - int cqi_idx = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb; + int cqi_idx = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb; uint16_t target_coderate,target_qm; if (cqi_idx>0) { - int cqi_table = sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table; + int cqi_table = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table; AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n"); switch (cqi_table) { case 0: diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 7d3985ac28..ead2ad4d95 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -921,14 +921,14 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { idx: resource set index */ - nr_ssbri_cri = sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri; + nr_ssbri_cri = sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri; //extracting the ssb indexes for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) { - ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI[ssb_idx]; + ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[ssb_idx]; } //if strongest measured RSRP is configured - strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP); + strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP); // including ssb rsrp in mac stats stats->cumul_rsrp += strongest_ssb_rsrp; stats->num_rsrp_meas++; @@ -942,7 +942,7 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { } for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) { - ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); + ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp); //if current reported rsrp is greater than better rsrp if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) { @@ -1100,35 +1100,35 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, multiple simultaneous spatial domain receive filter */ - sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; + sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri; - for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { + for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) { curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits); if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) - sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = + sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = *(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); else - sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = + sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx] = *(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]); *cumul_bits += cri_ssbri_bitlen; - LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.choice.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); + LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI [csi_ssb_idx]); } curr_payload = pickandreverse_bits(payload, 7, *cumul_bits); - sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP = curr_payload & 0x7f; + sched_ctrl->CSI_report.ssb_cri_report.RSRP = curr_payload & 0x7f; *cumul_bits += 7; - for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { + for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) { curr_payload = pickandreverse_bits(payload, 4, *cumul_bits); - sched_ctrl->CSI_report.choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; + sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f; *cumul_bits += 4; } csi_report->nb_of_csi_ssb_report++; LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", - sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP, - get_measured_rsrp(sched_ctrl->CSI_report.choice.ssb_cri_report.RSRP)); + sched_ctrl->CSI_report.ssb_cri_report.RSRP, + get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP)); } @@ -1138,7 +1138,7 @@ void evaluate_cri_report(uint8_t *payload, NR_UE_sched_ctrl_t *sched_ctrl){ uint8_t temp_cri = pickandreverse_bits(payload, cri_bitlen, cumul_bits); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cri = temp_cri; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cri = temp_cri; } int evaluate_ri_report(uint8_t *payload, @@ -1152,7 +1152,7 @@ int evaluate_ri_report(uint8_t *payload, for (int i=0; i<8; i++) { if ((ri_restriction>>i)&0x01) { if(count == ri_index) { - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.ri = i; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri = i; LOG_I(MAC,"CSI Reported Rank %d\n", i+1); return i; } @@ -1179,14 +1179,14 @@ void evaluate_cqi_report(uint8_t *payload, // NR_CSI_ReportConfig__cqi_Table_table2 = 1 // NR_CSI_ReportConfig__cqi_Table_table3 = 2 if (cqi_Table) - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table; else AssertFatal(1==0,"CQI Table not present in RRC configuration\n"); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; - LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; + LOG_I(MAC,"Wide-band CQI for the first TB %d %p\n", temp_cqi,&sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb); if (cqi_bitlen > 4) { temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi); } sched_ctrl->set_mcs = TRUE; @@ -1206,11 +1206,11 @@ uint8_t evaluate_pmi_report(uint8_t *payload, //in case of 2 port CSI configuration x1 is empty and the information bits are in x2 int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x1, - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.pmi_x2); + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1, + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2); return tot_bitlen; @@ -1228,7 +1228,7 @@ int evaluate_li_report(uint8_t *payload, if (li_bitlen>0) { int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits); LOG_I(MAC,"LI %d\n",temp_li); - sched_ctrl->CSI_report.choice.cri_ri_li_pmi_cqi_report.li = temp_li; + sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.li = temp_li; } return li_bitlen; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 0c460fcc9b..81df35cf06 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -453,11 +453,8 @@ typedef struct CRI_SSB_RSRP { } CRI_SSB_RSRP_t; struct CSI_Report { - NR_CSI_Report_Config_PR present; - union Config_CSI_Report { - struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report; - struct CRI_SSB_RSRP ssb_cri_report; - } choice; + struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report; + struct CRI_SSB_RSRP ssb_cri_report; }; #define MAX_SR_BITLEN 8 From d3ad905324d37eee84018737c0415162671b1d55 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Jun 2021 18:24:13 +0200 Subject: [PATCH 022/883] remove debug print from log --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ead2ad4d95..fc96deabb2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1183,7 +1183,7 @@ void evaluate_cqi_report(uint8_t *payload, else AssertFatal(1==0,"CQI Table not present in RRC configuration\n"); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; - LOG_I(MAC,"Wide-band CQI for the first TB %d %p\n", temp_cqi,&sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb); + LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); if (cqi_bitlen > 4) { temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; From ee2f133cae28f7841c104d19fa8495c50e1c47e4 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 21 Jun 2021 12:19:39 +0200 Subject: [PATCH 023/883] max mimo layers depending on antenna ports from config file --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 5890c44341..6d071f0f8c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -591,7 +591,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { LOG_D(PHY,"frame %d, slot %d: PUCCH signal energy %d\n",frame_rx,slot_rx,power_rxF); nr_decode_pucch0(gNB, - frame_rx, + frame_rx, slot_rx, uci_pdu_format0, pucch_pdu); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index b3baf2068c..653ce34d7b 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1122,7 +1122,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco pdsch_servingcellconfig->pucch_Cell= NULL; pdsch_servingcellconfig->ext1=calloc(1,sizeof(*pdsch_servingcellconfig->ext1)); pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1,sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers)); - *pdsch_servingcellconfig->ext1->maxMIMO_Layers = 2; + *pdsch_servingcellconfig->ext1->maxMIMO_Layers = dl_antenna_ports; pdsch_servingcellconfig->ext1->processingType2Enabled = NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig=NULL; From ed54f5981847104e9cfc2851df5625cc88c24f0c Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 22 Jun 2021 18:29:22 +0200 Subject: [PATCH 024/883] handling dl dmrs ports at phy --- common/utils/nr/nr_common.c | 18 ++ common/utils/nr/nr_common.h | 2 +- .../nfapi/public_inc/fapi_nr_ue_interface.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 10 +- .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 2 + openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 1 + openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 9 +- openair2/LAYER2/NR_MAC_UE/mac_extern.h | 8 +- openair2/LAYER2/NR_MAC_UE/mac_vars.c | 274 +++++++++--------- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 99 ++++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +- 11 files changed, 235 insertions(+), 193 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index cc2860191a..001f7a4739 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -196,6 +196,24 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx) { } } +int get_dmrs_port(int nl, uint16_t dmrs_ports) { + + if (dmrs_ports == 0) return 0; // dci 1_0 + int p = -1; + int found = -1; + for (int i=0; i<12; i++) { // loop over dmrs ports + if((dmrs_ports>>i)&0x01) { // check if current bit is 1 + found++; + if (found == nl) { // found antenna port number corresponding to current layer + p = i; + break; + } + } + } + AssertFatal(p>-1,"No dmrs port corresponding to layer %d found\n",nl); + return p; +} + int get_subband_size(int NPRB,int size) { // implements table 5.2.1.4-2 from 36.214 // diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 6389c2c094..b95fdd5046 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -62,7 +62,7 @@ uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx); uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); - +int get_dmrs_port(int nl, uint16_t dmrs_ports); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<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 c0abf6acb0..4bdd3c24cb 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 @@ -465,7 +465,7 @@ typedef struct { uint8_t pucch_resource_id; uint8_t pdsch_to_harq_feedback_time_ind; uint8_t n_dmrs_cdm_groups; - uint8_t dmrs_ports[10]; + uint16_t dmrs_ports; uint8_t n_front_load_symb; uint8_t tci_state; fapi_nr_dl_srs_config_t srs_config; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 75b48d5823..6e379fdf75 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -38,6 +38,7 @@ #include "PHY/NR_REFSIG/ptrs_nr.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "LAYER2/NR_MAC_gNB/mac_proto.h" +#include "common/utils/nr/nr_common.h" //#define DEBUG_DLSCH //#define DEBUG_DLSCH_MAPPING @@ -279,11 +280,12 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif for (int nl=0; nlnrOfLayers; nl++) { - + + int dmrs_port = get_dmrs_port(nl,rel15->dmrsPorts); // DMRS params for this ap - get_Wt(Wt, nl, dmrs_Type); - get_Wf(Wf, nl, dmrs_Type); - delta = get_delta(nl, dmrs_Type); + get_Wt(Wt, dmrs_port, dmrs_Type); + get_Wf(Wf, dmrs_port, dmrs_Type); + delta = get_delta(dmrs_port, dmrs_Type); l_prime = 0; // single symbol nl 0 l0 = get_l0(rel15->dlDmrsSymbPos); l_overline = l0; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index f3cca9e33d..9371c802f1 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -300,6 +300,8 @@ typedef struct { uint8_t dmrsConfigType; // Number of DMRS CDM groups with no data uint8_t n_dmrs_cdm_groups; + /// DMRS ports bitmap + uint16_t dmrs_ports; /// Starting Symbol number uint16_t start_symbol; /// Current subband PMI allocation diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index c276de847d..06975b026f 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -116,6 +116,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos; dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType; dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups; + dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports; dlsch0_harq->mcs = dlsch_config_pdu->mcs; dlsch0_harq->rvidx = dlsch_config_pdu->rv; dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index e3d4c54f5a..7ebba83408 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -761,17 +761,18 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_ uint16_t s1 = dlsch0_harq->nb_symbols; bool is_SI = dlsch0->rnti_type == _SI_RNTI_; - LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n",ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0->harq_processes[harq_pid]->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0->harq_processes[harq_pid]->dlDmrsSymbPos); + LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n", + ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos); for (m = s0; m < (s0 +s1); m++) { - if (((1<harq_processes[harq_pid]->dlDmrsSymbPos) > 0) { - for (uint8_t aatx=0; aatxharq_processes[harq_pid]->Nl; aatx++) {//for MIMO Config: it shall loop over no_layers + if (((1<dlDmrsSymbPos) > 0) { + for (uint8_t aatx=0; aatxNl; aatx++) {//for MIMO Config: it shall loop over no_layers nr_pdsch_channel_estimation(ue, proc, 0 /*eNB_id*/, is_SI, nr_slot_rx, - aatx /*p*/, + get_dmrs_port(aatx,dlsch0_harq->dmrs_ports), m, BWPStart, ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_extern.h b/openair2/LAYER2/NR_MAC_UE/mac_extern.h index e551790f7a..3affa41d51 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_extern.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_extern.h @@ -57,12 +57,12 @@ extern const uint8_t table_7_3_1_1_2_21[19][4]; extern const uint8_t table_7_3_1_1_2_22[6][5]; extern const uint8_t table_7_3_1_1_2_23[5][6]; extern const uint8_t table_7_3_2_3_3_1[12][5]; -extern const uint8_t table_7_3_2_3_3_2_oneCodeword[31][6]; +extern const uint8_t table_7_3_2_3_3_2_oneCodeword[31][10]; extern const uint8_t table_7_3_2_3_3_2_twoCodeword[4][10]; -extern const uint8_t table_7_3_2_3_3_3_oneCodeword[24][5]; +extern const uint8_t table_7_3_2_3_3_3_oneCodeword[24][7]; extern const uint8_t table_7_3_2_3_3_3_twoCodeword[2][7]; -extern const uint8_t table_7_3_2_3_3_4_oneCodeword[58][6]; -extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10]; +extern const uint8_t table_7_3_2_3_3_4_oneCodeword[58][14]; +extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14]; extern const uint16_t table_7_2_1[16]; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_vars.c b/openair2/LAYER2/NR_MAC_UE/mac_vars.c index 383267090f..b435dd773f 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_vars.c +++ b/openair2/LAYER2/NR_MAC_UE/mac_vars.c @@ -257,161 +257,161 @@ const uint8_t table_7_3_1_1_2_23[5][6] = { }; const uint8_t table_7_3_2_3_3_1[12][5] = { - {1,0,0,0,0}, {1,1,0,0,0}, {1,0,1,0,0}, - {2,0,0,0,0}, + {1,1,1,0,0}, {2,1,0,0,0}, - {2,2,0,0,0}, - {2,3,0,0,0}, {2,0,1,0,0}, - {2,2,3,0,0}, - {2,0,1,2,0}, - {2,0,1,2,3}, - {2,0,2,0,0} + {2,0,0,1,0}, + {2,0,0,0,1}, + {2,1,1,0,0}, + {2,0,0,1,1}, + {2,1,1,1,0}, + {2,1,1,1,1}, + {2,1,0,1,0} }; -const uint8_t table_7_3_2_3_3_2_oneCodeword[31][6] = { - {1,0,0,0,0,1}, - {1,1,0,0,0,1}, - {1,0,1,0,0,1}, - {2,0,0,0,0,1}, - {2,1,0,0,0,1}, - {2,2,0,0,0,1}, - {2,3,0,0,0,1}, - {2,0,1,0,0,1}, - {2,2,3,0,0,1}, - {2,0,1,2,0,1}, - {2,0,1,2,3,1}, - {2,0,2,0,0,1}, - {2,0,0,0,0,2}, - {2,1,0,0,0,2}, - {2,2,0,0,0,2}, - {2,3,0,0,0,2}, - {2,4,0,0,0,2}, - {2,5,0,0,0,2}, - {2,6,0,0,0,2}, - {2,7,0,0,0,2}, - {2,0,1,0,0,2}, - {2,2,3,0,0,2}, - {2,4,5,0,0,2}, - {2,6,7,0,0,2}, - {2,0,4,0,0,2}, - {2,2,6,0,0,2}, - {2,0,1,4,0,2}, - {2,2,3,6,0,2}, - {2,0,1,4,5,2}, - {2,2,3,6,7,2}, - {2,0,2,4,6,2} +const uint8_t table_7_3_2_3_3_2_oneCodeword[31][10] = { + {1,1,0,0,0,0,0,0,0,1}, + {1,0,1,0,0,0,0,0,0,1}, + {1,1,1,0,0,0,0,0,0,1}, + {2,1,0,0,0,0,0,0,0,1}, + {2,0,1,0,0,0,0,0,0,1}, + {2,0,0,1,0,0,0,0,0,1}, + {2,0,0,0,1,0,0,0,0,1}, + {2,1,1,0,0,0,0,0,0,1}, + {2,0,0,1,1,0,0,0,0,1}, + {2,1,1,1,0,0,0,0,0,1}, + {2,1,1,1,1,0,0,0,0,1}, + {2,1,0,1,0,0,0,0,0,1}, + {2,1,0,0,0,0,0,0,0,2}, + {2,0,1,0,0,0,0,0,0,2}, + {2,0,0,1,0,0,0,0,0,2}, + {2,0,0,0,1,0,0,0,0,2}, + {2,0,0,0,0,1,0,0,0,2}, + {2,0,0,0,0,0,1,0,0,2}, + {2,0,0,0,0,0,0,1,0,2}, + {2,0,0,0,0,0,0,0,1,2}, + {2,1,1,0,0,0,0,0,0,2}, + {2,0,0,1,1,0,0,0,0,2}, + {2,0,0,0,0,1,1,0,0,2}, + {2,0,0,0,0,0,0,1,1,2}, + {2,1,0,0,0,1,0,0,0,2}, + {2,0,0,1,0,0,0,1,0,2}, + {2,1,1,0,0,1,0,0,0,2}, + {2,0,0,1,1,0,0,1,0,2}, + {2,1,1,0,0,1,1,0,0,2}, + {2,0,0,1,1,0,0,1,1,2}, + {2,1,0,1,0,1,0,1,0,2} }; const uint8_t table_7_3_2_3_3_2_twoCodeword[4][10] = { - {2,0,1,2,3,4,0,0,0,2}, - {2,0,1,2,3,4,6,0,0,2}, - {2,0,1,2,3,4,5,6,0,2}, - {2,0,1,2,3,4,5,6,7,2} + {2,1,1,1,1,1,0,0,0,2}, + {2,1,1,1,1,1,0,1,0,2}, + {2,1,1,1,1,1,1,1,0,2}, + {2,1,1,1,1,1,1,1,1,2} }; -const uint8_t table_7_3_2_3_3_3_oneCodeword[24][5] = { - {1,0,0,0,0}, - {1,1,0,0,0}, - {1,0,1,0,0}, - {2,0,0,0,0}, - {2,1,0,0,0}, - {2,2,0,0,0}, - {2,3,0,0,0}, - {2,0,1,0,0}, - {2,2,3,0,0}, - {2,0,1,2,0}, - {2,0,1,2,3}, - {3,0,0,0,0}, - {3,1,0,0,0}, - {3,2,0,0,0}, - {3,3,0,0,0}, - {3,4,0,0,0}, - {3,5,0,0,0}, - {3,0,1,0,0}, - {3,2,3,0,0}, - {3,4,5,0,0}, - {3,0,1,2,0}, - {3,3,4,5,0}, - {3,0,1,2,3}, - {2,0,2,0,0} +const uint8_t table_7_3_2_3_3_3_oneCodeword[24][7] = { + {1,1,0,0,0,0,0}, + {1,0,1,0,0,0,0}, + {1,1,1,0,0,0,0}, + {2,1,0,0,0,0,0}, + {2,0,1,0,0,0,0}, + {2,0,0,1,0,0,0}, + {2,0,0,0,1,0,0}, + {2,1,1,0,0,0,0}, + {2,0,0,1,1,0,0}, + {2,1,1,1,0,0,0}, + {2,1,1,1,1,0,0}, + {3,1,0,0,0,0,0}, + {3,0,1,0,0,0,0}, + {3,0,0,1,0,0,0}, + {3,0,0,0,1,0,0}, + {3,0,0,0,0,1,0}, + {3,0,0,0,0,0,1}, + {3,1,1,0,0,0,0}, + {3,0,0,1,1,0,0}, + {3,0,0,0,0,1,1}, + {3,1,1,1,0,0,0}, + {3,0,0,0,1,1,1}, + {3,1,1,1,1,0,0}, + {3,1,0,1,0,0,0} }; const uint8_t table_7_3_2_3_3_3_twoCodeword[2][7] = { - {3,0,1,2,3,4,0}, - {3,0,1,2,3,4,5} + {3,1,1,1,1,1,0}, + {3,1,1,1,1,1,1} }; -const uint8_t table_7_3_2_3_3_4_oneCodeword[58][6] = { - {1,0,0,0,0,1}, - {1,1,0,0,0,1}, - {1,0,1,0,0,1}, - {2,0,0,0,0,1}, - {2,1,0,0,0,1}, - {2,2,0,0,0,1}, - {2,3,0,0,0,1}, - {2,0,1,0,0,1}, - {2,2,3,0,0,1}, - {2,0,1,2,0,1}, - {2,0,1,2,3,1}, - {3,0,0,0,0,1}, - {3,1,0,0,0,1}, - {3,2,0,0,0,1}, - {3,3,0,0,0,1}, - {3,4,0,0,0,1}, - {3,5,0,0,0,1}, - {3,0,1,0,0,1}, - {3,2,3,0,0,1}, - {3,4,5,0,0,1}, - {3,0,1,2,0,1}, - {3,3,4,5,0,1}, - {3,0,1,2,3,1}, - {2,0,2,0,0,1}, - {3,0,0,0,0,2}, - {3,1,0,0,0,2}, - {3,2,0,0,0,2}, - {3,3,0,0,0,2}, - {3,4,0,0,0,2}, - {3,5,0,0,0,2}, - {3,6,0,0,0,2}, - {3,7,0,0,0,2}, - {3,8,0,0,0,2}, - {3,9,0,0,0,2}, - {3,10,0,0,0,2}, - {3,11,0,0,0,2}, - {3,0,1,0,0,2}, - {3,2,3,0,0,2}, - {3,4,5,0,0,2}, - {3,6,7,0,0,2}, - {3,8,9,0,0,2}, - {3,10,11,0,0,2}, - {3,0,1,6,0,2}, - {3,2,3,8,0,2}, - {3,4,5,10,0,2}, - {3,0,1,6,7,2}, - {3,2,3,8,9,2}, - {3,4,5,10,11,2}, - {1,0,0,0,0,2}, - {1,1,0,0,0,2}, - {1,6,0,0,0,2}, - {1,7,0,0,0,2}, - {1,0,1,0,0,2}, - {1,6,7,0,0,2}, - {2,0,1,0,0,2}, - {2,2,3,0,0,2}, - {2,6,7,0,0,2}, - {2,8,9,0,0,2} +const uint8_t table_7_3_2_3_3_4_oneCodeword[58][14] = { + {1,1,0,0,0,0,0,0,0,0,0,0,0,1}, + {1,0,1,0,0,0,0,0,0,0,0,0,0,1}, + {1,1,1,0,0,0,0,0,0,0,0,0,0,1}, + {2,1,0,0,0,0,0,0,0,0,0,0,0,1}, + {2,0,1,0,0,0,0,0,0,0,0,0,0,1}, + {2,0,0,1,0,0,0,0,0,0,0,0,0,1}, + {2,0,0,0,1,0,0,0,0,0,0,0,0,1}, + {2,1,1,0,0,0,0,0,0,0,0,0,0,1}, + {2,0,0,1,1,0,0,0,0,0,0,0,0,1}, + {2,1,1,1,0,0,0,0,0,0,0,0,0,1}, + {2,1,1,1,1,0,0,0,0,0,0,0,0,1}, + {3,1,0,0,0,0,0,0,0,0,0,0,0,1}, + {3,0,1,0,0,0,0,0,0,0,0,0,0,1}, + {3,0,0,1,0,0,0,0,0,0,0,0,0,1}, + {3,0,0,0,1,0,0,0,0,0,0,0,0,1}, + {3,0,0,0,0,1,0,0,0,0,0,0,0,1}, + {3,0,0,0,0,0,1,0,0,0,0,0,0,1}, + {3,1,1,0,0,0,0,0,0,0,0,0,0,1}, + {3,0,0,1,1,0,0,0,0,0,0,0,0,1}, + {3,0,0,0,0,1,1,0,0,0,0,0,0,1}, + {3,1,1,1,0,0,0,0,0,0,0,0,0,1}, + {3,0,0,0,1,1,1,0,0,0,0,0,0,1}, + {3,1,1,1,1,0,0,0,0,0,0,0,0,1}, + {2,1,0,1,0,0,0,0,0,0,0,0,0,1}, + {3,1,0,0,0,0,0,0,0,0,0,0,0,2}, + {3,0,1,0,0,0,0,0,0,0,0,0,0,2}, + {3,0,0,1,0,0,0,0,0,0,0,0,0,2}, + {3,0,0,0,1,0,0,0,0,0,0,0,0,2}, + {3,0,0,0,0,1,0,0,0,0,0,0,0,2}, + {3,0,0,0,0,0,1,0,0,0,0,0,0,2}, + {3,0,0,0,0,0,0,1,0,0,0,0,0,2}, + {3,0,0,0,0,0,0,0,1,0,0,0,0,2}, + {3,0,0,0,0,0,0,0,0,1,0,0,0,2}, + {3,0,0,0,0,0,0,0,0,0,1,0,0,2}, + {3,0,0,0,0,0,0,0,0,0,0,1,0,2}, + {3,0,0,0,0,0,0,0,0,0,0,0,1,2}, + {3,1,1,0,0,0,0,0,0,0,0,0,0,2}, + {3,0,0,1,1,0,0,0,0,0,0,0,0,2}, + {3,0,0,0,0,1,1,0,0,0,0,0,0,2}, + {3,0,0,0,0,0,0,1,1,0,0,0,0,2}, + {3,0,0,0,0,0,0,0,0,1,1,0,0,2}, + {3,0,0,0,0,0,0,0,0,0,0,1,1,2}, + {3,1,1,0,0,0,0,1,0,0,0,0,0,2}, + {3,0,0,1,1,0,0,0,0,1,0,0,0,2}, + {3,0,0,0,0,1,1,0,0,0,0,1,0,2}, + {3,1,1,0,0,0,0,1,1,0,0,0,0,2}, + {3,0,0,1,1,0,0,0,0,1,1,0,0,2}, + {3,0,0,0,0,1,1,0,0,0,0,1,1,2}, + {1,1,0,0,0,0,0,0,0,0,0,0,0,2}, + {1,0,1,0,0,0,0,0,0,0,0,0,0,2}, + {1,0,0,0,0,0,0,1,0,0,0,0,0,2}, + {1,0,0,0,0,0,0,0,1,0,0,0,0,2}, + {1,1,1,0,0,0,0,0,0,0,0,0,0,2}, + {1,0,0,0,0,0,0,1,1,0,0,0,0,2}, + {2,1,1,0,0,0,0,0,0,0,0,0,0,2}, + {2,0,0,1,1,0,0,0,0,0,0,0,0,2}, + {2,0,0,0,0,0,0,1,1,0,0,0,0,2}, + {2,0,0,0,0,0,0,0,0,1,1,0,0,2} }; -const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10] = { - {3,0,1,2,3,4,0,0,0,1}, - {3,0,1,2,3,4,5,0,0,1}, - {2,0,1,2,3,6,0,0,0,2}, - {2,0,1,2,3,6,8,0,0,2}, - {2,0,1,2,3,6,7,8,0,2}, - {2,0,1,2,3,6,7,8,9,2} +const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14] = { + {3,1,1,1,1,1,0,0,0,0,0,0,0,1}, + {3,1,1,1,1,1,1,0,0,0,0,0,0,1}, + {2,1,1,1,1,0,0,1,0,0,0,0,0,2}, + {2,1,1,1,1,0,0,1,0,1,0,0,0,2}, + {2,1,1,1,1,0,0,1,1,1,0,0,0,2}, + {2,1,1,1,1,0,0,1,1,1,1,0,0,2}, }; // table 7.2-1 TS 38.321 diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 2bac03fc4f..1a1c8920c0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -698,6 +698,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1; else dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 2; + dlsch_config_pdu_1_0->dmrs_ports = 0; /* VRB_TO_PRB_MAPPING */ dlsch_config_pdu_1_0->vrb_to_prb_mapping = (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved:vrb_to_prb_mapping_interleaved; /* MCS TABLE INDEX */ @@ -974,31 +975,35 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr if ((dmrs_type == NULL) && (max_length == NULL)){ // Table 7.3.1.2.2-1: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=1 dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_1[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_1[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_1[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_1[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_1[dci->antenna_ports.val][4]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_1[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_1[dci->antenna_ports.val][4]<<3)); } if ((dmrs_type == NULL) && (max_length != NULL)){ // Table 7.3.1.2.2-2: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=2 if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][6]<<5) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][7]<<6) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][8]<<7)); + dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][9]; } if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5]; - dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6]; - dlsch_config_pdu_1_1->dmrs_ports[6] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][7]; - dlsch_config_pdu_1_1->dmrs_ports[7] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][8]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6]<<5) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][7]<<6) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][8]<<7)); dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][9]; } } @@ -1006,41 +1011,55 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr // Table 7.3.1.2.2-3: Antenna port(s) (1000 + DMRS port), dmrs-Type=2, maxLength=1 if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][6]<<5)); } if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5]; - dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6]<<5)); } } if ((dmrs_type != NULL) && (max_length != NULL)){ // Table 7.3.1.2.2-4: Antenna port(s) (1000 + DMRS port), dmrs-Type=2, maxLength=2 if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][6]<<5) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][7]<<6) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][8]<<7) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][9]<<8) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][10]<<9) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][11]<<10) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][12]<<11)); + dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][13]; } if (n_codewords == 1) { dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][0]; - dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1]; - dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]; - dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][3]; - dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4]; - dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5]; - dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6]; - dlsch_config_pdu_1_1->dmrs_ports[6] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][7]; - dlsch_config_pdu_1_1->dmrs_ports[7] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][8]; + dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1] + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<1) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4]<<3) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5]<<4) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6]<<5) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][7]<<6) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][8]<<7) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9]<<8) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][10]<<9) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][11]<<10) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][12]<<11)); dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9]; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8fcb544f18..36e1ff7735 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -694,8 +694,7 @@ void pf_dl(module_id_t module_id, const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2); if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; From ee2079816bc8b10c9be5bf3fce29f6a915c70b3c Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 23 Jun 2021 18:30:24 +0200 Subject: [PATCH 025/883] handling dl dmrs ports at mac and other modifications for semi static parameters for dlsch --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 41 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 10 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 117 ++++++++++++++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 10 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 9 +- 6 files changed, 123 insertions(+), 66 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 17cf1d77dd..b112790859 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -273,8 +273,8 @@ void nr_dlsim_preprocessor(module_id_t module_id, /* the following might override the table that is mandated by RRC * configuration */ ps->mcsTableIdx = g_mcsTableIdx; + ps->nrOfLayers = g_nrOfLayers; - sched_pdsch->nrOfLayers = g_nrOfLayers; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 36e1ff7735..2f6cf456a4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -453,8 +453,6 @@ bool allocate_dl_retransmission(module_id_t module_id, int rbStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; - const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2); int rbSize = 0; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; @@ -474,9 +472,8 @@ bool allocate_dl_retransmission(module_id_t module_id, } /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ - if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + if (ps->time_domain_allocation != tda || ps->nrOfLayers != UE_info->layers[UE_id]) + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps); } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ @@ -485,13 +482,12 @@ bool allocate_dl_retransmission(module_id_t module_id, while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) rbSize++; NR_pdsch_semi_static_t temp_ps; - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, &temp_ps); + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, retInfo->R, - retInfo->nrOfLayers, + temp_ps.nrOfLayers, temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT, retInfo->tb_size, @@ -603,7 +599,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - set_dl_nrOfLayers(sched_pdsch,sched_ctrl); + UE_info->layers[UE_id] = set_dl_nrOfLayers(sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, @@ -613,7 +609,7 @@ void pf_dl(module_id_t module_id, 0, /* N_PRB_DMRS * N_DMRS_SLOT */ 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - sched_pdsch->nrOfLayers) >> 3; + UE_info->layers[UE_id]) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); @@ -691,10 +687,9 @@ void pf_dl(module_id_t module_id, const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; - const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2); - if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + if (ps->nrOfLayers != UE_info->layers[UE_id] || + ps->time_domain_allocation != tda) + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; @@ -704,7 +699,7 @@ void pf_dl(module_id_t module_id, + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); nr_find_nb_rb(sched_pdsch->Qm, sched_pdsch->R, - sched_pdsch->nrOfLayers, + ps->nrOfLayers, ps->nrOfSymbols, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, sched_ctrl->num_total_bytes + oh, @@ -829,17 +824,17 @@ void nr_schedule_ue_spec(module_id_t module_id, const rnti_t rnti = UE_info->rnti[UE_id]; - /* POST processing */ - const uint8_t nrOfLayers = sched_pdsch->nrOfLayers; - const uint16_t R = sched_pdsch->R; - const uint8_t Qm = sched_pdsch->Qm; - const uint32_t TBS = sched_pdsch->tb_size; - /* pre-computed PDSCH values that only change if time domain * allocation/DMRS parameters change. Updated in the preprocessor through * nr_set_pdsch_semi_static() */ NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; + /* POST processing */ + const uint8_t nrOfLayers = ps->nrOfLayers; + const uint16_t R = sched_pdsch->R; + const uint8_t Qm = sched_pdsch->Qm; + const uint32_t TBS = sched_pdsch->tb_size; + int8_t current_harq_pid = sched_pdsch->dl_harq_pid; if (current_harq_pid < 0) { /* PP has not selected a specific HARQ Process, get a new one */ @@ -949,7 +944,7 @@ void nr_schedule_ue_spec(module_id_t module_id, pdsch_pdu->dlDmrsScramblingId = *scc->physCellId; pdsch_pdu->SCID = 0; pdsch_pdu->numDmrsCdmGrpsNoData = ps->numDmrsCdmGrpsNoData; - pdsch_pdu->dmrsPorts = 1; + pdsch_pdu->dmrsPorts = (1<resourceAlloc = 1; @@ -1031,7 +1026,7 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_payload.tpc = sched_ctrl->tpc1; // TPC for PUCCH: table 7.2.1-1 in 38.213 dci_payload.pucch_resource_indicator = pucch->resource_indicator; dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI - dci_payload.antenna_ports.val = 0; // nb of cdm groups w/o data 1 and dmrs port 0 + dci_payload.antenna_ports.val = ps->dmrs_ports_id; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; LOG_D(NR_MAC, "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 56034353ac..c6bd51c46b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -365,12 +365,10 @@ void nr_preprocessor_phytest(module_id_t module_id, sched_pdsch->rbStart = rbStart; sched_pdsch->rbSize = rbSize; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; - const uint8_t num_dmrs_cdm_grps_no_data = 1; - if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps); + int nrOfLayers = 1; + if (ps->time_domain_allocation != tda || ps->nrOfLayers != nrOfLayers) + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, nrOfLayers, sched_ctrl, ps); - sched_pdsch->nrOfLayers = 1; sched_pdsch->mcs = target_dl_mcs; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -381,7 +379,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - sched_pdsch->nrOfLayers) + ps->nrOfLayers) >> 3; /* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 6822354ad3..a05d585941 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -137,12 +137,11 @@ static inline uint8_t get_max_cces(uint8_t scs) { } -void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, - NR_UE_sched_ctrl_t *sched_ctrl) { +uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl) { - // for now this should be enough + // TODO check this but it should be enough for now // if there is not csi report RI is 0 from initialization - sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1; + return (sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1); } @@ -193,6 +192,36 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, } } +void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { + + //TODO first basic implementation of dmrs port selection + // only vaild for a single codeword + // for now it assumes a selection of Nl consecutive dmrs ports + // and a single front loaded symbol + // dmrs_ports_id is the index of Tables 7.3.1.2.2-1/2/3/4 + + switch (ps->nrOfLayers) { + case 1: + ps->dmrs_ports_id = 0; + ps->numDmrsCdmGrpsNoData = 1; + break; + case 2: + ps->dmrs_ports_id = 2; + ps->numDmrsCdmGrpsNoData = 1; + break; + case 3: + ps->dmrs_ports_id = 9; + ps->numDmrsCdmGrpsNoData = 2; + break; + case 4: + ps->dmrs_ports_id = 10; + ps->numDmrsCdmGrpsNoData = 2; + break; + default: + AssertFatal(1==0,"Number of layers %d\n not supported or not valid\n",ps->nrOfLayers); + } +} + NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, NR_BWP_Downlink_t *bwp, NR_SearchSpace_t *ss, @@ -341,20 +370,11 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *secondaryCellGroup, const NR_BWP_Downlink_t *bwp, int tda, - uint8_t num_dmrs_cdm_grps_no_data, + uint8_t layers, + NR_UE_sched_ctrl_t *sched_ctrl, NR_pdsch_semi_static_t *ps) { - ps->time_domain_allocation = tda; - const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? - bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); - const int mapping_type = tdaList->list.array[tda]->mappingType; - const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; - SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); - - ps->mcsTableIdx = 0; if (bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pdsch_Config && @@ -367,14 +387,57 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, } else ps->mcsTableIdx = 0; - ps->numDmrsCdmGrpsNoData = num_dmrs_cdm_grps_no_data; - ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0; + NR_PDSCH_Config_t *pdsch_Config; + if (bwp && + bwp->bwp_Dedicated && + bwp->bwp_Dedicated->pdsch_Config && + bwp->bwp_Dedicated->pdsch_Config->choice.setup) + pdsch_Config = bwp->bwp_Dedicated->pdsch_Config->choice.setup; + else + pdsch_Config = NULL; - // if no data in dmrs cdm group is 1 only even REs have no data - // if no data in dmrs cdm group is 2 both odd and even REs have no data - ps->N_PRB_DMRS = num_dmrs_cdm_grps_no_data * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); - ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwp ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type); - ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); + if (ps->time_domain_allocation != tda) { + ps->time_domain_allocation = tda; + const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? + bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); + ps->mapping_type = tdaList->list.array[tda]->mappingType; + if (pdsch_Config) { + if (ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB) + ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type == NULL ? 0 : 1; + else + ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1; + } + else + ps->dmrsConfigType = NFAPI_NR_DMRS_TYPE1; + const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; + SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); + ps->dl_dmrs_symb_pos = fill_dmrs_mask(pdsch_Config, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type); + ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); + } + + const long dci_format = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; + if (dci_format == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0 || + pdsch_Config == NULL) { + if (ps->nrOfSymbols == 2 && ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB) + ps->numDmrsCdmGrpsNoData = 1; + else { + if (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1) + ps->numDmrsCdmGrpsNoData = 2; + else + ps->numDmrsCdmGrpsNoData = 3; + } + ps->dmrs_ports_id = 0; + } + else { + if (ps->nrOfLayers != layers) { + ps->nrOfLayers = layers; + set_dl_dmrs_ports(ps); + } + } + + ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); } void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, @@ -671,7 +734,7 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, } void config_uldci(const NR_BWP_Uplink_t *ubwp, - const NR_ServingCellConfigCommon_t *scc, + const NR_ServingCellConfigCommon_t *scc, const nfapi_nr_pusch_pdu_t *pusch_pdu, dci_pdu_rel15_t *dci_pdu_rel15, int dci_format, @@ -810,15 +873,15 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, // This function configures pucch pdu fapi structure void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, - NR_ServingCellConfigCommon_t *scc, - NR_CellGroupConfig_t *CellGroup, - NR_BWP_Uplink_t *bwp, + NR_ServingCellConfigCommon_t *scc, + NR_CellGroupConfig_t *CellGroup, + NR_BWP_Uplink_t *bwp, uint16_t rnti, uint8_t pucch_resource, uint16_t O_csi, uint16_t O_ack, uint8_t O_sr, - int r_pucch) { + int r_pucch) { NR_PUCCH_Config_t *pucch_Config; NR_PUCCH_Resource_t *pucchres; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index eba95b5cdc..a54d143f42 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -230,7 +230,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, uint16_t O_csi, uint16_t O_ack, uint8_t O_sr, - int r_pucch); + int r_pucch); void find_search_space(int ss_type, NR_BWP_Downlink_t *bwp, @@ -273,7 +273,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *secondaryCellGroup, const NR_BWP_Downlink_t *bwp, int tda, - uint8_t num_dmrs_cdm_grps_no_data, + uint8_t layers, + NR_UE_sched_ctrl_t *sched_ctrl, NR_pdsch_semi_static_t *ps); void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, @@ -415,12 +416,13 @@ int16_t ssb_index_from_prach(module_id_t module_idP, void find_SSB_and_RO_available(module_id_t module_idP); +void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps); + void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t mcs_table_idx); -void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, - NR_UE_sched_ctrl_t *sched_ctrl); +uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl); void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 81df35cf06..84f92fc130 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -362,12 +362,12 @@ typedef struct NR_sched_pusch { typedef struct NR_pdsch_semi_static { int time_domain_allocation; uint8_t numDmrsCdmGrpsNoData; - + int mapping_type; int startSymbolIndex; int nrOfSymbols; - + uint8_t nrOfLayers; uint8_t mcsTableIdx; - + uint8_t dmrs_ports_id; uint8_t N_PRB_DMRS; uint8_t N_DMRS_SLOT; uint16_t dl_dmrs_symb_pos; @@ -383,7 +383,6 @@ typedef struct NR_sched_pdsch { uint8_t mcs; /// TBS-related info - uint8_t nrOfLayers; uint16_t R; uint8_t Qm; uint32_t tb_size; @@ -626,7 +625,7 @@ typedef struct { NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB]; NR_list_t list; int num_UEs; - + int layers[MAX_MOBILES_PER_GNB]; bool active[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB]; From c9a3125937745258d7d01d5bc48387a51486b3b2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 24 Jun 2021 14:37:24 +0200 Subject: [PATCH 026/883] get nrOfLayers from DCI info at UE --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 9 ++++++++- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 06975b026f..11fe8847bb 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -122,7 +122,14 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; dlsch0_harq->harq_ack.pucch_resource_indicator = dlsch_config_pdu->pucch_resource_id; dlsch0_harq->harq_ack.slot_for_feedback_ack = (slot+dlsch_config_pdu->pdsch_to_harq_feedback_time_ind)%frame_parms.slots_per_frame; - dlsch0_harq->Nl=1; + + //get nrOfLayers from DCI info + uint8_t Nl = 0; + for (i = 0; i < 12; i++) { // max 12 ports + if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1; + } + dlsch0_harq->Nl = Nl; + dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table; dlsch0_harq->harq_ack.rx_status = downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch0->rnti_type); if (dlsch0_harq->status != ACTIVE) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 1a1c8920c0..db3c7dfba6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -698,7 +698,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1; else dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 2; - dlsch_config_pdu_1_0->dmrs_ports = 0; + dlsch_config_pdu_1_0->dmrs_ports = 1; // only port 0 in case of DCI 1_0 /* VRB_TO_PRB_MAPPING */ dlsch_config_pdu_1_0->vrb_to_prb_mapping = (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved:vrb_to_prb_mapping_interleaved; /* MCS TABLE INDEX */ From a8c4dd537f4ec71ddcaf82c3d7dcb98a928b742f Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 25 Jun 2021 18:10:16 +0200 Subject: [PATCH 027/883] fill dmrs mask depending on actual number of frontloaded symbols, not maxlength --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 22 +++++-------------- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 4 +--- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 18 +++++++++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 8 +++---- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 17 ++++++++++++-- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + 8 files changed, 42 insertions(+), 36 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index a5a9aac7ec..d86a6ae2c6 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2352,10 +2352,6 @@ int get_num_dmrs(uint16_t dmrs_mask ) { for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); return(num_dmrs); } -/* returns the total DMRS symbols in a slot*/ -uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype){ - return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols, startSymbol, mappingtype)); -} // Table 5.1.2.2.1-1 38.214 uint8_t getRBGSize(uint16_t bwp_size, long rbg_size_config) { @@ -3010,9 +3006,9 @@ int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, sl else return(slot_in_period >= slots1+tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0); } -int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI) { +int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI, int length) { - int l0;int dmrs_AdditionalPosition = 0;int maxLength = 0; + int l0;int dmrs_AdditionalPosition = 0; NR_DMRS_DownlinkConfig_t *dmrs_config = NULL; LOG_D(MAC, "NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", NrOfSymbols, startSymbol, mappingtype_fromDCI, dmrs_TypeA_Position); @@ -3024,7 +3020,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i // in case of DCI FORMAT 1_0 or dedicated pdsch config not received additionposition = pos2, len1 should be used // referred to section 5.1.6.2 in 38.214 dmrs_AdditionalPosition = 2; - maxLength = 1; if (pdsch_Config != NULL) { if (mappingtype_fromDCI == typeA) { // Type A @@ -3039,8 +3034,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i AssertFatal(dmrs_config != NULL," DMRS configs not present in PDSCH DMRS Downlink config\n"); - // default values of maxlength = len2, additionalposition is pos2 - if (dmrs_config->maxLength != NULL) maxLength = 2; + // default values of additionalposition is pos2 if (dmrs_config->dmrs_AdditionalPosition != NULL) dmrs_AdditionalPosition = *dmrs_config->dmrs_AdditionalPosition; } @@ -3055,11 +3049,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i // For TypeB, ld is the duration of the scheduled PDSCH resources ld = (mappingtype_fromDCI == typeA) ? (NrOfSymbols + startSymbol) : NrOfSymbols; - // Section 7.4.1.1.2 in Spec 38.211 - //For PDSCH Mapping typeB, if PDSCH duration ld <=4, only single symbol DMRS is supported - if (mappingtype_fromDCI == typeB && ld <= 4) - maxLength = 1; - AssertFatal(ld > 2 && ld < 15,"Illegal NrOfSymbols according to Table 5.1.2.1-1 Spec 38.214 %d\n",ld); AssertFatal((NrOfSymbols + startSymbol) < 15,"Illegal S+L according to Table 5.1.2.1-1 Spec 38.214 S:%d L:%d\n",startSymbol, NrOfSymbols); @@ -3076,7 +3065,8 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i } - if (maxLength == 1) { + // number of front loaded symbols + if (length == 1) { row = ld - 2; l_prime = table_7_4_1_1_2_3_pdsch_dmrs_positions_l[row][column]; l0 = 1 << l0; @@ -3087,7 +3077,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i l0 = 1<=0,"ERROR in configuration.Check Time Domain allocation of this Grant. l_prime < 1. row:%d, column:%d\n", row, column); l_prime = (mappingtype_fromDCI == typeA) ? (l_prime | l0) : (l_prime << startSymbol); diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index a6adb47c0a..af197fa620 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -47,7 +47,7 @@ uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn); uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw); -int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI); +int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI,int length); int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slot_t slotP); @@ -153,8 +153,6 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config, uint8_t *reOffset, uint8_t *maxNumPorts, uint8_t *ulPower, uint8_t NrOfSymbols); -uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype); - /* \brief Set the transform precoding according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16 @param *pusch_config, pointer to pusch config @param *ubwp pointer to uplink bwp diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index db3c7dfba6..0a705e92df 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -691,7 +691,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr mac->mib->dmrs_TypeA_Position, dlsch_config_pdu_1_0->number_symbols, dlsch_config_pdu_1_0->start_symbol, - mappingtype); + mappingtype, 1); dlsch_config_pdu_1_0->dmrsConfigType = (mac->DLbwp[0] != NULL) ? (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0; /* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */ if (dlsch_config_pdu_1_0->number_symbols == 2) @@ -887,12 +887,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB); - /* dmrs symbol positions*/ - dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, - mac->scc->dmrs_TypeA_Position, - dlsch_config_pdu_1_1->number_symbols, - dlsch_config_pdu_1_1->start_symbol, - mappingtype); dlsch_config_pdu_1_1->dmrsConfigType = mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1; /* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214, using tables 7.3.1.2.2-1, 7.3.1.2.2-2, 7.3.1.2.2-3, 7.3.1.2.2-4 of 3GPP TS 38.212 */ @@ -964,6 +958,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr uint8_t n_codewords = 1; // FIXME!!! long *max_length = NULL; long *dmrs_type = NULL; + dlsch_config_pdu_1_1->n_front_load_symb = 1; // default value if (pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA) { max_length = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength; dmrs_type = pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type; @@ -1063,6 +1058,15 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9]; } } + + /* dmrs symbol positions*/ + dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, + mac->scc->dmrs_TypeA_Position, + dlsch_config_pdu_1_1->number_symbols, + dlsch_config_pdu_1_1->start_symbol, + mappingtype, + dlsch_config_pdu_1_1->n_front_load_symb); + /* TCI */ if (mac->dl_config_request.dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.tci_present_in_dci == 1){ // 0 bit if higher layer parameter tci-PresentInDCI is not enabled diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 5b69bbbbb5..bcc3059373 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1063,7 +1063,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, - mappingtype); + mappingtype, 1); int x_Overhead = 0; uint8_t tb_scaling = 0; @@ -1258,7 +1258,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra scc->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, - mappingtype); + mappingtype, 1); uint16_t N_DMRS_SLOT = get_num_dmrs(dlDmrsSymbPos); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 8b12742fcc..8d6a82a12b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -376,7 +376,7 @@ void schedule_control_sib1(module_id_t module_id, // Calculate number of PRB_DMRS uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6; - uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype); + uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1); uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos); LOG_D(MAC,"dlDmrsSymbPos %x\n",dlDmrsSymbPos); @@ -613,7 +613,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) // Calculate number of PRB_DMRS uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6; - uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype); + uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1); uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos); const uint32_t TBS = nr_compute_tbs(nr_get_Qm_dl(gNB_mac->sched_ctrlCommon->sched_pdsch.mcs, gNB_mac->sched_ctrlCommon->pdsch_semi_static.mcsTableIdx), diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c6bd51c46b..e6bfc73fbe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -166,10 +166,10 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex; pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols; pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, - scc->dmrs_TypeA_Position, - NrOfSymbols, - StartSymbolIndex, - mappingtype); + scc->dmrs_TypeA_Position, + NrOfSymbols, + StartSymbolIndex, + mappingtype, 1); /* AssertFatal(k0==0,"k0 is not zero for Initial DL BWP TimeDomain Alloc\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index a05d585941..e597ae936f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -200,22 +200,29 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { // and a single front loaded symbol // dmrs_ports_id is the index of Tables 7.3.1.2.2-1/2/3/4 + // number of front loaded symbols need to be consistent with maxLength + // when a more complete implementation is done + switch (ps->nrOfLayers) { case 1: ps->dmrs_ports_id = 0; ps->numDmrsCdmGrpsNoData = 1; + ps->frontloaded_symb = 1; break; case 2: ps->dmrs_ports_id = 2; ps->numDmrsCdmGrpsNoData = 1; + ps->frontloaded_symb = 1; break; case 3: ps->dmrs_ports_id = 9; ps->numDmrsCdmGrpsNoData = 2; + ps->frontloaded_symb = 1; break; case 4: ps->dmrs_ports_id = 10; ps->numDmrsCdmGrpsNoData = 2; + ps->frontloaded_symb = 1; break; default: AssertFatal(1==0,"Number of layers %d\n not supported or not valid\n",ps->nrOfLayers); @@ -375,6 +382,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, NR_pdsch_semi_static_t *ps) { + bool reset_dmrs = false; if (bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pdsch_Config && @@ -397,6 +405,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, pdsch_Config = NULL; if (ps->time_domain_allocation != tda) { + reset_dmrs = true; ps->time_domain_allocation = tda; const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : @@ -413,8 +422,6 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->dmrsConfigType = NFAPI_NR_DMRS_TYPE1; const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); - ps->dl_dmrs_symb_pos = fill_dmrs_mask(pdsch_Config, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type); - ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); } const long dci_format = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; @@ -429,15 +436,21 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->numDmrsCdmGrpsNoData = 3; } ps->dmrs_ports_id = 0; + ps->frontloaded_symb = 1; } else { if (ps->nrOfLayers != layers) { + reset_dmrs = true; ps->nrOfLayers = layers; set_dl_dmrs_ports(ps); } } ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); + if (reset_dmrs) { + ps->dl_dmrs_symb_pos = fill_dmrs_mask(pdsch_Config, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type, ps->frontloaded_symb); + ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); + } } void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 84f92fc130..3b38803dd2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -362,6 +362,7 @@ typedef struct NR_sched_pusch { typedef struct NR_pdsch_semi_static { int time_domain_allocation; uint8_t numDmrsCdmGrpsNoData; + uint8_t frontloaded_symb; int mapping_type; int startSymbolIndex; int nrOfSymbols; From 1de542eb35c91aad8f60c1ff9846ce3fbce53392 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 1 Jul 2021 14:41:05 +0200 Subject: [PATCH 028/883] removing layers from UE_info --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 17 ++++++++++------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2f6cf456a4..fd477ae834 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -472,8 +472,8 @@ bool allocate_dl_retransmission(module_id_t module_id, } /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ - if (ps->time_domain_allocation != tda || ps->nrOfLayers != UE_info->layers[UE_id]) - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps); + if (ps->time_domain_allocation != tda) + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, ps->nrOfLayers, sched_ctrl, ps); } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ @@ -482,7 +482,7 @@ bool allocate_dl_retransmission(module_id_t module_id, while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) rbSize++; NR_pdsch_semi_static_t temp_ps; - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, &temp_ps); + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, ps->nrOfLayers, sched_ctrl, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, @@ -563,6 +563,7 @@ void pf_dl(module_id_t module_id, float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled int ue_array[MAX_MOBILES_PER_GNB]; + int layers[MAX_MOBILES_PER_GNB]; NR_list_t UE_sched = { .head = -1, .next = ue_array, .tail = -1, .len = MAX_MOBILES_PER_GNB }; /* Loop UE_info->list to check retransmission */ @@ -575,6 +576,8 @@ void pf_dl(module_id_t module_id, /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head; + layers[UE_id] = ps->nrOfLayers; // initialization of layers to the previous value in the strcuture + /* Calculate Throughput */ const float a = 0.0005f; // corresponds to 200ms window const uint32_t b = UE_info->mac_stats[UE_id].dlsch_current_bytes; @@ -599,7 +602,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); - UE_info->layers[UE_id] = set_dl_nrOfLayers(sched_ctrl); + layers[UE_id] = set_dl_nrOfLayers(sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, @@ -609,7 +612,7 @@ void pf_dl(module_id_t module_id, 0, /* N_PRB_DMRS * N_DMRS_SLOT */ 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - UE_info->layers[UE_id]) >> 3; + layers[UE_id]) >> 3; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); @@ -687,9 +690,9 @@ void pf_dl(module_id_t module_id, const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - if (ps->nrOfLayers != UE_info->layers[UE_id] || + if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda) - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps); + nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, layers[UE_id], sched_ctrl, ps); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3b38803dd2..9b88f19d14 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -626,7 +626,6 @@ typedef struct { NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB]; NR_list_t list; int num_UEs; - int layers[MAX_MOBILES_PER_GNB]; bool active[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB]; From c72156aa070f8cb2ff251e6a23f89c68ad8ba78b Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 6 Jul 2021 17:45:10 +0200 Subject: [PATCH 029/883] bugfix in set_dl_mcs --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 3aad4980bc..0d7746e196 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -372,8 +372,8 @@ void nr_processULSegment(void* arg) { rv_index, (ulsch_harq->round==0)?1:0, E, - ulsch_harq->F, - Kr-ulsch_harq->F-2*(p_decoderParms->Z))==-1) { + ulsch_harq->F, + Kr-ulsch_harq->F-2*(p_decoderParms->Z))==-1) { stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index fd477ae834..7ba0a9cd94 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -866,7 +866,7 @@ void nr_schedule_ue_spec(module_id_t module_id, UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; LOG_D(NR_MAC, - "%4d.%2d RNTI %04x start %3d RBs %3d startSymbol %2d nb_symbol %2d MCS %2d TBS %4d HARQ PID %2d round %d NDI %d\n", + "%4d.%2d RNTI %04x start %3d RBs %3d startSymbol %2d nb_symbol %2d MCS %2d nrOfLayers %d TBS %4d HARQ PID %2d round %d NDI %d\n", frame, slot, rnti, @@ -875,6 +875,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ps->startSymbolIndex, ps->nrOfSymbols, sched_pdsch->mcs, + nrOfLayers, TBS, current_harq_pid, harq->round, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index e597ae936f..96047d541a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -159,15 +159,15 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, switch (cqi_table) { case 0: target_qm = cqi_table1[cqi_idx][0]; - target_coderate = cqi_table1[cqi_idx][0]; + target_coderate = cqi_table1[cqi_idx][1]; break; case 1: target_qm = cqi_table2[cqi_idx][0]; - target_coderate = cqi_table2[cqi_idx][0]; + target_coderate = cqi_table2[cqi_idx][1]; break; case 2: target_qm = cqi_table3[cqi_idx][0]; - target_coderate = cqi_table3[cqi_idx][0]; + target_coderate = cqi_table3[cqi_idx][1]; break; default: AssertFatal(1==0,"Invalid cqi table index %d\n",cqi_table); From 9709b5efe70331b4dfaa0cb3edcef51c687bdbb8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 7 Jul 2021 17:41:36 +0200 Subject: [PATCH 030/883] copying retInfo to sched_pusch in the right place --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index b9b3f336fa..40f426e3d0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -846,9 +846,6 @@ bool allocate_ul_retransmission(module_id_t module_id, retInfo->frame = sched_ctrl->sched_pusch.frame; retInfo->slot = sched_ctrl->sched_pusch.slot; - // Get previous PUSCH filed info - sched_ctrl->sched_pusch = *retInfo; - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0; const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -907,6 +904,9 @@ bool allocate_ul_retransmission(module_id_t module_id, retInfo->rbSize = new_rbSize; retInfo->time_domain_allocation = tda; sched_ctrl->pusch_semi_static = temp_ps; + + // Get previous PUSCH filed info + sched_ctrl->sched_pusch = *retInfo; } /* Find free CCE */ @@ -1572,7 +1572,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) n_ubwp = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count; config_uldci(sched_ctrl->active_ubwp, - scc, + scc, pusch_pdu, &uldci_payload, ps->dci_format, From cdbdb15858c888c2583da1318de6d90508696dac Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 28 Apr 2021 18:06:14 +0200 Subject: [PATCH 031/883] fix 2 layer MIMO in nr_dlsim after last merge with develop --- openair1/SIMULATION/NR_PHY/dlsim.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 05d153b661..fa2290c7f6 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -240,9 +240,9 @@ void update_ptrs_config(NR_CellGroupConfig_t *secondaryCellGroup, uint16_t *rbSi void update_dmrs_config(NR_CellGroupConfig_t *scg,PHY_VARS_NR_UE *ue, int8_t* dmrs_arg); extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration -/* specific dlsim DL preprocessor: uses rbStart/rbSize/mcs from command line of +/* specific dlsim DL preprocessor: uses rbStart/rbSize/mcs/nrOfLayers from command line of dlsim, does not search for CCE/PUCCH occasion but simply sets to 0 */ -int g_mcsIndex = -1, g_mcsTableIdx = 0, g_rbStart = -1, g_rbSize = -1; +int g_mcsIndex = -1, g_mcsTableIdx = 0, g_rbStart = -1, g_rbSize = -1, g_nrOfLayers = 1; void nr_dlsim_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t slot) { @@ -267,7 +267,8 @@ void nr_dlsim_preprocessor(module_id_t module_id, UE_info->CellGroup[0], sched_ctrl->active_bwp, /* tda = */ 2, - /* num_dmrs_cdm_grps_no_data = */ 1, + g_nrOfLayers, + sched_ctrl, ps); NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; @@ -288,7 +289,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, 0 /* N_PRB_oh, 0 for initialBWP */, 0 /* tb_scaling */, - sched_pdsch->nrOfLayers) + g_nrOfLayers) >> 3; /* the simulator assumes the HARQ PID is equal to the slot number */ @@ -356,7 +357,7 @@ int main(int argc, char **argv) // char fname[40], vname[40]; int trial, n_trials = 1, n_errors = 0, n_false_positive = 0; //int n_errors2, n_alamouti; - uint8_t transmission_mode = 1,n_tx=1,n_rx=1; + uint8_t n_tx=1,n_rx=1; uint8_t round; uint8_t num_rounds = 4; @@ -513,12 +514,11 @@ int main(int argc, char **argv) break; */ case 'x': - transmission_mode=atoi(optarg); + g_nrOfLayers=atoi(optarg); - if ((transmission_mode!=1) && - (transmission_mode!=2) && - (transmission_mode!=6)) { - printf("Unsupported transmission mode %d\n",transmission_mode); + if ((g_nrOfLayers!=1) && + (g_nrOfLayers!=2)) { + printf("Unsupported nr Of Layers %d\n",g_nrOfLayers); exit(-1); } @@ -1162,6 +1162,7 @@ int main(int argc, char **argv) } nr_ue_dcireq(&dcireq); //to be replaced with function pointer later + UE_harq_process->Nl = g_nrOfLayers; nr_ue_scheduled_response(&scheduled_response); phy_procedures_nrUE_RX(UE, From 2e8018d28f12f9cf63620ba0febbbb031d581834 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 14 Jul 2021 16:15:47 +0200 Subject: [PATCH 032/883] avoid segmentation fault in scheduling csirs for sa --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 881e1aa4c9..01e076ac8d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2207,6 +2207,10 @@ void nr_csirs_scheduling(int Mod_idP, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id]; + + if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || + !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) continue; + NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList != NULL) { From 0934403a428dc457689aa4bf55d95f8829172655 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 10 Aug 2021 14:26:09 +0200 Subject: [PATCH 033/883] bugfix in setting the nb of layers for sa --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 01e076ac8d..7bd7ba1d48 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -437,6 +437,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, } ps->dmrs_ports_id = 0; ps->frontloaded_symb = 1; + ps->nrOfLayers = 1; } else { if (ps->nrOfLayers != layers) { From 822d8e71adb624de9833b3fcf24bc3026c4f94d6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 27 Aug 2021 16:05:35 +0200 Subject: [PATCH 034/883] fixed missed initialization --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d5e3d5987c..65e4ee32f0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -483,7 +483,7 @@ bool allocate_dl_retransmission(module_id_t module_id, rbStart++; while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) rbSize++; - NR_pdsch_semi_static_t temp_ps; + NR_pdsch_semi_static_t temp_ps = *ps; nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, ps->nrOfLayers, sched_ctrl, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; From 32bbf94c5dc5c624d1896dbacec2cf74d5029b06 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 7 Sep 2021 16:54:53 +0200 Subject: [PATCH 035/883] adding condition to use type 2 only for OAI UE --- openair2/RRC/NR/rrc_gNB_reconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index a7de5249f2..cc3688b424 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -632,7 +632,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco } bwp->bwp_Dedicated->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL; - if (dl_antenna_ports > 1)// for MIMO, we use DMRS Config Type 2 + if ((get_softmodem_params()->do_ra || + get_softmodem_params()->phy_test) && + dl_antenna_ports > 1) // for MIMO, we use DMRS Config Type 2 but only with OAI UE bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type)); else bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL; From 9a09335495a5d1ec5d1ff075b6d5b18a262ad99e Mon Sep 17 00:00:00 2001 From: Xue Song Date: Fri, 10 Sep 2021 08:41:21 +0000 Subject: [PATCH 036/883] add rrc_gNB_modify_dedicatedRRCReconfiguration() add rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ() add rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP() --- openair2/RRC/NR/nr_rrc_defs.h | 12 +- openair2/RRC/NR/rrc_gNB.c | 196 +++++++++++++++++++++++ openair2/RRC/NR/rrc_gNB_NGAP.c | 258 ++++++++++++++++++++++++++++++ openair2/RRC/NR/rrc_gNB_NGAP.h | 22 +++ openair2/RRC/NR_UE/rrc_UE.c | 4 +- openair3/NGAP/ngap_gNB_handlers.c | 10 +- 6 files changed, 491 insertions(+), 11 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index c8b412df1f..1bc4d55547 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -345,14 +345,18 @@ typedef struct gNB_RRC_UE_s { uint8_t setup_e_rabs; /* Number of e_rab to be setup in the list */ uint8_t nb_of_e_rabs; - /* Total number of pdu session already setup in the list */ - uint8_t setup_pdu_sessions; - /* Number of pdu session to be setup in the list */ - uint8_t nb_of_pdusessions; /* Number of e_rab to be modified in the list */ uint8_t nb_of_modify_e_rabs; uint8_t nb_of_failed_e_rabs; e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB]; + /* Total number of pdu session already setup in the list */ + uint8_t setup_pdu_sessions; + /* Number of pdu session to be setup in the list */ + uint8_t nb_of_pdusessions; + /* Number of e_rab to be modified in the list */ + uint8_t nb_of_modify_pdusessions; + uint8_t nb_of_failed_pdusessions; + pdu_session_param_t modify_pdusession[NR_NB_RB_MAX]; /* list of e_rab to be setup by RRC layers */ /* list of pdu session to be setup by RRC layers */ e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB]; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 810e83fc43..845ce87cdf 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1156,6 +1156,187 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( #endif } +//----------------------------------------------------------------------------- +int +rrc_gNB_modify_dedicatedRRCReconfiguration( + const protocol_ctxt_t *const ctxt_pP, + rrc_gNB_ue_context_t *ue_context_pP) +//----------------------------------------------------------------------------- +{ + NR_DRB_ToAddMod_t *DRB_config = NULL; + NR_DRB_ToAddModList_t **DRB_configList = NULL; + NR_DRB_ToAddModList_t *DRB_configList2 = NULL; + struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList + *dedicatedNAS_MessageList = NULL; + NR_DedicatedNAS_Message_t *dedicatedNAS_Message = NULL; + uint8_t buffer[RRC_BUF_SIZE]; + uint16_t size; + int qos_flow_index = 0; + NR_QFI_t qfi = 0; + int i, j; + + uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id); + DRB_configList = &ue_context_pP->ue_context.DRB_configList; + + DRB_configList2 = CALLOC(1, sizeof(NR_DRB_ToAddModList_t)); + memset(DRB_configList2, 0, sizeof(NR_DRB_ToAddModList_t)); + + dedicatedNAS_MessageList = CALLOC(1, sizeof(struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList)); + + for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) { + // bypass the new and already configured pdu sessions + if (ue_context_pP->ue_context.modify_pdusession[i].status >= PDU_SESSION_STATUS_DONE) { + ue_context_pP->ue_context.modify_pdusession[i].xid = xid; + continue; + } + + if (ue_context_pP->ue_context.modify_pdusession[i].cause != NGAP_CAUSE_NOTHING) { + // set xid of failure pdu session + ue_context_pP->ue_context.modify_pdusession[i].xid = xid; + ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED; + continue; + } + + // search exist DRB_config + for (j = 0; j < (*DRB_configList)->list.count; j++) { + if ((*DRB_configList)->list.array[j]->cnAssociation->choice.sdap_Config->pdu_Session == + ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id) { + DRB_config = (*DRB_configList)->list.array[j]; + break; + } + } + + if (DRB_config == NULL) { + ue_context_pP->ue_context.modify_pdusession[i].xid = xid; + ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED; + ue_context_pP->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK; + ue_context_pP->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_unspecified; + ue_context_pP->ue_context.nb_of_failed_pdusessions++; + continue; + } + + // Reference TS23501 Table 5.7.4-1: Standardized 5QI to QoS characteristics mapping + for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) { + switch (ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI) { + case 1: //100ms + case 2: //150ms + case 3: //50ms + case 4: //300ms + case 5: //100ms + case 6: //300ms + case 7: //100ms + case 8: //300ms + case 9: //300ms Video (Buffered Streaming)TCP-based (e.g., www, e-mail, chat, ftp, p2p file sharing, progressive video, etc.) + // TODO + break; + + default: + LOG_E(NR_RRC,"not supported 5qi %lu\n", ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI); + ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED; + ue_context_pP->ue_context.modify_pdusession[i].xid = xid; + ue_context_pP->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK; + ue_context_pP->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_not_supported_5QI_value; + ue_context_pP->ue_context.nb_of_failed_pdusessions++; + continue; + } + + LOG_I(NR_RRC, "PDU SESSION ID %ld, DRB ID %ld (index %d), QOS flow %d, 5QI %ld \n", + DRB_config->cnAssociation->choice.sdap_Config->pdu_Session, + DRB_config->drb_Identity, i, + qos_flow_index, + ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI + ); + } + + ASN_SEQUENCE_ADD(&DRB_configList2->list, DRB_config); + + ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_DONE; + ue_context_pP->ue_context.modify_pdusession[i].xid = xid; + + if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) { + dedicatedNAS_Message = CALLOC(1, sizeof(NR_DedicatedNAS_Message_t)); + memset(dedicatedNAS_Message, 0, sizeof(OCTET_STRING_t)); + OCTET_STRING_fromBuf(dedicatedNAS_Message, + (char *)ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer, + ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.length); + ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); + + LOG_I(NR_RRC,"add NAS info with size %d (pdusession id %d)\n",ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length, + ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id); + } else { + // TODO + LOG_E(NR_RRC,"no NAS info (pdusession id %d)\n", ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id); + } + } + + /* If list is empty free the list and reset the address */ + if (dedicatedNAS_MessageList->list.count == 0) { + free(dedicatedNAS_MessageList); + dedicatedNAS_MessageList = NULL; + } + + memset(buffer, 0, RRC_BUF_SIZE); + size = do_RRCReconfiguration(ctxt_pP, buffer, + xid, + NULL, + DRB_configList2, + NULL, + NULL, + NULL, + NULL, + dedicatedNAS_MessageList, + NULL, + NULL); + LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); + + /* Free all NAS PDUs */ + for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) { + if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) { + /* Free the NAS PDU buffer and invalidate it */ + free(ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer); + ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer = NULL; + } + } + + LOG_I(NR_RRC, + "[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCReconfiguration (bytes %d, UE RNTI %x)\n", + ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti); + LOG_D(NR_RRC, + "[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", + ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH); + MSC_LOG_TX_MESSAGE( + MSC_RRC_GNB, + MSC_RRC_UE, + buffer, + size, + MSC_AS_TIME_FMT" dedicated RRCReconfiguration UE %x MUI %d size %u", + MSC_AS_TIME_ARGS(ctxt_pP), + ue_context_pP->ue_context.rnti, + rrc_gNB_mui, + size); + +#ifdef ITTI_SIM + MessageDef *message_p; + uint8_t *message_buffer; + message_buffer = itti_malloc (TASK_RRC_GNB_SIM, TASK_RRC_UE_SIM, size); + memcpy (message_buffer, buffer, size); + message_p = itti_alloc_new_message (TASK_RRC_GNB_SIM, 0, GNB_RRC_DCCH_DATA_IND); + GNB_RRC_DCCH_DATA_IND (message_p).rbid = DCCH; + GNB_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer; + GNB_RRC_DCCH_DATA_IND (message_p).size = size; + itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p); +#else + nr_rrc_data_req( + ctxt_pP, + DCCH, + rrc_gNB_mui++, + SDU_CONFIRM_NO, + size, + buffer, + PDCP_TRANSMISSION_MODE_CONTROL); +#endif +} + //----------------------------------------------------------------------------- void rrc_gNB_generate_dedicatedRRCReconfiguration_release( @@ -2340,6 +2521,17 @@ rrc_gNB_decode_dcch( ue_context_p, ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier); } + } else if (ue_context_p->ue_context.nb_of_modify_pdusessions > 0) { + rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(ctxt_pP, + ue_context_p, + ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier); + ue_context_p->ue_context.nb_of_modify_pdusessions = 0; + ue_context_p->ue_context.nb_of_failed_pdusessions = 0; + memset(ue_context_p->ue_context.modify_pdusession, 0, sizeof(ue_context_p->ue_context.modify_pdusession)); + + for(int i = 0; i < NR_NB_RB_MAX; i++) { + ue_context_p->ue_context.modify_pdusession[i].xid = -1; + } } } if (first_rrcreconfiguration == 0){ @@ -3245,6 +3437,10 @@ void *rrc_gnb_task(void *args_p) { rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(msg_p, msg_name_p, instance); break; + case NGAP_PDUSESSION_MODIFY_REQ: + rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(msg_p, msg_name_p, instance); + break; + case NGAP_PDUSESSION_RELEASE_COMMAND: rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(msg_p, msg_name_p, instance); break; diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 30c3f2f996..40d3f4a69f 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1118,6 +1118,264 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ( } } +//------------------------------------------------------------------------------ +int +rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( + MessageDef *msg_p, + const char *msg_name, + instance_t instance +) +//------------------------------------------------------------------------------ +{ + uint16_t ue_initial_id; + uint32_t gNB_ue_ngap_id; + uint8_t nb_pdusessions_tomodify; + rrc_gNB_ue_context_t *ue_context_p = NULL; + uint8_t i; + uint8_t qos_flow_index; + protocol_ctxt_t ctxt; + + ue_initial_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).ue_initial_id; + gNB_ue_ngap_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).gNB_ue_ngap_id; + nb_pdusessions_tomodify = NGAP_PDUSESSION_MODIFY_REQ(msg_p).nb_pdusessions_tomodify; + + ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, ue_initial_id, gNB_ue_ngap_id); + if (ue_context_p == NULL) { + LOG_W(NR_RRC, "[gNB %ld] In NGAP_PDUSESSION_MODIFY_REQ: unknown UE from NGAP ids (%d, %u)\n", instance, ue_initial_id, gNB_ue_ngap_id); + // TODO + return (-1); + } else { + PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0); + ctxt.eNB_index = 0; + + ue_context_p->ue_context.gNB_ue_ngap_id = gNB_ue_ngap_id; + { + int j; + boolean_t is_treated[NGAP_MAX_PDUSESSION] = {FALSE}; + uint8_t nb_of_failed_pdusessions = 0; + + for (i = 0; i < nb_pdusessions_tomodify; i++) { + if (is_treated[i] == TRUE) { + continue; + } + + for (j = i+1; j < nb_pdusessions_tomodify; j++) { + if (is_treated[j] == FALSE && + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id == + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) { + // handle multiple pdu session id + LOG_D(NR_RRC, "handle multiple pdu session id \n"); + ue_context_p->ue_context.modify_pdusession[j].status = PDU_SESSION_STATUS_NEW; + ue_context_p->ue_context.modify_pdusession[j].param.pdusession_id = + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id; + ue_context_p->ue_context.modify_pdusession[j].cause = NGAP_CAUSE_RADIO_NETWORK; + ue_context_p->ue_context.modify_pdusession[j].cause_value = NGAP_CauseRadioNetwork_multiple_PDU_session_ID_instances; + nb_of_failed_pdusessions++; + is_treated[i] = TRUE; + is_treated[j] = TRUE; + } + } + + if (is_treated[i] == TRUE) { + // handle multiple pdu session id + LOG_D(NR_RRC, "handle multiple pdu session id \n"); + ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW; + ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id = + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id; + ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK; + ue_context_p->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_multiple_PDU_session_ID_instances; + nb_of_failed_pdusessions++; + continue; + } + + for (j = 0; j < NR_NB_RB_MAX -3; j++) { + if (ue_context_p->ue_context.pduSession[j].param.pdusession_id == + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) { + if (ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_TORELEASE || + ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_DONE) { + break; + } + + ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW; + ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id = + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id; + ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_NOTHING; + if (NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.buffer != NULL) { + ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.buffer = + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.buffer; + ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.length = + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.length; + } + + for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos; qos_flow_index++) { + ue_context_p->ue_context.modify_pdusession[i].param.qos[qos_flow_index] = + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].qos[qos_flow_index]; + } + ue_context_p->ue_context.modify_pdusession[i].param.nb_qos = + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos; + + ue_context_p->ue_context.modify_pdusession[i].param.upf_addr = + ue_context_p->ue_context.pduSession[j].param.upf_addr; + ue_context_p->ue_context.modify_pdusession[i].param.gtp_teid = + ue_context_p->ue_context.pduSession[j].param.gtp_teid; + is_treated[i] = TRUE; + break; + } + } + + if (is_treated[i] == FALSE) { + // handle Unknown pdu session ID + LOG_D(NR_RRC, "handle Unknown pdu session ID \n"); + ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW; + ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id = + NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id; + ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK; + ue_context_p->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID; + nb_of_failed_pdusessions++; + is_treated[i] = TRUE; + } + } + + ue_context_p->ue_context.nb_of_modify_pdusessions = nb_pdusessions_tomodify; + ue_context_p->ue_context.nb_of_failed_pdusessions = nb_of_failed_pdusessions; + } + + if (ue_context_p->ue_context.nb_of_failed_pdusessions < ue_context_p->ue_context.nb_of_modify_pdusessions) { + if (0 == rrc_gNB_modify_dedicatedRRCReconfiguration(&ctxt, ue_context_p)) { + return (0); + } + } + + { // modify failed + uint8_t nb_of_pdu_sessions_failed = 0; + MessageDef *msg_fail_p = NULL; + msg_fail_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP); + if (msg_fail_p == NULL) { + LOG_E(NR_RRC, "itti_alloc_new_message failed, msg_fail_p is NULL \n"); + return (-1); + } + + NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).gNB_ue_ngap_id = gNB_ue_ngap_id; + NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).nb_of_pdusessions = 0; + + for (nb_of_pdu_sessions_failed = 0; nb_of_pdu_sessions_failed < ue_context_p->ue_context.nb_of_failed_pdusessions; nb_of_pdu_sessions_failed++) { + NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].pdusession_id = + ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].param.pdusession_id; + NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].cause = + ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].cause; + NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].cause_value = + ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].cause_value; + } + + NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).nb_of_pdusessions_failed = + ue_context_p->ue_context.nb_of_failed_pdusessions; + itti_send_msg_to_task(TASK_NGAP, instance, msg_fail_p); + ue_context_p->ue_context.nb_of_modify_pdusessions = 0; + ue_context_p->ue_context.nb_of_failed_pdusessions = 0; + memset(ue_context_p->ue_context.modify_pdusession, 0, sizeof(ue_context_p->ue_context.modify_pdusession)); + return (0); + } + } +} + +//------------------------------------------------------------------------------ +int +rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP( + const protocol_ctxt_t *const ctxt_pP, + rrc_gNB_ue_context_t *const ue_context_pP, + uint8_t xid +) +//------------------------------------------------------------------------------ +{ + MessageDef *msg_p = NULL; + int i, j; + uint8_t qos_flow_index; + uint8_t pdu_sessions_failed = 0; + uint8_t pdu_sessions_done = 0; + + msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP); + if (msg_p == NULL) { + LOG_E(NR_RRC, "itti_alloc_new_message failed, msg_p is NULL \n"); + return (-1); + } + + NGAP_PDUSESSION_MODIFY_RESP(msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id; + + for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) { + if (xid == ue_context_pP->ue_context.modify_pdusession[i].xid) { + if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_DONE) { + for (j = 0; j < ue_context_pP->ue_context.setup_pdu_sessions; j++) { + if (ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id == + ue_context_pP->ue_context.pduSession[i].param.pdusession_id) { + // Update ue_context_pP->ue_context.pduSession + ue_context_pP->ue_context.pduSession[i].status = PDU_SESSION_STATUS_ESTABLISHED; + ue_context_pP->ue_context.pduSession[i].cause = NGAP_CAUSE_NOTHING; + for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pduSession[i].param.nb_qos; qos_flow_index++) { + ue_context_pP->ue_context.pduSession[i].param.qos[qos_flow_index] = + ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index]; + } + break; + } + } + + if (j < ue_context_pP->ue_context.setup_pdu_sessions) { + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id = + ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id; + LOG_D(NR_RRC, "gnb_gtp_addr (msg index %d, pdu session index %d, status %d, xid %d): nb_of_modify_pdusessions %d, pdusession_id %d \n ", + pdu_sessions_done, i, ue_context_pP->ue_context.modify_pdusession[i].status, xid, + ue_context_pP->ue_context.nb_of_modify_pdusessions, + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id); + pdu_sessions_done++; + } else { + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id = + ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id; + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause = NGAP_CAUSE_RADIO_NETWORK; + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID; + pdu_sessions_failed++; + } + } else if ((ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_NEW) || + (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_ESTABLISHED)) { + LOG_D (NR_RRC, "PDU SESSION is NEW or already ESTABLISHED\n"); + } else if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_FAILED) { + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id = + ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id; + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause = + ue_context_pP->ue_context.modify_pdusession[i].cause; + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause_value = + ue_context_pP->ue_context.modify_pdusession[i].cause_value; + pdu_sessions_failed++; + } + } else { + LOG_D(NR_RRC,"xid does not corresponds (context pdu session index %d, status %d, xid %d/%d) \n ", + i, ue_context_pP->ue_context.modify_pdusession[i].status, xid, ue_context_pP->ue_context.modify_pdusession[i].xid); + } + } + + NGAP_PDUSESSION_MODIFY_RESP(msg_p).nb_of_pdusessions = pdu_sessions_done; + NGAP_PDUSESSION_MODIFY_RESP(msg_p).nb_of_pdusessions_failed = pdu_sessions_failed; + + if (pdu_sessions_done > 0 || pdu_sessions_failed > 0) { + LOG_D(NR_RRC,"NGAP_PDUSESSION_MODIFY_RESP: sending the message: nb_of_pdusessions %d, total pdu session %d, index %d\n", + ue_context_pP->ue_context.nb_of_modify_pdusessions, ue_context_pP->ue_context.setup_pdu_sessions, i); + MSC_LOG_TX_MESSAGE( + MSC_RRC_GNB, + MSC_NGAP_GNB, + (const char *)&NGAP_PDUSESSION_MODIFY_RESP(msg_p), + sizeof(ngap_pdusession_modify_resp_t), + MSC_AS_TIME_FMT" PDUSESSION_MODIFY_RESP UE %X gNB_ue_ngap_id %u pdu_sessions:%u succ %u fail", + MSC_AS_TIME_ARGS(ctxt_pP), + ue_context_pP->ue_id_rnti, + NGAP_PDUSESSION_MODIFY_RESP(msg_p).gNB_ue_ngap_id, + pdu_sessions_done, pdu_sessions_failed); + itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p); + } else { + itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + } + + return 0; +} + +//------------------------------------------------------------------------------ void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( const module_id_t gnb_mod_idP, diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.h b/openair2/RRC/NR/rrc_gNB_NGAP.h index 8779d62ff6..86faedc37e 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.h +++ b/openair2/RRC/NR/rrc_gNB_NGAP.h @@ -38,6 +38,7 @@ #include "NR_RRCSetupComplete-IEs.h" #include "NR_RegisteredAMF.h" #include "NR_UL-DCCH-Message.h" +#include "NGAP_CauseRadioNetwork.h" typedef struct rrc_ue_ngap_ids_s { /* Tree related data */ @@ -107,6 +108,27 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ( instance_t instance ); +int +rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( + MessageDef *msg_p, + const char *msg_name, + instance_t instance +); + +int +rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP( + const protocol_ctxt_t *const ctxt_pP, + rrc_gNB_ue_context_t *const ue_context_pP, + uint8_t xid +); + +int +rrc_gNB_modify_dedicatedRRCReconfiguration( + const protocol_ctxt_t *const ctxt_pP, + rrc_gNB_ue_context_t *ue_context_pP +); + + void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( const module_id_t gnb_mod_idP, diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index f272c16017..44c7f3dd0e 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2194,7 +2194,7 @@ nr_rrc_ue_establish_srb2( // nr_rrc_ue_process_measConfig(ctxt_pP, gNB_index, ie->measConfig); } - if(ie->nonCriticalExtension->masterCellGroup!=NULL) { + if((ie->nonCriticalExtension) && (ie->nonCriticalExtension->masterCellGroup!=NULL)) { nr_rrc_ue_process_masterCellGroup( ctxt_pP, gNB_index, @@ -2207,7 +2207,7 @@ nr_rrc_ue_establish_srb2( } /* Check if there is dedicated NAS information to forward to NAS */ - if (ie->nonCriticalExtension->dedicatedNAS_MessageList != NULL) { + if ((ie->nonCriticalExtension) && (ie->nonCriticalExtension->dedicatedNAS_MessageList != NULL)) { int list_count; uint32_t pdu_length; uint8_t *pdu_buffer; diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 401695473c..011c1cfeba 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -1631,11 +1631,11 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, } /* PDUSession Resource modify request = UE-related procedure -> stream != 0 */ - if (stream == 0) { - NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n", - assoc_id, stream); - return -1; - } +// if (stream == 0) { +// NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n", +// assoc_id, stream); +// return -1; +// } ue_desc_p->rx_stream = stream; From 736b8be64dc7563d9368357f16d52f290d507c3c Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 12 Sep 2021 10:08:26 +0200 Subject: [PATCH 037/883] fix phy sim compilation issue --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index a4e571ca0e..2d7e2146ed 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -763,7 +763,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index e267c8b6d7..d2b951b2fa 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -712,7 +712,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); From b31199c4efbf8b6f1931b7ab1ae4aea16272efdf Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 12 Sep 2021 11:27:45 +0200 Subject: [PATCH 038/883] make csirs prb occupation generic --- openair2/RRC/NR/rrc_gNB_reconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index ca1d8b3d9e..72357639f4 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1055,7 +1055,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6; imres0->freqBand = calloc(1,sizeof(*imres0->freqBand)); imres0->freqBand->startingRB = 0; - imres0->freqBand->nrofRBs = 108; + imres0->freqBand->nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2; imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset)); imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; imres0->periodicityAndOffset->choice.slots320 = 0; @@ -1329,7 +1329,7 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_ resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; resourceMapping.density.choice.one = (NULL_t)0; resourceMapping.freqBand.startingRB = 0; - resourceMapping.freqBand.nrofRBs = 108; + resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2; nzpcsi0->resourceMapping = resourceMapping; nzpcsi0->powerControlOffset = 0; nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); From 64a7359a4c0e4008594bfbd87da0897c02e306fb Mon Sep 17 00:00:00 2001 From: Xue Song Date: Mon, 13 Sep 2021 07:59:22 +0000 Subject: [PATCH 039/883] set fiveQI in ngap_gNB_handle_pdusession_modify_request() --- openair3/NGAP/ngap_gNB_handlers.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 011c1cfeba..fab7620f02 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -1745,6 +1745,12 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, /* Set the QOS informations */ NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].qfi = (uint8_t)qosFlowItem_p->qosFlowIdentifier; if(qosFlowItem_p->qosFlowLevelQosParameters) { + if (qosFlowItem_p->qosFlowLevelQosParameters->qosCharacteristics.present == NGAP_QosCharacteristics_PR_nonDynamic5QI) { + NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].fiveQI = + qosFlowItem_p->qosFlowLevelQosParameters->qosCharacteristics.choice.nonDynamic5QI->fiveQI; + } else if (qosFlowItem_p->qosFlowLevelQosParameters->qosCharacteristics.present == NGAP_QosCharacteristics_PR_dynamic5QI) { + // TODO + } NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].allocation_retention_priority.priority_level = qosFlowItem_p->qosFlowLevelQosParameters->allocationAndRetentionPriority.priorityLevelARP; NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].allocation_retention_priority.pre_emp_capability = From cfccd8ece89b0944a5d1bfb442b3cce8d5beb98d Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 13 Sep 2021 10:01:05 +0200 Subject: [PATCH 040/883] fix another compilation issue --- openair2/RRC/NR/nr_rrc_proto.h | 6 +++++- openair2/RRC/NR/rrc_gNB_reconfig.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index e6ac34f6fe..62ff03dcdf 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -82,7 +82,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int do_csirs, int uid); -void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs); +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, + NR_CSI_MeasConfig_t *csi_MeasConfig, + int dl_antenna_ports, + int curr_bwp, + int do_csirs); void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 72357639f4..a54ce7856a 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1093,7 +1093,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL; - config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,do_csirs); + config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,curr_bwp,do_csirs); csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList)); csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL; @@ -1294,7 +1294,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco } -void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs) { +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, + NR_CSI_MeasConfig_t *csi_MeasConfig, + int dl_antenna_ports, + int curr_bwp, + int do_csirs) { if (do_csirs) { csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); From 9fb094600f4a57373773eb4d122594b28aafd041 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 13 Sep 2021 14:54:49 +0200 Subject: [PATCH 041/883] cosmetic changes and duplicate code --- executables/nr-ru.c | 2 - openair1/SCHED_NR/nr_ru_procedures.c | 6 -- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 24 +++++ openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 4 - openair2/RRC/NR/rrc_gNB.c | 100 ++----------------- openair2/RRC/NR/rrc_gNB_NGAP.c | 2 - targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 2 +- 7 files changed, 34 insertions(+), 106 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index d7e0d0116b..2de04f4e7f 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1384,7 +1384,6 @@ void *ru_thread( void *param ) { } } - // At this point, all information for subframe has been received on FH interface res = pullTpool(gNB->resp_L1, gNB->threadPool); syncMsg = (processingData_L1_t *)NotifiedFifoData(res); @@ -1396,7 +1395,6 @@ void *ru_thread( void *param ) { syncMsg->timestamp_tx = proc->timestamp_tx; res->key = proc->tti_rx; pushTpool(gNB->threadPool, res); - } printf( "Exiting ru_thread \n"); diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index d9bf71c78b..eb0a4f8cdc 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -325,12 +325,6 @@ static void *nr_feptx_thread(void *param) { (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); } - else if (ru->do_precoding == 0) { - int gNB_tx = ru->gNB_list[0]->frame_parms.nb_antennas_tx; - memcpy((void*)&ru->common.txdataF_BF[aa][l*fp->ofdm_symbol_size], - (void*)&ru->gNB_list[0]->common_vars.txdataF[aa%gNB_tx][txdataF_offset + l*fp->ofdm_symbol_size], - (fp->samples_per_slot_wCP>>1)*sizeof(int32_t)); - } else { bw = ru->beam_weights[0]; for(i=0; isymbols_per_slot>>1; ++i){ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 2def947d8f..c36dbb9f60 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -77,6 +77,13 @@ void dump_mac_stats(gNB_MAC_INST *gNB) int stroff=0; for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { stroff = sprintf(output,"UE ID %d RNTI %04x (%d/%d)\n", UE_id, UE_info->rnti[UE_id], num++, UE_info->num_UEs); + LOG_I(NR_MAC, "UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n", + UE_id, + UE_info->rnti[UE_id], + num++, + UE_info->num_UEs, + UE_info->UE_sched_ctrl[UE_id].ph, + UE_info->UE_sched_ctrl[UE_id].pcmax); NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0; stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n", @@ -84,6 +91,12 @@ void dump_mac_stats(gNB_MAC_INST *gNB) stats->dlsch_rounds[0], stats->dlsch_rounds[1], stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, avg_rsrp, stats->num_rsrp_meas); + LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)\n", + UE_id, + stats->dlsch_rounds[0], stats->dlsch_rounds[1], + stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, + avg_rsrp, stats->num_rsrp_meas); + stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0 ; stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); @@ -97,6 +110,17 @@ void dump_mac_stats(gNB_MAC_INST *gNB) "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", UE_id, stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); + LOG_I(NR_MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); + LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n", + UE_id, + stats->ulsch_rounds[0], stats->ulsch_rounds[1], + stats->ulsch_rounds[2], stats->ulsch_rounds[3], + stats->ulsch_DTX, + stats->ulsch_errors); + LOG_I(NR_MAC, + "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", + UE_id, + stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); for (int lc_id = 0; lc_id < 63; lc_id++) { if (stats->lc_bytes_tx[lc_id] > 0) { stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index f120ba8080..093a5fcbe1 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -932,10 +932,6 @@ boolean_t nr_rrc_pdcp_config_asn1_req( // TODO } - if (drb2release_list != NULL) { - // TODO - } - free(kRRCenc); free(kRRCint); free(kUPenc); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 07edb96cd9..53de51953e 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -3043,20 +3043,20 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[ctxt_pP->module_id]->rrc_ue_head)) { ctxt_pP->rnti = ue_context_p->ue_id_rnti; - if (fd) { - if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) { - fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", + if (fd) { + if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) { + fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", ue_context_p->ue_id_rnti, ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi, ue_context_p->ue_context.ul_failure_timer); - } else { - fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", + } else { + fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", ue_context_p->ue_id_rnti, ue_context_p->ue_context.ul_failure_timer); - } + } - if (ue_context_p->ue_context.UE_Capability_nr) { - fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", + if (ue_context_p->ue_context.UE_Capability_nr) { + fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", @@ -3064,7 +3064,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr)); - } + } } if (ue_context_p->ue_context.ul_failure_timer > 0) { ue_context_p->ue_context.ul_failure_timer++; @@ -3125,88 +3125,6 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { if (fd) fclose(fd); - ue_context_p = NULL; - fd=fopen("nrRRCstats.log","w"); - RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[ctxt_pP->module_id]->rrc_ue_head)) { - ctxt_pP->rnti = ue_context_p->ue_id_rnti; - - if (fd) { - if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) { - fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n", - ue_context_p->ue_id_rnti, - ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi, - ue_context_p->ue_context.ul_failure_timer); - } else { - fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n", - ue_context_p->ue_id_rnti, - ue_context_p->ue_context.ul_failure_timer); - } - - if (ue_context_p->ue_context.UE_Capability_nr) { - fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", - get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", - is_ul_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", - get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr)); - } - } - if (ue_context_p->ue_context.ul_failure_timer > 0) { - ue_context_p->ue_context.ul_failure_timer++; - - if (ue_context_p->ue_context.ul_failure_timer >= 20000) { - // remove UE after 20 seconds after MAC (or else) has indicated UL failure - LOG_I(RRC, "Removing UE %x instance, because of uplink failure timer timeout\n", - ue_context_p->ue_context.rnti); - if(ue_context_p->ue_context.StatusRrc >= NR_RRC_CONNECTED){ - rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( - ctxt_pP->module_id, - ue_context_p, - NGAP_CAUSE_RADIO_NETWORK, - 30); - }else{ - mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); - rrc_rlc_remove_ue(ctxt_pP); - pdcp_remove_UE(ctxt_pP); - - /* remove RRC UE Context */ - ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); - if (ue_context_p) { - rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p); - LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); - } - } - break; // break RB_FOREACH - } - } - - if (ue_context_p->ue_context.ue_release_timer_rrc > 0) { - ue_context_p->ue_context.ue_release_timer_rrc++; - - if (ue_context_p->ue_context.ue_release_timer_rrc >= ue_context_p->ue_context.ue_release_timer_thres_rrc) { - LOG_I(NR_RRC, "Removing UE %x instance after UE_CONTEXT_RELEASE_Complete (ue_release_timer_rrc timeout)\n", - ue_context_p->ue_context.rnti); - ue_context_p->ue_context.ue_release_timer_rrc = 0; - - mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); - rrc_rlc_remove_ue(ctxt_pP); - pdcp_remove_UE(ctxt_pP); - - /* remove RRC UE Context */ - ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); - if (ue_context_p) { - rrc_gNB_remove_ue_context(ctxt_pP, RC.nrrrc[ctxt_pP->module_id], ue_context_p); - LOG_I(NR_RRC, "remove UE %x \n", ctxt_pP->rnti); - } - - break; // break RB_FOREACH - } - } - } - - fclose(fd); /* send a tick to x2ap */ if (is_x2ap_enabled()){ diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index a82914db6b..30c3f2f996 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -787,7 +787,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( struct rrc_gNB_ue_context_s *ue_context_p = NULL; protocol_ctxt_t ctxt; memset(&ctxt, 0, sizeof(protocol_ctxt_t)); - ue_initial_id = NGAP_DOWNLINK_NAS (msg_p).ue_initial_id; gNB_ue_ngap_id = NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id; ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, ue_initial_id, gNB_ue_ngap_id); @@ -876,7 +875,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( { // rrc_mac_config_req_gNB #ifdef ITTI_SIM - MessageDef *message_p; uint8_t *message_buffer; message_buffer = itti_malloc (TASK_RRC_GNB, TASK_RRC_UE_SIM, length); memcpy (message_buffer, buffer, length); diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index acd107479e..65045b1703 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -645,7 +645,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp break; default: AssertFatal(1==0,"Shouldn't be here\n"); - } + } samples_received=0; while (samples_received != nsamps) { From 124ccbf14c5170bb2728b796dcb67fed81b575d3 Mon Sep 17 00:00:00 2001 From: Xue Song Date: Tue, 14 Sep 2021 09:53:42 +0000 Subject: [PATCH 042/883] modify pdusession modify procedure --- openair2/COMMON/ngap_messages_types.h | 11 +++++++- openair2/RRC/NR/rrc_gNB.c | 8 ++++-- openair2/RRC/NR/rrc_gNB_NGAP.c | 23 +++++++++++----- openair3/NGAP/ngap_common.h | 3 +++ openair3/NGAP/ngap_gNB_nas_procedures.c | 35 +++++++++++++++++++------ 5 files changed, 63 insertions(+), 17 deletions(-) diff --git a/openair2/COMMON/ngap_messages_types.h b/openair2/COMMON/ngap_messages_types.h index af746b9193..6a301ce336 100644 --- a/openair2/COMMON/ngap_messages_types.h +++ b/openair2/COMMON/ngap_messages_types.h @@ -353,9 +353,18 @@ typedef struct pdusession_tobeswitched_s { uint32_t gtp_teid; } pdusession_tobeswitched_t; +typedef struct qos_flow_tobe_modified_s { + uint8_t qfi; // 0~63 +} qos_flow_tobe_modified_t; + typedef struct pdusession_modify_s { /* Unique pdusession_id for the UE. */ uint8_t pdusession_id; + + uint8_t nb_of_qos_flow; + + // qos_flow_add_or_modify + qos_flow_tobe_modified_t qos[QOSFLOW_MAX_VALUE]; } pdusession_modify_t; typedef enum ngap_Cause_e { @@ -770,7 +779,7 @@ typedef struct ngap_pdusession_modify_req_s { /* Number of pdusession to be modify in the list */ uint8_t nb_pdusessions_tomodify; - /* E RAB modify request */ + /* pdu session modify request */ pdusession_t pdusession_modify_params[NGAP_MAX_PDUSESSION]; } ngap_pdusession_modify_req_t; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 845ce87cdf..78416b5359 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1335,6 +1335,8 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( buffer, PDCP_TRANSMISSION_MODE_CONTROL); #endif + + return 0; } //----------------------------------------------------------------------------- @@ -2516,12 +2518,14 @@ rrc_gNB_decode_dcch( //NGAP_PDUSESSION_RELEASE_RESPONSE rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(ctxt_pP, ue_context_p, xid); } else if (ue_context_p->ue_context.established_pdu_sessions_flag != 1) { - if (ue_context_p->ue_context.setup_pdu_sessions > 0) { + if (ue_context_p->ue_context.nb_of_pdusessions > 0) { rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(ctxt_pP, ue_context_p, ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier); + ue_context_p->ue_context.nb_of_pdusessions = 0; } - } else if (ue_context_p->ue_context.nb_of_modify_pdusessions > 0) { + } + if (ue_context_p->ue_context.nb_of_modify_pdusessions > 0) { rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(ctxt_pP, ue_context_p, ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier); diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 40d3f4a69f..46d3b01bf0 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1241,12 +1241,14 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( } if (ue_context_p->ue_context.nb_of_failed_pdusessions < ue_context_p->ue_context.nb_of_modify_pdusessions) { + LOG_D(NR_RRC, "generate RRCReconfiguration \n"); if (0 == rrc_gNB_modify_dedicatedRRCReconfiguration(&ctxt, ue_context_p)) { return (0); } } { // modify failed + LOG_I(NR_RRC, "pdu session modify failed, fill NGAP_PDUSESSION_MODIFY_RESP with the pdu session information that failed to modify \n"); uint8_t nb_of_pdu_sessions_failed = 0; MessageDef *msg_fail_p = NULL; msg_fail_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP); @@ -1299,6 +1301,8 @@ rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP( return (-1); } + LOG_I(NR_RRC, "send message NGAP_PDUSESSION_MODIFY_RESP \n"); + NGAP_PDUSESSION_MODIFY_RESP(msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id; for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) { @@ -1306,12 +1310,13 @@ rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP( if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_DONE) { for (j = 0; j < ue_context_pP->ue_context.setup_pdu_sessions; j++) { if (ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id == - ue_context_pP->ue_context.pduSession[i].param.pdusession_id) { + ue_context_pP->ue_context.pduSession[j].param.pdusession_id) { + LOG_I(NR_RRC, "update pdu session %d \n", ue_context_pP->ue_context.pduSession[j].param.pdusession_id); // Update ue_context_pP->ue_context.pduSession - ue_context_pP->ue_context.pduSession[i].status = PDU_SESSION_STATUS_ESTABLISHED; - ue_context_pP->ue_context.pduSession[i].cause = NGAP_CAUSE_NOTHING; - for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pduSession[i].param.nb_qos; qos_flow_index++) { - ue_context_pP->ue_context.pduSession[i].param.qos[qos_flow_index] = + ue_context_pP->ue_context.pduSession[j].status = PDU_SESSION_STATUS_ESTABLISHED; + ue_context_pP->ue_context.pduSession[j].cause = NGAP_CAUSE_NOTHING; + for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) { + ue_context_pP->ue_context.pduSession[j].param.qos[qos_flow_index] = ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index]; } break; @@ -1321,7 +1326,13 @@ rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP( if (j < ue_context_pP->ue_context.setup_pdu_sessions) { NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id = ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id; - LOG_D(NR_RRC, "gnb_gtp_addr (msg index %d, pdu session index %d, status %d, xid %d): nb_of_modify_pdusessions %d, pdusession_id %d \n ", + for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) { + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].qos[qos_flow_index].qfi = + ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].qfi; + } + NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].nb_of_qos_flow = + ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; + LOG_I(NR_RRC, "Modify Resp (msg index %d, pdu session index %d, status %d, xid %d): nb_of_modify_pdusessions %d, pdusession_id %d \n ", pdu_sessions_done, i, ue_context_pP->ue_context.modify_pdusession[i].status, xid, ue_context_pP->ue_context.nb_of_modify_pdusessions, NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id); diff --git a/openair3/NGAP/ngap_common.h b/openair3/NGAP/ngap_common.h index 283dd2bffa..60f7beacd0 100644 --- a/openair3/NGAP/ngap_common.h +++ b/openair3/NGAP/ngap_common.h @@ -87,6 +87,9 @@ #include "NGAP_PDUSessionResourceModifyItemModReq.h" #include "NGAP_PDUSessionResourceModifyRequestTransfer.h" #include "NGAP_QosFlowAddOrModifyRequestItem.h" +#include "NGAP_PDUSessionResourceModifyResponseTransfer.h" +#include "NGAP_QosFlowAddOrModifyResponseList.h" +#include "NGAP_QosFlowAddOrModifyResponseItem.h" #include "NGAP_TAIListForPagingItem.h" #include "NGAP_GNB-ID.h" #include "NGAP_GlobalGNB-ID.h" diff --git a/openair3/NGAP/ngap_gNB_nas_procedures.c b/openair3/NGAP/ngap_gNB_nas_procedures.c index 6686f8c19e..87c1ef2e8d 100644 --- a/openair3/NGAP/ngap_gNB_nas_procedures.c +++ b/openair3/NGAP/ngap_gNB_nas_procedures.c @@ -1257,7 +1257,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ie->value.choice.RAN_UE_NGAP_ID = pdusession_modify_resp_p->gNB_ue_ngap_id; ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); - /* optional */ + /* PDUSessionResourceModifyListModRes optional */ if (pdusession_modify_resp_p->nb_of_pdusessions > 0) { ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t)); ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceModifyListModRes; @@ -1265,13 +1265,32 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_PDUSessionResourceModifyListModRes; for (i = 0; i < pdusession_modify_resp_p->nb_of_pdusessions; i++) { - NGAP_PDUSessionResourceModifyItemModRes_t *item; - - item = (NGAP_PDUSessionResourceModifyItemModRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyItemModRes_t)); - item->pDUSessionID = pdusession_modify_resp_p->pdusessions[i].pdusession_id; - - NGAP_DEBUG("pdusession_modify_resp: modified pdusession ID %ld\n", item->pDUSessionID); - ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceModifyListModRes.list, item); + NGAP_PDUSessionResourceModifyItemModRes_t *item; + NGAP_PDUSessionResourceModifyResponseTransfer_t *transfer_p = NULL; + + item = (NGAP_PDUSessionResourceModifyItemModRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyItemModRes_t)); + item->pDUSessionID = pdusession_modify_resp_p->pdusessions[i].pdusession_id; + + transfer_p = (NGAP_PDUSessionResourceModifyResponseTransfer_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseTransfer_t)); + transfer_p->qosFlowAddOrModifyResponseList = (NGAP_QosFlowAddOrModifyResponseList_t *)calloc(1, sizeof(NGAP_QosFlowAddOrModifyResponseList_t)); + + uint8_t qos_flow_index; + for (qos_flow_index = 0; qos_flow_index < pdusession_modify_resp_p->pdusessions[i].nb_of_qos_flow; qos_flow_index++) { + NGAP_QosFlowAddOrModifyResponseItem_t *qosFlowAddOrModifyResponseItem_p = calloc(1, sizeof(NGAP_QosFlowAddOrModifyResponseItem_t)); + qosFlowAddOrModifyResponseItem_p->qosFlowIdentifier = + pdusession_modify_resp_p->pdusessions[i].qos[qos_flow_index].qfi; + ASN_SEQUENCE_ADD(&transfer_p->qosFlowAddOrModifyResponseList->list, qosFlowAddOrModifyResponseItem_p); + } + + memset(&res, 0, sizeof(res)); + res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NGAP_PDUSessionResourceModifyResponseTransfer, transfer_p); + item->pDUSessionResourceModifyResponseTransfer.buf = res.buffer; + item->pDUSessionResourceModifyResponseTransfer.size = res.result.encoded; + + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceModifyResponseTransfer, transfer_p); + + NGAP_DEBUG("pdusession_modify_resp: modified pdusession ID %ld\n", item->pDUSessionID); + ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceModifyListModRes.list, item); } ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); From 286893a1ed6d87ff777ebe00ad868fde4c1480d7 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Mon, 27 Sep 2021 07:21:00 +0200 Subject: [PATCH 043/883] commit before merge --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 4 ++-- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 194c7c0c56..77ad962d56 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -97,8 +97,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_nsymb = pdcch_pdu_rel15->DurationSymbols; dci_idx = 0; - LOG_D(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); - LOG_D(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); + LOG_I(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); + LOG_I(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); // DMRS length is per OFDM symbol uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE) uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index e7a3c61c51..67ca6b9169 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -942,7 +942,7 @@ extern "C" { LOG_I(HW, "openair0_cfg[0].sdr_addrs == '%s'\n", openair0_cfg[0].sdr_addrs); LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external); usrp_state_t *s ; - int choffset = 1; + int choffset = 0; if ( device->priv == NULL) { s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1); From d9235268b46e5c7ecedf783c2167b56669b404da Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 29 Sep 2021 21:32:22 +0200 Subject: [PATCH 044/883] MAC statistics in separate thread --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 89 ++-------------------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + openair2/LAYER2/NR_MAC_gNB/main.c | 81 ++++++++++++++++++++ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + 4 files changed, 89 insertions(+), 83 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index e3ee1d9888..f9f8524f7f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -62,87 +62,6 @@ uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 }; uint8_t vnf_first_sched_entry = 1; -void clear_mac_stats(gNB_MAC_INST *gNB) { - memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t)); -} -#define MACSTATSSTRLEN 16384 -void dump_mac_stats(gNB_MAC_INST *gNB) -{ - NR_UE_info_t *UE_info = &gNB->UE_info; - int num = 1; - FILE *fd=fopen("nrMAC_stats.log","w"); - AssertFatal(fd!=NULL,"Cannot open nrMAC_stats.log, error %s\n",strerror(errno)); - char output[MACSTATSSTRLEN]; - memset(output,0,MACSTATSSTRLEN); - int stroff=0; - for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { - - stroff+=sprintf(output+stroff,"UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n", - UE_id, - UE_info->rnti[UE_id], - num++, - UE_info->num_UEs, - UE_info->UE_sched_ctrl[UE_id].ph, - UE_info->UE_sched_ctrl[UE_id].pcmax); - - LOG_I(NR_MAC, "UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n", - UE_id, - UE_info->rnti[UE_id], - num++, - UE_info->num_UEs, - UE_info->UE_sched_ctrl[UE_id].ph, - UE_info->UE_sched_ctrl[UE_id].pcmax); - - NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; - const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0; - stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d average RSRP %d (%d meas)\n", - UE_id, - stats->dlsch_rounds[0], stats->dlsch_rounds[1], - stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, - stats->pucch0_DTX, - avg_rsrp, stats->num_rsrp_meas); - LOG_I(NR_MAC, "UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d\n", - UE_id, - stats->dlsch_rounds[0], stats->dlsch_rounds[1], - stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors); - stats->num_rsrp_meas = 0; - stats->cumul_rsrp = 0 ; - stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); - stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n", - UE_id, - stats->ulsch_rounds[0], stats->ulsch_rounds[1], - stats->ulsch_rounds[2], stats->ulsch_rounds[3], - stats->ulsch_DTX, - stats->ulsch_errors); - stroff+=sprintf(output+stroff, - "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", - UE_id, - stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); - LOG_I(NR_MAC, "UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); - LOG_I(NR_MAC, "UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d\n", - UE_id, - stats->ulsch_rounds[0], stats->ulsch_rounds[1], - stats->ulsch_rounds[2], stats->ulsch_rounds[3], - stats->ulsch_errors); - LOG_I(NR_MAC, - "UE %d: ulsch_total_bytes (scheduled/received): %d / %d\n", - UE_id, - stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); - for (int lc_id = 0; lc_id < 63; lc_id++) { - if (stats->lc_bytes_tx[lc_id] > 0) { - stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); - } - if (stats->lc_bytes_rx[lc_id] > 0) { - stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); - } - } - } - print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL); - if (stroff>0) fprintf(fd,"%s",output); - fclose(fd); -} void clear_nr_nfapi_information(gNB_MAC_INST * gNB, int CC_idP, @@ -362,6 +281,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP); const int bwp_id = 1; + char stats_output[16384]; gNB_MAC_INST *gNB = RC.nrmac[module_idP]; NR_COMMON_channels_t *cc = gNB->common_channels; @@ -429,8 +349,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, } - if ((slot == 0) && (frame & 127) == 0) dump_mac_stats(RC.nrmac[module_idP]); - + if ((slot == 0) && (frame & 127) == 0) { + stats_output[0]='\0'; + dump_mac_stats(RC.nrmac[module_idP],stats_output,16384); + LOG_I(NR_MAC,"Frame.Slot %d.%d\n%s\n",frame,slot,stats_output); + } // This schedules MIB schedule_nr_mib(module_idP, frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 321476d513..51bbcf1c8a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -442,4 +442,5 @@ bool nr_find_nb_rb(uint16_t Qm, void nr_sr_reporting(int Mod_idP, frame_t frameP, sub_frame_t slotP); +void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen); #endif /*__LAYER2_NR_MAC_PROTO_H__*/ diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 117c18ae8d..0497eea7e1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -45,6 +45,85 @@ extern RAN_CONTEXT_t RC; +#define MACSTATSSTRLEN 16384 + +void nrmac_stats_thread(void *arg) { + + gNB_MAC_INST *gNB = (gNB_MAC_INST *)arg; + + char output[MACSTATSSTRLEN]; + memset(output,0,MACSTATSSTRLEN); + FILE *fd=fopen("nrMAC_stats.log","w"); + AssertFatal(fd!=NULL,"Cannot open nrMAC_stats.log, error %s\n",strerror(errno)); + + while (oai_exit == 0) { + dump_mac_stats(gNB,output,MACSTATSSTRLEN); + fprintf(fd,"%s\n",output); + fflush(fd); + usleep(200000); + fseek(fd,0,SEEK_SET); + } + fclose(fd); +} + +void clear_mac_stats(gNB_MAC_INST *gNB) { + memset((void*)gNB->UE_info.mac_stats,0,MAX_MOBILES_PER_GNB*sizeof(NR_mac_stats_t)); +} + +void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) +{ + NR_UE_info_t *UE_info = &gNB->UE_info; + int num = 1; + + int stroff=0; + if (UE_info->num_UEs == 0) return; + + for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { + + stroff+=sprintf(output+stroff,"UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm\n", + UE_id, + UE_info->rnti[UE_id], + num++, + UE_info->num_UEs, + UE_info->UE_sched_ctrl[UE_id].ph, + UE_info->UE_sched_ctrl[UE_id].pcmax); + + NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; + const int avg_rsrp = stats->num_rsrp_meas > 0 ? stats->cumul_rsrp / stats->num_rsrp_meas : 0; + stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d average RSRP %d (%d meas)\n", + UE_id, + stats->dlsch_rounds[0], stats->dlsch_rounds[1], + stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, + stats->pucch0_DTX, + avg_rsrp, stats->num_rsrp_meas); + stats->num_rsrp_meas = 0; + stats->cumul_rsrp = 0 ; + stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); + stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n", + UE_id, + stats->ulsch_rounds[0], stats->ulsch_rounds[1], + stats->ulsch_rounds[2], stats->ulsch_rounds[3], + stats->ulsch_DTX, + stats->ulsch_errors); + stroff+=sprintf(output+stroff, + "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", + UE_id, + stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); + for (int lc_id = 0; lc_id < 63; lc_id++) { + if (stats->lc_bytes_tx[lc_id] > 0) { + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); + LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); + } + if (stats->lc_bytes_rx[lc_id] > 0) { + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); + LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); + } + } + } + print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL); +} + + void mac_top_init_gNB(void) { module_id_t i; @@ -90,6 +169,7 @@ void mac_top_init_gNB(void) RC.nrmac[i]->pre_processor_dl = nr_init_fr1_dlsch_preprocessor(i, 0); RC.nrmac[i]->pre_processor_ul = nr_init_fr1_ulsch_preprocessor(i, 0); } + pthread_create(&RC.nrmac[i]->stats_thread,NULL,nrmac_stats_thread,(void*)RC.nrmac[i]); }//END for (i = 0; i < RC.nb_nr_macrlc_inst; i++) @@ -103,6 +183,7 @@ void mac_top_init_gNB(void) rrc_init_nr_global_param(); + } else { RC.nrmac = NULL; } diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index c2e2b8d562..1a3b654727 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -665,6 +665,7 @@ typedef struct gNB_MAC_INST_s { NR_TAG_t *tag; /// Pointer to IF module instance for PHY NR_IF_Module_t *if_inst; + pthread_t stats_thread; /// Pusch target SNR int pusch_target_snrx10; /// Pucch target SNR From 97d114e0ed8dc057a1fd9f1591dcd4ae580b70ef Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 4 Oct 2021 17:11:41 +0200 Subject: [PATCH 045/883] bugfix --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2ccc6c3e27..62ac6e57f7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -575,7 +575,6 @@ void pf_dl(module_id_t module_id, if (sched_ctrl->ul_failure==1 && get_softmodem_params()->phy_test==0) continue; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - if (sched_ctrl->ul_failure==1) continue; /* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */ sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head; From 33371f226a963e5e391a864f42511f6c191982a8 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 5 Oct 2021 11:37:34 +0200 Subject: [PATCH 046/883] initial changes for n41 support with aw2s RRU --- executables/nr-ru.c | 1 - executables/nr-softmodem.c | 4 +++- openair1/PHY/NR_TRANSPORT/nr_dci.c | 4 ++-- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 2 ++ openair1/PHY/NR_TRANSPORT/nr_prach.c | 21 ++++++++++--------- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 +- openair1/SCHED_NR/fapi_nr_l1.c | 3 ++- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair2/LAYER2/NR_MAC_gNB/config.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 20 ++++++++++-------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 12 files changed, 37 insertions(+), 30 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 57ab8494bf..4bcfc04b98 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1401,7 +1401,6 @@ void *ru_thread( void *param ) { // Do PRACH RU processing int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST); uint8_t prachStartSymbol,N_dur; - if (prach_id>=0) { T(T_GNB_PHY_PRACH_INPUT_SIGNAL, T_INT(proc->frame_rx), T_INT(proc->tti_rx), T_INT(0), T_BUFFER(&ru->common.rxdata[0][fp->get_samples_slot_timestamp(proc->tti_rx-1,fp,0)]/*-ru->N_TA_offset*/, fp->get_samples_per_slot(proc->tti_rx,fp)*4*2)); diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 1b33667b13..a799a54d57 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -335,13 +335,15 @@ int create_gNB_tasks(uint32_t gnb_nb) { for(int i = GNB_INTERFACE_NAME_FOR_NG_AMF_IDX; i <= GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX; i++) { if( NETParams[i].strptr == NULL) { - LOG_E(NGAP, "No configuration in the file.\n"); + LOG_E(NGAP, "No configuration in the file (%d).\n",i); NGAP_CONF_MODE = 0; } else { LOG_D(NGAP, "Configuration in the file: %s.\n",*NETParams[i].strptr); } } + LOG_E(NGAP,"aprefix %s : %s %s %s %s %d %s %d\n",aprefix,NETParams[0].strptr,NETParams[1].strptr,NETParams[2].strptr,NETParams[3].strptr,NETParams[4].iptr,NETParams[5].strptr,NETParams[6].iptr); + if (AMF_MODE_ENABLED) { if (gnb_nb > 0) { /* diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 194c7c0c56..253635ba65 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -97,8 +97,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_nsymb = pdcch_pdu_rel15->DurationSymbols; dci_idx = 0; - LOG_D(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); - LOG_D(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); + LOG_D(PHY, "pdcch: Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); + LOG_D(PHY, "pdcch: Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); // DMRS length is per OFDM symbol uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE) uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 5e00a37266..627149ac1f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -146,6 +146,8 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB, uint8_t dmrs_Type = rel15->dmrsConfigType; int nb_re_dmrs; uint16_t n_dmrs; + LOG_D(PHY,"pdsch: BWPStart %d, BWPSize %d, rbStart %d, rbsize %d\n", + rel15->BWPStart,rel15->BWPSize,rel15->rbStart,rel15->rbSize); if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) { nb_re_dmrs = 6*rel15->numDmrsCdmGrpsNoData; } diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach.c b/openair1/PHY/NR_TRANSPORT/nr_prach.c index 4e2fbd4e71..b12a58526d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_TRANSPORT/nr_prach.c @@ -68,7 +68,7 @@ int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame, int slot, find_type_t type) { } else if ((type == SEARCH_EXIST) && (gNB->prach_vars.list[i].frame == frame) && - (gNB->prach_vars.list[i].slot == slot)) { + (gNB->prach_vars.list[i].slot == slot)) { return i; } } @@ -107,15 +107,15 @@ int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type) { for (uint16_t i=0; i %d.%d\n", frame,slot,i, ru->prach_list[i].frame,ru->prach_list[i].slot); - if((type == SEARCH_EXIST_OR_FREE) && - (ru->prach_list[i].frame == -1) && - (ru->prach_list[i].slot == -1)) { - pthread_mutex_unlock(&ru->prach_list_mutex); - return i; - } + if((type == SEARCH_EXIST_OR_FREE) && + (ru->prach_list[i].frame == -1) && + (ru->prach_list[i].slot == -1)) { + pthread_mutex_unlock(&ru->prach_list_mutex); + return i; + } else if ((type == SEARCH_EXIST) && - (ru->prach_list[i].frame == frame) && - (ru->prach_list[i].slot == slot)) { + (ru->prach_list[i].frame == frame) && + (ru->prach_list[i].slot == slot)) { pthread_mutex_unlock(&ru->prach_list_mutex); return i; } @@ -185,7 +185,8 @@ void rx_nr_prach_ru(RU_t *ru, rxsigF = ru->prach_rxsigF[prachOccasion]; - AssertFatal(ru->if_south == LOCAL_RF,"we shouldn't call this if if_south != LOCAL_RF\n"); + AssertFatal(ru->if_south == LOCAL_RF || ru->if_south == REMOTE_IF5, + "we shouldn't call this if if_south != LOCAL_RF or REMOTE_IF5\n"); for (int aa=0; aanb_rx; aa++){ if (prach_sequence_length == 0) slot2=(slot/fp->slots_per_subframe)*fp->slots_per_subframe; diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 8063fe136f..1fa03842cc 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -426,7 +426,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - if (no_conf) LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + if (1/*no_conf*/) LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index b2a802ab08..c9b8defca2 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -253,7 +253,8 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PRACH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot); nfapi_nr_prach_pdu_t *prach_pdu = &UL_tti_req->pdus_list[i].prach_pdu; nr_fill_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu); - if (gNB->RU_list[0]->if_south == LOCAL_RF) nr_fill_prach_ru(gNB->RU_list[0], UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu); + if (gNB->RU_list[0]->if_south == LOCAL_RF || + gNB->RU_list[0]->if_south == REMOTE_IF5) nr_fill_prach_ru(gNB->RU_list[0], UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu); break; } } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index bc22a3602e..f700b092aa 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -453,7 +453,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, int SNRtimes10 = dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot) - dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot); - LOG_D(PHY, "Estimated SNR for PUSCH is = %f dB (ulsch_power %f, noise %f)\n", SNRtimes10/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot)/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot)/10.0); + LOG_I(PHY, "%d.%d: Estimated SNR for PUSCH is = %f dB (ulsch_power %f, noise %f) delay %d\n", frame, slot_rx, SNRtimes10/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot)/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot)/10.0,sync_pos); if (SNRtimes10 < -640) cqi=0; else if (SNRtimes10 > 635) cqi=255; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 41591b1169..4ac09bab6a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -318,14 +318,14 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts scs_scaling = scs_scaling>>2; uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA); uint16_t sco = absolute_diff%(12*scs_scaling); - AssertFatal(sco==(scs_scaling * ssb_SubcarrierOffset),"absoluteFrequencySSB has a subcarrier offset of %d while it should be %d\n",sco/scs_scaling,ssb_SubcarrierOffset); + AssertFatal(sco==(scs_scaling * (ssb_SubcarrierOffset>>(cfg->ssb_config.scs_common.value))),"absoluteFrequencySSB has a subcarrier offset of %d while it should be %d\n",sco/scs_scaling,ssb_SubcarrierOffset); cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG; cfg->num_tlv++; cfg->ssb_table.ssb_period.value = *scc->ssb_periodicityServingCell; cfg->ssb_table.ssb_period.tl.tag = NFAPI_NR_CONFIG_SSB_PERIOD_TAG; cfg->num_tlv++; - cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset; + cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset>>(cfg->ssb_config.scs_common.value); cfg->ssb_table.ssb_subcarrier_offset.tl.tag = NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG; cfg->num_tlv++; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 27037446d2..8367abfd3e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -861,7 +861,7 @@ void nr_get_Msg3alloc(module_id_t module_id, // msg3 is scheduled in mixed slot in the following TDD period - uint16_t msg3_nb_rb = 8 + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT); // sdu has 6 or 8 bytes + uint16_t msg3_nb_rb = 8; // sdu has 6 or 8 bytes int mu = ubwp ? ubwp->bwp_Common->genericParameters.subcarrierSpacing : diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 2f23800af9..cbdc00aa61 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -400,14 +400,14 @@ uint32_t schedule_control_sib1(module_id_t module_id, gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize = rbSize; gNB_mac->sched_ctrlCommon->sched_pdsch.rbStart = 0; - LOG_D(MAC,"mcs = %i\n", gNB_mac->sched_ctrlCommon->sched_pdsch.mcs); - LOG_D(MAC,"startSymbolIndex = %i\n", startSymbolIndex); - LOG_D(MAC,"nrOfSymbols = %i\n", nrOfSymbols); - LOG_D(MAC, "rbSize = %i\n", gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize); - LOG_D(MAC,"TBS = %i\n", TBS); - LOG_D(MAC,"dmrs_length %d\n",dmrs_length); - LOG_D(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); - LOG_D(MAC,"mappingtype = %d\n", mappingtype); + LOG_D(NR_MAC,"mcs = %i\n", gNB_mac->sched_ctrlCommon->sched_pdsch.mcs); + LOG_D(NR_MAC,"startSymbolIndex = %i\n", startSymbolIndex); + LOG_D(NR_MAC,"nrOfSymbols = %i\n", nrOfSymbols); + LOG_D(NR_MAC, "rbSize = %i\n", gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize); + LOG_D(NR_MAC,"TBS = %i\n", TBS); + LOG_D(NR_MAC,"dmrs_length %d\n",dmrs_length); + LOG_D(NR_MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); + LOG_D(NR_MAC,"mappingtype = %d\n", mappingtype); // Mark the corresponding RBs as used for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { @@ -486,7 +486,9 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, pdsch_pdu_rel15->StartSymbolIndex = StartSymbolIndex; pdsch_pdu_rel15->NrOfSymbols = NrOfSymbols; pdsch_pdu_rel15->dlDmrsSymbPos = dlDmrsSymbPos; - LOG_D(MAC,"dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos); + LOG_D(NR_MAC,"sib1:bwpStart %d, bwpSize %d\n",pdsch_pdu_rel15->BWPStart,pdsch_pdu_rel15->BWPSize); + LOG_D(NR_MAC,"sib1:rbStart %d, rbSize %d\n",pdsch_pdu_rel15->rbStart,pdsch_pdu_rel15->rbSize); + LOG_D(NR_MAC,"sib1:dlDmrsSymbPos = 0x%x\n", pdsch_pdu_rel15->dlDmrsSymbPos); /* Fill PDCCH DL DCI PDU */ nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index ec57befd71..49b1a8ff54 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1044,7 +1044,7 @@ void pf_ul(module_id_t module_id, gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; NR_UE_info_t *UE_info = &nrmac->UE_info; - const int min_rb = 40; + const int min_rb = 5; float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled int ue_array[MAX_MOBILES_PER_GNB]; From 3549168347562664433c2d8aa2ce8bdad50d5a43 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 6 Oct 2021 22:43:06 +0200 Subject: [PATCH 047/883] removal of mean signal level --- executables/nr-ru.c | 6 ++- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 52 +++++++++++++++----- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 57ab8494bf..1d0c3eea29 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1367,7 +1367,10 @@ void *ru_thread( void *param ) { initial_wait=0; opp_enabled = opp_enabled0; } - if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul); + if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul); + + + proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame; @@ -1387,6 +1390,7 @@ void *ru_thread( void *param ) { if (ru->feprx) { ru->feprx(ru,proc->tti_rx); //LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1); + if (initial_wait == 0 && proc->frame_rx == 127 ) {LOG_M("rxdata.m","rxs",ru->common.rxdata[0],fp->samples_per_frame,1,1); LOG_M("rxdataF.m","rxsF",RC.gNB[0]->common_vars.rxdataF[0],fp->symbols_per_slot*fp->ofdm_symbol_size,1,1); exit(-1);} LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx); /* LOG_D(PHY,"Copying rxdataF from RU to gNB\n"); diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index b1608b09ea..6cd7c4029f 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -676,25 +676,53 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp // bring RX data into 12 LSBs for softmodem RX for (int i=0; itype==USRP_X300_DEV) { openair0_cfg[0].rx_gain_calib_table = calib_table_x310; std::cerr << "-- Using calibration table: calib_table_x310" << std::endl; - s->usrp->set_rx_dc_offset(true); + // s->usrp->set_rx_dc_offset(true); } if (device->type==USRP_N300_DEV) { From a0eddabbbd9efca935cf5e0e9316a38aa76fcf23 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Wed, 6 Oct 2021 22:44:22 +0200 Subject: [PATCH 048/883] log reduction --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 77ad962d56..194c7c0c56 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -97,8 +97,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_nsymb = pdcch_pdu_rel15->DurationSymbols; dci_idx = 0; - LOG_I(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); - LOG_I(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); + LOG_D(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); + LOG_D(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); // DMRS length is per OFDM symbol uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE) uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE) From 7d7dd29514c4d5d9c2f5d497ca0b8eedf4641009 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 8 Oct 2021 15:44:57 +0200 Subject: [PATCH 049/883] blacklisting of PRBs in configuration file --- executables/nr-ru.c | 1 - .../PHY/NR_ESTIMATION/nr_measurements_gNB.c | 6 +- openair1/PHY/defs_gNB.h | 2 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 11 +++- openair2/GNB_APP/gnb_config.c | 55 ++++++++++++++++++- openair2/GNB_APP/gnb_paramdef.h | 6 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 + targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 33 +---------- 8 files changed, 78 insertions(+), 38 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 1d0c3eea29..195285b187 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1390,7 +1390,6 @@ void *ru_thread( void *param ) { if (ru->feprx) { ru->feprx(ru,proc->tti_rx); //LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1); - if (initial_wait == 0 && proc->frame_rx == 127 ) {LOG_M("rxdata.m","rxs",ru->common.rxdata[0],fp->samples_per_frame,1,1); LOG_M("rxdataF.m","rxsF",RC.gNB[0]->common_vars.rxdataF[0],fp->symbols_per_slot*fp->ofdm_symbol_size,1,1); exit(-1);} LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx); /* LOG_D(PHY,"Copying rxdataF from RU to gNB\n"); diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c index 020117adba..157c9533d0 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c +++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c @@ -73,8 +73,9 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) { int min_I0=1000,max_I0=0; int amin=0,amax=0; + fprintf(fd,"Blacklisted PRBs %d/%d\n",gNB->num_ulprbbl,gNB->frame_parms.N_RB_UL); for (int i=0; iframe_parms.N_RB_UL; i++) { - if (i==(gNB->frame_parms.N_RB_UL>>1) - 1) i+=2; + if (gNB->ulprbbl[i] > 0) continue; if (gNB->measurements.n0_subband_power_tot_dB[i]measurements.n0_subband_power_tot_dB[i]; amin=i;} @@ -82,7 +83,8 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) { } for (int i=0; iframe_parms.N_RB_UL; i++) { - fprintf(fd,"%2d.",gNB->measurements.n0_subband_power_tot_dB[i]-gNB->measurements.n0_subband_power_avg_dB); + if (gNB->ulprbbl[i] ==0) fprintf(fd,"%2d.",gNB->measurements.n0_subband_power_tot_dB[i]-gNB->measurements.n0_subband_power_avg_dB); + else fprintf(fd,"X ."); if (i%25 == 24) fprintf(fd,"\n"); } fprintf(fd,"\n"); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 9a1ba7e780..55a60f7a1b 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -855,6 +855,8 @@ typedef struct PHY_VARS_gNB_s { int pusch_thres; int prach_thres; uint64_t bad_pucch; + int num_ulprbbl; + int ulprbbl[275]; /* time_stats_t phy_proc; */ diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index bc22a3602e..f4a98cef64 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -539,11 +539,18 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { int rb2, rb, nb_rb; + int prbpos=0; if (1/*(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[slot_rx].max_num_of_symbol_per_slot_list[symbol].slot_config.value==1*/){ nb_rb = 0; for (int symbol=0;symbol<14;symbol++) - for (int m=0;m<9;m++) gNB->rb_mask_ul[symbol][m] = 0; - + for (int m=0;m<9;m++) { + gNB->rb_mask_ul[symbol][m] = 0; + for (int i=0;i<32;i++) { + prbpos = (m*32)+i; + if (prbpos>gNB->frame_parms.N_RB_UL) break; + gNB->rb_mask_ul[symbol][m] |= (gNB->ulprbbl[prbpos]>0 ? 1 : 0)<pucch[i]; if (pucch) { diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 209cdd255d..8d15fc3445 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -549,6 +549,31 @@ void RCconfig_nr_flexran() void RCconfig_NR_L1(void) { int j; + paramdef_t GNBSParams[] = GNBSPARAMS_DESC; + ////////// Identification parameters + paramdef_t GNBParams[] = GNBPARAMS_DESC; + + paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0}; + + config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL); + int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; + AssertFatal (num_gnbs > 0,"Failed to parse config file no gnbs %s \n",GNB_CONFIG_STRING_ACTIVE_GNBS); + + config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); + char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr; + if (ulprbbl) LOG_I(NR_PHY,"PRB blacklist %s\n",ulprbbl); + char *pt = strtok(ulprbbl,","); + int prbbl[275]; + int num_prbbl=0; + memset(prbbl,0,275*sizeof(int)); + + while (pt) { + prbbl[atoi(pt)] = 1; + LOG_I(NR_PHY,"Blacklisting prb %d\n",atoi(pt)); + pt = strtok(NULL,","); + num_prbbl++; + } + paramdef_t L1_Params[] = L1PARAMS_DESC; paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; @@ -577,6 +602,9 @@ void RCconfig_NR_L1(void) { RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); RC.gNB[j]->pusch_thres = *(L1_ParamList.paramarray[j][L1_PUSCH_DTX_THRESHOLD].uptr); + RC.gNB[j]->num_ulprbbl = num_prbbl; + LOG_I(NR_PHY,"Copying %d blacklisted PRB to L1 context\n",num_prbbl); + memcpy(RC.gNB[j]->ulprbbl,prbbl,275*sizeof(int)); if(strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { //sf_ahead = 2; // Need 4 subframe gap between RX and TX }else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) { @@ -633,9 +661,32 @@ void RCconfig_NR_L1(void) { void RCconfig_nr_macrlc() { int j; + + paramdef_t GNBSParams[] = GNBSPARAMS_DESC; + ////////// Identification parameters + paramdef_t GNBParams[] = GNBPARAMS_DESC; + + paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0}; + + config_get( GNBSParams,sizeof(GNBSParams)/sizeof(paramdef_t),NULL); + int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; + AssertFatal (num_gnbs > 0,"Failed to parse config file no gnbs %s \n",GNB_CONFIG_STRING_ACTIVE_GNBS); + + config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); + char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr; + char *pt = strtok(ulprbbl,","); + int prbbl[275]; + int num_prbbl=0; + int prb; + memset(prbbl,0,275*sizeof(int)); + while (pt) { + prb=atoi(pt); + prbbl[prb] = 1; + pt = strtok(NULL,","); + num_prbbl++; + } paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC; paramlist_def_t MacRLC_ParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; - config_getlist( &MacRLC_ParamList,MacRLC_Params,sizeof(MacRLC_Params)/sizeof(paramdef_t), NULL); if ( MacRLC_ParamList.numelt > 0) { @@ -702,6 +753,8 @@ void RCconfig_nr_macrlc() { AssertFatal(1==0,"MACRLC %d: %s unknown southbound midhaul\n",j,*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr)); } RC.nrmac[j]->ulsch_max_slots_inactivity = *(MacRLC_ParamList.paramarray[j][MACRLC_ULSCH_MAX_SLOTS_INACTIVITY].uptr); + RC.nrmac[j]->num_ulprbbl = num_prbbl; + memcpy(RC.nrmac[j]->ulprbbl,prbbl,num_prbbl*sizeof(prbbl[0])); }// for (j=0;j 0 LOG_E(PHY,"No %s configuration found\n", CONFIG_STRING_MACRLC_LIST); diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 380c6890a5..4618c009b4 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -120,7 +120,7 @@ typedef enum { #define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" #define GNB_CONFIG_STRING_MINRXTXTIMEPDSCH "min_rxtxtime_pdsch" - +#define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* cell configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -146,7 +146,8 @@ typedef enum { {GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ -{GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0} \ +{GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ } #define GNB_GNB_ID_IDX 0 @@ -170,6 +171,7 @@ typedef enum { #define GNB_DO_CSIRS_IDX 18 #define GNB_NRCELLID_IDX 19 #define GNB_MINRXTXTIMEPDSCH_IDX 20 +#define GNB_ULPRBBLACKLIST_IDX 21 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 1a3b654727..4adbb70daf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -683,6 +683,8 @@ typedef struct gNB_MAC_INST_s { /// current PDU index (BCH,DLSCH) uint16_t pdu_index[NFAPI_CC_MAX]; + int num_ulprbbl; + int ulprbbl[275]; /// NFAPI Config Request Structure nfapi_nr_config_request_scf_t config[NFAPI_CC_MAX]; /// NFAPI DL Config Request Structure diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 6cd7c4029f..7bccf66c5c 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -679,44 +679,17 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp #if defined(__x86_64__) || defined(__i386__) #ifdef __AVX2__ - __m256i mean=_mm256_setzero_si256(); - int16_t mean16[2]; - for (int j=0; j Date: Fri, 8 Oct 2021 21:21:28 +0200 Subject: [PATCH 050/883] MAC support for prb blacklisting --- openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c index 157c9533d0..73b8660e83 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c +++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c @@ -84,7 +84,7 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) { for (int i=0; iframe_parms.N_RB_UL; i++) { if (gNB->ulprbbl[i] ==0) fprintf(fd,"%2d.",gNB->measurements.n0_subband_power_tot_dB[i]-gNB->measurements.n0_subband_power_avg_dB); - else fprintf(fd,"X ."); + else fprintf(fd," X."); if (i%25 == 24) fprintf(fd,"\n"); } fprintf(fd,"\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index ec57befd71..03c0bbe777 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1322,6 +1322,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t int st = 0, e = 0, len = 0; for (int i = 0; i < bwpSize; i++) { + if (RC.nrmac[module_id]->ulprbbl[i] == 1) vrb_map_UL[i]=1; while ((vrb_map_UL[i] & symb) != 0 && i < bwpSize) i++; st = i; From 85d54ac9df34516244b5d7cb8d7f9886dbf09554 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Thu, 14 Oct 2021 15:46:50 +0200 Subject: [PATCH 051/883] logging --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair2/GNB_APP/gnb_config.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 59 ++++++++++--------- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index d1fe5ea049..7f5736a33a 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -275,7 +275,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0); //dumpsig=1; } else { - LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, TBS %d) r %d\n", + LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, TBS %d) r %d\n", gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot, rdata->harq_pid,pusch_pdu->pusch_data.new_data_indicator,ulsch_harq->status, ulsch_harq->round, ulsch_harq->ulsch_pdu.pusch_data.rv_index,ulsch_harq->TBS,r); ulsch_harq->round++; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 8d15fc3445..421f7e17dd 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -754,7 +754,7 @@ void RCconfig_nr_macrlc() { } RC.nrmac[j]->ulsch_max_slots_inactivity = *(MacRLC_ParamList.paramarray[j][MACRLC_ULSCH_MAX_SLOTS_INACTIVITY].uptr); RC.nrmac[j]->num_ulprbbl = num_prbbl; - memcpy(RC.nrmac[j]->ulprbbl,prbbl,num_prbbl*sizeof(prbbl[0])); + memcpy(RC.nrmac[j]->ulprbbl,prbbl,275*sizeof(prbbl[0])); }// for (j=0;j 0 LOG_E(PHY,"No %s configuration found\n", CONFIG_STRING_MACRLC_LIST); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 23b3bf1ddf..ddd7e0334a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1245,6 +1245,7 @@ void pf_ul(module_id_t module_id, const int B = cmax(sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes, 0); uint16_t rbSize = 0; uint32_t TBS = 0; + nr_find_nb_rb(sched_pusch->Qm, sched_pusch->R, ps->nrOfSymbols, @@ -1255,8 +1256,8 @@ void pf_ul(module_id_t module_id, &rbSize); sched_pusch->rbSize = rbSize; sched_pusch->tb_size = TBS; - LOG_D(NR_MAC,"rbSize %d, TBS %d, est buf %d, sched_ul %d, B %d, CCE %d, num_dmrs_symb %d, N_PRB_DMRS %d\n", - rbSize, sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B,sched_ctrl->cce_index,ps->num_dmrs_symb,ps->N_PRB_DMRS); + LOG_I(NR_MAC,"rbSize %d (max_rbSize %d), TBS %d, est buf %d, sched_ul %d, B %d, CCE %d, num_dmrs_symb %d, N_PRB_DMRS %d\n", + rbSize, max_rbSize,sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B,sched_ctrl->cce_index,ps->num_dmrs_symb,ps->N_PRB_DMRS); /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; @@ -1329,8 +1330,10 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t const uint16_t symb = ((1 << nrOfSymbols) - 1) << startSymbolIndex; int st = 0, e = 0, len = 0; + + for (int i = 0; i < bwpSize; i++) + if (RC.nrmac[module_id]->ulprbbl[i] == 1) vrb_map_UL[i]=symb; for (int i = 0; i < bwpSize; i++) { - if (RC.nrmac[module_id]->ulprbbl[i] == 1) vrb_map_UL[i]=1; while ((vrb_map_UL[i] & symb) != 0 && i < bwpSize) i++; st = i; @@ -1348,7 +1351,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t /* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */ for (int i = 0; i < bwpSize; i++) rballoc_mask[i] = i >= st && i <= e; - + LOG_D(NR_MAC,"%d.%d : UL start %d, end %d\n",frame,slot,st,e); /* proportional fair scheduling algorithm */ pf_ul(module_id, frame, @@ -1490,30 +1493,30 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) UE_info->mac_stats[UE_id].ulsch_current_bytes = sched_pusch->tb_size; sched_ctrl->last_ul_frame = sched_pusch->frame; sched_ctrl->last_ul_slot = sched_pusch->slot; - - LOG_D(NR_MAC, - "ULSCH/PUSCH: %4d.%2d RNTI %04x UL sched %4d.%2d DCI L %d start %2d RBS %3d startSymbol %2d nb_symbol %2d dmrs_pos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d est %6d sched %6d est BSR %6d TPC %d\n", - frame, - slot, - rnti, - sched_pusch->frame, - sched_pusch->slot, - sched_ctrl->aggregation_level, - sched_pusch->rbStart, - sched_pusch->rbSize, - ps->startSymbolIndex, - ps->nrOfSymbols, - ps->ul_dmrs_symb_pos, - sched_pusch->mcs, - sched_pusch->tb_size, - harq_id, - cur_harq->round, - nr_rv_round_map[cur_harq->round], - cur_harq->ndi, - sched_ctrl->estimated_ul_buffer, - sched_ctrl->sched_ul_bytes, - sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes, - sched_ctrl->tpc0); + if (sched_pusch->rbSize > 5) + LOG_D(NR_MAC, + "ULSCH/PUSCH: %4d.%2d RNTI %04x UL sched %4d.%2d DCI L %d start %2d RBS %3d startSymbol %2d nb_symbol %2d dmrs_pos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d est %6d sched %6d est BSR %6d TPC %d\n", + frame, + slot, + rnti, + sched_pusch->frame, + sched_pusch->slot, + sched_ctrl->aggregation_level, + sched_pusch->rbStart, + sched_pusch->rbSize, + ps->startSymbolIndex, + ps->nrOfSymbols, + ps->ul_dmrs_symb_pos, + sched_pusch->mcs, + sched_pusch->tb_size, + harq_id, + cur_harq->round, + nr_rv_round_map[cur_harq->round], + cur_harq->ndi, + sched_ctrl->estimated_ul_buffer, + sched_ctrl->sched_ul_bytes, + sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes, + sched_ctrl->tpc0); /* PUSCH in a later slot, but corresponding DCI now! */ From e1eebbad19112008bbbe797b539b920b4c2153c1 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Sat, 16 Oct 2021 11:11:05 +0200 Subject: [PATCH 052/883] CSI RSRP reporting ok. --- openair2/LAYER2/NR_MAC_gNB/config.c | 7 +++++ .../NR_MAC_gNB/gNB_scheduler_primitives.c | 7 ++++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 29 ++++++++++++++----- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index a2c130078e..15dd5c1561 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -626,6 +626,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, UE_info->UE_sched_ctrl[UE_id].search_space = get_searchspace(scc, bwpd, target_ss); UE_info->UE_sched_ctrl[UE_id].coreset = get_coreset(Mod_idP, scc, bwpd, UE_info->UE_sched_ctrl[UE_id].search_space, target_ss); UE_info->UE_sched_ctrl[UE_id].maxL = 2; + if (CellGroup->spCellConfig && + CellGroup->spCellConfig->spCellConfigDedicated && + CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig && + CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup + ) + compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, Mod_idP); + } } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index c1b1ef9762..3fb98620de 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1935,7 +1935,12 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG add_nr_list(&UE_info->list, UE_id); memset(&UE_info->mac_stats[UE_id], 0, sizeof(NR_mac_stats_t)); set_Y(UE_info->Y[UE_id], rntiP); - if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) + if (CellGroup && + CellGroup->spCellConfig && + CellGroup->spCellConfig->spCellConfigDedicated && + CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig && + CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup + ) compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; memset(sched_ctrl, 0, sizeof(*sched_ctrl)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 820aa8ae6a..65972017da 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -362,6 +362,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in struct NR_CSI_ResourceConfig *csi_resourceconfig; // for each CSI measurement report configuration (list of CSI-ReportConfig) + LOG_I(NR_MAC,"Searching %d csi_reports\n",csi_MeasConfig->csi_ReportConfigToAddModList->list.count); for (csi_report_id=0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++){ struct NR_CSI_ReportConfig *csi_reportconfig = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; // MAC structure for CSI measurement reports (per UE and per report) @@ -416,7 +417,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in } else AssertFatal(1==0,"Only periodic resource configuration currently supported\n"); } - + LOG_I(NR_MAC,"nb_resources %d\n",nb_resources); // computation of bit length depending on the report type switch(reportQuantity_type){ case (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP): @@ -504,7 +505,7 @@ void nr_csi_meas_reporting(int Mod_idP, // preparation is done in first slot of tdd period if (frame % (period / n_slots_frame) != offset / n_slots_frame) continue; - LOG_D(NR_MAC, "CSI reporting in frame %d slot %d\n", frame, sched_slot); + LOG_I(NR_MAC, "CSI reporting in frame %d slot %d\n", frame, sched_slot); const NR_PUCCH_CSI_Resource_t *pucchcsires = csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.array[0]; const NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[1]; // set with formats >1 @@ -530,7 +531,7 @@ void nr_csi_meas_reporting(int Mod_idP, curr_pucch->resource_indicator = res_index; curr_pucch->csi_bits += nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id); - + LOG_I(NR_MAC,"Programmed CSI pucch for %d.%d, resource %d, csi_bits %d\n",frame,sched_slot,res_index,curr_pucch->csi_bits); // going through the list of PUCCH resources to find the one indexed by resource_id uint16_t *vrb_map_UL = &RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; const int m = pucch_Config->resourceToAddModList->list.count; @@ -695,18 +696,27 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { int ssb_index[MAX_NUM_SSB] = {0}; int ssb_rsrp[MAX_NUM_SSB] = {0}; uint8_t idx = 0; - int bwp_id = 1; NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + int bwp_id = sched_ctrl->active_bwp ? 1 : 0; NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id]; - NR_BWP_Downlink_t *bwp = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]; + NR_BWP_Downlink_t *bwp = bwp_id>0 ? + sched_ctrl->active_bwp: + NULL; + + //bwp indicator - int n_dl_bwp = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count; + int n_dl_bwp=0; + if (CellGroup->spCellConfig->spCellConfigDedicated && + CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList) + n_dl_bwp = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count; + uint8_t nr_ssbri_cri = 0; uint8_t nb_of_csi_ssb_report = UE_info->csi_report_template[UE_id][cqi_idx].nb_of_csi_ssb_report; int better_rsrp_reported = -140-(-0); /*minimum_measured_RSRP_value - minimum_differntail_RSRP_value*///considering the minimum RSRP value as better RSRP initially uint8_t diff_rsrp_idx = 0; uint8_t i, j; - NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; if (n_dl_bwp < 4) @@ -831,7 +841,10 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { } } - sched_ctrl->UE_mac_ce_ctrl.pdcch_state_ind.tci_present_inDCI = bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[bwp_id-1]->tci_PresentInDCI; + sched_ctrl->UE_mac_ce_ctrl.pdcch_state_ind.tci_present_inDCI = bwp ? + bwp->bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[bwp_id-1]->tci_PresentInDCI : + CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdcch_Config->choice.setup->controlResourceSetToAddModList->list.array[0]->tci_PresentInDCI; + //filling pdsch tci state activation deactivation mac ce structure fields if(sched_ctrl->UE_mac_ce_ctrl.pdcch_state_ind.tci_present_inDCI) { From 4496b05423f5cff4080895adec85a1346da75cf8 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Sun, 17 Oct 2021 18:03:55 +0200 Subject: [PATCH 053/883] testing CSI reporting and MIMO DL --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 10 +++++----- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 20 +++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/main.c | 6 ++++++ openair2/RRC/NR/MESSAGES/asn1_msg.c | 1 - openair2/RRC/NR/rrc_gNB_reconfig.c | 3 ++- 8 files changed, 26 insertions(+), 20 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 594557afb1..53116671b9 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -1519,7 +1519,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, #ifdef DEBUG_NR_PUCCH_RX printf("cw_ML %d, metric %d dB\n",cw_ML,corr_dB); #endif - LOG_I(PHY,"slot %d PUCCH2 cw_ML %d, metric %d dB\n",slot,cw_ML,corr_dB); + LOG_D(PHY,"slot %d PUCCH2 cw_ML %d, metric %d dB\n",slot,cw_ML,corr_dB); decodedPayload[0]=(uint64_t)cw_ML; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 9bdedb0357..6d7b3fd81f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -905,7 +905,7 @@ void nr_schedule_ue_spec(module_id_t module_id, harq->is_waiting = true; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d nrOfLayer %d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) TPC %d\n", frame, slot, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index ea1eae17e2..57500ee56d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -418,7 +418,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, NR_PDSCH_Config_t *pdsch_Config=NULL; if (bwpd) pdsch_Config = bwpd->pdsch_Config->choice.setup; - LOG_I(NR_MAC,"tda %d, ps->time_domain_allocation %d,layers %d, ps->nrOfLayers %d, pdsch_config %p\n",tda,ps->time_domain_allocation,layers,ps->nrOfLayers,pdsch_Config); + LOG_D(NR_MAC,"tda %d, ps->time_domain_allocation %d,layers %d, ps->nrOfLayers %d, pdsch_config %p\n",tda,ps->time_domain_allocation,layers,ps->nrOfLayers,pdsch_Config); if (ps->time_domain_allocation != tda) { reset_dmrs = true; ps->time_domain_allocation = tda; @@ -440,7 +440,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, } const long dci_format = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; - LOG_I(NR_MAC,"dci_format %d\n",(int)dci_format); + LOG_D(NR_MAC,"dci_format %d\n",(int)dci_format); if (dci_format == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0 || pdsch_Config == NULL) { if (ps->nrOfSymbols == 2 && ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB) @@ -456,7 +456,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->nrOfLayers = 1; } else { - LOG_I(NR_MAC,"checking layers\n"); + LOG_D(NR_MAC,"checking layers\n"); if (ps->nrOfLayers != layers) { reset_dmrs = true; ps->nrOfLayers = layers; @@ -468,7 +468,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, if (reset_dmrs) { ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type, ps->frontloaded_symb); ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); - LOG_I(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT); + LOG_D(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT); } } @@ -2349,7 +2349,7 @@ void nr_csirs_scheduling(int Mod_idP, if((frame*n_slots_frame+slot-offset)%period == 0) { - LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot); + LOG_D(NR_MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot); nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index da18f324ef..4b23ab4656 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -60,7 +60,7 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, memset(pucch_pdu, 0, sizeof(nfapi_nr_pucch_pdu_t)); future_ul_tti_req->n_pdus += 1; - LOG_I(NR_MAC, + 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" : "", frame, @@ -78,7 +78,7 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, NR_BWP_UplinkDedicated_t *ubwpd; ubwpd = cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; - LOG_I(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); + LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); nr_configure_pucch(pucch_pdu, scc, UE_info->CellGroup[UE_id], @@ -556,7 +556,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in struct NR_CSI_ResourceConfig *csi_resourceconfig; // for each CSI measurement report configuration (list of CSI-ReportConfig) - LOG_I(NR_MAC,"Searching %d csi_reports\n",csi_MeasConfig->csi_ReportConfigToAddModList->list.count); + LOG_D(NR_MAC,"Searching %d csi_reports\n",csi_MeasConfig->csi_ReportConfigToAddModList->list.count); for (csi_report_id=0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++){ struct NR_CSI_ReportConfig *csi_reportconfig = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; // MAC structure for CSI measurement reports (per UE and per report) @@ -611,7 +611,7 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in } else AssertFatal(1==0,"Only periodic resource configuration currently supported\n"); } - LOG_I(NR_MAC,"nb_resources %d\n",nb_resources); + LOG_D(NR_MAC,"nb_resources %d\n",nb_resources); // computation of bit length depending on the report type switch(reportQuantity_type){ case (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP): @@ -724,7 +724,7 @@ void nr_csi_meas_reporting(int Mod_idP, // preparation is done in first slot of tdd period if (frame % (period / n_slots_frame) != offset / n_slots_frame) continue; - LOG_I(NR_MAC, "CSI reporting in frame %d slot %d\n", frame, sched_slot); + LOG_D(NR_MAC, "CSI reporting in frame %d slot %d\n", frame, sched_slot); const NR_PUCCH_CSI_Resource_t *pucchcsires = csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.array[0]; const NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[1]; // set with formats >1 @@ -750,7 +750,7 @@ void nr_csi_meas_reporting(int Mod_idP, curr_pucch->resource_indicator = res_index; curr_pucch->csi_bits += nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id); - LOG_I(NR_MAC,"Programmed CSI pucch for %d.%d, resource %d, csi_bits %d\n",frame,sched_slot,res_index,curr_pucch->csi_bits); + LOG_D(NR_MAC,"Programmed CSI pucch for %d.%d, resource %d, csi_bits %d\n",frame,sched_slot,res_index,curr_pucch->csi_bits); // going through the list of PUCCH resources to find the one indexed by resource_id uint16_t *vrb_map_UL = &RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; const int m = pucch_Config->resourceToAddModList->list.count; @@ -1188,7 +1188,7 @@ int evaluate_ri_report(uint8_t *payload, if ((ri_restriction>>i)&0x01) { if(count == ri_index) { sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri = i; - LOG_I(MAC,"CSI Reported Rank %d\n", i+1); + LOG_D(MAC,"CSI Reported Rank %d\n", i+1); return i; } count++; @@ -1218,7 +1218,7 @@ void evaluate_cqi_report(uint8_t *payload, else AssertFatal(1==0,"CQI Table not present in RRC configuration\n"); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi; - LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); + LOG_D(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi); if (cqi_bitlen > 4) { temp_cqi = pickandreverse_bits(payload, 4, cumul_bits); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi; @@ -1243,7 +1243,7 @@ uint8_t evaluate_pmi_report(uint8_t *payload, sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1, sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2); @@ -1262,7 +1262,7 @@ int evaluate_li_report(uint8_t *payload, if (li_bitlen>0) { int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits); - LOG_I(MAC,"LI %d\n",temp_li); + LOG_D(MAC,"LI %d\n",temp_li); sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.li = temp_li; } return li_bitlen; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 89410b6c2b..0c9c5bd76e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1261,7 +1261,7 @@ void pf_ul(module_id_t module_id, &rbSize); sched_pusch->rbSize = rbSize; sched_pusch->tb_size = TBS; - LOG_I(NR_MAC,"rbSize %d (max_rbSize %d), TBS %d, est buf %d, sched_ul %d, B %d, CCE %d, num_dmrs_symb %d, N_PRB_DMRS %d\n", + LOG_D(NR_MAC,"rbSize %d (max_rbSize %d), TBS %d, est buf %d, sched_ul %d, B %d, CCE %d, num_dmrs_symb %d, N_PRB_DMRS %d\n", rbSize, max_rbSize,sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B,sched_ctrl->cce_index,ps->num_dmrs_symb,ps->N_PRB_DMRS); /* Mark the corresponding RBs as used */ diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 0497eea7e1..7c7c992afc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -96,6 +96,12 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) stats->dlsch_rounds[2], stats->dlsch_rounds[3], stats->dlsch_errors, stats->pucch0_DTX, avg_rsrp, stats->num_rsrp_meas); + stroff+=sprintf(output+stroff,"UE %d: CQI %d, RI %d, PMI (%d,%d)\n", + UE_id, + UE_info->UE_sched_ctrl[UE_id].CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb, + UE_info->UE_sched_ctrl[UE_id].CSI_report.cri_ri_li_pmi_cqi_report.ri+1, + UE_info->UE_sched_ctrl[UE_id].CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1, + UE_info->UE_sched_ctrl[UE_id].CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2); stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0 ; stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 121696744b..438ba0626a 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1406,7 +1406,6 @@ void fill_initial_SpCellConfig(rnti_t rnti, } csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL; - csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL; csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL; csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index a54ce7856a..1697580640 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1342,7 +1342,8 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; nzpcsi0->periodicityAndOffset->choice.slots320 = 0; - nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL; + nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS)); + *nzpcsi0->qcl_InfoPeriodicCSI_RS=0; ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); } else From 772e8737203af26c31a61343439e04c56d60a2d1 Mon Sep 17 00:00:00 2001 From: Masayuki Harada Date: Thu, 21 Oct 2021 19:45:42 +0900 Subject: [PATCH 054/883] Add some comment and logs. --- openair2/RRC/NR/rrc_gNB_NGAP.c | 13 ++++++------- openair3/NGAP/ngap_gNB_handlers.c | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 46d3b01bf0..051c282f10 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1158,7 +1158,8 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( if (is_treated[i] == TRUE) { continue; } - + + //Check same PDU session ID to handle multiple pdu session id for (j = i+1; j < nb_pdusessions_tomodify; j++) { if (is_treated[j] == FALSE && NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id == @@ -1175,9 +1176,8 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( is_treated[j] = TRUE; } } - + // handle multiple pdu session id case if (is_treated[i] == TRUE) { - // handle multiple pdu session id LOG_D(NR_RRC, "handle multiple pdu session id \n"); ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW; ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id = @@ -1188,6 +1188,7 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( continue; } + // Check pdu session ID is established for (j = 0; j < NR_NB_RB_MAX -3; j++) { if (ue_context_p->ue_context.pduSession[j].param.pdusession_id == NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) { @@ -1223,8 +1224,8 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( } } + // handle Unknown pdu session ID if (is_treated[i] == FALSE) { - // handle Unknown pdu session ID LOG_D(NR_RRC, "handle Unknown pdu session ID \n"); ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW; ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id = @@ -1245,9 +1246,7 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( if (0 == rrc_gNB_modify_dedicatedRRCReconfiguration(&ctxt, ue_context_p)) { return (0); } - } - - { // modify failed + } else { // all pdu modification failed LOG_I(NR_RRC, "pdu session modify failed, fill NGAP_PDUSESSION_MODIFY_RESP with the pdu session information that failed to modify \n"); uint8_t nb_of_pdu_sessions_failed = 0; MessageDef *msg_fail_p = NULL; diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index fab7620f02..b468dce629 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -1630,13 +1630,6 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, return -1; } - /* PDUSession Resource modify request = UE-related procedure -> stream != 0 */ -// if (stream == 0) { -// NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n", -// assoc_id, stream); -// return -1; -// } - ue_desc_p->rx_stream = stream; if (ue_desc_p->amf_ue_ngap_id != amf_ue_ngap_id) { @@ -1718,14 +1711,20 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, switch(pdusessionTransfer_ies->id) { /* optional PDUSessionAggregateMaximumBitRate */ case NGAP_ProtocolIE_ID_id_PDUSessionAggregateMaximumBitRate: + // TODO + NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_PDUSessionAggregateMaximumBitRate\n"); break; /* optional UL-NGU-UP-TNLModifyList */ case NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLModifyList: + // TODO + NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLModifyList\n"); break; /* optional NetworkInstance */ case NGAP_ProtocolIE_ID_id_NetworkInstance: + // TODO + NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_NetworkInstance\n"); break; /* optional QosFlowAddOrModifyRequestList */ @@ -1764,14 +1763,20 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, /* optional QosFlowToReleaseList */ case NGAP_ProtocolIE_ID_id_QosFlowToReleaseList: + // TODO + NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_QosFlowToReleaseList\n"); break; /* optional AdditionalUL-NGU-UP-TNLInformation */ case NGAP_ProtocolIE_ID_id_AdditionalUL_NGU_UP_TNLInformation: + // TODO + NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_AdditionalUL_NGU_UP_TNLInformation\n"); break; /* optional CommonNetworkInstance */ case NGAP_ProtocolIE_ID_id_CommonNetworkInstance: + // TODO + NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_CommonNetworkInstance\n"); break; default: From 69b79efe502c9fd1422e5364facf434965a7e2e7 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 26 Oct 2021 13:58:19 +0200 Subject: [PATCH 055/883] change eNB ID for the different test config --- .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 281 ++++++++++++++++++ .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- ci-scripts/xml_files/fr1_lte_2x2_quectel.xml | 2 +- 3 files changed, 283 insertions(+), 2 deletions(-) create mode 100644 ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf new file mode 100644 index 0000000000..d2e91fb872 --- /dev/null +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -0,0 +1,281 @@ +Active_eNBs = ( "eNB-Eurecom-B38"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe02; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB-Eurecom-B38"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ( { mcc = 208; mnc = 97; mnc_length = 2; } ); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "3GPP_eNODEB"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "TDD"; + tdd_config = 1; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 38; + downlink_frequency = 2605000000L; + nr_scg_ssb_freq = 624608; + uplink_frequency_offset = 0; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 2; + nb_antennas_rx = 2; + tx_gain = 90; + rx_gain = 125; + pbch_repetition = "FALSE"; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 0; + pucch_nCS_AN = 0; + pucch_n1_AN = 0; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + + //Parameters for SIB18 + rxPool_sc_CP_Len = "normal"; + rxPool_sc_Period = "sf40"; + rxPool_data_CP_Len = "normal"; + rxPool_ResourceConfig_prb_Num = 20; + rxPool_ResourceConfig_prb_Start = 5; + rxPool_ResourceConfig_prb_End = 44; + rxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + rxPool_ResourceConfig_offsetIndicator_choice = 0; + rxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000"; + rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; +/* rxPool_dataHoppingConfig_hoppingParameter = 0; + rxPool_dataHoppingConfig_numSubbands = "ns1"; + rxPool_dataHoppingConfig_rbOffset = 0; + rxPool_commTxResourceUC-ReqAllowed = "TRUE"; +*/ + // Parameters for SIB19 + discRxPool_cp_Len = "normal" + discRxPool_discPeriod = "rf32" + discRxPool_numRetx = 1; + discRxPool_numRepetition = 2; + discRxPool_ResourceConfig_prb_Num = 5; + discRxPool_ResourceConfig_prb_Start = 3; + discRxPool_ResourceConfig_prb_End = 21; + discRxPool_ResourceConfig_offsetIndicator_present = "prSmall"; + discRxPool_ResourceConfig_offsetIndicator_choice = 0; + discRxPool_ResourceConfig_subframeBitmap_present = "prBs40"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff"; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5; + discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + enable_measurement_reports = "no"; + + ///X2 + enable_x2 = "yes"; + t_reloc_prep = 1000; /* unit: millisecond */ + tx2_reloc_overall = 2000; /* unit: millisecond */ + t_dc_prep = 1000; /* unit: millisecond */ + t_dc_overall = 2000; /* unit: millisecond */ + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR"; + ENB_INTERFACE_NAME_FOR_S1U = "eno1"; + ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR"; + ENB_PORT_FOR_X2C = 36422; # Spec 36422 + }; + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + phy_test_mode = 0; + scheduler_mode = "fairRR"; + bler_target_upper = 20.0; + bler_target_lower = 10.0; + max_ul_rb_index = 27; + puSch10xSnr = 200; + puCch10xSnr = 150; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 200; + pucch1_dtx_threshold = 5 + pucch1ab_dtx_threshold =0; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [38]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.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_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +NETWORK_CONTROLLER : +{ + FLEXRAN_ENABLED = "no"; + FLEXRAN_INTERFACE_NAME = "lo"; + FLEXRAN_IPV4_ADDRESS = "127.0.0.1"; + FLEXRAN_PORT = 2210; + FLEXRAN_CACHE = "/mnt/oai_agent_cache"; + FLEXRAN_AWAIT_RECONF = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 3460b82ac5..7a9df04996 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -6,7 +6,7 @@ eNBs = ( { ////////// Identification parameters: - eNB_ID = 0xe00; + eNB_ID = 0xe05; cell_type = "CELL_MACRO_ENB"; diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml index 86d9e5d5f0..03d474aef0 100644 --- a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml @@ -59,7 +59,7 @@ Initialize_eNB Initialize eNB - -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 + -O ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6 0 0 lte From ac31ef5622d72789106fe845b511a60f609bf000 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 27 Oct 2021 10:24:06 +0200 Subject: [PATCH 056/883] push DL to 60Mb in NSA --- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 4 ++-- ci-scripts/xml_files/fr1_nsa_quectel.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 12a6186403..8ed4d4486e 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -113,8 +113,8 @@ Iperf - iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile) - -u -b 20M -t 60 + iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) + -u -b 60M -t 60 DL nrmodule2_quectel 5 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 6c11a66d91..2d0ff53525 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -110,8 +110,8 @@ Iperf - iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile) - -u -b 20M -t 60 + iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) + -u -b 60M -t 60 DL idefix 3 From 9aab2b73b272d72c7c5ee1d91a37631c18caeb08 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 27 Oct 2021 16:05:18 +0200 Subject: [PATCH 057/883] tentative : change eNB ID again --- ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 7a9df04996..4a9fd780b7 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -6,7 +6,7 @@ eNBs = ( { ////////// Identification parameters: - eNB_ID = 0xe05; + eNB_ID = 0xe06; cell_type = "CELL_MACRO_ENB"; From 2f30123fc27365d4b39fa474fc1c6e7b123df3d2 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 31 Oct 2021 07:44:25 +0100 Subject: [PATCH 058/883] testing up to mcs 28 --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 8 ++++---- openair2/GNB_APP/MACRLC_nr_paramdef.h | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 11 ++++++----- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- openair2/RRC/NR/rrc_gNB.c | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 96842426f5..88ab5a19a8 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -426,8 +426,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", - frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + frame,slot,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>1) ? 1 : 0; @@ -443,8 +443,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", - frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); + LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>3) ? 1 : 0; diff --git a/openair2/GNB_APP/MACRLC_nr_paramdef.h b/openair2/GNB_APP/MACRLC_nr_paramdef.h index f014e737a4..861d20bdd5 100644 --- a/openair2/GNB_APP/MACRLC_nr_paramdef.h +++ b/openair2/GNB_APP/MACRLC_nr_paramdef.h @@ -96,7 +96,7 @@ {CONFIG_STRING_MACRLC_DL_BLER_TARGET_UPPER, "Upper threshold of BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.15, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER, "Lower threshold of BLER to increase DL MCS", 0, dblptr:NULL, defdblval:0.05, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_RD2_BLER_THRESHOLD, "Threshold of RD2/RETX2 BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.01, TYPE_DOUBLE, 0}, \ -{CONFIG_STRING_MACRLC_DL_MAX_MCS, "Maximum DL MCS that should be used", 0, u8ptr:NULL, defintval:20, TYPE_UINT8, 0}, \ +{CONFIG_STRING_MACRLC_DL_MAX_MCS, "Maximum DL MCS that should be used", 0, u8ptr:NULL, defintval:28, TYPE_UINT8, 0}, \ } #define MACRLC_CC_IDX 0 #define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index bda151f938..7850056289 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -410,13 +410,13 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t const uint8_t old_mcs = bler_stats->mcs; const NR_mac_stats_t *stats = &nrmac->UE_info.mac_stats[UE_id]; const int dret3x = stats->dlsch_rounds[3] - bler_stats->dlsch_rounds[3]; - if (dret3x > 0) { + if (0/*dret3x > 0*/) { /* if there is a third retransmission, decrease MCS for stabilization and * restart averaging window to stabilize transmission */ bler_stats->last_frame_slot = now; bler_stats->mcs = max(9, bler_stats->mcs - 1); memcpy(bler_stats->dlsch_rounds, stats->dlsch_rounds, sizeof(stats->dlsch_rounds)); - LOG_I(MAC, "%4d.%2d: %d retx in 3rd round, setting MCS to %d and restarting window\n", frame, slot, dret3x, bler_stats->mcs); + LOG_D(MAC, "%4d.%2d: %d retx in 3rd round, setting MCS to %d and restarting window\n", frame, slot, dret3x, bler_stats->mcs); return bler_stats->mcs; } if (diff < BLER_UPDATE_FRAME * n) @@ -434,20 +434,21 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t int new_mcs = old_mcs; /* first ensure that number of 2nd retx is below threshold. If this is the * case, use 1st retx to adjust faster */ + /* if (bler_stats->rd2_bler > nrmac->dl_rd2_bler_threshold && old_mcs > 6) { new_mcs -= 2; - } else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) { + } else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) {*/ if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs && dtx > 9) new_mcs += 1; else if (bler_stats->bler > nrmac->dl_bler_target_upper && old_mcs > 6) new_mcs -= 1; // else we are within threshold boundaries - } + /*}*/ bler_stats->last_frame_slot = now; bler_stats->mcs = new_mcs; memcpy(bler_stats->dlsch_rounds, stats->dlsch_rounds, sizeof(stats->dlsch_rounds)); - LOG_I(MAC, "%4d.%2d MCS %d -> %d (dtx %d, dretx %d, BLER wnd %.3f avg %.6f, dretx2 %d, RD2 BLER wnd %.3f avg %.6f)\n", + LOG_D(MAC, "%4d.%2d MCS %d -> %d (dtx %d, dretx %d, BLER wnd %.3f avg %.6f, dretx2 %d, RD2 BLER wnd %.3f avg %.6f)\n", frame, slot, old_mcs, new_mcs, dtx, dretx, bler_window, bler_stats->bler, dretx2, rd2_bler_wnd, bler_stats->rd2_bler); return new_mcs; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index f2ce8498fd..2692cac4c9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1103,7 +1103,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, // tpc (power control) only if we received AckNack or positive SR. For a // negative SR, the UE won't have sent anything, and the SNR is not valid - if (((uci_01->pduBitmap >> 1) & 0x1) || sched_ctrl->SR) { + if (((uci_01->pduBitmap >> 1) & 0x1) ) { if ((uci_01->harq) && (uci_01->harq->harq_confidence_level==0)) sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, uci_01->ul_cqi, 30); else sched_ctrl->tpc1 = 3; sched_ctrl->pucch_snrx10 = uci_01->ul_cqi * 5 - 640; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 655e6973a1..ee924c7a58 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1043,7 +1043,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( DRB_config->pdcp_Config->moreThanOneRLC = NULL; DRB_config->pdcp_Config->t_Reordering = calloc(1, sizeof(*DRB_config->pdcp_Config->t_Reordering)); - *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms750; + *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0; DRB_config->pdcp_Config->ext1 = NULL; if (rrc->security.do_drb_integrity) { From 6d6dd8f1775a097fafe045f6c76d33c6a805273b Mon Sep 17 00:00:00 2001 From: Eurecom Date: Sun, 31 Oct 2021 21:00:50 +0100 Subject: [PATCH 059/883] small modification in UE RX for handling DMRS configuration --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 9029c23664..b3f087ac75 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -267,7 +267,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - ps->nrOfLayers = g_nrOfLayers; + ps->nrOfLayers = 0; int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 30ae6b2c97..a82b4f1306 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1015,7 +1015,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr mac->scc? mac->scc->dmrs_TypeA_Position:mac->mib->dmrs_TypeA_Position, dlsch_config_pdu_1_1->number_symbols, dlsch_config_pdu_1_1->start_symbol, - mappingtype); + mappingtype, + dlsch_config_pdu_1_1->n_front_load_symb); dlsch_config_pdu_1_1->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2; @@ -1095,6 +1096,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<1) + (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<2) + (table_7_3_2_3_3_1[dci->antenna_ports.val][4]<<3)); + dlsch_config_pdu_1_1->n_front_load_symb = 1; } if ((dmrs_type == NULL) && (max_length != NULL)){ // Table 7.3.1.2.2-2: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=2 @@ -1181,7 +1183,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr } /* dmrs symbol positions*/ - dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, + dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config, mac->scc->dmrs_TypeA_Position, dlsch_config_pdu_1_1->number_symbols, dlsch_config_pdu_1_1->start_symbol, From a0f654573310255759389b02bb0c69c006761b3f Mon Sep 17 00:00:00 2001 From: Eurecom Date: Sun, 31 Oct 2021 21:14:53 +0100 Subject: [PATCH 060/883] added 133/162 PRBs to nr_dlsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index b3f087ac75..cc863e19c6 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -826,6 +826,14 @@ int main(int argc, char **argv) fs = 61.44e6; bw = 40e6; } + else if (mu == 1 && N_RB_DL == 133) { + fs = 61.44e6; + bw = 50e6; + } + else if (mu == 1 && N_RB_DL == 162) { + fs = 61.44e6; + bw = 60e6; + } else if (mu == 3 && N_RB_DL == 66) { fs = 122.88e6; bw = 100e6; From 1263074f59044b12c76282fae1cb1d5b868891f0 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 1 Nov 2021 23:16:01 +0100 Subject: [PATCH 061/883] log removal --- openair1/PHY/CODING/crc_byte.c | 4 ++-- .../PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c | 2 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index d85d72d2bc..987f692a32 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -167,7 +167,7 @@ unsigned int crc24a (unsigned char * inptr, return crc; #else return crc32_calc_pclmulqdq(inptr, octetlen, 0, - <e_crc24a_pclmulqdq) >> 8; + <e_crc24a_pclmulqdq); #endif } @@ -201,7 +201,7 @@ unsigned int crc24b (unsigned char * inptr, return crc; #else return crc32_calc_pclmulqdq(inptr, octetlen, 0, - <e_crc24b_pclmulqdq) >> 8; + <e_crc24b_pclmulqdq); #endif } diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c index 56a28822f2..57643a1bd8 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c @@ -38,7 +38,7 @@ #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" -#define DEBUG_LDPC +//#define DEBUG_LDPC #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 9923579f1a..9b14781062 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -426,7 +426,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); @@ -443,7 +443,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 109976f518..6f9115f58c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -956,7 +956,7 @@ void nr_schedule_ue_spec(module_id_t module_id, harq->is_waiting = true; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) PUCCH allocation %d TPC %d\n", 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 2692cac4c9..95d0cc944b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1328,7 +1328,7 @@ int nr_acknack_scheduling(int mod_id, pucch->ul_slot = (s + 1) % n_slots_frame; } if (ind_found==-1) { - LOG_W(NR_MAC, + LOG_D(NR_MAC, "%4d.%2d could not find pdsch_to_harq_feedback for UE %d: earliest " "ack slot %d\n", frame, From cd2f704163b98497ebea1e5251210fedfa748b71 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 2 Nov 2021 17:24:10 +0000 Subject: [PATCH 062/883] Fix segmentation fault when exporting packets to wireshark with high MCS --- openair2/UTIL/OPT/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index e64f7724c6..8731eb294a 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -408,7 +408,7 @@ static void SendFrameNR(guint8 radioType, guint8 direction, guint8 rntiType, guint8 isPredefinedData, guint8 retx, guint8 crcStatus, guint8 oob_event, guint8 oob_event_value, uint8_t *pdu_buffer, unsigned int pdu_buffer_size) { - unsigned char frameBuffer[9000]; + unsigned char frameBuffer[12000]; unsigned int frameOffset; ssize_t bytesSent; frameOffset = 0; From 12e8818bed71935813b95834b19a9e2188e8d782 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 2 Nov 2021 17:49:52 +0000 Subject: [PATCH 063/883] Remove duplicate validation --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index c20055507e..39b6e82be3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1935,7 +1935,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG add_nr_list(&UE_info->list, UE_id); memset(&UE_info->mac_stats[UE_id], 0, sizeof(NR_mac_stats_t)); set_Y(UE_info->Y[UE_id], rntiP); - if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) + if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; memset(sched_ctrl, 0, sizeof(*sched_ctrl)); From 0286138f33c5559ceca805c9a842aea241a5cc51 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 27 Oct 2021 12:09:27 +0200 Subject: [PATCH 064/883] Adaptations of the MAC scheduling to support FDD - removed calls to the TDD UL/DL configuration common in FDD mode - bugfix in the generation of prach info from index - initial adaptation of gNB schedulers - adapted PUCCH ack/nack scheduling by taking into account 6 slots min delay in FDD mode (to be integrated with latest development of PUCCH) - made the use of nr_slots_per_frame more consistent --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 11 --- openair2/GNB_APP/gnb_config.c | 13 +++- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 5 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 70 +++++++++++-------- openair2/LAYER2/NR_MAC_UE/main_ue_nr.c | 8 ++- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 10 +-- openair2/LAYER2/NR_MAC_gNB/config.c | 47 +++++++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 7 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 41 +++++++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 10 ++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 47 +++++++------ .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 10 ++- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + openair2/RRC/NR/MESSAGES/asn1_msg.c | 17 +++-- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 17 files changed, 178 insertions(+), 129 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 63cf6f2f2d..3135a96028 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -206,17 +206,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); } - - -/* - - if ((cfg->subframe_config.duplex_mode.value == TDD) && - ((nr_slot_select(fp,frame,slot)&NR_DOWNLINK_SLOT)==SF_DL)) return; - - // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1); - -*/ - void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { ldpcDecode_t *rdata = (ldpcDecode_t*) NotifiedFifoData(req); NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index af21fd8b08..ee20760941 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -291,9 +291,16 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { asn_sequence_del(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,i,1); } } - if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { - free(scc->tdd_UL_DL_ConfigurationCommon->pattern2); - scc->tdd_UL_DL_ConfigurationCommon->pattern2=NULL; + + lte_frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + if (frame_type == FDD) { + free(scc->tdd_UL_DL_ConfigurationCommon); + scc->tdd_UL_DL_ConfigurationCommon = NULL; + } else { // TDD + if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { + free(scc->tdd_UL_DL_ConfigurationCommon->pattern2); + scc->tdd_UL_DL_ConfigurationCommon->pattern2 = NULL; + } } if ((int)*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing == -1) { diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 3750bb156d..c8fa48b0ee 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -1753,9 +1753,11 @@ int get_nr_prach_info_from_index(uint8_t index, subframe = slot >> mu; s_map = table_6_3_3_2_2_prachConfig_Index[index][4]; if ( (s_map>>subframe)&0x01 ) { + *N_RA_slot = table_6_3_3_2_2_prachConfig_Index[index][6]; // Number of RACH slots within a subframe if (mu == 1) { - if ( (table_6_3_3_2_2_prachConfig_Index[index][6] <= 1) && (slot%2 == 0) ) + if ((*N_RA_slot <= 1) && (slot % 2 == 0)){ return 0; // no prach in even slots @ 30kHz for 1 prach per subframe + } } for(int i = 0; i <= subframe ; i++) { if ( (s_map >> i) & 0x01) { @@ -1764,6 +1766,7 @@ int get_nr_prach_info_from_index(uint8_t index, } if (start_symbol != NULL && N_t_slot != NULL && N_dur != NULL && format != NULL){ *start_symbol = table_6_3_3_2_2_prachConfig_Index[index][5]; + *config_period = x; *N_t_slot = table_6_3_3_2_2_prachConfig_Index[index][7]; *N_dur = table_6_3_3_2_2_prachConfig_Index[index][8]; if (table_6_3_3_2_2_prachConfig_Index[index][1] != -1) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 1accbf30cb..d848595ce4 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -228,27 +228,28 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, } // TDD Table Configuration - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) - cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } if(cfg->cell_config.frame_duplex_type == TDD){ + if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, + "scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); + cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); int return_tdd = set_tdd_config_nr_ue(cfg, - scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols ); - if (return_tdd !=0) + if (return_tdd !=0) { LOG_E(PHY,"TDD configuration can not be done\n"); - else + } else { LOG_I(PHY,"TDD has been properly configurated\n"); + } } // PRACH configuration @@ -411,14 +412,14 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, } // TDD Table Configuration - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) - cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } if(cfg->cell_config.frame_duplex_type == TDD){ + if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, + "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); + cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); int return_tdd = set_tdd_config_nr_ue(cfg, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, @@ -427,15 +428,14 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols ); - - if (return_tdd !=0) - LOG_E(PHY,"TDD configuration can not be done\n"); - else - LOG_I(PHY,"TDD has been properly configurated\n"); + if (return_tdd !=0) { + LOG_E(PHY, "TDD configuration can not be done\n"); + } else { + LOG_I(PHY, "TDD has been properly configurated\n"); + } } - + // PRACH configuration - uint8_t nb_preambles = 64; if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles != NULL) nb_preambles = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles; @@ -628,6 +628,7 @@ int nr_rrc_mac_config_req_ue( NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); RA_config_t *ra = &mac->ra; + fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. @@ -642,11 +643,20 @@ int nr_rrc_mac_config_req_ue( if (sccP != NULL) { mac->scc_SIB=sccP; - LOG_D(MAC,"Keeping ServingCellConfigCommonSIB\n"); + LOG_D(NR_MAC, "In %s: Keeping ServingCellConfigCommonSIB\n", __FUNCTION__); config_common_ue_sa(mac,module_id,cc_idP); - int num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) num_slots_ul++; - LOG_I(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul); + + int num_slots_ul = nr_slots_per_frame[mac->mib->subCarrierSpacingCommon]; + if(cfg->cell_config.frame_duplex_type == FDD){ + free(mac->scc_SIB->tdd_UL_DL_ConfigurationCommon); + mac->scc_SIB->tdd_UL_DL_ConfigurationCommon = NULL; + } else { + num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; + if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { + num_slots_ul++; + } + } + LOG_I(NR_MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul); mac->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t)); // Setup the SSB to Rach Occasions mapping according to the config build_ssb_to_ro_map(mac);//->scc, mac->phy_config.config_req.cell_config.frame_duplex_type); @@ -665,6 +675,10 @@ int nr_rrc_mac_config_req_ue( ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; } mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; + if(cfg->cell_config.frame_duplex_type == FDD){ + free(mac->scc->tdd_UL_DL_ConfigurationCommon); + mac->scc->tdd_UL_DL_ConfigurationCommon = NULL; + } mac->physCellId = *mac->scc->physCellId; config_common_ue(mac,module_id,cc_idP); mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c index b27837043f..992427b4e2 100644 --- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c +++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c @@ -68,10 +68,12 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) { // point to a list of structures (one for each UL slot) to store PUSCH scheduling parameters // received from UL DCI. if (nr_ue_mac_inst->scc) { - int num_slots_ul = nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if (nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) + NR_TDD_UL_DL_ConfigCommon_t *tdd = nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon; + int num_slots_ul = tdd ? tdd->pattern1.nrofUplinkSlots : nr_slots_per_frame[*nr_ue_mac_inst->scc->ssbSubcarrierSpacing]; + if (tdd && nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { num_slots_ul++; - LOG_D(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul); + } + LOG_D(NR_MAC, "In %s: Initializing ul_config_request. num_slots_ul = %d\n", __FUNCTION__, num_slots_ul); nr_ue_mac_inst->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t)); } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 145b24f00e..5615c1aa95 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -148,12 +148,14 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl int mu = mac->ULbwp[0] ? mac->ULbwp[0]->bwp_Common->genericParameters.subcarrierSpacing : mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing; - NR_TDD_UL_DL_Pattern_t *tdd_pattern = &tdd_config->pattern1; - const int num_slots_per_tdd = nr_slots_per_frame[mu] >> (7 - tdd_pattern->dl_UL_TransmissionPeriodicity); - const int num_slots_ul = tdd_pattern->nrofUplinkSlots + (tdd_pattern->nrofUplinkSymbols!=0); + const int n = nr_slots_per_frame[mu]; + const int num_slots_per_tdd = tdd_config ? (n >> (7 - tdd_config->pattern1.dl_UL_TransmissionPeriodicity)) : n; + const int num_slots_ul = tdd_config ? (tdd_config->pattern1.nrofUplinkSlots + (tdd_config->pattern1.nrofUplinkSymbols != 0)) : n; int index = slot % num_slots_ul; - LOG_D(NR_MAC, "In %s slots per tdd %d, num_slots_ul %d, index %d\n", __FUNCTION__, + LOG_D(NR_MAC, "In %s slots per %s: %d, num_slots_ul %d, index %d\n", + __FUNCTION__, + tdd_config ? "TDD" : "FDD", num_slots_per_tdd, num_slots_ul, index); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index a2c130078e..347b3f9495 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -58,6 +58,7 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList * struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list, NR_UE_sched_ctrl_t *sched_ctrl) { + if (rlc_bearer2add_list) // keep lcids for (int i=0;ilist.count;i++) { @@ -394,18 +395,17 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts cfg->num_tlv++; // TDD Table Configuration - //cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - cfg->tdd_table.tdd_period.tl.tag = NFAPI_NR_CONFIG_TDD_PERIOD_TAG; - cfg->num_tlv++; - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) - cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period.value = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } - if(cfg->cell_config.frame_duplex_type.value == TDD){ - LOG_I(NR_MAC,"Setting TDD configuration period to %d\n",cfg->tdd_table.tdd_period.value); + if (cfg->cell_config.frame_duplex_type.value == TDD){ + cfg->tdd_table.tdd_period.tl.tag = NFAPI_NR_CONFIG_TDD_PERIOD_TAG; + cfg->num_tlv++; + if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, + "In %s: scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n", __FUNCTION__); + cfg->tdd_table.tdd_period.value = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } + LOG_I(NR_MAC, "Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period.value); int periods_per_frame = set_tdd_config_nr(cfg, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots, @@ -439,8 +439,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present); /* dimension UL_tti_req_ahead for number of slots in frame */ - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; RC.nrmac[Mod_idP]->UL_tti_req_ahead[0] = calloc(n, sizeof(nfapi_nr_ul_tti_request_t)); AssertFatal(RC.nrmac[Mod_idP]->UL_tti_req_ahead[0], "could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n"); @@ -490,19 +489,23 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, find_SSB_and_RO_available(Mod_idP); - const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; - const int nr_dlmix_slots = tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0); - const int nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0); + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; + const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; + const int nr_dlmix_slots = tdd ? tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0) : 0; + const int nr_dl_slots = tdd ? nr_dlmix_slots : n; + const int nr_ulstart_slot = tdd ? tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0) : 1; for (int slot = 0; slot < n; ++slot) { /* FIXME: it seems there is a problem with slot 0/10/slots right after UL: * we just get retransmissions. Thus, do not schedule such slots in DL */ - if (slot % nr_slots_period != 0) - RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dlmix_slots) << (slot % 64); + if (slot % nr_slots_period != 0){ + RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dl_slots) << (slot % 64); + } RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64); - LOG_D(NR_MAC, "slot %d DL %d UL %d\n", + + LOG_I(NR_MAC, "In %s: slot %d DL %d UL %d\n", + __FUNCTION__, slot, (RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0, (RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 956a76ddbb..f961a9c01c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -170,7 +170,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, /* advance last round's future UL_tti_req to be ahead of current frame/slot */ future_ul_tti_req->SFN = (slotP == 0 ? frameP : frameP + 1) % 1024; - LOG_D(MAC,"Future_ul_tti SFN = %d for slot %d \n", future_ul_tti_req->SFN, (slotP + num_slots - 1) % num_slots); + LOG_D(NR_MAC, "In %s: UL_tti_req_ahead SFN.slot = %d.%d for slot %d \n", __FUNCTION__, future_ul_tti_req->SFN, future_ul_tti_req->Slot, (slotP + num_slots - 1) % num_slots); /* future_ul_tti_req->Slot is fixed! */ future_ul_tti_req->n_pdus = 0; future_ul_tti_req->n_ulsch = 0; @@ -367,9 +367,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, if (slot==0 && (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]>=257)) { const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; + const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; + const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; const int nb_periods_per_frame = n / nr_slots_period; + // re-initialization of tdd_beam_association at beginning of frame (only for FR2) for (int i=0; itdd_beam_association[i] = -1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index c6752d37c2..8b645c06f3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -406,14 +406,19 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, uint8_t mu = *scc->ssbSubcarrierSpacing; uint8_t response_window = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow; uint8_t slot_window; + const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; // number of mixed slot or of last dl slot if there is no mixed slot - uint8_t last_dl_slot_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots; + uint8_t last_dl_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; // lenght of tdd period in slots - uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols == 0) + uint8_t tdd_period_slot = tdd ? scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots : n_slots_frame; + + if (tdd && (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols == 0)) { last_dl_slot_period--; - if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0)) + } + if (tdd && ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))) { tdd_period_slot++; + } switch(response_window){ case NR_RACH_ConfigGeneric__ra_ResponseWindow_sl1: @@ -714,10 +719,17 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t // beam association for FR2 int16_t *tdd_beam_association = nr_mac->tdd_beam_association; if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) { - uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0)) + + const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + uint8_t tdd_period_slot = tdd ? scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots : n_slots_frame; + + if (tdd && ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))) { tdd_period_slot++; + } + int num_tdd_period = sched_slot/tdd_period_slot; + if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id)) return; // can't schedule retransmission in this slot else @@ -879,15 +891,18 @@ void nr_get_Msg3alloc(module_id_t module_id, ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList: scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + 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[mu]; + const int nrofUplinkSymbols = tdd ? tdd->nrofUplinkSymbols : 4; uint8_t k2 = 0; for (int i=0; ilist.count; i++) { startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols); // we want to transmit in the uplink symbols of mixed slot - if (NrOfSymbols == scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols) { + if (NrOfSymbols == nrofUplinkSymbols) { k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2; temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 - ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; + ra->Msg3_slot = temp_slot % n_slots_frame; if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { ra->Msg3_tda_id = i; break; @@ -897,16 +912,17 @@ void nr_get_Msg3alloc(module_id_t module_id, AssertFatal(ra->Msg3_tda_id<16,"Unable to find Msg3 time domain allocation in list\n"); - if (nr_slots_per_frame[mu]>temp_slot) + if (n_slots_frame > temp_slot) ra->Msg3_frame = current_frame; else - ra->Msg3_frame = (current_frame + (temp_slot/nr_slots_per_frame[mu]))%1024; + ra->Msg3_frame = (current_frame + (temp_slot / n_slots_frame)) % 1024; // beam association for FR2 if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) { - uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; - if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0)) + uint8_t tdd_period_slot = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots : n_slots_frame; + if (tdd && ((tdd->nrofDownlinkSymbols > 0) || (tdd->nrofUplinkSymbols > 0))) { tdd_period_slot++; + } int num_tdd_period = ra->Msg3_slot/tdd_period_slot; if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id)) AssertFatal(1==0,"Cannot schedule MSG3\n"); @@ -979,7 +995,6 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->dmrs_ports = 1; // 6.2.2 in 38.214 only port 0 to be used pusch_pdu->num_dmrs_cdm_grps_no_data = 2; // no data in dmrs symbols as in 6.2.2 in 38.214 pusch_pdu->resource_alloc = 1; //type 1 - pusch_pdu->rb_start = msg3_first_rb; if (msg3_nb_rb > pusch_pdu->bwp_size) AssertFatal(1==0,"MSG3 allocated number of RBs exceed the BWP size\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 28b7ea3c21..ccbda816f9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -266,8 +266,9 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, ssbSubcarrierOffset, offset_pointa, (*(uint32_t*)cc->MIB_pdu.payload) & ((1<<24)-1)); fill_ssb_vrb_map(cc, offset_pointa, ssb_start_symbol, CC_id); const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; + const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; + const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; num_tdd_period = rel_slot/nr_slots_period; gNB->tdd_beam_association[num_tdd_period]=i_ssb; num_ssb++; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d32e45a379..9b8a78c198 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -124,8 +124,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * } } - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_dl_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_dl_tda[bwp_id])); const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 668a88d746..5766b39e29 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2097,6 +2097,7 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, int *max_fb_time, + int *min_fb_time, uint8_t *pdsch_to_harq_feedback) { NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; @@ -2135,9 +2136,10 @@ void get_pdsch_to_harq_feedback(int Mod_idP, // common search type uses DCI format 1_0 if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { for (int i=0; i<8; i++) { - pdsch_to_harq_feedback[i] = i+1; + pdsch_to_harq_feedback[i] = i+1; // TODO take into account the min feedback time here if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; + *min_fb_time = 6; } } else { @@ -2158,12 +2160,12 @@ void get_pdsch_to_harq_feedback(int Mod_idP, } AssertFatal(found==1,"Couldn't find a ue specific searchspace\n"); - if (ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) { for (int i=0; i<8; i++) { - pdsch_to_harq_feedback[i] = i+1; + pdsch_to_harq_feedback[i] = i+1; // TODO take into account the min feedback time here if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; + *min_fb_time = 6; } } else { @@ -2173,6 +2175,8 @@ void get_pdsch_to_harq_feedback(int Mod_idP, pdsch_to_harq_feedback[i] = *ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i]; if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; + if(pdsch_to_harq_feedback[i]<*min_fb_time) + *min_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 f2ce8498fd..cccc930dce 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1173,19 +1173,21 @@ int nr_acknack_scheduling(int mod_id, const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; - const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots; - const int first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); - const int first_ul_slot_period = first_ul_slot_tdd%nr_slots_period; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; + const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; + const int first_ul_slot_tdd = tdd ? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : 0; + const int first_ul_slot_period = tdd ? first_ul_slot_tdd % nr_slots_period : 0; const int CC_id = 0; NR_sched_pucch_t *csi_pucch; - AssertFatal(slot < first_ul_slot_tdd + (tdd->nrofUplinkSymbols != 0), - "cannot handle multiple TDD periods (yet): slot %d first_ul_slot_tdd %d nrofUplinkSlots %ld\n", - slot, - first_ul_slot_tdd, - tdd->nrofUplinkSlots); + if (tdd) { + AssertFatal(slot < first_ul_slot_tdd + (tdd->nrofUplinkSymbols != 0), + "cannot handle multiple TDD periods (yet): slot %d first_ul_slot_tdd %d nrofUplinkSlots %ld\n", + slot, + first_ul_slot_tdd, + tdd->nrofUplinkSlots); + } /* for the moment, we consider: * * only pucch_sched[0] holds HARQ (and SR) @@ -1195,19 +1197,21 @@ int nr_acknack_scheduling(int mod_id, * * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */ NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[mod_id]->UE_info.UE_sched_ctrl[UE_id]; NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0]; - LOG_D(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c); + LOG_D(NR_MAC, "In %s: %d.%d 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 */ 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,"pucch_acknak : %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n",frame,slot,f,s); + LOG_D(NR_MAC, "In %s: %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n", __FUNCTION__, frame, slot, f, s); nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; @@ -1234,7 +1238,7 @@ int nr_acknack_scheduling(int mod_id, } } - LOG_D(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); + LOG_D(NR_MAC, "In %s: pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame, slot, pucch->frame, pucch->ul_slot, pucch->dai_c); // this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]; @@ -1253,10 +1257,11 @@ int nr_acknack_scheduling(int mod_id, if (sched_ctrl->active_ubwp) bwp_Id = sched_ctrl->active_ubwp->bwp_Id; int max_fb_time = 0; - get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, pdsch_to_harq_feedback); + int min_fb_time = 6; + get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, &min_fb_time, pdsch_to_harq_feedback); int max_absslot = frame*n_slots_frame + slot + max_fb_time; - LOG_D(NR_MAC,"pucch_acknak 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); + LOG_D(NR_MAC, "In %s: 1b. DL %d.%d, UL_ACK %d.%d, 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 */ @@ -1272,7 +1277,7 @@ int nr_acknack_scheduling(int mod_id, const int f = pucch->frame; const int s = pucch->ul_slot; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI > 0, cannot reach timing for pucch in %d.%d, advancing slot by 1 and trying again\n",frame,slot,f,s); + LOG_D(NR_MAC, "In %s: %d.%d DAI > 0, cannot reach timing for pucch in %d.%d, advancing slot by 1 and trying again\n", __FUNCTION__, frame, slot, f, s); nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; @@ -1286,11 +1291,11 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = i; pucch->dai_c++; // retain old resource indicator, and we are good - LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); + LOG_D(NR_MAC, "In %s: %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); return 0; } - LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 0, looking for new pucch occasion\n",frame,slot); + LOG_D(NR_MAC, "In %s: %d.%d DAI = 0, looking for new pucch occasion\n", __FUNCTION__, frame, slot); /* we need to find a new PUCCH occasion */ /*Inizialization of timing information*/ @@ -1299,7 +1304,7 @@ int nr_acknack_scheduling(int mod_id, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); pucch->frame = frame; - pucch->ul_slot = first_ul_slot_tdd; + pucch->ul_slot = tdd ? first_ul_slot_tdd : first_ul_slot_tdd + min_fb_time; } // Find the right timing_indicator value. @@ -1308,7 +1313,7 @@ int nr_acknack_scheduling(int mod_id, while ((pucch->frame*n_slots_frame + pucch->ul_slot) <= max_absslot) { int i = 0; while (i < 8) { - LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", + LOG_D(NR_MAC, "In %s: pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", __FUNCTION__, i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot); if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) { ind_found = i; @@ -1373,7 +1378,7 @@ int nr_acknack_scheduling(int mod_id, pucch->timing_indicator = ind_found; // index in the list of timing indicators - LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); + LOG_D(NR_MAC, "In %s: 2. DAI 0 DL %d.%d, UL_ACK %d.%d (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 diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 51192b4d63..64297c2617 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -165,10 +165,8 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub symb_tda_mi); } - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; for (int slot = 0; slot < n; ++slot) { @@ -181,11 +179,12 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub LOG_D(MAC, "DL slot %d UL slot %d preferred_ul_tda %d\n", slot, sched_slot, nrmac->preferred_ul_tda[bwp_id][slot]); } - if (k2 < tdd->nrofUplinkSlots) + if (tdd && k2 < tdd->nrofUplinkSlots) { LOG_W(NR_MAC, "k2 %d < tdd->nrofUplinkSlots %ld: not all UL slots can be scheduled\n", k2, tdd->nrofUplinkSlots); + } } // For both UL-SCH except: @@ -882,8 +881,7 @@ long get_K2(NR_ServingCellConfigCommon_t *scc,NR_BWP_Uplink_t *ubwp, int time_do bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t frame, sub_frame_t slot) { const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const int now = frame * n + slot; const struct gNB_MAC_INST_s *nrmac = RC.nrmac[mod_id]; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index d17448437d..8147f47847 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -213,6 +213,7 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, int *max_fb_time, + int *min_fb_time, uint8_t *pdsch_to_harq_feedback); void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index eb6f86fda6..9f50168260 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -619,10 +619,12 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, } sib1->servingCellConfigCommon->ssb_PeriodicityServingCell = *configuration->scc->ssb_periodicityServingCell; - sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon)); - sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing = configuration->scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing; - sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->pattern1 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern1; - sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->pattern2 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern2; + if (configuration->scc->tdd_UL_DL_ConfigurationCommon) { + sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon)); + sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing = configuration->scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing; + sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->pattern1 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern1; + sib1->servingCellConfigCommon->tdd_UL_DL_ConfigurationCommon->pattern2 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern2; + } sib1->servingCellConfigCommon->ss_PBCH_BlockPower = configuration->scc->ss_PBCH_BlockPower; // ims-EmergencySupport @@ -1181,8 +1183,11 @@ void fill_initial_SpCellConfig(rnti_t rnti, // Check for above configuration and exit for now if it is not the case AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30, "SCS != 30kHz\n"); - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity==NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5, - "TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); + + if (scc->tdd_UL_DL_ConfigurationCommon) { + AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity == NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5, + "TDD period != 5ms : %ld\n", scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); + } schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8+(10*((rnti>>1)&3)) + (rnti&1); schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 980bd39c37..401a3a1aba 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -945,7 +945,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = (i<6) ? (i+2) : 0; + *delay[i] = i + 6; // (i<6) ? (i+2) : 0; // (Temp) TODO replace with param from conf ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); From a5f18dbb2067549000c19c148dde5f9130a7c8be Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 3 Nov 2021 15:31:03 +0100 Subject: [PATCH 065/883] Enhancements to the overall MAC logging - updating to NR_MAC tag - minor cleanups - added more relavant info for debugging purposes --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 6 +++--- openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c | 4 ++-- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 9 ++++++++- openair2/LAYER2/NR_MAC_UE/config_ue.c | 8 ++++---- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 11 +---------- 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 8bbf569814..f957c38182 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -522,7 +522,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, A = (harq_process->TBS)<<3; - LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers, R); + LOG_D(NR_PHY, "ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n", harq_pid, A, G, mcs, n_layers, nb_rb, Qm, n_layers, R); if (R<1024) Coderate = (float) R /(float) 1024; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index ba5c65ceb7..8f0f5bea5d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -265,9 +265,9 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_IN); - LOG_D(PHY,"ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers); - LOG_D(PHY,"ulsch coding A %d G %d mod_order %d\n", A,G, mod_order); - LOG_D(PHY,"harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n", + LOG_D(NR_PHY, "ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers); + LOG_D(NR_PHY, "ulsch coding A %d G %d mod_order %d\n", A, G, mod_order); + LOG_D(NR_PHY, "harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n", harq_pid,harq_process->ndi,harq_process->pusch_pdu.pusch_data.new_data_indicator); if (harq_process->first_tx == 1 || diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c index 4fcbd322db..c33946fa5a 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c @@ -51,7 +51,7 @@ uint32_t nr_compute_tbs(uint16_t Qm, uint32_t Ninfo, Np_info, C; uint8_t n, scale; - LOG_D(NR_MAC,"nb_symb_sch %d, nb_dmrs_prb %d, nb_rb_oh %d\n",nb_symb_sch,nb_dmrs_prb,nb_rb_oh); + LOG_D(NR_MAC, "In %s: nb_symb_sch %d, nb_dmrs_prb %d, nb_rb %d, nb_rb_oh %d, tb_scaling %d Nl %d\n", __FUNCTION__, nb_symb_sch, nb_dmrs_prb, nb_rb, nb_rb_oh, tb_scaling, Nl); nbp_re = NR_NB_SC_PER_RB * nb_symb_sch - nb_dmrs_prb - nb_rb_oh; nb_re = min(156, nbp_re) * nb_rb; @@ -86,7 +86,7 @@ uint32_t nr_compute_tbs(uint16_t Qm, } } - LOG_D(NR_MAC, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs); + LOG_D(NR_MAC, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d bits\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs); return nr_tbs; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index c8fa48b0ee..341ba9c641 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2597,7 +2597,14 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr uint8_t row, colomn; int32_t l_prime; - LOG_D(NR_MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position); + LOG_D(NR_MAC, "In %s: PUSCH NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d additional_pos:%d, pusch_maxLength:%d\n", + __FUNCTION__, + duration_in_symbols, + start_symbol, + mapping_type, + dmrs_typeA_position, + additional_pos, + pusch_maxLength); // Section 6.4.1.1.3 in Spec 38.211 // For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PUSCH resources diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index d848595ce4..3691fcee7f 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -246,9 +246,9 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, ); if (return_tdd !=0) { - LOG_E(PHY,"TDD configuration can not be done\n"); + LOG_E(NR_PHY, "TDD configuration cannot be done\n"); } else { - LOG_I(PHY,"TDD has been properly configurated\n"); + LOG_I(NR_PHY, "TDD has been properly configurated\n"); } } @@ -429,9 +429,9 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols ); if (return_tdd !=0) { - LOG_E(PHY, "TDD configuration can not be done\n"); + LOG_E(NR_PHY, "TDD configuration can not be done\n"); } else { - LOG_I(PHY, "TDD has been properly configurated\n"); + LOG_I(NR_PHY, "TDD has been properly configurated\n"); } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 5615c1aa95..e8176f16e8 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -601,7 +601,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, pusch_config_pdu->nr_of_symbols = NrOfSymbols; l_prime_mask = get_l_prime(NrOfSymbols, mappingtype, add_pos, dmrslength, StartSymbolIndex, mac->scc ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position); - LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , DMRS_MASK:%x\n", pusch_config_pdu->start_symbol_index, pusch_config_pdu->nr_of_symbols, mappingtype, l_prime_mask); + LOG_D(NR_MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d, DMRS_MASK:%x\n", pusch_config_pdu->start_symbol_index, pusch_config_pdu->nr_of_symbols, mappingtype, l_prime_mask); #ifdef DEBUG_MSG3 LOG_D(NR_MAC, "In %s BWP assignment (BWP (start %d, size %d) \n", __FUNCTION__, pusch_config_pdu->bwp_start, pusch_config_pdu->bwp_size); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 8b645c06f3..807549d595 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -988,7 +988,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->data_scrambling_id = *scc->physCellId; pusch_pdu->nrOfLayers = 1; pusch_pdu->ul_dmrs_symb_pos = get_l_prime(nr_of_symbols,mappingtype,pusch_dmrs_pos2,pusch_len1,start_symbol_index, scc->dmrs_TypeA_Position); - LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , ul_dmrs_symb_pos:%x\n", start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos); + LOG_D(NR_MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d, ul_dmrs_symb_pos:%x\n", start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos); pusch_pdu->dmrs_config_type = 0; pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId; //If provided and the PUSCH is not a msg3 PUSCH, otherwise, L2 should set this to physical cell id. pusch_pdu->scid = 0; //DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]. Should match what is sent in DCI 0_1, otherwise set to 0. @@ -1912,25 +1912,16 @@ void nr_fill_rar(uint8_t Mod_idP, rar->UL_GRANT_4 = (uint8_t) ul_grant & 0xff; #ifdef DEBUG_RAR - //LOG_I(NR_MAC, "rarbi->E = 0x%x\n", rarbi->E); - //LOG_I(NR_MAC, "rarbi->T = 0x%x\n", rarbi->T); - //LOG_I(NR_MAC, "rarbi->R = 0x%x\n", rarbi->R); - //LOG_I(NR_MAC, "rarbi->BI = 0x%x\n", rarbi->BI); - LOG_I(NR_MAC, "rarh->E = 0x%x\n", rarh->E); LOG_I(NR_MAC, "rarh->T = 0x%x\n", rarh->T); LOG_I(NR_MAC, "rarh->RAPID = 0x%x (%i)\n", rarh->RAPID, rarh->RAPID); - LOG_I(NR_MAC, "rar->R = 0x%x\n", rar->R); LOG_I(NR_MAC, "rar->TA1 = 0x%x\n", rar->TA1); - LOG_I(NR_MAC, "rar->TA2 = 0x%x\n", rar->TA2); LOG_I(NR_MAC, "rar->UL_GRANT_1 = 0x%x\n", rar->UL_GRANT_1); - LOG_I(NR_MAC, "rar->UL_GRANT_2 = 0x%x\n", rar->UL_GRANT_2); LOG_I(NR_MAC, "rar->UL_GRANT_3 = 0x%x\n", rar->UL_GRANT_3); LOG_I(NR_MAC, "rar->UL_GRANT_4 = 0x%x\n", rar->UL_GRANT_4); - LOG_I(NR_MAC, "rar->TCRNTI_1 = 0x%x\n", rar->TCRNTI_1); LOG_I(NR_MAC, "rar->TCRNTI_2 = 0x%x\n", rar->TCRNTI_2); #endif From 755c8d5055a37895c8464d6c46fcd4a3234644c8 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 3 Nov 2021 15:33:46 +0100 Subject: [PATCH 066/883] Fixed calculation of num dmrs per prb at gnb side - the param was hardcoded to 12 at gNB side while it was computed at UE side - the same function used at UE side has been moved to the common file - now the computation at gNB side is consistent with the UE --- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 8 +++++++- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 19 ++++++++++++++++++ openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 9 +++++++++ openair2/LAYER2/NR_MAC_UE/mac_proto.h | 4 ---- openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c | 20 ------------------- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 8 +++++++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 14 ++++++++++++- 7 files changed, 55 insertions(+), 27 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index b1addf740a..4357f6dd49 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -143,7 +143,13 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ulsch_ue->Nid_cell = Nid_cell; - get_num_re_dmrs(pusch_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols); + get_num_re_dmrs(pusch_pdu->start_symbol_index, + pusch_pdu->nr_of_symbols, + pusch_pdu->ul_dmrs_symb_pos, + pusch_pdu->dmrs_config_type, + pusch_pdu->num_dmrs_cdm_grps_no_data, + &nb_dmrs_re_per_rb, + &number_dmrs_symbols); LOG_D(PHY,"ulsch %x : start_rb %d bwp_start %d start_sc %d start_symbol %d num_symbols %d cdmgrpsnodata %d num_dmrs %d dmrs_re_per_rb %d\n", rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb); diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 341ba9c641..7bf0f84f71 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -4294,3 +4294,22 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config, return valid; } +void get_num_re_dmrs(int start_symbol, + uint8_t number_of_symbols, + uint16_t ul_dmrs_symb_pos, + uint8_t dmrs_type, + uint8_t cdm_grps_no_data, + uint8_t *nb_dmrs_re_per_rb, + uint16_t *number_dmrs_symbols){ + + *number_dmrs_symbols = 0; + + for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) { + if((ul_dmrs_symb_pos >> i) & 0x01){ + *number_dmrs_symbols += 1; + } + } + + *nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6 : 4) * cdm_grps_no_data; + +} diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index e107553117..5e70cb2d4d 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -62,6 +62,15 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDLBWP, uint16_t N_RB, int bwp_id); + +void get_num_re_dmrs(int start_symbol, + uint8_t number_of_symbols, + uint16_t ul_dmrs_symb_pos, + uint8_t dmrs_type, + uint8_t cdm_grps_no_data, + uint8_t *nb_dmrs_re_per_rb, + uint16_t *number_dmrs_symbols); + void find_aggregation_candidates(uint8_t *aggregation_level, uint8_t *nr_of_candidates, NR_SearchSpace_t *ss, diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 30b87a056e..92710b3c0d 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -390,10 +390,6 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *p void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, fapi_nr_dl_config_request_t *dl_config, int rnti_type, int ss_id); void fill_dci_search_candidates(NR_SearchSpace_t *ss,fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15); -void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu, - uint8_t *nb_dmrs_re_per_rb, - uint16_t *number_dmrs_symbols); - void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac); void config_bwp_ue(NR_UE_MAC_INST_t *mac, uint16_t *bwp_ind, uint8_t *dci_format); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c b/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c index 7f1011fb28..a8b1428673 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c @@ -160,26 +160,6 @@ int nr_get_Po_NOMINAL_PUSCH(NR_PRACH_RESOURCES_t *prach_resources, module_id_t m return receivedTargerPower; } -void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu, - uint8_t *nb_dmrs_re_per_rb, - uint16_t *number_dmrs_symbols){ - - int start_symbol = pusch_pdu->start_symbol_index; - uint8_t number_of_symbols = pusch_pdu->nr_of_symbols; - uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos; - uint8_t dmrs_type = pusch_pdu->dmrs_config_type; - uint8_t cdm_grps_no_data = pusch_pdu->num_dmrs_cdm_grps_no_data; - - *number_dmrs_symbols = 0; - for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) { - if((ul_dmrs_symb_pos >> i) & 0x01) - *number_dmrs_symbols += 1; - } - - *nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*cdm_grps_no_data; - -} - // Implementation of 6.2.4 Configured ransmitted power // 3GPP TS 38.101-1 version 16.5.0 Release 16 // - diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index e8176f16e8..70abd545cd 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -842,7 +842,13 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, return -1; } - get_num_re_dmrs(pusch_config_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols); + get_num_re_dmrs(pusch_config_pdu->start_symbol_index, + pusch_config_pdu->nr_of_symbols, + pusch_config_pdu->ul_dmrs_symb_pos, + pusch_config_pdu->dmrs_config_type, + pusch_config_pdu->num_dmrs_cdm_grps_no_data, + &nb_dmrs_re_per_rb, + &number_dmrs_symbols); // Compute TBS pusch_config_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_config_pdu->qam_mod_order, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 807549d595..16543d6a7c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -968,6 +968,9 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, int start_symbol_index,nr_of_symbols; + uint8_t nb_dmrs_re_per_rb = 0; + uint16_t number_dmrs_symbols = 0; + SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols); pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; @@ -1013,11 +1016,20 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.new_data_indicator = 1; pusch_pdu->pusch_data.num_cb = 0; + + get_num_re_dmrs(pusch_pdu->start_symbol_index, + pusch_pdu->nr_of_symbols, + pusch_pdu->ul_dmrs_symb_pos, + pusch_pdu->dmrs_config_type, + pusch_pdu->num_dmrs_cdm_grps_no_data, + &nb_dmrs_re_per_rb, + &number_dmrs_symbols); + pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->target_code_rate, pusch_pdu->rb_size, pusch_pdu->nr_of_symbols, - 12, // nb dmrs set for no data in dmrs symbol + nb_dmrs_re_per_rb*number_dmrs_symbols, // nb dmrs set for no data in dmrs symbol 0, //nb_rb_oh 0, // to verify tb scaling pusch_pdu->nrOfLayers)>>3; From 9d9bc0e718a3dc5078f5e66669139fd2508013fd Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 4 Nov 2021 10:17:45 +0100 Subject: [PATCH 067/883] Conf file for band 66 in SA mode --- .../gnb.sa.band66.fr1.106PRB.usrpn300.conf | 303 ++++++++++++++++++ 1 file changed, 303 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf new file mode 100644 index 0000000000..09772440a4 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -0,0 +1,303 @@ +Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-Eurecom-5GNRBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 0xa000; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x1; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 433096; + dl_frequencyBand = 66; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 430000; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 66; + ul_absoluteFrequencyPointA = 350000; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 13475; +# 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, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + + 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: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + 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"; + ulsch_max_slots_inactivity = 100; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + }; + From 565fb8834201748e339a3e290848f216f6b07d64 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 4 Nov 2021 16:08:41 +0100 Subject: [PATCH 068/883] Simplified set_tdd_config_nr_ue function - reviewed redundant code - removed unnecessary return --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 74 ++++++++++----------------- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 6 +-- 2 files changed, 29 insertions(+), 51 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 3691fcee7f..d9514691ba 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -38,15 +38,27 @@ #include "common/utils/nr/nr_common.h" #include "executables/softmodem-common.h" -int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, - int mu, - int nrofDownlinkSlots, int nrofDownlinkSymbols, - int nrofUplinkSlots, int nrofUplinkSymbols) { +void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, + int mu, + NR_TDD_UL_DL_ConfigCommon_t *tdd_config) { + int nrofDownlinkSlots = tdd_config->pattern1.nrofDownlinkSlots; + int nrofDownlinkSymbols = tdd_config->pattern1.nrofDownlinkSymbols; + int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots; + int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols; int slot_number = 0; int nb_periods_per_frame; int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period = tdd_config->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, "tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); + cfg->tdd_table.tdd_period = *tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } + + LOG_I(NR_MAC, "Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); + switch(cfg->tdd_table.tdd_period) { case 0: nb_periods_per_frame = 20; // 10ms/0p5ms @@ -140,7 +152,8 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, } } - return (0); + LOG_I(NR_MAC, "TDD has been properly configurated\n"); + } @@ -228,28 +241,10 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac, } // TDD Table Configuration - if(cfg->cell_config.frame_duplex_type == TDD){ - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { - cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - } else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } - LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); - int return_tdd = set_tdd_config_nr_ue(cfg, - scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols - ); - - if (return_tdd !=0) { - LOG_E(NR_PHY, "TDD configuration cannot be done\n"); - } else { - LOG_I(NR_PHY, "TDD has been properly configurated\n"); - } + if (cfg->cell_config.frame_duplex_type == TDD){ + set_tdd_config_nr_ue(cfg, + scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + scc->tdd_UL_DL_ConfigurationCommon); } // PRACH configuration @@ -412,27 +407,10 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, } // TDD Table Configuration - if(cfg->cell_config.frame_duplex_type == TDD){ - if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) { - cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity; - } else { - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, - "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); - cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; - } - LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period); - int return_tdd = set_tdd_config_nr_ue(cfg, - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots, - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols - ); - if (return_tdd !=0) { - LOG_E(NR_PHY, "TDD configuration can not be done\n"); - } else { - LOG_I(NR_PHY, "TDD has been properly configurated\n"); - } + if (cfg->cell_config.frame_duplex_type == TDD){ + set_tdd_config_nr_ue(cfg, + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing, + scc->tdd_UL_DL_ConfigurationCommon); } // PRACH configuration diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 92710b3c0d..3531fa564e 100755 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -213,9 +213,9 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, uint8_t *ulsch_buffer, uint16_t buflen); -int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu, - int nrofDownlinkSlots, int nrofDownlinkSymbols, - int nrofUplinkSlots, int nrofUplinkSymbols); +void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, + int mu, + NR_TDD_UL_DL_ConfigCommon_t *tdd_config); void set_harq_status(NR_UE_MAC_INST_t *mac, uint8_t pucch_id, From d872a9bc95da8dcd804650bd692221546eb812f4 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 8 Oct 2021 15:16:08 +0200 Subject: [PATCH 069/883] runmodem update for IF frequency --- doc/RUNMODEM.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index dc7a982310..f51d3a7318 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -171,15 +171,9 @@ With the RF simulator (on the same machine): ## IF setup with OAI -The -C and --CO flags can be used together at UE side to set custom downlink and uplink FR1 arbitrary frequencies for the IF equipment. +The `if_freq` and `if_freq_off` options can be used to set (via command line) custom downlink and uplink FR1 arbitrary frequencies for the IF equipment both. -In order to run this setup, the following flags are needed at the UE side: - -`-C` - -`--CO` - -and the following parameters must be configured in the RUs section of the gNB configuration file: +In the same way, the following parameters must be configured in the RUs section of the gNB configuration file: `if_freq` @@ -199,7 +193,7 @@ gNB on machine 1: UE on machine 2: -`sudo ./nr-uesoftmodem -C 2169080000 --CO -400000000` +`sudo ./nr-uesoftmodem --if_freq 2169080000 --if_freq_off -400000000` From 6784eac3f5d53e343179bb37257a72105ccd806c Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 8 Oct 2021 12:00:32 +0200 Subject: [PATCH 070/883] runmodem update for sa --- doc/RUNMODEM.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index f51d3a7318..8976cbc39c 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -151,6 +151,14 @@ At the UE the --sa flag will: 4) 5G-NR RRC Reconfiguration 5) Start Downlink and Uplink Data Transfer +Command line parameters for UE in --sa mode: +- `C` : downlink carrier frequency in Hz (default value 0) +- `CO` : uplink frequency offset for FDD in Hz (default value 0) +- `numerology` : numerology index (default value 1) +- `r` : bandwidth in terms of RBs (default value 106) +- `band` : NR band number (default value 78) +- `s` : SSB start subcarrier (default value 512) + ### Run OAI in SA mode From the `cmake_targets/ran_build/build` folder: From 3fcbfdadadf03eca0caaf54001f886f8e925933e Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 27 Sep 2021 18:45:59 +0200 Subject: [PATCH 071/883] Minimum value of DL to ACK --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/GNB_APP/gnb_config.c | 2 ++ openair2/GNB_APP/gnb_paramdef.h | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 19 +++++++++++-------- openair2/RRC/NR/nr_rrc_proto.h | 2 ++ openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ openair2/RRC/NR/rrc_gNB_reconfig.c | 5 ++++- 8 files changed, 24 insertions(+), 12 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 83d6625830..3e982eb887 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -765,7 +765,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 2, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 69316d6b88..a7075eb218 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -713,7 +713,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index ee20760941..82e0233633 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1113,6 +1113,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; + printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index bf1d12825e..0c3d971569 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -149,7 +149,7 @@ typedef enum { {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ +{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ } #define GNB_GNB_ID_IDX 0 diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index f06d50be48..07648d0074 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1182,14 +1182,17 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; - // set the harq status at MAC for feedback - set_harq_status(mac,dci->pucch_resource_indicator, - dci->harq_pid, - dlsch_config_pdu_1_1->accumulated_delta_PUCCH, - feedback_ti, - dci->dai[0].val, - dci_ind->n_CCE,dci_ind->N_CCE,0, - frame,slot); + AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d)\n", + feedback_ti,DURATION_RX_TO_TX); + + // set the harq status at MAC for feedback + set_harq_status(mac,dci->pucch_resource_indicator, + dci->harq_pid, + dlsch_config_pdu_1_1->accumulated_delta_PUCCH, + feedback_ti, + dci->dai[0].val, + dci_ind->n_CCE,dci_ind->N_CCE, + 0,frame,slot); dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH; LOG_D(MAC,"(nr_ue_procedures.c) pdu_type=%d\n\n",dl_config->dl_config_list[dl_config->number_pdus].pdu_type); diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 9465b9b4b0..22109c3029 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -79,6 +79,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int scg_id, int servCellIndex, int dl_antenna_ports, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid); @@ -90,6 +91,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid); diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 52f451d7bb..e606e22a57 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -256,6 +256,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, + carrier->minRXTXTIMEpdsch, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); @@ -265,6 +266,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, + carrier->minRXTXTIMEpdsch, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 401a3a1aba..4b8fd77dc5 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -55,6 +55,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int scg_id, int servCellIndex, int dl_antenna_ports, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid) { @@ -945,7 +946,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = i + 6; // (i<6) ? (i+2) : 0; // (Temp) TODO replace with param from conf + *delay[i] = i+minRXTXTIMEpdsch; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); @@ -1348,6 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid) { @@ -1363,6 +1365,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon 1, 1, dl_antenna_ports, + minRXTXTIMEpdsch, do_csirs, initial_csi_index, uid); From 30cc2b764f605cf687c1d4910632e265d5b13201 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 11:00:59 +0100 Subject: [PATCH 072/883] removing min_fb_time from acknack scheduling --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 10 +++------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 ++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5766b39e29..edb3c02a49 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2097,7 +2097,6 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, int *max_fb_time, - int *min_fb_time, uint8_t *pdsch_to_harq_feedback) { NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; @@ -2136,10 +2135,9 @@ void get_pdsch_to_harq_feedback(int Mod_idP, // common search type uses DCI format 1_0 if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { for (int i=0; i<8; i++) { - pdsch_to_harq_feedback[i] = i+1; // TODO take into account the min feedback time here + pdsch_to_harq_feedback[i] = i+1; if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; - *min_fb_time = 6; } } else { @@ -2162,10 +2160,10 @@ void get_pdsch_to_harq_feedback(int Mod_idP, if (ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) { for (int i=0; i<8; i++) { - pdsch_to_harq_feedback[i] = i+1; // TODO take into account the min feedback time here + pdsch_to_harq_feedback[i] = i+1; if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; - *min_fb_time = 6; + } } else { @@ -2175,8 +2173,6 @@ void get_pdsch_to_harq_feedback(int Mod_idP, pdsch_to_harq_feedback[i] = *ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[i]; if(pdsch_to_harq_feedback[i]>*max_fb_time) *max_fb_time = pdsch_to_harq_feedback[i]; - if(pdsch_to_harq_feedback[i]<*min_fb_time) - *min_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 cccc930dce..982270b3a8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1257,8 +1257,7 @@ int nr_acknack_scheduling(int mod_id, if (sched_ctrl->active_ubwp) bwp_Id = sched_ctrl->active_ubwp->bwp_Id; int max_fb_time = 0; - int min_fb_time = 6; - get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, &min_fb_time, pdsch_to_harq_feedback); + get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, pdsch_to_harq_feedback); int max_absslot = frame*n_slots_frame + slot + max_fb_time; LOG_D(NR_MAC, "In %s: 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); @@ -1304,7 +1303,7 @@ int nr_acknack_scheduling(int mod_id, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); pucch->frame = frame; - pucch->ul_slot = tdd ? first_ul_slot_tdd : first_ul_slot_tdd + min_fb_time; + pucch->ul_slot = first_ul_slot_tdd; } // Find the right timing_indicator value. diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 8147f47847..d17448437d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -213,7 +213,6 @@ void get_pdsch_to_harq_feedback(int Mod_idP, int bwp_id, NR_SearchSpace__searchSpaceType_PR ss_type, int *max_fb_time, - int *min_fb_time, uint8_t *pdsch_to_harq_feedback); void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, From c9f2f54df3b4600393af6cb407d0199c9f0d6b89 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 15:18:05 +0100 Subject: [PATCH 073/883] using minRXTXTIMEpdsch in acknack scheduling (for common case) --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 ++-- openair1/SIMULATION/NR_PHY/ulsim.c | 4 ++-- openair2/GNB_APP/gnb_config.c | 9 +++------ openair2/LAYER2/NR_MAC_gNB/config.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 -- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 8 ++++++-- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 5 +++-- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + openair2/RRC/NR/rrc_gNB.c | 4 ++++ openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 2f30609d7d..ea15f937fe 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -787,9 +787,9 @@ int main(int argc, char **argv) AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface"); gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 0, 0, NULL); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); // reset preprocessor to the one of DLSIM after it has been set during // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index a7075eb218..0fa5165244 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -724,9 +724,9 @@ int main(int argc, char **argv) gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,0, 0, NULL); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 82e0233633..fa20d8e4e0 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -31,6 +31,7 @@ #include #include "common/utils/LOG/log.h" +#include "common/utils/nr/nr_common.h" #include "common/utils/LOG/log_extern.h" #include "assertions.h" #include "gnb_config.h" @@ -47,7 +48,6 @@ // #include "SystemInformationBlockType2.h" // #include "LAYER2/MAC/extern.h" // #include "LAYER2/MAC/proto.h" -#include "PHY/phy_extern.h" #include "PHY/INIT/phy_init.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "nfapi_vnf.h" @@ -947,8 +947,6 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { if (num_gnbs>0) { - - // Output a list of all gNBs. ////////// Identification parameters config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); @@ -1112,14 +1110,12 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; + printf("SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; - }// }//End for (k=0; k configuration.pdsch_AntennaPorts, rrc->configuration.pusch_AntennaPorts, rrc->configuration.sib1_tda, + rrc->configuration.minRXTXTIMEpdsch, rrc->configuration.scc, NULL, 0, diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 626b6724bb..06ad17df6e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -429,6 +429,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts, int sib1_tda, + int minRXTXTIMEpdsch, NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, int add_ue, @@ -479,6 +480,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, } } RC.nrmac[Mod_idP]->ssb_SubcarrierOffset = ssb_SubcarrierOffset; + RC.nrmac[Mod_idP]->minRXTXTIMEpdsch = minRXTXTIMEpdsch; NR_PHY_Config_t phycfg; phycfg.Mod_id = Mod_idP; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index bc1c11c1ba..77d55eb1df 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -968,8 +968,6 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, int start_symbol_index,nr_of_symbols; - uint8_t nb_dmrs_re_per_rb = 0; - uint16_t number_dmrs_symbols = 0; SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 11bee1ade6..5fdaebf637 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1180,6 +1180,8 @@ int nr_acknack_scheduling(int mod_id, const int first_ul_slot_tdd = tdd? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : 0; const int first_ul_slot_period = tdd? tdd->nrofDownlinkSlots : 0; const int CC_id = 0; + const int minfbtime = RC.nrmac[mod_id]->minRXTXTIMEpdsch; + NR_sched_pucch_t *csi_pucch; if (tdd) { @@ -1270,7 +1272,8 @@ int nr_acknack_scheduling(int mod_id, int diff = pucch->ul_slot - slot; if (diff<0) diff += n_slots_frame; - if (pdsch_to_harq_feedback[i] == diff) + if (pdsch_to_harq_feedback[i] == diff && + pdsch_to_harq_feedback[i] >= minfbtime) break; ++i; } @@ -1322,7 +1325,8 @@ int nr_acknack_scheduling(int mod_id, int diff = pucch->ul_slot - slot; if (diff<0) diff += n_slots_frame; - if (pdsch_to_harq_feedback[i] == diff) { + if (pdsch_to_harq_feedback[i] == diff && + pdsch_to_harq_feedback[i] >= minfbtime) { ind_found = i; break; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 5136a4a57c..6b254cd0af 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -50,10 +50,11 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, int pdsch_AntennaPorts, int pusch_AntennaPorts, int sib1_tda, + int minRXTXTIMEpdsch, NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, - int add_ue, - uint32_t rnti, + int add_ue, + uint32_t rnti, NR_CellGroupConfig_t *CellGroup); void clear_nr_nfapi_information(gNB_MAC_INST * gNB, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index b2735b2428..8690f7192f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -678,6 +678,7 @@ typedef struct gNB_MAC_INST_s { int ssb_SubcarrierOffset; /// SIB1 Time domain allocation int sib1_tda; + int minRXTXTIMEpdsch; /// Common cell resources NR_COMMON_channels_t common_channels[NFAPI_CC_MAX]; /// current PDU index (BCH,DLSCH) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 655e6973a1..85674bf9b5 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -239,6 +239,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 0, @@ -392,6 +393,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, NULL, NULL, 0, @@ -585,6 +587,7 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( rrc_instance_p->carrier.pdsch_AntennaPorts, rrc_instance_p->carrier.pusch_AntennaPorts, rrc_instance_p->carrier.sib1_tda, + rrc_instance_p->carrier.minRXTXTIMEpdsch, (NR_ServingCellConfigCommon_t *)rrc_instance_p->carrier.servingcellconfigcommon, &rrc_instance_p->carrier.mib, 0, @@ -1379,6 +1382,7 @@ rrc_gNB_process_RRCReconfigurationComplete( rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, NULL, NULL, 0, diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index e606e22a57..bf82888329 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -367,6 +367,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 1, // add_ue flag @@ -378,6 +379,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, + rrc->carrier.minRXTXTIMEpdsch, NULL, NULL, 1, // add_ue flag From 6ce5f98c622c13c96bc401bb65be348e281b74b2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 16:52:00 +0100 Subject: [PATCH 074/883] some fixes --- .../gnb.band66.tm1.106PRB.usrpn300.conf | 15 +-------------- openair2/LAYER2/NR_MAC_gNB/config.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 4 ++-- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 850cf9a60c..5211c3de6f 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -24,6 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { @@ -157,20 +158,6 @@ gNBs = # 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; } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 06ad17df6e..0a1d7bce2e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -136,6 +136,7 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sche process_rlcBearerConfig(CellGroup->rlc_BearerToAddModList,CellGroup->rlc_BearerToReleaseList,sched_ctrl); } + void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) { nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 5fdaebf637..ef3ac0d5f5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1174,7 +1174,7 @@ int nr_acknack_scheduling(int mod_id, const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; const int nr_mix_slots = tdd? (tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0) : 0; const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; const int first_ul_slot_tdd = tdd? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : 0; @@ -1311,7 +1311,7 @@ int nr_acknack_scheduling(int mod_id, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); pucch->frame = frame; - pucch->ul_slot = first_ul_slot_tdd; + pucch->ul_slot = tdd ? first_ul_slot_tdd : slot + minfbtime; } // Find the right timing_indicator value. From bde7e3a37897dbaca957f255dba4f849f01e7207 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 17:39:58 +0100 Subject: [PATCH 075/883] fixing initialization of UL_tti_req_ahead --- openair2/LAYER2/NR_MAC_gNB/config.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 0a1d7bce2e..b7882906bc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -424,7 +424,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts } -extern uint16_t sl_ahead; + int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, @@ -447,17 +447,16 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, "could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n"); /* fill in slot/frame numbers: slot is fixed, frame will be updated by * scheduler */ + uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); + uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); + /* consider that scheduler runs sl_ahead: the first sl_ahead slots are + * already "in the past" and thus we put frame 1 instead of 0! Note that + * extern variable sl_ahead is not initialized yet, so computing it above */ for (int i = 0; i < n; ++i) { nfapi_nr_ul_tti_request_t *req = &RC.nrmac[Mod_idP]->UL_tti_req_ahead[0][i]; - /* consider that scheduler runs sl_ahead: the first sl_ahead slots are - * already "in the past" and thus we put frame 1 instead of 0! Note that - * variable sl_ahead seems to not be correctly initialized, but I leave - * it for information purposes here (the fix would always put 0, what - * happens now, too) */ - req->SFN = i < sl_ahead; + req->SFN = i < (sl_ahead-1); req->Slot = i; } - RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL = calloc(n * MAX_BWP_SIZE, sizeof(uint16_t)); AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL, From 911b38776ff8712dc4b7024bececf0e71e56212f Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 8 Nov 2021 18:07:38 +0100 Subject: [PATCH 076/883] to avoid unnecessary error message for mixed slot in fdd --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 41 ++++++++++--------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2d658ab8f7..a5978dd635 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -97,7 +97,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * /* check that TDA index 1 fits into DL part of mixed slot, if it exists */ int tdaMi = -1; - if (tdaList->list.count > 1) { + if (tdd && tdaList->list.count > 1) { const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; AssertFatal(!tdaP_Mi->k0 || *tdaP_Mi->k0 == 0, "TimeDomainAllocation at index 1: non-null k0 (%ld) is not supported by the scheduler\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 64297c2617..e0ac0c7381 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -144,27 +144,28 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub // get largest time domain allocation (TDA) for UL slot and UL in mixed slot int tdaMi = -1; - const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; - AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), - "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", - k2, - get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); - SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); - const uint16_t symb_tda_mi = ((1 << len) - 1) << start; - // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check - // whether TDA is entirely within mixed slot, UL. Note that here we assume - // that the PUCCH is scheduled in every slot, and on all RBs (which is - // mostly not true, this is a simplification) - if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { - tdaMi = 1; - } else { - LOG_E(NR_MAC, - "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", - symb_pucch, - symb_ulMixed, - symb_tda_mi); + if (tdd) { + const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; + AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), + "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", + k2, + get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); + SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); + const uint16_t symb_tda_mi = ((1 << len) - 1) << start; + // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check + // whether TDA is entirely within mixed slot, UL. Note that here we assume + // that the PUCCH is scheduled in every slot, and on all RBs (which is + // mostly not true, this is a simplification) + if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { + tdaMi = 1; + } else { + LOG_E(NR_MAC, + "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", + symb_pucch, + symb_ulMixed, + symb_tda_mi); + } } - const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; From 1624e811419e7eda1d4ad6b69bd6601aabc9a41f Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 9 Nov 2021 10:18:39 +0100 Subject: [PATCH 077/883] fixes in UL scheduler at UE --- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index dae3f6a8a3..b4938e2fe1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1079,7 +1079,7 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac, // Calculate TX slot and frame *slot_tx = (current_slot + k2) % nr_slots_per_frame[mu]; - *frame_tx = ((current_slot + k2) > nr_slots_per_frame[mu]) ? (current_frame + 1) % 1024 : current_frame; + *frame_tx = ((current_slot + k2) > (nr_slots_per_frame[mu]-1)) ? (current_frame + 1) % 1024 : current_frame; } @@ -1768,7 +1768,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in } // CSI - if (mac->ra.ra_state == RA_SUCCEEDED) + if (mac->ra.ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test == 1) O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch); // ACKNACK From bac8bc569c6a9ea073a17bff7fa487c8129cc114 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 9 Nov 2021 10:51:00 +0100 Subject: [PATCH 078/883] minor changes in dlschsim, still doesn't work :-( --- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 8 ++---- openair1/SIMULATION/NR_PHY/dlschsim.c | 31 ++++++++++++++++----- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 5620018b73..0165a4062e 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -254,7 +254,7 @@ void ldpc8blocks( void *p) { #ifdef DEBUG_DLSCH_CODING for (int i =0; i<16; i++) - printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); + printf("output ratematching e[%d]= %d r_offset %u\n", i,e[i], r_offset); #endif nr_interleaving_ldpc(E, @@ -266,8 +266,6 @@ void ldpc8blocks( void *p) { for (int i =0; i<16; i++) printf("output interleaving f[%d]= %d r_offset %u\n", i,impp->output[i+r_offset], r_offset); - if (r==impp->n_segments-1) - write_output("enc_output.m","enc",impp->output,G,1,4); #endif r_offset += E; @@ -370,11 +368,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, //d_tmp[r] = &harq->d[r][0]; //channel_input[r] = &harq->d[r][0]; #ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp->F); + LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp.F); LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,impp.n_segments); LOG_D(PHY,"input %d %d %d %d %d \n", harq->c[r][0], harq->c[r][1], harq->c[r][2],harq->c[r][3], harq->c[r][4]); - for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++) { + for (int cnt =0 ; cnt < 22*(*impp.Zc)/8; cnt ++) { LOG_D(PHY,"%d ", harq->c[r][cnt]); } diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 96bd435674..b304327138 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -68,6 +68,7 @@ uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} +void processSlotTX(void *arg) {} int main(int argc, char **argv) { @@ -116,8 +117,10 @@ int main(int argc, char **argv) uint8_t Imcs = 9; uint8_t mcs_table = 0; double DS_TDL = .03; - cpuf = get_cpu_freq_GHz(); + cpuf = get_cpu_freq_GHz(); + char gNBthreads[128]="n"; + if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) { exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n"); } @@ -426,9 +429,22 @@ int main(int argc, char **argv) UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; - processingData_L1tx_t msgDataTx; - init_DLSCH_struct(gNB, &msgDataTx); - NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0]; + + gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); + initTpool(gNBthreads, gNB->threadPool, true); + gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); + initNotifiedFIFO(gNB->resp_L1_tx); + // we create 2 threads for L1 tx processing + notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX); + processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); + init_DLSCH_struct(gNB, msgDataTx); + msgDataTx->slot = slot; + msgDataTx->frame = frame; + memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); + reset_meas(&msgDataTx->phy_proc_tx); + gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; + pushTpool(gNB->threadPool,msgL1Tx); + NR_gNB_DLSCH_t *dlsch = msgDataTx->dlsch[0][0]; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15; //time_stats_t *rm_stats, *te_stats, *i_stats; uint8_t is_crnti = 0, llr8_flag = 0; @@ -501,10 +517,11 @@ int main(int argc, char **argv) /*for (int i=0; i0x%08x\n",crc24c(test_input, 32)); // generate signal - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } @@ -640,7 +657,7 @@ int main(int argc, char **argv) for (i = 0; i < 2; i++) { printf("gNB %d\n", i); - free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL); + free_gNB_dlsch(&(msgDataTx->dlsch[0][i]),N_RB_DL); printf("UE %d\n", i); free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL); } From 6087030c7884e305419b1b4a30c487d7e4534bd7 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 9 Nov 2021 13:53:58 +0100 Subject: [PATCH 079/883] adding min_rxtxtime_pdsch to fdd config file --- .../GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf index 09772440a4..0b0a46a1f1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime_pdsch = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( From 47847f170102369f54942107a22596959cdbbcbb Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 9 Nov 2021 15:57:31 +0100 Subject: [PATCH 080/883] bugfix in ul preprocessor --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index e0ac0c7381..16a77cdfcf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1293,8 +1293,13 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t if (!is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot)) return false; - bool is_mixed_slot = is_xlsch_in_slot(nr_mac->dlsch_slot_bitmap[sched_slot / 64], sched_slot) && - is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot); + bool is_mixed_slot = false; + const NR_TDD_UL_DL_Pattern_t *tdd = + scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + + if (tdd) + is_mixed_slot = is_xlsch_in_slot(nr_mac->dlsch_slot_bitmap[sched_slot / 64], sched_slot) && + is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot); // FIXME: Avoid mixed slots for initialUplinkBWP if (sched_ctrl->active_ubwp==NULL && is_mixed_slot) From bf8a191370283f2e26dc479df7628997f949a6b8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 10 Nov 2021 15:24:08 +0100 Subject: [PATCH 081/883] fixing msg2 scheduler --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 77d55eb1df..08d0a38038 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -481,9 +481,16 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // go to previous slot if the current scheduled slot is beyond the response window // and if the slot is not among the PDCCH monitored ones (38.213 10.1) - while (((*msg2_slot>slot_limit)&&(*msg2_frame>frame_limit)) || ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) { - if((*msg2_slot%tdd_period_slot) > 0) + while ((*msg2_frame>frame_limit) || + ((*msg2_frame==frame_limit) && + (*msg2_slot>slot_limit)) || + ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) { + + if(!tdd || ((*msg2_slot%tdd_period_slot) > 0)) { + if (*msg2_slot==0) + (*msg2_frame)--; (*msg2_slot)--; + } else AssertFatal(1==0,"No available DL slot to schedule msg2 has been found"); } From 26a541e2b0b9b4b7d38c75276f83a9d08e8d0255 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 10 Nov 2021 16:24:05 +0100 Subject: [PATCH 082/883] removing unnecessary free tdd_UL_DL_ConfigurationCommon --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index d9514691ba..7586342998 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -625,10 +625,7 @@ int nr_rrc_mac_config_req_ue( config_common_ue_sa(mac,module_id,cc_idP); int num_slots_ul = nr_slots_per_frame[mac->mib->subCarrierSpacingCommon]; - if(cfg->cell_config.frame_duplex_type == FDD){ - free(mac->scc_SIB->tdd_UL_DL_ConfigurationCommon); - mac->scc_SIB->tdd_UL_DL_ConfigurationCommon = NULL; - } else { + if(cfg->cell_config.frame_duplex_type == TDD){ num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) { num_slots_ul++; @@ -653,10 +650,6 @@ int nr_rrc_mac_config_req_ue( ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; } mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon; - if(cfg->cell_config.frame_duplex_type == FDD){ - free(mac->scc->tdd_UL_DL_ConfigurationCommon); - mac->scc->tdd_UL_DL_ConfigurationCommon = NULL; - } mac->physCellId = *mac->scc->physCellId; config_common_ue(mac,module_id,cc_idP); mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; From 4acc0f05ac86b6220a051c56ec394fb7cb05d261 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 10 Nov 2021 16:57:36 +0000 Subject: [PATCH 083/883] Update config files for SA --- .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 19 +++++++++++-------- .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 15 +++++++++------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 62b89188f9..c8c062c73a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -66,7 +66,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952 + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -95,7 +95,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 12952; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -232,15 +232,16 @@ MACRLCs = ( tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; } ); L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } @@ -314,7 +315,9 @@ security = { pdcp_log_verbosity ="medium"; rrc_log_level ="info"; rrc_log_verbosity ="medium"; - ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index ac8622fbc5..c525fb079c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -232,15 +232,16 @@ MACRLCs = ( tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; } ); L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } @@ -314,7 +315,9 @@ security = { pdcp_log_verbosity ="medium"; rrc_log_level ="info"; rrc_log_verbosity ="medium"; - ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; From f91017e2f0a4d57eba15544b6b0f24b8c0edd3af Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 10 Nov 2021 17:31:49 +0000 Subject: [PATCH 084/883] Change LOG levels --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 37 ++++++++----------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 14 ++----- 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 37a2849d21..1ce8c238cb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -32,9 +32,6 @@ #include "PHY/phy_extern_nr_ue.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "nr_transport_proto_ue.h" -//#include "SCHED/defs.h" -//#include "PHY/defs.h" -//#include "extern.h" #include "PHY/sse_intrin.h" #include "T.h" #include "openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h" @@ -379,10 +376,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", - frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -402,11 +397,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -463,9 +458,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #endif stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -515,11 +509,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -574,11 +568,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; @@ -657,9 +651,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index e1b87185bd..1039608ddb 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -60,6 +60,7 @@ //#define NR_PDCCH_SCHED_DEBUG //#define NR_PUCCH_SCHED //#define NR_PUCCH_SCHED_DEBUG +//#define NR_PDSCH_DEBUG #ifndef PUCCH #define PUCCH @@ -1038,16 +1039,9 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8); - - - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); -#if PHYSIM - printf(" --> Unscrambling for CW0 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - printf("AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); -#else + +#ifdef NR_PDSCH_DEBUG LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", @@ -1116,8 +1110,8 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); + #if PHYSIM printf(" --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); From dc59ed65bd1baca7e73377f149693a0701e28f32 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 10 Nov 2021 19:24:32 +0000 Subject: [PATCH 085/883] Creating the empty functions required for the NR-SRS --- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 6 ++--- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.h | 5 ++-- openair1/SCHED_NR/phy_procedures_nr_common.c | 16 ++++--------- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 24 +++++++------------ openair1/SCHED_NR/sched_nr.h | 1 + openair1/SCHED_NR_UE/defs.h | 11 ++------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 10 ++++---- .../NR_UE_PHY/unit_tests/src/srs_test.c | 2 +- 8 files changed, 26 insertions(+), 49 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index 4109950df6..e536d12127 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -410,7 +410,7 @@ int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, NR_DL_FRAME_PARMS *frame_pa /******************************************************************* * -* NAME : ue_srs_procedure_nr +* NAME : ue_srs_procedures_nr * * PARAMETERS : pointer to ue context * pointer to rxtx context* @@ -422,7 +422,7 @@ int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, NR_DL_FRAME_PARMS *frame_pa * send srs according to current configuration * *********************************************************************/ -int ue_srs_procedure_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id) +int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id) { NR_DL_FRAME_PARMS *frame_parms = &(ue->frame_parms); SRS_NR *p_srs_nr = &(ue->frame_parms.srs_nr); @@ -460,7 +460,7 @@ int ue_srs_procedure_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB int16_t txptr = AMP; uint16_t nsymb = (ue->frame_parms.Ncp==0) ? 14:12; uint16_t symbol_offset = (int)ue->frame_parms.ofdm_symbol_size*((proc->nr_slot_tx*nsymb)+(nsymb-1)); - if (generate_srs_nr(p_srs_resource_set, frame_parms, &ue->common_vars.txdataF[eNB_id][symbol_offset], txptr, proc) == 0) { + if (generate_srs_nr(p_srs_resource_set, frame_parms, &ue->common_vars.txdataF[gNB_id][symbol_offset], txptr, proc) == 0) { return 0; } else diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h index 86fd7fcc91..e6f94b5c35 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h @@ -155,13 +155,14 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, NR_DL_FRAME_PARMS *frame_parms, int frame_tx, int slot_tx); + /** \brief This function processes srs configuration * @param ue context @param rxtx context - @param current eNB identifier + @param current gNB_id identifier @returns 0 if srs is transmitted -1 otherwise */ -int ue_srs_procedure_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id); +int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id); #undef EXTERN #undef INIT_VARIABLES_SRS_MODULATION_NR_H diff --git a/openair1/SCHED_NR/phy_procedures_nr_common.c b/openair1/SCHED_NR/phy_procedures_nr_common.c index 8d1f615569..add5a169c3 100755 --- a/openair1/SCHED_NR/phy_procedures_nr_common.c +++ b/openair1/SCHED_NR/phy_procedures_nr_common.c @@ -19,17 +19,9 @@ * contact@openairinterface.org */ -/*! \file phy_procedures_lte_eNB.c -* \brief Implementation of common utilities for eNB/UE procedures from 36.213 LTE specifications -* \author R. Knopp, F. Kaltenberger -* \date 2011 -* \version 0.1 -* \company Eurecom -* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr -* \note -* \warning -*/ +#include "PHY/defs_gNB.h" -#include "sched_nr.h" -#include "PHY/INIT/phy_init.h" +bool is_srs_occasion_nr(NR_DL_FRAME_PARMS frame_parms, int frame_rx, int slot_rx) { + return false; +} diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 1685e206ae..217009d1ab 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -19,19 +19,13 @@ * contact@openairinterface.org */ -#include "PHY/phy_extern.h" #include "PHY/defs_gNB.h" #include "sched_nr.h" -#include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "PHY/NR_TRANSPORT/nr_dlsch.h" #include "PHY/NR_TRANSPORT/nr_ulsch.h" #include "PHY/NR_TRANSPORT/nr_dci.h" #include "PHY/NR_ESTIMATION/nr_ul_estimation.h" -#include "PHY/NR_UE_TRANSPORT/pucch_nr.h" -#include "SCHED/sched_eNB.h" -#include "sched_nr.h" -#include "SCHED/sched_common_extern.h" #include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h" #include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" #include "fapi_nr_l1.h" @@ -40,7 +34,6 @@ #include "PHY/INIT/phy_init.h" #include "PHY/MODULATION/nr_modulation.h" #include "T.h" -#include "executables/nr-softmodem.h" #include "executables/softmodem-common.h" #include "assertions.h" @@ -186,7 +179,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, for (int i=0;icsirs_pdu[i]; - if ((csirs->active == 1)) { + if (csirs->active == 1) { LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot); nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params = csirs->csirs_pdu.csi_rs_pdu_rel15; nr_generate_csi_rs(gNB, AMP, csi_params, gNB->gNB_config.cell_config.phy_cell_id.value, slot); @@ -206,16 +199,13 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); } +void srs_procedures_nr(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { + if(is_srs_occasion_nr(gNB->frame_parms, frame_rx, slot_rx)) { + LOG_W(NR_PHY, "SRS procedures are not implemented yet!"); + } -/* - - if ((cfg->subframe_config.duplex_mode.value == TDD) && - ((nr_slot_select(fp,frame,slot)&NR_DOWNLINK_SLOT)==SF_DL)) return; - - // VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1); - -*/ +} void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { ldpcDecode_t *rdata = (ldpcDecode_t*) NotifiedFifoData(req); @@ -648,6 +638,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } } else num_symb=NR_NUMBER_OF_SYMBOLS_PER_SLOT; + + srs_procedures_nr(gNB, frame_rx, slot_rx); gNB_I0_measurements(gNB,slot_rx,first_symb,num_symb); int offset = 10*gNB->frame_parms.ofdm_symbol_size + gNB->frame_parms.first_carrier_offset; diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index d7e0332b85..706aaf4aec 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -54,5 +54,6 @@ void nr_fep_full(RU_t *ru, int slot); void nr_fep_full_2thread(RU_t *ru, int slot); void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); int nr_phy_init_RU(RU_t *ru); +bool is_srs_occasion_nr(NR_DL_FRAME_PARMS frame_parms, int frame_rx, int slot_rx); #endif diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index c98574ec42..6f3c2c2df4 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -369,19 +369,12 @@ void nr_srs_power_cntl(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id 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); - -int nr_is_srs_occasion_common(NR_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx); - -void nr_compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); +bool is_srs_occasion_nr(NR_DL_FRAME_PARMS frame_parms, int frame_rx, int slot_rx); +void compute_srs_pos_nr(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); 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 1039608ddb..d6f358c75e 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -38,15 +38,12 @@ #include "PHY/defs_nr_UE.h" #include "PHY/phy_extern_nr_ue.h" #include "PHY/MODULATION/modulation_UE.h" -#include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -#include "SCHED_NR_UE/defs.h" -#include "SCHED_NR_UE/pucch_uci_ue_nr.h" +#include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h" #include "SCHED_NR/extern.h" #include "SCHED_NR_UE/phy_sch_processing_time.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h" -#include "PHY/NR_TRANSPORT/nr_dci.h" #ifdef EMOS #include "SCHED/phy_procedures_emos.h" #endif @@ -276,16 +273,17 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx); - start_meas(&ue->phy_proc_tx); if (ue->UE_mode[gNB_id] <= PUSCH){ - for (uint8_t harq_pid = 0; harq_pid < ue->ulsch[proc->thread_id][gNB_id][0]->number_harq_processes_for_pusch; harq_pid++) { if (ue->ulsch[proc->thread_id][gNB_id][0]->harq_processes[harq_pid]->status == ACTIVE) nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, proc->thread_id, gNB_id); } + } + if (ue->UE_mode[gNB_id] == PUSCH && is_srs_occasion_nr(ue->frame_parms, frame_tx, slot_tx)) { + ue_srs_procedures_nr(ue, proc, gNB_id); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c index aedb5729a3..34ea68bc61 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c @@ -229,7 +229,7 @@ int test_srs_periodicity(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc) for (int slot_tx = 0; slot_tx < frame_parms->slots_per_frame; slot_tx++) { proc->frame_tx = frame_tx; proc->nr_slot_tx = slot_tx; - if (ue_srs_procedure_nr( ue, proc, 0) == 0) { + if (ue_srs_procedures_nr( ue, proc, 0) == 0) { printf("test_srs_periodicity srs at frame %d slot %d \n", frame_tx, slot_tx); } } From 7e8dd29828a34df4ae35bbf253a7022f95371a2f Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 11 Nov 2021 15:13:34 +0000 Subject: [PATCH 086/883] Add SRS debug --- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 24 +++++++++++++++++++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index e536d12127..403de8387e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -47,6 +47,8 @@ #include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h" #undef DEFINE_VARIABLES_SRS_MODULATION_NR_H +#define SRS_DEBUG + /******************************************************************* * * NAME : generate_srs @@ -429,6 +431,14 @@ int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gN SRS_ResourceSet_t *p_srs_resource_set = frame_parms->srs_nr.p_SRS_ResourceSetList[p_srs_nr->active_srs_Resource_Set]; int generate_srs = 0; +#ifdef SRS_DEBUG + LOG_I(NR_PHY,"p_srs_nr = 0x%x\n", p_srs_nr); + if(p_srs_nr) LOG_I(NR_PHY,"p_srs_nr->number_srs_Resource_Set = %i\n", p_srs_nr->number_srs_Resource_Set); + if(p_srs_nr) LOG_I(NR_PHY,"p_srs_nr->active_srs_Resource_Set = %i\n", p_srs_nr->active_srs_Resource_Set); + LOG_I(NR_PHY,"p_srs_resource_set = 0x%x\n", p_srs_resource_set); + if(p_srs_resource_set) LOG_I(NR_PHY,"p_srs_resource_set->resourceType = %i\n", p_srs_resource_set->resourceType); +#endif + /* is there any resource set which has been configurated ? */ if (p_srs_nr->number_srs_Resource_Set != 0) { @@ -460,6 +470,20 @@ int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gN int16_t txptr = AMP; uint16_t nsymb = (ue->frame_parms.Ncp==0) ? 14:12; uint16_t symbol_offset = (int)ue->frame_parms.ofdm_symbol_size*((proc->nr_slot_tx*nsymb)+(nsymb-1)); + +#ifdef SRS_DEBUG + LOG_I(NR_PHY,"nsymb = %i, symbol_offset = %i\n", nsymb, symbol_offset); + LOG_I(NR_PHY,"p_srs_resource_set->srs_ResourceSetId = %i\n", p_srs_resource_set->srs_ResourceSetId); + LOG_I(NR_PHY,"p_srs_resource_set->number_srs_Resource = %i", p_srs_resource_set->number_srs_Resource); + LOG_I(NR_PHY,"p_srs_resource_set->resourceType = %i\n", p_srs_resource_set->resourceType); + LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->SRS_Periodicity = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->SRS_Periodicity); + LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->combOffset = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->combOffset); + LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->freqDomainPosition = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->freqDomainPosition); + LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_b_SRS = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_b_SRS); + LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_b_hop = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_b_hop); + LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_c_SRS = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_c_SRS); +#endif + if (generate_srs_nr(p_srs_resource_set, frame_parms, &ue->common_vars.txdataF[gNB_id][symbol_offset], txptr, proc) == 0) { return 0; } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 217009d1ab..ab33fb07eb 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -202,7 +202,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, void srs_procedures_nr(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { if(is_srs_occasion_nr(gNB->frame_parms, frame_rx, slot_rx)) { - LOG_W(NR_PHY, "SRS procedures are not implemented yet!"); + LOG_W(NR_PHY, "SRS procedures are not implemented yet!\n"); } } From 6aea63a0eb6b3d8a2a328fff6f74dcb2e672e496 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 11 Nov 2021 16:46:43 +0000 Subject: [PATCH 087/883] Init SRS parameters at gNB --- openair1/PHY/INIT/nr_parms.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 42d4a30e3b..1f536f2514 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -237,6 +237,30 @@ uint32_t get_samples_slot_timestamp(int slot, NR_DL_FRAME_PARMS* fp, uint8_t sl_ return samp_count; } +// FIXME: It is hardcoded for now +void set_srs_parameters(NR_DL_FRAME_PARMS *fp) { + + // init resource + SRS_Resource_t *p_srs_resource = calloc( 1, sizeof(*p_srs_resource)); + p_srs_resource->nrof_SrsPorts = port1; + p_srs_resource->transmissionComb = 2; // K_TC + p_srs_resource->resourceMapping_nrofSymbols = 1; + p_srs_resource->resourceMapping_repetitionFactor = 1; + p_srs_resource->SRS_Periodicity = srs_sl4; + p_srs_resource->SRS_Offset = 3; + + // init resource set with only 1 resource + SRS_ResourceSet_t *p_srs_resource_set = calloc( 1, sizeof(*p_srs_resource_set)); + p_srs_resource_set->resourceType = periodic; + p_srs_resource_set->number_srs_Resource++; + p_srs_resource_set->p_srs_ResourceList[0] = p_srs_resource; + + SRS_NR *p_srs_nr = &fp->srs_nr; + p_srs_nr->active_srs_Resource_Set = 0; + p_srs_nr->number_srs_Resource_Set++; + p_srs_nr->p_SRS_ResourceSetList[0] = p_srs_resource_set; +} + int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, NR_DL_FRAME_PARMS *fp) { @@ -294,6 +318,8 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, for (int p=0; pN_ssb += ((fp->L_ssb >> (63-p)) & 0x01); + set_srs_parameters(fp); + return 0; } From 7c899fd14798b725c25863bcb4bf8d850c4a366d Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Thu, 11 Nov 2021 17:58:11 +0000 Subject: [PATCH 088/883] Revert "Init SRS parameters at gNB" This reverts commit 6aea63a0eb6b3d8a2a328fff6f74dcb2e672e496 --- openair1/PHY/INIT/nr_parms.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 1f536f2514..42d4a30e3b 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -237,30 +237,6 @@ uint32_t get_samples_slot_timestamp(int slot, NR_DL_FRAME_PARMS* fp, uint8_t sl_ return samp_count; } -// FIXME: It is hardcoded for now -void set_srs_parameters(NR_DL_FRAME_PARMS *fp) { - - // init resource - SRS_Resource_t *p_srs_resource = calloc( 1, sizeof(*p_srs_resource)); - p_srs_resource->nrof_SrsPorts = port1; - p_srs_resource->transmissionComb = 2; // K_TC - p_srs_resource->resourceMapping_nrofSymbols = 1; - p_srs_resource->resourceMapping_repetitionFactor = 1; - p_srs_resource->SRS_Periodicity = srs_sl4; - p_srs_resource->SRS_Offset = 3; - - // init resource set with only 1 resource - SRS_ResourceSet_t *p_srs_resource_set = calloc( 1, sizeof(*p_srs_resource_set)); - p_srs_resource_set->resourceType = periodic; - p_srs_resource_set->number_srs_Resource++; - p_srs_resource_set->p_srs_ResourceList[0] = p_srs_resource; - - SRS_NR *p_srs_nr = &fp->srs_nr; - p_srs_nr->active_srs_Resource_Set = 0; - p_srs_nr->number_srs_Resource_Set++; - p_srs_nr->p_SRS_ResourceSetList[0] = p_srs_resource_set; -} - int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, NR_DL_FRAME_PARMS *fp) { @@ -318,8 +294,6 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, for (int p=0; pN_ssb += ((fp->L_ssb >> (63-p)) & 0x01); - set_srs_parameters(fp); - return 0; } From 8849a5e20d78db844efa07ed4fb1cc798c61c64b Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 12 Nov 2021 09:55:58 +0100 Subject: [PATCH 089/883] fix for numDmrsCdmGrpsNoData in SA --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 043c0951d4..d9961108e0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -435,17 +435,19 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); } - const long dci_format = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; - if (dci_format == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0 || - pdsch_Config == NULL) { - if (ps->nrOfSymbols == 2 && ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB) + const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; + int dci_format; + if (sched_ctrl->search_space) { + dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; + } + else { + dci_format = NR_DL_DCI_FORMAT_1_0; + } + if (dci_format == NR_DL_DCI_FORMAT_1_0) { + if (ps->nrOfSymbols == 2) ps->numDmrsCdmGrpsNoData = 1; - else { - if (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1) - ps->numDmrsCdmGrpsNoData = 2; - else - ps->numDmrsCdmGrpsNoData = 3; - } + else + ps->numDmrsCdmGrpsNoData = 2; ps->dmrs_ports_id = 0; ps->frontloaded_symb = 1; ps->nrOfLayers = 1; From 6c767458e8dbd588e4159f9d7cb2284bd4f6c3df Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 12 Nov 2021 14:23:08 +0000 Subject: [PATCH 090/883] Fill fapi_nr_ul_config_srs_pdu struct --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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 e1bb2579eb..32bbae1f5f 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 @@ -331,7 +331,34 @@ typedef struct } nfapi_nr_ue_pusch_pdu_t; typedef struct { +} fapi_nr_ul_srs_parms_v4; +typedef struct { + uint16_t rnti; // UE RNTI, Value: 1->65535 + uint32_t handle; // An opaque handling returned in the SRS.indication + uint16_t bwp_size; // Bandwidth part size [3GPP TS 38.213, sec 12]. Number of contiguous PRBs allocated to the BWP, Value: 1->275 + uint16_t bwp_start; // Bandwidth part start RB index from reference CRB [3GPP TS 38.213, sec 12], Value: 0->274 + uint8_t subcarrier_spacing; // subcarrierSpacing [3GPP TS 38.211, sec 4.2], Value:0->4 + uint8_t cyclic_prefix; // Cyclic prefix type [3GPP TS 38.211, sec 4.2], 0: Normal; 1: Extended + uint8_t num_ant_ports; // Number of antenna ports N_SRS_ap [3GPP TS 38.211, Sec 6.4.1.4.1], Value: 0 = 1 port, 1 = 2 ports, 2 = 4 ports + uint8_t num_symbols; // Number of symbols N_SRS_symb [3GPP TS 38.211, Sec 6.4.1.4.1], Value: 0 = 1 symbol, 1 = 2 symbols, 2 = 4 symbols + uint8_t num_repetitions; // Repetition factor R [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 = 1, 1 = 2, 2 = 4 + uint8_t time_start_position; // Starting position in the time domain l_0 [3GPP TS 38.211, Sec 6.4.1.4.1], Note: the MAC undertakes the translation from startPosition to l_0, Value: 0 --> 13 + uint8_t config_index; // SRS bandwidth config index C_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 63 + uint16_t sequence_id; // SRS sequence ID n_SRS_ID [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 1023 + uint8_t bandwidth_index; // SRS bandwidth index B_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 + uint8_t comb_size; // Transmission comb size K_TC [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 = comb size 2, 1 = comb size 4, 2 = comb size 8 (Rel16) + uint8_t comb_offset; // Transmission comb offset K'_TC[3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 1 (combSize = 0), Value: 0 --> 3 (combSize = 1), Value: 0 --> 7 (combSize = 2) + uint8_t cyclic_chift; // Cyclic shift n_CS_SRS [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 7 (combSize = 0), Value: 0 --> 11 (combSize = 1), Value: 0 --> 5 (combSize = 2) + uint8_t frequency_position; // Frequency domain position n_RRC [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 67 + uint16_t frequency_shift; // Frequency domain shift n_shift [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 268 + uint8_t frequency_hopping; // Frequency hopping b_hop [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 + uint8_t group_or_sequence_hopping; // Group or sequence hopping configuration (RRC parameter groupOrSequenceHopping in SRSResource IE), Value: 0 = No hopping, 1 = Group hopping groupOrSequenceHopping, 2 = Sequence hopping + uint8_t resource_type; // Type of SRS resource allocation [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0: aperiodic, 1: semi-persistent, 2: periodic + uint16_t t_srs; // SRS-Periodicity in slots [3GPP TS 38.211, Sec 6.4.1.4.4], Value: 1,2,3,4,5,8,10,16,20,32,40,64,80,160,320,640,1280,2560 + uint16_t t_offset; // Slot offset value [3GPP TS 38.211, Sec 6.4.1.4.3], Value:0->2559 + nfapi_nr_ue_ul_beamforming_t beamforming; + fapi_nr_ul_srs_parms_v4 srs_parms_v4; } fapi_nr_ul_config_srs_pdu; typedef struct { From 32e7b7b83f1cee02b69134ceee5cc454c8e46635 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 12 Nov 2021 16:39:16 +0000 Subject: [PATCH 091/883] Update SA default configuration files --- .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 126 +++---- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 323 ++++++++++++++++++ .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 126 +++---- 3 files changed, 451 insertions(+), 124 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 62b89188f9..de6bafc9f7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -1,4 +1,4 @@ -Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +Active_gNBs = ( "gNB-OAI"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; @@ -7,7 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; - gNB_name = "gNB-Eurecom-5GNRBox"; + gNB_name = "gNB-OAI"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; @@ -204,7 +204,7 @@ gNBs = }; - ////////// MME parameters: + ////////// AMF parameters: amf_ip_address = ( { ipv4 = "192.168.70.132"; ipv6 = "192:168:30::17"; active = "yes"; @@ -226,59 +226,61 @@ gNBs = ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 150; - pucch_TargetSNRx10 = 200; - } +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [41]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 114; - eNB_instances = [0]; - #beamforming 1x4 matrix: - bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; - clock_src = "internal"; - } +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [41]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} ); THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} ); rfsimulator : { - serveraddr = "server"; - serverport = "4043"; - options = (); #("saviq"); or/and "chanmod" - modelname = "AWGN"; - IQfile = "/tmp/rfsimulator.iqs"; + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; }; security = { @@ -298,23 +300,23 @@ security = { drb_integrity = "no"; }; - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; - }; +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf new file mode 100644 index 0000000000..abc64b6e46 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -0,0 +1,323 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; # 641280 + dl_frequencyBand = 78; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; # 640008 + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -70; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + #pusch_TargetSNRx10 = 150; + #pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; + #pucch0_dtx_threshold = 120; +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + sf_extension = 0; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.2,clock_source=internal,time_source=internal" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index ac8622fbc5..83b39b85ec 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -1,4 +1,4 @@ -Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +Active_gNBs = ( "gNB-OAI"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; @@ -7,7 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; - gNB_name = "gNB-Eurecom-5GNRBox"; + gNB_name = "gNB-OAI"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; @@ -204,7 +204,7 @@ gNBs = }; - ////////// MME parameters: + ////////// AMF parameters: amf_ip_address = ( { ipv4 = "192.168.70.132"; ipv6 = "192:168:30::17"; active = "yes"; @@ -226,59 +226,61 @@ gNBs = ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 150; - pucch_TargetSNRx10 = 200; - } +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 114; - eNB_instances = [0]; - #beamforming 1x4 matrix: - bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; - clock_src = "internal"; - } +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} ); THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} ); rfsimulator : { - serveraddr = "server"; - serverport = "4043"; - options = (); #("saviq"); or/and "chanmod" - modelname = "AWGN"; - IQfile = "/tmp/rfsimulator.iqs"; + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; }; security = { @@ -298,23 +300,23 @@ security = { drb_integrity = "no"; }; - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; - }; +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; From 68e968e5566f3ced06d9499e86d9d0cdc9361c7d Mon Sep 17 00:00:00 2001 From: rmagueta Date: Sat, 13 Nov 2021 17:10:07 +0000 Subject: [PATCH 092/883] Create gNB_scheduler_SRS.c --- cmake_targets/CMakeLists.txt | 1 + .../nfapi/public_inc/fapi_nr_ue_interface.h | 4 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c | 93 +++++++++++++++++++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 + 5 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 67f65b6848..6cf6f7128e 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2120,6 +2120,7 @@ set (MAC_NR_SRC ${NR_GNB_MAC_DIR}/gNB_scheduler_phytest.c ${NR_GNB_MAC_DIR}/gNB_scheduler_uci.c ${NR_GNB_MAC_DIR}/gNB_scheduler_RA.c + ${NR_GNB_MAC_DIR}/gNB_scheduler_SRS.c ) 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 32bbae1f5f..d59ddf9d82 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 @@ -346,7 +346,7 @@ typedef struct { uint8_t time_start_position; // Starting position in the time domain l_0 [3GPP TS 38.211, Sec 6.4.1.4.1], Note: the MAC undertakes the translation from startPosition to l_0, Value: 0 --> 13 uint8_t config_index; // SRS bandwidth config index C_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 63 uint16_t sequence_id; // SRS sequence ID n_SRS_ID [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 1023 - uint8_t bandwidth_index; // SRS bandwidth index B_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 + uint8_t bandwidth_index; // SRS bandwidth index B_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 uint8_t comb_size; // Transmission comb size K_TC [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 = comb size 2, 1 = comb size 4, 2 = comb size 8 (Rel16) uint8_t comb_offset; // Transmission comb offset K'_TC[3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 1 (combSize = 0), Value: 0 --> 3 (combSize = 1), Value: 0 --> 7 (combSize = 2) uint8_t cyclic_chift; // Cyclic shift n_CS_SRS [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 7 (combSize = 0), Value: 0 --> 11 (combSize = 1), Value: 0 --> 5 (combSize = 2) @@ -367,7 +367,7 @@ typedef struct { fapi_nr_ul_config_prach_pdu prach_config_pdu; fapi_nr_ul_config_pucch_pdu pucch_config_pdu; nfapi_nr_ue_pusch_pdu_t pusch_config_pdu; - fapi_nr_ul_config_srs_pdu srs_config_pdu; + fapi_nr_ul_config_srs_pdu srs_config_pdu; }; } fapi_nr_ul_config_request_pdu_t; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index b62f8e0282..90664770fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -397,6 +397,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_pucch(module_idP, frame, slot); + nr_schedule_srs(module_idP, frame, slot); + stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c new file mode 100644 index 0000000000..f1123e582b --- /dev/null +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c @@ -0,0 +1,93 @@ +/* + * 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 gNB_scheduler_SRS.c + * \brief primitives used for sounding reference signal + * \date 2021 + */ + +#include "platform_types.h" + +/* MAC */ +#include "nr_mac_gNB.h" +#include "NR_MAC_COMMON/nr_mac_extern.h" + +/* Utils */ +#include "common/utils/LOG/vcd_signal_dumper.h" + +void nr_schedule_srs_aperiodic(module_id_t module_idP, + frame_t frameP, + sub_frame_t slotP, + NR_SRS_ResourceSet_t *srs_resource_set) { + LOG_W(NR_PHY, "Aperiodic SRS scheduling is not implemented yet!\n"); +} + +void nr_schedule_srs_semi_persistent(module_id_t module_idP, + frame_t frameP, + sub_frame_t slotP, + NR_SRS_ResourceSet_t *srs_resource_set) { + LOG_W(NR_PHY, "Semi-persistent SRS scheduling is not implemented yet!\n"); +} + +void nr_schedule_srs_periodic(module_id_t module_idP, + frame_t frameP, + sub_frame_t slotP, + NR_SRS_ResourceSet_t *srs_resource_set) { + LOG_W(NR_PHY, "Periodic SRS scheduling is not implemented yet!\n"); +} + +void nr_schedule_srs(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) { + + gNB_MAC_INST *mac = RC.nrmac[module_idP]; + + for (int UE_id = 0; UE_id < MAX_MOBILES_PER_GNB; UE_id++) { + NR_CellGroupConfig_t *cg = mac->UE_info.CellGroup[UE_id]; + NR_BWP_UplinkDedicated_t *ubwpd = NULL; + if (cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) { + ubwpd = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP; + } else { + continue; + } + + NR_SRS_Config_t *srs_Config = ubwpd->srs_Config->choice.setup; + + for(int rs = 0; rs < srs_Config->srs_ResourceSetToAddModList->list.count; rs++) { + NR_SRS_ResourceSet_t *srs_resource_set = srs_Config->srs_ResourceSetToAddModList->list.array[rs]; + switch (srs_resource_set->resourceType.present) { + case NR_SRS_ResourceSet__resourceType_PR_aperiodic: + nr_schedule_srs_aperiodic(module_idP, frameP, slotP, srs_resource_set); + break; + case NR_SRS_ResourceSet__resourceType_PR_semi_persistent: + nr_schedule_srs_semi_persistent(module_idP, frameP, slotP, srs_resource_set); + break; + case NR_SRS_ResourceSet__resourceType_PR_periodic: + nr_schedule_srs_periodic(module_idP, frameP, slotP, srs_resource_set); + break; + default: + break; + } + } + } +} \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 3b275ca8a0..065b885a98 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -190,6 +190,8 @@ void nr_schedule_pucch(int Mod_idP, frame_t frameP, sub_frame_t slotP); +void nr_schedule_srs(module_id_t module_idP, frame_t frameP, sub_frame_t slotP); + void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, From 02b17c79d6ce432d0a56086af3f32adbe9855387 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 14 Nov 2021 17:28:24 +0100 Subject: [PATCH 093/883] commit before merge. minor changes for testing --- executables/nr-gnb.c | 7 ++++--- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 2 +- openair1/PHY/TOOLS/time_meas.h | 1 + openair1/PHY/defs_gNB.h | 1 + openair1/SCHED_NR/fapi_nr_l1.c | 4 ++-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 4 +++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 +++++ openair2/LAYER2/NR_MAC_gNB/main.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 ++ openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 12 +++++------- openair2/RRC/NR/rrc_gNB.c | 2 +- 12 files changed, 29 insertions(+), 17 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 439f4691d3..bbb6ee99f4 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -268,13 +268,13 @@ void rx_func(void *param) { // Call the scheduler start_meas(&gNB->ul_indication_stats); - pthread_mutex_lock(&gNB->UL_INFO_mutex); +// pthread_mutex_lock(&gNB->UL_INFO_mutex); gNB->UL_INFO.frame = frame_rx; gNB->UL_INFO.slot = slot_rx; gNB->UL_INFO.module_id = gNB->Mod_id; gNB->UL_INFO.CC_id = gNB->CC_id; gNB->if_inst->NR_UL_indication(&gNB->UL_INFO); - pthread_mutex_unlock(&gNB->UL_INFO_mutex); +// pthread_mutex_unlock(&gNB->UL_INFO_mutex); stop_meas(&gNB->ul_indication_stats); if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) { @@ -342,7 +342,7 @@ static void *process_stats_thread(void *param) { reset_meas(&gNB->ul_indication_stats); reset_meas(&gNB->rx_pusch_stats); reset_meas(&gNB->ulsch_decoding_stats); - + reset_meas(&gNB->schedule_response_stats); wait_sync("process_stats_thread"); while(!oai_exit) @@ -353,6 +353,7 @@ static void *process_stats_thread(void *param) { print_meas(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL); print_meas(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL); print_meas(&gNB->ul_indication_stats, "UL Indication", NULL, NULL); + print_meas(&gNB->schedule_response_stats,"Schedule Response",NULL,NULL); print_meas(&gNB->rx_pusch_stats, "PUSCH inner-receiver", NULL, NULL); print_meas(&gNB->ulsch_decoding_stats, "PUSCH decoding", NULL, NULL); } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index abae2f0cc4..2c5c6d6d4a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -424,7 +424,7 @@ uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx, remaining_re = upper_limit + start_sc - frame_parms->ofdm_symbol_size; upper_limit = frame_parms->ofdm_symbol_size - start_sc; } - if (frame_parms->N_RB_DL&1==0) { + if (0/*(frame_parms->N_RB_DL&1)==0*/) { __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h index f78ea55530..bf6999de70 100644 --- a/openair1/PHY/TOOLS/time_meas.h +++ b/openair1/PHY/TOOLS/time_meas.h @@ -128,6 +128,7 @@ static inline void start_meas(time_stats_t *ts) { } else { ts->in = rdtsc_oai(); } + if ((ts->trials&16383)<10) ts->max=0; } } diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index fb4f9a0092..1db4f6328a 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -868,6 +868,7 @@ typedef struct PHY_VARS_gNB_s { time_stats_t rx_pusch_stats; time_stats_t ul_indication_stats; + time_stats_t schedule_response_stats; time_stats_t ulsch_decoding_stats; time_stats_t ulsch_rate_unmatching_stats; time_stats_t ulsch_ldpc_decoding_stats; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 8f315ba214..f9d90d9204 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -148,7 +148,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ AssertFatal(RC.gNB[Mod_id]!=NULL,"RC.gNB[%d] is null\n",Mod_id); gNB = RC.gNB[Mod_id]; - + start_meas(&gNB->schedule_response_stats); notifiedFIFO_elt_t *res; res = pullTpool(gNB->resp_L1_tx, gNB->threadPool); processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); @@ -248,5 +248,5 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ oai_nfapi_tx_data_req(TX_req); } - + stop_meas(&gNB->schedule_response_stats); } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 63cf6f2f2d..8a69f18b88 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -401,7 +401,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag, int dtx_flag) { - pthread_mutex_lock(&gNB->UL_INFO_mutex); + //pthread_mutex_lock(&gNB->UL_INFO_mutex); int timing_advance_update, cqi; int sync_pos; @@ -526,7 +526,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, gNB->UL_INFO.rx_ind.number_of_pdus++; - pthread_mutex_unlock(&gNB->UL_INFO_mutex); +// pthread_mutex_unlock(&gNB->UL_INFO_mutex); } // Function to fill UL RB mask to be used for N0 measurements diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index b62f8e0282..ebe4758e27 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -393,7 +393,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_ulsch(module_idP, frame, slot); // This schedules the DCI for Downlink and PDSCH - nr_schedule_ue_spec(module_idP, frame, slot); + start_meas(&gNB->schedule_dlsch); + nr_schedule_ue_spec(module_idP, frame, slot); + stop_meas(&gNB->schedule_dlsch); nr_schedule_pucch(module_idP, frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 17241e4d1f..06797f2f2e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1218,6 +1218,7 @@ void nr_schedule_ue_spec(module_id_t module_id, // const int lcid = DL_SCH_LCID_DTCH; const int lcid = sched_ctrl->lcid_to_schedule; int dlsch_total_bytes = 0; + start_meas(&gNB_mac->rlc_data_req); if (sched_ctrl->num_total_bytes > 0) { tbs_size_t len = 0; while (size > 3) { @@ -1231,6 +1232,8 @@ void nr_schedule_ue_spec(module_id_t module_id, /* limit requested number of bytes to what preprocessor specified, or * such that TBS is full */ const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size); + + len = mac_rlc_data_req(module_id, rnti, module_id, @@ -1243,6 +1246,7 @@ void nr_schedule_ue_spec(module_id_t module_id, 0, 0); + LOG_D(NR_MAC, "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n", frame, @@ -1291,6 +1295,7 @@ void nr_schedule_ue_spec(module_id_t module_id, buf += size; dlsch_total_bytes += size; } + stop_meas(&gNB_mac->rlc_data_req); // Add padding header and zero rest out if there is space left if (size > 0) { diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 4b8b36600b..0ea94523d5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -128,6 +128,8 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) } } print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL); + print_meas(&gNB->schedule_dlsch,"dlsch scheduler",NULL,NULL); + print_meas(&gNB->rlc_data_req, "rlc_data_req",NULL,NULL); } diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 81be37872b..007573c4c3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -736,6 +736,8 @@ typedef struct gNB_MAC_INST_s { time_stats_t schedule_dlsch_preprocessor; /// processing time of eNB DLSCH scheduler time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor + /// processing time of rlc_data_req + time_stats_t rlc_data_req; /// processing time of eNB MCH scheduler time_stats_t schedule_mch; /// processing time of eNB ULSCH reception diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index cb5bef5ab0..4d04f4e0c8 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -266,13 +266,11 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { dump_dl(sched_info); #endif - if (ifi->NR_Schedule_response) { - AssertFatal(ifi->NR_Schedule_response!=NULL, - "nr_schedule_response is null (mod %d, cc %d)\n", - module_id, - CC_id); - ifi->NR_Schedule_response(sched_info); - } + AssertFatal(ifi->NR_Schedule_response!=NULL, + "nr_schedule_response is null (mod %d, cc %d)\n", + module_id, + CC_id); + ifi->NR_Schedule_response(sched_info); LOG_D(PHY,"NR_Schedule_response: SFN_SF:%d%d dl_pdus:%d\n", sched_info->frame, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 95852c8ccb..5a6e679c60 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -800,7 +800,7 @@ rrc_gNB_generate_defaultRRCReconfiguration( DRB_config->pdcp_Config->moreThanOneRLC = NULL; DRB_config->pdcp_Config->t_Reordering = calloc(1, sizeof(*DRB_config->pdcp_Config->t_Reordering)); - *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0; + *DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms100; DRB_config->pdcp_Config->ext1 = NULL; ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); From 3d454a45a338390dc02733f285e18dc212b0ad9b Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 14 Nov 2021 20:09:21 +0100 Subject: [PATCH 094/883] allow max_ul_frame_inactivity=0. This means 1/2 frame. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 9a6fa32b5f..2d117a3131 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -869,7 +869,7 @@ bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t * (2) there is a scheduling request * (3) or we did not schedule it in more than 10 frames */ const bool has_data = sched_ctrl->estimated_ul_buffer > sched_ctrl->sched_ul_bytes; - const bool high_inactivity = diff >= nrmac->ulsch_max_frame_inactivity * n; + const bool high_inactivity = diff >= (nrmac->ulsch_max_frame_inactivity>0 ? (nrmac->ulsch_max_frame_inactivity * n) : (n/2)); LOG_D(NR_MAC, "%4d.%2d UL inactivity %d slots has_data %d SR %d\n", frame, From 7738462b0c8574c5a565caf7c265760c22e0d992 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 07:44:54 +0000 Subject: [PATCH 095/883] Add missing stats after merge --- executables/nr-gnb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 491daec565..8e1b9c6765 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -339,6 +339,7 @@ static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) { stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->rx_pusch_stats, "PUSCH inner-receiver", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->ulsch_decoding_stats, "PUSCH decoding", NULL, NULL, output+stroff); + stroff += print_meas_log(&gNB->schedule_response_stats, "Schedule Response",NULL,NULL, output+stroff); if (ru->feprx) stroff += print_meas_log(&ru->ofdm_demod_stats,"feprx",NULL,NULL, output+stroff); if (ru->feptx_ofdm) { From 260eb84633e436bd78463f993b231a36a165a0c4 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 08:00:40 +0000 Subject: [PATCH 096/883] Schedule ulsch in all slots for SA --- .../conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 0e8466e2df..3a3d083130 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -255,7 +255,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; # pusch_TargetSNRx10 = 200; # pucch_TargetSNRx10 = 150; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index de6bafc9f7..a975b02154 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -232,7 +232,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index abc64b6e46..a24139025c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -232,7 +232,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; #pusch_TargetSNRx10 = 150; #pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 83b39b85ec..6e51487b83 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -232,7 +232,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); From bc9eeef2f8357293a283536224bc7ecb7c46536c Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 08:21:53 +0000 Subject: [PATCH 097/883] Put back a pthread_mutex_lock for UL_INFO_mutex --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 270123aeda..1685e206ae 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -401,7 +401,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag, int dtx_flag) { - //pthread_mutex_lock(&gNB->UL_INFO_mutex); + pthread_mutex_lock(&gNB->UL_INFO_mutex); NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0]; NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; @@ -526,7 +526,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, gNB->UL_INFO.rx_ind.number_of_pdus++; -// pthread_mutex_unlock(&gNB->UL_INFO_mutex); + pthread_mutex_unlock(&gNB->UL_INFO_mutex); } // Function to fill UL RB mask to be used for N0 measurements From b218f55a8259420d73704103bec6ccd40e7d40ab Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Nov 2021 11:27:17 +0100 Subject: [PATCH 098/883] setting max mcs to the one reported by CSI --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 6 ++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index aca1bccd4a..f6c7a97878 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -701,7 +701,7 @@ void pf_dl(module_id_t module_id, continue; /* Calculate coeff */ - set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); + set_dl_mcs(sched_pdsch,sched_ctrl,&mac->dl_max_mcs,ps->mcsTableIdx); sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id); layers[UE_id] = set_dl_nrOfLayers(sched_ctrl); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index d9961108e0..8326dac589 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -147,6 +147,7 @@ uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl) { void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, + uint8_t *target_mcs, uint8_t mcs_table_idx) { if (sched_ctrl->set_mcs) { @@ -180,14 +181,11 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, R = nr_get_code_rate_dl(i, mcs_table_idx); Qm = nr_get_Qm_dl(i, mcs_table_idx); if ((Qm == target_qm) && (target_coderate <= R)) { - sched_pdsch->mcs = i; + *target_mcs = i; break; } } } - else // default value - sched_pdsch->mcs = 9; - sched_ctrl->set_mcs = FALSE; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index c33586741d..93b27ae7ac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -429,6 +429,7 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps); void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, NR_UE_sched_ctrl_t *sched_ctrl, + uint8_t *target_mcs, uint8_t mcs_table_idx); uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl); From 55d753bb8eb7adff08dbcea80b59408502923ffa Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 15 Nov 2021 11:10:55 +0000 Subject: [PATCH 099/883] Revert "Create gNB_scheduler_SRS.c" This reverts commit 68e968e5566f3ced06d9499e86d9d0cdc9361c7d. --- cmake_targets/CMakeLists.txt | 1 - .../nfapi/public_inc/fapi_nr_ue_interface.h | 4 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 - .../LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c | 93 ------------------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 - 5 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 6cf6f7128e..67f65b6848 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2120,7 +2120,6 @@ set (MAC_NR_SRC ${NR_GNB_MAC_DIR}/gNB_scheduler_phytest.c ${NR_GNB_MAC_DIR}/gNB_scheduler_uci.c ${NR_GNB_MAC_DIR}/gNB_scheduler_RA.c - ${NR_GNB_MAC_DIR}/gNB_scheduler_SRS.c ) 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 d59ddf9d82..32bbae1f5f 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 @@ -346,7 +346,7 @@ typedef struct { uint8_t time_start_position; // Starting position in the time domain l_0 [3GPP TS 38.211, Sec 6.4.1.4.1], Note: the MAC undertakes the translation from startPosition to l_0, Value: 0 --> 13 uint8_t config_index; // SRS bandwidth config index C_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 63 uint16_t sequence_id; // SRS sequence ID n_SRS_ID [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 1023 - uint8_t bandwidth_index; // SRS bandwidth index B_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 + uint8_t bandwidth_index; // SRS bandwidth index B_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 uint8_t comb_size; // Transmission comb size K_TC [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 = comb size 2, 1 = comb size 4, 2 = comb size 8 (Rel16) uint8_t comb_offset; // Transmission comb offset K'_TC[3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 1 (combSize = 0), Value: 0 --> 3 (combSize = 1), Value: 0 --> 7 (combSize = 2) uint8_t cyclic_chift; // Cyclic shift n_CS_SRS [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 7 (combSize = 0), Value: 0 --> 11 (combSize = 1), Value: 0 --> 5 (combSize = 2) @@ -367,7 +367,7 @@ typedef struct { fapi_nr_ul_config_prach_pdu prach_config_pdu; fapi_nr_ul_config_pucch_pdu pucch_config_pdu; nfapi_nr_ue_pusch_pdu_t pusch_config_pdu; - fapi_nr_ul_config_srs_pdu srs_config_pdu; + fapi_nr_ul_config_srs_pdu srs_config_pdu; }; } fapi_nr_ul_config_request_pdu_t; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 90664770fa..b62f8e0282 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -397,8 +397,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_pucch(module_idP, frame, slot); - nr_schedule_srs(module_idP, frame, slot); - stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c deleted file mode 100644 index f1123e582b..0000000000 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_SRS.c +++ /dev/null @@ -1,93 +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 gNB_scheduler_SRS.c - * \brief primitives used for sounding reference signal - * \date 2021 - */ - -#include "platform_types.h" - -/* MAC */ -#include "nr_mac_gNB.h" -#include "NR_MAC_COMMON/nr_mac_extern.h" - -/* Utils */ -#include "common/utils/LOG/vcd_signal_dumper.h" - -void nr_schedule_srs_aperiodic(module_id_t module_idP, - frame_t frameP, - sub_frame_t slotP, - NR_SRS_ResourceSet_t *srs_resource_set) { - LOG_W(NR_PHY, "Aperiodic SRS scheduling is not implemented yet!\n"); -} - -void nr_schedule_srs_semi_persistent(module_id_t module_idP, - frame_t frameP, - sub_frame_t slotP, - NR_SRS_ResourceSet_t *srs_resource_set) { - LOG_W(NR_PHY, "Semi-persistent SRS scheduling is not implemented yet!\n"); -} - -void nr_schedule_srs_periodic(module_id_t module_idP, - frame_t frameP, - sub_frame_t slotP, - NR_SRS_ResourceSet_t *srs_resource_set) { - LOG_W(NR_PHY, "Periodic SRS scheduling is not implemented yet!\n"); -} - -void nr_schedule_srs(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) { - - gNB_MAC_INST *mac = RC.nrmac[module_idP]; - - for (int UE_id = 0; UE_id < MAX_MOBILES_PER_GNB; UE_id++) { - NR_CellGroupConfig_t *cg = mac->UE_info.CellGroup[UE_id]; - NR_BWP_UplinkDedicated_t *ubwpd = NULL; - if (cg && - cg->spCellConfig && - cg->spCellConfig->spCellConfigDedicated && - cg->spCellConfig->spCellConfigDedicated->uplinkConfig && - cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) { - ubwpd = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP; - } else { - continue; - } - - NR_SRS_Config_t *srs_Config = ubwpd->srs_Config->choice.setup; - - for(int rs = 0; rs < srs_Config->srs_ResourceSetToAddModList->list.count; rs++) { - NR_SRS_ResourceSet_t *srs_resource_set = srs_Config->srs_ResourceSetToAddModList->list.array[rs]; - switch (srs_resource_set->resourceType.present) { - case NR_SRS_ResourceSet__resourceType_PR_aperiodic: - nr_schedule_srs_aperiodic(module_idP, frameP, slotP, srs_resource_set); - break; - case NR_SRS_ResourceSet__resourceType_PR_semi_persistent: - nr_schedule_srs_semi_persistent(module_idP, frameP, slotP, srs_resource_set); - break; - case NR_SRS_ResourceSet__resourceType_PR_periodic: - nr_schedule_srs_periodic(module_idP, frameP, slotP, srs_resource_set); - break; - default: - break; - } - } - } -} \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 065b885a98..3b275ca8a0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -190,8 +190,6 @@ void nr_schedule_pucch(int Mod_idP, frame_t frameP, sub_frame_t slotP); -void nr_schedule_srs(module_id_t module_idP, frame_t frameP, sub_frame_t slotP); - void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, From 7c469da2ad8801c5149eef33c9363b8011b22a7e Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Nov 2021 12:35:24 +0100 Subject: [PATCH 100/883] handle tdd period in max ulsch inactivity --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 2d117a3131..b51014021b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -863,13 +863,22 @@ bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t const NR_UE_sched_ctrl_t *sched_ctrl = &nrmac->UE_info.UE_sched_ctrl[UE_id]; const int last_ul_sched = sched_ctrl->last_ul_frame * n + sched_ctrl->last_ul_slot; + const NR_TDD_UL_DL_Pattern_t *tdd = + scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + int num_slots_per_period; + int tdd_period_len[8] = {500,625,1000,1250,2000,2500,5000,10000}; + if (tdd) + num_slots_per_period = n*tdd_period_len[tdd->dl_UL_TransmissionPeriodicity]/10000; + else + num_slots_per_period = n; + const int diff = (now - last_ul_sched + 1024 * n) % (1024 * n); /* UE is to be scheduled if * (1) we think the UE has more bytes awaiting than what we scheduled * (2) there is a scheduling request * (3) or we did not schedule it in more than 10 frames */ const bool has_data = sched_ctrl->estimated_ul_buffer > sched_ctrl->sched_ul_bytes; - const bool high_inactivity = diff >= (nrmac->ulsch_max_frame_inactivity>0 ? (nrmac->ulsch_max_frame_inactivity * n) : (n/2)); + const bool high_inactivity = diff >= (nrmac->ulsch_max_frame_inactivity>0 ? (nrmac->ulsch_max_frame_inactivity * n) : num_slots_per_period); LOG_D(NR_MAC, "%4d.%2d UL inactivity %d slots has_data %d SR %d\n", frame, From 4f783e83b6a34d9a9c918cf44ec6f50e91d5c48b Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 15 Nov 2021 11:41:10 +0000 Subject: [PATCH 101/883] Set SRS as periodic --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 4 +-- openair2/RRC/NR/MESSAGES/asn1_msg.c | 36 ++++++++++++++----- 2 files changed, 29 insertions(+), 11 deletions(-) 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 32bbae1f5f..d59ddf9d82 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 @@ -346,7 +346,7 @@ typedef struct { uint8_t time_start_position; // Starting position in the time domain l_0 [3GPP TS 38.211, Sec 6.4.1.4.1], Note: the MAC undertakes the translation from startPosition to l_0, Value: 0 --> 13 uint8_t config_index; // SRS bandwidth config index C_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 63 uint16_t sequence_id; // SRS sequence ID n_SRS_ID [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 1023 - uint8_t bandwidth_index; // SRS bandwidth index B_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 + uint8_t bandwidth_index; // SRS bandwidth index B_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 uint8_t comb_size; // Transmission comb size K_TC [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 = comb size 2, 1 = comb size 4, 2 = comb size 8 (Rel16) uint8_t comb_offset; // Transmission comb offset K'_TC[3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 1 (combSize = 0), Value: 0 --> 3 (combSize = 1), Value: 0 --> 7 (combSize = 2) uint8_t cyclic_chift; // Cyclic shift n_CS_SRS [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 7 (combSize = 0), Value: 0 --> 11 (combSize = 1), Value: 0 --> 5 (combSize = 2) @@ -367,7 +367,7 @@ typedef struct { fapi_nr_ul_config_prach_pdu prach_config_pdu; fapi_nr_ul_config_pucch_pdu pucch_config_pdu; nfapi_nr_ue_pusch_pdu_t pusch_config_pdu; - fapi_nr_ul_config_srs_pdu srs_config_pdu; + fapi_nr_ul_config_srs_pdu srs_config_pdu; }; } fapi_nr_ul_config_request_pdu_t; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 0d95fce930..f057e96e34 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1112,13 +1112,21 @@ void fill_initial_SpCellConfig(rnti_t rnti, *srs_resset0_id=0; ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list,srs_resset0_id); srs_Config->srs_ResourceToReleaseList=NULL; - srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic; - srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic)); - srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1; - srs_resset0->resourceType.choice.aperiodic->csi_RS=NULL; - srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset)); - *srs_resset0->resourceType.choice.aperiodic->slotOffset=2; - srs_resset0->resourceType.choice.aperiodic->ext1=NULL; + + if(0) { + srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic; + srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic)); + srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1; + srs_resset0->resourceType.choice.aperiodic->csi_RS=NULL; + srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset)); + *srs_resset0->resourceType.choice.aperiodic->slotOffset=2; + srs_resset0->resourceType.choice.aperiodic->ext1=NULL; + } else { + srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; + srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic)); + srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL; + } + srs_resset0->usage=NR_SRS_ResourceSet__usage_codebook; srs_resset0->alpha = calloc(1,sizeof(*srs_resset0->alpha)); *srs_resset0->alpha = NR_Alpha_alpha1; @@ -1146,8 +1154,16 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_res0->freqHopping.b_SRS=0; srs_res0->freqHopping.b_hop=0; srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither; - srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; - srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); + + if(0) { + srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; + srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); + } else { + srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; + srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; + } + srs_res0->sequenceId=40; srs_res0->spatialRelationInfo=calloc(1,sizeof(*srs_res0->spatialRelationInfo)); srs_res0->spatialRelationInfo->servingCellId=NULL; @@ -1155,6 +1171,8 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_res0->spatialRelationInfo->referenceSignal.choice.csi_RS_Index=0; ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceToAddModList->list,srs_res0); + xer_fprint(stdout, &asn_DEF_NR_SetupRelease_SRS_Config, (const void*)initialUplinkBWP->srs_Config); + // configure Scheduling request // 40 slot period pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList)); From dd1f8fbaeef5a05c03ce253169ffeab29d88dbf1 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 12 Nov 2021 16:39:16 +0000 Subject: [PATCH 102/883] Update SA default configuration files --- .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 131 +++---- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 323 ++++++++++++++++++ .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 131 +++---- 3 files changed, 455 insertions(+), 130 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index c8c062c73a..a2fb971719 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -1,4 +1,4 @@ -Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +Active_gNBs = ( "gNB-OAI"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; @@ -7,7 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; - gNB_name = "gNB-Eurecom-5GNRBox"; + gNB_name = "gNB-OAI"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; @@ -204,7 +204,7 @@ gNBs = }; - ////////// MME parameters: + ////////// AMF parameters: amf_ip_address = ( { ipv4 = "192.168.70.132"; ipv6 = "192:168:30::17"; active = "yes"; @@ -226,60 +226,61 @@ gNBs = ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 150; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 4; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [41]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 114; - eNB_instances = [0]; - #beamforming 1x4 matrix: - bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; - clock_src = "internal"; - } +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [41]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} ); THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} ); rfsimulator : { - serveraddr = "server"; - serverport = "4043"; - options = (); #("saviq"); or/and "chanmod" - modelname = "AWGN"; - IQfile = "/tmp/rfsimulator.iqs"; + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; }; security = { @@ -299,25 +300,25 @@ security = { drb_integrity = "no"; }; - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf new file mode 100644 index 0000000000..abc64b6e46 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -0,0 +1,323 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; # 641280 + dl_frequencyBand = 78; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; # 640008 + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -70; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + #pusch_TargetSNRx10 = 150; + #pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; + #pucch0_dtx_threshold = 120; +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + sf_extension = 0; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.2,clock_source=internal,time_source=internal" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index c525fb079c..c97fc109ef 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -1,4 +1,4 @@ -Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +Active_gNBs = ( "gNB-OAI"); # Asn1_verbosity, choice in: none, info, annoying Asn1_verbosity = "none"; @@ -7,7 +7,7 @@ gNBs = { ////////// Identification parameters: gNB_ID = 0xe00; - gNB_name = "gNB-Eurecom-5GNRBox"; + gNB_name = "gNB-OAI"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; @@ -204,7 +204,7 @@ gNBs = }; - ////////// MME parameters: + ////////// AMF parameters: amf_ip_address = ( { ipv4 = "192.168.70.132"; ipv6 = "192:168:30::17"; active = "yes"; @@ -226,60 +226,61 @@ gNBs = ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 150; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 4; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 114; - eNB_instances = [0]; - #beamforming 1x4 matrix: - bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; - clock_src = "internal"; - } +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} ); THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} ); rfsimulator : { - serveraddr = "server"; - serverport = "4043"; - options = (); #("saviq"); or/and "chanmod" - modelname = "AWGN"; - IQfile = "/tmp/rfsimulator.iqs"; + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; }; security = { @@ -299,25 +300,25 @@ security = { drb_integrity = "no"; }; - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; From 04662813802900817dfe16004a0924d98470f263 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 15 Nov 2021 16:07:11 +0100 Subject: [PATCH 103/883] Update conf file for band 66 according to default SA mode scenario - conf file now takes into account the basic SA scenario with gNB and CN in the same PC - Network parameters and gNB interfaces have been updated accordingly --- .../gnb.sa.band66.fr1.106PRB.usrpn300.conf | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf index 0b0a46a1f1..d74bff4656 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -10,7 +10,7 @@ gNBs = gNB_name = "gNB-Eurecom-5GNRBox"; // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 0xa000; + tracking_area_code = 1; plmn_list = ({ mcc = 208; mnc = 99; @@ -22,7 +22,7 @@ gNBs = }, { sst = 1; - sd = 0x1; // 0 false, else true + sd = 0x112233; // 0 false, else true } ); @@ -217,10 +217,10 @@ gNBs = 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_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; @@ -282,6 +282,23 @@ rfsimulator : IQfile = "/tmp/rfsimulator.iqs"; }; +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + log_config : { global_log_level ="info"; From 7c941435ad6fccde51cb219ae12a09729e8d6369 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 15 Nov 2021 16:06:28 +0100 Subject: [PATCH 104/883] Bugfix wrong configuration of initial ack nack timing in FDD mode --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ef3ac0d5f5..d202145864 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1310,8 +1310,9 @@ int nr_acknack_scheduling(int mod_id, AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); - pucch->frame = frame; - pucch->ul_slot = tdd ? first_ul_slot_tdd : slot + minfbtime; + const int s = tdd ? first_ul_slot_tdd : slot + minfbtime; + pucch->frame = (s < n_slots_frame - 1) ? frame : (frame + 1) % 1024; + pucch->ul_slot = s % n_slots_frame; } // Find the right timing_indicator value. From 12700a17277b27f93a2ec94136add843461c9e0a Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 15 Nov 2021 16:09:38 +0100 Subject: [PATCH 105/883] Updated band 78 conf file for SA mode --- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 9c0427789d..82d478769c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -36,6 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; sib1_tda = 0; + min_rxtxtime_pdsch = 6; pdcch_ConfigSIB1 = ( { From 174ee99d3c97f0cc7f45f87f6b01785f7e839afd Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 15 Nov 2021 16:47:56 +0100 Subject: [PATCH 106/883] fix in dlsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 117b5339b6..f0c1d6886d 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -268,11 +268,6 @@ void nr_dlsim_preprocessor(module_id_t module_id, NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - ps->nrOfLayers = g_nrOfLayers; - - int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ? - NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[0], sched_ctrl->active_bwp, @@ -289,7 +284,6 @@ void nr_dlsim_preprocessor(module_id_t module_id, /* the following might override the table that is mandated by RRC * configuration */ ps->mcsTableIdx = g_mcsTableIdx; - ps->nrOfLayers = g_nrOfLayers; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); From bd9b730383706152c1d7ecff9f90fd33e103e995 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 16:36:34 +0000 Subject: [PATCH 107/883] Change variable types in statistics to accommodate more bytes and to avoid negative values --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 6 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- openair2/LAYER2/NR_MAC_gNB/main.c | 30 +++++++++---------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 24 +++++++-------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 185f35562b..f11b0148eb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -420,9 +420,9 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t return old_mcs; // no update // last update is longer than x frames ago - const int dtx = stats->dlsch_rounds[0] - bler_stats->dlsch_rounds[0]; - const int dretx = stats->dlsch_rounds[1] - bler_stats->dlsch_rounds[1]; - const int dretx2 = stats->dlsch_rounds[2] - bler_stats->dlsch_rounds[2]; + const int dtx = (int)(stats->dlsch_rounds[0] - bler_stats->dlsch_rounds[0]); + const int dretx = (int)(stats->dlsch_rounds[1] - bler_stats->dlsch_rounds[1]); + const int dretx2 = (int)(stats->dlsch_rounds[2] - bler_stats->dlsch_rounds[2]); const float bler_window = dtx > 0 ? (float) dretx / dtx : bler_stats->bler; const float rd2_bler_wnd = dtx > 0 ? (float) dretx2 / dtx : bler_stats->rd2_bler; bler_stats->bler = BLER_FILTER * bler_stats->bler + (1 - BLER_FILTER) * bler_window; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 55d38889a4..32b2f47101 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -582,7 +582,7 @@ static void handle_dl_harq(module_id_t mod_id, harq->ndi ^= 1; NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id]; stats->dlsch_errors++; - LOG_D(NR_MAC, "retransmission error for UE %d (total %d)\n", UE_id, stats->dlsch_errors); + LOG_D(NR_MAC, "retransmission error for UE %d (total %"PRIu64")\n", UE_id, stats->dlsch_errors); } else { add_tail_nr_list(&UE_info->UE_sched_ctrl[UE_id].retrans_dl_harq, harq_pid); harq->round++; diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 0ea94523d5..bfc2e39186 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -94,36 +94,36 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) avg_rsrp, stats->num_rsrp_meas); - stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, pucch0_DTX %d, BLER %.5f MCS %d\n", - UE_id, - stats->dlsch_rounds[0], stats->dlsch_rounds[1], - stats->dlsch_rounds[2], stats->dlsch_rounds[3], - stats->dlsch_errors, - stats->pucch0_DTX, - sched_ctrl->dl_bler_stats.bler, - sched_ctrl->dl_bler_stats.mcs); + stroff+=sprintf(output+stroff,"UE %d: dlsch_rounds %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64", dlsch_errors %"PRIu64", pucch0_DTX %d, BLER %.5f MCS %d\n", + UE_id, + stats->dlsch_rounds[0], stats->dlsch_rounds[1], + stats->dlsch_rounds[2], stats->dlsch_rounds[3], + stats->dlsch_errors, + stats->pucch0_DTX, + sched_ctrl->dl_bler_stats.bler, + sched_ctrl->dl_bler_stats.mcs); stats->num_rsrp_meas = 0; stats->cumul_rsrp = 0 ; - stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %d\n", UE_id, stats->dlsch_total_bytes); - stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d\n", + stroff+=sprintf(output+stroff,"UE %d: dlsch_total_bytes %"PRIu64"\n", UE_id, stats->dlsch_total_bytes); + stroff+=sprintf(output+stroff,"UE %d: ulsch_rounds %"PRIu64"/%"PRIu64"/%"PRIu64"/%"PRIu64", ulsch_DTX %d, ulsch_errors %"PRIu64"\n", UE_id, stats->ulsch_rounds[0], stats->ulsch_rounds[1], stats->ulsch_rounds[2], stats->ulsch_rounds[3], stats->ulsch_DTX, stats->ulsch_errors); stroff+=sprintf(output+stroff, - "UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d\n", + "UE %d: ulsch_total_bytes_scheduled %"PRIu64", ulsch_total_bytes_received %"PRIu64"\n", UE_id, stats->ulsch_total_bytes_scheduled, stats->ulsch_total_bytes_rx); for (int lc_id = 0; lc_id < 63; lc_id++) { if (stats->lc_bytes_tx[lc_id] > 0) { - stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %"PRIu64" bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); + LOG_D(NR_MAC, "UE %d: LCID %d: %"PRIu64" bytes TX\n", UE_id, lc_id, stats->lc_bytes_tx[lc_id]); } if (stats->lc_bytes_rx[lc_id] > 0) { - stroff+=sprintf(output+stroff, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); - LOG_D(NR_MAC, "UE %d: LCID %d: %d bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); + stroff+=sprintf(output+stroff, "UE %d: LCID %d: %"PRIu64" bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); + LOG_D(NR_MAC, "UE %d: LCID %d: %"PRIu64" bytes RX\n", UE_id, lc_id, stats->lc_bytes_rx[lc_id]); } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 007573c4c3..4072c3ded7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -427,7 +427,7 @@ typedef struct NR_DL_bler_stats { float bler; float rd2_bler; uint8_t mcs; - int dlsch_rounds[8]; + uint64_t dlsch_rounds[8]; } NR_DL_bler_stats_t; // @@ -618,19 +618,19 @@ typedef struct { } NRUEcontext_t; typedef struct { - int lc_bytes_tx[64]; - int lc_bytes_rx[64]; - int dlsch_rounds[8]; - int dlsch_errors; - int dlsch_total_bytes; + uint64_t lc_bytes_tx[64]; + uint64_t lc_bytes_rx[64]; + uint64_t dlsch_rounds[8]; + uint64_t dlsch_errors; + uint64_t dlsch_total_bytes; int dlsch_current_bytes; - int ulsch_rounds[8]; - int ulsch_errors; - int ulsch_DTX; - int ulsch_total_bytes_scheduled; - int ulsch_total_bytes_rx; + uint64_t ulsch_rounds[8]; + uint64_t ulsch_errors; + uint32_t ulsch_DTX; + uint64_t ulsch_total_bytes_scheduled; + uint64_t ulsch_total_bytes_rx; int ulsch_current_bytes; - int pucch0_DTX; + uint32_t pucch0_DTX; int cumul_rsrp; uint8_t num_rsrp_meas; } NR_mac_stats_t; From 0b88c164277eec2d13f5ebb28e08bea5774cb60f Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Nov 2021 16:39:36 +0000 Subject: [PATCH 108/883] Add T support for GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA --- common/utils/T/T_messages.txt | 4 ++++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index cd66be73f5..192bf8cc37 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -155,6 +155,10 @@ ID = GNB_MAC_DL_RAR_PDU_WITH_DATA DESC = NR MAC downlink PDU for RAR GROUP = ALL:MAC:GNB:WIRESHARK FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data +ID = GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA + DESC = NR MAC downlink retransmitted PDU for an UE + GROUP = ALL:MAC:GNB:WIRESHARK + FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : int,round : buffer,data #RLC logs ID = ENB_RLC_DL diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index f11b0148eb..9ef8009926 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1198,6 +1198,9 @@ void nr_schedule_ue_spec(module_id_t module_id, "UE %d mismatch between scheduled TBS and buffered TB for HARQ PID %d\n", UE_id, current_harq_pid); + + T(T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti), + T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->tb, TBS)); } else { /* initial transmission */ LOG_D(NR_MAC, "[%s] Initial HARQ transmission in %d.%d\n", __FUNCTION__, frame, slot); From 8c20f69aebac8e3747261fa10158b3edb93bb5d5 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 15 Nov 2021 17:27:42 +0000 Subject: [PATCH 109/883] Compute slot and frame for SRS transmission at UE --- openair1/PHY/impl_defs_nr.h | 4 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 61 ++++++++++++++++++++- openair2/RRC/NR/MESSAGES/asn1_msg.c | 1 + 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/impl_defs_nr.h b/openair1/PHY/impl_defs_nr.h index 59d8216679..87d193b4a3 100644 --- a/openair1/PHY/impl_defs_nr.h +++ b/openair1/PHY/impl_defs_nr.h @@ -211,10 +211,10 @@ typedef enum { srs_sl2560 = 16 } SRS_Periodicity_t; -#define NB_SRS_PERIOD (17) +#define NB_SRS_PERIOD (18) static const uint16_t srs_period[NB_SRS_PERIOD] -= { 1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560} += { 0, 1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 160, 320, 640, 1280, 2560} ; /// SRS_Resource of SRS_Config information element from 38.331 RRC specifications diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index cfa8b88f32..08d77bf156 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -878,6 +878,62 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, } +// Periodic SRS scheduling +void nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slot) { + + NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); + + NR_SRS_Config_t *srs_config = NULL; + if (mac->cg && + mac->cg->spCellConfig && + mac->cg->spCellConfig->spCellConfigDedicated && + mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig && + mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) { + srs_config = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->srs_Config->choice.setup; + } else { + return; + } + + for(int rs = 0; rs < srs_config->srs_ResourceSetToAddModList->list.count; rs++) { + + // Find periodic resource set + NR_SRS_ResourceSet_t *srs_resource_set = srs_config->srs_ResourceSetToAddModList->list.array[rs]; + if(srs_resource_set->resourceType.present != NR_SRS_ResourceSet__resourceType_PR_periodic) { + continue; + } + + // Find the corresponding srs resource + NR_SRS_Resource_t *srs_resource = NULL; + for(int r1 = 0; r1 < srs_resource_set->srs_ResourceIdList->list.count; r1++) { + for (int r2 = 0; r2 < srs_config->srs_ResourceToAddModList->list.count; r2++) { + if ((*srs_resource_set->srs_ResourceIdList->list.array[r1] == srs_config->srs_ResourceToAddModList->list.array[r2]->srs_ResourceId) && + (srs_config->srs_ResourceToAddModList->list.array[r2]->resourceType.present == NR_SRS_Resource__resourceType_PR_periodic)) { + srs_resource = srs_config->srs_ResourceToAddModList->list.array[r2]; + break; + } + } + } + + if(srs_resource == NULL) { + continue; + } + + int scs = mac->ULbwp[0] ? + mac->ULbwp[0]->bwp_Common->genericParameters.subcarrierSpacing : + mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing; + + uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; + uint16_t offset = srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40; + + int n_slots_frame = nr_slots_per_frame[scs]; + + // Check if UE should transmit the SRS + if((frame*n_slots_frame+slot-offset)%period == 0) { + LOG_W(NR_MAC, "(%d.%d) Periodic SRS scheduling is not implemented yet!\n", frame, slot); + } + } +} + // Performs : // 1. TODO: Call RRC for link status return to PHY // 2. TODO: Perform SR/BSR procedures for scheduling feedback @@ -1020,12 +1076,15 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in } if (dl_info) { - return (CONNECTION_OK); + return (UE_CONNECTION_OK); } module_id_t mod_id = ul_info->module_id; frame_t txFrameP = ul_info->frame_tx; slot_t txSlotP = ul_info->slot_tx; + // Periodic SRS scheduling + nr_ue_periodic_srs_scheduling(mod_id, txFrameP, txSlotP); + // Handle the SR/BSR procedures per subframe NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); uint8_t gNB_indexP=0; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index f057e96e34..91a9e30427 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1162,6 +1162,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 9; // 9 is an uplink slot } srs_res0->sequenceId=40; From 59e727049d2b16cdacb53e1eaaba3df1602929ff Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 16 Nov 2021 12:04:00 +0100 Subject: [PATCH 110/883] bugfix in dmrs_ports handling at UE for pdsch --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 7 +++---- openair1/SIMULATION/NR_PHY/dlsim.c | 3 +-- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 14 +++++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 76486fb86b..8bf88e6200 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -768,12 +768,13 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ uint16_t s1 = dlsch0_harq->nb_symbols; bool is_SI = dlsch0->rnti_type == _SI_RNTI_; - LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n", - ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos); + LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x, Nl %d\n", + ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos, dlsch0_harq->Nl); for (m = s0; m < (s0 +s1); m++) { if (dlsch0_harq->dlDmrsSymbPos & (1 << m)) { for (uint8_t aatx=0; aatxNl; aatx++) {//for MIMO Config: it shall loop over no_layers + LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_slot_rx,m); nr_pdsch_channel_estimation(ue, proc, gNB_id, @@ -784,7 +785,6 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ BWPStart, ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12, pdsch_nb_rb); - LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_slot_rx,m); #if 0 ///LOG_M: the channel estimation int nr_frame_rx = proc->frame_rx; @@ -1801,7 +1801,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, // do procedures for C-RNTI int ret_pdsch = 0; if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) { - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_IN); ret_pdsch = nr_ue_pdsch_procedures(ue, proc, diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index f0c1d6886d..00f2b9905f 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1197,9 +1197,8 @@ int main(int argc, char **argv) } nr_ue_dcireq(&dcireq); //to be replaced with function pointer later - UE_harq_process->Nl = g_nrOfLayers; nr_ue_scheduled_response(&scheduled_response); - + phy_procedures_nrUE_RX(UE, &UE_proc, 0, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 544bc66250..59f07c70e1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1135,7 +1135,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_1[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_1[dci->antenna_ports.val][1] + (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_1[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_1[dci->antenna_ports.val][4]<<3)); } if ((dmrs_type == NULL) && (max_length != NULL)){ @@ -1144,7 +1144,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][6]<<5) + @@ -1156,7 +1156,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6]<<5) + @@ -1171,7 +1171,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][6]<<5)); @@ -1180,7 +1180,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6]<<5)); @@ -1192,7 +1192,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][6]<<5) + @@ -1208,7 +1208,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][0]; dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1] + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<1) + - (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<2) + + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4]<<3) + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5]<<4) + (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6]<<5) + From dfec275b1c8a6f3497f6492a9cd983b7722a793c Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 16 Nov 2021 18:12:57 +0000 Subject: [PATCH 111/883] Send srs_config_pdu from MAC to PHY --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 2 +- openair1/PHY/INIT/nr_init_ue.c | 3 + openair1/PHY/defs_nr_UE.h | 5 + openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 8 ++ openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 94 +++++++++++++++++-- 5 files changed, 101 insertions(+), 11 deletions(-) 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 d59ddf9d82..78502d7d7e 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 @@ -349,7 +349,7 @@ typedef struct { uint8_t bandwidth_index; // SRS bandwidth index B_SRS [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 uint8_t comb_size; // Transmission comb size K_TC [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 = comb size 2, 1 = comb size 4, 2 = comb size 8 (Rel16) uint8_t comb_offset; // Transmission comb offset K'_TC[3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 1 (combSize = 0), Value: 0 --> 3 (combSize = 1), Value: 0 --> 7 (combSize = 2) - uint8_t cyclic_chift; // Cyclic shift n_CS_SRS [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 7 (combSize = 0), Value: 0 --> 11 (combSize = 1), Value: 0 --> 5 (combSize = 2) + uint8_t cyclic_shift; // Cyclic shift n_CS_SRS [3GPP TS 38.211, Sec 6.4.1.4.2], Value: 0 --> 7 (combSize = 0), Value: 0 --> 11 (combSize = 1), Value: 0 --> 5 (combSize = 2) uint8_t frequency_position; // Frequency domain position n_RRC [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 67 uint16_t frequency_shift; // Frequency domain shift n_shift [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 268 uint8_t frequency_hopping; // Frequency hopping b_hop [3GPP TS 38.211, Sec 6.4.1.4.3], Value: 0 --> 3 diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b60e77e814..76ab0d7403 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -136,6 +136,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, NR_UE_COMMON *const common_vars = &ue->common_vars; NR_UE_PBCH **const pbch_vars = ue->pbch_vars; NR_UE_PRACH **const prach_vars = ue->prach_vars; + NR_UE_SRS **const srs_vars = ue->srs_vars; + int i,j,k,l,slot,symb,q; int gNB_id; int th_id; @@ -318,6 +320,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, prach_vars[gNB_id] = (NR_UE_PRACH *)malloc16_clear(sizeof(NR_UE_PRACH)); pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH)); + srs_vars[gNB_id] = (NR_UE_SRS *)malloc16_clear(sizeof(NR_UE_SRS)); if (abstraction_flag == 0) { for (th_id=0; th_idprach_vars[gNB_id]->prach_pdu), (void*)prach_config_pdu, sizeof(fapi_nr_ul_config_prach_pdu)); break; + case (FAPI_NR_UL_CONFIG_TYPE_SRS): + // srs config pdu + srs_config_pdu = &ul_config->ul_config_list[i].srs_config_pdu; + memcpy((void*)&(PHY_vars_UE_g[module_id][cc_id]->srs_vars[gNB_id]->srs_config_pdu), (void*)srs_config_pdu, sizeof(fapi_nr_ul_config_srs_pdu)); + break; + default: break; } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 08d77bf156..05e4332c45 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -55,6 +55,8 @@ #include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" +//#define SRS_DEBUG + static prach_association_pattern_t prach_assoc_pattern; static ssb_list_info_t ssb_list; @@ -879,7 +881,9 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, } // Periodic SRS scheduling -void nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slot) { +bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slot) { + + bool srs_scheduled = false; NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); @@ -891,7 +895,7 @@ void nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) { srs_config = mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->srs_Config->choice.setup; } else { - return; + return false; } for(int rs = 0; rs < srs_config->srs_ResourceSetToAddModList->list.count; rs++) { @@ -918,20 +922,90 @@ void nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo continue; } - int scs = mac->ULbwp[0] ? - mac->ULbwp[0]->bwp_Common->genericParameters.subcarrierSpacing : - mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing; + NR_BWP_t ubwp = mac->ULbwp[0] ? + mac->ULbwp[0]->bwp_Common->genericParameters : + mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters; uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; uint16_t offset = srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40; - int n_slots_frame = nr_slots_per_frame[scs]; + int n_slots_frame = nr_slots_per_frame[ubwp.subcarrierSpacing]; // Check if UE should transmit the SRS if((frame*n_slots_frame+slot-offset)%period == 0) { - LOG_W(NR_MAC, "(%d.%d) Periodic SRS scheduling is not implemented yet!\n", frame, slot); + + fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slot); + fapi_nr_ul_config_srs_pdu *srs_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].srs_config_pdu; + + srs_config_pdu->rnti = mac->crnti; + srs_config_pdu->handle = 0; + srs_config_pdu->bwp_size = NRRIV2BW(ubwp.locationAndBandwidth, MAX_BWP_SIZE);; + srs_config_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp.locationAndBandwidth, MAX_BWP_SIZE);; + srs_config_pdu->subcarrier_spacing = ubwp.subcarrierSpacing; + srs_config_pdu->cyclic_prefix = 0; + srs_config_pdu->num_ant_ports = srs_resource->nrofSRS_Ports; + srs_config_pdu->num_symbols = srs_resource->resourceMapping.nrofSymbols; + + srs_config_pdu->num_repetitions = srs_resource->resourceMapping.repetitionFactor; + srs_config_pdu->time_start_position = srs_resource->resourceMapping.startPosition; + srs_config_pdu->config_index = srs_resource->freqHopping.c_SRS; + srs_config_pdu->sequence_id = srs_resource->sequenceId; + srs_config_pdu->bandwidth_index = srs_resource->freqHopping.b_SRS; + srs_config_pdu->comb_size = srs_resource->transmissionComb.present - 1; + + switch(srs_resource->transmissionComb.present) { + case NR_SRS_Resource__transmissionComb_PR_n2: + srs_config_pdu->comb_offset = srs_resource->transmissionComb.choice.n2->combOffset_n2; + srs_config_pdu->cyclic_shift = srs_resource->transmissionComb.choice.n2->cyclicShift_n2; + break; + case NR_SRS_Resource__transmissionComb_PR_n4: + srs_config_pdu->comb_offset = srs_resource->transmissionComb.choice.n4->combOffset_n4; + srs_config_pdu->cyclic_shift = srs_resource->transmissionComb.choice.n4->cyclicShift_n4; + break; + default: + LOG_W(NR_MAC, "Invalid or not implemented comb_size!\n"); + } + + srs_config_pdu->frequency_position = srs_resource->freqDomainPosition; + srs_config_pdu->frequency_shift = srs_resource->freqDomainShift; + srs_config_pdu->frequency_hopping = srs_resource->freqHopping.b_hop; + srs_config_pdu->group_or_sequence_hopping = srs_resource->groupOrSequenceHopping; + srs_config_pdu->resource_type = srs_resource->resourceType.present - 1; + srs_config_pdu->t_srs = period; + srs_config_pdu->t_offset = offset; + +#ifdef SRS_DEBUG + LOG_I(NR_MAC,"Frame = %i, slot = %i\n", frame, slot); + LOG_I(NR_MAC,"srs_config_pdu->rnti = 0x%04x\n", srs_config_pdu->rnti); + LOG_I(NR_MAC,"srs_config_pdu->handle = %u\n", srs_config_pdu->handle); + LOG_I(NR_MAC,"srs_config_pdu->bwp_size = %u\n", srs_config_pdu->bwp_size); + LOG_I(NR_MAC,"srs_config_pdu->bwp_start = %u\n", srs_config_pdu->bwp_start); + LOG_I(NR_MAC,"srs_config_pdu->subcarrier_spacing = %u\n", srs_config_pdu->subcarrier_spacing); + LOG_I(NR_MAC,"srs_config_pdu->cyclic_prefix = %u (0: Normal; 1: Extended)\n", srs_config_pdu->cyclic_prefix); + LOG_I(NR_MAC,"srs_config_pdu->num_ant_ports = %u (0 = 1 port, 1 = 2 ports, 2 = 4 ports)\n", srs_config_pdu->num_ant_ports); + LOG_I(NR_MAC,"srs_config_pdu->num_symbols = %u (0 = 1 symbol, 1 = 2 symbols, 2 = 4 symbols)\n", srs_config_pdu->num_symbols); + LOG_I(NR_MAC,"srs_config_pdu->num_repetitions = %u (0 = 1, 1 = 2, 2 = 4)\n", srs_config_pdu->num_repetitions); + LOG_I(NR_MAC,"srs_config_pdu->time_start_position = %u\n", srs_config_pdu->time_start_position); + LOG_I(NR_MAC,"srs_config_pdu->config_index = %u\n", srs_config_pdu->config_index); + LOG_I(NR_MAC,"srs_config_pdu->sequence_id = %u\n", srs_config_pdu->sequence_id); + LOG_I(NR_MAC,"srs_config_pdu->bandwidth_index = %u\n", srs_config_pdu->bandwidth_index); + LOG_I(NR_MAC,"srs_config_pdu->comb_size = %u (0 = comb size 2, 1 = comb size 4, 2 = comb size 8)\n", srs_config_pdu->comb_size); + LOG_I(NR_MAC,"srs_config_pdu->comb_offset = %u\n", srs_config_pdu->comb_offset); + LOG_I(NR_MAC,"srs_config_pdu->cyclic_shift = %u\n", srs_config_pdu->cyclic_shift); + LOG_I(NR_MAC,"srs_config_pdu->frequency_position = %u\n", srs_config_pdu->frequency_position); + LOG_I(NR_MAC,"srs_config_pdu->frequency_shift = %u\n", srs_config_pdu->frequency_shift); + LOG_I(NR_MAC,"srs_config_pdu->frequency_hopping = %u\n", srs_config_pdu->frequency_hopping); + LOG_I(NR_MAC,"srs_config_pdu->group_or_sequence_hopping = %u (0 = No hopping, 1 = Group hopping groupOrSequenceHopping, 2 = Sequence hopping)\n", srs_config_pdu->group_or_sequence_hopping); + LOG_I(NR_MAC,"srs_config_pdu->resource_type = %u (0: aperiodic, 1: semi-persistent, 2: periodic)\n", srs_config_pdu->resource_type); + LOG_I(NR_MAC,"srs_config_pdu->t_srs = %u\n", srs_config_pdu->t_srs); + LOG_I(NR_MAC,"srs_config_pdu->t_offset = %u\n", srs_config_pdu->t_offset); +#endif + + fill_ul_config(ul_config, frame, slot, FAPI_NR_UL_CONFIG_TYPE_SRS); + srs_scheduled = true; } } + return srs_scheduled; } // Performs : @@ -999,6 +1073,9 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slot_tx); + // Periodic SRS scheduling + nr_ue_periodic_srs_scheduling(mod_id, frame_tx, slot_tx); + // Schedule ULSCH only if the current frame and slot match those in ul_config_req // AND if a UL grant (UL DCI or Msg3) has been received (as indicated by num_pdus) if (ul_config && (ul_info->slot_tx == ul_config->slot && ul_info->frame_tx == ul_config->sfn) && ul_config->number_pdus > 0){ @@ -1082,9 +1159,6 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in frame_t txFrameP = ul_info->frame_tx; slot_t txSlotP = ul_info->slot_tx; - // Periodic SRS scheduling - nr_ue_periodic_srs_scheduling(mod_id, txFrameP, txSlotP); - // Handle the SR/BSR procedures per subframe NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); uint8_t gNB_indexP=0; From f05ede7fed31767287d8cf9a98994726d9ae48db Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 17 Nov 2021 19:10:21 +0000 Subject: [PATCH 112/883] UE is transmitting the SRS periodically --- openair1/PHY/INIT/nr_init_ue.c | 2 + .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 237 ++++++++---------- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.h | 2 +- openair1/PHY/defs_nr_UE.h | 1 + openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 1 + openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 1 - 7 files changed, 114 insertions(+), 132 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 76ab0d7403..df0dddcda9 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -322,6 +322,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH)); srs_vars[gNB_id] = (NR_UE_SRS *)malloc16_clear(sizeof(NR_UE_SRS)); + srs_vars[gNB_id]->active = false; + if (abstraction_flag == 0) { for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index 403de8387e..d1ca83fb72 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -38,7 +38,6 @@ #undef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H #include "PHY/defs_nr_UE.h" -//#include "extern.h" #include "PHY/NR_REFSIG/ss_pbch_nr.h" #include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" @@ -47,13 +46,13 @@ #include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h" #undef DEFINE_VARIABLES_SRS_MODULATION_NR_H -#define SRS_DEBUG +//#define SRS_DEBUG /******************************************************************* * * NAME : generate_srs * -* PARAMETERS : pointer to resource set +* PARAMETERS : pointer to srs config pdu * pointer to transmit buffer * amplitude scaling for this physical signal * slot number of transmission @@ -75,84 +74,88 @@ * - no antenna switching* * *********************************************************************/ -int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, +int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, NR_DL_FRAME_PARMS *frame_parms, int32_t *txptr, int16_t amp, UE_nr_rxtx_proc_t *proc) { uint8_t n_SRS_cs_max; - uint8_t u, v_nu; + uint8_t u; + uint8_t v_nu; uint32_t f_gh = 0; - SRS_Resource_t *p_SRS_Resource; - int frame_number = proc->frame_tx; - int slot_number = proc->nr_slot_tx; - uint16_t n_SRS, n_SRS_cs_i; + uint16_t n_SRS; + uint16_t n_SRS_cs_i; double alpha_i; uint8_t K_TC_p; - uint16_t n_b[B_SRS_NUMBER], F_b, subcarrier; - uint8_t N_b, k_0_overbar_p; + uint16_t n_b[B_SRS_NUMBER]; + uint16_t F_b; + uint16_t subcarrier; + uint8_t N_b; + uint8_t k_0_overbar_p; - if (p_srs_resource_set->p_srs_ResourceList[0] == NULL) { - LOG_E(PHY,"generate_srs: No resource associated with the SRS resource set!\n"); - return (-1); - } - else { - if (p_srs_resource_set->number_srs_Resource <= MAX_NR_OF_SRS_RESOURCES_PER_SET) { - p_SRS_Resource = p_srs_resource_set->p_srs_ResourceList[0]; - } - else { - LOG_E(PHY,"generate_srs: resource number of this resource set %d exceeds maximum supported value %d!\n", p_srs_resource_set->number_srs_Resource, MAX_NR_OF_SRS_RESOURCES_PER_SET); - return (-1); - } - } + int frame_number = proc->frame_tx; + int slot_number = proc->nr_slot_tx; - if (p_srs_resource_set->resourceType != periodic) { - LOG_E(PHY,"generate_srs: only SRS periodic is supported up to now!\n"); - return (-1); - } - /* get parameters from SRS resource configuration */ - uint8_t B_SRS = p_SRS_Resource->freqHopping_b_SRS; - uint8_t C_SRS = p_SRS_Resource->freqHopping_c_SRS; - uint8_t b_hop = p_SRS_Resource->freqHopping_b_hop; - uint8_t K_TC = p_SRS_Resource->transmissionComb; - uint8_t K_TC_overbar = p_SRS_Resource->combOffset; /* FFS_TODO_NR is this parameter for K_TC_overbar ?? */ - uint8_t n_SRS_cs = p_SRS_Resource->cyclicShift; - uint8_t n_ID_SRS = p_SRS_Resource->sequenceId; - uint8_t n_shift = p_SRS_Resource->freqDomainPosition; /* it adjusts the SRS allocation to align with the common resource block grid in multiples of four */ - uint8_t n_RRC = p_SRS_Resource->freqDomainShift; - uint8_t groupOrSequenceHopping = p_SRS_Resource->groupOrSequenceHopping; + // get parameters from srs_config_pdu + uint8_t B_SRS = srs_config_pdu->bandwidth_index; + uint8_t C_SRS = srs_config_pdu->config_index; + uint8_t b_hop = srs_config_pdu->frequency_hopping; + uint8_t K_TC = 2<comb_size; + uint8_t K_TC_overbar = srs_config_pdu->comb_offset; // FFS_TODO_NR is this parameter for K_TC_overbar ?? + uint8_t n_SRS_cs = srs_config_pdu->cyclic_shift; + uint8_t n_ID_SRS = srs_config_pdu->sequence_id; + uint8_t n_shift = srs_config_pdu->frequency_position; // it adjusts the SRS allocation to align with the common resource block grid in multiples of four + uint8_t n_RRC = srs_config_pdu->frequency_shift; + uint8_t groupOrSequenceHopping = srs_config_pdu->group_or_sequence_hopping; + uint8_t l_offset = srs_config_pdu->time_start_position; + uint16_t T_SRS = srs_config_pdu->t_srs; + uint16_t T_offset = srs_config_pdu->t_offset; // FFS_TODO_NR to check interface with RRC + uint8_t R = srs_config_pdu->num_repetitions==0 ? 1 : 2<<(srs_config_pdu->num_repetitions-1); + uint8_t N_ap = srs_config_pdu->num_ant_ports==0 ? 1 : 2<<(srs_config_pdu->num_ant_ports-1); // antenna port for transmission + uint8_t N_symb_SRS = srs_config_pdu->num_symbols==0 ? 1 : 2<<(srs_config_pdu->num_symbols-1); // consecutive OFDM symbols + uint8_t l0 = N_SYMB_SLOT - 1 - l_offset; // starting position in the time domain + uint8_t k_0_p; // frequency domain starting position - uint8_t l_offset = p_SRS_Resource->resourceMapping_startPosition; - - uint16_t T_SRS = srs_period[p_SRS_Resource->SRS_Periodicity]; - uint16_t T_offset = p_SRS_Resource->SRS_Offset;; /* FFS_TODO_NR to check interface with RRC */ - uint8_t R = p_SRS_Resource->resourceMapping_repetitionFactor; - - /* TS 38.211 6.4.1.4.1 SRS resource */ - uint8_t N_ap = (uint8_t)p_SRS_Resource->nrof_SrsPorts; /* antenna port for transmission */ - uint8_t N_symb_SRS = p_SRS_Resource->resourceMapping_nrofSymbols; /* consecutive OFDM symbols */ - uint8_t l0 = N_SYMB_SLOT - 1 - l_offset; /* starting position in the time domain */ - uint8_t k_0_p; /* frequency domain starting position */ +#ifdef SRS_DEBUG + LOG_I(NR_PHY,"Frame = %i, slot = %i\n", frame_number, slot_number); + LOG_I(NR_PHY,"B_SRS = %i\n", B_SRS); + LOG_I(NR_PHY,"C_SRS = %i\n", C_SRS); + LOG_I(NR_PHY,"b_hop = %i\n", b_hop); + LOG_I(NR_PHY,"K_TC = %i\n", K_TC); + LOG_I(NR_PHY,"K_TC_overbar = %i\n", K_TC_overbar); + LOG_I(NR_PHY,"n_SRS_cs = %i\n", n_SRS_cs); + LOG_I(NR_PHY,"n_ID_SRS = %i\n", n_ID_SRS); + LOG_I(NR_PHY,"n_shift = %i\n", n_shift); + LOG_I(NR_PHY,"n_RRC = %i\n", n_RRC); + LOG_I(NR_PHY,"groupOrSequenceHopping = %i\n", groupOrSequenceHopping); + LOG_I(NR_PHY,"l_offset = %i\n", l_offset); + LOG_I(NR_PHY,"T_SRS = %i\n", T_SRS); + LOG_I(NR_PHY,"T_offset = %i\n", T_offset); + LOG_I(NR_PHY,"R = %i\n", R); + LOG_I(NR_PHY,"N_ap = %i\n", N_ap); + LOG_I(NR_PHY,"N_symb_SRS = %i\n", N_symb_SRS); + LOG_I(NR_PHY,"l0 = %i\n", l0); +#endif if (N_ap != port1) { - LOG_E(PHY, "generate_srs: this number of antenna ports %d is not yet supported!\n", N_ap); + LOG_E(NR_PHY, "generate_srs: this number of antenna ports %d is not yet supported!\n", N_ap); return (-1); } if (N_symb_SRS != 1) { - LOG_E(PHY, "generate_srs: this number of srs symbol %d is not yet supported!\n", N_symb_SRS); + LOG_E(NR_PHY, "generate_srs: this number of srs symbol %d is not yet supported!\n", N_symb_SRS); return (-1); } if (groupOrSequenceHopping != neitherHopping) { - LOG_E(PHY, "generate_srs: sequence hopping is not yet supported!\n"); + LOG_E(NR_PHY, "generate_srs: sequence hopping is not yet supported!\n"); return (-1); } if (R == 0) { - LOG_E(PHY, "generate_srs: this parameter repetition factor %d is not consistent !\n", R); + LOG_E(NR_PHY, "generate_srs: this parameter repetition factor %d is not consistent !\n", R); return (-1); } else if (R > N_symb_SRS) { - LOG_E(PHY, "generate_srs: R %d can not be greater than N_symb_SRS %d !\n", R, N_symb_SRS); + LOG_E(NR_PHY, "generate_srs: R %d can not be greater than N_symb_SRS %d !\n", R, N_symb_SRS); return (-1); } /* see 38211 6.4.1.4.2 Sequence generation */ @@ -165,15 +168,15 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, // delta = 1; /* delta = log2(K_TC) */ } else { - LOG_E(PHY, "generate_srs: SRS unknown value for K_TC %d !\n", K_TC); + LOG_E(NR_PHY, "generate_srs: SRS unknown value for K_TC %d !\n", K_TC); return (-1); } if (n_SRS_cs >= n_SRS_cs_max) { - LOG_E(PHY, "generate_srs: inconsistent parameter n_SRS_cs %d >= n_SRS_cs_max %d !\n", n_SRS_cs, n_SRS_cs_max); + LOG_E(NR_PHY, "generate_srs: inconsistent parameter n_SRS_cs %d >= n_SRS_cs_max %d !\n", n_SRS_cs, n_SRS_cs_max); return (-1); } if (T_SRS == 0) { - LOG_E(PHY, "generate_srs: inconsistent parameter T_SRS %d can not be equal to zero !\n", T_SRS); + LOG_E(NR_PHY, "generate_srs: inconsistent parameter T_SRS %d can not be equal to zero !\n", T_SRS); return (-1); } else @@ -182,7 +185,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, while (srs_periodicity[index] != T_SRS) { index++; if (index == SRS_PERIODICITY) { - LOG_E(PHY, "generate_srs: inconsistent parameter T_SRS %d not specified !\n", T_SRS); + LOG_E(NR_PHY, "generate_srs: inconsistent parameter T_SRS %d not specified !\n", T_SRS); return (-1); } } @@ -204,10 +207,9 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, /* A UE may be configured to transmit an SRS resource on adjacent symbols within the last six symbols of a slot, */ /* where all antenna ports of the SRS resource are mapped to each symbol of the resource */ - uint8_t l = p_index; if (l >= N_symb_SRS) { - LOG_E(PHY, "generate_srs: number of antenna ports %d and number of srs symbols %d are different !\n", N_ap, N_symb_SRS); + LOG_E(NR_PHY, "generate_srs: number of antenna ports %d and number of srs symbols %d are different !\n", N_ap, N_symb_SRS); } switch(groupOrSequenceHopping) { @@ -249,7 +251,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, } default: { - LOG_E(PHY, "generate_srs: unknown hopping setting %d !\n", groupOrSequenceHopping); + LOG_E(NR_PHY, "generate_srs: unknown hopping setting %d !\n", groupOrSequenceHopping); return (-1); } } @@ -276,7 +278,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, N_b = 1; } /* periodicity and offset */ - if (p_srs_resource_set->resourceType == aperiodic) { + if (srs_config_pdu->resource_type == aperiodic) { n_SRS = l/R; } else { @@ -329,7 +331,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, } if (ul_allocated_re[M_sc_b_SRS_index] != M_sc_b_SRS) { - LOG_E(PHY, "generate_srs: srs uplink allocation %d can not be found! \n", M_sc_b_SRS); + LOG_E(NR_PHY, "generate_srs: srs uplink allocation %d can not be found! \n", M_sc_b_SRS); return (-1); } @@ -426,74 +428,51 @@ int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, NR_DL_FRAME_PARMS *frame_pa *********************************************************************/ int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id) { + + if(!ue->srs_vars[0]->active) { + return -1; + } + ue->srs_vars[0]->active = false; + + fapi_nr_ul_config_srs_pdu *srs_config_pdu = &ue->srs_vars[0]->srs_config_pdu; + +#ifdef SRS_DEBUG + LOG_I(NR_PHY,"Frame = %i, slot = %i\n", proc->frame_tx, proc->nr_slot_tx); + LOG_I(NR_PHY,"srs_config_pdu->rnti = 0x%04x\n", srs_config_pdu->rnti); + LOG_I(NR_PHY,"srs_config_pdu->handle = %u\n", srs_config_pdu->handle); + LOG_I(NR_PHY,"srs_config_pdu->bwp_size = %u\n", srs_config_pdu->bwp_size); + LOG_I(NR_PHY,"srs_config_pdu->bwp_start = %u\n", srs_config_pdu->bwp_start); + LOG_I(NR_PHY,"srs_config_pdu->subcarrier_spacing = %u\n", srs_config_pdu->subcarrier_spacing); + LOG_I(NR_PHY,"srs_config_pdu->cyclic_prefix = %u (0: Normal; 1: Extended)\n", srs_config_pdu->cyclic_prefix); + LOG_I(NR_PHY,"srs_config_pdu->num_ant_ports = %u (0 = 1 port, 1 = 2 ports, 2 = 4 ports)\n", srs_config_pdu->num_ant_ports); + LOG_I(NR_PHY,"srs_config_pdu->num_symbols = %u (0 = 1 symbol, 1 = 2 symbols, 2 = 4 symbols)\n", srs_config_pdu->num_symbols); + LOG_I(NR_PHY,"srs_config_pdu->num_repetitions = %u (0 = 1, 1 = 2, 2 = 4)\n", srs_config_pdu->num_repetitions); + LOG_I(NR_PHY,"srs_config_pdu->time_start_position = %u\n", srs_config_pdu->time_start_position); + LOG_I(NR_PHY,"srs_config_pdu->config_index = %u\n", srs_config_pdu->config_index); + LOG_I(NR_PHY,"srs_config_pdu->sequence_id = %u\n", srs_config_pdu->sequence_id); + LOG_I(NR_PHY,"srs_config_pdu->bandwidth_index = %u\n", srs_config_pdu->bandwidth_index); + LOG_I(NR_PHY,"srs_config_pdu->comb_size = %u (0 = comb size 2, 1 = comb size 4, 2 = comb size 8)\n", srs_config_pdu->comb_size); + LOG_I(NR_PHY,"srs_config_pdu->comb_offset = %u\n", srs_config_pdu->comb_offset); + LOG_I(NR_PHY,"srs_config_pdu->cyclic_shift = %u\n", srs_config_pdu->cyclic_shift); + LOG_I(NR_PHY,"srs_config_pdu->frequency_position = %u\n", srs_config_pdu->frequency_position); + LOG_I(NR_PHY,"srs_config_pdu->frequency_shift = %u\n", srs_config_pdu->frequency_shift); + LOG_I(NR_PHY,"srs_config_pdu->frequency_hopping = %u\n", srs_config_pdu->frequency_hopping); + LOG_I(NR_PHY,"srs_config_pdu->group_or_sequence_hopping = %u (0 = No hopping, 1 = Group hopping groupOrSequenceHopping, 2 = Sequence hopping)\n", srs_config_pdu->group_or_sequence_hopping); + LOG_I(NR_PHY,"srs_config_pdu->resource_type = %u (0: aperiodic, 1: semi-persistent, 2: periodic)\n", srs_config_pdu->resource_type); + LOG_I(NR_PHY,"srs_config_pdu->t_srs = %u\n", srs_config_pdu->t_srs); + LOG_I(NR_PHY,"srs_config_pdu->t_offset = %u\n", srs_config_pdu->t_offset); +#endif + NR_DL_FRAME_PARMS *frame_parms = &(ue->frame_parms); - SRS_NR *p_srs_nr = &(ue->frame_parms.srs_nr); - SRS_ResourceSet_t *p_srs_resource_set = frame_parms->srs_nr.p_SRS_ResourceSetList[p_srs_nr->active_srs_Resource_Set]; - int generate_srs = 0; -#ifdef SRS_DEBUG - LOG_I(NR_PHY,"p_srs_nr = 0x%x\n", p_srs_nr); - if(p_srs_nr) LOG_I(NR_PHY,"p_srs_nr->number_srs_Resource_Set = %i\n", p_srs_nr->number_srs_Resource_Set); - if(p_srs_nr) LOG_I(NR_PHY,"p_srs_nr->active_srs_Resource_Set = %i\n", p_srs_nr->active_srs_Resource_Set); - LOG_I(NR_PHY,"p_srs_resource_set = 0x%x\n", p_srs_resource_set); - if(p_srs_resource_set) LOG_I(NR_PHY,"p_srs_resource_set->resourceType = %i\n", p_srs_resource_set->resourceType); -#endif + int16_t txptr = AMP; + uint16_t nsymb = (ue->frame_parms.Ncp==0) ? 14:12; + uint16_t symbol_offset = (int)ue->frame_parms.ofdm_symbol_size*((proc->nr_slot_tx*nsymb)+(nsymb-1)); - /* is there any resource set which has been configurated ? */ - if (p_srs_nr->number_srs_Resource_Set != 0) { - - /* what is the current active resource set ? */ - if (p_srs_nr->active_srs_Resource_Set > MAX_NR_OF_SRS_RESOURCE_SET) { - LOG_W(PHY,"phy_procedures_UE_TX: srs active %d greater than maximum %d!\n", p_srs_nr->active_srs_Resource_Set, MAX_NR_OF_SRS_RESOURCE_SET); - } - else { - /* SRS resource set configurated ? */ - if (p_srs_resource_set != NULL) { - - SRS_Resource_t *p_srs_resource = frame_parms->srs_nr.p_SRS_ResourceSetList[p_srs_nr->active_srs_Resource_Set]->p_srs_ResourceList[0]; - - /* SRS resource configurated ? */ - if (p_srs_resource != NULL) { - if (p_srs_resource_set->resourceType == periodic) { - if (is_srs_period_nr(p_srs_resource, frame_parms, proc->frame_tx, proc->nr_slot_tx) == 0) { - generate_srs = 1; - } - } - } - else { - LOG_W(PHY,"phy_procedures_UE_TX: no configurated srs resource!\n"); - } - } - } - } - if (generate_srs == 1) { - int16_t txptr = AMP; - uint16_t nsymb = (ue->frame_parms.Ncp==0) ? 14:12; - uint16_t symbol_offset = (int)ue->frame_parms.ofdm_symbol_size*((proc->nr_slot_tx*nsymb)+(nsymb-1)); - -#ifdef SRS_DEBUG - LOG_I(NR_PHY,"nsymb = %i, symbol_offset = %i\n", nsymb, symbol_offset); - LOG_I(NR_PHY,"p_srs_resource_set->srs_ResourceSetId = %i\n", p_srs_resource_set->srs_ResourceSetId); - LOG_I(NR_PHY,"p_srs_resource_set->number_srs_Resource = %i", p_srs_resource_set->number_srs_Resource); - LOG_I(NR_PHY,"p_srs_resource_set->resourceType = %i\n", p_srs_resource_set->resourceType); - LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->SRS_Periodicity = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->SRS_Periodicity); - LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->combOffset = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->combOffset); - LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->freqDomainPosition = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->freqDomainPosition); - LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_b_SRS = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_b_SRS); - LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_b_hop = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_b_hop); - LOG_I(NR_PHY,"p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_c_SRS = %i\n", p_srs_resource_set->p_srs_ResourceList[0]->freqHopping_c_SRS); -#endif - - if (generate_srs_nr(p_srs_resource_set, frame_parms, &ue->common_vars.txdataF[gNB_id][symbol_offset], txptr, proc) == 0) { - return 0; - } - else - { - return (-1); - } - } - else { - return (-1); + if (generate_srs_nr(srs_config_pdu, frame_parms, &ue->common_vars.txdataF[gNB_id][symbol_offset], txptr, proc) == 0) { + return 0; + } else { + return -1; } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h index e6f94b5c35..b82a9f8f7a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h @@ -140,7 +140,7 @@ EXTERN const uint16_t srs_periodicity[SRS_PERIODICITY] @param proc pointer to the transmit parameters @returns 0 on success -1 on error with message */ -int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set, +int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, NR_DL_FRAME_PARMS *frame_parms, int32_t *txptr, int16_t amp, diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index fcdb1089eb..fe2f91c706 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -707,6 +707,7 @@ typedef struct { } NR_UE_PRACH; typedef struct { + bool active; fapi_nr_ul_config_srs_pdu srs_config_pdu; } NR_UE_SRS; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 1c86b58a33..4918748f51 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -230,6 +230,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ // srs config pdu srs_config_pdu = &ul_config->ul_config_list[i].srs_config_pdu; memcpy((void*)&(PHY_vars_UE_g[module_id][cc_id]->srs_vars[gNB_id]->srs_config_pdu), (void*)srs_config_pdu, sizeof(fapi_nr_ul_config_srs_pdu)); + PHY_vars_UE_g[module_id][cc_id]->srs_vars[gNB_id]->active = true; break; default: diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index d6f358c75e..9022d42422 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -282,7 +282,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, } } - if (ue->UE_mode[gNB_id] == PUSCH && is_srs_occasion_nr(ue->frame_parms, frame_tx, slot_tx)) { + if (ue->UE_mode[gNB_id] == PUSCH) { ue_srs_procedures_nr(ue, proc, gNB_id); } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 05e4332c45..98e469d48f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -945,7 +945,6 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo srs_config_pdu->cyclic_prefix = 0; srs_config_pdu->num_ant_ports = srs_resource->nrofSRS_Ports; srs_config_pdu->num_symbols = srs_resource->resourceMapping.nrofSymbols; - srs_config_pdu->num_repetitions = srs_resource->resourceMapping.repetitionFactor; srs_config_pdu->time_start_position = srs_resource->resourceMapping.startPosition; srs_config_pdu->config_index = srs_resource->freqHopping.c_SRS; From d8dc5baf3c5717eeed0d7435f5e99fc8089e635a Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 18 Nov 2021 19:50:53 +0000 Subject: [PATCH 113/883] Fix phi_M_ZC_24 --- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h | 60 +++++++++---------- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 7 +++ 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h index 43ec0c03dc..081ef33a66 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h @@ -224,36 +224,36 @@ EXTERN const char phi_M_ZC_24[24*U_GROUP_NUMBER] #ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H = { /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 */ -/* 0 */ -1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3, -/* 1 */ -1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3, -/* 2 */ -3, 3, 1, 3, -1, 1, -3, 1, -3, 1, -1, -3, -1, -3, -3, -3, -3, -1, -1, -1, 1, 1, -3, -3, -/* 3 */ 3, -1, 3, -1, 1, -3, 1, 1, -3, -3, 3, -3, -1, -1, -1, -1, -1, -3, -3, -1, 1, 1, -3, -3, -/* 4 */ 1, -3, 3, -1, -3, -1, 3, 3, 1, -1, 1, 1, 3, -3, -1, -3, -3, -3, -1, 3, -3, -1, -3, -3, -/* 5 */ 3, -1, 1, -1, 3, -3, 1, 1, 3, -1, -3, 3, 1, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, -3, -/* 6 */ -3, 3, -1, 3, 1, -1, -1, -1, 3, 3, 1, 1, 1, 3, 3, 1, -3, -3, -1, 1, -3, 1, 3, -3, -/* 7 */ -3, -1, 1, -3, -3, 1, 1, -3, 3, -1, -1, -3, 1, 3, 1, -1, -3, -1, -3, 1, -3, -3, -3, -3, -/* 8 */ -3, 1, -3, 1, -3, -3, 1, -3, 1, -3, -3, -3, -3, -3, 1, -3, -3, 1, 1, -3, 1, 1, -3, -3, -/* 9 */ 3, -3, -3, -1, 3, 3, -3, -1, 3, 1, 1, 1, 3, -1, 3, -3, -1, 3, -1, 3, 1, -1, -3, -3, -/* 10 */ -3, -3, -1, -1, -1, -3, 1, -1, -3, -1, 3, -3, 1, -3, 3, -3, 3, 3, 1, -1, -1, 1, -3, -3, -/* 11 */ -3, -3, 3, 3, 1, -1, -1, -1, 1, -3, -1, 1, -1, 3, -3, -1, -3, -1, -1, 1, -3, 3, -1, -3, -/* 12 */ -3, -3, 1, -1, 3, 3, -3, -1, 1, -1, -1, 1, 1, -1, -1, 3, -3, 1, -3, 1, -1, -1, -1, -3, -/* 13 */ -3, 1, -3, 3, -1, -1, -1, -3, 3, 1, -1, -3, -1, 1, 3, -1, 1, -1, 1, -3, -3, -3, -3, -3, -/* 14 */ -3, -3, -3, -1, 3, -3, 3, 1, 3, 1, -3, -1, -1, -3, 1, 1, 3, 1, -1, -3, 3, 1, 3, -3, -/* 15 */ 1, 1, -1, -3, -1, 1, 1, -3, 1, -1, 1, -3, 3, -3, -3, 3, -1, -3, 1, 3, -3, 1, -3, -3, -/* 16 */ -3, 3, -1, 3, -1, 3, 3, 1, 1, -3, 1, 3, -3, 3, -3, -3, -1, 1, 3, -3, -1, -1, -3, -3, -/* 17 */ -1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3, -/* 18 */ -3, 1, -3, 1, -3, 1, 1, 3, 1, -3, -3, -1, 1, 3, -1, -3, 3, 1, -1, -3, -3, -3, -3, -3, -/* 19 */ 3, -3, 3, -1, -3, 1, 3, 1, -1, -1, -3, -1, 3, -3, 3, -1, -1, 3, 3, -3, -3, 3, -3, -3, -/* 20 */ -1, 3, -3, -3, -1, 3, -1, -1, 1, 3, 1, 3, -1, -1, -3, 1, 3, 1, -1, -3, 1, -1, -3, -3, -/* 21 */ -3, 1, -3, -1, -1, 3, 1, 3, -3, 1, -1, 3, 3, -1, -3, 3, -3, -1, -1, -3, -3, -3, 3, -3, -/* 22 */ -3, -1, -1, -3, 1, -3, -3, -1, -1, 3, -1, 1, -1, 3, 1, -3, -1, 3, 1, 1, -1, -1, -3, -3, -/* 23 */ -3, 1, -3, 3, -3, 1, -3, 3, 1, -1, -3, -1, -3, -3, -3, -3, 1, 3, -1, 1, 3, 3, 3, -3, -/* 24 */ -3, -1, 1, -3, -1, -1, 1, 1, 1, 3, 3, -1, 1, -1, 1, -1, -1, -3, -3, -3, 3, 1, -1, -3, -/* 25 */ 3, -3, -1, 1, 3, -1, -1, -3, -1, 3, -1, -3, -1, -3, 3, -1, 3, 1, 1, -3, 3, -3, -3, -3, -/* 26 */ -3, 1, 3, -1, 1, -1, 3, -3, 3, -1, -3, -1, -3, 3, -1, -1, -1, -3, -1, -1, -3, 3, 3, -3, -/* 27 */ -3, 3, -1, -3, -1, -1, -1, 3, -1, -1, 3, -3, -1, 3, -3, 3, -3, -1, 3, 1, 1, -1, -3, -3, -/* 28 */ -3, 1, -1, -3, -3, -1, 1, -3, -1, -3, 1, 1, -1, 1, 1, 3, 3, 3, -1, 1, -1, 1, -1, -3, -/* 29 */ -1, 3, -1, -1, 3, 3, -1, -1, -1, 3, -1, -3, 1, 3, 1, 1, -3, -3, -3, -1, -3, -1, -3, -3, +/* 0 */ -1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3, +/* 1 */ -1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3, +/* 2 */ -1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3, +/* 3 */ 1, -3, 3, -1, -3, -1, 3, 3, 1, -1, 1, 1, 3, -3, -1, -3, -3, -3, -1, 3, -3, -1, -3, -3, +/* 4 */ -1, 3, -3, -3, -1, 3, -1, -1, 1, 3, 1, 3, -1, -1, -3, 1, 3, 1, -1, -3, 1, -1, -3, -3, +/* 5 */ -3, -1, 1, -3, -3, 1, 1, -3, 3, -1, -1, -3, 1, 3, 1, -1, -3, -1, -3, 1, -3, -3, -3, -3, +/* 6 */ -3, 3, 1, 3, -1, 1, -3, 1, -3, 1, -1, -3, -1, -3, -3, -3, -3, -1, -1, -1, 1, 1, -3, -3, +/* 7 */ -3, 1, 3, -1, 1, -1, 3, -3, 3, -1, -3, -1, -3, 3, -1, -1, -1, -3, -1, -1, -3, 3, 3, -3, +/* 8 */ -3, 1, -3, 3, -1, -1, -1, -3, 3, 1, -1, -3, -1, 1, 3, -1, 1, -1, 1, -3, -3, -3, -3, -3, +/* 9 */ 1, 1, -1, -3, -1, 1, 1, -3, 1, -1, 1, -3, 3, -3, -3, 3, -1, -3, 1, 3, -3, 1, -3, -3, +/* 10 */ -3, -3, -3, -1, 3, -3, 3, 1, 3, 1, -3, -1, -1, -3, 1, 1, 3, 1, -1, -3, 3, 1, 3, -3, +/* 11 */ -3, 3, -1, 3, 1, -1, -1, -1, 3, 3, 1, 1, 1, 3, 3, 1, -3, -3, -1, 1, -3, 1, 3, -3, +/* 12 */ 3, -3, 3, -1, -3, 1, 3, 1, -1, -1, -3, -1, 3, -3, 3, -1, -1, 3, 3, -3, -3, 3, -3, -3, +/* 13 */ -3, 3, -1, 3, -1, 3, 3, 1, 1, -3, 1, 3, -3, 3, -3, -3, -1, 1, 3, -3, -1, -1, -3, -3, +/* 14 */ -3, 1, -3, -1, -1, 3, 1, 3, -3, 1, -1, 3, 3, -1, -3, 3, -3, -1, -1, -3, -3, -3, 3, -3, +/* 15 */ -3, -1, -1, -3, 1, -3, -3, -1, -1, 3, -1, 1, -1, 3, 1, -3, -1, 3, 1, 1, -1, -1, -3, -3, +/* 16 */ -3, -3, 1, -1, 3, 3, -3, -1, 1, -1, -1, 1, 1, -1, -1, 3, -3, 1, -3, 1, -1, -1, -1, -3, +/* 17 */ 3, -1, 3, -1, 1, -3, 1, 1, -3, -3, 3, -3, -1, -1, -1, -1, -1, -3, -3, -1, 1, 1, -3, -3, +/* 18 */ 3, 1, -3, 1, -3, -3, 1, -3, 1, -3, -3, -3, -3, -3, 1, -3, -3, 1, 1, -3, 1, 1, -3, -3, +/* 19 */ -3, -3, 3, 3, 1, -1, -1, -1, 1, -3, -1, 1, -1, 3, -3, -1, -3, -1, -1, 1, -3, 3, -1, -3, +/* 20 */ -3, -3, -1, -1, -1, -3, 1, -1, -3, -1, 3, -3, 1, -3, 3, -3, 3, 3, 1, -1, -1, 1, -3, -3, +/* 21 */ 3, -1, 1, -1, 3, -3, 1, 1, 3, -1, -3, 3, 1, -3, 3, -1, -1, -1, -1, 1, -3, -3, -3, -3, +/* 22 */ -3, 1, -3, 3, -3, 1, -3, 3, 1, -1, -3, -1, -3, -3, -3, -3, 1, 3, -1, 1, 3, 3, 3, -3, +/* 23 */ -3, -1, 1, -3, -1, -1, 1, 1, 1, 3, 3, -1, 1, -1, 1, -1, -1, -3, -3, -3, 3, 1, -1, -3, +/* 24 */ -3, 3, -1, -3, -1, -1, -1, 3, -1, -1, 3, -3, -1, 3, -3, 3, -3, -1, 3, 1, 1, -1, -3, -3, +/* 25 */ -3, 1, -1, -3, -3, -1, 1, -3, -1, -3, 1, 1, -1, 1, 1, 3, 3, 3, -1, 1, -1, 1, -1, -3, +/* 26 */ -1, 3, -1, -1, 3, 3, -1, -1, -1, 3, -1, -3, 1, 3, 1, 1, -3, -3, -3, -1, -3, -1, -3, -3, +/* 27 */ 3, -3, -3, -1, 3, 3, -3, -1, 3, 1, 1, 1, 3, -1, 3, -3, -1, 3, -1, 3, 1, -1, -3, -3, +/* 28 */ -3, 1, -3, 1, -3, 1, 1, 3, 1, -3, -3, -1, 1, 3, -1, -3, 3, 1, -1, -3, -3, -3, -3, -3, +/* 29 */ 3, -3, -1, 1, 3, -1, -1, -3, -1, 3, -1, -3, -1, -3, 3, -1, 3, 1, 1, -3, 3, -3, -3, -3, } #endif ; diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index d1ca83fb72..d0c8aef3f7 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -367,6 +367,13 @@ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, txptr[subcarrier] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000); +#ifdef SRS_DEBUG + if( (subcarrier-frame_parms->first_carrier_offset)%12 == 0 ) { + LOG_I(NR_PHY,"---------- %i ----------\n", (subcarrier-frame_parms->first_carrier_offset)/12); + } + LOG_I(NR_PHY,"(%i)\t%i\t%i\n", subcarrier-frame_parms->first_carrier_offset, real_amp&0xFFFF, imag_amp&0xFFFF); +#endif + subcarrier += (K_TC); /* subcarrier increment */ if (subcarrier >= frame_parms->ofdm_symbol_size) From 2c35192416eed9acc2509e531e6ac02523179f70 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 19 Nov 2021 11:31:03 +0000 Subject: [PATCH 114/883] Fix phi_M_ZC_18 --- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h | 58 +++++++++---------- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 12 ++-- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h index 081ef33a66..0bd0d30587 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h @@ -185,36 +185,36 @@ EXTERN const char phi_M_ZC_18[18*U_GROUP_NUMBER] #ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H = { /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 */ -/* 0 */ 3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3, -/* 1 */ 3, -3, 1, 1, 3, -1, 1, -1, -1, -3, 1, 1, -1, 3, 3, -3, 3, -1, -/* 2 */ -3, 3, -1, -3, -1, -3, 1, 1, -3, -3, -1, -1, 3, -3, 1, 3, 1, 1, -/* 3 */ 1, 1, -1, -1, -3, -1, 1, -3, -3, -3, 1, -3, -1, -1, 1, -1, 3, 1, -/* 4 */ 1, 1, -3, 3, 3, 1, 3, -3, 3, -1, 1, 1, -1, 1, -3, -3, -1, 3, -/* 5 */ -3, -3, 1, -3, 3, 3, 3, -1, 3, 1, 1, -3, -3, -3, 3, -3, -1, -1, -/* 6 */ -1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1, -/* 7 */ -3, 1, -3, -3, 1, -3, -3, 3, 1, -3, -1, -3, -3, -3, -1, 1, 1, 3, -/* 8 */ 1, -3, -1, -3, 3, 3, -1, -3, 1, -3, -3, -1, -3, -1, 1, 3, 3, 3, -/* 9 */ -3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1, -/* 10 */ -3, -3, 1, -1, -1, 1, 1, -3, -1, 3, 3, 3, 3, -1, 3, 1, 3, 1, -/* 11 */ -3, -3, 3, 3, -3, 1, 3, -1, -3, 1, -1, -3, 3, -3, -1, -1, -1, 3, -/* 12 */ -3, -3, 3, 3, 3, 1, -3, 1, 3, 3, 1, -3, -3, 3, -1, -3, -1, 1, -/* 13 */ -3, 3, -1, 1, 3, 1, -3, -1, 1, 1, -3, 1, 3, 3, -1, -3, -3, -3, -/* 14 */ -3, 1, -3, -1, -1, 3, 1, -3, -3, -3, -1, -3, -3, 1, 1, 1, -1, -1, -/* 15 */ -3, -3, 3, 3, 3, -1, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -1, -/* 16 */ -3, -1, 3, 3, -1, 3, -1, -3, -1, 1, -1, -3, -1, -1, -1, 3, 3, 1, -/* 17 */ -3, -1, -3, -1, -3, 1, 3, -3, -1, 3, 3, 3, 1, -1, -3, 3, -1, -3, -/* 18 */ -3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1, -/* 19 */ 3, -1, -3, 1, -3, -3, -3, 3, 3, -1, 1, -3, -1, 3, 1, 1, 3, 3, -/* 20 */ 3, 3, 3, -3, -1, -3, -1, 3, -1, 1, -1, -3, 1, -3, -3, -1, 3, 3, -/* 21 */ 3, -1, 3, 1, -3, -3, -1, 1, -3, -3, 3, 3, 3, 1, 3, -3, 3, -3, -/* 22 */ -3, 1, 1, -3, 1, 1, 3, -3, -1, -3, -1, 3, -3, 3, -1, -1, -1, -3, -/* 23 */ -3, -1, -1, -3, 1, -3, 3, -1, -1, -3, 3, 3, -3, -1, 3, -1, -1, -1, -/* 24 */ -3, -3, -3, 1, -3, 3, 1, 1, 3, -3, -3, 1, 3, -1, 3, -3, -3, 3, -/* 25 */ 1, 1, -3, -3, -3, -3, 1, 3, -3, 3, 3, 1, -3, -1, 3, -1, -3, 1, -/* 26 */ 3, -1, -1, 1, -3, -1, -3, -1, -3, -3, -1, -3, 1, 1, 1, -3, -3, 3, -/* 27 */ 3, 1, -3, 1, -3, 3, 3, -1, -3, -3, -1, -3, -3, 3, -3, -1, 1, 3, +/* 0 */ -1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1, +/* 1 */ 3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3, +/* 2 */ -3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1, +/* 3 */ -3, -3, 3, 3, 3, 1, -3, 1, 3, 3, 1, -3, -3, 3, -1, -3, -1, 1, +/* 4 */ 1, 1, -1, -1, -3, -1, 1, -3, -3, -3, 1, -3, -1, -1, 1, -1, 3, 1, +/* 5 */ 3, -3, 1, 1, 3, -1, 1, -1, -1, -3, 1, 1, -1, 3, 3, -3, 3, -1, +/* 6 */ -3, 3, -1, 1, 3, 1, -3, -1, 1, 1, -3, 1, 3, 3, -1, -3, -3, -3, +/* 7 */ 1, 1, -3, 3, 3, 1, 3, -3, 3, -1, 1, 1, -1, 1, -3, -3, -1, 3, +/* 8 */ -3, 1, -3, -3, 1, -3, -3, 3, 1, -3, -1, -3, -3, -3, -1, 1, 1, 3, +/* 9 */ 3, -1, 3, 1, -3, -3, -1, 1, -3, -3, 3, 3, 3, 1, 3, -3, 3, -3, +/* 10 */ -3, -3, -3, 1, -3, 3, 1, 1, 3, -3, -3, 1, 3, -1, 3, -3, -3, 3, +/* 11 */ -3, -3, 3, 3, 3, -1, -1, -3, -1, -1, -1, 3, 1, -3, -3, -1, 3, -1, +/* 12 */ -3, -1, -3, -3, 1, 1, -1, -3, -1, -3, -1, -1, 3, 3, -1, 3, 1, 3, +/* 13 */ 1, 1, -3, -3, -3, -3, 1, 3, -3, 3, 3, 1, -3, -1, 3, -1, -3, 1, +/* 14 */ -3, 3, -1, -3, -1, -3, 1, 1, -3, -3, -1, -1, 3, -3, 1, 3, 1, 1, +/* 15 */ 3, 1, -3, 1, -3, 3, 3, -1, -3, -3, -1, -3, -3, 3, -3, -1, 1, 3, +/* 16 */ -3, -1, -3, -1, -3, 1, 3, -3, -1, 3, 3, 3, 1, -1, -3, 3, -1, -3, +/* 17 */ -3, -1, 3, 3, -1, 3, -1, -3, -1, 1, -1, -3, -1, -1, -1, 3, 3, 1, +/* 18 */ -3, 1, -3, -1, -1, 3, 1, -3, -3, -3, -1, -3, -3, 1, 1, 1, -1, -1, +/* 19 */ 3, 3, 3, -3, -1, -3, -1, 3, -1, 1, -1, -3, 1, -3, -3, -1, 3, 3, +/* 20 */ -3, 1, 1, -3, 1, 1, 3, -3, -1, -3, -1, 3, -3, 3, -1, -1, -1, -3, +/* 21 */ 1, -3, -1, -3, 3, 3, -1, -3, 1, -3, -3, -1, -3, -1, 1, 3, 3, 3, +/* 22 */ -3, -3, 1, -1, -1, 1, 1, -3, -1, 3, 3, 3, 3, -1, 3, 1, 3, 1, +/* 23 */ 3, -1, -3, 1, -3, -3, -3, 3, 3, -1, 1, -3, -1, 3, 1, 1, 3, 3, +/* 24 */ 3, -1, -1, 1, -3, -1, -3, -1, -3, -3, -1, -3, 1, 1, 1, -3, -3, 3, +/* 25 */ -3, -3, 1, -3, 3, 3, 3, -1, 3, 1, 1, -3, -3, -3, 3, -3, -1, -1, +/* 26 */ -3, -1, -1, -3, 1, -3, 3, -1, -1, -3, 3, 3, -3, -1, 3, -1, -1, -1, +/* 27 */ -3, -3, 3, 3, -3, 1, 3, -1, -3, 1, -1, -3, 3, -3, -1, -1, -1, 3, /* 28 */ -1, -3, 1, -3, -3, -3, 1, 1, 3, 3, -3, 3, 3, -3, -1, 3, -3, 1, -/* 29 */ -3, -1, -3, -3, 1, 1, -1, -3, -1, -3, -1, -1, 3, 3, -1, 3, 1, 3, +/* 29 */ -3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1, } #endif ; diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index d0c8aef3f7..8cd26e2db8 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -110,12 +110,12 @@ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, uint8_t groupOrSequenceHopping = srs_config_pdu->group_or_sequence_hopping; uint8_t l_offset = srs_config_pdu->time_start_position; uint16_t T_SRS = srs_config_pdu->t_srs; - uint16_t T_offset = srs_config_pdu->t_offset; // FFS_TODO_NR to check interface with RRC - uint8_t R = srs_config_pdu->num_repetitions==0 ? 1 : 2<<(srs_config_pdu->num_repetitions-1); - uint8_t N_ap = srs_config_pdu->num_ant_ports==0 ? 1 : 2<<(srs_config_pdu->num_ant_ports-1); // antenna port for transmission - uint8_t N_symb_SRS = srs_config_pdu->num_symbols==0 ? 1 : 2<<(srs_config_pdu->num_symbols-1); // consecutive OFDM symbols - uint8_t l0 = N_SYMB_SLOT - 1 - l_offset; // starting position in the time domain - uint8_t k_0_p; // frequency domain starting position + uint16_t T_offset = srs_config_pdu->t_offset; // FFS_TODO_NR to check interface with RRC + uint8_t R = 1<num_repetitions; + uint8_t N_ap = 1<num_ant_ports; // antenna port for transmission + uint8_t N_symb_SRS = 1<num_symbols; // consecutive OFDM symbols + uint8_t l0 = N_SYMB_SLOT - 1 - l_offset; // starting position in the time domain + uint8_t k_0_p; // frequency domain starting position #ifdef SRS_DEBUG LOG_I(NR_PHY,"Frame = %i, slot = %i\n", frame_number, slot_number); From 2aeee0534b6fc591d3b5b8ae7c9af43546c0afb5 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 19 Nov 2021 11:42:04 +0000 Subject: [PATCH 115/883] Fix phi_M_ZC_12 --- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h | 58 +++++++++++++------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h index 0bd0d30587..5848322b28 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h @@ -146,36 +146,36 @@ EXTERN const char phi_M_ZC_12[12*U_GROUP_NUMBER] #ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H = { /* 0 1 2 3 4 5 6 7 8 9 10 11 */ -/* 0 */ 1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1, -/* 1 */ -1, -1, -1, -1, 1, -3, -1, 3, 3, -1, -3, 1, -/* 2 */ -3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3, -/* 3 */ -3, 3, 1, 3, -3, 1, 1, 1, 1, 3, -3, 3, -/* 4 */ -3, 1, 3, -1, -1, -3, -3, -1, -1, 3, 1, -3, -/* 5 */ -1, 1, 1, -1, 1, 3, 3, -1, -1, -3, 1, -3, -/* 6 */ -3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3, -/* 7 */ -3, 3, -3, 3, 3, -3, -1, -1, 3, 3, 1, -3, -/* 8 */ -3, -1, -3, -1, -1, -3, 3, 3, -1, -1, 1, -3, -/* 9 */ -3, 3, 3, 3, -1, -3, -3, -1, -3, 1, 3, -3, -/* 10 */ 1, 3, -3, 1, 3, 3, 3, 1, -1, 1, -1, 3, -/* 11 */ -1, -3, 3, -1, -3, -3, -3, -1, 1, -1, 1, -3, -/* 12 */ 3, 1, 3, 1, 3, -3, -1, 1, 3, 1, -1, -3, -/* 13 */ -3, -3, 3, 3, 3, -3, -1, 1, -3, 3, 1, -3, -/* 14 */ -3, -1, 1, -3, 1, 3, 3, 3, -1, -3, 3, 3, -/* 15 */ -3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3, -/* 16 */ -1, 1, 3, -3, 1, -1, 1, -1, -1, -3, 1, -1, -/* 17 */ -3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1, -/* 18 */ -3, -1, 3, -3, -3, -1, -3, 1, -1, -3, 3, 3, +/* 0 */ -3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3, +/* 1 */ -3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3, +/* 2 */ -3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3, +/* 3 */ -3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3, +/* 4 */ -3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1, +/* 5 */ -3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3, +/* 6 */ 1, -1, 3, -1, -1, -1, -3, -1, 1, 1, 1, -3, +/* 7 */ -1, -3, 3, -1, -3, -3, -3, -1, 1, -1, 1, -3, +/* 8 */ -3, -1, 3, 1, -3, -1, -3, 3, 1, 3, 3, 1, +/* 9 */ -3, -1, -1, -3, -3, -1, -3, 3, 1, 3, -1, -3, +/* 10 */ -3, 3, -3, 3, 3, -3, -1, -1, 3, 3, 1, -3, +/* 11 */ -3, -1, -3, -1, -1, -3, 3, 3, -1, -1, 1, -3, +/* 12 */ -3, -1, 3, -3, -3, -1, -3, 1, -1, -3, 3, 3, +/* 13 */ -3, 1, -1, -1, 3, 3, -3, -1, -1, -3, -1, -3, +/* 14 */ 1, 3, -3, 1, 3, 3, 3, 1, -1, 1, -1, 3, +/* 15 */ -3, 1, 3, -1, -1, -3, -3, -1, -1, 3, 1, -3, +/* 16 */ -1, -1, -1, -1, 1, -3, -1, 3, 3, -1, -3, 1, +/* 17 */ -1, 1, 1, -1, 1, 3, 3, -1, -1, -3, 1, -3, +/* 18 */ -3, 1, 3, 3, -1, -1, -3, 3, 3, -3, 3, -3, /* 19 */ -3, -3, 3, -3, -1, 3, 3, 3, -1, -3, 1, -3, -/* 20 */ -3, 1, -1, -1, 3, 3, -3, -1, -1, -3, -1, -3, -/* 21 */ -3, 1, 3, 3, -1, -1, -3, 3, 3, -3, 3, -3, -/* 22 */ -3, -1, -1, -3, -3, -1, -3, 3, 1, 3, -1, -3, -/* 23 */ -3, -1, 3, 1, -3, -1, -3, 3, 1, 3, 3, 1, -/* 24 */ -3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3, -/* 25 */ 3, -1, -3, 3, -3, -1, 3, 3, 3, -3, -1, -3, -/* 26 */ 1, -1, 3, -1, -1, -1, -3, -1, 1, 1, 1, -3, -/* 27 */ -3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3, -/* 28 */ -3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3, -/* 29 */ -3, 3, 1, -1, 3, 3, -3, 1, -1, 1, -1, 1, +/* 20 */ 3, 1, 3, 1, 3, -3, -1, 1, 3, 1, -1, -3, +/* 21 */ -3, 3, 1, 3, -3, 1, 1, 1, 1, 3, -3, 3, +/* 22 */ -3, 3, 3, 3, -1, -3, -3, -1, -3, 1, 3, -3, +/* 23 */ 3, -1, -3, 3, -3, -1, 3, 3, 3, -3, -1, -3, +/* 24 */ -3, -1, 1, -3, 1, 3, 3, 3, -1, -3, 3, 3, +/* 25 */ -3, 3, 1, -1, 3, 3, -3, 1, -1, 1, -1, 1, +/* 26 */ -1, 1, 3, -3, 1, -1, 1, -1, -1, -3, 1, -1, +/* 27 */ -3, -3, 3, 3, 3, -3, -1, 1, -3, 3, 1, -3, +/* 28 */ 1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1, +/* 29 */ -3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3, } #endif ; From 10ecfcda406fb0139cd97f51f0b2fd758087a31c Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 19 Nov 2021 11:51:23 +0000 Subject: [PATCH 116/883] Fix phi_M_ZC_6 --- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h index 5848322b28..dab8e04059 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h @@ -108,22 +108,22 @@ EXTERN const char phi_M_ZC_6[6*U_GROUP_NUMBER] #ifdef INIT_VARIABLES_LOWPAPR_SEQUENCES_NR_H = { /* 0 1 2 3 4 5 */ -/* 0 */ -3, -1, 3, 3, -1, -3, -/* 1 */ -3, 3, -1, -1, 3, -3, -/* 2 */ -3, -3, -3, 3, 1, -3, -/* 3 */ 1, 1, 1, 3, -1, -3, -/* 4 */ 1, 1, 1, -3, -1, 3, -/* 5 */ -3, 1, -1, -3, -3, -3, -/* 6 */ -3, 1, 3, -3, -3, -3, -/* 7 */ -3, -1, 1, -3, 1, -1, -/* 8 */ -3, -1, -3, 1, -3, -3, -/* 9 */ -3, -3, 1, -3, 3, -3, +/* 0 */ -3, -1, 3, 3, -1, -3, +/* 1 */ -3, 3, -1, -1, 3, -3, +/* 2 */ -3, -3, -3, 3, 1, -3, +/* 3 */ 1, 1, 1, 3, -1, -3, +/* 4 */ 1, 1, 1, -3, -1, 3, +/* 5 */ -3, 1, -1, -3, -3, -3, +/* 6 */ -3, 1, 3, -3, -3, -3, +/* 7 */ -3, -1, 1, -3, 1, -1, +/* 8 */ -3, -1, -3, 1, -3, -3, +/* 9 */ -3, -3, 1, -3, 3, -3, /* 10 */ -3, 1, 3, 1, -3, -3, /* 11 */ -3, -1, -3, 1, 1, -3, /* 12 */ 1, 1, 3, -1, -3, 3, /* 13 */ 1, 1, 3, 3, -1, 3, /* 14 */ 1, 1, 1, -3, 3, -1, -/* 15 */ -1, 1, 1, -1, 3, -3, +/* 15 */ 1, 1, 1, -1, 3, -3, /* 16 */ -3, -1, -1, -1, 3, -1, /* 17 */ -3, -3, -1, 1, -1, -3, /* 18 */ -3, -3, -3, 1, -3, -1, From f80ba3e4db4b9cdcafbba97a40d3453d88dd3e2d Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 19 Nov 2021 15:48:07 +0100 Subject: [PATCH 117/883] nzp csi-rs scheduling function --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 25 +++ openair2/LAYER2/NR_MAC_UE/mac_proto.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 148 +++++++++++++++++- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 4 files changed, 173 insertions(+), 3 deletions(-) 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 e1bb2579eb..7e594205fa 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 @@ -433,11 +433,36 @@ typedef struct { fapi_nr_dl_config_dlsch_pdu_rel15_t dlsch_config_rel15; } fapi_nr_dl_config_dlsch_pdu; + +typedef struct { + uint16_t bwp_size;// + uint16_t bwp_start;// + uint8_t subcarrier_spacing;// + uint8_t cyclic_prefix;// + uint16_t start_rb; + uint16_t nr_of_rbs; + uint8_t csi_type;//Value: 0:TRS 1:CSI-RS NZP 2:CSI-RS ZP + uint8_t row;//Row entry into the CSI Resource location table. [TS38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1] Value: 1-18 + uint16_t freq_domain;//Value: Up to the 12 LSBs, actual size is determined by the Row parameter + uint8_t symb_l0;//The time domain location l0 and firstOFDMSymbolInTimeDomain Value: 0->13 + uint8_t symb_l1;// + uint8_t cdm_type; + uint8_t freq_density;//The density field, p and comb offset (for dot5).0: dot5 (even RB), 1: dot5 (odd RB), 2: one, 3: three + uint16_t scramb_id;//ScramblingID of the CSI-RS [TS38.214, sec 5.2.2.3.1] Value: 0->1023 +} fapi_nr_dl_config_csirs_pdu_rel15_t; + + +typedef struct { + fapi_nr_dl_config_csirs_pdu_rel15_t csirs_config_rel15; +} fapi_nr_dl_config_csirs_pdu; + + typedef struct { uint8_t pdu_type; union { fapi_nr_dl_config_dci_pdu dci_config_pdu; fapi_nr_dl_config_dlsch_pdu dlsch_config_pdu; + fapi_nr_dl_config_csirs_pdu csirs_config_pdu; }; } fapi_nr_dl_config_request_pdu_t; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index a9632fb330..c7faf01c00 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -353,6 +353,7 @@ and fills the PRACH PDU per each FD occasion. */ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, int thread_id); void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, int thread_id); +void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot); /* \brief This function schedules the Msg3 transmission @param diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index cfa8b88f32..fac34ddf9e 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -899,6 +899,9 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in nr_dcireq_t dcireq; if(mac->cg != NULL){ // we have a cg + + nr_schedule_csirs_reception(mac, rx_frame, rx_slot); + dcireq.module_id = mod_id; dcireq.gNB_index = gNB_index; dcireq.cc_id = cc_id; @@ -2095,7 +2098,8 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in } // CSI - if (mac->ra.ra_state == RA_SUCCEEDED) + if (mac->ra.ra_state == RA_SUCCEEDED || + get_softmodem_params()->phy_test == 1) O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch); // ACKNACK @@ -2141,7 +2145,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in if (N_UCI > 0) { - pucch->resource_set_id = find_pucch_resource_set(mac, N_UCI); + pucch->resource_set_id = find_pucch_resource_set(mac, O_ACK + O_CSI); select_pucch_resource(mac, pucch); fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP); fapi_nr_ul_config_pucch_pdu *pucch_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pucch_config_pdu; @@ -2161,6 +2165,146 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in } + +void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { + + if (mac->ra.ra_state == RA_SUCCEEDED || + get_softmodem_params()->phy_test == 1) { + + NR_CellGroupConfig_t *CellGroup = mac->cg; + + if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || + !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) + return; + + NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; + + if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList == NULL) + return; + + fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; + NR_NZP_CSI_RS_Resource_t *nzpcsi; + int period, offset; + NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; + int mu = mac->DLbwp[dl_bwp_id-1] ? + mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing : + mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing; + + for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ + nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; + csi_period_offset(NULL,nzpcsi,&period,&offset); + if((frame*nr_slots_per_frame[mu]+slot-offset)%period == 0) { + LOG_I(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot); + fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15; + + NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; + + if(mac->DLbwp[dl_bwp_id-1]){ + csirs_config_pdu->bwp_size = NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + } + else{ + csirs_config_pdu->bwp_size = NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + } + csirs_config_pdu->subcarrier_spacing = mu; + csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB; + csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs; + csirs_config_pdu->csi_type = 1; // NZP-CSI-RS + csirs_config_pdu->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain; + if (resourceMapping.firstOFDMSymbolInTimeDomain2) + csirs_config_pdu->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2; + csirs_config_pdu->cdm_type = resourceMapping.cdm_Type; + csirs_config_pdu->freq_density = resourceMapping.density.present; + if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5) + && (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs)) + csirs_config_pdu->freq_density--; + csirs_config_pdu->scramb_id = nzpcsi->scramblingID; + switch(resourceMapping.frequencyDomainAllocation.present){ + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1: + csirs_config_pdu->row = 1; + csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: + csirs_config_pdu->row = 2; + csirs_config_pdu->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | + ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: + csirs_config_pdu->row = 4; + csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: + csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; + // determining the row of table 7.4.1.5.3-1 in 38.211 + switch(resourceMapping.nrofPorts){ + case NR_CSI_RS_ResourceMapping__nrofPorts_p1: + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p2: + csirs_config_pdu->row = 3; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p4: + csirs_config_pdu->row = 5; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p8: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 8; + else{ + int num_k = 0; + for (int k=0; k<6; k++) + num_k+=(((csirs_config_pdu->freq_domain)>>k)&0x01); + if(num_k==4) + csirs_config_pdu->row = 6; + else + csirs_config_pdu->row = 7; + } + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p12: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 10; + else + csirs_config_pdu->row = 9; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p16: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 12; + else + csirs_config_pdu->row = 11; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p24: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 14; + else{ + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) + csirs_config_pdu->row = 15; + else + csirs_config_pdu->row = 13; + } + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p32: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 17; + else{ + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) + csirs_config_pdu->row = 18; + else + csirs_config_pdu->row = 16; + } + break; + default: + AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n"); + } + break; + default: + AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); + } + dl_config->number_pdus = dl_config->number_pdus + 1; + } + } + } +} + + // This function schedules the PRACH according to prach_ConfigurationIndex and TS 38.211, tables 6.3.3.2.x // PRACH formats 9, 10, 11 are corresponding to dual PRACH format configurations A1/B1, A2/B2, A3/B3. // - todo: diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7387bfe698..cffcc00b86 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2229,7 +2229,7 @@ void nr_csirs_scheduling(int Mod_idP, if((frame*n_slots_frame+slot-offset)%period == 0) { - LOG_I(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot); + LOG_D(MAC,"Scheduling CSI-RS in frame %d slot %d\n",frame,slot); nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); From 67c2ddb74259f5459d3e3d889b4f41c9a87337c2 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 19 Nov 2021 15:43:56 +0000 Subject: [PATCH 118/883] Fix SRS mapping at UE for a number of PRBs higher than 53 --- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index 8cd26e2db8..d3de585bf1 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -197,6 +197,8 @@ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, /* for each antenna ports for transmission */ for (int p_index = 0; p_index < N_ap; p_index++) { + uint8_t ofdm_symbol = 0; + /* see TS 38.211 6.4.1.4.2 Sequence generation */ n_SRS_cs_i = (n_SRS_cs + (n_SRS_cs_max * (SRS_antenna_port[p_index] - 1000)/N_ap))%n_SRS_cs_max; @@ -365,22 +367,29 @@ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, rv_ul_ref_sig[u][v_nu][M_sc_b_SRS_index][2*k+1]); #endif - txptr[subcarrier] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000); + txptr[subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000); #ifdef SRS_DEBUG - if( (subcarrier-frame_parms->first_carrier_offset)%12 == 0 ) { - LOG_I(NR_PHY,"---------- %i ----------\n", (subcarrier-frame_parms->first_carrier_offset)/12); + if( (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset)%12 == 0 ) { + LOG_I(NR_PHY,"------------ %i ------------\n", + (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset)/12); } - LOG_I(NR_PHY,"(%i)\t%i\t%i\n", subcarrier-frame_parms->first_carrier_offset, real_amp&0xFFFF, imag_amp&0xFFFF); + LOG_I(NR_PHY,"(%i) \t%i\t%i\n", + subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset, + real_amp&0xFFFF, + imag_amp&0xFFFF); #endif subcarrier += (K_TC); /* subcarrier increment */ - if (subcarrier >= frame_parms->ofdm_symbol_size) + if (subcarrier >= frame_parms->ofdm_symbol_size) { subcarrier=subcarrier-frame_parms->ofdm_symbol_size; + ofdm_symbol++; + } + } /* process next symbol */ - txptr = txptr + frame_parms->ofdm_symbol_size; + //txptr = txptr + frame_parms->ofdm_symbol_size; } return (0); From 79be6685fdb77852fad69249fcf544dc708997bd Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 19 Nov 2021 17:42:24 +0100 Subject: [PATCH 119/883] changes in ue fapi handling to include csi-rs pdu --- .../nfapi/public_inc/fapi_nr_ue_constants.h | 3 +- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 155 ++++++++++-------- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 1 + 3 files changed, 87 insertions(+), 72 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h index e144ce9447..fec03b4915 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h @@ -46,7 +46,8 @@ #define FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH 0x03 #define FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH 0x04 #define FAPI_NR_DL_CONFIG_TYPE_P_DLSCH 0x05 -#define FAPI_NR_DL_CONFIG_TYPES 0x05 +#define FAPI_NR_DL_CONFIG_TYPE_CSI_RS 0x06 +#define FAPI_NR_DL_CONFIG_TYPES 0x06 #define FAPI_NR_CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01 #define FAPI_NR_CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02 diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 697f5b19d1..bc5fb020ce 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -45,6 +45,56 @@ extern PHY_VARS_NR_UE ***PHY_vars_UE_g; const char *dl_pdu_type[]={"DCI", "DLSCH", "RA_DLSCH", "SI_DLSCH", "P_DLSCH"}; const char *ul_pdu_type[]={"PRACH", "PUCCH", "PUSCH", "SRS"}; + +void configure_dlsch(NR_UE_DLSCH_t *dlsch0, + fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, + int rnti) { + + uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr; + dlsch0->current_harq_pid = current_harq_pid; + dlsch0->active = 1; + dlsch0->rnti = rnti; + + LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid); + + NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid]; + if (dlsch0_harq){ + dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart; + dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize; + dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs; + dlsch0_harq->start_rb = dlsch_config_pdu->start_rb; + dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols; + dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol; + dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos; + dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType; + dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups; + dlsch0_harq->mcs = dlsch_config_pdu->mcs; + dlsch0_harq->rvidx = dlsch_config_pdu->rv; + dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; + //get nrOfLayers from DCI info + uint8_t Nl = 0; + for (int i = 0; i < 4; i++) { + if (dlsch_config_pdu->dmrs_ports[i] >= i) Nl += 1; + } + dlsch0_harq->Nl = Nl; + dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table; + downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type); + if (dlsch0_harq->status != ACTIVE) { + // dlsch0_harq->status not ACTIVE may be due to false retransmission. + // Reset the following flag to skip PDSCH procedures in that case. + dlsch0->active = 0; + } + /* PTRS */ + dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity; + dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity; + dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex; + dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS; + dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset; + dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap; + LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs); + } +} + int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ bool found = false; @@ -52,7 +102,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ module_id_t module_id = scheduled_response->module_id; uint8_t cc_id = scheduled_response->CC_id, thread_id; - uint32_t i; int slot = scheduled_response->slot; // Note: we have to handle the thread IDs for this. To be revisited completely. @@ -64,86 +113,50 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ if(scheduled_response->dl_config != NULL){ fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config; - + fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu; + fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config; pdcch_vars->nb_search_space = 0; - for (i = 0; i < dl_config->number_pdus; ++i){ + for (int i = 0; i < dl_config->number_pdus; ++i){ AssertFatal(dl_config->number_pdus < FAPI_NR_DL_CONFIG_LIST_NUM,"dl_config->number_pdus %d out of bounds\n",dl_config->number_pdus); AssertFatal(dl_config->dl_config_list[i].pdu_type<=FAPI_NR_DL_CONFIG_TYPES,"pdu_type %d > 2\n",dl_config->dl_config_list[i].pdu_type); LOG_D(PHY, "In %s: frame %d slot %d received 1 DL %s PDU of %d total DL PDUs:\n", __FUNCTION__, scheduled_response->frame, slot, dl_pdu_type[dl_config->dl_config_list[i].pdu_type - 1], dl_config->number_pdus); - if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_DCI) { - - fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; - memcpy((void*)&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config)); - pdcch_vars->nb_search_space = pdcch_vars->nb_search_space + 1; - pdcch_vars->sfn = scheduled_response->frame; - pdcch_vars->slot = slot; - LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space); - - } else { - - fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15; - uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr; - - if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_DLSCH){ - dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch[thread_id][0][0]; - } - else if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH){ + switch(dl_config->dl_config_list[i].pdu_type) { + case FAPI_NR_DL_CONFIG_TYPE_DCI: + pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; + memcpy((void*)&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config)); + pdcch_vars->nb_search_space = pdcch_vars->nb_search_space + 1; + pdcch_vars->sfn = scheduled_response->frame; + pdcch_vars->slot = slot; + LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space); + break; + case FAPI_NR_DL_CONFIG_TYPE_CSI_RS: + LOG_D(PHY,"Received CSI-RS PDU at FAPI\n"); + break; + case FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH: + dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15; dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch_ra[0]; dlsch0->rnti_type = _RA_RNTI_; - dlsch0->harq_processes[current_harq_pid]->status = ACTIVE; - } - else if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH){ + dlsch0->harq_processes[dlsch_config_pdu->harq_process_nbr]->status = ACTIVE; + configure_dlsch(dlsch0, dlsch_config_pdu, + dl_config->dl_config_list[i].dlsch_config_pdu.rnti); + break; + case FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH: + dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15; dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch_SI[0]; dlsch0->rnti_type = _SI_RNTI_; - dlsch0->harq_processes[current_harq_pid]->status = ACTIVE; - } - - dlsch0->current_harq_pid = current_harq_pid; - dlsch0->active = 1; - dlsch0->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti; - - LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid); - - NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid]; - if (dlsch0_harq){ - - dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart; - dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize; - dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs; - dlsch0_harq->start_rb = dlsch_config_pdu->start_rb; - dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols; - dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol; - dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos; - dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType; - dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups; - dlsch0_harq->mcs = dlsch_config_pdu->mcs; - dlsch0_harq->rvidx = dlsch_config_pdu->rv; - dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; - //get nrOfLayers from DCI info - uint8_t Nl = 0; - for (i = 0; i < 4; i++) { - if (dlsch_config_pdu->dmrs_ports[i] >= i) Nl += 1; - } - dlsch0_harq->Nl = Nl; - dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table; - downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type); - if (dlsch0_harq->status != ACTIVE) { - // dlsch0_harq->status not ACTIVE may be due to false retransmission. Reset the - // following flag to skip PDSCH procedures in that case. - dlsch0->active = 0; - } - /* PTRS */ - dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity; - dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity; - dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex; - dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS; - dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset; - dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap; - LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs); - } + dlsch0->harq_processes[dlsch_config_pdu->harq_process_nbr]->status = ACTIVE; + configure_dlsch(dlsch0, dlsch_config_pdu, + dl_config->dl_config_list[i].dlsch_config_pdu.rnti); + break; + case FAPI_NR_DL_CONFIG_TYPE_DLSCH: + dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15; + dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch[thread_id][0][0]; + configure_dlsch(dlsch0, dlsch_config_pdu, + dl_config->dl_config_list[i].dlsch_config_pdu.rnti); + break; } } dl_config->number_pdus = 0; @@ -153,7 +166,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ fapi_nr_ul_config_request_t *ul_config = scheduled_response->ul_config; - for (i = 0; i < ul_config->number_pdus; ++i){ + for (int i = 0; i < ul_config->number_pdus; ++i){ AssertFatal(ul_config->ul_config_list[i].pdu_type <= FAPI_NR_UL_CONFIG_TYPES,"pdu_type %d out of bounds\n",ul_config->ul_config_list[i].pdu_type); LOG_D(PHY, "In %s: processing %s PDU of %d total UL PDUs (ul_config %p) \n", __FUNCTION__, ul_pdu_type[ul_config->ul_config_list[i].pdu_type - 1], ul_config->number_pdus, ul_config); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index fac34ddf9e..79f58a29e2 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2298,6 +2298,7 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { default: AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); } + dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_RS; dl_config->number_pdus = dl_config->number_pdus + 1; } } From 86f306ee25de6aae0fdd4361b1c5f32668c7ec6c Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 19 Nov 2021 17:51:41 +0000 Subject: [PATCH 120/883] Create the rrc_get_max_nr_csrs function to get a configuration for SRS which fills the entire UL BWP --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 91a9e30427..d506ee1b29 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -39,6 +39,7 @@ #include #include /* for _ASN_DEFAULT_STACK_MAX */ #include +#include #include "asn1_msg.h" #include "../nr_rrc_proto.h" @@ -985,6 +986,31 @@ uint8_t do_RRCReject(uint8_t Mod_id, return((enc_rval.encoded+7)/8); } +// TODO: Implement to b_SRS = 1 and b_SRS = 2 +long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS) { + + if(b_SRS>0) { + LOG_E(NR_RRC,"rrc_get_max_nr_csrs(): Not implemented yet for b_SRS>0\n"); + return 0; // This c_srs is always valid + } + + const uint16_t m_SRS[64] = { 4, 8, 12, 16, 16, 20, 24, 24, 28, 32, 36, 40, 48, 48, 52, 56, 60, 64, 72, 72, 76, 80, 88, + 96, 96, 104, 112, 120, 120, 120, 128, 128, 128, 132, 136, 144, 144, 144, 144, 152, 160, + 160, 160, 168, 176, 184, 192, 192, 192, 192, 208, 216, 224, 240, 240, 240, 240, 256, 256, + 256, 264, 272, 272, 272 }; + + long c_srs = 0; + uint16_t m = 4; + for(int c = 1; c<64; c++) { + if(m_SRS[c]>m && m_SRS[c]resourceMapping.repetitionFactor=NR_SRS_Resource__resourceMapping__repetitionFactor_n1; srs_res0->freqDomainPosition=0; srs_res0->freqDomainShift=0; - srs_res0->freqHopping.c_SRS = 0; srs_res0->freqHopping.b_SRS=0; srs_res0->freqHopping.b_hop=0; + srs_res0->freqHopping.c_SRS = rrc_get_max_nr_csrs( + NRRIV2BW(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, 275), + srs_res0->freqHopping.b_SRS); srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither; if(0) { From 32f090c2987132e1b6a1c871f051c3d0b4797d67 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 21 Nov 2021 09:59:19 +0100 Subject: [PATCH 121/883] minor changes for testing --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 24 ++++++++++--------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/main.c | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 ++ 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 1a844aaaf1..8df27e3d52 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -430,7 +430,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_D(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + if (no_conf) LOG_I(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d SR_flag %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); @@ -447,7 +447,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_D(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + if (no_conf) LOG_I(NR_PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d SR_flag %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,pucch_pdu->sr_flag,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 1316c8445c..7a80223be3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -485,7 +485,8 @@ void nr_store_dlsch_buffer(module_id_t module_id, DL_SCH_LCID_DCCH, 0, 0); - if ((sched_ctrl->lcid_mask&(1<<4)) > 0) + if ((sched_ctrl->lcid_mask&(1<<4)) > 0) { + start_meas(&RC.nrmac[module_id]->rlc_status_ind); sched_ctrl->rlc_status[DL_SCH_LCID_DTCH] = mac_rlc_status_ind(module_id, rnti, module_id, @@ -496,16 +497,17 @@ void nr_store_dlsch_buffer(module_id_t module_id, DL_SCH_LCID_DTCH, 0, 0); - - if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){ - lcid = DL_SCH_LCID_DCCH; - } - else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) - { - lcid = DL_SCH_LCID_DCCH1; - }else{ - lcid = DL_SCH_LCID_DTCH; - } + stop_meas(&RC.nrmac[module_id]->rlc_status_ind); + } + if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){ + lcid = DL_SCH_LCID_DCCH; + } + else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) + { + lcid = DL_SCH_LCID_DCCH1; + }else{ + lcid = DL_SCH_LCID_DTCH; + } sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; //later multiplex here. Just select DCCH/SRB before DTCH/DRB diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 2d117a3131..1939f74e65 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1025,7 +1025,7 @@ void pf_ul(module_id_t module_id, gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; NR_UE_info_t *UE_info = &nrmac->UE_info; - const int min_rb = 5; + const int min_rb = 40; float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled int ue_array[MAX_MOBILES_PER_GNB]; diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 0ea94523d5..d91b4ae793 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -130,6 +130,7 @@ void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen) print_meas(&gNB->eNB_scheduler, "DL & UL scheduling timing stats", NULL, NULL); print_meas(&gNB->schedule_dlsch,"dlsch scheduler",NULL,NULL); print_meas(&gNB->rlc_data_req, "rlc_data_req",NULL,NULL); + print_meas(&gNB->rlc_status_ind,"rlc_status_ind",NULL,NULL); } diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 007573c4c3..939bbe0e7c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -738,6 +738,8 @@ typedef struct gNB_MAC_INST_s { time_stats_t schedule_dlsch; // include rlc_data_req + MAC header + preprocessor /// processing time of rlc_data_req time_stats_t rlc_data_req; + /// processing time of rlc_status_ind + time_stats_t rlc_status_ind; /// processing time of eNB MCH scheduler time_stats_t schedule_mch; /// processing time of eNB ULSCH reception From d70b52a76c76a7bf7324eb6f9e9389988c49b874 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Nov 2021 11:53:07 +0000 Subject: [PATCH 122/883] Compute frame/slot at gNB to receive the SRS --- cmake_targets/CMakeLists.txt | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 119 ++++++++++++++++++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 + 4 files changed, 124 insertions(+) create mode 100644 openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 67f65b6848..d229175416 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2119,6 +2119,7 @@ set (MAC_NR_SRC ${NR_GNB_MAC_DIR}/gNB_scheduler_primitives.c ${NR_GNB_MAC_DIR}/gNB_scheduler_phytest.c ${NR_GNB_MAC_DIR}/gNB_scheduler_uci.c + ${NR_GNB_MAC_DIR}/gNB_scheduler_srs.c ${NR_GNB_MAC_DIR}/gNB_scheduler_RA.c ) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index b62f8e0282..90664770fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -397,6 +397,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_pucch(module_idP, frame, slot); + nr_schedule_srs(module_idP, frame, slot); + stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c new file mode 100644 index 0000000000..a117a646ae --- /dev/null +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -0,0 +1,119 @@ +/* + * 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 gNB_scheduler_srs.c + * \brief MAC procedures related to SRS + * \date 2021 + * \version 1.0 + */ + +#include +#include "LAYER2/MAC/mac.h" +#include "NR_MAC_gNB/nr_mac_gNB.h" +#include "NR_MAC_COMMON/nr_mac_extern.h" +#include "NR_MAC_gNB/mac_proto.h" +#include "common/ran_context.h" +#include "nfapi/oai_integration/vendor_ext.h" + +extern RAN_CONTEXT_t RC; + +/******************************************************************* +* +* NAME : nr_schedule_srs +* +* PARAMETERS : module id +* frame number for possible SRS reception +* slot number for possible SRS reception +* +* DESCRIPTION : It informs the PHY layer that has an SRS to receive. +* Only for periodic scheduling yet. +* +*********************************************************************/ +void nr_schedule_srs(int module_id, frame_t frame, sub_frame_t slot) { + + gNB_MAC_INST *nrmac = RC.nrmac[module_id]; + NR_UE_info_t *UE_info = &nrmac->UE_info; + const NR_list_t *UE_list = &UE_info->list; + + for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { + + const int CC_id = 0; + NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[CC_id].ServingCellConfigCommon; + NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + + if(!UE_info->active[UE_id]) { + continue; + } + + NR_SRS_Config_t *srs_config = NULL; + if (cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) { + srs_config = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->srs_Config->choice.setup; + } else { + continue; + } + + for(int rs = 0; rs < srs_config->srs_ResourceSetToAddModList->list.count; rs++) { + + // Find periodic resource set + NR_SRS_ResourceSet_t *srs_resource_set = srs_config->srs_ResourceSetToAddModList->list.array[rs]; + if (srs_resource_set->resourceType.present != NR_SRS_ResourceSet__resourceType_PR_periodic) { + continue; + } + + // Find the corresponding srs resource + NR_SRS_Resource_t *srs_resource = NULL; + for (int r1 = 0; r1 < srs_resource_set->srs_ResourceIdList->list.count; r1++) { + for (int r2 = 0; r2 < srs_config->srs_ResourceToAddModList->list.count; r2++) { + if ((*srs_resource_set->srs_ResourceIdList->list.array[r1] == + srs_config->srs_ResourceToAddModList->list.array[r2]->srs_ResourceId) && + (srs_config->srs_ResourceToAddModList->list.array[r2]->resourceType.present == + NR_SRS_Resource__resourceType_PR_periodic)) { + srs_resource = srs_config->srs_ResourceToAddModList->list.array[r2]; + break; + } + } + } + + if (srs_resource == NULL) { + continue; + } + + NR_BWP_t ubwp = sched_ctrl->active_ubwp ? + sched_ctrl->active_ubwp->bwp_Common->genericParameters : + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + + uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; + uint16_t offset = srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40; + + int n_slots_frame = nr_slots_per_frame[ubwp.subcarrierSpacing]; + + // Check if UE transmitted the SRS here + if ((frame * n_slots_frame + slot - offset) % period == 0) { + LOG_W(NR_MAC,"(%d.%d) SRS is received here, but the procedures are not implemented yet!\n", frame, slot); + } + } + } +} \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 3b275ca8a0..d15e0c9236 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -190,6 +190,8 @@ void nr_schedule_pucch(int Mod_idP, frame_t frameP, sub_frame_t slotP); +void nr_schedule_srs(int module_id, frame_t frame, sub_frame_t slot); + void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, From 5697860db1a8b7c79804333d8174346609f2c5a5 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Nov 2021 13:56:18 +0000 Subject: [PATCH 123/883] Fill NFAPI of SRS pdu --- openair1/SCHED_NR/fapi_nr_l1.c | 3 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 65 ++++++++++++++++++- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 8f315ba214..db7135e7ef 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -229,6 +229,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ nr_fill_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu); if (gNB->RU_list[0]->if_south == LOCAL_RF) nr_fill_prach_ru(gNB->RU_list[0], UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu); break; + case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE: + LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot); + break; } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index a117a646ae..e85022f06b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -26,7 +26,6 @@ */ #include -#include "LAYER2/MAC/mac.h" #include "NR_MAC_gNB/nr_mac_gNB.h" #include "NR_MAC_COMMON/nr_mac_extern.h" #include "NR_MAC_gNB/mac_proto.h" @@ -35,6 +34,67 @@ extern RAN_CONTEXT_t RC; +void nr_configure_srs(nfapi_nr_srs_pdu_t *srs_pdu, int module_id, int CC_id, int UE_id, NR_SRS_Resource_t *srs_resource) { + + gNB_MAC_INST *nrmac = RC.nrmac[module_id]; + NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; + NR_UE_info_t *UE_info = &nrmac->UE_info; + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + + NR_BWP_t ubwp = sched_ctrl->active_ubwp ? + sched_ctrl->active_ubwp->bwp_Common->genericParameters : + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + + srs_pdu->rnti = UE_info->rnti[UE_id]; + srs_pdu->handle = 0; + srs_pdu->bwp_size = NRRIV2BW(ubwp.locationAndBandwidth, MAX_BWP_SIZE);; + srs_pdu->bwp_start = NRRIV2PRBOFFSET(ubwp.locationAndBandwidth, MAX_BWP_SIZE);; + srs_pdu->subcarrier_spacing = ubwp.subcarrierSpacing; + srs_pdu->cyclic_prefix = 0; + srs_pdu->num_ant_ports = srs_resource->nrofSRS_Ports; + srs_pdu->num_symbols = srs_resource->resourceMapping.nrofSymbols; + srs_pdu->num_repetitions = srs_resource->resourceMapping.repetitionFactor; + srs_pdu->time_start_position = srs_resource->resourceMapping.startPosition; + srs_pdu->config_index = srs_resource->freqHopping.c_SRS; + srs_pdu->sequence_id = srs_resource->sequenceId; + srs_pdu->bandwidth_index = srs_resource->freqHopping.b_SRS; + srs_pdu->comb_size = srs_resource->transmissionComb.present - 1; + + switch(srs_resource->transmissionComb.present) { + case NR_SRS_Resource__transmissionComb_PR_n2: + srs_pdu->comb_offset = srs_resource->transmissionComb.choice.n2->combOffset_n2; + srs_pdu->cyclic_shift = srs_resource->transmissionComb.choice.n2->cyclicShift_n2; + break; + case NR_SRS_Resource__transmissionComb_PR_n4: + srs_pdu->comb_offset = srs_resource->transmissionComb.choice.n4->combOffset_n4; + srs_pdu->cyclic_shift = srs_resource->transmissionComb.choice.n4->cyclicShift_n4; + break; + default: + LOG_W(NR_MAC, "Invalid or not implemented comb_size!\n"); + } + + srs_pdu->frequency_position = srs_resource->freqDomainPosition; + srs_pdu->frequency_shift = srs_resource->freqDomainShift; + srs_pdu->frequency_hopping = srs_resource->freqHopping.b_hop; + srs_pdu->group_or_sequence_hopping = srs_resource->groupOrSequenceHopping; + srs_pdu->resource_type = srs_resource->resourceType.present - 1; + srs_pdu->t_srs = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; + srs_pdu->t_offset = srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40; +} + +void nr_fill_nfapi_srs(int module_id, int CC_id, int UE_id, sub_frame_t slot, NR_SRS_Resource_t *srs_resource) { + + nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][slot]; + + future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE; + future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_srs_pdu_t); + nfapi_nr_srs_pdu_t *srs_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].srs_pdu; + memset(srs_pdu, 0, sizeof(nfapi_nr_srs_pdu_t)); + future_ul_tti_req->n_pdus += 1; + + nr_configure_srs(srs_pdu, module_id, CC_id, UE_id, srs_resource); +} + /******************************************************************* * * NAME : nr_schedule_srs @@ -112,7 +172,8 @@ void nr_schedule_srs(int module_id, frame_t frame, sub_frame_t slot) { // Check if UE transmitted the SRS here if ((frame * n_slots_frame + slot - offset) % period == 0) { - LOG_W(NR_MAC,"(%d.%d) SRS is received here, but the procedures are not implemented yet!\n", frame, slot); + LOG_D(NR_MAC,"(%d.%d) Scheduling SRS reception\n", frame, slot); + nr_fill_nfapi_srs(module_id, CC_id, UE_id, slot, srs_resource); } } } From 9551cf4a82ea34e188688e1b5a0a1e34d045d518 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Nov 2021 14:27:22 +0000 Subject: [PATCH 124/883] Implementation of get_nr_srs_offset function to remove the hardcoded offset sl40 --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 53 +++++++++++++++++++ openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 2 + openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 4 +- 4 files changed, 58 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 3f4be9dd58..e0289d9301 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2495,6 +2495,59 @@ uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB) { return 4; } +/******************************************************************* +* +* NAME : get_nr_srs_offset +* +* PARAMETERS : periodicityAndOffset for SRS +* +* RETURN : the offset parameter for SRS +* +*********************************************************************/ + +uint16_t get_nr_srs_offset(NR_SRS_PeriodicityAndOffset_t periodicityAndOffset) { + + switch(periodicityAndOffset.present) { + case NR_SRS_PeriodicityAndOffset_PR_sl1: + return periodicityAndOffset.choice.sl1; + case NR_SRS_PeriodicityAndOffset_PR_sl2: + return periodicityAndOffset.choice.sl2; + case NR_SRS_PeriodicityAndOffset_PR_sl4: + return periodicityAndOffset.choice.sl4; + case NR_SRS_PeriodicityAndOffset_PR_sl5: + return periodicityAndOffset.choice.sl5; + case NR_SRS_PeriodicityAndOffset_PR_sl8: + return periodicityAndOffset.choice.sl8; + case NR_SRS_PeriodicityAndOffset_PR_sl10: + return periodicityAndOffset.choice.sl10; + case NR_SRS_PeriodicityAndOffset_PR_sl16: + return periodicityAndOffset.choice.sl16; + case NR_SRS_PeriodicityAndOffset_PR_sl20: + return periodicityAndOffset.choice.sl20; + case NR_SRS_PeriodicityAndOffset_PR_sl32: + return periodicityAndOffset.choice.sl32; + case NR_SRS_PeriodicityAndOffset_PR_sl40: + return periodicityAndOffset.choice.sl40; + case NR_SRS_PeriodicityAndOffset_PR_sl64: + return periodicityAndOffset.choice.sl64; + case NR_SRS_PeriodicityAndOffset_PR_sl80: + return periodicityAndOffset.choice.sl80; + case NR_SRS_PeriodicityAndOffset_PR_sl160: + return periodicityAndOffset.choice.sl160; + case NR_SRS_PeriodicityAndOffset_PR_sl320: + return periodicityAndOffset.choice.sl320; + case NR_SRS_PeriodicityAndOffset_PR_sl640: + return periodicityAndOffset.choice.sl640; + case NR_SRS_PeriodicityAndOffset_PR_sl1280: + return periodicityAndOffset.choice.sl1280; + case NR_SRS_PeriodicityAndOffset_PR_sl2560: + return periodicityAndOffset.choice.sl2560; + case NR_SRS_PeriodicityAndOffset_PR_NOTHING: + LOG_W(NR_MAC,"NR_SRS_PeriodicityAndOffset_PR_NOTHING\n"); + return 0; + } +} + // Set the transform precoding status according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16: // - "UE procedure for applying transform precoding on PUSCH" uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP, diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index ced29f066f..a451feba93 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -119,6 +119,8 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr uint8_t get_L_ptrs(uint8_t mcs1, uint8_t mcs2, uint8_t mcs3, uint8_t I_mcs, uint8_t mcs_table); uint8_t get_K_ptrs(uint16_t nrb0, uint16_t nrb1, uint16_t N_RB); +uint16_t get_nr_srs_offset(NR_SRS_PeriodicityAndOffset_t periodicityAndOffset); + void get_type0_PDCCH_CSS_config_parameters(NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, frame_t frameP, NR_MIB_t *mib, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 98e469d48f..e6dde3dc06 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -927,7 +927,7 @@ bool nr_ue_periodic_srs_scheduling(module_id_t mod_id, frame_t frame, slot_t slo mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters; uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; - uint16_t offset = srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40; + uint16_t offset = get_nr_srs_offset(srs_resource->resourceType.choice.periodic->periodicityAndOffset_p); int n_slots_frame = nr_slots_per_frame[ubwp.subcarrierSpacing]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index e85022f06b..2a0429614e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -79,7 +79,7 @@ void nr_configure_srs(nfapi_nr_srs_pdu_t *srs_pdu, int module_id, int CC_id, int srs_pdu->group_or_sequence_hopping = srs_resource->groupOrSequenceHopping; srs_pdu->resource_type = srs_resource->resourceType.present - 1; srs_pdu->t_srs = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; - srs_pdu->t_offset = srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40; + srs_pdu->t_offset = get_nr_srs_offset(srs_resource->resourceType.choice.periodic->periodicityAndOffset_p); } void nr_fill_nfapi_srs(int module_id, int CC_id, int UE_id, sub_frame_t slot, NR_SRS_Resource_t *srs_resource) { @@ -166,7 +166,7 @@ void nr_schedule_srs(int module_id, frame_t frame, sub_frame_t slot) { scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; uint16_t period = srs_period[srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.present]; - uint16_t offset = srs_resource->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40; + uint16_t offset = get_nr_srs_offset(srs_resource->resourceType.choice.periodic->periodicityAndOffset_p); int n_slots_frame = nr_slots_per_frame[ubwp.subcarrierSpacing]; From 1f75a9780df1b160f02d8a406605c97b167eed5d Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 22 Nov 2021 16:27:42 +0100 Subject: [PATCH 125/883] scheduling of csi for im --- .../nfapi/public_inc/fapi_nr_ue_constants.h | 3 +- .../nfapi/public_inc/fapi_nr_ue_interface.h | 17 +++++ openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 5 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 32 ++++----- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 2 +- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 69 ++++++++++++++++++- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 8 files changed, 109 insertions(+), 22 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h index fec03b4915..32a15cfcdf 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_constants.h @@ -47,7 +47,8 @@ #define FAPI_NR_DL_CONFIG_TYPE_SI_DLSCH 0x04 #define FAPI_NR_DL_CONFIG_TYPE_P_DLSCH 0x05 #define FAPI_NR_DL_CONFIG_TYPE_CSI_RS 0x06 -#define FAPI_NR_DL_CONFIG_TYPES 0x06 +#define FAPI_NR_DL_CONFIG_TYPE_CSI_IM 0x07 +#define FAPI_NR_DL_CONFIG_TYPES 0x07 #define FAPI_NR_CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01 #define FAPI_NR_CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02 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 7e594205fa..554a194175 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 @@ -452,17 +452,34 @@ typedef struct { } fapi_nr_dl_config_csirs_pdu_rel15_t; +typedef struct { + uint16_t bwp_size; + uint16_t bwp_start; + uint8_t subcarrier_spacing; + uint16_t start_rb; + uint16_t nr_of_rbs; + uint8_t k_csiim[4]; + uint8_t l_csiim[4]; +} fapi_nr_dl_config_csiim_pdu_rel15_t; + + typedef struct { fapi_nr_dl_config_csirs_pdu_rel15_t csirs_config_rel15; } fapi_nr_dl_config_csirs_pdu; +typedef struct { + fapi_nr_dl_config_csiim_pdu_rel15_t csiim_config_rel15; +} fapi_nr_dl_config_csiim_pdu; + + typedef struct { uint8_t pdu_type; union { fapi_nr_dl_config_dci_pdu dci_config_pdu; fapi_nr_dl_config_dlsch_pdu dlsch_config_pdu; fapi_nr_dl_config_csirs_pdu csirs_config_pdu; + fapi_nr_dl_config_csiim_pdu csiim_config_pdu; }; } fapi_nr_dl_config_request_pdu_t; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index bc5fb020ce..21d05c5ea0 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -132,8 +132,11 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ pdcch_vars->slot = slot; LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space); break; + case FAPI_NR_DL_CONFIG_TYPE_CSI_IM: + LOG_I(PHY,"Received CSI-IM PDU at FAPI\n"); + break; case FAPI_NR_DL_CONFIG_TYPE_CSI_RS: - LOG_D(PHY,"Received CSI-RS PDU at FAPI\n"); + LOG_I(PHY,"Received CSI-RS PDU at FAPI\n"); break; case FAPI_NR_DL_CONFIG_TYPE_RA_DLSCH: dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 3f4be9dd58..f6d248e461 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -3282,65 +3282,65 @@ uint16_t get_ssb_start_symbol(const long band, NR_SubcarrierSpacing_t scs, int i void csi_period_offset(NR_CSI_ReportConfig_t *csirep, - NR_NZP_CSI_RS_Resource_t *nzpcsi, + struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset, int *period, int *offset) { - if(nzpcsi != NULL) { + if(periodicityAndOffset != NULL) { - NR_CSI_ResourcePeriodicityAndOffset_PR p_and_o = nzpcsi->periodicityAndOffset->present; + NR_CSI_ResourcePeriodicityAndOffset_PR p_and_o = periodicityAndOffset->present; switch(p_and_o){ case NR_CSI_ResourcePeriodicityAndOffset_PR_slots4: *period = 4; - *offset = nzpcsi->periodicityAndOffset->choice.slots4; + *offset = periodicityAndOffset->choice.slots4; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots5: *period = 5; - *offset = nzpcsi->periodicityAndOffset->choice.slots5; + *offset = periodicityAndOffset->choice.slots5; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots8: *period = 8; - *offset = nzpcsi->periodicityAndOffset->choice.slots8; + *offset = periodicityAndOffset->choice.slots8; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots10: *period = 10; - *offset = nzpcsi->periodicityAndOffset->choice.slots10; + *offset = periodicityAndOffset->choice.slots10; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots16: *period = 16; - *offset = nzpcsi->periodicityAndOffset->choice.slots16; + *offset = periodicityAndOffset->choice.slots16; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots20: *period = 20; - *offset = nzpcsi->periodicityAndOffset->choice.slots20; + *offset = periodicityAndOffset->choice.slots20; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots32: *period = 32; - *offset = nzpcsi->periodicityAndOffset->choice.slots32; + *offset = periodicityAndOffset->choice.slots32; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots40: *period = 40; - *offset = nzpcsi->periodicityAndOffset->choice.slots40; + *offset = periodicityAndOffset->choice.slots40; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots64: *period = 64; - *offset = nzpcsi->periodicityAndOffset->choice.slots64; + *offset = periodicityAndOffset->choice.slots64; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots80: *period = 80; - *offset = nzpcsi->periodicityAndOffset->choice.slots80; + *offset = periodicityAndOffset->choice.slots80; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots160: *period = 160; - *offset = nzpcsi->periodicityAndOffset->choice.slots160; + *offset = periodicityAndOffset->choice.slots160; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots320: *period = 320; - *offset = nzpcsi->periodicityAndOffset->choice.slots320; + *offset = periodicityAndOffset->choice.slots320; break; case NR_CSI_ResourcePeriodicityAndOffset_PR_slots640: *period = 640; - *offset = nzpcsi->periodicityAndOffset->choice.slots640; + *offset = periodicityAndOffset->choice.slots640; break; default: AssertFatal(1==0,"No periodicity and offset found in CSI resource"); diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index ced29f066f..bff461d342 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -158,7 +158,7 @@ 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 csi_period_offset(NR_CSI_ReportConfig_t *csirep, - NR_NZP_CSI_RS_Resource_t *nzpcsi, + struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset, int *period, int *offset); void reverse_n_bits(uint8_t *value, uint16_t bitlen); diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index c7faf01c00..61218f6310 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -354,6 +354,7 @@ and fills the PRACH PDU per each FD occasion. void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, int thread_id); void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, int thread_id); void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot); +void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot); /* \brief This function schedules the Msg3 transmission @param diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 79f58a29e2..3bf50f3a49 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -901,6 +901,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in if(mac->cg != NULL){ // we have a cg nr_schedule_csirs_reception(mac, rx_frame, rx_slot); + nr_schedule_csi_for_im(mac, rx_frame, rx_slot); dcireq.module_id = mod_id; dcireq.gNB_index = gNB_index; @@ -2166,6 +2167,70 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in } +void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) { + + if (mac->ra.ra_state == RA_SUCCEEDED || + get_softmodem_params()->phy_test == 1) { + + NR_CellGroupConfig_t *CellGroup = mac->cg; + + if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || + !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) + return; + + NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; + + if (csi_measconfig->csi_IM_ResourceToAddModList == NULL) + return; + + fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; + NR_CSI_IM_Resource_t *imcsi; + int period, offset; + NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; + int mu = mac->DLbwp[dl_bwp_id-1] ? + mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing : + mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing; + + for (int id = 0; id < csi_measconfig->csi_IM_ResourceToAddModList->list.count; id++){ + imcsi = csi_measconfig->csi_IM_ResourceToAddModList->list.array[id]; + csi_period_offset(NULL,imcsi->periodicityAndOffset,&period,&offset); + if((frame*nr_slots_per_frame[mu]+slot-offset)%period == 0) { + fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csiim_config_pdu.csiim_config_rel15; + if(mac->DLbwp[dl_bwp_id-1]){ + csiim_config_pdu->bwp_size = NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + } + else{ + csiim_config_pdu->bwp_size = NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + } + csiim_config_pdu->subcarrier_spacing = mu; + csiim_config_pdu->start_rb = imcsi->freqBand->startingRB; + csiim_config_pdu->nr_of_rbs = imcsi->freqBand->nrofRBs; + // As specified in 5.2.2.4 of 38.214 + switch (imcsi->csi_IM_ResourceElementPattern->present) { + case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0: + for (int i = 0; i<4; i++) { + csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern0->subcarrierLocation_p0<<1) + (i>>1); + csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern0->symbolLocation_p0 + (i%2); + } + break; + case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1: + for (int i = 0; i<4; i++) { + csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1<<2) + i; + csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1; + } + break; + default: + AssertFatal(1==0, "Invalid CSI-IM pattern\n"); + } + dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_IM; + dl_config->number_pdus = dl_config->number_pdus + 1; + } + } + } +} + void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { if (mac->ra.ra_state == RA_SUCCEEDED || @@ -2192,9 +2257,9 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; - csi_period_offset(NULL,nzpcsi,&period,&offset); + csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset); if((frame*nr_slots_per_frame[mu]+slot-offset)%period == 0) { - LOG_I(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot); + LOG_D(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot); fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15; NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index cffcc00b86..0c2351639f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2225,7 +2225,7 @@ void nr_csirs_scheduling(int Mod_idP, for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; - csi_period_offset(NULL,nzpcsi,&period,&offset); + csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset); if((frame*n_slots_frame+slot-offset)%period == 0) { From c2d948a0554f8d4f90b6ff13c446dedd547c4b66 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Nov 2021 17:46:48 +0000 Subject: [PATCH 126/883] Implementation of the remaining procedures until call the new PHY function nr_get_srs_signal at gNB --- cmake_targets/CMakeLists.txt | 1 + openair1/PHY/INIT/nr_init.c | 6 ++ .../PHY/NR_TRANSPORT/nr_transport_proto.h | 8 ++ openair1/PHY/NR_TRANSPORT/srs_rx.c | 91 +++++++++++++++++++ openair1/PHY/defs_gNB.h | 11 +++ openair1/SCHED_NR/fapi_nr_l1.c | 1 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 13 +++ 7 files changed, 131 insertions(+) create mode 100644 openair1/PHY/NR_TRANSPORT/srs_rx.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index d229175416..b631192dc3 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1804,6 +1804,7 @@ set(PHY_SRC_UE ${PHY_SMALLBLOCKSRC} ${PHY_NR_CODINGIF} ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c + ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/srs_rx.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_uci_tools_common.c ) set(PHY_NR_UE_SRC diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index cd4848ea8c..1efa86a841 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -546,6 +546,12 @@ void init_nr_transport(PHY_VARS_gNB *gNB) { AssertFatal(gNB->pucch[i]!=NULL,"Can't initialize pucch %d \n", i); } + for (int i=0; isrs[i] = new_gNB_srs(); + AssertFatal(gNB->srs[i]!=NULL,"Can't initialize srs %d \n", i); + } + for (int i=0; inumber_of_nr_ulsch_max; i++) { LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max); diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 4fed3a468f..3d1d040fd1 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -310,6 +310,14 @@ int nr_find_pucch(uint16_t rnti, int slot, PHY_VARS_gNB *gNB); +NR_gNB_SRS_t *new_gNB_srs(void); + +void nr_fill_srs(PHY_VARS_gNB *gNB, + int frame, + int slot, + nfapi_nr_srs_pdu_t *srs_pdu); + +void nr_get_srs_signal(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_srs_pdu_t *srs_pdu); void init_prach_list(PHY_VARS_gNB *gNB); void init_prach_ru_list(RU_t *ru); diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c new file mode 100644 index 0000000000..c1478ff047 --- /dev/null +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -0,0 +1,91 @@ +/* + * 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/NR_TRANSPORT/srs_rx.c + * \brief Top-level routines for getting the SRS physical channel + * \date 2021 + * \version 1.0 + */ + +#include +#include +#include +#include + +#include "PHY/impl_defs_nr.h" +#include "PHY/defs_nr_common.h" +#include "PHY/defs_gNB.h" +#include +#include "common/utils/LOG/log.h" + +#include "nfapi/oai_integration/vendor_ext.h" + +#include "T.h" + +NR_gNB_SRS_t *new_gNB_srs(void){ + NR_gNB_SRS_t *srs; + srs = (NR_gNB_SRS_t *)malloc16(sizeof(NR_gNB_SRS_t)); + srs->active = 0; + return (srs); +} + +int nr_find_srs(uint16_t rnti, + int frame, + int slot, + PHY_VARS_gNB *gNB) { + + AssertFatal(gNB!=NULL,"gNB is null\n"); + int index = -1; + + for (int i=0; isrs[i]!=NULL,"gNB->srs[%d] is null\n",i); + if ((gNB->srs[i]->active >0) && + (gNB->srs[i]->srs_pdu.rnti==rnti) && + (gNB->srs[i]->frame==frame) && + (gNB->srs[i]->slot==slot)) return(i); + else if ((gNB->srs[i]->active == 0) && (index==-1)) index=i; + } + + if (index==-1) + LOG_E(MAC,"SRS list is full\n"); + + return(index); +} + +void nr_fill_srs(PHY_VARS_gNB *gNB, + int frame, + int slot, + nfapi_nr_srs_pdu_t *srs_pdu) { + + int id = nr_find_srs(srs_pdu->rnti,frame,slot,gNB); + AssertFatal( (id>=0) && (idrnti,id); + + NR_gNB_SRS_t *srs = gNB->srs[id]; + srs->frame = frame; + srs->slot = slot; + srs->active = 1; + memcpy((void*)&srs->srs_pdu, (void*)srs_pdu, sizeof(nfapi_nr_srs_pdu_t)); +} + +void nr_get_srs_signal(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_srs_pdu_t *srs_pdu) { + LOG_W(NR_PHY, "(%d.%d) nr_get_srs_signal is not implemented yet!\n", frame,slot); +} \ No newline at end of file diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 11b5112a6c..ab0ccaf833 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -411,6 +411,16 @@ typedef struct { nfapi_nr_pucch_pdu_t pucch_pdu; } NR_gNB_PUCCH_t; +typedef struct { + uint8_t active; + /// Frame where current SRS pdu was received + uint32_t frame; + /// Slot where current SRS pdu was received + uint32_t slot; + /// ULSCH PDU + nfapi_nr_srs_pdu_t srs_pdu; +} NR_gNB_SRS_t; + typedef struct { /// \brief Pointers (dynamic) to the received data in the time domain. /// - first index: rx antenna [0..nb_antennas_rx[ @@ -770,6 +780,7 @@ typedef struct PHY_VARS_gNB_s { NR_gNB_PRACH prach_vars; NR_gNB_PUSCH *pusch_vars[NUMBER_OF_NR_ULSCH_MAX]; NR_gNB_PUCCH_t *pucch[NUMBER_OF_NR_PUCCH_MAX]; + NR_gNB_SRS_t *srs[NUMBER_OF_NR_SRS_MAX]; NR_gNB_PDCCH_t pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX]; NR_gNB_UL_PDCCH_t ul_pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX]; NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2]; // Nusers times two spatial streams diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index db7135e7ef..a611baf898 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -231,6 +231,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ break; case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE: LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot); + nr_fill_srs(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].srs_pdu); break; } } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index ab33fb07eb..cf08918e71 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -797,6 +797,19 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } } } + + for (int i=0;isrs[i]; + if (srs) { + if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) { + LOG_D(NR_PHY, "(%d.%d) gNB is waiting for SRS, id = %i\n", frame_rx, slot_rx, i); + nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu; + nr_get_srs_signal(gNB,frame_rx,slot_rx,srs_pdu); + srs->active = 0; + } + } + } + stop_meas(&gNB->phy_proc_rx); // figure out a better way to choose slot_rx, 19 is ok for a particular TDD configuration with 30kHz SCS if ((frame_rx&127) == 0 && slot_rx==19) { From cce7ed5483ff096ec36892742bddab50cdb64485 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 22 Nov 2021 18:35:52 +0000 Subject: [PATCH 127/883] Remove obsolete code and fix build warnings --- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 33 ------------------- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.h | 8 ++--- openair1/SCHED_NR/phy_procedures_nr_common.c | 16 ++++++--- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 10 ------ openair1/SCHED_NR/sched_nr.h | 1 - openair1/SCHED_NR_UE/defs.h | 12 ------- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 2 ++ 7 files changed, 18 insertions(+), 64 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index d3de585bf1..7552f373d3 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -395,39 +395,6 @@ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, return (0); } -/******************************************************************* -* -* NAME : is_srs_period_nr -* -* PARAMETERS : pointer to resource set -* pointer to transmit buffer -* amplitude scaling for this physical signal -* slot number of transmission -* RETURN : 0 if it is a valid slot for transmitting srs -* -1 if srs should not be transmitted -* -* DESCRIPTION : for periodic, -* -*********************************************************************/ -int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, NR_DL_FRAME_PARMS *frame_parms, int frame_tx, int slot_tx) -{ - uint16_t T_SRS = srs_period[p_SRS_Resource->SRS_Periodicity]; - uint16_t T_offset = p_SRS_Resource->SRS_Offset; /* FFS_TODO_NR to check interface */ - - if (T_offset > T_SRS) { - LOG_E(PHY,"is_srs_occasion_nr: T_offset %d is greater than T_SRS %d!\n", T_offset, T_SRS); - return (-1); - } - - int16_t N_slot_frame = frame_parms->slots_per_frame; - if ((N_slot_frame*frame_tx + slot_tx - T_offset)%T_SRS == 0) { - return (0); - } - else { - return (-1); - } -} - /******************************************************************* * * NAME : ue_srs_procedures_nr diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h index b82a9f8f7a..5abf064fef 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h @@ -141,10 +141,10 @@ EXTERN const uint16_t srs_periodicity[SRS_PERIODICITY] @returns 0 on success -1 on error with message */ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, - NR_DL_FRAME_PARMS *frame_parms, - int32_t *txptr, - int16_t amp, - UE_nr_rxtx_proc_t *proc); + NR_DL_FRAME_PARMS *frame_parms, + int32_t *txptr, + int16_t amp, + UE_nr_rxtx_proc_t *proc); /** \brief This function checks for periodic srs if srs should be transmitted in this slot * @param p_SRS_Resource pointer to active resource diff --git a/openair1/SCHED_NR/phy_procedures_nr_common.c b/openair1/SCHED_NR/phy_procedures_nr_common.c index add5a169c3..8d1f615569 100755 --- a/openair1/SCHED_NR/phy_procedures_nr_common.c +++ b/openair1/SCHED_NR/phy_procedures_nr_common.c @@ -19,9 +19,17 @@ * contact@openairinterface.org */ -#include "PHY/defs_gNB.h" +/*! \file phy_procedures_lte_eNB.c +* \brief Implementation of common utilities for eNB/UE procedures from 36.213 LTE specifications +* \author R. Knopp, F. Kaltenberger +* \date 2011 +* \version 0.1 +* \company Eurecom +* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr +* \note +* \warning +*/ -bool is_srs_occasion_nr(NR_DL_FRAME_PARMS frame_parms, int frame_rx, int slot_rx) { - return false; -} +#include "sched_nr.h" +#include "PHY/INIT/phy_init.h" diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index cf08918e71..c9058d471b 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -199,14 +199,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); } -void srs_procedures_nr(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { - - if(is_srs_occasion_nr(gNB->frame_parms, frame_rx, slot_rx)) { - LOG_W(NR_PHY, "SRS procedures are not implemented yet!\n"); - } - -} - void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { ldpcDecode_t *rdata = (ldpcDecode_t*) NotifiedFifoData(req); NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq; @@ -638,8 +630,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } } else num_symb=NR_NUMBER_OF_SYMBOLS_PER_SLOT; - - srs_procedures_nr(gNB, frame_rx, slot_rx); gNB_I0_measurements(gNB,slot_rx,first_symb,num_symb); int offset = 10*gNB->frame_parms.ofdm_symbol_size + gNB->frame_parms.first_carrier_offset; diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index 706aaf4aec..d7e0332b85 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -54,6 +54,5 @@ void nr_fep_full(RU_t *ru, int slot); void nr_fep_full_2thread(RU_t *ru, int slot); void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); int nr_phy_init_RU(RU_t *ru); -bool is_srs_occasion_nr(NR_DL_FRAME_PARMS frame_parms, int frame_rx, int slot_rx); #endif diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index 6f3c2c2df4..9e1c31abd8 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -358,24 +358,12 @@ int16_t nr_pucch_power_cntl(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t s */ 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); -/*! \brief This function implements the power control mechanism for SRS 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_srs_power_cntl(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t *pnb_rb_srs, 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); -bool is_srs_occasion_nr(NR_DL_FRAME_PARMS frame_parms, int frame_rx, int slot_rx); -void compute_srs_pos_nr(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); - 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/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index e0289d9301..942e3afad1 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2545,6 +2545,8 @@ uint16_t get_nr_srs_offset(NR_SRS_PeriodicityAndOffset_t periodicityAndOffset) { case NR_SRS_PeriodicityAndOffset_PR_NOTHING: LOG_W(NR_MAC,"NR_SRS_PeriodicityAndOffset_PR_NOTHING\n"); return 0; + default: + return 0; } } From b8e81a15fd8a829d30d787f1a019dd86ec705194 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 23 Nov 2021 11:26:08 +0000 Subject: [PATCH 128/883] Revert "Add T support for GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA" This reverts commit 0b88c164277eec2d13f5ebb28e08bea5774cb60f. --- common/utils/T/T_messages.txt | 4 ---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 --- 2 files changed, 7 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 192bf8cc37..cd66be73f5 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -155,10 +155,6 @@ ID = GNB_MAC_DL_RAR_PDU_WITH_DATA DESC = NR MAC downlink PDU for RAR GROUP = ALL:MAC:GNB:WIRESHARK FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data -ID = GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA - DESC = NR MAC downlink retransmitted PDU for an UE - GROUP = ALL:MAC:GNB:WIRESHARK - FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : int,round : buffer,data #RLC logs ID = ENB_RLC_DL diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d8b168ae75..568f8abc37 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1200,9 +1200,6 @@ void nr_schedule_ue_spec(module_id_t module_id, "UE %d mismatch between scheduled TBS and buffered TB for HARQ PID %d\n", UE_id, current_harq_pid); - - T(T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti), - T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->tb, TBS)); } else { /* initial transmission */ LOG_D(NR_MAC, "[%s] Initial HARQ transmission in %d.%d\n", __FUNCTION__, frame, slot); From 2fb5ec3a5ff32786c5d3dd956db4f26f15eeb1ce Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 Nov 2021 11:44:04 +0100 Subject: [PATCH 129/883] T tracer: trace MAC DL retransmission PDUs in the gnb and adapt macpdu2wireshark to deal with them --- common/utils/T/T_messages.txt | 4 ++ common/utils/T/tracer/macpdu2wireshark.c | 52 ++++++++++++++++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 ++ 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index cd66be73f5..192bf8cc37 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -155,6 +155,10 @@ ID = GNB_MAC_DL_RAR_PDU_WITH_DATA DESC = NR MAC downlink PDU for RAR GROUP = ALL:MAC:GNB:WIRESHARK FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data +ID = GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA + DESC = NR MAC downlink retransmitted PDU for an UE + GROUP = ALL:MAC:GNB:WIRESHARK + FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : int,round : buffer,data #RLC logs ID = ENB_RLC_DL diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c index d04f2c317d..c473888180 100644 --- a/common/utils/T/tracer/macpdu2wireshark.c +++ b/common/utils/T/tracer/macpdu2wireshark.c @@ -65,6 +65,11 @@ typedef struct { int nr_dl_frame; int nr_dl_slot; int nr_dl_data; + /* NR dl retx */ + int nr_dl_retx_rnti; + int nr_dl_retx_frame; + int nr_dl_retx_slot; + int nr_dl_retx_data; /* NR mib */ int nr_mib_frame; int nr_mib_slot; @@ -338,6 +343,16 @@ void nr_dl(void *_d, event e) e.e[d->nr_dl_data].b, e.e[d->nr_dl_data].bsize, NO_PREAMBLE); } +void nr_dl_retx(void *_d, event e) +{ + ev_data *d = _d; + + trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i, + e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i, + e.e[d->nr_dl_retx_data].b, e.e[d->nr_dl_retx_data].bsize, + NO_PREAMBLE); +} + void nr_mib(void *_d, event e) { ev_data *d = _d; @@ -367,7 +382,8 @@ void nr_rar(void *_d, event e) void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, int preamble_id, int rar_id, int sr_id, - int nr_ul_id, int nr_dl_id, int nr_mib_id, int nr_rar_id) + int nr_ul_id, int nr_dl_id, int nr_dl_retx_id, int nr_mib_id, + int nr_rar_id) { database_event_format f; int i; @@ -401,6 +417,10 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, d->nr_dl_frame = -1; d->nr_dl_slot = -1; d->nr_dl_data = -1; + d->nr_dl_retx_rnti = -1; + d->nr_dl_retx_frame = -1; + d->nr_dl_retx_slot = -1; + d->nr_dl_retx_data = -1; d->nr_mib_frame = -1; d->nr_mib_slot = -1; d->nr_mib_data = -1; @@ -518,6 +538,20 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, d->nr_dl_data == -1) goto error; + /* NR dl retx: rnti, frame, slot, data */ + f = get_format(database, nr_dl_retx_id); + + for (i = 0; i < f.count; i++) { + G("rnti", "int", d->nr_dl_retx_rnti); + G("frame", "int", d->nr_dl_retx_frame); + G("slot", "int", d->nr_dl_retx_slot); + G("data", "buffer", d->nr_dl_retx_data); + } + + if (d->nr_dl_retx_rnti == -1 || d->nr_dl_retx_frame == -1 || + d->nr_dl_retx_slot == -1 || d->nr_dl_retx_data == -1) + goto error; + /* NR MIB: frame, slot, data */ f = get_format(database, nr_mib_id); @@ -612,7 +646,7 @@ int main(int n, char **v) int in; int i; int ul_id, dl_id, mib_id, preamble_id, rar_id; - int nr_ul_id, nr_dl_id, nr_mib_id, nr_rar_id; + int nr_ul_id, nr_dl_id, nr_dl_retx_id, nr_mib_id, nr_rar_id; int sr_id; ev_data d; char *ip = DEFAULT_IP; @@ -692,6 +726,7 @@ int main(int n, char **v) on_off(database, "GNB_MAC_UL_PDU_WITH_DATA", is_on, 1); on_off(database, "GNB_MAC_DL_PDU_WITH_DATA", is_on, 1); + on_off(database, "GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA", is_on, 1); on_off(database, "GNB_PHY_MIB", is_on, 1); on_off(database, "GNB_MAC_DL_RAR_PDU_WITH_DATA", is_on, 1); @@ -715,11 +750,12 @@ int main(int n, char **v) nr_ul_id = event_id_from_name(database, "GNB_MAC_UL_PDU_WITH_DATA"); nr_dl_id = event_id_from_name(database, "GNB_MAC_DL_PDU_WITH_DATA"); + nr_dl_retx_id = event_id_from_name(database, "GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA"); nr_mib_id = event_id_from_name(database, "GNB_PHY_MIB"); nr_rar_id = event_id_from_name(database, "GNB_MAC_DL_RAR_PDU_WITH_DATA"); setup_data(&d, database, ul_id, dl_id, mib_id, preamble_id, rar_id, sr_id, - nr_ul_id, nr_dl_id, nr_mib_id, nr_rar_id); + nr_ul_id, nr_dl_id, nr_dl_retx_id, nr_mib_id, nr_rar_id); register_handler_function(h, ul_id, ul, &d); register_handler_function(h, dl_id, dl, &d); @@ -730,6 +766,7 @@ int main(int n, char **v) register_handler_function(h, nr_ul_id, nr_ul, &d); register_handler_function(h, nr_dl_id, nr_dl, &d); + register_handler_function(h, nr_dl_retx_id, nr_dl_retx, &d); register_handler_function(h, nr_mib_id, nr_mib, &d); register_handler_function(h, nr_rar_id, nr_rar, &d); @@ -753,10 +790,11 @@ int main(int n, char **v) if (e.type == -1) break; - if (!(e.type == ul_id || e.type == dl_id || e.type == mib_id || - e.type == preamble_id || e.type == rar_id || e.type == sr_id || - e.type == nr_ul_id || e.type == nr_dl_id || - e.type == nr_mib_id || e.type == nr_rar_id)) continue; + if (!(e.type == ul_id || e.type == dl_id || e.type == mib_id || + e.type == preamble_id || e.type == rar_id || e.type == sr_id || + e.type == nr_ul_id || e.type == nr_dl_id || + e.type == nr_dl_retx_id || e.type == nr_mib_id || + e.type == nr_rar_id)) continue; handle_event(h, e); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 568f8abc37..d8b168ae75 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1200,6 +1200,9 @@ void nr_schedule_ue_spec(module_id_t module_id, "UE %d mismatch between scheduled TBS and buffered TB for HARQ PID %d\n", UE_id, current_harq_pid); + + T(T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti), + T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->tb, TBS)); } else { /* initial transmission */ LOG_D(NR_MAC, "[%s] Initial HARQ transmission in %d.%d\n", __FUNCTION__, frame, slot); From 9fc0da267a84c8926517e086a03b7a4582f7e6a7 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 23 Nov 2021 12:26:25 +0000 Subject: [PATCH 130/883] Fix build warnings --- openair1/PHY/CODING/crc_byte.c | 17 +++++++++-------- .../CODING/nrLDPC_encoder/ldpc_encoder_optim.c | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 987f692a32..277598b4b4 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -151,12 +151,12 @@ can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants unsigned int crc24a (unsigned char * inptr, int bitlen) { + int octetlen = bitlen / 8; /* Change in octets */ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); #ifndef USE_INTEL_CRC + unsigned int crc = 0; + int resbit = (bitlen % 8); + while (octetlen-- > 0) { // printf("crc24a: in %x => crc %x\n",crc,*inptr); crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; @@ -185,11 +185,12 @@ static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = { unsigned int crc24b (unsigned char * inptr, int bitlen) { - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); + int octetlen = bitlen / 8; /* Change in octets */ + #ifndef USE_INTEL_CRC + unsigned int crc = 0; + int resbit = (bitlen % 8); + while (octetlen-- > 0) { // printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]); crc = (crc << 8) ^ crc24bTable[(*inptr++) ^ (crc >> 24)]; diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c index 7baa5d2c94..056ead3ab1 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c @@ -50,7 +50,7 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc { short nrows=0,ncols=0; - int i,i1,rate=3; + int i,rate=3; int no_punctured_columns,removed_bit; int simd_size; From 37950f470bc604f5271e6917cd90902653f36cc4 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 23 Nov 2021 16:51:03 +0000 Subject: [PATCH 131/883] Fix in nfapi_nr_srs_pdu_t --- nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index 9d245446c8..5a56cc9ea5 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -1310,7 +1310,7 @@ typedef struct uint8_t comb_offset;//Transmission comb offset 𝑘 ̄ TC [TS38.211, Sec 6.4.1.4.3] Value: 0 → 1 (combSize = 0) Value: 0 → 3 (combSize = 1) uint8_t cyclic_shift; uint8_t frequency_position; - uint8_t frequency_shift; + uint16_t frequency_shift; uint8_t frequency_hopping; uint8_t group_or_sequence_hopping;//Group or sequence hopping configuration (RRC parameter groupOrSequenceHopping in SRS-Resource uint8_t resource_type;//Type of SRS resource allocation From 01a260f1f996d5829778502d2f5a138de0dc665e Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 23 Nov 2021 18:55:29 +0000 Subject: [PATCH 132/883] gNB is receiving the SRS signal --- cmake_targets/CMakeLists.txt | 2 +- .../nfapi/public_inc/fapi_nr_ue_interface.h | 1 - openair1/PHY/INIT/nr_init.c | 6 +++ openair1/PHY/INIT/nr_init_ue.c | 3 ++ .../PHY/NR_TRANSPORT/nr_transport_proto.h | 7 ++- openair1/PHY/NR_TRANSPORT/srs_rx.c | 44 +++++++++++++++++-- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 29 +++++++----- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.h | 10 +++-- openair1/PHY/defs_gNB.h | 3 ++ openair1/PHY/defs_nr_UE.h | 2 + openair1/PHY/defs_nr_common.h | 7 +++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 11 ++++- 12 files changed, 105 insertions(+), 20 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index b631192dc3..7f983ea814 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1756,6 +1756,7 @@ set(PHY_SRC_UE set(PHY_NR_SRC_COMMON ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_prach_common.c + ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c ) set(PHY_NR_SRC @@ -1826,7 +1827,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_sch_dmrs.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/ ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_prach.c - ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.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 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 78502d7d7e..d5d70cf8b3 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 @@ -358,7 +358,6 @@ typedef struct { uint16_t t_srs; // SRS-Periodicity in slots [3GPP TS 38.211, Sec 6.4.1.4.4], Value: 1,2,3,4,5,8,10,16,20,32,40,64,80,160,320,640,1280,2560 uint16_t t_offset; // Slot offset value [3GPP TS 38.211, Sec 6.4.1.4.3], Value:0->2559 nfapi_nr_ue_ul_beamforming_t beamforming; - fapi_nr_ul_srs_parms_v4 srs_parms_v4; } fapi_nr_ul_config_srs_pdu; typedef struct { diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 1efa86a841..5356888f44 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -195,6 +195,12 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value); + gNB->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); + gNB->nr_srs_info->srs_generated_signal = (int32_t*)malloc16_clear(NR_NB_SC_PER_RB*NR_MAX_NB_RB*sizeof(int32_t)); + gNB->nr_srs_info->srs_received_signal = (int32_t*)malloc16_clear(NR_NB_SC_PER_RB*NR_MAX_NB_RB*sizeof(int32_t)); + + generate_ul_reference_signal_sequences(SHRT_MAX); + /* Generate low PAPR type 1 sequences for PUSCH DMRS, these are used if transform precoding is enabled. */ generate_lowpapr_typ1_refsig_sequences(SHRT_MAX); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index df0dddcda9..66b0ab3646 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -323,6 +323,9 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, srs_vars[gNB_id] = (NR_UE_SRS *)malloc16_clear(sizeof(NR_UE_SRS)); srs_vars[gNB_id]->active = false; + ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); + ue->nr_srs_info->srs_generated_signal = (int32_t*)malloc16_clear(NR_NB_SC_PER_RB*NR_MAX_NB_RB*sizeof(int32_t)); + ue->nr_srs_info->srs_received_signal = (int32_t*)malloc16_clear(NR_NB_SC_PER_RB*NR_MAX_NB_RB*sizeof(int32_t)); if (abstraction_flag == 0) { for (th_id=0; th_id +#include #include #include #include @@ -40,6 +40,8 @@ #include "T.h" +//#define SRS_DEBUG + NR_gNB_SRS_t *new_gNB_srs(void){ NR_gNB_SRS_t *srs; srs = (NR_gNB_SRS_t *)malloc16(sizeof(NR_gNB_SRS_t)); @@ -86,6 +88,42 @@ void nr_fill_srs(PHY_VARS_gNB *gNB, memcpy((void*)&srs->srs_pdu, (void*)srs_pdu, sizeof(nfapi_nr_srs_pdu_t)); } -void nr_get_srs_signal(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_srs_pdu_t *srs_pdu) { - LOG_W(NR_PHY, "(%d.%d) nr_get_srs_signal is not implemented yet!\n", frame,slot); +int nr_get_srs_signal(PHY_VARS_gNB *gNB, + int frame, + int slot, + nfapi_nr_srs_pdu_t *srs_pdu, + nr_srs_info_t *nr_srs_info, + int32_t *srs_received_signal) { + + if(nr_srs_info->n_symbs==0) { + LOG_E(NR_PHY, "nr_srs_info was not generated yet!\n"); + return -1; + } + + int32_t **rxdataF = gNB->common_vars.rxdataF; + NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; + + uint16_t n_symbols = (slot&3)*frame_parms->symbols_per_slot; // number of symbols until this slot + uint8_t l0 = frame_parms->symbols_per_slot - 1 - srs_pdu->time_start_position; // starting symbol in this slot + uint64_t symbol_offset = (n_symbols+l0)*frame_parms->ofdm_symbol_size; + + int32_t *rx_signal; + for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { + rx_signal = &rxdataF[ant][symbol_offset + frame_parms->first_carrier_offset]; + + for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { + srs_received_signal[nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset] = rx_signal[nr_srs_info->subcarrier_idx[sc_idx]]; + +#ifdef SRS_DEBUG + if(nr_srs_info->subcarrier_idx[sc_idx]%12 == 0) { + LOG_I(NR_PHY,"::::::::::::: %i :::::::::::::\n", nr_srs_info->subcarrier_idx[sc_idx]/12); + } + LOG_I(NR_PHY,"(%i) \t%i\t%i\n", + nr_srs_info->subcarrier_idx[sc_idx], + srs_received_signal[nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset]&0xFFFF, + (srs_received_signal[nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset]>>16)&0xFFFF); +#endif + } + } + return 0; } \ No newline at end of file diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index 7552f373d3..9d74795937 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -74,11 +74,13 @@ * - no antenna switching* * *********************************************************************/ -int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, - NR_DL_FRAME_PARMS *frame_parms, - int32_t *txptr, - int16_t amp, - UE_nr_rxtx_proc_t *proc) +int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, + NR_DL_FRAME_PARMS *frame_parms, + int32_t *txptr, + nr_srs_info_t *nr_srs_info, + int16_t amp, + int frame_number, + int slot_number) { uint8_t n_SRS_cs_max; uint8_t u; @@ -94,9 +96,6 @@ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, uint8_t N_b; uint8_t k_0_overbar_p; - int frame_number = proc->frame_tx; - int slot_number = proc->nr_slot_tx; - // get parameters from srs_config_pdu uint8_t B_SRS = srs_config_pdu->bandwidth_index; uint8_t C_SRS = srs_config_pdu->config_index; @@ -117,6 +116,10 @@ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, uint8_t l0 = N_SYMB_SLOT - 1 - l_offset; // starting position in the time domain uint8_t k_0_p; // frequency domain starting position + if(nr_srs_info) { + nr_srs_info->n_symbs = 0; + } + #ifdef SRS_DEBUG LOG_I(NR_PHY,"Frame = %i, slot = %i\n", frame_number, slot_number); LOG_I(NR_PHY,"B_SRS = %i\n", B_SRS); @@ -369,6 +372,11 @@ int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, txptr[subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000); + if(nr_srs_info) { + nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs] = subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset; + nr_srs_info->n_symbs++; + } + #ifdef SRS_DEBUG if( (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset)%12 == 0 ) { LOG_I(NR_PHY,"------------ %i ------------\n", @@ -417,7 +425,7 @@ int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gN } ue->srs_vars[0]->active = false; - fapi_nr_ul_config_srs_pdu *srs_config_pdu = &ue->srs_vars[0]->srs_config_pdu; + nfapi_nr_srs_pdu_t *srs_config_pdu = (nfapi_nr_srs_pdu_t*)&ue->srs_vars[0]->srs_config_pdu; #ifdef SRS_DEBUG LOG_I(NR_PHY,"Frame = %i, slot = %i\n", proc->frame_tx, proc->nr_slot_tx); @@ -452,7 +460,8 @@ int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gN uint16_t nsymb = (ue->frame_parms.Ncp==0) ? 14:12; uint16_t symbol_offset = (int)ue->frame_parms.ofdm_symbol_size*((proc->nr_slot_tx*nsymb)+(nsymb-1)); - if (generate_srs_nr(srs_config_pdu, frame_parms, &ue->common_vars.txdataF[gNB_id][symbol_offset], txptr, proc) == 0) { + if (generate_srs_nr(srs_config_pdu, frame_parms, &ue->common_vars.txdataF[gNB_id][symbol_offset], ue->nr_srs_info, + txptr, proc->frame_tx, proc->nr_slot_tx) == 0) { return 0; } else { return -1; diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h index 5abf064fef..e43bbe4934 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.h @@ -136,15 +136,19 @@ EXTERN const uint16_t srs_periodicity[SRS_PERIODICITY] /** \brief This function generates the sounding reference symbol (SRS) for the uplink according to 38.211 6.4.1.4 Sounding reference signal @param frame_parms NR DL Frame parameters @param txdataF pointer to the frequency domain TX signal + @param nr_srs_info pointer to the srs info structure @param amp amplitude of generated signal - @param proc pointer to the transmit parameters + @param frame_number frame number + @param slot_number slot number @returns 0 on success -1 on error with message */ -int generate_srs_nr(fapi_nr_ul_config_srs_pdu *srs_config_pdu, +int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, NR_DL_FRAME_PARMS *frame_parms, int32_t *txptr, + nr_srs_info_t *nr_srs_info, int16_t amp, - UE_nr_rxtx_proc_t *proc); + int frame_number, + int slot_number); /** \brief This function checks for periodic srs if srs should be transmitted in this slot * @param p_SRS_Resource pointer to active resource diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index ab0ccaf833..170011c507 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -794,6 +794,9 @@ typedef struct PHY_VARS_gNB_s { NR_gNB_UCI_STATS_t uci_stats[NUMBER_OF_NR_UCI_STATS_MAX]; t_nrPolar_params *uci_polarParams; + /// SRS variables + nr_srs_info_t *nr_srs_info; + uint8_t pbch_configured; char gNB_generate_rar; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index fe2f91c706..2f33fb5c2b 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -973,6 +973,8 @@ typedef struct { /// 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; //#if defined(UPGRADE_RAT_NR) #if 1 diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index c385d323e3..85902403b8 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -240,6 +240,13 @@ typedef struct { uint8_t init_msg1; } NR_PRACH_RESOURCES_t; +typedef struct { + uint16_t n_symbs; + uint16_t subcarrier_idx[6*NR_MAX_NB_RB]; + int32_t *srs_generated_signal; + int32_t *srs_received_signal; +} nr_srs_info_t; + typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS; typedef uint32_t (*get_samples_per_slot_t)(int slot, NR_DL_FRAME_PARMS* fp); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c9058d471b..e07b1c6069 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -33,6 +33,7 @@ #include "common/utils/LOG/vcd_signal_dumper.h" #include "PHY/INIT/phy_init.h" #include "PHY/MODULATION/nr_modulation.h" +#include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h" #include "T.h" #include "executables/softmodem-common.h" @@ -792,9 +793,17 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { NR_gNB_SRS_t *srs = gNB->srs[i]; if (srs) { if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) { + LOG_D(NR_PHY, "(%d.%d) gNB is waiting for SRS, id = %i\n", frame_rx, slot_rx, i); + nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu; - nr_get_srs_signal(gNB,frame_rx,slot_rx,srs_pdu); + + // At least currently, the configuration is constant, so it is enough to generate the sequence just once. + if(gNB->nr_srs_info->n_symbs==0) { + generate_srs_nr(srs_pdu, &gNB->frame_parms, gNB->nr_srs_info->srs_generated_signal, gNB->nr_srs_info, AMP, frame_rx, slot_rx); + } + + nr_get_srs_signal(gNB,frame_rx,slot_rx,srs_pdu, gNB->nr_srs_info, gNB->nr_srs_info->srs_received_signal); srs->active = 0; } } From b3e5b83b8bd2e90dfadc6482fd667b989fb9b6c6 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 23 Nov 2021 19:17:13 +0000 Subject: [PATCH 133/883] Fix build warning --- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 15896 ++++++++++++------------ 1 file changed, 7948 insertions(+), 7948 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index ecd8e3dbfe..3f31b28d8c 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -1,7948 +1,7948 @@ -/* - * Copyright 2017 Cisco Systems, Inc. - * - * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 - * - * 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. - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "nfapi_nr_interface_scf.h" - -extern int nfapi_unpack_p7_vendor_extension(nfapi_p7_message_header_t *header, uint8_t **ppReadPackedMsg, void *user_data); -extern int nfapi_pack_p7_vendor_extension(nfapi_p7_message_header_t *header, uint8_t **ppWritePackedMsg, void *user_data); - -uint32_t nfapi_calculate_checksum(uint8_t *buffer, uint16_t len) { - uint32_t chksum = 0; - // calcaulte upto the checksum - chksum = crc32(chksum, buffer, 8); - // skip the checksum - uint8_t zeros[4] = {0, 0, 0, 0}; - chksum = crc32(chksum, zeros, 4); - // continu with the rest of the mesage - chksum = crc32(chksum, &buffer[NFAPI_P7_HEADER_LENGTH], len - NFAPI_P7_HEADER_LENGTH); - // return the inverse - return ~(chksum); -} - -int nfapi_p7_update_checksum(uint8_t *buffer, uint32_t len) { - uint32_t checksum = nfapi_calculate_checksum(buffer, len); - uint8_t *p_write = &buffer[8]; - return (push32(checksum, &p_write, buffer + len) > 0 ? 0 : -1); -} - -int nfapi_p7_update_transmit_timestamp(uint8_t *buffer, uint32_t timestamp) { - uint8_t *p_write = &buffer[12]; - return (push32(timestamp, &p_write, buffer + 16) > 0 ? 0 : -1); -} - -uint32_t nfapi_p7_calculate_checksum(uint8_t *buffer, uint32_t len) { - return nfapi_calculate_checksum(buffer, len); -} - -void *nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t *config) { - if(size == 0) - return 0; - - void *buffer_p = NULL; - - if(config && config->allocate) { - buffer_p = (config->allocate)(size); - - if(buffer_p != NULL) { - memset(buffer_p,0,size); - } - - return buffer_p; - } else { - buffer_p = calloc(1, size); - return buffer_p; - } -} - -void nfapi_p7_deallocate(void *ptr, nfapi_p7_codec_config_t *config) { - if(ptr == NULL) - return; - - if(config && config->deallocate) { - return (config->deallocate)(ptr); - } else { - return free(ptr); - } -} -// Pack routines - - -static uint8_t pack_dl_config_dci_dl_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel8_t *value = (nfapi_dl_config_dci_dl_pdu_rel8_t *)tlv; - //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() dci_format:%u\n", __FUNCTION__, value->dci_format); - return ( push8(value->dci_format, ppWritePackedMsg, end) && - push8(value->cce_idx, ppWritePackedMsg, end) && - push8(value->aggregation_level, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->resource_allocation_type, ppWritePackedMsg, end) && - push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) && - push32(value->resource_block_coding, ppWritePackedMsg, end) && - push8(value->mcs_1, ppWritePackedMsg, end) && - push8(value->redundancy_version_1, ppWritePackedMsg, end) && - push8(value->new_data_indicator_1, ppWritePackedMsg, end) && - push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) && - push8(value->mcs_2, ppWritePackedMsg, end) && - push8(value->redundancy_version_2, ppWritePackedMsg, end) && - push8(value->new_data_indicator_2, ppWritePackedMsg, end) && - push8(value->harq_process, ppWritePackedMsg, end) && - push8(value->tpmi, ppWritePackedMsg, end) && - push8(value->pmi, ppWritePackedMsg, end) && - push8(value->precoding_information, ppWritePackedMsg, end) && - push8(value->tpc, ppWritePackedMsg, end) && - push8(value->downlink_assignment_index, ppWritePackedMsg, end) && - push8(value->ngap, ppWritePackedMsg, end) && - push8(value->transport_block_size_index, ppWritePackedMsg, end) && - push8(value->downlink_power_offset, ppWritePackedMsg, end) && - push8(value->allocate_prach_flag, ppWritePackedMsg, end) && - push8(value->preamble_index, ppWritePackedMsg, end) && - push8(value->prach_mask_index, ppWritePackedMsg, end) && - push8(value->rnti_type, ppWritePackedMsg, end) && - push16(value->transmission_power, ppWritePackedMsg, end)); -} - -static uint8_t pack_dl_config_dci_dl_pdu_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel9_t *value = (nfapi_dl_config_dci_dl_pdu_rel9_t *)tlv; - return( push8(value->mcch_flag, ppWritePackedMsg, end) && - push8(value->mcch_change_notification, ppWritePackedMsg, end) && - push8(value->scrambling_identity, ppWritePackedMsg, end)); -} - -static uint8_t pack_dl_config_dci_dl_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel10_t *value = (nfapi_dl_config_dci_dl_pdu_rel10_t *)tlv; - return ( push8(value->cross_carrier_scheduling_flag, ppWritePackedMsg, end) && - push8(value->carrier_indicator, ppWritePackedMsg, end) && - push8(value->srs_flag, ppWritePackedMsg, end) && - push8(value->srs_request, ppWritePackedMsg, end) && - push8(value->antenna_ports_scrambling_and_layers, ppWritePackedMsg, end) && - push8(value->total_dci_length_including_padding, ppWritePackedMsg, end) && - push8(value->n_dl_rb, ppWritePackedMsg, end)); -} - -static uint8_t pack_dl_config_dci_dl_pdu_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel11_t *value = (nfapi_dl_config_dci_dl_pdu_rel11_t *)tlv; - return ( push8(value->harq_ack_resource_offset, ppWritePackedMsg, end) && - push8(value->pdsch_re_mapping_quasi_co_location_indicator, ppWritePackedMsg, end)); -} - -static uint8_t pack_dl_config_dci_dl_pdu_rel12_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel12_t *value = (nfapi_dl_config_dci_dl_pdu_rel12_t *)tlv; - return ( push8(value->primary_cell_type, ppWritePackedMsg, end) && - push8(value->ul_dl_configuration_flag, ppWritePackedMsg, end) && - push8(value->number_ul_dl_configurations, ppWritePackedMsg, end) && - pusharray8(value->ul_dl_configuration_indication, NFAPI_MAX_UL_DL_CONFIGURATIONS, value->number_ul_dl_configurations, ppWritePackedMsg, end)); -} - -static uint8_t pack_tpm_value(nfapi_dl_config_dci_dl_tpm_t *value, uint8_t **ppWritePackedMsg, uint8_t *end) { - if (!( push8(value->num_prb_per_subband, ppWritePackedMsg, end) && - push8(value->number_of_subbands, ppWritePackedMsg, end) && - push8(value->num_antennas, ppWritePackedMsg, end))) - return 0; - - uint8_t idx = 0; - - for(idx = 0; idx < value->number_of_subbands; ++idx) { - nfapi_dl_config_dci_dl_tpm_subband_info_t *subband_info = &(value->subband_info[idx]); - - if(!(push8(subband_info->subband_index, ppWritePackedMsg, end) && - push8(subband_info->scheduled_ues, ppWritePackedMsg, end))) - return 0; - - uint8_t antenna_idx = 0; - uint8_t scheduled_ue_idx = 0; - - for(antenna_idx = 0; antenna_idx < value->num_antennas; ++antenna_idx) { - for(scheduled_ue_idx = 0; scheduled_ue_idx < subband_info->scheduled_ues; ++scheduled_ue_idx) { - if(!push16(subband_info->precoding_value[antenna_idx][scheduled_ue_idx], ppWritePackedMsg, end)) - return 0; - } - } - } - - return 1; -} - - -static uint8_t pack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv; - return( - push16(value->bwp_size, ppWritePackedMsg, end) && - push16(value->bwp_start, ppWritePackedMsg, end) && - push8(value->subcarrier_spacing, ppWritePackedMsg, end) && - push8(value->cyclic_prefix, ppWritePackedMsg, end) && - push16(value->start_rb, ppWritePackedMsg, end) && - push16(value->nr_of_rbs, ppWritePackedMsg, end) && - push8(value->csi_type, ppWritePackedMsg, end) && - push8(value->row, ppWritePackedMsg, end) && - push16(value->freq_domain, ppWritePackedMsg, end) && - push8(value->symb_l0, ppWritePackedMsg, end) && - push8(value->symb_l1, ppWritePackedMsg, end) && - push8(value->cdm_type, ppWritePackedMsg, end) && - push8(value->freq_density, ppWritePackedMsg, end) && - push16(value->scramb_id, ppWritePackedMsg, end) && - push8(value->power_control_offset, ppWritePackedMsg, end) && - push8(value->power_control_offset_ss, ppWritePackedMsg, end) - ); -} - - -static uint8_t pack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - - nfapi_nr_dl_tti_pdcch_pdu_rel15_t* value = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t*)tlv; - - for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i) - { - if(!(push16(value->dci_pdu[i].RNTI, ppWritePackedMsg, end) && - push16(value->dci_pdu[i].ScramblingId, ppWritePackedMsg, end) && - push16(value->dci_pdu[i].ScramblingRNTI, ppWritePackedMsg, end) && - push8(value->dci_pdu[i].CceIndex, ppWritePackedMsg, end) && - push8(value->dci_pdu[i].AggregationLevel, ppWritePackedMsg, end) && - push8(value->dci_pdu[i].beta_PDCCH_1_0, ppWritePackedMsg, end) && - push8(value->dci_pdu[i].powerControlOffsetSS, ppWritePackedMsg, end) && - push16(value->dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end) && - pusharray8(value->dci_pdu[i].Payload, value->dci_pdu[i].PayloadSizeBits, value->dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end))) - return 0; - - } - // TODO: resolve the packaging of array (currently sending a single element) - return( - push16(value->BWPSize, ppWritePackedMsg, end) && - push16(value->BWPStart, ppWritePackedMsg, end) && - push8(value->SubcarrierSpacing, ppWritePackedMsg, end) && - push8(value->CyclicPrefix, ppWritePackedMsg, end) && - push8(value->StartSymbolIndex, ppWritePackedMsg, end) && - push8(value->DurationSymbols, ppWritePackedMsg, end) && - pusharray8(value->FreqDomainResource, 6, 6, ppWritePackedMsg, end) && - push8(value->CceRegMappingType, ppWritePackedMsg, end) && - push8(value->RegBundleSize, ppWritePackedMsg, end) && - push8(value->InterleaverSize, ppWritePackedMsg, end) && - push8(value->CoreSetType, ppWritePackedMsg, end) && - push16(value->ShiftIndex, ppWritePackedMsg, end) && - push8(value->precoderGranularity, ppWritePackedMsg, end) && - push16(value->numDlDci, ppWritePackedMsg, end)); -} - - -static uint8_t pack_dl_tti_pdsch_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_dl_tti_pdsch_pdu_rel15_t *value = (nfapi_nr_dl_tti_pdsch_pdu_rel15_t *)tlv; - // TODO: resolve the packaging of array (currently sending a single element) - return( - push16(value->pduBitmap, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push16(value->pduIndex, ppWritePackedMsg, end) && - push16(value->BWPSize, ppWritePackedMsg, end) && - push16(value->BWPStart, ppWritePackedMsg, end) && - push8(value->SubcarrierSpacing, ppWritePackedMsg, end) && - push8(value->CyclicPrefix, ppWritePackedMsg, end) && - push8(value->NrOfCodewords, ppWritePackedMsg, end) && - pusharray16(value->targetCodeRate, 2, 1, ppWritePackedMsg, end) && - pusharray8(value->qamModOrder, 2, 1, ppWritePackedMsg, end) && - pusharray8(value->mcsIndex, 2, 1, ppWritePackedMsg, end) && - pusharray8(value->mcsTable, 2, 1, ppWritePackedMsg, end) && - pusharray8(value->rvIndex, 2, 1, ppWritePackedMsg, end) && - pusharray32(value->TBSize, 2, 1, ppWritePackedMsg, end) && - push16(value->dataScramblingId, ppWritePackedMsg, end) && - push8(value->nrOfLayers, ppWritePackedMsg, end) && - push8(value->transmissionScheme, ppWritePackedMsg, end) && - push8(value->refPoint, ppWritePackedMsg, end) && - push16(value->dlDmrsSymbPos, ppWritePackedMsg, end) && - push8(value->dmrsConfigType, ppWritePackedMsg, end) && - push16(value->dlDmrsScramblingId, ppWritePackedMsg, end) && - push8(value->SCID, ppWritePackedMsg, end) && - push8(value->numDmrsCdmGrpsNoData, ppWritePackedMsg, end) && - push16(value->dmrsPorts, ppWritePackedMsg, end) && - push8(value->resourceAlloc, ppWritePackedMsg, end) && - push16(value->rbStart, ppWritePackedMsg, end) && - push16(value->rbSize, ppWritePackedMsg, end) && - push8(value->VRBtoPRBMapping, ppWritePackedMsg, end) && - push8(value->StartSymbolIndex, ppWritePackedMsg, end) && - push8(value->NrOfSymbols, ppWritePackedMsg, end) && - push8(value->PTRSPortIndex, ppWritePackedMsg, end) && - push8(value->PTRSTimeDensity, ppWritePackedMsg, end) && - push8(value->PTRSFreqDensity, ppWritePackedMsg, end) && - push8(value->PTRSReOffset, ppWritePackedMsg, end) - ); -} - - -static uint8_t pack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_dl_tti_ssb_pdu_rel15_t *value = (nfapi_nr_dl_tti_ssb_pdu_rel15_t *)tlv; - return( - push16(value->PhysCellId, ppWritePackedMsg, end) && - push8(value->BetaPss, ppWritePackedMsg, end) && - push8(value->SsbBlockIndex, ppWritePackedMsg, end) && - push8(value->SsbSubcarrierOffset, ppWritePackedMsg, end) && - push16(value->ssbOffsetPointA, ppWritePackedMsg, end) && - push8(value->bchPayloadFlag, ppWritePackedMsg, end) && - push32(value->bchPayload, ppWritePackedMsg, end) - // TODO: pack precoding_and_beamforming too - ); -} - - -static uint8_t pack_dl_config_dci_dl_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel13_t *value = (nfapi_dl_config_dci_dl_pdu_rel13_t *)tlv; - return( push8(value->laa_end_partial_sf_flag, ppWritePackedMsg, end) && - push8(value->laa_end_partial_sf_configuration, ppWritePackedMsg, end) && - push8(value->initial_lbt_sf, ppWritePackedMsg, end) && - push8(value->codebook_size_determination, ppWritePackedMsg, end) && - push8(value->drms_table_flag, ppWritePackedMsg, end) && - push8(value->tpm_struct_flag, ppWritePackedMsg, end) && - (value->tpm_struct_flag == 1 ? pack_tpm_value(&(value->tpm), ppWritePackedMsg, end) : 1)); -} - -static uint8_t pack_dl_config_bch_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_bch_pdu_rel8_t *value = (nfapi_dl_config_bch_pdu_rel8_t *)tlv; - //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s()\n", __FUNCTION__); - return( push16(value->length, ppWritePackedMsg, end) && - push16(value->pdu_index, ppWritePackedMsg, end) && - push16(value->transmission_power, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_mch_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_mch_pdu_rel8_t *value = (nfapi_dl_config_mch_pdu_rel8_t *)tlv; - return ( push16(value->length, ppWritePackedMsg, end) && - push16(value->pdu_index, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->resource_allocation_type, ppWritePackedMsg, end) && - push32(value->resource_block_coding, ppWritePackedMsg, end) && - push8(value->modulation, ppWritePackedMsg, end) && - push16(value->transmission_power, ppWritePackedMsg, end) && - push16(value->mbsfn_area_id, ppWritePackedMsg, end)); -} - -static uint8_t pack_bf_vector_info(void *elem, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_bf_vector_t *bf = (nfapi_bf_vector_t *)elem; - return ( push8(bf->subband_index, ppWritePackedMsg, end) && - push8(bf->num_antennas, ppWritePackedMsg, end) && - pusharray16(bf->bf_value, NFAPI_MAX_NUM_ANTENNAS, bf->num_antennas, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_dlsch_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel8_t *value = (nfapi_dl_config_dlsch_pdu_rel8_t *)tlv; - return ( push16(value->length, ppWritePackedMsg, end) && - push16(value->pdu_index, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->resource_allocation_type, ppWritePackedMsg, end) && - push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) && - push32(value->resource_block_coding, ppWritePackedMsg, end) && - push8(value->modulation, ppWritePackedMsg, end) && - push8(value->redundancy_version, ppWritePackedMsg, end) && - push8(value->transport_blocks, ppWritePackedMsg, end) && - push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) && - push8(value->transmission_scheme, ppWritePackedMsg, end) && - push8(value->number_of_layers, ppWritePackedMsg, end) && - push8(value->number_of_subbands, ppWritePackedMsg, end) && - pusharray8(value->codebook_index, NFAPI_MAX_NUM_SUBBANDS, value->number_of_subbands, ppWritePackedMsg, end) && - push8(value->ue_category_capacity, ppWritePackedMsg, end) && - push8(value->pa, ppWritePackedMsg, end) && - push8(value->delta_power_offset_index, ppWritePackedMsg, end) && - push8(value->ngap, ppWritePackedMsg, end) && - push8(value->nprb, ppWritePackedMsg, end) && - push8(value->transmission_mode, ppWritePackedMsg, end) && - push8(value->num_bf_prb_per_subband, ppWritePackedMsg, end) && - push8(value->num_bf_vector, ppWritePackedMsg, end) && - packarray(value->bf_vector, sizeof(nfapi_bf_vector_t), NFAPI_MAX_BF_VECTORS, value->num_bf_vector, ppWritePackedMsg, end, &pack_bf_vector_info)); -} -static uint8_t pack_dl_config_dlsch_pdu_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel9_t *value = (nfapi_dl_config_dlsch_pdu_rel9_t *)tlv; - return ( push8(value->nscid, ppWritePackedMsg, end) ); -} -static uint8_t pack_dl_config_dlsch_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel10_t *value = (nfapi_dl_config_dlsch_pdu_rel10_t *)tlv; - return ( push8(value->csi_rs_flag, ppWritePackedMsg, end) && - push8(value->csi_rs_resource_config_r10, ppWritePackedMsg, end) && - push16(value->csi_rs_zero_tx_power_resource_config_bitmap_r10, ppWritePackedMsg, end) && - push8(value->csi_rs_number_nzp_configuration, ppWritePackedMsg, end) && - pusharray8(value->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, value->csi_rs_number_nzp_configuration, ppWritePackedMsg, end) && - push8(value->pdsch_start, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_dlsch_pdu_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel11_t *value = (nfapi_dl_config_dlsch_pdu_rel11_t *)tlv; - return( push8(value->drms_config_flag, ppWritePackedMsg, end) && - push16(value->drms_scrambling, ppWritePackedMsg, end) && - push8(value->csi_config_flag, ppWritePackedMsg, end) && - push16(value->csi_scrambling, ppWritePackedMsg, end) && - push8(value->pdsch_re_mapping_flag, ppWritePackedMsg, end) && - push8(value->pdsch_re_mapping_atenna_ports, ppWritePackedMsg, end) && - push8(value->pdsch_re_mapping_freq_shift, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_dlsch_pdu_rel12_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel12_t *value = (nfapi_dl_config_dlsch_pdu_rel12_t *)tlv; - return( push8(value->altcqi_table_r12, ppWritePackedMsg, end) && - push8(value->maxlayers, ppWritePackedMsg, end) && - push8(value->n_dl_harq, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_dlsch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel13_t *value = (nfapi_dl_config_dlsch_pdu_rel13_t *)tlv; - return( push8(value->dwpts_symbols, ppWritePackedMsg, end) && - push8(value->initial_lbt_sf, ppWritePackedMsg, end) && - push8(value->ue_type, ppWritePackedMsg, end) && - push8(value->pdsch_payload_type, ppWritePackedMsg, end) && - push16(value->initial_transmission_sf_io, ppWritePackedMsg, end) && - push8(value->drms_table_flag, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_pch_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_pch_pdu_rel8_t *value = (nfapi_dl_config_pch_pdu_rel8_t *)tlv; - return( push16(value->length, ppWritePackedMsg, end) && - push16(value->pdu_index, ppWritePackedMsg, end) && - push16(value->p_rnti, ppWritePackedMsg, end) && - push8(value->resource_allocation_type, ppWritePackedMsg, end) && - push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) && - push32(value->resource_block_coding, ppWritePackedMsg, end) && - push8(value->mcs, ppWritePackedMsg, end) && - push8(value->redundancy_version, ppWritePackedMsg, end) && - push8(value->number_of_transport_blocks, ppWritePackedMsg, end) && - push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) && - push8(value->transmission_scheme, ppWritePackedMsg, end) && - push8(value->number_of_layers, ppWritePackedMsg, end) && - push8(value->codebook_index, ppWritePackedMsg, end) && - push8(value->ue_category_capacity, ppWritePackedMsg, end) && - push8(value->pa, ppWritePackedMsg, end) && - push16(value->transmission_power, ppWritePackedMsg, end) && - push8(value->nprb, ppWritePackedMsg, end) && - push8(value->ngap, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_pch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_pch_pdu_rel13_t *value = (nfapi_dl_config_pch_pdu_rel13_t *)tlv; - return ( push8(value->ue_mode, ppWritePackedMsg, end) && - push16(value->initial_transmission_sf_io, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_prs_pdu_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_prs_pdu_rel9_t *value = (nfapi_dl_config_prs_pdu_rel9_t *)tlv; - return( push16(value->transmission_power, ppWritePackedMsg, end) && - push8(value->prs_bandwidth, ppWritePackedMsg, end) && - push8(value->prs_cyclic_prefix_type, ppWritePackedMsg, end) && - push8(value->prs_muting, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_csi_rs_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_csi_rs_pdu_rel10_t *value = (nfapi_dl_config_csi_rs_pdu_rel10_t *)tlv; - return( push8(value->csi_rs_antenna_port_count_r10, ppWritePackedMsg, end) && - push8(value->csi_rs_resource_config_r10, ppWritePackedMsg, end) && - push16(value->transmission_power, ppWritePackedMsg, end) && - push16(value->csi_rs_zero_tx_power_resource_config_bitmap_r10, ppWritePackedMsg, end) && - push8(value->csi_rs_number_of_nzp_configuration, ppWritePackedMsg, end) && - pusharray8(value->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, value->csi_rs_number_of_nzp_configuration, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_csi_rs_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_csi_rs_pdu_rel13_t *value = (nfapi_dl_config_csi_rs_pdu_rel13_t *)tlv; - - if(!(push8(value->csi_rs_class, ppWritePackedMsg, end) && - push8(value->cdm_type, ppWritePackedMsg, end) && - push8(value->num_bf_vector, ppWritePackedMsg, end))) { - return 0; - } - - uint16_t i; - - for(i = 0; i < value->num_bf_vector; ++i) { - if(!(push8(value->bf_vector[i].csi_rs_resource_index, ppWritePackedMsg, end) && - pusharray16(value->bf_vector[i].bf_value, NFAPI_MAX_ANTENNA_PORT_COUNT, NFAPI_MAX_ANTENNA_PORT_COUNT, ppWritePackedMsg, end))) - return 0; - } - - return 1; -} -static uint8_t pack_bf_vector(nfapi_bf_vector_t *vector, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( push8(vector->subband_index, ppWritePackedMsg, end) && - push8(vector->num_antennas, ppWritePackedMsg, end) && - pusharray16(vector->bf_value, NFAPI_MAX_NUM_ANTENNAS, vector->num_antennas, ppWritePackedMsg, end)); -} - -static uint8_t pack_dl_config_epdcch_parameters_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_epdcch_parameters_rel11_t *value = (nfapi_dl_config_epdcch_parameters_rel11_t *)tlv; - return ( push8(value->epdcch_resource_assignment_flag, ppWritePackedMsg, end) && - push16(value->epdcch_id, ppWritePackedMsg, end) && - push8(value->epdcch_start_symbol, ppWritePackedMsg, end) && - push8(value->epdcch_num_prb, ppWritePackedMsg, end) && - pusharray8(value->epdcch_prb_index, NFAPI_MAX_EPDCCH_PRB, value->epdcch_num_prb, ppWritePackedMsg, end) && - pack_bf_vector(&value->bf_vector, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_epdcch_parameters_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_epdcch_parameters_rel13_t *value = (nfapi_dl_config_epdcch_parameters_rel13_t *)tlv; - return (push8(value->dwpts_symbols, ppWritePackedMsg, end) && - push8(value->initial_lbt_sf, ppWritePackedMsg, end)); -} -static uint8_t pack_dl_config_mpdcch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_mpdcch_pdu_rel13_t *value = (nfapi_dl_config_mpdcch_pdu_rel13_t *)tlv; - return ( push8(value->mpdcch_narrow_band, ppWritePackedMsg, end) && - push8(value->number_of_prb_pairs, ppWritePackedMsg, end) && - push8(value->resource_block_assignment, ppWritePackedMsg, end) && - push8(value->mpdcch_tansmission_type, ppWritePackedMsg, end) && - push8(value->start_symbol, ppWritePackedMsg, end) && - push8(value->ecce_index, ppWritePackedMsg, end) && - push8(value->aggregation_level, ppWritePackedMsg, end) && - push8(value->rnti_type, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->ce_mode, ppWritePackedMsg, end) && - push16(value->drms_scrambling_init, ppWritePackedMsg, end) && - push16(value->initial_transmission_sf_io, ppWritePackedMsg, end) && - push16(value->transmission_power, ppWritePackedMsg, end) && - push8(value->dci_format, ppWritePackedMsg, end) && - push16(value->resource_block_coding, ppWritePackedMsg, end) && - push8(value->mcs, ppWritePackedMsg, end) && - push8(value->pdsch_reptition_levels, ppWritePackedMsg, end) && - push8(value->redundancy_version, ppWritePackedMsg, end) && - push8(value->new_data_indicator, ppWritePackedMsg, end) && - push8(value->harq_process, ppWritePackedMsg, end) && - push8(value->tpmi_length, ppWritePackedMsg, end) && - push8(value->tpmi, ppWritePackedMsg, end) && - push8(value->pmi_flag, ppWritePackedMsg, end) && - push8(value->pmi, ppWritePackedMsg, end) && - push8(value->harq_resource_offset, ppWritePackedMsg, end) && - push8(value->dci_subframe_repetition_number, ppWritePackedMsg, end) && - push8(value->tpc, ppWritePackedMsg, end) && - push8(value->downlink_assignment_index_length, ppWritePackedMsg, end) && - push8(value->downlink_assignment_index, ppWritePackedMsg, end) && - push8(value->allocate_prach_flag, ppWritePackedMsg, end) && - push8(value->preamble_index, ppWritePackedMsg, end) && - push8(value->prach_mask_index, ppWritePackedMsg, end) && - push8(value->starting_ce_level, ppWritePackedMsg, end) && - push8(value->srs_request, ppWritePackedMsg, end) && - push8(value->antenna_ports_and_scrambling_identity_flag, ppWritePackedMsg, end) && - push8(value->antenna_ports_and_scrambling_identity, ppWritePackedMsg, end) && - push8(value->frequency_hopping_enabled_flag, ppWritePackedMsg, end) && - push8(value->paging_direct_indication_differentiation_flag, ppWritePackedMsg, end) && - push8(value->direct_indication, ppWritePackedMsg, end) && - push8(value->total_dci_length_including_padding, ppWritePackedMsg, end) && - push8(value->number_of_tx_antenna_ports, ppWritePackedMsg, end) && - pusharray16(value->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, value->number_of_tx_antenna_ports, ppWritePackedMsg, end)); -} - - -static uint8_t pack_dl_config_nbch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_nbch_pdu_rel13_t *value = (nfapi_dl_config_nbch_pdu_rel13_t *)tlv; - return (push16(value->length, ppWritePackedMsg, end) && - push16(value->pdu_index, ppWritePackedMsg, end) && - push16(value->transmission_power, ppWritePackedMsg, end) && - push16(value->hyper_sfn_2_lsbs, ppWritePackedMsg, end)); -} - - -static uint8_t pack_dl_config_npdcch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_npdcch_pdu_rel13_t *value = (nfapi_dl_config_npdcch_pdu_rel13_t *)tlv; - return (push16(value->length, ppWritePackedMsg, end) && - push16(value->pdu_index, ppWritePackedMsg, end) && - push8(value->ncce_index, ppWritePackedMsg, end) && - push8(value->aggregation_level, ppWritePackedMsg, end) && - push8(value->start_symbol, ppWritePackedMsg, end) && - push8(value->rnti_type, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->scrambling_reinitialization_batch_index, ppWritePackedMsg, end) && - push8(value->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end) && - push8(value->dci_format, ppWritePackedMsg, end) && - push8(value->scheduling_delay, ppWritePackedMsg, end) && - push8(value->resource_assignment, ppWritePackedMsg, end) && - push8(value->repetition_number, ppWritePackedMsg, end) && - push8(value->mcs, ppWritePackedMsg, end) && - push8(value->new_data_indicator, ppWritePackedMsg, end) && - push8(value->harq_ack_resource, ppWritePackedMsg, end) && - push8(value->npdcch_order_indication, ppWritePackedMsg, end) && - push8(value->starting_number_of_nprach_repetitions, ppWritePackedMsg, end) && - push8(value->subcarrier_indication_of_nprach, ppWritePackedMsg, end) && - push8(value->paging_direct_indication_differentation_flag, ppWritePackedMsg, end) && - push8(value->direct_indication, ppWritePackedMsg, end) && - push8(value->dci_subframe_repetition_number, ppWritePackedMsg, end) && - push8(value->total_dci_length_including_padding, ppWritePackedMsg, end)); -} - -static uint8_t pack_dl_config_ndlsch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_ndlsch_pdu_rel13_t *value = (nfapi_dl_config_ndlsch_pdu_rel13_t *)tlv; - return (push16(value->length, ppWritePackedMsg, end) && - push16(value->pdu_index, ppWritePackedMsg, end) && - push8(value->start_symbol, ppWritePackedMsg, end) && - push8(value->rnti_type, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push16(value->resource_assignment, ppWritePackedMsg, end) && - push16(value->repetition_number, ppWritePackedMsg, end) && - push8(value->modulation, ppWritePackedMsg, end) && - push8(value->number_of_subframes_for_resource_assignment, ppWritePackedMsg, end) && - push8(value->scrambling_sequence_initialization_cinit, ppWritePackedMsg, end) && - push16(value->sf_idx, ppWritePackedMsg, end) && - push8(value->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end)); -} - - -static uint8_t pack_dl_tti_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_dl_tti_request_pdu_t *value = (nfapi_nr_dl_tti_request_pdu_t *)tlv; - - if(!(push32(value->PDUSize, ppWritePackedMsg, end) && - push16(value->PDUType, ppWritePackedMsg, end) )) - return 0; - - // first match the pdu type, then call the respective function - switch(value->PDUType) { - case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE: { - if(!(pack_dl_tti_csi_rs_pdu_rel15_value(&value->csi_rs_pdu.csi_rs_pdu_rel15,ppWritePackedMsg,end))) - return 0; - } - break; - - case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE: { - if(!(pack_dl_tti_pdcch_pdu_rel15_value(&value->pdcch_pdu.pdcch_pdu_rel15,ppWritePackedMsg,end))) - return 0; - } - break; - - case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE: { - if(!(pack_dl_tti_pdsch_pdu_rel15_value(&value->pdsch_pdu.pdsch_pdu_rel15,ppWritePackedMsg,end))) - return 0; - } - break; - - case NFAPI_NR_DL_TTI_SSB_PDU_TYPE: { - if(!(pack_dl_tti_ssb_pdu_rel15_value(&value->ssb_pdu.ssb_pdu_rel15,ppWritePackedMsg,end))) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid DL_TTI pdu type %d \n", value->PDUType ); - } - break; - } - - return 1; -} - -static uint8_t pack_dl_config_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_dl_config_request_body_t *value = (nfapi_dl_config_request_body_t *)tlv; - - //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() dci:%u pdu:%u pdsch:%u rnti:%u pcfich:%u\n", __FUNCTION__, value->number_dci, value->number_pdu, value->number_pdsch_rnti, value->transmission_power_pcfich); - - if(!(push8(value->number_pdcch_ofdm_symbols, ppWritePackedMsg, end) && - push8(value->number_dci, ppWritePackedMsg, end) && - push16(value->number_pdu, ppWritePackedMsg, end) && - push8(value->number_pdsch_rnti, ppWritePackedMsg, end) && - push16(value->transmission_power_pcfich, ppWritePackedMsg, end))) { - return 0; - } - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_pdu; - - for(; i < total_number_of_pdus; ++i) { - nfapi_dl_config_request_pdu_t *pdu = &(value->dl_config_pdu_list[i]); - - if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) - return 0; - - // Put a 0 size in and then determine the size after the pdu - // has been writen and write the calculated size - uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; - pdu->pdu_size = 0; - - if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) - return 0; - - switch(pdu->pdu_type) { - case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: { - //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE\n", __FUNCTION__); - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel8_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel9_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel10_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel11_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel12_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel13_value))) { - return 0; - } - } - break; - - case NFAPI_DL_CONFIG_BCH_PDU_TYPE: { - //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE\n", __FUNCTION__); - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG, &pdu->bch_pdu.bch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_bch_pdu_rel8_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_MCH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG, &pdu->mch_pdu.mch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_mch_pdu_rel8_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel8_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel9_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel10_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel11_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel12_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel13_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_PCH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG, &pdu->pch_pdu.pch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_pch_pdu_rel8_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG, &pdu->pch_pdu.pch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_pch_pdu_rel13_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_PRS_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG, &pdu->prs_pdu.prs_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_prs_pdu_rel9_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_csi_rs_pdu_rel10_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_csi_rs_pdu_rel13_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel8_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel9_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel10_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel11_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel12_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel13_value) && - pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG, &pdu->epdcch_pdu.epdcch_params_rel11, ppWritePackedMsg, end, &pack_dl_config_epdcch_parameters_rel11_value) & - pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG, &pdu->epdcch_pdu.epdcch_params_rel13, ppWritePackedMsg, end, &pack_dl_config_epdcch_parameters_rel13_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG, &pdu->mpdcch_pdu.mpdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_mpdcch_pdu_rel13_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_NBCH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG, &pdu->nbch_pdu.nbch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_nbch_pdu_rel13_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG, &pdu->npdcch_pdu.npdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_npdcch_pdu_rel13_value))) - return 0; - } - break; - - case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG, &pdu->ndlsch_pdu.ndlsch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_ndlsch_pdu_rel13_value))) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type ); - } - break; - }; - - // add 1 for the pdu_type. The delta will include the pdu_size - pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); - - push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); - } - - return 1; -} - - -static uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg; - - if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && - push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && - push8(pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end) && - push8(pNfapiMsg->dl_tti_request_body.nPDUs, ppWritePackedMsg, end) && - pusharray8(pNfapiMsg->dl_tti_request_body.nUe,256,pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end) - //pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end) - )) - return 0; - - int arr[12]; - - for(int i=0; idl_tti_request_body.nGroup; i++) { - for(int j=0; jdl_tti_request_body.nUe[i]; j++) { - arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j]; - } - - if(!(pusharrays32(arr,12,pNfapiMsg->dl_tti_request_body.nUe[i],ppWritePackedMsg, end))) - return 0; - } - - for(int i=0; idl_tti_request_body.nPDUs; i++) { - if(!pack_dl_tti_request_body_value(&pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i],ppWritePackedMsg,end)) - return 0; - } - - return 1; -} - - -static uint8_t pack_dl_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_dl_config_request_t *pNfapiMsg = (nfapi_dl_config_request_t *)msg; - //return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - //pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value) && - //pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); - { - uint8_t x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end); - uint8_t y = pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value); - uint8_t z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); - - if (!x || !y || !z) { - NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST x:%u y:%u z:%u \n", __FUNCTION__,x,y,z); - } - - return x && y && z; - } -} - - - - -static uint8_t pack_ul_config_request_ulsch_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_pdu_rel8_t *ulsch_pdu_rel8 = (nfapi_ul_config_ulsch_pdu_rel8_t *)tlv; - return( push32(ulsch_pdu_rel8->handle, ppWritePackedMsg, end) && - push16(ulsch_pdu_rel8->size, ppWritePackedMsg, end) && - push16(ulsch_pdu_rel8->rnti, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->resource_block_start, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->modulation_type, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->frequency_hopping_enabled_flag, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->frequency_hopping_bits, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->new_data_indication, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->redundancy_version, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->harq_process_number, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->ul_tx_mode, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->current_tx_nb, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel8->n_srs, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_ulsch_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_pdu_rel10_t *ulsch_pdu_rel10 = (nfapi_ul_config_ulsch_pdu_rel10_t *)tlv; - return (push8(ulsch_pdu_rel10->resource_allocation_type, ppWritePackedMsg, end) && - push32(ulsch_pdu_rel10->resource_block_coding, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel10->transport_blocks, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel10->transmission_scheme, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel10->number_of_layers, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel10->codebook_index, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel10->disable_sequence_hopping_flag, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_ulsch_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_pdu_rel11_t *ulsch_pdu_rel11 = (nfapi_ul_config_ulsch_pdu_rel11_t *)tlv; - return (push8(ulsch_pdu_rel11->virtual_cell_id_enabled_flag, ppWritePackedMsg, end) && - push16(ulsch_pdu_rel11->npusch_identity, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel11->dmrs_config_flag, ppWritePackedMsg, end) && - push16(ulsch_pdu_rel11->ndmrs_csh_identity, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_ulsch_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_pdu_rel13_t *ulsch_pdu_rel13 = (nfapi_ul_config_ulsch_pdu_rel13_t *)tlv; - return (push8(ulsch_pdu_rel13->ue_type, ppWritePackedMsg, end) && - push16(ulsch_pdu_rel13->total_number_of_repetitions, ppWritePackedMsg, end) && - push16(ulsch_pdu_rel13->repetition_number, ppWritePackedMsg, end) && - push16(ulsch_pdu_rel13->initial_transmission_sf_io, ppWritePackedMsg, end) && - push8(ulsch_pdu_rel13->empty_symbols_due_to_re_tunning, ppWritePackedMsg, end)); -} - -//Pack fns for ul_tti PDUS - - -static uint8_t pack_ul_tti_request_prach_pdu(nfapi_nr_prach_pdu_t *prach_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { - return( - push16(prach_pdu->phys_cell_id, ppWritePackedMsg, end) && - push8(prach_pdu->num_prach_ocas, ppWritePackedMsg, end) && - push8(prach_pdu->prach_format, ppWritePackedMsg, end) && - push8(prach_pdu->num_ra, ppWritePackedMsg, end) && - push8(prach_pdu->prach_start_symbol, ppWritePackedMsg, end) && - push16(prach_pdu->num_cs, ppWritePackedMsg, end) - // TODO: ignoring beamforming tlv for now - ); -} - -static uint8_t pack_ul_tti_request_pucch_pdu(nfapi_nr_pucch_pdu_t *pucch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { - return( - push16(pucch_pdu->rnti, ppWritePackedMsg, end) && - push32(pucch_pdu->handle, ppWritePackedMsg, end) && - push16(pucch_pdu->bwp_size, ppWritePackedMsg, end) && - push16(pucch_pdu->bwp_start, ppWritePackedMsg, end) && - push8(pucch_pdu->subcarrier_spacing, ppWritePackedMsg, end) && - push8(pucch_pdu->cyclic_prefix, ppWritePackedMsg, end) && - push8(pucch_pdu->format_type, ppWritePackedMsg, end) && - push8(pucch_pdu->multi_slot_tx_indicator, ppWritePackedMsg, end) && - push16(pucch_pdu->prb_start, ppWritePackedMsg, end) && - push16(pucch_pdu->prb_size, ppWritePackedMsg, end) && - push8(pucch_pdu->start_symbol_index, ppWritePackedMsg, end) && - push8(pucch_pdu->nr_of_symbols, ppWritePackedMsg, end) && - push8(pucch_pdu->freq_hop_flag, ppWritePackedMsg, end) && - push16(pucch_pdu->second_hop_prb, ppWritePackedMsg, end) && - push8(pucch_pdu->group_hop_flag, ppWritePackedMsg, end) && - push8(pucch_pdu->sequence_hop_flag, ppWritePackedMsg, end) && - push16(pucch_pdu->hopping_id, ppWritePackedMsg, end) && - push16(pucch_pdu->initial_cyclic_shift, ppWritePackedMsg, end) && - push16(pucch_pdu->data_scrambling_id, ppWritePackedMsg, end) && - push8(pucch_pdu->time_domain_occ_idx, ppWritePackedMsg, end) && - push8(pucch_pdu->pre_dft_occ_idx, ppWritePackedMsg, end) && - push8(pucch_pdu->pre_dft_occ_len, ppWritePackedMsg, end) && - push8(pucch_pdu->add_dmrs_flag, ppWritePackedMsg, end) && - push16(pucch_pdu->dmrs_scrambling_id, ppWritePackedMsg, end) && - push8(pucch_pdu->dmrs_cyclic_shift, ppWritePackedMsg, end) && - push8(pucch_pdu->sr_flag, ppWritePackedMsg, end) && - push8(pucch_pdu->bit_len_harq, ppWritePackedMsg, end) && - push16(pucch_pdu->bit_len_csi_part1, ppWritePackedMsg, end) && - push16(pucch_pdu->bit_len_csi_part2, ppWritePackedMsg, end) - // TODO: ignoring beamforming tlv for now - ); -} - - -static uint8_t pack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { - if (!( - push16(pusch_pdu->pdu_bit_map, ppWritePackedMsg, end) && - push16(pusch_pdu->rnti, ppWritePackedMsg, end) && - push32(pusch_pdu->handle, ppWritePackedMsg, end) && - push16(pusch_pdu->bwp_size, ppWritePackedMsg, end) && - push16(pusch_pdu->bwp_start, ppWritePackedMsg, end) && - push8(pusch_pdu->subcarrier_spacing, ppWritePackedMsg, end) && - push8(pusch_pdu->cyclic_prefix, ppWritePackedMsg, end) && - push16(pusch_pdu->target_code_rate, ppWritePackedMsg, end) && - push8(pusch_pdu->qam_mod_order, ppWritePackedMsg, end) && - push8(pusch_pdu->mcs_index, ppWritePackedMsg, end) && - push8(pusch_pdu->mcs_table, ppWritePackedMsg, end) && - push8(pusch_pdu->transform_precoding, ppWritePackedMsg, end) && - push16(pusch_pdu->data_scrambling_id, ppWritePackedMsg, end) && - push8(pusch_pdu->nrOfLayers, ppWritePackedMsg, end) && - push16(pusch_pdu->ul_dmrs_symb_pos, ppWritePackedMsg, end) && - push8(pusch_pdu->dmrs_config_type, ppWritePackedMsg, end) && - push16(pusch_pdu->ul_dmrs_scrambling_id, ppWritePackedMsg, end) && - push8(pusch_pdu->scid, ppWritePackedMsg, end) && - push8(pusch_pdu->num_dmrs_cdm_grps_no_data, ppWritePackedMsg, end) && - push16(pusch_pdu->dmrs_ports, ppWritePackedMsg, end) && - push8(pusch_pdu->resource_alloc, ppWritePackedMsg, end) && - push8(pusch_pdu->resource_alloc,ppWritePackedMsg, end) && - push16(pusch_pdu->dmrs_ports, ppWritePackedMsg, end) && - push16(pusch_pdu->rb_start, ppWritePackedMsg, end) && - push16(pusch_pdu->rb_size, ppWritePackedMsg, end) && - push8(pusch_pdu->vrb_to_prb_mapping, ppWritePackedMsg, end) && - push8(pusch_pdu->frequency_hopping, ppWritePackedMsg, end) && - push16(pusch_pdu->tx_direct_current_location, ppWritePackedMsg, end) && - push8(pusch_pdu->uplink_frequency_shift_7p5khz, ppWritePackedMsg, end) && - push8(pusch_pdu->start_symbol_index, ppWritePackedMsg, end) && - push8(pusch_pdu->nr_of_symbols, ppWritePackedMsg, end) - // TODO: ignoring beamforming tlv for now - )) - return 0; - - //Pack Optional Data only included if indicated in pduBitmap - switch(pusch_pdu->pdu_bit_map) { - case PUSCH_PDU_BITMAP_PUSCH_DATA: { - // pack optional TLVs - return( - push8(pusch_pdu->pusch_data.rv_index, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_data.harq_process_id, ppWritePackedMsg, end) && - push32(pusch_pdu->pusch_data.tb_size, ppWritePackedMsg, end) && - push16(pusch_pdu->pusch_data.num_cb, ppWritePackedMsg, end) && - pusharray8(pusch_pdu->pusch_data.cb_present_and_position,1,1,ppWritePackedMsg, end) - ); - } - break; - - case PUSCH_PDU_BITMAP_PUSCH_UCI: { - return( - push16(pusch_pdu->pusch_uci.harq_ack_bit_length, ppWritePackedMsg, end) && - push16(pusch_pdu->pusch_uci.csi_part1_bit_length, ppWritePackedMsg, end) && - push16(pusch_pdu->pusch_uci.csi_part2_bit_length, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_uci.alpha_scaling, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_uci.beta_offset_harq_ack, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_uci.beta_offset_csi1, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_uci.beta_offset_csi2, ppWritePackedMsg, end) - ); - } - break; - - case PUSCH_PDU_BITMAP_PUSCH_PTRS: { - return( - push8(pusch_pdu->pusch_ptrs.num_ptrs_ports, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_dmrs_port, ppWritePackedMsg, end) && - push16(pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_port_index, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_re_offset, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_ptrs.ptrs_time_density, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_ptrs.ptrs_freq_density, ppWritePackedMsg, end) && - push8(pusch_pdu->pusch_ptrs.ul_ptrs_power, ppWritePackedMsg, end) - ); - } - break; - - case PUSCH_PDU_BITMAP_DFTS_OFDM: { - return( - push8(pusch_pdu->dfts_ofdm.low_papr_group_number, ppWritePackedMsg, end) && - push16(pusch_pdu->dfts_ofdm.low_papr_sequence_number, ppWritePackedMsg, end) && - push8(pusch_pdu->dfts_ofdm.ul_ptrs_sample_density, ppWritePackedMsg, end) && - push8(pusch_pdu->dfts_ofdm.ul_ptrs_time_density_transform_precoding, ppWritePackedMsg, end) - ); - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_INFO, "Invalid pdu bitmap %d \n", pusch_pdu->pdu_bit_map ); - } - } - - return 1; -} - -static uint8_t pack_ul_tti_request_srs_pdu(nfapi_nr_srs_pdu_t *srs_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { - return( - push16(srs_pdu->rnti, ppWritePackedMsg, end) && - push32(srs_pdu->handle, ppWritePackedMsg, end) && - push16(srs_pdu->bwp_size, ppWritePackedMsg, end) && - push16(srs_pdu->bwp_start, ppWritePackedMsg, end) && - push8(srs_pdu->subcarrier_spacing, ppWritePackedMsg, end) && - push8(srs_pdu->cyclic_prefix, ppWritePackedMsg, end) && - push8(srs_pdu->num_ant_ports, ppWritePackedMsg, end) && - push8(srs_pdu->num_symbols, ppWritePackedMsg, end) && - push8(srs_pdu->num_repetitions, ppWritePackedMsg, end) && - push8(srs_pdu->time_start_position, ppWritePackedMsg, end) && - push8(srs_pdu->config_index, ppWritePackedMsg, end) && - push16(srs_pdu->sequence_id, ppWritePackedMsg, end) && - push8(srs_pdu->bandwidth_index, ppWritePackedMsg, end) && - push8(srs_pdu->comb_size, ppWritePackedMsg, end) && - push8(srs_pdu->comb_offset, ppWritePackedMsg, end) && - push8(srs_pdu->cyclic_shift, ppWritePackedMsg, end) && - push8(srs_pdu->frequency_position, ppWritePackedMsg, end) && - push8(srs_pdu->frequency_shift, ppWritePackedMsg, end) && - push8(srs_pdu->frequency_hopping, ppWritePackedMsg, end) && - push8(srs_pdu->group_or_sequence_hopping, ppWritePackedMsg, end) && - push8(srs_pdu->resource_type, ppWritePackedMsg, end) && - push16(srs_pdu->t_srs, ppWritePackedMsg, end) && - push16(srs_pdu->t_offset, ppWritePackedMsg, end) - // TODO: ignoring beamforming tlv for now - ); -} - -static uint8_t pack_ul_config_request_ulsch_pdu(nfapi_ul_config_ulsch_pdu *ulsch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG, &ulsch_pdu->ulsch_pdu_rel8, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel8_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG, &ulsch_pdu->ulsch_pdu_rel10, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel10_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG, &ulsch_pdu->ulsch_pdu_rel11, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel11_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG, &ulsch_pdu->ulsch_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel13_value)); -} - -static uint8_t pack_ul_config_request_cqi_ri_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_ri_information_rel8_t *cqi_ri_info_rel8 = (nfapi_ul_config_cqi_ri_information_rel8_t *)tlv; - return ( push8(cqi_ri_info_rel8->dl_cqi_pmi_size_rank_1, ppWritePackedMsg, end) && - push8(cqi_ri_info_rel8->dl_cqi_pmi_size_rank_greater_1, ppWritePackedMsg, end) && - push8(cqi_ri_info_rel8->ri_size, ppWritePackedMsg, end) && - push8(cqi_ri_info_rel8->delta_offset_cqi, ppWritePackedMsg, end) && - push8(cqi_ri_info_rel8->delta_offset_ri, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_cqi_ri_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_ri_information_rel9_t *cqi_ri_info_rel9 = (nfapi_ul_config_cqi_ri_information_rel9_t *)tlv; - - if(!(push8(cqi_ri_info_rel9->report_type, ppWritePackedMsg, end) && - push8(cqi_ri_info_rel9->delta_offset_cqi, ppWritePackedMsg, end) && - push8(cqi_ri_info_rel9->delta_offset_ri, ppWritePackedMsg, end))) { - return 0; - } - - switch(cqi_ri_info_rel9->report_type) { - case NFAPI_CSI_REPORT_TYPE_PERIODIC: { - if(!(push8(cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size, ppWritePackedMsg, end) && - push8(cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.control_type, ppWritePackedMsg, end))) { - return 0; - } - } - break; - - case NFAPI_CSI_REPORT_TYPE_APERIODIC: { - if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc, ppWritePackedMsg, end) == 0) - return 0; - - uint8_t i; - - for(i = 0; i < cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc; ++i) { - if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size, ppWritePackedMsg, end) == 0) - return 0; - - uint8_t j; - - for(j = 0; j < 8; ++j) { - if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size[j], ppWritePackedMsg, end) == 0) - return 0; - } - } - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel9->report_type ); - } - break; - }; - - return 1; -} - -static uint8_t pack_ul_config_request_cqi_ri_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_ri_information_rel13_t *cqi_ri_info_rel13 = (nfapi_ul_config_cqi_ri_information_rel13_t *)tlv; - - switch(cqi_ri_info_rel13->report_type) { - case NFAPI_CSI_REPORT_TYPE_PERIODIC: { - if(push16(cqi_ri_info_rel13->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size_2, ppWritePackedMsg, end) == 0) - return 0; - } - break; - - case NFAPI_CSI_REPORT_TYPE_APERIODIC: { - // No parameters - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel13->report_type ); - } - break; - }; - - return 1; -} - -static uint8_t pack_ul_config_request_cqi_ri_information(nfapi_ul_config_cqi_ri_information *cqi_ri_info, uint8_t **ppWritePackedMsg, uint8_t *end) { - return (pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG, &cqi_ri_info->cqi_ri_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel8_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG, &cqi_ri_info->cqi_ri_information_rel9, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel9_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG, &cqi_ri_info->cqi_ri_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel13_value)); -} - -static uint8_t pack_ul_config_request_init_tx_params_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_initial_transmission_parameters_rel8_t *init_tx_params_rel8 = (nfapi_ul_config_initial_transmission_parameters_rel8_t *)tlv; - return (push8(init_tx_params_rel8->n_srs_initial, ppWritePackedMsg, end) && - push8(init_tx_params_rel8->initial_number_of_resource_blocks, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_initial_transmission_parameters(nfapi_ul_config_initial_transmission_parameters *init_tx_params, uint8_t **ppWritePackedMsg, uint8_t *end) { - return pack_tlv(NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG, &init_tx_params->initial_transmission_parameters_rel8, ppWritePackedMsg, end, - &pack_ul_config_request_init_tx_params_rel8_value); -} - -static uint8_t pack_ul_config_request_ulsch_harq_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_harq_information_rel10_t *harq_info_rel10 = (nfapi_ul_config_ulsch_harq_information_rel10_t *)tlv; - return (push8(harq_info_rel10->harq_size, ppWritePackedMsg, end) && - push8(harq_info_rel10->delta_offset_harq, ppWritePackedMsg, end) && - push8(harq_info_rel10->ack_nack_mode, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_ulsch_harq_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_harq_information_rel13_t *harq_info_rel13 = (nfapi_ul_config_ulsch_harq_information_rel13_t *)tlv; - return (push16(harq_info_rel13->harq_size_2, ppWritePackedMsg, end) && - push8(harq_info_rel13->delta_offset_harq_2, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_ulsch_harq_information(nfapi_ul_config_ulsch_harq_information *harq_info, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG, &harq_info->harq_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_harq_info_rel10_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG, &harq_info->harq_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_harq_info_rel13_value)); -} - -static uint8_t pack_ul_config_request_ue_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ue_information_rel8_t *ue_info_rel8 = (nfapi_ul_config_ue_information_rel8_t *)tlv; - return ( push32(ue_info_rel8->handle, ppWritePackedMsg, end) && - push16(ue_info_rel8->rnti, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_ue_info_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ue_information_rel11_t *ue_info_rel11 = (nfapi_ul_config_ue_information_rel11_t *)tlv; - return ( push8(ue_info_rel11->virtual_cell_id_enabled_flag, ppWritePackedMsg, end) && - push16(ue_info_rel11->npusch_identity, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_ue_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_ue_information_rel13_t *ue_info_rel13 = (nfapi_ul_config_ue_information_rel13_t *)tlv; - return ( push8(ue_info_rel13->ue_type, ppWritePackedMsg, end) && - push8(ue_info_rel13->empty_symbols, ppWritePackedMsg, end) && - push16(ue_info_rel13->total_number_of_repetitions, ppWritePackedMsg, end) && - push16(ue_info_rel13->repetition_number, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_ue_information(nfapi_ul_config_ue_information *ue_info, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &ue_info->ue_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel8_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &ue_info->ue_information_rel11, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel11_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &ue_info->ue_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel13_value)); -} - -static uint8_t pack_ul_config_request_harq_info_rel10_tdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel10_tdd_t *harq_info_rel10_tdd = (nfapi_ul_config_harq_information_rel10_tdd_t *)tlv; - return ( push8(harq_info_rel10_tdd->harq_size, ppWritePackedMsg, end) && - push8(harq_info_rel10_tdd->ack_nack_mode, ppWritePackedMsg, end) && - push8(harq_info_rel10_tdd->number_of_pucch_resources, ppWritePackedMsg, end) && - push16(harq_info_rel10_tdd->n_pucch_1_0, ppWritePackedMsg, end) && - push16(harq_info_rel10_tdd->n_pucch_1_1, ppWritePackedMsg, end) && - push16(harq_info_rel10_tdd->n_pucch_1_2, ppWritePackedMsg, end) && - push16(harq_info_rel10_tdd->n_pucch_1_3, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_harq_info_rel8_fdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel8_fdd_t *harq_info_rel8_fdd = (nfapi_ul_config_harq_information_rel8_fdd_t *)tlv; - return ( push16(harq_info_rel8_fdd->n_pucch_1_0, ppWritePackedMsg, end) && - push8(harq_info_rel8_fdd->harq_size, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_harq_info_rel9_fdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel9_fdd_t *harq_info_rel9_fdd = (nfapi_ul_config_harq_information_rel9_fdd_t *)tlv; - return ( push8(harq_info_rel9_fdd->harq_size, ppWritePackedMsg, end) && - push8(harq_info_rel9_fdd->ack_nack_mode, ppWritePackedMsg, end) && - push8(harq_info_rel9_fdd->number_of_pucch_resources, ppWritePackedMsg, end) && - push16(harq_info_rel9_fdd->n_pucch_1_0, ppWritePackedMsg, end) && - push16(harq_info_rel9_fdd->n_pucch_1_1, ppWritePackedMsg, end) && - push16(harq_info_rel9_fdd->n_pucch_1_2, ppWritePackedMsg, end) && - push16(harq_info_rel9_fdd->n_pucch_1_3, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_harq_info_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel11_t *harq_info_rel11 = (nfapi_ul_config_harq_information_rel11_t *)tlv; - return ( push8(harq_info_rel11->num_ant_ports, ppWritePackedMsg, end) && - push16(harq_info_rel11->n_pucch_2_0, ppWritePackedMsg, end) && - push16(harq_info_rel11->n_pucch_2_1, ppWritePackedMsg, end) && - push16(harq_info_rel11->n_pucch_2_2, ppWritePackedMsg, end) && - push16(harq_info_rel11->n_pucch_2_3, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_harq_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel13_t *harq_info_rel13 = (nfapi_ul_config_harq_information_rel13_t *)tlv; - return ( push16(harq_info_rel13->harq_size_2, ppWritePackedMsg, end) && - push8(harq_info_rel13->starting_prb, ppWritePackedMsg, end) && - push8(harq_info_rel13->n_prb, ppWritePackedMsg, end) && - push8(harq_info_rel13->cdm_index, ppWritePackedMsg, end) && - push8(harq_info_rel13->n_srs, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_harq_information(nfapi_ul_config_harq_information *harq_info, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG, &harq_info->harq_information_rel10_tdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel10_tdd_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG, &harq_info->harq_information_rel8_fdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel8_fdd_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG, &harq_info->harq_information_rel9_fdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel9_fdd_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG, &harq_info->harq_information_rel11, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel11_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG, &harq_info->harq_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel13_value)); -} - -static uint8_t pack_ul_config_request_cqi_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_information_rel8_t *cqi_info_rel8 = (nfapi_ul_config_cqi_information_rel8_t *)tlv; - return ( push16(cqi_info_rel8->pucch_index, ppWritePackedMsg, end) && - push8(cqi_info_rel8->dl_cqi_pmi_size, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_cqi_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_information_rel10_t *cqi_info_rel10 = (nfapi_ul_config_cqi_information_rel10_t *)tlv; - return ( push8(cqi_info_rel10->number_of_pucch_resource, ppWritePackedMsg, end) && - push16(cqi_info_rel10->pucch_index_p1, ppWritePackedMsg, end)); -} -static uint8_t pack_ul_config_request_cqi_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_information_rel13_t *cqi_info_rel13 = (nfapi_ul_config_cqi_information_rel13_t *)tlv; - return ( push8(cqi_info_rel13->csi_mode, ppWritePackedMsg, end) && - push16(cqi_info_rel13->dl_cqi_pmi_size_2, ppWritePackedMsg, end) && - push8(cqi_info_rel13->starting_prb, ppWritePackedMsg, end) && - push8(cqi_info_rel13->n_prb, ppWritePackedMsg, end) && - push8(cqi_info_rel13->cdm_index, ppWritePackedMsg, end) && - push8(cqi_info_rel13->n_srs, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_cqi_information(nfapi_ul_config_cqi_information *cqi_info, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG, &cqi_info->cqi_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel8_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG, &cqi_info->cqi_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel10_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG, &cqi_info->cqi_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel13_value)); -} - -static uint8_t pack_ul_config_request_sr_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_sr_information_rel8_t *sr_info_rel8 = (nfapi_ul_config_sr_information_rel8_t *)tlv; - return push16(sr_info_rel8->pucch_index, ppWritePackedMsg, end); -} -static uint8_t pack_ul_config_request_sr_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_sr_information_rel10_t *sr_info_rel10 = (nfapi_ul_config_sr_information_rel10_t *)tlv; - return ( push8(sr_info_rel10->number_of_pucch_resources, ppWritePackedMsg, end) && - push16(sr_info_rel10->pucch_index_p1, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_sr_information(nfapi_ul_config_sr_information *sr_info, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG, &sr_info->sr_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_sr_info_rel8_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG, &sr_info->sr_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_sr_info_rel10_value)); -} - -static uint8_t pack_ul_config_request_srs_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_srs_pdu_rel8_t *srs_pdu_rel8 = (nfapi_ul_config_srs_pdu_rel8_t *)tlv; - return (push32(srs_pdu_rel8->handle, ppWritePackedMsg, end) && - push16(srs_pdu_rel8->size, ppWritePackedMsg, end) && - push16(srs_pdu_rel8->rnti, ppWritePackedMsg, end) && - push8(srs_pdu_rel8->srs_bandwidth, ppWritePackedMsg, end) && - push8(srs_pdu_rel8->frequency_domain_position, ppWritePackedMsg, end) && - push8(srs_pdu_rel8->srs_hopping_bandwidth, ppWritePackedMsg, end) && - push8(srs_pdu_rel8->transmission_comb, ppWritePackedMsg, end) && - push16(srs_pdu_rel8->i_srs, ppWritePackedMsg, end) && - push8(srs_pdu_rel8->sounding_reference_cyclic_shift, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_srs_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_srs_pdu_rel10_t *srs_pdu_rel10 = (nfapi_ul_config_srs_pdu_rel10_t *)tlv; - return push8(srs_pdu_rel10->antenna_port, ppWritePackedMsg, end); -} - -static uint8_t pack_ul_config_request_srs_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_srs_pdu_rel13_t *srs_pdu_rel13 = (nfapi_ul_config_srs_pdu_rel13_t *)tlv; - return ( push8(srs_pdu_rel13->number_of_combs, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_nb_harq_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_nb_harq_information_rel13_fdd_t *nb_harq_pdu_rel13 = (nfapi_ul_config_nb_harq_information_rel13_fdd_t *)tlv; - return ( push8(nb_harq_pdu_rel13->harq_ack_resource, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_config_request_nulsch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_nulsch_pdu_rel13_t *nulsch_pdu_rel13 = (nfapi_ul_config_nulsch_pdu_rel13_t *)tlv; - return (push8(nulsch_pdu_rel13->nulsch_format, ppWritePackedMsg, end) && - push32(nulsch_pdu_rel13->handle, ppWritePackedMsg, end) && - push16(nulsch_pdu_rel13->size, ppWritePackedMsg, end) && - push16(nulsch_pdu_rel13->rnti, ppWritePackedMsg, end) && - push8(nulsch_pdu_rel13->subcarrier_indication, ppWritePackedMsg, end) && - push8(nulsch_pdu_rel13->resource_assignment, ppWritePackedMsg, end) && - push8(nulsch_pdu_rel13->mcs, ppWritePackedMsg, end) && - push8(nulsch_pdu_rel13->redudancy_version, ppWritePackedMsg, end) && - push8(nulsch_pdu_rel13->repetition_number, ppWritePackedMsg, end) && - push8(nulsch_pdu_rel13->new_data_indication, ppWritePackedMsg, end) && - push8(nulsch_pdu_rel13->n_srs, ppWritePackedMsg, end) && - push16(nulsch_pdu_rel13->scrambling_sequence_initialization_cinit, ppWritePackedMsg, end) && - push16(nulsch_pdu_rel13->sf_idx, ppWritePackedMsg, end) && - pack_ul_config_request_ue_information(&(nulsch_pdu_rel13->ue_information), ppWritePackedMsg, end) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG, &nulsch_pdu_rel13->nb_harq_information.nb_harq_information_rel13_fdd, ppWritePackedMsg, end, - &pack_ul_config_request_nb_harq_rel13_value)); -} -static uint8_t pack_ul_config_request_nrach_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_nrach_pdu_rel13_t *nrach_pdu_rel13 = (nfapi_ul_config_nrach_pdu_rel13_t *)tlv; - return ( push8(nrach_pdu_rel13->nprach_config_0, ppWritePackedMsg, end) && - push8(nrach_pdu_rel13->nprach_config_1, ppWritePackedMsg, end) && - push8(nrach_pdu_rel13->nprach_config_2, ppWritePackedMsg, end)); -} - - - -static uint8_t pack_ul_tti_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_ul_tti_request_number_of_pdus_t *value = (nfapi_nr_ul_tti_request_number_of_pdus_t *)tlv; - - if(!(push16(value->pdu_size, ppWritePackedMsg, end) && - push16(value->pdu_type, ppWritePackedMsg, end) )) - return 0; - - // first match the pdu type, then call the respective function - switch(value->pdu_type) { - case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE: { - if(!pack_ul_tti_request_prach_pdu(&value->prach_pdu, ppWritePackedMsg, end)) - return 0; - } - break; - - case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE: { - if(!pack_ul_tti_request_pucch_pdu(&value->pucch_pdu, ppWritePackedMsg, end)) - return 0; - } - break; - - case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE: { - if(!pack_ul_tti_request_pusch_pdu(&value->pusch_pdu, ppWritePackedMsg, end)) - return 0; - } - break; - - case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE: { - if(!pack_ul_tti_request_srs_pdu(&value->srs_pdu, ppWritePackedMsg, end)) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid UL_TTI pdu type %d \n", value->pdu_type ); - } - break; - } - - return 1; -} - -static uint8_t pack_ul_tti_groups_list_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_ul_tti_request_number_of_groups_t *value = (nfapi_nr_ul_tti_request_number_of_groups_t *)tlv; - - if(!push8(value->n_ue, ppWritePackedMsg, end)) - return 0; - - for(int i=0; in_ue; i++) { - if(!push8(value->ue_list[i].pdu_idx, ppWritePackedMsg, end)) - return 0; - } - - return 1; -} - -static uint8_t pack_ul_config_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_config_request_body_t *value = (nfapi_ul_config_request_body_t *)tlv; - - if(!(push8(value->number_of_pdus, ppWritePackedMsg, end) && - push8(value->rach_prach_frequency_resources, ppWritePackedMsg, end) && - push8(value->srs_present, ppWritePackedMsg, end))) - return 0; - - uint16_t i = 0; - - for(i = 0; i < value->number_of_pdus; ++i) { - nfapi_ul_config_request_pdu_t *pdu = &(value->ul_config_pdu_list[i]); - - if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) - return 0; - - // Put a 0 size in and then determine the size after the pdu - // has been writen and write the calculated size - uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; - pdu->pdu_size = 0; - - if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) - return 0; - - switch(pdu->pdu_type) { - case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: { - if(!pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_pdu), ppWritePackedMsg, end)) - return 0; - } - break; - - case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: { - if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_cqi_ri_pdu.ulsch_pdu), ppWritePackedMsg, end) && - pack_ul_config_request_cqi_ri_information(&(pdu->ulsch_cqi_ri_pdu.cqi_ri_information), ppWritePackedMsg, end) && - pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_cqi_ri_pdu.initial_transmission_parameters), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: { - if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) && - pack_ul_config_request_ulsch_harq_information(&(pdu->ulsch_harq_pdu.harq_information), ppWritePackedMsg, end) && - pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_harq_pdu.initial_transmission_parameters), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: { - if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu), ppWritePackedMsg, end) && - pack_ul_config_request_cqi_ri_information(&(pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information), ppWritePackedMsg, end) && - pack_ul_config_request_ulsch_harq_information(&(pdu->ulsch_cqi_harq_ri_pdu.harq_information), ppWritePackedMsg, end) && - pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: { - if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_pdu.ue_information), ppWritePackedMsg, end) && - pack_ul_config_request_cqi_information(&(pdu->uci_cqi_pdu.cqi_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: { - if(!(pack_ul_config_request_ue_information(&(pdu->uci_sr_pdu.ue_information), ppWritePackedMsg, end) && - pack_ul_config_request_sr_information(&(pdu->uci_sr_pdu.sr_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: { - if(!(pack_ul_config_request_ue_information(&(pdu->uci_harq_pdu.ue_information), ppWritePackedMsg, end) && - pack_ul_config_request_harq_information(&(pdu->uci_harq_pdu.harq_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: { - if(!(pack_ul_config_request_ue_information(&(pdu->uci_sr_harq_pdu.ue_information), ppWritePackedMsg, end) && - pack_ul_config_request_sr_information(&(pdu->uci_sr_harq_pdu.sr_information), ppWritePackedMsg, end) && - pack_ul_config_request_harq_information(&(pdu->uci_sr_harq_pdu.harq_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: { - if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_harq_pdu.ue_information), ppWritePackedMsg, end) && - pack_ul_config_request_cqi_information(&(pdu->uci_cqi_harq_pdu.cqi_information), ppWritePackedMsg, end) && - pack_ul_config_request_harq_information(&(pdu->uci_cqi_harq_pdu.harq_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: { - if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_sr_pdu.ue_information), ppWritePackedMsg, end) && - pack_ul_config_request_cqi_information(&(pdu->uci_cqi_sr_pdu.cqi_information), ppWritePackedMsg, end) && - pack_ul_config_request_sr_information(&(pdu->uci_cqi_sr_pdu.sr_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: { - if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_sr_harq_pdu.ue_information), ppWritePackedMsg, end) && - pack_ul_config_request_cqi_information(&(pdu->uci_cqi_sr_harq_pdu.cqi_information), ppWritePackedMsg, end) && - pack_ul_config_request_sr_information(&(pdu->uci_cqi_sr_harq_pdu.sr_information), ppWritePackedMsg, end) && - pack_ul_config_request_harq_information(&(pdu->uci_cqi_sr_harq_pdu.harq_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_SRS_PDU_TYPE: { - if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG, &pdu->srs_pdu.srs_pdu_rel8, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel8_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG, &pdu->srs_pdu.srs_pdu_rel10, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel10_value) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG, &pdu->srs_pdu.srs_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel13_value))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE: { - if(!(pack_ul_config_request_ue_information(&(pdu->harq_buffer_pdu.ue_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: { - if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_uci_csi_pdu.ulsch_pdu), ppWritePackedMsg, end) && - pack_ul_config_request_cqi_information(&(pdu->ulsch_uci_csi_pdu.csi_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: { - if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_uci_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) && - pack_ul_config_request_harq_information(&(pdu->ulsch_uci_harq_pdu.harq_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: { - if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_csi_uci_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) && - pack_ul_config_request_cqi_information(&(pdu->ulsch_csi_uci_harq_pdu.csi_information), ppWritePackedMsg, end) && - pack_ul_config_request_harq_information(&(pdu->ulsch_csi_uci_harq_pdu.harq_information), ppWritePackedMsg, end))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG, &pdu->nulsch_pdu.nulsch_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_nulsch_pdu_rel13_value))) - return 0; - } - break; - - case NFAPI_UL_CONFIG_NRACH_PDU_TYPE: { - if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG, &pdu->nrach_pdu.nrach_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_nrach_pdu_rel13_value))) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type ); - } - break; - }; - - // add 1 for the pdu_type. The delta will include the pdu_size - pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); - - push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); - } - - return 1; -} - - -static uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg; - - if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && - push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && - push8(pNfapiMsg->n_pdus, ppWritePackedMsg, end) && - push8(pNfapiMsg->rach_present, ppWritePackedMsg, end) && - push8(pNfapiMsg->n_ulsch, ppWritePackedMsg, end) && - push8(pNfapiMsg->n_ulcch, ppWritePackedMsg, end) && - push8(pNfapiMsg->n_group, ppWritePackedMsg, end) )) - return 0; - - for(int i=0; in_pdus; i++) { - if(!pack_ul_tti_pdu_list_value(&pNfapiMsg->pdus_list[i], ppWritePackedMsg, end)) - return 0; - } - - for(int i=0; in_group; i++) { - if(!pack_ul_tti_groups_list_value(&pNfapiMsg->groups_list[i], ppWritePackedMsg, end)) - return 0; - } - - return 1; -} - - -static uint8_t pack_ul_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_ul_config_request_t *pNfapiMsg = (nfapi_ul_config_request_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_UL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->ul_config_request_body, ppWritePackedMsg, end, &pack_ul_config_request_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)) ; -} - -static uint8_t pack_hi_dci0_hi_rel8_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_hi_dci0_hi_pdu_rel8_t *hi_pdu_rel8 = (nfapi_hi_dci0_hi_pdu_rel8_t *)tlv; - return ( push8(hi_pdu_rel8->resource_block_start, ppWritePackedMsg, end) && - push8(hi_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) && - push8(hi_pdu_rel8->hi_value, ppWritePackedMsg, end) && - push8(hi_pdu_rel8->i_phich, ppWritePackedMsg, end) && - push16(hi_pdu_rel8->transmission_power, ppWritePackedMsg, end)); -} - -static uint8_t pack_hi_dci0_hi_rel10_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_hi_dci0_hi_pdu_rel10_t *hi_pdu_rel10 = (nfapi_hi_dci0_hi_pdu_rel10_t *)tlv; - return ( push8(hi_pdu_rel10->flag_tb2, ppWritePackedMsg, end) && - push8(hi_pdu_rel10->hi_value_2, ppWritePackedMsg, end)); -} - -static uint8_t pack_hi_dci0_dci_rel8_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_hi_dci0_dci_pdu_rel8_t *dci_pdu_rel8 = (nfapi_hi_dci0_dci_pdu_rel8_t *)tlv; - return ( push8(dci_pdu_rel8->dci_format, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->cce_index, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->aggregation_level, ppWritePackedMsg, end) && - push16(dci_pdu_rel8->rnti, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->resource_block_start, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->number_of_resource_block, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->mcs_1, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->frequency_hopping_enabled_flag, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->frequency_hopping_bits, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->new_data_indication_1, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->ue_tx_antenna_seleciton, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->tpc, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->cqi_csi_request, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->ul_index, ppWritePackedMsg, end) && - push8(dci_pdu_rel8->dl_assignment_index, ppWritePackedMsg, end) && - push32(dci_pdu_rel8->tpc_bitmap, ppWritePackedMsg, end) && - push16(dci_pdu_rel8->transmission_power, ppWritePackedMsg, end)); -} - -static uint8_t pack_hi_dci0_dci_rel10_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_hi_dci0_dci_pdu_rel10_t *dci_pdu_rel10 = (nfapi_hi_dci0_dci_pdu_rel10_t *)tlv; - return ( push8(dci_pdu_rel10->cross_carrier_scheduling_flag, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->carrier_indicator, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->size_of_cqi_csi_feild, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->srs_flag, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->srs_request, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->resource_allocation_flag, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->resource_allocation_type, ppWritePackedMsg, end) && - push32(dci_pdu_rel10->resource_block_coding, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->mcs_2, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->new_data_indication_2, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->number_of_antenna_ports, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->tpmi, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->total_dci_length_including_padding, ppWritePackedMsg, end) && - push8(dci_pdu_rel10->n_ul_rb, ppWritePackedMsg, end)); -} - -static uint8_t pack_hi_dci0_dci_rel12_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_hi_dci0_dci_pdu_rel12_t *dci_pdu_rel12 = (nfapi_hi_dci0_dci_pdu_rel12_t *)tlv; - return ( push8(dci_pdu_rel12->pscch_resource, ppWritePackedMsg, end) && - push8(dci_pdu_rel12->time_resource_pattern, ppWritePackedMsg, end)); -} - -static uint8_t pack_hi_dci0_mpdcch_dci_rel13_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t *mpdcch_dci_pdu_rel13 = (nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t *)tlv; - return ( push8(mpdcch_dci_pdu_rel13->mpdcch_narrowband, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->number_of_prb_pairs, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->resource_block_assignment, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->mpdcch_transmission_type, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->start_symbol, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->ecce_index, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->aggreagation_level, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->rnti_type, ppWritePackedMsg, end) && - push16(mpdcch_dci_pdu_rel13->rnti, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->ce_mode, ppWritePackedMsg, end) && - push16(mpdcch_dci_pdu_rel13->drms_scrambling_init, ppWritePackedMsg, end) && - push16(mpdcch_dci_pdu_rel13->initial_transmission_sf_io, ppWritePackedMsg, end) && - push16(mpdcch_dci_pdu_rel13->transmission_power, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->dci_format, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->resource_block_start, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->number_of_resource_blocks, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->mcs, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->pusch_repetition_levels, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->frequency_hopping_flag, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->new_data_indication, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->harq_process, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->redudency_version, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->tpc, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->csi_request, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->ul_inex, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->dai_presence_flag, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->dl_assignment_index, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->srs_request, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->dci_subframe_repetition_number, ppWritePackedMsg, end) && - push32(mpdcch_dci_pdu_rel13->tcp_bitmap, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->total_dci_length_include_padding, ppWritePackedMsg, end) && - push8(mpdcch_dci_pdu_rel13->number_of_tx_antenna_ports, ppWritePackedMsg, end) && - pusharray16(mpdcch_dci_pdu_rel13->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, mpdcch_dci_pdu_rel13->number_of_tx_antenna_ports, ppWritePackedMsg, end)); -} - -static uint8_t pack_hi_dci0_npdcch_dci_rel13_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_hi_dci0_npdcch_dci_pdu_rel13_t *npdcch_dci_pdu_rel13 = (nfapi_hi_dci0_npdcch_dci_pdu_rel13_t *)tlv; - return ( push8(npdcch_dci_pdu_rel13->ncce_index, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->aggregation_level, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->start_symbol, ppWritePackedMsg, end) && - push16(npdcch_dci_pdu_rel13->rnti, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->scrambling_reinitialization_batch_index, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->subcarrier_indication, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->resource_assignment, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->scheduling_delay, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->mcs, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->redudancy_version, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->repetition_number, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->new_data_indicator, ppWritePackedMsg, end) && - push8(npdcch_dci_pdu_rel13->dci_subframe_repetition_number, ppWritePackedMsg, end)); -} - - -static uint8_t pack_hi_dci0_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_hi_dci0_request_body_t *value = (nfapi_hi_dci0_request_body_t *)tlv; - - if(!(push16(value->sfnsf, ppWritePackedMsg, end) && - push8(value->number_of_dci, ppWritePackedMsg, end) && - push8(value->number_of_hi, ppWritePackedMsg, end))) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_dci + value->number_of_hi; - - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_hi_dci0_request_pdu_t *pdu = &(value->hi_dci0_pdu_list[i]); - - if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) - return 0; - - // Put a 0 size in and then determine the size after the pdu - // has been writen and write the calculated size - uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; - pdu->pdu_size = 0; - - if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) - return 0; - - switch(pdu->pdu_type) { - case NFAPI_HI_DCI0_HI_PDU_TYPE: { - if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG, &pdu->hi_pdu.hi_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_hi_rel8_pdu_value) && - pack_tlv(NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG, &pdu->hi_pdu.hi_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_hi_rel10_pdu_value))) - return 0; - } - break; - - case NFAPI_HI_DCI0_DCI_PDU_TYPE: { - if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG, &pdu->dci_pdu.dci_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_dci_rel8_pdu_value) && - pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG, &pdu->dci_pdu.dci_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_dci_rel10_pdu_value) && - pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG, &pdu->dci_pdu.dci_pdu_rel12, ppWritePackedMsg, end, pack_hi_dci0_dci_rel12_pdu_value))) - return 0; - } - break; - - case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE: { - if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_dci_rel8_pdu_value) && - pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_dci_rel10_pdu_value) && - pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG, &pdu->epdcch_dci_pdu.epdcch_parameters_rel11, ppWritePackedMsg, end, pack_dl_config_epdcch_parameters_rel11_value))) - return 0; - } - break; - - case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE: { - if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG, &pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13, ppWritePackedMsg, end, pack_hi_dci0_mpdcch_dci_rel13_pdu_value))) - return 0; - } - break; - - case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE: { - if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG, &pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13, ppWritePackedMsg, end, pack_hi_dci0_npdcch_dci_rel13_pdu_value))) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type ); - } - break; - }; - - // add 1 for the pdu_type. The delta will include the pdu_size - pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); - - push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); - } - - return 1; -} - -static uint8_t pack_ul_dci_pdu_list_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) -{ - nfapi_nr_ul_dci_request_pdus_t* value = (nfapi_nr_ul_dci_request_pdus_t*)tlv; - - for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i) - { - if(!(push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].RNTI, ppWritePackedMsg, end) && - push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].ScramblingId, ppWritePackedMsg, end) && - - push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].ScramblingRNTI, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].CceIndex, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].AggregationLevel, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].beta_PDCCH_1_0, ppWritePackedMsg, end) && - - push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].powerControlOffsetSS, ppWritePackedMsg, end) && - push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end) && - - pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].Payload, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end))) - - return 0; - } - - return (push16(value->PDUType, ppWritePackedMsg, end) && - push16(value->PDUSize, ppWritePackedMsg, end) && - push16(value->pdcch_pdu.pdcch_pdu_rel15.BWPSize, ppWritePackedMsg, end) && - push16(value->pdcch_pdu.pdcch_pdu_rel15.BWPStart, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.SubcarrierSpacing, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.CyclicPrefix, ppWritePackedMsg, end) && - - push8(value->pdcch_pdu.pdcch_pdu_rel15.StartSymbolIndex, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.DurationSymbols, ppWritePackedMsg, end) && - pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.FreqDomainResource, 6, 6, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.CceRegMappingType, ppWritePackedMsg, end) && - - push8(value->pdcch_pdu.pdcch_pdu_rel15.RegBundleSize, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.InterleaverSize, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.CoreSetType, ppWritePackedMsg, end) && - push16(value->pdcch_pdu.pdcch_pdu_rel15.ShiftIndex, ppWritePackedMsg, end) && - push8(value->pdcch_pdu.pdcch_pdu_rel15.precoderGranularity, ppWritePackedMsg, end) && - push16(value->pdcch_pdu.pdcch_pdu_rel15.numDlDci, ppWritePackedMsg, end)); - -} - -static uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t *)msg; - - if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && - push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && - push8(pNfapiMsg->numPdus, ppWritePackedMsg, end) - )) - return 0; - - for(int i=0; inumPdus; i++) { - if(!pack_ul_dci_pdu_list_value(&pNfapiMsg->ul_dci_pdu_list[i], ppWritePackedMsg, end)) - return 0; - } - - return 1; -} - - - -static uint8_t pack_hi_dci0_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_hi_dci0_request_t *pNfapiMsg = (nfapi_hi_dci0_request_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_HI_DCI0_REQUEST_BODY_TAG, &pNfapiMsg->hi_dci0_request_body, ppWritePackedMsg, end, &pack_hi_dci0_request_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -//pack_tx_data_pdu_list_value -static uint8_t pack_tx_data_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_pdu_t *value = (nfapi_nr_pdu_t *)tlv; - - if(!(push32(value->num_TLV, ppWritePackedMsg, end) && - push16(value->PDU_index, ppWritePackedMsg, end) && - push16(value->PDU_length, ppWritePackedMsg, end) - )) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_tlvs = value->num_TLV; - - for(; i < total_number_of_tlvs; ++i) { - if (!(push16(value->TLVs[i].length, ppWritePackedMsg, end) && - push16(value->TLVs[i].tag, ppWritePackedMsg, end))) - return 0; - - switch(value->TLVs[i].tag) { - case 0: { - if(!pusharray32(value->TLVs[i].value.direct, 16384, value->TLVs[i].length, ppWritePackedMsg, end)) - return 0; - - break; - } - - case 1: { - if(!pusharray32(value->TLVs[i].value.ptr, value->TLVs[i].length, value->TLVs[i].length, ppWritePackedMsg, end)) - return 0; - - break; - } - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid tag value %d \n", value->TLVs[i].tag ); - break; - } - } - } - - return 1; -} - -static uint8_t pack_tx_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_tx_request_body_t *value = (nfapi_tx_request_body_t *)tlv; - - if(push16(value->number_of_pdus, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_pdus; - - for(; i < total_number_of_pdus; ++i) { - nfapi_tx_request_pdu_t *pdu = &(value->tx_pdu_list[i]); - - if(!(push16(pdu->pdu_length, ppWritePackedMsg, end) && - push16(pdu->pdu_index, ppWritePackedMsg, end))) - return 0; - - uint8_t j; - - for(j = 0; j < pdu->num_segments; ++j) { - // Use -1 as it is unbounded - // DJP - does not handle -1 - // DJP - if(pusharray8(pdu->segments[j].segment_data, (uint32_t)(-1), pdu->segments[j].segment_length, ppWritePackedMsg, end) == 0) - int push_ret = pusharray8(pdu->segments[j].segment_data, 65535, pdu->segments[j].segment_length, ppWritePackedMsg, end); - - if (pdu->segments[j].segment_length == 3) { - NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, - pdu->segments[j].segment_data[0], - pdu->segments[j].segment_data[1], - pdu->segments[j].segment_data[2] - ); - } - - //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() segment_data:%p segment_length:%u pusharray8()=%d\n", __FUNCTION__, pdu->segments[j].segment_data, pdu->segments[j].segment_length, push_ret); - - if (push_ret == 0) { - return 0; - } - } - } - - return 1; -} - -static uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t *)msg; - - if (!( - push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && - push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && - push16(pNfapiMsg->Number_of_PDUs, ppWritePackedMsg, end) - )) - return 0; - - for(int i=0; iNumber_of_PDUs; i++) { - if(!pack_tx_data_pdu_list_value(&pNfapiMsg->pdu_list[i], ppWritePackedMsg, end)) - return 0; - } - - return 1; -} - -static uint8_t pack_tx_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t *)msg; - int x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end); - int y = pack_tlv(NFAPI_TX_REQUEST_BODY_TAG, &pNfapiMsg->tx_request_body, ppWritePackedMsg, end, &pack_tx_request_body_value); - int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); - //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() x:%d y:%d z:%d\n", __FUNCTION__, x, y, z); - return x && y && z; -} - -static uint8_t pack_release_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ue_release_request_body_t *value = (nfapi_ue_release_request_body_t *)tlv; - - if(push16(value->number_of_TLVs, ppWritePackedMsg, end) == 0) { - return 0; - } - - uint8_t j; - uint16_t num = value->number_of_TLVs; - - for(j = 0; j < num; ++j) { - if(push16(value->ue_release_request_TLVs_list[j].rnti, ppWritePackedMsg, end) == 0) { - return 0; - } - } - - return 1; -} - -static uint8_t pack_ue_release_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_ue_release_request_t *pNfapiMsg = (nfapi_ue_release_request_t *)msg; - int x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end); - int y = pack_tlv(NFAPI_UE_RELEASE_BODY_TAG, &pNfapiMsg->ue_release_request_body, ppWritePackedMsg, end, &pack_release_request_body_value); - int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); - return x && y && z; -} - -static uint8_t pack_ue_release_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_ue_release_response_t *pNfapiMsg = (nfapi_ue_release_response_t *)msg; - int x = push32(pNfapiMsg->error_code, ppWritePackedMsg, end); - int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); - return x && z; -} - -static uint8_t pack_rx_ue_information_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_rx_ue_information *value = (nfapi_rx_ue_information *)tlv; - return ( push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) ); -} - -static uint8_t unpack_rx_ue_information_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_rx_ue_information *value = (nfapi_rx_ue_information *)tlv; - return ( pull32(ppReadPackedMsg, &value->handle, end) && - pull16(ppReadPackedMsg, &value->rnti, end)); -} - -static uint8_t pack_harq_indication_tdd_harq_data_bundling(nfapi_harq_indication_tdd_harq_data_bundling_t *data, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( push8(data->value_0, ppWritePackedMsg, end) && - push8(data->value_1, ppWritePackedMsg, end)); -} - -static uint8_t pack_harq_indication_tdd_harq_data_multiplexing(nfapi_harq_indication_tdd_harq_data_multiplexing_t *data, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( push8(data->value_0, ppWritePackedMsg, end) && - push8(data->value_1, ppWritePackedMsg, end) && - push8(data->value_2, ppWritePackedMsg, end) && - push8(data->value_3, ppWritePackedMsg, end)); -} - -static uint8_t pack_harq_indication_tdd_harq_data_special_bundling(nfapi_harq_indication_tdd_harq_data_special_bundling_t *data, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( push8(data->value_0, ppWritePackedMsg, end) ); -} - -static uint8_t pack_harq_indication_tdd_harq_data(nfapi_harq_indication_tdd_harq_data_t *data, uint8_t **ppWritePackedMsg, uint8_t *end) { - return ( push8(data->value_0, ppWritePackedMsg, end) ); -} - -static uint8_t pack_harq_indication_tdd_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_rel8_t *harq_indication_tdd_rel8 = (nfapi_harq_indication_tdd_rel8_t *)tlv; - - if(!(push8(harq_indication_tdd_rel8->mode, ppWritePackedMsg, end) && - push8(harq_indication_tdd_rel8->number_of_ack_nack, ppWritePackedMsg, end))) - return 0; - - uint8_t result = 0; - - switch(harq_indication_tdd_rel8->mode) { - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: - result = pack_harq_indication_tdd_harq_data_bundling(&harq_indication_tdd_rel8->harq_data.bundling, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: - result = pack_harq_indication_tdd_harq_data_multiplexing(&harq_indication_tdd_rel8->harq_data.multiplex, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: - result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel8->harq_data.special_bundling, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: - result = 1; - break; - - default: - // err.... - break; - } - - return result; -} - -static uint8_t pack_harq_indication_tdd_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_rel9_t *harq_indication_tdd_rel9 = (nfapi_harq_indication_tdd_rel9_t *)tlv; - - if(!(push8(harq_indication_tdd_rel9->mode, ppWritePackedMsg, end) && - push8(harq_indication_tdd_rel9->number_of_ack_nack, ppWritePackedMsg, end))) - return 0; - - uint8_t idx; - - for(idx = 0; idx < harq_indication_tdd_rel9->number_of_ack_nack; ++idx) { - uint8_t result = 0; - - switch(harq_indication_tdd_rel9->mode) { - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: - result = pack_harq_indication_tdd_harq_data(&(harq_indication_tdd_rel9->harq_data[idx].bundling), ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].multiplex, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: - result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel9->harq_data[idx].special_bundling, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].channel_selection, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].format_3, ppWritePackedMsg, end); - break; - - default: - // err.... - break; - } - - if(result == 0) - return 0; - } - - return 1; -} - -static uint8_t pack_harq_indication_tdd_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_rel13_t *harq_indication_tdd_rel13 = (nfapi_harq_indication_tdd_rel13_t *)tlv; - - if(!(push8(harq_indication_tdd_rel13->mode, ppWritePackedMsg, end) && - push16(harq_indication_tdd_rel13->number_of_ack_nack, ppWritePackedMsg, end))) - return 0; - - uint8_t idx; - - for(idx = 0; idx < harq_indication_tdd_rel13->number_of_ack_nack; ++idx) { - uint8_t result = 0; - - switch(harq_indication_tdd_rel13->mode) { - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].bundling, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].multiplex, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: - result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel13->harq_data[idx].special_bundling, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].channel_selection, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_3, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_4, ppWritePackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5: - result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_5, ppWritePackedMsg, end); - break; - - default: - // err.... - break; - } - - if(result == 0) - return 0; - } - - return 1; -} - -static uint8_t pack_harq_indication_fdd_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_harq_indication_fdd_rel8_t *harq_indication_fdd_rel8 = (nfapi_harq_indication_fdd_rel8_t *)tlv; - return ( push8(harq_indication_fdd_rel8->harq_tb1, ppWritePackedMsg, end) && - push8(harq_indication_fdd_rel8->harq_tb2, ppWritePackedMsg, end)); -} - -static uint8_t pack_harq_indication_fdd_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_harq_indication_fdd_rel9_t *harq_indication_fdd_rel9 = (nfapi_harq_indication_fdd_rel9_t *)tlv; - return ( push8(harq_indication_fdd_rel9->mode, ppWritePackedMsg, end) && - push8(harq_indication_fdd_rel9->number_of_ack_nack, ppWritePackedMsg, end) && - pusharray8(harq_indication_fdd_rel9->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL9_MAX, harq_indication_fdd_rel9->number_of_ack_nack, ppWritePackedMsg, end)); -} - -static uint8_t pack_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_harq_indication_fdd_rel13_t *harq_indication_fdd_rel13 = (nfapi_harq_indication_fdd_rel13_t *)tlv; - return ( push8(harq_indication_fdd_rel13->mode, ppWritePackedMsg, end) && - push16(harq_indication_fdd_rel13->number_of_ack_nack, ppWritePackedMsg, end) && - pusharray8(harq_indication_fdd_rel13->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL13_MAX, harq_indication_fdd_rel13->number_of_ack_nack, ppWritePackedMsg, end)); -} - -static uint8_t pack_ul_cqi_information_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_ul_cqi_information_t *value = (nfapi_ul_cqi_information_t *)tlv; - return ( push8(value->ul_cqi, ppWritePackedMsg, end) && - push8(value->channel, ppWritePackedMsg, end)); -} - -static uint8_t pack_harq_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_harq_indication_body_t *value = (nfapi_harq_indication_body_t *)tlv; - - if(push16(value->number_of_harqs, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_harqs; - - for(; i < total_number_of_pdus; ++i) { - nfapi_harq_indication_pdu_t *pdu = &(value->harq_pdu_list[i]); - uint8_t *instance_length_p = *ppWritePackedMsg; - - if(!push16(pdu->instance_length, ppWritePackedMsg, end)) - return 0; - - if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && - pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL8_TAG, &pdu->harq_indication_tdd_rel8, ppWritePackedMsg, end, pack_harq_indication_tdd_rel8_value) && - pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL9_TAG, &pdu->harq_indication_tdd_rel9, ppWritePackedMsg, end, pack_harq_indication_tdd_rel9_value) && - pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL13_TAG, &pdu->harq_indication_tdd_rel13, ppWritePackedMsg, end, pack_harq_indication_tdd_rel13_value) && - pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL8_TAG, &pdu->harq_indication_fdd_rel8, ppWritePackedMsg, end, pack_harq_indication_fdd_rel8_value) && - pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL9_TAG, &pdu->harq_indication_fdd_rel9, ppWritePackedMsg, end, pack_harq_indication_fdd_rel9_value) && - pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL13_TAG, &pdu->harq_indication_fdd_rel13, ppWritePackedMsg, end, pack_harq_indication_fdd_rel13_value) && - pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value))) - return 0; - - // calculate the instance length subtracting the size of the instance - // length feild - uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; - push16(instance_length, &instance_length_p, end); - } - - return 1; -} - -static uint8_t pack_harq_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_harq_indication_t *pNfapiMsg = (nfapi_harq_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->harq_indication_body, ppWritePackedMsg, end, pack_harq_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_crc_indication_rel8_body(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_crc_indication_rel8_t *crc_indication_rel8 = (nfapi_crc_indication_rel8_t *)tlv; - return ( push8(crc_indication_rel8->crc_flag, ppWritePackedMsg, end) ); -} - -static uint8_t pack_crc_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_crc_indication_body_t *value = (nfapi_crc_indication_body_t *)tlv; - - if(push16(value->number_of_crcs, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_crcs; - - for(; i < total_number_of_pdus; ++i) { - nfapi_crc_indication_pdu_t *pdu = &(value->crc_pdu_list[i]); - uint8_t *instance_length_p = *ppWritePackedMsg; - - if(!push16(pdu->instance_length, ppWritePackedMsg, end)) - return 0; - - if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && - pack_tlv(NFAPI_CRC_INDICATION_REL8_TAG, &pdu->crc_indication_rel8, ppWritePackedMsg, end, pack_crc_indication_rel8_body))) - return 0; - - // calculate the instance length subtracting the size of the instance - // length feild - uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; - push16(instance_length, &instance_length_p, end); - } - - return 1; -} - -static uint8_t pack_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_crc_indication_t *pNfapiMsg = (nfapi_crc_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_CRC_INDICATION_BODY_TAG, &pNfapiMsg->crc_indication_body, ppWritePackedMsg, end, &pack_crc_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} -static uint8_t pack_rx_indication_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_rx_indication_rel8_t *value = (nfapi_rx_indication_rel8_t *)tlv; - return ( push16(value->length, ppWritePackedMsg, end) && - push16(value->offset, ppWritePackedMsg, end) && - push8(value->ul_cqi, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end)); -} -static uint8_t pack_rx_indication_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_rx_indication_rel9_t *value = (nfapi_rx_indication_rel9_t *)tlv; - return ( push16(value->timing_advance_r9, ppWritePackedMsg, end)); -} - -static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_rx_indication_body_t *value = (nfapi_rx_indication_body_t *)tlv; - - //printf("RX ULSCH BODY\n"); - - if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0) - return 0; - - // need to calculate the data offset's. - uint16_t i = 0; - uint16_t offset = 2; // taking into account the number_of_pdus - uint16_t total_number_of_pdus = value->number_of_pdus; - //printf("ULSCH:pdus:%d\n", total_number_of_pdus); - - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]); - - if(pdu->rx_ue_information.tl.tag == NFAPI_RX_UE_INFORMATION_TAG) { - //printf("NFAPI_RX_UE_INFORMATION_TAG\n"); - offset += 4 + 6; - } - - if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) { - //printf("NFAPI_RX_INDICATION_REL8_TAG\n"); - offset += 4 + 7; - } - - if(pdu->rx_indication_rel9.tl.tag == NFAPI_RX_INDICATION_REL9_TAG) { - //printf("NFAPI_RX_INDICATION_REL9_TAG\n"); - offset += 4 + 2; - } - } - - // Now update the structure to include the offset - for(i =0; i < total_number_of_pdus; ++i) { - nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]); - - if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) { - if(pdu->rx_indication_rel8.offset == 1) { - pdu->rx_indication_rel8.offset = offset; - offset += pdu->rx_indication_rel8.length; - } - } - } - - // Write out the pdu - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]); - - if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && - pack_tlv(NFAPI_RX_INDICATION_REL8_TAG, &pdu->rx_indication_rel8, ppWritePackedMsg, end, pack_rx_indication_rel8_value) && - pack_tlv(NFAPI_RX_INDICATION_REL9_TAG, &pdu->rx_indication_rel9, ppWritePackedMsg, end, pack_rx_indication_rel9_value))) - return 0; - } - - // Write out the pdu data - for(i = 0; i < total_number_of_pdus; ++i) { - uint16_t length = 0; - nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]); - - if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) { - length = pdu->rx_indication_rel8.length; - } - - if( pusharray8(value->rx_pdu_list[i].data, length, length, ppWritePackedMsg, end) == 0) - return 0; - } - - return 1; -} - - -static uint8_t pack_rx_ulsch_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_rx_indication_t *pNfapiMsg = (nfapi_rx_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_RX_INDICATION_BODY_TAG, &pNfapiMsg->rx_indication_body, ppWritePackedMsg, end, pack_rx_ulsch_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_preamble_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_preamble_pdu_rel8_t *preamble_rel8 = (nfapi_preamble_pdu_rel8_t *)tlv; - return ( push16(preamble_rel8->rnti, ppWritePackedMsg, end) && - push8(preamble_rel8->preamble, ppWritePackedMsg, end) && - push16(preamble_rel8->timing_advance, ppWritePackedMsg, end)); -} -static uint8_t pack_preamble_pdu_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_preamble_pdu_rel9_t *preamble_rel9 = (nfapi_preamble_pdu_rel9_t *)tlv; - return ( push16(preamble_rel9->timing_advance_r9, ppWritePackedMsg, end) ); -} -static uint8_t pack_preamble_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_preamble_pdu_rel13_t *preamble_rel13 = (nfapi_preamble_pdu_rel13_t *)tlv; - return ( push8(preamble_rel13->rach_resource_type, ppWritePackedMsg, end) ); -} - -static uint8_t pack_rach_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_rach_indication_body_t *value = (nfapi_rach_indication_body_t *)tlv; - - if( push16(value->number_of_preambles, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_preambles; - - for(; i < total_number_of_pdus; ++i) { - nfapi_preamble_pdu_t *pdu = &(value->preamble_list[i]); - uint8_t *instance_length_p = *ppWritePackedMsg; - - if(!push16(pdu->instance_length, ppWritePackedMsg, end)) - return 0; - - if(!(pack_tlv(NFAPI_PREAMBLE_REL8_TAG, &pdu->preamble_rel8, ppWritePackedMsg, end, pack_preamble_pdu_rel8_value) && - pack_tlv(NFAPI_PREAMBLE_REL9_TAG, &pdu->preamble_rel9, ppWritePackedMsg, end, pack_preamble_pdu_rel9_value) && - pack_tlv(NFAPI_PREAMBLE_REL13_TAG, &pdu->preamble_rel13, ppWritePackedMsg, end, pack_preamble_pdu_rel13_value))) - return 0; - - // calculate the instance length subtracting the size of the instance - // length feild - uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; - push16(instance_length, &instance_length_p, end); - } - - return 1; -} - -static uint8_t pack_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_rach_indication_t *pNfapiMsg = (nfapi_rach_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_RACH_INDICATION_BODY_TAG, &pNfapiMsg->rach_indication_body, ppWritePackedMsg, end, pack_rach_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_srs_indication_fdd_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_srs_indication_fdd_rel8_t *srs_pdu_rel8 = (nfapi_srs_indication_fdd_rel8_t *)tlv; - return ( push16(srs_pdu_rel8->doppler_estimation, ppWritePackedMsg, end) && - push16(srs_pdu_rel8->timing_advance, ppWritePackedMsg, end) && - push8(srs_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end) && - push8(srs_pdu_rel8->rb_start, ppWritePackedMsg, end) && - pusharray8(srs_pdu_rel8->snr, NFAPI_NUM_RB_MAX, srs_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end)); -} - -static uint8_t pack_srs_indication_fdd_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_srs_indication_fdd_rel9_t *srs_pdu_rel9 = (nfapi_srs_indication_fdd_rel9_t *)tlv; - return ( push16(srs_pdu_rel9->timing_advance_r9, ppWritePackedMsg, end) ); -} - -static uint8_t pack_srs_indication_tdd_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_srs_indication_ttd_rel10_t *srs_pdu_rel10 = (nfapi_srs_indication_ttd_rel10_t *)tlv; - return ( push8(srs_pdu_rel10->uppts_symbol, ppWritePackedMsg, end) ); -} - -static uint8_t pack_srs_indication_fdd_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_srs_indication_fdd_rel11_t *srs_pdu_rel11 = (nfapi_srs_indication_fdd_rel11_t *)tlv; - return ( push16(srs_pdu_rel11->ul_rtoa, ppWritePackedMsg, end) ) ; -} - -static uint8_t pack_tdd_channel_measurement_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_tdd_channel_measurement_t *value = (nfapi_tdd_channel_measurement_t *)tlv; - - if(!(push8(value->num_prb_per_subband, ppWritePackedMsg, end) && - push8(value->number_of_subbands, ppWritePackedMsg, end) && - push8(value->num_atennas, ppWritePackedMsg, end))) - return 0; - - uint8_t idx = 0; - - for(idx = 0; idx < value->number_of_subbands; ++idx) { - if(!(push8(value->subands[idx].subband_index, ppWritePackedMsg, end) && - pusharray16(value->subands[idx].channel, NFAPI_MAX_NUM_PHYSICAL_ANTENNAS, value->num_atennas, ppWritePackedMsg, end))) - return 0; - } - - return 1; -} - -static uint8_t pack_srs_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_srs_indication_body_t *value = (nfapi_srs_indication_body_t *)tlv; - - if( push8(value->number_of_ues, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_ues; - - for(; i < total_number_of_pdus; ++i) { - nfapi_srs_indication_pdu_t *pdu = &(value->srs_pdu_list[i]); - uint8_t *instance_length_p = *ppWritePackedMsg; - - if(!push16(pdu->instance_length, ppWritePackedMsg, end)) - return 0; - - if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, &pack_rx_ue_information_value) && - pack_tlv(NFAPI_SRS_INDICATION_FDD_REL8_TAG, &pdu->srs_indication_fdd_rel8, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel8_value) && - pack_tlv(NFAPI_SRS_INDICATION_FDD_REL9_TAG, &pdu->srs_indication_fdd_rel9, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel9_value) && - pack_tlv(NFAPI_SRS_INDICATION_TDD_REL10_TAG, &pdu->srs_indication_tdd_rel10, ppWritePackedMsg, end, &pack_srs_indication_tdd_rel10_value) && - pack_tlv(NFAPI_SRS_INDICATION_FDD_REL11_TAG, &pdu->srs_indication_fdd_rel11, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel11_value) && - pack_tlv(NFAPI_TDD_CHANNEL_MEASUREMENT_TAG, &pdu->tdd_channel_measurement, ppWritePackedMsg, end, &pack_tdd_channel_measurement_value))) - return 0; - - // calculate the instance length subtracting the size of the instance - // length feild - uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; - push16(instance_length, &instance_length_p, end); - } - - return 1; -} - -static uint8_t pack_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_srs_indication_t *pNfapiMsg = (nfapi_srs_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_SRS_INDICATION_BODY_TAG, &pNfapiMsg->srs_indication_body, ppWritePackedMsg, end, &pack_srs_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_sr_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_sr_indication_body_t *value = (nfapi_sr_indication_body_t *)tlv; - - if(push16(value->number_of_srs, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_srs; - - for(; i < total_number_of_pdus; ++i) { - nfapi_sr_indication_pdu_t *pdu = &(value->sr_pdu_list[i]); - uint8_t *instance_length_p = *ppWritePackedMsg; - - if(!push16(pdu->instance_length, ppWritePackedMsg, end)) - return 0; - - if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && - pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value))) - return 0; - - // calculate the instance length subtracting the size of the instance - // length feild - uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; - push16(instance_length, &instance_length_p, end); - } - - return 1; -} - -static uint8_t pack_sr_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_sr_indication_t *pNfapiMsg = (nfapi_sr_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_SR_INDICATION_BODY_TAG, &pNfapiMsg->sr_indication_body, ppWritePackedMsg, end, &pack_sr_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_cqi_indication_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_cqi_indication_rel8_t *cqi_pdu_rel8 = (nfapi_cqi_indication_rel8_t *)tlv; - return ( push16(cqi_pdu_rel8->length, ppWritePackedMsg, end) && - push16(cqi_pdu_rel8->data_offset, ppWritePackedMsg, end) && - push8(cqi_pdu_rel8->ul_cqi, ppWritePackedMsg, end) && - push8(cqi_pdu_rel8->ri, ppWritePackedMsg, end) && - push16(cqi_pdu_rel8->timing_advance, ppWritePackedMsg, end)); -} - -static uint8_t pack_cqi_indication_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_cqi_indication_rel9_t *cqi_pdu_rel9 = (nfapi_cqi_indication_rel9_t *)tlv; - return ( push16(cqi_pdu_rel9->length, ppWritePackedMsg, end) && - push16(cqi_pdu_rel9->data_offset, ppWritePackedMsg, end) && - push8(cqi_pdu_rel9->ul_cqi, ppWritePackedMsg, end) && - push8(cqi_pdu_rel9->number_of_cc_reported, ppWritePackedMsg, end) && - pusharray8(cqi_pdu_rel9->ri, NFAPI_CC_MAX, cqi_pdu_rel9->number_of_cc_reported, ppWritePackedMsg, end) && - push16(cqi_pdu_rel9->timing_advance, ppWritePackedMsg, end) && - push16(cqi_pdu_rel9->timing_advance_r9, ppWritePackedMsg, end)); -} - -static uint8_t pack_cqi_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_cqi_indication_body_t *value = (nfapi_cqi_indication_body_t *)tlv; - - if( push16(value->number_of_cqis, ppWritePackedMsg, end) == 0) - return 0; - - // need to calculate the data offset's. This very bittle due the hardcoding - // of the sizes. can not use the sizeof as we have an array for the Rel9 - // info - uint16_t i = 0; - uint16_t offset = 2; // taking into account the number_of_cqis - uint16_t total_number_of_pdus = value->number_of_cqis; - - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); - offset += 2; // for the instance length - - if(pdu->rx_ue_information.tl.tag == NFAPI_RX_UE_INFORMATION_TAG) { - offset += 4 + 6; // sizeof(nfapi_rx_ue_information) - sizeof(nfapi_tl_t) - } - - if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG) { - offset += 4 + 8; - } - - if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG) { - offset += 4 + 10 + pdu->cqi_indication_rel9.number_of_cc_reported; - } - - if(pdu->ul_cqi_information.tl.tag == NFAPI_UL_CQI_INFORMATION_TAG) { - offset += 4 + 2; - } - } - - // Now update the structure to include the offset - for(i =0; i < total_number_of_pdus; ++i) { - nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); - - if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG) { - if(pdu->cqi_indication_rel8.data_offset == 1) { - pdu->cqi_indication_rel8.data_offset = offset; - offset += pdu->cqi_indication_rel8.length; - } - } - - if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG) { - if(pdu->cqi_indication_rel9.data_offset == 1) { - pdu->cqi_indication_rel9.data_offset = offset; - offset += pdu->cqi_indication_rel9.length; - } - } - } - - // Write out the cqi information - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); - uint8_t *instance_length_p = *ppWritePackedMsg; - - if(!push16(pdu->instance_length, ppWritePackedMsg, end)) - return 0; - - if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end,pack_rx_ue_information_value) && - pack_tlv(NFAPI_CQI_INDICATION_REL8_TAG, &pdu->cqi_indication_rel8, ppWritePackedMsg, end, pack_cqi_indication_rel8_value) && - pack_tlv(NFAPI_CQI_INDICATION_REL9_TAG, &pdu->cqi_indication_rel9, ppWritePackedMsg, end, pack_cqi_indication_rel9_value) && - pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value))) - return 0; - - // calculate the instance length subtracting the size of the instance - // length feild - uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; - push16(instance_length, &instance_length_p, end); - } - - // Write out the cqi raw data - for(i = 0; i < total_number_of_pdus; ++i) { - uint16_t length = 0; - nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); - - if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG) { - length = pdu->cqi_indication_rel8.length; - } - - if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG) { - length = pdu->cqi_indication_rel9.length; - } - - if( pusharray8(value->cqi_raw_pdu_list[i].pdu, NFAPI_CQI_RAW_MAX_LEN, length, ppWritePackedMsg, end) == 0) - return 0; - } - - return 1; -} - -static uint8_t pack_cqi_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_cqi_indication_t *pNfapiMsg = (nfapi_cqi_indication_t *)msg; - //Fixme: allocate some mem to fix pure bug, need to find out proper size - pNfapiMsg->vendor_extension=NULL;//(nfapi_vendor_extension_tlv_t)malloc( sizeof(* pNfapiMsg->vendor_extension)); - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_CQI_INDICATION_BODY_TAG, &pNfapiMsg->cqi_indication_body, ppWritePackedMsg, end, pack_cqi_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_lbt_pdsch_req_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_lbt_pdsch_req_pdu_rel13_t *value = (nfapi_lbt_pdsch_req_pdu_rel13_t *)tlv; - return ( push32(value->handle, ppWritePackedMsg, end) && - push32(value->mp_cca, ppWritePackedMsg, end) && - push32(value->n_cca, ppWritePackedMsg, end) && - push32(value->offset, ppWritePackedMsg, end) && - push32(value->lte_txop_sf, ppWritePackedMsg, end) && - push16(value->txop_sfn_sf_end, ppWritePackedMsg, end) && - push32(value->lbt_mode, ppWritePackedMsg, end)); -} - -static uint8_t pack_lbt_drs_req_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_lbt_drs_req_pdu_rel13_t *value = (nfapi_lbt_drs_req_pdu_rel13_t *)tlv; - return ( push32(value->handle, ppWritePackedMsg, end) && - push32(value->offset, ppWritePackedMsg, end) && - push16(value->sfn_sf_end, ppWritePackedMsg, end) && - push32(value->lbt_mode, ppWritePackedMsg, end)); -} - -static uint8_t pack_lbt_dl_config_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_lbt_dl_config_request_body_t *value = (nfapi_lbt_dl_config_request_body_t *)tlv; - - if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_pdus; - - for(; i < total_number_of_pdus; ++i) { - nfapi_lbt_dl_config_request_pdu_t *pdu = &(value->lbt_dl_config_req_pdu_list[i]); - - if( push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) - return 0; - - // Put a 0 size in and then determine the size after the pdu - // has been writen and write the calculated size - uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; - pdu->pdu_size = 0; - - if( push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) - return 0; - - switch(pdu->pdu_type) { - case NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE: { - if( pack_tlv(NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG, &pdu->lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13, ppWritePackedMsg, end, pack_lbt_pdsch_req_pdu_rel13_value) == 0) - return 0; - } - break; - - case NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE: { - if(pack_tlv(NFAPI_LBT_DRS_REQ_PDU_REL13_TAG, &pdu->lbt_drs_req_pdu.lbt_drs_req_pdu_rel13, ppWritePackedMsg, end, pack_lbt_drs_req_pdu_rel13_value) == 0) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL_CONFIG.request invalid pdu type %d \n", pdu->pdu_type ); - } - break; - }; - - // add 1 for the pdu_type. The delta will include the pdu_size - pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); - - push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); - } - - return 1; -} - -static uint8_t pack_lbt_pdsch_rsp_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_lbt_pdsch_rsp_pdu_rel13_t *value = (nfapi_lbt_pdsch_rsp_pdu_rel13_t *)tlv; - return ( push32(value->handle, ppWritePackedMsg, end) && - push32(value->result, ppWritePackedMsg, end) && - push32(value->lte_txop_symbols, ppWritePackedMsg, end) && - push32(value->initial_partial_sf, ppWritePackedMsg, end)); -} - -static uint8_t pack_lbt_drs_rsp_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_lbt_drs_rsp_pdu_rel13_t *value = (nfapi_lbt_drs_rsp_pdu_rel13_t *)tlv; - return ( push32(value->handle, ppWritePackedMsg, end) && - push32(value->result, ppWritePackedMsg, end)); -} - -static uint8_t pack_lbt_dl_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_lbt_dl_config_request_t *pNfapiMsg = (nfapi_lbt_dl_config_request_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->lbt_dl_config_request_body, ppWritePackedMsg, end, &pack_lbt_dl_config_request_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_lbt_dl_config_indication_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_lbt_dl_indication_body_t *value = (nfapi_lbt_dl_indication_body_t *)tlv; - - if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_pdus = value->number_of_pdus; - - for(; i < total_number_of_pdus; ++i) { - nfapi_lbt_dl_indication_pdu_t *pdu = &(value->lbt_indication_pdu_list[i]); - - if( push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) - return 0; - - // Put a 0 size in and then determine the size after the pdu - // has been writen and write the calculated size - uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; - pdu->pdu_size = 0; - - if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) - return 0; - - switch(pdu->pdu_type) { - case NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE: { - if( pack_tlv(NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG, &pdu->lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13, ppWritePackedMsg, end, pack_lbt_pdsch_rsp_pdu_rel13_value) == 0) - return 0; - } - break; - - case NFAPI_LBT_DL_RSP_DRS_PDU_TYPE: { - if( pack_tlv(NFAPI_LBT_DRS_RSP_PDU_REL13_TAG, &pdu->lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13, ppWritePackedMsg, end, pack_lbt_drs_rsp_pdu_rel13_value) == 0) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL.indication body invalid pdu type %d \n", pdu->pdu_type ); - } - break; - }; - - // add 1 for the pdu_type. The delta will include the pdu_size - pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); - - push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); - } - - return 1; -} - -static uint8_t pack_lbt_dl_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_lbt_dl_indication_t *pNfapiMsg = (nfapi_lbt_dl_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_LBT_DL_INDICATION_BODY_TAG, &pNfapiMsg->lbt_dl_indication_body, ppWritePackedMsg, end, &pack_lbt_dl_config_indication_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_nb_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nb_harq_indication_fdd_rel13_t *nb_harq_indication_fdd_rel13 = (nfapi_nb_harq_indication_fdd_rel13_t *)tlv; - return ( push8(nb_harq_indication_fdd_rel13->harq_tb1, ppWritePackedMsg, end) ); -} - -static uint8_t pack_nb_harq_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nb_harq_indication_body_t *value = (nfapi_nb_harq_indication_body_t *)tlv; - - if( push16(value->number_of_harqs, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_harqs = value->number_of_harqs; - - for(; i < total_number_of_harqs; ++i) { - nfapi_nb_harq_indication_pdu_t *pdu = &(value->nb_harq_pdu_list[i]); - uint8_t *instance_length_p = *ppWritePackedMsg; - - if(!push16(pdu->instance_length, ppWritePackedMsg, end)) - return 0; - - if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && - pack_tlv(NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG, &pdu->nb_harq_indication_fdd_rel13, ppWritePackedMsg, end, pack_nb_harq_indication_fdd_rel13_value) && - pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value))) - return 0; - - // calculate the instance length subtracting the size of the instance - // length feild - uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; - push16(instance_length, &instance_length_p, end); - } - - return 1; -} - - -static uint8_t pack_nb_harq_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nb_harq_indication_t *pNfapiMsg = (nfapi_nb_harq_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_NB_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->nb_harq_indication_body, ppWritePackedMsg, end, &pack_nb_harq_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_nrach_indication_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nrach_indication_pdu_rel13_t *nrach_indication_fdd_rel13 = (nfapi_nrach_indication_pdu_rel13_t *)tlv; - return ( push16(nrach_indication_fdd_rel13->rnti, ppWritePackedMsg, end) && - push8(nrach_indication_fdd_rel13->initial_sc, ppWritePackedMsg, end) && - push16(nrach_indication_fdd_rel13->timing_advance, ppWritePackedMsg, end) && - push8(nrach_indication_fdd_rel13->nrach_ce_level, ppWritePackedMsg, end)); -} - - -static uint8_t pack_nrach_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nrach_indication_body_t *value = (nfapi_nrach_indication_body_t *)tlv; - - if( push8(value->number_of_initial_scs_detected, ppWritePackedMsg, end) == 0) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_initial_scs_detected = value->number_of_initial_scs_detected; - - for(; i < total_number_of_initial_scs_detected; ++i) { - nfapi_nrach_indication_pdu_t *pdu = &(value->nrach_pdu_list[i]); - - //uint8_t* instance_length_p = *ppWritePackedMsg; - //if(!push16(pdu->instance_length, ppWritePackedMsg, end)) - // return 0; - - if(!(pack_tlv(NFAPI_NRACH_INDICATION_REL13_TAG, &pdu->nrach_indication_rel13, ppWritePackedMsg, end, pack_nrach_indication_rel13_value))) - return 0; - - // calculate the instance length subtracting the size of the instance - // length feild - //uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; - //push16(instance_length, &instance_length_p, end); - } - - return 1; -} - -static uint8_t pack_nrach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nrach_indication_t *pNfapiMsg = (nfapi_nrach_indication_t *)msg; - return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && - pack_tlv(NFAPI_NRACH_INDICATION_BODY_TAG, &pNfapiMsg->nrach_indication_body, ppWritePackedMsg, end, &pack_nrach_indication_body_value) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_nr_dl_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nr_dl_node_sync_t *pNfapiMsg = (nfapi_nr_dl_node_sync_t *)msg; - return ( push32(pNfapiMsg->t1, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->delta_sfn_slot, ppWritePackedMsg, end) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_dl_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_dl_node_sync_t *pNfapiMsg = (nfapi_dl_node_sync_t *)msg; - return ( push32(pNfapiMsg->t1, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->delta_sfn_sf, ppWritePackedMsg, end) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_nr_ul_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nr_ul_node_sync_t *pNfapiMsg = (nfapi_nr_ul_node_sync_t *)msg; - return (push32(pNfapiMsg->t1, ppWritePackedMsg, end) && - push32(pNfapiMsg->t2, ppWritePackedMsg, end) && - push32(pNfapiMsg->t3, ppWritePackedMsg, end) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_ul_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_ul_node_sync_t *pNfapiMsg = (nfapi_ul_node_sync_t *)msg; - return (push32(pNfapiMsg->t1, ppWritePackedMsg, end) && - push32(pNfapiMsg->t2, ppWritePackedMsg, end) && - push32(pNfapiMsg->t3, ppWritePackedMsg, end) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_timing_info(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_timing_info_t *pNfapiMsg = (nfapi_timing_info_t *)msg; - return (push32(pNfapiMsg->last_sfn_sf, ppWritePackedMsg, end) && - push32(pNfapiMsg->time_since_last_timing_info, ppWritePackedMsg, end) && - push32(pNfapiMsg->dl_config_jitter, ppWritePackedMsg, end) && - push32(pNfapiMsg->tx_request_jitter, ppWritePackedMsg, end) && - push32(pNfapiMsg->ul_config_jitter, ppWritePackedMsg, end) && - push32(pNfapiMsg->hi_dci0_jitter, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->dl_config_latest_delay, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->tx_request_latest_delay, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->ul_config_latest_delay, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->hi_dci0_latest_delay, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->dl_config_earliest_arrival, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->tx_request_earliest_arrival, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->ul_config_earliest_arrival, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->hi_dci0_earliest_arrival, ppWritePackedMsg, end) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -static uint8_t pack_nr_timing_info(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nr_timing_info_t *pNfapiMsg = (nfapi_nr_timing_info_t *)msg; - return (push32(pNfapiMsg->last_sfn, ppWritePackedMsg, end) && - push32(pNfapiMsg->last_slot, ppWritePackedMsg, end) && - push32(pNfapiMsg->time_since_last_timing_info, ppWritePackedMsg, end) && - push32(pNfapiMsg->dl_tti_jitter, ppWritePackedMsg, end) && - push32(pNfapiMsg->tx_data_request_jitter, ppWritePackedMsg, end) && - push32(pNfapiMsg->ul_tti_jitter, ppWritePackedMsg, end) && - push32(pNfapiMsg->ul_dci_jitter, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->dl_tti_latest_delay, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->tx_data_request_latest_delay, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->ul_tti_latest_delay, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->ul_dci_latest_delay, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->dl_tti_earliest_arrival, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->tx_data_request_earliest_arrival, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->ul_tti_earliest_arrival, ppWritePackedMsg, end) && - pushs32(pNfapiMsg->ul_dci_earliest_arrival, ppWritePackedMsg, end) && - pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); -} - -//NR UPLINK indication function packing - -//SLOT INDICATION - -static uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_slot_indication_scf_t *pNfapiMsg = (nfapi_nr_slot_indication_scf_t*)msg; - - if (!(push16((uint16_t)pNfapiMsg->sfn , ppWritePackedMsg, end) && - push16((uint16_t)pNfapiMsg->slot , ppWritePackedMsg, end) - )) - return 0; - -return 1; -} - -//RX DATA INDICATION - -static uint8_t pack_nr_rx_data_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) -{ - nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv; - - if(!(push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->harq_id, ppWritePackedMsg, end) && - push16(value->pdu_length, ppWritePackedMsg, end) && - push8(value->ul_cqi, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end) && - push16(value->rssi, ppWritePackedMsg, end) - )) - return 0; - - return 1; -} - - -static uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t*)msg; - - if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && - push16(pNfapiMsg->slot , ppWritePackedMsg, end) && - push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end) - )) - return 0; - - for(int i=0; inumber_of_pdus;i++) - { - if(!pack_nr_rx_data_indication_body(pNfapiMsg->pdu_list,ppWritePackedMsg,end)) - return 0; - } - -return 1; -} - -//NR CRC INDICATION - -static uint8_t pack_nr_crc_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) -{ - nfapi_nr_crc_t* value = (nfapi_nr_crc_t*)tlv; - - if(!(push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->harq_id, ppWritePackedMsg, end) && - push8(value->tb_crc_status, ppWritePackedMsg, end) && - push16(value->num_cb, ppWritePackedMsg, end) && - //pusharray8(value->cb_crc_status, (int)(value->num_cb / 8) + 1, (int)(value->num_cb / 8) + 1, ppWritePackedMsg, end) && //length is ceil(NumCb/8) - push8(value->ul_cqi, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end) && - push16(value->rssi, ppWritePackedMsg, end) - )) - return 0; - - return 1; -} - -static uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t*)msg; - - if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && - push16(pNfapiMsg->slot , ppWritePackedMsg, end) && - push16(pNfapiMsg->number_crcs, ppWritePackedMsg, end) - )) - return 0; - - for(int i=0; inumber_crcs;i++) - { - if(!pack_nr_crc_indication_body(pNfapiMsg->crc_list,ppWritePackedMsg,end)) - return 0; - } - -return 1; -} - -//SRS INDICATION - -static uint8_t pack_nr_srs_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) -{ - nfapi_nr_srs_indication_pdu_t* value = (nfapi_nr_srs_indication_pdu_t*)tlv; - - if(!(push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end) && - push8(value->num_symbols, ppWritePackedMsg, end) && - push8(value->wide_band_snr, ppWritePackedMsg, end) && - push8(value->num_reported_symbols, ppWritePackedMsg, end) && - push8(value->reported_symbol_list->num_rbs, ppWritePackedMsg, end) - )) - return 0; - for(int i = 0; i < value->reported_symbol_list->num_rbs; i++) - { - if(!(push8(value->reported_symbol_list->rb_list->rb_snr, ppWritePackedMsg, end) - )) - return 0; - } - return 1; -} - -static uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t*)msg; - - if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && - push16(pNfapiMsg->slot , ppWritePackedMsg, end) && - push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end) - )) - return 0; - - for(int i=0; inumber_of_pdus;i++) - { - if(!pack_nr_srs_indication_body(&(pNfapiMsg->pdu_list[i]),ppWritePackedMsg,end)) - return 0; - } - -return 1; -} - -//RACH INDICATION - -static uint8_t pack_nr_rach_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) -{ - nfapi_nr_prach_indication_pdu_t* value = (nfapi_nr_prach_indication_pdu_t*)tlv; - - if(!(push16(value->phy_cell_id, ppWritePackedMsg, end) && - push8(value->symbol_index, ppWritePackedMsg, end) && - push8(value->slot_index, ppWritePackedMsg, end) && - push8(value->freq_index, ppWritePackedMsg, end) && - push8(value->avg_rssi, ppWritePackedMsg, end) && - push8(value->avg_snr, ppWritePackedMsg, end) && - push8(value->num_preamble, ppWritePackedMsg, end) - )) - return 0; - for(int i = 0; i < value->num_preamble; i++) - { - if(!(push8(value->preamble_list->preamble_index, ppWritePackedMsg, end) && - push16(value->preamble_list->timing_advance, ppWritePackedMsg, end) && - push32(value->preamble_list->preamble_pwr, ppWritePackedMsg, end) - )) - return 0; - } - return 1; -} - -static uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t*)msg; - - if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && - push16(pNfapiMsg->slot , ppWritePackedMsg, end) && - push8(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end) - )) - return 0; - - for(int i=0; inumber_of_pdus;i++) - { - if(!pack_nr_rach_indication_body(&(pNfapiMsg->pdu_list[i]),ppWritePackedMsg,end)) - return 0; - } - -return 1; -} - - -//UCI INDICATION - -static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_uci_pucch_pdu_format_0_1_t* value = (nfapi_nr_uci_pucch_pdu_format_0_1_t*)tlv; - - if(!(push8(value->pduBitmap, ppWritePackedMsg, end) && - push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->pucch_format, ppWritePackedMsg, end) && - push8(value->ul_cqi, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end) && - push16(value->rssi, ppWritePackedMsg, end) - )) - return 0; - if (value->pduBitmap & 0x01) { //SR - if(!(push8(value->sr->sr_indication, ppWritePackedMsg, end) && - push8(value->sr->sr_confidence_level, ppWritePackedMsg, end) - )) - return 0; - } - - if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - if(!(push8(value->harq->num_harq, ppWritePackedMsg, end) && - push8(value->harq->harq_confidence_level, ppWritePackedMsg, end) - )) - return 0; - - for(int i=0; iharq->num_harq;i++) - { - if(!(push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end) - )) - return 0; - } - } - - return 1; -} - -static uint8_t pack_nr_uci_pucch_2_3_4(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; - - if(!(push8(value->pduBitmap, ppWritePackedMsg, end) && - push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->pucch_format, ppWritePackedMsg, end) && - push8(value->ul_cqi, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end) && - push16(value->rssi, ppWritePackedMsg, end) - )) - return 0; - - if (value->pduBitmap & 0x01) { //SR - if(!(push8(value->sr.sr_bit_len, ppWritePackedMsg, end) && - pusharray8(value->sr.sr_payload, (int)(value->sr.sr_bit_len / 8) + 1, (int)(value->sr.sr_bit_len / 8) + 1, ppWritePackedMsg, end) - )) - return 0; - } - - if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - if(!(push8(value->harq.harq_crc, ppWritePackedMsg, end) && - push8(value->harq.harq_bit_len, ppWritePackedMsg, end) && - pusharray8(value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8) + 1, (int)(value->harq.harq_bit_len / 8) + 1, ppWritePackedMsg, end) - )) - return 0; - } - - if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1 - if(!(push8(value->csi_part1.csi_part1_crc, ppWritePackedMsg, end) && - push8(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end) && - pusharray8(value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, ppWritePackedMsg, end) - )) - return 0; - } - - if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2 - if(!(push8(value->csi_part2.csi_part2_crc, ppWritePackedMsg, end) && - push8(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end) && - pusharray8(value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, ppWritePackedMsg, end) - )) - return 0; - } - - return 1; -} - -static uint8_t pack_nr_uci_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) -{ - nfapi_nr_uci_t* value = (nfapi_nr_uci_t*)tlv; - - if(!(push16(value->pdu_type, ppWritePackedMsg, end) && - push16(value->pdu_size, ppWritePackedMsg, end) - )) - return 0; - - switch (value->pdu_type) { - case NFAPI_NR_UCI_PUSCH_PDU_TYPE: - printf("Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n"); - break; - - case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: - pack_nr_uci_pucch_0_1(&value->pucch_pdu_format_0_1, ppWritePackedMsg, end); - break; - - case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: - pack_nr_uci_pucch_2_3_4(&value->pucch_pdu_format_2_3_4, ppWritePackedMsg, end); - break; - } - - return 1; -} - -static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg; - - if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && - push16(pNfapiMsg->slot , ppWritePackedMsg, end) && - push16(pNfapiMsg->num_ucis, ppWritePackedMsg, end) - )) - return 0; - - for(int i=0; inum_ucis;i++) - { - if(!pack_nr_uci_indication_body(pNfapiMsg->uci_list,ppWritePackedMsg,end)) - return 0; - } - -return 1; -} - - -// Main pack function - public - -int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t* config) -{ - nfapi_p7_message_header_t *pMessageHeader = pMessageBuf; - uint8_t *pWritePackedMessage = pPackedBuf; - uint8_t *pPackedLengthField = &pWritePackedMessage[4]; - uint8_t *end = pPackedBuf + packedBufLen; - - if (pMessageBuf == NULL || pPackedBuf == NULL) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack supplied pointers are null\n"); - return -1; - } - /* - printf("\n P7 MESSAGE SENT: \n"); - for(int i=0; i< packedBufLen; i++){ - printf("%d", *(uint8_t *)(pMessageBuf + i)); - } - printf("\n"); - */ - // process the header - if(!(push16(pMessageHeader->phy_id, &pWritePackedMessage, end) && - push16(pMessageHeader->message_id, &pWritePackedMessage, end) && - push16(0/*pMessageHeader->message_length*/, &pWritePackedMessage, end) && - push16(pMessageHeader->m_segment_sequence, &pWritePackedMessage, end) && - push32(0/*pMessageHeader->checksum*/, &pWritePackedMessage, end) && - push32(pMessageHeader->transmit_timestamp, &pWritePackedMessage, end))) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack header failed\n"); - return -1; - } - - if (pMessageHeader->message_id != NFAPI_TIMING_INFO) - { - //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() message_id:0x%04x phy_id:%u m_segment_sequence:%u timestamp:%u\n", __FUNCTION__, pMessageHeader->message_id, pMessageHeader->phy_id, pMessageHeader->m_segment_sequence, pMessageHeader->transmit_timestamp); - } - // look for the specific message - uint8_t result = 0; - switch (pMessageHeader->message_id) - { - case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: - result = pack_dl_tti_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: - result = pack_ul_tti_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: - result = pack_tx_data_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: - result = pack_ul_dci_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_UE_RELEASE_REQUEST: - result =pack_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_UE_RELEASE_RESPONSE: - result =pack_ue_release_response(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: - result = pack_nr_slot_indication(pMessageHeader, &pWritePackedMessage, end, config); - - case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: - result = pack_nr_rx_data_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: - result = pack_nr_crc_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: - result = pack_nr_uci_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: - result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: - result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC: - result = pack_nr_dl_node_sync(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NR_PHY_MSG_TYPE_UL_NODE_SYNC: - result = pack_nr_ul_node_sync(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_TIMING_INFO: - result = pack_nr_timing_info(pMessageHeader, &pWritePackedMessage, end, config); - break; - - default: - { - if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && - pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX) - { - if(config && config->pack_p7_vendor_extension) - { - result = (config->pack_p7_vendor_extension)(pMessageHeader, &pWritePackedMessage, end, config); - } - else - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve ecoder provided\n", __FUNCTION__, pMessageHeader->message_id); - } - } - else - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id); - } - } - break; - } - - if(result == 0) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack failed to pack message\n"); - return -1; - } - - // check for a valid message length - uintptr_t msgHead = (uintptr_t)pPackedBuf; - uintptr_t msgEnd = (uintptr_t)pWritePackedMessage; - uint32_t packedMsgLen = msgEnd - msgHead; - uint16_t packedMsgLen16; - if (packedMsgLen > 0xFFFF || packedMsgLen > packedBufLen) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Packed message length error %d, buffer supplied %d\n", packedMsgLen, packedBufLen); - return -1; - } - else - { - packedMsgLen16 = (uint16_t)packedMsgLen; - } - - // Update the message length in the header - pMessageHeader->message_length = packedMsgLen16; - - if(!push16(packedMsgLen16, &pPackedLengthField, end)) - return -1; - - if(1) - { - //quick test - if(pMessageHeader->message_length != packedMsgLen) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id); - } - } - - return (packedMsgLen); -} - -int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t *config) { - nfapi_p7_message_header_t *pMessageHeader = pMessageBuf; - uint8_t *pWritePackedMessage = pPackedBuf; - uint8_t *pPackedLengthField = &pWritePackedMessage[4]; - uint8_t *end = pPackedBuf + packedBufLen; - - if (pMessageBuf == NULL || pPackedBuf == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack supplied pointers are null\n"); - return -1; - } - - /* - printf("\n P7 MESSAGE SENT: \n"); - for(int i=0; i< packedBufLen; i++){ - printf("%d", *(uint8_t *)(pMessageBuf + i)); - } - printf("\n"); - */ - // process the header - if(!(push16(pMessageHeader->phy_id, &pWritePackedMessage, end) && - push16(pMessageHeader->message_id, &pWritePackedMessage, end) && - push16(0/*pMessageHeader->message_length*/, &pWritePackedMessage, end) && - push16(pMessageHeader->m_segment_sequence, &pWritePackedMessage, end) && - push32(0/*pMessageHeader->checksum*/, &pWritePackedMessage, end) && - push32(pMessageHeader->transmit_timestamp, &pWritePackedMessage, end))) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack header failed\n"); - return -1; - } - - if (pMessageHeader->message_id != NFAPI_TIMING_INFO) { - //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() message_id:0x%04x phy_id:%u m_segment_sequence:%u timestamp:%u\n", __FUNCTION__, pMessageHeader->message_id, pMessageHeader->phy_id, pMessageHeader->m_segment_sequence, pMessageHeader->transmit_timestamp); - } - - // look for the specific message - uint8_t result = 0; - - switch (pMessageHeader->message_id) { - case NFAPI_DL_CONFIG_REQUEST: - //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST\n", __FUNCTION__); - result = pack_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_UL_CONFIG_REQUEST: - result = pack_ul_config_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_TX_REQUEST: - //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__); - result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_HI_DCI0_REQUEST: - result = pack_hi_dci0_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_UE_RELEASE_REQUEST: - result =pack_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_UE_RELEASE_RESPONSE: - result =pack_ue_release_response(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_HARQ_INDICATION: - result = pack_harq_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_CRC_INDICATION: - result = pack_crc_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_RX_ULSCH_INDICATION: - //printf("RX ULSCH\n"); - result = pack_rx_ulsch_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_RACH_INDICATION: - result = pack_rach_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_SRS_INDICATION: - result = pack_srs_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_RX_SR_INDICATION: - result = pack_sr_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_RX_CQI_INDICATION: - result = pack_cqi_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_LBT_DL_CONFIG_REQUEST: - result = pack_lbt_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_LBT_DL_INDICATION: - result = pack_lbt_dl_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NB_HARQ_INDICATION: - result = pack_nb_harq_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_NRACH_INDICATION: - result = pack_nrach_indication(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_DL_NODE_SYNC: - result = pack_dl_node_sync(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_UL_NODE_SYNC: - result = pack_ul_node_sync(pMessageHeader, &pWritePackedMessage, end, config); - break; - - case NFAPI_TIMING_INFO: - result = pack_timing_info(pMessageHeader, &pWritePackedMessage, end, config); - break; - - default: { - if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && - pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX) { - if(config && config->pack_p7_vendor_extension) { - result = (config->pack_p7_vendor_extension)(pMessageHeader, &pWritePackedMessage, end, config); - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve ecoder provided\n", __FUNCTION__, pMessageHeader->message_id); - } - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id); - } - } - break; - } - - if(result == 0) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack failed to pack message\n"); - return -1; - } - - // check for a valid message length - uintptr_t msgHead = (uintptr_t)pPackedBuf; - uintptr_t msgEnd = (uintptr_t)pWritePackedMessage; - uint32_t packedMsgLen = msgEnd - msgHead; - uint16_t packedMsgLen16; - - if (packedMsgLen > 0xFFFF || packedMsgLen > packedBufLen) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Packed message length error %d, buffer supplied %d\n", packedMsgLen, packedBufLen); - return -1; - } else { - packedMsgLen16 = (uint16_t)packedMsgLen; - } - - // Update the message length in the header - pMessageHeader->message_length = packedMsgLen16; - - if(!push16(packedMsgLen16, &pPackedLengthField, end)) - return -1; - - if(1) { - //quick test - if(pMessageHeader->message_length != packedMsgLen) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id); - } - } - - return (packedMsgLen); -} - -// Unpack routines -// NR: -static uint8_t unpack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv; - return( - pull16(ppReadPackedMsg, &value->bwp_size, end) && - pull16(ppReadPackedMsg, &value->bwp_start, end) && - pull8(ppReadPackedMsg, &value->subcarrier_spacing, end) && - pull8(ppReadPackedMsg, &value->cyclic_prefix, end) && - pull16(ppReadPackedMsg, &value->start_rb, end) && - pull16(ppReadPackedMsg, &value->nr_of_rbs, end) && - pull8(ppReadPackedMsg, &value->csi_type, end) && - pull8(ppReadPackedMsg, &value->row, end) && - pull16(ppReadPackedMsg, &value->freq_domain, end) && - pull8(ppReadPackedMsg, &value->symb_l0, end) && - pull8(ppReadPackedMsg, &value->symb_l1, end) && - pull8(ppReadPackedMsg, &value->cdm_type, end) && - pull8(ppReadPackedMsg, &value->freq_density, end) && - pull16(ppReadPackedMsg, &value->scramb_id, end) && - pull8(ppReadPackedMsg, &value->power_control_offset, end) && - pull8(ppReadPackedMsg, &value->power_control_offset_ss, end) - ); -} - - -static uint8_t unpack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - - nfapi_nr_dl_tti_pdcch_pdu_rel15_t* value = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t*)tlv; - - for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i) - { - if(!(pull16(ppReadPackedMsg, &value->dci_pdu[i].RNTI, end) && - pull16(ppReadPackedMsg, &value->dci_pdu[i].ScramblingId, end) && - pull16(ppReadPackedMsg, &value->dci_pdu[i].ScramblingRNTI, end) && - pull8(ppReadPackedMsg, &value->dci_pdu[i].CceIndex, end) && - pull8(ppReadPackedMsg, &value->dci_pdu[i].AggregationLevel, end) && - pull8(ppReadPackedMsg, &value->dci_pdu[i].beta_PDCCH_1_0, end) && - pull8(ppReadPackedMsg, &value->dci_pdu[i].powerControlOffsetSS, end) && - pull16(ppReadPackedMsg, &value->dci_pdu[i].PayloadSizeBits, end) && - - pullarray8(ppReadPackedMsg, value->dci_pdu[i].Payload, value->dci_pdu[i].PayloadSizeBits, value->dci_pdu[i].PayloadSizeBits, end))) - - return 0; - } - // TODO: resolve the packaging of array (currently sending a single element) - return( - pull16(ppReadPackedMsg, &value->BWPSize, end) && - pull16(ppReadPackedMsg, &value->BWPStart, end) && - pull8(ppReadPackedMsg, &value->SubcarrierSpacing, end) && - pull8(ppReadPackedMsg, &value->CyclicPrefix, end) && - pull8(ppReadPackedMsg, &value->StartSymbolIndex, end) && - pull8(ppReadPackedMsg, &value->DurationSymbols, end) && - pullarray8(ppReadPackedMsg, value->FreqDomainResource, 6, 6, end) && - pull8(ppReadPackedMsg, &value->CceRegMappingType, end) && - pull8(ppReadPackedMsg, &value->RegBundleSize, end) && - pull8(ppReadPackedMsg, &value->InterleaverSize, end) && - pull8(ppReadPackedMsg, &value->CoreSetType, end) && - pull16(ppReadPackedMsg, &value->ShiftIndex, end) && - pull8(ppReadPackedMsg, &value->precoderGranularity, end) && - pull16(ppReadPackedMsg, &value->numDlDci, end)); -} - - - -static uint8_t unpack_dl_tti_pdsch_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_dl_tti_pdsch_pdu_rel15_t *value = (nfapi_nr_dl_tti_pdsch_pdu_rel15_t *)tlv; - // TODO: resolve the packaging of array (currently sending a single element) - return( - pull16(ppReadPackedMsg, &value->pduBitmap, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull16(ppReadPackedMsg, &value->pduIndex, end) && - pull16(ppReadPackedMsg, &value->BWPSize, end) && - pull16(ppReadPackedMsg, &value->BWPStart, end) && - pull8(ppReadPackedMsg, &value->SubcarrierSpacing, end) && - pull8(ppReadPackedMsg, &value->CyclicPrefix, end) && - pull8(ppReadPackedMsg, &value->NrOfCodewords, end) && - pullarray16(ppReadPackedMsg, value->targetCodeRate, 2, 1, end) && - pullarray8(ppReadPackedMsg, value->qamModOrder, 2, 1, end) && - pullarray8(ppReadPackedMsg, value->mcsIndex, 2, 1, end) && - pullarray8(ppReadPackedMsg, value->mcsTable, 2, 1, end) && - pullarray8(ppReadPackedMsg, value->rvIndex, 2, 1, end) && - pullarray32(ppReadPackedMsg, value->TBSize, 2, 1, end) && - pull16(ppReadPackedMsg, &value->dataScramblingId, end) && - pull8(ppReadPackedMsg, &value->nrOfLayers, end) && - pull8(ppReadPackedMsg, &value->transmissionScheme, end) && - pull8(ppReadPackedMsg, &value->refPoint, end) && - pull16(ppReadPackedMsg, &value->dlDmrsSymbPos, end) && - pull8(ppReadPackedMsg, &value->dmrsConfigType, end) && - pull16(ppReadPackedMsg, &value->dlDmrsScramblingId, end) && - pull8(ppReadPackedMsg, &value->SCID, end) && - pull8(ppReadPackedMsg, &value->numDmrsCdmGrpsNoData, end) && - pull16(ppReadPackedMsg, &value->dmrsPorts, end) && - pull8(ppReadPackedMsg, &value->resourceAlloc, end) && - pull16(ppReadPackedMsg, &value->rbStart, end) && - pull16(ppReadPackedMsg, &value->rbSize, end) && - pull8(ppReadPackedMsg, &value->VRBtoPRBMapping, end) && - pull8(ppReadPackedMsg, &value->StartSymbolIndex, end) && - pull8(ppReadPackedMsg, &value->NrOfSymbols, end) && - pull8(ppReadPackedMsg, &value->PTRSPortIndex, end) && - pull8(ppReadPackedMsg, &value->PTRSTimeDensity, end) && - pull8(ppReadPackedMsg, &value->PTRSFreqDensity, end) && - pull8(ppReadPackedMsg, &value->PTRSReOffset, end) - ); -} - - -static uint8_t unpack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_dl_tti_ssb_pdu_rel15_t *value = (nfapi_nr_dl_tti_ssb_pdu_rel15_t *)tlv; - return( - pull16(ppReadPackedMsg, &value->PhysCellId, end) && - pull8(ppReadPackedMsg, &value->BetaPss, end) && - pull8(ppReadPackedMsg, &value->SsbBlockIndex, end) && - pull8(ppReadPackedMsg, &value->SsbSubcarrierOffset, end) && - pull16(ppReadPackedMsg, &value->ssbOffsetPointA, end) && - pull8(ppReadPackedMsg, &value->bchPayloadFlag, end) && - pull32(ppReadPackedMsg, &value->bchPayload, end) - // TODO: pack precoding_and_beamforming too - ); -} - - -// LTE: -static uint8_t unpack_dl_config_dci_dl_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel8_t *dci_dl_pdu_rel8 = (nfapi_dl_config_dci_dl_pdu_rel8_t *)tlv; - return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->dci_format, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->cce_idx, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->aggregation_level, end) && - pull16(ppReadPackedMsg, &dci_dl_pdu_rel8->rnti, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->resource_allocation_type, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->virtual_resource_block_assignment_flag, end) && - pull32(ppReadPackedMsg, &dci_dl_pdu_rel8->resource_block_coding, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->mcs_1, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->redundancy_version_1, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->new_data_indicator_1, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->transport_block_to_codeword_swap_flag, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->mcs_2, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->redundancy_version_2, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->new_data_indicator_2, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->harq_process, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->tpmi, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->pmi, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->precoding_information, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->tpc, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->downlink_assignment_index, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->ngap, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->transport_block_size_index, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->downlink_power_offset, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->allocate_prach_flag, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->preamble_index, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->prach_mask_index, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->rnti_type, end) && - pull16(ppReadPackedMsg, &dci_dl_pdu_rel8->transmission_power, end)); -} - -static uint8_t unpack_dl_config_dci_dl_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel9_t *dci_dl_pdu_rel9 = (nfapi_dl_config_dci_dl_pdu_rel9_t *)tlv; - return ( pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->mcch_flag, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->mcch_change_notification, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->scrambling_identity, end)); -} - -static uint8_t unpack_dl_config_dci_dl_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel10_t *dci_dl_pdu_rel10 = (nfapi_dl_config_dci_dl_pdu_rel10_t *)tlv; - return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->cross_carrier_scheduling_flag, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->carrier_indicator, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->srs_flag, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->srs_request, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->antenna_ports_scrambling_and_layers, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->total_dci_length_including_padding, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->n_dl_rb, end)); -} - -static uint8_t unpack_dl_config_dci_dl_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel11_t *dci_dl_pdu_rel11 = (nfapi_dl_config_dci_dl_pdu_rel11_t *)tlv; - return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel11->harq_ack_resource_offset, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel11->pdsch_re_mapping_quasi_co_location_indicator, end)); -} - -static uint8_t unpack_dl_config_dci_dl_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel12_t *dci_dl_pdu_rel12 = (nfapi_dl_config_dci_dl_pdu_rel12_t *)tlv; - return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->primary_cell_type, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->ul_dl_configuration_flag, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->number_ul_dl_configurations, end) && - pullarray8(ppReadPackedMsg, dci_dl_pdu_rel12->ul_dl_configuration_indication, NFAPI_MAX_UL_DL_CONFIGURATIONS, dci_dl_pdu_rel12->number_ul_dl_configurations, end)); -} - -static uint8_t unpack_tpm_value(uint8_t **ppReadPackedMsg, nfapi_dl_config_dci_dl_tpm_t *value, uint8_t *end) { - if(!(pull8(ppReadPackedMsg, &value->num_prb_per_subband, end) && - pull8(ppReadPackedMsg, &value->number_of_subbands, end) && - pull8(ppReadPackedMsg, &value->num_antennas, end))) - return 0; - - uint8_t idx = 0; - - for(idx = 0; idx < value->number_of_subbands; ++idx) { - nfapi_dl_config_dci_dl_tpm_subband_info_t *subband_info = &(value->subband_info[idx]); - - if(!(pull8(ppReadPackedMsg, &subband_info->subband_index, end) && - pull8(ppReadPackedMsg, &subband_info->scheduled_ues, end))) - return 0; - - uint8_t antenna_idx = 0; - uint8_t scheduled_ue_idx = 0; - - for(antenna_idx = 0; antenna_idx < value->num_antennas; ++antenna_idx) { - for(scheduled_ue_idx = 0; scheduled_ue_idx < subband_info->scheduled_ues; ++scheduled_ue_idx) { - if(!pull16(ppReadPackedMsg, &(subband_info->precoding_value[antenna_idx][scheduled_ue_idx]), end)) - return 0; - } - } - } - - return 1; -} - - -static uint8_t unpack_dl_config_dci_dl_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dci_dl_pdu_rel13_t *dci_dl_pdu_rel13 = (nfapi_dl_config_dci_dl_pdu_rel13_t *)tlv; - // If the length is greater than 5 then the TPM struct flag and possiably the TPM structure have been - // added - uint8_t tpm_struct_flag_present = dci_dl_pdu_rel13->tl.length > 5; - dci_dl_pdu_rel13->tpm_struct_flag = 0; - return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->laa_end_partial_sf_flag, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->laa_end_partial_sf_configuration, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->initial_lbt_sf, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->codebook_size_determination, end) && - pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->drms_table_flag, end) && - ( (tpm_struct_flag_present == 1) ? pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->tpm_struct_flag, end) : 1) && - ( (tpm_struct_flag_present == 1 && dci_dl_pdu_rel13->tpm_struct_flag == 1) ? unpack_tpm_value(ppReadPackedMsg, &dci_dl_pdu_rel13->tpm, end) : 1)); -} - -static uint8_t unpack_dl_config_bch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_bch_pdu_rel8_t *bch_pdu_rel8 = (nfapi_dl_config_bch_pdu_rel8_t *)tlv; - return ( pull16(ppReadPackedMsg, &bch_pdu_rel8->length, end) && - pull16(ppReadPackedMsg, (uint16_t *)&bch_pdu_rel8->pdu_index, end) && - pull16(ppReadPackedMsg, &bch_pdu_rel8->transmission_power, end)); -} - -static uint8_t unpack_dl_config_mch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_mch_pdu_rel8_t *mch_pdu_rel8 = (nfapi_dl_config_mch_pdu_rel8_t *)tlv; - return (pull16(ppReadPackedMsg, &mch_pdu_rel8->length, end) && - pull16(ppReadPackedMsg, (uint16_t *)&mch_pdu_rel8->pdu_index, end) && - pull16(ppReadPackedMsg, &mch_pdu_rel8->rnti, end) && - pull8(ppReadPackedMsg, &mch_pdu_rel8->resource_allocation_type, end) && - pull32(ppReadPackedMsg, &mch_pdu_rel8->resource_block_coding, end) && - pull8(ppReadPackedMsg, &mch_pdu_rel8->modulation, end) && - pull16(ppReadPackedMsg, &mch_pdu_rel8->transmission_power, end) && - pull16(ppReadPackedMsg, &mch_pdu_rel8->mbsfn_area_id, end)); -} - -static uint8_t unpack_dl_config_dlsch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel8_t *dlsch_pdu_rel8 = (nfapi_dl_config_dlsch_pdu_rel8_t *)tlv; - - if (!(pull16(ppReadPackedMsg, &dlsch_pdu_rel8->length, end) && - pull16(ppReadPackedMsg, (uint16_t *)&dlsch_pdu_rel8->pdu_index, end) && - pull16(ppReadPackedMsg, &dlsch_pdu_rel8->rnti, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->resource_allocation_type, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->virtual_resource_block_assignment_flag, end) && - pull32(ppReadPackedMsg, &dlsch_pdu_rel8->resource_block_coding, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->modulation, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->redundancy_version, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transport_blocks, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transport_block_to_codeword_swap_flag, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transmission_scheme, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->number_of_layers, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->number_of_subbands, end) && - pullarray8(ppReadPackedMsg, dlsch_pdu_rel8->codebook_index, NFAPI_MAX_NUM_SUBBANDS, dlsch_pdu_rel8->number_of_subbands, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->ue_category_capacity, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->pa, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->delta_power_offset_index, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->ngap, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->nprb, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transmission_mode, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->num_bf_prb_per_subband, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->num_bf_vector, end))) - return 0; - - uint16_t j = 0; - - for(j = 0; j < dlsch_pdu_rel8->num_bf_vector; ++j) { - if(!(pull8(ppReadPackedMsg, &dlsch_pdu_rel8->bf_vector[j].subband_index, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel8->bf_vector[j].num_antennas, end) && - pullarray16(ppReadPackedMsg, dlsch_pdu_rel8->bf_vector[j].bf_value, NFAPI_MAX_NUM_ANTENNAS, dlsch_pdu_rel8->bf_vector[j].num_antennas, end))) - return 0; - } - - return 1; -} -static uint8_t unpack_dl_config_dlsch_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel9_t *dlsch_pdu_rel9 = (nfapi_dl_config_dlsch_pdu_rel9_t *)tlv; - return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel9->nscid, end) ); -} -static uint8_t unpack_dl_config_dlsch_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel10_t *dlsch_pdu_rel10 = (nfapi_dl_config_dlsch_pdu_rel10_t *)tlv; - return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_flag, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_resource_config_r10, end) && - pull16(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_zero_tx_power_resource_config_bitmap_r10, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_number_nzp_configuration, end) && - pullarray8(ppReadPackedMsg, dlsch_pdu_rel10->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, dlsch_pdu_rel10->csi_rs_number_nzp_configuration, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel10->pdsch_start, end)) ; -} -static uint8_t unpack_dl_config_dlsch_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel11_t *dlsch_pdu_rel11 = (nfapi_dl_config_dlsch_pdu_rel11_t *)tlv; - return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel11->drms_config_flag, end) && - pull16(ppReadPackedMsg, &dlsch_pdu_rel11->drms_scrambling, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel11->csi_config_flag, end) && - pull16(ppReadPackedMsg, &dlsch_pdu_rel11->csi_scrambling, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_flag, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_atenna_ports, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_freq_shift, end)); -} -static uint8_t unpack_dl_config_dlsch_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel12_t *dlsch_pdu_rel12 = (nfapi_dl_config_dlsch_pdu_rel12_t *)tlv; - return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel12->altcqi_table_r12, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel12->maxlayers, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel12->n_dl_harq, end)); -} -static uint8_t unpack_dl_config_dlsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_dlsch_pdu_rel13_t *dlsch_pdu_rel13 = (nfapi_dl_config_dlsch_pdu_rel13_t *)tlv; - return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel13->dwpts_symbols, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel13->initial_lbt_sf, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel13->ue_type, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel13->pdsch_payload_type, end) && - pull16(ppReadPackedMsg, &dlsch_pdu_rel13->initial_transmission_sf_io, end) && - pull8(ppReadPackedMsg, &dlsch_pdu_rel13->drms_table_flag, end)); -} - -static uint8_t unpack_dl_config_pch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_pch_pdu_rel8_t *pch_pdu_rel8 = (nfapi_dl_config_pch_pdu_rel8_t *)tlv; - return ( pull16(ppReadPackedMsg, &pch_pdu_rel8->length, end) && - pull16(ppReadPackedMsg, (uint16_t *)&pch_pdu_rel8->pdu_index, end) && - pull16(ppReadPackedMsg, &pch_pdu_rel8->p_rnti, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->resource_allocation_type, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->virtual_resource_block_assignment_flag, end) && - pull32(ppReadPackedMsg, &pch_pdu_rel8->resource_block_coding, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->mcs, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->redundancy_version, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->number_of_transport_blocks, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->transport_block_to_codeword_swap_flag, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->transmission_scheme, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->number_of_layers, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->codebook_index, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->ue_category_capacity, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->pa, end) && - pull16(ppReadPackedMsg, &pch_pdu_rel8->transmission_power, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->nprb, end) && - pull8(ppReadPackedMsg, &pch_pdu_rel8->ngap, end)); -} -static uint8_t unpack_dl_config_pch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_pch_pdu_rel13_t *pch_pdu_rel13 = (nfapi_dl_config_pch_pdu_rel13_t *)tlv; - return ( pull8(ppReadPackedMsg, &pch_pdu_rel13->ue_mode, end) && - pull16(ppReadPackedMsg, &pch_pdu_rel13->initial_transmission_sf_io, end)); -} - -static uint8_t unpack_dl_config_prs_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_prs_pdu_rel9_t *prs_pdu_rel9 = (nfapi_dl_config_prs_pdu_rel9_t *)tlv; - return ( pull16(ppReadPackedMsg, &prs_pdu_rel9->transmission_power, end) && - pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_bandwidth, end) && - pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_cyclic_prefix_type, end) && - pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_muting, end)); -} - -static uint8_t unpack_dl_config_csi_rs_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_csi_rs_pdu_rel10_t *csi_rs_pdu_rel10 = (nfapi_dl_config_csi_rs_pdu_rel10_t *)tlv; - return ( pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_antenna_port_count_r10, end) && - pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_resource_config_r10, end) && - pull16(ppReadPackedMsg, &csi_rs_pdu_rel10->transmission_power, end) && - pull16(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_zero_tx_power_resource_config_bitmap_r10, end) && - pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_number_of_nzp_configuration, end) && - pullarray8(ppReadPackedMsg, csi_rs_pdu_rel10->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, csi_rs_pdu_rel10->csi_rs_number_of_nzp_configuration, end)); -} - -static uint8_t unpack_dl_config_csi_rs_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_csi_rs_pdu_rel13_t *csi_rs_pdu_rel13 = (nfapi_dl_config_csi_rs_pdu_rel13_t *)tlv; - - if (!(pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->csi_rs_class, end) && - pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->cdm_type, end) && - pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->num_bf_vector, end))) - return 0; - - uint16_t idx =0; - - for(idx = 0; idx < csi_rs_pdu_rel13->num_bf_vector; ++idx) { - if(!(pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->bf_vector[idx].csi_rs_resource_index, end))) - return 0; - - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : HOW TO DECODE BF VALUE \n"); - //pullarray16(ppReadPackedMsg, &csi_rs_pdu_rel13->bf_vector[idx].bf_vector, ??); - } - - return 1; -} - -static uint8_t unpack_dl_config_epdcch_params_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_epdcch_parameters_rel11_t *epdcch_params_rel11 = (nfapi_dl_config_epdcch_parameters_rel11_t *)tlv; - return (pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_resource_assignment_flag, end) && - pull16(ppReadPackedMsg, &epdcch_params_rel11->epdcch_id, end) && - pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_start_symbol, end) && - pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_num_prb, end) && - pullarray8(ppReadPackedMsg, epdcch_params_rel11->epdcch_prb_index, NFAPI_MAX_EPDCCH_PRB, epdcch_params_rel11->epdcch_num_prb, end) && - pull8(ppReadPackedMsg, &epdcch_params_rel11->bf_vector.subband_index, end) && - pull8(ppReadPackedMsg, &epdcch_params_rel11->bf_vector.num_antennas, end) && - pullarray16(ppReadPackedMsg, epdcch_params_rel11->bf_vector.bf_value, NFAPI_MAX_NUM_ANTENNAS, epdcch_params_rel11->bf_vector.num_antennas, end)); -} - -static uint8_t unpack_dl_config_epdcch_params_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_epdcch_parameters_rel13_t *epdcch_params_rel13 = (nfapi_dl_config_epdcch_parameters_rel13_t *)tlv; - return ( pull8(ppReadPackedMsg, &epdcch_params_rel13->dwpts_symbols, end) && - pull8(ppReadPackedMsg, &epdcch_params_rel13->initial_lbt_sf, end)); -} - -static uint8_t unpack_dl_config_mpdcch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_mpdcch_pdu_rel13_t *mpdcch_params_rel13 = (nfapi_dl_config_mpdcch_pdu_rel13_t *)tlv; - return ( pull8(ppReadPackedMsg, &mpdcch_params_rel13->mpdcch_narrow_band, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->number_of_prb_pairs, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->resource_block_assignment, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->mpdcch_tansmission_type, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->start_symbol, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->ecce_index, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->aggregation_level, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->rnti_type, end) && - pull16(ppReadPackedMsg, &mpdcch_params_rel13->rnti, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->ce_mode, end) && - pull16(ppReadPackedMsg, &mpdcch_params_rel13->drms_scrambling_init, end) && - pull16(ppReadPackedMsg, &mpdcch_params_rel13->initial_transmission_sf_io, end) && - pull16(ppReadPackedMsg, &mpdcch_params_rel13->transmission_power, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->dci_format, end) && - pull16(ppReadPackedMsg, &mpdcch_params_rel13->resource_block_coding, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->mcs, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->pdsch_reptition_levels, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->redundancy_version, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->new_data_indicator, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->harq_process, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpmi_length, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpmi, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->pmi_flag, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->pmi, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->harq_resource_offset, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->dci_subframe_repetition_number, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpc, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->downlink_assignment_index_length, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->downlink_assignment_index, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->allocate_prach_flag, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->preamble_index, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->prach_mask_index, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->starting_ce_level, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->srs_request, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->antenna_ports_and_scrambling_identity_flag, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->antenna_ports_and_scrambling_identity, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->frequency_hopping_enabled_flag, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->paging_direct_indication_differentiation_flag, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->direct_indication, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->total_dci_length_including_padding, end) && - pull8(ppReadPackedMsg, &mpdcch_params_rel13->number_of_tx_antenna_ports, end) && - pullarray16(ppReadPackedMsg, mpdcch_params_rel13->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, mpdcch_params_rel13->number_of_tx_antenna_ports, end)); -} - - -static uint8_t unpack_dl_config_nbch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_nbch_pdu_rel13_t *nbch_params_rel13 = (nfapi_dl_config_nbch_pdu_rel13_t *)tlv; - return ( pull16(ppReadPackedMsg, &nbch_params_rel13->length, end) && - pull16(ppReadPackedMsg, (uint16_t *)&nbch_params_rel13->pdu_index, end) && - pull16(ppReadPackedMsg, &nbch_params_rel13->transmission_power, end) && - pull16(ppReadPackedMsg, &nbch_params_rel13->hyper_sfn_2_lsbs, end)); -} - -static uint8_t unpack_dl_config_npdcch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_npdcch_pdu_rel13_t *npdcch_params_rel13 = (nfapi_dl_config_npdcch_pdu_rel13_t *)tlv; - return ( pull16(ppReadPackedMsg, &npdcch_params_rel13->length, end) && - pull16(ppReadPackedMsg, (uint16_t *)&npdcch_params_rel13->pdu_index, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->ncce_index, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->aggregation_level, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->start_symbol, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->rnti_type, end) && - pull16(ppReadPackedMsg, &npdcch_params_rel13->rnti, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->scrambling_reinitialization_batch_index, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->nrs_antenna_ports_assumed_by_the_ue, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->dci_format, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->scheduling_delay, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->resource_assignment, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->repetition_number, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->mcs, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->new_data_indicator, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->harq_ack_resource, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->npdcch_order_indication, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->starting_number_of_nprach_repetitions, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->subcarrier_indication_of_nprach, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->paging_direct_indication_differentation_flag, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->direct_indication, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->dci_subframe_repetition_number, end) && - pull8(ppReadPackedMsg, &npdcch_params_rel13->total_dci_length_including_padding, end)); -} - -static uint8_t unpack_dl_config_ndlsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_dl_config_ndlsch_pdu_rel13_t *ndlsch_params_rel13 = (nfapi_dl_config_ndlsch_pdu_rel13_t *)tlv; - return ( pull16(ppReadPackedMsg, &ndlsch_params_rel13->length, end) && - pull16(ppReadPackedMsg, (uint16_t *)&ndlsch_params_rel13->pdu_index, end) && - pull8(ppReadPackedMsg, &ndlsch_params_rel13->start_symbol, end) && - pull8(ppReadPackedMsg, &ndlsch_params_rel13->rnti_type, end) && - pull16(ppReadPackedMsg, &ndlsch_params_rel13->rnti, end) && - pull16(ppReadPackedMsg, &ndlsch_params_rel13->resource_assignment, end) && - pull16(ppReadPackedMsg, &ndlsch_params_rel13->repetition_number, end) && - pull8(ppReadPackedMsg, &ndlsch_params_rel13->modulation, end) && - pull8(ppReadPackedMsg, &ndlsch_params_rel13->number_of_subframes_for_resource_assignment, end) && - pull8(ppReadPackedMsg, &ndlsch_params_rel13->scrambling_sequence_initialization_cinit, end) && - pull16(ppReadPackedMsg, &ndlsch_params_rel13->sf_idx, end) && - pull8(ppReadPackedMsg, &ndlsch_params_rel13->nrs_antenna_ports_assumed_by_the_ue, end)); -} - - -static uint8_t unpack_dl_tti_request_body_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { - nfapi_nr_dl_tti_request_pdu_t *value = (nfapi_nr_dl_tti_request_pdu_t *)msg; - - if(!(pull32(ppReadPackedMsg, &value->PDUSize, end) && - pull16(ppReadPackedMsg, &value->PDUType, end) )) - return 0; - - // first match the pdu type, then call the respective function - switch(value->PDUType) { - case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE: { - if(!(unpack_dl_tti_csi_rs_pdu_rel15_value(&value->csi_rs_pdu.csi_rs_pdu_rel15,ppReadPackedMsg,end))) - return 0; - } - break; - - case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE: { - if(!(unpack_dl_tti_pdcch_pdu_rel15_value(&value->pdcch_pdu.pdcch_pdu_rel15,ppReadPackedMsg,end))) - return 0; - } - break; - - case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE: { - if(!(unpack_dl_tti_pdsch_pdu_rel15_value(&value->pdsch_pdu.pdsch_pdu_rel15,ppReadPackedMsg,end))) - return 0; - } - break; - - case NFAPI_NR_DL_TTI_SSB_PDU_TYPE: { - if(!(unpack_dl_tti_ssb_pdu_rel15_value(&value->ssb_pdu.ssb_pdu_rel15,ppReadPackedMsg,end))) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid DL_TTI pdu type %d \n", value->PDUType ); - } - break; - } - - return 1; -} - - - - -static uint8_t unpack_dl_config_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_dl_config_request_body_t *value = (nfapi_dl_config_request_body_t *)tlv; - - if(!(pull8(ppReadPackedMsg, &value->number_pdcch_ofdm_symbols, end) && - pull8(ppReadPackedMsg, &value->number_dci, end) && - pull16(ppReadPackedMsg, &value->number_pdu, end) && - pull8(ppReadPackedMsg, &value->number_pdsch_rnti, end) && - pull16(ppReadPackedMsg, &value->transmission_power_pcfich, end))) - return 0; - - if(value->number_pdu > NFAPI_DL_CONFIG_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of dl config pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_pdu, NFAPI_DL_CONFIG_MAX_PDU); - return 0; - } - - if(value->number_pdu) { - value->dl_config_pdu_list = (nfapi_dl_config_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_dl_config_request_pdu_t) * value->number_pdu, config); - - if(value->dl_config_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate dl config pdu list (count:%d)\n", __FUNCTION__, value->number_pdu); - return 0; - } - } else { - value->dl_config_pdu_list = 0; - } - - uint16_t i; - uint16_t total_number_of_pdus = value->number_pdu; - - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_dl_config_request_pdu_t *pdu = &(value->dl_config_pdu_list[i]); - - if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && - pull8(ppReadPackedMsg, &pdu->pdu_size, end))) - return 0; - - uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; - - if(packedPduEnd > end) { - // pdu end of beyond buffer end - return 0; - } - - switch(pdu->pdu_type) { - case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel8, &unpack_dl_config_dci_dl_pdu_rel8_value}, - { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel9, &unpack_dl_config_dci_dl_pdu_rel9_value}, - { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel10, &unpack_dl_config_dci_dl_pdu_rel10_value}, - { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel11, &unpack_dl_config_dci_dl_pdu_rel11_value}, - { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel12, &unpack_dl_config_dci_dl_pdu_rel12_value}, - { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel13, &unpack_dl_config_dci_dl_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_BCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG, &pdu->bch_pdu.bch_pdu_rel8, &unpack_dl_config_bch_pdu_rel8_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_MCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG, &pdu->mch_pdu.mch_pdu_rel8, &unpack_dl_config_mch_pdu_rel8_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel8, &unpack_dl_config_dlsch_pdu_rel8_value}, - { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel9, &unpack_dl_config_dlsch_pdu_rel9_value}, - { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel10, &unpack_dl_config_dlsch_pdu_rel10_value}, - { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel11, &unpack_dl_config_dlsch_pdu_rel11_value}, - { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel12, &unpack_dl_config_dlsch_pdu_rel12_value}, - { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel13, &unpack_dl_config_dlsch_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_PCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG, &pdu->pch_pdu.pch_pdu_rel8, &unpack_dl_config_pch_pdu_rel8_value}, - { NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG, &pdu->pch_pdu.pch_pdu_rel13, &unpack_dl_config_pch_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_PRS_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG, &pdu->prs_pdu.prs_pdu_rel9, &unpack_dl_config_prs_pdu_rel9_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel10, &unpack_dl_config_csi_rs_pdu_rel10_value}, - { NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel13, &unpack_dl_config_csi_rs_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel8, &unpack_dl_config_dci_dl_pdu_rel8_value}, - { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel9, &unpack_dl_config_dci_dl_pdu_rel9_value}, - { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel10, &unpack_dl_config_dci_dl_pdu_rel10_value}, - { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel11, &unpack_dl_config_dci_dl_pdu_rel11_value}, - { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel12, &unpack_dl_config_dci_dl_pdu_rel12_value}, - { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel13, &unpack_dl_config_dci_dl_pdu_rel13_value}, - { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG, &pdu->epdcch_pdu.epdcch_params_rel11, &unpack_dl_config_epdcch_params_rel11_value}, - { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG, &pdu->epdcch_pdu.epdcch_params_rel13, &unpack_dl_config_epdcch_params_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG, &pdu->mpdcch_pdu.mpdcch_pdu_rel13, &unpack_dl_config_mpdcch_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_NBCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG, &pdu->nbch_pdu.nbch_pdu_rel13, &unpack_dl_config_nbch_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG, &pdu->npdcch_pdu.npdcch_pdu_rel13, &unpack_dl_config_npdcch_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG, &pdu->ndlsch_pdu.ndlsch_pdu_rel13, &unpack_dl_config_ndlsch_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - default: - // Need to log an error - break; - } - } - - return 1; -} - - -static uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg; - - if (!(pull16(ppReadPackedMsg,&pNfapiMsg->SFN, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->dl_tti_request_body.nGroup, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->dl_tti_request_body.nPDUs, end) && - pullarray8(ppReadPackedMsg,pNfapiMsg->dl_tti_request_body.nUe,256,pNfapiMsg->dl_tti_request_body.nGroup, end) - //pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end) - )) - return 0; - - int arr[12]; - - for(int i=0; idl_tti_request_body.nGroup; i++) { - for(int j=0; jdl_tti_request_body.nUe[i]; j++) { - arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j]; - } - - if(!(pullarrays32(ppReadPackedMsg,arr,12,pNfapiMsg->dl_tti_request_body.nUe[i], end))) - return 0; - } - - for(int i=0; idl_tti_request_body.nPDUs; i++) { - if(!unpack_dl_tti_request_body_value(ppReadPackedMsg, end, &pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i])) - return 0; - } - - return 1; -} - - -static uint8_t unpack_ul_tti_request_prach_pdu(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_prach_pdu_t *prach_pdu = (nfapi_nr_prach_pdu_t *)tlv; - return( - pull16(ppReadPackedMsg, &prach_pdu->phys_cell_id, end) && - pull8(ppReadPackedMsg, &prach_pdu->num_prach_ocas, end) && - pull8(ppReadPackedMsg, &prach_pdu->prach_format, end) && - pull8(ppReadPackedMsg, &prach_pdu->num_ra, end) && - pull8(ppReadPackedMsg, &prach_pdu->prach_start_symbol, end) && - pull16(ppReadPackedMsg, &prach_pdu->num_cs, end) - // TODO: ignoring beamforming tlv for now - ); -} - - -static uint8_t unpack_ul_tti_request_pucch_pdu(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_pucch_pdu_t *pucch_pdu = (nfapi_nr_pucch_pdu_t *)tlv; - return( - pull16(ppReadPackedMsg, &pucch_pdu->rnti, end) && - pull32(ppReadPackedMsg, &pucch_pdu->handle, end) && - pull16(ppReadPackedMsg, &pucch_pdu->bwp_size, end) && - pull16(ppReadPackedMsg, &pucch_pdu->bwp_start, end) && - pull8(ppReadPackedMsg, &pucch_pdu->subcarrier_spacing, end) && - pull8(ppReadPackedMsg, &pucch_pdu->cyclic_prefix, end) && - pull8(ppReadPackedMsg, &pucch_pdu->format_type, end) && - pull8(ppReadPackedMsg, &pucch_pdu->multi_slot_tx_indicator, end) && - pull16(ppReadPackedMsg, &pucch_pdu->prb_start, end) && - pull16(ppReadPackedMsg, &pucch_pdu->prb_size, end) && - pull8(ppReadPackedMsg, &pucch_pdu->start_symbol_index, end) && - pull8(ppReadPackedMsg, &pucch_pdu->nr_of_symbols, end) && - pull8(ppReadPackedMsg, &pucch_pdu->freq_hop_flag, end) && - pull16(ppReadPackedMsg, &pucch_pdu->second_hop_prb, end) && - pull8(ppReadPackedMsg, &pucch_pdu->group_hop_flag, end) && - pull8(ppReadPackedMsg, &pucch_pdu->sequence_hop_flag, end) && - pull16(ppReadPackedMsg, &pucch_pdu->hopping_id, end) && - pull16(ppReadPackedMsg, &pucch_pdu->initial_cyclic_shift, end) && - pull16(ppReadPackedMsg, &pucch_pdu->data_scrambling_id, end) && - pull8(ppReadPackedMsg, &pucch_pdu->time_domain_occ_idx, end) && - pull8(ppReadPackedMsg, &pucch_pdu->pre_dft_occ_idx, end) && - pull8(ppReadPackedMsg, &pucch_pdu->pre_dft_occ_len, end) && - pull8(ppReadPackedMsg, &pucch_pdu->add_dmrs_flag, end) && - pull16(ppReadPackedMsg, &pucch_pdu->dmrs_scrambling_id, end) && - pull8(ppReadPackedMsg, &pucch_pdu->dmrs_cyclic_shift, end) && - pull8(ppReadPackedMsg, &pucch_pdu->sr_flag, end) && - pull8(ppReadPackedMsg, &pucch_pdu->bit_len_harq, end) && - pull16(ppReadPackedMsg, &pucch_pdu->bit_len_csi_part1, end) && - pull16(ppReadPackedMsg, &pucch_pdu->bit_len_csi_part2, end) - // TODO: ignoring beamforming tlv for now - ); -} - - -static uint8_t unpack_ul_tti_request_pusch_pdu(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_pusch_pdu_t *pusch_pdu = (nfapi_nr_pusch_pdu_t *)tlv; - - if (!( - pull16(ppReadPackedMsg, &pusch_pdu->pdu_bit_map, end) && - pull16(ppReadPackedMsg, &pusch_pdu->rnti, end) && - pull32(ppReadPackedMsg, &pusch_pdu->handle, end) && - pull16(ppReadPackedMsg, &pusch_pdu->bwp_size, end) && - pull16(ppReadPackedMsg, &pusch_pdu->bwp_start, end) && - pull8(ppReadPackedMsg, &pusch_pdu->subcarrier_spacing, end) && - pull8(ppReadPackedMsg, &pusch_pdu->cyclic_prefix, end) && - pull16(ppReadPackedMsg, &pusch_pdu->target_code_rate, end) && - pull8(ppReadPackedMsg, &pusch_pdu->qam_mod_order, end) && - pull8(ppReadPackedMsg, &pusch_pdu->mcs_index, end) && - pull8(ppReadPackedMsg, &pusch_pdu->mcs_table, end) && - pull8(ppReadPackedMsg, &pusch_pdu->transform_precoding, end) && - pull16(ppReadPackedMsg, &pusch_pdu->data_scrambling_id, end) && - pull8(ppReadPackedMsg, &pusch_pdu->nrOfLayers, end) && - pull16(ppReadPackedMsg, &pusch_pdu->ul_dmrs_symb_pos, end) && - pull8(ppReadPackedMsg, &pusch_pdu->dmrs_config_type, end) && - pull16(ppReadPackedMsg, &pusch_pdu->ul_dmrs_scrambling_id, end) && - pull8(ppReadPackedMsg, &pusch_pdu->scid, end) && - pull8(ppReadPackedMsg, &pusch_pdu->num_dmrs_cdm_grps_no_data, end) && - pull16(ppReadPackedMsg, &pusch_pdu->dmrs_ports, end) && - pull8(ppReadPackedMsg, &pusch_pdu->resource_alloc, end) && - pull8(ppReadPackedMsg, &pusch_pdu->resource_alloc,end) && - pull16(ppReadPackedMsg, &pusch_pdu->dmrs_ports, end) && - pull16(ppReadPackedMsg, &pusch_pdu->rb_start, end) && - pull16(ppReadPackedMsg, &pusch_pdu->rb_size, end) && - pull8(ppReadPackedMsg, &pusch_pdu->vrb_to_prb_mapping, end) && - pull8(ppReadPackedMsg, &pusch_pdu->frequency_hopping, end) && - pull16(ppReadPackedMsg, &pusch_pdu->tx_direct_current_location, end) && - pull8(ppReadPackedMsg, &pusch_pdu->uplink_frequency_shift_7p5khz, end) && - pull8(ppReadPackedMsg, &pusch_pdu->start_symbol_index, end) && - pull8(ppReadPackedMsg, &pusch_pdu->nr_of_symbols, end) - // TODO: ignoring beamforming tlv for now - )) - return 0; - - //Pack Optional Data only included if indicated in pduBitmap - switch(pusch_pdu->pdu_bit_map) { - case PUSCH_PDU_BITMAP_PUSCH_DATA: { - // pack optional TLVs - return( - pull8(ppReadPackedMsg, &pusch_pdu->pusch_data.rv_index, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_data.harq_process_id, end) && - pull32(ppReadPackedMsg, &pusch_pdu->pusch_data.tb_size, end) && - pull16(ppReadPackedMsg, &pusch_pdu->pusch_data.num_cb, end) && - pullarray8(ppReadPackedMsg, pusch_pdu->pusch_data.cb_present_and_position,1,1,end) - ); - } - break; - - case PUSCH_PDU_BITMAP_PUSCH_UCI: { - return( - pull16(ppReadPackedMsg, &pusch_pdu->pusch_uci.harq_ack_bit_length, end) && - pull16(ppReadPackedMsg, &pusch_pdu->pusch_uci.csi_part1_bit_length, end) && - pull16(ppReadPackedMsg, &pusch_pdu->pusch_uci.csi_part2_bit_length, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_uci.alpha_scaling, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_uci.beta_offset_harq_ack, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_uci.beta_offset_csi1, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_uci.beta_offset_csi2, end) - ); - } - break; - - case PUSCH_PDU_BITMAP_PUSCH_PTRS: { - return( - pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.num_ptrs_ports, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_dmrs_port, end) && - + pull16(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_port_index, end) && - + pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_re_offset, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_time_density, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_freq_density, end) && - pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ul_ptrs_power, end) - ); - } - break; - - case PUSCH_PDU_BITMAP_DFTS_OFDM: { - return( - pull8(ppReadPackedMsg, &pusch_pdu->dfts_ofdm.low_papr_group_number, end) && - pull16(ppReadPackedMsg, &pusch_pdu->dfts_ofdm.low_papr_sequence_number, end) && - pull8(ppReadPackedMsg, &pusch_pdu->dfts_ofdm.ul_ptrs_sample_density, end) && - pull8(ppReadPackedMsg, &pusch_pdu->dfts_ofdm.ul_ptrs_time_density_transform_precoding, end) - ); - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_INFO, "Invalid pdu bitmap %d \n", pusch_pdu->pdu_bit_map ); - } - } - - return 1; -} - - -static uint8_t unpack_ul_tti_request_srs_pdu(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_srs_pdu_t *srs_pdu = (nfapi_nr_srs_pdu_t *)tlv; - return( - pull16(ppReadPackedMsg, &srs_pdu->rnti, end) && - pull32(ppReadPackedMsg, &srs_pdu->handle, end) && - pull16(ppReadPackedMsg, &srs_pdu->bwp_size, end) && - pull16(ppReadPackedMsg, &srs_pdu->bwp_start, end) && - pull8(ppReadPackedMsg, &srs_pdu->subcarrier_spacing, end) && - pull8(ppReadPackedMsg, &srs_pdu->cyclic_prefix, end) && - pull8(ppReadPackedMsg, &srs_pdu->num_ant_ports, end) && - pull8(ppReadPackedMsg, &srs_pdu->num_symbols, end) && - pull8(ppReadPackedMsg, &srs_pdu->num_repetitions, end) && - pull8(ppReadPackedMsg, &srs_pdu->time_start_position, end) && - pull8(ppReadPackedMsg, &srs_pdu->config_index, end) && - pull16(ppReadPackedMsg, &srs_pdu->sequence_id, end) && - pull8(ppReadPackedMsg, &srs_pdu->bandwidth_index, end) && - pull8(ppReadPackedMsg, &srs_pdu->comb_size, end) && - pull8(ppReadPackedMsg, &srs_pdu->comb_offset, end) && - pull8(ppReadPackedMsg, &srs_pdu->cyclic_shift, end) && - pull8(ppReadPackedMsg, &srs_pdu->frequency_position, end) && - pull8(ppReadPackedMsg, &srs_pdu->frequency_shift, end) && - pull8(ppReadPackedMsg, &srs_pdu->frequency_hopping, end) && - pull8(ppReadPackedMsg, &srs_pdu->group_or_sequence_hopping, end) && - pull8(ppReadPackedMsg, &srs_pdu->resource_type, end) && - pull16(ppReadPackedMsg, &srs_pdu->t_srs, end) && - pull16(ppReadPackedMsg, &srs_pdu->t_offset, end) - // TODO: ignoring beamforming tlv for now - ); -} - - -static uint8_t unpack_ul_tti_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { - nfapi_nr_ul_tti_request_number_of_pdus_t *pNfapiMsg = (nfapi_nr_ul_tti_request_number_of_pdus_t *)msg; - - if(!(pull16(ppReadPackedMsg, &pNfapiMsg->pdu_size, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->pdu_type, end) )) - return 0; - - // first natch the pdu type, then call the respective function - switch(pNfapiMsg->pdu_type) { - case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE: { - if(!unpack_ul_tti_request_prach_pdu(&pNfapiMsg->prach_pdu, ppReadPackedMsg, end)) - return 0; - } - break; - - case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE: { - if(!unpack_ul_tti_request_pucch_pdu(&pNfapiMsg->pucch_pdu, ppReadPackedMsg, end)) - return 0; - } - break; - - case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE: { - if(!unpack_ul_tti_request_pusch_pdu(&pNfapiMsg->pusch_pdu, ppReadPackedMsg, end)) - return 0; - } - break; - - case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE: { - if(!unpack_ul_tti_request_srs_pdu(&pNfapiMsg->srs_pdu, ppReadPackedMsg, end)) - return 0; - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid UL_TTI pdu type %d \n", pNfapiMsg->pdu_type ); - } - break; - } - - return 1; -} - - -static uint8_t unpack_ul_tti_groups_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { - nfapi_nr_ul_tti_request_number_of_groups_t *pNfapiMsg = (nfapi_nr_ul_tti_request_number_of_groups_t *)msg; - - if(!pull8(ppReadPackedMsg, &pNfapiMsg->n_ue, end)) - return 0; - - for (int i = 0; i < pNfapiMsg->n_ue; i++) { - if(!pull8(ppReadPackedMsg, &pNfapiMsg->ue_list[i].pdu_idx,end) ) - return 0; - } - - return 1; -} - - -static uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg; - - if (!( - pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->n_pdus, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->n_group, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->rach_present, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->n_ulcch, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->n_ulsch, end) )) - return 0; - - for(int i=0; i< pNfapiMsg->n_pdus; i++) { - if (!unpack_ul_tti_pdu_list_value(ppReadPackedMsg, end, &pNfapiMsg->pdus_list[i])) - return 0; - } - - for(int i=0; i< pNfapiMsg->n_group; i++) { - if (!unpack_ul_tti_groups_list_value(ppReadPackedMsg, end, &pNfapiMsg->groups_list[i])) - return 0; - } - - return 1; -} - - - -static uint8_t unpack_dl_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_dl_config_request_t *pNfapiMsg = (nfapi_dl_config_request_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, &unpack_dl_config_request_body_value}, - }; - return ( pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_ul_config_ulsch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_pdu_rel8_t *ulsch_pdu_rel8 = (nfapi_ul_config_ulsch_pdu_rel8_t *)tlv; - return (pull32(ppReadPackedMsg, &ulsch_pdu_rel8->handle, end) && - pull16(ppReadPackedMsg, &ulsch_pdu_rel8->size, end) && - pull16(ppReadPackedMsg, &ulsch_pdu_rel8->rnti, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->resource_block_start, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->number_of_resource_blocks, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->modulation_type, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->cyclic_shift_2_for_drms, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->frequency_hopping_enabled_flag, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->frequency_hopping_bits, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->new_data_indication, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->redundancy_version, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->harq_process_number, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->ul_tx_mode, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->current_tx_nb, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel8->n_srs, end )); -} - -static uint8_t unpack_ul_config_ulsch_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_pdu_rel10_t *ulsch_pdu_rel10 = (nfapi_ul_config_ulsch_pdu_rel10_t *)tlv; - return (pull8(ppReadPackedMsg, &ulsch_pdu_rel10->resource_allocation_type, end) && - pull32(ppReadPackedMsg, &ulsch_pdu_rel10->resource_block_coding, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel10->transport_blocks, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel10->transmission_scheme, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel10->number_of_layers, end) & - pull8(ppReadPackedMsg, &ulsch_pdu_rel10->codebook_index, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel10->disable_sequence_hopping_flag, end)); -} -static uint8_t unpack_ul_config_ulsch_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_pdu_rel11_t *ulsch_pdu_rel11 = (nfapi_ul_config_ulsch_pdu_rel11_t *)tlv; - return ( pull8(ppReadPackedMsg, &ulsch_pdu_rel11->virtual_cell_id_enabled_flag, end) && - pull16(ppReadPackedMsg, &ulsch_pdu_rel11->npusch_identity, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel11->dmrs_config_flag, end) && - pull16(ppReadPackedMsg, &ulsch_pdu_rel11->ndmrs_csh_identity, end)); -} -static uint8_t unpack_ul_config_ulsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_pdu_rel13_t *ulsch_pdu_rel13 = (nfapi_ul_config_ulsch_pdu_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &ulsch_pdu_rel13->ue_type, end) && - pull16(ppReadPackedMsg, &ulsch_pdu_rel13->total_number_of_repetitions, end) && - pull16(ppReadPackedMsg, &ulsch_pdu_rel13->repetition_number, end) && - pull16(ppReadPackedMsg, &ulsch_pdu_rel13->initial_transmission_sf_io, end) && - pull8(ppReadPackedMsg, &ulsch_pdu_rel13->empty_symbols_due_to_re_tunning, end)); -} -static uint8_t unpack_ul_config_cqi_ri_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_ri_information_rel8_t *cqi_ri_info_rel8 = (nfapi_ul_config_cqi_ri_information_rel8_t *)tlv; - return (pull8(ppReadPackedMsg, &cqi_ri_info_rel8->dl_cqi_pmi_size_rank_1, end) && - pull8(ppReadPackedMsg, &cqi_ri_info_rel8->dl_cqi_pmi_size_rank_greater_1, end) && - pull8(ppReadPackedMsg, &cqi_ri_info_rel8->ri_size, end) && - pull8(ppReadPackedMsg, &cqi_ri_info_rel8->delta_offset_cqi, end) && - pull8(ppReadPackedMsg, &cqi_ri_info_rel8->delta_offset_ri, end)); -} - -static uint8_t unpack_ul_config_cqi_ri_info_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_ri_information_rel9_t *cqi_ri_info_rel9 = (nfapi_ul_config_cqi_ri_information_rel9_t *)tlv; - - if(!(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->report_type, end) && - pull8(ppReadPackedMsg, &cqi_ri_info_rel9->delta_offset_cqi, end) && - pull8(ppReadPackedMsg, &cqi_ri_info_rel9->delta_offset_ri, end))) - return 0; - - switch(cqi_ri_info_rel9->report_type) { - case NFAPI_CSI_REPORT_TYPE_PERIODIC: { - if(!(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size, end) && - pull8(ppReadPackedMsg, &cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.control_type, end))) - return 0; - } - break; - - case NFAPI_CSI_REPORT_TYPE_APERIODIC: { - if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc, end) ==0) - return 0; - - uint8_t i; - - for(i = 0; i < cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc; ++i) { - if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size, end) == 0) - return 0; - - uint8_t j; - - for(j = 0; j < 8; ++j) { - if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size[j], end) == 0) - return 0; - } - } - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel9->report_type ); - return 0; - } - break; - }; - - return 1; -} - -// NOTE : This function is a little unconventional as we uese the side to -// determine the report type -static uint8_t unpack_ul_config_cqi_ri_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_ri_information_rel13_t *cqi_ri_info_rel13 = (nfapi_ul_config_cqi_ri_information_rel13_t *)tlv; - - if(cqi_ri_info_rel13->tl.length == 0) { - cqi_ri_info_rel13->report_type = NFAPI_CSI_REPORT_TYPE_APERIODIC; - } else { - cqi_ri_info_rel13->report_type = NFAPI_CSI_REPORT_TYPE_PERIODIC; - - if(pull16(ppReadPackedMsg, &cqi_ri_info_rel13->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size_2, end) == 0) - return 0; - } - - return 1; -} -static uint8_t unpack_ul_config_cqi_init_tx_params_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_initial_transmission_parameters_rel8_t *init_tx_params_rel8 = (nfapi_ul_config_initial_transmission_parameters_rel8_t *)tlv; - return (pull8(ppReadPackedMsg, &init_tx_params_rel8->n_srs_initial, end) && - pull8(ppReadPackedMsg, &init_tx_params_rel8->initial_number_of_resource_blocks, end)); -} -static uint8_t unpack_ul_config_ulsch_harq_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_harq_information_rel10_t *harq_info_rel10 = (nfapi_ul_config_ulsch_harq_information_rel10_t *)tlv; - return (pull8(ppReadPackedMsg, &harq_info_rel10->harq_size, end) && - pull8(ppReadPackedMsg, &harq_info_rel10->delta_offset_harq, end) && - pull8(ppReadPackedMsg, &harq_info_rel10->ack_nack_mode, end)); -} - -static uint8_t unpack_ul_config_ulsch_harq_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ulsch_harq_information_rel13_t *harq_info_rel13 = (nfapi_ul_config_ulsch_harq_information_rel13_t *)tlv; - return (pull16(ppReadPackedMsg, &harq_info_rel13->harq_size_2, end) && - pull8(ppReadPackedMsg, &harq_info_rel13->delta_offset_harq_2, end)); -} - -static uint8_t unpack_ul_config_ue_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ue_information_rel8_t *ue_info_rel8 = (nfapi_ul_config_ue_information_rel8_t *)tlv; - return (pull32(ppReadPackedMsg, &ue_info_rel8->handle, end) && - pull16(ppReadPackedMsg, (uint16_t *)&ue_info_rel8->rnti, end)); -} -static uint8_t unpack_ul_config_ue_info_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ue_information_rel11_t *ue_info_rel11 = (nfapi_ul_config_ue_information_rel11_t *)tlv; - return (pull8(ppReadPackedMsg, &ue_info_rel11->virtual_cell_id_enabled_flag, end) && - pull16(ppReadPackedMsg, &ue_info_rel11->npusch_identity, end)); -} -static uint8_t unpack_ul_config_ue_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_ue_information_rel13_t *ue_info_rel13 = (nfapi_ul_config_ue_information_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &ue_info_rel13->ue_type, end) && - pull8(ppReadPackedMsg, &ue_info_rel13->empty_symbols, end) && - pull16(ppReadPackedMsg, &ue_info_rel13->total_number_of_repetitions, end) && - pull16(ppReadPackedMsg, &ue_info_rel13->repetition_number, end)); -} - -static uint8_t unpack_ul_config_cqi_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_information_rel8_t *cqi_info_rel8 = (nfapi_ul_config_cqi_information_rel8_t *)tlv; - return ( pull16(ppReadPackedMsg, &cqi_info_rel8->pucch_index, end) && - pull8(ppReadPackedMsg, &cqi_info_rel8->dl_cqi_pmi_size, end)); -} -static uint8_t unpack_ul_config_cqi_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_information_rel10_t *cqi_info_rel10 = (nfapi_ul_config_cqi_information_rel10_t *)tlv; - return (pull8(ppReadPackedMsg, &cqi_info_rel10->number_of_pucch_resource, end) && - pull16(ppReadPackedMsg, &cqi_info_rel10->pucch_index_p1, end)); -} -static uint8_t unpack_ul_config_cqi_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_cqi_information_rel13_t *cqi_info_rel13 = (nfapi_ul_config_cqi_information_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &cqi_info_rel13->csi_mode, end) && - pull16(ppReadPackedMsg, &cqi_info_rel13->dl_cqi_pmi_size_2, end) && - pull8(ppReadPackedMsg, &cqi_info_rel13->starting_prb, end) && - pull8(ppReadPackedMsg, &cqi_info_rel13->n_prb, end) && - pull8(ppReadPackedMsg, &cqi_info_rel13->cdm_index, end) && - pull8(ppReadPackedMsg, &cqi_info_rel13->n_srs, end)); -} - -static uint8_t unpack_ul_config_sr_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_sr_information_rel8_t *sr_info_rel8 = (nfapi_ul_config_sr_information_rel8_t *)tlv; - return ( pull16(ppReadPackedMsg, &sr_info_rel8->pucch_index, end)); -} - -static uint8_t unpack_ul_config_sr_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_sr_information_rel10_t *sr_info_rel10 = (nfapi_ul_config_sr_information_rel10_t *)tlv; - return (pull8(ppReadPackedMsg, &sr_info_rel10->number_of_pucch_resources, end) && - pull16(ppReadPackedMsg, &sr_info_rel10->pucch_index_p1, end)); -} - -static uint8_t unpack_ul_config_harq_info_rel10_tdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel10_tdd_t *harq_info_tdd_rel10 = (nfapi_ul_config_harq_information_rel10_tdd_t *)tlv; - return (pull8(ppReadPackedMsg, &harq_info_tdd_rel10->harq_size, end) && - pull8(ppReadPackedMsg, &harq_info_tdd_rel10->ack_nack_mode, end) && - pull8(ppReadPackedMsg, &harq_info_tdd_rel10->number_of_pucch_resources, end) && - pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_0, end) && - pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_1, end) && - pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_2, end) && - pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_3, end)); -} - -static uint8_t unpack_ul_config_harq_info_rel8_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel8_fdd_t *harq_info_fdd_rel8 = (nfapi_ul_config_harq_information_rel8_fdd_t *)tlv; - return (pull16(ppReadPackedMsg, &harq_info_fdd_rel8->n_pucch_1_0, end) && - pull8(ppReadPackedMsg, &harq_info_fdd_rel8->harq_size, end)); -} - -static uint8_t unpack_ul_config_harq_info_rel9_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel9_fdd_t *harq_info_fdd_rel9 = (nfapi_ul_config_harq_information_rel9_fdd_t *)tlv; - return (pull8(ppReadPackedMsg, &harq_info_fdd_rel9->harq_size, end) && - pull8(ppReadPackedMsg, &harq_info_fdd_rel9->ack_nack_mode, end) && - pull8(ppReadPackedMsg, &harq_info_fdd_rel9->number_of_pucch_resources, end) && - pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_0, end) && - pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_1, end) && - pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_2, end) && - pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_3, end)); -} - -static uint8_t unpack_ul_config_harq_info_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel11_t *harq_info_rel11 = (nfapi_ul_config_harq_information_rel11_t *)tlv; - return (pull8(ppReadPackedMsg, &harq_info_rel11->num_ant_ports, end) && - pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_0, end) && - pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_1, end) && - pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_2, end) && - pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_3, end)); -} - -static uint8_t unpack_ul_config_harq_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_harq_information_rel13_t *harq_info_rel13 = (nfapi_ul_config_harq_information_rel13_t *)tlv; - return (pull16(ppReadPackedMsg, &harq_info_rel13->harq_size_2, end) && - pull8(ppReadPackedMsg, &harq_info_rel13->starting_prb, end) && - pull8(ppReadPackedMsg, &harq_info_rel13->n_prb, end) && - pull8(ppReadPackedMsg, &harq_info_rel13->cdm_index, end) && - pull8(ppReadPackedMsg, &harq_info_rel13->n_srs, end)); -} - - -static uint8_t unpack_ul_config_srs_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_srs_pdu_rel8_t *srs_pdu_rel8 = (nfapi_ul_config_srs_pdu_rel8_t *)tlv; - return (pull32(ppReadPackedMsg, &srs_pdu_rel8->handle, end) && - pull16(ppReadPackedMsg, &srs_pdu_rel8->size, end) && - pull16(ppReadPackedMsg, &srs_pdu_rel8->rnti, end) && - pull8(ppReadPackedMsg, &srs_pdu_rel8->srs_bandwidth, end) && - pull8(ppReadPackedMsg, &srs_pdu_rel8->frequency_domain_position, end) && - pull8(ppReadPackedMsg, &srs_pdu_rel8->srs_hopping_bandwidth, end) && - pull8(ppReadPackedMsg, &srs_pdu_rel8->transmission_comb, end) && - pull16(ppReadPackedMsg, &srs_pdu_rel8->i_srs, end) && - pull8(ppReadPackedMsg, &srs_pdu_rel8->sounding_reference_cyclic_shift, end)); -} - -static uint8_t unpack_ul_config_srs_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_srs_pdu_rel10_t *srs_pdu_rel10 = (nfapi_ul_config_srs_pdu_rel10_t *)tlv; - return pull8(ppReadPackedMsg, &srs_pdu_rel10->antenna_port, end); -} - -static uint8_t unpack_ul_config_srs_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_srs_pdu_rel13_t *srs_pdu_rel13 = (nfapi_ul_config_srs_pdu_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &srs_pdu_rel13->number_of_combs, end)); -} - -static uint8_t unpack_ul_nb_harq_info_rel13_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_nb_harq_information_rel13_fdd_t *nb_harq_info_fdd_rel13 = (nfapi_ul_config_nb_harq_information_rel13_fdd_t *)tlv; - return (pull8(ppReadPackedMsg, &nb_harq_info_fdd_rel13->harq_ack_resource, end)); -} - -static uint8_t unpack_ul_config_nulsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_nulsch_pdu_rel13_t *nulsch_pdu_rel13 = (nfapi_ul_config_nulsch_pdu_rel13_t *)tlv; - - if(!(pull8(ppReadPackedMsg, &nulsch_pdu_rel13->nulsch_format, end) && - pull32(ppReadPackedMsg, &nulsch_pdu_rel13->handle, end) && - pull16(ppReadPackedMsg, &nulsch_pdu_rel13->size, end) && - pull16(ppReadPackedMsg, &nulsch_pdu_rel13->rnti, end) && - pull8(ppReadPackedMsg, &nulsch_pdu_rel13->subcarrier_indication, end) && - pull8(ppReadPackedMsg, &nulsch_pdu_rel13->resource_assignment, end) && - pull8(ppReadPackedMsg, &nulsch_pdu_rel13->mcs, end) && - pull8(ppReadPackedMsg, &nulsch_pdu_rel13->redudancy_version, end) && - pull8(ppReadPackedMsg, &nulsch_pdu_rel13->repetition_number, end) && - pull8(ppReadPackedMsg, &nulsch_pdu_rel13->new_data_indication, end) && - pull8(ppReadPackedMsg, &nulsch_pdu_rel13->n_srs, end) && - pull16(ppReadPackedMsg, &nulsch_pdu_rel13->scrambling_sequence_initialization_cinit, end) && - pull16(ppReadPackedMsg, &nulsch_pdu_rel13->sf_idx, end))) - return 0; - - unpack_tlv_t unpack_fns[] = { - { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel8, &unpack_ul_config_ue_info_rel8_value}, - { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel11, &unpack_ul_config_ue_info_rel11_value}, - { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel13, &unpack_ul_config_ue_info_rel13_value}, - { NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG, &nulsch_pdu_rel13->nb_harq_information.nb_harq_information_rel13_fdd, &unpack_ul_nb_harq_info_rel13_fdd_value}, - }; - return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, 0, 0); -} - -static uint8_t unpack_ul_config_nrach_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_config_nrach_pdu_rel13_t *nrach_pdu_rel13 = (nfapi_ul_config_nrach_pdu_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_0, end) && - pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_1, end) && - pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_2, end)); -} - - -static uint8_t unpack_ul_config_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { -#define UL_CONFIG_ULSCH_PDU_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG, &_pdu.ulsch_pdu_rel8, &unpack_ul_config_ulsch_pdu_rel8_value}, \ - { NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG, &_pdu.ulsch_pdu_rel10, &unpack_ul_config_ulsch_pdu_rel10_value}, \ - { NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG, &_pdu.ulsch_pdu_rel11, &unpack_ul_config_ulsch_pdu_rel11_value}, \ - { NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG, &_pdu.ulsch_pdu_rel13, &unpack_ul_config_ulsch_pdu_rel13_value}, -#define UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG, &_pdu.cqi_ri_information_rel8, &unpack_ul_config_cqi_ri_info_rel8_value}, \ - { NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG, &_pdu.cqi_ri_information_rel9, &unpack_ul_config_cqi_ri_info_rel9_value}, \ - { NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG, &_pdu.cqi_ri_information_rel13, &unpack_ul_config_cqi_ri_info_rel13_value}, -#define UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG, &_pdu.harq_information_rel10, &unpack_ul_config_ulsch_harq_info_rel10_value},\ - { NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG, &_pdu.harq_information_rel13, &unpack_ul_config_ulsch_harq_info_rel13_value}, -#define UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG, &_pdu.initial_transmission_parameters_rel8, &unpack_ul_config_cqi_init_tx_params_rel8_value}, -#define UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &_pdu.ue_information_rel8, &unpack_ul_config_ue_info_rel8_value}, \ - { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &_pdu.ue_information_rel11, &unpack_ul_config_ue_info_rel11_value}, \ - { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &_pdu.ue_information_rel13, &unpack_ul_config_ue_info_rel13_value}, -#define UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG, &_pdu.cqi_information_rel8, &unpack_ul_config_cqi_info_rel8_value}, \ - { NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG, &_pdu.cqi_information_rel10, &unpack_ul_config_cqi_info_rel10_value}, \ - { NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG, &_pdu.cqi_information_rel13, &unpack_ul_config_cqi_info_rel13_value}, -#define UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG, &_pdu.sr_information_rel8, &unpack_ul_config_sr_info_rel8_value}, \ - { NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG, &_pdu.sr_information_rel10, &unpack_ul_config_sr_info_rel10_value}, -#define UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG, &_pdu.harq_information_rel10_tdd, &unpack_ul_config_harq_info_rel10_tdd_value}, \ - { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG, &_pdu.harq_information_rel8_fdd, &unpack_ul_config_harq_info_rel8_fdd_value}, \ - { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG, &_pdu.harq_information_rel9_fdd, &unpack_ul_config_harq_info_rel9_fdd_value}, \ - { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG, &_pdu.harq_information_rel11, &unpack_ul_config_harq_info_rel11_value}, \ - { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG, &_pdu.harq_information_rel13, &unpack_ul_config_harq_info_rel13_value}, -#define UL_CONFIG_SRS_PDU_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG, &_pdu.srs_pdu_rel8, &unpack_ul_config_srs_pdu_rel8_value}, \ - { NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG, &_pdu.srs_pdu_rel10, &unpack_ul_config_srs_pdu_rel10_value}, \ - { NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG, &_pdu.srs_pdu_rel13, &unpack_ul_config_srs_pdu_rel13_value}, -#define UL_CONFIG_NULSCH_PDU_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG, &_pdu.nulsch_pdu_rel13, &unpack_ul_config_nulsch_pdu_rel13_value}, -#define UL_CONFIG_NRACH_PDU_UNPACK_FNS(_pdu) \ - { NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG, &_pdu.nrach_pdu_rel13, &unpack_ul_config_nrach_pdu_rel13_value}, - nfapi_ul_config_request_body_t *value = (nfapi_ul_config_request_body_t *)tlv; - - if(!(pull8(ppReadPackedMsg, &value->number_of_pdus, end) && - pull8(ppReadPackedMsg, &value->rach_prach_frequency_resources, end) && - pull8(ppReadPackedMsg, &value->srs_present, end))) - return 0; - - if(value->number_of_pdus > NFAPI_UL_CONFIG_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of ul config pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_UL_CONFIG_MAX_PDU); - return 0; - } - - if(value->number_of_pdus > 0) { - value->ul_config_pdu_list = (nfapi_ul_config_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_ul_config_request_pdu_t) * value->number_of_pdus, config); - - if(value->ul_config_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate ul config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus); - return 0; - } - } else { - value->ul_config_pdu_list = 0; - } - - uint16_t i; - uint16_t total_number_of_pdus = value->number_of_pdus; - - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_ul_config_request_pdu_t *pdu = &(value->ul_config_pdu_list[i]); - - if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && - pull8(ppReadPackedMsg, &pdu->pdu_size, end))) - return 0; - - uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; - - if(packedPduEnd > end) { - // pdu end is past buffer end - return 0; - } - - switch(pdu->pdu_type) { - case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_pdu) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.ulsch_pdu) - UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.cqi_ri_information) - UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.initial_transmission_parameters) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_harq_pdu.ulsch_pdu) - UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(pdu->ulsch_harq_pdu.harq_information) - UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_harq_pdu.initial_transmission_parameters) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu) - UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information) - UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.harq_information) - UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_pdu.ue_information) - UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_pdu.cqi_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_sr_pdu.ue_information) - UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_sr_pdu.sr_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_harq_pdu.ue_information) - UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_harq_pdu.harq_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.ue_information) - UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.sr_information) - UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.harq_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.ue_information) - UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.cqi_information) - UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.harq_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.ue_information) - UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.cqi_information) - UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.sr_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.ue_information) - UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.cqi_information) - UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.sr_information) - UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.harq_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_SRS_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_SRS_PDU_UNPACK_FNS(pdu->srs_pdu) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->harq_buffer_pdu.ue_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_uci_csi_pdu.ulsch_pdu) - UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->ulsch_uci_csi_pdu.csi_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_uci_harq_pdu.ulsch_pdu) - UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->ulsch_uci_harq_pdu.harq_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.ulsch_pdu) - UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.csi_information) - UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.harq_information) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_NULSCH_PDU_UNPACK_FNS(pdu->nulsch_pdu) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_UL_CONFIG_NRACH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - UL_CONFIG_NRACH_PDU_UNPACK_FNS(pdu->nrach_pdu) - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - } - } - - return 1; -} - - -static uint8_t unpack_ul_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_ul_config_request_t *pNfapiMsg = (nfapi_ul_config_request_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_UL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->ul_config_request_body, &unpack_ul_config_request_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_hi_dci0_hi_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_hi_dci0_hi_pdu_rel8_t *hi_pdu_rel8 = (nfapi_hi_dci0_hi_pdu_rel8_t *)tlv; - return( pull8(ppReadPackedMsg, &hi_pdu_rel8->resource_block_start, end) && - pull8(ppReadPackedMsg, &hi_pdu_rel8->cyclic_shift_2_for_drms, end) && - pull8(ppReadPackedMsg, &hi_pdu_rel8->hi_value, end) && - pull8(ppReadPackedMsg, &hi_pdu_rel8->i_phich, end) && - pull16(ppReadPackedMsg, &hi_pdu_rel8->transmission_power, end)); -} - -static uint8_t unpack_hi_dci0_hi_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_hi_dci0_hi_pdu_rel10_t *hi_pdu_rel10 = (nfapi_hi_dci0_hi_pdu_rel10_t *)tlv; - return (pull8(ppReadPackedMsg, &hi_pdu_rel10->flag_tb2, end) && - pull8(ppReadPackedMsg, &hi_pdu_rel10->hi_value_2, end)); -} - -static uint8_t unpack_hi_dci0_dci_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_hi_dci0_dci_pdu_rel8_t *dci_pdu_rel8 = (nfapi_hi_dci0_dci_pdu_rel8_t *)tlv; - return (pull8(ppReadPackedMsg, &dci_pdu_rel8->dci_format, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->cce_index, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->aggregation_level, end) && - pull16(ppReadPackedMsg, &dci_pdu_rel8->rnti, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->resource_block_start, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->number_of_resource_block, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->mcs_1, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->cyclic_shift_2_for_drms, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->frequency_hopping_enabled_flag, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->frequency_hopping_bits, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->new_data_indication_1, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->ue_tx_antenna_seleciton, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->tpc, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->cqi_csi_request, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->ul_index, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel8->dl_assignment_index, end) && - pull32(ppReadPackedMsg, &dci_pdu_rel8->tpc_bitmap, end) && - pull16(ppReadPackedMsg, &dci_pdu_rel8->transmission_power, end)); -} - -static uint8_t unpack_hi_dci0_dci_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_hi_dci0_dci_pdu_rel10_t *dci_pdu_rel10 = (nfapi_hi_dci0_dci_pdu_rel10_t *)tlv; - return (pull8(ppReadPackedMsg, &dci_pdu_rel10->cross_carrier_scheduling_flag, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->carrier_indicator, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->size_of_cqi_csi_feild, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->srs_flag, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->srs_request, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->resource_allocation_flag, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->resource_allocation_type, end) && - pull32(ppReadPackedMsg, &dci_pdu_rel10->resource_block_coding, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->mcs_2, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->new_data_indication_2, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->number_of_antenna_ports, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->tpmi, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->total_dci_length_including_padding, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel10->n_ul_rb, end)); -} - -static uint8_t unpack_hi_dci0_dci_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_hi_dci0_dci_pdu_rel12_t *dci_pdu_rel12 = (nfapi_hi_dci0_dci_pdu_rel12_t *)tlv; - return ( pull8(ppReadPackedMsg, &dci_pdu_rel12->pscch_resource, end) && - pull8(ppReadPackedMsg, &dci_pdu_rel12->time_resource_pattern, end)); -} - -static uint8_t unpack_hi_dci0_mpdcch_dci_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t *value = (nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &value->mpdcch_narrowband, end) && - pull8(ppReadPackedMsg, &value->number_of_prb_pairs, end) && - pull8(ppReadPackedMsg, &value->resource_block_assignment, end) && - pull8(ppReadPackedMsg, &value->mpdcch_transmission_type, end) && - pull8(ppReadPackedMsg, &value->start_symbol, end) && - pull8(ppReadPackedMsg, &value->ecce_index, end) && - pull8(ppReadPackedMsg, &value->aggreagation_level, end) && - pull8(ppReadPackedMsg, &value->rnti_type, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->ce_mode, end) && - pull16(ppReadPackedMsg, &value->drms_scrambling_init, end) && - pull16(ppReadPackedMsg, &value->initial_transmission_sf_io, end) && - pull16(ppReadPackedMsg, &value->transmission_power, end) && - pull8(ppReadPackedMsg, &value->dci_format, end) && - pull8(ppReadPackedMsg, &value->resource_block_start, end) && - pull8(ppReadPackedMsg, &value->number_of_resource_blocks, end) && - pull8(ppReadPackedMsg, &value->mcs, end) && - pull8(ppReadPackedMsg, &value->pusch_repetition_levels, end) && - pull8(ppReadPackedMsg, &value->frequency_hopping_flag, end) && - pull8(ppReadPackedMsg, &value->new_data_indication, end) && - pull8(ppReadPackedMsg, &value->harq_process, end) && - pull8(ppReadPackedMsg, &value->redudency_version, end) && - pull8(ppReadPackedMsg, &value->tpc, end) && - pull8(ppReadPackedMsg, &value->csi_request, end) && - pull8(ppReadPackedMsg, &value->ul_inex, end) && - pull8(ppReadPackedMsg, &value->dai_presence_flag, end) && - pull8(ppReadPackedMsg, &value->dl_assignment_index, end) && - pull8(ppReadPackedMsg, &value->srs_request, end) && - pull8(ppReadPackedMsg, &value->dci_subframe_repetition_number, end) && - pull32(ppReadPackedMsg, &value->tcp_bitmap, end) && - pull8(ppReadPackedMsg, &value->total_dci_length_include_padding, end) && - pull8(ppReadPackedMsg, &value->number_of_tx_antenna_ports, end) && - pullarray16(ppReadPackedMsg, value->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, value->number_of_tx_antenna_ports, end)); -} - -static uint8_t unpack_hi_dci0_npdcch_dci_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_hi_dci0_npdcch_dci_pdu_rel13_t *value = (nfapi_hi_dci0_npdcch_dci_pdu_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &value->ncce_index, end) && - pull8(ppReadPackedMsg, &value->aggregation_level, end) && - pull8(ppReadPackedMsg, &value->start_symbol, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->scrambling_reinitialization_batch_index, end) && - pull8(ppReadPackedMsg, &value->nrs_antenna_ports_assumed_by_the_ue, end) && - pull8(ppReadPackedMsg, &value->subcarrier_indication, end) && - pull8(ppReadPackedMsg, &value->resource_assignment, end) && - pull8(ppReadPackedMsg, &value->scheduling_delay, end) && - pull8(ppReadPackedMsg, &value->mcs, end) && - pull8(ppReadPackedMsg, &value->redudancy_version, end) && - pull8(ppReadPackedMsg, &value->repetition_number, end) && - pull8(ppReadPackedMsg, &value->new_data_indicator, end) && - pull8(ppReadPackedMsg, &value->dci_subframe_repetition_number, end)); -} - -static uint8_t unpack_hi_dci0_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_hi_dci0_request_body_t *value = (nfapi_hi_dci0_request_body_t *)tlv; - - if(!(pull16(ppReadPackedMsg, &value->sfnsf, end) && - pull8(ppReadPackedMsg, &value->number_of_dci, end) && - pull8(ppReadPackedMsg, &value->number_of_hi, end))) - return 0; - - uint8_t totalNumPdus = value->number_of_hi + value->number_of_dci; - - if(totalNumPdus > NFAPI_HI_DCI0_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of dci0 pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, totalNumPdus, NFAPI_HI_DCI0_MAX_PDU); - return 0; - } - - if(totalNumPdus > 0) { - value->hi_dci0_pdu_list = (nfapi_hi_dci0_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_hi_dci0_request_pdu_t) * totalNumPdus, config); - - if(value->hi_dci0_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate hi dci0 pdu list (count:%d)\n", __FUNCTION__, totalNumPdus); - return 0; - } - } else { - value->hi_dci0_pdu_list = 0; - } - - uint8_t i; - - for(i = 0; i < totalNumPdus; ++i) { - nfapi_hi_dci0_request_pdu_t *pdu = &(value->hi_dci0_pdu_list[i]); - - if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && - pull8(ppReadPackedMsg, &pdu->pdu_size, end))) - return 0; - - uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; - - if(packedPduEnd > end) { - // pdu end if past buffer end - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pdu size to big %d %d\n", __FUNCTION__, packedPduEnd, end); - return 0; - } - - switch(pdu->pdu_type) { - case NFAPI_HI_DCI0_HI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG, &pdu->hi_pdu.hi_pdu_rel8, &unpack_hi_dci0_hi_pdu_rel8_value}, - { NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG, &pdu->hi_pdu.hi_pdu_rel10, &unpack_hi_dci0_hi_pdu_rel10_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_HI_DCI0_DCI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG, &pdu->dci_pdu.dci_pdu_rel8, &unpack_hi_dci0_dci_pdu_rel8_value}, - { NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG, &pdu->dci_pdu.dci_pdu_rel10, &unpack_hi_dci0_dci_pdu_rel10_value}, - { NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG, &pdu->dci_pdu.dci_pdu_rel12, &unpack_hi_dci0_dci_pdu_rel12_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel8, &unpack_hi_dci0_dci_pdu_rel8_value}, - { NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel10, &unpack_hi_dci0_dci_pdu_rel10_value}, - { NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG, &pdu->epdcch_dci_pdu.epdcch_parameters_rel11, &unpack_dl_config_epdcch_params_rel11_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG, &pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13, &unpack_hi_dci0_mpdcch_dci_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG, &pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13, &unpack_hi_dci0_npdcch_dci_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type ); - } - break; - }; - } - - return 1; -} -//unpack_ul_dci_pdu_list_value - -static uint8_t unpack_ul_dci_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) -{ - nfapi_nr_ul_dci_request_pdus_t* value = (nfapi_nr_ul_dci_request_pdus_t*)msg; - for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i) - { - if(!(pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].RNTI, end) && - pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].ScramblingId, end) && - - pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].ScramblingRNTI, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].CceIndex, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].AggregationLevel, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].beta_PDCCH_1_0, end) && - - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].powerControlOffsetSS, end) && - pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, end) && - - pullarray8(ppReadPackedMsg, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].Payload, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, end))) - - return 0; - } - - return (pull16(ppReadPackedMsg, &value->PDUType, end) && - pull16(ppReadPackedMsg, &value->PDUSize, end) && - pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.BWPSize, end) && - pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.BWPStart, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.SubcarrierSpacing, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CyclicPrefix, end) && - - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.StartSymbolIndex, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.DurationSymbols, end) && - pullarray8(ppReadPackedMsg, value->pdcch_pdu.pdcch_pdu_rel15.FreqDomainResource, 6, 6, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CceRegMappingType, end) && - - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.RegBundleSize, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.InterleaverSize, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CoreSetType, end) && - pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.ShiftIndex, end) && - pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.precoderGranularity, end) && - pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.numDlDci, end)); - -} - -static uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t *)msg; - - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->numPdus, end) - )) - return 0; - - for(int i=0; i< pNfapiMsg->numPdus; i++) { - if (!unpack_ul_dci_pdu_list_value(ppReadPackedMsg, end, &pNfapiMsg->ul_dci_pdu_list[i])) - return 0; - } - - return 1; -} - -static uint8_t unpack_hi_dci0_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_hi_dci0_request_t *pNfapiMsg = (nfapi_hi_dci0_request_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_HI_DCI0_REQUEST_BODY_TAG, &pNfapiMsg->hi_dci0_request_body, &unpack_hi_dci0_request_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} -static uint8_t unpack_tx_data_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { - nfapi_nr_pdu_t *pNfapiMsg = (nfapi_nr_pdu_t *)msg; - - if(!(pull32(ppReadPackedMsg, &pNfapiMsg->num_TLV, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->PDU_index, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->PDU_length, end) - )) - return 0; - - uint16_t i = 0; - uint16_t total_number_of_tlvs = pNfapiMsg->num_TLV; - - for(; i < total_number_of_tlvs; ++i) { - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->TLVs[i].length, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->TLVs[i].tag, end))) - return 0; - - switch(pNfapiMsg->TLVs[i].tag) { - case 0: { - if(!pullarray32(ppReadPackedMsg, pNfapiMsg->TLVs[i].value.direct, 16384, pNfapiMsg->TLVs[i].length, end)) - return 0; - - break; - } - - case 1: { - if(!pullarray32(ppReadPackedMsg, pNfapiMsg->TLVs[i].value.ptr, pNfapiMsg->TLVs[i].length, pNfapiMsg->TLVs[i].length, end)) - return 0; - - break; - } - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid tag value %d \n", pNfapiMsg->TLVs[i].tag ); - break; - } - } - } - - return 1; -} - -static uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t *)msg; - - if(!(pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->Number_of_PDUs, end))) - return 0; - - for(int i=0; i< pNfapiMsg->Number_of_PDUs; i++) { - if (!unpack_tx_data_pdu_list_value(ppReadPackedMsg, end, &pNfapiMsg->pdu_list[i])) - return 0; - } - - return 1; -} - -static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - uint8_t proceed = 1; - nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t *)msg; - - if(pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) == 0) - return 0; - - while (((uint8_t *)(*ppReadPackedMsg) < end) && proceed) { - nfapi_tl_t generic_tl; - - if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) - return 0; - - switch(generic_tl.tag) { - case NFAPI_TX_REQUEST_BODY_TAG: { - pNfapiMsg->tx_request_body.tl = generic_tl; - - if( pull16(ppReadPackedMsg, &pNfapiMsg->tx_request_body.number_of_pdus, end) == 0) - return 0; - - if(pNfapiMsg->tx_request_body.number_of_pdus > NFAPI_TX_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of tx pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, pNfapiMsg->tx_request_body.number_of_pdus, NFAPI_TX_MAX_PDU); - return 0; - } - - if(pNfapiMsg->tx_request_body.number_of_pdus > 0) { - pNfapiMsg->tx_request_body.tx_pdu_list = (nfapi_tx_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_tx_request_pdu_t) * pNfapiMsg->tx_request_body.number_of_pdus, config); - - if(pNfapiMsg->tx_request_body.tx_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate tx pdu list (count:%d)\n", __FUNCTION__, pNfapiMsg->tx_request_body.number_of_pdus); - return 0; - } - } else { - pNfapiMsg->tx_request_body.tx_pdu_list = 0; - } - - uint16_t i; - uint16_t totalNumPdus = pNfapiMsg->tx_request_body.number_of_pdus; - - for(i = 0; i < totalNumPdus; ++i) { - nfapi_tx_request_pdu_t *pdu = &(pNfapiMsg->tx_request_body.tx_pdu_list[i]); - - if (pdu) { - uint16_t length = 0; - uint16_t index = 0; - - if(!(pull16(ppReadPackedMsg, &length, end) && - pull16(ppReadPackedMsg, &index, end))) - return 0; - - pdu->pdu_length = length; - pdu->pdu_index = index; - // TODO : May need to rethink this bit - pdu->num_segments = 1; - pdu->segments[0].segment_length = pdu->pdu_length; - pdu->segments[0].segment_data = nfapi_p7_allocate(pdu->pdu_length, config); - - if(pdu->segments[0].segment_data) { - if(!pullarray8(ppReadPackedMsg, pdu->segments[0].segment_data, pdu->segments[0].segment_length, pdu->segments[0].segment_length, end)) - return 0; - - if (pdu->segments[0].segment_length == 3) { - NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, - pdu->segments[0].segment_data[0], - pdu->segments[0].segment_data[1], - pdu->segments[0].segment_data[2] - ); - } - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_tx_request: Failed to allocate pdu (len:%d) %d/%d %d\n", pdu->pdu_length, totalNumPdus, i, pdu->pdu_index); - } - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "NULL pdu\n"); - } - } - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_tx_request FIXME : Invalid pdu type %d \n", generic_tl.tag ); - } - break; - }; - } - - return 1; -} - -//UNPACK NR UPLINK INDICATION FUNCTIONS - -//SLOT INDICATION - -static uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_slot_indication_scf_t *msg, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_slot_indication_scf_t *pNfapiMsg = (nfapi_nr_slot_indication_scf_t*)msg; - - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) - )) - return 0; - -return 1; -} - -//RX DATA INDICATION - -static uint8_t unpack_nr_rx_data_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) -{ - nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv; - - if(!(pull32(ppReadPackedMsg, &value->handle, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->harq_id, end) && - pull16(ppReadPackedMsg, &value->pdu_length, end) && - pull8(ppReadPackedMsg, &value->ul_cqi, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end) && - pull16(ppReadPackedMsg, &value->rssi, end) - )) - return 0; - return 1; -} - - -static uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_rx_data_indication_t *msg, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t*)msg; - - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end) - )) - return 0; - - for(int i=0; inumber_of_pdus;i++) - { - if(!unpack_nr_rx_data_indication_body(pNfapiMsg->pdu_list, ppReadPackedMsg, end)) - return 0; - } - -return 1; -} - -//NR CRC INDICATION - -static uint8_t unpack_nr_crc_indication_body(nfapi_nr_crc_t* value, uint8_t **ppReadPackedMsg, uint8_t *end) -{ - if(!(pull32(ppReadPackedMsg, &value->handle, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->harq_id, end) && - pull8(ppReadPackedMsg, &value->tb_crc_status, end) && - pull16(ppReadPackedMsg, &value->num_cb, end) && - //pullarray8(ppReadPackedMsg, value->cb_crc_status, (int)(value->num_cb / 8) + 1, (int)(value->num_cb / 8) + 1, end) && //length is ceil(NumCb/8) - pull8(ppReadPackedMsg, &value->ul_cqi, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end) && - pull16(ppReadPackedMsg, &value->rssi, end) - )) - return 0; - - //memcpy((nfapi_nr_crc_t *)tlv,value,sizeof(nfapi_nr_crc_t)); - - return 1; -} - -static uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_crc_indication_t *msg, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t *) msg; - // pNfapiMsg = (nfapi_nr_crc_indication_t *) malloc(sizeof(nfapi_nr_crc_indication_t)); - // pNfapiMsg->crc_list = (nfapi_nr_crc_t *) malloc(sizeof(nfapi_nr_crc_t)); - - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->slot, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->number_crcs, end) - )) - return 0; - - for(int i=0; inumber_crcs;i++) - { - if(!unpack_nr_crc_indication_body(pNfapiMsg->crc_list,ppReadPackedMsg,end)) - //if(!unpack_nr_crc_indication_body(value,ppReadPackedMsg,end)) - return 0; - } - -return 1; -} - -//SRS INDICATION - -static uint8_t unpack_nr_srs_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) -{ - nfapi_nr_srs_indication_pdu_t* value = (nfapi_nr_srs_indication_pdu_t*)tlv; - - if(!(pull32(ppReadPackedMsg, &value->handle, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end) && - pull8(ppReadPackedMsg, &value->num_symbols, end) && - pull8(ppReadPackedMsg, &value->wide_band_snr, end) && - pull8(ppReadPackedMsg, &value->num_reported_symbols, end) && - pull16(ppReadPackedMsg, &value->reported_symbol_list->num_rbs, end) - )) - return 0; - for(int i = 0; i < value->reported_symbol_list->num_rbs; i++) - { - if(!(pull8(ppReadPackedMsg, &value->reported_symbol_list->rb_list->rb_snr, end) - )) - return 0; - } - return 1; -} - -static uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t*)msg; - - if (!(pull16(ppReadPackedMsg,&pNfapiMsg->sfn , end) && - pull16(ppReadPackedMsg,&pNfapiMsg->slot , end) && - pull8(ppReadPackedMsg,&pNfapiMsg->number_of_pdus, end) - )) - return 0; - - for(int i=0; inumber_of_pdus;i++) - { - if(!unpack_nr_srs_indication_body(&pNfapiMsg->pdu_list,ppReadPackedMsg,end)) - return 0; - } - -return 1; -} - -//NR RACH - -static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) -{ - nfapi_nr_prach_indication_pdu_t* value = (nfapi_nr_prach_indication_pdu_t*)tlv; - - if(!(pull16(ppReadPackedMsg, &value->phy_cell_id, end) && - pull8(ppReadPackedMsg, &value->symbol_index, end) && - pull8(ppReadPackedMsg, &value->slot_index, end) && - pull8(ppReadPackedMsg, &value->freq_index, end) && - pull8(ppReadPackedMsg, &value->avg_rssi, end) && - pull8(ppReadPackedMsg, &value->avg_snr, end) && - pull8(ppReadPackedMsg, &value->num_preamble, end) - )) - return 0; - value->preamble_list = (nfapi_nr_prach_indication_preamble_t*) malloc(sizeof(nfapi_nr_prach_indication_preamble_t) * value->num_preamble); - for(int i = 0; i < value->num_preamble; i++) - { - if(!(pull8(ppReadPackedMsg, &value->preamble_list->preamble_index, end) && - pull16(ppReadPackedMsg, &value->preamble_list->timing_advance, end) && - pull32(ppReadPackedMsg, &value->preamble_list->preamble_pwr, end) - )) - return 0; - } - return 1; -} - -static uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_rach_indication_t* msg, nfapi_p7_codec_config_t* config) { - - nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t*)msg; - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) && - pull8(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end) - )) - return 0; - pNfapiMsg->pdu_list = (nfapi_nr_prach_indication_pdu_t*) malloc(sizeof(nfapi_nr_prach_indication_pdu_t) * pNfapiMsg->number_of_pdus); - for(int i=0; i< pNfapiMsg->number_of_pdus;i++) - { - if(!unpack_nr_rach_indication_body(pNfapiMsg->pdu_list,ppReadPackedMsg,end)) - return 0; - } - -return 1; -} - -//NR UCI - -static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_uci_pucch_pdu_format_0_1_t* value = (nfapi_nr_uci_pucch_pdu_format_0_1_t*)tlv; - - // uint8_t *ptr = *ppReadPackedMsg; - // printf("\n Read P7 message uci_0_1 indication unpack: "); - // while(ptr < end){ - // printf(" %d ", *ptr); - // ptr++; - // } - // printf("\n"); - - if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && - pull32(ppReadPackedMsg, &value->handle, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->pucch_format, end) && - pull8(ppReadPackedMsg, &value->ul_cqi, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end) && - pull16(ppReadPackedMsg, &value->rssi, end) - )) - return 0; - if (value->pduBitmap & 0x01) { //SR - value->sr = (nfapi_nr_sr_pdu_0_1_t*) malloc(sizeof(nfapi_nr_sr_pdu_0_1_t)); - if(!(pull8(ppReadPackedMsg, &value->sr->sr_indication, end) && - pull8(ppReadPackedMsg, &value->sr->sr_confidence_level, end) - )) - return 0; - } - - if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - value->harq = (nfapi_nr_harq_pdu_0_1_t*) malloc(sizeof(nfapi_nr_harq_pdu_0_1_t)); - if(!(pull8(ppReadPackedMsg, &value->harq->num_harq, end) && - pull8(ppReadPackedMsg, &value->harq->harq_confidence_level, end) - )) - return 0; - value->harq->harq_list = (nfapi_nr_harq_t*) malloc(sizeof(nfapi_nr_harq_t*) * value->harq->num_harq); - for(int i=0; iharq->num_harq;i++) - { - if(!(pull8(ppReadPackedMsg, &value->harq->harq_list->harq_value, end) - )) - return 0; - } - } - - return 1; -} - - -static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; - - if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && - pull32(ppReadPackedMsg, &value->handle, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->pucch_format, end) && - pull8(ppReadPackedMsg, &value->ul_cqi, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end) && - pull16(ppReadPackedMsg, &value->rssi, end) - )) - return 0; - if (value->pduBitmap & 0x01) { //SR - if(!(pull16(ppReadPackedMsg, &value->sr.sr_bit_len, end))) - return 0; - - value->sr.sr_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->sr.sr_bit_len/8))); - - if(!(pullarray8(ppReadPackedMsg, &value->sr.sr_payload[0], (int)(value->sr.sr_bit_len / 8), (int)(value->sr.sr_bit_len / 8), end))) - return 0; - } - - if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - if(!(pull8(ppReadPackedMsg, &value->harq.harq_crc, end)) && - (pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end))) - return 0; - - value->harq.harq_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->harq.harq_bit_len/8 ))); - - if(!(pullarray8(ppReadPackedMsg, value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8), (int)(value->harq.harq_bit_len / 8), end))) - return 0; - } - - if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1 - if(!(pull8(ppReadPackedMsg, &value->csi_part1.csi_part1_crc, end)) && - (pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end))) - return 0; - - value->csi_part1.csi_part1_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->csi_part1.csi_part1_bit_len/8))); - -// if(!(pullarray8(ppReadPackedMsg, value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8), (int)(value->csi_part1.csi_part1_bit_len / 8), end))) -// return 0; - } - - if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2 - if(!(pull8(ppReadPackedMsg, &value->csi_part2.csi_part2_crc, end)) && - (pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end))) - return 0; - - value->csi_part2.csi_part2_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->csi_part2.csi_part2_bit_len/8 ))); - - if(!(pullarray8(ppReadPackedMsg, value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) , (int)(value->csi_part2.csi_part2_bit_len / 8) , end))) - return 0; - } - - return 1; -} - -static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t* value, uint8_t **ppReadPackedMsg, uint8_t *end) -{ - if(!(pull16(ppReadPackedMsg, &value->pdu_type, end) && - pull16(ppReadPackedMsg, &value->pdu_size, end) - )) - return 0; - - switch (value->pdu_type) { - case NFAPI_NR_UCI_PUSCH_PDU_TYPE: - printf("Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n"); - break; - - case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { - nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu = &value->pucch_pdu_format_0_1; - unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end); - break; - } - case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4; - unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end); - break; - } - } - - return 1; -} - -static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) -{ - nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg; - - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->num_ucis, end) - )) - return 0; - - for(int i=0; inum_ucis;i++) - { - if(!unpack_nr_uci_indication_body(pNfapiMsg->uci_list,ppReadPackedMsg,end)) - return 0; - } - -return 1; -} - -static uint8_t unpack_ue_release_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - uint8_t proceed = 1; - nfapi_ue_release_request_t *pNfapiMsg = (nfapi_ue_release_request_t *)msg; - - if(pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) == 0) - return 0; - - while (((uint8_t *)(*ppReadPackedMsg) < end) && proceed) { - nfapi_tl_t generic_tl; - - if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) - return 0; - - switch(generic_tl.tag) { - case NFAPI_UE_RELEASE_BODY_TAG: { - pNfapiMsg->ue_release_request_body.tl = generic_tl; - - if( pull16(ppReadPackedMsg, &pNfapiMsg->ue_release_request_body.number_of_TLVs, end) == 0) - return 0; - - if(pNfapiMsg->ue_release_request_body.number_of_TLVs > NFAPI_RELEASE_MAX_RNTI) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of relese rnti's exceed maxium (count:%d max:%d)\n", __FUNCTION__, pNfapiMsg->ue_release_request_body.number_of_TLVs, NFAPI_RELEASE_MAX_RNTI); - return 0; - } else { - uint8_t j; - uint16_t num = pNfapiMsg->ue_release_request_body.number_of_TLVs; - - for(j = 0; j < num; ++j) { - if(pull16(ppReadPackedMsg, &pNfapiMsg->ue_release_request_body.ue_release_request_TLVs_list[j].rnti, end) == 0) { - return 0; - } - } - } - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_ue_release_request FIXME : Invalid type %d \n", generic_tl.tag ); - } - break; - }; - } - - return 1; -} - -static uint8_t unpack_harq_indication_tdd_harq_data_bundling(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_harq_data_bundling_t *value = (nfapi_harq_indication_tdd_harq_data_bundling_t *)tlv; - return (pull8(ppReadPackedMsg, &value->value_0, end) && - pull8(ppReadPackedMsg, &value->value_1, end)); -} - -static uint8_t unpack_harq_indication_tdd_harq_data_multiplexing(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_harq_data_multiplexing_t *value = (nfapi_harq_indication_tdd_harq_data_multiplexing_t *)tlv; - return (pull8(ppReadPackedMsg, &value->value_0, end) && - pull8(ppReadPackedMsg, &value->value_1, end) && - pull8(ppReadPackedMsg, &value->value_2, end) && - pull8(ppReadPackedMsg, &value->value_3, end)); -} -static uint8_t unpack_harq_indication_tdd_harq_data_special_bundling(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_harq_data_special_bundling_t *value = (nfapi_harq_indication_tdd_harq_data_special_bundling_t *)tlv; - return ( pull8(ppReadPackedMsg, &value->value_0, end)); -} -static uint8_t unpack_harq_indication_tdd_harq_data(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_harq_data_t *value = (nfapi_harq_indication_tdd_harq_data_t *)tlv; - return (pull8(ppReadPackedMsg, &value->value_0, end)); -} - -static uint8_t unpack_harq_indication_tdd_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_rel8_t *value = (nfapi_harq_indication_tdd_rel8_t *)tlv; - - if(!(pull8(ppReadPackedMsg, &value->mode, end) && - pull8(ppReadPackedMsg, &value->number_of_ack_nack, end))) - return 0; - - uint8_t result = 0; - - switch(value->mode) { - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: - result = unpack_harq_indication_tdd_harq_data_bundling(&value->harq_data.bundling, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: - result = unpack_harq_indication_tdd_harq_data_multiplexing(&value->harq_data.multiplex, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: - result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data.special_bundling, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: - result = 1; - break; - - default: - // TODO add error message - return 0; - break; - } - - return result; -} - -static uint8_t unpack_harq_indication_tdd_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_rel9_t *value = (nfapi_harq_indication_tdd_rel9_t *)tlv; - - if(!(pull8(ppReadPackedMsg, &value->mode, end) && - pull8(ppReadPackedMsg, &value->number_of_ack_nack, end))) - return 0; - - if(value->number_of_ack_nack > NFAPI_MAX_NUMBER_ACK_NACK_TDD) { - // TODO : add error message - return 0; - } - - uint16_t idx = 0; - - for(idx = 0; idx < value->number_of_ack_nack; ++idx) { - uint8_t result = 0; - - switch(value->mode) { - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].bundling, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].multiplex, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: - result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data[idx].special_bundling, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].channel_selection, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_3, ppReadPackedMsg, end); - break; - - default: - // TODO add error message - return 0; - break; - } - - if(result == 0) - return 0; - } - - return 1; -} - -static uint8_t unpack_harq_indication_tdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_tdd_rel13_t *value = (nfapi_harq_indication_tdd_rel13_t *)tlv; - - if(!(pull8(ppReadPackedMsg, &value->mode, end) && - pull16(ppReadPackedMsg, &value->number_of_ack_nack, end))) - return 0; - - if(value->number_of_ack_nack > NFAPI_MAX_NUMBER_ACK_NACK_TDD) { - // TODO : add error message - return 0; - } - - uint16_t idx = 0; - - for(idx = 0; idx < value->number_of_ack_nack; ++idx) { - uint8_t result = 0; - - switch(value->mode) { - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].bundling, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].multiplex, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: - result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data[idx].special_bundling, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].channel_selection, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_3, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_4, ppReadPackedMsg, end); - break; - - case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5: - result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_5, ppReadPackedMsg, end); - break; - - default: - // TODO add error message - return 0; - break; - } - - if(result == 0) - return 0; - } - - return 1; -} - -static uint8_t unpack_harq_indication_fdd_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_fdd_rel8_t *value = (nfapi_harq_indication_fdd_rel8_t *)tlv; - return (pull8(ppReadPackedMsg, &value->harq_tb1, end) && - pull8(ppReadPackedMsg, &value->harq_tb2, end)); -} - -static uint8_t unpack_harq_indication_fdd_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_fdd_rel9_t *value = (nfapi_harq_indication_fdd_rel9_t *)tlv; - return (pull8(ppReadPackedMsg, &value->mode, end) && - pull8(ppReadPackedMsg, &value->number_of_ack_nack, end) && - pullarray8(ppReadPackedMsg, value->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL9_MAX, value->number_of_ack_nack, end)); -} - -static uint8_t unpack_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_harq_indication_fdd_rel13_t *value = (nfapi_harq_indication_fdd_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &value->mode, end) && - pull16(ppReadPackedMsg, &value->number_of_ack_nack, end) && - pullarray8(ppReadPackedMsg, value->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL13_MAX, value->number_of_ack_nack, end)); -} - -static uint8_t unpack_ul_cqi_information_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_ul_cqi_information_t *value = (nfapi_ul_cqi_information_t *)tlv; - return (pull8(ppReadPackedMsg, &value->ul_cqi, end) && - pull8(ppReadPackedMsg, &value->channel, end)); -} - - - -static uint8_t unpack_harq_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_harq_indication_body_t *value = (nfapi_harq_indication_body_t *)tlv; - uint8_t *harqBodyEnd = *ppReadPackedMsg + value->tl.length; - - if(harqBodyEnd > end) - return 0; - - if(pull16(ppReadPackedMsg, &value->number_of_harqs, end) == 0) - return 0; - - if(value->number_of_harqs > NFAPI_HARQ_IND_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of harq ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_harqs, NFAPI_HARQ_IND_MAX_PDU); - return 0; - } - - value->harq_pdu_list = (nfapi_harq_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_harq_indication_pdu_t) * value->number_of_harqs, config); - - if(value->harq_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate harq ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_harqs); - return 0; - } - - uint8_t i = 0; - - for(i = 0; i < value->number_of_harqs; ++i) { - nfapi_harq_indication_pdu_t *pdu = &(value->harq_pdu_list[i]); - - if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) - return 0; - - uint8_t *harqPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; - unpack_tlv_t unpack_fns[] = { - { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, - { NFAPI_HARQ_INDICATION_TDD_REL8_TAG, &pdu->harq_indication_tdd_rel8, &unpack_harq_indication_tdd_rel8_value}, - { NFAPI_HARQ_INDICATION_TDD_REL9_TAG, &pdu->harq_indication_tdd_rel9, &unpack_harq_indication_tdd_rel9_value}, - { NFAPI_HARQ_INDICATION_TDD_REL13_TAG, &pdu->harq_indication_tdd_rel13, &unpack_harq_indication_tdd_rel13_value}, - { NFAPI_HARQ_INDICATION_FDD_REL8_TAG, &pdu->harq_indication_fdd_rel8, &unpack_harq_indication_fdd_rel8_value}, - { NFAPI_HARQ_INDICATION_FDD_REL9_TAG, &pdu->harq_indication_fdd_rel9, &unpack_harq_indication_fdd_rel9_value}, - { NFAPI_HARQ_INDICATION_FDD_REL13_TAG, &pdu->harq_indication_fdd_rel13, &unpack_harq_indication_fdd_rel13_value}, - { NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, &unpack_ul_cqi_information_value} - }; - - if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, harqPduInstanceEnd, 0, 0) == 0) - return 0; - } - - return 1; -} - -static uint8_t unpack_harq_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_harq_indication_t *pNfapiMsg = (nfapi_harq_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->harq_indication_body, &unpack_harq_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_crc_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_crc_indication_rel8_t *crc_pdu_rel8 = (nfapi_crc_indication_rel8_t *)tlv; - return ( pull8(ppReadPackedMsg, &crc_pdu_rel8->crc_flag, end) ); -} - -static uint8_t unpack_crc_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_crc_indication_body_t *value = (nfapi_crc_indication_body_t *)tlv; - uint8_t *crcBodyEnd = *ppReadPackedMsg + value->tl.length; - - if(crcBodyEnd > end) - return 0; - - if(pull16(ppReadPackedMsg, &value->number_of_crcs, end) == 0) - return 0; - - if(value->number_of_crcs > NFAPI_CRC_IND_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of crc ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_crcs, NFAPI_CRC_IND_MAX_PDU); - return 0; - } - - if(value->number_of_crcs > 0) { - value->crc_pdu_list = (nfapi_crc_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_crc_indication_pdu_t) * value->number_of_crcs, config); - - if(value->crc_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate crc ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_crcs); - return 0; - } - } else { - value->crc_pdu_list = 0; - } - - uint8_t i = 0; - - for(i = 0; i < value->number_of_crcs; ++i) { - nfapi_crc_indication_pdu_t *pdu = &(value->crc_pdu_list[i]); - - if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) - return 0; - - uint8_t *crcPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; - unpack_tlv_t unpack_fns[] = { - { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, - { NFAPI_CRC_INDICATION_REL8_TAG, &pdu->crc_indication_rel8, unpack_crc_indication_rel8_value }, - }; - - if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, crcPduInstanceEnd, 0, 0) == 0) - return 0; - } - - return 1; -} - -static uint8_t unpack_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_crc_indication_t *pNfapiMsg = (nfapi_crc_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_CRC_INDICATION_BODY_TAG, &pNfapiMsg->crc_indication_body, &unpack_crc_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_rx_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_rx_indication_rel8_t *value = (nfapi_rx_indication_rel8_t *)tlv; - return (pull16(ppReadPackedMsg, &value->length, end) && - pull16(ppReadPackedMsg, &value->offset, end) && - pull8(ppReadPackedMsg, &value->ul_cqi, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end)); -} -static uint8_t unpack_rx_indication_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_rx_indication_rel9_t *value = (nfapi_rx_indication_rel9_t *)tlv; - return (pull16(ppReadPackedMsg, &value->timing_advance_r9, end)); -} - -static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_rx_indication_body_t *value = (nfapi_rx_indication_body_t *)tlv; - // the rxBodyEnd points to the end of the cqi PDU's - uint8_t *rxBodyEnd = *ppReadPackedMsg + value->tl.length; - uint8_t *rxPduEnd = rxBodyEnd; - uint8_t *numberOfPdusAddress = *ppReadPackedMsg; - - if(rxBodyEnd > end) { - // pdu end is past buffer end - return 0; - } - - if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0) - return 0; - - if(value->number_of_pdus > NFAPI_RX_IND_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of rx ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_RX_IND_MAX_PDU); - return 0; - } - - if(value->number_of_pdus > 0) { - value->rx_pdu_list = (nfapi_rx_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_rx_indication_pdu_t) * value->number_of_pdus, config); - - if(value->rx_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate rx ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus); - return 0; - } - } else { - value->rx_pdu_list = 0; - } - - uint8_t i = 0; - nfapi_rx_indication_pdu_t *pdu = 0; - - while((uint8_t *)(*ppReadPackedMsg) < rxBodyEnd && (uint8_t *)(*ppReadPackedMsg) < rxPduEnd) { - nfapi_tl_t generic_tl; - - if( unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) - return 0; - - switch(generic_tl.tag) { - case NFAPI_RX_UE_INFORMATION_TAG: { - pdu = &(value->rx_pdu_list[i++]); - pdu->rx_ue_information.tl = generic_tl; - - if(unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0) - return 0; - } - break; - - case NFAPI_RX_INDICATION_REL8_TAG: { - if(pdu != 0) { - pdu->rx_indication_rel8.tl = generic_tl; - - if(unpack_rx_indication_rel8_value(&pdu->rx_indication_rel8, ppReadPackedMsg, end) == 0) - return 0; - - if(pdu->rx_indication_rel8.offset > 0) { - // Need to check that the data is within the tlv - if(numberOfPdusAddress + pdu->rx_indication_rel8.offset + pdu->rx_indication_rel8.length <= rxBodyEnd) { - // If this the first pdu set the rxPduEnd - if(numberOfPdusAddress + pdu->rx_indication_rel8.offset < rxPduEnd) { - rxPduEnd = numberOfPdusAddress + pdu->rx_indication_rel8.offset; - - if(rxPduEnd > end) { - // pdu end is past buffer end - return 0; - } - } - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME: the rx data is outside of the tlv\n"); - } - } - } - } - break; - - case NFAPI_RX_INDICATION_REL9_TAG: { - if(pdu != 0) { - pdu->rx_indication_rel9.tl = generic_tl; - - if(unpack_rx_indication_rel9_value(&pdu->rx_indication_rel9, ppReadPackedMsg, end) == 0) - return 0; - } - } - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "RX_ULSCH.indication Invalid pdu type %d \n", generic_tl.tag ); - } - break; - } - } - - uint8_t idx = 0; - - for(idx = 0; idx < value->number_of_pdus; ++idx) { - if(value->rx_pdu_list[idx].rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) { - uint32_t length = value->rx_pdu_list[idx].rx_indication_rel8.length; - value->rx_pdu_list[idx].data = nfapi_p7_allocate(length, config); - - if(pullarray8(ppReadPackedMsg, value->rx_pdu_list[idx].data, length, length, end) == 0) { - return 0; - } - } - } - - return 1; -} - -static uint8_t unpack_rx_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_rx_indication_t *pNfapiMsg = (nfapi_rx_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_RX_INDICATION_BODY_TAG, &pNfapiMsg->rx_indication_body, &unpack_rx_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_preamble_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_preamble_pdu_rel8_t *preamble_pdu_rel8 = (nfapi_preamble_pdu_rel8_t *)tlv; - return (pull16(ppReadPackedMsg, &preamble_pdu_rel8->rnti, end) && - pull8(ppReadPackedMsg, &preamble_pdu_rel8->preamble, end) && - pull16(ppReadPackedMsg, &preamble_pdu_rel8->timing_advance, end)); -} - -static uint8_t unpack_preamble_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_preamble_pdu_rel9_t *preamble_pdu_rel9 = (nfapi_preamble_pdu_rel9_t *)tlv; - return pull16(ppReadPackedMsg, &preamble_pdu_rel9->timing_advance_r9, end); -} - -static uint8_t unpack_preamble_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_preamble_pdu_rel13_t *preamble_pdu_rel13 = (nfapi_preamble_pdu_rel13_t *)tlv; - return pull8(ppReadPackedMsg, &preamble_pdu_rel13->rach_resource_type, end); -} - -static uint8_t unpack_rach_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_rach_indication_body_t *value = (nfapi_rach_indication_body_t *)tlv; - uint8_t *rachBodyEnd = *ppReadPackedMsg + value->tl.length; - - if(rachBodyEnd > end) - return 0; - - if(pull16(ppReadPackedMsg, &value->number_of_preambles, end) == 0) - return 0; - - if(value->number_of_preambles > NFAPI_PREAMBLE_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of preamble du's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_preambles, NFAPI_PREAMBLE_MAX_PDU); - return 0; - } - - if(value->number_of_preambles > 0) { - value->preamble_list = (nfapi_preamble_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_preamble_pdu_t) * value->number_of_preambles, config); - - if(value->preamble_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate preamble pdu list (count:%d)\n", __FUNCTION__, value->number_of_preambles); - return 0; - } - } else { - value->preamble_list = 0; - } - - uint8_t i = 0; - - for(i = 0; i < value->number_of_preambles; ++i) { - nfapi_preamble_pdu_t *pdu = &(value->preamble_list[i]); - - if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) - return 0; - - uint8_t *preamblePduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; - unpack_tlv_t unpack_fns[] = { - { NFAPI_PREAMBLE_REL8_TAG, &pdu->preamble_rel8, unpack_preamble_pdu_rel8_value }, - { NFAPI_PREAMBLE_REL9_TAG, &pdu->preamble_rel9, unpack_preamble_pdu_rel9_value }, - { NFAPI_PREAMBLE_REL13_TAG, &pdu->preamble_rel13, unpack_preamble_pdu_rel13_value }, - }; - - if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, preamblePduInstanceEnd, 0, 0) == 0) - return 0; - } - - return 1; -} - -static uint8_t unpack_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_rach_indication_t *pNfapiMsg = (nfapi_rach_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_RACH_INDICATION_BODY_TAG, &pNfapiMsg->rach_indication_body, &unpack_rach_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_srs_indication_fdd_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_srs_indication_fdd_rel8_t *srs_pdu_fdd_rel8 = (nfapi_srs_indication_fdd_rel8_t *)tlv; - - if(!(pull16(ppReadPackedMsg, &srs_pdu_fdd_rel8->doppler_estimation, end) && - pull16(ppReadPackedMsg, &srs_pdu_fdd_rel8->timing_advance, end) && - pull8(ppReadPackedMsg, &srs_pdu_fdd_rel8->number_of_resource_blocks, end) && - pull8(ppReadPackedMsg, &srs_pdu_fdd_rel8->rb_start, end) && - pullarray8(ppReadPackedMsg, srs_pdu_fdd_rel8->snr, NFAPI_NUM_RB_MAX, srs_pdu_fdd_rel8->number_of_resource_blocks, end))) - return 0; - - return 1; -} - -static uint8_t unpack_srs_indication_fdd_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_srs_indication_fdd_rel9_t *srs_pdu_fdd_rel9 = (nfapi_srs_indication_fdd_rel9_t *)tlv; - return (pull16(ppReadPackedMsg, &srs_pdu_fdd_rel9->timing_advance_r9, end)); -} - -static uint8_t unpack_srs_indication_tdd_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_srs_indication_ttd_rel10_t *srs_pdu_tdd_rel10 = (nfapi_srs_indication_ttd_rel10_t *)tlv; - return (pull8(ppReadPackedMsg, &srs_pdu_tdd_rel10->uppts_symbol, end)); -} - -static uint8_t unpack_srs_indication_fdd_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_srs_indication_fdd_rel11_t *srs_pdu_fdd_rel11 = (nfapi_srs_indication_fdd_rel11_t *)tlv; - return ( pull16(ppReadPackedMsg, &srs_pdu_fdd_rel11->ul_rtoa, end)); -} - -static uint8_t unpack_tdd_channel_measurement_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_tdd_channel_measurement_t *value = (nfapi_tdd_channel_measurement_t *)tlv; - - if(!(pull8(ppReadPackedMsg, &value->num_prb_per_subband, end) && - pull8(ppReadPackedMsg, &value->number_of_subbands, end) && - pull8(ppReadPackedMsg, &value->num_atennas, end))) - return 0; - - if(value->number_of_subbands > NFAPI_MAX_NUM_SUBBANDS) { - // todo : add error - return 0; - } - - if(value->num_atennas > NFAPI_MAX_NUM_PHYSICAL_ANTENNAS) { - // todo : add error - return 0; - } - - uint8_t idx = 0; - - for(idx = 0; idx < value->number_of_subbands; ++idx) { - if(!(pull8(ppReadPackedMsg, &value->subands[idx].subband_index, end) && - pullarray16(ppReadPackedMsg, value->subands[idx].channel, NFAPI_MAX_NUM_PHYSICAL_ANTENNAS, value->num_atennas, end))) - return 0; - } - - return 1; -} - - -static uint8_t unpack_srs_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_srs_indication_body_t *value = (nfapi_srs_indication_body_t *)tlv; - uint8_t *srsBodyEnd = *ppReadPackedMsg + value->tl.length; - - if(srsBodyEnd > end) - return 0; - - if(pull8(ppReadPackedMsg, &value->number_of_ues, end) == 0) - return 0; - - if(value->number_of_ues > NFAPI_SRS_IND_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of srs ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_ues, NFAPI_SRS_IND_MAX_PDU); - return 0; - } - - if(value->number_of_ues > 0) { - value->srs_pdu_list = (nfapi_srs_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_srs_indication_pdu_t) * value->number_of_ues, config); - - if(value->srs_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate srs ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_ues); - return 0; - } - } else { - value->srs_pdu_list = 0; - } - - uint8_t i = 0; - - for(i = 0; i < value->number_of_ues; ++i) { - nfapi_srs_indication_pdu_t *pdu = &(value->srs_pdu_list[i]); - - if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) - return 0; - - uint8_t *srsPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; - unpack_tlv_t unpack_fns[] = { - { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, - { NFAPI_SRS_INDICATION_FDD_REL8_TAG, &pdu->srs_indication_fdd_rel8, unpack_srs_indication_fdd_rel8_value}, - { NFAPI_SRS_INDICATION_FDD_REL9_TAG, &pdu->srs_indication_fdd_rel9, unpack_srs_indication_fdd_rel9_value}, - { NFAPI_SRS_INDICATION_TDD_REL10_TAG, &pdu->srs_indication_tdd_rel10, unpack_srs_indication_tdd_rel10_value}, - { NFAPI_SRS_INDICATION_FDD_REL11_TAG, &pdu->srs_indication_fdd_rel11, unpack_srs_indication_fdd_rel11_value}, - { NFAPI_TDD_CHANNEL_MEASUREMENT_TAG, &pdu->tdd_channel_measurement, unpack_tdd_channel_measurement_value}, - }; - - if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, srsPduInstanceEnd, 0, 0) == 0) - return 0; - } - - return 1; -} - -static uint8_t unpack_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_srs_indication_t *pNfapiMsg = (nfapi_srs_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_SRS_INDICATION_BODY_TAG, &pNfapiMsg->srs_indication_body, &unpack_srs_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - - -static uint8_t unpack_sr_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_sr_indication_body_t *value = (nfapi_sr_indication_body_t *)tlv; - uint8_t *srBodyEnd = *ppReadPackedMsg + value->tl.length; - - if(srBodyEnd > end) - return 0; - - if(pull16(ppReadPackedMsg, &value->number_of_srs, end) == 0) - return 0; - - if(value->number_of_srs > NFAPI_SR_IND_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of sr ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_srs, NFAPI_SR_IND_MAX_PDU); - return 0; - } - - if(value->number_of_srs > 0) { - value->sr_pdu_list = (nfapi_sr_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_sr_indication_pdu_t) * value->number_of_srs, config); - - if(value->sr_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate sr ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_srs); - return 0; - } - } else { - value->sr_pdu_list = 0; - } - - uint8_t i = 0; - - for(i = 0; i < value->number_of_srs; ++i) { - nfapi_sr_indication_pdu_t *pdu = &(value->sr_pdu_list[i]); - - if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) - return 0; - - uint8_t *srPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; - unpack_tlv_t unpack_fns[] = { - { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, - { NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, unpack_ul_cqi_information_value }, - }; - - if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, srPduInstanceEnd, 0, 0) == 0) - return 0; - } - - return 1; -} - -static int unpack_sr_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_sr_indication_t *pNfapiMsg = (nfapi_sr_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_SR_INDICATION_BODY_TAG, &pNfapiMsg->sr_indication_body, &unpack_sr_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} -static uint8_t unpack_cqi_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_cqi_indication_rel8_t *cqi_pdu_rel8 = (nfapi_cqi_indication_rel8_t *)tlv; - return (pull16(ppReadPackedMsg, &cqi_pdu_rel8->length, end) && - pull16(ppReadPackedMsg, &cqi_pdu_rel8->data_offset, end) && - pull8(ppReadPackedMsg, &cqi_pdu_rel8->ul_cqi, end) && - pull8(ppReadPackedMsg, &cqi_pdu_rel8->ri, end) && - pull16(ppReadPackedMsg, &cqi_pdu_rel8->timing_advance, end)); -} - -static uint8_t unpack_cqi_indication_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_cqi_indication_rel9_t *cqi_pdu_rel9 = (nfapi_cqi_indication_rel9_t *)tlv; - - if(!(pull16(ppReadPackedMsg, &cqi_pdu_rel9->length, end) && - pull16(ppReadPackedMsg, &cqi_pdu_rel9->data_offset, end) && - pull8(ppReadPackedMsg, &cqi_pdu_rel9->ul_cqi, end) && - pull8(ppReadPackedMsg, &cqi_pdu_rel9->number_of_cc_reported, end))) - return 0; - - if(cqi_pdu_rel9->number_of_cc_reported > NFAPI_CC_MAX) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : out of bound array\n"); - return 0; - } - - if(!(pullarray8(ppReadPackedMsg, cqi_pdu_rel9->ri, NFAPI_CC_MAX, cqi_pdu_rel9->number_of_cc_reported, end) && - pull16(ppReadPackedMsg, &cqi_pdu_rel9->timing_advance, end) && - pull16(ppReadPackedMsg, &cqi_pdu_rel9->timing_advance_r9, end))) - return 0; - - return 1; -} - -static uint8_t unpack_cqi_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_cqi_indication_body_t *value = (nfapi_cqi_indication_body_t *)tlv; - // the cqiBodyEnd points to the end of the cqi PDU's - uint8_t *cqiBodyEnd = *ppReadPackedMsg + value->tl.length; - - //uint8_t* cqiPduEnd = cqiBodyEnd; - //uint8_t* numberOfPdusAddress = *ppReadPackedMsg; - - if(cqiBodyEnd > end) - return 0; - - if(pull16(ppReadPackedMsg, &value->number_of_cqis, end) == 0) - return 0; - - if(value->number_of_cqis > NFAPI_CQI_IND_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of cqi ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_cqis, NFAPI_CQI_IND_MAX_PDU); - return -1; - } - - if(value->number_of_cqis > 0) { - value->cqi_pdu_list = (nfapi_cqi_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_cqi_indication_pdu_t) * value->number_of_cqis, config); - - if(value->cqi_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate cqi ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_cqis); - return 0; - } - } else { - value->cqi_pdu_list = 0; - } - - if(value->number_of_cqis > 0) { - value->cqi_raw_pdu_list = (nfapi_cqi_indication_raw_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_cqi_indication_raw_pdu_t) * value->number_of_cqis, config); - - if(value->cqi_raw_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate raw cqi ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_cqis); - return 0; - } - } else { - value->cqi_raw_pdu_list = 0; - } - - uint8_t i = 0; - - for(i = 0; i < value->number_of_cqis; ++i) { - nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); - memset(pdu, 0, sizeof(nfapi_cqi_indication_pdu_t)); - - if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) - return 0; - - uint8_t *cqiPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; - - while((uint8_t *)(*ppReadPackedMsg) < cqiPduInstanceEnd) { - nfapi_tl_t generic_tl; - - if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) - return 0; - - switch(generic_tl.tag) { - case NFAPI_RX_UE_INFORMATION_TAG: - pdu->rx_ue_information.tl = generic_tl; - - if(unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0) - return 0; - - break; - - case NFAPI_CQI_INDICATION_REL8_TAG: - pdu->cqi_indication_rel8.tl = generic_tl; - - if(unpack_cqi_indication_rel8_value(&pdu->cqi_indication_rel8, ppReadPackedMsg, end) == 0) - return 0; - - break; - - case NFAPI_CQI_INDICATION_REL9_TAG: - pdu->cqi_indication_rel9.tl = generic_tl; - - if(unpack_cqi_indication_rel9_value(&pdu->cqi_indication_rel9, ppReadPackedMsg, end) == 0) - return 0; - - break; - - case NFAPI_UL_CQI_INFORMATION_TAG: - pdu->ul_cqi_information.tl = generic_tl; - - if(unpack_ul_cqi_information_value(&pdu->ul_cqi_information, ppReadPackedMsg, end) == 0) - return 0; - - break; - - default: { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "RX_CQI.indication Invalid pdu type %d \n", generic_tl.tag ); - } - break; - }; - } - } - - uint8_t idx = 0; - - for(idx = 0; idx < value->number_of_cqis; ++idx) { - if(value->cqi_pdu_list[idx].cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG) { - if(pullarray8(ppReadPackedMsg, &(value->cqi_raw_pdu_list[idx].pdu[0]), NFAPI_CQI_RAW_MAX_LEN, value->cqi_pdu_list[idx].cqi_indication_rel8.length, end) == 0) - return 0; - } else if(value->cqi_pdu_list[idx].cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG) { - if(pullarray8(ppReadPackedMsg, &(value->cqi_raw_pdu_list[idx].pdu[0]), NFAPI_CQI_RAW_MAX_LEN, value->cqi_pdu_list[idx].cqi_indication_rel9.length, end) == 0) - return 0; - } - } - - return 1; -} - -static uint8_t unpack_cqi_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_cqi_indication_t *pNfapiMsg = (nfapi_cqi_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_CQI_INDICATION_BODY_TAG, &pNfapiMsg->cqi_indication_body, &unpack_cqi_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} -static uint8_t unpack_lbt_pdsch_req_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_lbt_pdsch_req_pdu_rel13_t *value = (nfapi_lbt_pdsch_req_pdu_rel13_t *)tlv; - return (pull32(ppReadPackedMsg, &value->handle, end) && - pull32(ppReadPackedMsg, &value->mp_cca, end) && - pull32(ppReadPackedMsg, &value->n_cca, end) && - pull32(ppReadPackedMsg, &value->offset, end) && - pull32(ppReadPackedMsg, &value->lte_txop_sf, end) && - pull16(ppReadPackedMsg, &value->txop_sfn_sf_end, end) && - pull32(ppReadPackedMsg, &value->lbt_mode, end)); -} - -static uint8_t unpack_lbt_drs_req_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_lbt_drs_req_pdu_rel13_t *value = (nfapi_lbt_drs_req_pdu_rel13_t *)tlv; - return (pull32(ppReadPackedMsg, &value->handle, end) && - pull32(ppReadPackedMsg, &value->offset, end) && - pull16(ppReadPackedMsg, &value->sfn_sf_end, end) && - pull32(ppReadPackedMsg, &value->lbt_mode, end)); -} - - -static uint8_t unpack_lbt_config_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_lbt_dl_config_request_body_t *value = (nfapi_lbt_dl_config_request_body_t *)tlv; - - if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0) - return 0; - - if(value->number_of_pdus > NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of lbt dl config pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU); - return 0; - } - - if(value->number_of_pdus) { - value->lbt_dl_config_req_pdu_list = (nfapi_lbt_dl_config_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_lbt_dl_config_request_pdu_t) * value->number_of_pdus, config); - - if(value->lbt_dl_config_req_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate lbt dl config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus); - return 0; - } - } else { - value->lbt_dl_config_req_pdu_list = 0; - } - - uint16_t i; - uint16_t total_number_of_pdus = value->number_of_pdus; - - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_lbt_dl_config_request_pdu_t *pdu = &(value->lbt_dl_config_req_pdu_list[i]); - - if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && - pull8(ppReadPackedMsg, &pdu->pdu_size, end))) - return 0; - - uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; - - if(packedPduEnd > end) - return 0; - - switch(pdu->pdu_type) { - case NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG, &pdu->lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13, &unpack_lbt_pdsch_req_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_LBT_DRS_REQ_PDU_REL13_TAG, &pdu->lbt_drs_req_pdu.lbt_drs_req_pdu_rel13, &unpack_lbt_drs_req_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - default: - NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL_CONFIG.request body invalid pdu type %d\n", pdu->pdu_type); - return 0; - } - } - - return 1; -} -static uint8_t unpack_lbt_dl_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_lbt_dl_config_request_t *pNfapiMsg = (nfapi_lbt_dl_config_request_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->lbt_dl_config_request_body, &unpack_lbt_config_request_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_lbt_pdsch_rsp_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_lbt_pdsch_rsp_pdu_rel13_t *value = (nfapi_lbt_pdsch_rsp_pdu_rel13_t *)tlv; - return (pull32(ppReadPackedMsg, &value->handle, end) && - pull32(ppReadPackedMsg, &value->result, end) && - pull32(ppReadPackedMsg, &value->lte_txop_symbols, end) && - pull32(ppReadPackedMsg, &value->initial_partial_sf, end)); -} -static uint8_t unpack_lbt_drs_rsp_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_lbt_drs_rsp_pdu_rel13_t *value = (nfapi_lbt_drs_rsp_pdu_rel13_t *)tlv; - return (pull32(ppReadPackedMsg, &value->handle, end) && - pull32(ppReadPackedMsg, &value->result, end)); -} - -static uint8_t unpack_lbt_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_lbt_dl_indication_body_t *value = (nfapi_lbt_dl_indication_body_t *)tlv; - - if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0) - return 0; - - if(value->number_of_pdus > NFAPI_LBT_IND_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of lbt dl ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_LBT_IND_MAX_PDU); - return 0; - } - - if(value->number_of_pdus > 0) { - value->lbt_indication_pdu_list = (nfapi_lbt_dl_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_lbt_dl_indication_pdu_t) * value->number_of_pdus, config); - - if(value->lbt_indication_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate lbt dl ind config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus); - return 0; - } - } else { - value->lbt_indication_pdu_list = 0; - } - - uint16_t i; - uint16_t total_number_of_pdus = value->number_of_pdus; - - for(i = 0; i < total_number_of_pdus; ++i) { - nfapi_lbt_dl_indication_pdu_t *pdu = &(value->lbt_indication_pdu_list[i]); - - if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && - pull8(ppReadPackedMsg, &pdu->pdu_size, end))) - return 0; - - uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; - - if(packedPduEnd > end) - return 0; - - switch(pdu->pdu_type) { - case NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG, &pdu->lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13, &unpack_lbt_pdsch_rsp_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - case NFAPI_LBT_DL_RSP_DRS_PDU_TYPE: { - unpack_tlv_t unpack_fns[] = { - { NFAPI_LBT_DRS_RSP_PDU_REL13_TAG, &pdu->lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13, &unpack_lbt_drs_rsp_pdu_rel13_value}, - }; - unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); - } - break; - - default: - NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL.indication body invalid pdu type %d\n", pdu->pdu_type); - return 0; - } - } - - return 1; -} -static uint8_t unpack_lbt_dl_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_lbt_dl_indication_t *pNfapiMsg = (nfapi_lbt_dl_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_LBT_DL_INDICATION_BODY_TAG, &pNfapiMsg->lbt_dl_indication_body, &unpack_lbt_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_nb_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nb_harq_indication_fdd_rel13_t *value = (nfapi_nb_harq_indication_fdd_rel13_t *)tlv; - return (pull8(ppReadPackedMsg, &value->harq_tb1, end)); -} - - -static uint8_t unpack_nb_harq_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nb_harq_indication_body_t *value = (nfapi_nb_harq_indication_body_t *)tlv; - uint8_t *nbharqBodyEnd = *ppReadPackedMsg + value->tl.length; - - if(nbharqBodyEnd > end) - return 0; - - if(pull16(ppReadPackedMsg, &value->number_of_harqs, end) == 0) - return 0; - - if(value->number_of_harqs > NFAPI_HARQ_IND_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of harq ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_harqs, NFAPI_HARQ_IND_MAX_PDU); - return 0; - } - - value->nb_harq_pdu_list = (nfapi_nb_harq_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_nb_harq_indication_pdu_t) * value->number_of_harqs, config); - - if(value->nb_harq_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate harq ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_harqs); - return 0; - } - - uint8_t i = 0; - - for(i = 0; i < value->number_of_harqs; ++i) { - nfapi_nb_harq_indication_pdu_t *pdu = &(value->nb_harq_pdu_list[i]); - - if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) - return 0; - - uint8_t *harqPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; - unpack_tlv_t unpack_fns[] = { - { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, - { NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG, &pdu->nb_harq_indication_fdd_rel13, &unpack_nb_harq_indication_fdd_rel13_value}, - { NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, &unpack_ul_cqi_information_value} - }; - - if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, harqPduInstanceEnd, 0, 0) == 0) - return 0; - } - - return 1; -} - -static uint8_t unpack_nb_harq_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nb_harq_indication_t *pNfapiMsg = (nfapi_nb_harq_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_NB_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->nb_harq_indication_body, &unpack_nb_harq_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_nrach_indication_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nrach_indication_pdu_rel13_t *value = (nfapi_nrach_indication_pdu_rel13_t *)tlv; - return (pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->initial_sc, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end) && - pull8(ppReadPackedMsg, &value->nrach_ce_level, end)); -} - -static uint8_t unpack_ue_release_resp(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_ue_release_response_t *pNfapiMsg = (nfapi_ue_release_response_t *)msg; - - if(pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) == 0) { - return 0; - } else { - NFAPI_TRACE(NFAPI_TRACE_INFO, "ue_release_response:error_code = %d\n", pNfapiMsg->error_code); - } - - return 1; -} - -static uint8_t unpack_nrach_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { - nfapi_nrach_indication_body_t *value = (nfapi_nrach_indication_body_t *)tlv; - uint8_t *nrachBodyEnd = *ppReadPackedMsg + value->tl.length; - - if(nrachBodyEnd > end) - return 0; - - if(pull8(ppReadPackedMsg, &value->number_of_initial_scs_detected, end) == 0) - return 0; - - if(value->number_of_initial_scs_detected > NFAPI_PREAMBLE_MAX_PDU) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of detected scs ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_initial_scs_detected, NFAPI_PREAMBLE_MAX_PDU); - return 0; - } - - value->nrach_pdu_list = (nfapi_nrach_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_nrach_indication_pdu_t) * value->number_of_initial_scs_detected, config); - - if(value->nrach_pdu_list == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate nrach ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_initial_scs_detected); - return 0; - } - - uint8_t i = 0; - - for(i = 0; i < value->number_of_initial_scs_detected; ++i) { - nfapi_nrach_indication_pdu_t *pdu = &(value->nrach_pdu_list[i]); - uint8_t *nrachPduInstanceEnd = *ppReadPackedMsg + 4 + 6; - unpack_tlv_t unpack_fns[] = { - { NFAPI_NRACH_INDICATION_REL13_TAG, &pdu->nrach_indication_rel13, &unpack_nrach_indication_rel13_value}, - }; - - if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, nrachPduInstanceEnd, 0, 0) == 0) - return 0; - } - - return 1; -} - -static uint8_t unpack_nrach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nrach_indication_t *pNfapiMsg = (nfapi_nrach_indication_t *)msg; - unpack_p7_tlv_t unpack_fns[] = { - { NFAPI_NRACH_INDICATION_BODY_TAG, &pNfapiMsg->nrach_indication_body, &unpack_nrach_indication_body_value}, - }; - return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && - unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_nr_dl_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nr_dl_node_sync_t *pNfapiMsg = (nfapi_nr_dl_node_sync_t *)msg; - return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->delta_sfn_slot, end) && - unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_dl_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_dl_node_sync_t *pNfapiMsg = (nfapi_dl_node_sync_t *)msg; - return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->delta_sfn_sf, end) && - unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - - -static uint8_t unpack_nr_ul_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nr_ul_node_sync_t *pNfapiMsg = (nfapi_nr_ul_node_sync_t *)msg; - return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->t2, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->t3, end) && - unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - - -static uint8_t unpack_ul_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_ul_node_sync_t *pNfapiMsg = (nfapi_ul_node_sync_t *)msg; - return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->t2, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->t3, end) && - unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - -static uint8_t unpack_timing_info(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_timing_info_t *pNfapiMsg = (nfapi_timing_info_t *)msg; - return (pull32(ppReadPackedMsg, &pNfapiMsg->last_sfn_sf, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->time_since_last_timing_info, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->dl_config_jitter, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->tx_request_jitter, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->ul_config_jitter, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_jitter, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->dl_config_latest_delay, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->tx_request_latest_delay, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->ul_config_latest_delay, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_latest_delay, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->dl_config_earliest_arrival, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->tx_request_earliest_arrival, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->ul_config_earliest_arrival, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_earliest_arrival, end) && - unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - - -static uint8_t unpack_nr_timing_info(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { - nfapi_nr_timing_info_t *pNfapiMsg = (nfapi_nr_timing_info_t *)msg; - return (pull32(ppReadPackedMsg, &pNfapiMsg->last_sfn, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->last_slot, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->time_since_last_timing_info, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->dl_tti_jitter, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->tx_data_request_jitter, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->ul_tti_jitter, end) && - pull32(ppReadPackedMsg, &pNfapiMsg->ul_dci_jitter, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->dl_tti_latest_delay, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->tx_data_request_latest_delay, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->ul_tti_latest_delay, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->ul_dci_latest_delay, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->dl_tti_earliest_arrival, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->tx_data_request_earliest_arrival, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->ul_tti_earliest_arrival, end) && - pulls32(ppReadPackedMsg, &pNfapiMsg->ul_dci_earliest_arrival, end) && - unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); -} - - - -// unpack length check - -static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen) { - int retLen = 0; - - switch (msgId) { - case NFAPI_DL_CONFIG_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_dl_config_request_t)) - retLen = sizeof(nfapi_dl_config_request_t); - - break; - - case NFAPI_UL_CONFIG_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_ul_config_request_t)) - retLen = sizeof(nfapi_ul_config_request_t); - - break; - - case NFAPI_SUBFRAME_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_subframe_indication_t)) - retLen = sizeof(nfapi_subframe_indication_t); - - break; - - case NFAPI_HI_DCI0_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_hi_dci0_request_t)) - retLen = sizeof(nfapi_hi_dci0_request_t); - - break; - - case NFAPI_TX_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_tx_request_t)) - retLen = sizeof(nfapi_tx_request_t); - - break; - - case NFAPI_HARQ_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_harq_indication_t)) - retLen = sizeof(nfapi_harq_indication_t); - - break; - - case NFAPI_CRC_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_crc_indication_t)) - retLen = sizeof(nfapi_crc_indication_t); - - break; - - case NFAPI_RX_ULSCH_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_rx_indication_t)) - retLen = sizeof(nfapi_rx_indication_t); - - break; - - case NFAPI_RACH_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_rach_indication_t)) - retLen = sizeof(nfapi_rach_indication_t); - - break; - - case NFAPI_SRS_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_srs_indication_t)) - retLen = sizeof(nfapi_srs_indication_t); - - break; - - case NFAPI_RX_SR_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_sr_indication_t)) - retLen = sizeof(nfapi_sr_indication_t); - - break; - - case NFAPI_RX_CQI_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_cqi_indication_t)) - retLen = sizeof(nfapi_cqi_indication_t); - - break; - - case NFAPI_LBT_DL_CONFIG_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_lbt_dl_config_request_t)) - retLen = sizeof(nfapi_lbt_dl_config_request_t); - - break; - - case NFAPI_LBT_DL_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_lbt_dl_indication_t)) - retLen = sizeof(nfapi_lbt_dl_indication_t); - - break; - - case NFAPI_NB_HARQ_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_nb_harq_indication_t)) - retLen = sizeof(nfapi_nb_harq_indication_t); - - break; - - case NFAPI_NRACH_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_nrach_indication_t)) - retLen = sizeof(nfapi_nrach_indication_t); - - break; - - case NFAPI_DL_NODE_SYNC: - if (unpackedBufLen >= sizeof(nfapi_dl_node_sync_t)) - retLen = sizeof(nfapi_dl_node_sync_t); - - break; - - case NFAPI_UL_NODE_SYNC: - if (unpackedBufLen >= sizeof(nfapi_ul_node_sync_t)) - retLen = sizeof(nfapi_ul_node_sync_t); - - break; - - case NFAPI_TIMING_INFO: - if (unpackedBufLen >= sizeof(nfapi_timing_info_t)) - retLen = sizeof(nfapi_timing_info_t); - - break; - - case NFAPI_UE_RELEASE_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_ue_release_request_t)) - retLen = sizeof(nfapi_ue_release_request_t); - - break; - - case NFAPI_UE_RELEASE_RESPONSE: - if (unpackedBufLen >= sizeof(nfapi_ue_release_response_t)) - retLen = sizeof(nfapi_ue_release_response_t); - - break; - - default: - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown message ID %d\n", msgId); - break; - } - - return retLen; -} - -static int check_nr_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen) -{ - int retLen = 0; - - switch (msgId) - { - case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_nr_dl_tti_request_t)) - retLen = sizeof(nfapi_nr_dl_tti_request_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_nr_ul_tti_request_t)) - retLen = sizeof(nfapi_nr_ul_tti_request_t); - break; - - case NFAPI_SUBFRAME_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_subframe_indication_t)) - retLen = sizeof(nfapi_subframe_indication_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_nr_ul_dci_request_t)) - retLen = sizeof(nfapi_nr_ul_dci_request_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_nr_tx_data_request_t)) - retLen = sizeof(nfapi_nr_tx_data_request_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_nr_rx_data_indication_t)) - retLen = sizeof(nfapi_nr_rx_data_indication_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_nr_crc_indication_t)) - retLen = sizeof(nfapi_nr_crc_indication_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_nr_rach_indication_t)) - retLen = sizeof(nfapi_nr_rach_indication_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_nr_uci_indication_t)) - retLen = sizeof(nfapi_nr_uci_indication_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: - if (unpackedBufLen >= sizeof(nfapi_nr_srs_indication_t)) - retLen = sizeof(nfapi_nr_srs_indication_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC: - if (unpackedBufLen >= sizeof(nfapi_nr_dl_node_sync_t)) - retLen = sizeof(nfapi_nr_dl_node_sync_t); - break; - - case NFAPI_NR_PHY_MSG_TYPE_UL_NODE_SYNC: - if (unpackedBufLen >= sizeof(nfapi_nr_ul_node_sync_t)) - retLen = sizeof(nfapi_nr_ul_node_sync_t); - break; - - case NFAPI_TIMING_INFO: - if (unpackedBufLen >= sizeof(nfapi_timing_info_t)) - retLen = sizeof(nfapi_timing_info_t); - break; - - case NFAPI_UE_RELEASE_REQUEST: - if (unpackedBufLen >= sizeof(nfapi_ue_release_request_t)) - retLen = sizeof(nfapi_ue_release_request_t); - break; - - case NFAPI_UE_RELEASE_RESPONSE: - if (unpackedBufLen >= sizeof(nfapi_ue_release_response_t)) - retLen = sizeof(nfapi_ue_release_response_t); - break; - - default: - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown message ID %d\n", msgId); - break; - } - - return retLen; -} - - - -// Main unpack functions - public - -int nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { - nfapi_p7_message_header_t *pMessageHeader = pUnpackedBuf; - uint8_t *pReadPackedMessage = pMessageBuf; - uint8_t *end = pMessageBuf + messageBufLen; - - if (pMessageBuf == NULL || pUnpackedBuf == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 header unpack supplied pointers are null\n"); - return -1; - } - - if (messageBufLen < NFAPI_P7_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p7_message_header_t)) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 header unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen); - return -1; - } - - // process the header - if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) && - pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) && - pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) && - pull16(&pReadPackedMessage, &pMessageHeader->m_segment_sequence, end) && - pull32(&pReadPackedMessage, &pMessageHeader->checksum, end) && - pull32(&pReadPackedMessage, &pMessageHeader->transmit_timestamp, end))) - return -1; - - return 0; -} - -int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { - int result = 0; - nfapi_p7_message_header_t *pMessageHeader = (nfapi_p7_message_header_t *)pUnpackedBuf; - uint8_t *pReadPackedMessage = pMessageBuf; - uint8_t *end = pMessageBuf + messageBufLen; - - if (pMessageBuf == NULL || pUnpackedBuf == NULL) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied pointers are null\n"); - return -1; - } - - if (messageBufLen < NFAPI_P7_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p7_message_header_t)) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen); - return -1; - } - - /* - uint8_t *ptr = pMessageBuf; - printf("\n Read P7 message unpack: "); - while(ptr < end){ - printf(" %d ", *ptr); - ptr++; - } - printf("\n"); - */ - // clean the supplied buffer for - tag value blanking - (void)memset(pUnpackedBuf, 0, unpackedBufLen); - - // process the header - if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) && - pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) && - pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) && - pull16(&pReadPackedMessage, &pMessageHeader->m_segment_sequence, end) && - pull32(&pReadPackedMessage, &pMessageHeader->checksum, end) && - pull32(&pReadPackedMessage, &pMessageHeader->transmit_timestamp, end))) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack header failed\n"); - return -1; - } - - if((uint8_t *)(pMessageBuf + pMessageHeader->message_length) > end) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack message length is greater than the message buffer \n"); - return -1; - } - - /* - if(check_unpack_length(pMessageHeader->message_id, unpackedBufLen) == 0) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack unpack buffer is not large enough \n"); - return -1; - } - */ - - // look for the specific message - switch (pMessageHeader->message_id) { - case NFAPI_DL_CONFIG_REQUEST: - if (check_unpack_length(NFAPI_DL_CONFIG_REQUEST, unpackedBufLen)) - result = unpack_dl_config_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_UL_CONFIG_REQUEST: - if (check_unpack_length(NFAPI_UL_CONFIG_REQUEST, unpackedBufLen)) - result = unpack_ul_config_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_TX_REQUEST: - if (check_unpack_length(NFAPI_TX_REQUEST, unpackedBufLen)) - result = unpack_tx_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_HI_DCI0_REQUEST: - if (check_unpack_length(NFAPI_HI_DCI0_REQUEST, unpackedBufLen)) - result = unpack_hi_dci0_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_UE_RELEASE_REQUEST: - if (check_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen)) - result = unpack_ue_release_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_HARQ_INDICATION: - if (check_unpack_length(NFAPI_HARQ_INDICATION, unpackedBufLen)) - result = unpack_harq_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_CRC_INDICATION: - if (check_unpack_length(NFAPI_CRC_INDICATION, unpackedBufLen)) - result = unpack_crc_indication(&pReadPackedMessage,end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_RX_ULSCH_INDICATION: - if (check_unpack_length(NFAPI_RX_ULSCH_INDICATION, unpackedBufLen)) - result = unpack_rx_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_RACH_INDICATION: - if (check_unpack_length(NFAPI_RACH_INDICATION, unpackedBufLen)) - result = unpack_rach_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_SRS_INDICATION: - if (check_unpack_length(NFAPI_SRS_INDICATION, unpackedBufLen)) - result = unpack_srs_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_RX_SR_INDICATION: - if (check_unpack_length(NFAPI_RX_SR_INDICATION, unpackedBufLen)) - result = unpack_sr_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_RX_CQI_INDICATION: - if (check_unpack_length(NFAPI_RX_CQI_INDICATION, unpackedBufLen)) - result = unpack_cqi_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_LBT_DL_CONFIG_REQUEST: - if (check_unpack_length(NFAPI_LBT_DL_CONFIG_REQUEST, unpackedBufLen)) - result = unpack_lbt_dl_config_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_LBT_DL_INDICATION: - if (check_unpack_length(NFAPI_LBT_DL_INDICATION, unpackedBufLen)) - result = unpack_lbt_dl_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_NB_HARQ_INDICATION: - if (check_unpack_length(NFAPI_NB_HARQ_INDICATION, unpackedBufLen)) - result = unpack_nb_harq_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_NRACH_INDICATION: - if (check_unpack_length(NFAPI_NRACH_INDICATION, unpackedBufLen)) - result = unpack_nrach_indication(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_DL_NODE_SYNC: - if (check_unpack_length(NFAPI_DL_NODE_SYNC, unpackedBufLen)) - result = unpack_dl_node_sync(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_UL_NODE_SYNC: - if (check_unpack_length(NFAPI_UL_NODE_SYNC, unpackedBufLen)) - result = unpack_ul_node_sync(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_TIMING_INFO: - if (check_unpack_length(NFAPI_TIMING_INFO, unpackedBufLen)) - result = unpack_timing_info(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - case NFAPI_UE_RELEASE_RESPONSE: - if (check_unpack_length(NFAPI_UE_RELEASE_RESPONSE, unpackedBufLen)) - result = unpack_ue_release_resp(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - - break; - - default: - if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && - pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX) { - if(config && config->unpack_p7_vendor_extension) { - result = (config->unpack_p7_vendor_extension)(pMessageHeader, &pReadPackedMessage, end, config); - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve decoder provided\n", __FUNCTION__, pMessageHeader->message_id); - } - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id); - } - - break; - } - - if(result == 0) - return -1; - else - return 0; -} - -int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config) -{ - int result = 0; - nfapi_p7_message_header_t *pMessageHeader = (nfapi_p7_message_header_t*)pUnpackedBuf; - uint8_t *pReadPackedMessage = pMessageBuf; - uint8_t *end = pMessageBuf + messageBufLen; - - if (pMessageBuf == NULL || pUnpackedBuf == NULL) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied pointers are null\n"); - return -1; - } - - if (messageBufLen < NFAPI_P7_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p7_message_header_t)) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen); - return -1; - } - - // uint8_t *ptr = pMessageBuf; - // printf("\n Read P7 message unpack: "); - // while(ptr < end){ - // printf(" %d ", *ptr); - // ptr++; - // } - // printf("\n"); - - // clean the supplied buffer for - tag value blanking - (void)memset(pUnpackedBuf, 0, unpackedBufLen); - - // process the header - if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) && - pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) && - pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) && - pull16(&pReadPackedMessage, &pMessageHeader->m_segment_sequence, end) && - pull32(&pReadPackedMessage, &pMessageHeader->checksum, end) && - pull32(&pReadPackedMessage, &pMessageHeader->transmit_timestamp, end))) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack header failed\n"); - return -1; - } - - if((uint8_t*)(pMessageBuf + pMessageHeader->message_length) > end) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack message length is greater than the message buffer \n"); - return -1; - } - - /* - if(check_unpack_length(pMessageHeader->message_id, unpackedBufLen) == 0) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack unpack buffer is not large enough \n"); - return -1; - } - */ - - // look for the specific message - switch (pMessageHeader->message_id) - { - case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST, unpackedBufLen)) - result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - break; - - case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST, unpackedBufLen)) - result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - break; - case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST, unpackedBufLen)) - result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - break; - case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST, unpackedBufLen)) - result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - break; - - case NFAPI_UE_RELEASE_REQUEST: - if (check_nr_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen)) - result = unpack_ue_release_request(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - break; - case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION, unpackedBufLen)){ - nfapi_nr_slot_indication_scf_t* msg = (nfapi_nr_slot_indication_scf_t*) pMessageHeader; - result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg, config); - } - else - return -1; - break; - - case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION, unpackedBufLen)){ - nfapi_nr_rx_data_indication_t* msg = (nfapi_nr_rx_data_indication_t*) pMessageHeader; - msg->pdu_list = (nfapi_nr_rx_data_pdu_t*) malloc(sizeof(nfapi_nr_rx_data_pdu_t)); - msg->pdu_list->pdu = (uint8_t *) malloc(sizeof(uint8_t)); - result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, msg, config); - } - else - return -1; - break; - - case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION, unpackedBufLen)){ - - nfapi_nr_crc_indication_t* msg = (nfapi_nr_crc_indication_t*) pMessageHeader; - msg->crc_list = (nfapi_nr_crc_t*) malloc(sizeof(nfapi_nr_crc_t)); - result = unpack_nr_crc_indication(&pReadPackedMessage,end , msg, config); - } - else - return -1; - break; - - case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION, unpackedBufLen)){ - nfapi_nr_uci_indication_t* msg = (nfapi_nr_uci_indication_t*) pMessageHeader; - msg->uci_list = (nfapi_nr_uci_t*) malloc(sizeof(nfapi_nr_uci_t)); - result = unpack_nr_uci_indication(&pReadPackedMessage, end, msg, config); - } - else - return -1; - break; - - case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION, unpackedBufLen)){ - nfapi_nr_srs_indication_t* msg = (nfapi_nr_srs_indication_t*) pMessageHeader; - msg->pdu_list = (nfapi_nr_srs_indication_pdu_t*) malloc(sizeof(nfapi_nr_srs_indication_pdu_t)); - result = unpack_nr_srs_indication(&pReadPackedMessage, end, msg, config); - } - else - return -1; - break; - - case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION, unpackedBufLen)){ - nfapi_nr_rach_indication_t* msg = (nfapi_nr_rach_indication_t*) pMessageHeader; - result = unpack_nr_rach_indication(&pReadPackedMessage, end, msg, config); - } - else - return -1; - break; - - case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC, unpackedBufLen)) - result = unpack_nr_dl_node_sync(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - break; - - case NFAPI_NR_PHY_MSG_TYPE_UL_NODE_SYNC: - if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_NODE_SYNC, unpackedBufLen)) - result = unpack_nr_ul_node_sync(&pReadPackedMessage, end , pMessageHeader, config); - else - return -1; - break; - - case NFAPI_TIMING_INFO: - if (check_nr_unpack_length(NFAPI_TIMING_INFO, unpackedBufLen)) - result = unpack_nr_timing_info(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - break; - - case NFAPI_UE_RELEASE_RESPONSE: - if (check_nr_unpack_length(NFAPI_UE_RELEASE_RESPONSE, unpackedBufLen)) - result = unpack_ue_release_resp(&pReadPackedMessage, end, pMessageHeader, config); - else - return -1; - break; - - default: - - if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && - pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX) - { - if(config && config->unpack_p7_vendor_extension) - { - result = (config->unpack_p7_vendor_extension)(pMessageHeader, &pReadPackedMessage, end, config); - } - else - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve decoder provided\n", __FUNCTION__, pMessageHeader->message_id); - } - } - else - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id); - } - break; - } - - if(result == 0) - return -1; - else - return 0; -} - - +/* + * Copyright 2017 Cisco Systems, Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * 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. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "nfapi_nr_interface_scf.h" + +extern int nfapi_unpack_p7_vendor_extension(nfapi_p7_message_header_t *header, uint8_t **ppReadPackedMsg, void *user_data); +extern int nfapi_pack_p7_vendor_extension(nfapi_p7_message_header_t *header, uint8_t **ppWritePackedMsg, void *user_data); + +uint32_t nfapi_calculate_checksum(uint8_t *buffer, uint16_t len) { + uint32_t chksum = 0; + // calcaulte upto the checksum + chksum = crc32(chksum, buffer, 8); + // skip the checksum + uint8_t zeros[4] = {0, 0, 0, 0}; + chksum = crc32(chksum, zeros, 4); + // continu with the rest of the mesage + chksum = crc32(chksum, &buffer[NFAPI_P7_HEADER_LENGTH], len - NFAPI_P7_HEADER_LENGTH); + // return the inverse + return ~(chksum); +} + +int nfapi_p7_update_checksum(uint8_t *buffer, uint32_t len) { + uint32_t checksum = nfapi_calculate_checksum(buffer, len); + uint8_t *p_write = &buffer[8]; + return (push32(checksum, &p_write, buffer + len) > 0 ? 0 : -1); +} + +int nfapi_p7_update_transmit_timestamp(uint8_t *buffer, uint32_t timestamp) { + uint8_t *p_write = &buffer[12]; + return (push32(timestamp, &p_write, buffer + 16) > 0 ? 0 : -1); +} + +uint32_t nfapi_p7_calculate_checksum(uint8_t *buffer, uint32_t len) { + return nfapi_calculate_checksum(buffer, len); +} + +void *nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t *config) { + if(size == 0) + return 0; + + void *buffer_p = NULL; + + if(config && config->allocate) { + buffer_p = (config->allocate)(size); + + if(buffer_p != NULL) { + memset(buffer_p,0,size); + } + + return buffer_p; + } else { + buffer_p = calloc(1, size); + return buffer_p; + } +} + +void nfapi_p7_deallocate(void *ptr, nfapi_p7_codec_config_t *config) { + if(ptr == NULL) + return; + + if(config && config->deallocate) { + return (config->deallocate)(ptr); + } else { + return free(ptr); + } +} +// Pack routines + + +static uint8_t pack_dl_config_dci_dl_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel8_t *value = (nfapi_dl_config_dci_dl_pdu_rel8_t *)tlv; + //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() dci_format:%u\n", __FUNCTION__, value->dci_format); + return ( push8(value->dci_format, ppWritePackedMsg, end) && + push8(value->cce_idx, ppWritePackedMsg, end) && + push8(value->aggregation_level, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->resource_allocation_type, ppWritePackedMsg, end) && + push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) && + push32(value->resource_block_coding, ppWritePackedMsg, end) && + push8(value->mcs_1, ppWritePackedMsg, end) && + push8(value->redundancy_version_1, ppWritePackedMsg, end) && + push8(value->new_data_indicator_1, ppWritePackedMsg, end) && + push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) && + push8(value->mcs_2, ppWritePackedMsg, end) && + push8(value->redundancy_version_2, ppWritePackedMsg, end) && + push8(value->new_data_indicator_2, ppWritePackedMsg, end) && + push8(value->harq_process, ppWritePackedMsg, end) && + push8(value->tpmi, ppWritePackedMsg, end) && + push8(value->pmi, ppWritePackedMsg, end) && + push8(value->precoding_information, ppWritePackedMsg, end) && + push8(value->tpc, ppWritePackedMsg, end) && + push8(value->downlink_assignment_index, ppWritePackedMsg, end) && + push8(value->ngap, ppWritePackedMsg, end) && + push8(value->transport_block_size_index, ppWritePackedMsg, end) && + push8(value->downlink_power_offset, ppWritePackedMsg, end) && + push8(value->allocate_prach_flag, ppWritePackedMsg, end) && + push8(value->preamble_index, ppWritePackedMsg, end) && + push8(value->prach_mask_index, ppWritePackedMsg, end) && + push8(value->rnti_type, ppWritePackedMsg, end) && + push16(value->transmission_power, ppWritePackedMsg, end)); +} + +static uint8_t pack_dl_config_dci_dl_pdu_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel9_t *value = (nfapi_dl_config_dci_dl_pdu_rel9_t *)tlv; + return( push8(value->mcch_flag, ppWritePackedMsg, end) && + push8(value->mcch_change_notification, ppWritePackedMsg, end) && + push8(value->scrambling_identity, ppWritePackedMsg, end)); +} + +static uint8_t pack_dl_config_dci_dl_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel10_t *value = (nfapi_dl_config_dci_dl_pdu_rel10_t *)tlv; + return ( push8(value->cross_carrier_scheduling_flag, ppWritePackedMsg, end) && + push8(value->carrier_indicator, ppWritePackedMsg, end) && + push8(value->srs_flag, ppWritePackedMsg, end) && + push8(value->srs_request, ppWritePackedMsg, end) && + push8(value->antenna_ports_scrambling_and_layers, ppWritePackedMsg, end) && + push8(value->total_dci_length_including_padding, ppWritePackedMsg, end) && + push8(value->n_dl_rb, ppWritePackedMsg, end)); +} + +static uint8_t pack_dl_config_dci_dl_pdu_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel11_t *value = (nfapi_dl_config_dci_dl_pdu_rel11_t *)tlv; + return ( push8(value->harq_ack_resource_offset, ppWritePackedMsg, end) && + push8(value->pdsch_re_mapping_quasi_co_location_indicator, ppWritePackedMsg, end)); +} + +static uint8_t pack_dl_config_dci_dl_pdu_rel12_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel12_t *value = (nfapi_dl_config_dci_dl_pdu_rel12_t *)tlv; + return ( push8(value->primary_cell_type, ppWritePackedMsg, end) && + push8(value->ul_dl_configuration_flag, ppWritePackedMsg, end) && + push8(value->number_ul_dl_configurations, ppWritePackedMsg, end) && + pusharray8(value->ul_dl_configuration_indication, NFAPI_MAX_UL_DL_CONFIGURATIONS, value->number_ul_dl_configurations, ppWritePackedMsg, end)); +} + +static uint8_t pack_tpm_value(nfapi_dl_config_dci_dl_tpm_t *value, uint8_t **ppWritePackedMsg, uint8_t *end) { + if (!( push8(value->num_prb_per_subband, ppWritePackedMsg, end) && + push8(value->number_of_subbands, ppWritePackedMsg, end) && + push8(value->num_antennas, ppWritePackedMsg, end))) + return 0; + + uint8_t idx = 0; + + for(idx = 0; idx < value->number_of_subbands; ++idx) { + nfapi_dl_config_dci_dl_tpm_subband_info_t *subband_info = &(value->subband_info[idx]); + + if(!(push8(subband_info->subband_index, ppWritePackedMsg, end) && + push8(subband_info->scheduled_ues, ppWritePackedMsg, end))) + return 0; + + uint8_t antenna_idx = 0; + uint8_t scheduled_ue_idx = 0; + + for(antenna_idx = 0; antenna_idx < value->num_antennas; ++antenna_idx) { + for(scheduled_ue_idx = 0; scheduled_ue_idx < subband_info->scheduled_ues; ++scheduled_ue_idx) { + if(!push16(subband_info->precoding_value[antenna_idx][scheduled_ue_idx], ppWritePackedMsg, end)) + return 0; + } + } + } + + return 1; +} + + +static uint8_t pack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv; + return( + push16(value->bwp_size, ppWritePackedMsg, end) && + push16(value->bwp_start, ppWritePackedMsg, end) && + push8(value->subcarrier_spacing, ppWritePackedMsg, end) && + push8(value->cyclic_prefix, ppWritePackedMsg, end) && + push16(value->start_rb, ppWritePackedMsg, end) && + push16(value->nr_of_rbs, ppWritePackedMsg, end) && + push8(value->csi_type, ppWritePackedMsg, end) && + push8(value->row, ppWritePackedMsg, end) && + push16(value->freq_domain, ppWritePackedMsg, end) && + push8(value->symb_l0, ppWritePackedMsg, end) && + push8(value->symb_l1, ppWritePackedMsg, end) && + push8(value->cdm_type, ppWritePackedMsg, end) && + push8(value->freq_density, ppWritePackedMsg, end) && + push16(value->scramb_id, ppWritePackedMsg, end) && + push8(value->power_control_offset, ppWritePackedMsg, end) && + push8(value->power_control_offset_ss, ppWritePackedMsg, end) + ); +} + + +static uint8_t pack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + + nfapi_nr_dl_tti_pdcch_pdu_rel15_t* value = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t*)tlv; + + for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i) + { + if(!(push16(value->dci_pdu[i].RNTI, ppWritePackedMsg, end) && + push16(value->dci_pdu[i].ScramblingId, ppWritePackedMsg, end) && + push16(value->dci_pdu[i].ScramblingRNTI, ppWritePackedMsg, end) && + push8(value->dci_pdu[i].CceIndex, ppWritePackedMsg, end) && + push8(value->dci_pdu[i].AggregationLevel, ppWritePackedMsg, end) && + push8(value->dci_pdu[i].beta_PDCCH_1_0, ppWritePackedMsg, end) && + push8(value->dci_pdu[i].powerControlOffsetSS, ppWritePackedMsg, end) && + push16(value->dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end) && + pusharray8(value->dci_pdu[i].Payload, value->dci_pdu[i].PayloadSizeBits, value->dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end))) + return 0; + + } + // TODO: resolve the packaging of array (currently sending a single element) + return( + push16(value->BWPSize, ppWritePackedMsg, end) && + push16(value->BWPStart, ppWritePackedMsg, end) && + push8(value->SubcarrierSpacing, ppWritePackedMsg, end) && + push8(value->CyclicPrefix, ppWritePackedMsg, end) && + push8(value->StartSymbolIndex, ppWritePackedMsg, end) && + push8(value->DurationSymbols, ppWritePackedMsg, end) && + pusharray8(value->FreqDomainResource, 6, 6, ppWritePackedMsg, end) && + push8(value->CceRegMappingType, ppWritePackedMsg, end) && + push8(value->RegBundleSize, ppWritePackedMsg, end) && + push8(value->InterleaverSize, ppWritePackedMsg, end) && + push8(value->CoreSetType, ppWritePackedMsg, end) && + push16(value->ShiftIndex, ppWritePackedMsg, end) && + push8(value->precoderGranularity, ppWritePackedMsg, end) && + push16(value->numDlDci, ppWritePackedMsg, end)); +} + + +static uint8_t pack_dl_tti_pdsch_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_dl_tti_pdsch_pdu_rel15_t *value = (nfapi_nr_dl_tti_pdsch_pdu_rel15_t *)tlv; + // TODO: resolve the packaging of array (currently sending a single element) + return( + push16(value->pduBitmap, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push16(value->pduIndex, ppWritePackedMsg, end) && + push16(value->BWPSize, ppWritePackedMsg, end) && + push16(value->BWPStart, ppWritePackedMsg, end) && + push8(value->SubcarrierSpacing, ppWritePackedMsg, end) && + push8(value->CyclicPrefix, ppWritePackedMsg, end) && + push8(value->NrOfCodewords, ppWritePackedMsg, end) && + pusharray16(value->targetCodeRate, 2, 1, ppWritePackedMsg, end) && + pusharray8(value->qamModOrder, 2, 1, ppWritePackedMsg, end) && + pusharray8(value->mcsIndex, 2, 1, ppWritePackedMsg, end) && + pusharray8(value->mcsTable, 2, 1, ppWritePackedMsg, end) && + pusharray8(value->rvIndex, 2, 1, ppWritePackedMsg, end) && + pusharray32(value->TBSize, 2, 1, ppWritePackedMsg, end) && + push16(value->dataScramblingId, ppWritePackedMsg, end) && + push8(value->nrOfLayers, ppWritePackedMsg, end) && + push8(value->transmissionScheme, ppWritePackedMsg, end) && + push8(value->refPoint, ppWritePackedMsg, end) && + push16(value->dlDmrsSymbPos, ppWritePackedMsg, end) && + push8(value->dmrsConfigType, ppWritePackedMsg, end) && + push16(value->dlDmrsScramblingId, ppWritePackedMsg, end) && + push8(value->SCID, ppWritePackedMsg, end) && + push8(value->numDmrsCdmGrpsNoData, ppWritePackedMsg, end) && + push16(value->dmrsPorts, ppWritePackedMsg, end) && + push8(value->resourceAlloc, ppWritePackedMsg, end) && + push16(value->rbStart, ppWritePackedMsg, end) && + push16(value->rbSize, ppWritePackedMsg, end) && + push8(value->VRBtoPRBMapping, ppWritePackedMsg, end) && + push8(value->StartSymbolIndex, ppWritePackedMsg, end) && + push8(value->NrOfSymbols, ppWritePackedMsg, end) && + push8(value->PTRSPortIndex, ppWritePackedMsg, end) && + push8(value->PTRSTimeDensity, ppWritePackedMsg, end) && + push8(value->PTRSFreqDensity, ppWritePackedMsg, end) && + push8(value->PTRSReOffset, ppWritePackedMsg, end) + ); +} + + +static uint8_t pack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_dl_tti_ssb_pdu_rel15_t *value = (nfapi_nr_dl_tti_ssb_pdu_rel15_t *)tlv; + return( + push16(value->PhysCellId, ppWritePackedMsg, end) && + push8(value->BetaPss, ppWritePackedMsg, end) && + push8(value->SsbBlockIndex, ppWritePackedMsg, end) && + push8(value->SsbSubcarrierOffset, ppWritePackedMsg, end) && + push16(value->ssbOffsetPointA, ppWritePackedMsg, end) && + push8(value->bchPayloadFlag, ppWritePackedMsg, end) && + push32(value->bchPayload, ppWritePackedMsg, end) + // TODO: pack precoding_and_beamforming too + ); +} + + +static uint8_t pack_dl_config_dci_dl_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel13_t *value = (nfapi_dl_config_dci_dl_pdu_rel13_t *)tlv; + return( push8(value->laa_end_partial_sf_flag, ppWritePackedMsg, end) && + push8(value->laa_end_partial_sf_configuration, ppWritePackedMsg, end) && + push8(value->initial_lbt_sf, ppWritePackedMsg, end) && + push8(value->codebook_size_determination, ppWritePackedMsg, end) && + push8(value->drms_table_flag, ppWritePackedMsg, end) && + push8(value->tpm_struct_flag, ppWritePackedMsg, end) && + (value->tpm_struct_flag == 1 ? pack_tpm_value(&(value->tpm), ppWritePackedMsg, end) : 1)); +} + +static uint8_t pack_dl_config_bch_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_bch_pdu_rel8_t *value = (nfapi_dl_config_bch_pdu_rel8_t *)tlv; + //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s()\n", __FUNCTION__); + return( push16(value->length, ppWritePackedMsg, end) && + push16(value->pdu_index, ppWritePackedMsg, end) && + push16(value->transmission_power, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_mch_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_mch_pdu_rel8_t *value = (nfapi_dl_config_mch_pdu_rel8_t *)tlv; + return ( push16(value->length, ppWritePackedMsg, end) && + push16(value->pdu_index, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->resource_allocation_type, ppWritePackedMsg, end) && + push32(value->resource_block_coding, ppWritePackedMsg, end) && + push8(value->modulation, ppWritePackedMsg, end) && + push16(value->transmission_power, ppWritePackedMsg, end) && + push16(value->mbsfn_area_id, ppWritePackedMsg, end)); +} + +static uint8_t pack_bf_vector_info(void *elem, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_bf_vector_t *bf = (nfapi_bf_vector_t *)elem; + return ( push8(bf->subband_index, ppWritePackedMsg, end) && + push8(bf->num_antennas, ppWritePackedMsg, end) && + pusharray16(bf->bf_value, NFAPI_MAX_NUM_ANTENNAS, bf->num_antennas, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_dlsch_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel8_t *value = (nfapi_dl_config_dlsch_pdu_rel8_t *)tlv; + return ( push16(value->length, ppWritePackedMsg, end) && + push16(value->pdu_index, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->resource_allocation_type, ppWritePackedMsg, end) && + push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) && + push32(value->resource_block_coding, ppWritePackedMsg, end) && + push8(value->modulation, ppWritePackedMsg, end) && + push8(value->redundancy_version, ppWritePackedMsg, end) && + push8(value->transport_blocks, ppWritePackedMsg, end) && + push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) && + push8(value->transmission_scheme, ppWritePackedMsg, end) && + push8(value->number_of_layers, ppWritePackedMsg, end) && + push8(value->number_of_subbands, ppWritePackedMsg, end) && + pusharray8(value->codebook_index, NFAPI_MAX_NUM_SUBBANDS, value->number_of_subbands, ppWritePackedMsg, end) && + push8(value->ue_category_capacity, ppWritePackedMsg, end) && + push8(value->pa, ppWritePackedMsg, end) && + push8(value->delta_power_offset_index, ppWritePackedMsg, end) && + push8(value->ngap, ppWritePackedMsg, end) && + push8(value->nprb, ppWritePackedMsg, end) && + push8(value->transmission_mode, ppWritePackedMsg, end) && + push8(value->num_bf_prb_per_subband, ppWritePackedMsg, end) && + push8(value->num_bf_vector, ppWritePackedMsg, end) && + packarray(value->bf_vector, sizeof(nfapi_bf_vector_t), NFAPI_MAX_BF_VECTORS, value->num_bf_vector, ppWritePackedMsg, end, &pack_bf_vector_info)); +} +static uint8_t pack_dl_config_dlsch_pdu_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel9_t *value = (nfapi_dl_config_dlsch_pdu_rel9_t *)tlv; + return ( push8(value->nscid, ppWritePackedMsg, end) ); +} +static uint8_t pack_dl_config_dlsch_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel10_t *value = (nfapi_dl_config_dlsch_pdu_rel10_t *)tlv; + return ( push8(value->csi_rs_flag, ppWritePackedMsg, end) && + push8(value->csi_rs_resource_config_r10, ppWritePackedMsg, end) && + push16(value->csi_rs_zero_tx_power_resource_config_bitmap_r10, ppWritePackedMsg, end) && + push8(value->csi_rs_number_nzp_configuration, ppWritePackedMsg, end) && + pusharray8(value->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, value->csi_rs_number_nzp_configuration, ppWritePackedMsg, end) && + push8(value->pdsch_start, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_dlsch_pdu_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel11_t *value = (nfapi_dl_config_dlsch_pdu_rel11_t *)tlv; + return( push8(value->drms_config_flag, ppWritePackedMsg, end) && + push16(value->drms_scrambling, ppWritePackedMsg, end) && + push8(value->csi_config_flag, ppWritePackedMsg, end) && + push16(value->csi_scrambling, ppWritePackedMsg, end) && + push8(value->pdsch_re_mapping_flag, ppWritePackedMsg, end) && + push8(value->pdsch_re_mapping_atenna_ports, ppWritePackedMsg, end) && + push8(value->pdsch_re_mapping_freq_shift, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_dlsch_pdu_rel12_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel12_t *value = (nfapi_dl_config_dlsch_pdu_rel12_t *)tlv; + return( push8(value->altcqi_table_r12, ppWritePackedMsg, end) && + push8(value->maxlayers, ppWritePackedMsg, end) && + push8(value->n_dl_harq, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_dlsch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel13_t *value = (nfapi_dl_config_dlsch_pdu_rel13_t *)tlv; + return( push8(value->dwpts_symbols, ppWritePackedMsg, end) && + push8(value->initial_lbt_sf, ppWritePackedMsg, end) && + push8(value->ue_type, ppWritePackedMsg, end) && + push8(value->pdsch_payload_type, ppWritePackedMsg, end) && + push16(value->initial_transmission_sf_io, ppWritePackedMsg, end) && + push8(value->drms_table_flag, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_pch_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_pch_pdu_rel8_t *value = (nfapi_dl_config_pch_pdu_rel8_t *)tlv; + return( push16(value->length, ppWritePackedMsg, end) && + push16(value->pdu_index, ppWritePackedMsg, end) && + push16(value->p_rnti, ppWritePackedMsg, end) && + push8(value->resource_allocation_type, ppWritePackedMsg, end) && + push8(value->virtual_resource_block_assignment_flag, ppWritePackedMsg, end) && + push32(value->resource_block_coding, ppWritePackedMsg, end) && + push8(value->mcs, ppWritePackedMsg, end) && + push8(value->redundancy_version, ppWritePackedMsg, end) && + push8(value->number_of_transport_blocks, ppWritePackedMsg, end) && + push8(value->transport_block_to_codeword_swap_flag, ppWritePackedMsg, end) && + push8(value->transmission_scheme, ppWritePackedMsg, end) && + push8(value->number_of_layers, ppWritePackedMsg, end) && + push8(value->codebook_index, ppWritePackedMsg, end) && + push8(value->ue_category_capacity, ppWritePackedMsg, end) && + push8(value->pa, ppWritePackedMsg, end) && + push16(value->transmission_power, ppWritePackedMsg, end) && + push8(value->nprb, ppWritePackedMsg, end) && + push8(value->ngap, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_pch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_pch_pdu_rel13_t *value = (nfapi_dl_config_pch_pdu_rel13_t *)tlv; + return ( push8(value->ue_mode, ppWritePackedMsg, end) && + push16(value->initial_transmission_sf_io, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_prs_pdu_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_prs_pdu_rel9_t *value = (nfapi_dl_config_prs_pdu_rel9_t *)tlv; + return( push16(value->transmission_power, ppWritePackedMsg, end) && + push8(value->prs_bandwidth, ppWritePackedMsg, end) && + push8(value->prs_cyclic_prefix_type, ppWritePackedMsg, end) && + push8(value->prs_muting, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_csi_rs_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_csi_rs_pdu_rel10_t *value = (nfapi_dl_config_csi_rs_pdu_rel10_t *)tlv; + return( push8(value->csi_rs_antenna_port_count_r10, ppWritePackedMsg, end) && + push8(value->csi_rs_resource_config_r10, ppWritePackedMsg, end) && + push16(value->transmission_power, ppWritePackedMsg, end) && + push16(value->csi_rs_zero_tx_power_resource_config_bitmap_r10, ppWritePackedMsg, end) && + push8(value->csi_rs_number_of_nzp_configuration, ppWritePackedMsg, end) && + pusharray8(value->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, value->csi_rs_number_of_nzp_configuration, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_csi_rs_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_csi_rs_pdu_rel13_t *value = (nfapi_dl_config_csi_rs_pdu_rel13_t *)tlv; + + if(!(push8(value->csi_rs_class, ppWritePackedMsg, end) && + push8(value->cdm_type, ppWritePackedMsg, end) && + push8(value->num_bf_vector, ppWritePackedMsg, end))) { + return 0; + } + + uint16_t i; + + for(i = 0; i < value->num_bf_vector; ++i) { + if(!(push8(value->bf_vector[i].csi_rs_resource_index, ppWritePackedMsg, end) && + pusharray16(value->bf_vector[i].bf_value, NFAPI_MAX_ANTENNA_PORT_COUNT, NFAPI_MAX_ANTENNA_PORT_COUNT, ppWritePackedMsg, end))) + return 0; + } + + return 1; +} +static uint8_t pack_bf_vector(nfapi_bf_vector_t *vector, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( push8(vector->subband_index, ppWritePackedMsg, end) && + push8(vector->num_antennas, ppWritePackedMsg, end) && + pusharray16(vector->bf_value, NFAPI_MAX_NUM_ANTENNAS, vector->num_antennas, ppWritePackedMsg, end)); +} + +static uint8_t pack_dl_config_epdcch_parameters_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_epdcch_parameters_rel11_t *value = (nfapi_dl_config_epdcch_parameters_rel11_t *)tlv; + return ( push8(value->epdcch_resource_assignment_flag, ppWritePackedMsg, end) && + push16(value->epdcch_id, ppWritePackedMsg, end) && + push8(value->epdcch_start_symbol, ppWritePackedMsg, end) && + push8(value->epdcch_num_prb, ppWritePackedMsg, end) && + pusharray8(value->epdcch_prb_index, NFAPI_MAX_EPDCCH_PRB, value->epdcch_num_prb, ppWritePackedMsg, end) && + pack_bf_vector(&value->bf_vector, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_epdcch_parameters_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_epdcch_parameters_rel13_t *value = (nfapi_dl_config_epdcch_parameters_rel13_t *)tlv; + return (push8(value->dwpts_symbols, ppWritePackedMsg, end) && + push8(value->initial_lbt_sf, ppWritePackedMsg, end)); +} +static uint8_t pack_dl_config_mpdcch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_mpdcch_pdu_rel13_t *value = (nfapi_dl_config_mpdcch_pdu_rel13_t *)tlv; + return ( push8(value->mpdcch_narrow_band, ppWritePackedMsg, end) && + push8(value->number_of_prb_pairs, ppWritePackedMsg, end) && + push8(value->resource_block_assignment, ppWritePackedMsg, end) && + push8(value->mpdcch_tansmission_type, ppWritePackedMsg, end) && + push8(value->start_symbol, ppWritePackedMsg, end) && + push8(value->ecce_index, ppWritePackedMsg, end) && + push8(value->aggregation_level, ppWritePackedMsg, end) && + push8(value->rnti_type, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->ce_mode, ppWritePackedMsg, end) && + push16(value->drms_scrambling_init, ppWritePackedMsg, end) && + push16(value->initial_transmission_sf_io, ppWritePackedMsg, end) && + push16(value->transmission_power, ppWritePackedMsg, end) && + push8(value->dci_format, ppWritePackedMsg, end) && + push16(value->resource_block_coding, ppWritePackedMsg, end) && + push8(value->mcs, ppWritePackedMsg, end) && + push8(value->pdsch_reptition_levels, ppWritePackedMsg, end) && + push8(value->redundancy_version, ppWritePackedMsg, end) && + push8(value->new_data_indicator, ppWritePackedMsg, end) && + push8(value->harq_process, ppWritePackedMsg, end) && + push8(value->tpmi_length, ppWritePackedMsg, end) && + push8(value->tpmi, ppWritePackedMsg, end) && + push8(value->pmi_flag, ppWritePackedMsg, end) && + push8(value->pmi, ppWritePackedMsg, end) && + push8(value->harq_resource_offset, ppWritePackedMsg, end) && + push8(value->dci_subframe_repetition_number, ppWritePackedMsg, end) && + push8(value->tpc, ppWritePackedMsg, end) && + push8(value->downlink_assignment_index_length, ppWritePackedMsg, end) && + push8(value->downlink_assignment_index, ppWritePackedMsg, end) && + push8(value->allocate_prach_flag, ppWritePackedMsg, end) && + push8(value->preamble_index, ppWritePackedMsg, end) && + push8(value->prach_mask_index, ppWritePackedMsg, end) && + push8(value->starting_ce_level, ppWritePackedMsg, end) && + push8(value->srs_request, ppWritePackedMsg, end) && + push8(value->antenna_ports_and_scrambling_identity_flag, ppWritePackedMsg, end) && + push8(value->antenna_ports_and_scrambling_identity, ppWritePackedMsg, end) && + push8(value->frequency_hopping_enabled_flag, ppWritePackedMsg, end) && + push8(value->paging_direct_indication_differentiation_flag, ppWritePackedMsg, end) && + push8(value->direct_indication, ppWritePackedMsg, end) && + push8(value->total_dci_length_including_padding, ppWritePackedMsg, end) && + push8(value->number_of_tx_antenna_ports, ppWritePackedMsg, end) && + pusharray16(value->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, value->number_of_tx_antenna_ports, ppWritePackedMsg, end)); +} + + +static uint8_t pack_dl_config_nbch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_nbch_pdu_rel13_t *value = (nfapi_dl_config_nbch_pdu_rel13_t *)tlv; + return (push16(value->length, ppWritePackedMsg, end) && + push16(value->pdu_index, ppWritePackedMsg, end) && + push16(value->transmission_power, ppWritePackedMsg, end) && + push16(value->hyper_sfn_2_lsbs, ppWritePackedMsg, end)); +} + + +static uint8_t pack_dl_config_npdcch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_npdcch_pdu_rel13_t *value = (nfapi_dl_config_npdcch_pdu_rel13_t *)tlv; + return (push16(value->length, ppWritePackedMsg, end) && + push16(value->pdu_index, ppWritePackedMsg, end) && + push8(value->ncce_index, ppWritePackedMsg, end) && + push8(value->aggregation_level, ppWritePackedMsg, end) && + push8(value->start_symbol, ppWritePackedMsg, end) && + push8(value->rnti_type, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->scrambling_reinitialization_batch_index, ppWritePackedMsg, end) && + push8(value->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end) && + push8(value->dci_format, ppWritePackedMsg, end) && + push8(value->scheduling_delay, ppWritePackedMsg, end) && + push8(value->resource_assignment, ppWritePackedMsg, end) && + push8(value->repetition_number, ppWritePackedMsg, end) && + push8(value->mcs, ppWritePackedMsg, end) && + push8(value->new_data_indicator, ppWritePackedMsg, end) && + push8(value->harq_ack_resource, ppWritePackedMsg, end) && + push8(value->npdcch_order_indication, ppWritePackedMsg, end) && + push8(value->starting_number_of_nprach_repetitions, ppWritePackedMsg, end) && + push8(value->subcarrier_indication_of_nprach, ppWritePackedMsg, end) && + push8(value->paging_direct_indication_differentation_flag, ppWritePackedMsg, end) && + push8(value->direct_indication, ppWritePackedMsg, end) && + push8(value->dci_subframe_repetition_number, ppWritePackedMsg, end) && + push8(value->total_dci_length_including_padding, ppWritePackedMsg, end)); +} + +static uint8_t pack_dl_config_ndlsch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_ndlsch_pdu_rel13_t *value = (nfapi_dl_config_ndlsch_pdu_rel13_t *)tlv; + return (push16(value->length, ppWritePackedMsg, end) && + push16(value->pdu_index, ppWritePackedMsg, end) && + push8(value->start_symbol, ppWritePackedMsg, end) && + push8(value->rnti_type, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push16(value->resource_assignment, ppWritePackedMsg, end) && + push16(value->repetition_number, ppWritePackedMsg, end) && + push8(value->modulation, ppWritePackedMsg, end) && + push8(value->number_of_subframes_for_resource_assignment, ppWritePackedMsg, end) && + push8(value->scrambling_sequence_initialization_cinit, ppWritePackedMsg, end) && + push16(value->sf_idx, ppWritePackedMsg, end) && + push8(value->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end)); +} + + +static uint8_t pack_dl_tti_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_dl_tti_request_pdu_t *value = (nfapi_nr_dl_tti_request_pdu_t *)tlv; + + if(!(push32(value->PDUSize, ppWritePackedMsg, end) && + push16(value->PDUType, ppWritePackedMsg, end) )) + return 0; + + // first match the pdu type, then call the respective function + switch(value->PDUType) { + case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE: { + if(!(pack_dl_tti_csi_rs_pdu_rel15_value(&value->csi_rs_pdu.csi_rs_pdu_rel15,ppWritePackedMsg,end))) + return 0; + } + break; + + case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE: { + if(!(pack_dl_tti_pdcch_pdu_rel15_value(&value->pdcch_pdu.pdcch_pdu_rel15,ppWritePackedMsg,end))) + return 0; + } + break; + + case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE: { + if(!(pack_dl_tti_pdsch_pdu_rel15_value(&value->pdsch_pdu.pdsch_pdu_rel15,ppWritePackedMsg,end))) + return 0; + } + break; + + case NFAPI_NR_DL_TTI_SSB_PDU_TYPE: { + if(!(pack_dl_tti_ssb_pdu_rel15_value(&value->ssb_pdu.ssb_pdu_rel15,ppWritePackedMsg,end))) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid DL_TTI pdu type %d \n", value->PDUType ); + } + break; + } + + return 1; +} + +static uint8_t pack_dl_config_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_dl_config_request_body_t *value = (nfapi_dl_config_request_body_t *)tlv; + + //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() dci:%u pdu:%u pdsch:%u rnti:%u pcfich:%u\n", __FUNCTION__, value->number_dci, value->number_pdu, value->number_pdsch_rnti, value->transmission_power_pcfich); + + if(!(push8(value->number_pdcch_ofdm_symbols, ppWritePackedMsg, end) && + push8(value->number_dci, ppWritePackedMsg, end) && + push16(value->number_pdu, ppWritePackedMsg, end) && + push8(value->number_pdsch_rnti, ppWritePackedMsg, end) && + push16(value->transmission_power_pcfich, ppWritePackedMsg, end))) { + return 0; + } + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_pdu; + + for(; i < total_number_of_pdus; ++i) { + nfapi_dl_config_request_pdu_t *pdu = &(value->dl_config_pdu_list[i]); + + if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) + return 0; + + // Put a 0 size in and then determine the size after the pdu + // has been writen and write the calculated size + uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; + pdu->pdu_size = 0; + + if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) + return 0; + + switch(pdu->pdu_type) { + case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: { + //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE\n", __FUNCTION__); + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel8_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel9_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel10_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel11_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel12_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel13_value))) { + return 0; + } + } + break; + + case NFAPI_DL_CONFIG_BCH_PDU_TYPE: { + //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE\n", __FUNCTION__); + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG, &pdu->bch_pdu.bch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_bch_pdu_rel8_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_MCH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG, &pdu->mch_pdu.mch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_mch_pdu_rel8_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel8_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel9_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel10_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel11_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel12_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dlsch_pdu_rel13_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_PCH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG, &pdu->pch_pdu.pch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_pch_pdu_rel8_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG, &pdu->pch_pdu.pch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_pch_pdu_rel13_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_PRS_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG, &pdu->prs_pdu.prs_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_prs_pdu_rel9_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_csi_rs_pdu_rel10_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_csi_rs_pdu_rel13_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel8, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel8_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel9, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel9_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel10, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel10_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel11, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel11_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel12, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel12_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_dci_dl_pdu_rel13_value) && + pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG, &pdu->epdcch_pdu.epdcch_params_rel11, ppWritePackedMsg, end, &pack_dl_config_epdcch_parameters_rel11_value) & + pack_tlv(NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG, &pdu->epdcch_pdu.epdcch_params_rel13, ppWritePackedMsg, end, &pack_dl_config_epdcch_parameters_rel13_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG, &pdu->mpdcch_pdu.mpdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_mpdcch_pdu_rel13_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_NBCH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG, &pdu->nbch_pdu.nbch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_nbch_pdu_rel13_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG, &pdu->npdcch_pdu.npdcch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_npdcch_pdu_rel13_value))) + return 0; + } + break; + + case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG, &pdu->ndlsch_pdu.ndlsch_pdu_rel13, ppWritePackedMsg, end, &pack_dl_config_ndlsch_pdu_rel13_value))) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type ); + } + break; + }; + + // add 1 for the pdu_type. The delta will include the pdu_size + pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); + + push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); + } + + return 1; +} + + +static uint8_t pack_dl_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg; + + if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && + push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && + push8(pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end) && + push8(pNfapiMsg->dl_tti_request_body.nPDUs, ppWritePackedMsg, end) && + pusharray8(pNfapiMsg->dl_tti_request_body.nUe,256,pNfapiMsg->dl_tti_request_body.nGroup, ppWritePackedMsg, end) + //pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end) + )) + return 0; + + int arr[12]; + + for(int i=0; idl_tti_request_body.nGroup; i++) { + for(int j=0; jdl_tti_request_body.nUe[i]; j++) { + arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j]; + } + + if(!(pusharrays32(arr,12,pNfapiMsg->dl_tti_request_body.nUe[i],ppWritePackedMsg, end))) + return 0; + } + + for(int i=0; idl_tti_request_body.nPDUs; i++) { + if(!pack_dl_tti_request_body_value(&pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i],ppWritePackedMsg,end)) + return 0; + } + + return 1; +} + + +static uint8_t pack_dl_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_dl_config_request_t *pNfapiMsg = (nfapi_dl_config_request_t *)msg; + //return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + //pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value) && + //pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); + { + uint8_t x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end); + uint8_t y = pack_tlv(NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, ppWritePackedMsg, end, &pack_dl_config_request_body_value); + uint8_t z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); + + if (!x || !y || !z) { + NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST x:%u y:%u z:%u \n", __FUNCTION__,x,y,z); + } + + return x && y && z; + } +} + + + + +static uint8_t pack_ul_config_request_ulsch_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_pdu_rel8_t *ulsch_pdu_rel8 = (nfapi_ul_config_ulsch_pdu_rel8_t *)tlv; + return( push32(ulsch_pdu_rel8->handle, ppWritePackedMsg, end) && + push16(ulsch_pdu_rel8->size, ppWritePackedMsg, end) && + push16(ulsch_pdu_rel8->rnti, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->resource_block_start, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->modulation_type, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->frequency_hopping_enabled_flag, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->frequency_hopping_bits, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->new_data_indication, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->redundancy_version, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->harq_process_number, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->ul_tx_mode, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->current_tx_nb, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel8->n_srs, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_ulsch_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_pdu_rel10_t *ulsch_pdu_rel10 = (nfapi_ul_config_ulsch_pdu_rel10_t *)tlv; + return (push8(ulsch_pdu_rel10->resource_allocation_type, ppWritePackedMsg, end) && + push32(ulsch_pdu_rel10->resource_block_coding, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel10->transport_blocks, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel10->transmission_scheme, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel10->number_of_layers, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel10->codebook_index, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel10->disable_sequence_hopping_flag, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_ulsch_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_pdu_rel11_t *ulsch_pdu_rel11 = (nfapi_ul_config_ulsch_pdu_rel11_t *)tlv; + return (push8(ulsch_pdu_rel11->virtual_cell_id_enabled_flag, ppWritePackedMsg, end) && + push16(ulsch_pdu_rel11->npusch_identity, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel11->dmrs_config_flag, ppWritePackedMsg, end) && + push16(ulsch_pdu_rel11->ndmrs_csh_identity, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_ulsch_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_pdu_rel13_t *ulsch_pdu_rel13 = (nfapi_ul_config_ulsch_pdu_rel13_t *)tlv; + return (push8(ulsch_pdu_rel13->ue_type, ppWritePackedMsg, end) && + push16(ulsch_pdu_rel13->total_number_of_repetitions, ppWritePackedMsg, end) && + push16(ulsch_pdu_rel13->repetition_number, ppWritePackedMsg, end) && + push16(ulsch_pdu_rel13->initial_transmission_sf_io, ppWritePackedMsg, end) && + push8(ulsch_pdu_rel13->empty_symbols_due_to_re_tunning, ppWritePackedMsg, end)); +} + +//Pack fns for ul_tti PDUS + + +static uint8_t pack_ul_tti_request_prach_pdu(nfapi_nr_prach_pdu_t *prach_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { + return( + push16(prach_pdu->phys_cell_id, ppWritePackedMsg, end) && + push8(prach_pdu->num_prach_ocas, ppWritePackedMsg, end) && + push8(prach_pdu->prach_format, ppWritePackedMsg, end) && + push8(prach_pdu->num_ra, ppWritePackedMsg, end) && + push8(prach_pdu->prach_start_symbol, ppWritePackedMsg, end) && + push16(prach_pdu->num_cs, ppWritePackedMsg, end) + // TODO: ignoring beamforming tlv for now + ); +} + +static uint8_t pack_ul_tti_request_pucch_pdu(nfapi_nr_pucch_pdu_t *pucch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { + return( + push16(pucch_pdu->rnti, ppWritePackedMsg, end) && + push32(pucch_pdu->handle, ppWritePackedMsg, end) && + push16(pucch_pdu->bwp_size, ppWritePackedMsg, end) && + push16(pucch_pdu->bwp_start, ppWritePackedMsg, end) && + push8(pucch_pdu->subcarrier_spacing, ppWritePackedMsg, end) && + push8(pucch_pdu->cyclic_prefix, ppWritePackedMsg, end) && + push8(pucch_pdu->format_type, ppWritePackedMsg, end) && + push8(pucch_pdu->multi_slot_tx_indicator, ppWritePackedMsg, end) && + push16(pucch_pdu->prb_start, ppWritePackedMsg, end) && + push16(pucch_pdu->prb_size, ppWritePackedMsg, end) && + push8(pucch_pdu->start_symbol_index, ppWritePackedMsg, end) && + push8(pucch_pdu->nr_of_symbols, ppWritePackedMsg, end) && + push8(pucch_pdu->freq_hop_flag, ppWritePackedMsg, end) && + push16(pucch_pdu->second_hop_prb, ppWritePackedMsg, end) && + push8(pucch_pdu->group_hop_flag, ppWritePackedMsg, end) && + push8(pucch_pdu->sequence_hop_flag, ppWritePackedMsg, end) && + push16(pucch_pdu->hopping_id, ppWritePackedMsg, end) && + push16(pucch_pdu->initial_cyclic_shift, ppWritePackedMsg, end) && + push16(pucch_pdu->data_scrambling_id, ppWritePackedMsg, end) && + push8(pucch_pdu->time_domain_occ_idx, ppWritePackedMsg, end) && + push8(pucch_pdu->pre_dft_occ_idx, ppWritePackedMsg, end) && + push8(pucch_pdu->pre_dft_occ_len, ppWritePackedMsg, end) && + push8(pucch_pdu->add_dmrs_flag, ppWritePackedMsg, end) && + push16(pucch_pdu->dmrs_scrambling_id, ppWritePackedMsg, end) && + push8(pucch_pdu->dmrs_cyclic_shift, ppWritePackedMsg, end) && + push8(pucch_pdu->sr_flag, ppWritePackedMsg, end) && + push8(pucch_pdu->bit_len_harq, ppWritePackedMsg, end) && + push16(pucch_pdu->bit_len_csi_part1, ppWritePackedMsg, end) && + push16(pucch_pdu->bit_len_csi_part2, ppWritePackedMsg, end) + // TODO: ignoring beamforming tlv for now + ); +} + + +static uint8_t pack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { + if (!( + push16(pusch_pdu->pdu_bit_map, ppWritePackedMsg, end) && + push16(pusch_pdu->rnti, ppWritePackedMsg, end) && + push32(pusch_pdu->handle, ppWritePackedMsg, end) && + push16(pusch_pdu->bwp_size, ppWritePackedMsg, end) && + push16(pusch_pdu->bwp_start, ppWritePackedMsg, end) && + push8(pusch_pdu->subcarrier_spacing, ppWritePackedMsg, end) && + push8(pusch_pdu->cyclic_prefix, ppWritePackedMsg, end) && + push16(pusch_pdu->target_code_rate, ppWritePackedMsg, end) && + push8(pusch_pdu->qam_mod_order, ppWritePackedMsg, end) && + push8(pusch_pdu->mcs_index, ppWritePackedMsg, end) && + push8(pusch_pdu->mcs_table, ppWritePackedMsg, end) && + push8(pusch_pdu->transform_precoding, ppWritePackedMsg, end) && + push16(pusch_pdu->data_scrambling_id, ppWritePackedMsg, end) && + push8(pusch_pdu->nrOfLayers, ppWritePackedMsg, end) && + push16(pusch_pdu->ul_dmrs_symb_pos, ppWritePackedMsg, end) && + push8(pusch_pdu->dmrs_config_type, ppWritePackedMsg, end) && + push16(pusch_pdu->ul_dmrs_scrambling_id, ppWritePackedMsg, end) && + push8(pusch_pdu->scid, ppWritePackedMsg, end) && + push8(pusch_pdu->num_dmrs_cdm_grps_no_data, ppWritePackedMsg, end) && + push16(pusch_pdu->dmrs_ports, ppWritePackedMsg, end) && + push8(pusch_pdu->resource_alloc, ppWritePackedMsg, end) && + push8(pusch_pdu->resource_alloc,ppWritePackedMsg, end) && + push16(pusch_pdu->dmrs_ports, ppWritePackedMsg, end) && + push16(pusch_pdu->rb_start, ppWritePackedMsg, end) && + push16(pusch_pdu->rb_size, ppWritePackedMsg, end) && + push8(pusch_pdu->vrb_to_prb_mapping, ppWritePackedMsg, end) && + push8(pusch_pdu->frequency_hopping, ppWritePackedMsg, end) && + push16(pusch_pdu->tx_direct_current_location, ppWritePackedMsg, end) && + push8(pusch_pdu->uplink_frequency_shift_7p5khz, ppWritePackedMsg, end) && + push8(pusch_pdu->start_symbol_index, ppWritePackedMsg, end) && + push8(pusch_pdu->nr_of_symbols, ppWritePackedMsg, end) + // TODO: ignoring beamforming tlv for now + )) + return 0; + + //Pack Optional Data only included if indicated in pduBitmap + switch(pusch_pdu->pdu_bit_map) { + case PUSCH_PDU_BITMAP_PUSCH_DATA: { + // pack optional TLVs + return( + push8(pusch_pdu->pusch_data.rv_index, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_data.harq_process_id, ppWritePackedMsg, end) && + push32(pusch_pdu->pusch_data.tb_size, ppWritePackedMsg, end) && + push16(pusch_pdu->pusch_data.num_cb, ppWritePackedMsg, end) && + pusharray8(pusch_pdu->pusch_data.cb_present_and_position,1,1,ppWritePackedMsg, end) + ); + } + break; + + case PUSCH_PDU_BITMAP_PUSCH_UCI: { + return( + push16(pusch_pdu->pusch_uci.harq_ack_bit_length, ppWritePackedMsg, end) && + push16(pusch_pdu->pusch_uci.csi_part1_bit_length, ppWritePackedMsg, end) && + push16(pusch_pdu->pusch_uci.csi_part2_bit_length, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_uci.alpha_scaling, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_uci.beta_offset_harq_ack, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_uci.beta_offset_csi1, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_uci.beta_offset_csi2, ppWritePackedMsg, end) + ); + } + break; + + case PUSCH_PDU_BITMAP_PUSCH_PTRS: { + return( + push8(pusch_pdu->pusch_ptrs.num_ptrs_ports, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_dmrs_port, ppWritePackedMsg, end) && + push16(pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_port_index, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_re_offset, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_ptrs.ptrs_time_density, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_ptrs.ptrs_freq_density, ppWritePackedMsg, end) && + push8(pusch_pdu->pusch_ptrs.ul_ptrs_power, ppWritePackedMsg, end) + ); + } + break; + + case PUSCH_PDU_BITMAP_DFTS_OFDM: { + return( + push8(pusch_pdu->dfts_ofdm.low_papr_group_number, ppWritePackedMsg, end) && + push16(pusch_pdu->dfts_ofdm.low_papr_sequence_number, ppWritePackedMsg, end) && + push8(pusch_pdu->dfts_ofdm.ul_ptrs_sample_density, ppWritePackedMsg, end) && + push8(pusch_pdu->dfts_ofdm.ul_ptrs_time_density_transform_precoding, ppWritePackedMsg, end) + ); + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_INFO, "Invalid pdu bitmap %d \n", pusch_pdu->pdu_bit_map ); + } + } + + return 1; +} + +static uint8_t pack_ul_tti_request_srs_pdu(nfapi_nr_srs_pdu_t *srs_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { + return( + push16(srs_pdu->rnti, ppWritePackedMsg, end) && + push32(srs_pdu->handle, ppWritePackedMsg, end) && + push16(srs_pdu->bwp_size, ppWritePackedMsg, end) && + push16(srs_pdu->bwp_start, ppWritePackedMsg, end) && + push8(srs_pdu->subcarrier_spacing, ppWritePackedMsg, end) && + push8(srs_pdu->cyclic_prefix, ppWritePackedMsg, end) && + push8(srs_pdu->num_ant_ports, ppWritePackedMsg, end) && + push8(srs_pdu->num_symbols, ppWritePackedMsg, end) && + push8(srs_pdu->num_repetitions, ppWritePackedMsg, end) && + push8(srs_pdu->time_start_position, ppWritePackedMsg, end) && + push8(srs_pdu->config_index, ppWritePackedMsg, end) && + push16(srs_pdu->sequence_id, ppWritePackedMsg, end) && + push8(srs_pdu->bandwidth_index, ppWritePackedMsg, end) && + push8(srs_pdu->comb_size, ppWritePackedMsg, end) && + push8(srs_pdu->comb_offset, ppWritePackedMsg, end) && + push8(srs_pdu->cyclic_shift, ppWritePackedMsg, end) && + push8(srs_pdu->frequency_position, ppWritePackedMsg, end) && + push8(srs_pdu->frequency_shift, ppWritePackedMsg, end) && + push8(srs_pdu->frequency_hopping, ppWritePackedMsg, end) && + push8(srs_pdu->group_or_sequence_hopping, ppWritePackedMsg, end) && + push8(srs_pdu->resource_type, ppWritePackedMsg, end) && + push16(srs_pdu->t_srs, ppWritePackedMsg, end) && + push16(srs_pdu->t_offset, ppWritePackedMsg, end) + // TODO: ignoring beamforming tlv for now + ); +} + +static uint8_t pack_ul_config_request_ulsch_pdu(nfapi_ul_config_ulsch_pdu *ulsch_pdu, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG, &ulsch_pdu->ulsch_pdu_rel8, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel8_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG, &ulsch_pdu->ulsch_pdu_rel10, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel10_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG, &ulsch_pdu->ulsch_pdu_rel11, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel11_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG, &ulsch_pdu->ulsch_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_rel13_value)); +} + +static uint8_t pack_ul_config_request_cqi_ri_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_ri_information_rel8_t *cqi_ri_info_rel8 = (nfapi_ul_config_cqi_ri_information_rel8_t *)tlv; + return ( push8(cqi_ri_info_rel8->dl_cqi_pmi_size_rank_1, ppWritePackedMsg, end) && + push8(cqi_ri_info_rel8->dl_cqi_pmi_size_rank_greater_1, ppWritePackedMsg, end) && + push8(cqi_ri_info_rel8->ri_size, ppWritePackedMsg, end) && + push8(cqi_ri_info_rel8->delta_offset_cqi, ppWritePackedMsg, end) && + push8(cqi_ri_info_rel8->delta_offset_ri, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_cqi_ri_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_ri_information_rel9_t *cqi_ri_info_rel9 = (nfapi_ul_config_cqi_ri_information_rel9_t *)tlv; + + if(!(push8(cqi_ri_info_rel9->report_type, ppWritePackedMsg, end) && + push8(cqi_ri_info_rel9->delta_offset_cqi, ppWritePackedMsg, end) && + push8(cqi_ri_info_rel9->delta_offset_ri, ppWritePackedMsg, end))) { + return 0; + } + + switch(cqi_ri_info_rel9->report_type) { + case NFAPI_CSI_REPORT_TYPE_PERIODIC: { + if(!(push8(cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size, ppWritePackedMsg, end) && + push8(cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.control_type, ppWritePackedMsg, end))) { + return 0; + } + } + break; + + case NFAPI_CSI_REPORT_TYPE_APERIODIC: { + if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc, ppWritePackedMsg, end) == 0) + return 0; + + uint8_t i; + + for(i = 0; i < cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc; ++i) { + if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size, ppWritePackedMsg, end) == 0) + return 0; + + uint8_t j; + + for(j = 0; j < 8; ++j) { + if(push8(cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size[j], ppWritePackedMsg, end) == 0) + return 0; + } + } + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel9->report_type ); + } + break; + }; + + return 1; +} + +static uint8_t pack_ul_config_request_cqi_ri_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_ri_information_rel13_t *cqi_ri_info_rel13 = (nfapi_ul_config_cqi_ri_information_rel13_t *)tlv; + + switch(cqi_ri_info_rel13->report_type) { + case NFAPI_CSI_REPORT_TYPE_PERIODIC: { + if(push16(cqi_ri_info_rel13->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size_2, ppWritePackedMsg, end) == 0) + return 0; + } + break; + + case NFAPI_CSI_REPORT_TYPE_APERIODIC: { + // No parameters + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel13->report_type ); + } + break; + }; + + return 1; +} + +static uint8_t pack_ul_config_request_cqi_ri_information(nfapi_ul_config_cqi_ri_information *cqi_ri_info, uint8_t **ppWritePackedMsg, uint8_t *end) { + return (pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG, &cqi_ri_info->cqi_ri_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel8_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG, &cqi_ri_info->cqi_ri_information_rel9, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel9_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG, &cqi_ri_info->cqi_ri_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_cqi_ri_rel13_value)); +} + +static uint8_t pack_ul_config_request_init_tx_params_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_initial_transmission_parameters_rel8_t *init_tx_params_rel8 = (nfapi_ul_config_initial_transmission_parameters_rel8_t *)tlv; + return (push8(init_tx_params_rel8->n_srs_initial, ppWritePackedMsg, end) && + push8(init_tx_params_rel8->initial_number_of_resource_blocks, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_initial_transmission_parameters(nfapi_ul_config_initial_transmission_parameters *init_tx_params, uint8_t **ppWritePackedMsg, uint8_t *end) { + return pack_tlv(NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG, &init_tx_params->initial_transmission_parameters_rel8, ppWritePackedMsg, end, + &pack_ul_config_request_init_tx_params_rel8_value); +} + +static uint8_t pack_ul_config_request_ulsch_harq_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_harq_information_rel10_t *harq_info_rel10 = (nfapi_ul_config_ulsch_harq_information_rel10_t *)tlv; + return (push8(harq_info_rel10->harq_size, ppWritePackedMsg, end) && + push8(harq_info_rel10->delta_offset_harq, ppWritePackedMsg, end) && + push8(harq_info_rel10->ack_nack_mode, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_ulsch_harq_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_harq_information_rel13_t *harq_info_rel13 = (nfapi_ul_config_ulsch_harq_information_rel13_t *)tlv; + return (push16(harq_info_rel13->harq_size_2, ppWritePackedMsg, end) && + push8(harq_info_rel13->delta_offset_harq_2, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_ulsch_harq_information(nfapi_ul_config_ulsch_harq_information *harq_info, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG, &harq_info->harq_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_harq_info_rel10_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG, &harq_info->harq_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ulsch_harq_info_rel13_value)); +} + +static uint8_t pack_ul_config_request_ue_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ue_information_rel8_t *ue_info_rel8 = (nfapi_ul_config_ue_information_rel8_t *)tlv; + return ( push32(ue_info_rel8->handle, ppWritePackedMsg, end) && + push16(ue_info_rel8->rnti, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_ue_info_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ue_information_rel11_t *ue_info_rel11 = (nfapi_ul_config_ue_information_rel11_t *)tlv; + return ( push8(ue_info_rel11->virtual_cell_id_enabled_flag, ppWritePackedMsg, end) && + push16(ue_info_rel11->npusch_identity, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_ue_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_ue_information_rel13_t *ue_info_rel13 = (nfapi_ul_config_ue_information_rel13_t *)tlv; + return ( push8(ue_info_rel13->ue_type, ppWritePackedMsg, end) && + push8(ue_info_rel13->empty_symbols, ppWritePackedMsg, end) && + push16(ue_info_rel13->total_number_of_repetitions, ppWritePackedMsg, end) && + push16(ue_info_rel13->repetition_number, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_ue_information(nfapi_ul_config_ue_information *ue_info, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &ue_info->ue_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel8_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &ue_info->ue_information_rel11, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel11_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &ue_info->ue_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_ue_info_rel13_value)); +} + +static uint8_t pack_ul_config_request_harq_info_rel10_tdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel10_tdd_t *harq_info_rel10_tdd = (nfapi_ul_config_harq_information_rel10_tdd_t *)tlv; + return ( push8(harq_info_rel10_tdd->harq_size, ppWritePackedMsg, end) && + push8(harq_info_rel10_tdd->ack_nack_mode, ppWritePackedMsg, end) && + push8(harq_info_rel10_tdd->number_of_pucch_resources, ppWritePackedMsg, end) && + push16(harq_info_rel10_tdd->n_pucch_1_0, ppWritePackedMsg, end) && + push16(harq_info_rel10_tdd->n_pucch_1_1, ppWritePackedMsg, end) && + push16(harq_info_rel10_tdd->n_pucch_1_2, ppWritePackedMsg, end) && + push16(harq_info_rel10_tdd->n_pucch_1_3, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_harq_info_rel8_fdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel8_fdd_t *harq_info_rel8_fdd = (nfapi_ul_config_harq_information_rel8_fdd_t *)tlv; + return ( push16(harq_info_rel8_fdd->n_pucch_1_0, ppWritePackedMsg, end) && + push8(harq_info_rel8_fdd->harq_size, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_harq_info_rel9_fdd_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel9_fdd_t *harq_info_rel9_fdd = (nfapi_ul_config_harq_information_rel9_fdd_t *)tlv; + return ( push8(harq_info_rel9_fdd->harq_size, ppWritePackedMsg, end) && + push8(harq_info_rel9_fdd->ack_nack_mode, ppWritePackedMsg, end) && + push8(harq_info_rel9_fdd->number_of_pucch_resources, ppWritePackedMsg, end) && + push16(harq_info_rel9_fdd->n_pucch_1_0, ppWritePackedMsg, end) && + push16(harq_info_rel9_fdd->n_pucch_1_1, ppWritePackedMsg, end) && + push16(harq_info_rel9_fdd->n_pucch_1_2, ppWritePackedMsg, end) && + push16(harq_info_rel9_fdd->n_pucch_1_3, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_harq_info_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel11_t *harq_info_rel11 = (nfapi_ul_config_harq_information_rel11_t *)tlv; + return ( push8(harq_info_rel11->num_ant_ports, ppWritePackedMsg, end) && + push16(harq_info_rel11->n_pucch_2_0, ppWritePackedMsg, end) && + push16(harq_info_rel11->n_pucch_2_1, ppWritePackedMsg, end) && + push16(harq_info_rel11->n_pucch_2_2, ppWritePackedMsg, end) && + push16(harq_info_rel11->n_pucch_2_3, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_harq_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel13_t *harq_info_rel13 = (nfapi_ul_config_harq_information_rel13_t *)tlv; + return ( push16(harq_info_rel13->harq_size_2, ppWritePackedMsg, end) && + push8(harq_info_rel13->starting_prb, ppWritePackedMsg, end) && + push8(harq_info_rel13->n_prb, ppWritePackedMsg, end) && + push8(harq_info_rel13->cdm_index, ppWritePackedMsg, end) && + push8(harq_info_rel13->n_srs, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_harq_information(nfapi_ul_config_harq_information *harq_info, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG, &harq_info->harq_information_rel10_tdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel10_tdd_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG, &harq_info->harq_information_rel8_fdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel8_fdd_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG, &harq_info->harq_information_rel9_fdd, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel9_fdd_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG, &harq_info->harq_information_rel11, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel11_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG, &harq_info->harq_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_harq_info_rel13_value)); +} + +static uint8_t pack_ul_config_request_cqi_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_information_rel8_t *cqi_info_rel8 = (nfapi_ul_config_cqi_information_rel8_t *)tlv; + return ( push16(cqi_info_rel8->pucch_index, ppWritePackedMsg, end) && + push8(cqi_info_rel8->dl_cqi_pmi_size, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_cqi_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_information_rel10_t *cqi_info_rel10 = (nfapi_ul_config_cqi_information_rel10_t *)tlv; + return ( push8(cqi_info_rel10->number_of_pucch_resource, ppWritePackedMsg, end) && + push16(cqi_info_rel10->pucch_index_p1, ppWritePackedMsg, end)); +} +static uint8_t pack_ul_config_request_cqi_info_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_information_rel13_t *cqi_info_rel13 = (nfapi_ul_config_cqi_information_rel13_t *)tlv; + return ( push8(cqi_info_rel13->csi_mode, ppWritePackedMsg, end) && + push16(cqi_info_rel13->dl_cqi_pmi_size_2, ppWritePackedMsg, end) && + push8(cqi_info_rel13->starting_prb, ppWritePackedMsg, end) && + push8(cqi_info_rel13->n_prb, ppWritePackedMsg, end) && + push8(cqi_info_rel13->cdm_index, ppWritePackedMsg, end) && + push8(cqi_info_rel13->n_srs, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_cqi_information(nfapi_ul_config_cqi_information *cqi_info, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG, &cqi_info->cqi_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel8_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG, &cqi_info->cqi_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel10_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG, &cqi_info->cqi_information_rel13, ppWritePackedMsg, end, &pack_ul_config_request_cqi_info_rel13_value)); +} + +static uint8_t pack_ul_config_request_sr_info_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_sr_information_rel8_t *sr_info_rel8 = (nfapi_ul_config_sr_information_rel8_t *)tlv; + return push16(sr_info_rel8->pucch_index, ppWritePackedMsg, end); +} +static uint8_t pack_ul_config_request_sr_info_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_sr_information_rel10_t *sr_info_rel10 = (nfapi_ul_config_sr_information_rel10_t *)tlv; + return ( push8(sr_info_rel10->number_of_pucch_resources, ppWritePackedMsg, end) && + push16(sr_info_rel10->pucch_index_p1, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_sr_information(nfapi_ul_config_sr_information *sr_info, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( pack_tlv(NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG, &sr_info->sr_information_rel8, ppWritePackedMsg, end, &pack_ul_config_request_sr_info_rel8_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG, &sr_info->sr_information_rel10, ppWritePackedMsg, end, &pack_ul_config_request_sr_info_rel10_value)); +} + +static uint8_t pack_ul_config_request_srs_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_srs_pdu_rel8_t *srs_pdu_rel8 = (nfapi_ul_config_srs_pdu_rel8_t *)tlv; + return (push32(srs_pdu_rel8->handle, ppWritePackedMsg, end) && + push16(srs_pdu_rel8->size, ppWritePackedMsg, end) && + push16(srs_pdu_rel8->rnti, ppWritePackedMsg, end) && + push8(srs_pdu_rel8->srs_bandwidth, ppWritePackedMsg, end) && + push8(srs_pdu_rel8->frequency_domain_position, ppWritePackedMsg, end) && + push8(srs_pdu_rel8->srs_hopping_bandwidth, ppWritePackedMsg, end) && + push8(srs_pdu_rel8->transmission_comb, ppWritePackedMsg, end) && + push16(srs_pdu_rel8->i_srs, ppWritePackedMsg, end) && + push8(srs_pdu_rel8->sounding_reference_cyclic_shift, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_srs_pdu_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_srs_pdu_rel10_t *srs_pdu_rel10 = (nfapi_ul_config_srs_pdu_rel10_t *)tlv; + return push8(srs_pdu_rel10->antenna_port, ppWritePackedMsg, end); +} + +static uint8_t pack_ul_config_request_srs_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_srs_pdu_rel13_t *srs_pdu_rel13 = (nfapi_ul_config_srs_pdu_rel13_t *)tlv; + return ( push8(srs_pdu_rel13->number_of_combs, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_nb_harq_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_nb_harq_information_rel13_fdd_t *nb_harq_pdu_rel13 = (nfapi_ul_config_nb_harq_information_rel13_fdd_t *)tlv; + return ( push8(nb_harq_pdu_rel13->harq_ack_resource, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_config_request_nulsch_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_nulsch_pdu_rel13_t *nulsch_pdu_rel13 = (nfapi_ul_config_nulsch_pdu_rel13_t *)tlv; + return (push8(nulsch_pdu_rel13->nulsch_format, ppWritePackedMsg, end) && + push32(nulsch_pdu_rel13->handle, ppWritePackedMsg, end) && + push16(nulsch_pdu_rel13->size, ppWritePackedMsg, end) && + push16(nulsch_pdu_rel13->rnti, ppWritePackedMsg, end) && + push8(nulsch_pdu_rel13->subcarrier_indication, ppWritePackedMsg, end) && + push8(nulsch_pdu_rel13->resource_assignment, ppWritePackedMsg, end) && + push8(nulsch_pdu_rel13->mcs, ppWritePackedMsg, end) && + push8(nulsch_pdu_rel13->redudancy_version, ppWritePackedMsg, end) && + push8(nulsch_pdu_rel13->repetition_number, ppWritePackedMsg, end) && + push8(nulsch_pdu_rel13->new_data_indication, ppWritePackedMsg, end) && + push8(nulsch_pdu_rel13->n_srs, ppWritePackedMsg, end) && + push16(nulsch_pdu_rel13->scrambling_sequence_initialization_cinit, ppWritePackedMsg, end) && + push16(nulsch_pdu_rel13->sf_idx, ppWritePackedMsg, end) && + pack_ul_config_request_ue_information(&(nulsch_pdu_rel13->ue_information), ppWritePackedMsg, end) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG, &nulsch_pdu_rel13->nb_harq_information.nb_harq_information_rel13_fdd, ppWritePackedMsg, end, + &pack_ul_config_request_nb_harq_rel13_value)); +} +static uint8_t pack_ul_config_request_nrach_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_nrach_pdu_rel13_t *nrach_pdu_rel13 = (nfapi_ul_config_nrach_pdu_rel13_t *)tlv; + return ( push8(nrach_pdu_rel13->nprach_config_0, ppWritePackedMsg, end) && + push8(nrach_pdu_rel13->nprach_config_1, ppWritePackedMsg, end) && + push8(nrach_pdu_rel13->nprach_config_2, ppWritePackedMsg, end)); +} + + + +static uint8_t pack_ul_tti_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_ul_tti_request_number_of_pdus_t *value = (nfapi_nr_ul_tti_request_number_of_pdus_t *)tlv; + + if(!(push16(value->pdu_size, ppWritePackedMsg, end) && + push16(value->pdu_type, ppWritePackedMsg, end) )) + return 0; + + // first match the pdu type, then call the respective function + switch(value->pdu_type) { + case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE: { + if(!pack_ul_tti_request_prach_pdu(&value->prach_pdu, ppWritePackedMsg, end)) + return 0; + } + break; + + case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE: { + if(!pack_ul_tti_request_pucch_pdu(&value->pucch_pdu, ppWritePackedMsg, end)) + return 0; + } + break; + + case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE: { + if(!pack_ul_tti_request_pusch_pdu(&value->pusch_pdu, ppWritePackedMsg, end)) + return 0; + } + break; + + case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE: { + if(!pack_ul_tti_request_srs_pdu(&value->srs_pdu, ppWritePackedMsg, end)) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid UL_TTI pdu type %d \n", value->pdu_type ); + } + break; + } + + return 1; +} + +static uint8_t pack_ul_tti_groups_list_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_ul_tti_request_number_of_groups_t *value = (nfapi_nr_ul_tti_request_number_of_groups_t *)tlv; + + if(!push8(value->n_ue, ppWritePackedMsg, end)) + return 0; + + for(int i=0; in_ue; i++) { + if(!push8(value->ue_list[i].pdu_idx, ppWritePackedMsg, end)) + return 0; + } + + return 1; +} + +static uint8_t pack_ul_config_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_config_request_body_t *value = (nfapi_ul_config_request_body_t *)tlv; + + if(!(push8(value->number_of_pdus, ppWritePackedMsg, end) && + push8(value->rach_prach_frequency_resources, ppWritePackedMsg, end) && + push8(value->srs_present, ppWritePackedMsg, end))) + return 0; + + uint16_t i = 0; + + for(i = 0; i < value->number_of_pdus; ++i) { + nfapi_ul_config_request_pdu_t *pdu = &(value->ul_config_pdu_list[i]); + + if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) + return 0; + + // Put a 0 size in and then determine the size after the pdu + // has been writen and write the calculated size + uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; + pdu->pdu_size = 0; + + if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) + return 0; + + switch(pdu->pdu_type) { + case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: { + if(!pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_pdu), ppWritePackedMsg, end)) + return 0; + } + break; + + case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: { + if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_cqi_ri_pdu.ulsch_pdu), ppWritePackedMsg, end) && + pack_ul_config_request_cqi_ri_information(&(pdu->ulsch_cqi_ri_pdu.cqi_ri_information), ppWritePackedMsg, end) && + pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_cqi_ri_pdu.initial_transmission_parameters), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: { + if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) && + pack_ul_config_request_ulsch_harq_information(&(pdu->ulsch_harq_pdu.harq_information), ppWritePackedMsg, end) && + pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_harq_pdu.initial_transmission_parameters), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: { + if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu), ppWritePackedMsg, end) && + pack_ul_config_request_cqi_ri_information(&(pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information), ppWritePackedMsg, end) && + pack_ul_config_request_ulsch_harq_information(&(pdu->ulsch_cqi_harq_ri_pdu.harq_information), ppWritePackedMsg, end) && + pack_ul_config_request_initial_transmission_parameters(&(pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: { + if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_pdu.ue_information), ppWritePackedMsg, end) && + pack_ul_config_request_cqi_information(&(pdu->uci_cqi_pdu.cqi_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: { + if(!(pack_ul_config_request_ue_information(&(pdu->uci_sr_pdu.ue_information), ppWritePackedMsg, end) && + pack_ul_config_request_sr_information(&(pdu->uci_sr_pdu.sr_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: { + if(!(pack_ul_config_request_ue_information(&(pdu->uci_harq_pdu.ue_information), ppWritePackedMsg, end) && + pack_ul_config_request_harq_information(&(pdu->uci_harq_pdu.harq_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: { + if(!(pack_ul_config_request_ue_information(&(pdu->uci_sr_harq_pdu.ue_information), ppWritePackedMsg, end) && + pack_ul_config_request_sr_information(&(pdu->uci_sr_harq_pdu.sr_information), ppWritePackedMsg, end) && + pack_ul_config_request_harq_information(&(pdu->uci_sr_harq_pdu.harq_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: { + if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_harq_pdu.ue_information), ppWritePackedMsg, end) && + pack_ul_config_request_cqi_information(&(pdu->uci_cqi_harq_pdu.cqi_information), ppWritePackedMsg, end) && + pack_ul_config_request_harq_information(&(pdu->uci_cqi_harq_pdu.harq_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: { + if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_sr_pdu.ue_information), ppWritePackedMsg, end) && + pack_ul_config_request_cqi_information(&(pdu->uci_cqi_sr_pdu.cqi_information), ppWritePackedMsg, end) && + pack_ul_config_request_sr_information(&(pdu->uci_cqi_sr_pdu.sr_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: { + if(!(pack_ul_config_request_ue_information(&(pdu->uci_cqi_sr_harq_pdu.ue_information), ppWritePackedMsg, end) && + pack_ul_config_request_cqi_information(&(pdu->uci_cqi_sr_harq_pdu.cqi_information), ppWritePackedMsg, end) && + pack_ul_config_request_sr_information(&(pdu->uci_cqi_sr_harq_pdu.sr_information), ppWritePackedMsg, end) && + pack_ul_config_request_harq_information(&(pdu->uci_cqi_sr_harq_pdu.harq_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_SRS_PDU_TYPE: { + if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG, &pdu->srs_pdu.srs_pdu_rel8, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel8_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG, &pdu->srs_pdu.srs_pdu_rel10, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel10_value) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG, &pdu->srs_pdu.srs_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_srs_pdu_rel13_value))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE: { + if(!(pack_ul_config_request_ue_information(&(pdu->harq_buffer_pdu.ue_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: { + if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_uci_csi_pdu.ulsch_pdu), ppWritePackedMsg, end) && + pack_ul_config_request_cqi_information(&(pdu->ulsch_uci_csi_pdu.csi_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: { + if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_uci_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) && + pack_ul_config_request_harq_information(&(pdu->ulsch_uci_harq_pdu.harq_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: { + if(!(pack_ul_config_request_ulsch_pdu(&(pdu->ulsch_csi_uci_harq_pdu.ulsch_pdu), ppWritePackedMsg, end) && + pack_ul_config_request_cqi_information(&(pdu->ulsch_csi_uci_harq_pdu.csi_information), ppWritePackedMsg, end) && + pack_ul_config_request_harq_information(&(pdu->ulsch_csi_uci_harq_pdu.harq_information), ppWritePackedMsg, end))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG, &pdu->nulsch_pdu.nulsch_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_nulsch_pdu_rel13_value))) + return 0; + } + break; + + case NFAPI_UL_CONFIG_NRACH_PDU_TYPE: { + if(!(pack_tlv(NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG, &pdu->nrach_pdu.nrach_pdu_rel13, ppWritePackedMsg, end, &pack_ul_config_request_nrach_pdu_rel13_value))) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type ); + } + break; + }; + + // add 1 for the pdu_type. The delta will include the pdu_size + pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); + + push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); + } + + return 1; +} + + +static uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg; + + if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && + push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && + push8(pNfapiMsg->n_pdus, ppWritePackedMsg, end) && + push8(pNfapiMsg->rach_present, ppWritePackedMsg, end) && + push8(pNfapiMsg->n_ulsch, ppWritePackedMsg, end) && + push8(pNfapiMsg->n_ulcch, ppWritePackedMsg, end) && + push8(pNfapiMsg->n_group, ppWritePackedMsg, end) )) + return 0; + + for(int i=0; in_pdus; i++) { + if(!pack_ul_tti_pdu_list_value(&pNfapiMsg->pdus_list[i], ppWritePackedMsg, end)) + return 0; + } + + for(int i=0; in_group; i++) { + if(!pack_ul_tti_groups_list_value(&pNfapiMsg->groups_list[i], ppWritePackedMsg, end)) + return 0; + } + + return 1; +} + + +static uint8_t pack_ul_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_ul_config_request_t *pNfapiMsg = (nfapi_ul_config_request_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_UL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->ul_config_request_body, ppWritePackedMsg, end, &pack_ul_config_request_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)) ; +} + +static uint8_t pack_hi_dci0_hi_rel8_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_hi_dci0_hi_pdu_rel8_t *hi_pdu_rel8 = (nfapi_hi_dci0_hi_pdu_rel8_t *)tlv; + return ( push8(hi_pdu_rel8->resource_block_start, ppWritePackedMsg, end) && + push8(hi_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) && + push8(hi_pdu_rel8->hi_value, ppWritePackedMsg, end) && + push8(hi_pdu_rel8->i_phich, ppWritePackedMsg, end) && + push16(hi_pdu_rel8->transmission_power, ppWritePackedMsg, end)); +} + +static uint8_t pack_hi_dci0_hi_rel10_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_hi_dci0_hi_pdu_rel10_t *hi_pdu_rel10 = (nfapi_hi_dci0_hi_pdu_rel10_t *)tlv; + return ( push8(hi_pdu_rel10->flag_tb2, ppWritePackedMsg, end) && + push8(hi_pdu_rel10->hi_value_2, ppWritePackedMsg, end)); +} + +static uint8_t pack_hi_dci0_dci_rel8_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_hi_dci0_dci_pdu_rel8_t *dci_pdu_rel8 = (nfapi_hi_dci0_dci_pdu_rel8_t *)tlv; + return ( push8(dci_pdu_rel8->dci_format, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->cce_index, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->aggregation_level, ppWritePackedMsg, end) && + push16(dci_pdu_rel8->rnti, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->resource_block_start, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->number_of_resource_block, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->mcs_1, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->cyclic_shift_2_for_drms, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->frequency_hopping_enabled_flag, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->frequency_hopping_bits, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->new_data_indication_1, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->ue_tx_antenna_seleciton, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->tpc, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->cqi_csi_request, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->ul_index, ppWritePackedMsg, end) && + push8(dci_pdu_rel8->dl_assignment_index, ppWritePackedMsg, end) && + push32(dci_pdu_rel8->tpc_bitmap, ppWritePackedMsg, end) && + push16(dci_pdu_rel8->transmission_power, ppWritePackedMsg, end)); +} + +static uint8_t pack_hi_dci0_dci_rel10_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_hi_dci0_dci_pdu_rel10_t *dci_pdu_rel10 = (nfapi_hi_dci0_dci_pdu_rel10_t *)tlv; + return ( push8(dci_pdu_rel10->cross_carrier_scheduling_flag, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->carrier_indicator, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->size_of_cqi_csi_feild, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->srs_flag, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->srs_request, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->resource_allocation_flag, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->resource_allocation_type, ppWritePackedMsg, end) && + push32(dci_pdu_rel10->resource_block_coding, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->mcs_2, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->new_data_indication_2, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->number_of_antenna_ports, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->tpmi, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->total_dci_length_including_padding, ppWritePackedMsg, end) && + push8(dci_pdu_rel10->n_ul_rb, ppWritePackedMsg, end)); +} + +static uint8_t pack_hi_dci0_dci_rel12_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_hi_dci0_dci_pdu_rel12_t *dci_pdu_rel12 = (nfapi_hi_dci0_dci_pdu_rel12_t *)tlv; + return ( push8(dci_pdu_rel12->pscch_resource, ppWritePackedMsg, end) && + push8(dci_pdu_rel12->time_resource_pattern, ppWritePackedMsg, end)); +} + +static uint8_t pack_hi_dci0_mpdcch_dci_rel13_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t *mpdcch_dci_pdu_rel13 = (nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t *)tlv; + return ( push8(mpdcch_dci_pdu_rel13->mpdcch_narrowband, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->number_of_prb_pairs, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->resource_block_assignment, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->mpdcch_transmission_type, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->start_symbol, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->ecce_index, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->aggreagation_level, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->rnti_type, ppWritePackedMsg, end) && + push16(mpdcch_dci_pdu_rel13->rnti, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->ce_mode, ppWritePackedMsg, end) && + push16(mpdcch_dci_pdu_rel13->drms_scrambling_init, ppWritePackedMsg, end) && + push16(mpdcch_dci_pdu_rel13->initial_transmission_sf_io, ppWritePackedMsg, end) && + push16(mpdcch_dci_pdu_rel13->transmission_power, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->dci_format, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->resource_block_start, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->number_of_resource_blocks, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->mcs, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->pusch_repetition_levels, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->frequency_hopping_flag, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->new_data_indication, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->harq_process, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->redudency_version, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->tpc, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->csi_request, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->ul_inex, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->dai_presence_flag, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->dl_assignment_index, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->srs_request, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->dci_subframe_repetition_number, ppWritePackedMsg, end) && + push32(mpdcch_dci_pdu_rel13->tcp_bitmap, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->total_dci_length_include_padding, ppWritePackedMsg, end) && + push8(mpdcch_dci_pdu_rel13->number_of_tx_antenna_ports, ppWritePackedMsg, end) && + pusharray16(mpdcch_dci_pdu_rel13->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, mpdcch_dci_pdu_rel13->number_of_tx_antenna_ports, ppWritePackedMsg, end)); +} + +static uint8_t pack_hi_dci0_npdcch_dci_rel13_pdu_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_hi_dci0_npdcch_dci_pdu_rel13_t *npdcch_dci_pdu_rel13 = (nfapi_hi_dci0_npdcch_dci_pdu_rel13_t *)tlv; + return ( push8(npdcch_dci_pdu_rel13->ncce_index, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->aggregation_level, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->start_symbol, ppWritePackedMsg, end) && + push16(npdcch_dci_pdu_rel13->rnti, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->scrambling_reinitialization_batch_index, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->nrs_antenna_ports_assumed_by_the_ue, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->subcarrier_indication, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->resource_assignment, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->scheduling_delay, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->mcs, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->redudancy_version, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->repetition_number, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->new_data_indicator, ppWritePackedMsg, end) && + push8(npdcch_dci_pdu_rel13->dci_subframe_repetition_number, ppWritePackedMsg, end)); +} + + +static uint8_t pack_hi_dci0_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_hi_dci0_request_body_t *value = (nfapi_hi_dci0_request_body_t *)tlv; + + if(!(push16(value->sfnsf, ppWritePackedMsg, end) && + push8(value->number_of_dci, ppWritePackedMsg, end) && + push8(value->number_of_hi, ppWritePackedMsg, end))) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_dci + value->number_of_hi; + + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_hi_dci0_request_pdu_t *pdu = &(value->hi_dci0_pdu_list[i]); + + if(push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) + return 0; + + // Put a 0 size in and then determine the size after the pdu + // has been writen and write the calculated size + uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; + pdu->pdu_size = 0; + + if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) + return 0; + + switch(pdu->pdu_type) { + case NFAPI_HI_DCI0_HI_PDU_TYPE: { + if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG, &pdu->hi_pdu.hi_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_hi_rel8_pdu_value) && + pack_tlv(NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG, &pdu->hi_pdu.hi_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_hi_rel10_pdu_value))) + return 0; + } + break; + + case NFAPI_HI_DCI0_DCI_PDU_TYPE: { + if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG, &pdu->dci_pdu.dci_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_dci_rel8_pdu_value) && + pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG, &pdu->dci_pdu.dci_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_dci_rel10_pdu_value) && + pack_tlv(NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG, &pdu->dci_pdu.dci_pdu_rel12, ppWritePackedMsg, end, pack_hi_dci0_dci_rel12_pdu_value))) + return 0; + } + break; + + case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE: { + if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel8, ppWritePackedMsg, end, pack_hi_dci0_dci_rel8_pdu_value) && + pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel10, ppWritePackedMsg, end, pack_hi_dci0_dci_rel10_pdu_value) && + pack_tlv(NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG, &pdu->epdcch_dci_pdu.epdcch_parameters_rel11, ppWritePackedMsg, end, pack_dl_config_epdcch_parameters_rel11_value))) + return 0; + } + break; + + case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE: { + if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG, &pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13, ppWritePackedMsg, end, pack_hi_dci0_mpdcch_dci_rel13_pdu_value))) + return 0; + } + break; + + case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE: { + if(!(pack_tlv(NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG, &pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13, ppWritePackedMsg, end, pack_hi_dci0_npdcch_dci_rel13_pdu_value))) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type ); + } + break; + }; + + // add 1 for the pdu_type. The delta will include the pdu_size + pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); + + push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); + } + + return 1; +} + +static uint8_t pack_ul_dci_pdu_list_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +{ + nfapi_nr_ul_dci_request_pdus_t* value = (nfapi_nr_ul_dci_request_pdus_t*)tlv; + + for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i) + { + if(!(push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].RNTI, ppWritePackedMsg, end) && + push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].ScramblingId, ppWritePackedMsg, end) && + + push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].ScramblingRNTI, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].CceIndex, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].AggregationLevel, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].beta_PDCCH_1_0, ppWritePackedMsg, end) && + + push8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].powerControlOffsetSS, ppWritePackedMsg, end) && + push16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end) && + + pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].Payload, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, ppWritePackedMsg, end))) + + return 0; + } + + return (push16(value->PDUType, ppWritePackedMsg, end) && + push16(value->PDUSize, ppWritePackedMsg, end) && + push16(value->pdcch_pdu.pdcch_pdu_rel15.BWPSize, ppWritePackedMsg, end) && + push16(value->pdcch_pdu.pdcch_pdu_rel15.BWPStart, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.SubcarrierSpacing, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.CyclicPrefix, ppWritePackedMsg, end) && + + push8(value->pdcch_pdu.pdcch_pdu_rel15.StartSymbolIndex, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.DurationSymbols, ppWritePackedMsg, end) && + pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.FreqDomainResource, 6, 6, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.CceRegMappingType, ppWritePackedMsg, end) && + + push8(value->pdcch_pdu.pdcch_pdu_rel15.RegBundleSize, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.InterleaverSize, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.CoreSetType, ppWritePackedMsg, end) && + push16(value->pdcch_pdu.pdcch_pdu_rel15.ShiftIndex, ppWritePackedMsg, end) && + push8(value->pdcch_pdu.pdcch_pdu_rel15.precoderGranularity, ppWritePackedMsg, end) && + push16(value->pdcch_pdu.pdcch_pdu_rel15.numDlDci, ppWritePackedMsg, end)); + +} + +static uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t *)msg; + + if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && + push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && + push8(pNfapiMsg->numPdus, ppWritePackedMsg, end) + )) + return 0; + + for(int i=0; inumPdus; i++) { + if(!pack_ul_dci_pdu_list_value(&pNfapiMsg->ul_dci_pdu_list[i], ppWritePackedMsg, end)) + return 0; + } + + return 1; +} + + + +static uint8_t pack_hi_dci0_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_hi_dci0_request_t *pNfapiMsg = (nfapi_hi_dci0_request_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_HI_DCI0_REQUEST_BODY_TAG, &pNfapiMsg->hi_dci0_request_body, ppWritePackedMsg, end, &pack_hi_dci0_request_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +//pack_tx_data_pdu_list_value +static uint8_t pack_tx_data_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_pdu_t *value = (nfapi_nr_pdu_t *)tlv; + + if(!(push32(value->num_TLV, ppWritePackedMsg, end) && + push16(value->PDU_index, ppWritePackedMsg, end) && + push16(value->PDU_length, ppWritePackedMsg, end) + )) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_tlvs = value->num_TLV; + + for(; i < total_number_of_tlvs; ++i) { + if (!(push16(value->TLVs[i].length, ppWritePackedMsg, end) && + push16(value->TLVs[i].tag, ppWritePackedMsg, end))) + return 0; + + switch(value->TLVs[i].tag) { + case 0: { + if(!pusharray32(value->TLVs[i].value.direct, 16384, value->TLVs[i].length, ppWritePackedMsg, end)) + return 0; + + break; + } + + case 1: { + if(!pusharray32(value->TLVs[i].value.ptr, value->TLVs[i].length, value->TLVs[i].length, ppWritePackedMsg, end)) + return 0; + + break; + } + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid tag value %d \n", value->TLVs[i].tag ); + break; + } + } + } + + return 1; +} + +static uint8_t pack_tx_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_tx_request_body_t *value = (nfapi_tx_request_body_t *)tlv; + + if(push16(value->number_of_pdus, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_pdus; + + for(; i < total_number_of_pdus; ++i) { + nfapi_tx_request_pdu_t *pdu = &(value->tx_pdu_list[i]); + + if(!(push16(pdu->pdu_length, ppWritePackedMsg, end) && + push16(pdu->pdu_index, ppWritePackedMsg, end))) + return 0; + + uint8_t j; + + for(j = 0; j < pdu->num_segments; ++j) { + // Use -1 as it is unbounded + // DJP - does not handle -1 + // DJP - if(pusharray8(pdu->segments[j].segment_data, (uint32_t)(-1), pdu->segments[j].segment_length, ppWritePackedMsg, end) == 0) + int push_ret = pusharray8(pdu->segments[j].segment_data, 65535, pdu->segments[j].segment_length, ppWritePackedMsg, end); + + if (pdu->segments[j].segment_length == 3) { + NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, + pdu->segments[j].segment_data[0], + pdu->segments[j].segment_data[1], + pdu->segments[j].segment_data[2] + ); + } + + //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() segment_data:%p segment_length:%u pusharray8()=%d\n", __FUNCTION__, pdu->segments[j].segment_data, pdu->segments[j].segment_length, push_ret); + + if (push_ret == 0) { + return 0; + } + } + } + + return 1; +} + +static uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t *)msg; + + if (!( + push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && + push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && + push16(pNfapiMsg->Number_of_PDUs, ppWritePackedMsg, end) + )) + return 0; + + for(int i=0; iNumber_of_PDUs; i++) { + if(!pack_tx_data_pdu_list_value(&pNfapiMsg->pdu_list[i], ppWritePackedMsg, end)) + return 0; + } + + return 1; +} + +static uint8_t pack_tx_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t *)msg; + int x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end); + int y = pack_tlv(NFAPI_TX_REQUEST_BODY_TAG, &pNfapiMsg->tx_request_body, ppWritePackedMsg, end, &pack_tx_request_body_value); + int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); + //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() x:%d y:%d z:%d\n", __FUNCTION__, x, y, z); + return x && y && z; +} + +static uint8_t pack_release_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ue_release_request_body_t *value = (nfapi_ue_release_request_body_t *)tlv; + + if(push16(value->number_of_TLVs, ppWritePackedMsg, end) == 0) { + return 0; + } + + uint8_t j; + uint16_t num = value->number_of_TLVs; + + for(j = 0; j < num; ++j) { + if(push16(value->ue_release_request_TLVs_list[j].rnti, ppWritePackedMsg, end) == 0) { + return 0; + } + } + + return 1; +} + +static uint8_t pack_ue_release_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_ue_release_request_t *pNfapiMsg = (nfapi_ue_release_request_t *)msg; + int x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end); + int y = pack_tlv(NFAPI_UE_RELEASE_BODY_TAG, &pNfapiMsg->ue_release_request_body, ppWritePackedMsg, end, &pack_release_request_body_value); + int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); + return x && y && z; +} + +static uint8_t pack_ue_release_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_ue_release_response_t *pNfapiMsg = (nfapi_ue_release_response_t *)msg; + int x = push32(pNfapiMsg->error_code, ppWritePackedMsg, end); + int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); + return x && z; +} + +static uint8_t pack_rx_ue_information_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_rx_ue_information *value = (nfapi_rx_ue_information *)tlv; + return ( push32(value->handle, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) ); +} + +static uint8_t unpack_rx_ue_information_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_rx_ue_information *value = (nfapi_rx_ue_information *)tlv; + return ( pull32(ppReadPackedMsg, &value->handle, end) && + pull16(ppReadPackedMsg, &value->rnti, end)); +} + +static uint8_t pack_harq_indication_tdd_harq_data_bundling(nfapi_harq_indication_tdd_harq_data_bundling_t *data, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( push8(data->value_0, ppWritePackedMsg, end) && + push8(data->value_1, ppWritePackedMsg, end)); +} + +static uint8_t pack_harq_indication_tdd_harq_data_multiplexing(nfapi_harq_indication_tdd_harq_data_multiplexing_t *data, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( push8(data->value_0, ppWritePackedMsg, end) && + push8(data->value_1, ppWritePackedMsg, end) && + push8(data->value_2, ppWritePackedMsg, end) && + push8(data->value_3, ppWritePackedMsg, end)); +} + +static uint8_t pack_harq_indication_tdd_harq_data_special_bundling(nfapi_harq_indication_tdd_harq_data_special_bundling_t *data, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( push8(data->value_0, ppWritePackedMsg, end) ); +} + +static uint8_t pack_harq_indication_tdd_harq_data(nfapi_harq_indication_tdd_harq_data_t *data, uint8_t **ppWritePackedMsg, uint8_t *end) { + return ( push8(data->value_0, ppWritePackedMsg, end) ); +} + +static uint8_t pack_harq_indication_tdd_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_rel8_t *harq_indication_tdd_rel8 = (nfapi_harq_indication_tdd_rel8_t *)tlv; + + if(!(push8(harq_indication_tdd_rel8->mode, ppWritePackedMsg, end) && + push8(harq_indication_tdd_rel8->number_of_ack_nack, ppWritePackedMsg, end))) + return 0; + + uint8_t result = 0; + + switch(harq_indication_tdd_rel8->mode) { + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: + result = pack_harq_indication_tdd_harq_data_bundling(&harq_indication_tdd_rel8->harq_data.bundling, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: + result = pack_harq_indication_tdd_harq_data_multiplexing(&harq_indication_tdd_rel8->harq_data.multiplex, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: + result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel8->harq_data.special_bundling, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: + result = 1; + break; + + default: + // err.... + break; + } + + return result; +} + +static uint8_t pack_harq_indication_tdd_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_rel9_t *harq_indication_tdd_rel9 = (nfapi_harq_indication_tdd_rel9_t *)tlv; + + if(!(push8(harq_indication_tdd_rel9->mode, ppWritePackedMsg, end) && + push8(harq_indication_tdd_rel9->number_of_ack_nack, ppWritePackedMsg, end))) + return 0; + + uint8_t idx; + + for(idx = 0; idx < harq_indication_tdd_rel9->number_of_ack_nack; ++idx) { + uint8_t result = 0; + + switch(harq_indication_tdd_rel9->mode) { + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: + result = pack_harq_indication_tdd_harq_data(&(harq_indication_tdd_rel9->harq_data[idx].bundling), ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].multiplex, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: + result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel9->harq_data[idx].special_bundling, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].channel_selection, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel9->harq_data[idx].format_3, ppWritePackedMsg, end); + break; + + default: + // err.... + break; + } + + if(result == 0) + return 0; + } + + return 1; +} + +static uint8_t pack_harq_indication_tdd_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_rel13_t *harq_indication_tdd_rel13 = (nfapi_harq_indication_tdd_rel13_t *)tlv; + + if(!(push8(harq_indication_tdd_rel13->mode, ppWritePackedMsg, end) && + push16(harq_indication_tdd_rel13->number_of_ack_nack, ppWritePackedMsg, end))) + return 0; + + uint8_t idx; + + for(idx = 0; idx < harq_indication_tdd_rel13->number_of_ack_nack; ++idx) { + uint8_t result = 0; + + switch(harq_indication_tdd_rel13->mode) { + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].bundling, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].multiplex, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: + result = pack_harq_indication_tdd_harq_data_special_bundling(&harq_indication_tdd_rel13->harq_data[idx].special_bundling, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].channel_selection, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_3, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_4, ppWritePackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5: + result = pack_harq_indication_tdd_harq_data(&harq_indication_tdd_rel13->harq_data[idx].format_5, ppWritePackedMsg, end); + break; + + default: + // err.... + break; + } + + if(result == 0) + return 0; + } + + return 1; +} + +static uint8_t pack_harq_indication_fdd_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_harq_indication_fdd_rel8_t *harq_indication_fdd_rel8 = (nfapi_harq_indication_fdd_rel8_t *)tlv; + return ( push8(harq_indication_fdd_rel8->harq_tb1, ppWritePackedMsg, end) && + push8(harq_indication_fdd_rel8->harq_tb2, ppWritePackedMsg, end)); +} + +static uint8_t pack_harq_indication_fdd_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_harq_indication_fdd_rel9_t *harq_indication_fdd_rel9 = (nfapi_harq_indication_fdd_rel9_t *)tlv; + return ( push8(harq_indication_fdd_rel9->mode, ppWritePackedMsg, end) && + push8(harq_indication_fdd_rel9->number_of_ack_nack, ppWritePackedMsg, end) && + pusharray8(harq_indication_fdd_rel9->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL9_MAX, harq_indication_fdd_rel9->number_of_ack_nack, ppWritePackedMsg, end)); +} + +static uint8_t pack_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_harq_indication_fdd_rel13_t *harq_indication_fdd_rel13 = (nfapi_harq_indication_fdd_rel13_t *)tlv; + return ( push8(harq_indication_fdd_rel13->mode, ppWritePackedMsg, end) && + push16(harq_indication_fdd_rel13->number_of_ack_nack, ppWritePackedMsg, end) && + pusharray8(harq_indication_fdd_rel13->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL13_MAX, harq_indication_fdd_rel13->number_of_ack_nack, ppWritePackedMsg, end)); +} + +static uint8_t pack_ul_cqi_information_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_ul_cqi_information_t *value = (nfapi_ul_cqi_information_t *)tlv; + return ( push8(value->ul_cqi, ppWritePackedMsg, end) && + push8(value->channel, ppWritePackedMsg, end)); +} + +static uint8_t pack_harq_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_harq_indication_body_t *value = (nfapi_harq_indication_body_t *)tlv; + + if(push16(value->number_of_harqs, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_harqs; + + for(; i < total_number_of_pdus; ++i) { + nfapi_harq_indication_pdu_t *pdu = &(value->harq_pdu_list[i]); + uint8_t *instance_length_p = *ppWritePackedMsg; + + if(!push16(pdu->instance_length, ppWritePackedMsg, end)) + return 0; + + if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && + pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL8_TAG, &pdu->harq_indication_tdd_rel8, ppWritePackedMsg, end, pack_harq_indication_tdd_rel8_value) && + pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL9_TAG, &pdu->harq_indication_tdd_rel9, ppWritePackedMsg, end, pack_harq_indication_tdd_rel9_value) && + pack_tlv(NFAPI_HARQ_INDICATION_TDD_REL13_TAG, &pdu->harq_indication_tdd_rel13, ppWritePackedMsg, end, pack_harq_indication_tdd_rel13_value) && + pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL8_TAG, &pdu->harq_indication_fdd_rel8, ppWritePackedMsg, end, pack_harq_indication_fdd_rel8_value) && + pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL9_TAG, &pdu->harq_indication_fdd_rel9, ppWritePackedMsg, end, pack_harq_indication_fdd_rel9_value) && + pack_tlv(NFAPI_HARQ_INDICATION_FDD_REL13_TAG, &pdu->harq_indication_fdd_rel13, ppWritePackedMsg, end, pack_harq_indication_fdd_rel13_value) && + pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value))) + return 0; + + // calculate the instance length subtracting the size of the instance + // length feild + uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; + push16(instance_length, &instance_length_p, end); + } + + return 1; +} + +static uint8_t pack_harq_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_harq_indication_t *pNfapiMsg = (nfapi_harq_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->harq_indication_body, ppWritePackedMsg, end, pack_harq_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_crc_indication_rel8_body(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_crc_indication_rel8_t *crc_indication_rel8 = (nfapi_crc_indication_rel8_t *)tlv; + return ( push8(crc_indication_rel8->crc_flag, ppWritePackedMsg, end) ); +} + +static uint8_t pack_crc_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_crc_indication_body_t *value = (nfapi_crc_indication_body_t *)tlv; + + if(push16(value->number_of_crcs, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_crcs; + + for(; i < total_number_of_pdus; ++i) { + nfapi_crc_indication_pdu_t *pdu = &(value->crc_pdu_list[i]); + uint8_t *instance_length_p = *ppWritePackedMsg; + + if(!push16(pdu->instance_length, ppWritePackedMsg, end)) + return 0; + + if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && + pack_tlv(NFAPI_CRC_INDICATION_REL8_TAG, &pdu->crc_indication_rel8, ppWritePackedMsg, end, pack_crc_indication_rel8_body))) + return 0; + + // calculate the instance length subtracting the size of the instance + // length feild + uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; + push16(instance_length, &instance_length_p, end); + } + + return 1; +} + +static uint8_t pack_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_crc_indication_t *pNfapiMsg = (nfapi_crc_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_CRC_INDICATION_BODY_TAG, &pNfapiMsg->crc_indication_body, ppWritePackedMsg, end, &pack_crc_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} +static uint8_t pack_rx_indication_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_rx_indication_rel8_t *value = (nfapi_rx_indication_rel8_t *)tlv; + return ( push16(value->length, ppWritePackedMsg, end) && + push16(value->offset, ppWritePackedMsg, end) && + push8(value->ul_cqi, ppWritePackedMsg, end) && + push16(value->timing_advance, ppWritePackedMsg, end)); +} +static uint8_t pack_rx_indication_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_rx_indication_rel9_t *value = (nfapi_rx_indication_rel9_t *)tlv; + return ( push16(value->timing_advance_r9, ppWritePackedMsg, end)); +} + +static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_rx_indication_body_t *value = (nfapi_rx_indication_body_t *)tlv; + + //printf("RX ULSCH BODY\n"); + + if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0) + return 0; + + // need to calculate the data offset's. + uint16_t i = 0; + uint16_t offset = 2; // taking into account the number_of_pdus + uint16_t total_number_of_pdus = value->number_of_pdus; + //printf("ULSCH:pdus:%d\n", total_number_of_pdus); + + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]); + + if(pdu->rx_ue_information.tl.tag == NFAPI_RX_UE_INFORMATION_TAG) { + //printf("NFAPI_RX_UE_INFORMATION_TAG\n"); + offset += 4 + 6; + } + + if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) { + //printf("NFAPI_RX_INDICATION_REL8_TAG\n"); + offset += 4 + 7; + } + + if(pdu->rx_indication_rel9.tl.tag == NFAPI_RX_INDICATION_REL9_TAG) { + //printf("NFAPI_RX_INDICATION_REL9_TAG\n"); + offset += 4 + 2; + } + } + + // Now update the structure to include the offset + for(i =0; i < total_number_of_pdus; ++i) { + nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]); + + if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) { + if(pdu->rx_indication_rel8.offset == 1) { + pdu->rx_indication_rel8.offset = offset; + offset += pdu->rx_indication_rel8.length; + } + } + } + + // Write out the pdu + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]); + + if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && + pack_tlv(NFAPI_RX_INDICATION_REL8_TAG, &pdu->rx_indication_rel8, ppWritePackedMsg, end, pack_rx_indication_rel8_value) && + pack_tlv(NFAPI_RX_INDICATION_REL9_TAG, &pdu->rx_indication_rel9, ppWritePackedMsg, end, pack_rx_indication_rel9_value))) + return 0; + } + + // Write out the pdu data + for(i = 0; i < total_number_of_pdus; ++i) { + uint16_t length = 0; + nfapi_rx_indication_pdu_t *pdu = &(value->rx_pdu_list[i]); + + if(pdu->rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) { + length = pdu->rx_indication_rel8.length; + } + + if( pusharray8(value->rx_pdu_list[i].data, length, length, ppWritePackedMsg, end) == 0) + return 0; + } + + return 1; +} + + +static uint8_t pack_rx_ulsch_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_rx_indication_t *pNfapiMsg = (nfapi_rx_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_RX_INDICATION_BODY_TAG, &pNfapiMsg->rx_indication_body, ppWritePackedMsg, end, pack_rx_ulsch_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_preamble_pdu_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_preamble_pdu_rel8_t *preamble_rel8 = (nfapi_preamble_pdu_rel8_t *)tlv; + return ( push16(preamble_rel8->rnti, ppWritePackedMsg, end) && + push8(preamble_rel8->preamble, ppWritePackedMsg, end) && + push16(preamble_rel8->timing_advance, ppWritePackedMsg, end)); +} +static uint8_t pack_preamble_pdu_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_preamble_pdu_rel9_t *preamble_rel9 = (nfapi_preamble_pdu_rel9_t *)tlv; + return ( push16(preamble_rel9->timing_advance_r9, ppWritePackedMsg, end) ); +} +static uint8_t pack_preamble_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_preamble_pdu_rel13_t *preamble_rel13 = (nfapi_preamble_pdu_rel13_t *)tlv; + return ( push8(preamble_rel13->rach_resource_type, ppWritePackedMsg, end) ); +} + +static uint8_t pack_rach_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_rach_indication_body_t *value = (nfapi_rach_indication_body_t *)tlv; + + if( push16(value->number_of_preambles, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_preambles; + + for(; i < total_number_of_pdus; ++i) { + nfapi_preamble_pdu_t *pdu = &(value->preamble_list[i]); + uint8_t *instance_length_p = *ppWritePackedMsg; + + if(!push16(pdu->instance_length, ppWritePackedMsg, end)) + return 0; + + if(!(pack_tlv(NFAPI_PREAMBLE_REL8_TAG, &pdu->preamble_rel8, ppWritePackedMsg, end, pack_preamble_pdu_rel8_value) && + pack_tlv(NFAPI_PREAMBLE_REL9_TAG, &pdu->preamble_rel9, ppWritePackedMsg, end, pack_preamble_pdu_rel9_value) && + pack_tlv(NFAPI_PREAMBLE_REL13_TAG, &pdu->preamble_rel13, ppWritePackedMsg, end, pack_preamble_pdu_rel13_value))) + return 0; + + // calculate the instance length subtracting the size of the instance + // length feild + uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; + push16(instance_length, &instance_length_p, end); + } + + return 1; +} + +static uint8_t pack_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_rach_indication_t *pNfapiMsg = (nfapi_rach_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_RACH_INDICATION_BODY_TAG, &pNfapiMsg->rach_indication_body, ppWritePackedMsg, end, pack_rach_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_srs_indication_fdd_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_srs_indication_fdd_rel8_t *srs_pdu_rel8 = (nfapi_srs_indication_fdd_rel8_t *)tlv; + return ( push16(srs_pdu_rel8->doppler_estimation, ppWritePackedMsg, end) && + push16(srs_pdu_rel8->timing_advance, ppWritePackedMsg, end) && + push8(srs_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end) && + push8(srs_pdu_rel8->rb_start, ppWritePackedMsg, end) && + pusharray8(srs_pdu_rel8->snr, NFAPI_NUM_RB_MAX, srs_pdu_rel8->number_of_resource_blocks, ppWritePackedMsg, end)); +} + +static uint8_t pack_srs_indication_fdd_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_srs_indication_fdd_rel9_t *srs_pdu_rel9 = (nfapi_srs_indication_fdd_rel9_t *)tlv; + return ( push16(srs_pdu_rel9->timing_advance_r9, ppWritePackedMsg, end) ); +} + +static uint8_t pack_srs_indication_tdd_rel10_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_srs_indication_ttd_rel10_t *srs_pdu_rel10 = (nfapi_srs_indication_ttd_rel10_t *)tlv; + return ( push8(srs_pdu_rel10->uppts_symbol, ppWritePackedMsg, end) ); +} + +static uint8_t pack_srs_indication_fdd_rel11_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_srs_indication_fdd_rel11_t *srs_pdu_rel11 = (nfapi_srs_indication_fdd_rel11_t *)tlv; + return ( push16(srs_pdu_rel11->ul_rtoa, ppWritePackedMsg, end) ) ; +} + +static uint8_t pack_tdd_channel_measurement_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_tdd_channel_measurement_t *value = (nfapi_tdd_channel_measurement_t *)tlv; + + if(!(push8(value->num_prb_per_subband, ppWritePackedMsg, end) && + push8(value->number_of_subbands, ppWritePackedMsg, end) && + push8(value->num_atennas, ppWritePackedMsg, end))) + return 0; + + uint8_t idx = 0; + + for(idx = 0; idx < value->number_of_subbands; ++idx) { + if(!(push8(value->subands[idx].subband_index, ppWritePackedMsg, end) && + pusharray16(value->subands[idx].channel, NFAPI_MAX_NUM_PHYSICAL_ANTENNAS, value->num_atennas, ppWritePackedMsg, end))) + return 0; + } + + return 1; +} + +static uint8_t pack_srs_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_srs_indication_body_t *value = (nfapi_srs_indication_body_t *)tlv; + + if( push8(value->number_of_ues, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_ues; + + for(; i < total_number_of_pdus; ++i) { + nfapi_srs_indication_pdu_t *pdu = &(value->srs_pdu_list[i]); + uint8_t *instance_length_p = *ppWritePackedMsg; + + if(!push16(pdu->instance_length, ppWritePackedMsg, end)) + return 0; + + if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, &pack_rx_ue_information_value) && + pack_tlv(NFAPI_SRS_INDICATION_FDD_REL8_TAG, &pdu->srs_indication_fdd_rel8, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel8_value) && + pack_tlv(NFAPI_SRS_INDICATION_FDD_REL9_TAG, &pdu->srs_indication_fdd_rel9, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel9_value) && + pack_tlv(NFAPI_SRS_INDICATION_TDD_REL10_TAG, &pdu->srs_indication_tdd_rel10, ppWritePackedMsg, end, &pack_srs_indication_tdd_rel10_value) && + pack_tlv(NFAPI_SRS_INDICATION_FDD_REL11_TAG, &pdu->srs_indication_fdd_rel11, ppWritePackedMsg, end, &pack_srs_indication_fdd_rel11_value) && + pack_tlv(NFAPI_TDD_CHANNEL_MEASUREMENT_TAG, &pdu->tdd_channel_measurement, ppWritePackedMsg, end, &pack_tdd_channel_measurement_value))) + return 0; + + // calculate the instance length subtracting the size of the instance + // length feild + uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; + push16(instance_length, &instance_length_p, end); + } + + return 1; +} + +static uint8_t pack_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_srs_indication_t *pNfapiMsg = (nfapi_srs_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_SRS_INDICATION_BODY_TAG, &pNfapiMsg->srs_indication_body, ppWritePackedMsg, end, &pack_srs_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_sr_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_sr_indication_body_t *value = (nfapi_sr_indication_body_t *)tlv; + + if(push16(value->number_of_srs, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_srs; + + for(; i < total_number_of_pdus; ++i) { + nfapi_sr_indication_pdu_t *pdu = &(value->sr_pdu_list[i]); + uint8_t *instance_length_p = *ppWritePackedMsg; + + if(!push16(pdu->instance_length, ppWritePackedMsg, end)) + return 0; + + if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && + pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value))) + return 0; + + // calculate the instance length subtracting the size of the instance + // length feild + uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; + push16(instance_length, &instance_length_p, end); + } + + return 1; +} + +static uint8_t pack_sr_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_sr_indication_t *pNfapiMsg = (nfapi_sr_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_SR_INDICATION_BODY_TAG, &pNfapiMsg->sr_indication_body, ppWritePackedMsg, end, &pack_sr_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_cqi_indication_rel8_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_cqi_indication_rel8_t *cqi_pdu_rel8 = (nfapi_cqi_indication_rel8_t *)tlv; + return ( push16(cqi_pdu_rel8->length, ppWritePackedMsg, end) && + push16(cqi_pdu_rel8->data_offset, ppWritePackedMsg, end) && + push8(cqi_pdu_rel8->ul_cqi, ppWritePackedMsg, end) && + push8(cqi_pdu_rel8->ri, ppWritePackedMsg, end) && + push16(cqi_pdu_rel8->timing_advance, ppWritePackedMsg, end)); +} + +static uint8_t pack_cqi_indication_rel9_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_cqi_indication_rel9_t *cqi_pdu_rel9 = (nfapi_cqi_indication_rel9_t *)tlv; + return ( push16(cqi_pdu_rel9->length, ppWritePackedMsg, end) && + push16(cqi_pdu_rel9->data_offset, ppWritePackedMsg, end) && + push8(cqi_pdu_rel9->ul_cqi, ppWritePackedMsg, end) && + push8(cqi_pdu_rel9->number_of_cc_reported, ppWritePackedMsg, end) && + pusharray8(cqi_pdu_rel9->ri, NFAPI_CC_MAX, cqi_pdu_rel9->number_of_cc_reported, ppWritePackedMsg, end) && + push16(cqi_pdu_rel9->timing_advance, ppWritePackedMsg, end) && + push16(cqi_pdu_rel9->timing_advance_r9, ppWritePackedMsg, end)); +} + +static uint8_t pack_cqi_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_cqi_indication_body_t *value = (nfapi_cqi_indication_body_t *)tlv; + + if( push16(value->number_of_cqis, ppWritePackedMsg, end) == 0) + return 0; + + // need to calculate the data offset's. This very bittle due the hardcoding + // of the sizes. can not use the sizeof as we have an array for the Rel9 + // info + uint16_t i = 0; + uint16_t offset = 2; // taking into account the number_of_cqis + uint16_t total_number_of_pdus = value->number_of_cqis; + + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); + offset += 2; // for the instance length + + if(pdu->rx_ue_information.tl.tag == NFAPI_RX_UE_INFORMATION_TAG) { + offset += 4 + 6; // sizeof(nfapi_rx_ue_information) - sizeof(nfapi_tl_t) + } + + if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG) { + offset += 4 + 8; + } + + if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG) { + offset += 4 + 10 + pdu->cqi_indication_rel9.number_of_cc_reported; + } + + if(pdu->ul_cqi_information.tl.tag == NFAPI_UL_CQI_INFORMATION_TAG) { + offset += 4 + 2; + } + } + + // Now update the structure to include the offset + for(i =0; i < total_number_of_pdus; ++i) { + nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); + + if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG) { + if(pdu->cqi_indication_rel8.data_offset == 1) { + pdu->cqi_indication_rel8.data_offset = offset; + offset += pdu->cqi_indication_rel8.length; + } + } + + if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG) { + if(pdu->cqi_indication_rel9.data_offset == 1) { + pdu->cqi_indication_rel9.data_offset = offset; + offset += pdu->cqi_indication_rel9.length; + } + } + } + + // Write out the cqi information + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); + uint8_t *instance_length_p = *ppWritePackedMsg; + + if(!push16(pdu->instance_length, ppWritePackedMsg, end)) + return 0; + + if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end,pack_rx_ue_information_value) && + pack_tlv(NFAPI_CQI_INDICATION_REL8_TAG, &pdu->cqi_indication_rel8, ppWritePackedMsg, end, pack_cqi_indication_rel8_value) && + pack_tlv(NFAPI_CQI_INDICATION_REL9_TAG, &pdu->cqi_indication_rel9, ppWritePackedMsg, end, pack_cqi_indication_rel9_value) && + pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value))) + return 0; + + // calculate the instance length subtracting the size of the instance + // length feild + uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; + push16(instance_length, &instance_length_p, end); + } + + // Write out the cqi raw data + for(i = 0; i < total_number_of_pdus; ++i) { + uint16_t length = 0; + nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); + + if(pdu->cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG) { + length = pdu->cqi_indication_rel8.length; + } + + if(pdu->cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG) { + length = pdu->cqi_indication_rel9.length; + } + + if( pusharray8(value->cqi_raw_pdu_list[i].pdu, NFAPI_CQI_RAW_MAX_LEN, length, ppWritePackedMsg, end) == 0) + return 0; + } + + return 1; +} + +static uint8_t pack_cqi_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_cqi_indication_t *pNfapiMsg = (nfapi_cqi_indication_t *)msg; + //Fixme: allocate some mem to fix pure bug, need to find out proper size + pNfapiMsg->vendor_extension=NULL;//(nfapi_vendor_extension_tlv_t)malloc( sizeof(* pNfapiMsg->vendor_extension)); + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_CQI_INDICATION_BODY_TAG, &pNfapiMsg->cqi_indication_body, ppWritePackedMsg, end, pack_cqi_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_lbt_pdsch_req_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_lbt_pdsch_req_pdu_rel13_t *value = (nfapi_lbt_pdsch_req_pdu_rel13_t *)tlv; + return ( push32(value->handle, ppWritePackedMsg, end) && + push32(value->mp_cca, ppWritePackedMsg, end) && + push32(value->n_cca, ppWritePackedMsg, end) && + push32(value->offset, ppWritePackedMsg, end) && + push32(value->lte_txop_sf, ppWritePackedMsg, end) && + push16(value->txop_sfn_sf_end, ppWritePackedMsg, end) && + push32(value->lbt_mode, ppWritePackedMsg, end)); +} + +static uint8_t pack_lbt_drs_req_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_lbt_drs_req_pdu_rel13_t *value = (nfapi_lbt_drs_req_pdu_rel13_t *)tlv; + return ( push32(value->handle, ppWritePackedMsg, end) && + push32(value->offset, ppWritePackedMsg, end) && + push16(value->sfn_sf_end, ppWritePackedMsg, end) && + push32(value->lbt_mode, ppWritePackedMsg, end)); +} + +static uint8_t pack_lbt_dl_config_request_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_lbt_dl_config_request_body_t *value = (nfapi_lbt_dl_config_request_body_t *)tlv; + + if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_pdus; + + for(; i < total_number_of_pdus; ++i) { + nfapi_lbt_dl_config_request_pdu_t *pdu = &(value->lbt_dl_config_req_pdu_list[i]); + + if( push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) + return 0; + + // Put a 0 size in and then determine the size after the pdu + // has been writen and write the calculated size + uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; + pdu->pdu_size = 0; + + if( push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) + return 0; + + switch(pdu->pdu_type) { + case NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE: { + if( pack_tlv(NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG, &pdu->lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13, ppWritePackedMsg, end, pack_lbt_pdsch_req_pdu_rel13_value) == 0) + return 0; + } + break; + + case NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE: { + if(pack_tlv(NFAPI_LBT_DRS_REQ_PDU_REL13_TAG, &pdu->lbt_drs_req_pdu.lbt_drs_req_pdu_rel13, ppWritePackedMsg, end, pack_lbt_drs_req_pdu_rel13_value) == 0) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL_CONFIG.request invalid pdu type %d \n", pdu->pdu_type ); + } + break; + }; + + // add 1 for the pdu_type. The delta will include the pdu_size + pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); + + push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); + } + + return 1; +} + +static uint8_t pack_lbt_pdsch_rsp_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_lbt_pdsch_rsp_pdu_rel13_t *value = (nfapi_lbt_pdsch_rsp_pdu_rel13_t *)tlv; + return ( push32(value->handle, ppWritePackedMsg, end) && + push32(value->result, ppWritePackedMsg, end) && + push32(value->lte_txop_symbols, ppWritePackedMsg, end) && + push32(value->initial_partial_sf, ppWritePackedMsg, end)); +} + +static uint8_t pack_lbt_drs_rsp_pdu_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_lbt_drs_rsp_pdu_rel13_t *value = (nfapi_lbt_drs_rsp_pdu_rel13_t *)tlv; + return ( push32(value->handle, ppWritePackedMsg, end) && + push32(value->result, ppWritePackedMsg, end)); +} + +static uint8_t pack_lbt_dl_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_lbt_dl_config_request_t *pNfapiMsg = (nfapi_lbt_dl_config_request_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->lbt_dl_config_request_body, ppWritePackedMsg, end, &pack_lbt_dl_config_request_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_lbt_dl_config_indication_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_lbt_dl_indication_body_t *value = (nfapi_lbt_dl_indication_body_t *)tlv; + + if( push16(value->number_of_pdus, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_pdus = value->number_of_pdus; + + for(; i < total_number_of_pdus; ++i) { + nfapi_lbt_dl_indication_pdu_t *pdu = &(value->lbt_indication_pdu_list[i]); + + if( push8(pdu->pdu_type, ppWritePackedMsg, end) == 0) + return 0; + + // Put a 0 size in and then determine the size after the pdu + // has been writen and write the calculated size + uint8_t *pWritePackedMsgPduSize = *ppWritePackedMsg; + pdu->pdu_size = 0; + + if(push8(pdu->pdu_size, ppWritePackedMsg, end) == 0) + return 0; + + switch(pdu->pdu_type) { + case NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE: { + if( pack_tlv(NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG, &pdu->lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13, ppWritePackedMsg, end, pack_lbt_pdsch_rsp_pdu_rel13_value) == 0) + return 0; + } + break; + + case NFAPI_LBT_DL_RSP_DRS_PDU_TYPE: { + if( pack_tlv(NFAPI_LBT_DRS_RSP_PDU_REL13_TAG, &pdu->lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13, ppWritePackedMsg, end, pack_lbt_drs_rsp_pdu_rel13_value) == 0) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL.indication body invalid pdu type %d \n", pdu->pdu_type ); + } + break; + }; + + // add 1 for the pdu_type. The delta will include the pdu_size + pdu->pdu_size = 1 + (*ppWritePackedMsg - pWritePackedMsgPduSize); + + push8(pdu->pdu_size, &pWritePackedMsgPduSize, end); + } + + return 1; +} + +static uint8_t pack_lbt_dl_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_lbt_dl_indication_t *pNfapiMsg = (nfapi_lbt_dl_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_LBT_DL_INDICATION_BODY_TAG, &pNfapiMsg->lbt_dl_indication_body, ppWritePackedMsg, end, &pack_lbt_dl_config_indication_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_nb_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nb_harq_indication_fdd_rel13_t *nb_harq_indication_fdd_rel13 = (nfapi_nb_harq_indication_fdd_rel13_t *)tlv; + return ( push8(nb_harq_indication_fdd_rel13->harq_tb1, ppWritePackedMsg, end) ); +} + +static uint8_t pack_nb_harq_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nb_harq_indication_body_t *value = (nfapi_nb_harq_indication_body_t *)tlv; + + if( push16(value->number_of_harqs, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_harqs = value->number_of_harqs; + + for(; i < total_number_of_harqs; ++i) { + nfapi_nb_harq_indication_pdu_t *pdu = &(value->nb_harq_pdu_list[i]); + uint8_t *instance_length_p = *ppWritePackedMsg; + + if(!push16(pdu->instance_length, ppWritePackedMsg, end)) + return 0; + + if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && + pack_tlv(NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG, &pdu->nb_harq_indication_fdd_rel13, ppWritePackedMsg, end, pack_nb_harq_indication_fdd_rel13_value) && + pack_tlv(NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, ppWritePackedMsg, end, pack_ul_cqi_information_value))) + return 0; + + // calculate the instance length subtracting the size of the instance + // length feild + uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; + push16(instance_length, &instance_length_p, end); + } + + return 1; +} + + +static uint8_t pack_nb_harq_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nb_harq_indication_t *pNfapiMsg = (nfapi_nb_harq_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_NB_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->nb_harq_indication_body, ppWritePackedMsg, end, &pack_nb_harq_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_nrach_indication_rel13_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nrach_indication_pdu_rel13_t *nrach_indication_fdd_rel13 = (nfapi_nrach_indication_pdu_rel13_t *)tlv; + return ( push16(nrach_indication_fdd_rel13->rnti, ppWritePackedMsg, end) && + push8(nrach_indication_fdd_rel13->initial_sc, ppWritePackedMsg, end) && + push16(nrach_indication_fdd_rel13->timing_advance, ppWritePackedMsg, end) && + push8(nrach_indication_fdd_rel13->nrach_ce_level, ppWritePackedMsg, end)); +} + + +static uint8_t pack_nrach_indication_body_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nrach_indication_body_t *value = (nfapi_nrach_indication_body_t *)tlv; + + if( push8(value->number_of_initial_scs_detected, ppWritePackedMsg, end) == 0) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_initial_scs_detected = value->number_of_initial_scs_detected; + + for(; i < total_number_of_initial_scs_detected; ++i) { + nfapi_nrach_indication_pdu_t *pdu = &(value->nrach_pdu_list[i]); + + //uint8_t* instance_length_p = *ppWritePackedMsg; + //if(!push16(pdu->instance_length, ppWritePackedMsg, end)) + // return 0; + + if(!(pack_tlv(NFAPI_NRACH_INDICATION_REL13_TAG, &pdu->nrach_indication_rel13, ppWritePackedMsg, end, pack_nrach_indication_rel13_value))) + return 0; + + // calculate the instance length subtracting the size of the instance + // length feild + //uint16_t instance_length = *ppWritePackedMsg - instance_length_p - 2; + //push16(instance_length, &instance_length_p, end); + } + + return 1; +} + +static uint8_t pack_nrach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nrach_indication_t *pNfapiMsg = (nfapi_nrach_indication_t *)msg; + return ( push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end) && + pack_tlv(NFAPI_NRACH_INDICATION_BODY_TAG, &pNfapiMsg->nrach_indication_body, ppWritePackedMsg, end, &pack_nrach_indication_body_value) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_nr_dl_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nr_dl_node_sync_t *pNfapiMsg = (nfapi_nr_dl_node_sync_t *)msg; + return ( push32(pNfapiMsg->t1, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->delta_sfn_slot, ppWritePackedMsg, end) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_dl_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_dl_node_sync_t *pNfapiMsg = (nfapi_dl_node_sync_t *)msg; + return ( push32(pNfapiMsg->t1, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->delta_sfn_sf, ppWritePackedMsg, end) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_nr_ul_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nr_ul_node_sync_t *pNfapiMsg = (nfapi_nr_ul_node_sync_t *)msg; + return (push32(pNfapiMsg->t1, ppWritePackedMsg, end) && + push32(pNfapiMsg->t2, ppWritePackedMsg, end) && + push32(pNfapiMsg->t3, ppWritePackedMsg, end) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_ul_node_sync(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_ul_node_sync_t *pNfapiMsg = (nfapi_ul_node_sync_t *)msg; + return (push32(pNfapiMsg->t1, ppWritePackedMsg, end) && + push32(pNfapiMsg->t2, ppWritePackedMsg, end) && + push32(pNfapiMsg->t3, ppWritePackedMsg, end) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_timing_info(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_timing_info_t *pNfapiMsg = (nfapi_timing_info_t *)msg; + return (push32(pNfapiMsg->last_sfn_sf, ppWritePackedMsg, end) && + push32(pNfapiMsg->time_since_last_timing_info, ppWritePackedMsg, end) && + push32(pNfapiMsg->dl_config_jitter, ppWritePackedMsg, end) && + push32(pNfapiMsg->tx_request_jitter, ppWritePackedMsg, end) && + push32(pNfapiMsg->ul_config_jitter, ppWritePackedMsg, end) && + push32(pNfapiMsg->hi_dci0_jitter, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->dl_config_latest_delay, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->tx_request_latest_delay, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->ul_config_latest_delay, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->hi_dci0_latest_delay, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->dl_config_earliest_arrival, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->tx_request_earliest_arrival, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->ul_config_earliest_arrival, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->hi_dci0_earliest_arrival, ppWritePackedMsg, end) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +static uint8_t pack_nr_timing_info(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nr_timing_info_t *pNfapiMsg = (nfapi_nr_timing_info_t *)msg; + return (push32(pNfapiMsg->last_sfn, ppWritePackedMsg, end) && + push32(pNfapiMsg->last_slot, ppWritePackedMsg, end) && + push32(pNfapiMsg->time_since_last_timing_info, ppWritePackedMsg, end) && + push32(pNfapiMsg->dl_tti_jitter, ppWritePackedMsg, end) && + push32(pNfapiMsg->tx_data_request_jitter, ppWritePackedMsg, end) && + push32(pNfapiMsg->ul_tti_jitter, ppWritePackedMsg, end) && + push32(pNfapiMsg->ul_dci_jitter, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->dl_tti_latest_delay, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->tx_data_request_latest_delay, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->ul_tti_latest_delay, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->ul_dci_latest_delay, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->dl_tti_earliest_arrival, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->tx_data_request_earliest_arrival, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->ul_tti_earliest_arrival, ppWritePackedMsg, end) && + pushs32(pNfapiMsg->ul_dci_earliest_arrival, ppWritePackedMsg, end) && + pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); +} + +//NR UPLINK indication function packing + +//SLOT INDICATION + +static uint8_t pack_nr_slot_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_slot_indication_scf_t *pNfapiMsg = (nfapi_nr_slot_indication_scf_t*)msg; + + if (!(push16((uint16_t)pNfapiMsg->sfn , ppWritePackedMsg, end) && + push16((uint16_t)pNfapiMsg->slot , ppWritePackedMsg, end) + )) + return 0; + +return 1; +} + +//RX DATA INDICATION + +static uint8_t pack_nr_rx_data_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +{ + nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv; + + if(!(push32(value->handle, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->harq_id, ppWritePackedMsg, end) && + push16(value->pdu_length, ppWritePackedMsg, end) && + push8(value->ul_cqi, ppWritePackedMsg, end) && + push16(value->timing_advance, ppWritePackedMsg, end) && + push16(value->rssi, ppWritePackedMsg, end) + )) + return 0; + + return 1; +} + + +static uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t*)msg; + + if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && + push16(pNfapiMsg->slot , ppWritePackedMsg, end) && + push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end) + )) + return 0; + + for(int i=0; inumber_of_pdus;i++) + { + if(!pack_nr_rx_data_indication_body(pNfapiMsg->pdu_list,ppWritePackedMsg,end)) + return 0; + } + +return 1; +} + +//NR CRC INDICATION + +static uint8_t pack_nr_crc_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +{ + nfapi_nr_crc_t* value = (nfapi_nr_crc_t*)tlv; + + if(!(push32(value->handle, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->harq_id, ppWritePackedMsg, end) && + push8(value->tb_crc_status, ppWritePackedMsg, end) && + push16(value->num_cb, ppWritePackedMsg, end) && + //pusharray8(value->cb_crc_status, (int)(value->num_cb / 8) + 1, (int)(value->num_cb / 8) + 1, ppWritePackedMsg, end) && //length is ceil(NumCb/8) + push8(value->ul_cqi, ppWritePackedMsg, end) && + push16(value->timing_advance, ppWritePackedMsg, end) && + push16(value->rssi, ppWritePackedMsg, end) + )) + return 0; + + return 1; +} + +static uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t*)msg; + + if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && + push16(pNfapiMsg->slot , ppWritePackedMsg, end) && + push16(pNfapiMsg->number_crcs, ppWritePackedMsg, end) + )) + return 0; + + for(int i=0; inumber_crcs;i++) + { + if(!pack_nr_crc_indication_body(pNfapiMsg->crc_list,ppWritePackedMsg,end)) + return 0; + } + +return 1; +} + +//SRS INDICATION + +static uint8_t pack_nr_srs_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +{ + nfapi_nr_srs_indication_pdu_t* value = (nfapi_nr_srs_indication_pdu_t*)tlv; + + if(!(push32(value->handle, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push16(value->timing_advance, ppWritePackedMsg, end) && + push8(value->num_symbols, ppWritePackedMsg, end) && + push8(value->wide_band_snr, ppWritePackedMsg, end) && + push8(value->num_reported_symbols, ppWritePackedMsg, end) && + push8(value->reported_symbol_list->num_rbs, ppWritePackedMsg, end) + )) + return 0; + for(int i = 0; i < value->reported_symbol_list->num_rbs; i++) + { + if(!(push8(value->reported_symbol_list->rb_list->rb_snr, ppWritePackedMsg, end) + )) + return 0; + } + return 1; +} + +static uint8_t pack_nr_srs_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t*)msg; + + if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && + push16(pNfapiMsg->slot , ppWritePackedMsg, end) && + push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end) + )) + return 0; + + for(int i=0; inumber_of_pdus;i++) + { + if(!pack_nr_srs_indication_body(&(pNfapiMsg->pdu_list[i]),ppWritePackedMsg,end)) + return 0; + } + +return 1; +} + +//RACH INDICATION + +static uint8_t pack_nr_rach_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +{ + nfapi_nr_prach_indication_pdu_t* value = (nfapi_nr_prach_indication_pdu_t*)tlv; + + if(!(push16(value->phy_cell_id, ppWritePackedMsg, end) && + push8(value->symbol_index, ppWritePackedMsg, end) && + push8(value->slot_index, ppWritePackedMsg, end) && + push8(value->freq_index, ppWritePackedMsg, end) && + push8(value->avg_rssi, ppWritePackedMsg, end) && + push8(value->avg_snr, ppWritePackedMsg, end) && + push8(value->num_preamble, ppWritePackedMsg, end) + )) + return 0; + for(int i = 0; i < value->num_preamble; i++) + { + if(!(push8(value->preamble_list->preamble_index, ppWritePackedMsg, end) && + push16(value->preamble_list->timing_advance, ppWritePackedMsg, end) && + push32(value->preamble_list->preamble_pwr, ppWritePackedMsg, end) + )) + return 0; + } + return 1; +} + +static uint8_t pack_nr_rach_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t*)msg; + + if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && + push16(pNfapiMsg->slot , ppWritePackedMsg, end) && + push8(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end) + )) + return 0; + + for(int i=0; inumber_of_pdus;i++) + { + if(!pack_nr_rach_indication_body(&(pNfapiMsg->pdu_list[i]),ppWritePackedMsg,end)) + return 0; + } + +return 1; +} + + +//UCI INDICATION + +static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_uci_pucch_pdu_format_0_1_t* value = (nfapi_nr_uci_pucch_pdu_format_0_1_t*)tlv; + + if(!(push8(value->pduBitmap, ppWritePackedMsg, end) && + push32(value->handle, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->pucch_format, ppWritePackedMsg, end) && + push8(value->ul_cqi, ppWritePackedMsg, end) && + push16(value->timing_advance, ppWritePackedMsg, end) && + push16(value->rssi, ppWritePackedMsg, end) + )) + return 0; + if (value->pduBitmap & 0x01) { //SR + if(!(push8(value->sr->sr_indication, ppWritePackedMsg, end) && + push8(value->sr->sr_confidence_level, ppWritePackedMsg, end) + )) + return 0; + } + + if (((value->pduBitmap >> 1) & 0x01)) { //HARQ + if(!(push8(value->harq->num_harq, ppWritePackedMsg, end) && + push8(value->harq->harq_confidence_level, ppWritePackedMsg, end) + )) + return 0; + + for(int i=0; iharq->num_harq;i++) + { + if(!(push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end) + )) + return 0; + } + } + + return 1; +} + +static uint8_t pack_nr_uci_pucch_2_3_4(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; + + if(!(push8(value->pduBitmap, ppWritePackedMsg, end) && + push32(value->handle, ppWritePackedMsg, end) && + push16(value->rnti, ppWritePackedMsg, end) && + push8(value->pucch_format, ppWritePackedMsg, end) && + push8(value->ul_cqi, ppWritePackedMsg, end) && + push16(value->timing_advance, ppWritePackedMsg, end) && + push16(value->rssi, ppWritePackedMsg, end) + )) + return 0; + + if (value->pduBitmap & 0x01) { //SR + if(!(push8(value->sr.sr_bit_len, ppWritePackedMsg, end) && + pusharray8(value->sr.sr_payload, (int)(value->sr.sr_bit_len / 8) + 1, (int)(value->sr.sr_bit_len / 8) + 1, ppWritePackedMsg, end) + )) + return 0; + } + + if (((value->pduBitmap >> 1) & 0x01)) { //HARQ + if(!(push8(value->harq.harq_crc, ppWritePackedMsg, end) && + push8(value->harq.harq_bit_len, ppWritePackedMsg, end) && + pusharray8(value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8) + 1, (int)(value->harq.harq_bit_len / 8) + 1, ppWritePackedMsg, end) + )) + return 0; + } + + if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1 + if(!(push8(value->csi_part1.csi_part1_crc, ppWritePackedMsg, end) && + push8(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end) && + pusharray8(value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, ppWritePackedMsg, end) + )) + return 0; + } + + if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2 + if(!(push8(value->csi_part2.csi_part2_crc, ppWritePackedMsg, end) && + push8(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end) && + pusharray8(value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, ppWritePackedMsg, end) + )) + return 0; + } + + return 1; +} + +static uint8_t pack_nr_uci_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +{ + nfapi_nr_uci_t* value = (nfapi_nr_uci_t*)tlv; + + if(!(push16(value->pdu_type, ppWritePackedMsg, end) && + push16(value->pdu_size, ppWritePackedMsg, end) + )) + return 0; + + switch (value->pdu_type) { + case NFAPI_NR_UCI_PUSCH_PDU_TYPE: + printf("Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n"); + break; + + case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: + pack_nr_uci_pucch_0_1(&value->pucch_pdu_format_0_1, ppWritePackedMsg, end); + break; + + case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: + pack_nr_uci_pucch_2_3_4(&value->pucch_pdu_format_2_3_4, ppWritePackedMsg, end); + break; + } + + return 1; +} + +static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg; + + if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && + push16(pNfapiMsg->slot , ppWritePackedMsg, end) && + push16(pNfapiMsg->num_ucis, ppWritePackedMsg, end) + )) + return 0; + + for(int i=0; inum_ucis;i++) + { + if(!pack_nr_uci_indication_body(pNfapiMsg->uci_list,ppWritePackedMsg,end)) + return 0; + } + +return 1; +} + + +// Main pack function - public + +int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t* config) +{ + nfapi_p7_message_header_t *pMessageHeader = pMessageBuf; + uint8_t *pWritePackedMessage = pPackedBuf; + uint8_t *pPackedLengthField = &pWritePackedMessage[4]; + uint8_t *end = pPackedBuf + packedBufLen; + + if (pMessageBuf == NULL || pPackedBuf == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack supplied pointers are null\n"); + return -1; + } + /* + printf("\n P7 MESSAGE SENT: \n"); + for(int i=0; i< packedBufLen; i++){ + printf("%d", *(uint8_t *)(pMessageBuf + i)); + } + printf("\n"); + */ + // process the header + if(!(push16(pMessageHeader->phy_id, &pWritePackedMessage, end) && + push16(pMessageHeader->message_id, &pWritePackedMessage, end) && + push16(0/*pMessageHeader->message_length*/, &pWritePackedMessage, end) && + push16(pMessageHeader->m_segment_sequence, &pWritePackedMessage, end) && + push32(0/*pMessageHeader->checksum*/, &pWritePackedMessage, end) && + push32(pMessageHeader->transmit_timestamp, &pWritePackedMessage, end))) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack header failed\n"); + return -1; + } + + if (pMessageHeader->message_id != NFAPI_TIMING_INFO) + { + //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() message_id:0x%04x phy_id:%u m_segment_sequence:%u timestamp:%u\n", __FUNCTION__, pMessageHeader->message_id, pMessageHeader->phy_id, pMessageHeader->m_segment_sequence, pMessageHeader->transmit_timestamp); + } + // look for the specific message + uint8_t result = 0; + switch (pMessageHeader->message_id) + { + case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: + result = pack_dl_tti_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: + result = pack_ul_tti_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: + result = pack_tx_data_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: + result = pack_ul_dci_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_UE_RELEASE_REQUEST: + result =pack_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_UE_RELEASE_RESPONSE: + result =pack_ue_release_response(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: + result = pack_nr_slot_indication(pMessageHeader, &pWritePackedMessage, end, config); + + case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: + result = pack_nr_rx_data_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: + result = pack_nr_crc_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: + result = pack_nr_uci_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: + result = pack_nr_srs_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: + result = pack_nr_rach_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC: + result = pack_nr_dl_node_sync(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_NODE_SYNC: + result = pack_nr_ul_node_sync(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_TIMING_INFO: + result = pack_nr_timing_info(pMessageHeader, &pWritePackedMessage, end, config); + break; + + default: + { + if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && + pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX) + { + if(config && config->pack_p7_vendor_extension) + { + result = (config->pack_p7_vendor_extension)(pMessageHeader, &pWritePackedMessage, end, config); + } + else + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve ecoder provided\n", __FUNCTION__, pMessageHeader->message_id); + } + } + else + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id); + } + } + break; + } + + if(result == 0) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack failed to pack message\n"); + return -1; + } + + // check for a valid message length + uintptr_t msgHead = (uintptr_t)pPackedBuf; + uintptr_t msgEnd = (uintptr_t)pWritePackedMessage; + uint32_t packedMsgLen = msgEnd - msgHead; + uint16_t packedMsgLen16; + if (packedMsgLen > 0xFFFF || packedMsgLen > packedBufLen) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Packed message length error %d, buffer supplied %d\n", packedMsgLen, packedBufLen); + return -1; + } + else + { + packedMsgLen16 = (uint16_t)packedMsgLen; + } + + // Update the message length in the header + pMessageHeader->message_length = packedMsgLen16; + + if(!push16(packedMsgLen16, &pPackedLengthField, end)) + return -1; + + if(1) + { + //quick test + if(pMessageHeader->message_length != packedMsgLen) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id); + } + } + + return (packedMsgLen); +} + +int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBufLen, nfapi_p7_codec_config_t *config) { + nfapi_p7_message_header_t *pMessageHeader = pMessageBuf; + uint8_t *pWritePackedMessage = pPackedBuf; + uint8_t *pPackedLengthField = &pWritePackedMessage[4]; + uint8_t *end = pPackedBuf + packedBufLen; + + if (pMessageBuf == NULL || pPackedBuf == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack supplied pointers are null\n"); + return -1; + } + + /* + printf("\n P7 MESSAGE SENT: \n"); + for(int i=0; i< packedBufLen; i++){ + printf("%d", *(uint8_t *)(pMessageBuf + i)); + } + printf("\n"); + */ + // process the header + if(!(push16(pMessageHeader->phy_id, &pWritePackedMessage, end) && + push16(pMessageHeader->message_id, &pWritePackedMessage, end) && + push16(0/*pMessageHeader->message_length*/, &pWritePackedMessage, end) && + push16(pMessageHeader->m_segment_sequence, &pWritePackedMessage, end) && + push32(0/*pMessageHeader->checksum*/, &pWritePackedMessage, end) && + push32(pMessageHeader->transmit_timestamp, &pWritePackedMessage, end))) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack header failed\n"); + return -1; + } + + if (pMessageHeader->message_id != NFAPI_TIMING_INFO) { + //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() message_id:0x%04x phy_id:%u m_segment_sequence:%u timestamp:%u\n", __FUNCTION__, pMessageHeader->message_id, pMessageHeader->phy_id, pMessageHeader->m_segment_sequence, pMessageHeader->transmit_timestamp); + } + + // look for the specific message + uint8_t result = 0; + + switch (pMessageHeader->message_id) { + case NFAPI_DL_CONFIG_REQUEST: + //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST\n", __FUNCTION__); + result = pack_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_UL_CONFIG_REQUEST: + result = pack_ul_config_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_TX_REQUEST: + //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__); + result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_HI_DCI0_REQUEST: + result = pack_hi_dci0_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_UE_RELEASE_REQUEST: + result =pack_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_UE_RELEASE_RESPONSE: + result =pack_ue_release_response(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_HARQ_INDICATION: + result = pack_harq_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_CRC_INDICATION: + result = pack_crc_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_RX_ULSCH_INDICATION: + //printf("RX ULSCH\n"); + result = pack_rx_ulsch_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_RACH_INDICATION: + result = pack_rach_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_SRS_INDICATION: + result = pack_srs_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_RX_SR_INDICATION: + result = pack_sr_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_RX_CQI_INDICATION: + result = pack_cqi_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_LBT_DL_CONFIG_REQUEST: + result = pack_lbt_dl_config_request(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_LBT_DL_INDICATION: + result = pack_lbt_dl_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NB_HARQ_INDICATION: + result = pack_nb_harq_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_NRACH_INDICATION: + result = pack_nrach_indication(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_DL_NODE_SYNC: + result = pack_dl_node_sync(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_UL_NODE_SYNC: + result = pack_ul_node_sync(pMessageHeader, &pWritePackedMessage, end, config); + break; + + case NFAPI_TIMING_INFO: + result = pack_timing_info(pMessageHeader, &pWritePackedMessage, end, config); + break; + + default: { + if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && + pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX) { + if(config && config->pack_p7_vendor_extension) { + result = (config->pack_p7_vendor_extension)(pMessageHeader, &pWritePackedMessage, end, config); + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve ecoder provided\n", __FUNCTION__, pMessageHeader->message_id); + } + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id); + } + } + break; + } + + if(result == 0) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 Pack failed to pack message\n"); + return -1; + } + + // check for a valid message length + uintptr_t msgHead = (uintptr_t)pPackedBuf; + uintptr_t msgEnd = (uintptr_t)pWritePackedMessage; + uint32_t packedMsgLen = msgEnd - msgHead; + uint16_t packedMsgLen16; + + if (packedMsgLen > 0xFFFF || packedMsgLen > packedBufLen) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Packed message length error %d, buffer supplied %d\n", packedMsgLen, packedBufLen); + return -1; + } else { + packedMsgLen16 = (uint16_t)packedMsgLen; + } + + // Update the message length in the header + pMessageHeader->message_length = packedMsgLen16; + + if(!push16(packedMsgLen16, &pPackedLengthField, end)) + return -1; + + if(1) { + //quick test + if(pMessageHeader->message_length != packedMsgLen) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id); + } + } + + return (packedMsgLen); +} + +// Unpack routines +// NR: +static uint8_t unpack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv; + return( + pull16(ppReadPackedMsg, &value->bwp_size, end) && + pull16(ppReadPackedMsg, &value->bwp_start, end) && + pull8(ppReadPackedMsg, &value->subcarrier_spacing, end) && + pull8(ppReadPackedMsg, &value->cyclic_prefix, end) && + pull16(ppReadPackedMsg, &value->start_rb, end) && + pull16(ppReadPackedMsg, &value->nr_of_rbs, end) && + pull8(ppReadPackedMsg, &value->csi_type, end) && + pull8(ppReadPackedMsg, &value->row, end) && + pull16(ppReadPackedMsg, &value->freq_domain, end) && + pull8(ppReadPackedMsg, &value->symb_l0, end) && + pull8(ppReadPackedMsg, &value->symb_l1, end) && + pull8(ppReadPackedMsg, &value->cdm_type, end) && + pull8(ppReadPackedMsg, &value->freq_density, end) && + pull16(ppReadPackedMsg, &value->scramb_id, end) && + pull8(ppReadPackedMsg, &value->power_control_offset, end) && + pull8(ppReadPackedMsg, &value->power_control_offset_ss, end) + ); +} + + +static uint8_t unpack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + + nfapi_nr_dl_tti_pdcch_pdu_rel15_t* value = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t*)tlv; + + for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i) + { + if(!(pull16(ppReadPackedMsg, &value->dci_pdu[i].RNTI, end) && + pull16(ppReadPackedMsg, &value->dci_pdu[i].ScramblingId, end) && + pull16(ppReadPackedMsg, &value->dci_pdu[i].ScramblingRNTI, end) && + pull8(ppReadPackedMsg, &value->dci_pdu[i].CceIndex, end) && + pull8(ppReadPackedMsg, &value->dci_pdu[i].AggregationLevel, end) && + pull8(ppReadPackedMsg, &value->dci_pdu[i].beta_PDCCH_1_0, end) && + pull8(ppReadPackedMsg, &value->dci_pdu[i].powerControlOffsetSS, end) && + pull16(ppReadPackedMsg, &value->dci_pdu[i].PayloadSizeBits, end) && + + pullarray8(ppReadPackedMsg, value->dci_pdu[i].Payload, value->dci_pdu[i].PayloadSizeBits, value->dci_pdu[i].PayloadSizeBits, end))) + + return 0; + } + // TODO: resolve the packaging of array (currently sending a single element) + return( + pull16(ppReadPackedMsg, &value->BWPSize, end) && + pull16(ppReadPackedMsg, &value->BWPStart, end) && + pull8(ppReadPackedMsg, &value->SubcarrierSpacing, end) && + pull8(ppReadPackedMsg, &value->CyclicPrefix, end) && + pull8(ppReadPackedMsg, &value->StartSymbolIndex, end) && + pull8(ppReadPackedMsg, &value->DurationSymbols, end) && + pullarray8(ppReadPackedMsg, value->FreqDomainResource, 6, 6, end) && + pull8(ppReadPackedMsg, &value->CceRegMappingType, end) && + pull8(ppReadPackedMsg, &value->RegBundleSize, end) && + pull8(ppReadPackedMsg, &value->InterleaverSize, end) && + pull8(ppReadPackedMsg, &value->CoreSetType, end) && + pull16(ppReadPackedMsg, &value->ShiftIndex, end) && + pull8(ppReadPackedMsg, &value->precoderGranularity, end) && + pull16(ppReadPackedMsg, &value->numDlDci, end)); +} + + + +static uint8_t unpack_dl_tti_pdsch_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_dl_tti_pdsch_pdu_rel15_t *value = (nfapi_nr_dl_tti_pdsch_pdu_rel15_t *)tlv; + // TODO: resolve the packaging of array (currently sending a single element) + return( + pull16(ppReadPackedMsg, &value->pduBitmap, end) && + pull16(ppReadPackedMsg, &value->rnti, end) && + pull16(ppReadPackedMsg, &value->pduIndex, end) && + pull16(ppReadPackedMsg, &value->BWPSize, end) && + pull16(ppReadPackedMsg, &value->BWPStart, end) && + pull8(ppReadPackedMsg, &value->SubcarrierSpacing, end) && + pull8(ppReadPackedMsg, &value->CyclicPrefix, end) && + pull8(ppReadPackedMsg, &value->NrOfCodewords, end) && + pullarray16(ppReadPackedMsg, value->targetCodeRate, 2, 1, end) && + pullarray8(ppReadPackedMsg, value->qamModOrder, 2, 1, end) && + pullarray8(ppReadPackedMsg, value->mcsIndex, 2, 1, end) && + pullarray8(ppReadPackedMsg, value->mcsTable, 2, 1, end) && + pullarray8(ppReadPackedMsg, value->rvIndex, 2, 1, end) && + pullarray32(ppReadPackedMsg, value->TBSize, 2, 1, end) && + pull16(ppReadPackedMsg, &value->dataScramblingId, end) && + pull8(ppReadPackedMsg, &value->nrOfLayers, end) && + pull8(ppReadPackedMsg, &value->transmissionScheme, end) && + pull8(ppReadPackedMsg, &value->refPoint, end) && + pull16(ppReadPackedMsg, &value->dlDmrsSymbPos, end) && + pull8(ppReadPackedMsg, &value->dmrsConfigType, end) && + pull16(ppReadPackedMsg, &value->dlDmrsScramblingId, end) && + pull8(ppReadPackedMsg, &value->SCID, end) && + pull8(ppReadPackedMsg, &value->numDmrsCdmGrpsNoData, end) && + pull16(ppReadPackedMsg, &value->dmrsPorts, end) && + pull8(ppReadPackedMsg, &value->resourceAlloc, end) && + pull16(ppReadPackedMsg, &value->rbStart, end) && + pull16(ppReadPackedMsg, &value->rbSize, end) && + pull8(ppReadPackedMsg, &value->VRBtoPRBMapping, end) && + pull8(ppReadPackedMsg, &value->StartSymbolIndex, end) && + pull8(ppReadPackedMsg, &value->NrOfSymbols, end) && + pull8(ppReadPackedMsg, &value->PTRSPortIndex, end) && + pull8(ppReadPackedMsg, &value->PTRSTimeDensity, end) && + pull8(ppReadPackedMsg, &value->PTRSFreqDensity, end) && + pull8(ppReadPackedMsg, &value->PTRSReOffset, end) + ); +} + + +static uint8_t unpack_dl_tti_ssb_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_dl_tti_ssb_pdu_rel15_t *value = (nfapi_nr_dl_tti_ssb_pdu_rel15_t *)tlv; + return( + pull16(ppReadPackedMsg, &value->PhysCellId, end) && + pull8(ppReadPackedMsg, &value->BetaPss, end) && + pull8(ppReadPackedMsg, &value->SsbBlockIndex, end) && + pull8(ppReadPackedMsg, &value->SsbSubcarrierOffset, end) && + pull16(ppReadPackedMsg, &value->ssbOffsetPointA, end) && + pull8(ppReadPackedMsg, &value->bchPayloadFlag, end) && + pull32(ppReadPackedMsg, &value->bchPayload, end) + // TODO: pack precoding_and_beamforming too + ); +} + + +// LTE: +static uint8_t unpack_dl_config_dci_dl_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel8_t *dci_dl_pdu_rel8 = (nfapi_dl_config_dci_dl_pdu_rel8_t *)tlv; + return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->dci_format, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->cce_idx, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->aggregation_level, end) && + pull16(ppReadPackedMsg, &dci_dl_pdu_rel8->rnti, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->resource_allocation_type, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->virtual_resource_block_assignment_flag, end) && + pull32(ppReadPackedMsg, &dci_dl_pdu_rel8->resource_block_coding, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->mcs_1, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->redundancy_version_1, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->new_data_indicator_1, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->transport_block_to_codeword_swap_flag, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->mcs_2, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->redundancy_version_2, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->new_data_indicator_2, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->harq_process, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->tpmi, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->pmi, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->precoding_information, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->tpc, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->downlink_assignment_index, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->ngap, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->transport_block_size_index, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->downlink_power_offset, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->allocate_prach_flag, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->preamble_index, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->prach_mask_index, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel8->rnti_type, end) && + pull16(ppReadPackedMsg, &dci_dl_pdu_rel8->transmission_power, end)); +} + +static uint8_t unpack_dl_config_dci_dl_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel9_t *dci_dl_pdu_rel9 = (nfapi_dl_config_dci_dl_pdu_rel9_t *)tlv; + return ( pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->mcch_flag, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->mcch_change_notification, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel9->scrambling_identity, end)); +} + +static uint8_t unpack_dl_config_dci_dl_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel10_t *dci_dl_pdu_rel10 = (nfapi_dl_config_dci_dl_pdu_rel10_t *)tlv; + return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->cross_carrier_scheduling_flag, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->carrier_indicator, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->srs_flag, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->srs_request, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->antenna_ports_scrambling_and_layers, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->total_dci_length_including_padding, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel10->n_dl_rb, end)); +} + +static uint8_t unpack_dl_config_dci_dl_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel11_t *dci_dl_pdu_rel11 = (nfapi_dl_config_dci_dl_pdu_rel11_t *)tlv; + return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel11->harq_ack_resource_offset, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel11->pdsch_re_mapping_quasi_co_location_indicator, end)); +} + +static uint8_t unpack_dl_config_dci_dl_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel12_t *dci_dl_pdu_rel12 = (nfapi_dl_config_dci_dl_pdu_rel12_t *)tlv; + return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->primary_cell_type, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->ul_dl_configuration_flag, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel12->number_ul_dl_configurations, end) && + pullarray8(ppReadPackedMsg, dci_dl_pdu_rel12->ul_dl_configuration_indication, NFAPI_MAX_UL_DL_CONFIGURATIONS, dci_dl_pdu_rel12->number_ul_dl_configurations, end)); +} + +static uint8_t unpack_tpm_value(uint8_t **ppReadPackedMsg, nfapi_dl_config_dci_dl_tpm_t *value, uint8_t *end) { + if(!(pull8(ppReadPackedMsg, &value->num_prb_per_subband, end) && + pull8(ppReadPackedMsg, &value->number_of_subbands, end) && + pull8(ppReadPackedMsg, &value->num_antennas, end))) + return 0; + + uint8_t idx = 0; + + for(idx = 0; idx < value->number_of_subbands; ++idx) { + nfapi_dl_config_dci_dl_tpm_subband_info_t *subband_info = &(value->subband_info[idx]); + + if(!(pull8(ppReadPackedMsg, &subband_info->subband_index, end) && + pull8(ppReadPackedMsg, &subband_info->scheduled_ues, end))) + return 0; + + uint8_t antenna_idx = 0; + uint8_t scheduled_ue_idx = 0; + + for(antenna_idx = 0; antenna_idx < value->num_antennas; ++antenna_idx) { + for(scheduled_ue_idx = 0; scheduled_ue_idx < subband_info->scheduled_ues; ++scheduled_ue_idx) { + if(!pull16(ppReadPackedMsg, &(subband_info->precoding_value[antenna_idx][scheduled_ue_idx]), end)) + return 0; + } + } + } + + return 1; +} + + +static uint8_t unpack_dl_config_dci_dl_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dci_dl_pdu_rel13_t *dci_dl_pdu_rel13 = (nfapi_dl_config_dci_dl_pdu_rel13_t *)tlv; + // If the length is greater than 5 then the TPM struct flag and possiably the TPM structure have been + // added + uint8_t tpm_struct_flag_present = dci_dl_pdu_rel13->tl.length > 5; + dci_dl_pdu_rel13->tpm_struct_flag = 0; + return (pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->laa_end_partial_sf_flag, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->laa_end_partial_sf_configuration, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->initial_lbt_sf, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->codebook_size_determination, end) && + pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->drms_table_flag, end) && + ( (tpm_struct_flag_present == 1) ? pull8(ppReadPackedMsg, &dci_dl_pdu_rel13->tpm_struct_flag, end) : 1) && + ( (tpm_struct_flag_present == 1 && dci_dl_pdu_rel13->tpm_struct_flag == 1) ? unpack_tpm_value(ppReadPackedMsg, &dci_dl_pdu_rel13->tpm, end) : 1)); +} + +static uint8_t unpack_dl_config_bch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_bch_pdu_rel8_t *bch_pdu_rel8 = (nfapi_dl_config_bch_pdu_rel8_t *)tlv; + return ( pull16(ppReadPackedMsg, &bch_pdu_rel8->length, end) && + pull16(ppReadPackedMsg, (uint16_t *)&bch_pdu_rel8->pdu_index, end) && + pull16(ppReadPackedMsg, &bch_pdu_rel8->transmission_power, end)); +} + +static uint8_t unpack_dl_config_mch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_mch_pdu_rel8_t *mch_pdu_rel8 = (nfapi_dl_config_mch_pdu_rel8_t *)tlv; + return (pull16(ppReadPackedMsg, &mch_pdu_rel8->length, end) && + pull16(ppReadPackedMsg, (uint16_t *)&mch_pdu_rel8->pdu_index, end) && + pull16(ppReadPackedMsg, &mch_pdu_rel8->rnti, end) && + pull8(ppReadPackedMsg, &mch_pdu_rel8->resource_allocation_type, end) && + pull32(ppReadPackedMsg, &mch_pdu_rel8->resource_block_coding, end) && + pull8(ppReadPackedMsg, &mch_pdu_rel8->modulation, end) && + pull16(ppReadPackedMsg, &mch_pdu_rel8->transmission_power, end) && + pull16(ppReadPackedMsg, &mch_pdu_rel8->mbsfn_area_id, end)); +} + +static uint8_t unpack_dl_config_dlsch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel8_t *dlsch_pdu_rel8 = (nfapi_dl_config_dlsch_pdu_rel8_t *)tlv; + + if (!(pull16(ppReadPackedMsg, &dlsch_pdu_rel8->length, end) && + pull16(ppReadPackedMsg, (uint16_t *)&dlsch_pdu_rel8->pdu_index, end) && + pull16(ppReadPackedMsg, &dlsch_pdu_rel8->rnti, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->resource_allocation_type, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->virtual_resource_block_assignment_flag, end) && + pull32(ppReadPackedMsg, &dlsch_pdu_rel8->resource_block_coding, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->modulation, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->redundancy_version, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transport_blocks, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transport_block_to_codeword_swap_flag, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transmission_scheme, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->number_of_layers, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->number_of_subbands, end) && + pullarray8(ppReadPackedMsg, dlsch_pdu_rel8->codebook_index, NFAPI_MAX_NUM_SUBBANDS, dlsch_pdu_rel8->number_of_subbands, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->ue_category_capacity, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->pa, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->delta_power_offset_index, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->ngap, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->nprb, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->transmission_mode, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->num_bf_prb_per_subband, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->num_bf_vector, end))) + return 0; + + uint16_t j = 0; + + for(j = 0; j < dlsch_pdu_rel8->num_bf_vector; ++j) { + if(!(pull8(ppReadPackedMsg, &dlsch_pdu_rel8->bf_vector[j].subband_index, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel8->bf_vector[j].num_antennas, end) && + pullarray16(ppReadPackedMsg, dlsch_pdu_rel8->bf_vector[j].bf_value, NFAPI_MAX_NUM_ANTENNAS, dlsch_pdu_rel8->bf_vector[j].num_antennas, end))) + return 0; + } + + return 1; +} +static uint8_t unpack_dl_config_dlsch_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel9_t *dlsch_pdu_rel9 = (nfapi_dl_config_dlsch_pdu_rel9_t *)tlv; + return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel9->nscid, end) ); +} +static uint8_t unpack_dl_config_dlsch_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel10_t *dlsch_pdu_rel10 = (nfapi_dl_config_dlsch_pdu_rel10_t *)tlv; + return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_flag, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_resource_config_r10, end) && + pull16(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_zero_tx_power_resource_config_bitmap_r10, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel10->csi_rs_number_nzp_configuration, end) && + pullarray8(ppReadPackedMsg, dlsch_pdu_rel10->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, dlsch_pdu_rel10->csi_rs_number_nzp_configuration, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel10->pdsch_start, end)) ; +} +static uint8_t unpack_dl_config_dlsch_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel11_t *dlsch_pdu_rel11 = (nfapi_dl_config_dlsch_pdu_rel11_t *)tlv; + return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel11->drms_config_flag, end) && + pull16(ppReadPackedMsg, &dlsch_pdu_rel11->drms_scrambling, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel11->csi_config_flag, end) && + pull16(ppReadPackedMsg, &dlsch_pdu_rel11->csi_scrambling, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_flag, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_atenna_ports, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel11->pdsch_re_mapping_freq_shift, end)); +} +static uint8_t unpack_dl_config_dlsch_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel12_t *dlsch_pdu_rel12 = (nfapi_dl_config_dlsch_pdu_rel12_t *)tlv; + return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel12->altcqi_table_r12, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel12->maxlayers, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel12->n_dl_harq, end)); +} +static uint8_t unpack_dl_config_dlsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_dlsch_pdu_rel13_t *dlsch_pdu_rel13 = (nfapi_dl_config_dlsch_pdu_rel13_t *)tlv; + return ( pull8(ppReadPackedMsg, &dlsch_pdu_rel13->dwpts_symbols, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel13->initial_lbt_sf, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel13->ue_type, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel13->pdsch_payload_type, end) && + pull16(ppReadPackedMsg, &dlsch_pdu_rel13->initial_transmission_sf_io, end) && + pull8(ppReadPackedMsg, &dlsch_pdu_rel13->drms_table_flag, end)); +} + +static uint8_t unpack_dl_config_pch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_pch_pdu_rel8_t *pch_pdu_rel8 = (nfapi_dl_config_pch_pdu_rel8_t *)tlv; + return ( pull16(ppReadPackedMsg, &pch_pdu_rel8->length, end) && + pull16(ppReadPackedMsg, (uint16_t *)&pch_pdu_rel8->pdu_index, end) && + pull16(ppReadPackedMsg, &pch_pdu_rel8->p_rnti, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->resource_allocation_type, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->virtual_resource_block_assignment_flag, end) && + pull32(ppReadPackedMsg, &pch_pdu_rel8->resource_block_coding, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->mcs, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->redundancy_version, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->number_of_transport_blocks, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->transport_block_to_codeword_swap_flag, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->transmission_scheme, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->number_of_layers, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->codebook_index, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->ue_category_capacity, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->pa, end) && + pull16(ppReadPackedMsg, &pch_pdu_rel8->transmission_power, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->nprb, end) && + pull8(ppReadPackedMsg, &pch_pdu_rel8->ngap, end)); +} +static uint8_t unpack_dl_config_pch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_pch_pdu_rel13_t *pch_pdu_rel13 = (nfapi_dl_config_pch_pdu_rel13_t *)tlv; + return ( pull8(ppReadPackedMsg, &pch_pdu_rel13->ue_mode, end) && + pull16(ppReadPackedMsg, &pch_pdu_rel13->initial_transmission_sf_io, end)); +} + +static uint8_t unpack_dl_config_prs_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_prs_pdu_rel9_t *prs_pdu_rel9 = (nfapi_dl_config_prs_pdu_rel9_t *)tlv; + return ( pull16(ppReadPackedMsg, &prs_pdu_rel9->transmission_power, end) && + pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_bandwidth, end) && + pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_cyclic_prefix_type, end) && + pull8(ppReadPackedMsg, &prs_pdu_rel9->prs_muting, end)); +} + +static uint8_t unpack_dl_config_csi_rs_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_csi_rs_pdu_rel10_t *csi_rs_pdu_rel10 = (nfapi_dl_config_csi_rs_pdu_rel10_t *)tlv; + return ( pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_antenna_port_count_r10, end) && + pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_resource_config_r10, end) && + pull16(ppReadPackedMsg, &csi_rs_pdu_rel10->transmission_power, end) && + pull16(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_zero_tx_power_resource_config_bitmap_r10, end) && + pull8(ppReadPackedMsg, &csi_rs_pdu_rel10->csi_rs_number_of_nzp_configuration, end) && + pullarray8(ppReadPackedMsg, csi_rs_pdu_rel10->csi_rs_resource_config, NFAPI_MAX_CSI_RS_RESOURCE_CONFIG, csi_rs_pdu_rel10->csi_rs_number_of_nzp_configuration, end)); +} + +static uint8_t unpack_dl_config_csi_rs_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_csi_rs_pdu_rel13_t *csi_rs_pdu_rel13 = (nfapi_dl_config_csi_rs_pdu_rel13_t *)tlv; + + if (!(pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->csi_rs_class, end) && + pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->cdm_type, end) && + pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->num_bf_vector, end))) + return 0; + + uint16_t idx =0; + + for(idx = 0; idx < csi_rs_pdu_rel13->num_bf_vector; ++idx) { + if(!(pull8(ppReadPackedMsg, &csi_rs_pdu_rel13->bf_vector[idx].csi_rs_resource_index, end))) + return 0; + + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : HOW TO DECODE BF VALUE \n"); + //pullarray16(ppReadPackedMsg, &csi_rs_pdu_rel13->bf_vector[idx].bf_vector, ??); + } + + return 1; +} + +static uint8_t unpack_dl_config_epdcch_params_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_epdcch_parameters_rel11_t *epdcch_params_rel11 = (nfapi_dl_config_epdcch_parameters_rel11_t *)tlv; + return (pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_resource_assignment_flag, end) && + pull16(ppReadPackedMsg, &epdcch_params_rel11->epdcch_id, end) && + pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_start_symbol, end) && + pull8(ppReadPackedMsg, &epdcch_params_rel11->epdcch_num_prb, end) && + pullarray8(ppReadPackedMsg, epdcch_params_rel11->epdcch_prb_index, NFAPI_MAX_EPDCCH_PRB, epdcch_params_rel11->epdcch_num_prb, end) && + pull8(ppReadPackedMsg, &epdcch_params_rel11->bf_vector.subband_index, end) && + pull8(ppReadPackedMsg, &epdcch_params_rel11->bf_vector.num_antennas, end) && + pullarray16(ppReadPackedMsg, epdcch_params_rel11->bf_vector.bf_value, NFAPI_MAX_NUM_ANTENNAS, epdcch_params_rel11->bf_vector.num_antennas, end)); +} + +static uint8_t unpack_dl_config_epdcch_params_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_epdcch_parameters_rel13_t *epdcch_params_rel13 = (nfapi_dl_config_epdcch_parameters_rel13_t *)tlv; + return ( pull8(ppReadPackedMsg, &epdcch_params_rel13->dwpts_symbols, end) && + pull8(ppReadPackedMsg, &epdcch_params_rel13->initial_lbt_sf, end)); +} + +static uint8_t unpack_dl_config_mpdcch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_mpdcch_pdu_rel13_t *mpdcch_params_rel13 = (nfapi_dl_config_mpdcch_pdu_rel13_t *)tlv; + return ( pull8(ppReadPackedMsg, &mpdcch_params_rel13->mpdcch_narrow_band, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->number_of_prb_pairs, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->resource_block_assignment, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->mpdcch_tansmission_type, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->start_symbol, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->ecce_index, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->aggregation_level, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->rnti_type, end) && + pull16(ppReadPackedMsg, &mpdcch_params_rel13->rnti, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->ce_mode, end) && + pull16(ppReadPackedMsg, &mpdcch_params_rel13->drms_scrambling_init, end) && + pull16(ppReadPackedMsg, &mpdcch_params_rel13->initial_transmission_sf_io, end) && + pull16(ppReadPackedMsg, &mpdcch_params_rel13->transmission_power, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->dci_format, end) && + pull16(ppReadPackedMsg, &mpdcch_params_rel13->resource_block_coding, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->mcs, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->pdsch_reptition_levels, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->redundancy_version, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->new_data_indicator, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->harq_process, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpmi_length, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpmi, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->pmi_flag, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->pmi, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->harq_resource_offset, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->dci_subframe_repetition_number, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->tpc, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->downlink_assignment_index_length, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->downlink_assignment_index, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->allocate_prach_flag, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->preamble_index, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->prach_mask_index, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->starting_ce_level, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->srs_request, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->antenna_ports_and_scrambling_identity_flag, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->antenna_ports_and_scrambling_identity, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->frequency_hopping_enabled_flag, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->paging_direct_indication_differentiation_flag, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->direct_indication, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->total_dci_length_including_padding, end) && + pull8(ppReadPackedMsg, &mpdcch_params_rel13->number_of_tx_antenna_ports, end) && + pullarray16(ppReadPackedMsg, mpdcch_params_rel13->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, mpdcch_params_rel13->number_of_tx_antenna_ports, end)); +} + + +static uint8_t unpack_dl_config_nbch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_nbch_pdu_rel13_t *nbch_params_rel13 = (nfapi_dl_config_nbch_pdu_rel13_t *)tlv; + return ( pull16(ppReadPackedMsg, &nbch_params_rel13->length, end) && + pull16(ppReadPackedMsg, (uint16_t *)&nbch_params_rel13->pdu_index, end) && + pull16(ppReadPackedMsg, &nbch_params_rel13->transmission_power, end) && + pull16(ppReadPackedMsg, &nbch_params_rel13->hyper_sfn_2_lsbs, end)); +} + +static uint8_t unpack_dl_config_npdcch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_npdcch_pdu_rel13_t *npdcch_params_rel13 = (nfapi_dl_config_npdcch_pdu_rel13_t *)tlv; + return ( pull16(ppReadPackedMsg, &npdcch_params_rel13->length, end) && + pull16(ppReadPackedMsg, (uint16_t *)&npdcch_params_rel13->pdu_index, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->ncce_index, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->aggregation_level, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->start_symbol, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->rnti_type, end) && + pull16(ppReadPackedMsg, &npdcch_params_rel13->rnti, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->scrambling_reinitialization_batch_index, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->nrs_antenna_ports_assumed_by_the_ue, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->dci_format, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->scheduling_delay, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->resource_assignment, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->repetition_number, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->mcs, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->new_data_indicator, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->harq_ack_resource, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->npdcch_order_indication, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->starting_number_of_nprach_repetitions, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->subcarrier_indication_of_nprach, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->paging_direct_indication_differentation_flag, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->direct_indication, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->dci_subframe_repetition_number, end) && + pull8(ppReadPackedMsg, &npdcch_params_rel13->total_dci_length_including_padding, end)); +} + +static uint8_t unpack_dl_config_ndlsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_dl_config_ndlsch_pdu_rel13_t *ndlsch_params_rel13 = (nfapi_dl_config_ndlsch_pdu_rel13_t *)tlv; + return ( pull16(ppReadPackedMsg, &ndlsch_params_rel13->length, end) && + pull16(ppReadPackedMsg, (uint16_t *)&ndlsch_params_rel13->pdu_index, end) && + pull8(ppReadPackedMsg, &ndlsch_params_rel13->start_symbol, end) && + pull8(ppReadPackedMsg, &ndlsch_params_rel13->rnti_type, end) && + pull16(ppReadPackedMsg, &ndlsch_params_rel13->rnti, end) && + pull16(ppReadPackedMsg, &ndlsch_params_rel13->resource_assignment, end) && + pull16(ppReadPackedMsg, &ndlsch_params_rel13->repetition_number, end) && + pull8(ppReadPackedMsg, &ndlsch_params_rel13->modulation, end) && + pull8(ppReadPackedMsg, &ndlsch_params_rel13->number_of_subframes_for_resource_assignment, end) && + pull8(ppReadPackedMsg, &ndlsch_params_rel13->scrambling_sequence_initialization_cinit, end) && + pull16(ppReadPackedMsg, &ndlsch_params_rel13->sf_idx, end) && + pull8(ppReadPackedMsg, &ndlsch_params_rel13->nrs_antenna_ports_assumed_by_the_ue, end)); +} + + +static uint8_t unpack_dl_tti_request_body_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { + nfapi_nr_dl_tti_request_pdu_t *value = (nfapi_nr_dl_tti_request_pdu_t *)msg; + + if(!(pull32(ppReadPackedMsg, &value->PDUSize, end) && + pull16(ppReadPackedMsg, &value->PDUType, end) )) + return 0; + + // first match the pdu type, then call the respective function + switch(value->PDUType) { + case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE: { + if(!(unpack_dl_tti_csi_rs_pdu_rel15_value(&value->csi_rs_pdu.csi_rs_pdu_rel15,ppReadPackedMsg,end))) + return 0; + } + break; + + case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE: { + if(!(unpack_dl_tti_pdcch_pdu_rel15_value(&value->pdcch_pdu.pdcch_pdu_rel15,ppReadPackedMsg,end))) + return 0; + } + break; + + case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE: { + if(!(unpack_dl_tti_pdsch_pdu_rel15_value(&value->pdsch_pdu.pdsch_pdu_rel15,ppReadPackedMsg,end))) + return 0; + } + break; + + case NFAPI_NR_DL_TTI_SSB_PDU_TYPE: { + if(!(unpack_dl_tti_ssb_pdu_rel15_value(&value->ssb_pdu.ssb_pdu_rel15,ppReadPackedMsg,end))) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid DL_TTI pdu type %d \n", value->PDUType ); + } + break; + } + + return 1; +} + + + + +static uint8_t unpack_dl_config_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_dl_config_request_body_t *value = (nfapi_dl_config_request_body_t *)tlv; + + if(!(pull8(ppReadPackedMsg, &value->number_pdcch_ofdm_symbols, end) && + pull8(ppReadPackedMsg, &value->number_dci, end) && + pull16(ppReadPackedMsg, &value->number_pdu, end) && + pull8(ppReadPackedMsg, &value->number_pdsch_rnti, end) && + pull16(ppReadPackedMsg, &value->transmission_power_pcfich, end))) + return 0; + + if(value->number_pdu > NFAPI_DL_CONFIG_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of dl config pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_pdu, NFAPI_DL_CONFIG_MAX_PDU); + return 0; + } + + if(value->number_pdu) { + value->dl_config_pdu_list = (nfapi_dl_config_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_dl_config_request_pdu_t) * value->number_pdu, config); + + if(value->dl_config_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate dl config pdu list (count:%d)\n", __FUNCTION__, value->number_pdu); + return 0; + } + } else { + value->dl_config_pdu_list = 0; + } + + uint16_t i; + uint16_t total_number_of_pdus = value->number_pdu; + + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_dl_config_request_pdu_t *pdu = &(value->dl_config_pdu_list[i]); + + if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && + pull8(ppReadPackedMsg, &pdu->pdu_size, end))) + return 0; + + uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; + + if(packedPduEnd > end) { + // pdu end of beyond buffer end + return 0; + } + + switch(pdu->pdu_type) { + case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel8, &unpack_dl_config_dci_dl_pdu_rel8_value}, + { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL9_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel9, &unpack_dl_config_dci_dl_pdu_rel9_value}, + { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL10_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel10, &unpack_dl_config_dci_dl_pdu_rel10_value}, + { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL11_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel11, &unpack_dl_config_dci_dl_pdu_rel11_value}, + { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL12_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel12, &unpack_dl_config_dci_dl_pdu_rel12_value}, + { NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL13_TAG, &pdu->dci_dl_pdu.dci_dl_pdu_rel13, &unpack_dl_config_dci_dl_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_BCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_BCH_PDU_REL8_TAG, &pdu->bch_pdu.bch_pdu_rel8, &unpack_dl_config_bch_pdu_rel8_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_MCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_MCH_PDU_REL8_TAG, &pdu->mch_pdu.mch_pdu_rel8, &unpack_dl_config_mch_pdu_rel8_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_DLSCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel8, &unpack_dl_config_dlsch_pdu_rel8_value}, + { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL9_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel9, &unpack_dl_config_dlsch_pdu_rel9_value}, + { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel10, &unpack_dl_config_dlsch_pdu_rel10_value}, + { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL11_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel11, &unpack_dl_config_dlsch_pdu_rel11_value}, + { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL12_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel12, &unpack_dl_config_dlsch_pdu_rel12_value}, + { NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG, &pdu->dlsch_pdu.dlsch_pdu_rel13, &unpack_dl_config_dlsch_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_PCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL8_TAG, &pdu->pch_pdu.pch_pdu_rel8, &unpack_dl_config_pch_pdu_rel8_value}, + { NFAPI_DL_CONFIG_REQUEST_PCH_PDU_REL13_TAG, &pdu->pch_pdu.pch_pdu_rel13, &unpack_dl_config_pch_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_PRS_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_PRS_PDU_REL9_TAG, &pdu->prs_pdu.prs_pdu_rel9, &unpack_dl_config_prs_pdu_rel9_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_CSI_RS_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL10_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel10, &unpack_dl_config_csi_rs_pdu_rel10_value}, + { NFAPI_DL_CONFIG_REQUEST_CSI_RS_PDU_REL13_TAG, &pdu->csi_rs_pdu.csi_rs_pdu_rel13, &unpack_dl_config_csi_rs_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL8_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel8, &unpack_dl_config_dci_dl_pdu_rel8_value}, + { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL9_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel9, &unpack_dl_config_dci_dl_pdu_rel9_value}, + { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL10_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel10, &unpack_dl_config_dci_dl_pdu_rel10_value}, + { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL11_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel11, &unpack_dl_config_dci_dl_pdu_rel11_value}, + { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL12_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel12, &unpack_dl_config_dci_dl_pdu_rel12_value}, + { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PDU_REL13_TAG, &pdu->epdcch_pdu.epdcch_pdu_rel13, &unpack_dl_config_dci_dl_pdu_rel13_value}, + { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL11_TAG, &pdu->epdcch_pdu.epdcch_params_rel11, &unpack_dl_config_epdcch_params_rel11_value}, + { NFAPI_DL_CONFIG_REQUEST_EPDCCH_PARAM_REL13_TAG, &pdu->epdcch_pdu.epdcch_params_rel13, &unpack_dl_config_epdcch_params_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_MPDCCH_PDU_REL13_TAG, &pdu->mpdcch_pdu.mpdcch_pdu_rel13, &unpack_dl_config_mpdcch_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_NBCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_NBCH_PDU_REL13_TAG, &pdu->nbch_pdu.nbch_pdu_rel13, &unpack_dl_config_nbch_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_NPDCCH_PDU_REL13_TAG, &pdu->npdcch_pdu.npdcch_pdu_rel13, &unpack_dl_config_npdcch_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_NDLSCH_PDU_REL13_TAG, &pdu->ndlsch_pdu.ndlsch_pdu_rel13, &unpack_dl_config_ndlsch_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + default: + // Need to log an error + break; + } + } + + return 1; +} + + +static uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nr_dl_tti_request_t *pNfapiMsg = (nfapi_nr_dl_tti_request_t *)msg; + + if (!(pull16(ppReadPackedMsg,&pNfapiMsg->SFN, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->dl_tti_request_body.nGroup, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->dl_tti_request_body.nPDUs, end) && + pullarray8(ppReadPackedMsg,pNfapiMsg->dl_tti_request_body.nUe,256,pNfapiMsg->dl_tti_request_body.nGroup, end) + //pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end) + )) + return 0; + + int arr[12]; + + for(int i=0; idl_tti_request_body.nGroup; i++) { + for(int j=0; jdl_tti_request_body.nUe[i]; j++) { + arr[j] = pNfapiMsg->dl_tti_request_body.PduIdx[i][j]; + } + + if(!(pullarrays32(ppReadPackedMsg,arr,12,pNfapiMsg->dl_tti_request_body.nUe[i], end))) + return 0; + } + + for(int i=0; idl_tti_request_body.nPDUs; i++) { + if(!unpack_dl_tti_request_body_value(ppReadPackedMsg, end, &pNfapiMsg->dl_tti_request_body.dl_tti_pdu_list[i])) + return 0; + } + + return 1; +} + + +static uint8_t unpack_ul_tti_request_prach_pdu(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_prach_pdu_t *prach_pdu = (nfapi_nr_prach_pdu_t *)tlv; + return( + pull16(ppReadPackedMsg, &prach_pdu->phys_cell_id, end) && + pull8(ppReadPackedMsg, &prach_pdu->num_prach_ocas, end) && + pull8(ppReadPackedMsg, &prach_pdu->prach_format, end) && + pull8(ppReadPackedMsg, &prach_pdu->num_ra, end) && + pull8(ppReadPackedMsg, &prach_pdu->prach_start_symbol, end) && + pull16(ppReadPackedMsg, &prach_pdu->num_cs, end) + // TODO: ignoring beamforming tlv for now + ); +} + + +static uint8_t unpack_ul_tti_request_pucch_pdu(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_pucch_pdu_t *pucch_pdu = (nfapi_nr_pucch_pdu_t *)tlv; + return( + pull16(ppReadPackedMsg, &pucch_pdu->rnti, end) && + pull32(ppReadPackedMsg, &pucch_pdu->handle, end) && + pull16(ppReadPackedMsg, &pucch_pdu->bwp_size, end) && + pull16(ppReadPackedMsg, &pucch_pdu->bwp_start, end) && + pull8(ppReadPackedMsg, &pucch_pdu->subcarrier_spacing, end) && + pull8(ppReadPackedMsg, &pucch_pdu->cyclic_prefix, end) && + pull8(ppReadPackedMsg, &pucch_pdu->format_type, end) && + pull8(ppReadPackedMsg, &pucch_pdu->multi_slot_tx_indicator, end) && + pull16(ppReadPackedMsg, &pucch_pdu->prb_start, end) && + pull16(ppReadPackedMsg, &pucch_pdu->prb_size, end) && + pull8(ppReadPackedMsg, &pucch_pdu->start_symbol_index, end) && + pull8(ppReadPackedMsg, &pucch_pdu->nr_of_symbols, end) && + pull8(ppReadPackedMsg, &pucch_pdu->freq_hop_flag, end) && + pull16(ppReadPackedMsg, &pucch_pdu->second_hop_prb, end) && + pull8(ppReadPackedMsg, &pucch_pdu->group_hop_flag, end) && + pull8(ppReadPackedMsg, &pucch_pdu->sequence_hop_flag, end) && + pull16(ppReadPackedMsg, &pucch_pdu->hopping_id, end) && + pull16(ppReadPackedMsg, &pucch_pdu->initial_cyclic_shift, end) && + pull16(ppReadPackedMsg, &pucch_pdu->data_scrambling_id, end) && + pull8(ppReadPackedMsg, &pucch_pdu->time_domain_occ_idx, end) && + pull8(ppReadPackedMsg, &pucch_pdu->pre_dft_occ_idx, end) && + pull8(ppReadPackedMsg, &pucch_pdu->pre_dft_occ_len, end) && + pull8(ppReadPackedMsg, &pucch_pdu->add_dmrs_flag, end) && + pull16(ppReadPackedMsg, &pucch_pdu->dmrs_scrambling_id, end) && + pull8(ppReadPackedMsg, &pucch_pdu->dmrs_cyclic_shift, end) && + pull8(ppReadPackedMsg, &pucch_pdu->sr_flag, end) && + pull8(ppReadPackedMsg, &pucch_pdu->bit_len_harq, end) && + pull16(ppReadPackedMsg, &pucch_pdu->bit_len_csi_part1, end) && + pull16(ppReadPackedMsg, &pucch_pdu->bit_len_csi_part2, end) + // TODO: ignoring beamforming tlv for now + ); +} + + +static uint8_t unpack_ul_tti_request_pusch_pdu(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_pusch_pdu_t *pusch_pdu = (nfapi_nr_pusch_pdu_t *)tlv; + + if (!( + pull16(ppReadPackedMsg, &pusch_pdu->pdu_bit_map, end) && + pull16(ppReadPackedMsg, &pusch_pdu->rnti, end) && + pull32(ppReadPackedMsg, &pusch_pdu->handle, end) && + pull16(ppReadPackedMsg, &pusch_pdu->bwp_size, end) && + pull16(ppReadPackedMsg, &pusch_pdu->bwp_start, end) && + pull8(ppReadPackedMsg, &pusch_pdu->subcarrier_spacing, end) && + pull8(ppReadPackedMsg, &pusch_pdu->cyclic_prefix, end) && + pull16(ppReadPackedMsg, &pusch_pdu->target_code_rate, end) && + pull8(ppReadPackedMsg, &pusch_pdu->qam_mod_order, end) && + pull8(ppReadPackedMsg, &pusch_pdu->mcs_index, end) && + pull8(ppReadPackedMsg, &pusch_pdu->mcs_table, end) && + pull8(ppReadPackedMsg, &pusch_pdu->transform_precoding, end) && + pull16(ppReadPackedMsg, &pusch_pdu->data_scrambling_id, end) && + pull8(ppReadPackedMsg, &pusch_pdu->nrOfLayers, end) && + pull16(ppReadPackedMsg, &pusch_pdu->ul_dmrs_symb_pos, end) && + pull8(ppReadPackedMsg, &pusch_pdu->dmrs_config_type, end) && + pull16(ppReadPackedMsg, &pusch_pdu->ul_dmrs_scrambling_id, end) && + pull8(ppReadPackedMsg, &pusch_pdu->scid, end) && + pull8(ppReadPackedMsg, &pusch_pdu->num_dmrs_cdm_grps_no_data, end) && + pull16(ppReadPackedMsg, &pusch_pdu->dmrs_ports, end) && + pull8(ppReadPackedMsg, &pusch_pdu->resource_alloc, end) && + pull8(ppReadPackedMsg, &pusch_pdu->resource_alloc,end) && + pull16(ppReadPackedMsg, &pusch_pdu->dmrs_ports, end) && + pull16(ppReadPackedMsg, &pusch_pdu->rb_start, end) && + pull16(ppReadPackedMsg, &pusch_pdu->rb_size, end) && + pull8(ppReadPackedMsg, &pusch_pdu->vrb_to_prb_mapping, end) && + pull8(ppReadPackedMsg, &pusch_pdu->frequency_hopping, end) && + pull16(ppReadPackedMsg, &pusch_pdu->tx_direct_current_location, end) && + pull8(ppReadPackedMsg, &pusch_pdu->uplink_frequency_shift_7p5khz, end) && + pull8(ppReadPackedMsg, &pusch_pdu->start_symbol_index, end) && + pull8(ppReadPackedMsg, &pusch_pdu->nr_of_symbols, end) + // TODO: ignoring beamforming tlv for now + )) + return 0; + + //Pack Optional Data only included if indicated in pduBitmap + switch(pusch_pdu->pdu_bit_map) { + case PUSCH_PDU_BITMAP_PUSCH_DATA: { + // pack optional TLVs + return( + pull8(ppReadPackedMsg, &pusch_pdu->pusch_data.rv_index, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_data.harq_process_id, end) && + pull32(ppReadPackedMsg, &pusch_pdu->pusch_data.tb_size, end) && + pull16(ppReadPackedMsg, &pusch_pdu->pusch_data.num_cb, end) && + pullarray8(ppReadPackedMsg, pusch_pdu->pusch_data.cb_present_and_position,1,1,end) + ); + } + break; + + case PUSCH_PDU_BITMAP_PUSCH_UCI: { + return( + pull16(ppReadPackedMsg, &pusch_pdu->pusch_uci.harq_ack_bit_length, end) && + pull16(ppReadPackedMsg, &pusch_pdu->pusch_uci.csi_part1_bit_length, end) && + pull16(ppReadPackedMsg, &pusch_pdu->pusch_uci.csi_part2_bit_length, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_uci.alpha_scaling, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_uci.beta_offset_harq_ack, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_uci.beta_offset_csi1, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_uci.beta_offset_csi2, end) + ); + } + break; + + case PUSCH_PDU_BITMAP_PUSCH_PTRS: { + return( + pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.num_ptrs_ports, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_dmrs_port, end) && + + pull16(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_port_index, end) && + + pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_ports_list->ptrs_re_offset, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_time_density, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ptrs_freq_density, end) && + pull8(ppReadPackedMsg, &pusch_pdu->pusch_ptrs.ul_ptrs_power, end) + ); + } + break; + + case PUSCH_PDU_BITMAP_DFTS_OFDM: { + return( + pull8(ppReadPackedMsg, &pusch_pdu->dfts_ofdm.low_papr_group_number, end) && + pull16(ppReadPackedMsg, &pusch_pdu->dfts_ofdm.low_papr_sequence_number, end) && + pull8(ppReadPackedMsg, &pusch_pdu->dfts_ofdm.ul_ptrs_sample_density, end) && + pull8(ppReadPackedMsg, &pusch_pdu->dfts_ofdm.ul_ptrs_time_density_transform_precoding, end) + ); + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_INFO, "Invalid pdu bitmap %d \n", pusch_pdu->pdu_bit_map ); + } + } + + return 1; +} + + +static uint8_t unpack_ul_tti_request_srs_pdu(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_srs_pdu_t *srs_pdu = (nfapi_nr_srs_pdu_t *)tlv; + return( + pull16(ppReadPackedMsg, &srs_pdu->rnti, end) && + pull32(ppReadPackedMsg, &srs_pdu->handle, end) && + pull16(ppReadPackedMsg, &srs_pdu->bwp_size, end) && + pull16(ppReadPackedMsg, &srs_pdu->bwp_start, end) && + pull8(ppReadPackedMsg, &srs_pdu->subcarrier_spacing, end) && + pull8(ppReadPackedMsg, &srs_pdu->cyclic_prefix, end) && + pull8(ppReadPackedMsg, &srs_pdu->num_ant_ports, end) && + pull8(ppReadPackedMsg, &srs_pdu->num_symbols, end) && + pull8(ppReadPackedMsg, &srs_pdu->num_repetitions, end) && + pull8(ppReadPackedMsg, &srs_pdu->time_start_position, end) && + pull8(ppReadPackedMsg, &srs_pdu->config_index, end) && + pull16(ppReadPackedMsg, &srs_pdu->sequence_id, end) && + pull8(ppReadPackedMsg, &srs_pdu->bandwidth_index, end) && + pull8(ppReadPackedMsg, &srs_pdu->comb_size, end) && + pull8(ppReadPackedMsg, &srs_pdu->comb_offset, end) && + pull8(ppReadPackedMsg, &srs_pdu->cyclic_shift, end) && + pull8(ppReadPackedMsg, &srs_pdu->frequency_position, end) && + pull16(ppReadPackedMsg, &srs_pdu->frequency_shift, end) && + pull8(ppReadPackedMsg, &srs_pdu->frequency_hopping, end) && + pull8(ppReadPackedMsg, &srs_pdu->group_or_sequence_hopping, end) && + pull8(ppReadPackedMsg, &srs_pdu->resource_type, end) && + pull16(ppReadPackedMsg, &srs_pdu->t_srs, end) && + pull16(ppReadPackedMsg, &srs_pdu->t_offset, end) + // TODO: ignoring beamforming tlv for now + ); +} + + +static uint8_t unpack_ul_tti_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { + nfapi_nr_ul_tti_request_number_of_pdus_t *pNfapiMsg = (nfapi_nr_ul_tti_request_number_of_pdus_t *)msg; + + if(!(pull16(ppReadPackedMsg, &pNfapiMsg->pdu_size, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->pdu_type, end) )) + return 0; + + // first natch the pdu type, then call the respective function + switch(pNfapiMsg->pdu_type) { + case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE: { + if(!unpack_ul_tti_request_prach_pdu(&pNfapiMsg->prach_pdu, ppReadPackedMsg, end)) + return 0; + } + break; + + case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE: { + if(!unpack_ul_tti_request_pucch_pdu(&pNfapiMsg->pucch_pdu, ppReadPackedMsg, end)) + return 0; + } + break; + + case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE: { + if(!unpack_ul_tti_request_pusch_pdu(&pNfapiMsg->pusch_pdu, ppReadPackedMsg, end)) + return 0; + } + break; + + case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE: { + if(!unpack_ul_tti_request_srs_pdu(&pNfapiMsg->srs_pdu, ppReadPackedMsg, end)) + return 0; + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid UL_TTI pdu type %d \n", pNfapiMsg->pdu_type ); + } + break; + } + + return 1; +} + + +static uint8_t unpack_ul_tti_groups_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { + nfapi_nr_ul_tti_request_number_of_groups_t *pNfapiMsg = (nfapi_nr_ul_tti_request_number_of_groups_t *)msg; + + if(!pull8(ppReadPackedMsg, &pNfapiMsg->n_ue, end)) + return 0; + + for (int i = 0; i < pNfapiMsg->n_ue; i++) { + if(!pull8(ppReadPackedMsg, &pNfapiMsg->ue_list[i].pdu_idx,end) ) + return 0; + } + + return 1; +} + + +static uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg; + + if (!( + pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->n_pdus, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->n_group, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->rach_present, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->n_ulcch, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->n_ulsch, end) )) + return 0; + + for(int i=0; i< pNfapiMsg->n_pdus; i++) { + if (!unpack_ul_tti_pdu_list_value(ppReadPackedMsg, end, &pNfapiMsg->pdus_list[i])) + return 0; + } + + for(int i=0; i< pNfapiMsg->n_group; i++) { + if (!unpack_ul_tti_groups_list_value(ppReadPackedMsg, end, &pNfapiMsg->groups_list[i])) + return 0; + } + + return 1; +} + + + +static uint8_t unpack_dl_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_dl_config_request_t *pNfapiMsg = (nfapi_dl_config_request_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->dl_config_request_body, &unpack_dl_config_request_body_value}, + }; + return ( pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_ul_config_ulsch_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_pdu_rel8_t *ulsch_pdu_rel8 = (nfapi_ul_config_ulsch_pdu_rel8_t *)tlv; + return (pull32(ppReadPackedMsg, &ulsch_pdu_rel8->handle, end) && + pull16(ppReadPackedMsg, &ulsch_pdu_rel8->size, end) && + pull16(ppReadPackedMsg, &ulsch_pdu_rel8->rnti, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->resource_block_start, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->number_of_resource_blocks, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->modulation_type, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->cyclic_shift_2_for_drms, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->frequency_hopping_enabled_flag, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->frequency_hopping_bits, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->new_data_indication, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->redundancy_version, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->harq_process_number, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->ul_tx_mode, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->current_tx_nb, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel8->n_srs, end )); +} + +static uint8_t unpack_ul_config_ulsch_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_pdu_rel10_t *ulsch_pdu_rel10 = (nfapi_ul_config_ulsch_pdu_rel10_t *)tlv; + return (pull8(ppReadPackedMsg, &ulsch_pdu_rel10->resource_allocation_type, end) && + pull32(ppReadPackedMsg, &ulsch_pdu_rel10->resource_block_coding, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel10->transport_blocks, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel10->transmission_scheme, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel10->number_of_layers, end) & + pull8(ppReadPackedMsg, &ulsch_pdu_rel10->codebook_index, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel10->disable_sequence_hopping_flag, end)); +} +static uint8_t unpack_ul_config_ulsch_pdu_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_pdu_rel11_t *ulsch_pdu_rel11 = (nfapi_ul_config_ulsch_pdu_rel11_t *)tlv; + return ( pull8(ppReadPackedMsg, &ulsch_pdu_rel11->virtual_cell_id_enabled_flag, end) && + pull16(ppReadPackedMsg, &ulsch_pdu_rel11->npusch_identity, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel11->dmrs_config_flag, end) && + pull16(ppReadPackedMsg, &ulsch_pdu_rel11->ndmrs_csh_identity, end)); +} +static uint8_t unpack_ul_config_ulsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_pdu_rel13_t *ulsch_pdu_rel13 = (nfapi_ul_config_ulsch_pdu_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &ulsch_pdu_rel13->ue_type, end) && + pull16(ppReadPackedMsg, &ulsch_pdu_rel13->total_number_of_repetitions, end) && + pull16(ppReadPackedMsg, &ulsch_pdu_rel13->repetition_number, end) && + pull16(ppReadPackedMsg, &ulsch_pdu_rel13->initial_transmission_sf_io, end) && + pull8(ppReadPackedMsg, &ulsch_pdu_rel13->empty_symbols_due_to_re_tunning, end)); +} +static uint8_t unpack_ul_config_cqi_ri_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_ri_information_rel8_t *cqi_ri_info_rel8 = (nfapi_ul_config_cqi_ri_information_rel8_t *)tlv; + return (pull8(ppReadPackedMsg, &cqi_ri_info_rel8->dl_cqi_pmi_size_rank_1, end) && + pull8(ppReadPackedMsg, &cqi_ri_info_rel8->dl_cqi_pmi_size_rank_greater_1, end) && + pull8(ppReadPackedMsg, &cqi_ri_info_rel8->ri_size, end) && + pull8(ppReadPackedMsg, &cqi_ri_info_rel8->delta_offset_cqi, end) && + pull8(ppReadPackedMsg, &cqi_ri_info_rel8->delta_offset_ri, end)); +} + +static uint8_t unpack_ul_config_cqi_ri_info_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_ri_information_rel9_t *cqi_ri_info_rel9 = (nfapi_ul_config_cqi_ri_information_rel9_t *)tlv; + + if(!(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->report_type, end) && + pull8(ppReadPackedMsg, &cqi_ri_info_rel9->delta_offset_cqi, end) && + pull8(ppReadPackedMsg, &cqi_ri_info_rel9->delta_offset_ri, end))) + return 0; + + switch(cqi_ri_info_rel9->report_type) { + case NFAPI_CSI_REPORT_TYPE_PERIODIC: { + if(!(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size, end) && + pull8(ppReadPackedMsg, &cqi_ri_info_rel9->periodic_cqi_pmi_ri_report.control_type, end))) + return 0; + } + break; + + case NFAPI_CSI_REPORT_TYPE_APERIODIC: { + if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc, end) ==0) + return 0; + + uint8_t i; + + for(i = 0; i < cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.number_of_cc; ++i) { + if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].ri_size, end) == 0) + return 0; + + uint8_t j; + + for(j = 0; j < 8; ++j) { + if(pull8(ppReadPackedMsg, &cqi_ri_info_rel9->aperiodic_cqi_pmi_ri_report.cc[i].dl_cqi_pmi_size[j], end) == 0) + return 0; + } + } + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid report type %d \n", cqi_ri_info_rel9->report_type ); + return 0; + } + break; + }; + + return 1; +} + +// NOTE : This function is a little unconventional as we uese the side to +// determine the report type +static uint8_t unpack_ul_config_cqi_ri_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_ri_information_rel13_t *cqi_ri_info_rel13 = (nfapi_ul_config_cqi_ri_information_rel13_t *)tlv; + + if(cqi_ri_info_rel13->tl.length == 0) { + cqi_ri_info_rel13->report_type = NFAPI_CSI_REPORT_TYPE_APERIODIC; + } else { + cqi_ri_info_rel13->report_type = NFAPI_CSI_REPORT_TYPE_PERIODIC; + + if(pull16(ppReadPackedMsg, &cqi_ri_info_rel13->periodic_cqi_pmi_ri_report.dl_cqi_pmi_ri_size_2, end) == 0) + return 0; + } + + return 1; +} +static uint8_t unpack_ul_config_cqi_init_tx_params_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_initial_transmission_parameters_rel8_t *init_tx_params_rel8 = (nfapi_ul_config_initial_transmission_parameters_rel8_t *)tlv; + return (pull8(ppReadPackedMsg, &init_tx_params_rel8->n_srs_initial, end) && + pull8(ppReadPackedMsg, &init_tx_params_rel8->initial_number_of_resource_blocks, end)); +} +static uint8_t unpack_ul_config_ulsch_harq_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_harq_information_rel10_t *harq_info_rel10 = (nfapi_ul_config_ulsch_harq_information_rel10_t *)tlv; + return (pull8(ppReadPackedMsg, &harq_info_rel10->harq_size, end) && + pull8(ppReadPackedMsg, &harq_info_rel10->delta_offset_harq, end) && + pull8(ppReadPackedMsg, &harq_info_rel10->ack_nack_mode, end)); +} + +static uint8_t unpack_ul_config_ulsch_harq_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ulsch_harq_information_rel13_t *harq_info_rel13 = (nfapi_ul_config_ulsch_harq_information_rel13_t *)tlv; + return (pull16(ppReadPackedMsg, &harq_info_rel13->harq_size_2, end) && + pull8(ppReadPackedMsg, &harq_info_rel13->delta_offset_harq_2, end)); +} + +static uint8_t unpack_ul_config_ue_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ue_information_rel8_t *ue_info_rel8 = (nfapi_ul_config_ue_information_rel8_t *)tlv; + return (pull32(ppReadPackedMsg, &ue_info_rel8->handle, end) && + pull16(ppReadPackedMsg, (uint16_t *)&ue_info_rel8->rnti, end)); +} +static uint8_t unpack_ul_config_ue_info_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ue_information_rel11_t *ue_info_rel11 = (nfapi_ul_config_ue_information_rel11_t *)tlv; + return (pull8(ppReadPackedMsg, &ue_info_rel11->virtual_cell_id_enabled_flag, end) && + pull16(ppReadPackedMsg, &ue_info_rel11->npusch_identity, end)); +} +static uint8_t unpack_ul_config_ue_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_ue_information_rel13_t *ue_info_rel13 = (nfapi_ul_config_ue_information_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &ue_info_rel13->ue_type, end) && + pull8(ppReadPackedMsg, &ue_info_rel13->empty_symbols, end) && + pull16(ppReadPackedMsg, &ue_info_rel13->total_number_of_repetitions, end) && + pull16(ppReadPackedMsg, &ue_info_rel13->repetition_number, end)); +} + +static uint8_t unpack_ul_config_cqi_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_information_rel8_t *cqi_info_rel8 = (nfapi_ul_config_cqi_information_rel8_t *)tlv; + return ( pull16(ppReadPackedMsg, &cqi_info_rel8->pucch_index, end) && + pull8(ppReadPackedMsg, &cqi_info_rel8->dl_cqi_pmi_size, end)); +} +static uint8_t unpack_ul_config_cqi_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_information_rel10_t *cqi_info_rel10 = (nfapi_ul_config_cqi_information_rel10_t *)tlv; + return (pull8(ppReadPackedMsg, &cqi_info_rel10->number_of_pucch_resource, end) && + pull16(ppReadPackedMsg, &cqi_info_rel10->pucch_index_p1, end)); +} +static uint8_t unpack_ul_config_cqi_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_cqi_information_rel13_t *cqi_info_rel13 = (nfapi_ul_config_cqi_information_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &cqi_info_rel13->csi_mode, end) && + pull16(ppReadPackedMsg, &cqi_info_rel13->dl_cqi_pmi_size_2, end) && + pull8(ppReadPackedMsg, &cqi_info_rel13->starting_prb, end) && + pull8(ppReadPackedMsg, &cqi_info_rel13->n_prb, end) && + pull8(ppReadPackedMsg, &cqi_info_rel13->cdm_index, end) && + pull8(ppReadPackedMsg, &cqi_info_rel13->n_srs, end)); +} + +static uint8_t unpack_ul_config_sr_info_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_sr_information_rel8_t *sr_info_rel8 = (nfapi_ul_config_sr_information_rel8_t *)tlv; + return ( pull16(ppReadPackedMsg, &sr_info_rel8->pucch_index, end)); +} + +static uint8_t unpack_ul_config_sr_info_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_sr_information_rel10_t *sr_info_rel10 = (nfapi_ul_config_sr_information_rel10_t *)tlv; + return (pull8(ppReadPackedMsg, &sr_info_rel10->number_of_pucch_resources, end) && + pull16(ppReadPackedMsg, &sr_info_rel10->pucch_index_p1, end)); +} + +static uint8_t unpack_ul_config_harq_info_rel10_tdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel10_tdd_t *harq_info_tdd_rel10 = (nfapi_ul_config_harq_information_rel10_tdd_t *)tlv; + return (pull8(ppReadPackedMsg, &harq_info_tdd_rel10->harq_size, end) && + pull8(ppReadPackedMsg, &harq_info_tdd_rel10->ack_nack_mode, end) && + pull8(ppReadPackedMsg, &harq_info_tdd_rel10->number_of_pucch_resources, end) && + pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_0, end) && + pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_1, end) && + pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_2, end) && + pull16(ppReadPackedMsg, &harq_info_tdd_rel10->n_pucch_1_3, end)); +} + +static uint8_t unpack_ul_config_harq_info_rel8_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel8_fdd_t *harq_info_fdd_rel8 = (nfapi_ul_config_harq_information_rel8_fdd_t *)tlv; + return (pull16(ppReadPackedMsg, &harq_info_fdd_rel8->n_pucch_1_0, end) && + pull8(ppReadPackedMsg, &harq_info_fdd_rel8->harq_size, end)); +} + +static uint8_t unpack_ul_config_harq_info_rel9_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel9_fdd_t *harq_info_fdd_rel9 = (nfapi_ul_config_harq_information_rel9_fdd_t *)tlv; + return (pull8(ppReadPackedMsg, &harq_info_fdd_rel9->harq_size, end) && + pull8(ppReadPackedMsg, &harq_info_fdd_rel9->ack_nack_mode, end) && + pull8(ppReadPackedMsg, &harq_info_fdd_rel9->number_of_pucch_resources, end) && + pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_0, end) && + pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_1, end) && + pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_2, end) && + pull16(ppReadPackedMsg, &harq_info_fdd_rel9->n_pucch_1_3, end)); +} + +static uint8_t unpack_ul_config_harq_info_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel11_t *harq_info_rel11 = (nfapi_ul_config_harq_information_rel11_t *)tlv; + return (pull8(ppReadPackedMsg, &harq_info_rel11->num_ant_ports, end) && + pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_0, end) && + pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_1, end) && + pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_2, end) && + pull16(ppReadPackedMsg, &harq_info_rel11->n_pucch_2_3, end)); +} + +static uint8_t unpack_ul_config_harq_info_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_harq_information_rel13_t *harq_info_rel13 = (nfapi_ul_config_harq_information_rel13_t *)tlv; + return (pull16(ppReadPackedMsg, &harq_info_rel13->harq_size_2, end) && + pull8(ppReadPackedMsg, &harq_info_rel13->starting_prb, end) && + pull8(ppReadPackedMsg, &harq_info_rel13->n_prb, end) && + pull8(ppReadPackedMsg, &harq_info_rel13->cdm_index, end) && + pull8(ppReadPackedMsg, &harq_info_rel13->n_srs, end)); +} + + +static uint8_t unpack_ul_config_srs_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_srs_pdu_rel8_t *srs_pdu_rel8 = (nfapi_ul_config_srs_pdu_rel8_t *)tlv; + return (pull32(ppReadPackedMsg, &srs_pdu_rel8->handle, end) && + pull16(ppReadPackedMsg, &srs_pdu_rel8->size, end) && + pull16(ppReadPackedMsg, &srs_pdu_rel8->rnti, end) && + pull8(ppReadPackedMsg, &srs_pdu_rel8->srs_bandwidth, end) && + pull8(ppReadPackedMsg, &srs_pdu_rel8->frequency_domain_position, end) && + pull8(ppReadPackedMsg, &srs_pdu_rel8->srs_hopping_bandwidth, end) && + pull8(ppReadPackedMsg, &srs_pdu_rel8->transmission_comb, end) && + pull16(ppReadPackedMsg, &srs_pdu_rel8->i_srs, end) && + pull8(ppReadPackedMsg, &srs_pdu_rel8->sounding_reference_cyclic_shift, end)); +} + +static uint8_t unpack_ul_config_srs_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_srs_pdu_rel10_t *srs_pdu_rel10 = (nfapi_ul_config_srs_pdu_rel10_t *)tlv; + return pull8(ppReadPackedMsg, &srs_pdu_rel10->antenna_port, end); +} + +static uint8_t unpack_ul_config_srs_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_srs_pdu_rel13_t *srs_pdu_rel13 = (nfapi_ul_config_srs_pdu_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &srs_pdu_rel13->number_of_combs, end)); +} + +static uint8_t unpack_ul_nb_harq_info_rel13_fdd_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_nb_harq_information_rel13_fdd_t *nb_harq_info_fdd_rel13 = (nfapi_ul_config_nb_harq_information_rel13_fdd_t *)tlv; + return (pull8(ppReadPackedMsg, &nb_harq_info_fdd_rel13->harq_ack_resource, end)); +} + +static uint8_t unpack_ul_config_nulsch_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_nulsch_pdu_rel13_t *nulsch_pdu_rel13 = (nfapi_ul_config_nulsch_pdu_rel13_t *)tlv; + + if(!(pull8(ppReadPackedMsg, &nulsch_pdu_rel13->nulsch_format, end) && + pull32(ppReadPackedMsg, &nulsch_pdu_rel13->handle, end) && + pull16(ppReadPackedMsg, &nulsch_pdu_rel13->size, end) && + pull16(ppReadPackedMsg, &nulsch_pdu_rel13->rnti, end) && + pull8(ppReadPackedMsg, &nulsch_pdu_rel13->subcarrier_indication, end) && + pull8(ppReadPackedMsg, &nulsch_pdu_rel13->resource_assignment, end) && + pull8(ppReadPackedMsg, &nulsch_pdu_rel13->mcs, end) && + pull8(ppReadPackedMsg, &nulsch_pdu_rel13->redudancy_version, end) && + pull8(ppReadPackedMsg, &nulsch_pdu_rel13->repetition_number, end) && + pull8(ppReadPackedMsg, &nulsch_pdu_rel13->new_data_indication, end) && + pull8(ppReadPackedMsg, &nulsch_pdu_rel13->n_srs, end) && + pull16(ppReadPackedMsg, &nulsch_pdu_rel13->scrambling_sequence_initialization_cinit, end) && + pull16(ppReadPackedMsg, &nulsch_pdu_rel13->sf_idx, end))) + return 0; + + unpack_tlv_t unpack_fns[] = { + { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel8, &unpack_ul_config_ue_info_rel8_value}, + { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel11, &unpack_ul_config_ue_info_rel11_value}, + { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &nulsch_pdu_rel13->ue_information.ue_information_rel13, &unpack_ul_config_ue_info_rel13_value}, + { NFAPI_UL_CONFIG_REQUEST_NB_HARQ_INFORMATION_REL13_FDD_TAG, &nulsch_pdu_rel13->nb_harq_information.nb_harq_information_rel13_fdd, &unpack_ul_nb_harq_info_rel13_fdd_value}, + }; + return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, 0, 0); +} + +static uint8_t unpack_ul_config_nrach_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_config_nrach_pdu_rel13_t *nrach_pdu_rel13 = (nfapi_ul_config_nrach_pdu_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_0, end) && + pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_1, end) && + pull8(ppReadPackedMsg, &nrach_pdu_rel13->nprach_config_2, end)); +} + + +static uint8_t unpack_ul_config_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { +#define UL_CONFIG_ULSCH_PDU_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL8_TAG, &_pdu.ulsch_pdu_rel8, &unpack_ul_config_ulsch_pdu_rel8_value}, \ + { NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL10_TAG, &_pdu.ulsch_pdu_rel10, &unpack_ul_config_ulsch_pdu_rel10_value}, \ + { NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL11_TAG, &_pdu.ulsch_pdu_rel11, &unpack_ul_config_ulsch_pdu_rel11_value}, \ + { NFAPI_UL_CONFIG_REQUEST_ULSCH_PDU_REL13_TAG, &_pdu.ulsch_pdu_rel13, &unpack_ul_config_ulsch_pdu_rel13_value}, +#define UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL8_TAG, &_pdu.cqi_ri_information_rel8, &unpack_ul_config_cqi_ri_info_rel8_value}, \ + { NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL9_TAG, &_pdu.cqi_ri_information_rel9, &unpack_ul_config_cqi_ri_info_rel9_value}, \ + { NFAPI_UL_CONFIG_REQUEST_CQI_RI_INFORMATION_REL13_TAG, &_pdu.cqi_ri_information_rel13, &unpack_ul_config_cqi_ri_info_rel13_value}, +#define UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL10_TAG, &_pdu.harq_information_rel10, &unpack_ul_config_ulsch_harq_info_rel10_value},\ + { NFAPI_UL_CONFIG_REQUEST_ULSCH_HARQ_INFORMATION_REL13_TAG, &_pdu.harq_information_rel13, &unpack_ul_config_ulsch_harq_info_rel13_value}, +#define UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_INITIAL_TRANSMISSION_PARAMETERS_REL8_TAG, &_pdu.initial_transmission_parameters_rel8, &unpack_ul_config_cqi_init_tx_params_rel8_value}, +#define UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL8_TAG, &_pdu.ue_information_rel8, &unpack_ul_config_ue_info_rel8_value}, \ + { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL11_TAG, &_pdu.ue_information_rel11, &unpack_ul_config_ue_info_rel11_value}, \ + { NFAPI_UL_CONFIG_REQUEST_UE_INFORMATION_REL13_TAG, &_pdu.ue_information_rel13, &unpack_ul_config_ue_info_rel13_value}, +#define UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL8_TAG, &_pdu.cqi_information_rel8, &unpack_ul_config_cqi_info_rel8_value}, \ + { NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL10_TAG, &_pdu.cqi_information_rel10, &unpack_ul_config_cqi_info_rel10_value}, \ + { NFAPI_UL_CONFIG_REQUEST_CQI_INFORMATION_REL13_TAG, &_pdu.cqi_information_rel13, &unpack_ul_config_cqi_info_rel13_value}, +#define UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL8_TAG, &_pdu.sr_information_rel8, &unpack_ul_config_sr_info_rel8_value}, \ + { NFAPI_UL_CONFIG_REQUEST_SR_INFORMATION_REL10_TAG, &_pdu.sr_information_rel10, &unpack_ul_config_sr_info_rel10_value}, +#define UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL10_TDD_TAG, &_pdu.harq_information_rel10_tdd, &unpack_ul_config_harq_info_rel10_tdd_value}, \ + { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL8_FDD_TAG, &_pdu.harq_information_rel8_fdd, &unpack_ul_config_harq_info_rel8_fdd_value}, \ + { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL9_FDD_TAG, &_pdu.harq_information_rel9_fdd, &unpack_ul_config_harq_info_rel9_fdd_value}, \ + { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL11_TAG, &_pdu.harq_information_rel11, &unpack_ul_config_harq_info_rel11_value}, \ + { NFAPI_UL_CONFIG_REQUEST_HARQ_INFORMATION_REL13_TAG, &_pdu.harq_information_rel13, &unpack_ul_config_harq_info_rel13_value}, +#define UL_CONFIG_SRS_PDU_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL8_TAG, &_pdu.srs_pdu_rel8, &unpack_ul_config_srs_pdu_rel8_value}, \ + { NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL10_TAG, &_pdu.srs_pdu_rel10, &unpack_ul_config_srs_pdu_rel10_value}, \ + { NFAPI_UL_CONFIG_REQUEST_SRS_PDU_REL13_TAG, &_pdu.srs_pdu_rel13, &unpack_ul_config_srs_pdu_rel13_value}, +#define UL_CONFIG_NULSCH_PDU_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG, &_pdu.nulsch_pdu_rel13, &unpack_ul_config_nulsch_pdu_rel13_value}, +#define UL_CONFIG_NRACH_PDU_UNPACK_FNS(_pdu) \ + { NFAPI_UL_CONFIG_REQUEST_NRACH_PDU_REL13_TAG, &_pdu.nrach_pdu_rel13, &unpack_ul_config_nrach_pdu_rel13_value}, + nfapi_ul_config_request_body_t *value = (nfapi_ul_config_request_body_t *)tlv; + + if(!(pull8(ppReadPackedMsg, &value->number_of_pdus, end) && + pull8(ppReadPackedMsg, &value->rach_prach_frequency_resources, end) && + pull8(ppReadPackedMsg, &value->srs_present, end))) + return 0; + + if(value->number_of_pdus > NFAPI_UL_CONFIG_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of ul config pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_UL_CONFIG_MAX_PDU); + return 0; + } + + if(value->number_of_pdus > 0) { + value->ul_config_pdu_list = (nfapi_ul_config_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_ul_config_request_pdu_t) * value->number_of_pdus, config); + + if(value->ul_config_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate ul config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus); + return 0; + } + } else { + value->ul_config_pdu_list = 0; + } + + uint16_t i; + uint16_t total_number_of_pdus = value->number_of_pdus; + + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_ul_config_request_pdu_t *pdu = &(value->ul_config_pdu_list[i]); + + if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && + pull8(ppReadPackedMsg, &pdu->pdu_size, end))) + return 0; + + uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; + + if(packedPduEnd > end) { + // pdu end is past buffer end + return 0; + } + + switch(pdu->pdu_type) { + case NFAPI_UL_CONFIG_ULSCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_pdu) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.ulsch_pdu) + UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.cqi_ri_information) + UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_cqi_ri_pdu.initial_transmission_parameters) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_harq_pdu.ulsch_pdu) + UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(pdu->ulsch_harq_pdu.harq_information) + UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_harq_pdu.initial_transmission_parameters) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_ULSCH_CQI_HARQ_RI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu) + UL_CONFIG_CQI_RI_INFO_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.cqi_ri_information) + UL_CONFIG_ULSCH_HARQ_INFO_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.harq_information) + UL_CONFIG_INIT_TX_PARAMS_UNPACK_FNS(pdu->ulsch_cqi_harq_ri_pdu.initial_transmission_parameters) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_pdu.ue_information) + UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_pdu.cqi_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_UCI_SR_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_sr_pdu.ue_information) + UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_sr_pdu.sr_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_harq_pdu.ue_information) + UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_harq_pdu.harq_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.ue_information) + UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.sr_information) + UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_sr_harq_pdu.harq_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.ue_information) + UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.cqi_information) + UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_cqi_harq_pdu.harq_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_UCI_CQI_SR_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.ue_information) + UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.cqi_information) + UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_cqi_sr_pdu.sr_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_UCI_CQI_SR_HARQ_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.ue_information) + UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.cqi_information) + UL_CONFIG_UCI_SR_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.sr_information) + UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->uci_cqi_sr_harq_pdu.harq_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_SRS_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_SRS_PDU_UNPACK_FNS(pdu->srs_pdu) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_HARQ_BUFFER_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_UCI_UE_INFO_UNPACK_FNS(pdu->harq_buffer_pdu.ue_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_ULSCH_UCI_CSI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_uci_csi_pdu.ulsch_pdu) + UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->ulsch_uci_csi_pdu.csi_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_ULSCH_UCI_HARQ_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_uci_harq_pdu.ulsch_pdu) + UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->ulsch_uci_harq_pdu.harq_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_ULSCH_CSI_UCI_HARQ_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_ULSCH_PDU_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.ulsch_pdu) + UL_CONFIG_UCI_CQI_INFO_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.csi_information) + UL_CONFIG_UCI_HARQ_INFO_UNPACK_FNS(pdu->ulsch_csi_uci_harq_pdu.harq_information) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_NULSCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_NULSCH_PDU_UNPACK_FNS(pdu->nulsch_pdu) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_UL_CONFIG_NRACH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + UL_CONFIG_NRACH_PDU_UNPACK_FNS(pdu->nrach_pdu) + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + } + } + + return 1; +} + + +static uint8_t unpack_ul_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_ul_config_request_t *pNfapiMsg = (nfapi_ul_config_request_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_UL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->ul_config_request_body, &unpack_ul_config_request_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_hi_dci0_hi_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_hi_dci0_hi_pdu_rel8_t *hi_pdu_rel8 = (nfapi_hi_dci0_hi_pdu_rel8_t *)tlv; + return( pull8(ppReadPackedMsg, &hi_pdu_rel8->resource_block_start, end) && + pull8(ppReadPackedMsg, &hi_pdu_rel8->cyclic_shift_2_for_drms, end) && + pull8(ppReadPackedMsg, &hi_pdu_rel8->hi_value, end) && + pull8(ppReadPackedMsg, &hi_pdu_rel8->i_phich, end) && + pull16(ppReadPackedMsg, &hi_pdu_rel8->transmission_power, end)); +} + +static uint8_t unpack_hi_dci0_hi_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_hi_dci0_hi_pdu_rel10_t *hi_pdu_rel10 = (nfapi_hi_dci0_hi_pdu_rel10_t *)tlv; + return (pull8(ppReadPackedMsg, &hi_pdu_rel10->flag_tb2, end) && + pull8(ppReadPackedMsg, &hi_pdu_rel10->hi_value_2, end)); +} + +static uint8_t unpack_hi_dci0_dci_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_hi_dci0_dci_pdu_rel8_t *dci_pdu_rel8 = (nfapi_hi_dci0_dci_pdu_rel8_t *)tlv; + return (pull8(ppReadPackedMsg, &dci_pdu_rel8->dci_format, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->cce_index, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->aggregation_level, end) && + pull16(ppReadPackedMsg, &dci_pdu_rel8->rnti, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->resource_block_start, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->number_of_resource_block, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->mcs_1, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->cyclic_shift_2_for_drms, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->frequency_hopping_enabled_flag, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->frequency_hopping_bits, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->new_data_indication_1, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->ue_tx_antenna_seleciton, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->tpc, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->cqi_csi_request, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->ul_index, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel8->dl_assignment_index, end) && + pull32(ppReadPackedMsg, &dci_pdu_rel8->tpc_bitmap, end) && + pull16(ppReadPackedMsg, &dci_pdu_rel8->transmission_power, end)); +} + +static uint8_t unpack_hi_dci0_dci_pdu_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_hi_dci0_dci_pdu_rel10_t *dci_pdu_rel10 = (nfapi_hi_dci0_dci_pdu_rel10_t *)tlv; + return (pull8(ppReadPackedMsg, &dci_pdu_rel10->cross_carrier_scheduling_flag, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->carrier_indicator, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->size_of_cqi_csi_feild, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->srs_flag, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->srs_request, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->resource_allocation_flag, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->resource_allocation_type, end) && + pull32(ppReadPackedMsg, &dci_pdu_rel10->resource_block_coding, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->mcs_2, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->new_data_indication_2, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->number_of_antenna_ports, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->tpmi, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->total_dci_length_including_padding, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel10->n_ul_rb, end)); +} + +static uint8_t unpack_hi_dci0_dci_pdu_rel12_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_hi_dci0_dci_pdu_rel12_t *dci_pdu_rel12 = (nfapi_hi_dci0_dci_pdu_rel12_t *)tlv; + return ( pull8(ppReadPackedMsg, &dci_pdu_rel12->pscch_resource, end) && + pull8(ppReadPackedMsg, &dci_pdu_rel12->time_resource_pattern, end)); +} + +static uint8_t unpack_hi_dci0_mpdcch_dci_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t *value = (nfapi_hi_dci0_mpdcch_dci_pdu_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &value->mpdcch_narrowband, end) && + pull8(ppReadPackedMsg, &value->number_of_prb_pairs, end) && + pull8(ppReadPackedMsg, &value->resource_block_assignment, end) && + pull8(ppReadPackedMsg, &value->mpdcch_transmission_type, end) && + pull8(ppReadPackedMsg, &value->start_symbol, end) && + pull8(ppReadPackedMsg, &value->ecce_index, end) && + pull8(ppReadPackedMsg, &value->aggreagation_level, end) && + pull8(ppReadPackedMsg, &value->rnti_type, end) && + pull16(ppReadPackedMsg, &value->rnti, end) && + pull8(ppReadPackedMsg, &value->ce_mode, end) && + pull16(ppReadPackedMsg, &value->drms_scrambling_init, end) && + pull16(ppReadPackedMsg, &value->initial_transmission_sf_io, end) && + pull16(ppReadPackedMsg, &value->transmission_power, end) && + pull8(ppReadPackedMsg, &value->dci_format, end) && + pull8(ppReadPackedMsg, &value->resource_block_start, end) && + pull8(ppReadPackedMsg, &value->number_of_resource_blocks, end) && + pull8(ppReadPackedMsg, &value->mcs, end) && + pull8(ppReadPackedMsg, &value->pusch_repetition_levels, end) && + pull8(ppReadPackedMsg, &value->frequency_hopping_flag, end) && + pull8(ppReadPackedMsg, &value->new_data_indication, end) && + pull8(ppReadPackedMsg, &value->harq_process, end) && + pull8(ppReadPackedMsg, &value->redudency_version, end) && + pull8(ppReadPackedMsg, &value->tpc, end) && + pull8(ppReadPackedMsg, &value->csi_request, end) && + pull8(ppReadPackedMsg, &value->ul_inex, end) && + pull8(ppReadPackedMsg, &value->dai_presence_flag, end) && + pull8(ppReadPackedMsg, &value->dl_assignment_index, end) && + pull8(ppReadPackedMsg, &value->srs_request, end) && + pull8(ppReadPackedMsg, &value->dci_subframe_repetition_number, end) && + pull32(ppReadPackedMsg, &value->tcp_bitmap, end) && + pull8(ppReadPackedMsg, &value->total_dci_length_include_padding, end) && + pull8(ppReadPackedMsg, &value->number_of_tx_antenna_ports, end) && + pullarray16(ppReadPackedMsg, value->precoding_value, NFAPI_MAX_TX_PHYSICAL_ANTENNA_PORTS, value->number_of_tx_antenna_ports, end)); +} + +static uint8_t unpack_hi_dci0_npdcch_dci_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_hi_dci0_npdcch_dci_pdu_rel13_t *value = (nfapi_hi_dci0_npdcch_dci_pdu_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &value->ncce_index, end) && + pull8(ppReadPackedMsg, &value->aggregation_level, end) && + pull8(ppReadPackedMsg, &value->start_symbol, end) && + pull16(ppReadPackedMsg, &value->rnti, end) && + pull8(ppReadPackedMsg, &value->scrambling_reinitialization_batch_index, end) && + pull8(ppReadPackedMsg, &value->nrs_antenna_ports_assumed_by_the_ue, end) && + pull8(ppReadPackedMsg, &value->subcarrier_indication, end) && + pull8(ppReadPackedMsg, &value->resource_assignment, end) && + pull8(ppReadPackedMsg, &value->scheduling_delay, end) && + pull8(ppReadPackedMsg, &value->mcs, end) && + pull8(ppReadPackedMsg, &value->redudancy_version, end) && + pull8(ppReadPackedMsg, &value->repetition_number, end) && + pull8(ppReadPackedMsg, &value->new_data_indicator, end) && + pull8(ppReadPackedMsg, &value->dci_subframe_repetition_number, end)); +} + +static uint8_t unpack_hi_dci0_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_hi_dci0_request_body_t *value = (nfapi_hi_dci0_request_body_t *)tlv; + + if(!(pull16(ppReadPackedMsg, &value->sfnsf, end) && + pull8(ppReadPackedMsg, &value->number_of_dci, end) && + pull8(ppReadPackedMsg, &value->number_of_hi, end))) + return 0; + + uint8_t totalNumPdus = value->number_of_hi + value->number_of_dci; + + if(totalNumPdus > NFAPI_HI_DCI0_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of dci0 pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, totalNumPdus, NFAPI_HI_DCI0_MAX_PDU); + return 0; + } + + if(totalNumPdus > 0) { + value->hi_dci0_pdu_list = (nfapi_hi_dci0_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_hi_dci0_request_pdu_t) * totalNumPdus, config); + + if(value->hi_dci0_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate hi dci0 pdu list (count:%d)\n", __FUNCTION__, totalNumPdus); + return 0; + } + } else { + value->hi_dci0_pdu_list = 0; + } + + uint8_t i; + + for(i = 0; i < totalNumPdus; ++i) { + nfapi_hi_dci0_request_pdu_t *pdu = &(value->hi_dci0_pdu_list[i]); + + if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && + pull8(ppReadPackedMsg, &pdu->pdu_size, end))) + return 0; + + uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; + + if(packedPduEnd > end) { + // pdu end if past buffer end + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pdu size to big %d %d\n", __FUNCTION__, packedPduEnd, end); + return 0; + } + + switch(pdu->pdu_type) { + case NFAPI_HI_DCI0_HI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_HI_DCI0_REQUEST_HI_PDU_REL8_TAG, &pdu->hi_pdu.hi_pdu_rel8, &unpack_hi_dci0_hi_pdu_rel8_value}, + { NFAPI_HI_DCI0_REQUEST_HI_PDU_REL10_TAG, &pdu->hi_pdu.hi_pdu_rel10, &unpack_hi_dci0_hi_pdu_rel10_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_HI_DCI0_DCI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL8_TAG, &pdu->dci_pdu.dci_pdu_rel8, &unpack_hi_dci0_dci_pdu_rel8_value}, + { NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL10_TAG, &pdu->dci_pdu.dci_pdu_rel10, &unpack_hi_dci0_dci_pdu_rel10_value}, + { NFAPI_HI_DCI0_REQUEST_DCI_PDU_REL12_TAG, &pdu->dci_pdu.dci_pdu_rel12, &unpack_hi_dci0_dci_pdu_rel12_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_HI_DCI0_EPDCCH_DCI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL8_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel8, &unpack_hi_dci0_dci_pdu_rel8_value}, + { NFAPI_HI_DCI0_REQUEST_EPDCCH_DCI_PDU_REL10_TAG, &pdu->epdcch_dci_pdu.epdcch_dci_pdu_rel10, &unpack_hi_dci0_dci_pdu_rel10_value}, + { NFAPI_HI_DCI0_REQUEST_EPDCCH_PARAMETERS_REL11_TAG, &pdu->epdcch_dci_pdu.epdcch_parameters_rel11, &unpack_dl_config_epdcch_params_rel11_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_HI_DCI0_REQUEST_MPDCCH_DCI_PDU_REL13_TAG, &pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13, &unpack_hi_dci0_mpdcch_dci_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_HI_DCI0_REQUEST_NPDCCH_DCI_PDU_REL13_TAG, &pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13, &unpack_hi_dci0_npdcch_dci_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid pdu type %d \n", pdu->pdu_type ); + } + break; + }; + } + + return 1; +} +//unpack_ul_dci_pdu_list_value + +static uint8_t unpack_ul_dci_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) +{ + nfapi_nr_ul_dci_request_pdus_t* value = (nfapi_nr_ul_dci_request_pdus_t*)msg; + for(uint8_t i = 0; i < MAX_DCI_CORESET; ++i) + { + if(!(pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].RNTI, end) && + pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].ScramblingId, end) && + + pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].ScramblingRNTI, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].CceIndex, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].AggregationLevel, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].beta_PDCCH_1_0, end) && + + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].powerControlOffsetSS, end) && + pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, end) && + + pullarray8(ppReadPackedMsg, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].Payload, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[i].PayloadSizeBits, end))) + + return 0; + } + + return (pull16(ppReadPackedMsg, &value->PDUType, end) && + pull16(ppReadPackedMsg, &value->PDUSize, end) && + pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.BWPSize, end) && + pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.BWPStart, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.SubcarrierSpacing, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CyclicPrefix, end) && + + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.StartSymbolIndex, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.DurationSymbols, end) && + pullarray8(ppReadPackedMsg, value->pdcch_pdu.pdcch_pdu_rel15.FreqDomainResource, 6, 6, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CceRegMappingType, end) && + + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.RegBundleSize, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.InterleaverSize, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CoreSetType, end) && + pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.ShiftIndex, end) && + pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.precoderGranularity, end) && + pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.numDlDci, end)); + +} + +static uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t *)msg; + + if (!(pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && + pull8(ppReadPackedMsg, &pNfapiMsg->numPdus, end) + )) + return 0; + + for(int i=0; i< pNfapiMsg->numPdus; i++) { + if (!unpack_ul_dci_pdu_list_value(ppReadPackedMsg, end, &pNfapiMsg->ul_dci_pdu_list[i])) + return 0; + } + + return 1; +} + +static uint8_t unpack_hi_dci0_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_hi_dci0_request_t *pNfapiMsg = (nfapi_hi_dci0_request_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_HI_DCI0_REQUEST_BODY_TAG, &pNfapiMsg->hi_dci0_request_body, &unpack_hi_dci0_request_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} +static uint8_t unpack_tx_data_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg) { + nfapi_nr_pdu_t *pNfapiMsg = (nfapi_nr_pdu_t *)msg; + + if(!(pull32(ppReadPackedMsg, &pNfapiMsg->num_TLV, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->PDU_index, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->PDU_length, end) + )) + return 0; + + uint16_t i = 0; + uint16_t total_number_of_tlvs = pNfapiMsg->num_TLV; + + for(; i < total_number_of_tlvs; ++i) { + if (!(pull16(ppReadPackedMsg, &pNfapiMsg->TLVs[i].length, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->TLVs[i].tag, end))) + return 0; + + switch(pNfapiMsg->TLVs[i].tag) { + case 0: { + if(!pullarray32(ppReadPackedMsg, pNfapiMsg->TLVs[i].value.direct, 16384, pNfapiMsg->TLVs[i].length, end)) + return 0; + + break; + } + + case 1: { + if(!pullarray32(ppReadPackedMsg, pNfapiMsg->TLVs[i].value.ptr, pNfapiMsg->TLVs[i].length, pNfapiMsg->TLVs[i].length, end)) + return 0; + + break; + } + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : Invalid tag value %d \n", pNfapiMsg->TLVs[i].tag ); + break; + } + } + } + + return 1; +} + +static uint8_t unpack_tx_data_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t *)msg; + + if(!(pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->Number_of_PDUs, end))) + return 0; + + for(int i=0; i< pNfapiMsg->Number_of_PDUs; i++) { + if (!unpack_tx_data_pdu_list_value(ppReadPackedMsg, end, &pNfapiMsg->pdu_list[i])) + return 0; + } + + return 1; +} + +static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + uint8_t proceed = 1; + nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t *)msg; + + if(pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) == 0) + return 0; + + while (((uint8_t *)(*ppReadPackedMsg) < end) && proceed) { + nfapi_tl_t generic_tl; + + if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) + return 0; + + switch(generic_tl.tag) { + case NFAPI_TX_REQUEST_BODY_TAG: { + pNfapiMsg->tx_request_body.tl = generic_tl; + + if( pull16(ppReadPackedMsg, &pNfapiMsg->tx_request_body.number_of_pdus, end) == 0) + return 0; + + if(pNfapiMsg->tx_request_body.number_of_pdus > NFAPI_TX_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of tx pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, pNfapiMsg->tx_request_body.number_of_pdus, NFAPI_TX_MAX_PDU); + return 0; + } + + if(pNfapiMsg->tx_request_body.number_of_pdus > 0) { + pNfapiMsg->tx_request_body.tx_pdu_list = (nfapi_tx_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_tx_request_pdu_t) * pNfapiMsg->tx_request_body.number_of_pdus, config); + + if(pNfapiMsg->tx_request_body.tx_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate tx pdu list (count:%d)\n", __FUNCTION__, pNfapiMsg->tx_request_body.number_of_pdus); + return 0; + } + } else { + pNfapiMsg->tx_request_body.tx_pdu_list = 0; + } + + uint16_t i; + uint16_t totalNumPdus = pNfapiMsg->tx_request_body.number_of_pdus; + + for(i = 0; i < totalNumPdus; ++i) { + nfapi_tx_request_pdu_t *pdu = &(pNfapiMsg->tx_request_body.tx_pdu_list[i]); + + if (pdu) { + uint16_t length = 0; + uint16_t index = 0; + + if(!(pull16(ppReadPackedMsg, &length, end) && + pull16(ppReadPackedMsg, &index, end))) + return 0; + + pdu->pdu_length = length; + pdu->pdu_index = index; + // TODO : May need to rethink this bit + pdu->num_segments = 1; + pdu->segments[0].segment_length = pdu->pdu_length; + pdu->segments[0].segment_data = nfapi_p7_allocate(pdu->pdu_length, config); + + if(pdu->segments[0].segment_data) { + if(!pullarray8(ppReadPackedMsg, pdu->segments[0].segment_data, pdu->segments[0].segment_length, pdu->segments[0].segment_length, end)) + return 0; + + if (pdu->segments[0].segment_length == 3) { + NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, + pdu->segments[0].segment_data[0], + pdu->segments[0].segment_data[1], + pdu->segments[0].segment_data[2] + ); + } + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_tx_request: Failed to allocate pdu (len:%d) %d/%d %d\n", pdu->pdu_length, totalNumPdus, i, pdu->pdu_index); + } + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "NULL pdu\n"); + } + } + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_tx_request FIXME : Invalid pdu type %d \n", generic_tl.tag ); + } + break; + }; + } + + return 1; +} + +//UNPACK NR UPLINK INDICATION FUNCTIONS + +//SLOT INDICATION + +static uint8_t unpack_nr_slot_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_slot_indication_scf_t *msg, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_slot_indication_scf_t *pNfapiMsg = (nfapi_nr_slot_indication_scf_t*)msg; + + if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && + pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) + )) + return 0; + +return 1; +} + +//RX DATA INDICATION + +static uint8_t unpack_nr_rx_data_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) +{ + nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv; + + if(!(pull32(ppReadPackedMsg, &value->handle, end) && + pull16(ppReadPackedMsg, &value->rnti, end) && + pull8(ppReadPackedMsg, &value->harq_id, end) && + pull16(ppReadPackedMsg, &value->pdu_length, end) && + pull8(ppReadPackedMsg, &value->ul_cqi, end) && + pull16(ppReadPackedMsg, &value->timing_advance, end) && + pull16(ppReadPackedMsg, &value->rssi, end) + )) + return 0; + return 1; +} + + +static uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_rx_data_indication_t *msg, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_rx_data_indication_t *pNfapiMsg = (nfapi_nr_rx_data_indication_t*)msg; + + if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && + pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) && + pull16(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end) + )) + return 0; + + for(int i=0; inumber_of_pdus;i++) + { + if(!unpack_nr_rx_data_indication_body(pNfapiMsg->pdu_list, ppReadPackedMsg, end)) + return 0; + } + +return 1; +} + +//NR CRC INDICATION + +static uint8_t unpack_nr_crc_indication_body(nfapi_nr_crc_t* value, uint8_t **ppReadPackedMsg, uint8_t *end) +{ + if(!(pull32(ppReadPackedMsg, &value->handle, end) && + pull16(ppReadPackedMsg, &value->rnti, end) && + pull8(ppReadPackedMsg, &value->harq_id, end) && + pull8(ppReadPackedMsg, &value->tb_crc_status, end) && + pull16(ppReadPackedMsg, &value->num_cb, end) && + //pullarray8(ppReadPackedMsg, value->cb_crc_status, (int)(value->num_cb / 8) + 1, (int)(value->num_cb / 8) + 1, end) && //length is ceil(NumCb/8) + pull8(ppReadPackedMsg, &value->ul_cqi, end) && + pull16(ppReadPackedMsg, &value->timing_advance, end) && + pull16(ppReadPackedMsg, &value->rssi, end) + )) + return 0; + + //memcpy((nfapi_nr_crc_t *)tlv,value,sizeof(nfapi_nr_crc_t)); + + return 1; +} + +static uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_crc_indication_t *msg, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t *) msg; + // pNfapiMsg = (nfapi_nr_crc_indication_t *) malloc(sizeof(nfapi_nr_crc_indication_t)); + // pNfapiMsg->crc_list = (nfapi_nr_crc_t *) malloc(sizeof(nfapi_nr_crc_t)); + + if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->slot, end) && + pull16(ppReadPackedMsg, &pNfapiMsg->number_crcs, end) + )) + return 0; + + for(int i=0; inumber_crcs;i++) + { + if(!unpack_nr_crc_indication_body(pNfapiMsg->crc_list,ppReadPackedMsg,end)) + //if(!unpack_nr_crc_indication_body(value,ppReadPackedMsg,end)) + return 0; + } + +return 1; +} + +//SRS INDICATION + +static uint8_t unpack_nr_srs_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) +{ + nfapi_nr_srs_indication_pdu_t* value = (nfapi_nr_srs_indication_pdu_t*)tlv; + + if(!(pull32(ppReadPackedMsg, &value->handle, end) && + pull16(ppReadPackedMsg, &value->rnti, end) && + pull16(ppReadPackedMsg, &value->timing_advance, end) && + pull8(ppReadPackedMsg, &value->num_symbols, end) && + pull8(ppReadPackedMsg, &value->wide_band_snr, end) && + pull8(ppReadPackedMsg, &value->num_reported_symbols, end) && + pull16(ppReadPackedMsg, &value->reported_symbol_list->num_rbs, end) + )) + return 0; + for(int i = 0; i < value->reported_symbol_list->num_rbs; i++) + { + if(!(pull8(ppReadPackedMsg, &value->reported_symbol_list->rb_list->rb_snr, end) + )) + return 0; + } + return 1; +} + +static uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t*)msg; + + if (!(pull16(ppReadPackedMsg,&pNfapiMsg->sfn , end) && + pull16(ppReadPackedMsg,&pNfapiMsg->slot , end) && + pull8(ppReadPackedMsg,&pNfapiMsg->number_of_pdus, end) + )) + return 0; + + for(int i=0; inumber_of_pdus;i++) + { + if(!unpack_nr_srs_indication_body(&pNfapiMsg->pdu_list,ppReadPackedMsg,end)) + return 0; + } + +return 1; +} + +//NR RACH + +static uint8_t unpack_nr_rach_indication_body(nfapi_nr_prach_indication_pdu_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) +{ + nfapi_nr_prach_indication_pdu_t* value = (nfapi_nr_prach_indication_pdu_t*)tlv; + + if(!(pull16(ppReadPackedMsg, &value->phy_cell_id, end) && + pull8(ppReadPackedMsg, &value->symbol_index, end) && + pull8(ppReadPackedMsg, &value->slot_index, end) && + pull8(ppReadPackedMsg, &value->freq_index, end) && + pull8(ppReadPackedMsg, &value->avg_rssi, end) && + pull8(ppReadPackedMsg, &value->avg_snr, end) && + pull8(ppReadPackedMsg, &value->num_preamble, end) + )) + return 0; + value->preamble_list = (nfapi_nr_prach_indication_preamble_t*) malloc(sizeof(nfapi_nr_prach_indication_preamble_t) * value->num_preamble); + for(int i = 0; i < value->num_preamble; i++) + { + if(!(pull8(ppReadPackedMsg, &value->preamble_list->preamble_index, end) && + pull16(ppReadPackedMsg, &value->preamble_list->timing_advance, end) && + pull32(ppReadPackedMsg, &value->preamble_list->preamble_pwr, end) + )) + return 0; + } + return 1; +} + +static uint8_t unpack_nr_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_rach_indication_t* msg, nfapi_p7_codec_config_t* config) { + + nfapi_nr_rach_indication_t *pNfapiMsg = (nfapi_nr_rach_indication_t*)msg; + if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && + pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) && + pull8(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end) + )) + return 0; + pNfapiMsg->pdu_list = (nfapi_nr_prach_indication_pdu_t*) malloc(sizeof(nfapi_nr_prach_indication_pdu_t) * pNfapiMsg->number_of_pdus); + for(int i=0; i< pNfapiMsg->number_of_pdus;i++) + { + if(!unpack_nr_rach_indication_body(pNfapiMsg->pdu_list,ppReadPackedMsg,end)) + return 0; + } + +return 1; +} + +//NR UCI + +static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_uci_pucch_pdu_format_0_1_t* value = (nfapi_nr_uci_pucch_pdu_format_0_1_t*)tlv; + + // uint8_t *ptr = *ppReadPackedMsg; + // printf("\n Read P7 message uci_0_1 indication unpack: "); + // while(ptr < end){ + // printf(" %d ", *ptr); + // ptr++; + // } + // printf("\n"); + + if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && + pull32(ppReadPackedMsg, &value->handle, end) && + pull16(ppReadPackedMsg, &value->rnti, end) && + pull8(ppReadPackedMsg, &value->pucch_format, end) && + pull8(ppReadPackedMsg, &value->ul_cqi, end) && + pull16(ppReadPackedMsg, &value->timing_advance, end) && + pull16(ppReadPackedMsg, &value->rssi, end) + )) + return 0; + if (value->pduBitmap & 0x01) { //SR + value->sr = (nfapi_nr_sr_pdu_0_1_t*) malloc(sizeof(nfapi_nr_sr_pdu_0_1_t)); + if(!(pull8(ppReadPackedMsg, &value->sr->sr_indication, end) && + pull8(ppReadPackedMsg, &value->sr->sr_confidence_level, end) + )) + return 0; + } + + if (((value->pduBitmap >> 1) & 0x01)) { //HARQ + value->harq = (nfapi_nr_harq_pdu_0_1_t*) malloc(sizeof(nfapi_nr_harq_pdu_0_1_t)); + if(!(pull8(ppReadPackedMsg, &value->harq->num_harq, end) && + pull8(ppReadPackedMsg, &value->harq->harq_confidence_level, end) + )) + return 0; + value->harq->harq_list = (nfapi_nr_harq_t*) malloc(sizeof(nfapi_nr_harq_t*) * value->harq->num_harq); + for(int i=0; iharq->num_harq;i++) + { + if(!(pull8(ppReadPackedMsg, &value->harq->harq_list->harq_value, end) + )) + return 0; + } + } + + return 1; +} + + +static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; + + if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && + pull32(ppReadPackedMsg, &value->handle, end) && + pull16(ppReadPackedMsg, &value->rnti, end) && + pull8(ppReadPackedMsg, &value->pucch_format, end) && + pull8(ppReadPackedMsg, &value->ul_cqi, end) && + pull16(ppReadPackedMsg, &value->timing_advance, end) && + pull16(ppReadPackedMsg, &value->rssi, end) + )) + return 0; + if (value->pduBitmap & 0x01) { //SR + if(!(pull16(ppReadPackedMsg, &value->sr.sr_bit_len, end))) + return 0; + + value->sr.sr_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->sr.sr_bit_len/8))); + + if(!(pullarray8(ppReadPackedMsg, &value->sr.sr_payload[0], (int)(value->sr.sr_bit_len / 8), (int)(value->sr.sr_bit_len / 8), end))) + return 0; + } + + if (((value->pduBitmap >> 1) & 0x01)) { //HARQ + if(!(pull8(ppReadPackedMsg, &value->harq.harq_crc, end)) && + (pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end))) + return 0; + + value->harq.harq_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->harq.harq_bit_len/8 ))); + + if(!(pullarray8(ppReadPackedMsg, value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8), (int)(value->harq.harq_bit_len / 8), end))) + return 0; + } + + if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1 + if(!(pull8(ppReadPackedMsg, &value->csi_part1.csi_part1_crc, end)) && + (pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end))) + return 0; + + value->csi_part1.csi_part1_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->csi_part1.csi_part1_bit_len/8))); + +// if(!(pullarray8(ppReadPackedMsg, value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8), (int)(value->csi_part1.csi_part1_bit_len / 8), end))) +// return 0; + } + + if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2 + if(!(pull8(ppReadPackedMsg, &value->csi_part2.csi_part2_crc, end)) && + (pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end))) + return 0; + + value->csi_part2.csi_part2_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->csi_part2.csi_part2_bit_len/8 ))); + + if(!(pullarray8(ppReadPackedMsg, value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) , (int)(value->csi_part2.csi_part2_bit_len / 8) , end))) + return 0; + } + + return 1; +} + +static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t* value, uint8_t **ppReadPackedMsg, uint8_t *end) +{ + if(!(pull16(ppReadPackedMsg, &value->pdu_type, end) && + pull16(ppReadPackedMsg, &value->pdu_size, end) + )) + return 0; + + switch (value->pdu_type) { + case NFAPI_NR_UCI_PUSCH_PDU_TYPE: + printf("Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n"); + break; + + case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { + nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu = &value->pucch_pdu_format_0_1; + unpack_nr_uci_pucch_0_1(uci_pdu, ppReadPackedMsg, end); + break; + } + case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4; + unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end); + break; + } + } + + return 1; +} + +static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) +{ + nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg; + + if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && + pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) && + pull16(ppReadPackedMsg, &pNfapiMsg->num_ucis, end) + )) + return 0; + + for(int i=0; inum_ucis;i++) + { + if(!unpack_nr_uci_indication_body(pNfapiMsg->uci_list,ppReadPackedMsg,end)) + return 0; + } + +return 1; +} + +static uint8_t unpack_ue_release_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + uint8_t proceed = 1; + nfapi_ue_release_request_t *pNfapiMsg = (nfapi_ue_release_request_t *)msg; + + if(pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) == 0) + return 0; + + while (((uint8_t *)(*ppReadPackedMsg) < end) && proceed) { + nfapi_tl_t generic_tl; + + if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) + return 0; + + switch(generic_tl.tag) { + case NFAPI_UE_RELEASE_BODY_TAG: { + pNfapiMsg->ue_release_request_body.tl = generic_tl; + + if( pull16(ppReadPackedMsg, &pNfapiMsg->ue_release_request_body.number_of_TLVs, end) == 0) + return 0; + + if(pNfapiMsg->ue_release_request_body.number_of_TLVs > NFAPI_RELEASE_MAX_RNTI) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of relese rnti's exceed maxium (count:%d max:%d)\n", __FUNCTION__, pNfapiMsg->ue_release_request_body.number_of_TLVs, NFAPI_RELEASE_MAX_RNTI); + return 0; + } else { + uint8_t j; + uint16_t num = pNfapiMsg->ue_release_request_body.number_of_TLVs; + + for(j = 0; j < num; ++j) { + if(pull16(ppReadPackedMsg, &pNfapiMsg->ue_release_request_body.ue_release_request_TLVs_list[j].rnti, end) == 0) { + return 0; + } + } + } + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_ue_release_request FIXME : Invalid type %d \n", generic_tl.tag ); + } + break; + }; + } + + return 1; +} + +static uint8_t unpack_harq_indication_tdd_harq_data_bundling(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_harq_data_bundling_t *value = (nfapi_harq_indication_tdd_harq_data_bundling_t *)tlv; + return (pull8(ppReadPackedMsg, &value->value_0, end) && + pull8(ppReadPackedMsg, &value->value_1, end)); +} + +static uint8_t unpack_harq_indication_tdd_harq_data_multiplexing(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_harq_data_multiplexing_t *value = (nfapi_harq_indication_tdd_harq_data_multiplexing_t *)tlv; + return (pull8(ppReadPackedMsg, &value->value_0, end) && + pull8(ppReadPackedMsg, &value->value_1, end) && + pull8(ppReadPackedMsg, &value->value_2, end) && + pull8(ppReadPackedMsg, &value->value_3, end)); +} +static uint8_t unpack_harq_indication_tdd_harq_data_special_bundling(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_harq_data_special_bundling_t *value = (nfapi_harq_indication_tdd_harq_data_special_bundling_t *)tlv; + return ( pull8(ppReadPackedMsg, &value->value_0, end)); +} +static uint8_t unpack_harq_indication_tdd_harq_data(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_harq_data_t *value = (nfapi_harq_indication_tdd_harq_data_t *)tlv; + return (pull8(ppReadPackedMsg, &value->value_0, end)); +} + +static uint8_t unpack_harq_indication_tdd_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_rel8_t *value = (nfapi_harq_indication_tdd_rel8_t *)tlv; + + if(!(pull8(ppReadPackedMsg, &value->mode, end) && + pull8(ppReadPackedMsg, &value->number_of_ack_nack, end))) + return 0; + + uint8_t result = 0; + + switch(value->mode) { + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: + result = unpack_harq_indication_tdd_harq_data_bundling(&value->harq_data.bundling, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: + result = unpack_harq_indication_tdd_harq_data_multiplexing(&value->harq_data.multiplex, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: + result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data.special_bundling, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: + result = 1; + break; + + default: + // TODO add error message + return 0; + break; + } + + return result; +} + +static uint8_t unpack_harq_indication_tdd_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_rel9_t *value = (nfapi_harq_indication_tdd_rel9_t *)tlv; + + if(!(pull8(ppReadPackedMsg, &value->mode, end) && + pull8(ppReadPackedMsg, &value->number_of_ack_nack, end))) + return 0; + + if(value->number_of_ack_nack > NFAPI_MAX_NUMBER_ACK_NACK_TDD) { + // TODO : add error message + return 0; + } + + uint16_t idx = 0; + + for(idx = 0; idx < value->number_of_ack_nack; ++idx) { + uint8_t result = 0; + + switch(value->mode) { + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].bundling, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].multiplex, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: + result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data[idx].special_bundling, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].channel_selection, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_3, ppReadPackedMsg, end); + break; + + default: + // TODO add error message + return 0; + break; + } + + if(result == 0) + return 0; + } + + return 1; +} + +static uint8_t unpack_harq_indication_tdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_tdd_rel13_t *value = (nfapi_harq_indication_tdd_rel13_t *)tlv; + + if(!(pull8(ppReadPackedMsg, &value->mode, end) && + pull16(ppReadPackedMsg, &value->number_of_ack_nack, end))) + return 0; + + if(value->number_of_ack_nack > NFAPI_MAX_NUMBER_ACK_NACK_TDD) { + // TODO : add error message + return 0; + } + + uint16_t idx = 0; + + for(idx = 0; idx < value->number_of_ack_nack; ++idx) { + uint8_t result = 0; + + switch(value->mode) { + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_BUNDLING: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].bundling, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_MULIPLEXING: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].multiplex, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_SPECIAL_BUNDLING: + result = unpack_harq_indication_tdd_harq_data_special_bundling(&value->harq_data[idx].special_bundling, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_CHANNEL_SELECTION: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].channel_selection, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_3: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_3, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_4: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_4, ppReadPackedMsg, end); + break; + + case NFAPI_HARQ_INDICATION_TDD_HARQ_ACK_NACK_FORMAT_FORMAT_5: + result = unpack_harq_indication_tdd_harq_data(&value->harq_data[idx].format_5, ppReadPackedMsg, end); + break; + + default: + // TODO add error message + return 0; + break; + } + + if(result == 0) + return 0; + } + + return 1; +} + +static uint8_t unpack_harq_indication_fdd_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_fdd_rel8_t *value = (nfapi_harq_indication_fdd_rel8_t *)tlv; + return (pull8(ppReadPackedMsg, &value->harq_tb1, end) && + pull8(ppReadPackedMsg, &value->harq_tb2, end)); +} + +static uint8_t unpack_harq_indication_fdd_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_fdd_rel9_t *value = (nfapi_harq_indication_fdd_rel9_t *)tlv; + return (pull8(ppReadPackedMsg, &value->mode, end) && + pull8(ppReadPackedMsg, &value->number_of_ack_nack, end) && + pullarray8(ppReadPackedMsg, value->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL9_MAX, value->number_of_ack_nack, end)); +} + +static uint8_t unpack_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_harq_indication_fdd_rel13_t *value = (nfapi_harq_indication_fdd_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &value->mode, end) && + pull16(ppReadPackedMsg, &value->number_of_ack_nack, end) && + pullarray8(ppReadPackedMsg, value->harq_tb_n, NFAPI_HARQ_ACK_NACK_REL13_MAX, value->number_of_ack_nack, end)); +} + +static uint8_t unpack_ul_cqi_information_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_ul_cqi_information_t *value = (nfapi_ul_cqi_information_t *)tlv; + return (pull8(ppReadPackedMsg, &value->ul_cqi, end) && + pull8(ppReadPackedMsg, &value->channel, end)); +} + + + +static uint8_t unpack_harq_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_harq_indication_body_t *value = (nfapi_harq_indication_body_t *)tlv; + uint8_t *harqBodyEnd = *ppReadPackedMsg + value->tl.length; + + if(harqBodyEnd > end) + return 0; + + if(pull16(ppReadPackedMsg, &value->number_of_harqs, end) == 0) + return 0; + + if(value->number_of_harqs > NFAPI_HARQ_IND_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of harq ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_harqs, NFAPI_HARQ_IND_MAX_PDU); + return 0; + } + + value->harq_pdu_list = (nfapi_harq_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_harq_indication_pdu_t) * value->number_of_harqs, config); + + if(value->harq_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate harq ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_harqs); + return 0; + } + + uint8_t i = 0; + + for(i = 0; i < value->number_of_harqs; ++i) { + nfapi_harq_indication_pdu_t *pdu = &(value->harq_pdu_list[i]); + + if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) + return 0; + + uint8_t *harqPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; + unpack_tlv_t unpack_fns[] = { + { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, + { NFAPI_HARQ_INDICATION_TDD_REL8_TAG, &pdu->harq_indication_tdd_rel8, &unpack_harq_indication_tdd_rel8_value}, + { NFAPI_HARQ_INDICATION_TDD_REL9_TAG, &pdu->harq_indication_tdd_rel9, &unpack_harq_indication_tdd_rel9_value}, + { NFAPI_HARQ_INDICATION_TDD_REL13_TAG, &pdu->harq_indication_tdd_rel13, &unpack_harq_indication_tdd_rel13_value}, + { NFAPI_HARQ_INDICATION_FDD_REL8_TAG, &pdu->harq_indication_fdd_rel8, &unpack_harq_indication_fdd_rel8_value}, + { NFAPI_HARQ_INDICATION_FDD_REL9_TAG, &pdu->harq_indication_fdd_rel9, &unpack_harq_indication_fdd_rel9_value}, + { NFAPI_HARQ_INDICATION_FDD_REL13_TAG, &pdu->harq_indication_fdd_rel13, &unpack_harq_indication_fdd_rel13_value}, + { NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, &unpack_ul_cqi_information_value} + }; + + if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, harqPduInstanceEnd, 0, 0) == 0) + return 0; + } + + return 1; +} + +static uint8_t unpack_harq_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_harq_indication_t *pNfapiMsg = (nfapi_harq_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->harq_indication_body, &unpack_harq_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_crc_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_crc_indication_rel8_t *crc_pdu_rel8 = (nfapi_crc_indication_rel8_t *)tlv; + return ( pull8(ppReadPackedMsg, &crc_pdu_rel8->crc_flag, end) ); +} + +static uint8_t unpack_crc_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_crc_indication_body_t *value = (nfapi_crc_indication_body_t *)tlv; + uint8_t *crcBodyEnd = *ppReadPackedMsg + value->tl.length; + + if(crcBodyEnd > end) + return 0; + + if(pull16(ppReadPackedMsg, &value->number_of_crcs, end) == 0) + return 0; + + if(value->number_of_crcs > NFAPI_CRC_IND_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of crc ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_crcs, NFAPI_CRC_IND_MAX_PDU); + return 0; + } + + if(value->number_of_crcs > 0) { + value->crc_pdu_list = (nfapi_crc_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_crc_indication_pdu_t) * value->number_of_crcs, config); + + if(value->crc_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate crc ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_crcs); + return 0; + } + } else { + value->crc_pdu_list = 0; + } + + uint8_t i = 0; + + for(i = 0; i < value->number_of_crcs; ++i) { + nfapi_crc_indication_pdu_t *pdu = &(value->crc_pdu_list[i]); + + if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) + return 0; + + uint8_t *crcPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; + unpack_tlv_t unpack_fns[] = { + { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, + { NFAPI_CRC_INDICATION_REL8_TAG, &pdu->crc_indication_rel8, unpack_crc_indication_rel8_value }, + }; + + if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, crcPduInstanceEnd, 0, 0) == 0) + return 0; + } + + return 1; +} + +static uint8_t unpack_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_crc_indication_t *pNfapiMsg = (nfapi_crc_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_CRC_INDICATION_BODY_TAG, &pNfapiMsg->crc_indication_body, &unpack_crc_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_rx_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_rx_indication_rel8_t *value = (nfapi_rx_indication_rel8_t *)tlv; + return (pull16(ppReadPackedMsg, &value->length, end) && + pull16(ppReadPackedMsg, &value->offset, end) && + pull8(ppReadPackedMsg, &value->ul_cqi, end) && + pull16(ppReadPackedMsg, &value->timing_advance, end)); +} +static uint8_t unpack_rx_indication_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_rx_indication_rel9_t *value = (nfapi_rx_indication_rel9_t *)tlv; + return (pull16(ppReadPackedMsg, &value->timing_advance_r9, end)); +} + +static uint8_t unpack_rx_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_rx_indication_body_t *value = (nfapi_rx_indication_body_t *)tlv; + // the rxBodyEnd points to the end of the cqi PDU's + uint8_t *rxBodyEnd = *ppReadPackedMsg + value->tl.length; + uint8_t *rxPduEnd = rxBodyEnd; + uint8_t *numberOfPdusAddress = *ppReadPackedMsg; + + if(rxBodyEnd > end) { + // pdu end is past buffer end + return 0; + } + + if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0) + return 0; + + if(value->number_of_pdus > NFAPI_RX_IND_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of rx ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_RX_IND_MAX_PDU); + return 0; + } + + if(value->number_of_pdus > 0) { + value->rx_pdu_list = (nfapi_rx_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_rx_indication_pdu_t) * value->number_of_pdus, config); + + if(value->rx_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate rx ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus); + return 0; + } + } else { + value->rx_pdu_list = 0; + } + + uint8_t i = 0; + nfapi_rx_indication_pdu_t *pdu = 0; + + while((uint8_t *)(*ppReadPackedMsg) < rxBodyEnd && (uint8_t *)(*ppReadPackedMsg) < rxPduEnd) { + nfapi_tl_t generic_tl; + + if( unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) + return 0; + + switch(generic_tl.tag) { + case NFAPI_RX_UE_INFORMATION_TAG: { + pdu = &(value->rx_pdu_list[i++]); + pdu->rx_ue_information.tl = generic_tl; + + if(unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0) + return 0; + } + break; + + case NFAPI_RX_INDICATION_REL8_TAG: { + if(pdu != 0) { + pdu->rx_indication_rel8.tl = generic_tl; + + if(unpack_rx_indication_rel8_value(&pdu->rx_indication_rel8, ppReadPackedMsg, end) == 0) + return 0; + + if(pdu->rx_indication_rel8.offset > 0) { + // Need to check that the data is within the tlv + if(numberOfPdusAddress + pdu->rx_indication_rel8.offset + pdu->rx_indication_rel8.length <= rxBodyEnd) { + // If this the first pdu set the rxPduEnd + if(numberOfPdusAddress + pdu->rx_indication_rel8.offset < rxPduEnd) { + rxPduEnd = numberOfPdusAddress + pdu->rx_indication_rel8.offset; + + if(rxPduEnd > end) { + // pdu end is past buffer end + return 0; + } + } + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME: the rx data is outside of the tlv\n"); + } + } + } + } + break; + + case NFAPI_RX_INDICATION_REL9_TAG: { + if(pdu != 0) { + pdu->rx_indication_rel9.tl = generic_tl; + + if(unpack_rx_indication_rel9_value(&pdu->rx_indication_rel9, ppReadPackedMsg, end) == 0) + return 0; + } + } + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "RX_ULSCH.indication Invalid pdu type %d \n", generic_tl.tag ); + } + break; + } + } + + uint8_t idx = 0; + + for(idx = 0; idx < value->number_of_pdus; ++idx) { + if(value->rx_pdu_list[idx].rx_indication_rel8.tl.tag == NFAPI_RX_INDICATION_REL8_TAG) { + uint32_t length = value->rx_pdu_list[idx].rx_indication_rel8.length; + value->rx_pdu_list[idx].data = nfapi_p7_allocate(length, config); + + if(pullarray8(ppReadPackedMsg, value->rx_pdu_list[idx].data, length, length, end) == 0) { + return 0; + } + } + } + + return 1; +} + +static uint8_t unpack_rx_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_rx_indication_t *pNfapiMsg = (nfapi_rx_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_RX_INDICATION_BODY_TAG, &pNfapiMsg->rx_indication_body, &unpack_rx_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_preamble_pdu_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_preamble_pdu_rel8_t *preamble_pdu_rel8 = (nfapi_preamble_pdu_rel8_t *)tlv; + return (pull16(ppReadPackedMsg, &preamble_pdu_rel8->rnti, end) && + pull8(ppReadPackedMsg, &preamble_pdu_rel8->preamble, end) && + pull16(ppReadPackedMsg, &preamble_pdu_rel8->timing_advance, end)); +} + +static uint8_t unpack_preamble_pdu_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_preamble_pdu_rel9_t *preamble_pdu_rel9 = (nfapi_preamble_pdu_rel9_t *)tlv; + return pull16(ppReadPackedMsg, &preamble_pdu_rel9->timing_advance_r9, end); +} + +static uint8_t unpack_preamble_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_preamble_pdu_rel13_t *preamble_pdu_rel13 = (nfapi_preamble_pdu_rel13_t *)tlv; + return pull8(ppReadPackedMsg, &preamble_pdu_rel13->rach_resource_type, end); +} + +static uint8_t unpack_rach_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_rach_indication_body_t *value = (nfapi_rach_indication_body_t *)tlv; + uint8_t *rachBodyEnd = *ppReadPackedMsg + value->tl.length; + + if(rachBodyEnd > end) + return 0; + + if(pull16(ppReadPackedMsg, &value->number_of_preambles, end) == 0) + return 0; + + if(value->number_of_preambles > NFAPI_PREAMBLE_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of preamble du's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_preambles, NFAPI_PREAMBLE_MAX_PDU); + return 0; + } + + if(value->number_of_preambles > 0) { + value->preamble_list = (nfapi_preamble_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_preamble_pdu_t) * value->number_of_preambles, config); + + if(value->preamble_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate preamble pdu list (count:%d)\n", __FUNCTION__, value->number_of_preambles); + return 0; + } + } else { + value->preamble_list = 0; + } + + uint8_t i = 0; + + for(i = 0; i < value->number_of_preambles; ++i) { + nfapi_preamble_pdu_t *pdu = &(value->preamble_list[i]); + + if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) + return 0; + + uint8_t *preamblePduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; + unpack_tlv_t unpack_fns[] = { + { NFAPI_PREAMBLE_REL8_TAG, &pdu->preamble_rel8, unpack_preamble_pdu_rel8_value }, + { NFAPI_PREAMBLE_REL9_TAG, &pdu->preamble_rel9, unpack_preamble_pdu_rel9_value }, + { NFAPI_PREAMBLE_REL13_TAG, &pdu->preamble_rel13, unpack_preamble_pdu_rel13_value }, + }; + + if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, preamblePduInstanceEnd, 0, 0) == 0) + return 0; + } + + return 1; +} + +static uint8_t unpack_rach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_rach_indication_t *pNfapiMsg = (nfapi_rach_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_RACH_INDICATION_BODY_TAG, &pNfapiMsg->rach_indication_body, &unpack_rach_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_srs_indication_fdd_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_srs_indication_fdd_rel8_t *srs_pdu_fdd_rel8 = (nfapi_srs_indication_fdd_rel8_t *)tlv; + + if(!(pull16(ppReadPackedMsg, &srs_pdu_fdd_rel8->doppler_estimation, end) && + pull16(ppReadPackedMsg, &srs_pdu_fdd_rel8->timing_advance, end) && + pull8(ppReadPackedMsg, &srs_pdu_fdd_rel8->number_of_resource_blocks, end) && + pull8(ppReadPackedMsg, &srs_pdu_fdd_rel8->rb_start, end) && + pullarray8(ppReadPackedMsg, srs_pdu_fdd_rel8->snr, NFAPI_NUM_RB_MAX, srs_pdu_fdd_rel8->number_of_resource_blocks, end))) + return 0; + + return 1; +} + +static uint8_t unpack_srs_indication_fdd_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_srs_indication_fdd_rel9_t *srs_pdu_fdd_rel9 = (nfapi_srs_indication_fdd_rel9_t *)tlv; + return (pull16(ppReadPackedMsg, &srs_pdu_fdd_rel9->timing_advance_r9, end)); +} + +static uint8_t unpack_srs_indication_tdd_rel10_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_srs_indication_ttd_rel10_t *srs_pdu_tdd_rel10 = (nfapi_srs_indication_ttd_rel10_t *)tlv; + return (pull8(ppReadPackedMsg, &srs_pdu_tdd_rel10->uppts_symbol, end)); +} + +static uint8_t unpack_srs_indication_fdd_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_srs_indication_fdd_rel11_t *srs_pdu_fdd_rel11 = (nfapi_srs_indication_fdd_rel11_t *)tlv; + return ( pull16(ppReadPackedMsg, &srs_pdu_fdd_rel11->ul_rtoa, end)); +} + +static uint8_t unpack_tdd_channel_measurement_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_tdd_channel_measurement_t *value = (nfapi_tdd_channel_measurement_t *)tlv; + + if(!(pull8(ppReadPackedMsg, &value->num_prb_per_subband, end) && + pull8(ppReadPackedMsg, &value->number_of_subbands, end) && + pull8(ppReadPackedMsg, &value->num_atennas, end))) + return 0; + + if(value->number_of_subbands > NFAPI_MAX_NUM_SUBBANDS) { + // todo : add error + return 0; + } + + if(value->num_atennas > NFAPI_MAX_NUM_PHYSICAL_ANTENNAS) { + // todo : add error + return 0; + } + + uint8_t idx = 0; + + for(idx = 0; idx < value->number_of_subbands; ++idx) { + if(!(pull8(ppReadPackedMsg, &value->subands[idx].subband_index, end) && + pullarray16(ppReadPackedMsg, value->subands[idx].channel, NFAPI_MAX_NUM_PHYSICAL_ANTENNAS, value->num_atennas, end))) + return 0; + } + + return 1; +} + + +static uint8_t unpack_srs_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_srs_indication_body_t *value = (nfapi_srs_indication_body_t *)tlv; + uint8_t *srsBodyEnd = *ppReadPackedMsg + value->tl.length; + + if(srsBodyEnd > end) + return 0; + + if(pull8(ppReadPackedMsg, &value->number_of_ues, end) == 0) + return 0; + + if(value->number_of_ues > NFAPI_SRS_IND_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of srs ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_ues, NFAPI_SRS_IND_MAX_PDU); + return 0; + } + + if(value->number_of_ues > 0) { + value->srs_pdu_list = (nfapi_srs_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_srs_indication_pdu_t) * value->number_of_ues, config); + + if(value->srs_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate srs ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_ues); + return 0; + } + } else { + value->srs_pdu_list = 0; + } + + uint8_t i = 0; + + for(i = 0; i < value->number_of_ues; ++i) { + nfapi_srs_indication_pdu_t *pdu = &(value->srs_pdu_list[i]); + + if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) + return 0; + + uint8_t *srsPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; + unpack_tlv_t unpack_fns[] = { + { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, + { NFAPI_SRS_INDICATION_FDD_REL8_TAG, &pdu->srs_indication_fdd_rel8, unpack_srs_indication_fdd_rel8_value}, + { NFAPI_SRS_INDICATION_FDD_REL9_TAG, &pdu->srs_indication_fdd_rel9, unpack_srs_indication_fdd_rel9_value}, + { NFAPI_SRS_INDICATION_TDD_REL10_TAG, &pdu->srs_indication_tdd_rel10, unpack_srs_indication_tdd_rel10_value}, + { NFAPI_SRS_INDICATION_FDD_REL11_TAG, &pdu->srs_indication_fdd_rel11, unpack_srs_indication_fdd_rel11_value}, + { NFAPI_TDD_CHANNEL_MEASUREMENT_TAG, &pdu->tdd_channel_measurement, unpack_tdd_channel_measurement_value}, + }; + + if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, srsPduInstanceEnd, 0, 0) == 0) + return 0; + } + + return 1; +} + +static uint8_t unpack_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_srs_indication_t *pNfapiMsg = (nfapi_srs_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_SRS_INDICATION_BODY_TAG, &pNfapiMsg->srs_indication_body, &unpack_srs_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + + +static uint8_t unpack_sr_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_sr_indication_body_t *value = (nfapi_sr_indication_body_t *)tlv; + uint8_t *srBodyEnd = *ppReadPackedMsg + value->tl.length; + + if(srBodyEnd > end) + return 0; + + if(pull16(ppReadPackedMsg, &value->number_of_srs, end) == 0) + return 0; + + if(value->number_of_srs > NFAPI_SR_IND_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of sr ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_srs, NFAPI_SR_IND_MAX_PDU); + return 0; + } + + if(value->number_of_srs > 0) { + value->sr_pdu_list = (nfapi_sr_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_sr_indication_pdu_t) * value->number_of_srs, config); + + if(value->sr_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate sr ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_srs); + return 0; + } + } else { + value->sr_pdu_list = 0; + } + + uint8_t i = 0; + + for(i = 0; i < value->number_of_srs; ++i) { + nfapi_sr_indication_pdu_t *pdu = &(value->sr_pdu_list[i]); + + if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) + return 0; + + uint8_t *srPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; + unpack_tlv_t unpack_fns[] = { + { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, + { NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, unpack_ul_cqi_information_value }, + }; + + if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, srPduInstanceEnd, 0, 0) == 0) + return 0; + } + + return 1; +} + +static int unpack_sr_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_sr_indication_t *pNfapiMsg = (nfapi_sr_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_SR_INDICATION_BODY_TAG, &pNfapiMsg->sr_indication_body, &unpack_sr_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} +static uint8_t unpack_cqi_indication_rel8_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_cqi_indication_rel8_t *cqi_pdu_rel8 = (nfapi_cqi_indication_rel8_t *)tlv; + return (pull16(ppReadPackedMsg, &cqi_pdu_rel8->length, end) && + pull16(ppReadPackedMsg, &cqi_pdu_rel8->data_offset, end) && + pull8(ppReadPackedMsg, &cqi_pdu_rel8->ul_cqi, end) && + pull8(ppReadPackedMsg, &cqi_pdu_rel8->ri, end) && + pull16(ppReadPackedMsg, &cqi_pdu_rel8->timing_advance, end)); +} + +static uint8_t unpack_cqi_indication_rel9_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_cqi_indication_rel9_t *cqi_pdu_rel9 = (nfapi_cqi_indication_rel9_t *)tlv; + + if(!(pull16(ppReadPackedMsg, &cqi_pdu_rel9->length, end) && + pull16(ppReadPackedMsg, &cqi_pdu_rel9->data_offset, end) && + pull8(ppReadPackedMsg, &cqi_pdu_rel9->ul_cqi, end) && + pull8(ppReadPackedMsg, &cqi_pdu_rel9->number_of_cc_reported, end))) + return 0; + + if(cqi_pdu_rel9->number_of_cc_reported > NFAPI_CC_MAX) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "FIXME : out of bound array\n"); + return 0; + } + + if(!(pullarray8(ppReadPackedMsg, cqi_pdu_rel9->ri, NFAPI_CC_MAX, cqi_pdu_rel9->number_of_cc_reported, end) && + pull16(ppReadPackedMsg, &cqi_pdu_rel9->timing_advance, end) && + pull16(ppReadPackedMsg, &cqi_pdu_rel9->timing_advance_r9, end))) + return 0; + + return 1; +} + +static uint8_t unpack_cqi_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_cqi_indication_body_t *value = (nfapi_cqi_indication_body_t *)tlv; + // the cqiBodyEnd points to the end of the cqi PDU's + uint8_t *cqiBodyEnd = *ppReadPackedMsg + value->tl.length; + + //uint8_t* cqiPduEnd = cqiBodyEnd; + //uint8_t* numberOfPdusAddress = *ppReadPackedMsg; + + if(cqiBodyEnd > end) + return 0; + + if(pull16(ppReadPackedMsg, &value->number_of_cqis, end) == 0) + return 0; + + if(value->number_of_cqis > NFAPI_CQI_IND_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of cqi ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_cqis, NFAPI_CQI_IND_MAX_PDU); + return -1; + } + + if(value->number_of_cqis > 0) { + value->cqi_pdu_list = (nfapi_cqi_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_cqi_indication_pdu_t) * value->number_of_cqis, config); + + if(value->cqi_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate cqi ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_cqis); + return 0; + } + } else { + value->cqi_pdu_list = 0; + } + + if(value->number_of_cqis > 0) { + value->cqi_raw_pdu_list = (nfapi_cqi_indication_raw_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_cqi_indication_raw_pdu_t) * value->number_of_cqis, config); + + if(value->cqi_raw_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate raw cqi ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_cqis); + return 0; + } + } else { + value->cqi_raw_pdu_list = 0; + } + + uint8_t i = 0; + + for(i = 0; i < value->number_of_cqis; ++i) { + nfapi_cqi_indication_pdu_t *pdu = &(value->cqi_pdu_list[i]); + memset(pdu, 0, sizeof(nfapi_cqi_indication_pdu_t)); + + if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) + return 0; + + uint8_t *cqiPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; + + while((uint8_t *)(*ppReadPackedMsg) < cqiPduInstanceEnd) { + nfapi_tl_t generic_tl; + + if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) + return 0; + + switch(generic_tl.tag) { + case NFAPI_RX_UE_INFORMATION_TAG: + pdu->rx_ue_information.tl = generic_tl; + + if(unpack_rx_ue_information_value(&pdu->rx_ue_information, ppReadPackedMsg, end) == 0) + return 0; + + break; + + case NFAPI_CQI_INDICATION_REL8_TAG: + pdu->cqi_indication_rel8.tl = generic_tl; + + if(unpack_cqi_indication_rel8_value(&pdu->cqi_indication_rel8, ppReadPackedMsg, end) == 0) + return 0; + + break; + + case NFAPI_CQI_INDICATION_REL9_TAG: + pdu->cqi_indication_rel9.tl = generic_tl; + + if(unpack_cqi_indication_rel9_value(&pdu->cqi_indication_rel9, ppReadPackedMsg, end) == 0) + return 0; + + break; + + case NFAPI_UL_CQI_INFORMATION_TAG: + pdu->ul_cqi_information.tl = generic_tl; + + if(unpack_ul_cqi_information_value(&pdu->ul_cqi_information, ppReadPackedMsg, end) == 0) + return 0; + + break; + + default: { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "RX_CQI.indication Invalid pdu type %d \n", generic_tl.tag ); + } + break; + }; + } + } + + uint8_t idx = 0; + + for(idx = 0; idx < value->number_of_cqis; ++idx) { + if(value->cqi_pdu_list[idx].cqi_indication_rel8.tl.tag == NFAPI_CQI_INDICATION_REL8_TAG) { + if(pullarray8(ppReadPackedMsg, &(value->cqi_raw_pdu_list[idx].pdu[0]), NFAPI_CQI_RAW_MAX_LEN, value->cqi_pdu_list[idx].cqi_indication_rel8.length, end) == 0) + return 0; + } else if(value->cqi_pdu_list[idx].cqi_indication_rel9.tl.tag == NFAPI_CQI_INDICATION_REL9_TAG) { + if(pullarray8(ppReadPackedMsg, &(value->cqi_raw_pdu_list[idx].pdu[0]), NFAPI_CQI_RAW_MAX_LEN, value->cqi_pdu_list[idx].cqi_indication_rel9.length, end) == 0) + return 0; + } + } + + return 1; +} + +static uint8_t unpack_cqi_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_cqi_indication_t *pNfapiMsg = (nfapi_cqi_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_CQI_INDICATION_BODY_TAG, &pNfapiMsg->cqi_indication_body, &unpack_cqi_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} +static uint8_t unpack_lbt_pdsch_req_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_lbt_pdsch_req_pdu_rel13_t *value = (nfapi_lbt_pdsch_req_pdu_rel13_t *)tlv; + return (pull32(ppReadPackedMsg, &value->handle, end) && + pull32(ppReadPackedMsg, &value->mp_cca, end) && + pull32(ppReadPackedMsg, &value->n_cca, end) && + pull32(ppReadPackedMsg, &value->offset, end) && + pull32(ppReadPackedMsg, &value->lte_txop_sf, end) && + pull16(ppReadPackedMsg, &value->txop_sfn_sf_end, end) && + pull32(ppReadPackedMsg, &value->lbt_mode, end)); +} + +static uint8_t unpack_lbt_drs_req_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_lbt_drs_req_pdu_rel13_t *value = (nfapi_lbt_drs_req_pdu_rel13_t *)tlv; + return (pull32(ppReadPackedMsg, &value->handle, end) && + pull32(ppReadPackedMsg, &value->offset, end) && + pull16(ppReadPackedMsg, &value->sfn_sf_end, end) && + pull32(ppReadPackedMsg, &value->lbt_mode, end)); +} + + +static uint8_t unpack_lbt_config_request_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_lbt_dl_config_request_body_t *value = (nfapi_lbt_dl_config_request_body_t *)tlv; + + if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0) + return 0; + + if(value->number_of_pdus > NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of lbt dl config pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_LBT_DL_CONFIG_REQ_MAX_PDU); + return 0; + } + + if(value->number_of_pdus) { + value->lbt_dl_config_req_pdu_list = (nfapi_lbt_dl_config_request_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_lbt_dl_config_request_pdu_t) * value->number_of_pdus, config); + + if(value->lbt_dl_config_req_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate lbt dl config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus); + return 0; + } + } else { + value->lbt_dl_config_req_pdu_list = 0; + } + + uint16_t i; + uint16_t total_number_of_pdus = value->number_of_pdus; + + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_lbt_dl_config_request_pdu_t *pdu = &(value->lbt_dl_config_req_pdu_list[i]); + + if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && + pull8(ppReadPackedMsg, &pdu->pdu_size, end))) + return 0; + + uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; + + if(packedPduEnd > end) + return 0; + + switch(pdu->pdu_type) { + case NFAPI_LBT_DL_CONFIG_REQUEST_PDSCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_LBT_PDSCH_REQ_PDU_REL13_TAG, &pdu->lbt_pdsch_req_pdu.lbt_pdsch_req_pdu_rel13, &unpack_lbt_pdsch_req_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_LBT_DL_CONFIG_REQUEST_DRS_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_LBT_DRS_REQ_PDU_REL13_TAG, &pdu->lbt_drs_req_pdu.lbt_drs_req_pdu_rel13, &unpack_lbt_drs_req_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + default: + NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL_CONFIG.request body invalid pdu type %d\n", pdu->pdu_type); + return 0; + } + } + + return 1; +} +static uint8_t unpack_lbt_dl_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_lbt_dl_config_request_t *pNfapiMsg = (nfapi_lbt_dl_config_request_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_LBT_DL_CONFIG_REQUEST_BODY_TAG, &pNfapiMsg->lbt_dl_config_request_body, &unpack_lbt_config_request_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_lbt_pdsch_rsp_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_lbt_pdsch_rsp_pdu_rel13_t *value = (nfapi_lbt_pdsch_rsp_pdu_rel13_t *)tlv; + return (pull32(ppReadPackedMsg, &value->handle, end) && + pull32(ppReadPackedMsg, &value->result, end) && + pull32(ppReadPackedMsg, &value->lte_txop_symbols, end) && + pull32(ppReadPackedMsg, &value->initial_partial_sf, end)); +} +static uint8_t unpack_lbt_drs_rsp_pdu_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_lbt_drs_rsp_pdu_rel13_t *value = (nfapi_lbt_drs_rsp_pdu_rel13_t *)tlv; + return (pull32(ppReadPackedMsg, &value->handle, end) && + pull32(ppReadPackedMsg, &value->result, end)); +} + +static uint8_t unpack_lbt_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_lbt_dl_indication_body_t *value = (nfapi_lbt_dl_indication_body_t *)tlv; + + if(pull16(ppReadPackedMsg, &value->number_of_pdus, end) == 0) + return 0; + + if(value->number_of_pdus > NFAPI_LBT_IND_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of lbt dl ind pdu's exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_pdus, NFAPI_LBT_IND_MAX_PDU); + return 0; + } + + if(value->number_of_pdus > 0) { + value->lbt_indication_pdu_list = (nfapi_lbt_dl_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_lbt_dl_indication_pdu_t) * value->number_of_pdus, config); + + if(value->lbt_indication_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate lbt dl ind config pdu list (count:%d)\n", __FUNCTION__, value->number_of_pdus); + return 0; + } + } else { + value->lbt_indication_pdu_list = 0; + } + + uint16_t i; + uint16_t total_number_of_pdus = value->number_of_pdus; + + for(i = 0; i < total_number_of_pdus; ++i) { + nfapi_lbt_dl_indication_pdu_t *pdu = &(value->lbt_indication_pdu_list[i]); + + if(!(pull8(ppReadPackedMsg, &pdu->pdu_type, end) && + pull8(ppReadPackedMsg, &pdu->pdu_size, end))) + return 0; + + uint8_t *packedPduEnd = (*ppReadPackedMsg) + pdu->pdu_size - 2; + + if(packedPduEnd > end) + return 0; + + switch(pdu->pdu_type) { + case NFAPI_LBT_DL_RSP_PDSCH_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_LBT_PDSCH_RSP_PDU_REL13_TAG, &pdu->lbt_pdsch_rsp_pdu.lbt_pdsch_rsp_pdu_rel13, &unpack_lbt_pdsch_rsp_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + case NFAPI_LBT_DL_RSP_DRS_PDU_TYPE: { + unpack_tlv_t unpack_fns[] = { + { NFAPI_LBT_DRS_RSP_PDU_REL13_TAG, &pdu->lbt_drs_rsp_pdu.lbt_drs_rsp_pdu_rel13, &unpack_lbt_drs_rsp_pdu_rel13_value}, + }; + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, packedPduEnd, 0, 0); + } + break; + + default: + NFAPI_TRACE(NFAPI_TRACE_ERROR, "LBT_DL.indication body invalid pdu type %d\n", pdu->pdu_type); + return 0; + } + } + + return 1; +} +static uint8_t unpack_lbt_dl_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_lbt_dl_indication_t *pNfapiMsg = (nfapi_lbt_dl_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_LBT_DL_INDICATION_BODY_TAG, &pNfapiMsg->lbt_dl_indication_body, &unpack_lbt_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_nb_harq_indication_fdd_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nb_harq_indication_fdd_rel13_t *value = (nfapi_nb_harq_indication_fdd_rel13_t *)tlv; + return (pull8(ppReadPackedMsg, &value->harq_tb1, end)); +} + + +static uint8_t unpack_nb_harq_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nb_harq_indication_body_t *value = (nfapi_nb_harq_indication_body_t *)tlv; + uint8_t *nbharqBodyEnd = *ppReadPackedMsg + value->tl.length; + + if(nbharqBodyEnd > end) + return 0; + + if(pull16(ppReadPackedMsg, &value->number_of_harqs, end) == 0) + return 0; + + if(value->number_of_harqs > NFAPI_HARQ_IND_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of harq ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_harqs, NFAPI_HARQ_IND_MAX_PDU); + return 0; + } + + value->nb_harq_pdu_list = (nfapi_nb_harq_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_nb_harq_indication_pdu_t) * value->number_of_harqs, config); + + if(value->nb_harq_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate harq ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_harqs); + return 0; + } + + uint8_t i = 0; + + for(i = 0; i < value->number_of_harqs; ++i) { + nfapi_nb_harq_indication_pdu_t *pdu = &(value->nb_harq_pdu_list[i]); + + if(pull16(ppReadPackedMsg, &pdu->instance_length, end) == 0) + return 0; + + uint8_t *harqPduInstanceEnd = *ppReadPackedMsg + pdu->instance_length; + unpack_tlv_t unpack_fns[] = { + { NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, unpack_rx_ue_information_value }, + { NFAPI_NB_HARQ_INDICATION_FDD_REL13_TAG, &pdu->nb_harq_indication_fdd_rel13, &unpack_nb_harq_indication_fdd_rel13_value}, + { NFAPI_UL_CQI_INFORMATION_TAG, &pdu->ul_cqi_information, &unpack_ul_cqi_information_value} + }; + + if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, harqPduInstanceEnd, 0, 0) == 0) + return 0; + } + + return 1; +} + +static uint8_t unpack_nb_harq_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nb_harq_indication_t *pNfapiMsg = (nfapi_nb_harq_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_NB_HARQ_INDICATION_BODY_TAG, &pNfapiMsg->nb_harq_indication_body, &unpack_nb_harq_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_nrach_indication_rel13_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nrach_indication_pdu_rel13_t *value = (nfapi_nrach_indication_pdu_rel13_t *)tlv; + return (pull16(ppReadPackedMsg, &value->rnti, end) && + pull8(ppReadPackedMsg, &value->initial_sc, end) && + pull16(ppReadPackedMsg, &value->timing_advance, end) && + pull8(ppReadPackedMsg, &value->nrach_ce_level, end)); +} + +static uint8_t unpack_ue_release_resp(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_ue_release_response_t *pNfapiMsg = (nfapi_ue_release_response_t *)msg; + + if(pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) == 0) { + return 0; + } else { + NFAPI_TRACE(NFAPI_TRACE_INFO, "ue_release_response:error_code = %d\n", pNfapiMsg->error_code); + } + + return 1; +} + +static uint8_t unpack_nrach_indication_body_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { + nfapi_nrach_indication_body_t *value = (nfapi_nrach_indication_body_t *)tlv; + uint8_t *nrachBodyEnd = *ppReadPackedMsg + value->tl.length; + + if(nrachBodyEnd > end) + return 0; + + if(pull8(ppReadPackedMsg, &value->number_of_initial_scs_detected, end) == 0) + return 0; + + if(value->number_of_initial_scs_detected > NFAPI_PREAMBLE_MAX_PDU) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of detected scs ind pdus exceed maxium (count:%d max:%d)\n", __FUNCTION__, value->number_of_initial_scs_detected, NFAPI_PREAMBLE_MAX_PDU); + return 0; + } + + value->nrach_pdu_list = (nfapi_nrach_indication_pdu_t *)nfapi_p7_allocate(sizeof(nfapi_nrach_indication_pdu_t) * value->number_of_initial_scs_detected, config); + + if(value->nrach_pdu_list == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate nrach ind pdu list (count:%d)\n", __FUNCTION__, value->number_of_initial_scs_detected); + return 0; + } + + uint8_t i = 0; + + for(i = 0; i < value->number_of_initial_scs_detected; ++i) { + nfapi_nrach_indication_pdu_t *pdu = &(value->nrach_pdu_list[i]); + uint8_t *nrachPduInstanceEnd = *ppReadPackedMsg + 4 + 6; + unpack_tlv_t unpack_fns[] = { + { NFAPI_NRACH_INDICATION_REL13_TAG, &pdu->nrach_indication_rel13, &unpack_nrach_indication_rel13_value}, + }; + + if(unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, nrachPduInstanceEnd, 0, 0) == 0) + return 0; + } + + return 1; +} + +static uint8_t unpack_nrach_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nrach_indication_t *pNfapiMsg = (nfapi_nrach_indication_t *)msg; + unpack_p7_tlv_t unpack_fns[] = { + { NFAPI_NRACH_INDICATION_BODY_TAG, &pNfapiMsg->nrach_indication_body, &unpack_nrach_indication_body_value}, + }; + return (pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) && + unpack_p7_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_nr_dl_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nr_dl_node_sync_t *pNfapiMsg = (nfapi_nr_dl_node_sync_t *)msg; + return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->delta_sfn_slot, end) && + unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_dl_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_dl_node_sync_t *pNfapiMsg = (nfapi_dl_node_sync_t *)msg; + return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->delta_sfn_sf, end) && + unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + + +static uint8_t unpack_nr_ul_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nr_ul_node_sync_t *pNfapiMsg = (nfapi_nr_ul_node_sync_t *)msg; + return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->t2, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->t3, end) && + unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + + +static uint8_t unpack_ul_node_sync(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_ul_node_sync_t *pNfapiMsg = (nfapi_ul_node_sync_t *)msg; + return (pull32(ppReadPackedMsg, &pNfapiMsg->t1, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->t2, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->t3, end) && + unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + +static uint8_t unpack_timing_info(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_timing_info_t *pNfapiMsg = (nfapi_timing_info_t *)msg; + return (pull32(ppReadPackedMsg, &pNfapiMsg->last_sfn_sf, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->time_since_last_timing_info, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->dl_config_jitter, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->tx_request_jitter, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->ul_config_jitter, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_jitter, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->dl_config_latest_delay, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->tx_request_latest_delay, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->ul_config_latest_delay, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_latest_delay, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->dl_config_earliest_arrival, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->tx_request_earliest_arrival, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->ul_config_earliest_arrival, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->hi_dci0_earliest_arrival, end) && + unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + + +static uint8_t unpack_nr_timing_info(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { + nfapi_nr_timing_info_t *pNfapiMsg = (nfapi_nr_timing_info_t *)msg; + return (pull32(ppReadPackedMsg, &pNfapiMsg->last_sfn, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->last_slot, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->time_since_last_timing_info, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->dl_tti_jitter, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->tx_data_request_jitter, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->ul_tti_jitter, end) && + pull32(ppReadPackedMsg, &pNfapiMsg->ul_dci_jitter, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->dl_tti_latest_delay, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->tx_data_request_latest_delay, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->ul_tti_latest_delay, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->ul_dci_latest_delay, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->dl_tti_earliest_arrival, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->tx_data_request_earliest_arrival, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->ul_tti_earliest_arrival, end) && + pulls32(ppReadPackedMsg, &pNfapiMsg->ul_dci_earliest_arrival, end) && + unpack_p7_tlv_list(NULL, 0, ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); +} + + + +// unpack length check + +static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen) { + int retLen = 0; + + switch (msgId) { + case NFAPI_DL_CONFIG_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_dl_config_request_t)) + retLen = sizeof(nfapi_dl_config_request_t); + + break; + + case NFAPI_UL_CONFIG_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_ul_config_request_t)) + retLen = sizeof(nfapi_ul_config_request_t); + + break; + + case NFAPI_SUBFRAME_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_subframe_indication_t)) + retLen = sizeof(nfapi_subframe_indication_t); + + break; + + case NFAPI_HI_DCI0_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_hi_dci0_request_t)) + retLen = sizeof(nfapi_hi_dci0_request_t); + + break; + + case NFAPI_TX_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_tx_request_t)) + retLen = sizeof(nfapi_tx_request_t); + + break; + + case NFAPI_HARQ_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_harq_indication_t)) + retLen = sizeof(nfapi_harq_indication_t); + + break; + + case NFAPI_CRC_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_crc_indication_t)) + retLen = sizeof(nfapi_crc_indication_t); + + break; + + case NFAPI_RX_ULSCH_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_rx_indication_t)) + retLen = sizeof(nfapi_rx_indication_t); + + break; + + case NFAPI_RACH_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_rach_indication_t)) + retLen = sizeof(nfapi_rach_indication_t); + + break; + + case NFAPI_SRS_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_srs_indication_t)) + retLen = sizeof(nfapi_srs_indication_t); + + break; + + case NFAPI_RX_SR_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_sr_indication_t)) + retLen = sizeof(nfapi_sr_indication_t); + + break; + + case NFAPI_RX_CQI_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_cqi_indication_t)) + retLen = sizeof(nfapi_cqi_indication_t); + + break; + + case NFAPI_LBT_DL_CONFIG_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_lbt_dl_config_request_t)) + retLen = sizeof(nfapi_lbt_dl_config_request_t); + + break; + + case NFAPI_LBT_DL_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_lbt_dl_indication_t)) + retLen = sizeof(nfapi_lbt_dl_indication_t); + + break; + + case NFAPI_NB_HARQ_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_nb_harq_indication_t)) + retLen = sizeof(nfapi_nb_harq_indication_t); + + break; + + case NFAPI_NRACH_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_nrach_indication_t)) + retLen = sizeof(nfapi_nrach_indication_t); + + break; + + case NFAPI_DL_NODE_SYNC: + if (unpackedBufLen >= sizeof(nfapi_dl_node_sync_t)) + retLen = sizeof(nfapi_dl_node_sync_t); + + break; + + case NFAPI_UL_NODE_SYNC: + if (unpackedBufLen >= sizeof(nfapi_ul_node_sync_t)) + retLen = sizeof(nfapi_ul_node_sync_t); + + break; + + case NFAPI_TIMING_INFO: + if (unpackedBufLen >= sizeof(nfapi_timing_info_t)) + retLen = sizeof(nfapi_timing_info_t); + + break; + + case NFAPI_UE_RELEASE_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_ue_release_request_t)) + retLen = sizeof(nfapi_ue_release_request_t); + + break; + + case NFAPI_UE_RELEASE_RESPONSE: + if (unpackedBufLen >= sizeof(nfapi_ue_release_response_t)) + retLen = sizeof(nfapi_ue_release_response_t); + + break; + + default: + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown message ID %d\n", msgId); + break; + } + + return retLen; +} + +static int check_nr_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen) +{ + int retLen = 0; + + switch (msgId) + { + case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_nr_dl_tti_request_t)) + retLen = sizeof(nfapi_nr_dl_tti_request_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_nr_ul_tti_request_t)) + retLen = sizeof(nfapi_nr_ul_tti_request_t); + break; + + case NFAPI_SUBFRAME_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_subframe_indication_t)) + retLen = sizeof(nfapi_subframe_indication_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_nr_ul_dci_request_t)) + retLen = sizeof(nfapi_nr_ul_dci_request_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_nr_tx_data_request_t)) + retLen = sizeof(nfapi_nr_tx_data_request_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_nr_rx_data_indication_t)) + retLen = sizeof(nfapi_nr_rx_data_indication_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_nr_crc_indication_t)) + retLen = sizeof(nfapi_nr_crc_indication_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_nr_rach_indication_t)) + retLen = sizeof(nfapi_nr_rach_indication_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_nr_uci_indication_t)) + retLen = sizeof(nfapi_nr_uci_indication_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: + if (unpackedBufLen >= sizeof(nfapi_nr_srs_indication_t)) + retLen = sizeof(nfapi_nr_srs_indication_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC: + if (unpackedBufLen >= sizeof(nfapi_nr_dl_node_sync_t)) + retLen = sizeof(nfapi_nr_dl_node_sync_t); + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_NODE_SYNC: + if (unpackedBufLen >= sizeof(nfapi_nr_ul_node_sync_t)) + retLen = sizeof(nfapi_nr_ul_node_sync_t); + break; + + case NFAPI_TIMING_INFO: + if (unpackedBufLen >= sizeof(nfapi_timing_info_t)) + retLen = sizeof(nfapi_timing_info_t); + break; + + case NFAPI_UE_RELEASE_REQUEST: + if (unpackedBufLen >= sizeof(nfapi_ue_release_request_t)) + retLen = sizeof(nfapi_ue_release_request_t); + break; + + case NFAPI_UE_RELEASE_RESPONSE: + if (unpackedBufLen >= sizeof(nfapi_ue_release_response_t)) + retLen = sizeof(nfapi_ue_release_response_t); + break; + + default: + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown message ID %d\n", msgId); + break; + } + + return retLen; +} + + + +// Main unpack functions - public + +int nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { + nfapi_p7_message_header_t *pMessageHeader = pUnpackedBuf; + uint8_t *pReadPackedMessage = pMessageBuf; + uint8_t *end = pMessageBuf + messageBufLen; + + if (pMessageBuf == NULL || pUnpackedBuf == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 header unpack supplied pointers are null\n"); + return -1; + } + + if (messageBufLen < NFAPI_P7_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p7_message_header_t)) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 header unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen); + return -1; + } + + // process the header + if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) && + pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) && + pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) && + pull16(&pReadPackedMessage, &pMessageHeader->m_segment_sequence, end) && + pull32(&pReadPackedMessage, &pMessageHeader->checksum, end) && + pull32(&pReadPackedMessage, &pMessageHeader->transmit_timestamp, end))) + return -1; + + return 0; +} + +int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { + int result = 0; + nfapi_p7_message_header_t *pMessageHeader = (nfapi_p7_message_header_t *)pUnpackedBuf; + uint8_t *pReadPackedMessage = pMessageBuf; + uint8_t *end = pMessageBuf + messageBufLen; + + if (pMessageBuf == NULL || pUnpackedBuf == NULL) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied pointers are null\n"); + return -1; + } + + if (messageBufLen < NFAPI_P7_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p7_message_header_t)) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen); + return -1; + } + + /* + uint8_t *ptr = pMessageBuf; + printf("\n Read P7 message unpack: "); + while(ptr < end){ + printf(" %d ", *ptr); + ptr++; + } + printf("\n"); + */ + // clean the supplied buffer for - tag value blanking + (void)memset(pUnpackedBuf, 0, unpackedBufLen); + + // process the header + if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) && + pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) && + pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) && + pull16(&pReadPackedMessage, &pMessageHeader->m_segment_sequence, end) && + pull32(&pReadPackedMessage, &pMessageHeader->checksum, end) && + pull32(&pReadPackedMessage, &pMessageHeader->transmit_timestamp, end))) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack header failed\n"); + return -1; + } + + if((uint8_t *)(pMessageBuf + pMessageHeader->message_length) > end) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack message length is greater than the message buffer \n"); + return -1; + } + + /* + if(check_unpack_length(pMessageHeader->message_id, unpackedBufLen) == 0) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack unpack buffer is not large enough \n"); + return -1; + } + */ + + // look for the specific message + switch (pMessageHeader->message_id) { + case NFAPI_DL_CONFIG_REQUEST: + if (check_unpack_length(NFAPI_DL_CONFIG_REQUEST, unpackedBufLen)) + result = unpack_dl_config_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_UL_CONFIG_REQUEST: + if (check_unpack_length(NFAPI_UL_CONFIG_REQUEST, unpackedBufLen)) + result = unpack_ul_config_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_TX_REQUEST: + if (check_unpack_length(NFAPI_TX_REQUEST, unpackedBufLen)) + result = unpack_tx_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_HI_DCI0_REQUEST: + if (check_unpack_length(NFAPI_HI_DCI0_REQUEST, unpackedBufLen)) + result = unpack_hi_dci0_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_UE_RELEASE_REQUEST: + if (check_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen)) + result = unpack_ue_release_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_HARQ_INDICATION: + if (check_unpack_length(NFAPI_HARQ_INDICATION, unpackedBufLen)) + result = unpack_harq_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_CRC_INDICATION: + if (check_unpack_length(NFAPI_CRC_INDICATION, unpackedBufLen)) + result = unpack_crc_indication(&pReadPackedMessage,end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_RX_ULSCH_INDICATION: + if (check_unpack_length(NFAPI_RX_ULSCH_INDICATION, unpackedBufLen)) + result = unpack_rx_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_RACH_INDICATION: + if (check_unpack_length(NFAPI_RACH_INDICATION, unpackedBufLen)) + result = unpack_rach_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_SRS_INDICATION: + if (check_unpack_length(NFAPI_SRS_INDICATION, unpackedBufLen)) + result = unpack_srs_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_RX_SR_INDICATION: + if (check_unpack_length(NFAPI_RX_SR_INDICATION, unpackedBufLen)) + result = unpack_sr_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_RX_CQI_INDICATION: + if (check_unpack_length(NFAPI_RX_CQI_INDICATION, unpackedBufLen)) + result = unpack_cqi_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_LBT_DL_CONFIG_REQUEST: + if (check_unpack_length(NFAPI_LBT_DL_CONFIG_REQUEST, unpackedBufLen)) + result = unpack_lbt_dl_config_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_LBT_DL_INDICATION: + if (check_unpack_length(NFAPI_LBT_DL_INDICATION, unpackedBufLen)) + result = unpack_lbt_dl_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_NB_HARQ_INDICATION: + if (check_unpack_length(NFAPI_NB_HARQ_INDICATION, unpackedBufLen)) + result = unpack_nb_harq_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_NRACH_INDICATION: + if (check_unpack_length(NFAPI_NRACH_INDICATION, unpackedBufLen)) + result = unpack_nrach_indication(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_DL_NODE_SYNC: + if (check_unpack_length(NFAPI_DL_NODE_SYNC, unpackedBufLen)) + result = unpack_dl_node_sync(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_UL_NODE_SYNC: + if (check_unpack_length(NFAPI_UL_NODE_SYNC, unpackedBufLen)) + result = unpack_ul_node_sync(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_TIMING_INFO: + if (check_unpack_length(NFAPI_TIMING_INFO, unpackedBufLen)) + result = unpack_timing_info(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + case NFAPI_UE_RELEASE_RESPONSE: + if (check_unpack_length(NFAPI_UE_RELEASE_RESPONSE, unpackedBufLen)) + result = unpack_ue_release_resp(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + + break; + + default: + if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && + pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX) { + if(config && config->unpack_p7_vendor_extension) { + result = (config->unpack_p7_vendor_extension)(pMessageHeader, &pReadPackedMessage, end, config); + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve decoder provided\n", __FUNCTION__, pMessageHeader->message_id); + } + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id); + } + + break; + } + + if(result == 0) + return -1; + else + return 0; +} + +int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config) +{ + int result = 0; + nfapi_p7_message_header_t *pMessageHeader = (nfapi_p7_message_header_t*)pUnpackedBuf; + uint8_t *pReadPackedMessage = pMessageBuf; + uint8_t *end = pMessageBuf + messageBufLen; + + if (pMessageBuf == NULL || pUnpackedBuf == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied pointers are null\n"); + return -1; + } + + if (messageBufLen < NFAPI_P7_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p7_message_header_t)) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen); + return -1; + } + + // uint8_t *ptr = pMessageBuf; + // printf("\n Read P7 message unpack: "); + // while(ptr < end){ + // printf(" %d ", *ptr); + // ptr++; + // } + // printf("\n"); + + // clean the supplied buffer for - tag value blanking + (void)memset(pUnpackedBuf, 0, unpackedBufLen); + + // process the header + if(!(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end) && + pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) && + pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) && + pull16(&pReadPackedMessage, &pMessageHeader->m_segment_sequence, end) && + pull32(&pReadPackedMessage, &pMessageHeader->checksum, end) && + pull32(&pReadPackedMessage, &pMessageHeader->transmit_timestamp, end))) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack header failed\n"); + return -1; + } + + if((uint8_t*)(pMessageBuf + pMessageHeader->message_length) > end) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack message length is greater than the message buffer \n"); + return -1; + } + + /* + if(check_unpack_length(pMessageHeader->message_id, unpackedBufLen) == 0) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "P7 unpack unpack buffer is not large enough \n"); + return -1; + } + */ + + // look for the specific message + switch (pMessageHeader->message_id) + { + case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST, unpackedBufLen)) + result = unpack_dl_tti_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST, unpackedBufLen)) + result = unpack_ul_tti_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + break; + case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST, unpackedBufLen)) + result = unpack_tx_data_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + break; + case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST, unpackedBufLen)) + result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + break; + + case NFAPI_UE_RELEASE_REQUEST: + if (check_nr_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen)) + result = unpack_ue_release_request(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + break; + case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION, unpackedBufLen)){ + nfapi_nr_slot_indication_scf_t* msg = (nfapi_nr_slot_indication_scf_t*) pMessageHeader; + result = unpack_nr_slot_indication(&pReadPackedMessage, end, msg, config); + } + else + return -1; + break; + + case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION, unpackedBufLen)){ + nfapi_nr_rx_data_indication_t* msg = (nfapi_nr_rx_data_indication_t*) pMessageHeader; + msg->pdu_list = (nfapi_nr_rx_data_pdu_t*) malloc(sizeof(nfapi_nr_rx_data_pdu_t)); + msg->pdu_list->pdu = (uint8_t *) malloc(sizeof(uint8_t)); + result = unpack_nr_rx_data_indication(&pReadPackedMessage, end, msg, config); + } + else + return -1; + break; + + case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION, unpackedBufLen)){ + + nfapi_nr_crc_indication_t* msg = (nfapi_nr_crc_indication_t*) pMessageHeader; + msg->crc_list = (nfapi_nr_crc_t*) malloc(sizeof(nfapi_nr_crc_t)); + result = unpack_nr_crc_indication(&pReadPackedMessage,end , msg, config); + } + else + return -1; + break; + + case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION, unpackedBufLen)){ + nfapi_nr_uci_indication_t* msg = (nfapi_nr_uci_indication_t*) pMessageHeader; + msg->uci_list = (nfapi_nr_uci_t*) malloc(sizeof(nfapi_nr_uci_t)); + result = unpack_nr_uci_indication(&pReadPackedMessage, end, msg, config); + } + else + return -1; + break; + + case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION, unpackedBufLen)){ + nfapi_nr_srs_indication_t* msg = (nfapi_nr_srs_indication_t*) pMessageHeader; + msg->pdu_list = (nfapi_nr_srs_indication_pdu_t*) malloc(sizeof(nfapi_nr_srs_indication_pdu_t)); + result = unpack_nr_srs_indication(&pReadPackedMessage, end, msg, config); + } + else + return -1; + break; + + case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION, unpackedBufLen)){ + nfapi_nr_rach_indication_t* msg = (nfapi_nr_rach_indication_t*) pMessageHeader; + result = unpack_nr_rach_indication(&pReadPackedMessage, end, msg, config); + } + else + return -1; + break; + + case NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_DL_NODE_SYNC, unpackedBufLen)) + result = unpack_nr_dl_node_sync(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + break; + + case NFAPI_NR_PHY_MSG_TYPE_UL_NODE_SYNC: + if (check_nr_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_NODE_SYNC, unpackedBufLen)) + result = unpack_nr_ul_node_sync(&pReadPackedMessage, end , pMessageHeader, config); + else + return -1; + break; + + case NFAPI_TIMING_INFO: + if (check_nr_unpack_length(NFAPI_TIMING_INFO, unpackedBufLen)) + result = unpack_nr_timing_info(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + break; + + case NFAPI_UE_RELEASE_RESPONSE: + if (check_nr_unpack_length(NFAPI_UE_RELEASE_RESPONSE, unpackedBufLen)) + result = unpack_ue_release_resp(&pReadPackedMessage, end, pMessageHeader, config); + else + return -1; + break; + + default: + + if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && + pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX) + { + if(config && config->unpack_p7_vendor_extension) + { + result = (config->unpack_p7_vendor_extension)(pMessageHeader, &pReadPackedMessage, end, config); + } + else + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve decoder provided\n", __FUNCTION__, pMessageHeader->message_id); + } + } + else + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, pMessageHeader->message_id); + } + break; + } + + if(result == 0) + return -1; + else + return 0; +} + + From 03393ddc898615c5ef297a4162ced12a570a41f2 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 25 Nov 2021 11:01:54 +0000 Subject: [PATCH 134/883] Minor fixes for multiple antennas scenario --- openair1/PHY/INIT/nr_init.c | 5 +-- openair1/PHY/INIT/nr_init_ue.c | 7 ++-- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 2 +- openair1/PHY/NR_TRANSPORT/srs_rx.c | 33 +++++++++++-------- openair1/PHY/defs_nr_common.h | 2 +- 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 5356888f44..da6c656085 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -196,8 +196,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value); gNB->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); - gNB->nr_srs_info->srs_generated_signal = (int32_t*)malloc16_clear(NR_NB_SC_PER_RB*NR_MAX_NB_RB*sizeof(int32_t)); - gNB->nr_srs_info->srs_received_signal = (int32_t*)malloc16_clear(NR_NB_SC_PER_RB*NR_MAX_NB_RB*sizeof(int32_t)); + gNB->nr_srs_info->srs_generated_signal = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); generate_ul_reference_signal_sequences(SHRT_MAX); @@ -213,6 +212,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, common_vars->txdataF = (int32_t **)malloc16(Ptx*sizeof(int32_t*)); common_vars->rxdataF = (int32_t **)malloc16(Prx*sizeof(int32_t*)); common_vars->beam_id = (uint8_t **)malloc16(Ptx*sizeof(uint8_t*)); + gNB->nr_srs_info->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;itxdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); // [hna] samples_per_frame without CP @@ -225,6 +225,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, for (i=0;irxdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); common_vars->rxdata[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); } common_vars->debugBuff = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)*100); common_vars->debugBuff_sample_offset = 0; diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 66b0ab3646..3c9f90d121 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -324,8 +324,11 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, srs_vars[gNB_id]->active = false; ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); - ue->nr_srs_info->srs_generated_signal = (int32_t*)malloc16_clear(NR_NB_SC_PER_RB*NR_MAX_NB_RB*sizeof(int32_t)); - ue->nr_srs_info->srs_received_signal = (int32_t*)malloc16_clear(NR_NB_SC_PER_RB*NR_MAX_NB_RB*sizeof(int32_t)); + ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + for (i=0; inb_antennas_rx; i++) { + ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + } if (abstraction_flag == 0) { for (th_id=0; th_idn_symbs==0) { - LOG_E(NR_PHY, "nr_srs_info was not generated yet!\n"); + LOG_E(NR_PHY, "(%d.%d) nr_srs_info was not generated yet!\n", frame, slot); return -1; } @@ -109,19 +109,24 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, int32_t *rx_signal; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { + + memset(srs_received_signal[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); rx_signal = &rxdataF[ant][symbol_offset + frame_parms->first_carrier_offset]; for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { - srs_received_signal[nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset] = rx_signal[nr_srs_info->subcarrier_idx[sc_idx]]; + srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset] = rx_signal[nr_srs_info->subcarrier_idx[sc_idx]]; #ifdef SRS_DEBUG - if(nr_srs_info->subcarrier_idx[sc_idx]%12 == 0) { - LOG_I(NR_PHY,"::::::::::::: %i :::::::::::::\n", nr_srs_info->subcarrier_idx[sc_idx]/12); - } - LOG_I(NR_PHY,"(%i) \t%i\t%i\n", - nr_srs_info->subcarrier_idx[sc_idx], - srs_received_signal[nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset]&0xFFFF, - (srs_received_signal[nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset]>>16)&0xFFFF); + if(sc_idx == 0) { + LOG_I(NR_PHY,"________ Rx antenna %i ________\n", ant); + } + if(nr_srs_info->subcarrier_idx[sc_idx]%12 == 0) { + LOG_I(NR_PHY,"::::::::::::: %i :::::::::::::\n", nr_srs_info->subcarrier_idx[sc_idx]/12); + } + LOG_I(NR_PHY,"(%i) \t%i\t%i\n", + nr_srs_info->subcarrier_idx[sc_idx], + srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset]&0xFFFF, + (srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset]>>16)&0xFFFF); #endif } } diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 85902403b8..2eb05a145e 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -244,7 +244,7 @@ typedef struct { uint16_t n_symbs; uint16_t subcarrier_idx[6*NR_MAX_NB_RB]; int32_t *srs_generated_signal; - int32_t *srs_received_signal; + int32_t **srs_received_signal; } nr_srs_info_t; typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS; From 6847a1969b9e0774a0ac197314e3a25241f0fef7 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 25 Nov 2021 11:54:05 +0000 Subject: [PATCH 135/883] Fix build warning --- openair2/X2AP/x2ap_eNB_handler.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openair2/X2AP/x2ap_eNB_handler.c b/openair2/X2AP/x2ap_eNB_handler.c index d44f36e186..f71229f066 100644 --- a/openair2/X2AP/x2ap_eNB_handler.c +++ b/openair2/X2AP/x2ap_eNB_handler.c @@ -512,8 +512,8 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance, return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data); } -const char *X2AP_cause_str1[4]={"radioNetwork","transport","protocol","misc"}; -const char *X2AP_case_str_radio[50]={" X2AP_CauseRadioNetwork_handover_desirable_for_radio_reasons", +const char *X2AP_ResetRequest_str[2]={"X2AP_ResetRequest_IEs__value_PR_Cause","X2AP_ResetRequest_IEs__value_PR_InterfaceInstanceIndication"}; +const char *X2AP_case_str_radio[50]={"X2AP_CauseRadioNetwork_handover_desirable_for_radio_reasons", "X2AP_CauseRadioNetwork_time_critical_handover", "X2AP_CauseRadioNetwork_resource_optimisation_handover", "X2AP_CauseRadioNetwork_reduce_load_in_serving_cell", @@ -617,8 +617,9 @@ x2ap_eNB_handle_x2_reset_request(instance_t instance, X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__); return -1; } else { - AssertFatal(ie->value.present <= X2AP_Cause_PR_misc && ie->value.present > 0,"Cause value %d, is impossible\n",ie->value.present); - LOG_I(X2AP,"Received X2AP Reset Request with Cause Type %s\n",X2AP_cause_str1[ie->value.present-1]); + AssertFatal(ie->value.present <= X2AP_ResetRequest_IEs__value_PR_InterfaceInstanceIndication && ie->value.present > 0, + "Cause value %d, is impossible\n",ie->value.present); + LOG_I(X2AP,"Received X2AP Reset Request with Cause Type %s\n",X2AP_ResetRequest_str[ie->value.present-1]); } X2AP_DEBUG("Adding eNB to the list of associated eNBs\n"); From 32593036904c96cfd2df923de3c31c55db5062b9 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 26 Nov 2021 18:03:56 +0000 Subject: [PATCH 136/883] Add gNB support for multiple UEs for SRS on PHY --- openair1/PHY/INIT/nr_init.c | 12 ++++++++---- openair1/PHY/NR_TRANSPORT/nr_transport_proto.h | 5 +++++ openair1/PHY/NR_TRANSPORT/srs_rx.c | 2 +- openair1/PHY/defs_gNB.h | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 6 +++--- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index da6c656085..929e1c050f 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -195,8 +195,14 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value); - gNB->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); - gNB->nr_srs_info->srs_generated_signal = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + for (int id=0; idnr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); + gNB->nr_srs_info[id]->srs_generated_signal = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*)); + for (i=0;inr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + } + } generate_ul_reference_signal_sequences(SHRT_MAX); @@ -212,7 +218,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, common_vars->txdataF = (int32_t **)malloc16(Ptx*sizeof(int32_t*)); common_vars->rxdataF = (int32_t **)malloc16(Prx*sizeof(int32_t*)); common_vars->beam_id = (uint8_t **)malloc16(Ptx*sizeof(uint8_t*)); - gNB->nr_srs_info->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;itxdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); // [hna] samples_per_frame without CP @@ -225,7 +230,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, for (i=0;irxdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); common_vars->rxdata[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); } common_vars->debugBuff = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)*100); common_vars->debugBuff_sample_offset = 0; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 2b528e5ddf..06ccc70d77 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -312,6 +312,11 @@ int nr_find_pucch(uint16_t rnti, NR_gNB_SRS_t *new_gNB_srs(void); +int nr_find_srs(uint16_t rnti, + int frame, + int slot, + PHY_VARS_gNB *gNB); + void nr_fill_srs(PHY_VARS_gNB *gNB, int frame, int slot, diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index 8cacd5018c..684e4b5caf 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -59,7 +59,7 @@ int nr_find_srs(uint16_t rnti, for (int i=0; isrs[i]!=NULL,"gNB->srs[%d] is null\n",i); - if ((gNB->srs[i]->active >0) && + if ((gNB->srs[i]->active>0) && (gNB->srs[i]->srs_pdu.rnti==rnti) && (gNB->srs[i]->frame==frame) && (gNB->srs[i]->slot==slot)) return(i); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 170011c507..d25d7d33b9 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -795,7 +795,7 @@ typedef struct PHY_VARS_gNB_s { t_nrPolar_params *uci_polarParams; /// SRS variables - nr_srs_info_t *nr_srs_info; + nr_srs_info_t *nr_srs_info[NUMBER_OF_NR_SRS_MAX]; uint8_t pbch_configured; char gNB_generate_rar; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index e07b1c6069..d56318ef16 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -799,11 +799,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu; // At least currently, the configuration is constant, so it is enough to generate the sequence just once. - if(gNB->nr_srs_info->n_symbs==0) { - generate_srs_nr(srs_pdu, &gNB->frame_parms, gNB->nr_srs_info->srs_generated_signal, gNB->nr_srs_info, AMP, frame_rx, slot_rx); + if(gNB->nr_srs_info[i]->n_symbs==0) { + generate_srs_nr(srs_pdu, &gNB->frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx); } - nr_get_srs_signal(gNB,frame_rx,slot_rx,srs_pdu, gNB->nr_srs_info, gNB->nr_srs_info->srs_received_signal); + nr_get_srs_signal(gNB,frame_rx,slot_rx,srs_pdu, gNB->nr_srs_info[i], gNB->nr_srs_info[i]->srs_received_signal); srs->active = 0; } } From a9d474193b29ee60ef234a7b8ba49be9640f0cc8 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 26 Nov 2021 18:28:35 +0000 Subject: [PATCH 137/883] Fix BWP start in SRS --- openair1/PHY/NR_TRANSPORT/srs_rx.c | 10 ++++++---- openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 16 +++++++++------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index 684e4b5caf..7178b63ea1 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -107,14 +107,16 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, uint8_t l0 = frame_parms->symbols_per_slot - 1 - srs_pdu->time_start_position; // starting symbol in this slot uint64_t symbol_offset = (n_symbols+l0)*frame_parms->ofdm_symbol_size; + uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; + int32_t *rx_signal; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { memset(srs_received_signal[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - rx_signal = &rxdataF[ant][symbol_offset + frame_parms->first_carrier_offset]; + rx_signal = &rxdataF[ant][symbol_offset + subcarrier_offset]; for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { - srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset] = rx_signal[nr_srs_info->subcarrier_idx[sc_idx]]; + srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset] = rx_signal[nr_srs_info->subcarrier_idx[sc_idx]]; #ifdef SRS_DEBUG if(sc_idx == 0) { @@ -125,8 +127,8 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, } LOG_I(NR_PHY,"(%i) \t%i\t%i\n", nr_srs_info->subcarrier_idx[sc_idx], - srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset]&0xFFFF, - (srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + frame_parms->first_carrier_offset]>>16)&0xFFFF); + srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF, + (srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]>>16)&0xFFFF); #endif } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index 9d74795937..0a3090513f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -116,6 +116,8 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, uint8_t l0 = N_SYMB_SLOT - 1 - l_offset; // starting position in the time domain uint8_t k_0_p; // frequency domain starting position + uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_config_pdu->bwp_start*N_SC_RB; + if(nr_srs_info) { nr_srs_info->n_symbs = 0; } @@ -324,7 +326,7 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, k_0_p += K_TC * M_sc_b_SRS * n_b[b]; } - subcarrier = (frame_parms->first_carrier_offset) + k_0_p; + subcarrier = subcarrier_offset + k_0_p; if (subcarrier>frame_parms->ofdm_symbol_size) { subcarrier -= frame_parms->ofdm_symbol_size; } @@ -373,17 +375,17 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, txptr[subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000); if(nr_srs_info) { - nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs] = subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset; + nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs] = subcarrier + ofdm_symbol*frame_parms->ofdm_symbol_size - subcarrier_offset; nr_srs_info->n_symbs++; } #ifdef SRS_DEBUG - if( (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset)%12 == 0 ) { - LOG_I(NR_PHY,"------------ %i ------------\n", - (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset)/12); + if( (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-subcarrier_offset)%12 == 0 ) { + LOG_I(NR_PHY,"------------ %lu ------------\n", + (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-subcarrier_offset)/12); } - LOG_I(NR_PHY,"(%i) \t%i\t%i\n", - subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-frame_parms->first_carrier_offset, + LOG_I(NR_PHY,"(%lu) \t%i\t%i\n", + subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-subcarrier_offset, real_amp&0xFFFF, imag_amp&0xFFFF); #endif From fff34778118521cd0b23725a019af4d594946b03 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Sun, 28 Nov 2021 01:18:44 +0000 Subject: [PATCH 138/883] Fix SRS mapping at UE --- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index 0a3090513f..32a09549c8 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -101,20 +101,20 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, uint8_t C_SRS = srs_config_pdu->config_index; uint8_t b_hop = srs_config_pdu->frequency_hopping; uint8_t K_TC = 2<comb_size; - uint8_t K_TC_overbar = srs_config_pdu->comb_offset; // FFS_TODO_NR is this parameter for K_TC_overbar ?? + uint8_t K_TC_overbar = srs_config_pdu->comb_offset; // FFS_TODO_NR is this parameter for K_TC_overbar ?? uint8_t n_SRS_cs = srs_config_pdu->cyclic_shift; uint8_t n_ID_SRS = srs_config_pdu->sequence_id; - uint8_t n_shift = srs_config_pdu->frequency_position; // it adjusts the SRS allocation to align with the common resource block grid in multiples of four + uint8_t n_shift = srs_config_pdu->frequency_position; // it adjusts the SRS allocation to align with the common resource block grid in multiples of four uint8_t n_RRC = srs_config_pdu->frequency_shift; uint8_t groupOrSequenceHopping = srs_config_pdu->group_or_sequence_hopping; uint8_t l_offset = srs_config_pdu->time_start_position; uint16_t T_SRS = srs_config_pdu->t_srs; - uint16_t T_offset = srs_config_pdu->t_offset; // FFS_TODO_NR to check interface with RRC + uint16_t T_offset = srs_config_pdu->t_offset; // FFS_TODO_NR to check interface with RRC uint8_t R = 1<num_repetitions; - uint8_t N_ap = 1<num_ant_ports; // antenna port for transmission - uint8_t N_symb_SRS = 1<num_symbols; // consecutive OFDM symbols - uint8_t l0 = N_SYMB_SLOT - 1 - l_offset; // starting position in the time domain - uint8_t k_0_p; // frequency domain starting position + uint8_t N_ap = 1<num_ant_ports; // antenna port for transmission + uint8_t N_symb_SRS = 1<num_symbols; // consecutive OFDM symbols + uint8_t l0 = frame_parms->symbols_per_slot - 1 - l_offset; // starting position in the time domain + uint8_t k_0_p; // frequency domain starting position uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_config_pdu->bwp_start*N_SC_RB; @@ -457,13 +457,10 @@ int ue_srs_procedures_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gN #endif NR_DL_FRAME_PARMS *frame_parms = &(ue->frame_parms); - - int16_t txptr = AMP; - uint16_t nsymb = (ue->frame_parms.Ncp==0) ? 14:12; - uint16_t symbol_offset = (int)ue->frame_parms.ofdm_symbol_size*((proc->nr_slot_tx*nsymb)+(nsymb-1)); + uint16_t symbol_offset = (frame_parms->symbols_per_slot - 1 - srs_config_pdu->time_start_position)*frame_parms->ofdm_symbol_size; if (generate_srs_nr(srs_config_pdu, frame_parms, &ue->common_vars.txdataF[gNB_id][symbol_offset], ue->nr_srs_info, - txptr, proc->frame_tx, proc->nr_slot_tx) == 0) { + AMP, proc->frame_tx, proc->nr_slot_tx) == 0) { return 0; } else { return -1; From ed38681ab5ed48c75b6097a166794f2a930f548c Mon Sep 17 00:00:00 2001 From: rmagueta Date: Sun, 28 Nov 2021 02:00:53 +0000 Subject: [PATCH 139/883] gNB schedules different SRS resources for different UEs --- openair2/RRC/NR/L2_nr_interface.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 18 +++++++++++++----- openair2/RRC/NR/MESSAGES/asn1_msg.h | 10 ++++++---- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index 9cef23a6c5..260516e59e 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -325,7 +325,7 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, NR_ServingCellConfigCommon_t *scc=RC.nrrrc[module_idP]->carrier.servingcellconfigcommon; uint8_t sdu2[100]; memset(&cellGroupConfig,0,sizeof(cellGroupConfig)); - fill_initial_cellGroupConfig(rntiP,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier); + fill_initial_cellGroupConfig(rntiP,-1,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier); asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)&cellGroupConfig, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index dbdf5b8097..3f64f4209b 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1014,9 +1014,16 @@ long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS) { } void fill_initial_SpCellConfig(rnti_t rnti, + int uid, NR_SpCellConfig_t *SpCellConfig, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier) { + + // This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4. + // However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources, + // where the startPosition = 1, 2 or 3 and sl40 = 7, 17, 27 or 37 only give us 12 different allocations. + AssertFatal(uid>=0 && uid<12, "gNB cannot allocate the SRS resources\n"); + int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE); SpCellConfig->servCellIndex = NULL; SpCellConfig->reconfigurationWithSync = NULL; @@ -1095,7 +1102,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList = calloc(1,sizeof(*pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList)); NR_PUSCH_PathlossReferenceRS_t *plrefRS = calloc(1,sizeof(*plrefRS)); plrefRS->pusch_PathlossReferenceRS_Id=0; - plrefRS->referenceSignal.present = NR_PathlossReferenceRS_Config_PR_ssb_Index; + plrefRS->referenceSignal.present = NR_PUSCH_PathlossReferenceRS__referenceSignal_PR_ssb_Index; plrefRS->referenceSignal.choice.ssb_Index = 0; ASN_SEQUENCE_ADD(&pusch_Config->pusch_PowerControl->pathlossReferenceRSToAddModList->list,plrefRS); pusch_Config->pusch_PowerControl->pathlossReferenceRSToReleaseList = NULL; @@ -1175,7 +1182,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_res0->transmissionComb.choice.n2=calloc(1,sizeof(*srs_res0->transmissionComb.choice.n2)); srs_res0->transmissionComb.choice.n2->combOffset_n2=0; srs_res0->transmissionComb.choice.n2->cyclicShift_n2=0; - srs_res0->resourceMapping.startPosition=2; + srs_res0->resourceMapping.startPosition = 1 + uid%3; srs_res0->resourceMapping.nrofSymbols=NR_SRS_Resource__resourceMapping__nrofSymbols_n1; srs_res0->resourceMapping.repetitionFactor=NR_SRS_Resource__resourceMapping__repetitionFactor_n1; srs_res0->freqDomainPosition=0; @@ -1194,7 +1201,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; - srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 9; // 9 is an uplink slot + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 7 + (uid/3)*10; // 7/17/27/37 are mixed slots } srs_res0->sequenceId=40; @@ -1455,6 +1462,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr } void fill_initial_cellGroupConfig(rnti_t rnti, + int uid, NR_CellGroupConfig_t *cellGroupConfig, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier) { @@ -1548,7 +1556,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti, cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig)); - fill_initial_SpCellConfig(rnti,cellGroupConfig->spCellConfig,scc,carrier); + fill_initial_SpCellConfig(rnti,uid,cellGroupConfig->spCellConfig,scc,carrier); cellGroupConfig->sCellToAddModList = NULL; cellGroupConfig->sCellToReleaseList = NULL; @@ -1627,7 +1635,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, } else { cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); - fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,cellGroupConfig,scc,carrier); + fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,ue_context_pP->local_uid,cellGroupConfig,scc,carrier); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 7b38de2bb9..1b34d7ba59 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -90,13 +90,15 @@ uint8_t do_RRCReject(uint8_t Mod_id, uint8_t *const buffer); void fill_initial_SpCellConfig(rnti_t rnti, - NR_SpCellConfig_t *SpCellConfig, - NR_ServingCellConfigCommon_t *scc, + int uid, + NR_SpCellConfig_t *SpCellConfig, + NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); void fill_initial_cellGroupConfig(rnti_t rnti, - NR_CellGroupConfig_t *cellGroupConfig, - NR_ServingCellConfigCommon_t *scc, + int uid, + NR_CellGroupConfig_t *cellGroupConfig, + NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); From 90fb3282f92835d5d78fa00bc847e05a5262bf6e Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 28 Nov 2021 14:50:09 +0100 Subject: [PATCH 140/883] fix in dmrs config type at ue --- openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c | 6 +----- openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 1 + openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 30eae2d30f..7281f8e290 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -642,6 +642,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, unsigned short p, unsigned char symbol, unsigned short BWPStart, + uint8_t config_type, unsigned short bwp_start_subcarrier, unsigned short nb_rb_pdsch) { @@ -653,10 +654,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, int16_t *fl=NULL,*fm=NULL,*fr=NULL,*fml=NULL,*fmr=NULL,*fmm=NULL,*fdcl=NULL,*fdcr=NULL,*fdclh=NULL,*fdcrh=NULL, *frl=NULL, *frr=NULL; int ch_offset,symbol_offset; - NR_UE_DLSCH_t **dlsch = ue->dlsch[proc->thread_id][gNB_id]; - const unsigned char harq_pid = dlsch[0]->current_harq_pid; - NR_DL_UE_HARQ_t *dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - uint8_t nushift; int **dl_ch_estimates =ue->pdsch_vars[proc->thread_id][gNB_id]->dl_ch_estimates; int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; @@ -678,7 +675,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, if (is_SI) { rb_offset -= BWPStart; } - uint8_t config_type = dlsch0_harq->dmrsConfigType; int8_t delta = get_delta(p, config_type); // checking if re-initialization of scrambling IDs is needed diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index c5330ce2f2..4dec92143a 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -72,6 +72,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, unsigned short p, unsigned char symbol, unsigned short BWPStart, + uint8_t config_type, unsigned short bwp_start_subcarrier, unsigned short nb_rb_pdsch); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index e1b87185bd..d76bffbb6f 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -782,6 +782,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ aatx /*p*/, m, BWPStart, + dlsch0_harq->dmrsConfigType, ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12, pdsch_nb_rb); LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_slot_rx,m); From 0517b97382dd609e10d51946408d21932e10c653 Mon Sep 17 00:00:00 2001 From: sfn Date: Mon, 2 Aug 2021 15:38:46 +0200 Subject: [PATCH 141/883] Add codebook type I precoding matrices generation function --- executables/nr-gnb.c | 8 +- openair1/PHY/INIT/nr_init.c | 402 ++++++++++++++++++++++++- openair1/PHY/defs_gNB.h | 3 + openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 + openair2/RRC/NR/rrc_gNB_reconfig.c | 46 ++- 5 files changed, 445 insertions(+), 16 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index f83fac2737..e2385c45c0 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -74,7 +74,7 @@ #include "UTIL/OPT/opt.h" #include "enb_config.h" #include "gnb_paramdef.h" - +#include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "s1ap_eNB.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" @@ -497,14 +497,18 @@ void print_opp_meas(void) { void init_eNB_afterRU(void) { int inst,ru_id,i,aa; PHY_VARS_gNB *gNB; + gNB_MAC_INST *mac; LOG_I(PHY,"%s() RC.nb_nr_inst:%d\n", __FUNCTION__, RC.nb_nr_inst); if(NFAPI_MODE == NFAPI_MODE_PNF) RC.nb_nr_inst = 1; for (inst=0; instUL_INFO.module_id]; + phy_init_nr_gNB(gNB,0,0); + mac_init_codebook_gNB(gNB,mac); // map antennas and PRACH signals to gNB RX if (0) AssertFatal(gNB->num_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id); diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index cd4848ea8c..09f37d99fc 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -36,9 +36,10 @@ #include "MBSFN-SubframeConfigList.h"*/ #include "openair1/PHY/defs_RU.h" #include "openair1/PHY/CODING/nrLDPC_extern.h" +#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "assertions.h" #include - +#include #include "PHY/NR_TRANSPORT/nr_ulsch.h" #include "PHY/NR_REFSIG/nr_refsig.h" #include "SCHED_NR/fapi_nr_l1.h" @@ -71,6 +72,405 @@ int l1_north_init_gNB() { return(0); } +int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, + gNB_MAC_INST *mac) { + //get RRC Codebook configuration + struct NR_CSI_ReportConfig *csi_reportconfig = mac->UE_info.CellGroup[0]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.array[0]; + //int rrc_count = mac->UE_info.CellGroup[0]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.count; + + if(csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present==NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) { + int N1=1; + int N2=1; + int O1=0; + int O2=0; + int CSI_RS_antenna_ports=1; + + //Uniform Planner Array: UPA + // X X X X ... X + // X X X X ... X + // N2 . . . . ... . + // X X X X ... X + // |<-----N1---->| + printf("NR Codebook Config: codebookType, type1, subType_PR_typeI_SinglePanel\n"); + struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; + if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { + N1=1; + N2=1; + O1=1; + O2=1; + CSI_RS_antenna_ports=2; + } else if(type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { + //Type 1 Single Panel : Based on 38.214 v15.3-Table 5.2.2.2.1-2: Supported configurations of (N1,N2) and (O1,O2) + switch(type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present) { + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_two_one\n"); + N1=2; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=4; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_two_two_TypeI\n"); + N1=2; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=8; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_four_one\n"); + N1=4; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=8; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_three_two\n"); + N1=3; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=12; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_six_one\n"); + N1=6; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=12; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_four_two\n"); + N1=4; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=16; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_eight_one\n"); + N1=8; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=16; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_four_three\n"); + N1=4; + N2=3; + O1=4; + O2=4; + CSI_RS_antenna_ports=24; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_six_two_\n"); + N1=6; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=24; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_twelve_one\n"); + N1=12; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=24; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_four_four\n"); + N1=4; + N2=4; + O1=4; + O2=4; + CSI_RS_antenna_ports=32; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_eight_two\n"); + N1=8; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=32; + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction: + printf("NR Codebook Config: codebookType, type1, n1_n2_PR_sixteen_one\n"); + N1=16; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=32; + break; + default: + printf("n1 n2 is %d\n",type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present); + N1=1; + N2=1; + O1=1; + O2=1; + CSI_RS_antenna_ports=2; + break; + } + } + + if(csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode==1){ + if (CSI_RS_antenna_ports < 16) { + //Generate DFT vertical beams + //ll: index of a vertical beams vector (represented by i1_1 in TS 38.214) + double complex v[N1*O1][N1]; + for (int ll=0; ll=4) + pmi_size = N1*O1*N2*O2*(4)+N1*O1*N2*O2*N1*O1*N2*O2*2+N1*O1*N2*O2*N1*O1*N2*O2*2+(N1*O1-1)*N2*O2*N1*O1*N2*O2*2+(N2*O2-1)*N1*O1*N2*O2*2+(N1*O1-1)*N2*O2*2+(N2*O2-1)*2+2; + gNB->nr_mimo_precoding_matrix = (int32_t **)malloc16(pmi_size* sizeof(int32_t)); + int32_t **mat = gNB->nr_mimo_precoding_matrix; + + double complex res_code; + + //Table 5.2.2.2.1-5: + //Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + for(int ll=0; ll0) + ((short*) &mat[pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[pmiq][len])[0],((short*) &mat[pmiq][len])[1]); + } + + for(int len=N1*N2; len<2*N1*N2; len++) { + res_code=sqrt(1/(double)CSI_RS_antenna_ports)*theta_n[nn]*v_lm[ll][mm][len-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[pmiq][len])[0],((short*) &mat[pmiq][len])[1]); + + } + } + int llc; + int mmc; + double complex phase_sign; + //Table 5.2.2.2.1-6: + //Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + for(int llb=0; llb0) + ((short*) &mat[pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + + if (cimag(res_code)>0) + ((short*) &mat[pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*2+j_col])[0],((short*) &mat[pmiq][i_rows*2+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*2+j_col])[0],((short*) &mat[pmiq][i_rows*2+j_col])[1]); + } + } + } + //Table 5.2.2.2.1-7: + //Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + if(CSI_RS_antenna_ports>=3) + for(int llb=0; llb0) + ((short*) &mat[pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + + if (cimag(res_code)>0) + ((short*) &mat[pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*3+j_col])[0],((short*) &mat[pmiq][i_rows*3+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*3+j_col])[0],((short*) &mat[pmiq][i_rows*3+j_col])[1]); + } + } + } + //Table 5.2.2.2.1-8: + //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + if(CSI_RS_antenna_ports>=4) + for(int llb=0; llb0) + ((short*) &mat[pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q1else + ((short*) &mat[pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*4+j_col])[0],((short*) &mat[pmiq][i_rows*4+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*4+j_col])[0],((short*) &mat[pmiq][i_rows*4+j_col])[1]); + } + } + } + } + } else {//codebookMode 2 + printf("CodeBook Type 1, CodebookMode %ld is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode); + } + } else { + printf("subType_PR_typeI %d is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); + } + + return (0); +} int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 11b5112a6c..57e841ad40 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -804,6 +804,9 @@ typedef struct PHY_VARS_gNB_s { /// PDSCH DMRS sequence uint32_t ****nr_gold_pdsch_dmrs; + /// PDSCH codebook I precoding LUTs + int32_t **nr_mimo_precoding_matrix; + /// PUSCH DMRS uint32_t ****nr_gold_pusch_dmrs; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 62d70f4f2c..e7715bec14 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -38,6 +38,8 @@ void set_cset_offset(uint16_t); void mac_top_init_gNB(void); +int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, gNB_MAC_INST *mac); + void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 980bd39c37..c4e9389f99 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1189,19 +1189,39 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csirep1->codebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1)); csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present= - NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= - calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two)); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0; - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); - csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03; - csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; + if (dl_antenna_ports <= 2) { + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present= + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= + calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.bits_unused=2; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two->twoTX_CodebookSubsetRestriction.buf[0]=0xfc; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.bits_unused=0; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0]=0x03; + csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; + } else if (dl_antenna_ports < 16) { + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present= + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo= + calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo)); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present= + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction; + /*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.size=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.bits_unused=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.buf[0]=0xc0; //'00000011'B + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->typeI_SinglePanel_codebookSubsetRestriction_i2->size = 1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->typeI_SinglePanel_codebookSubsetRestriction_i2->bits_unused=1; + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->typeI_SinglePanel_codebookSubsetRestriction_i2->buf=malloc(1); + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->typeI_SinglePanel_codebookSubsetRestriction_i2->buf[0]=0xc0;*/ + csirep1->codebookConfig->codebookType.choice.type1->codebookMode=1; + } else {//32 antennas are Not implemented yet + csirep1->codebookConfig->codebookType.choice.type1->codebookMode=2; + } csirep1->dummy = NULL; csirep1->groupBasedBeamReporting.present = NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled; csirep1->groupBasedBeamReporting.choice.disabled=calloc(1,sizeof(*csirep1->groupBasedBeamReporting.choice.disabled)); From e993a59d22c12c3865baf86ff51a60d3356d5f3c Mon Sep 17 00:00:00 2001 From: sfn Date: Mon, 29 Nov 2021 11:15:31 +0100 Subject: [PATCH 142/883] Make use of gNB precoding matrix for PDSCH layer precoding --- openair1/PHY/INIT/nr_init.c | 810 ++++++++++-------- openair1/PHY/MODULATION/nr_modulation.c | 15 + openair1/PHY/MODULATION/nr_modulation.h | 5 + openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 67 +- openair1/PHY/defs_gNB.h | 2 +- openair1/SIMULATION/NR_PHY/dlsim.c | 1 + openair2/RRC/NR/rrc_gNB_reconfig.c | 15 +- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 2 + 8 files changed, 497 insertions(+), 420 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 09f37d99fc..f77526210d 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -76,399 +76,451 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, gNB_MAC_INST *mac) { //get RRC Codebook configuration struct NR_CSI_ReportConfig *csi_reportconfig = mac->UE_info.CellGroup[0]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.array[0]; - //int rrc_count = mac->UE_info.CellGroup[0]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.count; - if(csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present==NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) { - int N1=1; - int N2=1; - int O1=0; - int O2=0; - int CSI_RS_antenna_ports=1; + if(gNB->frame_parms.nb_antennas_tx>1){ + LOG_I(MAC,"NR mac_init_codebook_gNB: codebookType present %d\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); + if(csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present==NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) { + int N1=1; + int N2=1; + int O1=0; + int O2=0; + int CSI_RS_antenna_ports=1; - //Uniform Planner Array: UPA - // X X X X ... X - // X X X X ... X - // N2 . . . . ... . - // X X X X ... X - // |<-----N1---->| - printf("NR Codebook Config: codebookType, type1, subType_PR_typeI_SinglePanel\n"); - struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; - if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { - N1=1; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=2; - } else if(type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { - //Type 1 Single Panel : Based on 38.214 v15.3-Table 5.2.2.2.1-2: Supported configurations of (N1,N2) and (O1,O2) - switch(type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present) { - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_two_one\n"); - N1=2; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=4; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_two_two_TypeI\n"); - N1=2; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=8; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_four_one\n"); - N1=4; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=8; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_three_two\n"); - N1=3; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=12; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_six_one\n"); - N1=6; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=12; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_four_two\n"); - N1=4; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=16; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_eight_one\n"); - N1=8; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=16; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_four_three\n"); - N1=4; - N2=3; - O1=4; - O2=4; - CSI_RS_antenna_ports=24; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_six_two_\n"); - N1=6; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=24; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_twelve_one\n"); - N1=12; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=24; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_four_four\n"); - N1=4; - N2=4; - O1=4; - O2=4; - CSI_RS_antenna_ports=32; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_eight_two\n"); - N1=8; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=32; - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction: - printf("NR Codebook Config: codebookType, type1, n1_n2_PR_sixteen_one\n"); - N1=16; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=32; - break; - default: - printf("n1 n2 is %d\n",type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present); - N1=1; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=2; - break; + //Uniform Planner Array: UPA + // X X X X ... X + // X X X X ... X + // N2 . . . . ... . + // X X X X ... X + // |<-----N1---->| + LOG_I(MAC,"NR Codebook Config: codebookType, type1, subType_PR_typeI_SinglePanel\n"); + struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; + if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { + N1=1; + N2=1; + O1=1; + O2=1; + CSI_RS_antenna_ports=2; + LOG_I(MAC,"NR Codebook Config: antenna ports: %d\n",CSI_RS_antenna_ports); + } else if(type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { + //Type 1 Single Panel : Based on 38.214 v15.3-Table 5.2.2.2.1-2: Supported configurations of (N1,N2) and (O1,O2) + switch(type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present) { + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction: + N1=2; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=4; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction: + N1=2; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=8; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_two_TypeI\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction: + N1=4; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=8; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction: + N1=3; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=12; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_three_two\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction: + N1=6; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=12; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction: + N1=4; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=16; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_two\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction: + N1=8; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=16; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction: + N1=4; + N2=3; + O1=4; + O2=4; + CSI_RS_antenna_ports=24; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_three\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction: + N1=6; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=24; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_two\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction: + N1=12; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=24; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_twelve_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction: + N1=4; + N2=4; + O1=4; + O2=4; + CSI_RS_antenna_ports=32; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_four\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction: + N1=8; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=32; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_two\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction: + N1=16; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=32; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_sixteen_one\n",CSI_RS_antenna_ports); + break; + default: + N1=1; + N2=1; + O1=1; + O2=1; + CSI_RS_antenna_ports=2; + LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2 %d\n",CSI_RS_antenna_ports,type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present); + break; + } } - } - if(csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode==1){ - if (CSI_RS_antenna_ports < 16) { - //Generate DFT vertical beams - //ll: index of a vertical beams vector (represented by i1_1 in TS 38.214) - double complex v[N1*O1][N1]; - for (int ll=0; ll=4) - pmi_size = N1*O1*N2*O2*(4)+N1*O1*N2*O2*N1*O1*N2*O2*2+N1*O1*N2*O2*N1*O1*N2*O2*2+(N1*O1-1)*N2*O2*N1*O1*N2*O2*2+(N2*O2-1)*N1*O1*N2*O2*2+(N1*O1-1)*N2*O2*2+(N2*O2-1)*2+2; - gNB->nr_mimo_precoding_matrix = (int32_t **)malloc16(pmi_size* sizeof(int32_t)); - int32_t **mat = gNB->nr_mimo_precoding_matrix; - - double complex res_code; - - //Table 5.2.2.2.1-5: - //Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - for(int ll=0; ll0) - ((short*) &mat[pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[pmiq][len])[0],((short*) &mat[pmiq][len])[1]); - } - - for(int len=N1*N2; len<2*N1*N2; len++) { - res_code=sqrt(1/(double)CSI_RS_antenna_ports)*theta_n[nn]*v_lm[ll][mm][len-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[pmiq][len])[0],((short*) &mat[pmiq][len])[1]); - - } + if(csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode==1){ + if (CSI_RS_antenna_ports < 16) { + //Generate DFT vertical beams + //ll: index of a vertical beams vector (represented by i1_1 in TS 38.214) + double complex v[N1*O1][N1]; + for (int ll=0; ll0) - ((short*) &mat[pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + //Generate DFT Horizontal beams + //mm: index of a Horizontal beams vector (represented by i1_2 in TS 38.214) + double complex u[N2*O2][N2]; + for (int mm=0; mm0) - ((short*) &mat[pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*2+j_col])[0],((short*) &mat[pmiq][i_rows*2+j_col])[1]); - } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*2+j_col])[0],((short*) &mat[pmiq][i_rows*2+j_col])[1]); - } - } - } - //Table 5.2.2.2.1-7: - //Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - if(CSI_RS_antenna_ports>=3) - for(int llb=0; llb0) - ((short*) &mat[pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + gNB->nr_mimo_precoding_matrix = (int32_t ***)malloc16(4* sizeof(int32_t **)); + int32_t ***mat = gNB->nr_mimo_precoding_matrix; + double complex res_code; - if (cimag(res_code)>0) - ((short*) &mat[pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*3+j_col])[0],((short*) &mat[pmiq][i_rows*3+j_col])[1]); - } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*3+j_col])[0],((short*) &mat[pmiq][i_rows*3+j_col])[1]); + //Table 5.2.2.2.1-5: + //Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + int pmiq_size = N1*O1*N2*O2*4+1; + mat[0] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + + //pmi=0 corresponds to unit matrix + mat[0][0] = (int32_t *)calloc(2*N1*N2,sizeof(int32_t)); + for(int j_col=0; j_col<1; j_col++)//1 layer + for (int i_rows=0; i_rows<2*N1*N2; i_rows++)//2-x polarized antenna + if(j_col==i_rows) + ((short*) &mat[0][0][i_rows+j_col])[0] = 32768; + + for(int ll=0; ll0) + ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_I(MAC, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); + } + + for(int len=N1*N2; len<2*N1*N2; len++) { + res_code=sqrt(1/(double)CSI_RS_antenna_ports)*theta_n[nn]*v_lm[ll][mm][len-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + + LOG_I(MAC, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); + } + } + + int llc; + int mmc; + double complex phase_sign; + //Table 5.2.2.2.1-6: + //Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; + mat[1] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + + //pmi=0 corresponds to unit matrix + mat[1][0] = (int32_t *)calloc((2*N1*N2)*(2),sizeof(int32_t)); + for(int j_col=0; j_col<2; j_col++)//2 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++)//2-x polarized antenna + if(j_col==i_rows) + ((short*) &mat[1][0][i_rows*2+j_col])[0] = 32768; + + //pmi=1,...,pmi_size are computed as follows + for(int llb=0; llb0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + + if (cimag(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + + LOG_I(MAC, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + + LOG_I(MAC, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + } } } - } - //Table 5.2.2.2.1-8: - //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - if(CSI_RS_antenna_ports>=4) - for(int llb=0; llb=3){ + pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; + mat[2] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + + //pmi=0 corresponds to unit matrix + mat[2][0] = (int32_t *)calloc((2*N1*N2)*(3),sizeof(int32_t)); + for(int j_col=0; j_col<3; j_col++)//3 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++)//2-x polarized antenna + if(j_col==i_rows) + ((short*) &mat[2][0][i_rows*3+j_col])[0] = 32768; + + //pmi=1,...,pmi_size are computed as follows + for(int llb=0; llb0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + + if (cimag(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + + LOG_D(MAC, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + + LOG_D(MAC, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + } + } } - if (j_col==1) { - llc = ll; - mmc = mm; - phase_sign = 1; + } + //Table 5.2.2.2.1-8: + //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + + if(CSI_RS_antenna_ports>=4){ + pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; + mat[3] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + + //pmi=0 corresponds to unit matrix + mat[3][0] = (int32_t *)calloc((2*N1*N2)*(4),sizeof(int32_t)); + for(int j_col=0; j_col<4; j_col++)//4 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++)//2-x polarized antenna + if(j_col==i_rows) + ((short*) &mat[3][0][i_rows*4+j_col])[0] = 32768; + + //pmi=1,...,pmi_size are computed as follows + for(int llb=0; llb0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q1else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + + LOG_D(MAC, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + } + + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + + LOG_D(MAC, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + } + } } - if (j_col==3) { - llc = llb; - mmc = mmb; - phase_sign = -1; - } - if (j_col==4) { - llc = ll; - mmc = mm; - phase_sign = -1; - } - for (int i_rows=0; i_rows0) - ((short*) &mat[pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q1else - ((short*) &mat[pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*4+j_col])[0],((short*) &mat[pmiq][i_rows*4+j_col])[1]); - } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - printf("%d %d result = %f+j %f FIXED POINT %d+j %d \n",pmiq, i_rows, creal(res_code), cimag(res_code),((short*) &mat[pmiq][i_rows*4+j_col])[0],((short*) &mat[pmiq][i_rows*4+j_col])[1]); - } - } - } + } + } + } else {//codebookMode 2 + LOG_I(MAC,"CodeBook Type 1, CodebookMode %ld is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode); } - } else {//codebookMode 2 - printf("CodeBook Type 1, CodebookMode %ld is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode); + } else { + LOG_I(MAC,"subType_PR_typeI %d is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); } - } else { - printf("subType_PR_typeI %d is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); } - return (0); } diff --git a/openair1/PHY/MODULATION/nr_modulation.c b/openair1/PHY/MODULATION/nr_modulation.c index c81a88ff30..1db5c5eb32 100644 --- a/openair1/PHY/MODULATION/nr_modulation.c +++ b/openair1/PHY/MODULATION/nr_modulation.c @@ -801,3 +801,18 @@ int nr_layer_precoder(int16_t **datatx_F_precoding, char *prec_matrix, uint8_t n /* ((int16_t *)precodatatx_F)[0] = (int16_t)((((int16_t *)precodatatx_F)[0]*ONE_OVER_SQRT2_Q15)>>15); ((int16_t *)precodatatx_F)[1] = (int16_t)((((int16_t *)precodatatx_F)[1]*ONE_OVER_SQRT2_Q15)>>15);*/ } + +int nr_layer_precoder_cm(int16_t **datatx_F_precoding, int *prec_matrix, uint8_t n_layers, int32_t re_offset) +{ + int32_t precodatatx_F = 0; + for (int al = 0; al>15); + ((int16_t *) &precodatatx_F)[1] += (int16_t)(((int32_t)(antenna_re*(((int16_t *)&prec_matrix[al])[1])) + (int32_t)(antenna_im* (((int16_t *)&prec_matrix[al])[0])))>>15); + } + + return precodatatx_F; +} + diff --git a/openair1/PHY/MODULATION/nr_modulation.h b/openair1/PHY/MODULATION/nr_modulation.h index 75541a1361..de0dbcfd31 100644 --- a/openair1/PHY/MODULATION/nr_modulation.h +++ b/openair1/PHY/MODULATION/nr_modulation.h @@ -135,4 +135,9 @@ int nr_layer_precoder(int16_t **datatx_F_precoding, char *prec_matrix, uint8_t n_layers, int32_t re_offset); + +int nr_layer_precoder_cm(int16_t **datatx_F_precoding, + int *prec_matrix, + uint8_t n_layers, + int32_t re_offset); #endif diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index fa1b6c955b..47014fd0ff 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -459,47 +459,38 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } } else { - //get the precoding matrix weights: - char *W_prec; - switch (frame_parms->nb_antennas_tx) { - case 1://1 antenna port - W_prec = nr_W_1l_2p[pmi][ap]; - break; - case 2://2 antenna ports - if (rel15->nrOfLayers == 1)//1 layer - W_prec = nr_W_1l_2p[pmi][ap]; - else//2 layers - W_prec = nr_W_2l_2p[pmi][ap]; - break; - case 4://4 antenna ports - if (rel15->nrOfLayers == 1)//1 layer - W_prec = nr_W_1l_4p[pmi][ap]; - else if (rel15->nrOfLayers == 2)//2 layers - W_prec = nr_W_2l_4p[pmi][ap]; - else if (rel15->nrOfLayers == 3)//3 layers - W_prec = nr_W_3l_4p[pmi][ap]; - else//4 layers - W_prec = nr_W_4l_4p[pmi][ap]; - break; - default: - LOG_D(PHY,"Precoding 1,2, or 4 antenna ports are currently supported\n"); - W_prec = nr_W_1l_2p[pmi][ap]; - break; - } - for (int i=0; iofdm_symbol_size + k; - int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset+txdataF_offset); - ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0]; - ((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1]; -#ifdef DEBUG_DLSCH_MAPPING - printf("antenna %d\t l %d \t k %d \t txdataF: %d %d\n", - ap, l, k, ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)], - ((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)]); -#endif - if (++k >= frame_parms->ofdm_symbol_size) { + if(frame_parms->nb_antennas_tx==1){//no precoding matrix defined + memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + txdataF_offset+ k)], + NR_NB_SC_PER_RB*sizeof(int32_t)); + k += NR_NB_SC_PER_RB; + if (k >= frame_parms->ofdm_symbol_size) { k -= frame_parms->ofdm_symbol_size; } } + else { + //get the precoding matrix weights: + int32_t **mat = gNB->nr_mimo_precoding_matrix[rel15->nrOfLayers-1]; + //i_row =0,...,dl_antenna_port + //j_col =0,...,nrOfLayers + //mat[pmi][i_rows*2+j_col] + int *W_prec; + W_prec = (int32_t *)&mat[pmi][ap*rel15->nrOfLayers]; + for (int i=0; iofdm_symbol_size + k; + int32_t precodatatx_F = nr_layer_precoder_cm(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset+txdataF_offset); + ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0]; + ((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1]; + #ifdef DEBUG_DLSCH_MAPPING + printf("antenna %d\t l %d \t k %d \t txdataF: %d %d\n", + ap, l, k, ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)], + ((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)]); + #endif + if (++k >= frame_parms->ofdm_symbol_size) { + k -= frame_parms->ofdm_symbol_size; + } + } + } } } //RB loop } // symbol loop diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 57e841ad40..a9e0707c74 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -805,7 +805,7 @@ typedef struct PHY_VARS_gNB_s { uint32_t ****nr_gold_pdsch_dmrs; /// PDSCH codebook I precoding LUTs - int32_t **nr_mimo_precoding_matrix; + int32_t ***nr_mimo_precoding_matrix; /// PUSCH DMRS uint32_t ****nr_gold_pusch_dmrs; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 51fdfc917e..accd5f7099 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -794,6 +794,7 @@ int main(int argc, char **argv) // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; phy_init_nr_gNB(gNB,0,1); + mac_init_codebook_gNB(gNB,gNB_mac); N_RB_DL = gNB->frame_parms.N_RB_DL; NR_UE_info_t *UE_info = &RC.nrmac[0]->UE_info; UE_info->num_UEs=1; diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index c4e9389f99..f5a97f1bf7 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1156,7 +1156,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; - if (do_csirs && dl_antenna_ports > 1) { + if (dl_antenna_ports > 1) {/*do_csirs&&*/ NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); csirep1->reportConfigId=0; csirep1->carrier=NULL; @@ -1208,8 +1208,19 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo; csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo= calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo)); + if(dl_antenna_ports == 4) csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present= - NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction; + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction; + else if(dl_antenna_ports == 8) + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present= + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction; + else if(dl_antenna_ports == 12) + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present= + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction; + else//default + csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present= + NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction; + /*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.size=1; csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.bits_unused=1; csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.choice.two_one_TypeI_SinglePanel_Restriction.buf=malloc(1); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index 30194647b8..f93e97ed65 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -239,6 +239,8 @@ RUs = ( #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; ## beamforming 2x2 matrix: #bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 2x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000]; ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2"; From 2242c6a8a9ece30e59203023834ad7ccceb7f27d Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 4 Oct 2021 19:10:38 +0200 Subject: [PATCH 143/883] cosmetic changes in codebook initialization --- executables/nr-gnb.c | 2 +- openair1/PHY/INIT/nr_init.c | 196 ++++++++++++++----------- openair1/PHY/INIT/phy_init.h | 3 + openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 - 5 files changed, 118 insertions(+), 87 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index e2385c45c0..0a893993a4 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -508,7 +508,7 @@ void init_eNB_afterRU(void) { mac = RC.nrmac[gNB->UL_INFO.module_id]; phy_init_nr_gNB(gNB,0,0); - mac_init_codebook_gNB(gNB,mac); + init_codebook_gNB(gNB,mac); // map antennas and PRACH signals to gNB RX if (0) AssertFatal(gNB->num_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id); diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index f77526210d..98df74ca87 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -72,13 +72,13 @@ int l1_north_init_gNB() { return(0); } -int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, - gNB_MAC_INST *mac) { +int init_codebook_gNB(PHY_VARS_gNB *gNB, + gNB_MAC_INST *mac) { //get RRC Codebook configuration struct NR_CSI_ReportConfig *csi_reportconfig = mac->UE_info.CellGroup[0]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.array[0]; if(gNB->frame_parms.nb_antennas_tx>1){ - LOG_I(MAC,"NR mac_init_codebook_gNB: codebookType present %d\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); + LOG_D(PHY, "NR init_codebook_gNB: codebookType present %d\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); if(csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present==NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) { int N1=1; int N2=1; @@ -92,7 +92,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, // N2 . . . . ... . // X X X X ... X // |<-----N1---->| - LOG_I(MAC,"NR Codebook Config: codebookType, type1, subType_PR_typeI_SinglePanel\n"); + LOG_D(PHY, "NR Codebook Config: codebookType, type1, subType_PR_typeI_SinglePanel\n"); struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { N1=1; @@ -100,7 +100,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=1; O2=1; CSI_RS_antenna_ports=2; - LOG_I(MAC,"NR Codebook Config: antenna ports: %d\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: antenna ports: %d\n",CSI_RS_antenna_ports); } else if(type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { //Type 1 Single Panel : Based on 38.214 v15.3-Table 5.2.2.2.1-2: Supported configurations of (N1,N2) and (O1,O2) switch(type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present) { @@ -110,7 +110,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=1; CSI_RS_antenna_ports=4; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_one\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_one\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction: N1=2; @@ -118,7 +118,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=4; CSI_RS_antenna_ports=8; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_two_TypeI\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_two_TypeI\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction: N1=4; @@ -126,7 +126,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=1; CSI_RS_antenna_ports=8; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_one\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_one\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction: N1=3; @@ -134,7 +134,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=4; CSI_RS_antenna_ports=12; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_three_two\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_three_two\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction: N1=6; @@ -142,7 +142,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=1; CSI_RS_antenna_ports=12; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_one\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_one\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction: N1=4; @@ -150,7 +150,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=4; CSI_RS_antenna_ports=16; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_two\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_two\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction: N1=8; @@ -158,7 +158,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=1; CSI_RS_antenna_ports=16; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_one\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_one\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction: N1=4; @@ -166,7 +166,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=4; CSI_RS_antenna_ports=24; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_three\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_three\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction: N1=6; @@ -174,7 +174,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=4; CSI_RS_antenna_ports=24; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_two\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_two\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction: N1=12; @@ -182,7 +182,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=1; CSI_RS_antenna_ports=24; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_twelve_one\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_twelve_one\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction: N1=4; @@ -190,7 +190,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=4; CSI_RS_antenna_ports=32; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_four\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_four\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction: N1=8; @@ -198,7 +198,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=4; CSI_RS_antenna_ports=32; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_two\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_two\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction: N1=16; @@ -206,7 +206,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=4; O2=1; CSI_RS_antenna_ports=32; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_sixteen_one\n",CSI_RS_antenna_ports); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_sixteen_one\n",CSI_RS_antenna_ports); break; default: N1=1; @@ -214,7 +214,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, O1=1; O2=1; CSI_RS_antenna_ports=2; - LOG_I(MAC,"NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2 %d\n",CSI_RS_antenna_ports,type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present); + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2 %d\n",CSI_RS_antenna_ports,type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present); break; } } @@ -224,38 +224,43 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, //Generate DFT vertical beams //ll: index of a vertical beams vector (represented by i1_1 in TS 38.214) double complex v[N1*O1][N1]; - for (int ll=0; llnr_mimo_precoding_matrix = (int32_t ***)malloc16(4* sizeof(int32_t **)); int32_t ***mat = gNB->nr_mimo_precoding_matrix; @@ -268,17 +273,20 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, //pmi=0 corresponds to unit matrix mat[0][0] = (int32_t *)calloc(2*N1*N2,sizeof(int32_t)); - for(int j_col=0; j_col<1; j_col++)//1 layer - for (int i_rows=0; i_rows<2*N1*N2; i_rows++)//2-x polarized antenna - if(j_col==i_rows) + for(int j_col=0; j_col<1; j_col++) { //1 layer + for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna + if(j_col==i_rows) { ((short*) &mat[0][0][i_rows+j_col])[0] = 32768; + } + } + } - for(int ll=0; ll0) @@ -289,7 +297,7 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(MAC, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); + LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); } for(int len=N1*N2; len<2*N1*N2; len++) { @@ -303,9 +311,11 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, else ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(MAC, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); + LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); } } + } + } int llc; int mmc; @@ -317,20 +327,23 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, //pmi=0 corresponds to unit matrix mat[1][0] = (int32_t *)calloc((2*N1*N2)*(2),sizeof(int32_t)); - for(int j_col=0; j_col<2; j_col++)//2 layers - for (int i_rows=0; i_rows<2*N1*N2; i_rows++)//2-x polarized antenna - if(j_col==i_rows) + for(int j_col=0; j_col<2; j_col++) { //2 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna + if(j_col==i_rows) { ((short*) &mat[1][0][i_rows*2+j_col])[0] = 32768; + } + } + } //pmi=1,...,pmi_size are computed as follows - for(int llb=0; llb0) ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(MAC, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); } for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; @@ -367,33 +379,40 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, else ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(MAC, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); } } } + } + } + } + } //Table 5.2.2.2.1-7: //Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - if(CSI_RS_antenna_ports>=3){ + if(CSI_RS_antenna_ports>=3) { pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; mat[2] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); //pmi=0 corresponds to unit matrix mat[2][0] = (int32_t *)calloc((2*N1*N2)*(3),sizeof(int32_t)); - for(int j_col=0; j_col<3; j_col++)//3 layers - for (int i_rows=0; i_rows<2*N1*N2; i_rows++)//2-x polarized antenna - if(j_col==i_rows) + for(int j_col=0; j_col<3; j_col++) { //3 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna + if(j_col==i_rows) { ((short*) &mat[2][0][i_rows*3+j_col])[0] = 32768; + } + } + } //pmi=1,...,pmi_size are computed as follows - for(int llb=0; llb0) ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(MAC, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); } for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; @@ -435,34 +453,41 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, else ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(MAC, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); } } } + } + } + } + } } + //Table 5.2.2.2.1-8: //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - - if(CSI_RS_antenna_ports>=4){ + if(CSI_RS_antenna_ports>=4) { pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; mat[3] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); //pmi=0 corresponds to unit matrix mat[3][0] = (int32_t *)calloc((2*N1*N2)*(4),sizeof(int32_t)); - for(int j_col=0; j_col<4; j_col++)//4 layers - for (int i_rows=0; i_rows<2*N1*N2; i_rows++)//2-x polarized antenna - if(j_col==i_rows) + for(int j_col=0; j_col<4; j_col++) { //4 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna + if(j_col==i_rows) { ((short*) &mat[3][0][i_rows*4+j_col])[0] = 32768; + } + } + } //pmi=1,...,pmi_size are computed as follows - for(int llb=0; llb0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q1else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(MAC, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); } for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { @@ -508,20 +534,24 @@ int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, else ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(MAC, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); } } } + } + } + } + } } } } else {//codebookMode 2 - LOG_I(MAC,"CodeBook Type 1, CodebookMode %ld is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode); + AssertFatal(1==0, "CodeBook Type 1, CodebookMode %ld is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode); } } else { - LOG_I(MAC,"subType_PR_typeI %d is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); + AssertFatal(1==0, "subType_PR_typeI %d is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); } } - return (0); + return 0; } int phy_init_nr_gNB(PHY_VARS_gNB *gNB, diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index dd9232de83..94c0d22a4e 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -37,6 +37,8 @@ #include "LTE_SCellToAddMod-r10.h" #include "LTE_NonMBSFN-SubframeConfig-r14.h" +typedef struct gNB_MAC_INST_s gNB_MAC_INST; + /** @addtogroup _PHY_STRUCTURES_ * @{ */ @@ -400,6 +402,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); void init_N_TA_offset(PHY_VARS_NR_UE *ue); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag); +int init_codebook_gNB(PHY_VARS_gNB *gNB, gNB_MAC_INST *mac); void nr_phy_config_request(NR_PHY_Config_t *gNB); void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst); void phy_free_nr_gNB(PHY_VARS_gNB *gNB); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index accd5f7099..d05ffc9abe 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -794,7 +794,7 @@ int main(int argc, char **argv) // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; phy_init_nr_gNB(gNB,0,1); - mac_init_codebook_gNB(gNB,gNB_mac); + init_codebook_gNB(gNB,gNB_mac); N_RB_DL = gNB->frame_parms.N_RB_DL; NR_UE_info_t *UE_info = &RC.nrmac[0]->UE_info; UE_info->num_UEs=1; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index e7715bec14..62d70f4f2c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -38,8 +38,6 @@ void set_cset_offset(uint16_t); void mac_top_init_gNB(void); -int mac_init_codebook_gNB(PHY_VARS_gNB *gNB, gNB_MAC_INST *mac); - void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, From df9e492d02fd23f7b916ee7ae8116273177b6e6a Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 29 Nov 2021 16:39:05 +0100 Subject: [PATCH 144/883] removing bwp from pdcch_pdu_idx and cce_list --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 10 ++++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 12 ++++++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 9 ++++----- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 ++------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 8 ++------ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 6 +++--- 8 files changed, 24 insertions(+), 36 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 51fdfc917e..72e8d11be6 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1038,8 +1038,8 @@ int main(int argc, char **argv) while ((roundack==0)) { - memset(RC.nrmac[0]->cce_list[1][0],0,MAX_NUM_CCE*sizeof(int)); - memset(RC.nrmac[0]->cce_list[1][1],0,MAX_NUM_CCE*sizeof(int)); + memset(RC.nrmac[0]->cce_list[0],0,MAX_NUM_CCE*sizeof(int)); + memset(RC.nrmac[0]->cce_list[1],0,MAX_NUM_CCE*sizeof(int)); clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot); UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 4c0e9dab9f..c4e1fbff96 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -67,7 +67,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0]; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t ***pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t ***)gNB->pdcch_pdu_idx[CC_idP]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t **pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t **)gNB->pdcch_pdu_idx[CC_idP]; nfapi_nr_ul_tti_request_t *future_ul_tti_req = &gNB->UL_tti_req_ahead[CC_idP][(slotP + num_slots - 1) % num_slots]; nfapi_nr_ul_dci_request_t *UL_dci_req = &gNB->UL_dci_req[0]; @@ -80,7 +80,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, DL_req[CC_idP].dl_tti_request_body.nPDUs = 0; DL_req[CC_idP].dl_tti_request_body.nGroup = 0; //DL_req[CC_idP].dl_tti_request_body.transmission_power_pcfich = 6000; - memset(pdcch, 0, sizeof(**pdcch) * MAX_NUM_BWP * MAX_NUM_CORESET); + memset(pdcch, 0, sizeof(*pdcch) * MAX_NUM_CORESET); UL_dci_req[CC_idP].SFN = frameP; UL_dci_req[CC_idP].Slot = slotP; @@ -276,7 +276,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, protocol_ctxt_t ctxt={0}; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP); - const int bwp_id = 1; char stats_output[16384]; gNB_MAC_INST *gNB = RC.nrmac[module_idP]; @@ -307,9 +306,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_rrc_trigger(&ctxt, 0 /*CC_id*/, frame, slot >> *scc->ssbSubcarrierSpacing); } - memset(RC.nrmac[module_idP]->cce_list[0][0],0,MAX_NUM_CCE*sizeof(int)); // coreset0 - memset(RC.nrmac[module_idP]->cce_list[0][1],0,MAX_NUM_CCE*sizeof(int)); // coreset1 on initialBWP - memset(RC.nrmac[module_idP]->cce_list[bwp_id][1],0,MAX_NUM_CCE*sizeof(int)); // coresetid 1 + memset(RC.nrmac[module_idP]->cce_list[0],0,MAX_NUM_CCE*sizeof(int)); // coreset0 + memset(RC.nrmac[module_idP]->cce_list[1],0,MAX_NUM_CCE*sizeof(int)); // coreset1 NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info; for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) for (int i=0; iUL_dci_req[CC_id]; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][ra->bwp_id][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu_rel15) { nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu = &ul_dci_req->ul_dci_pdu_list[ul_dci_req->numPdus]; memset(ul_dci_request_pdu, 0, sizeof(nfapi_nr_ul_dci_request_pdus_t)); @@ -789,7 +789,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t pdcch_pdu_rel15 = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); - nr_mac->pdcch_pdu_idx[CC_id][ra->bwp_id][coresetid] = pdcch_pdu_rel15; + nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } uint8_t aggregation_level; @@ -1196,7 +1196,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra // important if we have multiple RAs, and the DLSCH has to reuse them, so we need to mark them const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu_rel15) { nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t)); @@ -1205,7 +1205,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); - nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu_rel15; + nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; @@ -1572,7 +1572,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra // important if we have multiple RAs, and the DLSCH has to reuse them, so we need to mark them const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu_rel15) { nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t)); @@ -1581,7 +1581,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); - nr_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu_rel15; + nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0e01702d77..bbae3c48a2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -627,7 +627,7 @@ bool allocate_dl_retransmission(module_id_t module_id, slot); int cid = sched_ctrl->coreset->controlResourceSetId; UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = RC.nrmac[module_id]->cce_list[sched_ctrl->active_bwp?sched_ctrl->active_bwp->bwp_Id:0][cid]; + int *cce_list = RC.nrmac[module_id]->cce_list[cid]; for (int i = 0; i < sched_ctrl->aggregation_level; i++) cce_list[sched_ctrl->cce_index + i] = 0; return false; @@ -732,7 +732,6 @@ void pf_dl(module_id_t module_id, NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0; const uint16_t rnti = UE_info->rnti[UE_id]; NR_BWP_t *genericParameters = sched_ctrl->active_bwp ? &sched_ctrl->active_bwp->bwp_Common->genericParameters: @@ -764,7 +763,7 @@ void pf_dl(module_id_t module_id, slot); int cid = sched_ctrl->coreset->controlResourceSetId; UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = mac->cce_list[bwp_Id][cid]; + int *cce_list = mac->cce_list[cid]; for (int i = 0; i < sched_ctrl->aggregation_level; i++) cce_list[sched_ctrl->cce_index + i] = 0; return; @@ -995,7 +994,7 @@ void nr_schedule_ue_spec(module_id_t module_id, const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu) { nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t)); @@ -1007,7 +1006,7 @@ void nr_schedule_ue_spec(module_id_t module_id, NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset; nr_configure_pdcch(gNB_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); - gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu; + gNB_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index f1005cea70..75f3a1ae8d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -358,7 +358,7 @@ void nr_preprocessor_phytest(module_id_t module_id, frame, slot); UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = RC.nrmac[module_id]->cce_list[sched_ctrl->active_bwp->bwp_Id][cid]; + int *cce_list = RC.nrmac[module_id]->cce_list[cid]; for (int i = 0; i < sched_ctrl->aggregation_level; i++) cce_list[sched_ctrl->cce_index + i] = 0; return; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7387bfe698..4f455e0b92 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -218,12 +218,7 @@ int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, int coreset_id = coreset->controlResourceSetId; - int *cce_list; - if(bwp == NULL) { - cce_list = nr_mac->cce_list[0][coreset_id]; - } else { - cce_list = nr_mac->cce_list[bwp->bwp_Id][coreset_id]; - } + int *cce_list = nr_mac->cce_list[coreset_id]; int n_rb=0; for (int i=0;i<6;i++) @@ -2410,7 +2405,7 @@ bool find_free_CCE(module_id_t module_id, const int cid = sched_ctrl->coreset->controlResourceSetId; const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid][slot]; const int m = RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid]; - if (UE_id >= 0) LOG_D(NR_MAC,"calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",sched_ctrl->aggregation_level,nr_of_candidates,Y); + if (UE_id >= 0) LOG_D(NR_MAC,"slot %d calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",slot, sched_ctrl->aggregation_level,nr_of_candidates,Y); sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], sched_ctrl->active_bwp, sched_ctrl->coreset, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 9a6fa32b5f..bcc0832863 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1388,10 +1388,6 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) nfapi_nr_ul_dci_request_t *ul_dci_req = &RC.nrmac[module_id]->UL_dci_req[CC_id]; ul_dci_req->SFN = frame; ul_dci_req->Slot = slot; - /* a PDCCH PDU groups DCIs per BWP and CORESET. Save a pointer to each - * allocated PDCCH so we can easily allocate UE's DCIs independent of any - * CORESET order */ - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_bwp_coreset[MAX_NUM_BWP][MAX_NUM_CORESET] = {{0}}; NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; @@ -1628,7 +1624,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) NR_SearchSpace_t *ss = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->search_space: RC.nrmac[module_id]->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->coreset: RC.nrmac[module_id]->sched_ctrlCommon->coreset; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = pdcch_pdu_bwp_coreset[bwpid][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu) { nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu = &ul_dci_req->ul_dci_pdu_list[ul_dci_req->numPdus]; memset(ul_dci_request_pdu, 0, sizeof(nfapi_nr_ul_dci_request_pdus_t)); @@ -1637,7 +1633,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; nr_configure_pdcch(nr_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); - pdcch_pdu_bwp_coreset[bwpid][coresetid] = pdcch_pdu; + nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } LOG_D(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 27f42f4b1d..99e21b6560 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -73,7 +73,7 @@ /* Defs */ #define MAX_NUM_BWP 2 -#define MAX_NUM_CORESET 2 +#define MAX_NUM_CORESET 12 #define MAX_NUM_CCE 90 #define MAX_HARQ_ROUNDS 4 /*!\brief Maximum number of random access process */ @@ -703,7 +703,7 @@ typedef struct gNB_MAC_INST_s { /// a PDCCH PDU groups DCIs per BWP and CORESET. The following structure /// keeps pointers to PDCCH PDUs within DL_req so that we can easily track /// PDCCH PDUs per CC/BWP/CORESET - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_idx[NFAPI_CC_MAX][MAX_NUM_BWP][MAX_NUM_CORESET]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_idx[NFAPI_CC_MAX][MAX_NUM_CORESET]; /// NFAPI UL TTI Request Structure, simple pointer into structure /// UL_tti_req_ahead for current frame/slot nfapi_nr_ul_tti_request_t *UL_tti_req[NFAPI_CC_MAX]; @@ -743,7 +743,7 @@ typedef struct gNB_MAC_INST_s { /// processing time of eNB PCH scheduler time_stats_t schedule_pch; /// CCE lists - int cce_list[MAX_NUM_BWP][MAX_NUM_CORESET][MAX_NUM_CCE]; + int cce_list[MAX_NUM_CORESET][MAX_NUM_CCE]; /// list of allocated beams per period int16_t *tdd_beam_association; From 0ae0c9ac56bd6a4b851b84a0438554a92a40a333 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 29 Nov 2021 17:37:50 +0000 Subject: [PATCH 145/883] Do not perform ULSCH scheduling on slots where there is SRS scheduling --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 6 ++++-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 5 +++++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 18 ++++++++++++------ .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 11 ++++++++++- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 11 ++++++++++- 6 files changed, 42 insertions(+), 11 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 4efb04a873..655fce5761 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -383,6 +383,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, if (slot == 0) nr_csi_meas_reporting(module_idP, frame, slot); + // Schedule SRS: check in slot 0 for the whole frame + if (slot == 0) + nr_schedule_srs(module_idP, frame); + // This schedule RA procedure if not in phy_test mode // Otherwise already consider 5G already connected if (get_softmodem_params()->phy_test == 0) { @@ -397,8 +401,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_pucch(module_idP, frame, slot); - nr_schedule_srs(module_idP, frame, slot); - stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7387bfe698..32ef22879e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1961,6 +1961,11 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG sched_ctrl->pucch_consecutive_dtx_cnt = 0; sched_ctrl->pusch_consecutive_dtx_cnt = 0; sched_ctrl->ul_failure = 0; + + sched_ctrl->sched_srs.frame = -1; + sched_ctrl->sched_srs.slot = -1; + sched_ctrl->sched_srs.srs_scheduled = false; + /* set illegal time domain allocation to force recomputation of all fields */ sched_ctrl->pdsch_semi_static.time_domain_allocation = -1; sched_ctrl->pusch_semi_static.time_domain_allocation = -1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index 2a0429614e..3ef234a2ed 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -101,13 +101,12 @@ void nr_fill_nfapi_srs(int module_id, int CC_id, int UE_id, sub_frame_t slot, NR * * PARAMETERS : module id * frame number for possible SRS reception -* slot number for possible SRS reception * * DESCRIPTION : It informs the PHY layer that has an SRS to receive. * Only for periodic scheduling yet. * *********************************************************************/ -void nr_schedule_srs(int module_id, frame_t frame, sub_frame_t slot) { +void nr_schedule_srs(int module_id, frame_t frame) { gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_UE_info_t *UE_info = &nrmac->UE_info; @@ -120,6 +119,10 @@ void nr_schedule_srs(int module_id, frame_t frame, sub_frame_t slot) { NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + sched_ctrl->sched_srs.frame = -1; + sched_ctrl->sched_srs.slot = -1; + sched_ctrl->sched_srs.srs_scheduled = false; + if(!UE_info->active[UE_id]) { continue; } @@ -170,10 +173,13 @@ void nr_schedule_srs(int module_id, frame_t frame, sub_frame_t slot) { int n_slots_frame = nr_slots_per_frame[ubwp.subcarrierSpacing]; - // Check if UE transmitted the SRS here - if ((frame * n_slots_frame + slot - offset) % period == 0) { - LOG_D(NR_MAC,"(%d.%d) Scheduling SRS reception\n", frame, slot); - nr_fill_nfapi_srs(module_id, CC_id, UE_id, slot, srs_resource); + // Check if UE will transmit the SRS in this frame + if ( ((frame - offset/n_slots_frame)*n_slots_frame)%period == 0) { + LOG_D(NR_MAC,"(%d.%d) Scheduling SRS reception\n", frame, offset%n_slots_frame); + nr_fill_nfapi_srs(module_id, CC_id, UE_id, offset%n_slots_frame, srs_resource); + sched_ctrl->sched_srs.frame = frame; + sched_ctrl->sched_srs.slot = offset%n_slots_frame; + sched_ctrl->sched_srs.srs_scheduled = true; } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 9a6fa32b5f..d0e66c8b00 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1274,6 +1274,15 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t if (sched_ctrl->active_ubwp==NULL && is_mixed_slot) return false; + // Avoid slots with the SRS + const NR_list_t *UE_list = &UE_info->list; + for (int UE_idx = UE_list->head; UE_idx >= 0; UE_idx = UE_list->next[UE_idx]) { + NR_sched_srs_t sched_srs = UE_info->UE_sched_ctrl[UE_idx].sched_srs; + if(sched_srs.srs_scheduled && sched_srs.frame==sched_frame && sched_srs.slot==sched_slot) { + return false; + } + } + sched_ctrl->sched_pusch.slot = sched_slot; sched_ctrl->sched_pusch.frame = sched_frame; for (UE_id = UE_info->list.next[UE_id]; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { @@ -1513,7 +1522,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) memset(pusch_pdu, 0, sizeof(nfapi_nr_pusch_pdu_t)); future_ul_tti_req->n_pdus += 1; - LOG_D(NR_MAC, "%4d.%2d Scheduling UE specific PUSCH for sched %d.%d, ul_tto_req %d.%d\n", frame, slot, + LOG_D(NR_MAC, "%4d.%2d Scheduling UE specific PUSCH for sched %d.%d, ul_tti_req %d.%d\n", frame, slot, sched_pusch->frame,sched_pusch->slot,future_ul_tti_req->SFN,future_ul_tti_req->Slot); pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index b0aaf95722..e0efbd4afe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -190,7 +190,7 @@ void nr_schedule_pucch(int Mod_idP, frame_t frameP, sub_frame_t slotP); -void nr_schedule_srs(int module_id, frame_t frame, sub_frame_t slot); +void nr_schedule_srs(int module_id, frame_t frame); void nr_csirs_scheduling(int Mod_idP, frame_t frame, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 27f42f4b1d..46674dfaa5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -360,6 +360,12 @@ typedef struct NR_sched_pusch { int time_domain_allocation; } NR_sched_pusch_t; +typedef struct NR_sched_srs { + int frame; + int slot; + bool srs_scheduled; +} NR_sched_srs_t; + /* PDSCH semi-static configuratio: as long as the TDA/DMRS/mcsTable remains the * same, there is no need to recalculate all S/L or DMRS-related parameters * over and over again. Hence, we store them in this struct for easy @@ -546,9 +552,12 @@ typedef struct { /// PUSCH semi-static configuration: is not cleared across TTIs NR_pusch_semi_static_t pusch_semi_static; - /// Sched PDSCH: scheduling decisions, copied into HARQ and cleared every TTI + /// Sched PUSCH: scheduling decisions, copied into HARQ and cleared every TTI NR_sched_pusch_t sched_pusch; + /// Sched SRS: scheduling decisions + NR_sched_srs_t sched_srs; + /// uplink bytes that are currently scheduled int sched_ul_bytes; /// estimation of the UL buffer size From 99250c95249c1f40acc90d94da2e31356db93997 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 30 Nov 2021 09:27:07 +0100 Subject: [PATCH 146/883] fix for Y --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 75f3a1ae8d..596169cc29 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -334,7 +334,7 @@ void nr_preprocessor_phytest(module_id_t module_id, AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = UE_info->Y[UE_id][cid][slot]; + const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; const int m = UE_info->num_pdcch_cand[UE_id][cid]; sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], sched_ctrl->active_bwp, @@ -501,7 +501,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = UE_info->Y[UE_id][cid][slot]; + const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; const int m = UE_info->num_pdcch_cand[UE_id][cid]; sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], sched_ctrl->active_bwp, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 4f455e0b92..36ae3c607f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2403,7 +2403,7 @@ bool find_free_CCE(module_id_t module_id, } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid][slot]; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; const int m = RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid]; if (UE_id >= 0) LOG_D(NR_MAC,"slot %d calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",slot, sched_ctrl->aggregation_level,nr_of_candidates,Y); sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], From 3a983dbf9c7eecbb8924783d321ddb9d1c85e944 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 30 Nov 2021 18:24:51 +0000 Subject: [PATCH 147/883] LS channel estimation based on SRS at gNB --- openair1/PHY/INIT/nr_init.c | 5 ++ openair1/PHY/INIT/nr_init_ue.c | 5 ++ .../NR_ESTIMATION/nr_ul_channel_estimation.c | 60 +++++++++++++++++++ openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h | 10 ++++ .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 1 + openair1/PHY/defs_nr_common.h | 4 ++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 8 +++ 7 files changed, 93 insertions(+) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 929e1c050f..322f656c2b 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -198,9 +198,14 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, for (int id=0; idnr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); gNB->nr_srs_info[id]->srs_generated_signal = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->noise_power = (double*)malloc16_clear(sizeof(double)); gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*)); + gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); + gNB->nr_srs_info[id]->srs_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;inr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); } } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 3c9f90d121..56547e7617 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -325,9 +325,14 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, srs_vars[gNB_id]->active = false; ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->noise_power = (double*)malloc16_clear(sizeof(double)); ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->nr_srs_info->srs_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); for (i=0; inb_antennas_rx; i++) { ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); } if (abstraction_flag == 0) { diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 1f164748bf..349bb52e3c 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -36,6 +36,7 @@ //#define DEBUG_CH //#define DEBUG_PUSCH +//#define SRS_DEBUG #define NO_INTERP 1 #define dBc(x,y) (dB_fixed(((int32_t)(x))*(x) + ((int32_t)(y))*(y))) @@ -1091,3 +1092,62 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, }// last symbol check }//Antenna loop } + +int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, + int frame, + int slot, + nfapi_nr_srs_pdu_t *srs_pdu, + nr_srs_info_t *nr_srs_info, + int32_t *srs_generated_signal, + int32_t **srs_received_signal, + int32_t **srs_estimated_channel, + double *noise_power) { + + if(nr_srs_info->n_symbs==0) { + LOG_E(NR_PHY, "(%d.%d) nr_srs_info was not generated yet!\n", frame, slot); + return -1; + } + + NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; + int32_t **srs_ls_estimated_channel = nr_srs_info->srs_ls_estimated_channel; + uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; + + for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { + + memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + memset(srs_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + + for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { + + int16_t generated_real = srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF; + int16_t generated_imag = (srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]>>16)&0xFFFF; + + int16_t received_real = srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF; + int16_t received_imag = (srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]>>16)&0xFFFF; + + // We know that nr_srs_info->srs_generated_signal_bits bits are enough to represent the generated_real and generated_imag. + // So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits. + int16_t ls_estimated_real = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits); + int16_t ls_estimated_imag = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); + + srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset] = ls_estimated_real + (((int32_t)ls_estimated_imag<<16)&0xFFFF0000); + +#ifdef SRS_DEBUG + if(sc_idx == 0) { + LOG_I(NR_PHY,"______________________________ Rx antenna %i _______________________________\n", ant); + } + if(nr_srs_info->subcarrier_idx[sc_idx]%12 == 0) { + LOG_I(NR_PHY,":::::::::::::::::::::::::::::::::::: %i ::::::::::::::::::::::::::::::::::::\n", nr_srs_info->subcarrier_idx[sc_idx]/12); + LOG_I(NR_PHY,"\t __genRe________genIm__|____rxRe_________rxIm__|____lsRe________lsIm_\n"); + } + LOG_I(NR_PHY,"(%4i) %6i\t%6i | %6i\t%6i | %6i\t%6i\n", + nr_srs_info->subcarrier_idx[sc_idx], + generated_real, generated_imag, + received_real, received_imag, + ls_estimated_real, ls_estimated_imag); +#endif + } + } + + return 0; +} \ No newline at end of file diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h index fd3403236e..cafb181d73 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h @@ -62,4 +62,14 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, uint8_t nr_tti_rx, unsigned char symbol, uint32_t nb_re_pusch); + +int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, + int frame, + int slot, + nfapi_nr_srs_pdu_t *srs_pdu, + nr_srs_info_t *nr_srs_info, + int32_t *srs_generated_signal, + int32_t **srs_received_signal, + int32_t **srs_estimated_channel, + double *noise_power); #endif diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index 32a09549c8..d1521943fd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -120,6 +120,7 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, if(nr_srs_info) { nr_srs_info->n_symbs = 0; + nr_srs_info->srs_generated_signal_bits = log2_approx(amp); } #ifdef SRS_DEBUG diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 2eb05a145e..ca8c95bc40 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -243,8 +243,12 @@ typedef struct { typedef struct { uint16_t n_symbs; uint16_t subcarrier_idx[6*NR_MAX_NB_RB]; + uint8_t srs_generated_signal_bits; int32_t *srs_generated_signal; int32_t **srs_received_signal; + int32_t **srs_ls_estimated_channel; + int32_t **srs_estimated_channel; + double *noise_power; } nr_srs_info_t; typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index d56318ef16..1f01bc4a46 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -804,6 +804,14 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } nr_get_srs_signal(gNB,frame_rx,slot_rx,srs_pdu, gNB->nr_srs_info[i], gNB->nr_srs_info[i]->srs_received_signal); + + nr_srs_channel_estimation(gNB,frame_rx,slot_rx,srs_pdu, + gNB->nr_srs_info[i], + gNB->nr_srs_info[i]->srs_generated_signal, + gNB->nr_srs_info[i]->srs_received_signal, + gNB->nr_srs_info[i]->srs_estimated_channel, + gNB->nr_srs_info[i]->noise_power); + srs->active = 0; } } From dbba6c651838e7eecfcebffd703675be645d181a Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 1 Dec 2021 01:50:58 +0000 Subject: [PATCH 148/883] Perform channel interpolation for SRS at gNB --- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 349bb52e3c..ae1d7f483e 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -274,10 +274,10 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ch, ul_ch, 8); - + //for (int i= 0; i<16; i++) //printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i)); - + pil += 2; re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size; rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)]; @@ -1112,11 +1112,15 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t **srs_ls_estimated_channel = nr_srs_info->srs_ls_estimated_channel; uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; + int16_t ls_estimated[2]; + for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); memset(srs_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[0] + subcarrier_offset]; + for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { int16_t generated_real = srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF; @@ -1127,10 +1131,19 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, // We know that nr_srs_info->srs_generated_signal_bits bits are enough to represent the generated_real and generated_imag. // So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits. - int16_t ls_estimated_real = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits); - int16_t ls_estimated_imag = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); + ls_estimated[0] = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits); + ls_estimated[1] = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); - srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset] = ls_estimated_real + (((int32_t)ls_estimated_imag<<16)&0xFFFF0000); + srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset] = ls_estimated[0] + (((int32_t)ls_estimated[1]<<16)&0xFFFF0000); + + if(sc_idx == 0) { + multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); + } else if(sc_idx%2 == 1) { + multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); + } else if(sc_idx%2 == 0) { + multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8); + srs_estimated_channel16+=8; + } #ifdef SRS_DEBUG if(sc_idx == 0) { @@ -1149,5 +1162,25 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, } } +#ifdef SRS_DEBUG + for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { + for(int sc = 0; sc <= nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs-1]; sc++) { + if(sc == 0) { + LOG_I(NR_PHY,"__________________ Rx antenna %i ___________________\n", ant); + } + if(sc%12 == 0) { + LOG_I(NR_PHY,":::::::::::::::::::::::: %i ::::::::::::::::::::::::\n", sc/12); + LOG_I(NR_PHY,"\t __lsRe__________lsIm__|____intRe_______intIm_\n"); + } + LOG_I(NR_PHY,"(%4i) %6i\t%6i | %6i\t%6i\n", + sc, + (int16_t)(srs_ls_estimated_channel[ant][sc+subcarrier_offset]&0xFFFF), + (int16_t)((srs_ls_estimated_channel[ant][sc+subcarrier_offset]>>16)&0xFFFF), + (int16_t)(srs_estimated_channel[ant][sc+subcarrier_offset]&0xFFFF), + (int16_t)((srs_estimated_channel[ant][sc+subcarrier_offset]>>16)&0xFFFF)); + } + } +#endif + return 0; } \ No newline at end of file From d7af1269b7479162f362e61cf04af844d2b52c5d Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 1 Dec 2021 11:13:45 +0000 Subject: [PATCH 149/883] Fix LOG --- openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index ae1d7f483e..1a83be9d73 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1157,7 +1157,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, nr_srs_info->subcarrier_idx[sc_idx], generated_real, generated_imag, received_real, received_imag, - ls_estimated_real, ls_estimated_imag); + ls_estimated[0], ls_estimated[1]); #endif } } From 340508ffe0acfe25624b2a53b36014481a70c534 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 1 Dec 2021 14:43:04 +0000 Subject: [PATCH 150/883] Extension of the channel interpolation implementation for the case NR_SRS_Resource__transmissionComb_PR_n4 --- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 1a83be9d73..7155a2ddac 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1136,13 +1136,24 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset] = ls_estimated[0] + (((int32_t)ls_estimated[1]<<16)&0xFFFF0000); - if(sc_idx == 0) { - multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); - } else if(sc_idx%2 == 1) { - multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); - } else if(sc_idx%2 == 0) { - multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8); - srs_estimated_channel16+=8; + // Channel interpolation + if(srs_pdu->comb_size == 0) { + if(sc_idx == 0) { + multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); + } else if(sc_idx%2 == 1) { + multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); + } else if(sc_idx%2 == 0) { + multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8); + srs_estimated_channel16+=8; + } + } else { + if(sc_idx>0) { + multadd_real_vector_complex_scalar(filt8_dcr0_h, ls_estimated, srs_estimated_channel16, 8); + srs_estimated_channel16+=8; + srs_estimated_channel16[0] = 0; + srs_estimated_channel16[1] = 0; + } + multadd_real_vector_complex_scalar(filt8_dcl0_h, ls_estimated, srs_estimated_channel16, 8); } #ifdef SRS_DEBUG From 242828dd29011bf508f1963beea3890c56caafba Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Wed, 1 Dec 2021 15:59:16 +0100 Subject: [PATCH 151/883] hardcode instruction set usage: Carry-less Multiplication on intel/AMD --- cmake_targets/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 71e030dad3..5547227af9 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -315,9 +315,9 @@ add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAV set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic") set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops -march=native") + "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops -mpclmul") set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11 -march=native") + "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11 -mpclmul") From 3d00d78af81e3516b66709b6e4714404d8643b2a Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 2 Dec 2021 01:30:06 +0000 Subject: [PATCH 152/883] Power noise estimation based on SRS --- openair1/PHY/INIT/nr_init.c | 2 +- openair1/PHY/INIT/nr_init_ue.c | 2 +- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 46 +++++++++++++++---- openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h | 2 +- openair1/PHY/defs_nr_common.h | 2 +- 5 files changed, 42 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 322f656c2b..bc1ea96af9 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -198,7 +198,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, for (int id=0; idnr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); gNB->nr_srs_info[id]->srs_generated_signal = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->noise_power = (double*)malloc16_clear(sizeof(double)); + gNB->nr_srs_info[id]->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t)); gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 56547e7617..db6398bb46 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -325,7 +325,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, srs_vars[gNB_id]->active = false; ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->noise_power = (double*)malloc16_clear(sizeof(double)); + ue->nr_srs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t)); ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 7155a2ddac..c04f1f1731 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1093,6 +1093,16 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, }//Antenna loop } +uint32_t calc_power(uint16_t *x, uint32_t size) { + uint64_t sum_x = 0; + uint64_t sum_x2 = 0; + for(int k = 0; kn_symbs==0) { LOG_E(NR_PHY, "(%d.%d) nr_srs_info was not generated yet!\n", frame, slot); @@ -1112,6 +1122,10 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t **srs_ls_estimated_channel = nr_srs_info->srs_ls_estimated_channel; uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; + uint16_t noise_real[frame_parms->nb_antennas_rx*nr_srs_info->n_symbs]; + uint16_t noise_imag[frame_parms->nb_antennas_rx*nr_srs_info->n_symbs]; + + int16_t prev_ls_estimated[2]; int16_t ls_estimated[2]; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { @@ -1133,9 +1147,15 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, // So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits. ls_estimated[0] = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits); ls_estimated[1] = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); - srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset] = ls_estimated[0] + (((int32_t)ls_estimated[1]<<16)&0xFFFF0000); + if(sc_idx>0) { + ls_estimated[0] = (ls_estimated[0] + prev_ls_estimated[0])>>1; + ls_estimated[1] = (ls_estimated[1] + prev_ls_estimated[1])>>1; + } + prev_ls_estimated[0] = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits); + prev_ls_estimated[1] = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); + // Channel interpolation if(srs_pdu->comb_size == 0) { if(sc_idx == 0) { @@ -1156,6 +1176,9 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, multadd_real_vector_complex_scalar(filt8_dcl0_h, ls_estimated, srs_estimated_channel16, 8); } + noise_real[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF)); + noise_imag[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]>>16)&0xFFFF)); + #ifdef SRS_DEBUG if(sc_idx == 0) { LOG_I(NR_PHY,"______________________________ Rx antenna %i _______________________________\n", ant); @@ -1168,29 +1191,36 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, nr_srs_info->subcarrier_idx[sc_idx], generated_real, generated_imag, received_real, received_imag, - ls_estimated[0], ls_estimated[1]); + prev_ls_estimated[0], prev_ls_estimated[1]); #endif } } + *noise_power = calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->n_symbs) + + calc_power(noise_imag,frame_parms->nb_antennas_rx*nr_srs_info->n_symbs); + #ifdef SRS_DEBUG + uint8_t shift = srs_pdu->comb_size == 0 ? 1 : 2; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { for(int sc = 0; sc <= nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs-1]; sc++) { if(sc == 0) { - LOG_I(NR_PHY,"__________________ Rx antenna %i ___________________\n", ant); + LOG_I(NR_PHY,"______________________________ Rx antenna %i _______________________________\n", ant); } if(sc%12 == 0) { - LOG_I(NR_PHY,":::::::::::::::::::::::: %i ::::::::::::::::::::::::\n", sc/12); - LOG_I(NR_PHY,"\t __lsRe__________lsIm__|____intRe_______intIm_\n"); + LOG_I(NR_PHY,":::::::::::::::::::::::::::::::::::: %i ::::::::::::::::::::::::::::::::::::\n", sc/12); + LOG_I(NR_PHY,"\t __lsRe__________lsIm__|____intRe_______intIm__|____noiRe_______noiIm_\n"); } - LOG_I(NR_PHY,"(%4i) %6i\t%6i | %6i\t%6i\n", + LOG_I(NR_PHY,"(%4i) %6i\t%6i | %6i\t%6i | %6i\t%6i\n", sc, (int16_t)(srs_ls_estimated_channel[ant][sc+subcarrier_offset]&0xFFFF), (int16_t)((srs_ls_estimated_channel[ant][sc+subcarrier_offset]>>16)&0xFFFF), (int16_t)(srs_estimated_channel[ant][sc+subcarrier_offset]&0xFFFF), - (int16_t)((srs_estimated_channel[ant][sc+subcarrier_offset]>>16)&0xFFFF)); + (int16_t)((srs_estimated_channel[ant][sc+subcarrier_offset]>>16)&0xFFFF), + noise_real[ant*nr_srs_info->n_symbs+(sc>>shift)], + noise_imag[ant*nr_srs_info->n_symbs+(sc>>shift)]); } } + LOG_I(NR_PHY,"noise_power = %u\n", *noise_power); #endif return 0; diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h index cafb181d73..9bbccaf6fd 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h @@ -71,5 +71,5 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t *srs_generated_signal, int32_t **srs_received_signal, int32_t **srs_estimated_channel, - double *noise_power); + uint32_t *noise_power); #endif diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index ca8c95bc40..d9b1a2e148 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -248,7 +248,7 @@ typedef struct { int32_t **srs_received_signal; int32_t **srs_ls_estimated_channel; int32_t **srs_estimated_channel; - double *noise_power; + uint32_t *noise_power; } nr_srs_info_t; typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS; From 3d10b9fc41eace583216ac3f40fb622b28360036 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 2 Dec 2021 10:08:55 +0100 Subject: [PATCH 153/883] symbol-wise vrb map occupation for dl --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 24 +++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 63 ++++++++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 24 ++++--- 4 files changed, 70 insertions(+), 46 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 28c95e87f7..8a9c5b3f52 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1144,13 +1144,19 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra BWPSize = type0_PDCCH_CSS_config->num_rbs; } + // Calculate number of symbols + int startSymbolIndex, nrOfSymbols; + const int startSymbolAndLength = pdsch_TimeDomainAllocationList->list.array[time_domain_assignment]->startSymbolAndLength; + SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); + AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n"); + coreset = get_coreset(module_idP, scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common); AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg2\n"); uint16_t *vrb_map = cc[CC_id].vrb_map; for (int i = 0; (i < rbSize) && (rbStart <= (BWPSize - rbSize)); i++) { - if (vrb_map[BWPStart + rbStart + i]) { + if (vrb_map[BWPStart + rbStart + i]&(((1<list.array[time_domain_assignment]->startSymbolAndLength; - SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); - AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n"); - LOG_D(NR_MAC,"Msg2 startSymbolIndex.nrOfSymbols %d.%d\n",startSymbolIndex,nrOfSymbols); int mappingtype = pdsch_TimeDomainAllocationList->list.array[time_domain_assignment]->mappingType; @@ -1362,9 +1362,9 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->TX_req[CC_id].Number_of_PDUs++; nr_mac->TX_req[CC_id].Slot = slotP; - // Mark the corresponding RBs as used + // Mark the corresponding symbols RBs as used for (int rb = 0; rb < rbSize; rb++) { - vrb_map[BWPStart + rb + rbStart] = 1; + vrb_map[BWPStart + rb + rbStart] = ((1<state = WAIT_Msg3; @@ -1547,7 +1547,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra int i = 0; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { - if (vrb_map[BWPStart + rbStart + i]) { + if (vrb_map[BWPStart + rbStart + i]&(((1<TX_req[CC_id].Number_of_PDUs++; nr_mac->TX_req[CC_id].Slot = slotP; - // Mark the corresponding RBs as used + // Mark the corresponding symbols and RBs as used for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) { - vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] = 1; + vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] = ((1<BWPSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index df25b085e6..7f7a202fc4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -384,7 +384,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, int rbSize = 0; uint32_t TBS = 0; do { - if(rbSize < bwpSize && !vrb_map[rbStart + rbSize]) + if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&(((1<sched_ctrlCommon->sched_pdsch.mcs<10) @@ -411,10 +411,9 @@ uint32_t schedule_control_sib1(module_id_t module_id, LOG_D(MAC,"dmrs_length %d\n",dmrs_length); LOG_D(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); LOG_D(MAC,"mappingtype = %d\n", mappingtype); - // Mark the corresponding RBs as used for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { - vrb_map[rb + rbStart] = 1; + vrb_map[rb + rbStart] = ((1<rbSize) { rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbSize = 0; - while (rbStart < bwpSize && !rballoc_mask[rbStart]) + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) rbStart++; if (rbStart >= bwpSize) { LOG_D(NR_MAC, "cannot allocate retransmission for UE %d/RNTI %04x: no resources\n", UE_id, UE_info->rnti[UE_id]); return false; } - while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize] && rbSize < retInfo->rbSize) + while (rbStart + rbSize < bwpSize && + (rballoc_mask[rbStart + rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex)) && + rbSize < retInfo->rbSize) rbSize++; } /* check whether we need to switch the TDA allocation since the last @@ -577,13 +580,15 @@ bool allocate_dl_retransmission(module_id_t module_id, } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ - while (rbStart < bwpSize && !rballoc_mask[rbStart]) - rbStart++; - while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) - rbSize++; NR_pdsch_semi_static_t temp_ps; temp_ps.nrOfLayers = 1; nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + rbStart++; + while (rbStart + rbSize < bwpSize && + (rballoc_mask[rbStart + rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + rbSize++; uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, @@ -642,7 +647,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* retransmissions: directly allocate */ *n_rb_sched -= sched_ctrl->sched_pdsch.rbSize; for (int rb = 0; rb < sched_ctrl->sched_pdsch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] = 0; + rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= (((1<nrOfSymbols)-1)<startSymbolIndex); return true; } @@ -655,7 +660,7 @@ void pf_dl(module_id_t module_id, NR_list_t *UE_list, int max_num_ue, int n_rb_sched, - uint8_t *rballoc_mask) { + uint16_t *rballoc_mask) { gNB_MAC_INST *mac = RC.nrmac[module_id]; NR_UE_info_t *UE_info = &mac->UE_info; @@ -769,13 +774,6 @@ void pf_dl(module_id_t module_id, return; } - // Freq-demain allocation - while (rbStart < bwpSize && !rballoc_mask[rbStart]) rbStart++; - - uint16_t max_rbSize = 1; - while (rbStart + max_rbSize < bwpSize && rballoc_mask[rbStart + max_rbSize]) - max_rbSize++; - /* MCS has been set above */ const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; @@ -785,6 +783,17 @@ void pf_dl(module_id_t module_id, const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; if (ps->time_domain_allocation != tda) nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); + + // Freq-demain allocation + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + rbStart++; + + uint16_t max_rbSize = 1; + while (rbStart + max_rbSize < bwpSize && + (rballoc_mask[rbStart + max_rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + max_rbSize++; + sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; @@ -806,7 +815,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] = 0; + rballoc_mask[rb + sched_pdsch->rbStart] -= (((1<nrOfSymbols)-1)<startSymbolIndex); } } @@ -819,9 +828,18 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; const int CC_id = 0; - /* Get bwpSize from the first UE */ + /* Get bwpSize and TDAfrom the first UE */ + /* This is temporary and it assumes all UEs have the same BWP and TDA*/ int UE_id = UE_info->list.head; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; + int startSymbolIndex, nrOfSymbols; + const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = sched_ctrl->active_bwp ? + sched_ctrl->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); + const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; + SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth: @@ -833,13 +851,16 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t MAX_BWP_SIZE); uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map; - uint8_t rballoc_mask[bwpSize]; + uint16_t rballoc_mask[bwpSize]; int n_rb_sched = 0; for (int i = 0; i < bwpSize; i++) { // calculate mask: init with "NOT" vrb_map: // if any RB in vrb_map is blocked (1), the current RBG will be 0 - rballoc_mask[i] = !vrb_map[i+BWPStart]; - n_rb_sched += rballoc_mask[i]; + rballoc_mask[i] = (~vrb_map[i+BWPStart])&0x3fff; //bitwise not and 14 symbols + // if all the pdsch symbols are free + if((rballoc_mask[i]&(((1<UE_sched_ctrl[UE_id]; + const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; + const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; + NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; + ps->nrOfLayers = target_dl_Nl; + if (ps->time_domain_allocation != tda) + nr_set_pdsch_semi_static( + scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps); + /* find largest unallocated chunk */ const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); const int BWPStart = NRRIV2PRBOFFSET(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); @@ -289,11 +297,14 @@ void nr_preprocessor_phytest(module_id_t module_id, /* loop ensures that we allocate exactly target_dl_bw, or return */ while (true) { /* advance to first free RB */ - while (rbStart < bwpSize && vrb_map[rbStart + BWPStart]) + while (rbStart < bwpSize && + (vrb_map[rbStart + BWPStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) rbStart++; rbSize = 1; /* iterate until we are at target_dl_bw or no available RBs */ - while (rbStart + rbSize < bwpSize && !vrb_map[rbStart + rbSize + BWPStart] && rbSize < target_dl_bw) + while (rbStart + rbSize < bwpSize && + !(vrb_map[rbStart + rbSize + BWPStart]&(((1<nrOfSymbols)-1)<startSymbolIndex)) && + rbSize < target_dl_bw) rbSize++; /* found target_dl_bw? */ if (rbSize == target_dl_bw) @@ -369,16 +380,9 @@ void nr_preprocessor_phytest(module_id_t module_id, // rnti, frame, slot); NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; - NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; sched_pdsch->pucch_allocation = alloc; sched_pdsch->rbStart = rbStart; sched_pdsch->rbSize = rbSize; - const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; - const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; - ps->nrOfLayers = target_dl_Nl; - if (ps->time_domain_allocation != tda) - nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps); sched_pdsch->mcs = target_dl_mcs; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -398,7 +402,7 @@ void nr_preprocessor_phytest(module_id_t module_id, /* mark the corresponding RBs as used */ for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - vrb_map[rb + sched_pdsch->rbStart + BWPStart] = 1; + vrb_map[rb + sched_pdsch->rbStart + BWPStart] = ((1<nrOfSymbols)-1)<startSymbolIndex; if ((frame&127) == 0) LOG_D(MAC,"phytest: %d.%d DL mcs %d, DL rbStart %d, DL rbSize %d\n", frame, slot, sched_pdsch->mcs, rbStart,rbSize); } From e013208451fd3b9faba6139d75b286fa5a3f3cc0 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 2 Dec 2021 11:01:01 +0000 Subject: [PATCH 154/883] Remove temporary xer_fprint --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 3f64f4209b..a7a84edb68 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1211,8 +1211,6 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_res0->spatialRelationInfo->referenceSignal.choice.csi_RS_Index=0; ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceToAddModList->list,srs_res0); - xer_fprint(stdout, &asn_DEF_NR_SetupRelease_SRS_Config, (const void*)initialUplinkBWP->srs_Config); - // configure Scheduling request // 40 slot period pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList)); From 13d6147e03db0c40a80ef5f4826a2fb493d542de Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Thu, 2 Dec 2021 13:31:15 +0100 Subject: [PATCH 155/883] fix code review and cross compilation issue --- openair1/PHY/CODING/crc_byte.c | 38 +++++++++++++++---------------- openair1/PHY/CODING/nrLDPC_defs.h | 20 ++++++++-------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 277598b4b4..c3b141db8e 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -153,22 +153,22 @@ unsigned int crc24a (unsigned char * inptr, { int octetlen = bitlen / 8; /* Change in octets */ -#ifndef USE_INTEL_CRC - unsigned int crc = 0; - int resbit = (bitlen % 8); - - while (octetlen-- > 0) { - // printf("crc24a: in %x => crc %x\n",crc,*inptr); - crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; - } - - if (resbit > 0) - crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; - return crc; -#else - return crc32_calc_pclmulqdq(inptr, octetlen, 0, + if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) { + unsigned int crc = 0; + int resbit = (bitlen % 8); + + while (octetlen-- > 0) { + // printf("crc24a: in %x => crc %x\n",crc,*inptr); + crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; + } + + if (resbit > 0) + crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; + return crc; + } else { + return crc32_calc_pclmulqdq(inptr, octetlen, 0, <e_crc24a_pclmulqdq); -#endif + } } @@ -186,8 +186,8 @@ unsigned int crc24b (unsigned char * inptr, int bitlen) { int octetlen = bitlen / 8; /* Change in octets */ - -#ifndef USE_INTEL_CRC + + if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) { unsigned int crc = 0; int resbit = (bitlen % 8); @@ -200,10 +200,10 @@ unsigned int crc24b (unsigned char * inptr, crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; return crc; -#else + } else { return crc32_calc_pclmulqdq(inptr, octetlen, 0, <e_crc24b_pclmulqdq); -#endif + } } unsigned int crc24c (unsigned char * inptr, diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index 67248d971c..0d7ff9ef9f 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -38,12 +38,12 @@ */ typedef struct { unsigned int n_segments; // optim8seg - unsigned int macro_num; // optim8segmulti - unsigned char gen_code; //orig - time_stats_t *tinput; - time_stats_t *tprep; - time_stats_t *tparity; - time_stats_t *toutput; + unsigned int macro_num; // optim8segmulti + unsigned char gen_code; //orig + time_stats_t *tinput; + time_stats_t *tprep; + time_stats_t *tparity; + time_stats_t *toutput; int Kr; uint32_t Kb; uint32_t *Zc; @@ -58,10 +58,10 @@ typedef struct { uint32_t F; /// LDPC-code outputs uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; -}encoder_implemparams_t; +} encoder_implemparams_t; #define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL} -typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out); -typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t*); +typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out); +typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t *); //============================================================================================================================ // decoder interface /** @@ -71,5 +71,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho \param p_llrOut Output vector \param p_profiler LDPC profiler statistics */ -typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* ); +typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_procBuf *, t_nrLDPC_time_stats * ); #endif From 222ff5c11d313a6214a6ca277e8552731f7f75fb Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 2 Nov 2021 17:24:10 +0000 Subject: [PATCH 156/883] Fix segmentation fault when exporting packets to wireshark with high MCS --- openair2/UTIL/OPT/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c index e64f7724c6..8731eb294a 100644 --- a/openair2/UTIL/OPT/probe.c +++ b/openair2/UTIL/OPT/probe.c @@ -408,7 +408,7 @@ static void SendFrameNR(guint8 radioType, guint8 direction, guint8 rntiType, guint8 isPredefinedData, guint8 retx, guint8 crcStatus, guint8 oob_event, guint8 oob_event_value, uint8_t *pdu_buffer, unsigned int pdu_buffer_size) { - unsigned char frameBuffer[9000]; + unsigned char frameBuffer[12000]; unsigned int frameOffset; ssize_t bytesSent; frameOffset = 0; From 75057be8ef1fa6055f5e93b87901b55a537eaee9 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 3 Dec 2021 16:17:20 +0000 Subject: [PATCH 157/883] Add missing configuration for NSA --- common/utils/nr/nr_common.h | 1 + openair2/RRC/NR/rrc_gNB_reconfig.c | 46 +++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index d9f2b0c03a..8aded5b1be 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -71,6 +71,7 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); int get_dmrs_port(int nl, uint16_t dmrs_ports); +long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 980bd39c37..2cacd8ccf3 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -61,6 +61,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n"); + // This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4. + // However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources, + // where the startPosition = 1, 2 or 3 and sl40 = 7, 17, 27 or 37 only give us 12 different allocations. + AssertFatal(uid>=0 && uid<12, "gNB cannot allocate the SRS resources\n"); + uint64_t bitmap=0; switch (servingcellconfigcommon->ssb_PositionsInBurst->present) { case 1 : @@ -796,13 +801,21 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco *srs_resset0_id=0; ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list,srs_resset0_id); srs_Config->srs_ResourceToReleaseList=NULL; - srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic; - srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic)); - srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1; - srs_resset0->resourceType.choice.aperiodic->csi_RS=NULL; - srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset)); - *srs_resset0->resourceType.choice.aperiodic->slotOffset=2; - srs_resset0->resourceType.choice.aperiodic->ext1=NULL; + + if(0) { + srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic; + srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic)); + srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1; + srs_resset0->resourceType.choice.aperiodic->csi_RS=NULL; + srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset)); + *srs_resset0->resourceType.choice.aperiodic->slotOffset=2; + srs_resset0->resourceType.choice.aperiodic->ext1=NULL; + } else { + srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; + srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic)); + srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL; + } + srs_resset0->usage=NR_SRS_ResourceSet__usage_codebook; srs_resset0->alpha = calloc(1,sizeof(*srs_resset0->alpha)); *srs_resset0->alpha = NR_Alpha_alpha1; @@ -821,17 +834,28 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco srs_res0->transmissionComb.choice.n2=calloc(1,sizeof(*srs_res0->transmissionComb.choice.n2)); srs_res0->transmissionComb.choice.n2->combOffset_n2=0; srs_res0->transmissionComb.choice.n2->cyclicShift_n2=0; - srs_res0->resourceMapping.startPosition=2; + srs_res0->resourceMapping.startPosition = 1 + uid%3; srs_res0->resourceMapping.nrofSymbols=NR_SRS_Resource__resourceMapping__nrofSymbols_n1; srs_res0->resourceMapping.repetitionFactor=NR_SRS_Resource__resourceMapping__repetitionFactor_n1; srs_res0->freqDomainPosition=0; srs_res0->freqDomainShift=0; - srs_res0->freqHopping.c_SRS = 0; srs_res0->freqHopping.b_SRS=0; srs_res0->freqHopping.b_hop=0; + srs_res0->freqHopping.c_SRS = rrc_get_max_nr_csrs( + NRRIV2BW(servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, 275), + srs_res0->freqHopping.b_SRS); srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither; - srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; - srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); + + if(0) { + srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; + srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); + } else { + srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; + srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 7 + (uid/3)*10; // 7/17/27/37 are mixed slots + } + srs_res0->sequenceId=40; srs_res0->spatialRelationInfo=calloc(1,sizeof(*srs_res0->spatialRelationInfo)); srs_res0->spatialRelationInfo->servingCellId=NULL; From a41b131f21e198a160f5c2064858bc041ad10b2a Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 3 Dec 2021 18:07:33 +0000 Subject: [PATCH 158/883] Fix first SRS reception at gNB --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index 3ef234a2ed..12d30d59a4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -123,7 +123,7 @@ void nr_schedule_srs(int module_id, frame_t frame) { sched_ctrl->sched_srs.slot = -1; sched_ctrl->sched_srs.srs_scheduled = false; - if(!UE_info->active[UE_id]) { + if(!UE_info->Msg4_ACKed[UE_id]) { continue; } From 5301e0a110ad9f2dc9d88f1778e66c1a07c34b1f Mon Sep 17 00:00:00 2001 From: rmagueta Date: Sat, 4 Dec 2021 13:58:57 +0000 Subject: [PATCH 159/883] Fix SRS mapping above PRB 53 to work with COTS --- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 83 ++++++++++++------- openair1/PHY/NR_TRANSPORT/srs_rx.c | 21 +++-- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 21 ++--- 3 files changed, 76 insertions(+), 49 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index c04f1f1731..29df722aa3 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1120,7 +1120,6 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; int32_t **srs_ls_estimated_channel = nr_srs_info->srs_ls_estimated_channel; - uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; uint16_t noise_real[frame_parms->nb_antennas_rx*nr_srs_info->n_symbs]; uint16_t noise_imag[frame_parms->nb_antennas_rx*nr_srs_info->n_symbs]; @@ -1133,23 +1132,23 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); memset(srs_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[0] + subcarrier_offset]; + int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[0]]; for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { - int16_t generated_real = srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF; - int16_t generated_imag = (srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]>>16)&0xFFFF; + int16_t generated_real = srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF; + int16_t generated_imag = (srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF; - int16_t received_real = srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF; - int16_t received_imag = (srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]>>16)&0xFFFF; + int16_t received_real = srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF; + int16_t received_imag = (srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF; // We know that nr_srs_info->srs_generated_signal_bits bits are enough to represent the generated_real and generated_imag. // So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits. ls_estimated[0] = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits); ls_estimated[1] = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); - srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset] = ls_estimated[0] + (((int32_t)ls_estimated[1]<<16)&0xFFFF0000); + srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]] = ls_estimated[0] + (((int32_t)ls_estimated[1]<<16)&0xFFFF0000); - if(sc_idx>0) { + if(sc_idx>0 && nr_srs_info->subcarrier_idx[sc_idx]>nr_srs_info->subcarrier_idx[sc_idx-1]) { ls_estimated[0] = (ls_estimated[0] + prev_ls_estimated[0])>>1; ls_estimated[1] = (ls_estimated[1] + prev_ls_estimated[1])>>1; } @@ -1160,35 +1159,55 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, if(srs_pdu->comb_size == 0) { if(sc_idx == 0) { multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); + } else if(nr_srs_info->subcarrier_idx[sc_idx]subcarrier_idx[sc_idx-1]) { + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx+2]] - 8; + multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); + } else if( (sc_idx < (nr_srs_info->n_symbs-1) && nr_srs_info->subcarrier_idx[sc_idx+1]subcarrier_idx[sc_idx]) || (sc_idx == (nr_srs_info->n_symbs-1))) { + multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); + srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; } else if(sc_idx%2 == 1) { multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); } else if(sc_idx%2 == 0) { multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8); - srs_estimated_channel16+=8; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; } } else { if(sc_idx>0) { multadd_real_vector_complex_scalar(filt8_dcr0_h, ls_estimated, srs_estimated_channel16, 8); - srs_estimated_channel16+=8; + if(nr_srs_info->subcarrier_idx[sc_idx]subcarrier_idx[sc_idx-1]) { + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx+1]] - 8; + } else { + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + } srs_estimated_channel16[0] = 0; srs_estimated_channel16[1] = 0; } multadd_real_vector_complex_scalar(filt8_dcl0_h, ls_estimated, srs_estimated_channel16, 8); + if(sc_idx == (nr_srs_info->n_symbs-1)) { + srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+2] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+3] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + } } - noise_real[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF)); - noise_imag[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]>>16)&0xFFFF)); + noise_real[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF)); + noise_imag[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF)); #ifdef SRS_DEBUG + uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; + int subcarrier_log = nr_srs_info->subcarrier_idx[sc_idx]-subcarrier_offset; + if(subcarrier_log < 0) { + subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size; + } if(sc_idx == 0) { LOG_I(NR_PHY,"______________________________ Rx antenna %i _______________________________\n", ant); } - if(nr_srs_info->subcarrier_idx[sc_idx]%12 == 0) { - LOG_I(NR_PHY,":::::::::::::::::::::::::::::::::::: %i ::::::::::::::::::::::::::::::::::::\n", nr_srs_info->subcarrier_idx[sc_idx]/12); + if(subcarrier_log%12 == 0) { + LOG_I(NR_PHY,":::::::::::::::::::::::::::::::::::: %i ::::::::::::::::::::::::::::::::::::\n", subcarrier_log/12); LOG_I(NR_PHY,"\t __genRe________genIm__|____rxRe_________rxIm__|____lsRe________lsIm_\n"); } LOG_I(NR_PHY,"(%4i) %6i\t%6i | %6i\t%6i | %6i\t%6i\n", - nr_srs_info->subcarrier_idx[sc_idx], + subcarrier_log, generated_real, generated_imag, received_real, received_imag, prev_ls_estimated[0], prev_ls_estimated[1]); @@ -1200,24 +1219,32 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, + calc_power(noise_imag,frame_parms->nb_antennas_rx*nr_srs_info->n_symbs); #ifdef SRS_DEBUG - uint8_t shift = srs_pdu->comb_size == 0 ? 1 : 2; + uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; + uint8_t R = srs_pdu->comb_size == 0 ? 2 : 4; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { - for(int sc = 0; sc <= nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs-1]; sc++) { - if(sc == 0) { + for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { + int subcarrier_log = nr_srs_info->subcarrier_idx[sc_idx]-subcarrier_offset; + if(subcarrier_log < 0) { + subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size; + } + if(sc_idx == 0) { LOG_I(NR_PHY,"______________________________ Rx antenna %i _______________________________\n", ant); } - if(sc%12 == 0) { - LOG_I(NR_PHY,":::::::::::::::::::::::::::::::::::: %i ::::::::::::::::::::::::::::::::::::\n", sc/12); + if(subcarrier_log%12 == 0) { + LOG_I(NR_PHY,":::::::::::::::::::::::::::::::::::: %i ::::::::::::::::::::::::::::::::::::\n", subcarrier_log/12); LOG_I(NR_PHY,"\t __lsRe__________lsIm__|____intRe_______intIm__|____noiRe_______noiIm_\n"); } - LOG_I(NR_PHY,"(%4i) %6i\t%6i | %6i\t%6i | %6i\t%6i\n", - sc, - (int16_t)(srs_ls_estimated_channel[ant][sc+subcarrier_offset]&0xFFFF), - (int16_t)((srs_ls_estimated_channel[ant][sc+subcarrier_offset]>>16)&0xFFFF), - (int16_t)(srs_estimated_channel[ant][sc+subcarrier_offset]&0xFFFF), - (int16_t)((srs_estimated_channel[ant][sc+subcarrier_offset]>>16)&0xFFFF), - noise_real[ant*nr_srs_info->n_symbs+(sc>>shift)], - noise_imag[ant*nr_srs_info->n_symbs+(sc>>shift)]); + for(int r = 0; rsubcarrier_idx[sc_idx]+r]&0xFFFF), + (int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF), + (int16_t)(srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF), + (int16_t)((srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF), + noise_real[ant*nr_srs_info->n_symbs+sc_idx], + noise_imag[ant*nr_srs_info->n_symbs+sc_idx]); + } + } } LOG_I(NR_PHY,"noise_power = %u\n", *noise_power); diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index 7178b63ea1..bb329ca1f5 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -107,28 +107,31 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, uint8_t l0 = frame_parms->symbols_per_slot - 1 - srs_pdu->time_start_position; // starting symbol in this slot uint64_t symbol_offset = (n_symbols+l0)*frame_parms->ofdm_symbol_size; - uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; - int32_t *rx_signal; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { memset(srs_received_signal[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - rx_signal = &rxdataF[ant][symbol_offset + subcarrier_offset]; + rx_signal = &rxdataF[ant][symbol_offset]; for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { - srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset] = rx_signal[nr_srs_info->subcarrier_idx[sc_idx]]; + srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]] = rx_signal[nr_srs_info->subcarrier_idx[sc_idx]]; #ifdef SRS_DEBUG + uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; + int subcarrier_log = nr_srs_info->subcarrier_idx[sc_idx]-subcarrier_offset; + if(subcarrier_log < 0) { + subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size; + } if(sc_idx == 0) { LOG_I(NR_PHY,"________ Rx antenna %i ________\n", ant); } - if(nr_srs_info->subcarrier_idx[sc_idx]%12 == 0) { - LOG_I(NR_PHY,"::::::::::::: %i :::::::::::::\n", nr_srs_info->subcarrier_idx[sc_idx]/12); + if(subcarrier_log%12 == 0) { + LOG_I(NR_PHY,"::::::::::::: %i :::::::::::::\n", subcarrier_log/12); } LOG_I(NR_PHY,"(%i) \t%i\t%i\n", - nr_srs_info->subcarrier_idx[sc_idx], - srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]&0xFFFF, - (srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx] + subcarrier_offset]>>16)&0xFFFF); + subcarrier_log, + (int16_t)(srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF), + (int16_t)((srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF)); #endif } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index d1521943fd..262afa8fcc 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -203,8 +203,6 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, /* for each antenna ports for transmission */ for (int p_index = 0; p_index < N_ap; p_index++) { - uint8_t ofdm_symbol = 0; - /* see TS 38.211 6.4.1.4.2 Sequence generation */ n_SRS_cs_i = (n_SRS_cs + (n_SRS_cs_max * (SRS_antenna_port[p_index] - 1000)/N_ap))%n_SRS_cs_max; @@ -373,29 +371,28 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, rv_ul_ref_sig[u][v_nu][M_sc_b_SRS_index][2*k+1]); #endif - txptr[subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000); + txptr[subcarrier] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000); if(nr_srs_info) { - nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs] = subcarrier + ofdm_symbol*frame_parms->ofdm_symbol_size - subcarrier_offset; + nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs] = subcarrier; nr_srs_info->n_symbs++; } #ifdef SRS_DEBUG - if( (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-subcarrier_offset)%12 == 0 ) { - LOG_I(NR_PHY,"------------ %lu ------------\n", - (subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-subcarrier_offset)/12); + int subcarrier_log = subcarrier-subcarrier_offset; + if(subcarrier_log < 0) { + subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size; } - LOG_I(NR_PHY,"(%lu) \t%i\t%i\n", - subcarrier+ofdm_symbol*frame_parms->ofdm_symbol_size-subcarrier_offset, - real_amp&0xFFFF, - imag_amp&0xFFFF); + if( subcarrier_log%12 == 0 ) { + LOG_I(NR_PHY,"------------ %d ------------\n", subcarrier_log/12); + } + LOG_I(NR_PHY,"(%d) \t%i\t%i\n", subcarrier_log, (int16_t)(real_amp&0xFFFF), (int16_t)(imag_amp&0xFFFF)); #endif subcarrier += (K_TC); /* subcarrier increment */ if (subcarrier >= frame_parms->ofdm_symbol_size) { subcarrier=subcarrier-frame_parms->ofdm_symbol_size; - ofdm_symbol++; } } From 5f0a9fba894e6623b51765606822a25dfc6c5253 Mon Sep 17 00:00:00 2001 From: francescomani Date: Sat, 4 Dec 2021 15:49:33 +0100 Subject: [PATCH 160/883] reworking handling pdcch at mac, including support for multiple pdcch pdu --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 +- openair2/LAYER2/NR_MAC_gNB/config.c | 11 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 8 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 68 +++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 36 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 77 ++++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 57 ++-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 316 +++++++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 95 +++++- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 28 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 25 +- 11 files changed, 510 insertions(+), 215 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 72e8d11be6..affa7fd803 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1038,8 +1038,6 @@ int main(int argc, char **argv) while ((roundack==0)) { - memset(RC.nrmac[0]->cce_list[0],0,MAX_NUM_CCE*sizeof(int)); - memset(RC.nrmac[0]->cce_list[1],0,MAX_NUM_CCE*sizeof(int)); clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot); UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1); @@ -1047,7 +1045,7 @@ int main(int argc, char **argv) UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].round = round; for (int i=0; iUE_info.num_pdcch_cand[0][i] = 0; + gNB_mac->UE_info.pdcch_cand[i] = 0; if (css_flag == 0) { nr_schedule_ue_spec(0, frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index cedd095794..a99f08b641 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -535,7 +535,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, if (CellGroup) { const NR_ServingCellConfig_t *servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated; - const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList; if(bwpList) { AssertFatal(bwpList->list.count > 0, "downlinkBWP_ToAddModList has no BWPs!\n"); @@ -605,6 +604,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, } LOG_I(NR_MAC,"Added new RA process for UE RNTI %04x with initial CellGroup\n", rnti); } else { // CellGroup has been updated + NR_ServingCellConfigCommon_t *scc = RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon; const int UE_id = find_nr_UE_id(Mod_idP,rnti); int target_ss; UE_info->CellGroup[UE_id] = CellGroup; @@ -612,19 +612,28 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]); // update coreset/searchspace void *bwpd = NULL; + NR_BWP_t *genericParameters = NULL; target_ss = NR_SearchSpace__searchSpaceType_PR_common; if ((UE_info->UE_sched_ctrl[UE_id].active_bwp)) { target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; bwpd = (void*)UE_info->UE_sched_ctrl[UE_id].active_bwp->bwp_Dedicated; + genericParameters = &UE_info->UE_sched_ctrl[UE_id].active_bwp->bwp_Common->genericParameters; } else if (CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated && (CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP)) { target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; + genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; } UE_info->UE_sched_ctrl[UE_id].search_space = get_searchspace(scc, bwpd, target_ss); UE_info->UE_sched_ctrl[UE_id].coreset = get_coreset(Mod_idP, scc, bwpd, UE_info->UE_sched_ctrl[UE_id].search_space, target_ss); + UE_info->UE_sched_ctrl[UE_id].sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP], + UE_info->UE_sched_ctrl[UE_id].search_space, + UE_info->UE_sched_ctrl[UE_id].coreset, + scc, + genericParameters, + NULL); UE_info->UE_sched_ctrl[UE_id].maxL = 2; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index c4e1fbff96..1fd6417214 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -306,12 +306,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_rrc_trigger(&ctxt, 0 /*CC_id*/, frame, slot >> *scc->ssbSubcarrierSpacing); } - memset(RC.nrmac[module_idP]->cce_list[0],0,MAX_NUM_CCE*sizeof(int)); // coreset0 - memset(RC.nrmac[module_idP]->cce_list[1],0,MAX_NUM_CCE*sizeof(int)); // coreset1 - NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info; - for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) - for (int i=0; inum_pdcch_cand[UE_id][i] = 0; + for (int i=0; ipdcch_cand[i] = 0; for (int CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { //mbsfn_status[CC_id] = 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 8a9c5b3f52..e5b96ccaa5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -581,12 +581,15 @@ void nr_initiate_ra_proc(module_id_t module_idP, NR_SearchSpaceId_t ra_SearchSpace = 0; struct NR_PDCCH_ConfigCommon__commonSearchSpaceList *commonSearchSpaceList = NULL; + NR_BWP_t *genericParameters = NULL; if(bwp) { commonSearchSpaceList = bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; ra_SearchSpace = *bwp->bwp_Common->pdcch_ConfigCommon->choice.setup->ra_SearchSpace; + genericParameters = &bwp->bwp_Common->genericParameters; } else { commonSearchSpaceList = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList; ra_SearchSpace = *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_SearchSpace; + genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; } AssertFatal(commonSearchSpaceList->list.count > 0, "common SearchSpace list has 0 elements\n"); @@ -599,6 +602,14 @@ void nr_initiate_ra_proc(module_id_t module_idP, AssertFatal(ra->ra_ss!=NULL,"SearchSpace cannot be null for RA\n"); + ra->coreset = get_coreset(module_idP, scc, bwp, ra->ra_ss, NR_SearchSpace__searchSpaceType_PR_common); + ra->sched_pdcch = set_pdcch_structure(nr_mac, + ra->ra_ss, + ra->coreset, + scc, + genericParameters, + NULL); + // retrieving ra pdcch monitoring period and offset find_monitoring_periodicity_offset_common(ra->ra_ss, &monitoring_slot_period, &monitoring_offset); @@ -774,7 +785,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t // generation of DCI 0_0 to schedule msg3 retransmission NR_SearchSpace_t *ss = ra->ra_ss; - NR_ControlResourceSet_t *coreset = get_coreset(module_idP, scc, NULL, ss, NR_SearchSpace__searchSpaceType_PR_common); + NR_ControlResourceSet_t *coreset = ra->coreset; AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg3 retransmission\n"); nfapi_nr_ul_dci_request_t *ul_dci_req = &nr_mac->UL_dci_req[CC_id]; @@ -788,7 +799,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu_rel15 = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -800,7 +811,13 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t if(nr_of_candidates>0) break; } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - int CCEIndex = allocate_nr_CCEs(nr_mac, NULL, coreset, aggregation_level, 0, 0, nr_of_candidates); + int CCEIndex = find_pdcch_candidate(nr_mac, + CC_id, + aggregation_level, + nr_of_candidates, + ra->sched_pdcch, + coreset, + 0); if (CCEIndex < 0) { LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); return; @@ -841,6 +858,13 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ra->bwp_id); // Mark the corresponding RBs as used + + fill_pdcch_vrb_map(nr_mac, + CC_id, + ra->sched_pdcch, + CCEIndex, + aggregation_level); + for (int rb = 0; rb < ra->msg3_nb_rb; rb++) { vrb_map_UL[rbStart + BWPStart + rb] = 1; } @@ -1150,7 +1174,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); AssertFatal(startSymbolIndex >= 0, "StartSymbolIndex is negative\n"); - coreset = get_coreset(module_idP, scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common); + coreset = ra->coreset; AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg2\n"); @@ -1182,7 +1206,15 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if(nr_of_candidates>0) break; } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates); + + int CCEIndex = find_pdcch_candidate(nr_mac, + CC_id, + aggregation_level, + nr_of_candidates, + ra->sched_pdcch, + coreset, + 0); + if (CCEIndex < 0) { LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); return; @@ -1204,7 +1236,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1363,6 +1395,11 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->TX_req[CC_id].Slot = slotP; // Mark the corresponding symbols RBs as used + fill_pdcch_vrb_map(nr_mac, + CC_id, + ra->sched_pdcch, + CCEIndex, + aggregation_level); for (int rb = 0; rb < rbSize; rb++) { vrb_map[BWPStart + rb + rbStart] = ((1<downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; } - coreset = get_coreset(module_idP, scc, bwp, ss, NR_SearchSpace__searchSpaceType_PR_common); + coreset = ra->coreset; AssertFatal(coreset!=NULL,"Coreset cannot be null for RA-Msg4\n"); @@ -1447,7 +1484,15 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if(nr_of_candidates>0) break; } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - int CCEIndex = allocate_nr_CCEs(nr_mac, bwp, coreset, aggregation_level,0,0,nr_of_candidates); + + int CCEIndex = find_pdcch_candidate(nr_mac, + CC_id, + aggregation_level, + nr_of_candidates, + ra->sched_pdcch, + coreset, + 0); + if (CCEIndex < 0) { LOG_E(NR_MAC, "%s(): cannot find free CCE for RA RNTI %04x!\n", __func__, ra->rnti); return; @@ -1580,7 +1625,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(nr_mac, pdcch_pdu_rel15, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1722,6 +1767,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->TX_req[CC_id].Slot = slotP; // Mark the corresponding symbols and RBs as used + fill_pdcch_vrb_map(nr_mac, + CC_id, + ra->sched_pdcch, + CCEIndex, + aggregation_level); for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) { vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] = ((1<common_channels[CC_id].vrb_map; + NR_COMMON_channels_t *cc = &gNB_mac->common_channels[CC_id]; + NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; + uint16_t *vrb_map = cc->vrb_map; if (gNB_mac->sched_ctrlCommon == NULL){ LOG_D(NR_MAC,"schedule_control_common: Filling nr_mac->sched_ctrlCommon\n"); @@ -340,6 +342,12 @@ uint32_t schedule_control_sib1(module_id_t module_id, fill_coresetZero(gNB_mac->sched_ctrlCommon->coreset,type0_PDCCH_CSS_config); gNB_mac->cset0_bwp_start = type0_PDCCH_CSS_config->cset_start_rb; gNB_mac->cset0_bwp_size = type0_PDCCH_CSS_config->num_rbs; + gNB_mac->sched_ctrlCommon->sched_pdcch = set_pdcch_structure(NULL, + gNB_mac->sched_ctrlCommon->search_space, + gNB_mac->sched_ctrlCommon->coreset, + scc, + NULL, + type0_PDCCH_CSS_config); } gNB_mac->sched_ctrlCommon->pdsch_semi_static.time_domain_allocation = time_domain_allocation; @@ -354,13 +362,13 @@ uint32_t schedule_control_sib1(module_id_t module_id, if (nr_of_candidates>0) break; // choosing the lower value of aggregation level available } AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - gNB_mac->sched_ctrlCommon->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], - NULL, - gNB_mac->sched_ctrlCommon->coreset, - gNB_mac->sched_ctrlCommon->aggregation_level, - 0, - candidate_idx, - nr_of_candidates); + gNB_mac->sched_ctrlCommon->cce_index = find_pdcch_candidate(gNB_mac, + CC_id, + gNB_mac->sched_ctrlCommon->aggregation_level, + nr_of_candidates, + gNB_mac->sched_ctrlCommon->sched_pdcch, + gNB_mac->sched_ctrlCommon->coreset, + 0); AssertFatal(gNB_mac->sched_ctrlCommon->cce_index >= 0, "Could not find CCE for coreset0\n"); @@ -412,6 +420,11 @@ uint32_t schedule_control_sib1(module_id_t module_id, LOG_D(MAC,"N_PRB_DMRS = %d\n",N_PRB_DMRS); LOG_D(MAC,"mappingtype = %d\n", mappingtype); // Mark the corresponding RBs as used + fill_pdcch_vrb_map(gNB_mac, + CC_id, + gNB_mac->sched_ctrlCommon->sched_pdcch, + gNB_mac->sched_ctrlCommon->cce_index, + gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { vrb_map[rb + rbStart] = ((1<PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(NULL, - pdcch_pdu_rel15, - gNB_mac->sched_ctrlCommon->search_space, + nr_configure_pdcch(pdcch_pdu_rel15, gNB_mac->sched_ctrlCommon->coreset, - scc, NULL, - type0_PDCCH_CSS_config); + gNB_mac->sched_ctrlCommon->sched_pdcch); nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 30724db595..fd07b66bf6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -612,8 +612,27 @@ bool allocate_dl_retransmission(module_id_t module_id, } /* Find a free CCE */ - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + /* CC_id = */ 0, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + if (CCEIndex<0) { LOG_D(MAC, "%4d.%2d could not find CCE for DL DCI retransmission UE %d/RNTI %04x\n", frame, slot, UE_id, UE_info->rnti[UE_id]); return false; @@ -630,14 +649,18 @@ bool allocate_dl_retransmission(module_id_t module_id, UE_info->rnti[UE_id], frame, slot); - int cid = sched_ctrl->coreset->controlResourceSetId; - UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = RC.nrmac[module_id]->cce_list[cid]; - for (int i = 0; i < sched_ctrl->aggregation_level; i++) - cce_list[sched_ctrl->cce_index + i] = 0; + RC.nrmac[module_id]->pdcch_cand[cid]--; return false; } + sched_ctrl->cce_index = CCEIndex; + + fill_pdcch_vrb_map(RC.nrmac[module_id], + /* CC_id = */ 0, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + /* just reuse from previous scheduling opportunity, set new start RB */ sched_ctrl->sched_pdsch = *retInfo; sched_ctrl->sched_pdsch.rbStart = rbStart; @@ -746,8 +769,27 @@ void pf_dl(module_id_t module_id, int rbStart = 0; // start wrt BWPstart /* Find a free CCE */ - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + + int CCEIndex = find_pdcch_candidate(mac, + /* CC_id = */ 0, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + if (CCEIndex<0) { LOG_D(NR_MAC, "%4d.%2d could not find CCE for DL DCI UE %d/RNTI %04x\n", frame, slot, UE_id, rnti); continue; } @@ -766,14 +808,18 @@ void pf_dl(module_id_t module_id, rnti, frame, slot); - int cid = sched_ctrl->coreset->controlResourceSetId; - UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = mac->cce_list[cid]; - for (int i = 0; i < sched_ctrl->aggregation_level; i++) - cce_list[sched_ctrl->cce_index + i] = 0; + mac->pdcch_cand[cid]--; return; } + sched_ctrl->cce_index = CCEIndex; + + fill_pdcch_vrb_map(mac, + /* CC_id = */ 0, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + /* MCS has been set above */ const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; @@ -1024,9 +1070,8 @@ void nr_schedule_ue_spec(module_id_t module_id, dl_req->nPDUs += 1; pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; LOG_D(NR_MAC,"Trying to configure DL pdcch for UE %d, bwp %d, cs %d\n",UE_id,bwpid,coresetid); - NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset; - nr_configure_pdcch(gNB_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, sched_ctrl->sched_pdcch); gNB_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index f5f8a91299..b691674b3e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -346,15 +346,16 @@ void nr_preprocessor_phytest(module_id_t module_id, const int cid = sched_ctrl->coreset->controlResourceSetId; const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; - const int m = UE_info->num_pdcch_cand[UE_id][cid]; - sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], - sched_ctrl->active_bwp, - sched_ctrl->coreset, - sched_ctrl->aggregation_level, - Y, - m, - nr_of_candidates); - AssertFatal(sched_ctrl->cce_index >= 0, + + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + AssertFatal(CCEIndex >= 0, "%s(): could not find CCE for UE %d\n", __func__, UE_id); @@ -368,13 +369,18 @@ void nr_preprocessor_phytest(module_id_t module_id, rnti, frame, slot); - UE_info->num_pdcch_cand[UE_id][cid]--; - int *cce_list = RC.nrmac[module_id]->cce_list[cid]; - for (int i = 0; i < sched_ctrl->aggregation_level; i++) - cce_list[sched_ctrl->cce_index + i] = 0; + RC.nrmac[module_id]->pdcch_cand[cid]--; return; } + sched_ctrl->cce_index = CCEIndex; + + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + //AssertFatal(alloc, // "could not find uplink slot for PUCCH (RNTI %04x@%d.%d)!\n", // rnti, frame, slot); @@ -506,19 +512,20 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ const int cid = sched_ctrl->coreset->controlResourceSetId; const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; - const int m = UE_info->num_pdcch_cand[UE_id][cid]; - sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], - sched_ctrl->active_bwp, - sched_ctrl->coreset, - sched_ctrl->aggregation_level, - Y, - m, - nr_of_candidates); + + int CCEIndex = find_pdcch_candidate(nr_mac, + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + if (sched_ctrl->cce_index < 0) { LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PUSCH\n", __func__); + nr_mac->pdcch_cand[cid]--; return false; } - UE_info->num_pdcch_cand[UE_id][cid]++; const int mcs = target_ul_mcs; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; @@ -547,6 +554,12 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ >> 3; /* mark the corresponding RBs as used */ + fill_pdcch_vrb_map(nr_mac, + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + for (int rb = rbStart; rb < rbStart + rbSize; rb++) vrb_map_UL[rb+BWPStart] = 1; return true; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 36ae3c607f..97405b6f32 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -159,6 +159,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_SearchSpace_t *ss, NR_SearchSpace__searchSpaceType_PR ss_type) { NR_ControlResourceSetId_t coreset_id = *ss->controlResourceSetId; + if (ss_type == NR_SearchSpace__searchSpaceType_PR_common) { // common search space NR_ControlResourceSet_t *coreset; if(coreset_id == 0) { @@ -208,48 +209,183 @@ NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, AssertFatal(0, "Couldn't find an adequate searchspace bwp_Dedicated %p\n",bwp_Dedicated); } -int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, - NR_BWP_Downlink_t *bwp, - NR_ControlResourceSet_t *coreset, - int aggregation, - uint16_t Y, - int m, - int nr_of_candidates) { +NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, + NR_SearchSpace_t *ss, + NR_ControlResourceSet_t *coreset, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_t *bwp, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) { - int coreset_id = coreset->controlResourceSetId; + NR_sched_pdcch_t *pdcch = calloc(1,sizeof(NR_sched_pdcch_t)); - int *cce_list = nr_mac->cce_list[coreset_id]; + int sps; + AssertFatal(*ss->controlResourceSetId == coreset->controlResourceSetId, + "coreset id in SS %ld does not correspond to the one in coreset %ld", + *ss->controlResourceSetId, coreset->controlResourceSetId); - int n_rb=0; - for (int i=0;i<6;i++) - for (int j=0;j<8;j++) { - n_rb+=((coreset->frequencyDomainResources.buf[i]>>j)&1); + if (bwp) { // This is not for SIB1 + if(coreset->controlResourceSetId == 0){ + pdcch->BWPSize = gNB_mac->cset0_bwp_size; + pdcch->BWPStart = gNB_mac->cset0_bwp_start; } - n_rb*=6; + else { + pdcch->BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE); + pdcch->BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE); + } + pdcch->SubcarrierSpacing = bwp->subcarrierSpacing; + pdcch->CyclicPrefix = (bwp->cyclicPrefix==NULL) ? 0 : *bwp->cyclicPrefix; - uint16_t N_reg = n_rb * coreset->duration; - uint16_t n_CI = 0; + //AssertFatal(pdcch_scs==kHz15, "PDCCH SCS above 15kHz not allowed if a symbol above 2 is monitored"); + sps = bwp->cyclicPrefix == NULL ? 14 : 12; + } + else { + AssertFatal(type0_PDCCH_CSS_config!=NULL,"type0_PDCCH_CSS_config is null,bwp %p\n",bwp); + pdcch->BWPSize = type0_PDCCH_CSS_config->num_rbs; + pdcch->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; + pdcch->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; + pdcch->CyclicPrefix = 0; + sps = 14; + } - const uint16_t N_cce = N_reg / NR_NB_REG_PER_CCE; - const uint16_t M_s_max = nr_of_candidates; + AssertFatal(ss->monitoringSymbolsWithinSlot!=NULL,"ss->monitoringSymbolsWithinSlot is null\n"); + AssertFatal(ss->monitoringSymbolsWithinSlot->buf!=NULL,"ss->monitoringSymbolsWithinSlot->buf is null\n"); - LOG_D(PHY,"allocate_NR_CCes : bwp_id %d, coreset_id %d : N_cce %d, m %d, nr_of_candidates %d, Y %d\n", - (int)(bwp ? bwp->bwp_Id : 0),coreset_id,N_cce,m,nr_of_candidates, Y); - //PDCCH candidate index m in CORESET exceeds the maximum number of PDCCH candidates - if(m >= nr_of_candidates) - return -1; + // for SPS=14 8 MSBs in positions 13 downto 6 + uint16_t monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | + (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); - int first_cce = aggregation * (( Y + CEILIDIV((m*N_cce),(aggregation*M_s_max)) + n_CI ) % CEILIDIV(N_cce,aggregation)); + for (int i=0; i>(sps-1-i))&1) { + pdcch->StartSymbolIndex=i; + break; + } + } - for (int i=0;iDurationSymbols = coreset->duration; - return(first_cce); + //cce-REG-MappingType + pdcch->CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved? + NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED : NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED; + if (pdcch->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) { + pdcch->RegBundleSize = (coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize == + NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize); + pdcch->InterleaverSize = (coreset->cce_REG_MappingType.choice.interleaved->interleaverSize == + NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->interleaverSize); + AssertFatal(scc->physCellId != NULL,"scc->physCellId is null\n"); + pdcch->ShiftIndex = coreset->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *coreset->cce_REG_MappingType.choice.interleaved->shiftIndex : *scc->physCellId; + } + else { + pdcch->RegBundleSize = 6; + pdcch->InterleaverSize = 0; + pdcch->ShiftIndex = 0; + } + + int N_rb = 0; // nb of rbs of coreset per symbol + for (int i=0;i<6;i++) { + for (int t=0;t<8;t++) { + N_rb+=((coreset->frequencyDomainResources.buf[i]>>t)&1); + } + } + pdcch->n_rb = N_rb*=6; // each bit of frequencyDomainResources represents 6 PRBs + + return pdcch; } + +uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, + int cc_id, + int aggregation, + int nr_of_candidates, + NR_sched_pdcch_t *pdcch, + NR_ControlResourceSet_t *coreset, + uint16_t Y){ + + uint16_t *vrb_map = mac->common_channels[cc_id].vrb_map; + const int next_cand = mac->pdcch_cand[coreset->controlResourceSetId]; + const int N_ci = 0; + + if(next_cand>=nr_of_candidates) { + LOG_D(NR_MAC,"No more available candidates for this coreset\n"); + return -1; + } + + int N_rb = pdcch->n_rb; // nb of rbs of coreset per symbol + int N_symb = coreset->duration; // nb of coreset symbols + int N_regs = N_rb*N_symb; // nb of REGs per coreset + int N_cces = N_regs / NR_NB_REG_PER_CCE; // nb of cces in coreset + + int L = pdcch->RegBundleSize; + int R = pdcch->InterleaverSize; + int n_shift = pdcch->ShiftIndex; + int C = R>0 ? N_regs/(L*R) : 0; + int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle + + int first_cce; + bool taken = false; // flag if the resource for a given candidate are taken + // loop over all the available candidates + for(int m=next_cand; mBWPStart + f*B_rb + rb]&(((1<StartSymbolIndex)) { + taken = true; + break; + } + } + } + } + if(!taken){ + mac->pdcch_cand[coreset->controlResourceSetId] = m++; // using candidate m, next available is m+1 + return first_cce; + } + } + return -1; +} + +void fill_pdcch_vrb_map(gNB_MAC_INST *mac, + int CC_id, + NR_sched_pdcch_t *pdcch, + int first_cce, + int aggregation){ + + uint16_t *vrb_map = mac->common_channels[CC_id].vrb_map; + + int N_rb = pdcch->n_rb; // nb of rbs of coreset per symbol + int L = pdcch->RegBundleSize; + int R = pdcch->InterleaverSize; + int n_shift = pdcch->ShiftIndex; + int N_symb = pdcch->DurationSymbols; + int N_regs = N_rb*N_symb; // nb of REGs per coreset + int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle + int C = R>0 ? N_regs/(L*R) : 0; + + for (int j=first_cce; jBWPStart + f*B_rb + rb] = ((1<StartSymbolIndex; + } + } +} + + bool nr_find_nb_rb(uint16_t Qm, uint16_t R, uint16_t nb_symb_sch, @@ -346,7 +482,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, - const NR_BWP_UplinkDedicated_t *ubwpd, + const NR_BWP_UplinkDedicated_t *ubwpd, long dci_format, int tda, uint8_t num_dmrs_cdm_grps_no_data, @@ -718,81 +854,32 @@ int nr_get_default_pucch_res(int pucch_ResourceCommon) { return(default_pucch_csset[pucch_ResourceCommon]); } -void nr_configure_pdcch(gNB_MAC_INST *gNB_mac, - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, - NR_SearchSpace_t *ss, + + +void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_ControlResourceSet_t *coreset, - NR_ServingCellConfigCommon_t *scc, NR_BWP_t *bwp, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) { + NR_sched_pdcch_t *pdcch) { - int sps; - AssertFatal(*ss->controlResourceSetId == coreset->controlResourceSetId, - "coreset id in SS %ld does not correspond to the one in coreset %ld", - *ss->controlResourceSetId, coreset->controlResourceSetId); - if (bwp) { // This is not for SIB1 - if(coreset->controlResourceSetId == 0){ - pdcch_pdu->BWPSize = gNB_mac->cset0_bwp_size; - pdcch_pdu->BWPStart = gNB_mac->cset0_bwp_start; - } - else { - pdcch_pdu->BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE); - pdcch_pdu->BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE); - } - pdcch_pdu->SubcarrierSpacing = bwp->subcarrierSpacing; - pdcch_pdu->CyclicPrefix = (bwp->cyclicPrefix==NULL) ? 0 : *bwp->cyclicPrefix; - - //AssertFatal(pdcch_scs==kHz15, "PDCCH SCS above 15kHz not allowed if a symbol above 2 is monitored"); - sps = bwp->cyclicPrefix == NULL ? 14 : 12; - } - else { - AssertFatal(type0_PDCCH_CSS_config!=NULL,"type0_PDCCH_CSS_config is null,bwp %p\n",bwp); - pdcch_pdu->BWPSize = type0_PDCCH_CSS_config->num_rbs; - pdcch_pdu->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; - pdcch_pdu->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; - pdcch_pdu->CyclicPrefix = 0; - sps = 14; - } - - AssertFatal(ss->monitoringSymbolsWithinSlot!=NULL,"ss->monitoringSymbolsWithinSlot is null\n"); - AssertFatal(ss->monitoringSymbolsWithinSlot->buf!=NULL,"ss->monitoringSymbolsWithinSlot->buf is null\n"); - - // for SPS=14 8 MSBs in positions 13 downto 6 - uint16_t monitoringSymbolsWithinSlot = (ss->monitoringSymbolsWithinSlot->buf[0]<<(sps-8)) | - (ss->monitoringSymbolsWithinSlot->buf[1]>>(16-sps)); - - for (int i=0; i>(sps-1-i))&1) { - pdcch_pdu->StartSymbolIndex=i; - break; - } - } + pdcch_pdu->BWPSize = pdcch->BWPSize; + pdcch_pdu->BWPStart = pdcch->BWPStart; + pdcch_pdu->SubcarrierSpacing = pdcch->SubcarrierSpacing; + pdcch_pdu->CyclicPrefix = pdcch->CyclicPrefix; + pdcch_pdu->StartSymbolIndex = pdcch->StartSymbolIndex; pdcch_pdu->DurationSymbols = coreset->duration; for (int i=0;i<6;i++) pdcch_pdu->FreqDomainResource[i] = coreset->frequencyDomainResources.buf[i]; - LOG_D(MAC,"Coreset : BWPstart %d, BWPsize %d, SCS %d, freq %x, , duration %d, \n",pdcch_pdu->BWPStart,pdcch_pdu->BWPSize,(int)pdcch_pdu->SubcarrierSpacing,(int)coreset->frequencyDomainResources.buf[0],(int)coreset->duration); + LOG_D(MAC,"Coreset : BWPstart %d, BWPsize %d, SCS %d, freq %x, , duration %d, \n", + pdcch_pdu->BWPStart,pdcch_pdu->BWPSize,(int)pdcch_pdu->SubcarrierSpacing,(int)coreset->frequencyDomainResources.buf[0],(int)coreset->duration); - //cce-REG-MappingType - pdcch_pdu->CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved? - NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED : NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED; - - if (pdcch_pdu->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) { - pdcch_pdu->RegBundleSize = (coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize == - NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize); - pdcch_pdu->InterleaverSize = (coreset->cce_REG_MappingType.choice.interleaved->interleaverSize == - NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->interleaverSize); - AssertFatal(scc->physCellId != NULL,"scc->physCellId is null\n"); - pdcch_pdu->ShiftIndex = coreset->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *coreset->cce_REG_MappingType.choice.interleaved->shiftIndex : *scc->physCellId; - } - else { - pdcch_pdu->RegBundleSize = 0; - pdcch_pdu->InterleaverSize = 0; - pdcch_pdu->ShiftIndex = 0; - } + pdcch_pdu->CceRegMappingType = pdcch->CceRegMappingType; + pdcch_pdu->RegBundleSize = pdcch->RegBundleSize; + pdcch_pdu->InterleaverSize = pdcch->InterleaverSize; + pdcch_pdu->ShiftIndex = pdcch->ShiftIndex; if(coreset->controlResourceSetId == 0) { if(bwp == NULL) @@ -1968,6 +2055,9 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG bwpList->list.count); const int bwp_id = 1; sched_ctrl->active_bwp = bwpList ? bwpList->list.array[bwp_id - 1] : NULL; + NR_BWP_t *genericParameters = sched_ctrl->active_bwp ? + &sched_ctrl->active_bwp->bwp_Common->genericParameters: + &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common; sched_ctrl->search_space = get_searchspace(scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, @@ -1975,6 +2065,12 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG sched_ctrl->coreset = get_coreset(mod_idP, scc, sched_ctrl->active_bwp ? (void*)sched_ctrl->active_bwp->bwp_Dedicated : NULL, sched_ctrl->search_space, target_ss); + sched_ctrl->sched_pdcch = set_pdcch_structure(RC.nrmac[mod_idP], + sched_ctrl->search_space, + sched_ctrl->coreset, + scc, + genericParameters, + NULL); const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig ? servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList : NULL; if (ubwpList) AssertFatal(ubwpList->list.count == 1, "uplinkBWP_ToAddModList has %d BWP!\n", @@ -2388,38 +2484,6 @@ void nr_csirs_scheduling(int Mod_idP, } } -bool find_free_CCE(module_id_t module_id, - sub_frame_t slot, - int UE_id){ - NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[module_id]->UE_info.UE_sched_ctrl[UE_id]; - uint8_t nr_of_candidates; - for (int i=0; i<5; i++) { - // for now taking the lowest value among the available aggregation levels - find_aggregation_candidates(&sched_ctrl->aggregation_level, - &nr_of_candidates, - sched_ctrl->search_space, - 1<0) break; - } - AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); - const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; - const int m = RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid]; - if (UE_id >= 0) LOG_D(NR_MAC,"slot %d calling allocate_nr_CCEs with L %d, nr_of_candidates %d, Y %x\n",slot, sched_ctrl->aggregation_level,nr_of_candidates,Y); - sched_ctrl->cce_index = allocate_nr_CCEs(RC.nrmac[module_id], - sched_ctrl->active_bwp, - sched_ctrl->coreset, - sched_ctrl->aggregation_level, - Y, - m, - nr_of_candidates); - if (sched_ctrl->cce_index < 0) - return false; - - RC.nrmac[module_id]->UE_info.num_pdcch_cand[UE_id][cid]++; - return true; -} - /*void fill_nfapi_coresets_and_searchspaces(NR_CellGroupConfig_t *cg, nfapi_nr_coreset_t *coreset, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bcc0832863..30f5ba1476 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -963,13 +963,38 @@ bool allocate_ul_retransmission(module_id_t module_id, sched_ctrl->pusch_semi_static = temp_ps; } - /* Find free CCE */ - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + /* Find a free CCE */ + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + if (CCEIndex<0) { LOG_D(NR_MAC, "%4d.%2d no free CCE for retransmission UL DCI UE %04x\n", frame, slot, UE_info->rnti[UE_id]); return false; } + sched_ctrl->cce_index = CCEIndex; + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + /* frame/slot in sched_pusch has been set previously. In the following, we * overwrite the information in the retransmission information before storing * as the new scheduling instruction */ @@ -1084,8 +1109,27 @@ void pf_ul(module_id_t module_id, * based on data to transmit) */ if (B == 0 && do_sched) { /* if no data, pre-allocate 5RB */ - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + /* Find a free CCE */ + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + + if (CCEIndex<0) { LOG_D(NR_MAC, "%4d.%2d no free CCE for UL DCI UE %04x (BSR 0)\n", frame, slot, UE_info->rnti[UE_id]); continue; } @@ -1102,6 +1146,13 @@ void pf_ul(module_id_t module_id, return; } + sched_ctrl->cce_index = CCEIndex; + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + /* Save PUSCH field */ /* we want to avoid a lengthy deduction of DMRS and other parameters in * every TTI if we can save it, so check whether dci_format, TDA, or @@ -1167,8 +1218,27 @@ void pf_ul(module_id_t module_id, *max = UE_sched.next[*max]; *p = -1; - bool freeCCE = find_free_CCE(module_id, slot, UE_id); - if (!freeCCE) { + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + + const int cid = sched_ctrl->coreset->controlResourceSetId; + const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + uint8_t nr_of_candidates; + for (int i=0; i<5; i++) { + // for now taking the lowest value among the available aggregation levels + find_aggregation_candidates(&sched_ctrl->aggregation_level, + &nr_of_candidates, + sched_ctrl->search_space, + 1<0) break; + } + int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], + CC_id, + sched_ctrl->aggregation_level, + nr_of_candidates, + sched_ctrl->sched_pdcch, + sched_ctrl->coreset, + Y); + if (CCEIndex<0) { LOG_D(NR_MAC, "%4d.%2d no free CCE for UL DCI UE %04x\n", frame, slot, UE_info->rnti[UE_id]); continue; } @@ -1179,7 +1249,6 @@ void pf_ul(module_id_t module_id, if (max_num_ue < 0) return; - NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; @@ -1232,6 +1301,14 @@ void pf_ul(module_id_t module_id, rbSize, sched_pusch->tb_size, sched_ctrl->estimated_ul_buffer, sched_ctrl->sched_ul_bytes, B,sched_ctrl->cce_index,ps->num_dmrs_symb,ps->N_PRB_DMRS); /* Mark the corresponding RBs as used */ + + sched_ctrl->cce_index = CCEIndex; + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] = 0; @@ -1632,7 +1709,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(nr_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); + nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, sched_ctrl->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 62d70f4f2c..56a24c5b94 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -248,13 +248,31 @@ void find_search_space(int ss_type, NR_BWP_Downlink_t *bwp, NR_SearchSpace_t *ss); -void nr_configure_pdcch(gNB_MAC_INST *gNB_mac, - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, - NR_SearchSpace_t *ss, +void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_ControlResourceSet_t *coreset, - NR_ServingCellConfigCommon_t *scc, NR_BWP_t *bwp, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); + NR_sched_pdcch_t *pdcch); + +NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, + NR_SearchSpace_t *ss, + NR_ControlResourceSet_t *coreset, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_t *bwp, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); + +uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, + int cc_id, + int aggregation, + int nr_of_candidates, + NR_sched_pdcch_t *pdcch, + NR_ControlResourceSet_t *coreset, + uint16_t Y); + +void fill_pdcch_vrb_map(gNB_MAC_INST *mac, + int CC_id, + NR_sched_pdcch_t *pdcch, + int first_cce, + int aggregation); void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *CellGroup, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 99e21b6560..f7bd2a5ac8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -103,6 +103,20 @@ typedef struct NR_preamble_ue { uint8_t *preamble_list; } NR_preamble_ue_t; +typedef struct NR_sched_pdcch { + uint16_t BWPSize; + uint16_t BWPStart; + uint8_t CyclicPrefix; + uint8_t SubcarrierSpacing; + uint8_t StartSymbolIndex; + uint8_t CceRegMappingType; + uint8_t RegBundleSize; + uint8_t InterleaverSize; + uint16_t ShiftIndex; + uint8_t DurationSymbols; + int n_rb; +} NR_sched_pdcch_t; + /*! \brief gNB template for the Random access information */ typedef struct { /// Flag to indicate this process is active @@ -163,6 +177,9 @@ typedef struct { int mac_pdu_length; /// RA search space NR_SearchSpace_t *ra_ss; + /// RA Coreset + NR_ControlResourceSet_t *coreset; + NR_sched_pdcch_t *sched_pdcch; // Beam index uint8_t beam_id; /// CellGroup for UE that is to come (NSA is non-null, null for SA) @@ -298,7 +315,6 @@ typedef struct UE_info { pdschTciStatesActDeact_t pdsch_TCI_States_ActDeact; } NR_UE_mac_ce_ctrl_t; - typedef struct NR_sched_pucch { int frame; int ul_slot; @@ -533,6 +549,7 @@ typedef struct { /// CCE index and aggregation, should be coherent with cce_list NR_SearchSpace_t *search_space; NR_ControlResourceSet_t *coreset; + NR_sched_pdcch_t *sched_pdcch; /// CCE index and Aggr. Level are shared for PUSCH/PDSCH allocation decisions /// corresponding to the sched_pusch/sched_pdsch structures below @@ -652,10 +669,10 @@ typedef struct { /// CCE indexing int Y[MAX_MOBILES_PER_GNB][3][160]; int m[MAX_MOBILES_PER_GNB]; - int num_pdcch_cand[MAX_MOBILES_PER_GNB][MAX_NUM_CORESET]; // UE selected beam index uint8_t UE_beam_index[MAX_MOBILES_PER_GNB]; bool Msg4_ACKed[MAX_MOBILES_PER_GNB]; + } NR_UE_info_t; typedef void (*nr_pp_impl_dl)(module_id_t mod_id, @@ -714,7 +731,7 @@ typedef struct gNB_MAC_INST_s { nfapi_nr_ul_dci_request_t UL_dci_req[NFAPI_CC_MAX]; /// NFAPI DL PDU structure nfapi_nr_tx_data_request_t TX_req[NFAPI_CC_MAX]; - + int pdcch_cand[MAX_NUM_CORESET]; NR_UE_info_t UE_info; /// UL handle @@ -742,8 +759,6 @@ typedef struct gNB_MAC_INST_s { time_stats_t rx_ulsch_sdu; // include rlc_data_ind /// processing time of eNB PCH scheduler time_stats_t schedule_pch; - /// CCE lists - int cce_list[MAX_NUM_CORESET][MAX_NUM_CCE]; /// list of allocated beams per period int16_t *tdd_beam_association; From a7d72715cf2f10035f140dd766d66f3972049f7e Mon Sep 17 00:00:00 2001 From: francescomani Date: Sat, 4 Dec 2021 17:09:55 +0100 Subject: [PATCH 161/883] addressing review comments and some other changes --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 +-- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 29 ++++++++----------- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 3 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 12 ++++---- 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index eb5fa64565..5d91a03529 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -50,7 +50,7 @@ void configure_dlsch(NR_UE_DLSCH_t *dlsch0, fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, int rnti) { - uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr; + const uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr; dlsch0->current_harq_pid = current_harq_pid; dlsch0->active = 1; dlsch0->rnti = rnti; @@ -126,7 +126,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ switch(dl_config->dl_config_list[i].pdu_type) { case FAPI_NR_DL_CONFIG_TYPE_DCI: pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; - memcpy((void*)&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config)); + memcpy(&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],pdcch_config,sizeof(*pdcch_config)); pdcch_vars->nb_search_space = pdcch_vars->nb_search_space + 1; pdcch_vars->sfn = scheduled_response->frame; pdcch_vars->slot = slot; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index b204c1baa1..e5628d6d7b 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2212,14 +2212,11 @@ void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) { csi_period_offset(NULL,imcsi->periodicityAndOffset,&period,&offset); if((frame*nr_slots_per_frame[mu]+slot-offset)%period == 0) { fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csiim_config_pdu.csiim_config_rel15; - if(mac->DLbwp[dl_bwp_id-1]){ - csiim_config_pdu->bwp_size = NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } - else{ - csiim_config_pdu->bwp_size = NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } + const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1]; + const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth: + mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth; + csiim_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE); + csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE); csiim_config_pdu->subcarrier_spacing = mu; csiim_config_pdu->start_rb = imcsi->freqBand->startingRB; csiim_config_pdu->nr_of_rbs = imcsi->freqBand->nrofRBs; @@ -2280,14 +2277,11 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; - if(mac->DLbwp[dl_bwp_id-1]){ - csirs_config_pdu->bwp_size = NRRIV2BW(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } - else{ - csirs_config_pdu->bwp_size = NRRIV2BW(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth, MAX_BWP_SIZE); - } + const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1]; + const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth: + mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth; + csirs_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE); + csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE); csirs_config_pdu->subcarrier_spacing = mu; csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB; csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs; @@ -2309,7 +2303,7 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: csirs_config_pdu->row = 2; csirs_config_pdu->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | - ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); + ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0)); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: csirs_config_pdu->row = 4; @@ -2320,6 +2314,7 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { // determining the row of table 7.4.1.5.3-1 in 38.211 switch(resourceMapping.nrofPorts){ case NR_CSI_RS_ResourceMapping__nrofPorts_p1: + AssertFatal(1==0,"Resource with 1 CSI port shouldn't be within other rows\n"); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p2: csirs_config_pdu->row = 3; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 0c2351639f..1ddea42766 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2273,7 +2273,7 @@ void nr_csirs_scheduling(int Mod_idP, case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: csirs_pdu_rel15->row = 2; csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | - ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); + ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0)); for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); break; @@ -2288,6 +2288,7 @@ void nr_csirs_scheduling(int Mod_idP, // determining the row of table 7.4.1.5.3-1 in 38.211 switch(resourceMapping.nrofPorts){ case NR_CSI_RS_ResourceMapping__nrofPorts_p1: + AssertFatal(1==0,"Resource with 1 CSI port shouldn't be within other rows\n"); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p2: csirs_pdu_rel15->row = 3; diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 980bd39c37..398e927f94 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1304,17 +1304,17 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_ resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16; resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; break; case 2: resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; - resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.row2.size = 1; - resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4; + resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.other.size = 1; + resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2; + resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4; resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; break; From 82dc3430f7a3ac4f21ffd112e64213ee79523abe Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 6 Dec 2021 11:20:51 +0100 Subject: [PATCH 162/883] function for bitmap from start symbol and length --- common/utils/nr/nr_common.c | 5 +++ common/utils/nr/nr_common.h | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 8 ++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 6 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 20 +++++------ .../NR_MAC_gNB/gNB_scheduler_primitives.c | 36 +++++++++---------- 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index a704a66c76..42c7ef9c7e 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -472,6 +472,11 @@ int get_subband_size(int NPRB,int size) { } +// from start symbol index and nb or symbols to symbol occupation bitmap in a slot +uint16_t startandlength_to_bitmat(int startSymbolIndex, int nrOfSymbols) { + return (((1<state = WAIT_Msg3; @@ -1592,7 +1592,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra int i = 0; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { - if (vrb_map[BWPStart + rbStart + i]&(((1<rbSize; rb++) { - vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] = ((1<rbStart] |= startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); } LOG_D(NR_MAC,"BWPSize: %i\n", pdcch_pdu_rel15->BWPSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 342e441673..7945042ba5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -314,7 +314,7 @@ void fill_ssb_vrb_map (NR_COMMON_channels_t *cc, int rbStart, uint16_t symStart uint16_t *vrb_map = cc[CC_id].vrb_map; for (int rb = 0; rb < 20; rb++) - vrb_map[rbStart + rb] = 15<sched_ctrlCommon->sched_pdsch.mcs<10) @@ -426,7 +426,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, gNB_mac->sched_ctrlCommon->cce_index, gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { - vrb_map[rb + rbStart] = ((1<nrOfSymbols)-1)<startSymbolIndex))) + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; if (rbStart >= bwpSize) { LOG_D(NR_MAC, "cannot allocate retransmission for UE %d/RNTI %04x: no resources\n", UE_id, UE_info->rnti[UE_id]); return false; } while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex)) && + (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols)) && rbSize < retInfo->rbSize) rbSize++; } @@ -584,10 +584,10 @@ bool allocate_dl_retransmission(module_id_t module_id, temp_ps.nrOfLayers = 1; nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) rbSize++; uint32_t new_tbs; uint16_t new_rbSize; @@ -670,7 +670,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* retransmissions: directly allocate */ *n_rb_sched -= sched_ctrl->sched_pdsch.rbSize; for (int rb = 0; rb < sched_ctrl->sched_pdsch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= (((1<nrOfSymbols)-1)<startSymbolIndex); + rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); return true; } @@ -832,12 +832,12 @@ void pf_dl(module_id_t module_id, // Freq-demain allocation while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; uint16_t max_rbSize = 1; while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + (rballoc_mask[rbStart + max_rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) max_rbSize++; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -861,7 +861,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] -= (((1<nrOfSymbols)-1)<startSymbolIndex); + rballoc_mask[rb + sched_pdsch->rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); } } @@ -904,8 +904,8 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t // if any RB in vrb_map is blocked (1), the current RBG will be 0 rballoc_mask[i] = (~vrb_map[i+BWPStart])&0x3fff; //bitwise not and 14 symbols // if all the pdsch symbols are free - if((rballoc_mask[i]&(((1<BWPStart + f*B_rb + rb] = ((1<StartSymbolIndex; + vrb_map[pdcch->BWPStart + f*B_rb + rb] |= startandlength_to_bitmat(pdcch->StartSymbolIndex, N_symb); } } } @@ -2359,20 +2359,20 @@ void nr_csirs_scheduling(int Mod_idP, csirs_pdu_rel15->row = 1; csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: csirs_pdu_rel15->row = 2; csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: csirs_pdu_rel15->row = 4; csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; @@ -2383,18 +2383,18 @@ void nr_csirs_scheduling(int Mod_idP, case NR_CSI_RS_ResourceMapping__nrofPorts_p2: csirs_pdu_rel15->row = 3; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p4: csirs_pdu_rel15->row = 5; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p8: if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 8; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); } else{ int num_k = 0; @@ -2403,12 +2403,12 @@ void nr_csirs_scheduling(int Mod_idP, if(num_k==4) { csirs_pdu_rel15->row = 6; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); } else { csirs_pdu_rel15->row = 7; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); } } break; @@ -2416,12 +2416,12 @@ void nr_csirs_scheduling(int Mod_idP, if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 10; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); } else { csirs_pdu_rel15->row = 9; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (1 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); } break; case NR_CSI_RS_ResourceMapping__nrofPorts_p16: @@ -2430,24 +2430,24 @@ void nr_csirs_scheduling(int Mod_idP, else csirs_pdu_rel15->row = 11; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((1 << csirs_pdu_rel15->symb_l0) | (2 << csirs_pdu_rel15->symb_l0)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p24: if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 14; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); } else{ if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { csirs_pdu_rel15->row = 15; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (7 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 3); } else { csirs_pdu_rel15->row = 13; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); } } break; @@ -2455,18 +2455,18 @@ void nr_csirs_scheduling(int Mod_idP, if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 17; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); } else{ if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { csirs_pdu_rel15->row = 18; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (7 << csirs_pdu_rel15->symb_l0); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 3); } else { csirs_pdu_rel15->row = 16; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= ((3 << csirs_pdu_rel15->symb_l0) | (3 << csirs_pdu_rel15->symb_l1)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); } } break; From 1dd8c67fc2c1cae82b2829138efe0e366eeecdb7 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 7 Dec 2021 14:35:42 +0100 Subject: [PATCH 163/883] block ul prbs in map with prbbl --- openair2/GNB_APP/gnb_config.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 9851d14b91..4a13aec400 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -675,13 +675,13 @@ void RCconfig_nr_macrlc() { config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr; char *pt = strtok(ulprbbl,","); - int prbbl[275]; + uint16_t prbbl[275]; int num_prbbl=0; int prb; - memset(prbbl,0,275*sizeof(int)); + memset(prbbl,0,275*sizeof(uint16_t)); while (pt) { prb=atoi(pt); - prbbl[prb] = 1; + prbbl[prb] = 0x3FFF; // all symbols taken pt = strtok(NULL,","); num_prbbl++; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ae52f8cc60..9516c9a347 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -323,7 +323,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const int last_slot = (slot + num_slots - 1) % num_slots; uint16_t *vrb_map_UL = cc[CC_id].vrb_map_UL; - memset(&vrb_map_UL[last_slot * MAX_BWP_SIZE], 0, sizeof(uint16_t) * MAX_BWP_SIZE); + memcpy(&vrb_map_UL[last_slot * MAX_BWP_SIZE], &RC.nrmac[module_idP]->ulprbbl, MAX_BWP_SIZE); clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 45e0a5b52b..32fdce60d3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -697,7 +697,7 @@ typedef struct gNB_MAC_INST_s { /// current PDU index (BCH,DLSCH) uint16_t pdu_index[NFAPI_CC_MAX]; int num_ulprbbl; - int ulprbbl[275]; + uint16_t ulprbbl[275]; /// NFAPI Config Request Structure nfapi_nr_config_request_scf_t config[NFAPI_CC_MAX]; /// NFAPI DL Config Request Structure From 7cb3739cf6918029414f43b095db14e842b143fc Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 7 Dec 2021 14:54:48 +0100 Subject: [PATCH 164/883] bitmap occupation function --- common/utils/nr/nr_common.c | 5 +++++ common/utils/nr/nr_common.h | 1 + 2 files changed, 6 insertions(+) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index a704a66c76..42c7ef9c7e 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -472,6 +472,11 @@ int get_subband_size(int NPRB,int size) { } +// from start symbol index and nb or symbols to symbol occupation bitmap in a slot +uint16_t startandlength_to_bitmat(int startSymbolIndex, int nrOfSymbols) { + return (((1< Date: Wed, 8 Dec 2021 09:27:33 +0100 Subject: [PATCH 165/883] symbol level occupation for ULSCH and msg3 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 15 ++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 94 ++++++++++--------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 + 4 files changed, 66 insertions(+), 50 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 25aeea70a6..0d0c8980ce 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -729,6 +729,8 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t int scs = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; int fh = 0; int startSymbolAndLength = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->startSymbolAndLength; + int StartSymbolIndex, NrOfSymbols; + SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols); int mappingtype = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[ra->Msg3_tda_id]->mappingType; uint16_t *vrb_map_UL = &RC.nrmac[module_idP]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; @@ -737,7 +739,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t int BWPSize = nr_mac->type0_PDCCH_CSS_config[ra->beam_id].num_rbs; int rbStart = 0; for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) { - if (vrb_map_UL[rbStart + BWPStart + i]) { + if (vrb_map_UL[rbStart + BWPStart + i]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols)) { rbStart += i; i = 0; } @@ -842,7 +844,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t // Mark the corresponding RBs as used for (int rb = 0; rb < ra->msg3_nb_rb; rb++) { - vrb_map_UL[rbStart + BWPStart + rb] = 1; + vrb_map_UL[rbStart + BWPStart + rb] |= startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols); } // reset state to wait msg3 @@ -891,6 +893,8 @@ void nr_get_Msg3alloc(module_id_t module_id, ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { ra->Msg3_tda_id = i; + ra->msg3_startsymb = StartSymbolIndex; + ra->msg3_nrsymb = NrOfSymbols; break; } } @@ -938,11 +942,12 @@ void nr_get_Msg3alloc(module_id_t module_id, while (rbSize < msg3_nb_rb) { rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbSize = 0; - while (rbStart < bwpSize && vrb_map_UL[rbStart + bwpStart]) + while (rbStart < bwpSize && + (vrb_map_UL[rbStart + bwpStart]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols))) rbStart++; AssertFatal(rbStart < bwpSize - msg3_nb_rb, "no space to allocate Msg 3 for RA!\n"); while (rbStart + rbSize < bwpSize - && !vrb_map_UL[rbStart + bwpStart + rbSize] + && !(vrb_map_UL[rbStart + bwpStart + rbSize]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols)) && rbSize < msg3_nb_rb) rbSize++; } @@ -1039,7 +1044,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t i + ra->msg3_first_rb, ra->Msg3_frame, ra->Msg3_slot); - vrb_map_UL[i + ra->msg3_first_rb + ra->msg3_bwp_start] = 1; + vrb_map_UL[i + ra->msg3_first_rb + ra->msg3_bwp_start] |= startandlength_to_bitmat(ra->msg3_startsymb, ra->msg3_nrsymb); } LOG_D(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", module_idP, frameP, slotP, CC_id, ra->Msg3_frame, ra->Msg3_slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c0107c5fc6..d939ed8139 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -473,9 +473,8 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; - const uint16_t symb = ((1 << ps->nrOfSymbols) - 1) << ps->startSymbolIndex; for (int i = rbStart; i < rbStart + rbSize; ++i) { - if ((vrb_map_UL[i+BWPStart] & symb) != 0) { + if ((vrb_map_UL[i+BWPStart] & startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols)) != 0) { LOG_E(MAC, "%s(): %4d.%2d RB %d is already reserved, cannot schedule UE\n", __func__, @@ -544,6 +543,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ /* mark the corresponding RBs as used */ for (int rb = rbStart; rb < rbStart + rbSize; rb++) - vrb_map_UL[rb+BWPStart] = 1; + vrb_map_UL[rb+BWPStart] |= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); return true; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index d14cf09f99..949f148121 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -938,13 +938,6 @@ bool allocate_ul_retransmission(module_id_t module_id, LOG_D(NR_MAC,"retInfo->time_domain_allocation = %d, tda = %d\n", retInfo->time_domain_allocation, tda); LOG_D(NR_MAC,"num_dmrs_cdm_grps_no_data %d, tbs %d\n",num_dmrs_cdm_grps_no_data, retInfo->tb_size); if (tda == retInfo->time_domain_allocation) { - /* Check the resource is enough for retransmission */ - while (rbStart < bwpSize && !rballoc_mask[rbStart]) - rbStart++; - if (rbStart + retInfo->rbSize > bwpSize) { - LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize); - return false; - } /* check whether we need to switch the TDA allocation since tha last * (re-)transmission */ NR_pusch_semi_static_t *ps = &sched_ctrl->pusch_semi_static; @@ -955,18 +948,30 @@ bool allocate_ul_retransmission(module_id_t module_id, || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + + /* Check the resource is enough for retransmission */ + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + rbStart++; + if (rbStart + retInfo->rbSize > bwpSize) { + LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize); + return false; + } + LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size); } else { - /* the retransmission will use a different time domain allocation, check - * that we have enough resources */ - while (rbStart < bwpSize && !rballoc_mask[rbStart]) - rbStart++; - int rbSize = 0; - while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) - rbSize++; NR_pusch_semi_static_t temp_ps; int dci_format = get_dci_format(sched_ctrl); nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps); + /* the retransmission will use a different time domain allocation, check + * that we have enough resources */ + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&startandlength_to_bitmat(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) + rbStart++; + int rbSize = 0; + while (rbStart + rbSize < bwpSize && + (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) + rbSize++; uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, @@ -1022,7 +1027,7 @@ bool allocate_ul_retransmission(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] = 0; + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(sched_ctrl->pusch_semi_static.startSymbolIndex, sched_ctrl->pusch_semi_static.nrOfSymbols); return true; } @@ -1121,14 +1126,6 @@ void pf_ul(module_id_t module_id, if (max_num_ue < 0) return; - LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart); - while (rbStart < bwpSize && !rballoc_mask[rbStart]) rbStart++; - if (rbStart + min_rb >= bwpSize) { - LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n", - UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); - return; - } - /* Save PUSCH field */ /* we want to avoid a lengthy deduction of DMRS and other parameters in * every TTI if we can save it, so check whether dci_format, TDA, or @@ -1140,6 +1137,17 @@ void pf_ul(module_id_t module_id, || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + + LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart); + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + rbStart++; + if (rbStart + min_rb >= bwpSize) { + LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n", + UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); + return; + } + NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = 9; update_ul_ue_R_Qm(sched_pusch, ps); @@ -1158,7 +1166,7 @@ void pf_ul(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] = 0; + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); continue; } @@ -1215,19 +1223,6 @@ void pf_ul(module_id_t module_id, NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; NR_pusch_semi_static_t *ps = &sched_ctrl->pusch_semi_static; - while (rbStart < bwpSize && !rballoc_mask[rbStart]) rbStart++; - sched_pusch->rbStart = rbStart; - uint16_t max_rbSize = 1; - while (rbStart + max_rbSize < bwpSize && rballoc_mask[rbStart + max_rbSize]) - max_rbSize++; - - if (rbStart + min_rb >= bwpSize) { - LOG_W(NR_MAC, "cannot allocate UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n", - UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); - return; - } - else LOG_D(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); - /* Save PUSCH field */ /* we want to avoid a lengthy deduction of DMRS and other parameters in * every TTI if we can save it, so check whether dci_format, TDA, or @@ -1241,6 +1236,23 @@ void pf_ul(module_id_t module_id, nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); update_ul_ue_R_Qm(sched_pusch, ps); + while (rbStart < bwpSize && + !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + rbStart++; + sched_pusch->rbStart = rbStart; + uint16_t max_rbSize = 1; + while (rbStart + max_rbSize < bwpSize && + (rballoc_mask[rbStart + max_rbSize]&&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + max_rbSize++; + + if (rbStart + min_rb >= bwpSize) { + LOG_W(NR_MAC, "cannot allocate UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n", + UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); + return; + } + else LOG_D(NR_MAC,"allocating UL data for UE %d/RNTI %04x (rbStsart %d, min_rb %d, bwpSize %d\n",UE_id, UE_info->rnti[UE_id],rbStart,min_rb,bwpSize); + + /* Calculate the current scheduling bytes and the necessary RBs */ const int B = cmax(sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes, 0); uint16_t rbSize = 0; @@ -1261,7 +1273,7 @@ void pf_ul(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] = 0; + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); } } @@ -1330,11 +1342,9 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; int startSymbolIndex, nrOfSymbols; SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); - const uint16_t symb = ((1 << nrOfSymbols) - 1) << startSymbolIndex; + const uint16_t symb = startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); int st = 0, e = 0, len = 0; - for (int i = 0; i < bwpSize; i++) - if (RC.nrmac[module_id]->ulprbbl[i] == 1) vrb_map_UL[i]=symb; for (int i = 0; i < bwpSize; i++) { while ((vrb_map_UL[bwpStart + i] & symb) != 0 && i < bwpSize) @@ -1355,7 +1365,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t /* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */ for (int i = 0; i < bwpSize; i++) - rballoc_mask[i] = i >= st && i <= e; + rballoc_mask[i] = (i >= st && i <= e)*startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); /* proportional fair scheduling algorithm */ pf_ul(module_id, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 32fdce60d3..3944cb34f9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -157,6 +157,8 @@ typedef struct { uint8_t msg3_round; /// Flag to indicate if Msg3 carries a DCCH or DTCH message bool msg3_dcch_dtch; + int msg3_startsymb; + int msg3_nrsymb; /// TBS used for Msg4 int msg4_TBsize; /// MCS used for Msg4 From a778f69a7642e4e6dfc5a02dc2cda27662f485a9 Mon Sep 17 00:00:00 2001 From: sfn Date: Thu, 9 Dec 2021 10:36:01 +0100 Subject: [PATCH 166/883] Remove dependency of init_codebook_gNB on mac parameters --- executables/nr-gnb.c | 3 +- openair1/PHY/INIT/nr_init.c | 861 ++++++++++++++--------------- openair1/PHY/INIT/nr_parms.c | 9 + openair1/PHY/INIT/phy_init.h | 2 +- openair1/PHY/defs_nr_common.h | 6 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 6 files changed, 438 insertions(+), 445 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 0a893993a4..9e3c650f6e 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -505,10 +505,9 @@ void init_eNB_afterRU(void) { for (inst=0; instUL_INFO.module_id]; phy_init_nr_gNB(gNB,0,0); - init_codebook_gNB(gNB,mac); + init_codebook_gNB(gNB); // map antennas and PRACH signals to gNB RX if (0) AssertFatal(gNB->num_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id); diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 98df74ca87..1e825226af 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -72,471 +72,456 @@ int l1_north_init_gNB() { return(0); } -int init_codebook_gNB(PHY_VARS_gNB *gNB, - gNB_MAC_INST *mac) { - //get RRC Codebook configuration - struct NR_CSI_ReportConfig *csi_reportconfig = mac->UE_info.CellGroup[0]->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.array[0]; +int init_codebook_gNB(PHY_VARS_gNB *gNB) { if(gNB->frame_parms.nb_antennas_tx>1){ - LOG_D(PHY, "NR init_codebook_gNB: codebookType present %d\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); - if(csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present==NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) { - int N1=1; - int N2=1; - int O1=0; - int O2=0; - int CSI_RS_antenna_ports=1; + //NR Codebook Generation for codebook type1 SinglePanel + //csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present + int N1; + int N2; + int O1; + int O2; + int CSI_RS_antenna_ports; + //Uniform Planner Array: UPA + // X X X X ... X + // X X X X ... X + // N2 . . . . ... . + // X X X X ... X + // |<-----N1---->| + if (gNB->frame_parms.nb_antennas_tx == 2) {//nrOfAntennaPorts = two + N1=1; + N2=1; + O1=1; + O2=1; + CSI_RS_antenna_ports=2; + LOG_D(PHY, "NR Codebook Config: antenna ports: %d\n",CSI_RS_antenna_ports); + } else if(gNB->frame_parms.nb_antennas_tx > 2) {//nrOfAntennaPorts moreThanTwo + //Type 1 Single Panel : Based on 38.214 v15.3-Table 5.2.2.2.1-2: Supported configurations of (N1,N2) and (O1,O2) + switch(gNB->frame_parms.antennas_tx_n1_n2) { + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction: + N1=2; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=4; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction: + N1=2; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=8; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_two_TypeI\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction: + N1=4; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=8; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction: + N1=3; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=12; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_three_two\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction: + N1=6; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=12; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction: + N1=4; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=16; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_two\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction: + N1=8; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=16; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction: + N1=4; + N2=3; + O1=4; + O2=4; + CSI_RS_antenna_ports=24; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_three\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction: + N1=6; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=24; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_two\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction: + N1=12; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=24; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_twelve_one\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction: + N1=4; + N2=4; + O1=4; + O2=4; + CSI_RS_antenna_ports=32; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_four\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction: + N1=8; + N2=2; + O1=4; + O2=4; + CSI_RS_antenna_ports=32; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_two\n",CSI_RS_antenna_ports); + break; + case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction: + N1=16; + N2=1; + O1=4; + O2=1; + CSI_RS_antenna_ports=32; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_sixteen_one\n",CSI_RS_antenna_ports); + break; + default: + N1=1; + N2=1; + O1=1; + O2=1; + CSI_RS_antenna_ports=2; + LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d \n",CSI_RS_antenna_ports); + break; + } + } - //Uniform Planner Array: UPA - // X X X X ... X - // X X X X ... X - // N2 . . . . ... . - // X X X X ... X - // |<-----N1---->| - LOG_D(PHY, "NR Codebook Config: codebookType, type1, subType_PR_typeI_SinglePanel\n"); - struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel; - if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) { - N1=1; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=2; - LOG_D(PHY, "NR Codebook Config: antenna ports: %d\n",CSI_RS_antenna_ports); - } else if(type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) { - //Type 1 Single Panel : Based on 38.214 v15.3-Table 5.2.2.2.1-2: Supported configurations of (N1,N2) and (O1,O2) - switch(type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present) { - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction: - N1=2; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=4; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction: - N1=2; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=8; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_two_TypeI\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction: - N1=4; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=8; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction: - N1=3; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=12; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_three_two\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction: - N1=6; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=12; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction: - N1=4; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=16; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_two\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction: - N1=8; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=16; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction: - N1=4; - N2=3; - O1=4; - O2=4; - CSI_RS_antenna_ports=24; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_three\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction: - N1=6; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=24; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_two\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction: - N1=12; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=24; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_twelve_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction: - N1=4; - N2=4; - O1=4; - O2=4; - CSI_RS_antenna_ports=32; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_four\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction: - N1=8; - N2=2; - O1=4; - O2=4; - CSI_RS_antenna_ports=32; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_two\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction: - N1=16; - N2=1; - O1=4; - O2=1; - CSI_RS_antenna_ports=32; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_sixteen_one\n",CSI_RS_antenna_ports); - break; - default: - N1=1; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=2; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2 %d\n",CSI_RS_antenna_ports,type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present); - break; + // Generation of codebook Type1 with codebookMode 1 (CSI_RS_antenna_ports < 16) + if (CSI_RS_antenna_ports < 16) { + //Generate DFT vertical beams + //ll: index of a vertical beams vector (represented by i1_1 in TS 38.214) + double complex v[N1*O1][N1]; + for (int ll=0; llcodebookConfig->codebookType.choice.type1->codebookMode==1){ - if (CSI_RS_antenna_ports < 16) { - //Generate DFT vertical beams - //ll: index of a vertical beams vector (represented by i1_1 in TS 38.214) - double complex v[N1*O1][N1]; - for (int ll=0; llnr_mimo_precoding_matrix = (int32_t ***)malloc16(4* sizeof(int32_t **)); + int32_t ***mat = gNB->nr_mimo_precoding_matrix; + double complex res_code; + + //Table 5.2.2.2.1-5: + //Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + int pmiq_size = N1*O1*N2*O2*4+1; + mat[0] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + + //pmi=0 corresponds to unit matrix + mat[0][0] = (int32_t *)calloc(2*N1*N2,sizeof(int32_t)); + for(int j_col=0; j_col<1; j_col++) { //1 layer + for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna + if(j_col==i_rows) { + ((short*) &mat[0][0][i_rows+j_col])[0] = 32768; + } + } + } + + for(int ll=0; ll0) + ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); + } + + for(int len=N1*N2; len<2*N1*N2; len++) { + res_code=sqrt(1/(double)CSI_RS_antenna_ports)*theta_n[nn]*v_lm[ll][mm][len-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); + } } - //Kronecker product v_lm - double complex v_lm[N1*O1][N2*O2][N2*N1]; - //v_ll_mm_codebook denotes the elements of a precoding matrix W_i1,1_i_1,2 + } + } + + int llc; + int mmc; + double complex phase_sign; + //Table 5.2.2.2.1-6: + //Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; + mat[1] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + + //pmi=0 corresponds to unit matrix + mat[1][0] = (int32_t *)calloc((2*N1*N2)*(2),sizeof(int32_t)); + for(int j_col=0; j_col<2; j_col++) { //2 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna + if(j_col==i_rows) { + ((short*) &mat[1][0][i_rows*2+j_col])[0] = 32768; + } + } + } + + //pmi=1,...,pmi_size are computed as follows + for(int llb=0; llbnr_mimo_precoding_matrix = (int32_t ***)malloc16(4* sizeof(int32_t **)); - int32_t ***mat = gNB->nr_mimo_precoding_matrix; - double complex res_code; - - //Table 5.2.2.2.1-5: - //Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - int pmiq_size = N1*O1*N2*O2*4+1; - mat[0] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); - - //pmi=0 corresponds to unit matrix - mat[0][0] = (int32_t *)calloc(2*N1*N2,sizeof(int32_t)); - for(int j_col=0; j_col<1; j_col++) { //1 layer - for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna - if(j_col==i_rows) { - ((short*) &mat[0][0][i_rows+j_col])[0] = 32768; - } - } - } - - for(int ll=0; ll0) - ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); - } - - for(int len=N1*N2; len<2*N1*N2; len++) { - res_code=sqrt(1/(double)CSI_RS_antenna_ports)*theta_n[nn]*v_lm[ll][mm][len-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - - LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); - } - } - } - } - - int llc; - int mmc; - double complex phase_sign; - //Table 5.2.2.2.1-6: - //Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; - mat[1] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); - - //pmi=0 corresponds to unit matrix - mat[1][0] = (int32_t *)calloc((2*N1*N2)*(2),sizeof(int32_t)); - for(int j_col=0; j_col<2; j_col++) { //2 layers - for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna - if(j_col==i_rows) { - ((short*) &mat[1][0][i_rows*2+j_col])[0] = 32768; - } - } - } - - //pmi=1,...,pmi_size are computed as follows - for(int llb=0; llb0) - ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - - LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); - } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - - LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); - } - } + for (int nn=0; nn<2; nn++) { + int pmiq = 1+llb*N2*O2*N1*O1*N2*O2*2+mmb*N1*O1*N2*O2*2+ll*N2*O2*2+mm*2+nn; + mat[1][pmiq] = (int32_t *)malloc16((2*N1*N2)*(2)*sizeof(int32_t)); + LOG_D(PHY, "layer 2 Codebook pmiq = %d\n",pmiq); + for(int j_col=0; j_col<2; j_col++) { + if (j_col==0) { + llc = llb; + mmc = mmb; + phase_sign = 1; + } + if (j_col==1) { + llc = ll; + mmc = mm; + phase_sign = -1; + } + for (int i_rows=0; i_rows0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); } } } } } + } + } - //Table 5.2.2.2.1-7: - //Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - if(CSI_RS_antenna_ports>=3) { - pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; - mat[2] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + //Table 5.2.2.2.1-7: + //Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + if(CSI_RS_antenna_ports>=3) { + pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; + mat[2] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); - //pmi=0 corresponds to unit matrix - mat[2][0] = (int32_t *)calloc((2*N1*N2)*(3),sizeof(int32_t)); - for(int j_col=0; j_col<3; j_col++) { //3 layers - for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna - if(j_col==i_rows) { - ((short*) &mat[2][0][i_rows*3+j_col])[0] = 32768; - } - } - } - - //pmi=1,...,pmi_size are computed as follows - for(int llb=0; llb0) - ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - - LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); - } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - - LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); - } - } - } - } - } - } + //pmi=0 corresponds to unit matrix + mat[2][0] = (int32_t *)calloc((2*N1*N2)*(3),sizeof(int32_t)); + for(int j_col=0; j_col<3; j_col++) { //3 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna + if(j_col==i_rows) { + ((short*) &mat[2][0][i_rows*3+j_col])[0] = 32768; } } + } - //Table 5.2.2.2.1-8: - //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - if(CSI_RS_antenna_ports>=4) { - pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; - mat[3] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); - - //pmi=0 corresponds to unit matrix - mat[3][0] = (int32_t *)calloc((2*N1*N2)*(4),sizeof(int32_t)); - for(int j_col=0; j_col<4; j_col++) { //4 layers - for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna - if(j_col==i_rows) { - ((short*) &mat[3][0][i_rows*4+j_col])[0] = 32768; + //pmi=1,...,pmi_size are computed as follows + for(int llb=0; llb0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + } + } } } } + } + } + } - //pmi=1,...,pmi_size are computed as follows - for(int llb=0; llb0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + //Table 5.2.2.2.1-8: + //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS + if(CSI_RS_antenna_ports>=4) { + pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; + mat[3] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); - LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); - } + //pmi=0 corresponds to unit matrix + mat[3][0] = (int32_t *)calloc((2*N1*N2)*(4),sizeof(int32_t)); + for(int j_col=0; j_col<4; j_col++) { //4 layers + for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna + if(j_col==i_rows) { + ((short*) &mat[3][0][i_rows*4+j_col])[0] = 32768; + } + } + } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + //pmi=1,...,pmi_size are computed as follows + for(int llb=0; llb0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + } - LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); - } - } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); } } } @@ -544,11 +529,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB, } } } - } else {//codebookMode 2 - AssertFatal(1==0, "CodeBook Type 1, CodebookMode %ld is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->codebookMode); } - } else { - AssertFatal(1==0, "subType_PR_typeI %d is not supported\n",csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present); } } return 0; diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 42d4a30e3b..62da208f3d 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -269,6 +269,15 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, fp->nb_antennas_rx = cfg->carrier_config.num_rx_ant.value; // It denotes the number of rx antennas at gNB fp->nb_antennas_tx = cfg->carrier_config.num_tx_ant.value; // It corresponds to pdsch_AntennaPorts (logical antenna ports) + //RRC Parameters: depends on the physical structure of the gNB Uniform planner array + if (fp->nb_antennas_tx == 4) + fp->antennas_tx_n1_n2 = 1;//NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction; + else if (fp->nb_antennas_tx == 8) + fp->antennas_tx_n1_n2 = 3;//NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction; + else if (fp->nb_antennas_tx == 12) + fp->antennas_tx_n1_n2 = 5;//NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction; + else//We currently support codebook 1 for nrOfAntennaPorts < 16 + fp->antennas_tx_n1_n2 = 0;//NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_NOTHING; fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe; diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 94c0d22a4e..e45f40da42 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -402,7 +402,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); void init_N_TA_offset(PHY_VARS_NR_UE *ue); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag); -int init_codebook_gNB(PHY_VARS_gNB *gNB, gNB_MAC_INST *mac); +int init_codebook_gNB(PHY_VARS_gNB *gNB); void nr_phy_config_request(NR_PHY_Config_t *gNB); void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst); void phy_free_nr_gNB(PHY_VARS_gNB *gNB); diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index c385d323e3..8e024420af 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -318,8 +318,12 @@ struct NR_DL_FRAME_PARMS { uint32_t samples_per_frame_wCP; /// NR numerology index [0..5] as specified in 38.211 Section 4 (mu). 0=15khZ SCS, 1=30khZ, 2=60kHz, etc uint8_t numerology_index; - /// Number of Physical transmit antennas in node + /// Number of Physical transmit antennas in node (corresponds to nrOfAntennaPorts) uint8_t nb_antennas_tx; + /// UPA Panel Antenna configuration: two_one, two_two, four_one, three_two, six_one, etc + uint8_t antennas_tx_n1_n2; + /// UPA Panel Antenna Type: non, Single panel, or multiple + uint8_t antennas_tx_panel_type; /// Number of Receive antennas in node uint8_t nb_antennas_rx; /// Number of common transmit antenna ports in eNodeB (1 or 2) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index d05ffc9abe..ee25934f2d 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -794,7 +794,7 @@ int main(int argc, char **argv) // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; phy_init_nr_gNB(gNB,0,1); - init_codebook_gNB(gNB,gNB_mac); + init_codebook_gNB(gNB); N_RB_DL = gNB->frame_parms.N_RB_DL; NR_UE_info_t *UE_info = &RC.nrmac[0]->UE_info; UE_info->num_UEs=1; From bfd0de0a22d2fcce5eb2b119b92dd0773361c248 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Thu, 9 Dec 2021 11:38:39 +0100 Subject: [PATCH 167/883] remove now unneccessary MAC includes and forward declaration --- executables/nr-gnb.c | 4 +--- openair1/PHY/INIT/nr_init.c | 1 - openair1/PHY/INIT/phy_init.h | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 9e3c650f6e..673eed0a31 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -63,7 +63,7 @@ #include "PHY/phy_extern.h" -#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" +#include "common/ran_context.h" #include "RRC/LTE/rrc_extern.h" #include "PHY_INTERFACE/phy_interface.h" #include "common/utils/LOG/log_extern.h" @@ -74,7 +74,6 @@ #include "UTIL/OPT/opt.h" #include "enb_config.h" #include "gnb_paramdef.h" -#include "LAYER2/NR_MAC_gNB/mac_proto.h" #include "s1ap_eNB.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" @@ -497,7 +496,6 @@ void print_opp_meas(void) { void init_eNB_afterRU(void) { int inst,ru_id,i,aa; PHY_VARS_gNB *gNB; - gNB_MAC_INST *mac; LOG_I(PHY,"%s() RC.nb_nr_inst:%d\n", __FUNCTION__, RC.nb_nr_inst); if(NFAPI_MODE == NFAPI_MODE_PNF) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 1e825226af..de123ee3e3 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -36,7 +36,6 @@ #include "MBSFN-SubframeConfigList.h"*/ #include "openair1/PHY/defs_RU.h" #include "openair1/PHY/CODING/nrLDPC_extern.h" -#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "assertions.h" #include #include diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index e45f40da42..810f880789 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -37,8 +37,6 @@ #include "LTE_SCellToAddMod-r10.h" #include "LTE_NonMBSFN-SubframeConfig-r14.h" -typedef struct gNB_MAC_INST_s gNB_MAC_INST; - /** @addtogroup _PHY_STRUCTURES_ * @{ */ From 9b0d2384ea407a683ffb0e8aa02ff6903a991135 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Thu, 9 Dec 2021 12:34:08 +0100 Subject: [PATCH 168/883] minor changes after merge --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 1 - openair2/RRC/NR/MESSAGES/asn1_msg.c | 1 - 2 files changed, 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 125b77df41..3dcecb0286 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -941,7 +941,6 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) { int better_rsrp_reported = -140-(-0); /*minimum_measured_RSRP_value - minimum_differntail_RSRP_value*///considering the minimum RSRP value as better RSRP initially uint8_t diff_rsrp_idx = 0; uint8_t i, j; - NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; if (n_dl_bwp < 4) pdsch_bwp_id = bwp_id; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 4591756c67..743c794546 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1260,7 +1260,6 @@ void fill_initial_SpCellConfig(rnti_t rnti, // frequency domain resources depends on BWP size // options are 24, 48 or 96 coreset->frequencyDomainResources.buf = calloc(1,6); - int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; if (0) { if (curr_bwp < 48) coreset->frequencyDomainResources.buf[0] = 0xf0; From d6dedc1f49b4caeeb28344d50d0a04c5e7599b55 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 9 Dec 2021 13:14:19 +0100 Subject: [PATCH 169/883] handling multiple pdcch pdu at fapi and phy --- nfapi/oai_integration/nfapi_pnf.c | 16 +++++++------- .../nfapi/public_inc/nfapi_nr_interface_scf.h | 5 +---- openair1/PHY/NR_TRANSPORT/nr_dci.c | 22 ++++++++----------- openair1/PHY/NR_TRANSPORT/nr_dci.h | 11 +++++----- openair1/PHY/defs_gNB.h | 6 +++-- openair1/SCHED_NR/fapi_nr_l1.c | 17 +++++++------- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 12 +++++----- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 8 files changed, 41 insertions(+), 50 deletions(-) diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index 4edbeee342..a0b4a03e04 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -1132,8 +1132,8 @@ notifiedFIFO_elt_t *l1tx_message_extract(PHY_VARS_gNB *gNB, int frame, int slot) if (freeRes) { msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); msgTx->num_pdsch_slot=0; - msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; - msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; + msgTx->num_dl_pdcch = 0; + msgTx->num_ul_pdcch = 0; msgTx->slot = slot; msgTx->frame = frame; return freeRes; @@ -1158,11 +1158,11 @@ int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, proc = &gNB->proc.L1_proc; if (req->numPdus > 0) { - if (req->ul_dci_pdu_list[req->numPdus-1].PDUType == 0) { // copy only the last PDU (PHY can have only one UL PDCCH pdu) - msgTx->ul_pdcch_pdu = req->ul_dci_pdu_list[req->numPdus-1]; // copy the last pdu - } - else { - LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), req->numPdus-1, req->ul_dci_pdu_list[req->numPdus-1].PDUType); + for (int i=0; inumPdus; i++) { + if (req->ul_dci_pdu_list[i].PDUType == 0) // only possible value 0: PDCCH PDU + msgTx->ul_pdcch_pdu[i] = req->ul_dci_pdu_list[i]; + else + LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), req->numPdus-1, req->ul_dci_pdu_list[req->numPdus-1].PDUType); } } @@ -1244,7 +1244,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) { // we trust the scheduler sends only one PDCCH PDU per slot - msgTx->pdcch_pdu = dl_tti_pdu_list[i].pdcch_pdu; // fills the last received PDCCH PDU + msgTx->pdcch_pdu[i] = dl_tti_pdu_list[i].pdcch_pdu; // fills the last received PDCCH PDU } else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) { //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]); diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index 9d245446c8..b7337538ed 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -1400,9 +1400,6 @@ typedef struct } nfapi_nr_ul_dci_request_t; */ - // normally one PDU per coreset per BWP -#define NFAPI_NR_MAX_UL_DCI_PDUS 4 - typedef struct { /// only possible value 0: PDCCH PDU uint16_t PDUType; @@ -1416,7 +1413,7 @@ typedef struct { uint16_t SFN; uint16_t Slot; uint8_t numPdus; - nfapi_nr_ul_dci_request_pdus_t ul_dci_pdu_list[NFAPI_NR_MAX_UL_DCI_PDUS]; + nfapi_nr_ul_dci_request_pdus_t ul_dci_pdu_list[NFAPI_NR_MAX_NB_CORESETS]; } nfapi_nr_ul_dci_request_t; //3.4.5 slot_errors diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 3dd44a7896..ba67822b9f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -251,20 +251,16 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, } void nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { + processingData_L1tx_t *msgTx, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { - AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n"); + for (int i=0; inum_ul_pdcch; i++) + nr_generate_dci(gNB,&msgTx->ul_pdcch_pdu[i].pdcch_pdu.pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + for (int i=0; inum_dl_pdcch; i++) + nr_generate_dci(gNB,&msgTx->pdcch_pdu[i].pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); - if (pdcch_pdu) { - nr_generate_dci(gNB,&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); - } - if (ul_dci_pdu) { - nr_generate_dci(gNB,&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); - } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 07baaf2728..0077bd2f38 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -30,12 +30,11 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format, uint16_t N_RB); void nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_pdcch_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms); + processingData_L1tx_t *msgTx, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms); void nr_pdcch_scrambling(uint32_t *in, uint32_t size, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 11b5112a6c..ff77854898 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -962,12 +962,14 @@ typedef struct processingData_L1tx { int slot; openair0_timestamp timestamp_tx; PHY_VARS_gNB *gNB; - nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu; - nfapi_nr_ul_dci_request_pdus_t ul_pdcch_pdu; + nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS]; + nfapi_nr_ul_dci_request_pdus_t ul_pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS]; NR_gNB_CSIRS_t csirs_pdu[NUMBER_OF_NR_CSIRS_MAX]; NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2]; NR_gNB_SSB_t ssb[64]; uint16_t num_pdsch_slot; + int num_dl_pdcch; + int num_ul_pdcch; time_stats_t phy_proc_tx; } processingData_L1tx_t; diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 8f315ba214..cfe29690b6 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -166,10 +166,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ TX_req->SFN,TX_req->Slot,TX_req->Number_of_PDUs, number_ul_dci_pdu,number_ul_tti_pdu); - int pdcch_received=0; msgTx->num_pdsch_slot=0; - msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; - msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0; + msgTx->num_dl_pdcch=0; + msgTx->num_ul_pdcch=number_ul_dci_pdu; msgTx->slot = slot; msgTx->frame = frame; @@ -183,10 +182,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ break; case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE: - AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n"); - msgTx->pdcch_pdu = dl_tti_pdu->pdcch_pdu; - - pdcch_received = 1; + LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot); + msgTx->pdcch_pdu[msgTx->num_dl_pdcch] = dl_tti_pdu->pdcch_pdu; + msgTx->num_dl_pdcch++; break; case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE: @@ -208,8 +206,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ } } - if (number_ul_dci_pdu > 0) - msgTx->ul_pdcch_pdu = UL_dci_req->ul_dci_pdu_list[number_ul_dci_pdu-1]; // copy the last pdu + for (int i=0; iul_pdcch_pdu[i] = UL_dci_req->ul_dci_pdu_list[i]; + } pushNotifiedFIFO(gNB->resp_L1_tx,res); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 1685e206ae..c32463b681 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -158,18 +158,16 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,0); - int num_dl_dci = msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci; - int num_ul_dci = msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci; + int num_pdcch_pdus = msgTx->num_ul_pdcch + msgTx->num_dl_pdcch; - if (num_dl_dci > 0 || num_ul_dci > 0) { - LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n", - gNB->Mod_id, frame, slot, num_ul_dci, num_dl_dci); + if (num_pdcch_pdus > 0) { + LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL PDCCH PDUs %d/%d)\n", + gNB->Mod_id, frame, slot, msgTx->num_ul_pdcch, msgTx->num_dl_pdcch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); nr_generate_dci_top(gNB, - num_dl_dci > 0 ? &msgTx->pdcch_pdu : NULL, - num_ul_dci > 0 ? &msgTx->ul_pdcch_pdu.pdcch_pdu : NULL, + msgTx, gNB->nr_gold_pdcch_dmrs[slot], &gNB->common_vars.txdataF[0][txdataF_offset], AMP, fp); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index affa7fd803..28e6379adf 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1045,7 +1045,7 @@ int main(int argc, char **argv) UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].round = round; for (int i=0; iUE_info.pdcch_cand[i] = 0; + gNB_mac->pdcch_cand[i] = 0; if (css_flag == 0) { nr_schedule_ue_spec(0, frame, slot); From 39eb4ded163cd10957b4dc5f9d9d0f8b078323eb Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 9 Dec 2021 15:50:57 +0000 Subject: [PATCH 170/883] Add min_rxtxtime_pdsch in some config files --- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 + .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 ++ .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 + 3 files changed, 4 insertions(+) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index a2fb971719..03b9190578 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime_pdsch = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index abc64b6e46..82d76e9f5e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -35,6 +35,8 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; + min_rxtxtime_pdsch = 6; + sib1_tda = 0; ul_prbblacklist = "51,52,53,54" pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index c97fc109ef..f46310c1ca 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime_pdsch = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( From 80853a0f6f2af3703a0e88afe6fb8e9da7473f60 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 9 Dec 2021 16:54:16 +0000 Subject: [PATCH 171/883] Create do_SRS parameter to enable the periodic SRS --- openair2/COMMON/rrc_messages_types.h | 1 + openair2/GNB_APP/gnb_config.c | 2 ++ openair2/GNB_APP/gnb_paramdef.h | 9 ++++++--- openair2/RRC/NR/MESSAGES/asn1_msg.c | 18 +++++++++--------- openair2/RRC/NR/nr_rrc_defs.h | 1 + openair2/RRC/NR/rrc_gNB.c | 1 + 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index f61648d8b4..2a7e8c961d 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -414,6 +414,7 @@ typedef struct NRRrcConfigurationReq_s { int pusch_AntennaPorts; int minRXTXTIMEpdsch; int do_CSIRS; + int do_SRS; int pusch_TargetSNRx10; int pucch_TargetSNRx10; } gNB_RrcConfigurationReq; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 9851d14b91..b4b2b88ba8 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1114,6 +1114,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; + printf("Do SRS %d\n",*GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).do_SRS = *GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 0c3d971569..8d3bea6db0 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -118,6 +118,7 @@ typedef enum { #define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts" #define GNB_CONFIG_STRING_SIB1TDA "sib1_tda" #define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" +#define GNB_CONFIG_STRING_DOSRS "do_SRS" #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" #define GNB_CONFIG_STRING_MINRXTXTIMEPDSCH "min_rxtxtime_pdsch" #define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" @@ -147,6 +148,7 @@ typedef enum { {GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_DOSRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ @@ -171,9 +173,10 @@ typedef enum { #define GNB_PUSCH_ANTENNAPORTS_IDX 16 #define GNB_SIB1_TDA_IDX 17 #define GNB_DO_CSIRS_IDX 18 -#define GNB_NRCELLID_IDX 19 -#define GNB_MINRXTXTIMEPDSCH_IDX 20 -#define GNB_ULPRBBLACKLIST_IDX 21 +#define GNB_DO_SRS_IDX 19 +#define GNB_NRCELLID_IDX 20 +#define GNB_MINRXTXTIMEPDSCH_IDX 21 +#define GNB_ULPRBBLACKLIST_IDX 22 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index a7a84edb68..9c741ef7e4 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1150,7 +1150,11 @@ void fill_initial_SpCellConfig(rnti_t rnti, ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list,srs_resset0_id); srs_Config->srs_ResourceToReleaseList=NULL; - if(0) { + if(carrier->do_SRS) { + srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; + srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic)); + srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL; + } else { srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic; srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic)); srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1; @@ -1158,10 +1162,6 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset)); *srs_resset0->resourceType.choice.aperiodic->slotOffset=2; srs_resset0->resourceType.choice.aperiodic->ext1=NULL; - } else { - srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; - srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic)); - srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL; } srs_resset0->usage=NR_SRS_ResourceSet__usage_codebook; @@ -1194,14 +1194,14 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_res0->freqHopping.b_SRS); srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither; - if(0) { - srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; - srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); - } else { + if(carrier->do_SRS) { srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 7 + (uid/3)*10; // 7/17/27/37 are mixed slots + } else { + srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; + srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); } srs_res0->sequenceId=40; diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index ad31e8cac7..9eb5221546 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -449,6 +449,7 @@ typedef struct { int pusch_AntennaPorts; int minRXTXTIMEpdsch; int do_CSIRS; + int do_SRS; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; NR_PDCCH_ConfigSIB1_t *pdcch_ConfigSIB1; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 34e570070d..f6d65e9051 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -333,6 +333,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->carrier.minRXTXTIMEpdsch = configuration->minRXTXTIMEpdsch; rrc->carrier.sib1_tda = configuration->sib1_tda; rrc->carrier.do_CSIRS = configuration->do_CSIRS; + rrc->carrier.do_SRS = configuration->do_SRS; /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); rrc->cell_info_configured = 0; From 6fa17e2d296a2e2ed78236ec8058a38d4f03388a Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 9 Dec 2021 16:59:57 +0000 Subject: [PATCH 172/883] Add do_SRS parameter in some config files --- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 + .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 + .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 + 3 files changed, 3 insertions(+) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 03b9190578..46bcaa6119 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -37,6 +37,7 @@ gNBs = pusch_AntennaPorts = 1; min_rxtxtime_pdsch = 6; sib1_tda = 0; + do_SRS = 1; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 82d76e9f5e..154af4aac3 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -37,6 +37,7 @@ gNBs = pusch_AntennaPorts = 2; min_rxtxtime_pdsch = 6; sib1_tda = 0; + do_SRS = 1; ul_prbblacklist = "51,52,53,54" pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index f46310c1ca..5556bf1500 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -37,6 +37,7 @@ gNBs = pusch_AntennaPorts = 1; min_rxtxtime_pdsch = 6; sib1_tda = 0; + do_SRS = 1; pdcch_ConfigSIB1 = ( { From 0f62e37e22ef830601af952599147b5b42642b25 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 9 Dec 2021 17:39:39 +0000 Subject: [PATCH 173/883] Add do_SRS parameter also for NSA --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/RRC/NR/nr_rrc_proto.h | 2 ++ openair2/RRC/NR/rrc_gNB_nsa.c | 34 ++++++++++++----------- openair2/RRC/NR/rrc_gNB_reconfig.c | 43 ++++++++++++++++-------------- 5 files changed, 45 insertions(+), 38 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 50e21ac02b..4bbb63564e 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -768,7 +768,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index a7075eb218..dd5f1dfb27 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -713,7 +713,7 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 22109c3029..40de13dfb0 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -81,6 +81,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int dl_antenna_ports, int minRXTXTIMEpdsch, int do_csirs, + int do_srs, int initial_csi_index, int uid); @@ -93,6 +94,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon int dl_antenna_ports, int minRXTXTIMEpdsch, int do_csirs, + int do_srs, int initial_csi_index, int uid); diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 2104d5cdd7..7dbc621878 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -237,24 +237,26 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ } if (ue_context_p->ue_context.spCellConfig) { fill_default_reconfig(carrier->servingcellconfigcommon, - ue_context_p->ue_context.spCellConfig->spCellConfigDedicated, - reconfig_ies, - ue_context_p->ue_context.secondaryCellGroup, - carrier->pdsch_AntennaPorts, - carrier->minRXTXTIMEpdsch, - carrier->do_CSIRS, - carrier->initial_csi_index[ue_context_p->local_uid + 1], - ue_context_p->local_uid); + ue_context_p->ue_context.spCellConfig->spCellConfigDedicated, + reconfig_ies, + ue_context_p->ue_context.secondaryCellGroup, + carrier->pdsch_AntennaPorts, + carrier->minRXTXTIMEpdsch, + carrier->do_CSIRS, + carrier->do_SRS, + carrier->initial_csi_index[ue_context_p->local_uid + 1], + ue_context_p->local_uid); } else { fill_default_reconfig(carrier->servingcellconfigcommon, - NULL, - reconfig_ies, - ue_context_p->ue_context.secondaryCellGroup, - carrier->pdsch_AntennaPorts, - carrier->minRXTXTIMEpdsch, - carrier->do_CSIRS, - carrier->initial_csi_index[ue_context_p->local_uid + 1], - ue_context_p->local_uid); + NULL, + reconfig_ies, + ue_context_p->ue_context.secondaryCellGroup, + carrier->pdsch_AntennaPorts, + carrier->minRXTXTIMEpdsch, + carrier->do_CSIRS, + carrier->do_SRS, + carrier->initial_csi_index[ue_context_p->local_uid + 1], + ue_context_p->local_uid); } ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity; NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index d313a567ad..bc8bb0a56a 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -57,6 +57,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int dl_antenna_ports, int minRXTXTIMEpdsch, int do_csirs, + int do_srs, int initial_csi_index, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); @@ -803,19 +804,19 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list,srs_resset0_id); srs_Config->srs_ResourceToReleaseList=NULL; - if(0) { - srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic; - srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic)); - srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1; - srs_resset0->resourceType.choice.aperiodic->csi_RS=NULL; - srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset)); - *srs_resset0->resourceType.choice.aperiodic->slotOffset=2; + if(do_srs) { + srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; + srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic)); + srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL; + } else { + srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_aperiodic; + srs_resset0->resourceType.choice.aperiodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic)); + srs_resset0->resourceType.choice.aperiodic->aperiodicSRS_ResourceTrigger=1; + srs_resset0->resourceType.choice.aperiodic->csi_RS=NULL; + srs_resset0->resourceType.choice.aperiodic->slotOffset= calloc(1,sizeof(*srs_resset0->resourceType.choice.aperiodic->slotOffset)); + *srs_resset0->resourceType.choice.aperiodic->slotOffset=2; srs_resset0->resourceType.choice.aperiodic->ext1=NULL; - } else { - srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; - srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic)); - srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL; - } + } srs_resset0->usage=NR_SRS_ResourceSet__usage_codebook; srs_resset0->alpha = calloc(1,sizeof(*srs_resset0->alpha)); @@ -847,15 +848,15 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco srs_res0->freqHopping.b_SRS); srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither; - if(0) { - srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; + if(do_srs) { + srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; + srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 7 + (uid/3)*10; // 7/17/27/37 are mixed slots + } else { + srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); - } else { - srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; - srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); - srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; - srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 7 + (uid/3)*10; // 7/17/27/37 are mixed slots - } + } srs_res0->sequenceId=40; srs_res0->spatialRelationInfo=calloc(1,sizeof(*srs_res0->spatialRelationInfo)); @@ -1375,6 +1376,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon int dl_antenna_ports, int minRXTXTIMEpdsch, int do_csirs, + int do_srs, int initial_csi_index, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); @@ -1391,6 +1393,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon dl_antenna_ports, minRXTXTIMEpdsch, do_csirs, + do_srs, initial_csi_index, uid); From b942851a4ccbc46d0aaea380c39fde03ba50a5d3 Mon Sep 17 00:00:00 2001 From: sfn Date: Fri, 10 Dec 2021 15:50:04 +0100 Subject: [PATCH 174/883] Fix failure of phy-sim --- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index f5a97f1bf7..a73b3ef80d 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1156,7 +1156,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList)); csi_MeasConfig->csi_ReportConfigToReleaseList = NULL; - if (dl_antenna_ports > 1) {/*do_csirs&&*/ + if (do_csirs && dl_antenna_ports > 1) { NR_CSI_ReportConfig_t *csirep1 = calloc(1,sizeof(*csirep1)); csirep1->reportConfigId=0; csirep1->carrier=NULL; From 74e962653b6df324e8862fb4ce342deb58b380c9 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 10 Dec 2021 15:40:02 +0000 Subject: [PATCH 175/883] Add OAI logo and prev/next UE buttons --- common/utils/T/tracer/gnb.c | 128 +++++++++++++++++++++++++++++------- 1 file changed, 103 insertions(+), 25 deletions(-) diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index 4aaa4898a1..4daad92842 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -4,15 +4,24 @@ #include #include #include "database.h" +#include "event.h" #include "handler.h" #include "config.h" #include "logger/logger.h" -#include "view/view.h" #include "gui/gui.h" +#include "utils.h" +#include "openair_logo.h" + +int ue_id[65536]; +int next_ue_id; typedef struct { widget *pucch_pusch_iq_plot; logger *pucch_pusch_iq_logger; + widget *current_ue_label; + widget *current_ue_button; + widget *prev_ue_button; + widget *next_ue_button; } gnb_gui; typedef struct { @@ -21,11 +30,12 @@ typedef struct { int nevents; pthread_mutex_t lock; gnb_gui *e; + int ue; /* what UE is displayed in the UE specific views */ void *database; } gnb_data; -void is_on_changed(void *_d) -{ +void is_on_changed(void *_d) { + gnb_data *d = _d; char t; @@ -49,58 +59,121 @@ connection_dies: if (pthread_mutex_unlock(&d->lock)) abort(); } -void usage(void) -{ +void usage(void) { printf( -"options:\n" -" -d this option is mandatory\n" -" -ip connect to given IP address (default %s)\n" -" -p connect to given port (default %d)\n", - DEFAULT_REMOTE_IP, - DEFAULT_REMOTE_PORT + "options:\n" + " -d this option is mandatory\n" + " -ip connect to given IP address (default %s)\n" + " -p connect to given port (default %d)\n", + DEFAULT_REMOTE_IP, + DEFAULT_REMOTE_PORT ); exit(1); } -static void *gui_thread(void *_g) -{ +static void *gui_thread(void *_g) { gui *g = _g; gui_loop(g); return NULL; } -static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, - gnb_data *ed) -{ +static void set_current_ue(gui *g, gnb_data *e, int ue) { + char s[256]; + sprintf(s, "[UE %d] ", ue); + label_set_text(g, e->e->current_ue_label, s); +} + +void reset_ue_ids(void) { + int i; + printf("resetting known UEs\n"); + for (i = 0; i < 65536; i++) ue_id[i] = -1; + ue_id[65535] = 0; + ue_id[65534] = 1; // HACK: to be removed + ue_id[2] = 2; // this supposes RA RNTI = 2, very openair specific + next_ue_id = 0; +} + +static void click(void *private, gui *g, char *notification, widget *w, void *notification_data) { + int *d = notification_data; + int button = d[0]; + gnb_data *ed = private; + gnb_gui *e = ed->e; + int ue = ed->ue; + int do_reset = 0; + + if (button != 1) return; + if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; } + if (w == e->next_ue_button) ue++; + if (w == e->current_ue_button) do_reset = 1; + + if (pthread_mutex_lock(&ed->lock)) abort(); + if (do_reset) reset_ue_ids(); + if (ue != ed->ue) { + set_current_ue(g, ed, ue); + ed->ue = ue; + } + if (pthread_mutex_unlock(&ed->lock)) abort(); +} + +static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, gnb_data *ed) { + widget *main_window; widget *top_container; widget *line; + widget *col; + widget *logo; widget *w; + widget *w2; logger *l; view *v; - main_window = new_toplevel_window(g, 500, 300, "gNB tracer"); - + main_window = new_toplevel_window(g, 1200, 900, "gNB tracer"); top_container = new_container(g, VERTICAL); widget_add_child(g, main_window, top_container, -1); line = new_container(g, HORIZONTAL); widget_add_child(g, top_container, line, -1); + logo = new_image(g, openair_logo_png, openair_logo_png_len); - /* PUCCH/PUSCH IQ data */ - w = new_xy_plot(g, 55, 55, "", 50); + // logo + prev/next UE buttons + col = new_container(g, VERTICAL); + widget_add_child(g, col, logo, -1); + w = new_container(g, HORIZONTAL); + widget_add_child(g, col, w, -1); + w2 = new_label(g, ""); + widget_add_child(g, w, w2, -1); + label_set_clickable(g, w2, 1); + e->current_ue_button = w2; + e->current_ue_label = w2; + w2 = new_label(g, " [prev UE] "); + widget_add_child(g, w, w2, -1); + label_set_clickable(g, w2, 1); + e->prev_ue_button = w2; + w2 = new_label(g, " [next UE] "); + widget_add_child(g, w, w2, -1); + label_set_clickable(g, w2, 1); + e->next_ue_button = w2; + widget_add_child(g, line, col, -1); + + // PUCCH/PUSCH IQ data + w = new_xy_plot(g, 200, 200, "", 10); e->pucch_pusch_iq_plot = w; widget_add_child(g, line, w, -1); xy_plot_set_range(g, w, -1000, 1000, -1000, 1000); - xy_plot_set_title(g, w, "rxdataF"); + xy_plot_set_title(g, w, " GNB_PHY_PUCCH_PUSCH_IQ"); l = new_iqlog_full(h, database, "GNB_PHY_PUCCH_PUSCH_IQ", "rxdataF"); v = new_view_xy(300*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE); logger_add_view(l, v); e->pucch_pusch_iq_logger = l; + + set_current_ue(g, ed, ed->ue); + register_notifier(g, "click", e->current_ue_button, click, ed); + register_notifier(g, "click", e->prev_ue_button, click, ed); + register_notifier(g, "click", e->next_ue_button, click, ed); } -int main(int n, char **v) -{ +int main(int n, char **v) { + char *database_filename = NULL; void *database; char *ip = DEFAULT_REMOTE_IP; @@ -115,8 +188,11 @@ int main(int n, char **v) for (i = 1; i < n; i++) { if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); - if (!strcmp(v[i], "-d")) - { if (i > n-2) usage(); database_filename = v[++i]; continue; } + if (!strcmp(v[i], "-d")) { + if (i > n-2) usage(); + database_filename = v[++i]; + continue; + } usage(); } @@ -137,6 +213,8 @@ int main(int n, char **v) on_off(database, "GNB_PHY_PUCCH_PUSCH_IQ", is_on, 1); + gnb_data.ue = 0; + gnb_data.e = ⪚ gnb_data.database = database; gnb_data.socket = -1; gnb_data.is_on = is_on; From 0f48386133c6907e486a427b23c368e7fc12752c Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 10 Dec 2021 17:44:46 +0100 Subject: [PATCH 176/883] improvements in handling tdd structure --- common/utils/nr/nr_common.c | 42 +++++++++++++++++++ common/utils/nr/nr_common.h | 1 + openair2/LAYER2/NR_MAC_gNB/config.c | 23 ++++++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 11 +++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 38 +++++++++-------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 4 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 25 +++++++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 34 ++++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 26 ++++++++---- 9 files changed, 141 insertions(+), 63 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index a704a66c76..4b006ca425 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -257,6 +257,48 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) { *n_rb = 6*count; } +int get_nb_periods_per_frame(uint8_t tdd_period) { + + int nb_periods_per_frame; + switch(tdd_period) { + case 0: + nb_periods_per_frame = 20; // 10ms/0p5ms + break; + + case 1: + nb_periods_per_frame = 16; // 10ms/0p625ms + break; + + case 2: + nb_periods_per_frame = 10; // 10ms/1ms + break; + + case 3: + nb_periods_per_frame = 8; // 10ms/1p25ms + break; + + case 4: + nb_periods_per_frame = 5; // 10ms/2ms + break; + + case 5: + nb_periods_per_frame = 4; // 10ms/2p5ms + break; + + case 6: + nb_periods_per_frame = 2; // 10ms/5ms + break; + + case 7: + nb_periods_per_frame = 1; // 10ms/10ms + break; + + default: + AssertFatal(1==0,"Undefined tdd period %d\n", tdd_period); + } + return nb_periods_per_frame; +} + int get_dmrs_port(int nl, uint16_t dmrs_ports) { diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index d9f2b0c03a..4165ca2d41 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -71,6 +71,7 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); int get_dmrs_port(int nl, uint16_t dmrs_ports); +int get_nb_periods_per_frame(uint8_t tdd_period); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 5223b00e2a..0c397187b5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -492,16 +492,25 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, find_SSB_and_RO_available(Mod_idP); const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; - const int nr_dlmix_slots = tdd ? tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0) : 0; - const int nr_dl_slots = tdd ? nr_dlmix_slots : n; - const int nr_ulstart_slot = tdd ? tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0) : 1; + + int nr_slots_period = n; + int nr_dl_slots = n; + int nr_ulstart_slot = 0; + if (tdd) { + nr_dl_slots = tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0); + nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0); + nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + } + else{ + if(RC.nrmac[Mod_idP]->common_channels[0].frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + } for (int slot = 0; slot < n; ++slot) { /* FIXME: it seems there is a problem with slot 0/10/slots right after UL: - * we just get retransmissions. Thus, do not schedule such slots in DL */ - if (slot % nr_slots_period != 0){ + * we just get retransmissions. Thus, do not schedule such slots in DL in TDD */ + if (RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD || + (slot % nr_slots_period != 0)){ RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dl_slots) << (slot % 64); } RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 7b6dc0e01d..1929f58943 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -36,6 +36,7 @@ #include "NR_MAC_gNB/mac_proto.h" #include "common/utils/LOG/log.h" +#include "common/utils/nr/nr_common.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "OCG.h" @@ -284,13 +285,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; if (slot==0 && (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]>=257)) { + //FR2 const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; - const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; - const int nb_periods_per_frame = n / nr_slots_period; - - // re-initialization of tdd_beam_association at beginning of frame (only for FR2) + AssertFatal(tdd,"Dynamic TDD not handled yet\n"); + const int nb_periods_per_frame = get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + // re-initialization of tdd_beam_association at beginning of frame for (int i=0; itdd_beam_association[i] = -1; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index fcfbc455ca..dcd85e880b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -397,6 +397,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, uint16_t *msg2_frame, uint16_t *msg2_slot, NR_ServingCellConfigCommon_t *scc, + lte_frame_type_t frame_type, uint16_t monitoring_slot_period, uint16_t monitoring_offset,uint8_t beam_index, uint8_t num_active_ssb, @@ -411,17 +412,20 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; // number of mixed slot or of last dl slot if there is no mixed slot - uint8_t last_dl_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; + uint8_t last_dl_slot_period = n_slots_frame-1; // lenght of tdd period in slots - uint8_t tdd_period_slot = tdd ? scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots : n_slots_frame; + uint8_t tdd_period_slot = n_slots_frame; - if (tdd && (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols == 0)) { - last_dl_slot_period--; + if (tdd) { + last_dl_slot_period = tdd->nrofDownlinkSymbols == 0? (tdd->nrofDownlinkSlots-1) : tdd->nrofDownlinkSlots; + tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - if (tdd && ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))) { - tdd_period_slot++; + else{ + if(frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); } + switch(response_window){ case NR_RACH_ConfigGeneric__ra_ResponseWindow_sl1: slot_window = 1; @@ -515,6 +519,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, gNB_MAC_INST *nr_mac = RC.nrmac[module_idP]; NR_COMMON_channels_t *cc = &nr_mac->common_channels[CC_id]; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; + lte_frame_type_t frame_type = cc->frame_type; uint8_t total_RApreambles = MAX_NUM_NR_PRACH_PREAMBLES; uint8_t num_ssb_per_RO = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present; @@ -619,6 +624,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, &msg2_frame, &msg2_slot, scc, + frame_type, monitoring_slot_period, monitoring_offset, beam_index, @@ -728,15 +734,11 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t // beam association for FR2 int16_t *tdd_beam_association = nr_mac->tdd_beam_association; if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) { - + // FR2 const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - uint8_t tdd_period_slot = tdd ? scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots : n_slots_frame; - - if (tdd && ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))) { - tdd_period_slot++; - } - + AssertFatal(tdd,"Dynamic TDD not handled yet\n"); + uint8_t tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); int num_tdd_period = sched_slot/tdd_period_slot; if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id)) @@ -886,6 +888,8 @@ void nr_get_Msg3alloc(module_id_t module_id, uint16_t msg3_nb_rb = 8; // sdu has 6 or 8 bytes + lte_frame_type_t frame_type = RC.nrmac[module_id]->common_channels->frame_type; + int mu = ubwp ? ubwp->bwp_Common->genericParameters.subcarrierSpacing : scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; @@ -901,7 +905,7 @@ void nr_get_Msg3alloc(module_id_t module_id, 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[mu]; - const int nrofUplinkSymbols = tdd ? tdd->nrofUplinkSymbols : 4; + const int nrofUplinkSymbols = (frame_type==TDD) ? tdd->nrofUplinkSymbols : 11; // TODO change in favor of harmonization branch uint8_t k2 = 0; for (int i=0; ilist.count; i++) { startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; @@ -927,10 +931,8 @@ void nr_get_Msg3alloc(module_id_t module_id, // beam association for FR2 if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) { - uint8_t tdd_period_slot = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots : n_slots_frame; - if (tdd && ((tdd->nrofDownlinkSymbols > 0) || (tdd->nrofUplinkSymbols > 0))) { - tdd_period_slot++; - } + AssertFatal(tdd,"Dynamic TDD not handled yet\n"); + uint8_t tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); int num_tdd_period = ra->Msg3_slot/tdd_period_slot; if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id)) AssertFatal(1==0,"Cannot schedule MSG3\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 090c9523ef..d7a004b17f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -268,8 +268,8 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) fill_ssb_vrb_map(cc, offset_pointa, ssb_start_symbol, CC_id); const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; + // FR2 is only TDD, to be fixed for flexible TDD + const int nr_slots_period = tdd ? n_slots_frame/get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity) : n_slots_frame; num_tdd_period = rel_slot/nr_slots_period; gNB->tdd_beam_association[num_tdd_period]=i_ssb; num_ssb++; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0f0f38cd75..65a97e01ac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -62,9 +62,23 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * /* there is a mixed slot only when in TDD */ NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon; + lte_frame_type_t frame_type = nrmac->common_channels->frame_type; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - const int symb_dlMixed = tdd ? (1 << tdd->nrofDownlinkSymbols) - 1 : 0; + + int symb_dlMixed = 0; + int nr_mix_slots = 0; + int nr_slots_period = n; + if (tdd) { + symb_dlMixed = (1 << tdd->nrofDownlinkSymbols) - 1; + nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; + nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + } + else{ + if(frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + } int target_ss; if (bwp) { @@ -97,7 +111,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * /* check that TDA index 1 fits into DL part of mixed slot, if it exists */ int tdaMi = -1; - if (tdd && tdaList->list.count > 1) { + if (frame_type == TDD && tdaList->list.count > 1) { const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; AssertFatal(!tdaP_Mi->k0 || *tdaP_Mi->k0 == 0, "TimeDomainAllocation at index 1: non-null k0 (%ld) is not supported by the scheduler\n", @@ -120,16 +134,13 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * } } - const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_dl_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_dl_tda[bwp_id])); - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; for (int i = 0; i < n; ++i) { nrmac->preferred_dl_tda[bwp_id][i] = -1; - if (!tdd || i % nr_slots_period < tdd->nrofDownlinkSlots) + if (frame_type == FDD || i % nr_slots_period < tdd->nrofDownlinkSlots) nrmac->preferred_dl_tda[bwp_id][i] = 0; - else if (tdd && nr_mix_slots && i % nr_slots_period == tdd->nrofDownlinkSlots) + else if (nr_mix_slots && i % nr_slots_period == tdd->nrofDownlinkSlots) nrmac->preferred_dl_tda[bwp_id][i] = tdaMi; LOG_D(MAC, "slot %d preferred_dl_tda %d\n", i, nrmac->preferred_dl_tda[bwp_id][i]); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 42dffee5cc..1365a02505 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -32,6 +32,7 @@ #include "NR_MAC_COMMON/nr_mac_extern.h" #include "NR_MAC_gNB/mac_proto.h" #include "common/ran_context.h" +#include "common/utils/nr/nr_common.h" #include "nfapi/oai_integration/vendor_ext.h" extern RAN_CONTEXT_t RC; @@ -1182,26 +1183,27 @@ int nr_acknack_scheduling(int mod_id, int r_pucch, int is_common) { - const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; - const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; - const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - const int nr_mix_slots = tdd? (tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0) : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n_slots_frame; - const int first_ul_slot_tdd = tdd? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : 0; - const int first_ul_slot_period = tdd? tdd->nrofDownlinkSlots : 0; 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 n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + // initializing the values for FDD + int nr_slots_period = n_slots_frame; + int first_ul_slot_tdd = slot + minfbtime; + int first_ul_slot_period = 0; + if(tdd){ + nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); + first_ul_slot_period = tdd->nrofDownlinkSlots; + } + else{ + if(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + } NR_sched_pucch_t *csi_pucch; - if (tdd) { - AssertFatal(slot < first_ul_slot_tdd + (tdd->nrofUplinkSymbols != 0), - "cannot handle multiple TDD periods (yet): slot %d first_ul_slot_tdd %d nrofUplinkSlots %ld\n", - slot, - first_ul_slot_tdd, - tdd->nrofUplinkSlots); - } - /* 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] @@ -1320,7 +1322,7 @@ int nr_acknack_scheduling(int mod_id, AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); - const int s = tdd ? first_ul_slot_tdd : slot + minfbtime; + const int s = first_ul_slot_tdd; pucch->frame = (s < n_slots_frame - 1) ? frame : (frame + 1) % 1024; pucch->ul_slot = s % n_slots_frame; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 49871670a3..37f735a0c5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -59,11 +59,24 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* there is a mixed slot only when in TDD */ NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon; + lte_frame_type_t frame_type = nrmac->common_channels->frame_type; + const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const int mu = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; /* Uplink symbols are at the end of the slot */ - const int symb_ulMixed = tdd ? ((1 << tdd->nrofUplinkSymbols) - 1) << (14 - tdd->nrofUplinkSymbols) : 0; + int symb_ulMixed = 0; + int nr_mix_slots = 0; + int nr_slots_period = n; + if (tdd) { + symb_ulMixed = ((1 << tdd->nrofUplinkSymbols) - 1) << (14 - tdd->nrofUplinkSymbols); + nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; + nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + } + else{ + if(frame_type == TDD) + AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + } const struct NR_PUCCH_Config__resourceToAddModList *resList = ubwp->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList; // for the moment, just block any symbol that might hold a PUCCH, regardless @@ -117,7 +130,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub // get largest time domain allocation (TDA) for UL slot and UL in mixed slot int tdaMi = -1; - if (tdd) { + if (nr_mix_slots>0) { const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", @@ -139,16 +152,15 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub symb_tda_mi); } } - const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); - const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; - const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n; + for (int slot = 0; slot < n; ++slot) { const int sched_slot = (slot + k2) % n; nrmac->preferred_ul_tda[bwp_id][slot] = -1; - if (!tdd || sched_slot % nr_slots_period >= tdd->nrofDownlinkSlots + nr_mix_slots) + if (frame_type == FDD || sched_slot % nr_slots_period >= tdd->nrofDownlinkSlots + nr_mix_slots) nrmac->preferred_ul_tda[bwp_id][slot] = 0; - else if (tdd && nr_mix_slots && sched_slot % nr_slots_period == tdd->nrofDownlinkSlots) + else if (nr_mix_slots && sched_slot % nr_slots_period == tdd->nrofDownlinkSlots) nrmac->preferred_ul_tda[bwp_id][slot] = tdaMi; LOG_D(MAC, "DL slot %d UL slot %d preferred_ul_tda %d\n", slot, sched_slot, nrmac->preferred_ul_tda[bwp_id][slot]); } From 2ad5045efe78bb2b8af1741a7cb105507a4cd39f Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 10 Dec 2021 20:02:39 +0000 Subject: [PATCH 177/883] Tracer for UL estimated channel based on SRS --- common/utils/T/tracer/gnb.c | 29 +++++++++++++++++++---- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 3 +++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index 4daad92842..baa559b850 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -17,11 +17,13 @@ int next_ue_id; typedef struct { widget *pucch_pusch_iq_plot; - logger *pucch_pusch_iq_logger; + widget *ul_estimate_ue_xy_plot; widget *current_ue_label; widget *current_ue_button; widget *prev_ue_button; widget *next_ue_button; + logger *pucch_pusch_iq_logger; + logger *ul_estimate_ue_logger; } gnb_gui; typedef struct { @@ -78,9 +80,17 @@ static void *gui_thread(void *_g) { } static void set_current_ue(gui *g, gnb_data *e, int ue) { + char s[256]; + sprintf(s, "[UE %d] ", ue); label_set_text(g, e->e->current_ue_label, s); + + sprintf(s, "GNB_PHY_PUCCH_PUSCH_IQ [UE %d]", ue); + xy_plot_set_title(g, e->e->pucch_pusch_iq_plot, s); + + sprintf(s, "UL estimated channel [UE %d]", ue); + xy_plot_set_title(g, e->e->ul_estimate_ue_xy_plot, s); } void reset_ue_ids(void) { @@ -127,7 +137,7 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g logger *l; view *v; - main_window = new_toplevel_window(g, 1200, 900, "gNB tracer"); + main_window = new_toplevel_window(g, 1050, 230, "gNB tracer"); top_container = new_container(g, VERTICAL); widget_add_child(g, main_window, top_container, -1); @@ -160,12 +170,22 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g e->pucch_pusch_iq_plot = w; widget_add_child(g, line, w, -1); xy_plot_set_range(g, w, -1000, 1000, -1000, 1000); - xy_plot_set_title(g, w, " GNB_PHY_PUCCH_PUSCH_IQ"); l = new_iqlog_full(h, database, "GNB_PHY_PUCCH_PUSCH_IQ", "rxdataF"); v = new_view_xy(300*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE); logger_add_view(l, v); e->pucch_pusch_iq_logger = l; + // UL estimated channel + w = new_xy_plot(g, 600, 200, "", 50); + e->ul_estimate_ue_xy_plot = w; + widget_add_child(g, line, w, -1); + xy_plot_set_range(g, w, 0, 512*10, -10, 80); + l = new_framelog(h, database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "subframe", "chest_t"); + framelog_set_update_only_at_sf9(l, 0); + v = new_view_xy(512*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); + logger_add_view(l, v); + e->ul_estimate_ue_logger = l; + set_current_ue(g, ed, ed->ue); register_notifier(g, "click", e->current_ue_button, click, ed); register_notifier(g, "click", e->prev_ue_button, click, ed); @@ -212,6 +232,7 @@ int main(int n, char **v) { h = new_handler(database); on_off(database, "GNB_PHY_PUCCH_PUSCH_IQ", is_on, 1); + on_off(database, "ENB_PHY_UL_CHANNEL_ESTIMATE", is_on, 1); gnb_data.ue = 0; gnb_data.e = ⪚ @@ -233,7 +254,7 @@ restart: if (gnb_data.socket != -1) close(gnb_data.socket); gnb_data.socket = connect_to(ip, port); - /* send the first message - activate selected traces */ + // send the first message - activate selected traces is_on_changed(&gnb_data); /* read messages */ diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 1f01bc4a46..fb460b7550 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -812,6 +812,9 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->nr_srs_info[i]->srs_estimated_channel, gNB->nr_srs_info[i]->noise_power); + T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx), T_INT(0), + T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel[0], 512 * 4)); + srs->active = 0; } } From 34866293c1485a612e9e62c4c777d2234b0b3dc5 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 11 Dec 2021 17:32:09 +0100 Subject: [PATCH 178/883] minor changes --- openair1/PHY/CODING/crc_byte.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/config.c | 4 +--- targets/ARCH/AW2SORI/oaiori.c | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index c3b141db8e..a0ad837e87 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -153,7 +153,7 @@ unsigned int crc24a (unsigned char * inptr, { int octetlen = bitlen / 8; /* Change in octets */ - if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) { + if ( bitlen % 8 /*|| !__builtin_cpu_supports ("pclmul")*/ ) { unsigned int crc = 0; int resbit = (bitlen % 8); @@ -187,7 +187,7 @@ unsigned int crc24b (unsigned char * inptr, { int octetlen = bitlen / 8; /* Change in octets */ - if ( bitlen % 8 || !__builtin_cpu_supports ("pclmul") ) { + if ( bitlen % 8 /*|| !__builtin_cpu_supports ("pclmul") */) { unsigned int crc = 0; int resbit = (bitlen % 8); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 1cb3fdb708..4687f6aeea 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -325,8 +325,6 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts } else { ssb_SubcarrierOffset_limit = 12; } - if (ssb_SubcarrierOffsetssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG; @@ -334,7 +332,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts cfg->ssb_table.ssb_period.value = *scc->ssb_periodicityServingCell; cfg->ssb_table.ssb_period.tl.tag = NFAPI_NR_CONFIG_SSB_PERIOD_TAG; cfg->num_tlv++; - cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset; + cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset>>(cfg->ssb_config.scs_common.value); cfg->ssb_table.ssb_subcarrier_offset.tl.tag = NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG; cfg->num_tlv++; diff --git a/targets/ARCH/AW2SORI/oaiori.c b/targets/ARCH/AW2SORI/oaiori.c index f79e2fad20..ec69e27135 100644 --- a/targets/ARCH/AW2SORI/oaiori.c +++ b/targets/ARCH/AW2SORI/oaiori.c @@ -317,7 +317,10 @@ int aw2s_startstreaming(openair0_device *device) { (openair0_cfg->rx_num_channels > 1 && rx1->fst != ORI_FST_Operational) || tx0->fst != ORI_FST_Operational || (openair0_cfg->tx_num_channels > 1 && tx1->fst != ORI_FST_Operational)) - {} + { + printf("rx0->fst %d,rx1->fst %d,tx0->fst %d, tx1->fst %d\n", + rx0->fst,rx1 ? rx1->fst : -1, tx0->fst, tx1 ? tx1->fst: -1); + } // test RX interface uint64_t TS; From a2842e953d317223d9933109e4f310b6011de5c3 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 13 Dec 2021 10:58:57 +0000 Subject: [PATCH 179/883] Add GNB_PHY_UL_CHANNEL_ESTIMATE for Tracer --- common/utils/T/T_messages.txt | 4 ++++ common/utils/T/tracer/gnb.c | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 192bf8cc37..d6309df941 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -93,6 +93,10 @@ ID = GNB_PHY_PUCCH_PUSCH_IQ DESC = gNodeB input data in the frequency domain for a slot where some PUCCH or PUSCH detection was done GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB FORMAT = int,frame : int,slot : buffer,rxdataF +ID = GNB_PHY_UL_CHANNEL_ESTIMATE + DESC = gNodeB channel estimation in the frequency domain + GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB + FORMAT = int,gNB_ID : int,rnti : int,frame : int,subframe : int,antenna : buffer,chest_t ID = GNB_PHY_PRACH_INPUT_SIGNAL DESC = gNodeB input data in the time domain for slots with PRACH detection GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index baa559b850..6812f9157b 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -180,7 +180,7 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g e->ul_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); xy_plot_set_range(g, w, 0, 512*10, -10, 80); - l = new_framelog(h, database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "subframe", "chest_t"); + l = new_framelog(h, database, "GNB_PHY_UL_CHANNEL_ESTIMATE", "subframe", "chest_t"); framelog_set_update_only_at_sf9(l, 0); v = new_view_xy(512*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index fb460b7550..9ac9dba4bd 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -812,7 +812,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->nr_srs_info[i]->srs_estimated_channel, gNB->nr_srs_info[i]->noise_power); - T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx), T_INT(0), + T(T_GNB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx), T_INT(0), T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel[0], 512 * 4)); srs->active = 0; From 1341646ba4a5bdd5fe01d609f4fe2ea650167f1b Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 13 Dec 2021 11:33:31 +0000 Subject: [PATCH 180/883] Call on_off for GNB_PHY_UL_CHANNEL_ESTIMATE --- common/utils/T/tracer/gnb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index 6812f9157b..f9e4297b40 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -232,7 +232,7 @@ int main(int n, char **v) { h = new_handler(database); on_off(database, "GNB_PHY_PUCCH_PUSCH_IQ", is_on, 1); - on_off(database, "ENB_PHY_UL_CHANNEL_ESTIMATE", is_on, 1); + on_off(database, "GNB_PHY_UL_CHANNEL_ESTIMATE", is_on, 1); gnb_data.ue = 0; gnb_data.e = ⪚ From b4e108e46cbe390cf01ad9bacfbf2cd5ec187176 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 13 Dec 2021 13:09:13 +0000 Subject: [PATCH 181/883] Code formatting improvements --- common/utils/T/tracer/gnb.c | 59 +++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index f9e4297b40..1086636b2f 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -36,8 +36,8 @@ typedef struct { void *database; } gnb_data; -void is_on_changed(void *_d) { - +void is_on_changed(void *_d) +{ gnb_data *d = _d; char t; @@ -61,26 +61,28 @@ connection_dies: if (pthread_mutex_unlock(&d->lock)) abort(); } -void usage(void) { +void usage(void) +{ printf( - "options:\n" - " -d this option is mandatory\n" - " -ip connect to given IP address (default %s)\n" - " -p connect to given port (default %d)\n", - DEFAULT_REMOTE_IP, - DEFAULT_REMOTE_PORT +"options:\n" +" -d this option is mandatory\n" +" -ip connect to given IP address (default %s)\n" +" -p connect to given port (default %d)\n", + DEFAULT_REMOTE_IP, + DEFAULT_REMOTE_PORT ); exit(1); } -static void *gui_thread(void *_g) { +static void *gui_thread(void *_g) +{ gui *g = _g; gui_loop(g); return NULL; } -static void set_current_ue(gui *g, gnb_data *e, int ue) { - +static void set_current_ue(gui *g, gnb_data *e, int ue) +{ char s[256]; sprintf(s, "[UE %d] ", ue); @@ -93,17 +95,19 @@ static void set_current_ue(gui *g, gnb_data *e, int ue) { xy_plot_set_title(g, e->e->ul_estimate_ue_xy_plot, s); } -void reset_ue_ids(void) { +void reset_ue_ids(void) +{ int i; printf("resetting known UEs\n"); for (i = 0; i < 65536; i++) ue_id[i] = -1; ue_id[65535] = 0; - ue_id[65534] = 1; // HACK: to be removed - ue_id[2] = 2; // this supposes RA RNTI = 2, very openair specific + ue_id[65534] = 1; /* HACK: to be removed */ + ue_id[2] = 2; /* this supposes RA RNTI = 2, very openair specific */ next_ue_id = 0; } -static void click(void *private, gui *g, char *notification, widget *w, void *notification_data) { +static void click(void *private, gui *g, char *notification, widget *w, void *notification_data) +{ int *d = notification_data; int button = d[0]; gnb_data *ed = private; @@ -125,8 +129,8 @@ static void click(void *private, gui *g, char *notification, widget *w, void *no if (pthread_mutex_unlock(&ed->lock)) abort(); } -static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, gnb_data *ed) { - +static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, gnb_data *ed) +{ widget *main_window; widget *top_container; widget *line; @@ -145,7 +149,7 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g widget_add_child(g, top_container, line, -1); logo = new_image(g, openair_logo_png, openair_logo_png_len); - // logo + prev/next UE buttons + /* logo + prev/next UE buttons */ col = new_container(g, VERTICAL); widget_add_child(g, col, logo, -1); w = new_container(g, HORIZONTAL); @@ -165,7 +169,7 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g e->next_ue_button = w2; widget_add_child(g, line, col, -1); - // PUCCH/PUSCH IQ data + /* PUCCH/PUSCH IQ data */ w = new_xy_plot(g, 200, 200, "", 10); e->pucch_pusch_iq_plot = w; widget_add_child(g, line, w, -1); @@ -175,7 +179,7 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g logger_add_view(l, v); e->pucch_pusch_iq_logger = l; - // UL estimated channel + /* UL estimated channel */ w = new_xy_plot(g, 600, 200, "", 50); e->ul_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); @@ -192,8 +196,8 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g register_notifier(g, "click", e->next_ue_button, click, ed); } -int main(int n, char **v) { - +int main(int n, char **v) +{ char *database_filename = NULL; void *database; char *ip = DEFAULT_REMOTE_IP; @@ -208,11 +212,8 @@ int main(int n, char **v) { for (i = 1; i < n; i++) { if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); - if (!strcmp(v[i], "-d")) { - if (i > n-2) usage(); - database_filename = v[++i]; - continue; - } + if (!strcmp(v[i], "-d")) + { if (i > n-2) usage(); database_filename = v[++i]; continue; } usage(); } @@ -254,7 +255,7 @@ restart: if (gnb_data.socket != -1) close(gnb_data.socket); gnb_data.socket = connect_to(ip, port); - // send the first message - activate selected traces + /* send the first message - activate selected traces */ is_on_changed(&gnb_data); /* read messages */ From 29599ab91fd45cdf065dd2415b58f5befb212b60 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 13 Dec 2021 15:52:46 +0100 Subject: [PATCH 182/883] fixes for FDD --- ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 6f65d983d7..5211c3de6f 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index dcd85e880b..b70112032c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1034,12 +1034,15 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.new_data_indicator = 1; pusch_pdu->pusch_data.num_cb = 0; + int num_dmrs_symb = 0; + for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) + num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->target_code_rate, pusch_pdu->rb_size, pusch_pdu->nr_of_symbols, - 12, // nb dmrs set for no data in dmrs symbol + num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol 0, //nb_rb_oh 0, // to verify tb scaling pusch_pdu->nrOfLayers)>>3; From 9f9fdb95eb4656ea6d37f003df04bdbc4f29d766 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 13 Dec 2021 16:12:10 +0100 Subject: [PATCH 183/883] fix in config file --- ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 27cf57f50a..4200300c50 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { From 171408bc4d3b02a8b42b5755434fd1ff7daaf42d Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 13 Dec 2021 21:25:38 +0100 Subject: [PATCH 184/883] pucch DTX threshold modification --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 4921a79fa5..ea926d0bbb 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -400,7 +400,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_stats->pucch0_thres = gNB->pucch0_thres; /* + (10*max_n0);*/ bool no_conf=false; if (nr_sequences>1) { - if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < uci_stats->pucch0_thres) + if (/*xrtmag_dBtimes10 < (30+xrtmag_next_dBtimes10) ||*/ SNRtimes10 < uci_stats->pucch0_thres) no_conf=true; } gNB->bad_pucch += no_conf; @@ -431,7 +431,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = !(index&0x01); - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + if (no_conf) LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { @@ -450,7 +450,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list[1].harq_value = !(index&0x01); uci_pdu->harq->harq_list[0].harq_value = !((index>>1)&0x01); - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + if (no_conf) LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); From a3cb841b6f8ea2ec1b74058a94f361b5465ad916 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 14 Dec 2021 09:54:14 +0000 Subject: [PATCH 185/883] Add config file for 162PRBs (60MHz BW) --- ...gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 331 ++++++++++++++++++ 1 file changed, 331 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf new file mode 100644 index 0000000000..83fd3e0886 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -0,0 +1,331 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; +# do_CSIRS = 1; + min_rxtxtime_pdsch = 2; + ul_prbblacklist = "79,80,81,82" + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 10; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3300.60 MHz + 81*12*30e-3 MHz = 3329.76 + absoluteFrequencySSB = 621984; + # this is 3300.60 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=0,L=162 (275*(275-L+1))+(274-RBstart)) + initialDLBWPlocationAndBandwidth = 31899; + # +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 10; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; + + #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 = 31899; +# 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 = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -70; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 0; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 120; +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + sf_extension = 0; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.2,clock_source=internal,time_source=internal" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; From 9e2ab1a36ab338481521b03ca66090feea50d7ba Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 14 Dec 2021 13:57:45 +0000 Subject: [PATCH 186/883] Delete min_rxtxtime_pdsch from config file gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf to get 0 errors in iperf with COTS --- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 154af4aac3..a556a9c126 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -35,7 +35,6 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; - min_rxtxtime_pdsch = 6; sib1_tda = 0; do_SRS = 1; ul_prbblacklist = "51,52,53,54" From edb6b9b4227a6886da2306e4a36cf5045489251c Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 14 Dec 2021 18:00:55 +0000 Subject: [PATCH 187/883] Increase SRS periodicity to get higher bitrate --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index 12d30d59a4..a2b27357dd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -175,7 +175,7 @@ void nr_schedule_srs(int module_id, frame_t frame) { // Check if UE will transmit the SRS in this frame if ( ((frame - offset/n_slots_frame)*n_slots_frame)%period == 0) { - LOG_D(NR_MAC,"(%d.%d) Scheduling SRS reception\n", frame, offset%n_slots_frame); + LOG_D(NR_MAC,"Scheduling SRS reception for %d.%d\n", frame, offset%n_slots_frame); nr_fill_nfapi_srs(module_id, CC_id, UE_id, offset%n_slots_frame, srs_resource); sched_ctrl->sched_srs.frame = frame; sched_ctrl->sched_srs.slot = offset%n_slots_frame; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 9c741ef7e4..22916c6faa 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1021,8 +1021,8 @@ void fill_initial_SpCellConfig(rnti_t rnti, // This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4. // However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources, - // where the startPosition = 1, 2 or 3 and sl40 = 7, 17, 27 or 37 only give us 12 different allocations. - AssertFatal(uid>=0 && uid<12, "gNB cannot allocate the SRS resources\n"); + // where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations. + AssertFatal(uid>=0 && uid<30, "gNB cannot allocate the SRS resources\n"); int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE); SpCellConfig->servCellIndex = NULL; @@ -1182,7 +1182,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, srs_res0->transmissionComb.choice.n2=calloc(1,sizeof(*srs_res0->transmissionComb.choice.n2)); srs_res0->transmissionComb.choice.n2->combOffset_n2=0; srs_res0->transmissionComb.choice.n2->cyclicShift_n2=0; - srs_res0->resourceMapping.startPosition = 1 + uid%3; + srs_res0->resourceMapping.startPosition = 2 + uid%2; srs_res0->resourceMapping.nrofSymbols=NR_SRS_Resource__resourceMapping__nrofSymbols_n1; srs_res0->resourceMapping.repetitionFactor=NR_SRS_Resource__resourceMapping__repetitionFactor_n1; srs_res0->freqDomainPosition=0; @@ -1197,8 +1197,8 @@ void fill_initial_SpCellConfig(rnti_t rnti, if(carrier->do_SRS) { srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); - srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; - srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 7 + (uid/3)*10; // 7/17/27/37 are mixed slots + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl160; + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl160 = 17 + (uid>1)*10; // 17/17/.../147/157 are mixed slots } else { srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); From 351b74205b1eecade3451c2c392a1debc94b39d5 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 14 Dec 2021 18:07:41 +0000 Subject: [PATCH 188/883] Increase SRS periodicity to get higher bitrate in NSA --- openair2/RRC/NR/rrc_gNB_reconfig.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index bc8bb0a56a..20d635ba9b 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -65,8 +65,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco // This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4. // However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources, - // where the startPosition = 1, 2 or 3 and sl40 = 7, 17, 27 or 37 only give us 12 different allocations. - AssertFatal(uid>=0 && uid<12, "gNB cannot allocate the SRS resources\n"); + // where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations. + AssertFatal(uid>=0 && uid<30, "gNB cannot allocate the SRS resources\n"); uint64_t bitmap=0; switch (servingcellconfigcommon->ssb_PositionsInBurst->present) { @@ -836,7 +836,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco srs_res0->transmissionComb.choice.n2=calloc(1,sizeof(*srs_res0->transmissionComb.choice.n2)); srs_res0->transmissionComb.choice.n2->combOffset_n2=0; srs_res0->transmissionComb.choice.n2->cyclicShift_n2=0; - srs_res0->resourceMapping.startPosition = 1 + uid%3; + srs_res0->resourceMapping.startPosition = 2 + uid%2; srs_res0->resourceMapping.nrofSymbols=NR_SRS_Resource__resourceMapping__nrofSymbols_n1; srs_res0->resourceMapping.repetitionFactor=NR_SRS_Resource__resourceMapping__repetitionFactor_n1; srs_res0->freqDomainPosition=0; @@ -851,8 +851,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco if(do_srs) { srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); - srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl40; - srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl40 = 7 + (uid/3)*10; // 7/17/27/37 are mixed slots + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl160; + srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.choice.sl160 = 17 + (uid>1)*10; // 17/17/.../147/157 are mixed slots } else { srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_aperiodic; srs_res0->resourceType.choice.aperiodic=calloc(1,sizeof(*srs_res0->resourceType.choice.aperiodic)); From 096869e07fb33fa7947db23b9ea7ce11be5053a7 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 14 Dec 2021 20:11:41 +0000 Subject: [PATCH 189/883] SRS tracer improvements --- common/utils/T/tracer/gnb.c | 4 ++-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index 1086636b2f..2f0ed6b246 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -183,10 +183,10 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g w = new_xy_plot(g, 600, 200, "", 50); e->ul_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, 0, 512*10, -10, 80); + xy_plot_set_range(g, w, 0, 100*10, -10, 80); l = new_framelog(h, database, "GNB_PHY_UL_CHANNEL_ESTIMATE", "subframe", "chest_t"); framelog_set_update_only_at_sf9(l, 0); - v = new_view_xy(512*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); + v = new_view_xy(100*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); e->ul_estimate_ue_logger = l; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 9ac9dba4bd..b5d0e5373e 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -812,8 +812,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->nr_srs_info[i]->srs_estimated_channel, gNB->nr_srs_info[i]->noise_power); - T(T_GNB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx), T_INT(0), - T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel[0], 512 * 4)); + T(T_GNB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), + T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel[0], 100 * 4)); srs->active = 0; } From bdf5d26b821246c3eb78e7ac7cc9d53b098b7f8b Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 15 Dec 2021 08:44:53 +0100 Subject: [PATCH 190/883] changing the name of a function --- common/utils/nr/nr_common.c | 4 +-- common/utils/nr/nr_common.h | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 8 ++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 6 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 20 +++++------ .../NR_MAC_gNB/gNB_scheduler_primitives.c | 36 +++++++++---------- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 42c7ef9c7e..65fecea96f 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -473,8 +473,8 @@ int get_subband_size(int NPRB,int size) { } // from start symbol index and nb or symbols to symbol occupation bitmap in a slot -uint16_t startandlength_to_bitmat(int startSymbolIndex, int nrOfSymbols) { - return (((1<state = WAIT_Msg3; @@ -1609,7 +1609,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra int i = 0; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { - if (vrb_map[BWPStart + rbStart + i]&startandlength_to_bitmat(startSymbolIndex, nrOfSymbols)) { + if (vrb_map[BWPStart + rbStart + i]&SL_to_bitmap(startSymbolIndex, nrOfSymbols)) { rbStart += i+1; i = 0; } else { @@ -1790,7 +1790,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra CCEIndex, aggregation_level); for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) { - vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] |= startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); + vrb_map[BWPStart + rb + pdsch_pdu_rel15->rbStart] |= SL_to_bitmap(startSymbolIndex, nrOfSymbols); } LOG_D(NR_MAC,"BWPSize: %i\n", pdcch_pdu_rel15->BWPSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 7945042ba5..8212cba08d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -314,7 +314,7 @@ void fill_ssb_vrb_map (NR_COMMON_channels_t *cc, int rbStart, uint16_t symStart uint16_t *vrb_map = cc[CC_id].vrb_map; for (int rb = 0; rb < 20; rb++) - vrb_map[rbStart + rb] = startandlength_to_bitmat(symStart, 4); + vrb_map[rbStart + rb] = SL_to_bitmap(symStart, 4); } @@ -392,7 +392,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, int rbSize = 0; uint32_t TBS = 0; do { - if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&startandlength_to_bitmat(startSymbolIndex, nrOfSymbols))) + if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&SL_to_bitmap(startSymbolIndex, nrOfSymbols))) rbSize++; else{ if (gNB_mac->sched_ctrlCommon->sched_pdsch.mcs<10) @@ -426,7 +426,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, gNB_mac->sched_ctrlCommon->cce_index, gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { - vrb_map[rb + rbStart] = startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); + vrb_map[rb + rbStart] = SL_to_bitmap(startSymbolIndex, nrOfSymbols); } return TBS; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 1f5eb4af2b..e5e9bf8f18 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -562,14 +562,14 @@ bool allocate_dl_retransmission(module_id_t module_id, rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbSize = 0; while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; if (rbStart >= bwpSize) { LOG_D(NR_MAC, "cannot allocate retransmission for UE %d/RNTI %04x: no resources\n", UE_id, UE_info->rnti[UE_id]); return false; } while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols)) && + (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) && rbSize < retInfo->rbSize) rbSize++; } @@ -584,10 +584,10 @@ bool allocate_dl_retransmission(module_id_t module_id, temp_ps.nrOfLayers = 1; nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbSize++; uint32_t new_tbs; uint16_t new_rbSize; @@ -670,7 +670,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* retransmissions: directly allocate */ *n_rb_sched -= sched_ctrl->sched_pdsch.rbSize; for (int rb = 0; rb < sched_ctrl->sched_pdsch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); return true; } @@ -832,12 +832,12 @@ void pf_dl(module_id_t module_id, // Freq-demain allocation while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; uint16_t max_rbSize = 1; while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + max_rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) max_rbSize++; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -861,7 +861,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_pdsch->rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); } } @@ -904,8 +904,8 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t // if any RB in vrb_map is blocked (1), the current RBG will be 0 rballoc_mask[i] = (~vrb_map[i+BWPStart])&0x3fff; //bitwise not and 14 symbols // if all the pdsch symbols are free - if((rballoc_mask[i]&startandlength_to_bitmat(startSymbolIndex, nrOfSymbols)) == - startandlength_to_bitmat(startSymbolIndex, nrOfSymbols)) + if((rballoc_mask[i]&SL_to_bitmap(startSymbolIndex, nrOfSymbols)) == + SL_to_bitmap(startSymbolIndex, nrOfSymbols)) n_rb_sched++; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index a5ba558deb..61168994c8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -380,7 +380,7 @@ void fill_pdcch_vrb_map(gNB_MAC_INST *mac, f = (r*C + c + n_shift)%(N_regs/L); } for(int rb=0; rbBWPStart + f*B_rb + rb] |= startandlength_to_bitmat(pdcch->StartSymbolIndex, N_symb); + vrb_map[pdcch->BWPStart + f*B_rb + rb] |= SL_to_bitmap(pdcch->StartSymbolIndex, N_symb); } } } @@ -2371,20 +2371,20 @@ void nr_csirs_scheduling(int Mod_idP, csirs_pdu_rel15->row = 1; csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: csirs_pdu_rel15->row = 2; csirs_pdu_rel15->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<8)&0xff0)); for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: csirs_pdu_rel15->row = 4; csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: csirs_pdu_rel15->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; @@ -2395,18 +2395,18 @@ void nr_csirs_scheduling(int Mod_idP, case NR_CSI_RS_ResourceMapping__nrofPorts_p2: csirs_pdu_rel15->row = 3; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p4: csirs_pdu_rel15->row = 5; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p8: if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 8; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); } else{ int num_k = 0; @@ -2415,12 +2415,12 @@ void nr_csirs_scheduling(int Mod_idP, if(num_k==4) { csirs_pdu_rel15->row = 6; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); } else { csirs_pdu_rel15->row = 7; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); } } break; @@ -2428,12 +2428,12 @@ void nr_csirs_scheduling(int Mod_idP, if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 10; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); } else { csirs_pdu_rel15->row = 9; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 1); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 1); } break; case NR_CSI_RS_ResourceMapping__nrofPorts_p16: @@ -2442,24 +2442,24 @@ void nr_csirs_scheduling(int Mod_idP, else csirs_pdu_rel15->row = 11; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2); break; case NR_CSI_RS_ResourceMapping__nrofPorts_p24: if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 14; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2)); } else{ if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { csirs_pdu_rel15->row = 15; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 3); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 3); } else { csirs_pdu_rel15->row = 13; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2)); } } break; @@ -2467,18 +2467,18 @@ void nr_csirs_scheduling(int Mod_idP, if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) { csirs_pdu_rel15->row = 17; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2)); } else{ if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) { csirs_pdu_rel15->row = 18; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 3); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= SL_to_bitmap(csirs_pdu_rel15->symb_l0, 3); } else { csirs_pdu_rel15->row = 16; for (int rb = csirs_pdu_rel15->start_rb; rb < (csirs_pdu_rel15->start_rb + csirs_pdu_rel15->nr_of_rbs); rb++) - vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (startandlength_to_bitmat(csirs_pdu_rel15->symb_l0, 2) | startandlength_to_bitmat(csirs_pdu_rel15->symb_l1, 2)); + vrb_map[rb+csirs_pdu_rel15->bwp_start] |= (SL_to_bitmap(csirs_pdu_rel15->symb_l0, 2) | SL_to_bitmap(csirs_pdu_rel15->symb_l1, 2)); } } break; From 366c42e6fa030b7f81c8d91509949bbfbe6377f7 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 15 Dec 2021 09:31:30 +0100 Subject: [PATCH 191/883] fix in prach vrb occupation --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 0d0c8980ce..d1fcdc7c05 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -389,7 +389,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP const int16_t N_RA_RB = get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, mu_pusch); uint16_t *vrb_map_UL = &cc->vrb_map_UL[slotP * MAX_BWP_SIZE]; for (int i = 0; i < N_RA_RB * fdm; ++i) - vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] = 0xff; // all symbols + vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] = 0x3fff; // all symbols } } } From 909f0ad44f38e4dc90b20185df64a9c5f57f8690 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 15 Dec 2021 09:43:08 +0100 Subject: [PATCH 192/883] changing the name of a function --- common/utils/nr/nr_common.c | 2 +- common/utils/nr/nr_common.h | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 10 ++++----- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 22 +++++++++---------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 42c7ef9c7e..dbe3d218f3 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -473,7 +473,7 @@ int get_subband_size(int NPRB,int size) { } // from start symbol index and nb or symbols to symbol occupation bitmap in a slot -uint16_t startandlength_to_bitmat(int startSymbolIndex, int nrOfSymbols) { +uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols) { return (((1<type0_PDCCH_CSS_config[ra->beam_id].num_rbs; int rbStart = 0; for (int i = 0; (i < ra->msg3_nb_rb) && (rbStart <= (BWPSize - ra->msg3_nb_rb)); i++) { - if (vrb_map_UL[rbStart + BWPStart + i]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols)) { + if (vrb_map_UL[rbStart + BWPStart + i]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols)) { rbStart += i; i = 0; } @@ -844,7 +844,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t // Mark the corresponding RBs as used for (int rb = 0; rb < ra->msg3_nb_rb; rb++) { - vrb_map_UL[rbStart + BWPStart + rb] |= startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols); + vrb_map_UL[rbStart + BWPStart + rb] |= SL_to_bitmap(StartSymbolIndex, NrOfSymbols); } // reset state to wait msg3 @@ -943,11 +943,11 @@ void nr_get_Msg3alloc(module_id_t module_id, rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbSize = 0; while (rbStart < bwpSize && - (vrb_map_UL[rbStart + bwpStart]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols))) + (vrb_map_UL[rbStart + bwpStart]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols))) rbStart++; AssertFatal(rbStart < bwpSize - msg3_nb_rb, "no space to allocate Msg 3 for RA!\n"); while (rbStart + rbSize < bwpSize - && !(vrb_map_UL[rbStart + bwpStart + rbSize]&startandlength_to_bitmat(StartSymbolIndex, NrOfSymbols)) + && !(vrb_map_UL[rbStart + bwpStart + rbSize]&SL_to_bitmap(StartSymbolIndex, NrOfSymbols)) && rbSize < msg3_nb_rb) rbSize++; } @@ -1044,7 +1044,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t i + ra->msg3_first_rb, ra->Msg3_frame, ra->Msg3_slot); - vrb_map_UL[i + ra->msg3_first_rb + ra->msg3_bwp_start] |= startandlength_to_bitmat(ra->msg3_startsymb, ra->msg3_nrsymb); + vrb_map_UL[i + ra->msg3_first_rb + ra->msg3_bwp_start] |= SL_to_bitmap(ra->msg3_startsymb, ra->msg3_nrsymb); } LOG_D(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", module_idP, frameP, slotP, CC_id, ra->Msg3_frame, ra->Msg3_slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index d939ed8139..5afdfcbbf3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -474,7 +474,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; for (int i = rbStart; i < rbStart + rbSize; ++i) { - if ((vrb_map_UL[i+BWPStart] & startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols)) != 0) { + if ((vrb_map_UL[i+BWPStart] & SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) != 0) { LOG_E(MAC, "%s(): %4d.%2d RB %d is already reserved, cannot schedule UE\n", __func__, @@ -543,6 +543,6 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ /* mark the corresponding RBs as used */ for (int rb = rbStart; rb < rbStart + rbSize; rb++) - vrb_map_UL[rb+BWPStart] |= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); + vrb_map_UL[rb+BWPStart] |= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); return true; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 949f148121..7892da4128 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -951,7 +951,7 @@ bool allocate_ul_retransmission(module_id_t module_id, /* Check the resource is enough for retransmission */ while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; if (rbStart + retInfo->rbSize > bwpSize) { LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize); @@ -966,11 +966,11 @@ bool allocate_ul_retransmission(module_id_t module_id, /* the retransmission will use a different time domain allocation, check * that we have enough resources */ while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbStart++; int rbSize = 0; while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&startandlength_to_bitmat(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) + (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbSize++; uint32_t new_tbs; uint16_t new_rbSize; @@ -1027,7 +1027,7 @@ bool allocate_ul_retransmission(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(sched_ctrl->pusch_semi_static.startSymbolIndex, sched_ctrl->pusch_semi_static.nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(sched_ctrl->pusch_semi_static.startSymbolIndex, sched_ctrl->pusch_semi_static.nrOfSymbols); return true; } @@ -1140,7 +1140,7 @@ void pf_ul(module_id_t module_id, LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart); while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; if (rbStart + min_rb >= bwpSize) { LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n", @@ -1166,7 +1166,7 @@ void pf_ul(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); continue; } @@ -1237,12 +1237,12 @@ void pf_ul(module_id_t module_id, update_ul_ue_R_Qm(sched_pusch, ps); while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; sched_pusch->rbStart = rbStart; uint16_t max_rbSize = 1; while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&&startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + max_rbSize]&&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) max_rbSize++; if (rbStart + min_rb >= bwpSize) { @@ -1273,7 +1273,7 @@ void pf_ul(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= startandlength_to_bitmat(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); } } @@ -1342,7 +1342,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; int startSymbolIndex, nrOfSymbols; SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); - const uint16_t symb = startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); + const uint16_t symb = SL_to_bitmap(startSymbolIndex, nrOfSymbols); int st = 0, e = 0, len = 0; @@ -1365,7 +1365,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t /* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */ for (int i = 0; i < bwpSize; i++) - rballoc_mask[i] = (i >= st && i <= e)*startandlength_to_bitmat(startSymbolIndex, nrOfSymbols); + rballoc_mask[i] = (i >= st && i <= e)*SL_to_bitmap(startSymbolIndex, nrOfSymbols); /* proportional fair scheduling algorithm */ pf_ul(module_id, From 223ad6aabe2093de896163beff981a2ebf0b8758 Mon Sep 17 00:00:00 2001 From: sfn Date: Wed, 15 Dec 2021 12:55:27 +0100 Subject: [PATCH 193/883] Enable 4 layers Transmission for PDSCH: tested only for dlsim and RFsim with pmi=0 --- openair1/PHY/INIT/nr_init_ue.c | 21 +++++++------------ .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 20 +++--------------- openair1/PHY/defs_nr_common.h | 2 +- openair1/SIMULATION/NR_PHY/dlsim.c | 14 ++++++------- targets/ARCH/rfsimulator/simulator.c | 8 +++---- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 10 ++++----- 6 files changed, 28 insertions(+), 47 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b60e77e814..20211e45b9 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -66,9 +66,8 @@ extern uint16_t beta_cqi[16]; void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch, const NR_DL_FRAME_PARMS *const fp) { AssertFatal( pdsch, "pdsch==0" ); - pdsch->pmi_ext = (uint8_t *)malloc16_clear( fp->N_RB_DL ); - pdsch->llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) ); - pdsch->layer_llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) ); + + //pdsch->layer_llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) ); pdsch->llr128 = (int16_t **)malloc16_clear( sizeof(int16_t *) ); // FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV // FK, 11-3-2015: this is only as a temporary pointer, no memory is stored there @@ -80,8 +79,6 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch, pdsch->dl_ch_estimates_ext = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) ); pdsch->dl_bf_ch_estimates = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) ); pdsch->dl_bf_ch_estimates_ext = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) ); - //pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); - //pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch->dl_ch_mag0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) ); pdsch->dl_ch_magb0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) ); pdsch->dl_ch_magr0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) ); @@ -110,8 +107,6 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch, pdsch->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_bf_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * fp->ofdm_symbol_size*7*2); pdsch->dl_bf_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); - //pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); - //pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_mag0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_magb0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); pdsch->dl_ch_magr0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); @@ -325,14 +320,14 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12); - ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts; - ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); - ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); - ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) ); + for (int i=0; ipdsch_vars[th_id][gNB_id]->llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448 + } + for (int i=0; ipdsch_vars[th_id][gNB_id]->layer_llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448 + } } - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 37a2849d21..7ec7207778 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -3009,26 +3009,12 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars, uint8_t nr_slot_rx, uint8_t beamforming_mode) { - - int16_t *pllr_symbol_cw0; - int16_t *pllr_symbol_cw1; - int16_t *pllr_symbol_layer0; - int16_t *pllr_symbol_layer1; uint32_t llr_offset_symbol; - if (first_symbol_flag==1) pdsch_vars[gNB_id]->llr_offset[symbol-1] = 0; + if (first_symbol_flag==1) + pdsch_vars[gNB_id]->llr_offset[symbol-1] = 0; llr_offset_symbol = pdsch_vars[gNB_id]->llr_offset[symbol-1]; - //pllr_symbol_cw0_deint = (int8_t*)pdsch_vars[gNB_id]->llr[0]; - //pllr_symbol_cw1_deint = (int8_t*)pdsch_vars[gNB_id]->llr[1]; - pllr_symbol_layer0 = pdsch_vars[gNB_id]->layer_llr[0]; - pllr_symbol_layer1 = pdsch_vars[gNB_id]->layer_llr[1]; - pllr_symbol_layer0 += llr_offset_symbol; - pllr_symbol_layer1 += llr_offset_symbol; - pllr_symbol_cw0 = pdsch_vars[gNB_id]->llr[0]; - pllr_symbol_cw1 = pdsch_vars[gNB_id]->llr[1]; - pllr_symbol_cw0 += llr_offset_symbol; - pllr_symbol_cw1 += llr_offset_symbol; - + pdsch_vars[gNB_id]->llr_offset[symbol] = len*dlsch0_harq->Qm + llr_offset_symbol; /*LOG_I(PHY,"compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n", diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 8e024420af..98f9d33efa 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -93,7 +93,7 @@ #define NR_MAX_CSET_DURATION 3 #define NR_MAX_NB_RBG 18 -#define NR_MAX_NB_LAYERS 2 // 8 // SU-MIMO (3GPP TS 38.211 V15.4.0 section 7.3.1.3) +#define NR_MAX_NB_LAYERS 4 // 8 // SU-MIMO (3GPP TS 38.211 V15.4.0 section 7.3.1.3) #define NR_MAX_NB_CODEWORDS 2 #define NR_MAX_NB_HARQ_PROCESSES 16 #define NR_MAX_PDSCH_ENCODED_LENGTH (NR_MAX_NB_RB*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8*NR_MAX_NB_LAYERS) // 8 is the maximum modulation order (it was 950984 before !!) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index ee25934f2d..6d2c819656 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -528,8 +528,8 @@ int main(int argc, char **argv) case 'x': g_nrOfLayers=atoi(optarg); - if ((g_nrOfLayers!=1) && - (g_nrOfLayers!=2)) { + if ((g_nrOfLayers==0) || + (g_nrOfLayers>4)) { printf("Unsupported nr Of Layers %d\n",g_nrOfLayers); exit(-1); } @@ -1170,10 +1170,10 @@ int main(int argc, char **argv) frame_length_complex_samples, 0); - double H_awgn_mimo[4][4] ={{1.0, 0.5, 0.25, 0.125},//rx 0 - {0.5, 1.0, 0.5, 0.25}, //rx 1 - {0.25, 0.5, 1.0, 0.5}, //rx 2 - {0.125, 0.25, 0.5, 1.0}};//rx 3 + double H_awgn_mimo[4][4] ={{1.0, 0.0, 0.0, 0.0}, //rx 0 + {0.0, 1.0, 0.0, 0.0}, //rx 1 + {0.0, 0.0, 1.0, 0.0}, //rx 2 + {0.0, 0.0, 0.0, 1.0}};//rx 3 for (i=frame_parms->get_samples_slot_timestamp(slot,frame_parms,0); iget_samples_slot_timestamp(slot+1,frame_parms,0); @@ -1228,7 +1228,7 @@ int main(int argc, char **argv) TBS = UE_harq_process->TBS;//rel15->TBSize[0]; uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); uint16_t nb_rb = rel15->rbSize; - uint8_t nb_re_dmrs = rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4; + uint8_t nb_re_dmrs = rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6*UE_harq_process->n_dmrs_cdm_groups : 4*UE_harq_process->n_dmrs_cdm_groups; uint8_t mod_order = rel15->qamModOrder[0]; uint8_t nb_symb_sch = rel15->NrOfSymbols; diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index 13945998d7..81233678fd 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -736,10 +736,10 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest CirSize ); else { // no channel modeling - double H_awgn_mimo[4][4] ={{1.0, 0.5, 0.25, 0.125},//rx 0 - {0.5, 1.0, 0.5, 0.25}, //rx 1 - {0.25, 0.5, 1.0, 0.5}, //rx 2 - {0.125, 0.25, 0.5, 1.0}};//rx 3 + double H_awgn_mimo[4][4] ={{1.0, 0.0, 0.0, 0.0},//rx 0 + {0.0, 1.0, 0.0, 0.0}, //rx 1 + {0.0, 0.0, 1.0, 0.0}, //rx 2 + {0.0, 0.0, 0.0, 1.0}};//rx 3 sample_t *out=(sample_t *)samplesVoid[a]; int nbAnt_tx = ptr->th.nbAnt;//number of Tx antennas diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index f93e97ed65..0109bc966b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -22,7 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; + pdsch_AntennaPorts = 4; pusch_AntennaPorts = 1; servingCellConfigCommon = ( @@ -225,7 +225,7 @@ L1s = ( RUs = ( { local_rf = "yes" - nb_tx = 1 + nb_tx = 4 nb_rx = 1 att_tx = 0 att_rx = 0; @@ -238,11 +238,11 @@ RUs = ( ## beamforming 1x4 matrix: 1 layer x 4 antennas #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; ## beamforming 2x2 matrix: - #bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; ## beamforming 2x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000]; + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000]; ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2"; clock_src = "external"; } From 461cf243e581f5b44342104dbaeb422db8971886 Mon Sep 17 00:00:00 2001 From: sfn Date: Wed, 15 Dec 2021 13:18:19 +0100 Subject: [PATCH 194/883] Minor change nr_mimo_precoding_matrix --- openair1/PHY/INIT/nr_init.c | 2 +- openair1/PHY/defs_gNB.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index de123ee3e3..6265eecc3a 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -255,7 +255,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { } } - gNB->nr_mimo_precoding_matrix = (int32_t ***)malloc16(4* sizeof(int32_t **)); + gNB->nr_mimo_precoding_matrix = (int32_t ***)malloc16(gNB->frame_parms.nb_antennas_tx* sizeof(int32_t **)); int32_t ***mat = gNB->nr_mimo_precoding_matrix; double complex res_code; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index a9e0707c74..9b3236b837 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -805,6 +805,9 @@ typedef struct PHY_VARS_gNB_s { uint32_t ****nr_gold_pdsch_dmrs; /// PDSCH codebook I precoding LUTs + /// first dimension: Rank number [0,...,noOfLayers-1[ + /// second dimension: PMI [0,...,CodeSize-1[ + /// third dimension: [i_rows*noOfLayers+j_col], i_rows=0,...pdsch_AntennaPorts-1 and j_col=0,...,noOfLayers-1 int32_t ***nr_mimo_precoding_matrix; /// PUSCH DMRS From 99e006f750d08ad2fe25ba492046cc97e265fd9e Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 15 Dec 2021 13:38:00 +0100 Subject: [PATCH 195/883] testing with UM/No Harq --- openair2/GNB_APP/MACRLC_nr_paramdef.h | 5 +++-- openair2/GNB_APP/gnb_config.c | 2 ++ openair2/GNB_APP/gnb_paramdef.h | 6 ++++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 6 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + openair2/RRC/NR/MESSAGES/asn1_msg.c | 21 +++++++------------ openair2/RRC/NR/MESSAGES/asn1_msg.h | 2 +- openair2/RRC/NR/nr_rrc_defs.h | 1 + openair2/RRC/NR/rrc_gNB.c | 3 ++- 11 files changed, 28 insertions(+), 27 deletions(-) diff --git a/openair2/GNB_APP/MACRLC_nr_paramdef.h b/openair2/GNB_APP/MACRLC_nr_paramdef.h index b17fced7b7..436271fc0b 100644 --- a/openair2/GNB_APP/MACRLC_nr_paramdef.h +++ b/openair2/GNB_APP/MACRLC_nr_paramdef.h @@ -64,7 +64,7 @@ #define CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER "dl_bler_target_lower" #define CONFIG_STRING_MACRLC_DL_RD2_BLER_THRESHOLD "dl_rd2_bler_threshold" #define CONFIG_STRING_MACRLC_DL_MAX_MCS "dl_max_mcs" - +#define CONFIG_STRING_MACRLC_HARQ_ROUND_MAX "harq_round_max" /*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* MacRLC configuration parameters */ @@ -97,6 +97,7 @@ {CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER, "Lower threshold of BLER to increase DL MCS", 0, dblptr:NULL, defdblval:0.05, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_RD2_BLER_THRESHOLD, "Threshold of RD2/RETX2 BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.01, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_MAX_MCS, "Maximum DL MCS that should be used", 0, u8ptr:NULL, defintval:28, TYPE_UINT8, 0}, \ +{CONFIG_STRING_MACRLC_HARQ_ROUND_MAX, "Maximum number of HARQ rounds", 0, u8ptr:NULL, defintval:4, TYPE_UINT8, 0} \ } #define MACRLC_CC_IDX 0 #define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 @@ -124,6 +125,6 @@ #define MACRLC_DL_BLER_TARGET_LOWER_IDX 23 #define MACRLC_DL_RD2_BLER_THRESHOLD_IDX 24 #define MACRLC_DL_MAX_MCS_IDX 25 - +#define MACRLC_HARQ_ROUND_MAX_IDX 26 /*---------------------------------------------------------------------------------------------------------------------------------------------------------*/ #endif diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index dffced1374..7f85164140 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -759,6 +759,7 @@ void RCconfig_nr_macrlc() { RC.nrmac[j]->dl_bler_target_lower = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_BLER_TARGET_LOWER_IDX].dblptr); RC.nrmac[j]->dl_rd2_bler_threshold = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_RD2_BLER_THRESHOLD_IDX].dblptr); RC.nrmac[j]->dl_max_mcs = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_MAX_MCS_IDX].u8ptr); + RC.nrmac[j]->harq_round_max = *(MacRLC_ParamList.paramarray[j][MACRLC_HARQ_ROUND_MAX_IDX].u8ptr); RC.nrmac[j]->num_ulprbbl = num_prbbl; LOG_I(NR_MAC,"Blacklisted PRBS %d\n",num_prbbl); memcpy(RC.nrmac[j]->ulprbbl,prbbl,275*sizeof(prbbl[0])); @@ -1041,6 +1042,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { rrc->nr_cellid = (uint64_t)*(GNBParamList.paramarray[i][GNB_NRCELLID_IDX].u64ptr); + rrc->um_on_default_drb = *(GNBParamList.paramarray[i][GNB_UMONDEFAULTDRB_IDX].uptr); if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) { } else if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "cudu") == 0) { diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index bf1d12825e..94e9735a31 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -121,7 +121,7 @@ typedef enum { #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" #define GNB_CONFIG_STRING_MINRXTXTIMEPDSCH "min_rxtxtime_pdsch" #define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" - +#define GNB_CONFIG_STRING_UMONDEFAULTDRB "um_on_default_drb" /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* cell configuration parameters */ @@ -149,7 +149,8 @@ typedef enum { {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ +{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_UMONDEFAULTDRB, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0} \ } #define GNB_GNB_ID_IDX 0 @@ -174,6 +175,7 @@ typedef enum { #define GNB_NRCELLID_IDX 19 #define GNB_MINRXTXTIMEPDSCH_IDX 20 #define GNB_ULPRBBLACKLIST_IDX 21 +#define GNB_UMONDEFAULTDRB_IDX 22 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d8b168ae75..3f93f79621 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -611,7 +611,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* Find a free CCE */ bool freeCCE = find_free_CCE(module_id, slot, UE_id); if (!freeCCE) { - LOG_D(MAC, "%4d.%2d could not find CCE for DL DCI retransmission UE %d/RNTI %04x\n", + LOG_I(MAC, "%4d.%2d allocate_dl_transmission: could not find CCE for DL DCI retransmission UE %d/RNTI %04x\n", frame, slot, UE_id, UE_info->rnti[UE_id]); return false; } @@ -746,7 +746,7 @@ void pf_dl(module_id_t module_id, /* Find a free CCE */ bool freeCCE = find_free_CCE(module_id, slot, UE_id); if (!freeCCE) { - LOG_D(NR_MAC, "%4d.%2d could not find CCE for DL DCI UE %d/RNTI %04x\n", frame, slot, UE_id, rnti); + LOG_I(NR_MAC, "%4d.%2d could not find CCE for DL DCI UE %d/RNTI %04x\n", frame, slot, UE_id, rnti); continue; } /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */ @@ -963,7 +963,7 @@ void nr_schedule_ue_spec(module_id_t module_id, harq->is_waiting = true; UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++; - LOG_D(NR_MAC, + LOG_I(NR_MAC, "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) PUCCH allocation %d TPC %d\n", 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 ee312f51a0..9b48feab9d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -576,7 +576,7 @@ static void handle_dl_harq(module_id_t mod_id, add_tail_nr_list(&UE_info->UE_sched_ctrl[UE_id].available_dl_harq, harq_pid); harq->round = 0; harq->ndi ^= 1; - } else if (harq->round >= MAX_HARQ_ROUNDS - 1) { + } else if (harq->round >= RC.nrmac[mod_id]->harq_round_max - 1) { add_tail_nr_list(&UE_info->UE_sched_ctrl[UE_id].available_dl_harq, harq_pid); harq->round = 0; harq->ndi ^= 1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 1d6edfe4f0..b2d2b51a30 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -550,7 +550,7 @@ void handle_nr_ul_harq(const int CC_idP, remove_front_nr_list(&sched_ctrl->feedback_ul_harq); sched_ctrl->ul_harq_processes[harq_pid].is_waiting = false; - if(sched_ctrl->ul_harq_processes[harq_pid].round >= MAX_HARQ_ROUNDS - 1) { + if(sched_ctrl->ul_harq_processes[harq_pid].round >= gNB_mac->harq_round_max - 1) { abort_nr_ul_harq(mod_id, UE_id, harq_pid); } else { sched_ctrl->ul_harq_processes[harq_pid].round++; @@ -571,7 +571,7 @@ void handle_nr_ul_harq(const int CC_idP, harq_pid, crc_pdu->rnti); add_tail_nr_list(&sched_ctrl->available_ul_harq, harq_pid); - } else if (harq->round >= MAX_HARQ_ROUNDS - 1) { + } else if (harq->round >= gNB_mac->harq_round_max - 1) { abort_nr_ul_harq(mod_id, UE_id, harq_pid); LOG_D(NR_MAC, "RNTI %04x: Ulharq id %d crc failed in all rounds\n", @@ -1481,7 +1481,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) sched_ctrl->last_ul_frame = sched_pusch->frame; sched_ctrl->last_ul_slot = sched_pusch->slot; - LOG_D(NR_MAC, + LOG_I(NR_MAC, "ULSCH/PUSCH: %4d.%2d RNTI %04x UL sched %4d.%2d DCI L %d start %2d RBS %3d startSymbol %2d nb_symbol %2d dmrs_pos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d est %6d sched %6d est BSR %6d TPC %d\n", frame, slot, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 738f9b4117..5091262a0b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -781,6 +781,7 @@ typedef struct gNB_MAC_INST_s { double dl_bler_target_lower; double dl_rd2_bler_threshold; uint8_t dl_max_mcs; + uint8_t harq_round_max; } gNB_MAC_INST; #endif /*__LAYER2_NR_MAC_GNB_H__ */ diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index ff6923429e..f1cc264b9f 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1258,7 +1258,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, ss2->nrofCandidates=calloc(1,sizeof(*ss2->nrofCandidates)); ss2->nrofCandidates->aggregationLevel1 = NR_SearchSpace__nrofCandidates__aggregationLevel1_n0; ss2->nrofCandidates->aggregationLevel2 = NR_SearchSpace__nrofCandidates__aggregationLevel2_n2; - ss2->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n1; + ss2->nrofCandidates->aggregationLevel4 = NR_SearchSpace__nrofCandidates__aggregationLevel4_n0; ss2->nrofCandidates->aggregationLevel8 = NR_SearchSpace__nrofCandidates__aggregationLevel8_n0; ss2->nrofCandidates->aggregationLevel16 = NR_SearchSpace__nrofCandidates__aggregationLevel16_n0; ss2->searchSpaceType=calloc(1,sizeof(*ss2->searchSpaceType)); @@ -1317,7 +1317,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, } -void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup) { +void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup,int use_rlc_um_for_drb) { cellGroupConfig->cellGroupId = 0; cellGroupConfig->rlc_BearerToReleaseList = NULL; @@ -1377,18 +1377,11 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr rlc_BearerConfig_drb->servedRadioBearer->choice.drb_Identity = 1; rlc_BearerConfig_drb->reestablishRLC = NULL; rlc_Config_drb = calloc(1, sizeof(NR_RLC_Config_t)); - rlc_Config_drb->present = NR_RLC_Config_PR_am; - rlc_Config_drb->choice.am = calloc(1, sizeof(*rlc_Config_drb->choice.am)); - rlc_Config_drb->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t)); - *(rlc_Config_drb->choice.am->dl_AM_RLC.sn_FieldLength) = NR_SN_FieldLengthAM_size18; - rlc_Config_drb->choice.am->dl_AM_RLC.t_Reassembly = NR_T_Reassembly_ms80; - rlc_Config_drb->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms10; - rlc_Config_drb->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1, sizeof(NR_SN_FieldLengthAM_t)); - *(rlc_Config_drb->choice.am->ul_AM_RLC.sn_FieldLength) = NR_SN_FieldLengthAM_size18; - rlc_Config_drb->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms80; - rlc_Config_drb->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_p64; - rlc_Config_drb->choice.am->ul_AM_RLC.pollByte = NR_PollByte_kB125; - rlc_Config_drb->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t8; + + if (use_rlc_um_for_drb) nr_drb_config(rlc_Config_drb, NR_RLC_Config_PR_um_Bi_Directional); + else nr_drb_config(rlc_Config_drb, NR_RLC_Config_PR_am); + + rlc_BearerConfig_drb->rlc_Config = rlc_Config_drb; logicalChannelConfig_drb = calloc(1, sizeof(NR_LogicalChannelConfig_t)); logicalChannelConfig_drb->ul_SpecificParameters = calloc(1, sizeof(*logicalChannelConfig_drb->ul_SpecificParameters)); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 7b38de2bb9..b9a3ea6dac 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -99,7 +99,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); -void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); +void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup,int use_rlc_um_for_drb); uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, uint8_t *const buffer, diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index ad31e8cac7..95f3772b71 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -514,6 +514,7 @@ typedef struct gNB_RRC_INST_s { int srb1_max_retx_threshold; int srb1_timer_reordering; int srb1_timer_status_prohibit; + int um_on_default_drb; int srs_enable[MAX_NUM_CCs]; uint16_t sctp_in_streams; uint16_t sctp_out_streams; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 65ae2660b3..2ff3da787c 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1109,7 +1109,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( memset(buffer, 0, RRC_BUF_SIZE); cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); - fill_mastercellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.masterCellGroup); + fill_mastercellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.masterCellGroup, + rrc->um_on_default_drb); size = do_RRCReconfiguration(ctxt_pP, buffer, xid, *SRB_configList2, From d31db3dd7e64e263bc01ee9771a52092a474eb9a Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 15 Dec 2021 14:16:30 +0000 Subject: [PATCH 196/883] Change variable name --- common/utils/T/tracer/gnb.c | 2 +- openair1/PHY/INIT/nr_init.c | 4 +-- openair1/PHY/INIT/nr_init_ue.c | 4 +-- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 30 +++++++++---------- openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h | 2 +- openair1/PHY/defs_nr_common.h | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 +-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index 2f0ed6b246..f205f3582a 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -91,7 +91,7 @@ static void set_current_ue(gui *g, gnb_data *e, int ue) sprintf(s, "GNB_PHY_PUCCH_PUSCH_IQ [UE %d]", ue); xy_plot_set_title(g, e->e->pucch_pusch_iq_plot, s); - sprintf(s, "UL estimated channel [UE %d]", ue); + sprintf(s, "UL channel estimation in frequency domain [UE %d]", ue); xy_plot_set_title(g, e->e->ul_estimate_ue_xy_plot, s); } diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index bc1ea96af9..22149349ab 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -201,11 +201,11 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, gNB->nr_srs_info[id]->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t)); gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); - gNB->nr_srs_info[id]->srs_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); + gNB->nr_srs_info[id]->srs_estimated_channel_freq = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;inr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); } } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index db6398bb46..888e05dea2 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -328,11 +328,11 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->nr_srs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t)); ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->nr_srs_info->srs_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->nr_srs_info->srs_estimated_channel_freq = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); for (i=0; inb_antennas_rx; i++) { ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); } if (abstraction_flag == 0) { diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 29df722aa3..eb6973d7ee 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1110,7 +1110,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, nr_srs_info_t *nr_srs_info, int32_t *srs_generated_signal, int32_t **srs_received_signal, - int32_t **srs_estimated_channel, + int32_t **srs_estimated_channel_freq, uint32_t *noise_power) { if(nr_srs_info->n_symbs==0) { @@ -1130,9 +1130,9 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - memset(srs_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + memset(srs_estimated_channel_freq[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[0]]; + int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[0]]; for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { @@ -1160,38 +1160,38 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, if(sc_idx == 0) { multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); } else if(nr_srs_info->subcarrier_idx[sc_idx]subcarrier_idx[sc_idx-1]) { - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx+2]] - 8; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx+2]] - 8; multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); } else if( (sc_idx < (nr_srs_info->n_symbs-1) && nr_srs_info->subcarrier_idx[sc_idx+1]subcarrier_idx[sc_idx]) || (sc_idx == (nr_srs_info->n_symbs-1))) { multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); - srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; } else if(sc_idx%2 == 1) { multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); } else if(sc_idx%2 == 0) { multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8); - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; } } else { if(sc_idx>0) { multadd_real_vector_complex_scalar(filt8_dcr0_h, ls_estimated, srs_estimated_channel16, 8); if(nr_srs_info->subcarrier_idx[sc_idx]subcarrier_idx[sc_idx-1]) { - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx+1]] - 8; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx+1]] - 8; } else { - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; } srs_estimated_channel16[0] = 0; srs_estimated_channel16[1] = 0; } multadd_real_vector_complex_scalar(filt8_dcl0_h, ls_estimated, srs_estimated_channel16, 8); if(sc_idx == (nr_srs_info->n_symbs-1)) { - srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; - srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+2] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; - srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+3] = srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+2] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+3] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; } } - noise_real[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF)); - noise_imag[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF)); + noise_real[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF)); + noise_imag[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF)); #ifdef SRS_DEBUG uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; @@ -1239,8 +1239,8 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, subcarrier_log+r, (int16_t)(srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF), (int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF), - (int16_t)(srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF), - (int16_t)((srs_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF), + (int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF), + (int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF), noise_real[ant*nr_srs_info->n_symbs+sc_idx], noise_imag[ant*nr_srs_info->n_symbs+sc_idx]); } diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h index 9bbccaf6fd..e361684f5d 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h @@ -70,6 +70,6 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, nr_srs_info_t *nr_srs_info, int32_t *srs_generated_signal, int32_t **srs_received_signal, - int32_t **srs_estimated_channel, + int32_t **srs_estimated_channel_freq, uint32_t *noise_power); #endif diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index d9b1a2e148..e5be7f820b 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -247,7 +247,7 @@ typedef struct { int32_t *srs_generated_signal; int32_t **srs_received_signal; int32_t **srs_ls_estimated_channel; - int32_t **srs_estimated_channel; + int32_t **srs_estimated_channel_freq; uint32_t *noise_power; } nr_srs_info_t; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index b5d0e5373e..ef0a7b1dc5 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -809,11 +809,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->nr_srs_info[i], gNB->nr_srs_info[i]->srs_generated_signal, gNB->nr_srs_info[i]->srs_received_signal, - gNB->nr_srs_info[i]->srs_estimated_channel, + gNB->nr_srs_info[i]->srs_estimated_channel_freq, gNB->nr_srs_info[i]->noise_power); T(T_GNB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), - T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel[0], 100 * 4)); + T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], 100 * 4)); srs->active = 0; } From ecd09b3068cd230ef7c1de5288a541b7b4fcbeec Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 15 Dec 2021 14:39:31 +0000 Subject: [PATCH 197/883] Change variable name --- common/utils/T/T_messages.txt | 2 +- common/utils/T/tracer/gnb.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index d6309df941..81ad3acc27 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -94,7 +94,7 @@ ID = GNB_PHY_PUCCH_PUSCH_IQ GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB FORMAT = int,frame : int,slot : buffer,rxdataF ID = GNB_PHY_UL_CHANNEL_ESTIMATE - DESC = gNodeB channel estimation in the frequency domain + DESC = gNodeB channel estimation in the time/frequency domain GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB FORMAT = int,gNB_ID : int,rnti : int,frame : int,subframe : int,antenna : buffer,chest_t ID = GNB_PHY_PRACH_INPUT_SIGNAL diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index f205f3582a..43d3368c42 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -17,13 +17,13 @@ int next_ue_id; typedef struct { widget *pucch_pusch_iq_plot; - widget *ul_estimate_ue_xy_plot; + widget *ul_freq_estimate_ue_xy_plot; widget *current_ue_label; widget *current_ue_button; widget *prev_ue_button; widget *next_ue_button; logger *pucch_pusch_iq_logger; - logger *ul_estimate_ue_logger; + logger *ul_freq_estimate_ue_logger; } gnb_gui; typedef struct { @@ -92,7 +92,7 @@ static void set_current_ue(gui *g, gnb_data *e, int ue) xy_plot_set_title(g, e->e->pucch_pusch_iq_plot, s); sprintf(s, "UL channel estimation in frequency domain [UE %d]", ue); - xy_plot_set_title(g, e->e->ul_estimate_ue_xy_plot, s); + xy_plot_set_title(g, e->e->ul_freq_estimate_ue_xy_plot, s); } void reset_ue_ids(void) @@ -181,14 +181,14 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g /* UL estimated channel */ w = new_xy_plot(g, 600, 200, "", 50); - e->ul_estimate_ue_xy_plot = w; + e->ul_freq_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); xy_plot_set_range(g, w, 0, 100*10, -10, 80); l = new_framelog(h, database, "GNB_PHY_UL_CHANNEL_ESTIMATE", "subframe", "chest_t"); framelog_set_update_only_at_sf9(l, 0); v = new_view_xy(100*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); - e->ul_estimate_ue_logger = l; + e->ul_freq_estimate_ue_logger = l; set_current_ue(g, ed, ed->ue); register_notifier(g, "click", e->current_ue_button, click, ed); From 8aac96062a6896f73687596acfdd931a0fae958c Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 15 Dec 2021 17:02:57 +0000 Subject: [PATCH 198/883] Add UL time channel estimation based on SRS --- common/utils/T/T_messages.txt | 8 +- common/utils/T/tracer/gnb.c | 27 ++++- openair1/PHY/INIT/nr_init.c | 2 + openair1/PHY/INIT/nr_init_ue.c | 2 + .../NR_ESTIMATION/nr_ul_channel_estimation.c | 102 ++++++++---------- openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h | 1 + openair1/PHY/defs_nr_common.h | 1 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 6 +- 8 files changed, 84 insertions(+), 65 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 81ad3acc27..6b8d5777ab 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -93,8 +93,12 @@ ID = GNB_PHY_PUCCH_PUSCH_IQ DESC = gNodeB input data in the frequency domain for a slot where some PUCCH or PUSCH detection was done GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB FORMAT = int,frame : int,slot : buffer,rxdataF -ID = GNB_PHY_UL_CHANNEL_ESTIMATE - DESC = gNodeB channel estimation in the time/frequency domain +ID = GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE + DESC = gNodeB channel estimation in the frequency domain + GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB + FORMAT = int,gNB_ID : int,rnti : int,frame : int,subframe : int,antenna : buffer,chest_t +ID = GNB_PHY_UL_TIME_CHANNEL_ESTIMATE + DESC = gNodeB channel estimation in the time domain GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB FORMAT = int,gNB_ID : int,rnti : int,frame : int,subframe : int,antenna : buffer,chest_t ID = GNB_PHY_PRACH_INPUT_SIGNAL diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index 43d3368c42..342c2e8cb2 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -18,12 +18,14 @@ int next_ue_id; typedef struct { widget *pucch_pusch_iq_plot; widget *ul_freq_estimate_ue_xy_plot; + widget *ul_time_estimate_ue_xy_plot; widget *current_ue_label; widget *current_ue_button; widget *prev_ue_button; widget *next_ue_button; logger *pucch_pusch_iq_logger; logger *ul_freq_estimate_ue_logger; + logger *ul_time_estimate_ue_logger; } gnb_gui; typedef struct { @@ -93,6 +95,9 @@ static void set_current_ue(gui *g, gnb_data *e, int ue) sprintf(s, "UL channel estimation in frequency domain [UE %d]", ue); xy_plot_set_title(g, e->e->ul_freq_estimate_ue_xy_plot, s); + + sprintf(s, "UL channel estimation in time domain [UE %d]", ue); + xy_plot_set_title(g, e->e->ul_time_estimate_ue_xy_plot, s); } void reset_ue_ids(void) @@ -141,7 +146,7 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g logger *l; view *v; - main_window = new_toplevel_window(g, 1050, 230, "gNB tracer"); + main_window = new_toplevel_window(g, 1500, 230, "gNB tracer"); top_container = new_container(g, VERTICAL); widget_add_child(g, main_window, top_container, -1); @@ -179,17 +184,28 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g logger_add_view(l, v); e->pucch_pusch_iq_logger = l; - /* UL estimated channel */ - w = new_xy_plot(g, 600, 200, "", 50); + /* UL channel estimation in frequency domain */ + w = new_xy_plot(g, 490, 200, "", 50); e->ul_freq_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); xy_plot_set_range(g, w, 0, 100*10, -10, 80); - l = new_framelog(h, database, "GNB_PHY_UL_CHANNEL_ESTIMATE", "subframe", "chest_t"); + l = new_framelog(h, database, "GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE", "subframe", "chest_t"); framelog_set_update_only_at_sf9(l, 0); v = new_view_xy(100*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); e->ul_freq_estimate_ue_logger = l; + /* UL channel estimation in time domain */ + w = new_xy_plot(g, 490, 200, "", 50); + e->ul_time_estimate_ue_xy_plot = w; + widget_add_child(g, line, w, -1); + xy_plot_set_range(g, w, 0, 100*10, -10, 80); + l = new_framelog(h, database, "GNB_PHY_UL_TIME_CHANNEL_ESTIMATE", "subframe", "chest_t"); + framelog_set_update_only_at_sf9(l, 0); + v = new_view_xy(100*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); + logger_add_view(l, v); + e->ul_time_estimate_ue_logger = l; + set_current_ue(g, ed, ed->ue); register_notifier(g, "click", e->current_ue_button, click, ed); register_notifier(g, "click", e->prev_ue_button, click, ed); @@ -233,7 +249,8 @@ int main(int n, char **v) h = new_handler(database); on_off(database, "GNB_PHY_PUCCH_PUSCH_IQ", is_on, 1); - on_off(database, "GNB_PHY_UL_CHANNEL_ESTIMATE", is_on, 1); + on_off(database, "GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE", is_on, 1); + on_off(database, "GNB_PHY_UL_TIME_CHANNEL_ESTIMATE", is_on, 1); gnb_data.ue = 0; gnb_data.e = ⪚ diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 22149349ab..89b76f9131 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -202,10 +202,12 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_estimated_channel_freq = (int32_t **)malloc16(Prx*sizeof(int32_t*)); + gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;inr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); } } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 888e05dea2..2bd6922302 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -329,10 +329,12 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_estimated_channel_freq = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->nr_srs_info->srs_estimated_channel_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); for (i=0; inb_antennas_rx; i++) { ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); } if (abstraction_flag == 0) { diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index eb6973d7ee..90d385f50b 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -41,6 +41,41 @@ #define NO_INTERP 1 #define dBc(x,y) (dB_fixed(((int32_t)(x))*(x) + ((int32_t)(y))*(y))) +void freq2time(uint16_t ofdm_symbol_size, + int16_t *freq_signal, + int16_t *time_signal) { + + switch (ofdm_symbol_size) { + case 128: + idft(IDFT_128, freq_signal, time_signal, 1); + break; + case 256: + idft(IDFT_256, freq_signal, time_signal, 1); + break; + case 512: + idft(IDFT_512, freq_signal, time_signal, 1); + break; + case 1024: + idft(IDFT_1024, freq_signal, time_signal, 1); + break; + case 1536: + idft(IDFT_1536, freq_signal, time_signal, 1); + break; + case 2048: + idft(IDFT_2048, freq_signal, time_signal, 1); + break; + case 4096: + idft(IDFT_4096, freq_signal, time_signal, 1); + break; + case 8192: + idft(IDFT_8192, freq_signal, time_signal, 1); + break; + default: + idft(IDFT_512, freq_signal, time_signal, 1); + break; + } +} + int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, unsigned char Ns, unsigned short p, @@ -899,63 +934,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, #endif // Convert to time domain - - switch (gNB->frame_parms.ofdm_symbol_size) { - case 128: - idft(IDFT_128,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - - case 256: - idft(IDFT_256,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - - case 512: - idft(IDFT_512,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - - case 1024: - idft(IDFT_1024,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - - case 1536: - idft(IDFT_1536,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - - case 2048: - idft(IDFT_2048,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - - case 4096: - idft(IDFT_4096,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - - case 8192: - idft(IDFT_8192,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - - default: - idft(IDFT_512,(int16_t*) &ul_ch_estimates[aarx][symbol_offset], - (int16_t*) ul_ch_estimates_time[aarx], - 1); - break; - } - + freq2time(gNB->frame_parms.ofdm_symbol_size, + (int16_t*) &ul_ch_estimates[aarx][symbol_offset], + (int16_t*) ul_ch_estimates_time[aarx]); } #ifdef DEBUG_CH @@ -1111,6 +1092,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t *srs_generated_signal, int32_t **srs_received_signal, int32_t **srs_estimated_channel_freq, + int32_t **srs_estimated_channel_time, uint32_t *noise_power) { if(nr_srs_info->n_symbs==0) { @@ -1131,6 +1113,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); memset(srs_estimated_channel_freq[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + memset(srs_estimated_channel_time[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[0]]; @@ -1213,6 +1196,11 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, prev_ls_estimated[0], prev_ls_estimated[1]); #endif } + + // Convert to time domain + freq2time(gNB->frame_parms.ofdm_symbol_size, + (int16_t*) srs_estimated_channel_freq[ant], + (int16_t*) srs_estimated_channel_time[ant]); } *noise_power = calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->n_symbs) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h index e361684f5d..bfb1627c0d 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h @@ -71,5 +71,6 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t *srs_generated_signal, int32_t **srs_received_signal, int32_t **srs_estimated_channel_freq, + int32_t **srs_estimated_channel_time, uint32_t *noise_power); #endif diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index e5be7f820b..1fe442b7f5 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -248,6 +248,7 @@ typedef struct { int32_t **srs_received_signal; int32_t **srs_ls_estimated_channel; int32_t **srs_estimated_channel_freq; + int32_t **srs_estimated_channel_time; uint32_t *noise_power; } nr_srs_info_t; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index ef0a7b1dc5..ad998ac505 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -810,11 +810,15 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->nr_srs_info[i]->srs_generated_signal, gNB->nr_srs_info[i]->srs_received_signal, gNB->nr_srs_info[i]->srs_estimated_channel_freq, + gNB->nr_srs_info[i]->srs_estimated_channel_time, gNB->nr_srs_info[i]->noise_power); - T(T_GNB_PHY_UL_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), + T(T_GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], 100 * 4)); + T(T_GNB_PHY_UL_TIME_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), + T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_time[0], 100 * 4)); + srs->active = 0; } } From f2f6850b33008686f94c84c29999ad62219242c1 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 15 Dec 2021 18:03:43 +0100 Subject: [PATCH 199/883] first version to check pucch vrb occupation --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 47 ++++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 189 +++++++++++++----- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 8 + 3 files changed, 181 insertions(+), 63 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 33cb2b1b1d..bda19f252a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1035,23 +1035,26 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, else { // this is the default PUCCH configuration, PUCCH format 0 or 1 LOG_D(NR_MAC,"pucch_acknak: Filling default PUCCH configuration from Tables (r_pucch %d, bwp %p)\n",r_pucch,bwp); int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon; - int prboffset = r_pucch/default_pucch_csset[rsetindex]; - int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex]; - pucch_pdu->prb_start = (r_pucch>>3)==0 ? - default_pucch_prboffset[rsetindex] + prboffset: - pucch_pdu->bwp_size-1-default_pucch_prboffset[rsetindex]-prboffsetm8; + int prb_start, second_hop_prb, nr_of_symb, start_symb; + set_r_pucch_parms(rsetindex, + r_pucch, + pucch_pdu->bwp_size, + &prb_start, + &second_hop_prb, + &nr_of_symb, + &start_symb); + + pucch_pdu->prb_start = prb_start; pucch_pdu->rnti = rnti; pucch_pdu->freq_hop_flag = 1; - pucch_pdu->second_hop_prb = (r_pucch>>3)==0? - pucch_pdu->bwp_size-1-default_pucch_prboffset[rsetindex]-prboffset: - default_pucch_prboffset[rsetindex] + prboffsetm8; + pucch_pdu->second_hop_prb = second_hop_prb; pucch_pdu->format_type = default_pucch_fmt[rsetindex]; pucch_pdu->initial_cyclic_shift = r_pucch%default_pucch_csset[rsetindex]; if (rsetindex==3||rsetindex==7||rsetindex==11) pucch_pdu->initial_cyclic_shift*=6; else if (rsetindex==1||rsetindex==2) pucch_pdu->initial_cyclic_shift*=3; else pucch_pdu->initial_cyclic_shift*=4; - pucch_pdu->nr_of_symbols = default_pucch_numbsymb[rsetindex]; - pucch_pdu->start_symbol_index = default_pucch_firstsymb[rsetindex]; + pucch_pdu->nr_of_symbols = nr_of_symb; + pucch_pdu->start_symbol_index = start_symb; if (pucch_pdu->format_type == 1) pucch_pdu->time_domain_occ_idx = 0; // check this!! pucch_pdu->sr_flag = O_sr; pucch_pdu->prb_size=1; @@ -1059,6 +1062,30 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, } +void set_r_pucch_parms(int rsetindex, + int r_pucch, + int bwp_size, + int *prb_start, + int *second_hop_prb, + int *nr_of_symbols, + int *start_symbol_index) { + + int prboffset = r_pucch/default_pucch_csset[rsetindex]; + int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex]; + + *prb_start = (r_pucch>>3)==0 ? + default_pucch_prboffset[rsetindex] + prboffset: + bwp_size-1-default_pucch_prboffset[rsetindex]-prboffsetm8; + + *second_hop_prb = (r_pucch>>3)==0? + bwp_size-1-default_pucch_prboffset[rsetindex]-prboffset: + default_pucch_prboffset[rsetindex] + prboffsetm8; + + *nr_of_symbols = default_pucch_numbsymb[rsetindex]; + *start_symbol_index = default_pucch_firstsymb[rsetindex]; +} + + void prepare_dci(const NR_CellGroupConfig_t *CellGroup, dci_pdu_rel15_t *dci_pdu_rel15, nr_dci_format_t format, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index a94559769d..d0c2f16157 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -32,6 +32,7 @@ #include "NR_MAC_COMMON/nr_mac_extern.h" #include "NR_MAC_gNB/mac_proto.h" #include "common/ran_context.h" +#include "common/utils/nr/nr_common.h" #include "nfapi/oai_integration/vendor_ext.h" extern RAN_CONTEXT_t RC; @@ -539,16 +540,16 @@ void nr_csi_meas_reporting(int Mod_idP, switch(pucchres->format.present){ case NR_PUCCH_Resource__format_PR_format2: len = pucchres->format.choice.format2->nrofPRBs; - mask = ((1 << pucchres->format.choice.format2->nrofSymbols) - 1) << pucchres->format.choice.format2->startingSymbolIndex; + 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; break; case NR_PUCCH_Resource__format_PR_format3: len = pucchres->format.choice.format3->nrofPRBs; - mask = ((1 << pucchres->format.choice.format3->nrofSymbols) - 1) << pucchres->format.choice.format3->startingSymbolIndex; + mask = SL_to_bitmap(pucchres->format.choice.format3->startingSymbolIndex, pucchres->format.choice.format3->nrofSymbols); curr_pucch->simultaneous_harqcsi = pucch_Config->format3->choice.setup->simultaneousHARQ_ACK_CSI; break; case NR_PUCCH_Resource__format_PR_format4: - mask = ((1 << pucchres->format.choice.format4->nrofSymbols) - 1) << pucchres->format.choice.format4->startingSymbolIndex; + mask = SL_to_bitmap(pucchres->format.choice.format4->startingSymbolIndex, pucchres->format.choice.format4->nrofSymbols); curr_pucch->simultaneous_harqcsi = pucch_Config->format4->choice.setup->simultaneousHARQ_ACK_CSI; break; default: @@ -556,7 +557,12 @@ void nr_csi_meas_reporting(int Mod_idP, } // verify resources are free for (int i = start; i < start + len; ++i) { - vrb_map_UL[i+bwp_start] |= mask; + if((vrb_map_UL[i+bwp_start] & mask) != 0) { + LOG_E(NR_MAC, "%s(): VRB MAP not free. Can't schedule CSI reporting on PUCCH.\n", __func__); + memset(curr_pucch, 0, sizeof(*curr_pucch)); + } + else + vrb_map_UL[i+bwp_start] |= mask; } } } @@ -1170,6 +1176,63 @@ 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) { + + // 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 + + int prb_start, second_hop_prb, nr_of_symb, start_symb; + 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); + second_hop_prb = resource->secondHopPRB!= NULL ? *resource->secondHopPRB : 0; + nr_of_symb = resource->format.choice.format0->nrofSymbols; + start_symb = resource->format.choice.format0->startingSymbolIndex; + prb_start = resource->startingPRB; + } + else{ + int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon; + set_r_pucch_parms(rsetindex, + r_pucch, + bwp_size, + &prb_start, + &second_hop_prb, + &nr_of_symb, + &start_symb); + } + + // verifying occupation of PRBs for ACK/NACK on dedicated pucch + bool ret = true; + for (int l=0; lUE_info.UE_sched_ctrl[UE_id]; + + NR_PUCCH_Config_t *pucch_Config = NULL; + if (sched_ctrl->active_ubwp) { + pucch_Config = sched_ctrl->active_ubwp->bwp_Dedicated->pucch_Config->choice.setup; + } else if (RC.nrmac[mod_id]->UE_info.CellGroup[UE_id] && + RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig && + RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated && + RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig && + RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP && + RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) { + pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; + } + NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? + &sched_ctrl->active_ubwp->bwp_Common->genericParameters: + &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + int bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); + NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0]; LOG_D(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c); pucch->r_pucch=r_pucch; @@ -1321,21 +1402,32 @@ int nr_acknack_scheduling(int mod_id, int ind_found = -1; // while we are within the feedback limits while ((n_slots_frame + pucch->ul_slot - slot) % n_slots_frame <= max_fb_time) { - 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) { - ind_found = i; - break; + // checking if in ul_slot the resources potentially to be assigned to this PUCCH are available + bool ret = test_acknack_vrb_occupation(sched_ctrl, + pucch, + &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE], + 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) { + ind_found = i; + break; + } + ++i; } - ++i; + if (ind_found!=-1) + break; } - if (ind_found!=-1) - break; // advance to the next ul slot const int f = pucch->frame; const int s = pucch->ul_slot; @@ -1396,45 +1488,36 @@ int nr_acknack_scheduling(int mod_id, pucch->dai_c++; pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources pucch->r_pucch=r_pucch; - NR_PUCCH_Config_t *pucch_Config = NULL; - if (sched_ctrl->active_ubwp) { - pucch_Config = sched_ctrl->active_ubwp->bwp_Dedicated->pucch_Config->choice.setup; - } else if (RC.nrmac[mod_id]->UE_info.CellGroup[UE_id] && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) { - pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; - } - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? - &sched_ctrl->active_ubwp->bwp_Common->genericParameters: - &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); - - /* verify that at that slot and symbol, resources are free. We only do this - * for initialCyclicShift 0 (we assume it always has that one), so other - * initialCyclicShifts can overlap with ICS 0!*/ - if (pucch_Config) { + int prb_start, second_hop_prb, nr_of_symb, start_symb; + if(r_pucch<0){ const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator]; DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0); - int second_hop_prb = resource->secondHopPRB!= NULL ? *resource->secondHopPRB : 0; - int nr_of_symbols = resource->format.choice.format0->nrofSymbols; - if (resource->format.choice.format0->initialCyclicShift == 0) { - uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE]; - for (int l=0; lformat.choice.format0->startingSymbolIndex + l); - int prb; - if (l==1 && second_hop_prb != 0) - prb = second_hop_prb; - else - prb = resource->startingPRB; - if ((vrb_map_UL[bwp_start+prb] & symb) != 0) - LOG_W(MAC, "symbol 0x%x is not free for PUCCH alloc in vrb_map_UL at RB %ld and slot %d.%d\n", symb, resource->startingPRB, pucch->frame, pucch->ul_slot); - vrb_map_UL[bwp_start+prb] |= symb; - } - } + second_hop_prb = resource->secondHopPRB!= NULL ? *resource->secondHopPRB : 0; + nr_of_symb = resource->format.choice.format0->nrofSymbols; + start_symb = resource->format.choice.format0->startingSymbolIndex; + prb_start = resource->startingPRB; + } + else{ + int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon; + set_r_pucch_parms(rsetindex, + r_pucch, + bwp_size, + &prb_start, + &second_hop_prb, + &nr_of_symb, + &start_symb); + } + + uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE]; + for (int l=0; l Date: Wed, 15 Dec 2021 18:47:00 +0000 Subject: [PATCH 200/883] SRS Tracer improvements --- common/utils/T/tracer/gnb.c | 8 ++++---- openair1/PHY/INIT/nr_init.c | 2 ++ openair1/PHY/INIT/nr_init_ue.c | 2 ++ openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c | 10 ++++++++++ openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h | 1 + openair1/PHY/defs_nr_common.h | 1 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 +++++---- 7 files changed, 25 insertions(+), 8 deletions(-) diff --git a/common/utils/T/tracer/gnb.c b/common/utils/T/tracer/gnb.c index 342c2e8cb2..6629a1efd6 100644 --- a/common/utils/T/tracer/gnb.c +++ b/common/utils/T/tracer/gnb.c @@ -188,10 +188,10 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g w = new_xy_plot(g, 490, 200, "", 50); e->ul_freq_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, 0, 100*10, -10, 80); + xy_plot_set_range(g, w, 0, 2048, -10, 80); l = new_framelog(h, database, "GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE", "subframe", "chest_t"); framelog_set_update_only_at_sf9(l, 0); - v = new_view_xy(100*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); + v = new_view_xy(2048, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); e->ul_freq_estimate_ue_logger = l; @@ -199,10 +199,10 @@ static void gnb_main_gui(gnb_gui *e, gui *g, event_handler *h, void *database, g w = new_xy_plot(g, 490, 200, "", 50); e->ul_time_estimate_ue_xy_plot = w; widget_add_child(g, line, w, -1); - xy_plot_set_range(g, w, 0, 100*10, -10, 80); + xy_plot_set_range(g, w, 0, 2048, -10, 80); l = new_framelog(h, database, "GNB_PHY_UL_TIME_CHANNEL_ESTIMATE", "subframe", "chest_t"); framelog_set_update_only_at_sf9(l, 0); - v = new_view_xy(100*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); + v = new_view_xy(2048, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE); logger_add_view(l, v); e->ul_time_estimate_ue_logger = l; diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 89b76f9131..2c51e3f7a8 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -203,11 +203,13 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_estimated_channel_freq = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t **)malloc16(Prx*sizeof(int32_t*)); + gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;inr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); } } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 2bd6922302..1219365493 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -330,11 +330,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_estimated_channel_freq = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_estimated_channel_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->nr_srs_info->srs_estimated_channel_time_shifted = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); for (i=0; inb_antennas_rx; i++) { ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); } if (abstraction_flag == 0) { diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 90d385f50b..1c6e8a54b8 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1093,6 +1093,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t **srs_received_signal, int32_t **srs_estimated_channel_freq, int32_t **srs_estimated_channel_time, + int32_t **srs_estimated_channel_time_shifted, uint32_t *noise_power) { if(nr_srs_info->n_symbs==0) { @@ -1114,6 +1115,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); memset(srs_estimated_channel_freq[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); memset(srs_estimated_channel_time[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + memset(srs_estimated_channel_time_shifted[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[0]]; @@ -1201,6 +1203,14 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, freq2time(gNB->frame_parms.ofdm_symbol_size, (int16_t*) srs_estimated_channel_freq[ant], (int16_t*) srs_estimated_channel_time[ant]); + + memcpy(&srs_estimated_channel_time_shifted[ant][0], + &srs_estimated_channel_time[ant][gNB->frame_parms.ofdm_symbol_size>>1], + (gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t)); + + memcpy(&srs_estimated_channel_time_shifted[ant][gNB->frame_parms.ofdm_symbol_size>>1], + &srs_estimated_channel_time[ant][0], + (gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t)); } *noise_power = calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->n_symbs) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h index bfb1627c0d..a01106adb5 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h @@ -72,5 +72,6 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t **srs_received_signal, int32_t **srs_estimated_channel_freq, int32_t **srs_estimated_channel_time, + int32_t **srs_estimated_channel_time_shifted, uint32_t *noise_power); #endif diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 1fe442b7f5..9d0efd5c6d 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -249,6 +249,7 @@ typedef struct { int32_t **srs_ls_estimated_channel; int32_t **srs_estimated_channel_freq; int32_t **srs_estimated_channel_time; + int32_t **srs_estimated_channel_time_shifted; uint32_t *noise_power; } nr_srs_info_t; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index ad998ac505..cc21dcd09e 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -811,13 +811,14 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->nr_srs_info[i]->srs_received_signal, gNB->nr_srs_info[i]->srs_estimated_channel_freq, gNB->nr_srs_info[i]->srs_estimated_channel_time, + gNB->nr_srs_info[i]->srs_estimated_channel_time_shifted, gNB->nr_srs_info[i]->noise_power); - T(T_GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), - T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], 100 * 4)); + T(T_GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(0), T_INT(0), + T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t))); - T(T_GNB_PHY_UL_TIME_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(slot_rx%10), T_INT(0), - T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_time[0], 100 * 4)); + T(T_GNB_PHY_UL_TIME_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(0), T_INT(0), + T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_time_shifted[0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t))); srs->active = 0; } From 2414a681f896923536cb982a49956ebb9ea4d2fe Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 16 Dec 2021 14:44:40 +0100 Subject: [PATCH 201/883] additional parameters in pucch structure to avoid double computation --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 57 ++++++------------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 4 ++ 2 files changed, 22 insertions(+), 39 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index d0c2f16157..61efbdb941 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1196,35 +1196,34 @@ bool test_acknack_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, (csi_pucch->csi_bits + csi_pucch->dai_c) < 11) return true; // available resources for csi_pucch already verified - int prb_start, second_hop_prb, nr_of_symb, start_symb; 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); - second_hop_prb = resource->secondHopPRB!= NULL ? *resource->secondHopPRB : 0; - nr_of_symb = resource->format.choice.format0->nrofSymbols; - start_symb = resource->format.choice.format0->startingSymbolIndex; - prb_start = resource->startingPRB; + pucch->second_hop_prb = resource->secondHopPRB!= NULL ? *resource->secondHopPRB : 0; + pucch->nr_of_symb = resource->format.choice.format0->nrofSymbols; + pucch->start_symb = resource->format.choice.format0->startingSymbolIndex; + pucch->prb_start = resource->startingPRB; } else{ int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon; set_r_pucch_parms(rsetindex, r_pucch, bwp_size, - &prb_start, - &second_hop_prb, - &nr_of_symb, - &start_symb); + &pucch->prb_start, + &pucch->second_hop_prb, + &pucch->nr_of_symb, + &pucch->start_symb); } // verifying occupation of PRBs for ACK/NACK on dedicated pucch bool ret = true; - for (int l=0; lnr_of_symb; l++) { + uint16_t symb = SL_to_bitmap(pucch->start_symb+l, 1); int prb; - if (l==1 && second_hop_prb != 0) - prb = second_hop_prb; + if (l==1 && pucch->second_hop_prb != 0) + prb = pucch->second_hop_prb; else - prb = prb_start; + prb = pucch->prb_start; if ((vrb_map_UL[bwp_start+prb] & symb) != 0) { ret = false; break; @@ -1489,34 +1488,14 @@ int nr_acknack_scheduling(int mod_id, pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources pucch->r_pucch=r_pucch; - int prb_start, second_hop_prb, nr_of_symb, start_symb; - if(r_pucch<0){ - const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[pucch->resource_indicator]; - DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0); - second_hop_prb = resource->secondHopPRB!= NULL ? *resource->secondHopPRB : 0; - nr_of_symb = resource->format.choice.format0->nrofSymbols; - start_symb = resource->format.choice.format0->startingSymbolIndex; - prb_start = resource->startingPRB; - } - else{ - int rsetindex = *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon; - set_r_pucch_parms(rsetindex, - r_pucch, - bwp_size, - &prb_start, - &second_hop_prb, - &nr_of_symb, - &start_symb); - } - uint16_t *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 && second_hop_prb != 0) - prb = second_hop_prb; + if (l==1 && pucch->second_hop_prb != 0) + prb = pucch->second_hop_prb; else - prb = prb_start; + prb = pucch->prb_start; vrb_map_UL[bwp_start+prb] |= symb; } return 0; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3944cb34f9..83eee7f827 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -313,6 +313,10 @@ typedef struct NR_sched_pucch { uint8_t timing_indicator; uint8_t resource_indicator; int r_pucch; + int prb_start; + int second_hop_prb; + int nr_of_symb; + int start_symb; } NR_sched_pucch_t; /* PUSCH semi-static configuration: as long as the TDA and DCI format remain From 6010aaeffc4f715100b394e1569b26e30eae314b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 16 Dec 2021 16:48:05 +0000 Subject: [PATCH 202/883] Add SRS resource allocation in fill_ul_rb_mask --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index cc21dcd09e..61dd9f695b 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -583,6 +583,20 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } } + for (int i=0;isrs[i]; + if (srs) { + if ((srs->active == 1) && (srs->frame == frame_rx) && (srs->slot == slot_rx)) { + nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu; + for(int symbol = 0; symbol<(1<num_symbols); symbol++) { + for(rb = srs_pdu->bwp_start; rb < (srs_pdu->bwp_start+srs_pdu->bwp_size); rb++) { + gNB->rb_mask_ul[gNB->frame_parms.symbols_per_slot-srs_pdu->time_start_position-1+symbol][rb>>5] |= 1<<(rb&31); + } + } + } + } + } + } void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { From ebc33e4b3e7061de3806e608d9ba0407fa8d2290 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 16 Dec 2021 17:39:49 +0000 Subject: [PATCH 203/883] Real-time performance optimization --- openair1/PHY/INIT/nr_init.c | 10 +++++----- openair1/PHY/INIT/nr_init_ue.c | 10 +++++----- openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c | 8 ++++---- openair1/PHY/defs_nr_common.h | 2 ++ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 2c51e3f7a8..3c7feb89e0 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -205,11 +205,11 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;inr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); } } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 1219365493..73ac583342 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -332,11 +332,11 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->nr_srs_info->srs_estimated_channel_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_estimated_channel_time_shifted = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); for (i=0; inb_antennas_rx; i++) { - ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); } if (abstraction_flag == 0) { diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 1c6e8a54b8..e81a510d56 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1112,10 +1112,10 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { - memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - memset(srs_estimated_channel_freq[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - memset(srs_estimated_channel_time[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - memset(srs_estimated_channel_time_shifted[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + memset(srs_ls_estimated_channel[ant], 0, frame_parms->ofdm_symbol_size*(1<num_symbols)*sizeof(int32_t)); + memset(srs_estimated_channel_freq[ant], 0, frame_parms->ofdm_symbol_size*(1<num_symbols)*sizeof(int32_t)); + memset(srs_estimated_channel_time[ant], 0, frame_parms->ofdm_symbol_size*(1<num_symbols)*sizeof(int32_t)); + memset(srs_estimated_channel_time_shifted[ant], 0, frame_parms->ofdm_symbol_size*(1<num_symbols)*sizeof(int32_t)); int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[0]]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 9d0efd5c6d..1544583087 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -107,6 +107,8 @@ #define MAX_NUM_NR_ULSCH_SEGMENTS 34 #define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056) +#define MAX_NUM_NR_SRS_SYMBOLS 4 + #define MAX_NUM_NR_CHANNEL_BITS (14*273*12*8) // 14 symbols, 273 RB #define MAX_NUM_NR_RE (14*273*12) #define NR_RX_NB_TH 1 From 00904bc2a01e05168aca26b32fac72434d55b174 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 16 Dec 2021 17:39:49 +0000 Subject: [PATCH 204/883] Real-time performance optimization --- openair1/PHY/INIT/nr_init.c | 10 +++++----- openair1/PHY/INIT/nr_init_ue.c | 10 +++++----- openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c | 6 ++---- openair1/PHY/defs_nr_common.h | 2 ++ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 2c51e3f7a8..3c7feb89e0 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -205,11 +205,11 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted = (int32_t **)malloc16(Prx*sizeof(int32_t*)); for (i=0;inr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); - gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); } } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 1219365493..73ac583342 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -332,11 +332,11 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->nr_srs_info->srs_estimated_channel_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->nr_srs_info->srs_estimated_channel_time_shifted = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); for (i=0; inb_antennas_rx; i++) { - ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); + ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); + ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); } if (abstraction_flag == 0) { diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 1c6e8a54b8..42824b4b6e 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1112,10 +1112,8 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { - memset(srs_ls_estimated_channel[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - memset(srs_estimated_channel_freq[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - memset(srs_estimated_channel_time[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); - memset(srs_estimated_channel_time_shifted[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + memset(srs_ls_estimated_channel[ant], 0, frame_parms->ofdm_symbol_size*(1<num_symbols)*sizeof(int32_t)); + memset(srs_estimated_channel_freq[ant], 0, frame_parms->ofdm_symbol_size*(1<num_symbols)*sizeof(int32_t)); int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[0]]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 9d0efd5c6d..1544583087 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -107,6 +107,8 @@ #define MAX_NUM_NR_ULSCH_SEGMENTS 34 #define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056) +#define MAX_NUM_NR_SRS_SYMBOLS 4 + #define MAX_NUM_NR_CHANNEL_BITS (14*273*12*8) // 14 symbols, 273 RB #define MAX_NUM_NR_RE (14*273*12) #define NR_RX_NB_TH 1 From 74ea4e5b5b4e9a98750c8331b7b3b8c9a3ca0c70 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 16 Dec 2021 18:24:10 +0000 Subject: [PATCH 205/883] Refactor name of two variables --- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 72 +++++++++---------- openair1/PHY/NR_TRANSPORT/srs_rx.c | 12 ++-- .../PHY/NR_UE_TRANSPORT/srs_modulation_nr.c | 6 +- openair1/PHY/defs_nr_common.h | 4 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 5 files changed, 48 insertions(+), 48 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 42824b4b6e..a168430937 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1096,7 +1096,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, int32_t **srs_estimated_channel_time_shifted, uint32_t *noise_power) { - if(nr_srs_info->n_symbs==0) { + if(nr_srs_info->sc_list_length == 0) { LOG_E(NR_PHY, "(%d.%d) nr_srs_info was not generated yet!\n", frame, slot); return -1; } @@ -1104,8 +1104,8 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; int32_t **srs_ls_estimated_channel = nr_srs_info->srs_ls_estimated_channel; - uint16_t noise_real[frame_parms->nb_antennas_rx*nr_srs_info->n_symbs]; - uint16_t noise_imag[frame_parms->nb_antennas_rx*nr_srs_info->n_symbs]; + uint16_t noise_real[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length]; + uint16_t noise_imag[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length]; int16_t prev_ls_estimated[2]; int16_t ls_estimated[2]; @@ -1115,23 +1115,23 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, memset(srs_ls_estimated_channel[ant], 0, frame_parms->ofdm_symbol_size*(1<num_symbols)*sizeof(int32_t)); memset(srs_estimated_channel_freq[ant], 0, frame_parms->ofdm_symbol_size*(1<num_symbols)*sizeof(int32_t)); - int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[0]]; + int16_t *srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[0]]; - for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { + for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) { - int16_t generated_real = srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF; - int16_t generated_imag = (srs_generated_signal[nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF; + int16_t generated_real = srs_generated_signal[nr_srs_info->sc_list[sc_idx]] & 0xFFFF; + int16_t generated_imag = (srs_generated_signal[nr_srs_info->sc_list[sc_idx]] >> 16) & 0xFFFF; - int16_t received_real = srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF; - int16_t received_imag = (srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF; + int16_t received_real = srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]] & 0xFFFF; + int16_t received_imag = (srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]] >> 16) & 0xFFFF; // We know that nr_srs_info->srs_generated_signal_bits bits are enough to represent the generated_real and generated_imag. // So we only need a nr_srs_info->srs_generated_signal_bits shift to ensure that the result fits into 16 bits. ls_estimated[0] = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits); ls_estimated[1] = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); - srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]] = ls_estimated[0] + (((int32_t)ls_estimated[1]<<16)&0xFFFF0000); + srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]] = ls_estimated[0] + (((int32_t)ls_estimated[1] << 16) & 0xFFFF0000); - if(sc_idx>0 && nr_srs_info->subcarrier_idx[sc_idx]>nr_srs_info->subcarrier_idx[sc_idx-1]) { + if(sc_idx>0 && nr_srs_info->sc_list[sc_idx] > nr_srs_info->sc_list[sc_idx - 1]) { ls_estimated[0] = (ls_estimated[0] + prev_ls_estimated[0])>>1; ls_estimated[1] = (ls_estimated[1] + prev_ls_estimated[1])>>1; } @@ -1142,43 +1142,43 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, if(srs_pdu->comb_size == 0) { if(sc_idx == 0) { multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); - } else if(nr_srs_info->subcarrier_idx[sc_idx]subcarrier_idx[sc_idx-1]) { - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx+2]] - 8; + } else if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 2]] - 8; multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); - } else if( (sc_idx < (nr_srs_info->n_symbs-1) && nr_srs_info->subcarrier_idx[sc_idx+1]subcarrier_idx[sc_idx]) || (sc_idx == (nr_srs_info->n_symbs-1))) { + } else if((sc_idx < (nr_srs_info->sc_list_length - 1) && nr_srs_info->sc_list[sc_idx + 1] < nr_srs_info->sc_list[sc_idx]) || (sc_idx == (nr_srs_info->sc_list_length - 1))) { multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); - srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx] + 1] = srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; } else if(sc_idx%2 == 1) { multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); } else if(sc_idx%2 == 0) { multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8); - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; } } else { if(sc_idx>0) { multadd_real_vector_complex_scalar(filt8_dcr0_h, ls_estimated, srs_estimated_channel16, 8); - if(nr_srs_info->subcarrier_idx[sc_idx]subcarrier_idx[sc_idx-1]) { - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx+1]] - 8; + if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 1]] - 8; } else { - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; } srs_estimated_channel16[0] = 0; srs_estimated_channel16[1] = 0; } multadd_real_vector_complex_scalar(filt8_dcl0_h, ls_estimated, srs_estimated_channel16, 8); - if(sc_idx == (nr_srs_info->n_symbs-1)) { - srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+1] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; - srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+2] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; - srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+3] = srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]; + if(sc_idx == (nr_srs_info->sc_list_length - 1)) { + srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx] + 1] = srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; + srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx] + 2] = srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; + srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx] + 3] = srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; } } - noise_real[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF)); - noise_imag[ant*nr_srs_info->n_symbs+sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF)); + noise_real[ant*nr_srs_info->sc_list_length + sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]] & 0xFFFF)); + noise_imag[ant*nr_srs_info->sc_list_length + sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]] >> 16) & 0xFFFF)); #ifdef SRS_DEBUG uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; - int subcarrier_log = nr_srs_info->subcarrier_idx[sc_idx]-subcarrier_offset; + int subcarrier_log = nr_srs_info->sc_list[sc_idx]-subcarrier_offset; if(subcarrier_log < 0) { subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size; } @@ -1211,15 +1211,15 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, (gNB->frame_parms.ofdm_symbol_size>>1)*sizeof(int32_t)); } - *noise_power = calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->n_symbs) - + calc_power(noise_imag,frame_parms->nb_antennas_rx*nr_srs_info->n_symbs); + *noise_power = calc_power(noise_real,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length) + + calc_power(noise_imag,frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length); #ifdef SRS_DEBUG uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; uint8_t R = srs_pdu->comb_size == 0 ? 2 : 4; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { - for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { - int subcarrier_log = nr_srs_info->subcarrier_idx[sc_idx]-subcarrier_offset; + for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) { + int subcarrier_log = nr_srs_info->sc_list[sc_idx]-subcarrier_offset; if(subcarrier_log < 0) { subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size; } @@ -1233,12 +1233,12 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, for(int r = 0; rsubcarrier_idx[sc_idx]+r]&0xFFFF), - (int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF), - (int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]&0xFFFF), - (int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->subcarrier_idx[sc_idx]+r]>>16)&0xFFFF), - noise_real[ant*nr_srs_info->n_symbs+sc_idx], - noise_imag[ant*nr_srs_info->n_symbs+sc_idx]); + (int16_t)(srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]+r]&0xFFFF), + (int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]+r]>>16)&0xFFFF), + (int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]+r]&0xFFFF), + (int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]+r]>>16)&0xFFFF), + noise_real[ant*nr_srs_info->sc_list_length+sc_idx], + noise_imag[ant*nr_srs_info->sc_list_length+sc_idx]); } } diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index bb329ca1f5..083f83959b 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -95,7 +95,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, nr_srs_info_t *nr_srs_info, int32_t **srs_received_signal) { - if(nr_srs_info->n_symbs==0) { + if(nr_srs_info->sc_list_length == 0) { LOG_E(NR_PHY, "(%d.%d) nr_srs_info was not generated yet!\n", frame, slot); return -1; } @@ -113,12 +113,12 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, memset(srs_received_signal[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); rx_signal = &rxdataF[ant][symbol_offset]; - for(int sc_idx = 0; sc_idx < nr_srs_info->n_symbs; sc_idx++) { - srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]] = rx_signal[nr_srs_info->subcarrier_idx[sc_idx]]; + for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) { + srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]] = rx_signal[nr_srs_info->sc_list[sc_idx]]; #ifdef SRS_DEBUG uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; - int subcarrier_log = nr_srs_info->subcarrier_idx[sc_idx]-subcarrier_offset; + int subcarrier_log = nr_srs_info->sc_list[sc_idx]-subcarrier_offset; if(subcarrier_log < 0) { subcarrier_log = subcarrier_log + frame_parms->ofdm_symbol_size; } @@ -130,8 +130,8 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, } LOG_I(NR_PHY,"(%i) \t%i\t%i\n", subcarrier_log, - (int16_t)(srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]]&0xFFFF), - (int16_t)((srs_received_signal[ant][nr_srs_info->subcarrier_idx[sc_idx]]>>16)&0xFFFF)); + (int16_t)(srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]]&0xFFFF), + (int16_t)((srs_received_signal[ant][nr_srs_info->sc_list[sc_idx]]>>16)&0xFFFF)); #endif } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c index 262afa8fcc..f3a953c9a8 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c @@ -119,7 +119,7 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_config_pdu->bwp_start*N_SC_RB; if(nr_srs_info) { - nr_srs_info->n_symbs = 0; + nr_srs_info->sc_list_length = 0; nr_srs_info->srs_generated_signal_bits = log2_approx(amp); } @@ -374,8 +374,8 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu, txptr[subcarrier] = (real_amp & 0xFFFF) + ((imag_amp<<16)&0xFFFF0000); if(nr_srs_info) { - nr_srs_info->subcarrier_idx[nr_srs_info->n_symbs] = subcarrier; - nr_srs_info->n_symbs++; + nr_srs_info->sc_list[nr_srs_info->sc_list_length] = subcarrier; + nr_srs_info->sc_list_length++; } #ifdef SRS_DEBUG diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 1544583087..20549d3978 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -243,8 +243,8 @@ typedef struct { } NR_PRACH_RESOURCES_t; typedef struct { - uint16_t n_symbs; - uint16_t subcarrier_idx[6*NR_MAX_NB_RB]; + uint16_t sc_list_length; + uint16_t sc_list[6 * NR_MAX_NB_RB]; uint8_t srs_generated_signal_bits; int32_t *srs_generated_signal; int32_t **srs_received_signal; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 61dd9f695b..f3bc72f62c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -813,7 +813,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { nfapi_nr_srs_pdu_t *srs_pdu = &srs->srs_pdu; // At least currently, the configuration is constant, so it is enough to generate the sequence just once. - if(gNB->nr_srs_info[i]->n_symbs==0) { + if(gNB->nr_srs_info[i]->sc_list_length == 0) { generate_srs_nr(srs_pdu, &gNB->frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx); } From c2640db1449c70fa3fe7760959fee626e6983066 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Thu, 16 Dec 2021 20:22:06 +0000 Subject: [PATCH 206/883] Fix memset that was deleting other variables --- openair1/PHY/NR_TRANSPORT/srs_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index 083f83959b..c16becdb20 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -110,7 +110,7 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB, int32_t *rx_signal; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { - memset(srs_received_signal[ant], 0, frame_parms->samples_per_frame*sizeof(int32_t)); + memset(srs_received_signal[ant], 0, frame_parms->ofdm_symbol_size*sizeof(int32_t)); rx_signal = &rxdataF[ant][symbol_offset]; for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) { From 5567306d4952371107fe176e351bcb42d91b52d8 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 17 Dec 2021 09:53:44 +0000 Subject: [PATCH 207/883] Memory allocation optimization --- openair1/PHY/INIT/nr_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 3c7feb89e0..48f7fe6bf0 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -197,7 +197,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, for (int id=0; idnr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); - gNB->nr_srs_info[id]->srs_generated_signal = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)); + gNB->nr_srs_info[id]->srs_generated_signal = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); gNB->nr_srs_info[id]->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t)); gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*)); gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*)); From bc04d7209b19cc827bb3a1415028b0073ce184ba Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 20 Dec 2021 11:54:57 +0100 Subject: [PATCH 208/883] some improvements from review --- nfapi/oai_integration/nfapi_pnf.c | 5 +-- openair2/LAYER2/NR_MAC_gNB/config.c | 14 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 12 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 43 +++++++++++-------- 5 files changed, 43 insertions(+), 35 deletions(-) diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c index a0b4a03e04..639b32b08c 100644 --- a/nfapi/oai_integration/nfapi_pnf.c +++ b/nfapi/oai_integration/nfapi_pnf.c @@ -1159,7 +1159,7 @@ int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, if (req->numPdus > 0) { for (int i=0; inumPdus; i++) { - if (req->ul_dci_pdu_list[i].PDUType == 0) // only possible value 0: PDCCH PDU + if (req->ul_dci_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) // only possible value 0: PDCCH PDU msgTx->ul_pdcch_pdu[i] = req->ul_dci_pdu_list[i]; else LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), req->numPdus-1, req->ul_dci_pdu_list[req->numPdus-1].PDUType); @@ -1243,8 +1243,7 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) { - // we trust the scheduler sends only one PDCCH PDU per slot - msgTx->pdcch_pdu[i] = dl_tti_pdu_list[i].pdcch_pdu; // fills the last received PDCCH PDU + msgTx->pdcch_pdu[i] = dl_tti_pdu_list[i].pdcch_pdu; // copies all the received PDCCH PDUs } else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) { //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]); diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index a56206a1d2..7b89e4e993 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -641,14 +641,16 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; } + else + AssertFatal(1==0,"Either initial BWP or active BWP should always be present\n"); sched_ctrl->search_space = get_searchspace(scc, bwpd, target_ss); sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss); - UE_info->UE_sched_ctrl[UE_id].sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP], - sched_ctrl->search_space, - sched_ctrl->coreset, - scc, - genericParameters, - NULL); + sched_ctrl->sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP], + sched_ctrl->search_space, + sched_ctrl->coreset, + scc, + genericParameters, + NULL); sched_ctrl->maxL = 2; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index e5e9bf8f18..f9a87456f4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -830,14 +830,15 @@ void pf_dl(module_id_t module_id, if (ps->time_domain_allocation != tda) nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); + const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); // Freq-demain allocation while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&slbitmap)) rbStart++; uint16_t max_rbSize = 1; while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + max_rbSize]&slbitmap)) max_rbSize++; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -861,7 +862,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_pdsch->rbStart] -= slbitmap; } } @@ -896,6 +897,7 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + const uint16_t slbitmap = SL_to_bitmap(startSymbolIndex, nrOfSymbols); uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map; uint16_t rballoc_mask[bwpSize]; int n_rb_sched = 0; @@ -904,8 +906,8 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t // if any RB in vrb_map is blocked (1), the current RBG will be 0 rballoc_mask[i] = (~vrb_map[i+BWPStart])&0x3fff; //bitwise not and 14 symbols // if all the pdsch symbols are free - if((rballoc_mask[i]&SL_to_bitmap(startSymbolIndex, nrOfSymbols)) == - SL_to_bitmap(startSymbolIndex, nrOfSymbols)) + if((rballoc_mask[i]&slbitmap) == + slbitmap) n_rb_sched++; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 2de5117229..9d3d015aae 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -298,12 +298,12 @@ void nr_preprocessor_phytest(module_id_t module_id, while (true) { /* advance to first free RB */ while (rbStart < bwpSize && - (vrb_map[rbStart + BWPStart]&(((1<nrOfSymbols)-1)<startSymbolIndex))) + (vrb_map[rbStart + BWPStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) rbStart++; rbSize = 1; /* iterate until we are at target_dl_bw or no available RBs */ while (rbStart + rbSize < bwpSize && - !(vrb_map[rbStart + rbSize + BWPStart]&(((1<nrOfSymbols)-1)<startSymbolIndex)) && + !(vrb_map[rbStart + rbSize + BWPStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) && rbSize < target_dl_bw) rbSize++; /* found target_dl_bw? */ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 61168994c8..5c82beb0df 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -293,6 +293,19 @@ NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, } +int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs) { + + int f; // interleaving function + if(R==0) + f = k; + else { + int c = k/R; + int r = k%R; + f = (r*C + c + n_shift)%(N_regs/L); + } + return f; +} + uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, int cc_id, int aggregation, @@ -310,34 +323,26 @@ uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, return -1; } - int N_rb = pdcch->n_rb; // nb of rbs of coreset per symbol - int N_symb = coreset->duration; // nb of coreset symbols - int N_regs = N_rb*N_symb; // nb of REGs per coreset - int N_cces = N_regs / NR_NB_REG_PER_CCE; // nb of cces in coreset - - int L = pdcch->RegBundleSize; - int R = pdcch->InterleaverSize; - int n_shift = pdcch->ShiftIndex; - int C = R>0 ? N_regs/(L*R) : 0; - int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle + const int N_rb = pdcch->n_rb; // nb of rbs of coreset per symbol + const int N_symb = coreset->duration; // nb of coreset symbols + const int N_regs = N_rb*N_symb; // nb of REGs per coreset + const int N_cces = N_regs / NR_NB_REG_PER_CCE; // nb of cces in coreset + const int R = pdcch->InterleaverSize; + const int L = pdcch->RegBundleSize; + const int C = R>0 ? N_regs/(L*R) : 0; + const int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle int first_cce; bool taken = false; // flag if the resource for a given candidate are taken // loop over all the available candidates + // this implements TS 38.211 Sec. 7.3.2.2 for(int m=next_cand; mShiftIndex, C, L, N_regs); for(int rb=0; rbBWPStart + f*B_rb + rb]&(((1<StartSymbolIndex)) { + if(vrb_map[pdcch->BWPStart + f*B_rb + rb]&SL_to_bitmap(pdcch->StartSymbolIndex,N_symb)) { taken = true; break; } From 91ec80e3bb8aa06f2b47c44ac365fd0861fe53f8 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 20 Dec 2021 11:41:56 +0000 Subject: [PATCH 209/883] Fix after merge --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 676f45b95e..07ffc47152 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -253,6 +253,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ srs_config_pdu = &ul_config->ul_config_list[i].srs_config_pdu; memcpy((void*)&(PHY_vars_UE_g[module_id][cc_id]->srs_vars[gNB_id]->srs_config_pdu), (void*)srs_config_pdu, sizeof(fapi_nr_ul_config_srs_pdu)); PHY_vars_UE_g[module_id][cc_id]->srs_vars[gNB_id]->active = true; + ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more + pdu_done++; break; default: From 6947202c80e2ea87c8169382e2df4b929f5b1afc Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 20 Dec 2021 15:53:53 +0100 Subject: [PATCH 210/883] sched_pdcch not a pointer in structures --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 18 +++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 6 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 10 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 8 +-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 58 +++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 14 ++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 12 ++-- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 4 +- 8 files changed, 65 insertions(+), 65 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index c622d67c97..5cca08fc93 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -799,7 +799,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu_rel15 = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, &ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -815,7 +815,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t CC_id, aggregation_level, nr_of_candidates, - ra->sched_pdcch, + &ra->sched_pdcch, coreset, 0); if (CCEIndex < 0) { @@ -861,7 +861,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t fill_pdcch_vrb_map(nr_mac, CC_id, - ra->sched_pdcch, + &ra->sched_pdcch, CCEIndex, aggregation_level); @@ -1211,7 +1211,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra CC_id, aggregation_level, nr_of_candidates, - ra->sched_pdcch, + &ra->sched_pdcch, coreset, 0); @@ -1236,7 +1236,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, &ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1397,7 +1397,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra // Mark the corresponding symbols RBs as used fill_pdcch_vrb_map(nr_mac, CC_id, - ra->sched_pdcch, + &ra->sched_pdcch, CCEIndex, aggregation_level); for (int rb = 0; rb < rbSize; rb++) { @@ -1500,7 +1500,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra CC_id, aggregation_level, nr_of_candidates, - ra->sched_pdcch, + &ra->sched_pdcch, coreset, 0); @@ -1642,7 +1642,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_tti_pdcch_pdu->PDUSize = (uint8_t)(2 + sizeof(nfapi_nr_dl_tti_pdcch_pdu)); dl_req->nPDUs += 1; pdcch_pdu_rel15 = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; - nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, ra->sched_pdcch); + nr_configure_pdcch(pdcch_pdu_rel15, coreset, genericParameters, &ra->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu_rel15; } @@ -1786,7 +1786,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra // Mark the corresponding symbols and RBs as used fill_pdcch_vrb_map(nr_mac, CC_id, - ra->sched_pdcch, + &ra->sched_pdcch, CCEIndex, aggregation_level); for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 8212cba08d..eca68d8573 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -366,7 +366,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, CC_id, gNB_mac->sched_ctrlCommon->aggregation_level, nr_of_candidates, - gNB_mac->sched_ctrlCommon->sched_pdcch, + &gNB_mac->sched_ctrlCommon->sched_pdcch, gNB_mac->sched_ctrlCommon->coreset, 0); @@ -422,7 +422,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, // Mark the corresponding RBs as used fill_pdcch_vrb_map(gNB_mac, CC_id, - gNB_mac->sched_ctrlCommon->sched_pdcch, + &gNB_mac->sched_ctrlCommon->sched_pdcch, gNB_mac->sched_ctrlCommon->cce_index, gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { @@ -452,7 +452,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, nr_configure_pdcch(pdcch_pdu_rel15, gNB_mac->sched_ctrlCommon->coreset, NULL, - gNB_mac->sched_ctrlCommon->sched_pdcch); + &gNB_mac->sched_ctrlCommon->sched_pdcch); nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs]; memset((void*)dl_tti_pdsch_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index f9a87456f4..ed796ef007 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -628,7 +628,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* CC_id = */ 0, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -657,7 +657,7 @@ bool allocate_dl_retransmission(module_id_t module_id, fill_pdcch_vrb_map(RC.nrmac[module_id], /* CC_id = */ 0, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -785,7 +785,7 @@ void pf_dl(module_id_t module_id, /* CC_id = */ 0, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -816,7 +816,7 @@ void pf_dl(module_id_t module_id, fill_pdcch_vrb_map(mac, /* CC_id = */ 0, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -1073,7 +1073,7 @@ void nr_schedule_ue_spec(module_id_t module_id, pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; LOG_D(NR_MAC,"Trying to configure DL pdcch for UE %d, bwp %d, cs %d\n",UE_id,bwpid,coresetid); NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset; - nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, sched_ctrl->sched_pdcch); + nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, &sched_ctrl->sched_pdcch); gNB_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 9d3d015aae..8f32cf136e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -351,7 +351,7 @@ void nr_preprocessor_phytest(module_id_t module_id, CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -377,7 +377,7 @@ void nr_preprocessor_phytest(module_id_t module_id, fill_pdcch_vrb_map(RC.nrmac[module_id], CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -517,7 +517,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -556,7 +556,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ /* mark the corresponding RBs as used */ fill_pdcch_vrb_map(nr_mac, CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5c82beb0df..4f3e04bd07 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -209,41 +209,41 @@ NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, AssertFatal(0, "Couldn't find an adequate searchspace bwp_Dedicated %p\n",bwp_Dedicated); } -NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, - NR_SearchSpace_t *ss, - NR_ControlResourceSet_t *coreset, - NR_ServingCellConfigCommon_t *scc, - NR_BWP_t *bwp, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) { - - NR_sched_pdcch_t *pdcch = calloc(1,sizeof(NR_sched_pdcch_t)); +NR_sched_pdcch_t set_pdcch_structure(gNB_MAC_INST *gNB_mac, + NR_SearchSpace_t *ss, + NR_ControlResourceSet_t *coreset, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_t *bwp, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config) { int sps; + NR_sched_pdcch_t pdcch; + AssertFatal(*ss->controlResourceSetId == coreset->controlResourceSetId, "coreset id in SS %ld does not correspond to the one in coreset %ld", *ss->controlResourceSetId, coreset->controlResourceSetId); if (bwp) { // This is not for SIB1 if(coreset->controlResourceSetId == 0){ - pdcch->BWPSize = gNB_mac->cset0_bwp_size; - pdcch->BWPStart = gNB_mac->cset0_bwp_start; + pdcch.BWPSize = gNB_mac->cset0_bwp_size; + pdcch.BWPStart = gNB_mac->cset0_bwp_start; } else { - pdcch->BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE); - pdcch->BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE); + pdcch.BWPSize = NRRIV2BW(bwp->locationAndBandwidth, MAX_BWP_SIZE); + pdcch.BWPStart = NRRIV2PRBOFFSET(bwp->locationAndBandwidth, MAX_BWP_SIZE); } - pdcch->SubcarrierSpacing = bwp->subcarrierSpacing; - pdcch->CyclicPrefix = (bwp->cyclicPrefix==NULL) ? 0 : *bwp->cyclicPrefix; + pdcch.SubcarrierSpacing = bwp->subcarrierSpacing; + pdcch.CyclicPrefix = (bwp->cyclicPrefix==NULL) ? 0 : *bwp->cyclicPrefix; //AssertFatal(pdcch_scs==kHz15, "PDCCH SCS above 15kHz not allowed if a symbol above 2 is monitored"); sps = bwp->cyclicPrefix == NULL ? 14 : 12; } else { AssertFatal(type0_PDCCH_CSS_config!=NULL,"type0_PDCCH_CSS_config is null,bwp %p\n",bwp); - pdcch->BWPSize = type0_PDCCH_CSS_config->num_rbs; - pdcch->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; - pdcch->SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; - pdcch->CyclicPrefix = 0; + pdcch.BWPSize = type0_PDCCH_CSS_config->num_rbs; + pdcch.BWPStart = type0_PDCCH_CSS_config->cset_start_rb; + pdcch.SubcarrierSpacing = type0_PDCCH_CSS_config->scs_pdcch; + pdcch.CyclicPrefix = 0; sps = 14; } @@ -256,29 +256,29 @@ NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, for (int i=0; i>(sps-1-i))&1) { - pdcch->StartSymbolIndex=i; + pdcch.StartSymbolIndex=i; break; } } - pdcch->DurationSymbols = coreset->duration; + pdcch.DurationSymbols = coreset->duration; //cce-REG-MappingType - pdcch->CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved? + pdcch.CceRegMappingType = coreset->cce_REG_MappingType.present == NR_ControlResourceSet__cce_REG_MappingType_PR_interleaved? NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED : NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED; - if (pdcch->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) { - pdcch->RegBundleSize = (coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize == + if (pdcch.CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) { + pdcch.RegBundleSize = (coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize == NR_ControlResourceSet__cce_REG_MappingType__interleaved__reg_BundleSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->reg_BundleSize); - pdcch->InterleaverSize = (coreset->cce_REG_MappingType.choice.interleaved->interleaverSize == + pdcch.InterleaverSize = (coreset->cce_REG_MappingType.choice.interleaved->interleaverSize == NR_ControlResourceSet__cce_REG_MappingType__interleaved__interleaverSize_n6) ? 6 : (2+coreset->cce_REG_MappingType.choice.interleaved->interleaverSize); AssertFatal(scc->physCellId != NULL,"scc->physCellId is null\n"); - pdcch->ShiftIndex = coreset->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *coreset->cce_REG_MappingType.choice.interleaved->shiftIndex : *scc->physCellId; + pdcch.ShiftIndex = coreset->cce_REG_MappingType.choice.interleaved->shiftIndex != NULL ? *coreset->cce_REG_MappingType.choice.interleaved->shiftIndex : *scc->physCellId; } else { - pdcch->RegBundleSize = 6; - pdcch->InterleaverSize = 0; - pdcch->ShiftIndex = 0; + pdcch.RegBundleSize = 6; + pdcch.InterleaverSize = 0; + pdcch.ShiftIndex = 0; } int N_rb = 0; // nb of rbs of coreset per symbol @@ -287,7 +287,7 @@ NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, N_rb+=((coreset->frequencyDomainResources.buf[i]>>t)&1); } } - pdcch->n_rb = N_rb*=6; // each bit of frequencyDomainResources represents 6 PRBs + pdcch.n_rb = N_rb*=6; // each bit of frequencyDomainResources represents 6 PRBs return pdcch; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 7b33e029d8..2fa5a55d0e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1024,7 +1024,7 @@ bool allocate_ul_retransmission(module_id_t module_id, CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -1036,7 +1036,7 @@ bool allocate_ul_retransmission(module_id_t module_id, sched_ctrl->cce_index = CCEIndex; fill_pdcch_vrb_map(RC.nrmac[module_id], CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -1170,7 +1170,7 @@ void pf_ul(module_id_t module_id, CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); @@ -1194,7 +1194,7 @@ void pf_ul(module_id_t module_id, sched_ctrl->cce_index = CCEIndex; fill_pdcch_vrb_map(RC.nrmac[module_id], CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -1280,7 +1280,7 @@ void pf_ul(module_id_t module_id, CC_id, sched_ctrl->aggregation_level, nr_of_candidates, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, sched_ctrl->coreset, Y); if (CCEIndex<0) { @@ -1350,7 +1350,7 @@ void pf_ul(module_id_t module_id, sched_ctrl->cce_index = CCEIndex; fill_pdcch_vrb_map(RC.nrmac[module_id], CC_id, - sched_ctrl->sched_pdcch, + &sched_ctrl->sched_pdcch, CCEIndex, sched_ctrl->aggregation_level); @@ -1754,7 +1754,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ul_dci_request_pdu->PDUSize = (uint8_t)(2+sizeof(nfapi_nr_dl_tti_pdcch_pdu)); pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; - nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, sched_ctrl->sched_pdcch); + nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, &sched_ctrl->sched_pdcch); nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 524f4598b3..4b876fcf04 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -253,12 +253,12 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, NR_BWP_t *bwp, NR_sched_pdcch_t *pdcch); -NR_sched_pdcch_t *set_pdcch_structure(gNB_MAC_INST *gNB_mac, - NR_SearchSpace_t *ss, - NR_ControlResourceSet_t *coreset, - NR_ServingCellConfigCommon_t *scc, - NR_BWP_t *bwp, - NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); +NR_sched_pdcch_t set_pdcch_structure(gNB_MAC_INST *gNB_mac, + NR_SearchSpace_t *ss, + NR_ControlResourceSet_t *coreset, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_t *bwp, + NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, int cc_id, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index c18f4b8bba..1073cef16c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -181,7 +181,7 @@ typedef struct { NR_SearchSpace_t *ra_ss; /// RA Coreset NR_ControlResourceSet_t *coreset; - NR_sched_pdcch_t *sched_pdcch; + NR_sched_pdcch_t sched_pdcch; // Beam index uint8_t beam_id; /// CellGroup for UE that is to come (NSA is non-null, null for SA) @@ -551,7 +551,7 @@ typedef struct { /// CCE index and aggregation, should be coherent with cce_list NR_SearchSpace_t *search_space; NR_ControlResourceSet_t *coreset; - NR_sched_pdcch_t *sched_pdcch; + NR_sched_pdcch_t sched_pdcch; /// CCE index and Aggr. Level are shared for PUSCH/PDSCH allocation decisions /// corresponding to the sched_pusch/sched_pdsch structures below From 5e3e1e42a5390e07cf7dbcf38090517dd41f217d Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 20 Dec 2021 16:31:49 +0100 Subject: [PATCH 211/883] remove softmodem param for 256 qam --- executables/softmodem-common.h | 11 ++++------- openair1/SIMULATION/NR_PHY/dlsim.c | 6 ------ openair2/RRC/NR/rrc_gNB_reconfig.c | 21 +++------------------ 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 3a7022a502..f51d9c4724 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -119,7 +119,6 @@ extern "C" #define TIMING_SOURCE softmodem_params.timing_source #define SEND_DMRSSYNC softmodem_params.send_dmrs_sync #define USIM_TEST softmodem_params.usim_test -#define USE_256QAM_TABLE softmodem_params.use_256qam_table #define PRB_INTERPOLATION softmodem_params.prb_interpolation #define NFAPI softmodem_params.nfapi #define NON_STOP softmodem_params.non_stop @@ -154,11 +153,10 @@ extern int usrp_tx_thread; {"basicsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&basicsim, defintval:0, TYPE_INT, 0}, \ {"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \ - {"use-256qam-table", CONFIG_HLP_256QAM, PARAMFLAG_BOOL, iptr:&USE_256QAM_TABLE, defintval:0, TYPE_INT, 0}, \ - {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \ - {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \ - {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \ - {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \ + {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \ + {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \ + {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \ + {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \ } @@ -248,7 +246,6 @@ typedef struct { uint32_t timing_source; int hw_timing_advance; uint32_t send_dmrs_sync; - int use_256qam_table; int prb_interpolation; uint8_t nfapi; int non_stop; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index dc46215d1b..d5ff44a484 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -605,11 +605,6 @@ int main(int argc, char **argv) g_mcsIndex = atoi(optarg); break; - case 'q': - g_mcsTableIdx = 1; - get_softmodem_params()->use_256qam_table = 1; - break; - case 'm': mu = atoi(optarg); break; @@ -665,7 +660,6 @@ int main(int argc, char **argv) printf("-c Start symbol for PDSCH (fixed for now)\n"); printf("-j Number of symbols for PDSCH (fixed for now)\n"); printf("-e MSC index\n"); - printf("-q Use 2nd MCS table (256 QAM table) for PDSCH\n"); printf("-t Acceptable effective throughput (in percentage)\n"); printf("-T Enable PTRS, arguments list L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2 \n"); printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n"); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 30604cd015..9329ff17ac 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -330,12 +330,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - if (!get_softmodem_params()->use_256qam_table) { - secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table=NULL; - } else { - secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table)); - *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; - } + secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->mcs_Table=NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; @@ -597,12 +592,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - if (!get_softmodem_params()->use_256qam_table) { - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL; - } else { - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table)); - *bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; - } + bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; @@ -628,12 +618,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - if (!get_softmodem_params()->use_256qam_table) { - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL; - } else { - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table)); - *bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; - } + bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; From 50629a83a22ef75b79ef8e290c7f0db358cb270b Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 20 Dec 2021 21:24:52 +0100 Subject: [PATCH 212/883] first set of changes to AW2S ORI/eCPRI driver for n78 --- targets/ARCH/AW2SORI/oaiori.c | 44 +++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/targets/ARCH/AW2SORI/oaiori.c b/targets/ARCH/AW2SORI/oaiori.c index f79e2fad20..ea39d9c90d 100644 --- a/targets/ARCH/AW2SORI/oaiori.c +++ b/targets/ARCH/AW2SORI/oaiori.c @@ -101,31 +101,37 @@ static const eutra_bandentry_t eutra_bandtable[] = { uint32_t to_earfcn_DL_aw2s(int eutra_bandP, long long int dl_CarrierFreq, uint32_t bw) { uint32_t dl_CarrierFreq_by_100k = dl_CarrierFreq / 100000; - int i; + int i=0; if (eutra_bandP > 68) { printf("eutra_band %d > 68\n", eutra_bandP); exit(-1);} - for (i = 0; i < BANDTABLE_SIZE && eutra_bandtable[i].band != eutra_bandP; i++); - printf("AW2S: band %d, index %d\n",eutra_bandP, i); + + if (eutra_bandP > 0) + for (i = 0; i < BANDTABLE_SIZE && eutra_bandtable[i].band != eutra_bandP; i++); + printf("AW2S: band %d: index %d\n",eutra_bandP, i); if (i >= BANDTABLE_SIZE) { printf(" i = %d , it will trigger out-of-bounds read.\n",i); exit(-1);} - if (dl_CarrierFreq_by_100k < eutra_bandtable[i].dl_min) { - printf("Band %d, bw %u : DL carrier frequency %u .1 MHz < %u\n", - eutra_bandP, bw, dl_CarrierFreq_by_100k, - eutra_bandtable[i].dl_min); exit(-1);} + while(i - (eutra_bandtable[i].dl_max - bw)) { - printf("Band %d, bw %u : DL carrier frequency %u .1MHz > %d\n", - eutra_bandP, bw, dl_CarrierFreq_by_100k, - eutra_bandtable[i].dl_max - bw); exit(-1); } - printf("AW2S: dl_CarrierFreq_by_100k %d, dl_min %d\n",dl_CarrierFreq_by_100k,eutra_bandtable[i].dl_min); + if(dl_CarrierFreq_by_100k > + (eutra_bandtable[i].dl_max - bw)) { + printf("Band %d, bw %u : DL carrier frequency %u .1MHz > %d\n", + eutra_bandtable[i].band, bw, dl_CarrierFreq_by_100k, + eutra_bandtable[i].dl_max - bw); i++;continue; } + printf("AW2S: dl_CarrierFreq_by_100k %d, dl_min %d\n",dl_CarrierFreq_by_100k,eutra_bandtable[i].dl_min); - return (dl_CarrierFreq_by_100k - eutra_bandtable[i].dl_min + - (eutra_bandtable[i].N_OFFs_DL / 10)); + return (dl_CarrierFreq_by_100k - eutra_bandtable[i].dl_min + + (eutra_bandtable[i].N_OFFs_DL / 10)); + + } + printf("No DL band found\n"); + exit(-1); } - uint32_t to_earfcn_UL_aw2s(int eutra_bandP, long long int ul_CarrierFreq, uint32_t bw) { uint32_t ul_CarrierFreq_by_100k = ul_CarrierFreq / 100000; int i; @@ -134,6 +140,7 @@ uint32_t to_earfcn_UL_aw2s(int eutra_bandP, long long int ul_CarrierFreq, uint32 exit(-1); } + for (i = 0; i < BANDTABLE_SIZE && eutra_bandtable[i].band != eutra_bandP; i++); if(i >= BANDTABLE_SIZE) {printf("i = %d , it will trigger out-of-bounds read.\n",i); exit(-1);} @@ -313,12 +320,13 @@ int aw2s_startstreaming(openair0_device *device) { printf("ORI_ObjectStateModify: %s\n", ORI_Result_Print(RE_result)); } + /* while (rx0->fst != ORI_FST_Operational || (openair0_cfg->rx_num_channels > 1 && rx1->fst != ORI_FST_Operational) || tx0->fst != ORI_FST_Operational || (openair0_cfg->tx_num_channels > 1 && tx1->fst != ORI_FST_Operational)) {} - +*/ // test RX interface uint64_t TS; char temp_rx[1024] __attribute__((aligned(32))); @@ -475,7 +483,7 @@ int aw2s_oriinit(openair0_device *device) { txParams.TxEUtraTDD.axcW = 1; txParams.TxEUtraTDD.axcB = 0; txParams.TxEUtraTDD.chanBW = openair0_cfg->tx_bw/100e3; - txParams.TxEUtraTDD.earfcn = to_earfcn_DL_aw2s(38,(long long int)openair0_cfg->tx_freq[0],txParams.TxEUtraTDD.chanBW); + txParams.TxEUtraTDD.earfcn = to_earfcn_DL_aw2s(-1,(long long int)openair0_cfg->tx_freq[0],txParams.TxEUtraTDD.chanBW); txParams.TxEUtraTDD.maxTxPwr = 430-((int)openair0_cfg->tx_gain[0]*10); txParams.TxEUtraTDD.tddULDLConfig = 1; txParams.TxEUtraTDD.tddSpecialSFConfig = 0; From ae29f64419adfa54a1e6cdefb4303a042d44cc63 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 21 Dec 2021 10:57:35 +0100 Subject: [PATCH 213/883] adapting function for dl 256 qam --- common/utils/nr/nr_common.c | 21 +++++++++++ common/utils/nr/nr_common.h | 1 + openair2/RRC/NR/nr_rrc_config.c | 67 ++++++++++++++++++++++++++++++++- openair2/RRC/NR/nr_rrc_config.h | 1 + openair2/RRC/NR/rrc_gNB.c | 28 +------------- 5 files changed, 90 insertions(+), 28 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 34a86f860a..25af02ba4b 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -36,6 +36,27 @@ const char *duplex_mode[]={"FDD","TDD"}; +int tables_5_3_2[5][11] = { + {25, 52, 79, 106, 133, 160, 216, 270, -1, -1, -1}, // 15 FR1 + {11, 24, 38, 51, 65, 78, 106, 133, 162, 217, 273}, // 30 FR1 + {-1, 11, 18, 24, 31, 38, 51, 65, 79, 107, 135}, // 60 FR1 + {66, 132, 264, -1 , -1, -1, -1, -1, -1, -1, -1}, // 60 FR2 + {32, 66, 132, 264, -1, -1, -1, -1, -1, -1, -1} // 120FR2 +}; + +int get_supported_band_index(int scs, int band, int n_rbs){ + + int scs_index = scs; + if (band>256) + scs_index++; + for (int i=0; i<11; i++) { + if(n_rbs == tables_5_3_2[scs][i]) + return i; + } + return (-1); // not found +} + + // Table 5.2-1 NR operating bands in FR1 & FR2 (3GPP TS 38.101) // Table 5.4.2.3-1 Applicable NR-ARFCN per operating band in FR1 & FR2 (3GPP TS 38.101) // Notes: diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index d16c8fbb19..5d8cdf06bf 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -72,6 +72,7 @@ int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); int get_dmrs_port(int nl, uint16_t dmrs_ports); int get_nb_periods_per_frame(uint8_t tdd_period); +int get_supported_band_index(int scs, int band, int n_rbs); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index b4cbe7b8bc..73f91622f5 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -98,6 +98,71 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3); } } - } + +void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, NR_UE_NR_Capability_t *cap) { + + int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing; + struct NR_FrequencyInfoDL__scs_SpecificCarrierList scs_list = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList; + int bw_rb = -1; + for(int i=0; isubcarrierSpacing){ + bw_rb = scs_list.list.array[i]->carrierBandwidth; + break; + } + } + AssertFatal(bw_rb>0,"Could not find scs-SpecificCarrierList element for scs %d",scs); + int bw = get_supported_band_index(scs, band, bw_rb); + AssertFatal(bw>0,"Supported band corresponding to %d RBs not found\n", bw_rb); + + bool supported = false; + if (band>256) { + for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; + if(bandNRinfo->bandNR == band && bandNRinfo->pdsch_256QAM_FR2) { + supported = true; + break; + } + } + } + else if (cap->phy_Parameters.phy_ParametersFR1 && cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1) + supported = true; + + // check featureSet + NR_FeatureSets_t *fs=cap->featureSets; + NR_ModulationOrder_t supported_mo = 0; + if (fs && supported) { + // go through DL feature sets and look for one with current SCS + for (int i=0;ifeatureSetsDownlinkPerCC->list.count;i++) { + int supported_bw; + NR_FeatureSetDownlinkPerCC_t *fs_cc = fs->featureSetsDownlinkPerCC->list.array[i]; + switch (fs_cc->supportedBandwidthDL.present) { + case NR_SupportedBandwidth_PR_fr1: + supported_bw = fs_cc->supportedBandwidthDL.choice.fr1; + break; + case NR_SupportedBandwidth_PR_fr2: + supported_bw = fs_cc->supportedBandwidthDL.choice.fr2; + break; + default: + AssertFatal(1==0,"Invalid parameter for supported bandwith choice\n"); + } + if (fs_cc->supportedSubcarrierSpacingDL == scs && + supported_bw == bw && + fs_cc->supportedModulationOrderDL) + supported_mo = *fs_cc->supportedModulationOrderDL ; + } + } + if (supported && (supported_mo == NR_ModulationOrder_qam256)) { + long *mcs_Table = bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table; + if(mcs_Table == NULL) + mcs_Table = calloc(1, sizeof(*mcs_Table)); + *mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; + } + else + bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; +} + + + diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index 192fee754e..7daf08b547 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -113,6 +113,7 @@ typedef struct physicalcellgroup_s{ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); +void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, NR_UE_NR_Capability_t *cap); #endif diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 7f7353f9af..9562d671e6 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -2891,30 +2891,6 @@ unsigned int get_ul_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { return(0); } -int is_dl_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { - int common_band = *rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; - int common_scs = rrc->carrier.servingcellconfigcommon->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; - if (common_band>256) { - for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { - NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; - if (bandNRinfo->bandNR == common_band && !bandNRinfo->pdsch_256QAM_FR2) return (0); - } - } - else if (cap->phy_Parameters.phy_ParametersFR1 && !cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1) return(0); - - // check featureSet - NR_FeatureSets_t *fs=cap->featureSets; - if (fs) { - // go through DL feature sets and look for one with current SCS - for (int i=0;ifeatureSetsDownlinkPerCC->list.count;i++) { - if (fs->featureSetsDownlinkPerCC->list.array[i]->supportedSubcarrierSpacingDL == common_scs && - fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL && - *fs->featureSetsDownlinkPerCC->list.array[i]->supportedModulationOrderDL == NR_ModulationOrder_qam256) return(1); - } - } - return(0); -} - int is_ul_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]; int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; @@ -3005,11 +2981,9 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { } if (ue_context_p->ue_context.UE_Capability_nr) { - fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", + fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n", get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), - is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", - is_ul_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no", get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr), get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr)); From dfc53049678b0dc6a6e5d6d146872ee271f61436 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 22 Dec 2021 10:43:08 +0100 Subject: [PATCH 214/883] passing UECAP structure to RRC reconfiguration functions --- openair1/SIMULATION/NR_PHY/dlsim.c | 3 ++- openair1/SIMULATION/NR_PHY/ulsim.c | 3 ++- openair2/RRC/NR/MESSAGES/asn1_msg.c | 21 ++++++++++++--------- openair2/RRC/NR/MESSAGES/asn1_msg.h | 6 ++++++ openair2/RRC/NR/nr_rrc_proto.h | 2 ++ openair2/RRC/NR/rrc_gNB.c | 8 ++++++++ openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ openair2/RRC/NR/rrc_gNB_reconfig.c | 3 +++ 8 files changed, 37 insertions(+), 11 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index d5ff44a484..32a05f060a 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -762,7 +762,8 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0); + // TODO do a UECAP for phy-sim + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 6, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index c9d863c6b5..f30e6393a7 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -713,7 +713,8 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0); + // TODO do a UECAP for phy-sim + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 0, 0, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index bdd1cf5261..cad40cd05a 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1407,6 +1407,13 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb); } + +void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, + rrc_gNB_carrier_data_t *carrier, + NR_UE_NR_Capability_t *uecap) { + +} + void fill_initial_cellGroupConfig(rnti_t rnti, NR_CellGroupConfig_t *cellGroupConfig, NR_ServingCellConfigCommon_t *scc, @@ -1824,6 +1831,8 @@ int16_t do_RRCReconfiguration( NR_SDAP_Config_t *sdap_config, NR_MeasConfig_t *meas_config, struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, + rrc_gNB_ue_context_t *const ue_context_pP, + rrc_gNB_carrier_data_t *carrier, NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig) //------------------------------------------------------------------------------ @@ -1860,15 +1869,6 @@ int16_t do_RRCReconfiguration( ie->radioBearerConfig->srb3_ToRelease = NULL; ie->radioBearerConfig->drb_ToReleaseList = DRB_releaseList; } - /******************** Secondary Cell Group ********************/ - // rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier); - // fill_default_secondaryCellGroup( carrier->servingcellconfigcommon, - // ue_context_pP->ue_context.secondaryCellGroup, - // 1, - // 1, - // carrier->pdsch_AntennaPorts, - // carrier->initial_csi_index[ue_context_p->local_uid + 1], - // ue_context_pP->local_uid); /******************** Meas Config ********************/ // measConfig @@ -1884,6 +1884,9 @@ int16_t do_RRCReconfiguration( } if(cellGroupConfig!=NULL){ + update_cellGroupConfig(cellGroupConfig, + carrier, + ue_context_pP->ue_context.UE_Capability_nr); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)cellGroupConfig, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 7b38de2bb9..8585e82af8 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -99,6 +99,10 @@ void fill_initial_cellGroupConfig(rnti_t rnti, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); +void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, + rrc_gNB_carrier_data_t *carrier, + NR_UE_NR_Capability_t *uecap); + void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, @@ -133,6 +137,8 @@ int16_t do_RRCReconfiguration( NR_SDAP_Config_t *sdap_config, NR_MeasConfig_t *meas_config, struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, + rrc_gNB_ue_context_t *const ue_context_pP, + rrc_gNB_carrier_data_t *carrier, NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig); diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 22109c3029..7309bcf2d9 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -76,6 +76,7 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti); void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_CellGroupConfig_t *secondaryCellGroup, + NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, int dl_antenna_ports, @@ -90,6 +91,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, + NR_UE_NR_Capability_t *uecap, int dl_antenna_ports, int minRXTXTIMEpdsch, int do_csirs, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 9562d671e6..8a9d4cf566 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -777,6 +777,8 @@ rrc_gNB_generate_defaultRRCReconfiguration( NULL, dedicatedNAS_MessageList, NULL, + NULL, + NULL, NULL); free(ue_context_pP->ue_context.nas_pdu.buffer); @@ -1046,6 +1048,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( NULL, NULL, dedicatedNAS_MessageList, + ue_context_pP, + &rrc->carrier, NULL, cellGroupConfig); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n"); @@ -1155,6 +1159,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL, dedicatedNAS_MessageList, NULL, + NULL, + NULL, NULL); ue_context_pP->ue_context.pdu_session_release_command_flag = 1; @@ -1680,6 +1686,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, // MeasObj_list, NULL, NULL, + NULL, + NULL, NULL); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 643a2eb506..174f6aec99 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -262,6 +262,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.spCellConfig->spCellConfigDedicated, reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, + ue_context_p->ue_context.UE_Capability_nr, carrier->pdsch_AntennaPorts, carrier->minRXTXTIME, carrier->do_CSIRS, @@ -272,6 +273,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ NULL, reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, + ue_context_p->ue_context.UE_Capability_nr, carrier->pdsch_AntennaPorts, carrier->minRXTXTIME, carrier->do_CSIRS, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 9329ff17ac..39d02df73e 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -52,6 +52,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_CellGroupConfig_t *secondaryCellGroup, + NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, int dl_antenna_ports, @@ -1333,6 +1334,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, + NR_UE_NR_Capability_t *uecap, int dl_antenna_ports, int minRXTXTIME, int do_csirs, @@ -1347,6 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon fill_default_secondaryCellGroup(servingcellconfigcommon, servingcellconfigdedicated, secondaryCellGroup, + uecap, 1, 1, dl_antenna_ports, From a8d5595272ea304fe85324cadbba11de14d2c26b Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 22 Dec 2021 13:58:32 +0100 Subject: [PATCH 215/883] calling set mcs table function --- cmake_targets/CMakeLists.txt | 1 + openair2/RRC/NR/MESSAGES/asn1_msg.c | 6 ++++++ openair2/RRC/NR/rrc_gNB_reconfig.c | 29 ++--------------------------- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 6e960cce23..d3215de430 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2097,6 +2097,7 @@ set(NR_L2_SRC_UE ${NR_SDAP_SRC} ${NR_UE_RRC_DIR}/L2_interface_ue.c ${NR_UE_RRC_DIR}/main_ue.c + ${NR_RRC_DIR}/nr_rrc_config.c ${NR_UE_RRC_DIR}/rrc_UE.c ) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index cad40cd05a..8ad62c5fb2 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1412,6 +1412,12 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, rrc_gNB_carrier_data_t *carrier, NR_UE_NR_Capability_t *uecap) { + NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig; + struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; + for (int i=0; ilist.count; i++){ + NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i]; + set_dl_mcs_table(bwp, carrier->servingcellconfigcommon, uecap); + } } void fill_initial_cellGroupConfig(rnti_t rnti, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 39d02df73e..cba56b116d 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -45,6 +45,7 @@ #include "SIMULATION/TOOLS/sim.h" #include "executables/softmodem-common.h" #include "LAYER2/nr_rlc/nr_rlc_oai_api.h" +#include "nr_rrc_config.h" #define false 0 #define true 1 @@ -593,33 +594,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); - *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling)); - bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize = - calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize)); - *bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.choice.staticBundling->bundleSize = NR_PDSCH_Config__prb_BundlingType__staticBundling__bundleSize_wideband; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToAddModList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->zp_CSI_RS_ResourceToReleaseList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToAddModList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->aperiodic_ZP_CSI_RS_ResourceSetsToReleaseList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToAddModList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->sp_ZP_CSI_RS_ResourceSetsToReleaseList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->p_ZP_CSI_RS_ResourceSet=NULL; - - bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToReleaseList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->vrb_ToPRB_Interleaver=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->resourceAllocation=NR_PDSCH_Config__resourceAllocation_resourceAllocationType1; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_TimeDomainAllocationList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->pdsch_AggregationFactor=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToAddModList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternToReleaseList=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table=NULL; + set_dl_mcs_table(bwp, servingcellconfigcommon, uecap); bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; From ad37d8ae5f1100c08efb04d9d137af64a355136b Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 10 Nov 2021 17:31:49 +0000 Subject: [PATCH 216/883] Change LOG levels --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 37 ++++++++----------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 17 ++++++--- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 37a2849d21..1ce8c238cb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -32,9 +32,6 @@ #include "PHY/phy_extern_nr_ue.h" #include "PHY/NR_TRANSPORT/nr_transport_proto.h" #include "nr_transport_proto_ue.h" -//#include "SCHED/defs.h" -//#include "PHY/defs.h" -//#include "extern.h" #include "PHY/sse_intrin.h" #include "T.h" #include "openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h" @@ -379,10 +376,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", - frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -402,11 +397,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -463,9 +458,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #endif stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -515,11 +509,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -574,11 +568,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; @@ -657,9 +651,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else + +#ifdef DEBUG_PDSCH_RX LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index bfa16ef715..bb911195c7 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -60,6 +60,7 @@ //#define NR_PDCCH_SCHED_DEBUG //#define NR_PUCCH_SCHED //#define NR_PUCCH_SCHED_DEBUG +//#define NR_PDSCH_DEBUG #ifndef PUCCH #define PUCCH @@ -1020,15 +1021,14 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8); - - - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); +#ifdef NR_PDSCH_DEBUG LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#endif if(is_cw1_active) { // start ldpc decode for CW 1 @@ -1080,13 +1080,20 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - +#if PHYSIM + printf(" --> Unscrambling for CW1 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#else LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#endif + LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); From c713d499f4db92e9bec3d7f028b74b2863f0c93a Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 22 Dec 2021 17:40:08 +0100 Subject: [PATCH 217/883] bugfix --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index b70112032c..0c4d771afb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -458,7 +458,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // slot and frame limit to transmit msg2 according to response window uint8_t slot_limit = (rach_slot + slot_window)%nr_slots_per_frame[mu]; - uint8_t frame_limit = (slot_limit>(rach_slot))? rach_frame : (rach_frame +1); + uint16_t frame_limit = (slot_limit>(rach_slot))? rach_frame : (rach_frame +1); // computing start of next period From b830090a5a525f8025c14e430f93ed5d4088129b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 22 Dec 2021 18:27:26 +0000 Subject: [PATCH 218/883] Perform frequency offset correction in two consecutive frames for SA --- openair1/PHY/NR_REFSIG/ss_pbch_nr.h | 1 + .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 37 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ss_pbch_nr.h b/openair1/PHY/NR_REFSIG/ss_pbch_nr.h index 52a9c41ae9..44f8549258 100644 --- a/openair1/PHY/NR_REFSIG/ss_pbch_nr.h +++ b/openair1/PHY/NR_REFSIG/ss_pbch_nr.h @@ -65,6 +65,7 @@ /* SS/PBCH parameters */ #define N_RB_SS_PBCH_BLOCK (20) #define NB_SYMBOLS_PBCH (3) +#define NR_N_SYMBOLS_SSB (4) #define IQ_SIZE (sizeof(int16_t) * 2) /* I and Q are alternatively stored into buffers */ #define N_SYMB_SLOT (14) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 767edf9cc6..3466f43452 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -42,6 +42,7 @@ #include "common_lib.h" #include +#include #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/sss_nr.h" @@ -250,21 +251,31 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, #endif // digital compensation of FFO for SSB symbols - if (ue->UE_fo_compensation){ - double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time - double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample + if (ue->UE_fo_compensation){ + double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time + double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample - int start = is*fp->samples_per_frame+ue->ssb_offset; // start for offset correction is at ssb_offset (pss time position) - int end = start + 4*(fp->ofdm_symbol_size + fp->nb_prefix_samples); // loop over samples in 4 symbols (ssb size), including prefix + // In SA we need to perform frequency offset correction in two consecutive frames because we need to decode SIB1 + // and we do not know yet in which slot it goes. - for(int n=start; nnb_antennas_rx; ar++) { - re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]); - im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]); - ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle))); - ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle))); - } - } + // start for offset correction + int start = get_softmodem_params()->sa ? + is*fp->samples_per_frame : + is*fp->samples_per_frame + ue->ssb_offset; + + // loop over samples + int end = get_softmodem_params()->sa ? + start + (fp->samples_per_frame<<1): + start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples); + + for(int n=start; nnb_antennas_rx; ar++) { + re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]); + im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]); + ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle))); + ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle))); + } + } } /* check that SSS/PBCH block is continuous inside the received buffer */ From a2014a52496747627eec5856907dded770ce3905 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 23 Dec 2021 10:36:58 +0000 Subject: [PATCH 219/883] Increase SSS phase hypothesis resolution --- openair1/PHY/NR_REFSIG/sss_nr.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/sss_nr.h b/openair1/PHY/NR_REFSIG/sss_nr.h index 12d91ed3d1..e413400097 100644 --- a/openair1/PHY/NR_REFSIG/sss_nr.h +++ b/openair1/PHY/NR_REFSIG/sss_nr.h @@ -63,18 +63,22 @@ /************** VARIABLES *****************************************/ -#define PHASE_HYPOTHESIS_NUMBER (7) +#define PHASE_HYPOTHESIS_NUMBER (16) #define INDEX_NO_PHASE_DIFFERENCE (3) /* this is for no phase shift case */ EXTERN const int16_t phase_re_nr[PHASE_HYPOTHESIS_NUMBER] #ifdef INIT_VARIABLES_SSS_NR_H -= {16383, 25101, 30791, 32767, 30791, 25101, 16383} +// -pi/3 ---- pi/3 += {16384,20173,23571,26509,28932,30791,32051,32687,32687,32051,30791, + 28932,26509,23571,20173,16384} #endif ; EXTERN const int16_t phase_im_nr[PHASE_HYPOTHESIS_NUMBER] #ifdef INIT_VARIABLES_SSS_NR_H -= {-28378, -21063, -11208, 0, 11207, 21062, 28377}; +// -pi/3 ---- pi/3 += {-28377,-25821,-22762,-19260,-15383,-11207,-6813,-2286,2286,6813,11207, + 15383,19260,22762,25821,28377} #endif ; From a33457aa62ce61d4f2b989ca7ce9ce5eda382cdf Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 23 Dec 2021 14:27:49 +0100 Subject: [PATCH 220/883] fix in allocation of mcs_table in bwp structure --- openair2/RRC/NR/nr_rrc_config.c | 9 ++++----- openair2/RRC/NR/rrc_gNB.c | 21 --------------------- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 73f91622f5..8ba2ecfcbe 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -155,13 +155,12 @@ void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, } } if (supported && (supported_mo == NR_ModulationOrder_qam256)) { - long *mcs_Table = bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table; - if(mcs_Table == NULL) - mcs_Table = calloc(1, sizeof(*mcs_Table)); - *mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; + if(bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == NULL) + bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table)); + *bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; } else - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; + bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; } diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 8a9d4cf566..5334c748f3 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -2899,27 +2899,6 @@ unsigned int get_ul_bw_mask(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { return(0); } -int is_ul_256QAM_supported(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { - int common_band = *rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]; - int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; - for (int i=0;irf_Parameters.supportedBandListNR.list.count;i++) { - NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[i]; - if (bandNRinfo->bandNR == common_band && !bandNRinfo->pusch_256QAM) return (0); - } - - // check featureSet - NR_FeatureSets_t *fs=cap->featureSets; - if (fs) { - // go through UL feature sets and look for one with current SCS - for (int i=0;ifeatureSetsUplinkPerCC->list.count;i++) { - if (fs->featureSetsUplinkPerCC->list.array[i]->supportedSubcarrierSpacingUL == common_scs && - fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL && - *fs->featureSetsUplinkPerCC->list.array[i]->supportedModulationOrderUL == NR_ModulationOrder_qam256) return(1); - } - } - return(0); -} - int get_ul_mimo_layersCB(gNB_RRC_INST *rrc,NR_UE_NR_Capability_t *cap) { int common_scs = rrc->carrier.servingcellconfigcommon->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index cba56b116d..3b013ac88b 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -697,8 +697,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco pusch_Config->pusch_TimeDomainAllocationList = NULL; pusch_Config->pusch_AggregationFactor=NULL; pusch_Config->mcs_Table=NULL; - pusch_Config->mcs_TableTransformPrecoder=NULL; pusch_Config->transformPrecoder= NULL; + pusch_Config->mcs_TableTransformPrecoder=NULL; /* if msg3_transformprecoding is set in conf file - pusch config should not disable it */ if (servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) { pusch_Config->transformPrecoder=calloc(1,sizeof(*pusch_Config->transformPrecoder)); From 62e540e6e66a025e46af1669dad0bb043b6264ba Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 23 Dec 2021 14:47:41 +0100 Subject: [PATCH 221/883] fix in case uecap is null --- openair2/RRC/NR/nr_rrc_config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 8ba2ecfcbe..c77d245af3 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -103,6 +103,11 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, NR_UE_NR_Capability_t *cap) { + if (cap == NULL){ + bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; + return; + } + int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing; struct NR_FrequencyInfoDL__scs_SpecificCarrierList scs_list = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList; From f508d8c80df110616e467f553629734f48ac77a6 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 23 Dec 2021 17:14:46 +0000 Subject: [PATCH 222/883] Improve frequency offset correction in two consecutive frames for SA --- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 3466f43452..dcb8035e8a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -31,8 +31,6 @@ */ #include "PHY/types.h" #include "PHY/defs_nr_UE.h" -#include "PHY/phy_extern_nr_ue.h" -#include "PHY/INIT/phy_init.h" #include "PHY/MODULATION/modulation_UE.h" #include "nr_transport_proto_ue.h" #include "PHY/NR_UE_ESTIMATION/nr_estimation.h" @@ -42,12 +40,10 @@ #include "common_lib.h" #include -#include #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/sss_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" -#include "PHY/NR_TRANSPORT/nr_dci.h" extern openair0_config_t openair0_cfg[]; //static nfapi_nr_config_request_t config_t; @@ -202,6 +198,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, { int32_t sync_pos, sync_pos_frame; // k_ssb, N_ssb_crb, sync_pos2, + int32_t accumulated_freq_offset = 0; int32_t metric_tdd_ncp=0; uint8_t phase_tdd_ncp; double im, re; @@ -254,19 +251,16 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, if (ue->UE_fo_compensation){ double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample + accumulated_freq_offset += ue->common_vars.freq_offset; - // In SA we need to perform frequency offset correction in two consecutive frames because we need to decode SIB1 + // In SA we need to perform frequency offset correction until the end of buffer because we need to decode SIB1 // and we do not know yet in which slot it goes. // start for offset correction - int start = get_softmodem_params()->sa ? - is*fp->samples_per_frame : - is*fp->samples_per_frame + ue->ssb_offset; + int start = sa ? is*fp->samples_per_frame : is*fp->samples_per_frame + ue->ssb_offset; // loop over samples - int end = get_softmodem_params()->sa ? - start + (fp->samples_per_frame<<1): - start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples); + int end = sa ? n_frames*fp->samples_per_frame-1 : start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples); for(int n=start; nnb_antennas_rx; ar++) { @@ -555,6 +549,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, } if (dec == false) // sib1 not decoded ret = -1; + + ue->common_vars.freq_offset = accumulated_freq_offset; } // exit_fun("debug exit"); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_OUT); From 22754562cf67df26b8184c894af8c890c3d33bef Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 10:26:52 +0000 Subject: [PATCH 223/883] Adjust sync based on PSS --- executables/nr-ue.c | 4 +- openair1/PHY/NR_REFSIG/pss_nr.h | 2 + openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 85 +++++++++++++++++++ openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 11 ++- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 + .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 + 6 files changed, 101 insertions(+), 3 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 60ff40abeb..c90a5119cd 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -642,7 +642,9 @@ void *UE_thread(void *arg) { readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms); writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms); } else { - UE->rx_offset_diff = computeSamplesShift(UE); + //UE->rx_offset_diff = computeSamplesShift(UE); + + readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms) - UE->rx_offset_diff; writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms)- UE->rx_offset_diff; diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index b32d48a2e9..e2dd0e456b 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -141,6 +141,8 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain int *eNB_id, int *f_off); +int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off); + #endif #undef EXTERN diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 28b6677b2c..4ee5884afd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "PHY/defs_nr_UE.h" @@ -975,3 +976,87 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain return(peak_position); } +int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { + + int **rxdata = ue->common_vars.rxdata; + NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; + uint8_t Nid2 = GET_NID2(frame_parms->Nid_cell); + + int maxval=0; + for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) { + maxval = max(maxval,primary_synchro_time_nr[Nid2][i]); + maxval = max(maxval,-primary_synchro_time_nr[Nid2][i]); + } + int shift = log2_approx(maxval); + + /* Search pss in the received buffer each 4 samples which ensures a memory alignment on 128 bits (32 bits x 4 ) */ + /* This is required by SIMD (single instruction Multiple Data) Extensions of Intel processors. */ + /* Correlation computation is based on a dot product which is realized thank to SIMS extensions */ + int64_t peak_value = 0; + int peak_position = 0; + int64_t result = 0; + int64_t avg=0; + int start = 2*(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples) + frame_parms->nb_prefix_samples0 - 200; + int length = 2*frame_parms->ofdm_symbol_size + 200; + memset(pss_corr_ue[Nid2],0,(start+length)*sizeof(int64_t)); + for (int n=start; n < start+length; n+=4) { // + for (int ar=0; arnb_antennas_rx; ar++) { + result = dot_product64((short*)primary_synchro_time_nr[Nid2], + (short*) &(rxdata[ar][n]), + frame_parms->ofdm_symbol_size, + shift); + pss_corr_ue[Nid2][n] += abs64(result); + } + avg+=pss_corr_ue[Nid2][n]; + if (pss_corr_ue[Nid2][n] > peak_value) { + peak_value = pss_corr_ue[Nid2][n]; + peak_position = n; + } + } + + avg/=(length/4); + if (peak_value < 5*avg) { + return 0; + } + + int peak_position_diff = peak_position - ( ((frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)<<1) + frame_parms->nb_prefix_samples0); + + // Fractional frequency offset computation according to Cross-correlation Synchronization Algorithm Using PSS + // Shoujun Huang, Yongtao Su, Ying He and Shan Tang, "Joint time and frequency offset estimation in LTE downlink," + // 7th International Conference on Communications and Networking in China, 2012. + + // Computing cross-correlation at peak on half the symbol size for first half of data + int64_t result1 = dot_product64((short*)primary_synchro_time_nr[Nid2], + (short*) &(rxdata[0][peak_position]), + frame_parms->ofdm_symbol_size>>1, + shift); + + // Computing cross-correlation at peak on half the symbol size for data shifted by half symbol size + // as it is real and complex it is necessary to shift by a value equal to symbol size to obtain such shift + int64_t result2 = dot_product64((short*)primary_synchro_time_nr[Nid2]+(frame_parms->ofdm_symbol_size), + (short*) &(rxdata[0][peak_position])+frame_parms->ofdm_symbol_size, + frame_parms->ofdm_symbol_size>>1, + shift); + + int64_t re1 = ((int*) &result1)[0]; + int64_t re2 = ((int*) &result2)[0]; + int64_t im1 = ((int*) &result1)[1]; + int64_t im2 = ((int*) &result2)[1]; + + // Estimation of fractional frequency offset: angle[(result1)'*(result2)]/pi + double ffo_est = atan2(re1*im2-re2*im1,re1*re2+im1*im2)/M_PI; + + // Computing absolute value of frequency offset + *f_off = ffo_est*frame_parms->subcarrier_spacing; + + /*nr_rf_card_config_freq(&openair0_cfg[ue->rf_map.card], openair0_cfg->tx_freq[0], openair0_cfg->rx_freq[0], ue->common_vars.freq_offset); + + if (ue->mode != loop_through_memory) { + ue->rfdevice.trx_set_freq_func(&ue->rfdevice,&openair0_cfg[0],0); + }*/ + + LOG_I(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB, ffo %lf\n", + peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg),ffo_est); + + return peak_position_diff; +} diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index bb911195c7..fb36b3ee86 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -39,6 +39,7 @@ #include "PHY/phy_extern_nr_ue.h" #include "PHY/MODULATION/modulation_UE.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" +#include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "SCHED_NR_UE/defs.h" @@ -1647,10 +1648,12 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { + int peak_position_diff = nr_adjust_pss_synch(ue, (int *)&ue->common_vars.freq_offset); + LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); nr_ue_pbch_procedures(gNB_id, ue, proc, 0); - if (ue->no_timing_correction==0) { + /* if (ue->no_timing_correction==0) { LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction); nr_adjust_synch_ue(fp, ue, @@ -1659,7 +1662,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, nr_slot_rx, 0, 16384); - } + }*/ + + //ue->rx_offset = peak_position_diff; + + ue->rx_offset_diff = -peak_position_diff; LOG_D(PHY, "Doing N0 measurements in %s\n", __FUNCTION__); nr_ue_rrc_measurements(ue, proc, nr_slot_rx); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index abc64b6e46..c4b06c1139 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; + min_rxtxtime_pdsch = 6; ul_prbblacklist = "51,52,53,54" pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 83b39b85ec..c7531f39ba 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime_pdsch = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( From b7a27219ac32643d37f68dff35d6d7e511b5e52f Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 24 Dec 2021 12:24:35 +0000 Subject: [PATCH 224/883] Fix warnings after merge with develop --- .../conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- openair1/PHY/INIT/nr_init_ue.c | 11 +---------- openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 11 +++++------ .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index d6625ce521..d81a18a84b 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -20,23 +20,14 @@ */ #include "phy_init.h" -#include "SCHED_UE/sched_UE.h" #include "PHY/phy_extern_nr_ue.h" -//#include "SIMULATION/TOOLS/sim.h" -/*#include "RadioResourceConfigCommonSIB.h" -#include "RadioResourceConfigDedicated.h" -#include "TDD-Config.h" -#include "MBSFN-SubframeConfigList.h"*/ #include "openair1/PHY/defs_RU.h" #include "openair1/PHY/impl_defs_nr.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "assertions.h" -#include +#include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -//#include "PHY/LTE_REFSIG/lte_refsig.h" -#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h" -#include "PHY/INIT/phy_init.h" #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..66ed4593d8 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -44,15 +44,14 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, int16_t *d) { - uint32_t i; - uint8_t reset; - uint32_t x1, x2, s=0; + uint8_t reset = 1; + uint32_t x1 = 0; + uint32_t s = 0; - reset = 1; // x1 is set in lte_gold_generic - x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 + uint32_t x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 - for (i=0; i<32; i++) { + for (uint32_t i=0; i<32; i++) { if ((i&0x1f)==0) { s = lte_gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index d767f72013..76b45bda15 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -35,7 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; sib1_tda = 0; do_SRS = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 0d402536a9..5cea75e4f6 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,7 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; sib1_tda = 0; do_SRS = 1; From 29268d0a66c1a88a0058de066ce5968e9d8bfe3d Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Fri, 24 Dec 2021 13:12:30 +0000 Subject: [PATCH 225/883] Revert "Merge remote-tracking branch 'origin/develop' into ue-phy-sync-improvements" This reverts commit 96554bef5148f2610e2d0f4d72fe151a69b46d96 --- ci-scripts/Jenkinsfile-trig-nsa | 11 +- ci-scripts/checkCodingFormattingRules.sh | 4 +- ci-scripts/conf_files/benetel-5g.conf | 22 + .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 2 +- .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 29 + .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 29 + .../gnb.band261.tm1.32PRB.usrpn300.conf | 26 +- .../gnb.band66.tm1.106PRB.usrpn300.conf | 22 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 21 + ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 29 + .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 659 +++++++++--------- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 316 --------- .../gnb.band78.tm1.106PRB.usrpn300.conf | 24 +- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 21 + .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 28 + ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- .../fr1_nsa_2x2_quectel_attach_detach.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 6 +- ci-scripts/xml_files/fr1_sa_oaiue_x300.xml | 123 ---- .../xml_files/fr1_sa_quectel_162prb.xml | 129 ---- .../fr1_sa_quectel_stages_162prb.xml | 166 ----- cmake_targets/CMakeLists.txt | 10 +- common/utils/nr/nr_common.c | 54 +- common/utils/nr/nr_common.h | 11 +- common/utils/threadPool/Makefile | 14 +- common/utils/threadPool/thread-pool.c | 45 +- common/utils/threadPool/thread-pool.h | 5 +- doc/testing_gnb_w_cots_ue_resources/gnb.conf | 37 + executables/nr-gnb.c | 10 +- executables/nr-ue.c | 2 +- openair1/PHY/CODING/crc.h | 543 --------------- openair1/PHY/CODING/crc_byte.c | 86 +-- openair1/PHY/CODING/crcext.h | 89 --- openair1/PHY/CODING/nrLDPC_defs.h | 37 +- .../nrLDPC_encoder/ldpc_encode_parity_check.c | 15 +- .../PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c | 2 + .../nrLDPC_encoder/ldpc_encoder_optim.c | 25 +- .../nrLDPC_encoder/ldpc_encoder_optim8seg.c | 18 +- .../ldpc_encoder_optim8segmulti.c | 94 +-- openair1/PHY/CODING/types.h | 98 --- openair1/PHY/INIT/nr_init_ue.c | 2 +- openair1/PHY/INIT/nr_parms.c | 1 + openair1/PHY/LTE_REFSIG/lte_refsig.h | 3 +- openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c | 75 ++ openair1/PHY/LTE_TRANSPORT/lte_mcs.c | 22 +- openair1/PHY/LTE_TRANSPORT/pcfich.c | 2 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- .../LTE_TRANSPORT/transport_common_proto.h | 2 +- openair1/PHY/LTE_TRANSPORT/transport_proto.h | 46 +- openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 2 +- .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 54 +- .../LTE_UE_TRANSPORT/dlsch_llr_computation.c | 6 +- openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c | 4 +- .../PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 209 ++---- openair1/PHY/NR_TRANSPORT/nr_dlsch.h | 3 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 393 ++++++----- openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c | 5 + .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 46 +- .../nr_dlsch_llr_computation.c | 2 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 39 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 5 +- openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 4 +- openair1/PHY/defs_gNB.h | 17 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 5 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 27 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 29 +- openair1/SIMULATION/NR_PHY/dlsim.c | 45 +- openair1/SIMULATION/NR_PHY/nr_unitary_defs.h | 162 ++++- openair1/SIMULATION/NR_PHY/ulsim.c | 8 +- openair2/COMMON/rrc_messages_types.h | 2 +- openair2/GNB_APP/RRC_nr_paramsvalues.h | 194 ++++++ openair2/GNB_APP/gnb_config.c | 127 +--- openair2/GNB_APP/gnb_paramdef.h | 6 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 39 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 10 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 54 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 42 +- openair2/LAYER2/NR_MAC_gNB/main.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 6 +- openair2/RRC/NR/nr_rrc_config.c | 159 +++-- openair2/RRC/NR/nr_rrc_config.h | 25 +- openair2/RRC/NR/nr_rrc_defs.h | 2 +- openair2/RRC/NR/rrc_gNB.c | 77 +- openair2/RRC/NR/rrc_gNB_nsa.c | 4 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 16 +- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 22 + .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 23 + .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 21 + .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 22 + .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 21 + .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 21 + .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 21 + .../gnb.band78.106PRB.30kHz,usrpb2x0.conf | 21 + .../CONF/gnb.band78.106PRB.slave.conf | 21 + .../CONF/gnb.band78.slave.conf | 21 + .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 23 + .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 21 + .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 22 + .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 23 + .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 21 + .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 21 + .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 23 + .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 23 + .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 23 + .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 21 + .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 39 ++ .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 21 + .../CONF/testing_gnb_24PRB.conf | 36 + .../CONF/testing_gnb_n310.conf | 21 + .../CONF/testing_gnb_nsa_n310.conf | 21 + .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 39 ++ ...b.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 38 + .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 22 + ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 22 + .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 22 + ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 39 ++ 120 files changed, 2798 insertions(+), 2816 deletions(-) delete mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf delete mode 100644 ci-scripts/xml_files/fr1_sa_oaiue_x300.xml delete mode 100644 ci-scripts/xml_files/fr1_sa_quectel_162prb.xml delete mode 100644 ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml delete mode 100644 openair1/PHY/CODING/crc.h delete mode 100644 openair1/PHY/CODING/crcext.h delete mode 100644 openair1/PHY/CODING/types.h create mode 100644 openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 7b4238d678..4a56270e90 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -88,15 +88,7 @@ pipeline { // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) //] //calling OAIUE N310 - //build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ - // string(name: 'eNB_MR', value: String.valueOf(MR)), - // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), - // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), - // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), - // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) - //] - //calling OAIUE N310-X300 - build job: "RAN-SA-OAIUE-N310-X300-CN5G", wait : true, propagate : false, parameters: [ + build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), @@ -104,6 +96,7 @@ pipeline { booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) ] + } } } diff --git a/ci-scripts/checkCodingFormattingRules.sh b/ci-scripts/checkCodingFormattingRules.sh index a805f765df..45cf08aa9a 100755 --- a/ci-scripts/checkCodingFormattingRules.sh +++ b/ci-scripts/checkCodingFormattingRules.sh @@ -77,7 +77,7 @@ then IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE || true` IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FILE || true` - IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true` + IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] @@ -198,7 +198,7 @@ do IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE || true` IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FULLFILE || true` - IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true` + IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 79b2f7f877..47898aad15 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -110,6 +119,19 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; #p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index 758bb44879..d2e91fb872 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index d1d32e2b58..6c8d5ba6f0 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 77693d5f72..9bf3136690 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -89,6 +89,19 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -143,6 +156,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index c9b369eaff..dfbbdf659d 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -86,6 +86,19 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 10; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -140,6 +153,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index 4338c00b36..e93177e7cc 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { @@ -55,6 +55,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 14; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 1c2133bebe..850cf9a60c 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -24,7 +24,6 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; servingCellConfigCommon = ( { @@ -55,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -110,6 +118,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b0a757c9d0..c8dc1477b0 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -55,6 +55,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 16456f939c..e8be5a6ef0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -90,6 +90,19 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -144,6 +157,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..f00a343089 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -1,316 +1,343 @@ -Active_gNBs = ( "gNB-OAI"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -gNBs = -( - { - ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - - gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - - plmn_list = ({ - mcc = 208; - mnc = 97; - mnc_length = 2; - snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); - - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 11; - searchSpaceZero = 0; - } - ); - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; - #scs-SpecificCarrierList - dl_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; - #initialDownlinkBWP - #genericParameters - # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; - initialDLBWPsearchSpaceZero = 0; - - - - #uplinkConfigCommon - #frequencyInfoUL - ul_frequencyBand = 78; - #scs-SpecificCarrierList - ul_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; - pMax = 20; - #initialUplinkBWP - #genericParameters - initialULBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; - #rach-ConfigCommon - #rach-ConfigGeneric - prach_ConfigurationIndex = 98; -#prach_msg1_FDM -#0 = one, 1=two, 2=four, 3=eight - prach_msg1_FDM = 0; - prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; -#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 = 3; -#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; - }; - - ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); - -MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } -); - -L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 4; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 75; - eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } -); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - -security = { - # preferred ciphering algorithms - # the first one of the list that an UE supports in chosen - # valid values: nea0, nea1, nea2, nea3 - ciphering_algorithms = ( "nea0" ); - - # preferred integrity algorithms - # the first one of the list that an UE supports in chosen - # valid values: nia0, nia1, nia2, nia3 - integrity_algorithms = ( "nia2", "nia0" ); - - # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter - # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' - drb_ciphering = "yes"; - drb_integrity = "no"; -}; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + min_rxtxtime_pdsch = 6; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 2; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf deleted file mode 100644 index ff05aa6e65..0000000000 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ /dev/null @@ -1,316 +0,0 @@ -Active_gNBs = ( "gNB-OAI"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -gNBs = -( - { - ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - - gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - - plmn_list = ({ - mcc = 208; - mnc = 97; - mnc_length = 2; - snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); - - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 11; - searchSpaceZero = 0; - } - ); - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; - #scs-SpecificCarrierList - dl_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; - #initialDownlinkBWP - #genericParameters - # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; - initialDLBWPsearchSpaceZero = 0; - - - - #uplinkConfigCommon - #frequencyInfoUL - ul_frequencyBand = 78; - #scs-SpecificCarrierList - ul_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; - pMax = 20; - #initialUplinkBWP - #genericParameters - initialULBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; - #rach-ConfigCommon - #rach-ConfigGeneric - prach_ConfigurationIndex = 98; -#prach_msg1_FDM -#0 = one, 1=two, 2=four, 3=eight - prach_msg1_FDM = 0; - prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; -#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 = 3; -#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; - }; - - ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); - -MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } -); - -L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 4; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 75; - eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } -); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - -security = { - # preferred ciphering algorithms - # the first one of the list that an UE supports in chosen - # valid values: nea0, nea1, nea2, nea3 - ciphering_algorithms = ( "nea0" ); - - # preferred integrity algorithms - # the first one of the list that an UE supports in chosen - # valid values: nia0, nia1, nia2, nia3 - integrity_algorithms = ( "nia2", "nia0" ); - - # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter - # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' - drb_ciphering = "yes"; - drb_integrity = "no"; -}; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6ade355053..4200300c50 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime = 6; + min_rxtxtime_pdsch = 6; servingCellConfigCommon = ( { @@ -55,6 +55,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 38; # this is SS=10 L=3 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index b7a04b1f36..015d9ee0d0 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -52,6 +52,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -106,6 +115,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 299a19cc4e..e6bbbf2d41 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -53,6 +53,19 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0;#for DL slot + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0;#for mixed slot + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -107,6 +120,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 2516af9429..86af12b53e 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -24,7 +24,7 @@ TEST-NSA-FR1-TM2-Tab1 NSA 2x2 Ping DL UL with QUECTEL tasks - 1 + 5 030000 040000 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 52cf1ec6e8..2d17ff38e2 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -24,7 +24,7 @@ TEST-NSA-FR1-TM2-Tab2 NSA 2x2 Attach-Detach with QUECTEL tasks - 1 + 5 031000 041000 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index cd79e49f2c..28eee1e224 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -22,7 +22,7 @@ --> TEST-SA-FR1-Tab1 - SA Ping DL UL with OAI NR UE (N310) + SA Ping DL UL with OAI NR UE tasks 1 @@ -40,9 +40,9 @@ Initialize_OAI_UE - Initialize OAI UE (N310) + Initialize OAI UE nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml deleted file mode 100644 index d527737b3c..0000000000 --- a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - TEST-SA-FR1-Tab2 - SA Ping DL UL with OAI NR UE (X300) - tasks - 1 - - 040000 - 000002 - 010000 - 000002 - 050000 - 050001 - 000001 - 010002 - 080000 - - - - - Initialize_OAI_UE - Initialize OAI UE (X300) - nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "addr=192.168.60.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation - - - - Terminate_OAI_UE - Terminate OAI UE - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 - 0 - 0 - nr - yes - yes - 192.168.18.240 - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping from CN to UE: 20pings in 20sec - -c 20 - 5 - - - - Ping - Ping from CN to UE: 100pings in 20sec - -c 100 -i 0.2 - 5 - - - - Iperf - iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) - -u -b 60M -t 60 - DL - nrmodule2_quectel - 5 - single-ue - - - - Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 - UL - nrmodule2_quectel - 5 - single-ue - - - - - Terminate_eNB - Terminate gNB - 0 - 0 - nr - - - - diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml deleted file mode 100644 index 2088678707..0000000000 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - TEST-SA-FR1-Tab3 - SA Ping DL UL with QUECTEL - tasks - 1 - - 040000 - 000002 - 010000 - 000001 - 050000 - 050001 - 070000 - 070001 - 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 - 0 - 0 - nr - yes - yes - 192.168.18.240 - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping: 20pings in 20sec - nrmodule2_quectel - -c 20 - 5 - - - - Ping - Ping: 100pings in 20sec - nrmodule2_quectel - -c 100 -i 0,2 - 5 - - - - Iperf - iperf (DL/140Mbps/UDP)(60 sec)(single-ue profile) - -u -b 140M -t 60 - DL - nrmodule2_quectel - 5 - single-ue - - - - Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 - UL - nrmodule2_quectel - 5 - single-ue - - - - - Terminate_eNB - Terminate gNB - 0 - 0 - nr - - - - 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 4b2400a4ac..0000000000 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml +++ /dev/null @@ -1,166 +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 - 0 - 0 - nr - yes - yes - 192.168.18.240 - - - - 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 - - - - diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f513ac0563..329ed7bb3d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1,4 +1,4 @@ -#/* +#/* # * 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. @@ -308,7 +308,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(COMPILATION_AVX2 "False") endif() if (CPUINFO MATCHES "sse4_1") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mpclmul") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") endif() if (CPUINFO MATCHES "ssse3") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3") @@ -889,7 +889,7 @@ set(HWLIB_BENETEL_4G_SOURCE ) add_library(benetel_4g MODULE ${HWLIB_BENETEL_4G_SOURCE} ) -set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") +set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") TARGET_LINK_LIBRARIES(benetel_4g ${DPDK_LIBS}) @@ -907,7 +907,7 @@ set(HWLIB_BENETEL_5G_SOURCE ) add_library(benetel_5g MODULE ${HWLIB_BENETEL_5G_SOURCE} ) -set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") +set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") TARGET_LINK_LIBRARIES(benetel_5g ${DPDK_LIBS}) @@ -993,6 +993,7 @@ add_boolean_option(TRACE_RLC_AM_HOLE False "TRACE for RLC AM, TO BE CHANGE add_boolean_option(TRACE_RLC_AM_PDU False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_RESEGMENT False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_RX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") +add_boolean_option(TRACE_RLC_AM_RX_DECODE False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_TX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_TX_STATUS False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_STATUS_CREATION False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") @@ -1571,6 +1572,7 @@ set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c + ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_gold_generic.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/srs_modulation.c ${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 0de24bcf6d..a704a66c76 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -257,48 +257,6 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) { *n_rb = 6*count; } -int get_nb_periods_per_frame(uint8_t tdd_period) { - - int nb_periods_per_frame; - switch(tdd_period) { - case 0: - nb_periods_per_frame = 20; // 10ms/0p5ms - break; - - case 1: - nb_periods_per_frame = 16; // 10ms/0p625ms - break; - - case 2: - nb_periods_per_frame = 10; // 10ms/1ms - break; - - case 3: - nb_periods_per_frame = 8; // 10ms/1p25ms - break; - - case 4: - nb_periods_per_frame = 5; // 10ms/2ms - break; - - case 5: - nb_periods_per_frame = 4; // 10ms/2p5ms - break; - - case 6: - nb_periods_per_frame = 2; // 10ms/5ms - break; - - case 7: - nb_periods_per_frame = 1; // 10ms/10ms - break; - - default: - AssertFatal(1==0,"Undefined tdd period %d\n", tdd_period); - } - return nb_periods_per_frame; -} - int get_dmrs_port(int nl, uint16_t dmrs_ports) { @@ -318,6 +276,14 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) { return p; } +int get_num_dmrs(uint16_t dmrs_mask ) { + + int num_dmrs=0; + + for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); + return(num_dmrs); +} + lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index) { lte_frame_type_t current_type; @@ -506,10 +472,6 @@ int get_subband_size(int NPRB,int size) { } -int get_SLIV(uint8_t S, uint8_t L) { - return ( (uint16_t)(((L-1)<=7)? (14*(L-1)+S) : (14*(15-L)+(13-S))) ); -} - void SLIV2SL(int SLIV,int *S,int *L) { int SLIVdiv14 = SLIV/14; diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 44a6e05577..d9f2b0c03a 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -50,17 +50,9 @@ typedef struct nr_bandentry_s { extern const size_t nr_bandtable_size; extern nr_bandentry_t nr_bandtable[]; -static inline int get_num_dmrs(uint16_t dmrs_mask ) { - int num_dmrs=0; - - for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); - return(num_dmrs); -} - - -int get_SLIV(uint8_t S, uint8_t L); void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset); +int get_num_dmrs(uint16_t dmrs_mask); uint16_t config_bandwidth(int mu, int nb_rb, int nr_band); int get_nr_table_idx(int nr_bandP, uint8_t scs_index); int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index); @@ -79,7 +71,6 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); int get_dmrs_port(int nl, uint16_t dmrs_ports); -int get_nb_periods_per_frame(uint8_t tdd_period); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/common/utils/threadPool/Makefile b/common/utils/threadPool/Makefile index 729f9dd0e2..6b28eb2ba8 100644 --- a/common/utils/threadPool/Makefile +++ b/common/utils/threadPool/Makefile @@ -1,3 +1,13 @@ -thread-pool-test: thread-pool.c thread-pool.h - gcc -g -O3 thread-pool.c -I ${OPENAIR_DIR}/nfapi/open-nFAPI/nfapi/public_inc -I ${OPENAIR_DIR}/ -I ${OPENAIR_DIR}/common/utils/ -I. ${OPENAIR_DIR}/common/utils/backtrace.c -I ${OPENAIR_DIR}/openair2/COMMON ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/config/config_userapi.c ${OPENAIR_DIR}/common/config/config_load_configmodule.c ${OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -DMAX_NUM_CCs=1 -I../LOG -I../../utils/T -o thread-pool-test +all: +measurement_display thread-pool-test + +measurement_display: +measurement_display.c thread-pool.h +gcc measurement_display.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o +measurement_display + +thread-pool-test: +thread-pool.c thread-pool.h +gcc -g thread-pool.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -I $ {OPENAIR_DIR}/openair2/COMMON $ {OPENAIR_DIR}/common/utils/LOG/log.c $ {OPENAIR_DIR}/common/config/config_userapi.c +$ {OPENAIR_DIR}/common/config/config_load_configmodule.c $ {OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test diff --git a/common/utils/threadPool/thread-pool.c b/common/utils/threadPool/thread-pool.c index fff09528a8..77729ae7a7 100644 --- a/common/utils/threadPool/thread-pool.c +++ b/common/utils/threadPool/thread-pool.c @@ -155,24 +155,21 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name } #ifdef TEST_THREAD_POOL -volatile int oai_exit=0; void exit_function(const char *file, const char *function, const int line, const char *s) { } struct testData { int id; - int sleepTime; char txt[30]; }; void processing(void *arg) { struct testData *in=(struct testData *)arg; - //printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); + printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); sprintf(in->txt,"Done by %ld, job %d", pthread_self(), in->id); - in->sleepTime=rand()%1000; - usleep(in->sleepTime); - //printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); + usleep(rand()%100); + printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); } int main() { @@ -211,43 +208,11 @@ int main() { } while(tmp); tpool_t pool; - char params[]="1,2,3,4,5"; + char params[]="1,2,3,u"; initTpool(params,&pool, true); notifiedFIFO_t worker_back; initNotifiedFIFO(&worker_back); - sleep(1); - int cumulProcessTime=0, cumulTime=0; - struct timespec st,end; - clock_gettime(CLOCK_MONOTONIC, &st); - int nb_jobs=4; - for (int i=0; i <1000 ; i++) { - int parall=nb_jobs; - for (int j=0; j id=i; - pushTpool(&pool, work); - } - int sleepmax=0; - while (parall) { - tmp=pullTpool(&worker_back,&pool); - if (tmp) { - parall--; - struct testData *dd=NotifiedFifoData(tmp); - if (dd->sleepTime > sleepmax) - sleepmax=dd->sleepTime; - delNotifiedFIFO_elt(tmp); - } - } - cumulProcessTime+=sleepmax; - } - clock_gettime(CLOCK_MONOTONIC, &end); - long long dur=(end.tv_sec-st.tv_sec)*1000*1000+(end.tv_nsec-st.tv_nsec)/1000; - printf("In µs, Total time per group of %d job:%lld, work time per job %d, overhead per job %lld\n", - nb_jobs, dur/1000, cumulProcessTime/1000, (dur-cumulProcessTime)/(1000*nb_jobs)); - - /* for (int i=0; i <1000 ; i++) { notifiedFIFO_elt_t *work=newNotifiedFIFO_elt(sizeof(struct testData), i, &worker_back, processing); struct testData *x=(struct testData *)NotifiedFifoData(work); @@ -267,7 +232,7 @@ int main() { abortTpool(&pool,510); } while(tmp); - */ + return 0; } #endif diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index 1839b42f39..a32b7c3859 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -31,7 +31,6 @@ #include #include #include -//#include #ifdef DEBUG #define THREADINIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP @@ -51,7 +50,7 @@ AssertFatal(ret==0,"ret=%d\n",ret);} #define condbroadcast(signal) {int ret=pthread_cond_broadcast(&signal); \ AssertFatal(ret==0,"ret=%d\n",ret);} -#define condsignal(signal) {int ret=pthread_cond_signal(&signal); \ +#define condsignal(signal) {int ret=pthread_cond_broadcast(&signal); \ AssertFatal(ret==0,"ret=%d\n",ret);} #define tpool_nbthreads(tpool) (tpool.nbThreads) typedef struct notifiedFIFO_elt_s { @@ -131,7 +130,7 @@ static inline void pushNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf, notifiedFIF static inline void pushNotifiedFIFO(notifiedFIFO_t *nf, notifiedFIFO_elt_t *msg) { mutexlock(nf->lockF); pushNotifiedFIFO_nothreadSafe(nf,msg); - condsignal(nf->notifF); + condbroadcast(nf->notifF); mutexunlock(nf->lockF); } diff --git a/doc/testing_gnb_w_cots_ue_resources/gnb.conf b/doc/testing_gnb_w_cots_ue_resources/gnb.conf index aae22a92ba..97935f92ee 100755 --- a/doc/testing_gnb_w_cots_ue_resources/gnb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/gnb.conf @@ -53,7 +53,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57) + initialDLBWPstartSymbolAndLength_3 = 57; //43; //57; #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -107,6 +129,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index dc8960846f..e9fc06ce4a 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -401,15 +401,15 @@ void init_gNB_Tpool(int inst) { LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); int threadCnt = min(numCPU, gNB->pusch_proc_threads); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); - char pool[80]; - sprintf(pool,"-1"); + char ul_pool[80]; + sprintf(ul_pool,"-1"); int s_offset = 0; for (int icpu=1; icputhreadPool, false); + if (getenv("noThreads")) strcpy(ul_pool, "n"); + initTpool(ul_pool, gNB->threadPool, false); // ULSCH decoder result FIFO gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->respDecode); diff --git a/executables/nr-ue.c b/executables/nr-ue.c index c4d8145c44..c90a5119cd 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -786,7 +786,7 @@ void init_NR_UE_threads(int nb_inst) { /* HACK: this function is needed to compile the UE * fix it somehow */ -int find_dlsch(uint16_t rnti, +int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB, find_type_t type) { diff --git a/openair1/PHY/CODING/crc.h b/openair1/PHY/CODING/crc.h deleted file mode 100644 index d6474eae9b..0000000000 --- a/openair1/PHY/CODING/crc.h +++ /dev/null @@ -1,543 +0,0 @@ -/******************************************************************************* - Copyright (c) 2009-2018, Intel Corporation - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ - -/** - * Header file for module with CRC computation methods - * - * PCLMULQDQ implementation is based on work by: - * Erdinc Ozturk - * Vinodh Gopal - * James Guilford - * - * "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction" - * URL: http://download.intel.com/design/intarch/papers/323102.pdf - */ - -#ifndef __CRC_H__ -#define __CRC_H__ - -#include - -#include "crcext.h" -#include "types.h" -#include -#include - -/** - * PCLMULQDQ CRC computation context structure - */ -struct crc_pclmulqdq_ctx { - /** - * K1 = reminder X^128 / P(X) : 0-63 - * K2 = reminder X^192 / P(X) : 64-127 - */ - uint64_t k1; - uint64_t k2; - - /** - * K3 = reminder X^64 / P(X) : 0-63 - * q = quotient X^64 / P(X) : 64-127 - */ - uint64_t k3; - uint64_t q; - - /** - * p = polynomial / P(X) : 0-63 - * res = reserved : 64-127 - */ - uint64_t p; - uint64_t res; -}; - -/** - * Functions and prototypes - */ - -/** - * @brief Initializes look-up-table (LUT) for given 8 bit polynomial - * - * @param poly CRC polynomial - * @param lut pointer to look-up-table to be initialized - */ -void crc8_init_lut(const uint8_t poly, uint8_t *lut); - -/** - * @brief Calculates 8 bit CRC using LUT method. - * - * @param crc CRC initial value - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param lut 256x8bits look-up-table pointer - * - * @return New CRC value - */ -__forceinline -uint8_t crc8_calc_lut(const uint8_t *data, - uint32_t data_len, - uint8_t crc, - const uint8_t *lut) -{ - if (unlikely(data == NULL || lut == NULL)) - return crc; - - while (data_len--) - crc = lut[*data++ ^ crc]; - - return crc; -} - -/** - * @brief Initializes look-up-table (LUT) for given 16 bit polynomial - * - * @param poly CRC polynomial - * @param lut pointer to 256x16bits look-up-table to be initialized - */ -void crc16_init_lut(const uint16_t poly, uint16_t *lut); - -/** - * @brief Calculates 16 bit CRC using LUT method. - * - * @param crc CRC initial value - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param lut 256x16bits look-up-table pointer - * - * @return New CRC value - */ -__forceinline -uint16_t crc16_calc_lut(const uint8_t *data, - uint32_t data_len, - uint16_t crc, - const uint16_t *lut) -{ - if (unlikely(data == NULL || lut == NULL)) - return crc; - - while (data_len--) - crc = lut[(crc >> 8) ^ *data++] ^ (crc << 8); - - return crc; -} - -/** - * @brief Initializes look-up-table (LUT) for given 32 bit polynomial - * - * @param poly CRC polynomial - * @param lut pointer to 256x32bits look-up-table to be initialized - */ -void crc32_init_lut(const uint32_t poly, uint32_t *lut); - -/** - * @brief Calculates 32 bit CRC using LUT method. - * - * @param crc CRC initial value - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param lut 256x32bits look-up-table pointer - * - * @return New CRC value - */ -__forceinline -uint32_t crc32_calc_lut(const uint8_t *data, - uint32_t data_len, - uint32_t crc, - const uint32_t *lut) -{ - if (unlikely(data == NULL || lut == NULL)) - return crc; - - while (data_len--) - crc = lut[(crc >> 24) ^ *data++] ^ (crc << 8); - - return crc; -} - -/** - * @brief Initializes look up tables for slice-By-2 method. - * - * @param poly CRC polynomial - * @param slice1 slice-by-2 look-up-table 1 - * @param slice2 slice-by-2 look-up-table 2 - * - * @return New CRC value - */ -void crc16_init_slice2(const uint16_t poly, - uint16_t *slice1, - uint16_t *slice2); - -/** - * @brief Calculates 16 bit CRC using Slice-By-2 method. - * - * @param crc CRC initial value - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param slice1 256x16bits slice look-up-table 1 - * @param slice2 256x16bits slice look-up-table 2 - * - * @return New CRC value - */ -__forceinline -uint16_t crc16_calc_slice2(const uint8_t *data, - uint32_t data_len, - uint16_t crc, - const uint16_t *slice1, - const uint16_t *slice2) -{ - uint_fast32_t i; - - if (unlikely(data == NULL)) - return crc; - - if (unlikely(slice1 == NULL || slice2 == NULL)) - return crc; - - crc = bswap2(crc); - for (i = (data_len & (~1)), data += (data_len & (~1)); i != 0; - i -= sizeof(uint16_t)) { - crc ^= (*((const uint16_t *)(data - i))); - crc = slice2[(uint8_t)crc] ^ slice1[(uint8_t)(crc >> 8)]; - } - crc = bswap2(crc); - if (data_len & 1) - crc = (crc << 8) ^ bswap2(slice1[(crc >> 8) ^ *data]); - - return crc; -} - -/** - * @brief Initializes look up tables for slice-By-4 method. - * - * @param poly CRC polynomial - * @param slice1 256x32bits slice look-up-table 1 - * @param slice2 256x32bits slice look-up-table 2 - * @param slice3 256x32bits slice look-up-table 3 - * @param slice4 256x32bits slice look-up-table 4 - * - * @return New CRC value - */ -void crc32_init_slice4(const uint32_t poly, - uint32_t *slice1, uint32_t *slice2, - uint32_t *slice3, uint32_t *slice4); - -/** - * @brief Calculates 32 bit CRC using Slice-By-4 method. - * - * @param data pointer to data block to calculate CRC for - * @param data_len size of data block - * @param crc CRC initial value - * @param slice1 256x32bits slice look-up-table 1 - * @param slice2 256x32bits slice look-up-table 2 - * @param slice3 256x32bits slice look-up-table 3 - * @param slice4 256x32bits slice look-up-table 4 - * - * @return New CRC value - */ -__forceinline -uint32_t crc32_calc_slice4(const uint8_t *data, - uint32_t data_len, uint32_t crc, - const uint32_t *slice1, const uint32_t *slice2, - const uint32_t *slice3, const uint32_t *slice4) -{ - uint_fast32_t i; - - if (unlikely(data == NULL)) - return crc; - - if (unlikely(slice1 == NULL || slice2 == NULL || - slice3 == NULL || slice4 == NULL)) - return crc; - - crc = bswap4(crc); - for (i = data_len & (~3), data += (data_len & (~3)); i != 0; - i -= sizeof(uint32_t)) { - crc ^= (*((const uint32_t *)(data - i))); - crc = slice4[(uint8_t)(crc)] ^ - slice3[(uint8_t)(crc >> 8)] ^ - slice2[(uint8_t)(crc >> 16)] ^ - slice1[(uint8_t)(crc >> 24)]; - } - crc = bswap4(crc); - for (i = data_len & 3, data += (data_len & 3); i != 0; i--) - crc = (crc << 8) ^ - bswap4(slice1[(crc >> 24) ^ *(data - i)]); - - return crc; -} - -/** - * @brief Performs one folding round - * - * Logically function operates as follows: - * DATA = READ_NEXT_16BYTES(); - * F1 = LSB8(FOLD) - * F2 = MSB8(FOLD) - * T1 = CLMUL( F1, K1 ) - * T2 = CLMUL( F2, K2 ) - * FOLD = XOR( T1, T2, DATA ) - * - * @param data_block 16 byte data block - * @param k1_k2 k1 and k2 constanst enclosed in XMM register - * @param fold running 16 byte folded data - * - * @return New 16 byte folded data - */ -__forceinline -__m128i crc32_folding_round(const __m128i data_block, - const __m128i k1_k2, - const __m128i fold) -{ - __m128i tmp = _mm_clmulepi64_si128(fold, k1_k2, 0x11); - - return _mm_xor_si128(_mm_clmulepi64_si128(fold, k1_k2, 0x00), - _mm_xor_si128(data_block, tmp)); -} - -/** - * @brief Performs Barret's reduction from 128 bits to 64 bits - * - * @param data128 128 bits data to be reduced - * @param k3_q k3 and Q constants enclosed in XMM register - * - * @return data reduced to 64 bits - */ -__forceinline -__m128i crc32_reduce_128_to_64(__m128i data128, const __m128i k3_q) -{ - __m128i tmp; - - tmp = _mm_xor_si128(_mm_clmulepi64_si128(data128, k3_q, 0x01 /* k3 */), - data128); - - data128 = _mm_xor_si128(_mm_clmulepi64_si128(tmp, k3_q, 0x01 /* k3 */), - data128); - - return _mm_srli_si128(_mm_slli_si128(data128, 8), 8); -} - -/** - * @brief Performs Barret's reduction from 64 bits to 32 bits - * - * @param data64 64 bits data to be reduced - * @param k3_q k3 and Q constants enclosed in XMM register - * @param p_res P constant enclosed in XMM register - * - * @return data reduced to 32 bits - */ -__forceinline -uint32_t -crc32_reduce_64_to_32(__m128i fold, const __m128i k3_q, const __m128i p_res) -{ - __m128i temp; - - temp = _mm_clmulepi64_si128(_mm_srli_si128(fold, 4), - k3_q, 0x10 /* Q */); - temp = _mm_srli_si128(_mm_xor_si128(temp, fold), 4); - temp = _mm_clmulepi64_si128(temp, p_res, 0 /* P */); - return _mm_extract_epi32(_mm_xor_si128(temp, fold), 0); -} - -/** - * @brief Calculates 32 bit CRC for given \a data block by applying folding and - * reduction methods. - * - * Algorithm operates on 32 bit CRCs so polynomials and initial values may - * need to be promoted to 32 bits where required. - * - * @param crc initial CRC value (32 bit value) - * @param data pointer to data block - * @param data_len length of \a data block in bytes - * @param params pointer to PCLMULQDQ CRC calculation context - * - * @return CRC for given \a data block (32 bits wide). - */ -__forceinline -uint32_t -crc32_calc_pclmulqdq(const uint8_t *data, - uint32_t data_len, uint32_t crc, - const struct crc_pclmulqdq_ctx *params) -{ - __m128i temp, fold, k, swap; - uint32_t n; - - if (unlikely(data == NULL || data_len == 0 || params == NULL)) - return crc; - -#ifdef __KERNEL__ - /** - * Preserve FPU context - */ - kernel_fpu_begin(); -#endif - - /** - * Add 4 bytes to data block size - * This is to secure the following: - * CRC32 = M(X)^32 mod P(X) - * M(X) - message to compute CRC on - * P(X) - CRC polynomial - */ - data_len += 4; - - /** - * Load first 16 data bytes in \a fold and - * set \a swap BE<->LE 16 byte conversion variable - */ - fold = _mm_loadu_si128((__m128i *)data); - swap = crc_xmm_be_le_swap128; - - /** - * ------------------------------------------------- - * Folding all data into single 16 byte data block - * Assumes: \a fold holds first 16 bytes of data - */ - - if (unlikely(data_len <= 16)) { - /** - * Data block fits into 16 byte block - * - adjust data block - * - 4 least significant bytes need to be zero - */ - fold = _mm_shuffle_epi8(fold, swap); - fold = _mm_slli_si128(xmm_shift_right(fold, 20 - data_len), 4); - - /** - * Apply CRC init value - */ - temp = _mm_insert_epi32(_mm_setzero_si128(), bswap4(crc), 0); - temp = xmm_shift_left(temp, data_len - 4); - fold = _mm_xor_si128(fold, temp); - } else { - /** - * There are 2x16 data blocks or more - */ - __m128i next_data; - - /** - * n = number of bytes required to align \a data_len - * to multiple of 16 - */ - n = ((~data_len) + 1) & 15; - - /** - * Apply CRC initial value and - * get \a fold to BE format - */ - fold = _mm_xor_si128(fold, - _mm_insert_epi32(_mm_setzero_si128(), - crc, 0)); - fold = _mm_shuffle_epi8(fold, swap); - - /** - * Load next 16 bytes of data and - * adjust \a fold & \a next_data as follows: - * - * CONCAT(fold,next_data) >> (n*8) - */ - next_data = _mm_loadu_si128((__m128i *)&data[16]); - next_data = _mm_shuffle_epi8(next_data, swap); - next_data = _mm_or_si128(xmm_shift_right(next_data, n), - xmm_shift_left(fold, 16 - n)); - fold = xmm_shift_right(fold, n); - - if (unlikely(data_len <= 32)) - /** - * In such unlikely case clear 4 least significant bytes - */ - next_data = - _mm_slli_si128(_mm_srli_si128(next_data, 4), 4); - - /** - * Do the initial folding round on 2 first 16 byte chunks - */ - k = _mm_load_si128((__m128i *)(¶ms->k1)); - fold = crc32_folding_round(next_data, k, fold); - - if (likely(data_len > 32)) { - /** - * \a data_block needs to be at least 48 bytes long - * in order to get here - */ - __m128i new_data; - - /** - * Main folding loop - * - n is adjusted to point to next 16 data block - * to read - * (16+16) = 2x16; represents 2 first data blocks - * processed above - * (- n) is the number of zero bytes padded to - * the message in order to align it to 16 bytes - * - the last 16 bytes is processed separately - */ - for (n = 16 + 16 - n; n < (data_len - 16); n += 16) { - new_data = _mm_loadu_si128((__m128i *)&data[n]); - new_data = _mm_shuffle_epi8(new_data, swap); - fold = crc32_folding_round(new_data, k, fold); - } - - /** - * The last folding round works always on 12 bytes - * (12 bytes of data and 4 zero bytes) - * Read from offset -4 is to avoid one - * shift right operation. - */ - new_data = _mm_loadu_si128((__m128i *)&data[n - 4]); - new_data = _mm_shuffle_epi8(new_data, swap); - new_data = _mm_slli_si128(new_data, 4); - fold = crc32_folding_round(new_data, k, fold); - } /* if (data_len > 32) */ - } - - /** - * ------------------------------------------------- - * Reduction 128 -> 32 - * Assumes: \a fold holds 128bit folded data - */ - - /** - * REDUCTION 128 -> 64 - */ - k = _mm_load_si128((__m128i *)(¶ms->k3)); - fold = crc32_reduce_128_to_64(fold, k); - - /** - * REDUCTION 64 -> 32 - */ - n = crc32_reduce_64_to_32(fold, k, - _mm_load_si128((__m128i *)(¶ms->p))); - -#ifdef __KERNEL__ - /** - * - restore FPU context - */ - kernel_fpu_end(); -#endif - - return n; -} - -#endif /* __CRC_H__ */ diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index d1c3917c2c..287cbcd1f4 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -30,17 +30,10 @@ Modified in June, 2001, to include the length non multiple of 8 */ -#ifndef __SSE4_1__ -#define USE_INTEL_CRC 0 -#else -#define USE_INTEL_CRC __SSE4_1__ -#endif #include "coding_defs.h" #include "assertions.h" -#if USE_INTEL_CRC -#include "crc.h" -#endif + /*ref 36-212 v8.6.0 , pp 8-9 */ /* the highest degree is set by default */ @@ -101,28 +94,6 @@ static unsigned short crc11Table[256]; static unsigned char crc8Table[256]; static unsigned char crc6Table[256]; -#if USE_INTEL_CRC -static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq, 16) = { - 0x64e4d700, /**< k1 */ - 0x2c8c9d00, /**< k2 */ - 0xd9fe8c00, /**< k3 */ - 0xf845fe24, /**< q */ - 0x864cfb00, /**< p */ - 0ULL /**< res */ -}; -__m128i crc_xmm_be_le_swap128; - -DECLARE_ALIGNED(const uint8_t crc_xmm_shift_tab[48], 16) = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -}; - -#endif - void crcTableInit (void) { unsigned char c = 0; @@ -137,29 +108,23 @@ void crcTableInit (void) crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24); crc6Table[c] = (unsigned char) (crcbit (&c, 1, poly6) >> 24); } while (++c); -#if USE_INTEL_CRC - crc_xmm_be_le_swap128 = _mm_setr_epi32(0x0c0d0e0f, 0x08090a0b, - 0x04050607, 0x00010203); - -#endif } /********************************************************* -Byte by byte LUT implementations, +Byte by byte implementations, assuming initial byte is 0 padded (in MSB) if necessary -can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants -*********************************************************/ +*********************************************************/ unsigned int crc24a (unsigned char * inptr, int bitlen) { - int octetlen = bitlen / 8; /* Change in octets */ - if ( bitlen % 8 || !USE_INTEL_CRC ) { - unsigned int crc = 0; - int resbit= (bitlen % 8); - + int octetlen, resbit; + unsigned int crc = 0; + octetlen = bitlen / 8; /* Change in octets */ + resbit = (bitlen % 8); + while (octetlen-- > 0) { // printf("crc24a: in %x => crc %x\n",crc,*inptr); crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; @@ -167,35 +132,17 @@ unsigned int crc24a (unsigned char * inptr, if (resbit > 0) crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; - return crc; - } - #if USE_INTEL_CRC - else { - return crc32_calc_pclmulqdq(inptr, octetlen, 0, - <e_crc24a_pclmulqdq); - } - #endif + return crc; } -#if USE_INTEL_CRC -static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = { - 0x80140500, /**< k1 */ - 0x42000100, /**< k2 */ - 0x90042100, /**< k3 */ - 0xffff83ff, /**< q */ - 0x80006300, /**< p */ - 0ULL /**< res */ -}; -#endif unsigned int crc24b (unsigned char * inptr, - int bitlen) + int bitlen) { - int octetlen = bitlen / 8; /* Change in octets */ - - if ( bitlen % 8 || !USE_INTEL_CRC ) { + int octetlen, resbit; unsigned int crc = 0; - int resbit = (bitlen % 8); + octetlen = bitlen / 8; /* Change in octets */ + resbit = (bitlen % 8); while (octetlen-- > 0) { // printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]); @@ -206,13 +153,6 @@ unsigned int crc24b (unsigned char * inptr, crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; return crc; - } -#if USE_INTEL_CRC - else { - return crc32_calc_pclmulqdq(inptr, octetlen, 0, - <e_crc24b_pclmulqdq); - } -#endif } unsigned int crc24c (unsigned char * inptr, diff --git a/openair1/PHY/CODING/crcext.h b/openair1/PHY/CODING/crcext.h deleted file mode 100644 index f441f25e50..0000000000 --- a/openair1/PHY/CODING/crcext.h +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - Copyright (c) 2009-2018, Intel Corporation - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ - -/** - * Header file with CRC external definitions - * - */ - -#ifndef __CRCEXT_H__ -#define __CRCEXT_H__ - -#include -#include "types.h" -/** - * Flag indicating availability of PCLMULQDQ instruction - * Only valid after running CRCInit() function. - */ -extern int pclmulqdq_available; - -/** - * Flag indicating availability of PCLMULQDQ instruction - * Only valid after running CRCInit() function. - */ -extern __m128i crc_xmm_be_le_swap128; -extern const uint8_t crc_xmm_shift_tab[48]; - -/** - * @brief Shifts right 128 bit register by specified number of bytes - * - * @param reg 128 bit value - * @param num number of bytes to shift right \a reg by (0-16) - * - * @return \a reg >> (\a num * 8) - */ -__forceinline -__m128i xmm_shift_right(__m128i reg, const unsigned int num) -{ - const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 + num); - - return _mm_shuffle_epi8(reg, _mm_loadu_si128(p)); -} - -/** - * @brief Shifts left 128 bit register by specified number of bytes - * - * @param reg 128 bit value - * @param num number of bytes to shift left \a reg by (0-16) - * - * @return \a reg << (\a num * 8) - */ -__forceinline -__m128i xmm_shift_left(__m128i reg, const unsigned int num) -{ - const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 - num); - - return _mm_shuffle_epi8(reg, _mm_loadu_si128(p)); -} - -/** - * @brief Initializes CRC module. - * @note It is mandatory to run it before using any of CRC API's. - */ -extern void CRCInit(void); - -#endif /* __CRCEXT_H__ */ diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index 0d7ff9ef9f..321ecaab7d 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -22,7 +22,6 @@ // encoder interface #ifndef __NRLDPC_DEFS__H__ #define __NRLDPC_DEFS__H__ -#include #include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" /** \brief LDPC encoder @@ -37,31 +36,17 @@ \param 9-12 time_stats_t *tinput,*tprep, *tparity,*toutput */ typedef struct { - unsigned int n_segments; // optim8seg - unsigned int macro_num; // optim8segmulti - unsigned char gen_code; //orig - time_stats_t *tinput; - time_stats_t *tprep; - time_stats_t *tparity; - time_stats_t *toutput; - int Kr; - uint32_t Kb; - uint32_t *Zc; - void *harq; - /// Encoder BG - uint8_t BG; - /// Interleaver outputs - unsigned char *output; - /// Number of bits in "small" code segments - uint32_t K; - /// Number of "Filler" bits - uint32_t F; - /// LDPC-code outputs - uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; -} encoder_implemparams_t; + int n_segments; // optim8seg + unsigned int macro_num; // optim8segmulti + unsigned char gen_code; //orig + time_stats_t *tinput; + time_stats_t *tprep; + time_stats_t *tparity; + time_stats_t *toutput; +}encoder_implemparams_t; #define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL} -typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out); -typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t *); +typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out); +typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t*); //============================================================================================================================ // decoder interface /** @@ -71,5 +56,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho \param p_llrOut Output vector \param p_profiler LDPC profiler statistics */ -typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_procBuf *, t_nrLDPC_time_stats * ); +typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* ); #endif diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c index 69d2ac4972..738fd49b7d 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c @@ -38,6 +38,8 @@ #include "common/utils/LOG/log.h" +//#define DEBUG_LDPC + #include "ldpc384_byte.c" #include "ldpc352_byte.c" #include "ldpc320_byte.c" @@ -71,18 +73,9 @@ -static void encode_parity_check_part_optim(uint8_t *cc,uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols) +static inline void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,short Kb) { - unsigned char c[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c - - for (int i1=0; i1 < ncols; i1++) { - memcpy(&c[2*i1*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); - memcpy(&c[(2*i1+1)*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); - } - for (int i1=1;i1tinput != NULL) start_meas(impp->tinput); - for (int i=0; i>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); } @@ -103,10 +108,24 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); + for (i1=0; i1 < ncols; i1++) + { + memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + } + for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c, d, BG, Zc, Kb,simd_size, ncols); + encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c index 6fa9c5ff53..a974e86e27 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c @@ -38,6 +38,7 @@ #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" +//#define DEBUG_LDPC #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" @@ -101,6 +102,7 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size + unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c // calculate number of punctured bits no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc; @@ -149,10 +151,24 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); + for (i1=0; i1 < ncols; i1++) + { + memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + } + for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c, d, BG, Zc, Kb, simd_size, ncols); + encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c index 15d4481eb6..b21f875b32 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c @@ -39,17 +39,17 @@ #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" +//#define DEBUG_LDPC + #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" -int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) +int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) { - //set_log(PHY, 4); - - int nrows=0,ncols=0; - int rate=3; + short nrows=0,ncols=0; + int i,i1,j,rate=3; int no_punctured_columns,removed_bit; //Table of possible lifting sizes char temp; @@ -95,8 +95,8 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor } #ifdef DEBUG_LDPC - LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,impp->n_segments); - LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",input[0][0],input[0][1],input[0][2],input[0][3]); + LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,n_segments); + LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",test_input[0][0],test_input[0][1],test_input[0][2],test_input[0][3]); #endif AssertFatal(Zc>0,"no valid Zc found for block length %d\n",block_length); @@ -104,8 +104,10 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor if ((Zc&31) > 0) simd_size = 16; else simd_size = 32; - unsigned char cc[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size - unsigned char dd[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size + unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size + unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size + + unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c // calculate number of punctured bits no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc; @@ -113,8 +115,8 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor //printf("%d\n",no_punctured_columns); //printf("%d\n",removed_bit); // unpack input - memset(cc,0,sizeof(unsigned char) * ncols * Zc); - memset(dd,0,sizeof(unsigned char) * nrows * Zc); + memset(c,0,sizeof(unsigned char) * ncols * Zc); + memset(d,0,sizeof(unsigned char) * nrows * Zc); if(impp->tinput != NULL) start_meas(impp->tinput); #if 0 @@ -122,29 +124,29 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor //for (j=0; j>(i&7); + temp = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); //printf("c(%d,%d)=%d\n",j,i,temp); c[i] |= (temp << (j-macro_segment)); } } #else #ifdef __AVX2__ - for (int i=0; i>5; i++) { - c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]); + for (i=0; i>5; i++) { + c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)test_input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]); //for (j=1; j>5)<<5;i>5)<<5;i>(i&7)))>>(7-(i&7)); + temp = (test_input[j][i/8]&(128>>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); - cc[i] |= (temp << (j-macro_segment)); + c[i] |= (temp << (j-macro_segment)); } } #else @@ -157,14 +159,28 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); + for (i1=0; i1 < ncols; i1++) + { + memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); + } + for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(cc, dd, BG, Zc, Kb, simd_size, ncols); + encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { - if (encode_parity_check_part_orig(cc, dd, BG, Zc, Kb, block_length)!=0) { + if (encode_parity_check_part_orig(c, d, BG, Zc, Kb, block_length)!=0) { printf("Problem with encoder\n"); return(-1); } @@ -172,8 +188,8 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor if(impp->toutput != NULL) start_meas(impp->toutput); // information part and puncture columns /* - memcpy(&output[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char)); - memcpy(&output[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char)); + memcpy(&channel_input[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char)); + memcpy(&channel_input[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char)); */ #ifdef __AVX2__ if ((((2*Zc)&31) == 0) && (((block_length-(2*Zc))&31) == 0)) { @@ -181,34 +197,34 @@ int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,shor //AssertFatal(((block_length-(2*Zc))&31) == 0,"block_length-(2*Zc) needs to be a multiple of 32 for now\n"); uint32_t l1 = (block_length-(2*Zc))>>5; uint32_t l2 = ((nrows-no_punctured_columns) * Zc-removed_bit)>>5; - __m256i *c256p = (__m256i *)&cc[2*Zc]; - __m256i *d256p = (__m256i *)&dd[0]; + __m256i *c256p = (__m256i *)&c[2*Zc]; + __m256i *d256p = (__m256i *)&d[0]; // if (((block_length-(2*Zc))&31)>0) l1++; - for (int i=0;i0) l2++; - for (int i1=0, i=l1;i1>(j-macro_segment))&1; - for (int i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++) + for (j=macro_segment; j < macro_segment_end; j++) + channel_input[j][i] = (c[2*Zc+i]>>(j-macro_segment))&1; + for (i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++) //for (j=0; j>(j-macro_segment))&1; + for (j=macro_segment; j < macro_segment_end; j++) + channel_input[j][block_length-2*Zc+i] = (d[i]>>(j-macro_segment))&1; } #else diff --git a/openair1/PHY/CODING/types.h b/openair1/PHY/CODING/types.h deleted file mode 100644 index 2bc7739e36..0000000000 --- a/openair1/PHY/CODING/types.h +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - Copyright (c) 2009-2018, Intel Corporation - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ - -/* Common data types, macros and functions used across the CRC library */ - -#ifndef CRC_TYPES_H_ -#define CRC_TYPES_H_ - -#ifdef __KERNEL__ -#include -#include -typedef uint32_t uint_fast32_t; -typedef uint16_t uint_fast16_t; -typedef uint8_t uint_fast8_t; -#else -#include -#include -#endif - -/* Declare variable at address aligned to a boundary */ -#define DECLARE_ALIGNED(_declaration, _boundary) \ - _declaration __attribute__((aligned(_boundary))) - -/* Macro to make function to be always inlined */ -#ifndef DEBUG -#define __forceinline \ - static inline __attribute__((always_inline)) -#else -#define __forceinline \ - static -#endif - -/* Likely & unliekly hints for the compiler */ -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) - -/* Macro to get dimension of an array */ -#ifndef DIM -#define DIM(x) (sizeof(x)/sizeof(x[0])) -#endif - -/** - * Common functions - */ - -/** - * @brief Swaps bytes in 16 bit word - * - * @param val 16 bit data value - * - * @return byte swapped value - */ -__forceinline uint16_t bswap2(const uint16_t val) -{ - return (uint16_t) ((val >> 8) | (val << 8)); -} - -/** - * @brief Swaps bytes in 32 bit word - * ABCD -> DCBA - * - * @param val 32 bit data value - * - * @return byte swapped value - */ -__forceinline uint32_t bswap4(const uint32_t val) -{ - return ((val >> 24) | /**< A*/ - ((val & 0xff0000) >> 8) | /**< B*/ - ((val & 0xff00) << 8) | /**< C*/ - (val << 24)); /**< D*/ -} - -#endif /* CRC_TYPES_H_ */ diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..b60e77e814 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -458,7 +458,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->decode_SIB = 1; init_nr_prach_tables(839); - init_symbol_rotation(fp); + return 0; } diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 347155ed3b..42d4a30e3b 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -209,6 +209,7 @@ uint32_t get_samples_per_slot(int slot, NR_DL_FRAME_PARMS* fp) return samp_count; } + uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, NR_DL_FRAME_PARMS* fp) { uint32_t slot_idx = 0; diff --git a/openair1/PHY/LTE_REFSIG/lte_refsig.h b/openair1/PHY/LTE_REFSIG/lte_refsig.h index 9d3bae503b..84a2676082 100644 --- a/openair1/PHY/LTE_REFSIG/lte_refsig.h +++ b/openair1/PHY/LTE_REFSIG/lte_refsig.h @@ -36,7 +36,8 @@ \param reset resets the generator \return 32 bits of the gold sequence */ -#include +uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); + /*!\brief This function generates the LTE Gold sequence (36-211, Sec 7.2), specifically for DL reference signals. @param frame_parms LTE DL Frame parameters diff --git a/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c b/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c new file mode 100644 index 0000000000..a23f8db4f2 --- /dev/null +++ b/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c @@ -0,0 +1,75 @@ +/* + * 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 + */ + +#include "PHY/types.h" + +/** + \brief Gold Sequence Generation defined in 3x.211 + \param x1 x1 shift register + \param x2 x2 shift register / cinit if reset is set + \param reset Reset flag / reinitialize the generator + \return c 32 bits of gold output +*/ +extern inline uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) +{ + int32_t n; + + // 3GPP 3x.211 + // Nc = 1600 + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + // x1(n+31) = [x1(n+3) + x1(n)]mod2 + // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 + if (reset) + { + // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 + // x1(31) = [x1(3) + x1(0)]mod2 = 1 + *x1 = 1 + (1U<<31); + // Init value for x2: cinit = sum_{i=0}^30 x2*2^i + // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 + // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 + *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); + + // x1 and x2 contain bits n = 0,1,...,31 + + // Nc = 1600 bits are skipped at the beginning + // i.e., 1600 / 32 = 50 32bit words + + for (n = 1; n < 50; n++) + { + // Compute x1(0),...,x1(27) + *x1 = (*x1>>1) ^ (*x1>>4); + // Compute x1(28),..,x1(31) and xor + *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); + // Compute x2(0),...,x2(27) + *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); + // Compute x2(28),..,x2(31) and xor + *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); + } + } + + *x1 = (*x1>>1) ^ (*x1>>4); + *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); + *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); + *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); + + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + return(*x1^*x2); +} diff --git a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c index 38914506ee..6144b978bf 100644 --- a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c +++ b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c @@ -147,10 +147,10 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb) { } } -int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) { +int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) { int rb,re_pbch_sss=0; int rb_alloc_ind,nsymb; - nsymb = (Ncp==NORMAL) ? 14 : 12; + nsymb = (frame_parms->Ncp==NORMAL) ? 14 : 12; // printf("adjust_G2 : symbol %d, subframe %d\n",symbol,subframe); if ((subframe!=0) && (subframe!=5) && (subframe!=6)) // if not PBCH/SSS or SSS @@ -158,12 +158,12 @@ int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t //first half of slot and TDD (no adjustments in first slot except for subframe 6 - PSS) if ((symbol<(nsymb>>1))&& - (frame_type == TDD)&& + (frame_parms->frame_type == TDD)&& (subframe!=6)) return(0); // after PBCH - if (frame_type==TDD) { //TDD + if (frame_parms->frame_type==TDD) { //TDD if ((symbol>((nsymb>>1)+3)) && (symbol!=(nsymb-1))) ///SSS return(0); @@ -185,9 +185,9 @@ int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t return(0); } - if ((N_RB_DL&1) == 1) { // ODD N_RB_DL - for (rb=((N_RB_DL>>1)-3); - rb<=((N_RB_DL>>1)+3); + if ((frame_parms->N_RB_DL&1) == 1) { // ODD N_RB_DL + for (rb=((frame_parms->N_RB_DL>>1)-3); + rb<=((frame_parms->N_RB_DL>>1)+3); rb++) { if (rb < 32) rb_alloc_ind = (rb_alloc[0]>>rb) & 1; @@ -201,16 +201,16 @@ int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t rb_alloc_ind = 0; if (rb_alloc_ind==1) { - if ((rb==(N_RB_DL>>1)-3) || - (rb==((N_RB_DL>>1)+3))) { + if ((rb==(frame_parms->N_RB_DL>>1)-3) || + (rb==((frame_parms->N_RB_DL>>1)+3))) { re_pbch_sss += 6; } else re_pbch_sss += 12; } } } else { - for (rb=((N_RB_DL>>1)-3); - rb<((N_RB_DL>>1)+3); + for (rb=((frame_parms->N_RB_DL>>1)-3); + rb<((frame_parms->N_RB_DL>>1)+3); rb++) { if (rb < 32) rb_alloc_ind = (rb_alloc[0]>>rb) & 1; diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c index 0ba63019a1..3646732ce3 100644 --- a/openair1/PHY/LTE_TRANSPORT/pcfich.c +++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c @@ -44,7 +44,7 @@ void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms, { uint32_t i; uint8_t reset; - uint32_t x1=0, x2, s=0; + uint32_t x1, x2, s=0; reset = 1; // x1 is set in lte_gold_generic diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 998edf235f..3270066448 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -895,7 +895,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint8_t pucch1_thres, - int br_flag + uint8_t br_flag ) //----------------------------------------------------------------------------- { diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h index af8e63c3ed..622f37b3bc 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h @@ -101,7 +101,7 @@ int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode); int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); +int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); #ifndef modOrder diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h index 1fbd1266d7..19af50056c 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h @@ -700,51 +700,7 @@ int find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type); int find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type); -static inline uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) -{ - int32_t n; - - // 3GPP 3x.211 - // Nc = 1600 - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - // x1(n+31) = [x1(n+3) + x1(n)]mod2 - // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 - if (reset) - { - // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 - // x1(31) = [x1(3) + x1(0)]mod2 = 1 - *x1 = 1 + (1U<<31); - // Init value for x2: cinit = sum_{i=0}^30 x2*2^i - // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 - // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 - *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); - - // x1 and x2 contain bits n = 0,1,...,31 - - // Nc = 1600 bits are skipped at the beginning - // i.e., 1600 / 32 = 50 32bit words - - for (n = 1; n < 50; n++) - { - // Compute x1(0),...,x1(27) - *x1 = (*x1>>1) ^ (*x1>>4); - // Compute x1(28),..,x1(31) and xor - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - // Compute x2(0),...,x2(27) - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - // Compute x2(28),..,x2(31) and xor - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - } - } - - *x1 = (*x1>>1) ^ (*x1>>4); - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - return(*x1^*x2); -} +uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); /**@}*/ diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index efde277203..4f65edd6d5 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -1293,7 +1293,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, } granted_re = nb_rb_alloc * (12-crs_re); - pbch_pss_sss_re = adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); + pbch_pss_sss_re = adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); pbch_pss_sss_re = (double)pbch_pss_sss_re * ((double)(12-crs_re)/12); data_re = granted_re - pbch_pss_sss_re; llr_offset = data_re * dlsch0_harq->Qm * 2; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index 6afd028099..91de5386ae 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -837,7 +837,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, first_symbol_flag, nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } else if (codeword_TB0 == -1) { dlsch_qpsk_llr(frame_parms, @@ -846,7 +846,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, first_symbol_flag, nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { if (dlsch1_harq->Qm == 2) { @@ -856,7 +856,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -866,7 +866,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -877,7 +877,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -888,7 +888,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -899,7 +899,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -910,7 +910,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } @@ -925,7 +925,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[0], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); } else if (codeword_TB0 == -1) { @@ -934,7 +934,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[1], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream, beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -946,7 +946,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -957,7 +957,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -969,7 +969,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -981,7 +981,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -993,7 +993,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1005,7 +1005,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } @@ -1021,7 +1021,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (codeword_TB0 == -1) { @@ -1031,7 +1031,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -1043,7 +1043,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1054,7 +1054,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -1066,7 +1066,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1078,7 +1078,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -1090,7 +1090,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, (int16_t *)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol]); if (rx_type==rx_IC_dual_stream) { @@ -1102,7 +1102,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], (int16_t *)pllr_symbol_cw1, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol]); } } @@ -1124,7 +1124,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->rxdataF_comp0, (int16_t *)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } @@ -1137,7 +1137,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[0], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); } @@ -1152,7 +1152,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c index 43f3b5451f..4c74377ef6 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c @@ -746,7 +746,7 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation - pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL ,&rb_alloc,2,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,2,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { if (frame_parms->nb_antenna_ports_eNB!=1) @@ -981,7 +981,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, 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,4,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,4,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { amp_tmp=0x1fff;//dlsch0->sqrt_rho_b; already taken into account @@ -1281,7 +1281,7 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, 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); + pbch_pss_sss_adjust=adjust_G2(frame_parms,&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 diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c index 9427ec3a5b..1f9fb86f80 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c @@ -336,8 +336,8 @@ void generate_pucch1x(int32_t **txdataF, -static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) __attribute__((always_inline)); -static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) { +inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) __attribute__((always_inline)); +inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) { uint32_t x1, x2, s=0; int i; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index c5d096ceb7..7ab795cae9 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -1303,7 +1303,7 @@ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL); int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode); int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); - +int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); #ifndef modOrder diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 9bbc61d4b6..fa1b6c955b 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -180,15 +180,13 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /// CRC, coding, interleaving and rate matching AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); start_meas(dlsch_encoding_stats); - nr_dlsch_encoding(gNB, - harq->pdu, frame, slot, dlsch, frame_parms, output, - tinput,tprep,tparity,toutput, - dlsch_rate_matching_stats, - dlsch_interleaving_stats, - dlsch_segmentation_stats); + if (nr_dlsch_encoding(gNB, + harq->pdu, frame, slot, dlsch, frame_parms,tinput,tprep,tparity,toutput, + dlsch_rate_matching_stats, + dlsch_interleaving_stats, + dlsch_segmentation_stats) == -1) + return; stop_meas(dlsch_encoding_stats); #ifdef DEBUG_DLSCH printf("PDSCH encoding:\nPayload:\n"); @@ -200,7 +198,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("\nEncoded payload:\n"); for (int i=0; i>3; i++) { for (int j=0; j<8; j++) - printf("%d", output[(i<<3)+j]); + printf("%d", harq->f[(i<<3)+j]); printf("\t"); } printf("\n"); @@ -213,7 +211,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, for (int q=0; qNrOfCodewords; q++) memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t)); for (int q=0; qNrOfCodewords; q++) - nr_pdsch_codeword_scrambling_optim(output, + nr_pdsch_codeword_scrambling_optim(harq->f, encoded_length, q, rel15->dataScramblingId, @@ -250,7 +248,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } #endif - start_meas(&gNB->dlsch_layer_mapping_stats); + /// Layer mapping nr_layer_mapping(mod_symbs, rel15->nrOfLayers, @@ -268,7 +266,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } #endif - stop_meas(&gNB->dlsch_layer_mapping_stats); /// Resource mapping // Non interleaved VRB to PRB mapping @@ -282,7 +279,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif - start_meas(&gNB->dlsch_resource_mapping_stats); + for (int ap=0; apnrOfLayers; ap++) { // DMRS params for this ap @@ -324,13 +321,20 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, dmrs_idx = (rel15->rbStart+rel15->BWPStart)*4; } } + } + + // Update l_prime in the case of double DMRS config + if ((dmrs_symbol_map & (1 << l))){ //DMRS time occasion if (l==(l_overline+1)) //take into account the double DMRS symbols l_prime = 1; else if (l>(l_overline+1)) {//new DMRS pair l_overline = l; l_prime = 0; } - /// DMRS QPSK modulation + } + + /// DMRS QPSK modulation + if (rel15->dlDmrsSymbPos & (1 << l)) { nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated #ifdef DEBUG_DLSCH @@ -351,143 +355,73 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, ptrs_symbol = is_ptrs_symbol(l,dlPtrsSymPos); if(ptrs_symbol) { /* PTRS QPSK Modulation for each OFDM symbol in a slot */ - printf("Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs); nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs); } } uint16_t k = start_sc; - if (ptrs_symbol || dmrs_symbol_map & (1 << l)) { + // Loop Over SCs: + for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) { + /* check if cuurent RE is PTRS RE*/ + is_ptrs_re=0; + /* check for PTRS symbol and set flag for PTRS RE */ + if(ptrs_symbol){ + is_ptrs_re = is_ptrs_subcarrier(k, + rel15->rnti, + ap, + rel15->dmrsConfigType, + rel15->PTRSFreqDensity, + rel15->rbSize, + rel15->PTRSReOffset, + start_sc, + frame_parms->ofdm_symbol_size); + } - // Loop Over SCs: - for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) { - /* check if cuurent RE is PTRS RE*/ - is_ptrs_re = 0; - if (ptrs_symbol) - is_ptrs_re = is_ptrs_subcarrier(k, - rel15->rnti, - ap, - rel15->dmrsConfigType, - rel15->PTRSFreqDensity, - rel15->rbSize, - rel15->PTRSReOffset, - start_sc, - frame_parms->ofdm_symbol_size); - /* Map DMRS Symbol */ - if ( (dmrs_symbol_map & (1 << l)) && - (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + /* Map DMRS Symbol */ + if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", + dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - dmrs_idx++; - k_prime++; - k_prime&=1; - n+=(k_prime)?0:1; - } - else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + dmrs_idx++; + k_prime++; + k_prime&=1; + n+=(k_prime)?0:1; + } + /* Map PTRS Symbol */ + else if(is_ptrs_re){ + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", - ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)],mod_ptrs[ptrs_idx<<1],mod_ptrs[(ptrs_idx<<1)+1]); + printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", + ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - ptrs_idx++; - } + ptrs_idx++; + } /* Map DATA Symbol */ - else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + else if( (!(dmrs_symbol_map & (1 << l))) || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", + m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - m++; - } - /* mute RE */ - else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; - } - if (++k >= frame_parms->ofdm_symbol_size) - k -= frame_parms->ofdm_symbol_size; - } //RE loop - } - else { // no PTRS or DMRS in this symbol - // Loop Over SCs: - int upper_limit=rel15->rbSize*NR_NB_SC_PER_RB; - int remaining_re = 0; - if (start_sc + upper_limit > frame_parms->ofdm_symbol_size) { - remaining_re = upper_limit + start_sc - frame_parms->ofdm_symbol_size; - upper_limit = frame_parms->ofdm_symbol_size - start_sc; - } - // fix the alignment issues later, use 64-bit SIMD below instead of 128. - if (0/*(frame_parms->N_RB_DL&1)==0*/) { - __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; - - __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; - __m128i amp128=_mm_set1_epi16(amp); - for (int i=0; i<(upper_limit>>2); i++) { - txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); - } //RE loop, first part - m+=upper_limit; - if (remaining_re > 0) { - txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; - txl = (__m128i*)&tx_layers[ap][m<<1]; - for (int i=0; i<(remaining_re>>2); i++) { - txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); - } - } + m++; } + /* mute RE */ else { - __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; - - __m64 *txl = (__m64*)&tx_layers[ap][m<<1]; - __m64 amp64=_mm_set1_pi16(amp); - for (int i=0; i<(upper_limit>>1); i++) { - - txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); -#ifdef DEBUG_DLSCH_MAPPING - if ((i&1) > 0) - printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]); -#endif - /* handle this, mute RE */ - /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; - }*/ - } //RE loop, first part - m+=upper_limit; - if (remaining_re > 0) { - txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; - txl = (__m64*)&tx_layers[ap][m<<1]; - for (int i=0; i<(remaining_re>>1); i++) { - txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); -#ifdef DEBUG_DLSCH_MAPPING - if ((i&1) > 0) - printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]); -#endif - /* handle this, mute RE */ - /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; - }*/ - } //RE loop, second part - } // - m+=remaining_re; - } // N_RB_DL even - } // no DMRS/PTRS in symbol + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + } + if (++k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; + } //RE loop } // symbol loop }// layer loop - stop_meas(&gNB->dlsch_resource_mapping_stats); ///Layer Precoding and Antenna port mapping // tx_layers 1-8 are mapped on antenna ports 1000-1007 @@ -496,9 +430,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, // pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1 // The Precoding matrix: // The Codebook Type I and Type II are not supported yet. - // We`adopt the precoding matrices of PUSCH for 4 layers. - start_meas(&gNB->dlsch_precoding_stats); - + // We adopt the precoding matrices of PUSCH for 4 layers. for (int ap=0; apnb_antennas_tx; ap++) { for (int l=rel15->StartSymbolIndex; lStartSymbolIndex+rel15->NrOfSymbols; l++) { @@ -573,7 +505,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } // symbol loop }// port loop - stop_meas(&gNB->dlsch_precoding_stats); dlsch->slot_tx[slot]=0; // TODO: handle precoding diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index 77db12672f..181c2ab273 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -43,6 +43,8 @@ void nr_check_time_alloc(uint8_t S, uint8_t L,nfapi_nr_dl_tti_pdsch_pdu_rel15_t uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB); +uint16_t get_SLIV(uint8_t S, uint8_t L); + uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t dmrs_typeA_position); void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type); @@ -83,7 +85,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, uint8_t slot, NR_gNB_DLSCH_t *dlsch, NR_DL_FRAME_PARMS* frame_parms, - unsigned char * output, time_stats_t *tinput, time_stats_t *tprep, time_stats_t *tparity, diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 5620018b73..0bcd1e3e51 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -50,47 +50,70 @@ //#define DEBUG_DLSCH_FREE 1 -void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) { +void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) +{ int r; - NR_gNB_DLSCH_t *dlsch = *dlschptr; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated + NR_gNB_DLSCH_t *dlsch = *dlschptr; + + uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated if (dlsch) { + if (N_RB != 273) { a_segments = a_segments*N_RB; a_segments = a_segments/273 +1; } - + #ifdef DEBUG_DLSCH_FREE LOG_D(PHY,"Freeing dlsch %p\n",dlsch); #endif NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; - if (harq->b) { free16(harq->b, a_segments * 1056); harq->b = NULL; #ifdef DEBUG_DLSCH_FREE LOG_D(PHY, "Freeing harq->b (%p)\n", harq->b); #endif - } - + + if (harq->e) { + free16(harq->e, 14 * N_RB * 12 * 8); + harq->e = NULL; #ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); + printf("Freeing dlsch process %d e (%p)\n", i, harq->e); #endif - - for (r = 0; r < a_segments; r++) { + } + + if (harq->f) { + free16(harq->f, 14 * N_RB * 12 * 8); + harq->f = NULL; #ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); + printf("Freeing dlsch process %d f (%p)\n", i, harq->f); #endif - - if (harq->c[r]) { - free16(harq->c[r], 1056); - harq->c[r] = NULL; + } + +#ifdef DEBUG_DLSCH_FREE + LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); +#endif + + for (r = 0; r < a_segments; r++) { +#ifdef DEBUG_DLSCH_FREE + LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); +#endif + + if (harq->c[r]) { + free16(harq->c[r], 1056); + harq->c[r] = NULL; + } + if (harq->d[r]) { + free16(harq->d[r], 3 * 8448); + harq->d[r] = NULL; + } } } - free16(dlsch, sizeof(NR_gNB_DLSCH_t)); - *dlschptr = NULL; } + + free16(dlsch, sizeof(NR_gNB_DLSCH_t)); + *dlschptr = NULL; } NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, @@ -98,7 +121,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, unsigned char Mdlharq, uint32_t Nsoft, uint8_t abstraction_flag, - uint16_t N_RB) { + uint16_t N_RB) +{ unsigned char i,r,aa,layer; int re; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated @@ -109,8 +133,10 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, } uint16_t dlsch_bytes = a_segments*1056; // allocated bytes per segment + NR_gNB_DLSCH_t *dlsch = malloc16(sizeof(NR_gNB_DLSCH_t)); AssertFatal(dlsch, "cannot allocate dlsch\n"); + bzero(dlsch,sizeof(NR_gNB_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; @@ -118,12 +144,11 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, dlsch->Nsoft = Nsoft; for (layer=0; layerue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *)); + dlsch->ue_spec_bf_weights[layer] = (int32_t**)malloc16(64*sizeof(int32_t*)); for (aa=0; aa<64; aa++) { dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); - - for (re=0; reue_spec_bf_weights[layer][aa][re] = 0x00007fff; } } @@ -135,8 +160,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t)); - dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *)); - + dlsch->calib_dl_ch_estimates = (int32_t**)malloc16(64*sizeof(int32_t*)); for (aa=0; aa<64; aa++) { dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); } @@ -148,6 +172,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; bzero(harq, sizeof(NR_DL_gNB_HARQ_t)); + harq->b = malloc16(dlsch_bytes); AssertFatal(harq->b, "cannot allocate memory for harq->b\n"); harq->pdu = malloc16(dlsch_bytes); @@ -163,33 +188,71 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, // In section 5.3.2 in 38.212, the for loop is up to N + 2*Zc (maximum size of N is 66*Zc, therefore 68*Zc) harq->c[r] = malloc16(8448); AssertFatal(harq->c[r], "cannot allocate harq->c[%d]\n", r); + harq->d[r] = malloc16(68 * 384); + AssertFatal(harq->d[r], "cannot allocate harq->d[%d]\n", r); // max size for coded output bzero(harq->c[r], 8448); + bzero(harq->d[r], (3 * 8448)); } + harq->e = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + AssertFatal(harq->e, "cannot allocate harq->e\n"); + bzero(harq->e, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + harq->f = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + AssertFatal(harq->f, "cannot allocate harq->f\n"); + bzero(harq->f, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + return(dlsch); } -void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) { +void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) +{ + + unsigned char Mdlharq; + unsigned char i,j,r; + AssertFatal(dlsch!=NULL,"dlsch is null\n"); - unsigned char Mdlharq = dlsch->Mdlharq; + Mdlharq = dlsch->Mdlharq; dlsch->rnti = 0; dlsch->active = 0; - for (int i=0; i<10; i++) { + NR_DL_gNB_HARQ_t *harq=&dlsch->harq_process; + + for (i=0; i<10; i++) { dlsch->harq_ids[0][i] = Mdlharq; dlsch->harq_ids[1][i] = Mdlharq; } + for (i=0; id[r]) + harq->d[r][j] = NR_NULL; + } } -void ldpc8blocks( void *p) { - encoder_implemparams_t *impp=(encoder_implemparams_t *) p; - NR_DL_gNB_HARQ_t *harq = (NR_DL_gNB_HARQ_t *)impp->harq; - uint16_t Kr= impp->K; +int nr_dlsch_encoding(PHY_VARS_gNB *gNB, + unsigned char *a, + int frame, + uint8_t slot, + NR_gNB_DLSCH_t *dlsch, + NR_DL_FRAME_PARMS* frame_parms, + time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, + time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats, + time_stats_t *dlsch_segmentation_stats) +{ + + unsigned int G; + unsigned int crc=1; + NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; - uint8_t mod_order = rel15->qamModOrder[0]; uint16_t nb_rb = rel15->rbSize; uint8_t nb_symb_sch = rel15->NrOfSymbols; - uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); - uint32_t A = rel15->TBSize[0]<<3; + uint32_t A, Kb, F=0; + uint32_t *Zc = &dlsch->harq_process.Z; + uint8_t mod_order = rel15->qamModOrder[0]; + uint16_t Kr=0,r; + uint32_t r_offset=0; + uint32_t E; + uint8_t Ilbrm = 1; + uint32_t Tbslbrm = 950984; //max tbs uint8_t nb_re_dmrs; if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) @@ -197,115 +260,24 @@ void ldpc8blocks( void *p) { else nb_re_dmrs = 4*rel15->numDmrsCdmGrpsNoData; - unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers); - LOG_D(PHY,"dlsch coding A %d Kr %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", - A,impp->K,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); - // nrLDPC_encoder output is in "d" - // let's make this interface happy! - uint8_t tmp[8][68 * 384]__attribute__((aligned(32))); - for (int rr=impp->macro_num*8, i=0; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++,i++ ) - impp->d[rr]=tmp[i]; - nrLDPC_encoder(harq->c,impp->d,*impp->Zc, impp->Kb,Kr,impp->BG,impp); - // Compute where to place in output buffer that is concatenation of all segments - uint32_t r_offset=0; - for (int i=0; i < impp->macro_num*8; i++ ) - r_offset+=nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, i); - for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) { - if (impp->F>0) { - // writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212 - memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL); - } - -#ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]); -#endif - uint32_t E = nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, rr); - //#ifdef DEBUG_DLSCH_CODING - LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", - rr, - impp->n_segments, - G, - E, - impp->F, - Kr-impp->F-2*(*impp->Zc), - mod_order,nb_rb); - // for tbslbrm calculation according to 5.4.2.1 of 38.212 - uint8_t Nl = 4; - - if (rel15->nrOfLayers < Nl) - Nl = rel15->nrOfLayers; - - uint32_t Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); - uint8_t Ilbrm = 1; - - uint8_t e[E]; - bzero (e, E); - nr_rate_matching_ldpc(Ilbrm, - Tbslbrm, - impp->BG, - *impp->Zc, - impp->d[rr], - e, - impp->n_segments, - impp->F, - Kr-impp->F-2*(*impp->Zc), - rel15->rvIndex[0], - E); -#ifdef DEBUG_DLSCH_CODING - - for (int i =0; i<16; i++) - printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); - -#endif - nr_interleaving_ldpc(E, - mod_order, - e, - impp->output+r_offset); -#ifdef DEBUG_DLSCH_CODING - - for (int i =0; i<16; i++) - printf("output interleaving f[%d]= %d r_offset %u\n", i,impp->output[i+r_offset], r_offset); - - if (r==impp->n_segments-1) - write_output("enc_output.m","enc",impp->output,G,1,4); - -#endif - r_offset += E; - } -} - -int nr_dlsch_encoding(PHY_VARS_gNB *gNB, - unsigned char *a, - int frame, - uint8_t slot, - NR_gNB_DLSCH_t *dlsch, - NR_DL_FRAME_PARMS *frame_parms, - unsigned char * output, - time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, - time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats, - time_stats_t *dlsch_segmentation_stats) { - encoder_implemparams_t impp; - impp.output=output; - unsigned int crc=1; - NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; - nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; - impp.Zc = &dlsch->harq_process.Z; + uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); + uint16_t R=rel15->targetCodeRate[0]; float Coderate = 0.0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); - uint32_t A = rel15->TBSize[0]<<3; + uint8_t Nl = 4; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); + + A = rel15->TBSize[0]<<3; if ( dlsch->rnti != SI_RNTI ) - trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); + trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); NR_gNB_SCH_STATS_t *stats=NULL; int first_free=-1; - - for (int i=0; idlsch_stats[i].rnti == 0 && first_free == -1) { first_free = i; stats=&gNB->dlsch_stats[i]; } - if (gNB->dlsch_stats[i].rnti == dlsch->rnti) { stats=&gNB->dlsch_stats[i]; break; @@ -318,94 +290,181 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, stats->current_RI = rel15->nrOfLayers; stats->current_Qm = rel15->qamModOrder[0]; } + G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers); + + LOG_D(PHY,"dlsch coding A %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", + A,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); if (A > 3824) { // Add 24-bit crc (polynomial A) to payload crc = crc24a(a,A)>>8; - a[A>>3] = ((uint8_t *)&crc)[2]; - a[1+(A>>3)] = ((uint8_t *)&crc)[1]; - a[2+(A>>3)] = ((uint8_t *)&crc)[0]; + a[A>>3] = ((uint8_t*)&crc)[2]; + a[1+(A>>3)] = ((uint8_t*)&crc)[1]; + a[2+(A>>3)] = ((uint8_t*)&crc)[0]; //printf("CRC %x (A %d)\n",crc,A); //printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]); + harq->B = A+24; // harq->b = a; + AssertFatal((A / 8) + 4 <= MAX_NR_DLSCH_PAYLOAD_BYTES, "A %d is too big (A/8+4 = %d > %d)\n", A, (A / 8) + 4, MAX_NR_DLSCH_PAYLOAD_BYTES); + memcpy(harq->b, a, (A / 8) + 4); // why is this +4 if the CRC is only 3 bytes? - } else { + } + else { // Add 16-bit crc (polynomial A) to payload crc = crc16(a,A)>>16; - a[A>>3] = ((uint8_t *)&crc)[1]; - a[1+(A>>3)] = ((uint8_t *)&crc)[0]; + a[A>>3] = ((uint8_t*)&crc)[1]; + a[1+(A>>3)] = ((uint8_t*)&crc)[0]; //printf("CRC %x (A %d)\n",crc,A); //printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]); + harq->B = A+16; // harq->b = a; + AssertFatal((A / 8) + 3 <= MAX_NR_DLSCH_PAYLOAD_BYTES, "A %d is too big (A/8+3 = %d > %d)\n", A, (A / 8) + 3, MAX_NR_DLSCH_PAYLOAD_BYTES); + memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc } - - if (rel15->targetCodeRate[0]<1000) - Coderate = (float)rel15->targetCodeRate[0] /(float) 1024; + if (R<1000) + Coderate = (float) R /(float) 1024; else // to scale for mcs 20 and 26 in table 5.1.3.1-2 which are decimal and input 2* in nr_tbs_tools - Coderate = (float)rel15->targetCodeRate[0] /(float) 2048; + Coderate = (float) R /(float) 2048; if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25) - impp.BG = 2; + harq->BG = 2; else - impp.BG = 1; + harq->BG = 1; start_meas(dlsch_segmentation_stats); - impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG); + Kb = nr_segmentation(harq->b, harq->c, harq->B, &harq->C, &harq->K, Zc, &harq->F, harq->BG); stop_meas(dlsch_segmentation_stats); + F = harq->F; - for (int r=0; rK; +#ifdef DEBUG_DLSCH_CODING + uint16_t Kr_bytes; + Kr_bytes = Kr>>3; +#endif + + //printf("segment Z %d k %d Kr %d BG %d C %d\n", *Zc,harq->K,Kr,BG,harq->C); + + for (r=0; rC; r++) { //d_tmp[r] = &harq->d[r][0]; //channel_input[r] = &harq->d[r][0]; #ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp->F); - LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,impp.n_segments); + LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, harq->F); + LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,harq->C); LOG_D(PHY,"input %d %d %d %d %d \n", harq->c[r][0], harq->c[r][1], harq->c[r][2],harq->c[r][3], harq->c[r][4]); - - for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++) { + for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++){ LOG_D(PHY,"%d ", harq->c[r][cnt]); } - LOG_D(PHY,"\n"); + #endif //ldpc_encoder_orig((unsigned char*)harq->c[r],harq->d[r],*Zc,Kb,Kr,BG,0); //ldpc_encoder_optim((unsigned char*)harq->c[r],(unsigned char*)&harq->d[r][0],*Zc,Kb,Kr,BG,NULL,NULL,NULL,NULL); } - + encoder_implemparams_t impp; + impp.n_segments=harq->C; impp.tprep = tprep; impp.tinput = tinput; impp.tparity = tparity; impp.toutput = toutput; - impp.harq=harq; - notifiedFIFO_t nf; - initNotifiedFIFO(&nf); - int nbJobs=0; - for(int j=0; j<(impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1)); j++) { - notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(impp), j, &nf, ldpc8blocks); - encoder_implemparams_t* perJobImpp=(encoder_implemparams_t*)NotifiedFifoData(req); - *perJobImpp=impp; - perJobImpp->macro_num=j; - pushTpool(gNB->threadPool,req); - nbJobs++; + for(int j=0;j<(harq->C/8+1);j++) { + impp.macro_num=j; + nrLDPC_encoder(harq->c,harq->d,*Zc,Kb,Kr,harq->BG,&impp); } - while(nbJobs) { - notifiedFIFO_elt_t *req=pullTpool(&nf, gNB->threadPool); - delNotifiedFIFO_elt(req); - nbJobs--; + +#ifdef DEBUG_DLSCH_CODING + write_output("enc_input0.m","enc_in0",&harq->c[0][0],Kr_bytes,1,4); + write_output("enc_output0.m","enc0",&harq->d[0][0],(3*8*Kr_bytes)+12,1,4); +#endif + + F = harq->F; + + Kr = harq->K; + for (r=0; rC; r++) { + + if (F>0) { + for (int k=(Kr-F-2*(*Zc)); kd[r][k] = NR_NULL; + //if (k<(Kr-F+8)) + //printf("r %d filler bits [%d] = %d \n", r,k, harq->d[r][k]); + } + } + +#ifdef DEBUG_DLSCH_CODING + LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]); +#endif + + E = nr_get_E(G, harq->C, mod_order, rel15->nrOfLayers, r); + + //#ifdef DEBUG_DLSCH_CODING + LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", + r, + harq->C, + G, + E, + F, + Kr-F-2*(*Zc), + mod_order,nb_rb); + + // for tbslbrm calculation according to 5.4.2.1 of 38.212 + if (rel15->nrOfLayers < Nl) + Nl = rel15->nrOfLayers; + + Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); + + start_meas(dlsch_rate_matching_stats); + if (nr_rate_matching_ldpc(Ilbrm, + Tbslbrm, + harq->BG, + *Zc, + harq->d[r], + harq->e+r_offset, + harq->C, + F, + Kr-F-2*(*Zc), + rel15->rvIndex[0], + E) == -1) + return -1; + + stop_meas(dlsch_rate_matching_stats); +#ifdef DEBUG_DLSCH_CODING + for (int i =0; i<16; i++) + printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); +#endif + + start_meas(dlsch_interleaving_stats); + nr_interleaving_ldpc(E, + mod_order, + harq->e+r_offset, + harq->f+r_offset); + stop_meas(dlsch_interleaving_stats); + +#ifdef DEBUG_DLSCH_CODING + for (int i =0; i<16; i++) + printf("output interleaving f[%d]= %d r_offset %u\n", i,harq->f[i+r_offset], r_offset); + + if (r==harq->C-1) + write_output("enc_output.m","enc",harq->f,G,1,4); +#endif + + r_offset += E; } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT); + return 0; } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c index 26b45eb9f7..3ba13d2f44 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c @@ -96,6 +96,11 @@ void nr_get_time_domain_allocation_type(nfapi_nr_config_request_t config, } } + +uint16_t get_SLIV(uint8_t S, uint8_t L) { + return ( (uint16_t)(((L-1)<=7)? (14*(L-1)+S) : (14*(15-L)+(13-S))) ); +} + static inline uint8_t get_K0(uint8_t row_idx, uint8_t time_alloc_type) { return ( (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A)|| (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_C)? 0 : diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index c4b40ec4cc..1ce8c238cb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -376,11 +376,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", - frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -399,11 +397,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -460,10 +458,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #endif stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); @@ -512,11 +509,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -571,11 +568,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; @@ -654,10 +651,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -#if DISABLE_LOG_X - printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); -#else - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + +#ifdef DEBUG_PDSCH_RX + LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif // Please keep it: useful for debugging 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 7c75884fa6..a064a91d87 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c @@ -947,7 +947,7 @@ void nr_dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, 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); + pbch_pss_sss_adjust=adjust_G2(frame_parms,&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 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 3cb002f9e1..0ab17c11e6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1286,8 +1286,8 @@ uint8_t get_transmission_mode(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti); */ 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); +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 @@ -1313,6 +1313,16 @@ uint8_t I_TBS2I_MCS(uint8_t I_TBS); uint8_t SE2I_TBS(float SE, uint8_t N_PRB, uint8_t symbPerRB); +/** \brief This function generates the sounding reference symbol (SRS) for the uplink according to 36.211 v8.6.0. If IFFT_FPGA is defined, the SRS is quantized to a QPSK sequence. + @param frame_parms LTE DL Frame Parameters + @param soundingrs_ul_config_dedicated Dynamic configuration from RRC during Connection Establishment + @param txdataF pointer to the frequency domain TX signal + @returns 0 on success*/ +int generate_srs(NR_DL_FRAME_PARMS *frame_parms, + SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, + int *txdataF, + int16_t amp, + uint32_t subframe); /*! @@ -1342,6 +1352,12 @@ int32_t generate_drs_pusch(PHY_VARS_NR_UE *phy_vars_ue, uint32_t nb_rb, uint8_t ant); +/*! + \brief This function initializes the Group Hopping, Sequence Hopping and nPRS sequences for PUCCH/PUSCH according to 36.211 v8.6.0. It should be called after configuration of UE (reception of SIB2/3) and initial configuration of eNB (or after reconfiguration of cell-specific parameters). + @param frame_parms Pointer to a NR_DL_FRAME_PARMS structure (eNB or UE)*/ +void init_ul_hopping(NR_DL_FRAME_PARMS *frame_parms); + + /*! \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 @@ -1406,6 +1422,8 @@ double sinr_eff_cqi_calc(PHY_VARS_NR_UE *phy_vars_ue, uint8_t sinr2cqi(double sinr,uint8_t trans_mode); +int dump_dci(NR_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci); + 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); @@ -1495,11 +1513,18 @@ int get_nCCE_offset_l1(int *CCE_table, const unsigned short rnti, const unsigned char subframe); +uint16_t get_nCCE(uint8_t num_pdcch_symbols,NR_DL_FRAME_PARMS *frame_parms,uint8_t mi); -//uint8_t get_mi(NR_DL_FRAME_PARMS *frame,uint8_t subframe); +uint16_t get_nquad(uint8_t num_pdcch_symbols,NR_DL_FRAME_PARMS *frame_parms,uint8_t mi); + +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); +uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); + +void pdcch_interleaving(NR_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi); + void nr_pdcch_unscrambling(int16_t *z, uint16_t scrambling_RNTI, uint32_t length, @@ -1514,6 +1539,7 @@ void dlsch_unscrambling(NR_DL_FRAME_PARMS *frame_parms, uint8_t q, uint8_t Ns); +void init_ncs_cell(NR_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]); void generate_pucch1x(int32_t **txdataF, NR_DL_FRAME_PARMS *frame_parms, @@ -1561,7 +1587,7 @@ void init_ulsch_power_LUT(void); @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); +int is_prach_subframe(NR_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe); /*! \brief Generate PRACH waveform @@ -1627,6 +1653,8 @@ void init_scrambling_lut(void); @param frame_parms Pointer to frame parameters @returns 1 if subframe is for MBSFN */ +int is_pmch_subframe(frame_t frame, int subframe, NR_DL_FRAME_PARMS *frame_parms); + 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); @@ -1663,7 +1691,8 @@ uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms, uint8_t n_ra_prboffset, uint8_t tdd_mapindex, uint16_t Nf); -#include + +uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 914523bc70..99dc2b658e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -105,8 +105,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5]; int16_t **tx_layers; int32_t **txdataF; - int8_t Wf[2], Wt[2]; - int l_prime[2], delta; + int8_t Wf[2], Wt[2], l_prime[2], delta; uint8_t nb_dmrs_re_per_rb; int ap, i; int sample_offsetF, N_RE_prime; @@ -412,7 +411,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (is_dmrs == 1) { // if transform precoding is enabled if (pusch_pdu->transform_precoding == 0) { - + ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[2*dmrs_idx]) >> 15; ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[(2*dmrs_idx) + 1]) >> 15; diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index ddec605253..cb929f1642 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -805,8 +805,8 @@ void nr_generate_pucch1_old(PHY_VARS_NR_UE *ue, } #endif //0 -static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) __attribute__((always_inline)); -static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) { +inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) __attribute__((always_inline)); +inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) { uint32_t x1, x2, s=0; int i; uint8_t c; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index fb4f9a0092..11b5112a6c 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -96,6 +96,20 @@ typedef struct { uint32_t subframe; /// MIMO mode for this DLSCH MIMO_mode_t mimo_mode; + /// Concatenated sequences + uint8_t *e; + /// LDPC-code outputs + uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; + /// Interleaver outputs + uint8_t *f; + /// Number of code segments + uint32_t C; + /// Number of bits in "small" code segments + uint32_t K; + /// Number of "Filler" bits + uint32_t F; + /// Encoder BG + uint8_t BG; /// LDPC lifting size uint32_t Z; } NR_DL_gNB_HARQ_t; @@ -854,9 +868,6 @@ typedef struct PHY_VARS_gNB_s { time_stats_t dlsch_encoding_stats; time_stats_t dlsch_modulation_stats; time_stats_t dlsch_scrambling_stats; - time_stats_t dlsch_resource_mapping_stats; - time_stats_t dlsch_layer_mapping_stats; - time_stats_t dlsch_precoding_stats; time_stats_t tinput; time_stats_t tprep; time_stats_t tparity; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 792667d510..1685e206ae 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -263,7 +263,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0); //dumpsig=1; } else { - LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", + LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot, rdata->harq_pid, pusch_pdu->pusch_data.new_data_indicator, ulsch_harq->status, ulsch_harq->round, @@ -358,11 +358,10 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); - LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, dmrs symbol positions %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", + LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", pusch_pdu->rb_size, number_symbols, nb_re_dmrs, - pusch_pdu->ul_dmrs_symb_pos, number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 5007f19063..fb36b3ee86 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1022,14 +1022,14 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8); - - - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", + +#ifdef NR_PDSCH_DEBUG + LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", + LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#endif if(is_cw1_active) { // start ldpc decode for CW 1 @@ -1081,13 +1081,21 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); - +#if PHYSIM + printf(" --> Unscrambling for CW1 %5.3f\n", + (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); + printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", + frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#else LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); +#endif + + LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); @@ -1396,6 +1404,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); + 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)); @@ -1486,6 +1495,7 @@ void *UE_thread_slot1_dl_processing(void *arg) { //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]); + 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) { @@ -1861,6 +1871,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); + LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); @@ -1938,6 +1949,7 @@ if (nr_slot_rx==9) { } stop_meas(&ue->generic_stat); + LOG_D(PHY,"after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); #ifdef EMOS phy_procedures_emos_UE_RX(ue,slot,gNB_id); @@ -1947,6 +1959,7 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); + LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); //#endif //pdsch diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index ff07422c6b..1d9584b30b 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -118,8 +118,7 @@ int main(int argc, char **argv) uint8_t mcs_table = 0; double DS_TDL = .03; cpuf = get_cpu_freq_GHz(); - char gNBthreads[128]="n"; - + if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) { exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n"); } @@ -127,7 +126,7 @@ int main(int argc, char **argv) //logInit(); randominit(0); - while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:X:")) != -1) { + while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:")) != -1) { switch (c) { /*case 'f': write_output_file = 1; @@ -293,11 +292,6 @@ int main(int argc, char **argv) nb_rb = atoi(optarg); break; - case 'X': - strncpy(gNBthreads, optarg, sizeof(gNBthreads)); - gNBthreads[sizeof(gNBthreads)-1]=0; - break; - /*case 'x': transmission_mode = atoi(optarg); break;*/ @@ -358,8 +352,6 @@ int main(int argc, char **argv) RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *)); RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; - gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); - initTpool(gNBthreads, gNB->threadPool, true); //gNB_config = &gNB->gNB_config; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; @@ -476,6 +468,7 @@ int main(int argc, char **argv) double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); + double errors_bit_uncoded = 0; //unsigned char *estimated_output; unsigned char *estimated_output_bit; unsigned char *test_input_bit; @@ -513,10 +506,8 @@ int main(int argc, char **argv) //printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32)); // generate signal - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { - nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } for (SNR = snr0; SNR < snr1; SNR += snr_step) { @@ -524,6 +515,7 @@ int main(int argc, char **argv) n_false_positive = 0; for (trial = 0; trial < n_trials; trial++) { + errors_bit_uncoded = 0; for (i = 0; i < available_bits; i++) { #ifdef DEBUG_CODER if ((i&0xf)==0) @@ -532,12 +524,11 @@ int main(int argc, char **argv) //if (i<16) // printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]); - - if (output[i] == 0) + if (dlsch->harq_process.f[i] == 0) modulated_input[i] = 1.0; ///sqrt(2); //QPSK else modulated_input[i] = -1.0; ///sqrt(2); - + //if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]); //SNR =10; SNR_lin = pow(10, SNR / 10.0); @@ -555,14 +546,18 @@ int main(int argc, char **argv) i,modulated_input[i], i,channel_output_fixed[i]); */ - //Uncoded BER if (channel_output_fixed[i] < 0) channel_output_uncoded[i] = 1; //QPSK demod else channel_output_uncoded[i] = 0; + + if (channel_output_uncoded[i] != dlsch->harq_process.f[i]) + errors_bit_uncoded = errors_bit_uncoded + 1; } + //if (errors_bit_uncoded>10) + //printf("errors bits uncoded %f\n", errors_bit_uncoded); #ifdef DEBUG_CODER printf("\n"); exit(-1); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index fa868a6896..50e21ac02b 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -277,7 +277,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, UE_info->CellGroup[0], sched_ctrl->active_bwp, NULL, - /* tda = */ 0, + /* tda = */ 2, dci_format, ps); @@ -369,7 +369,6 @@ int main(int argc, char **argv) uint8_t n_tx=1,n_rx=1; uint8_t round; uint8_t num_rounds = 4; - char gNBthreads[128]="n"; channel_desc_t *gNB2UE; //uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0; @@ -431,7 +430,9 @@ int main(int argc, char **argv) FILE *scg_fd=NULL; - while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:m:w:T:U:qX:")) != -1) { + + while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:m:w:T:U:q")) != -1) { + switch (c) { case 'f': scg_fd = fopen(optarg,"r"); @@ -634,12 +635,7 @@ int main(int argc, char **argv) dmrs_arg[i] = atoi(argv[optind++]); } break; - - case 'X': - strncpy(gNBthreads, optarg, sizeof(gNBthreads)); - gNBthreads[sizeof(gNBthreads)-1]=0; - break; - + default: case 'h': printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", @@ -675,8 +671,7 @@ int main(int argc, char **argv) printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n"); printf("-P Print DLSCH performances\n"); printf("-w Write txdata to binary file (one frame)\n"); - printf("-d number of dlsch threads, 0: no dlsch parallelization\n"); - printf("-X gNB thread pool configuration, n => no threads"); + printf("-D number of dlsch threads, 0: no dlsch parallelization\n"); exit (-1); break; } @@ -767,7 +762,7 @@ int main(int argc, char **argv) NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup)); prepare_scc(rrc.carrier.servingcellconfigcommon); uint64_t ssb_bitmap = 1; - fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); + fill_scc(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); ssb_bitmap = 1;// Enable only first SSB with index ssb_indx=0 fix_scc(scc,ssb_bitmap); @@ -832,14 +827,6 @@ int main(int argc, char **argv) fs = 61.44e6; bw = 40e6; } - else if (mu == 1 && N_RB_DL == 133) { - fs = 61.44e6; - bw = 50e6; - } - else if (mu == 1 && N_RB_DL == 162) { - fs = 61.44e6; - bw = 60e6; - } else if (mu == 3 && N_RB_DL == 66) { fs = 122.88e6; bw = 100e6; @@ -979,7 +966,8 @@ int main(int argc, char **argv) snrRun = 0; gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); - initTpool(gNBthreads, gNB->threadPool, true); + char tp_param[] = "n"; + initTpool(tp_param, gNB->threadPool, true); gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->resp_L1_tx); // we create 2 threads for L1 tx processing @@ -1229,8 +1217,8 @@ int main(int argc, char **argv) UE->dlsch[UE_proc.thread_id][0][0]->max_ldpc_iterations+1) n_errors++; - //NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id]; - //int16_t *UE_llr = pdsch_vars[0]->llr[0]; + NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id]; + int16_t *UE_llr = pdsch_vars[0]->llr[0]; TBS = UE_harq_process->TBS;//rel15->TBSize[0]; uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); @@ -1245,7 +1233,6 @@ int main(int argc, char **argv) printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) ); } - /* for (i = 0; i < available_bits; i++) { if(((gNB_dlsch->harq_process.f[i] == 0) && (UE_llr[i] <= 0)) || @@ -1259,7 +1246,6 @@ int main(int argc, char **argv) } } - */ for (i = 0; i < TBS; i++) { estimated_output_bit[i] = (UE_harq_process->b[i/8] & (1 << (i & 7))) >> (i & 7); @@ -1303,9 +1289,11 @@ int main(int argc, char **argv) printf("\n"); if (print_perf==1) { - printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n", + printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d, Kr %d (Zc %d))\n", 1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex, - msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3); + msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, + msgDataTx->dlsch[0][0]->harq_process.K, + msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); @@ -1317,9 +1305,6 @@ int main(int argc, char **argv) printStatIndent3(&gNB->dlsch_interleaving_stats, "DLSCH Interleaving time"); printStatIndent2(&gNB->dlsch_modulation_stats,"DLSCH modulation time"); printStatIndent2(&gNB->dlsch_scrambling_stats, "DLSCH scrambling time"); - printStatIndent2(&gNB->dlsch_layer_mapping_stats, "DLSCH Layer Mapping time"); - printStatIndent2(&gNB->dlsch_resource_mapping_stats, "DLSCH Resource Mapping time"); - printStatIndent2(&gNB->dlsch_precoding_stats,"DLSCH Layer Precoding time"); printf("\nUE RX function statistics (per %d us slot)\n",1000>>*scc->ssbSubcarrierSpacing); diff --git a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h index 805913d055..8d4acd1af1 100644 --- a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h +++ b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h @@ -59,7 +59,167 @@ int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {return(0);} //NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);} int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); } -void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul); + +void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) { + + *scc->physCellId=0; \ + // *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0; + *scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; + scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; + *scc->ssbSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; + *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB=641032; + *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]=78; + scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA=640000; + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; + + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_DL; + scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth=13036; + scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing=mu_dl;//NR_SubcarrierSpacing_kHz30; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=12; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero=0; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0=0; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=40; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0=0; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=53; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0=0; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength=54; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0=-1; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength=54; + *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=78; + *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_UL; + *scc->uplinkConfigCommon->frequencyInfoUL->p_Max=20; + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth=13036; + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing=mu_ul;//NR_SubcarrierSpacing_kHz30; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex=98; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM=NR_RACH_ConfigGeneric__msg1_FDM_one; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart=0; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig=13; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower=-118; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax=NR_RACH_ConfigGeneric__preambleTransMax_n10; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep=NR_RACH_ConfigGeneric__powerRampingStep_dB2; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer=NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; + *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB=19; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2=6; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2=6; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=69; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2=6; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2=33; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength=55; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; + scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; + *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40; + *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90; + scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; + *ssb_bitmap=0xff; + scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots=7; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols=6; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots=2; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols=4; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity=321; + + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols=-1; + scc->ss_PBCH_BlockPower=20; + *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1; +} + void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap); void prepare_scc(NR_ServingCellConfigCommon_t *scc); void prepare_scd(NR_ServingCellConfig_t *scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 97c753d455..a7075eb218 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -707,7 +707,7 @@ int main(int argc, char **argv) NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup)); prepare_scc(rrc.carrier.servingcellconfigcommon); uint64_t ssb_bitmap; - fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); + fill_scc(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); fix_scc(scc,ssb_bitmap); @@ -732,13 +732,17 @@ int main(int argc, char **argv) nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; cfg->carrier_config.num_tx_ant.value = n_tx; cfg->carrier_config.num_rx_ant.value = n_rx; -// nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); + nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); phy_init_nr_gNB(gNB,0,1); N_RB_DL = gNB->frame_parms.N_RB_DL; NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]; + //crcTableInit(); + + //nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_UL, mu, Nid_cell, SSB_positions); + //configure UE UE = malloc(sizeof(PHY_VARS_NR_UE)); diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index e1886b57ff..f61648d8b4 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -412,7 +412,7 @@ typedef struct NRRrcConfigurationReq_s { int sib1_tda; int pdsch_AntennaPorts; int pusch_AntennaPorts; - int minRXTXTIME; + int minRXTXTIMEpdsch; int do_CSIRS; int pusch_TargetSNRx10; int pucch_TargetSNRx10; diff --git a/openair2/GNB_APP/RRC_nr_paramsvalues.h b/openair2/GNB_APP/RRC_nr_paramsvalues.h index 8a7ce64d91..70295b1c31 100644 --- a/openair2/GNB_APP/RRC_nr_paramsvalues.h +++ b/openair2/GNB_APP/RRC_nr_paramsvalues.h @@ -58,6 +58,56 @@ #define GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO "initialDLBWPcontrolResourceSetZero" #define GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO "initialDLBWPsearchSpaceZero" + +#define GNB_CONFIG_STRING_INITIALDLBWPK0_0 "initialDLBWPk0_0" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0 "initialDLBWPmappingType_0" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0 "initialDLBWPstartSymbolAndLength_0" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_1 "initialDLBWPk0_1" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1 "initialDLBWPmappingType_1" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1 "initialDLBWPstartSymbolAndLength_1" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_2 "initialDLBWPk0_2" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2 "initialDLBWPmappingType_2" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2 "initialDLBWPstartSymbolAndLength_2" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_3 "initialDLBWPk0_3" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3 "initialDLBWPmappingType_3" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3 "initialDLBWPstartSymbolAndLength_3" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_4 "initialDLBWPk0_4" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4 "initialDLBWPmappingType_4" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4 "initialDLBWPstartSymbolAndLength_4" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_5 "initialDLBWPk0_5" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5 "initialDLBWPmappingType_5" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5 "initialDLBWPstartSymbolAndLength_5" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_6 "initialDLBWPk0_6" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6 "initialDLBWPmappingType_6" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6 "initialDLBWPstartSymbolAndLength_6" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_7 "initialDLBWPk0_7" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7 "initialDLBWPmappingType_7" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7 "initialDLBWPstartSymbolAndLength_7" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_8 "initialDLBWPk0_8" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8 "initialDLBWPmappingType_8" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8 "initialDLBWPstartSymbolAndLength_8" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_9 "initialDLBWPk0_9" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9 "initialDLBWPmappingType_9" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9 "initialDLBWPstartSymbolAndLength_9" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_10 "initialDLBWPk0_10" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10 "initialDLBWPmappingType_10" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10 "initialDLBWPstartSymbolAndLength_10" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_11 "initialDLBWPk0_11" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11 "initialDLBWPmappingType_11" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11 "initialDLBWPstartSymbolAndLength_11" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_12 "initialDLBWPk0_12" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12 "initialDLBWPmappingType_12" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12 "initialDLBWPstartSymbolAndLength_12" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_13 "initialDLBWPk0_13" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13 "initialDLBWPmappingType_13" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13 "initialDLBWPstartSymbolAndLength_13" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_14 "initialDLBWPk0_14" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14 "initialDLBWPmappingType_14" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14 "initialDLBWPstartSymbolAndLength_14" +#define GNB_CONFIG_STRING_INITIALDLBWPK0_15 "initialDLBWPk0_15" +#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15 "initialDLBWPmappingType_15" +#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15 "initialDLBWPstartSymbolAndLength_15" + #define GNB_CONFIG_STRING_ULFREQUENCYBAND "ul_frequencyBand" #define GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA "ul_absoluteFrequencyPointA" #define GNB_CONFIG_STRING_ULOFFSETTOCARRIER "ul_offstToCarrier" @@ -92,6 +142,54 @@ #define GNB_CONFIG_STRING_HOPPINGID "hoppingId" #define GNB_CONFIG_STRING_P0NOMINAL "p0_nominal" #define GNB_CONFIG_STRING_PUCCHRES "pucch_ResourceCommon" +#define GNB_CONFIG_STRING_INITIALULBWPK2_0 "initialULBWPk2_0" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0 "initialULBWPmappingType_0" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0 "initialULBWPstartSymbolAndLength_0" +#define GNB_CONFIG_STRING_INITIALULBWPK2_1 "initialULBWPk2_1" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1 "initialULBWPmappingType_1" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1 "initialULBWPstartSymbolAndLength_1" +#define GNB_CONFIG_STRING_INITIALULBWPK2_2 "initialULBWPk2_2" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2 "initialULBWPmappingType_2" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2 "initialULBWPstartSymbolAndLength_2" +#define GNB_CONFIG_STRING_INITIALULBWPK2_3 "initialULBWPk2_3" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3 "initialULBWPmappingType_3" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3 "initialULBWPstartSymbolAndLength_3" +#define GNB_CONFIG_STRING_INITIALULBWPK2_4 "initialULBWPk2_4" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4 "initialULBWPmappingType_4" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4 "initialULBWPstartSymbolAndLength_4" +#define GNB_CONFIG_STRING_INITIALULBWPK2_5 "initialULBWPk2_5" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5 "initialULBWPmappingType_5" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5 "initialULBWPstartSymbolAndLength_5" +#define GNB_CONFIG_STRING_INITIALULBWPK2_6 "initialULBWPk2_6" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6 "initialULBWPmappingType_6" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6 "initialULBWPstartSymbolAndLength_6" +#define GNB_CONFIG_STRING_INITIALULBWPK2_7 "initialULBWPk2_7" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7 "initialULBWPmappingType_7" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7 "initialULBWPstartSymbolAndLength_7" +#define GNB_CONFIG_STRING_INITIALULBWPK2_8 "initialULBWPk2_8" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8 "initialULBWPmappingType_8" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8 "initialULBWPstartSymbolAndLength_8" +#define GNB_CONFIG_STRING_INITIALULBWPK2_9 "initialULBWPk2_9" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9 "initialULBWPmappingType_9" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9 "initialULBWPstartSymbolAndLength_9" +#define GNB_CONFIG_STRING_INITIALULBWPK2_10 "initialULBWPk2_10" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10 "initialULBWPmappingType_10" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10 "initialULBWPstartSymbolAndLength_10" +#define GNB_CONFIG_STRING_INITIALULBWPK2_11 "initialULBWPk2_11" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11 "initialULBWPmappingType_11" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11 "initialULBWPstartSymbolAndLength_11" +#define GNB_CONFIG_STRING_INITIALULBWPK2_12 "initialULBWPk2_12" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12 "initialULBWPmappingType_12" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12 "initialULBWPstartSymbolAndLength_12" +#define GNB_CONFIG_STRING_INITIALULBWPK2_13 "initialULBWPk2_13" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13 "initialULBWPmappingType_13" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13 "initialULBWPstartSymbolAndLength_13" +#define GNB_CONFIG_STRING_INITIALULBWPK2_14 "initialULBWPk2_14" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14 "initialULBWPmappingType_14" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14 "initialULBWPstartSymbolAndLength_14" +#define GNB_CONFIG_STRING_INITIALULBWPK2_15 "initialULBWPk2_15" +#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15 "initialULBWPmappingType_15" +#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15 "initialULBWPstartSymbolAndLength_15" #define GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR "ssb_PositionsInBurst_PR" @@ -175,6 +273,54 @@ {GNB_CONFIG_STRING_INITIALDLBWPSUBCARRIERSPACING,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*12*/},\ {GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero,defint64val:12,TYPE_INT64,0/*13*/},\ {GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero,defint64val:0,TYPE_INT64,0/*14*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_0,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0,defint64val:-1,TYPE_INT64,0/*15*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:-1,TYPE_INT64,0/*16*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:-1,TYPE_INT64,0/*17*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_1,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0,defint64val:-1,TYPE_INT64,0/*18*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*19*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*20*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPK0_2,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0,defint64val:-1,TYPE_INT64,0/*21*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*22*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*23*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_3,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0,defint64val:-1,TYPE_INT64,0/*24*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*25*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*26*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_4,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0,defint64val:-1,TYPE_INT64,0/*27*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*28*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*29*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_5,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0,defint64val:-1,TYPE_INT64,0/*30*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*31*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*32*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_6,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0,defint64val:-1,TYPE_INT64,0/*33*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*34*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*35*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_7,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0,defint64val:-1,TYPE_INT64,0/*36*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*37*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*38*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_8,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0,defint64val:-1,TYPE_INT64,0/*39*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*40*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*41*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_9,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0,defint64val:-1,TYPE_INT64,0/*42*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*43*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*44*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_10,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0,defint64val:-1,TYPE_INT64,0/*45*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*46*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*47*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_11,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0,defint64val:-1,TYPE_INT64,0/*48*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*49*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*50*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPK0_12,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0,defint64val:-1,TYPE_INT64,0/*51*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*52*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*53*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_13,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0,defint64val:-1,TYPE_INT64,0/*54*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*55*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*56*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_14,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0,defint64val:-1,TYPE_INT64,0/*57*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*58*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*59*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPK0_15,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0,defint64val:-1,TYPE_INT64,0/*60*/}, \ +{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*61*/},\ +{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*62*/},\ {GNB_CONFIG_STRING_ULFREQUENCYBAND,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0],defint64val:-1,TYPE_INT64,0/*63*/},\ {GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA,defint64val:-1,TYPE_INT64,0/*64*/},\ {GNB_CONFIG_STRING_ULOFFSETTOCARRIER,NULL,0,i64ptr:&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier,defint64val:0,TYPE_INT64,0/*65*/},\ @@ -199,6 +345,54 @@ {GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139,defint64val:0,TYPE_INT64,0/*84*/},\ {GNB_CONFIG_STRING_RESTRICTEDSETCONFIG,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,defintval:NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \ {GNB_CONFIG_STRING_MSG3TRANSFPREC,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder,defintval:1,TYPE_INT64,0/*86*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPK2_0,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2,defint64val:-1,TYPE_INT64,0/*87*/},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,/*88*/},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:55,TYPE_INT64,0/*89*/},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_1,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2,defint64val:-1,TYPE_INT64,0/*90*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_2,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_3,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_4,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*100*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_5,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_6,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_7,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*110*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPK2_8,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_9,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_10,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_11,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2,defint64val:-1,TYPE_INT64,0/*120*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_12,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_13,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_14,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*130*/}, \ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPK2_15,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2,defint64val:-1,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ +{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ {GNB_CONFIG_STRING_MSG3DELTAPREABMLE, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble,defint64val:1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_P0NOMINALWITHGRANT, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant,defint64val:1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_PUCCHGROUPHOPPING, NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping,defint64val:NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither,TYPE_INT64,0},\ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d069bfe2f4..9851d14b91 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -94,6 +94,8 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { NR_FreqBandIndicatorNR_t *dl_frequencyBandList,*ul_frequencyBandList; struct NR_SCS_SpecificCarrier *dl_scs_SpecificCarrierList,*ul_scs_SpecificCarrierList; + struct NR_PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation; + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation; // struct NR_RateMatchPattern *ratematchpattern; // NR_RateMatchPatternId_t *ratematchpatternid; // NR_TCI_StateId_t *TCI_StateId; @@ -141,6 +143,14 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->present = NR_SetupRelease_PDSCH_ConfigCommon_PR_setup; scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon)); scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList = CALLOC(1,sizeof(struct NR_PDSCH_TimeDomainResourceAllocationList)); + // + for (int i=0;ik0 = CALLOC(1,sizeof(long)); + *bwp_dl_timedomainresourceallocation->k0=0; + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + bwp_dl_timedomainresourceallocation); + } ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct NR_MultiFrequencyBandListNR)); @@ -189,6 +199,12 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list,ul_scs_SpecificCarrierList); + for (int i=0;ik2 = CALLOC(1,sizeof(long)); + *pusch_configcommontimedomainresourceallocation->k2=0; + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_configcommontimedomainresourceallocation); + } //ratematchpattern = CALLOC(1,sizeof(struct NR_RateMatchPattern)); //ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps)); //ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf = MALLOC(35); @@ -207,92 +223,6 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { } -void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) { - - *scc->physCellId=0; \ - // *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0; - *scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; - scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; - *scc->ssbSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; - *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB=641032; - *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]=78; - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA=640000; - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; - - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_DL; - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth=13036; - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing=mu_dl;//NR_SubcarrierSpacing_kHz30; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=12; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero=0; - struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation0 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); - timedomainresourceallocation0->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation0->startSymbolAndLength=54; - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - timedomainresourceallocation0); - struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation1 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); - timedomainresourceallocation1->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation1->startSymbolAndLength=57; - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - timedomainresourceallocation1); - *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=78; - *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_UL; - *scc->uplinkConfigCommon->frequencyInfoUL->p_Max=20; - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth=13036; - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing=mu_ul;//NR_SubcarrierSpacing_kHz30; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex=98; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM=NR_RACH_ConfigGeneric__msg1_FDM_one; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart=0; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig=13; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower=-118; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax=NR_RACH_ConfigGeneric__preambleTransMax_n10; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep=NR_RACH_ConfigGeneric__powerRampingStep_dB2; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer=NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; - *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB=19; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation0 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation0->k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation0->k2=6; - pusch_timedomainresourceallocation0->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation0->startSymbolAndLength=55; - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation0); - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation1 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation1->k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation1->k2=6; - pusch_timedomainresourceallocation1->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation1->startSymbolAndLength=38; - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; - scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40; - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90; - scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; - *ssb_bitmap=0xff; - scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots=7; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols=6; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots=2; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols=4; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity=321; - - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols=-1; - scc->ss_PBCH_BlockPower=20; - *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1; -} - void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { @@ -343,9 +273,24 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { if (*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder!=0) scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = NULL; - // prepare DL Allocation lists - nr_rrc_config_dl_tda(scc); + // fix DL and UL Allocation lists + + for (int i=scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count-1;i>=0;i--) { + printf("Checking element %d : %ld\n",i,*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0); + if (*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0>32) { + printf("removing pdsch_TimeDomainAllocationList element %d\n",i); + free(scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0); + asn_sequence_del(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,i,1); + printf("List size now %d\n",scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count); + } + } + for (int i=scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.count-1;i>=0;i--) { + if (*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[i]->k2>32) { + free(scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[i]->k2); + asn_sequence_del(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,i,1); + } + } if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { free(scc->tdd_UL_DL_ConfigurationCommon->pattern2); scc->tdd_UL_DL_ConfigurationCommon->pattern2=NULL; @@ -1162,9 +1107,11 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; - printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; + printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; + printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 730b6b85b6..0c3d971569 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -119,7 +119,7 @@ typedef enum { #define GNB_CONFIG_STRING_SIB1TDA "sib1_tda" #define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" -#define GNB_CONFIG_STRING_MINRXTXTIME "min_rxtxtime" +#define GNB_CONFIG_STRING_MINRXTXTIMEPDSCH "min_rxtxtime_pdsch" #define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" @@ -148,7 +148,7 @@ typedef enum { {GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ -{GNB_CONFIG_STRING_MINRXTXTIME, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ } @@ -172,7 +172,7 @@ typedef enum { #define GNB_SIB1_TDA_IDX 17 #define GNB_DO_CSIRS_IDX 18 #define GNB_NRCELLID_IDX 19 -#define GNB_MINRXTXTIME_IDX 20 +#define GNB_MINRXTXTIMEPDSCH_IDX 20 #define GNB_ULPRBBLACKLIST_IDX 21 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 764c92ecb7..f67a3e1fa5 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -44,9 +44,46 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int nrofUplinkSlots, int nrofUplinkSymbols) { int slot_number = 0; - int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period); + int nb_periods_per_frame; int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period) { + case 0: + nb_periods_per_frame = 20; // 10ms/0p5ms + break; + + case 1: + nb_periods_per_frame = 16; // 10ms/0p625ms + break; + + case 2: + nb_periods_per_frame = 10; // 10ms/1ms + break; + + case 3: + nb_periods_per_frame = 8; // 10ms/1p25ms + break; + + case 4: + nb_periods_per_frame = 5; // 10ms/2ms + break; + + case 5: + nb_periods_per_frame = 4; // 10ms/2p5ms + break; + + case 6: + nb_periods_per_frame = 2; // 10ms/5ms + break; + + case 7: + nb_periods_per_frame = 1; // 10ms/10ms + break; + + default: + AssertFatal(1==0,"Undefined tdd period %d\n", cfg->tdd_table.tdd_period); + } + int nb_slots_per_period = ((1<tdd_table.tdd_period_in_slots = nb_slots_per_period; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 2f4ceb48ec..a5f6e4a7d1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -944,10 +944,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr return -1; } - if(rnti != ra->ra_rnti && rnti != SI_RNTI) - AssertFatal(1+dci->pdsch_to_harq_feedback_timing_indicator.val>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d).\n", - 1+dci->pdsch_to_harq_feedback_timing_indicator.val,DURATION_RX_TO_TX); - // set the harq status at MAC for feedback set_harq_status(mac,dci->pucch_resource_indicator, dci->harq_pid, @@ -1236,7 +1232,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; - AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d). Min feedback time set in config file (min_rxtxtime).\n", + AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d)\n", feedback_ti,DURATION_RX_TO_TX); // set the harq status at MAC for feedback @@ -3164,10 +3160,10 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, pos+=fsize; dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<time_domain_assignment.nbits; - dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<time_domain_assignment.nbits)-1); + dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&0x3; // Not supported yet - skip for now // Frequency hopping flag – 1 bit diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 3d45877979..c142af13ba 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -129,7 +129,7 @@ long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) { } AssertFatal(k2 >= DURATION_RX_TO_TX, - "Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d). K2 set according to min_rxtxtime in config file.\n", + "Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d)\n", k2,DURATION_RX_TO_TX); LOG_D(NR_MAC, "get_k2(): k2 is %ld\n", k2); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 2705b85b8c..25aeea70a6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -870,6 +870,9 @@ void nr_get_Msg3alloc(module_id_t module_id, int mu = ubwp ? ubwp->bwp_Common->genericParameters.subcarrierSpacing : scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; + int StartSymbolIndex = 0; + int NrOfSymbols = 0; + int startSymbolAndLength = 0; int temp_slot = 0; ra->Msg3_tda_id = 16; // initialization to a value above limit @@ -878,29 +881,20 @@ void nr_get_Msg3alloc(module_id_t module_id, scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; uint8_t k2 = 0; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); - if (frame_type == TDD) { - int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); - int nb_slots_per_period = ((1<list.count; i++) { + for (int i=0; ilist.count; i++) { + startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; + SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols); + // we want to transmit in the uplink symbols of mixed slot + if (NrOfSymbols == scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols) { k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2; - // we want to transmit in the uplink symbols of mixed slot - if ((k2 + DELTA[mu])%nb_slots_per_period == 0) { - temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 - ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; - if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { - ra->Msg3_tda_id = i; - break; - } + temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 + ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; + if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { + ra->Msg3_tda_id = i; + break; } } } - else { - ra->Msg3_tda_id = 0; - k2 = *pusch_TimeDomainAllocationList->list.array[0]->k2; - temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 - ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; - } AssertFatal(ra->Msg3_tda_id<16,"Unable to find Msg3 time domain allocation in list\n"); @@ -921,7 +915,7 @@ void nr_get_Msg3alloc(module_id_t module_id, tdd_beam_association[num_tdd_period] = ra->beam_id; } - LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id); + LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u start symbol index %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id, StartSymbolIndex); uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[ra->Msg3_slot * MAX_BWP_SIZE]; @@ -978,7 +972,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->bwp_size = bwp_size; pusch_pdu->subcarrier_spacing = scs; pusch_pdu->cyclic_prefix = 0; - pusch_pdu->mcs_index = 1; + pusch_pdu->mcs_index = 0; pusch_pdu->mcs_table = 0; pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); @@ -1015,14 +1009,11 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.new_data_indicator = 1; pusch_pdu->pusch_data.num_cb = 0; - int num_dmrs_symb = 0; - for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) - num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->target_code_rate, pusch_pdu->rb_size, pusch_pdu->nr_of_symbols, - num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol + 12, // nb dmrs set for no data in dmrs symbol 0, //nb_rb_oh 0, // to verify tb scaling pusch_pdu->nrOfLayers)>>3; @@ -1083,7 +1074,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t fh = ubwp->bwp_Dedicated->pusch_Config->choice.setup->frequencyHopping ? 1 : 0; } - LOG_D(NR_MAC, "Frame %d, Slot %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", + LOG_D(NR_MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", frameP, slotP, ra->Msg3_frame, @@ -1114,12 +1105,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if ((ra->Msg2_frame == frameP) && (ra->Msg2_slot == slotP)) { - //TODO time domain assignment for msg2 needs to be improved - uint8_t time_domain_assignment; - if(cc->frame_type == TDD) - time_domain_assignment = 1; - else - time_domain_assignment = 0; + uint8_t time_domain_assignment = 1; uint8_t mcsIndex = 0; int rbStart = 0; int rbSize = 8; @@ -1259,8 +1245,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type) dmrsConfigType = 1; - NR_PDSCH_Config_t *pdsch_config = bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pdsch_Config ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL; - pdsch_pdu_rel15->pduBitmap = 0; pdsch_pdu_rel15->rnti = ra->RA_rnti; pdsch_pdu_rel15->pduIndex = pduindex; @@ -1289,7 +1273,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra pdsch_pdu_rel15->VRBtoPRBMapping = 0; pdsch_pdu_rel15->StartSymbolIndex = startSymbolIndex; pdsch_pdu_rel15->NrOfSymbols = nrOfSymbols; - pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, + pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7b7b5c771b..33cb2b1b1d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -351,7 +351,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, - const NR_BWP_UplinkDedicated_t *ubwpd, + const NR_BWP_UplinkDedicated_t *ubwpd, long dci_format, int tda, uint8_t num_dmrs_cdm_grps_no_data, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index c68b16b553..313dd6236e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -104,6 +104,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* check that TDA index 1 fits into UL slot and does not overlap with PUCCH */ const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + AssertFatal(tdaList->list.count >= 3, "need to have at least three TDAs for UL slots\n"); const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_UL = tdaList->list.array[0]; const int k2 = get_K2(scc, (NR_BWP_Uplink_t*)ubwp,0, mu); int start, len; @@ -116,28 +117,27 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub // get largest time domain allocation (TDA) for UL slot and UL in mixed slot int tdaMi = -1; - if(tdaList->list.count > 1) { - const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; - AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), - "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", - k2, - get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); - SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); - const uint16_t symb_tda_mi = ((1 << len) - 1) << start; - // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check - // whether TDA is entirely within mixed slot, UL. Note that here we assume - // that the PUCCH is scheduled in every slot, and on all RBs (which is - // mostly not true, this is a simplification) - if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { - tdaMi = 1; - } else { - LOG_E(NR_MAC, - "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", - symb_pucch, - symb_ulMixed, - symb_tda_mi); - } + const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; + AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), + "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", + k2, + get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); + SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); + const uint16_t symb_tda_mi = ((1 << len) - 1) << start; + // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check + // whether TDA is entirely within mixed slot, UL. Note that here we assume + // that the PUCCH is scheduled in every slot, and on all RBs (which is + // mostly not true, this is a simplification) + if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { + tdaMi = 1; + } else { + LOG_E(NR_MAC, + "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", + symb_pucch, + symb_ulMixed, + symb_tda_mi); } + const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 5e5de9a8e1..547c5da00c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -64,7 +64,7 @@ void *nrmac_stats_thread(void *arg) { fseek(fd,0,SEEK_SET); } fclose(fd); - return NULL; + return (void *)0; } void clear_mac_stats(gNB_MAC_INST *gNB) { diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index bdd1cf5261..ff6923429e 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1185,9 +1185,9 @@ void fill_initial_SpCellConfig(rnti_t rnti, long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - AssertFatal(carrier->minRXTXTIME >=2 && carrier->minRXTXTIME <7, - "check minRXTXTIME %d\n",carrier->minRXTXTIME); - *delay[i] = (i+carrier->minRXTXTIME); + AssertFatal(carrier->minRXTXTIMEpdsch >=2 && carrier->minRXTXTIMEpdsch <7, + "check minRXTXTIMEpdsch %d\n",carrier->minRXTXTIMEpdsch); + *delay[i] = (i+carrier->minRXTXTIMEpdsch); ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 6b7f9a21b9..dedd4cf839 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -29,79 +29,96 @@ */ #include "nr_rrc_config.h" -#include "common/utils/nr/nr_common.h" -void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ - - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); - - // setting default TDA for DL with - struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); - timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,13); // basic slot configuration starting in symbol 1 til the end of the slot - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - timedomainresourceallocation); - - if(frame_type==TDD) { - // TDD - if(scc->tdd_UL_DL_ConfigurationCommon) { - int dl_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols; - if(dl_symb > 1) { - timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); - timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,dl_symb-1); // mixed slot configuration starting in symbol 1 til the end of the dl allocation - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - timedomainresourceallocation); - } - } - } +void rrc_config_rlc_bearer(uint8_t Mod_id, + int CC_id, + rlc_bearer_config_t *rlc_config + ){ + rlc_config->LogicalChannelIdentity[CC_id] = 0; + rlc_config->servedRadioBearer_present[CC_id] = 0; + rlc_config->srb_Identity[CC_id] = 0; + rlc_config->drb_Identity[CC_id] = 0; + rlc_config->reestablishRLC[CC_id] = 0; + rlc_config->rlc_Config_present[CC_id] = 0; + rlc_config->ul_AM_sn_FieldLength[CC_id] = 0; + rlc_config->t_PollRetransmit[CC_id] = 0; + rlc_config->pollPDU[CC_id] = 0; + rlc_config->pollByte[CC_id] = 0; + rlc_config->maxRetxThreshold[CC_id] = 0; + rlc_config->dl_AM_sn_FieldLength[CC_id] = 0; + rlc_config->dl_AM_t_Reassembly[CC_id] = 0; + rlc_config->t_StatusProhibit[CC_id] = 0; + rlc_config->ul_UM_sn_FieldLength[CC_id] = 0; + rlc_config->dl_UM_sn_FieldLength[CC_id] = 0; + rlc_config->dl_UM_t_Reassembly[CC_id] = 0; + rlc_config->priority[CC_id] = 0; + rlc_config->prioritisedBitRate[CC_id] = 0; + rlc_config->bucketSizeDuration[CC_id] = 0; + rlc_config->allowedServingCells[CC_id] = 0; + rlc_config->subcarrierspacing[CC_id] = 0; + rlc_config->maxPUSCH_Duration[CC_id] = 0; + rlc_config->configuredGrantType1Allowed[CC_id] = 0; + rlc_config->logicalChannelGroup[CC_id] = 0; + rlc_config->schedulingRequestID[CC_id] = 0; + rlc_config->logicalChannelSR_Mask[CC_id] = 0; + rlc_config->logicalChannelSR_DelayTimerApplied[CC_id] = 0; } - -void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ - - //TODO change to accomodate for SRS - - int temp_min_delay = 6; // k2 = 2 or 3 won'r work as well as higher values - int k2 = (min_fb_delayuplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); - - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation->k2 = k2; - pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0,13); // basic slot configuration starting in symbol 0 til the last but one symbol - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); - - if(frame_type==TDD) { - // TDD - if(scc->tdd_UL_DL_ConfigurationCommon) { - int ul_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; - pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); - pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation->k2 = k2; - pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); - - // for msg3 in the mixed slot - int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); - int nb_slots_per_period = ((1<k2 = CALLOC(1,sizeof(long)); - *pusch_timedomainresourceallocation_msg3->k2 = nb_slots_per_period - DELTA[mu]; - if(*pusch_timedomainresourceallocation_msg3->k2 < min_fb_delay) - *pusch_timedomainresourceallocation_msg3->k2 += nb_slots_per_period; - AssertFatal(*pusch_timedomainresourceallocation_msg3->k2<33,"Computed k2 for msg3 %ld is larger than the range allowed by RRC (0..32)\n", - *pusch_timedomainresourceallocation_msg3->k2); - pusch_timedomainresourceallocation_msg3->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3); - } - } - +void rrc_config_mac_cellgroup(uint8_t Mod_id, + int CC_id, + mac_cellgroup_t *mac_cellgroup_config + ){ + mac_cellgroup_config->DRX_Config_PR[CC_id] = 0; + mac_cellgroup_config->drx_onDurationTimer_PR[CC_id] = 0; + mac_cellgroup_config->subMilliSeconds[CC_id] = 0; + mac_cellgroup_config->milliSeconds[CC_id] = 0; + mac_cellgroup_config->drx_InactivityTimer[CC_id] = 0; + mac_cellgroup_config->drx_HARQ_RTT_TimerDL[CC_id] = 0; + mac_cellgroup_config->drx_HARQ_RTT_TimerUL[CC_id] = 0; + mac_cellgroup_config->drx_RetransmissionTimerDL[CC_id] = 0; + mac_cellgroup_config->drx_RetransmissionTimerUL[CC_id] = 0; + mac_cellgroup_config->drx_LongCycleStartOffset_PR[CC_id] = 0; + mac_cellgroup_config->drx_LongCycleStartOffset[CC_id] = 0; + mac_cellgroup_config->drx_ShortCycle[CC_id] = 0; + mac_cellgroup_config->drx_ShortCycleTimer[CC_id] = 0; + mac_cellgroup_config->drx_SlotOffset[CC_id] = 0; + mac_cellgroup_config->schedulingRequestId[CC_id] = 0; + mac_cellgroup_config->sr_ProhibitTimer[CC_id] = 0; + mac_cellgroup_config->sr_TransMax[CC_id] = 0; + mac_cellgroup_config->periodicBSR_Timer[CC_id] = 0; + mac_cellgroup_config->retxBSR_Timer[CC_id] = 0; + mac_cellgroup_config->logicalChannelSR_DelayTimer[CC_id] = 0; + mac_cellgroup_config->tag_Id[CC_id] = 0; + mac_cellgroup_config->timeAlignmentTimer[CC_id] = 0; + mac_cellgroup_config->PHR_Config_PR[CC_id] = 0; + mac_cellgroup_config->phr_PeriodicTimer[CC_id] = 0; + mac_cellgroup_config->phr_ProhibitTimer[CC_id] = 0; + mac_cellgroup_config->phr_Tx_PowerFactorChange[CC_id] = 0; + mac_cellgroup_config->multiplePHR[CC_id] = 0; + mac_cellgroup_config->phr_Type2SpCell[CC_id] = 0; + mac_cellgroup_config->phr_Type2OtherCell[CC_id] = 0; + mac_cellgroup_config->phr_ModeOtherCG[CC_id] = 0; + mac_cellgroup_config->skipUplinkTxDynamic[CC_id] = 0; } +void rrc_config_physicalcellgroup(uint8_t Mod_id, + int CC_id, + physicalcellgroup_t *physicalcellgroup_config + ){ + physicalcellgroup_config->harq_ACK_SpatialBundlingPUCCH[CC_id] = 0; + physicalcellgroup_config->harq_ACK_SpatialBundlingPUSCH[CC_id] = 0; + physicalcellgroup_config->p_NR[CC_id] = 0; + physicalcellgroup_config->pdsch_HARQ_ACK_Codebook[CC_id] = 0; + physicalcellgroup_config->tpc_SRS_RNTI[CC_id] = 0; + physicalcellgroup_config->tpc_PUCCH_RNTI[CC_id] = 0; + physicalcellgroup_config->tpc_PUSCH_RNTI[CC_id] = 0; + physicalcellgroup_config->sp_CSI_RNTI[CC_id] = 0; + physicalcellgroup_config->RNTI_Value[CC_id] = 0; +} + +void rrc_config_rachdedicated(uint8_t Mod_id, + int CC_id, + physicalcellgroup_t *physicalcellgroup_config + ){ + +} diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index 192fee754e..e19d94b341 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -111,8 +111,29 @@ typedef struct physicalcellgroup_s{ long RNTI_Value[MAX_NUM_CCs]; }physicalcellgroup_t; -void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); -void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); +typedef struct rach_dedicated_s{ + + +}rach_dedicated_t; +void rrc_config_servingcellconfigcommon(uint8_t Mod_id, + int CC_id, + gNB_RrcConfigurationReq *common_configuration + ); + +void rrc_config_rlc_bearer(uint8_t Mod_id, + int CC_id, + rlc_bearer_config_t *rlc_config + ); + +void rrc_config_mac_cellgroup(uint8_t Mod_id, + int CC_id, + mac_cellgroup_t *mac_cellgroup_config + ); + +void rrc_config_physicalcellgroup(uint8_t Mod_id, + int CC_id, + physicalcellgroup_t *physicalcellgroup_config + ); #endif diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index d71393bc2d..ad31e8cac7 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -447,7 +447,7 @@ typedef struct { int sib1_tda; int pdsch_AntennaPorts; int pusch_AntennaPorts; - int minRXTXTIME; + int minRXTXTIMEpdsch; int do_CSIRS; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 7f7353f9af..34e570070d 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -136,6 +136,80 @@ void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) { ///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------/// +void rrc_gNB_process_SgNBAdditionRequest( + const protocol_ctxt_t *const ctxt_pP, + rrc_gNB_ue_context_t *ue_context_pP +) { + rrc_gNB_generate_SgNBAdditionRequestAcknowledge(ctxt_pP,ue_context_pP); +} + +void rrc_gNB_generate_SgNBAdditionRequestAcknowledge( + const protocol_ctxt_t *const ctxt_pP, + rrc_gNB_ue_context_t *const ue_context_pP) { + //uint8_t size; + //uint8_t buffer[100]; + //int CC_id = ue_context_pP->ue_context.primaryCC_id; + //OCTET_STRING_t *secondaryCellGroup; + NR_CellGroupConfig_t *cellGroupconfig; + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList; + struct NR_MAC_CellGroupConfig *mac_CellGroupConfig; + struct NR_PhysicalCellGroupConfig *physicalCellGroupConfig; + struct NR_SpCellConfig *spCellConfig; + //struct NR_CellGroupConfig__sCellToAddModList *sCellToAddModList; + cellGroupconfig = CALLOC(1,sizeof(NR_CellGroupConfig_t)); + cellGroupconfig->rlc_BearerToAddModList = CALLOC(1,sizeof(struct NR_CellGroupConfig__rlc_BearerToAddModList)); + cellGroupconfig->mac_CellGroupConfig = CALLOC(1,sizeof(struct NR_MAC_CellGroupConfig)); + cellGroupconfig->physicalCellGroupConfig = CALLOC(1,sizeof(struct NR_PhysicalCellGroupConfig)); + cellGroupconfig->spCellConfig = CALLOC(1,sizeof(struct NR_SpCellConfig)); + //cellGroupconfig->sCellToAddModList = CALLOC(1,sizeof(struct NR_CellGroupConfig__sCellToAddModList)); + rlc_BearerToAddModList = cellGroupconfig->rlc_BearerToAddModList; + mac_CellGroupConfig = cellGroupconfig->mac_CellGroupConfig; + physicalCellGroupConfig = cellGroupconfig->physicalCellGroupConfig; + spCellConfig = cellGroupconfig->spCellConfig; + //sCellToAddModList = cellGroupconfig->sCellToAddModList; + rlc_bearer_config_t *rlc_config; + rlc_config = CALLOC(1,sizeof(rlc_bearer_config_t)); + //Fill rlc_bearer config value + rrc_config_rlc_bearer(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + rlc_config + ); + //Fill rlc_bearer config to structure + do_RLC_BEARER(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + rlc_BearerToAddModList, + rlc_config); + mac_cellgroup_t *mac_cellgroup_config; + mac_cellgroup_config = CALLOC(1,sizeof(mac_cellgroup_t)); + //Fill mac_cellgroup_config config value + rrc_config_mac_cellgroup(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + mac_cellgroup_config + ); + //Fill mac_cellgroup config to structure + do_MAC_CELLGROUP(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + mac_CellGroupConfig, + mac_cellgroup_config); + physicalcellgroup_t *physicalcellgroup_config; + physicalcellgroup_config = CALLOC(1,sizeof(physicalcellgroup_t)); + //Fill physicalcellgroup_config config value + rrc_config_physicalcellgroup(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + physicalcellgroup_config + ); + //Fill physicalcellgroup config to structure + do_PHYSICALCELLGROUP(ctxt_pP->module_id, + ue_context_pP->ue_context.primaryCC_id, + physicalCellGroupConfig, + physicalcellgroup_config); + do_SpCellConfig(RC.nrrrc[ctxt_pP->module_id], + spCellConfig); +} + +///---------------------------------------------------------------------------------------------------------------/// +///---------------------------------------------------------------------------------------------------------------/// + static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) { LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__); if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { @@ -256,10 +330,9 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset; rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts; - rrc->carrier.minRXTXTIME = configuration->minRXTXTIME; + rrc->carrier.minRXTXTIMEpdsch = configuration->minRXTXTIMEpdsch; rrc->carrier.sib1_tda = configuration->sib1_tda; rrc->carrier.do_CSIRS = configuration->do_CSIRS; - nr_rrc_config_ul_tda(configuration->scc,configuration->minRXTXTIME); /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); rrc->cell_info_configured = 0; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 3311779235..2104d5cdd7 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -241,7 +241,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, - carrier->minRXTXTIME, + carrier->minRXTXTIMEpdsch, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); @@ -251,7 +251,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, - carrier->minRXTXTIME, + carrier->minRXTXTIMEpdsch, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 30604cd015..4b8fd77dc5 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -55,7 +55,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int scg_id, int servCellIndex, int dl_antenna_ports, - int minRXTXTIME, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid) { @@ -483,10 +483,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_PDSCH_TimeDomainResourceAllocation_t *pdschi; for (int i=0;idownlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;i++) { pdschi= calloc(1,sizeof(*pdschi)); - if(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0){ - pdschi->k0 = calloc(1,sizeof(*pdschi->k0)); - *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0; - } + AssertFatal(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0!=NULL,"element %d is null\n",i); + + pdschi->k0 = calloc(1,sizeof(*pdschi->k0)); + *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0; pdschi->mappingType = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType; pdschi->startSymbolAndLength = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; ASN_SEQUENCE_ADD(&bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,pdschi); @@ -946,7 +946,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = i+minRXTXTIME; + *delay[i] = i+minRXTXTIMEpdsch; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); @@ -1349,7 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, - int minRXTXTIME, + int minRXTXTIMEpdsch, int do_csirs, int initial_csi_index, int uid) { @@ -1365,7 +1365,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon 1, 1, dl_antenna_ports, - minRXTXTIME, + minRXTXTIMEpdsch, do_csirs, initial_csi_index, uid); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index c6a4a90a14..b260eaa58d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -55,6 +55,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -111,6 +120,19 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; #p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index fd9399f89e..0306fe5d0b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,20 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 4; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 59e71a6225..c14ad17b42 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 4; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index 3fc81c0d6c..ff0fdd96bb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot (but is not used here) + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,19 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot (not used here) + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index a40a93c789..937790d4ac 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 4; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index 3860aba935..c9a95d59e8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 7c527e07c8..524407c4de 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -109,6 +118,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf index a171f2aae0..d191b67988 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 4f8c785baa..2dfa329346 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf index 012f46401e..7f0829e40a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot (but not used here) + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 63; # this is SS=7 L=5 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 91; # this is SS=7 L=7 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index b6b9252560..6248afab2f 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,20 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 0817d7373e..6f28cd36c1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index fd4c23cfdb..30194647b8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; #12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; # used for (full) DL slot + initialDLBWPmappingType_0 = 0; # 0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; # this is SS=1,L=13 + + initialDLBWPk0_1 = 0; # used for DL part mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; # this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for (full) UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for UL part mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 965408332c..fcbd3c0f02 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -54,6 +54,16 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index e36748a3a9..63123b8201 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7b2d369919..217ff76376 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index dbf4f58348..a1acfc313b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -54,6 +54,16 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 + #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6d23726a78..540dddad21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -54,6 +54,16 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 + #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index c3fa56f15e..edc5eaa0d4 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -54,6 +54,16 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_3 = 0; #for mixed slot + initialDLBWPmappingType_3 = 0; + initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 + #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +118,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 15aa368fdf..362a280ccb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index 1583e07ca1..e541607559 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -54,6 +54,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +131,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 8dfcfb2b88..b1c78bc978 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index d01b0947c0..96f2909031 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -55,7 +55,28 @@ gNBs = initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57) + initialDLBWPstartSymbolAndLength_3 = 57; //43; //57; #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -109,6 +130,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf index 198ad8471c..f51f59ae30 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf @@ -54,6 +54,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -108,6 +117,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2f4839fd3b..59e507ed3e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -56,6 +56,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -110,6 +119,18 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 7f9e4d2d44..05e441d396 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -81,6 +81,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 53; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 81; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -135,6 +158,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=12 + initialULBWPstartSymbolAndLength_0 = 53; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index ab4713f8b5..3bd884b602 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -69,6 +69,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -123,6 +146,21 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9238ea1809..de6bafc9f7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -73,6 +73,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -127,6 +136,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 86318d80e2..c4b06c1139 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -74,6 +74,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -128,6 +137,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 2; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index bbdd8b9c0f..c7531f39ba 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -74,6 +74,15 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -128,6 +137,19 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index e9577ee265..a0d25053b6 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -70,6 +70,29 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=2,L=12 + initialDLBWPstartSymbolAndLength_1 = 53; + + initialDLBWPk0_2 = 0; + initialDLBWPmappingType_2 = 0; + #this is SS=1,L=12 + initialDLBWPstartSymbolAndLength_2 = 54; + + initialDLBWPk0_3 = 0; + initialDLBWPmappingType_3 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -124,6 +147,22 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; + initialULBWPmappingType_0 = 1 + # this is SS=0 L=11 + initialULBWPstartSymbolAndLength_0 = 55; + + initialULBWPk2_1 = 6; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=12 + initialULBWPstartSymbolAndLength_1 = 69; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; From 799e52745f1eafeb647be826a71e7d748355d381 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 13:47:47 +0000 Subject: [PATCH 226/883] Adjust sync based on PSS improvements --- executables/nr-ue.c | 3 --- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 15 ++++++++++++--- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 +----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index c90a5119cd..702c214d9e 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -642,9 +642,6 @@ void *UE_thread(void *arg) { readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms); writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms); } else { - //UE->rx_offset_diff = computeSamplesShift(UE); - - readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms) - UE->rx_offset_diff; writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms)- UE->rx_offset_diff; diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 4ee5884afd..6865a636d5 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -981,6 +981,7 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { int **rxdata = ue->common_vars.rxdata; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; uint8_t Nid2 = GET_NID2(frame_parms->Nid_cell); + int peak_position_ref = ((frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)<<1) + frame_parms->nb_prefix_samples0; int maxval=0; for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) { @@ -996,8 +997,8 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { int peak_position = 0; int64_t result = 0; int64_t avg=0; - int start = 2*(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples) + frame_parms->nb_prefix_samples0 - 200; - int length = 2*frame_parms->ofdm_symbol_size + 200; + int start = peak_position_ref - (frame_parms->ofdm_symbol_size>>3); + int length = frame_parms->ofdm_symbol_size + (frame_parms->ofdm_symbol_size>>3); memset(pss_corr_ue[Nid2],0,(start+length)*sizeof(int64_t)); for (int n=start; n < start+length; n+=4) { // for (int ar=0; arnb_antennas_rx; ar++) { @@ -1019,7 +1020,15 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { return 0; } - int peak_position_diff = peak_position - ( ((frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)<<1) + frame_parms->nb_prefix_samples0); + int peak_position_diff = peak_position_ref - peak_position; + + ue->rx_offset_diff = 0; + if(peak_position_diff != 0) { + ue->rx_offset_diff = peak_position_diff>>3; + if (ue->rx_offset_diff == 0) { + ue->rx_offset_diff = peak_position_diff > 0 ? 1 : -1; + } + } // Fractional frequency offset computation according to Cross-correlation Synchronization Algorithm Using PSS // Shoujun Huang, Yongtao Su, Ying He and Shan Tang, "Joint time and frequency offset estimation in LTE downlink," diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index fb36b3ee86..732d975be4 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1648,7 +1648,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { - int peak_position_diff = nr_adjust_pss_synch(ue, (int *)&ue->common_vars.freq_offset); + nr_adjust_pss_synch(ue, (int *)&ue->common_vars.freq_offset); LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); nr_ue_pbch_procedures(gNB_id, ue, proc, 0); @@ -1664,10 +1664,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, 16384); }*/ - //ue->rx_offset = peak_position_diff; - - ue->rx_offset_diff = -peak_position_diff; - LOG_D(PHY, "Doing N0 measurements in %s\n", __FUNCTION__); nr_ue_rrc_measurements(ue, proc, nr_slot_rx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_OUT); From e1d88d6fc5147c0c42d2511e334a87266ccf452b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 13:49:56 +0000 Subject: [PATCH 227/883] Change log level --- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 6865a636d5..3bf12c0bab 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -1058,13 +1058,7 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { // Computing absolute value of frequency offset *f_off = ffo_est*frame_parms->subcarrier_spacing; - /*nr_rf_card_config_freq(&openair0_cfg[ue->rf_map.card], openair0_cfg->tx_freq[0], openair0_cfg->rx_freq[0], ue->common_vars.freq_offset); - - if (ue->mode != loop_through_memory) { - ue->rfdevice.trx_set_freq_func(&ue->rfdevice,&openair0_cfg[0],0); - }*/ - - LOG_I(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB, ffo %lf\n", + LOG_D(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB, ffo %lf\n", peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg),ffo_est); return peak_position_diff; From 624b307355f5bafe6ca0a7ba84748140d35e8c68 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 24 Dec 2021 12:24:35 +0000 Subject: [PATCH 228/883] Fix warnings after merge with develop --- .../conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- openair1/PHY/INIT/nr_init_ue.c | 11 +---------- openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 11 +++++------ .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 9 ++++++--- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 6 +++++- 6 files changed, 19 insertions(+), 22 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..fd5cc962b1 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -20,23 +20,14 @@ */ #include "phy_init.h" -#include "SCHED_UE/sched_UE.h" #include "PHY/phy_extern_nr_ue.h" -//#include "SIMULATION/TOOLS/sim.h" -/*#include "RadioResourceConfigCommonSIB.h" -#include "RadioResourceConfigDedicated.h" -#include "TDD-Config.h" -#include "MBSFN-SubframeConfigList.h"*/ #include "openair1/PHY/defs_RU.h" #include "openair1/PHY/impl_defs_nr.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "assertions.h" -#include +#include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -//#include "PHY/LTE_REFSIG/lte_refsig.h" -#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h" -#include "PHY/INIT/phy_init.h" #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..66ed4593d8 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -44,15 +44,14 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, int16_t *d) { - uint32_t i; - uint8_t reset; - uint32_t x1, x2, s=0; + uint8_t reset = 1; + uint32_t x1 = 0; + uint32_t s = 0; - reset = 1; // x1 is set in lte_gold_generic - x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 + uint32_t x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 - for (i=0; i<32; i++) { + for (uint32_t i=0; i<32; i++) { if ((i&0x1f)==0) { s = lte_gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 74c8f36e2e..357e4b6acd 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( @@ -66,7 +67,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952 + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -86,7 +87,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 12952; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -218,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +297,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 053cc2060b..c031651ed2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,7 +35,9 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; + do_SRS = 1; pdcch_ConfigSIB1 = ( { @@ -218,7 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +298,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; From daf8b950e143948bb7c50ffdc6039a8edf7a2e25 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:09:40 +0000 Subject: [PATCH 229/883] Rename pusch_proc_threads to thread_pool_size --- ci-scripts/conf_files/benetel-5g.conf | 6 +++--- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 4 ++-- .../conf_files/gnb.band261.tm1.32PRB.usrpn300.conf | 6 +++--- .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 2 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 8 ++++---- .../gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +++--- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 6 +++--- executables/nr-gnb.c | 4 ++-- openair1/PHY/defs_gNB.h | 2 +- openair2/GNB_APP/L1_nr_paramdef.h | 8 ++++---- openair2/GNB_APP/gnb_config.c | 2 +- .../PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf | 6 +++--- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 8 ++++---- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band78.106PRB.slave.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 10 +++++----- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 6 +++--- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 12 ++++++------ .../GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf | 2 +- .../PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf | 6 +++--- .../GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf | 6 +++--- .../GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf | 6 +++--- targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 6 +++--- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 6 +++--- .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 2 +- 44 files changed, 121 insertions(+), 121 deletions(-) diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 79b2f7f877..73b1da8c50 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -215,11 +215,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 77693d5f72..b4c663b80b 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -232,7 +232,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; + thread_pool_size = 2; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index c9b369eaff..725522f63a 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -229,9 +229,9 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; + thread_pool_size = 2; prach_dtx_threshold = 120; - } + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index 4338c00b36..dd9c210c0d 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 1c2133bebe..fdb816237d 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -198,7 +198,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b0a757c9d0..b891af747a 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - } + thread_pool_size = 8; + prach_dtx_threshold = 120; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 093e82d4e6..e6ce5624c0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index a2b4d86dfc..481613381c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index a2b4d86dfc..481613381c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6ade355053..7efdf159eb 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -194,11 +194,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index b7a04b1f36..98ca9a5791 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -213,7 +213,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 6; + thread_pool_size = 6; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 299a19cc4e..5a5f0e9aa6 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 6; - } + thread_pool_size = 6; +} ); RUs = ( diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index a78750fefa..92a4f9dcd6 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -400,8 +400,8 @@ void init_gNB_Tpool(int inst) { // ULSCH decoding threadpool gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); int numCPU = sysconf(_SC_NPROCESSORS_ONLN); - LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); - int threadCnt = min(numCPU, gNB->pusch_proc_threads); + LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->thread_pool_size,numCPU); + int threadCnt = min(numCPU, gNB->thread_pool_size); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); char pool[80]; sprintf(pool,"-1"); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 1db4f6328a..7372ea6a9c 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -891,7 +891,7 @@ typedef struct PHY_VARS_gNB_s { notifiedFIFO_t *resp_RU_tx; tpool_t *threadPool; int nbDecode; - uint8_t pusch_proc_threads; + uint8_t thread_pool_size; int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 0306713845..ccff1ca995 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -46,7 +46,7 @@ #define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" #define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" #define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads" +#define CONFIG_STRING_L1_THREAD_POOL_SIZE "thread_pool_size" #define CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR "ofdm_offset_divisor" #define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" #define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" @@ -65,8 +65,8 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:3, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_THREAD_POOL_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \ @@ -80,7 +80,7 @@ #define L1_REMOTE_N_PORTC_IDX 6 #define L1_LOCAL_N_PORTD_IDX 7 #define L1_REMOTE_N_PORTD_IDX 8 -#define L1_PUSCH_PROC_THREADS 9 +#define L1_THREAD_POOL_SIZE 9 #define L1_OFDM_OFFSET_DIVISOR 10 #define L1_PUCCH0_DTX_THRESHOLD 11 #define L1_PRACH_DTX_THRESHOLD 12 diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d069bfe2f4..027be4d3cb 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -653,7 +653,7 @@ void RCconfig_NR_L1(void) { RC.gNB[j]->Mod_id = j; } - RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr); + RC.gNB[j]->thread_pool_size = *(L1_ParamList.paramarray[j][L1_THREAD_POOL_SIZE].uptr); RC.gNB[j]->ofdm_offset_divisor = *(L1_ParamList.paramarray[j][L1_OFDM_OFFSET_DIVISOR].uptr); RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index c6a4a90a14..b90acb8e97 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -216,11 +216,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index fd9399f89e..c3faa198dd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 59e71a6225..8fa8fcf992 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -196,12 +196,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index 3fc81c0d6c..c2e364b75e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index a40a93c789..51c9076fe7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index 3860aba935..d81655e5d5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 7c527e07c8..b063989fd2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 4f8c785baa..856eed4fc2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index b6b9252560..2e4dc540f3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -242,12 +242,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 0817d7373e..a454af7b21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index fd4c23cfdb..f536fd4d47 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 965408332c..375bb5f54c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index e36748a3a9..76bc5bf992 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7b2d369919..7ff9d0ea77 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index dbf4f58348..07939f4d95 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6d23726a78..6b5baef5ce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index c3fa56f15e..50169f4bce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 15aa368fdf..e217f39b94 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 06ae5af066..97f20c1461 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -28,7 +28,7 @@ L1s = ( remote_n_portc = 50001; // vnf p5 port local_n_portd = 50010; // pnf p7 port remote_n_portd = 50011; // vnf p7 port - pusch_proc_threads = 8; + thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 8dfcfb2b88..5aade8ab21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index d01b0947c0..fd4a722fc7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2f4839fd3b..2ecd4b1426 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 7f9e4d2d44..92e97217b5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -208,11 +208,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; - } + thread_pool_size = 2; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 357e4b6acd..39e4d780af 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index a423ee0dd1..44b7a0abc7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index c031651ed2..e7fb2b3a1b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,7 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index e9577ee265..564b284f06 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -225,11 +225,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index 83fd3e0886..ae664dc48a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,7 +248,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From c1bec3e5bdbb8aec33339387237952a76a293ebd Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:09:40 +0000 Subject: [PATCH 230/883] Rename pusch_proc_threads to thread_pool_size --- ci-scripts/conf_files/benetel-5g.conf | 6 +- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 4 +- .../gnb.band261.tm1.32PRB.usrpn300.conf | 6 +- .../gnb.band66.tm1.106PRB.usrpn300.conf | 2 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 8 +- ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- .../gnb.band78.tm1.106PRB.usrpn300.conf | 6 +- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 6 +- executables/nr-gnb.c | 4 +- openair1/PHY/defs_gNB.h | 2 +- openair2/GNB_APP/L1_nr_paramdef.h | 8 +- openair2/GNB_APP/gnb_config.c | 2 +- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 6 +- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 6 +- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 6 +- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 6 +- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 8 +- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 6 +- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 6 +- .../CONF/gnb.band78.106PRB.slave.conf | 6 +- .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 10 +- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 6 +- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 6 +- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 12 +- .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 12 +- .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 6 +- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 6 +- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 12 +- .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 12 +- .../CONF/oaiL1.nfapi.usrpx300.conf | 2 +- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 6 +- .../CONF/testing_gnb_24PRB.conf | 6 +- .../CONF/testing_gnb_nsa_n310.conf | 6 +- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 6 +- .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 9 +- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 6 +- ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 6 +- ...gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 331 ++++++++++++++++++ 44 files changed, 460 insertions(+), 122 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 79b2f7f877..73b1da8c50 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -215,11 +215,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 77693d5f72..b4c663b80b 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -232,7 +232,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; + thread_pool_size = 2; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index c9b369eaff..725522f63a 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -229,9 +229,9 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; + thread_pool_size = 2; prach_dtx_threshold = 120; - } + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index 4338c00b36..dd9c210c0d 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 1c2133bebe..fdb816237d 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -198,7 +198,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b0a757c9d0..b891af747a 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - } + thread_pool_size = 8; + prach_dtx_threshold = 120; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 16456f939c..4bbb5dd7d1 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..9f7ea725d5 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index ff05aa6e65..9f7ea725d5 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6ade355053..7efdf159eb 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -194,11 +194,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index b7a04b1f36..98ca9a5791 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -213,7 +213,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 6; + thread_pool_size = 6; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 299a19cc4e..5a5f0e9aa6 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 6; - } + thread_pool_size = 6; +} ); RUs = ( diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index dc8960846f..543a679714 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -398,8 +398,8 @@ void init_gNB_Tpool(int inst) { // ULSCH decoding threadpool gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); int numCPU = sysconf(_SC_NPROCESSORS_ONLN); - LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); - int threadCnt = min(numCPU, gNB->pusch_proc_threads); + LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->thread_pool_size,numCPU); + int threadCnt = min(numCPU, gNB->thread_pool_size); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); char pool[80]; sprintf(pool,"-1"); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index fb4f9a0092..e548432749 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -890,7 +890,7 @@ typedef struct PHY_VARS_gNB_s { notifiedFIFO_t *resp_RU_tx; tpool_t *threadPool; int nbDecode; - uint8_t pusch_proc_threads; + uint8_t thread_pool_size; int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index 0306713845..ccff1ca995 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -46,7 +46,7 @@ #define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" #define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" #define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads" +#define CONFIG_STRING_L1_THREAD_POOL_SIZE "thread_pool_size" #define CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR "ofdm_offset_divisor" #define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" #define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" @@ -65,8 +65,8 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:3, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_THREAD_POOL_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \ @@ -80,7 +80,7 @@ #define L1_REMOTE_N_PORTC_IDX 6 #define L1_LOCAL_N_PORTD_IDX 7 #define L1_REMOTE_N_PORTD_IDX 8 -#define L1_PUSCH_PROC_THREADS 9 +#define L1_THREAD_POOL_SIZE 9 #define L1_OFDM_OFFSET_DIVISOR 10 #define L1_PUCCH0_DTX_THRESHOLD 11 #define L1_PRACH_DTX_THRESHOLD 12 diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index d069bfe2f4..027be4d3cb 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -653,7 +653,7 @@ void RCconfig_NR_L1(void) { RC.gNB[j]->Mod_id = j; } - RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr); + RC.gNB[j]->thread_pool_size = *(L1_ParamList.paramarray[j][L1_THREAD_POOL_SIZE].uptr); RC.gNB[j]->ofdm_offset_divisor = *(L1_ParamList.paramarray[j][L1_OFDM_OFFSET_DIVISOR].uptr); RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index c6a4a90a14..b90acb8e97 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -216,11 +216,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index fd9399f89e..c3faa198dd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 59e71a6225..8fa8fcf992 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -196,12 +196,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index 3fc81c0d6c..c2e364b75e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index a40a93c789..51c9076fe7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index 3860aba935..d81655e5d5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 7c527e07c8..b063989fd2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 4f8c785baa..856eed4fc2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index b6b9252560..2e4dc540f3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -242,12 +242,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 0817d7373e..a454af7b21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index fd4c23cfdb..f536fd4d47 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 965408332c..375bb5f54c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index e36748a3a9..76bc5bf992 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7b2d369919..7ff9d0ea77 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index dbf4f58348..07939f4d95 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6d23726a78..6b5baef5ce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index c3fa56f15e..50169f4bce 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 15aa368fdf..e217f39b94 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 06ae5af066..97f20c1461 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -28,7 +28,7 @@ L1s = ( remote_n_portc = 50001; // vnf p5 port local_n_portd = 50010; // pnf p7 port remote_n_portd = 50011; // vnf p7 port - pusch_proc_threads = 8; + thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 8dfcfb2b88..5aade8ab21 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index d01b0947c0..fd4a722fc7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2f4839fd3b..2ecd4b1426 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 7f9e4d2d44..92e97217b5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -208,11 +208,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 2; - } + thread_pool_size = 2; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9238ea1809..83c1bb24a9 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( @@ -66,7 +67,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952 + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -86,7 +87,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 12952; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -218,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +297,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 9717462176..d052e7ad66 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 4; + thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index d9b62064c1..a199e7859c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,7 +35,9 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; + do_SRS = 1; pdcch_ConfigSIB1 = ( { @@ -218,7 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +298,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index e9577ee265..564b284f06 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -225,11 +225,11 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - } + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf new file mode 100644 index 0000000000..ae664dc48a --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -0,0 +1,331 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; +# do_CSIRS = 1; + min_rxtxtime_pdsch = 2; + ul_prbblacklist = "79,80,81,82" + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 10; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3300.60 MHz + 81*12*30e-3 MHz = 3329.76 + absoluteFrequencySSB = 621984; + # this is 3300.60 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=0,L=162 (275*(275-L+1))+(274-RBstart)) + initialDLBWPlocationAndBandwidth = 31899; + # +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 10; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; + #initialULBWPmappingType + #0=typeA,1=typeB + initialDLBWPmappingType_0 = 0; + #this is SS=1,L=13 + initialDLBWPstartSymbolAndLength_0 = 40; + + initialDLBWPk0_1 = 0; + initialDLBWPmappingType_1 = 0; + #this is SS=1,L=5 + initialDLBWPstartSymbolAndLength_1 = 57; + + #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 = 31899; +# 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 = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 2; + initialULBWPmappingType_0 = 1 + # this is SS=2 L=13 + initialULBWPstartSymbolAndLength_0 = 41; + + initialULBWPk2_1 = 2; + initialULBWPmappingType_1 = 1; + # this is SS=0 L=4 + initialULBWPstartSymbolAndLength_1 = 52; + + initialULBWPk2_2 = 7; + initialULBWPmappingType_2 = 1; + # this is SS=10 L=4 + initialULBWPstartSymbolAndLength_2 = 52; + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -70; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 0; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 4; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 120; +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + sf_extension = 0; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "mgmt_addr=192.168.10.2,addr=192.168.10.2,clock_source=internal,time_source=internal" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; +}; From ba3c2f59cdf9257f24df4964eb6d84a7c8093530 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:28:19 +0000 Subject: [PATCH 231/883] Cleanup config files where thread_pool_size is equal to the default value --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 1 - ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 1 - ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 - .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 - .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 1 - 7 files changed, 7 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 4bbb5dd7d1..cfcdcd44dc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 9f7ea725d5..70bcf88efe 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index 9f7ea725d5..70bcf88efe 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 83c1bb24a9..4075fefcfe 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,7 +219,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index d052e7ad66..1c57d9523f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index a199e7859c..bed5d6e318 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,7 +220,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index ae664dc48a..befceae695 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,7 +248,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From 4a17e1ec61f2331fa93b44ffb82008bb68ca380b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:43:39 +0000 Subject: [PATCH 232/883] Fix and uniformization of indentation --- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 14 +++++++------- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 12 ++++++------ .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 4 ++-- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index b4c663b80b..9e9f960124 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -229,13 +229,13 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 725522f63a..829d73f854 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -226,12 +226,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index fdb816237d..2400136f9f 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -195,12 +195,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 98ca9a5791..249b7e4527 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 6; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 6; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( From bf0c6941788075e60fb9deaebd17ffae28e25dde Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:28:19 +0000 Subject: [PATCH 233/883] Cleanup config files where thread_pool_size is equal to the default value --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 1 - ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 1 - ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 - .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 - .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 1 - 7 files changed, 7 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index e6ce5624c0..f4fab7c422 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 481613381c..9bf8bd20cd 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index 481613381c..9bf8bd20cd 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 39e4d780af..0e884d77e5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,7 +219,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 44b7a0abc7..531f8a34fc 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e7fb2b3a1b..e96c545a4e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,7 +220,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index ae664dc48a..befceae695 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,7 +248,6 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From 692c68e4be139c0d76f5bde2f59a9055b881ff35 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 24 Dec 2021 18:43:39 +0000 Subject: [PATCH 234/883] Fix and uniformization of indentation --- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 14 +++++++------- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 12 ++++++------ .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 4 ++-- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index b4c663b80b..9e9f960124 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -229,13 +229,13 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 725522f63a..829d73f854 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -226,12 +226,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index fdb816237d..2400136f9f 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -195,12 +195,12 @@ MACRLCs = ( ); L1s = ( - { +{ num_cc = 1; tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 98ca9a5791..249b7e4527 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 6; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 6; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( From 3a78c66e00ccd650ab44470b0179a1a17bbbfa23 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 28 Dec 2021 10:40:19 +0100 Subject: [PATCH 235/883] add 256qam test case to dlsim --- cmake_targets/autotests/test_case_list.xml | 30 ++++++++------- openair1/SIMULATION/NR_PHY/dlsim.c | 18 +++++++-- openair2/RRC/NR/nr_rrc_config.c | 44 ++++++++++++++++++++++ openair2/RRC/NR/nr_rrc_config.h | 5 +++ 4 files changed, 79 insertions(+), 18 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 3472b14efc..19421a97ab 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1093,17 +1093,18 @@ (Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset), (Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27), (Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16), - (Test11: HARQ test 25% TP (4 rounds), - (Test12: HARQ test 33% TP (3 rounds), - (Test13: HARQ test 50% TP (2 rounds), - (Test14: 3 PTRS, 8 Interpolated Symbols), - (Test15: 6 PTRS, 5 Interpolated Symbols), - (Test16: 11 PTRS, 0 Interpolated Symbols), - (Test17: Mapping type A, 2 DMRS Symbols), - (Test18: Mapping type A, 3 DMRS Symbols), - (Test19: Mapping type B, 4 DMRS Symbols), - (Test20: 4x4 MIMO, 1 Layer), - (Test21: 4x4 MIMO, 2 Layers) + (Test11: 106 MCS-TABLE 256 QAM MCS Index 26), + (Test12: HARQ test 25% TP (4 rounds), + (Test13: HARQ test 33% TP (3 rounds), + (Test14: HARQ test 50% TP (2 rounds), + (Test15: 3 PTRS, 8 Interpolated Symbols), + (Test16: 6 PTRS, 5 Interpolated Symbols), + (Test17: 11 PTRS, 0 Interpolated Symbols), + (Test18: Mapping type A, 2 DMRS Symbols), + (Test19: Mapping type A, 3 DMRS Symbols), + (Test20: Mapping type B, 4 DMRS Symbols), + (Test21: 4x4 MIMO, 1 Layer), + (Test22: 4x4 MIMO, 2 Layers) $OPENAIR_DIR/cmake_targets/build_oai --phy_simulators -c @@ -1118,8 +1119,9 @@ -n100 -R217 -b100 -s5 -n100 -R217 -a80 -s5 -n100 -R217 -a110 -s5 -b100 - -n100 -e27 -s30 - -n100 -e16 -s10 + -n100 -e27 -s30 + -n100 -e16 -s10 + -n100 -q1 -e26 -s30 -n100 -s1 -t25 -n100 -s1 -t33 -n100 -s1 -t50 @@ -1131,7 +1133,7 @@ -n100 -s2 -U 2 1 3 -n10 -s20 -U 3 0 0 2 -gR -x1 -y4 -z4 -n10 -s20 -U 3 0 0 2 -gR -x2 -y4 -z4 - nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19 nr_dlsim.test20 nr_dlsim.test21 + nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19 nr_dlsim.test20 nr_dlsim.test21 nr_dlsim.test22 PDSCH test OK segmentation fault|assertion|exiting|fatal 3 diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 32a05f060a..c1c8e2894c 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -431,7 +431,7 @@ int main(int argc, char **argv) FILE *scg_fd=NULL; - while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:m:w:T:U:q")) != -1) { + while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:q:m:w:T:U")) != -1) { switch (c) { case 'f': @@ -598,13 +598,19 @@ int main(int argc, char **argv) case 'b': g_rbSize = atoi(optarg); break; + case 'D': dlsch_threads = atoi(optarg); - break; + break; + case 'e': g_mcsIndex = atoi(optarg); break; + case 'q': + g_mcsTableIdx = atoi(optarg); + break; + case 'm': mu = atoi(optarg); break; @@ -660,6 +666,7 @@ int main(int argc, char **argv) printf("-c Start symbol for PDSCH (fixed for now)\n"); printf("-j Number of symbols for PDSCH (fixed for now)\n"); printf("-e MSC index\n"); + printf("-q MCS Table index\n"); printf("-t Acceptable effective throughput (in percentage)\n"); printf("-T Enable PTRS, arguments list L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2 \n"); printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n"); @@ -759,11 +766,14 @@ int main(int argc, char **argv) fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); ssb_bitmap = 1;// Enable only first SSB with index ssb_indx=0 fix_scc(scc,ssb_bitmap); - prepare_scd(scd); + NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); + prepare_sim_uecap(UE_Capability_nr,scc,mu, + N_RB_DL,g_mcsTableIdx); + // TODO do a UECAP for phy-sim - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 6, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, n_tx, 6, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index c77d245af3..97c801b352 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -31,6 +31,50 @@ #include "nr_rrc_config.h" #include "common/utils/nr/nr_common.h" +void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, + NR_ServingCellConfigCommon_t *scc, + int numerology, + int rbsize, + int mcs_table) { + + int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + NR_BandNR_t *nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); + nr_bandnr->bandNR = band; + ASN_SEQUENCE_ADD(&cap->rf_Parameters.supportedBandListNR.list, + nr_bandnr); + if (mcs_table == 1) { + int bw = get_supported_band_index(numerology, band, rbsize); + if (band>256) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[0]; + bandNRinfo->pdsch_256QAM_FR2 = CALLOC(1,sizeof(*bandNRinfo->pdsch_256QAM_FR2)); + *bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported; + } + else{ + cap->phy_Parameters.phy_ParametersFR1 = CALLOC(1,sizeof(*cap->phy_Parameters.phy_ParametersFR1)); + NR_Phy_ParametersFR1_t *phy_fr1 = cap->phy_Parameters.phy_ParametersFR1; + phy_fr1->pdsch_256QAM_FR1 = CALLOC(1,sizeof(*phy_fr1->pdsch_256QAM_FR1)); + *phy_fr1->pdsch_256QAM_FR1 = NR_Phy_ParametersFR1__pdsch_256QAM_FR1_supported; + } + cap->featureSets = CALLOC(1,sizeof(*cap->featureSets)); + NR_FeatureSets_t *fs=cap->featureSets; + fs->featureSetsDownlinkPerCC = CALLOC(1,sizeof(*fs->featureSetsDownlinkPerCC)); + NR_FeatureSetDownlinkPerCC_t *fs_cc = CALLOC(1,sizeof(NR_FeatureSetDownlinkPerCC_t)); + fs_cc->supportedSubcarrierSpacingDL = numerology; + if(band>256) { + fs_cc->supportedBandwidthDL.present = NR_SupportedBandwidth_PR_fr2; + fs_cc->supportedBandwidthDL.choice.fr2 = bw; + } + else{ + fs_cc->supportedBandwidthDL.present = NR_SupportedBandwidth_PR_fr1; + fs_cc->supportedBandwidthDL.choice.fr1 = bw; + } + fs_cc->supportedModulationOrderDL = CALLOC(1,sizeof(*fs_cc->supportedModulationOrderDL)); + *fs_cc->supportedModulationOrderDL = NR_ModulationOrder_qam256; + ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list, + fs_cc); + } +} + void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index 7daf08b547..e8a2ab4518 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -114,6 +114,11 @@ typedef struct physicalcellgroup_s{ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, NR_UE_NR_Capability_t *cap); +void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, + NR_ServingCellConfigCommon_t *scc, + int numerology, + int rbsize, + int mcs_table); #endif From b4c78a9c5b8439379d385cb325ab0fd5e65a2739 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 28 Dec 2021 11:05:52 +0100 Subject: [PATCH 236/883] fix compilation issues after merge --- openair2/GNB_APP/gnb_config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 -- openair2/RRC/NR/rrc_gNB.c | 8 ++++---- openair2/RRC/NR/rrc_gNB_nsa.c | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 84b3e4159a..8a1a22412f 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2050,7 +2050,7 @@ void configure_gnb_du_mac(int inst) { rrc->configuration.pdsch_AntennaPorts, rrc->configuration.pusch_AntennaPorts, rrc->configuration.sib1_tda, - rrc->configuration.minRXTXTIMEpdsch, + rrc->configuration.minRXTXTIME, rrc->configuration.scc, NULL, 0, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 4f889910c1..25ede7a906 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -902,9 +902,7 @@ void nr_get_Msg3alloc(module_id_t module_id, 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[mu]; - const int nrofUplinkSymbols = (frame_type==TDD) ? tdd->nrofUplinkSymbols : 11; // TODO change in favor of harmonization branch uint8_t k2 = 0; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); if (frame_type == TDD) { int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); int nb_slots_per_period = ((1<carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 0, @@ -318,7 +318,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, NULL, NULL, 0, @@ -512,7 +512,7 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( rrc_instance_p->carrier.pdsch_AntennaPorts, rrc_instance_p->carrier.pusch_AntennaPorts, rrc_instance_p->carrier.sib1_tda, - rrc_instance_p->carrier.minRXTXTIMEpdsch, + rrc_instance_p->carrier.minRXTXTIME, (NR_ServingCellConfigCommon_t *)rrc_instance_p->carrier.servingcellconfigcommon, &rrc_instance_p->carrier.mib, 0, @@ -1278,7 +1278,7 @@ rrc_gNB_process_RRCReconfigurationComplete( rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, NULL, NULL, 0, diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 3b00404a21..c671ceebae 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -352,7 +352,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 1, // add_ue flag @@ -364,7 +364,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIMEpdsch, + rrc->carrier.minRXTXTIME, NULL, NULL, 1, // add_ue flag From f76aac65829c16e0583a2d00705771e4f98c7520 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 30 Dec 2021 10:27:02 +0100 Subject: [PATCH 237/883] bugfix in setting ue tdd settings --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index c9e761202e..bcb31b7592 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -47,9 +47,8 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots; int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols; int slot_number = 0; - int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period); + int nb_periods_per_frame = get_nb_periods_per_frame(tdd_config->pattern1.dl_UL_TransmissionPeriodicity); int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period_in_slots = nb_slots_per_period; From 0ddb872bea755867783a058dde21412df49dd16a Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 31 Dec 2021 11:59:17 +0100 Subject: [PATCH 238/883] config file for 10MHz SA --- .../gnb.sa.band78.fr1.24PRB.usrpb210.conf | 300 ++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf new file mode 100644 index 0000000000..c1bab381ec --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf @@ -0,0 +1,300 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 15; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 2; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 12 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 640288; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 640000; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 24; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 6325; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 2; + 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 = 24; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 6325; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + From 37a2d7af57c9604d6759afb440dbaef5d5a554f9 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 31 Dec 2021 12:00:28 +0100 Subject: [PATCH 239/883] changes to allow pdsch typeb in sib1 --- openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c | 1 - openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 19 ++++++++------- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 1 + openair2/LAYER2/NR_MAC_UE/mac_proto.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 23 ++++++++++++++----- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 10 ++++---- 7 files changed, 34 insertions(+), 23 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c b/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c index e6a9b8c5dc..a62138621d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c @@ -92,6 +92,5 @@ uint8_t get_l0(uint16_t dlDmrsSymbPos) { if ((mask&1) == 1) break; mask>>=1; } - AssertFatal(l0 < 4,"impossible l0 %d\n",l0); return (l0); } diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 3f4be9dd58..a87f8b765a 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -315,21 +315,21 @@ void get_info_from_tda_tables(int default_abc, int tda, int dmrs_TypeA_Position, int normal_CP, + bool *is_mapping_typeA, int *startSymbolIndex, int *nrOfSymbols) { int k0 = 0; - int is_mapping_typeA = 1; switch(default_abc){ case 1: if (normal_CP){ if (dmrs_TypeA_Position){ - is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][0]; + *is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][0]; k0 = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][1]; *startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][2]; *nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][3]; } else{ - is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][0]; + *is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][0]; k0 = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][1]; *startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][2]; *nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][3]; @@ -337,13 +337,13 @@ void get_info_from_tda_tables(int default_abc, } else{ if (dmrs_TypeA_Position){ - is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][0]; + *is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][0]; k0 = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][1]; *startSymbolIndex = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][2]; *nrOfSymbols = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][3]; } else{ - is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][0]; + *is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][0]; k0 = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][1]; *startSymbolIndex = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][2]; *nrOfSymbols = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][3]; @@ -352,13 +352,13 @@ void get_info_from_tda_tables(int default_abc, break; case 2: if (dmrs_TypeA_Position){ - is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][0]; + *is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][0]; k0 = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][1]; *startSymbolIndex = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][2]; *nrOfSymbols = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][3]; } else{ - is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][0]; + *is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][0]; k0 = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][1]; *startSymbolIndex = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][2]; *nrOfSymbols = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][3]; @@ -366,13 +366,13 @@ void get_info_from_tda_tables(int default_abc, break; case 3: if (dmrs_TypeA_Position){ - is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][0]; + *is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][0]; k0 = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][1]; *startSymbolIndex = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][2]; *nrOfSymbols = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][3]; } else{ - is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][0]; + *is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][0]; k0 = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][1]; *startSymbolIndex = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][2]; *nrOfSymbols = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][3]; @@ -382,7 +382,6 @@ void get_info_from_tda_tables(int default_abc, AssertFatal(1==0,"Invalid default time domaing allocation type\n"); } AssertFatal(k0==0,"Only k0 = 0 is supported\n"); - AssertFatal(is_mapping_typeA==1,"Only mapping type A is currently supported\n"); } const char *prachfmt[]={"0","1","2","3", "A1","A2","A3","B1","B4","C0","C2","A1/B1","A2/B2","A3/B3"}; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 8182e1c930..ed59e66d02 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -138,6 +138,7 @@ void get_info_from_tda_tables(int default_abc, int tda, int dmrs_TypeA_Position, int normal_CP, + bool *is_mapping_typeA, int *startSymbolIndex, int *nrOfSymbols); diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 288716ed85..ce848ce4c5 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -271,6 +271,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac, NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, + int *mappingtype, uint8_t time_domain_ind, int default_abc, bool use_default); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 2f4ceb48ec..733bc0e609 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -470,6 +470,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac, NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, + int *mapping_type, uint8_t time_domain_ind, int default_abc, bool use_default){ @@ -547,13 +548,15 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac, } else {// Default configuration from tables + bool is_typeA; get_info_from_tda_tables(default_abc, time_domain_ind, dmrs_typeA_pos, 1, // normal CP + &is_typeA, &sliv_S, &sliv_L); - + *mapping_type = is_typeA? typeA : typeB; dlsch_config_pdu->number_symbols = sliv_L; dlsch_config_pdu->start_symbol = sliv_S; } @@ -859,12 +862,17 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup) pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + int mappingtype; /* TIME_DOM_RESOURCE_ASSIGNMENT */ - if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,NULL,dlsch_config_pdu_1_0,dci->time_domain_assignment.val,default_abc,rnti==SI_RNTI) < 0) { + if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList, + NULL,dlsch_config_pdu_1_0,&mappingtype, + dci->time_domain_assignment.val, + default_abc,rnti==SI_RNTI) < 0) { LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot); return -1; } - int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_0->start_symbol <= 3)? typeA: typeB); + if(pdsch_TimeDomainAllocationList && rnti!=SI_RNTI) + mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType; /* dmrs symbol positions*/ dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, @@ -1054,13 +1062,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr return -1; } /* TIME_DOM_RESOURCE_ASSIGNMENT */ + int mappingtype; NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = choose_dl_tda_list(pdsch_Config,bwpc->pdsch_ConfigCommon->choice.setup); - if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,NULL,dlsch_config_pdu_1_1,dci->time_domain_assignment.val,0,false) < 0) { + if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList, + NULL,dlsch_config_pdu_1_1,&mappingtype, + dci->time_domain_assignment.val,0,false) < 0) { LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot); return -1; } - - int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB); + if(pdsch_TimeDomainAllocationList) + mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType; /* dmrs symbol positions*/ dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 3d45877979..f070dac86f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -754,7 +754,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, return -1; } /* TIME_DOM_RESOURCE_ASSIGNMENT */ - if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_TimeDomainAllocationList, NULL, pusch_config_pdu, NULL, dci->time_domain_assignment.val,0,false) < 0) { + if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_TimeDomainAllocationList, NULL, pusch_config_pdu, NULL, NULL, dci->time_domain_assignment.val,0,false) < 0) { return -1; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index df25b085e6..74b8b90e53 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -384,7 +384,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, int rbSize = 0; uint32_t TBS = 0; do { - if(rbSize < bwpSize && !vrb_map[rbStart + rbSize]) + if(rbSize < bwpSize && !(vrb_map[rbStart + rbSize]&(((1<sched_ctrlCommon->sched_pdsch.mcs<10) @@ -602,15 +602,15 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) int startSymbolIndex = 0; int nrOfSymbols = 0; + bool is_typeA; get_info_from_tda_tables(type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern, time_domain_allocation, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, - 1, &startSymbolIndex, &nrOfSymbols); - - // TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C) - int mappingtype = (startSymbolIndex <= 3)? typeA: typeB; + 1, &is_typeA, + &startSymbolIndex, &nrOfSymbols); + int mappingtype = is_typeA? typeA: typeB; uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype); // Configure sched_ctrlCommon for SIB1 From e5ee24c1ff032a6ed1fb433189de7d3c690c8846 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 3 Jan 2022 11:56:56 +0100 Subject: [PATCH 240/883] fixes in demapping and deinterleaving at OAI UE --- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 98 +++++++++++++-------------- 1 file changed, 46 insertions(+), 52 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 84c9627c8a..080273ab9b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -130,76 +130,76 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, */ int c = 0, r = 0; - uint16_t bundle_j = 0, f_bundle_j = 0, f_reg = 0; + uint16_t f_bundle_j = 0; uint32_t coreset_C = 0; uint16_t index_z, index_llr; int coreset_interleaved = 0; + int N_regs = coreset_nbr_rb*coreset_time_dur; + int B_rb = reg_bundle_size_L/coreset_time_dur; // nb of RBs occupied by each REG bundle if (reg_bundle_size_L != 0) { // interleaving will be done only if reg_bundle_size_L != 0 coreset_interleaved = 1; - coreset_C = (uint32_t) (coreset_nbr_rb / (coreset_interleaver_size_R * reg_bundle_size_L)); + coreset_C = (uint32_t) (N_regs / (coreset_interleaver_size_R * reg_bundle_size_L)); } else { reg_bundle_size_L = 6; } + int num_bundles_per_cce = 6/reg_bundle_size_L; + int max_bundles = NR_MAX_PDCCH_AGG_LEVEL*num_bundles_per_cce; + int f_bundle_j_list[max_bundles]; - int f_bundle_j_list[(2*NR_MAX_PDCCH_AGG_LEVEL) - 1] = {}; - - for (int reg = 0; reg < coreset_nbr_rb; reg++) { - if ((reg % reg_bundle_size_L) == 0) { + // for each bundle + for (int nb = 0; nb < max_bundles; nb++) { + if (coreset_interleaved == 0) f_bundle_j = nb; + else { if (r == coreset_interleaver_size_R) { r = 0; c++; } - - bundle_j = (c * coreset_interleaver_size_R) + r; - f_bundle_j = ((r * coreset_C) + c + n_shift) % (coreset_nbr_rb / reg_bundle_size_L); - - if (coreset_interleaved == 0) f_bundle_j = bundle_j; - - f_bundle_j_list[reg / 6] = f_bundle_j; - + f_bundle_j = ((r * coreset_C) + c + n_shift) % (N_regs / reg_bundle_size_L); + r++; } - if ((reg % reg_bundle_size_L) == 0) r++; + f_bundle_j_list[nb] = f_bundle_j; } - // Get cce_list indices by reg_idx in ascending order - int f_bundle_j_list_id = 0; - int f_bundle_j_list_ord[(2*NR_MAX_PDCCH_AGG_LEVEL)-1] = {}; + // Get cce_list indices by bundle index in ascending order + int f_bundle_j_list_ord[number_of_candidates][max_bundles]; for (int c_id = 0; c_id < number_of_candidates; c_id++ ) { - f_bundle_j_list_id = CCE[c_id]; - for (int p = 0; p < NR_MAX_PDCCH_AGG_LEVEL; p++) { - for (int p2 = CCE[c_id]; p2 < CCE[c_id] + L[c_id]; p2++) { - AssertFatal(p2<2*NR_MAX_PDCCH_AGG_LEVEL,"number_of_candidates %d : p2 %d, CCE[%d] %d, L[%d] %d\n",number_of_candidates,p2,c_id,CCE[c_id],c_id,L[c_id]); - if (f_bundle_j_list[p2] == p) { - AssertFatal(f_bundle_j_list_id < 2*NR_MAX_PDCCH_AGG_LEVEL,"f_bundle_j_list_id %d\n",f_bundle_j_list_id); - f_bundle_j_list_ord[f_bundle_j_list_id] = p; + int start_bund_cand = CCE[c_id]*num_bundles_per_cce; + int max_bund_per_cand = L[c_id]*num_bundles_per_cce; + int f_bundle_j_list_id = 0; + for(int nb = 0; nb < max_bundles; nb++) { + for(int bund_cand = start_bund_cand; bund_cand < start_bund_cand+max_bund_per_cand; bund_cand++){ + if (f_bundle_j_list[bund_cand] == nb) { + f_bundle_j_list_ord[c_id][f_bundle_j_list_id] = nb; f_bundle_j_list_id++; - break; + } } } } - int rb = 0; + int rb_count = 0; for (int c_id = 0; c_id < number_of_candidates; c_id++ ) { for (int symbol_idx = start_symbol; symbol_idx < start_symbol+coreset_time_dur; symbol_idx++) { - for (int cce_count = CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur; cce_count < CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur+L[c_id]; cce_count += coreset_time_dur) { - for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) { + for (int cce_count = 0; cce_count < L[c_id]; cce_count ++) { + for (int k=0; k<6/reg_bundle_size_L; k++) { // loop over REG bundles + int f = f_bundle_j_list_ord[c_id][k+6*cce_count/reg_bundle_size_L]; + for(int rb=0; rb \t[f_reg=%d,fbundle_j=%d] llr[%d]=(%d,%d) \n", - cce_count,reg_in_cce_idx,bundle_j,symbol_idx,c_id,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]), - f_reg,f_bundle_j,(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i])); + LOG_I(PHY,"[candidate=%d,symbol_idx=%d,cce=%d,REG bundle=%d,PRB=%d] z[%d]=(%d,%d) <-> \t llr[%d]=(%d,%d) \n", + c_id,symbol_idx,cce_count,k,f*B_rb + rb,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]), + (index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i])); #endif + } + rb_count++; } - rb++; } } } @@ -783,15 +783,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, rel15->number_of_candidates, rel15->CCE, rel15->L); - /* - nr_pdcch_unscrambling(rel15->rnti, - frame_parms, - slot, - pdcch_vars->e_rx, - rel15->coreset.duration*n_rb*9*2, - // get_nCCE(n_pdcch_symbols, frame_parms, mi) * 72, - rel15->coreset.pdcch_dmrs_scrambling_id); - */ + LOG_D(PHY,"we end nr_pdcch_unscrambling()\n"); LOG_D(PHY,"Ending nr_rx_pdcch() function\n"); @@ -866,6 +858,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, //int gNB_id = 0; int16_t tmp_e[16*108]; rnti_t n_rnti; + int e_rx_cand_idx = 0; for (int j=0;jnumber_of_candidates;j++) { int CCEind = rel15->CCE[j]; @@ -889,13 +882,13 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList); LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", - j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); + j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); - nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); + nr_pdcch_unscrambling(&pdcch_vars->e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); #ifdef DEBUG_DCI_DECODING - uint32_t * z = (uint32_t *) &pdcch_vars->e_rx[CCEind*108]; - for (int index_z = 0; index_z < 96; index_z++){ + uint32_t *z = (uint32_t *) &pdcch_vars->e_rx[e_rx_cand_idx]; + for (int index_z = 0; index_z < L*6; index_z++){ for (int i=0; i<9; i++) { LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i])); } @@ -935,6 +928,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, LOG_D(PHY,"(%i.%i) Decoded crc %x does not match rnti %x for DCI format %d\n", proc->frame_rx, proc->nr_slot_rx, crc, n_rnti, rel15->dci_format_options[k]); } } + e_rx_cand_idx += 9*L*6*2; //e_rx index for next candidate (L CCEs, 6 REGs per CCE and 9 REs per REG and 2 uint16_t per RE) } pdcch_vars->nb_search_space = 0; return(dci_ind->number_of_dcis); From 9b70a994c00bafd06effe86383e4a37b6b411fb5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 3 Jan 2022 12:11:13 +0100 Subject: [PATCH 241/883] bugfix for non-interleaved --- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 080273ab9b..a7332a3220 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -135,7 +135,6 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, uint16_t index_z, index_llr; int coreset_interleaved = 0; int N_regs = coreset_nbr_rb*coreset_time_dur; - int B_rb = reg_bundle_size_L/coreset_time_dur; // nb of RBs occupied by each REG bundle if (reg_bundle_size_L != 0) { // interleaving will be done only if reg_bundle_size_L != 0 coreset_interleaved = 1; @@ -144,6 +143,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, reg_bundle_size_L = 6; } + int B_rb = reg_bundle_size_L/coreset_time_dur; // nb of RBs occupied by each REG bundle int num_bundles_per_cce = 6/reg_bundle_size_L; int max_bundles = NR_MAX_PDCCH_AGG_LEVEL*num_bundles_per_cce; int f_bundle_j_list[max_bundles]; From 1be69de2e6ccde6b98cd29f5ac7d9a6917ad8308 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 3 Jan 2022 15:37:39 +0000 Subject: [PATCH 242/883] Code cleanup --- openair1/PHY/NR_REFSIG/pss_nr.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 34 ++------------------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index e2dd0e456b..3b480d7fab 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -141,7 +141,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain int *eNB_id, int *f_off); -int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off); +int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue); #endif #undef EXTERN diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 3bf12c0bab..8ff0795871 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -976,7 +976,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain return(peak_position); } -int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { +int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue) { int **rxdata = ue->common_vars.rxdata; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; @@ -1030,36 +1030,8 @@ int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue, int *f_off) { } } - // Fractional frequency offset computation according to Cross-correlation Synchronization Algorithm Using PSS - // Shoujun Huang, Yongtao Su, Ying He and Shan Tang, "Joint time and frequency offset estimation in LTE downlink," - // 7th International Conference on Communications and Networking in China, 2012. - - // Computing cross-correlation at peak on half the symbol size for first half of data - int64_t result1 = dot_product64((short*)primary_synchro_time_nr[Nid2], - (short*) &(rxdata[0][peak_position]), - frame_parms->ofdm_symbol_size>>1, - shift); - - // Computing cross-correlation at peak on half the symbol size for data shifted by half symbol size - // as it is real and complex it is necessary to shift by a value equal to symbol size to obtain such shift - int64_t result2 = dot_product64((short*)primary_synchro_time_nr[Nid2]+(frame_parms->ofdm_symbol_size), - (short*) &(rxdata[0][peak_position])+frame_parms->ofdm_symbol_size, - frame_parms->ofdm_symbol_size>>1, - shift); - - int64_t re1 = ((int*) &result1)[0]; - int64_t re2 = ((int*) &result2)[0]; - int64_t im1 = ((int*) &result1)[1]; - int64_t im2 = ((int*) &result2)[1]; - - // Estimation of fractional frequency offset: angle[(result1)'*(result2)]/pi - double ffo_est = atan2(re1*im2-re2*im1,re1*re2+im1*im2)/M_PI; - - // Computing absolute value of frequency offset - *f_off = ffo_est*frame_parms->subcarrier_spacing; - - LOG_D(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB, ffo %lf\n", - peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg),ffo_est); + LOG_D(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB\n", + peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg)); return peak_position_diff; } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 732d975be4..0b543da275 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1648,7 +1648,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { - nr_adjust_pss_synch(ue, (int *)&ue->common_vars.freq_offset); + nr_adjust_pss_synch(ue); LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); nr_ue_pbch_procedures(gNB_id, ue, proc, 0); From 8a428d734ebaf8dbbf4435e158b96e3557053089 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 4 Jan 2022 11:52:16 +0000 Subject: [PATCH 243/883] Fix nr_pbchsim to avoid multiple ffo compensations for each trial on input samples --- openair1/SIMULATION/NR_PHY/pbchsim.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 1169b8ecd8..a5c6222fe5 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -655,13 +655,6 @@ int main(int argc, char **argv) frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples); printf("txlev %d (%f)\n",txlev,10*log10(txlev));*/ - - for (i=0; inb_antennas_tx; aa++) { - r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); - r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]); - } - } for (SNR=snr0; SNRnb_antennas_tx; aa++) { + r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]); + r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]); + } + } + // multipath channel //multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0); @@ -697,13 +698,11 @@ int main(int argc, char **argv) 0.0, // IQ imbalance (dB), 0.0); // IQ phase imbalance (rad) - for (i=0; inb_antennas_rx; aa++) { - - ((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); - ((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); - } + for (aa=0; aanb_antennas_rx; aa++) { + ((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); + ((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0))); + } } if (n_trials==1) { From 1e3bef7a09f9aa3b7110e1cdb47fe7b32f890454 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Wed, 5 Jan 2022 09:26:59 +0000 Subject: [PATCH 244/883] Revert "Fix and uniformization of indentation" This reverts commit 692c68e4be139c0d76f5bde2f59a9055b881ff35 --- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 14 +++++++------- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 12 ++++++------ .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 4 ++-- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 9e9f960124..b4c663b80b 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -229,13 +229,13 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 829d73f854..725522f63a 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -226,12 +226,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 2; - prach_dtx_threshold = 120; -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 2; + prach_dtx_threshold = 120; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 2400136f9f..fdb816237d 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -195,12 +195,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 249b7e4527..98ca9a5791 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 6; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 6; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( From 602ecd1c3e8216804840fad2f729824e6989a847 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Wed, 5 Jan 2022 09:27:20 +0000 Subject: [PATCH 245/883] Revert "Cleanup config files where thread_pool_size is equal to the default value" This reverts commit bf0c6941788075e60fb9deaebd17ffae28e25dde --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 1 + ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 1 + ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 1 + .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 + .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 + .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 + .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 1 + 7 files changed, 7 insertions(+) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index f4fab7c422..e6ce5624c0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,6 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 9bf8bd20cd..481613381c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,6 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index 9bf8bd20cd..481613381c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,6 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 0e884d77e5..39e4d780af 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,6 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 531f8a34fc..44b7a0abc7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,6 +218,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e96c545a4e..e7fb2b3a1b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,6 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index befceae695..ae664dc48a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,6 +248,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From 345c9e38e4b94b2e6aae83bc97ca522e95fa2109 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Wed, 5 Jan 2022 09:27:43 +0000 Subject: [PATCH 246/883] Revert "Rename pusch_proc_threads to thread_pool_size" This reverts commit daf8b950e143948bb7c50ffdc6039a8edf7a2e25 --- ci-scripts/conf_files/benetel-5g.conf | 6 +++--- .../conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- .../conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 4 ++-- .../conf_files/gnb.band261.tm1.32PRB.usrpn300.conf | 6 +++--- .../conf_files/gnb.band66.tm1.106PRB.usrpn300.conf | 2 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 8 ++++---- .../gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +++--- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 6 +++--- executables/nr-gnb.c | 4 ++-- openair1/PHY/defs_gNB.h | 2 +- openair2/GNB_APP/L1_nr_paramdef.h | 8 ++++---- openair2/GNB_APP/gnb_config.c | 2 +- .../PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf | 6 +++--- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 8 ++++---- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band78.106PRB.slave.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 10 +++++----- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 6 +++--- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 6 +++--- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 6 +++--- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 12 ++++++------ .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 12 ++++++------ .../GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf | 2 +- .../PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf | 6 +++--- .../GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf | 6 +++--- .../GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf | 6 +++--- targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 6 +++--- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- .../gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 6 +++--- .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 2 +- 44 files changed, 121 insertions(+), 121 deletions(-) diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 73b1da8c50..79b2f7f877 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -215,11 +215,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index b4c663b80b..77693d5f72 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -232,7 +232,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 2; + pusch_proc_threads = 2; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 725522f63a..c9b369eaff 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -229,9 +229,9 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 2; + pusch_proc_threads = 2; prach_dtx_threshold = 120; - } + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index dd9c210c0d..4338c00b36 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index fdb816237d..1c2133bebe 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -198,7 +198,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b891af747a..b0a757c9d0 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; - prach_dtx_threshold = 120; -} + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index e6ce5624c0..093e82d4e6 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,7 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 481613381c..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index 481613381c..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -239,7 +239,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 7efdf159eb..6ade355053 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -194,11 +194,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 98ca9a5791..b7a04b1f36 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -213,7 +213,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 6; + pusch_proc_threads = 6; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 5a5f0e9aa6..299a19cc4e 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 6; -} + pusch_proc_threads = 6; + } ); RUs = ( diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 92a4f9dcd6..a78750fefa 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -400,8 +400,8 @@ void init_gNB_Tpool(int inst) { // ULSCH decoding threadpool gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); int numCPU = sysconf(_SC_NPROCESSORS_ONLN); - LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->thread_pool_size,numCPU); - int threadCnt = min(numCPU, gNB->thread_pool_size); + LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); + int threadCnt = min(numCPU, gNB->pusch_proc_threads); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); char pool[80]; sprintf(pool,"-1"); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7372ea6a9c..1db4f6328a 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -891,7 +891,7 @@ typedef struct PHY_VARS_gNB_s { notifiedFIFO_t *resp_RU_tx; tpool_t *threadPool; int nbDecode; - uint8_t thread_pool_size; + uint8_t pusch_proc_threads; int number_of_nr_dlsch_max; int number_of_nr_ulsch_max; void * scopeData; diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index ccff1ca995..0306713845 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -46,7 +46,7 @@ #define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd" #define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd" #define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference" -#define CONFIG_STRING_L1_THREAD_POOL_SIZE "thread_pool_size" +#define CONFIG_STRING_L1_PUSCH_PROC_THREADS "pusch_proc_threads" #define CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR "ofdm_offset_divisor" #define CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD "pucch0_dtx_threshold" #define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold" @@ -65,8 +65,8 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_THREAD_POOL_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_PUSCH_PROC_THREADS, NULL, 0, uptr:NULL, defintval:3, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUSCH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:50, TYPE_UINT, 0} \ @@ -80,7 +80,7 @@ #define L1_REMOTE_N_PORTC_IDX 6 #define L1_LOCAL_N_PORTD_IDX 7 #define L1_REMOTE_N_PORTD_IDX 8 -#define L1_THREAD_POOL_SIZE 9 +#define L1_PUSCH_PROC_THREADS 9 #define L1_OFDM_OFFSET_DIVISOR 10 #define L1_PUCCH0_DTX_THRESHOLD 11 #define L1_PRACH_DTX_THRESHOLD 12 diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 027be4d3cb..d069bfe2f4 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -653,7 +653,7 @@ void RCconfig_NR_L1(void) { RC.gNB[j]->Mod_id = j; } - RC.gNB[j]->thread_pool_size = *(L1_ParamList.paramarray[j][L1_THREAD_POOL_SIZE].uptr); + RC.gNB[j]->pusch_proc_threads = *(L1_ParamList.paramarray[j][L1_PUSCH_PROC_THREADS].uptr); RC.gNB[j]->ofdm_offset_divisor = *(L1_ParamList.paramarray[j][L1_OFDM_OFFSET_DIVISOR].uptr); RC.gNB[j]->pucch0_thres = *(L1_ParamList.paramarray[j][L1_PUCCH0_DTX_THRESHOLD].uptr); RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index b90acb8e97..c6a4a90a14 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -216,11 +216,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index c3faa198dd..fd9399f89e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 8fa8fcf992..59e71a6225 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -196,12 +196,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index c2e364b75e..3fc81c0d6c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index 51c9076fe7..a40a93c789 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index d81655e5d5..3860aba935 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index b063989fd2..7c527e07c8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -194,12 +194,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 856eed4fc2..4f8c785baa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index 2e4dc540f3..b6b9252560 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -242,12 +242,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index a454af7b21..0817d7373e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index f536fd4d47..fd4c23cfdb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 375bb5f54c..965408332c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index 76bc5bf992..e36748a3a9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -209,12 +209,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7ff9d0ea77..7b2d369919 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index 07939f4d95..dbf4f58348 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6b5baef5ce..6d23726a78 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index 50169f4bce..c3fa56f15e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -192,12 +192,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index e217f39b94..15aa368fdf 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -193,12 +193,12 @@ MACRLCs = ( ); L1s = ( -{ - num_cc = 1; - tr_n_preference = "local_mac"; - thread_pool_size = 8; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 97f20c1461..06ae5af066 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -28,7 +28,7 @@ L1s = ( remote_n_portc = 50001; // vnf p5 port local_n_portd = 50010; // pnf p7 port remote_n_portd = 50011; // vnf p7 port - thread_pool_size = 8; + pusch_proc_threads = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 5aade8ab21..8dfcfb2b88 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -210,12 +210,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index fd4a722fc7..d01b0947c0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -211,12 +211,12 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; + pusch_proc_threads = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 -} + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2ecd4b1426..2f4839fd3b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -210,11 +210,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 92e97217b5..7f9e4d2d44 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -208,11 +208,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 2; -} + pusch_proc_threads = 2; + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 39e4d780af..357e4b6acd 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -219,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 44b7a0abc7..a423ee0dd1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -218,7 +218,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; #pucch0_dtx_threshold = 120; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e7fb2b3a1b..c031651ed2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -220,7 +220,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index 564b284f06..e9577ee265 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -225,11 +225,11 @@ MACRLCs = ( ); L1s = ( -{ + { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 8; -} + pusch_proc_threads = 8; + } ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index ae664dc48a..83fd3e0886 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -248,7 +248,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - thread_pool_size = 4; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 120; } From d4f408062623901d67e02d60be3c82c5de2bb608 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 5 Jan 2022 14:00:09 +0000 Subject: [PATCH 247/883] Revert "Revert "Merge remote-tracking branch 'origin/develop' into ue-phy-sync-improvements"" This reverts commit 29268d0a66c1a88a0058de066ce5968e9d8bfe3d. --- ci-scripts/Jenkinsfile-trig-nsa | 11 +- ci-scripts/checkCodingFormattingRules.sh | 4 +- ci-scripts/conf_files/benetel-5g.conf | 22 - .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 2 +- .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 29 - .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 29 - .../gnb.band261.tm1.32PRB.usrpn300.conf | 26 +- .../gnb.band66.tm1.106PRB.usrpn300.conf | 22 +- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 21 - ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 29 - .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 659 +++++++++--------- .../gnb.band78.sa.fr1.162PRB.usrpn310.conf | 316 +++++++++ .../gnb.band78.tm1.106PRB.usrpn300.conf | 24 +- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 21 - .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 28 - ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- .../fr1_nsa_2x2_quectel_attach_detach.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 6 +- ci-scripts/xml_files/fr1_sa_oaiue_x300.xml | 123 ++++ .../xml_files/fr1_sa_quectel_162prb.xml | 129 ++++ .../fr1_sa_quectel_stages_162prb.xml | 166 +++++ cmake_targets/CMakeLists.txt | 10 +- common/utils/nr/nr_common.c | 54 +- common/utils/nr/nr_common.h | 11 +- common/utils/threadPool/Makefile | 14 +- common/utils/threadPool/thread-pool.c | 45 +- common/utils/threadPool/thread-pool.h | 5 +- doc/testing_gnb_w_cots_ue_resources/gnb.conf | 37 - executables/nr-gnb.c | 10 +- executables/nr-ue.c | 2 +- openair1/PHY/CODING/crc.h | 543 +++++++++++++++ openair1/PHY/CODING/crc_byte.c | 86 ++- openair1/PHY/CODING/crcext.h | 89 +++ openair1/PHY/CODING/nrLDPC_defs.h | 37 +- .../nrLDPC_encoder/ldpc_encode_parity_check.c | 15 +- .../PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c | 2 - .../nrLDPC_encoder/ldpc_encoder_optim.c | 25 +- .../nrLDPC_encoder/ldpc_encoder_optim8seg.c | 18 +- .../ldpc_encoder_optim8segmulti.c | 94 ++- openair1/PHY/CODING/types.h | 98 +++ openair1/PHY/INIT/nr_init_ue.c | 2 +- openair1/PHY/INIT/nr_parms.c | 1 - openair1/PHY/LTE_REFSIG/lte_refsig.h | 3 +- openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c | 75 -- openair1/PHY/LTE_TRANSPORT/lte_mcs.c | 22 +- openair1/PHY/LTE_TRANSPORT/pcfich.c | 2 +- openair1/PHY/LTE_TRANSPORT/pucch.c | 2 +- .../LTE_TRANSPORT/transport_common_proto.h | 2 +- openair1/PHY/LTE_TRANSPORT/transport_proto.h | 46 +- openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 2 +- .../PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 54 +- .../LTE_UE_TRANSPORT/dlsch_llr_computation.c | 6 +- openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c | 4 +- .../PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 209 ++++-- openair1/PHY/NR_TRANSPORT/nr_dlsch.h | 3 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 389 +++++------ openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c | 5 - .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 46 +- .../nr_dlsch_llr_computation.c | 2 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 39 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 5 +- openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 4 +- openair1/PHY/defs_gNB.h | 17 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 5 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 27 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 29 +- openair1/SIMULATION/NR_PHY/dlsim.c | 45 +- openair1/SIMULATION/NR_PHY/nr_unitary_defs.h | 162 +---- openair1/SIMULATION/NR_PHY/ulsim.c | 8 +- openair2/COMMON/rrc_messages_types.h | 2 +- openair2/GNB_APP/RRC_nr_paramsvalues.h | 194 ------ openair2/GNB_APP/gnb_config.c | 127 +++- openair2/GNB_APP/gnb_paramdef.h | 6 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 39 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 10 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 54 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 42 +- openair2/LAYER2/NR_MAC_gNB/main.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 6 +- openair2/RRC/NR/nr_rrc_config.c | 159 ++--- openair2/RRC/NR/nr_rrc_config.h | 25 +- openair2/RRC/NR/nr_rrc_defs.h | 2 +- openair2/RRC/NR/rrc_gNB.c | 77 +- openair2/RRC/NR/rrc_gNB_nsa.c | 4 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 16 +- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 22 - .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 23 - .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 21 - .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 22 - .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 21 - .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 21 - .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 21 - .../gnb.band78.106PRB.30kHz,usrpb2x0.conf | 21 - .../CONF/gnb.band78.106PRB.slave.conf | 21 - .../CONF/gnb.band78.slave.conf | 21 - .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 23 - .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 21 - .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 22 - .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 23 - .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 21 - .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 21 - .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 23 - .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 23 - .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 23 - .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 21 - .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 39 -- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 21 - .../CONF/testing_gnb_24PRB.conf | 36 - .../CONF/testing_gnb_n310.conf | 21 - .../CONF/testing_gnb_nsa_n310.conf | 21 - .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 39 -- ...b.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 38 - .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 22 - ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 22 - .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 22 - ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 39 -- 120 files changed, 2814 insertions(+), 2796 deletions(-) create mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf create mode 100644 ci-scripts/xml_files/fr1_sa_oaiue_x300.xml create mode 100644 ci-scripts/xml_files/fr1_sa_quectel_162prb.xml create mode 100644 ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml create mode 100644 openair1/PHY/CODING/crc.h create mode 100644 openair1/PHY/CODING/crcext.h create mode 100644 openair1/PHY/CODING/types.h delete mode 100644 openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa index 4a56270e90..7b4238d678 100644 --- a/ci-scripts/Jenkinsfile-trig-nsa +++ b/ci-scripts/Jenkinsfile-trig-nsa @@ -88,7 +88,15 @@ pipeline { // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) //] //calling OAIUE N310 - build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ + //build job: "RAN-SA-OAIUE-N310-CN5G", wait : true, propagate : false, parameters: [ + // string(name: 'eNB_MR', value: String.valueOf(MR)), + // string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), + // string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), + // string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), + // booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) + //] + //calling OAIUE N310-X300 + build job: "RAN-SA-OAIUE-N310-X300-CN5G", wait : true, propagate : false, parameters: [ string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)), @@ -96,7 +104,6 @@ pipeline { booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE)) ] - } } } diff --git a/ci-scripts/checkCodingFormattingRules.sh b/ci-scripts/checkCodingFormattingRules.sh index 45cf08aa9a..a805f765df 100755 --- a/ci-scripts/checkCodingFormattingRules.sh +++ b/ci-scripts/checkCodingFormattingRules.sh @@ -77,7 +77,7 @@ then IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE || true` IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FILE || true` - IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h" || true` + IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] @@ -198,7 +198,7 @@ do IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true` IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE || true` IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FULLFILE || true` - IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h" || true` + IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true` if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ] then if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ] diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 47898aad15..79b2f7f877 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -119,19 +110,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 55; # this is SS=0 L=12 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; #p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index d2e91fb872..758bb44879 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 6c8d5ba6f0..d1d32e2b58 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 9bf3136690..77693d5f72 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -89,19 +89,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -156,22 +143,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 2; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index dfbbdf659d..c9b369eaff 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -86,19 +86,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 10; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -153,22 +140,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index e93177e7cc..4338c00b36 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; servingCellConfigCommon = ( { @@ -55,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,21 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 14; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 850cf9a60c..1c2133bebe 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -24,6 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; servingCellConfigCommon = ( { @@ -54,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,18 +110,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index c8dc1477b0..b0a757c9d0 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -55,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,18 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index e8be5a6ef0..16456f939c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -90,19 +90,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -157,22 +144,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index f00a343089..ff05aa6e65 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -1,343 +1,316 @@ -Active_gNBs = ( "gNB-OAI"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -gNBs = -( - { - ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - - gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - - plmn_list = ({ - mcc = 208; - mnc = 97; - mnc_length = 2; - snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); - - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" - - ////////// Physical parameters: - - ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - - pdcch_ConfigSIB1 = ( - { - controlResourceSetZero = 11; - searchSpaceZero = 0; - } - ); - - servingCellConfigCommon = ( - { - #spCellConfigCommon - - physCellId = 0; - -# downlinkConfigCommon - #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; - #scs-SpecificCarrierList - dl_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; - #initialDownlinkBWP - #genericParameters - # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; - #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; - initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; - - #uplinkConfigCommon - #frequencyInfoUL - ul_frequencyBand = 78; - #scs-SpecificCarrierList - ul_offstToCarrier = 0; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; - pMax = 20; - #initialUplinkBWP - #genericParameters - initialULBWPlocationAndBandwidth = 28875; -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; - #rach-ConfigCommon - #rach-ConfigGeneric - prach_ConfigurationIndex = 98; -#prach_msg1_FDM -#0 = one, 1=two, 2=four, 3=eight - prach_msg1_FDM = 0; - prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; -#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 = 3; -#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, - - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=4 - initialULBWPstartSymbolAndLength_1 = 52; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - - msg3_DeltaPreamble = 1; - p0_NominalWithGrant =-90; - -# pucch-ConfigCommon setup : -# pucchGroupHopping -# 0 = neither, 1= group hopping, 2=sequence hopping - pucchGroupHopping = 0; - hoppingId = 40; - p0_nominal = -90; -# ssb_PositionsInBurs_BitmapPR -# 1=short, 2=medium, 3=long - ssb_PositionsInBurst_PR = 2; - ssb_PositionsInBurst_Bitmap = 1; - -# ssb_periodicityServingCell -# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 - ssb_periodicityServingCell = 2; - -# dmrs_TypeA_position -# 0 = pos2, 1 = pos3 - dmrs_TypeA_Position = 0; - -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - subcarrierSpacing = 1; - - - #tdd-UL-DL-ConfigurationCommon -# subcarrierSpacing -# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - referenceSubcarrierSpacing = 1; - # pattern1 - # dl_UL_TransmissionPeriodicity - # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 - dl_UL_TransmissionPeriodicity = 6; - nrofDownlinkSlots = 7; - nrofDownlinkSymbols = 6; - nrofUplinkSlots = 2; - nrofUplinkSymbols = 4; - - ssPBCH_BlockPower = -25; - } - - ); - - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - } -); - -MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } -); - -L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 2; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 75; - eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } -); - -THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } -); - -security = { - # preferred ciphering algorithms - # the first one of the list that an UE supports in chosen - # valid values: nea0, nea1, nea2, nea3 - ciphering_algorithms = ( "nea0" ); - - # preferred integrity algorithms - # the first one of the list that an UE supports in chosen - # valid values: nia0, nia1, nia2, nia3 - integrity_algorithms = ( "nia2", "nia0" ); - - # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter - # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' - drb_ciphering = "yes"; - drb_integrity = "no"; -}; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + min_rxtxtime_pdsch = 6; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf new file mode 100644 index 0000000000..ff05aa6e65 --- /dev/null +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -0,0 +1,316 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + min_rxtxtime_pdsch = 6; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 4; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 4200300c50..6ade355053 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; servingCellConfigCommon = ( { @@ -55,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +109,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 38; # this is SS=10 L=3 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 015d9ee0d0..b7a04b1f36 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -52,15 +52,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -115,18 +106,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index e6bbbf2d41..299a19cc4e 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -53,19 +53,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0;#for DL slot - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0;#for mixed slot - initialDLBWPmappingType_1 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_1 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -120,21 +107,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 2; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 86af12b53e..2516af9429 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -24,7 +24,7 @@ TEST-NSA-FR1-TM2-Tab1 NSA 2x2 Ping DL UL with QUECTEL tasks - 5 + 1 030000 040000 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 2d17ff38e2..52cf1ec6e8 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -24,7 +24,7 @@ TEST-NSA-FR1-TM2-Tab2 NSA 2x2 Attach-Detach with QUECTEL tasks - 5 + 1 031000 041000 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index 28eee1e224..cd79e49f2c 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -22,7 +22,7 @@ --> TEST-SA-FR1-Tab1 - SA Ping DL UL with OAI NR UE + SA Ping DL UL with OAI NR UE (N310) tasks 1 @@ -40,9 +40,9 @@ Initialize_OAI_UE - Initialize OAI UE + Initialize OAI UE (N310) nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml new file mode 100644 index 0000000000..d527737b3c --- /dev/null +++ b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml @@ -0,0 +1,123 @@ + + + TEST-SA-FR1-Tab2 + SA Ping DL UL with OAI NR UE (X300) + tasks + 1 + + 040000 + 000002 + 010000 + 000002 + 050000 + 050001 + 000001 + 010002 + 080000 + + + + + Initialize_OAI_UE + Initialize OAI UE (X300) + nr + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "addr=192.168.60.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation + + + + Terminate_OAI_UE + Terminate OAI UE + + + + + Initialize_eNB + Initialize gNB + -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa --usrp-tx-thread-config 1 + 0 + 0 + nr + yes + yes + 192.168.18.240 + + + + IdleSleep + Sleep + 5 + + + + IdleSleep + Sleep + 20 + + + + + Ping + Ping from CN to UE: 20pings in 20sec + -c 20 + 5 + + + + Ping + Ping from CN to UE: 100pings in 20sec + -c 100 -i 0.2 + 5 + + + + Iperf + iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) + -u -b 60M -t 60 + DL + nrmodule2_quectel + 5 + single-ue + + + + Iperf + iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) + -u -b 3M -t 60 + UL + nrmodule2_quectel + 5 + single-ue + + + + + Terminate_eNB + Terminate gNB + 0 + 0 + nr + + + + diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml new file mode 100644 index 0000000000..2088678707 --- /dev/null +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -0,0 +1,129 @@ + + + TEST-SA-FR1-Tab3 + SA Ping DL UL with QUECTEL + tasks + 1 + + 040000 + 000002 + 010000 + 000001 + 050000 + 050001 + 070000 + 070001 + 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 + 0 + 0 + nr + yes + yes + 192.168.18.240 + + + + IdleSleep + Sleep + 5 + + + + IdleSleep + Sleep + 20 + + + + + Ping + Ping: 20pings in 20sec + nrmodule2_quectel + -c 20 + 5 + + + + Ping + Ping: 100pings in 20sec + nrmodule2_quectel + -c 100 -i 0,2 + 5 + + + + Iperf + iperf (DL/140Mbps/UDP)(60 sec)(single-ue profile) + -u -b 140M -t 60 + DL + nrmodule2_quectel + 5 + single-ue + + + + Iperf + iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) + -u -b 3M -t 60 + UL + nrmodule2_quectel + 5 + single-ue + + + + + Terminate_eNB + Terminate gNB + 0 + 0 + nr + + + + diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml new file mode 100644 index 0000000000..4b2400a4ac --- /dev/null +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml @@ -0,0 +1,166 @@ + + + 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 + 0 + 0 + nr + yes + yes + 192.168.18.240 + + + + 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 + + + + diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 329ed7bb3d..f513ac0563 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1,4 +1,4 @@ -#/* +#/* # * 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. @@ -308,7 +308,7 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") set(COMPILATION_AVX2 "False") endif() if (CPUINFO MATCHES "sse4_1") - set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1") + set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mpclmul") endif() if (CPUINFO MATCHES "ssse3") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3") @@ -889,7 +889,7 @@ set(HWLIB_BENETEL_4G_SOURCE ) add_library(benetel_4g MODULE ${HWLIB_BENETEL_4G_SOURCE} ) -set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") +set_target_properties(benetel_4g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") TARGET_LINK_LIBRARIES(benetel_4g ${DPDK_LIBS}) @@ -907,7 +907,7 @@ set(HWLIB_BENETEL_5G_SOURCE ) add_library(benetel_5g MODULE ${HWLIB_BENETEL_5G_SOURCE} ) -set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") +set_target_properties(benetel_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -I$ENV{RTE_SDK}/$ENV{RTE_TARGET}/include") SET(DPDK_LIBS "-Wl,-rpath,$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -Wl,--whole-archive -L$ENV{RTE_SDK}/$ENV{RTE_TARGET}/lib -ldpdk -Wl,--no-whole-archive") TARGET_LINK_LIBRARIES(benetel_5g ${DPDK_LIBS}) @@ -993,7 +993,6 @@ add_boolean_option(TRACE_RLC_AM_HOLE False "TRACE for RLC AM, TO BE CHANGE add_boolean_option(TRACE_RLC_AM_PDU False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_RESEGMENT False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_RX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") -add_boolean_option(TRACE_RLC_AM_RX_DECODE False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_TX False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_TX_STATUS False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") add_boolean_option(TRACE_RLC_AM_STATUS_CREATION False "TRACE for RLC AM, TO BE CHANGED IN A MORE GENERAL FLAG") @@ -1572,7 +1571,6 @@ set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_scrambling.c - ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_gold_generic.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/srs_modulation.c ${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index a704a66c76..0de24bcf6d 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -257,6 +257,48 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) { *n_rb = 6*count; } +int get_nb_periods_per_frame(uint8_t tdd_period) { + + int nb_periods_per_frame; + switch(tdd_period) { + case 0: + nb_periods_per_frame = 20; // 10ms/0p5ms + break; + + case 1: + nb_periods_per_frame = 16; // 10ms/0p625ms + break; + + case 2: + nb_periods_per_frame = 10; // 10ms/1ms + break; + + case 3: + nb_periods_per_frame = 8; // 10ms/1p25ms + break; + + case 4: + nb_periods_per_frame = 5; // 10ms/2ms + break; + + case 5: + nb_periods_per_frame = 4; // 10ms/2p5ms + break; + + case 6: + nb_periods_per_frame = 2; // 10ms/5ms + break; + + case 7: + nb_periods_per_frame = 1; // 10ms/10ms + break; + + default: + AssertFatal(1==0,"Undefined tdd period %d\n", tdd_period); + } + return nb_periods_per_frame; +} + int get_dmrs_port(int nl, uint16_t dmrs_ports) { @@ -276,14 +318,6 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) { return p; } -int get_num_dmrs(uint16_t dmrs_mask ) { - - int num_dmrs=0; - - for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); - return(num_dmrs); -} - lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index) { lte_frame_type_t current_type; @@ -472,6 +506,10 @@ int get_subband_size(int NPRB,int size) { } +int get_SLIV(uint8_t S, uint8_t L) { + return ( (uint16_t)(((L-1)<=7)? (14*(L-1)+S) : (14*(15-L)+(13-S))) ); +} + void SLIV2SL(int SLIV,int *S,int *L) { int SLIVdiv14 = SLIV/14; diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index d9f2b0c03a..44a6e05577 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -50,9 +50,17 @@ typedef struct nr_bandentry_s { extern const size_t nr_bandtable_size; extern nr_bandentry_t nr_bandtable[]; +static inline int get_num_dmrs(uint16_t dmrs_mask ) { + int num_dmrs=0; + + for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); + return(num_dmrs); +} + + +int get_SLIV(uint8_t S, uint8_t L); void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset); -int get_num_dmrs(uint16_t dmrs_mask); uint16_t config_bandwidth(int mu, int nb_rb, int nr_band); int get_nr_table_idx(int nr_bandP, uint8_t scs_index); int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index); @@ -71,6 +79,7 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); int get_subband_size(int NPRB,int size); void SLIV2SL(int SLIV,int *S,int *L); int get_dmrs_port(int nl, uint16_t dmrs_ports); +int get_nb_periods_per_frame(uint8_t tdd_period); #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) diff --git a/common/utils/threadPool/Makefile b/common/utils/threadPool/Makefile index 6b28eb2ba8..729f9dd0e2 100644 --- a/common/utils/threadPool/Makefile +++ b/common/utils/threadPool/Makefile @@ -1,13 +1,3 @@ -all: -measurement_display thread-pool-test - -measurement_display: -measurement_display.c thread-pool.h -gcc measurement_display.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o -measurement_display - -thread-pool-test: -thread-pool.c thread-pool.h -gcc -g thread-pool.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -I $ {OPENAIR_DIR}/openair2/COMMON $ {OPENAIR_DIR}/common/utils/LOG/log.c $ {OPENAIR_DIR}/common/config/config_userapi.c -$ {OPENAIR_DIR}/common/config/config_load_configmodule.c $ {OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test +thread-pool-test: thread-pool.c thread-pool.h + gcc -g -O3 thread-pool.c -I ${OPENAIR_DIR}/nfapi/open-nFAPI/nfapi/public_inc -I ${OPENAIR_DIR}/ -I ${OPENAIR_DIR}/common/utils/ -I. ${OPENAIR_DIR}/common/utils/backtrace.c -I ${OPENAIR_DIR}/openair2/COMMON ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/config/config_userapi.c ${OPENAIR_DIR}/common/config/config_load_configmodule.c ${OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -DMAX_NUM_CCs=1 -I../LOG -I../../utils/T -o thread-pool-test diff --git a/common/utils/threadPool/thread-pool.c b/common/utils/threadPool/thread-pool.c index 77729ae7a7..fff09528a8 100644 --- a/common/utils/threadPool/thread-pool.c +++ b/common/utils/threadPool/thread-pool.c @@ -155,21 +155,24 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name } #ifdef TEST_THREAD_POOL +volatile int oai_exit=0; void exit_function(const char *file, const char *function, const int line, const char *s) { } struct testData { int id; + int sleepTime; char txt[30]; }; void processing(void *arg) { struct testData *in=(struct testData *)arg; - printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); + //printf("doing: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); sprintf(in->txt,"Done by %ld, job %d", pthread_self(), in->id); - usleep(rand()%100); - printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); + in->sleepTime=rand()%1000; + usleep(in->sleepTime); + //printf("done: %d, %s, in thr %ld\n",in->id, in->txt,pthread_self() ); } int main() { @@ -208,11 +211,43 @@ int main() { } while(tmp); tpool_t pool; - char params[]="1,2,3,u"; + char params[]="1,2,3,4,5"; initTpool(params,&pool, true); notifiedFIFO_t worker_back; initNotifiedFIFO(&worker_back); + sleep(1); + int cumulProcessTime=0, cumulTime=0; + struct timespec st,end; + clock_gettime(CLOCK_MONOTONIC, &st); + int nb_jobs=4; + for (int i=0; i <1000 ; i++) { + int parall=nb_jobs; + for (int j=0; j id=i; + pushTpool(&pool, work); + } + int sleepmax=0; + while (parall) { + tmp=pullTpool(&worker_back,&pool); + if (tmp) { + parall--; + struct testData *dd=NotifiedFifoData(tmp); + if (dd->sleepTime > sleepmax) + sleepmax=dd->sleepTime; + delNotifiedFIFO_elt(tmp); + } + } + cumulProcessTime+=sleepmax; + } + clock_gettime(CLOCK_MONOTONIC, &end); + long long dur=(end.tv_sec-st.tv_sec)*1000*1000+(end.tv_nsec-st.tv_nsec)/1000; + printf("In µs, Total time per group of %d job:%lld, work time per job %d, overhead per job %lld\n", + nb_jobs, dur/1000, cumulProcessTime/1000, (dur-cumulProcessTime)/(1000*nb_jobs)); + + /* for (int i=0; i <1000 ; i++) { notifiedFIFO_elt_t *work=newNotifiedFIFO_elt(sizeof(struct testData), i, &worker_back, processing); struct testData *x=(struct testData *)NotifiedFifoData(work); @@ -232,7 +267,7 @@ int main() { abortTpool(&pool,510); } while(tmp); - + */ return 0; } #endif diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index a32b7c3859..1839b42f39 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -31,6 +31,7 @@ #include #include #include +//#include #ifdef DEBUG #define THREADINIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP @@ -50,7 +51,7 @@ AssertFatal(ret==0,"ret=%d\n",ret);} #define condbroadcast(signal) {int ret=pthread_cond_broadcast(&signal); \ AssertFatal(ret==0,"ret=%d\n",ret);} -#define condsignal(signal) {int ret=pthread_cond_broadcast(&signal); \ +#define condsignal(signal) {int ret=pthread_cond_signal(&signal); \ AssertFatal(ret==0,"ret=%d\n",ret);} #define tpool_nbthreads(tpool) (tpool.nbThreads) typedef struct notifiedFIFO_elt_s { @@ -130,7 +131,7 @@ static inline void pushNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf, notifiedFIF static inline void pushNotifiedFIFO(notifiedFIFO_t *nf, notifiedFIFO_elt_t *msg) { mutexlock(nf->lockF); pushNotifiedFIFO_nothreadSafe(nf,msg); - condbroadcast(nf->notifF); + condsignal(nf->notifF); mutexunlock(nf->lockF); } diff --git a/doc/testing_gnb_w_cots_ue_resources/gnb.conf b/doc/testing_gnb_w_cots_ue_resources/gnb.conf index 97935f92ee..aae22a92ba 100755 --- a/doc/testing_gnb_w_cots_ue_resources/gnb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/gnb.conf @@ -53,29 +53,7 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57) - initialDLBWPstartSymbolAndLength_3 = 57; //43; //57; #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -129,21 +107,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 2; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index e9fc06ce4a..dc8960846f 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -401,15 +401,15 @@ void init_gNB_Tpool(int inst) { LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->pusch_proc_threads,numCPU); int threadCnt = min(numCPU, gNB->pusch_proc_threads); if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt); - char ul_pool[80]; - sprintf(ul_pool,"-1"); + char pool[80]; + sprintf(pool,"-1"); int s_offset = 0; for (int icpu=1; icputhreadPool, false); + if (getenv("noThreads")) strcpy(pool, "n"); + initTpool(pool, gNB->threadPool, false); // ULSCH decoder result FIFO gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->respDecode); diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 702c214d9e..6694635e26 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -783,7 +783,7 @@ void init_NR_UE_threads(int nb_inst) { /* HACK: this function is needed to compile the UE * fix it somehow */ -int8_t find_dlsch(uint16_t rnti, +int find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB, find_type_t type) { diff --git a/openair1/PHY/CODING/crc.h b/openair1/PHY/CODING/crc.h new file mode 100644 index 0000000000..d6474eae9b --- /dev/null +++ b/openair1/PHY/CODING/crc.h @@ -0,0 +1,543 @@ +/******************************************************************************* + Copyright (c) 2009-2018, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/** + * Header file for module with CRC computation methods + * + * PCLMULQDQ implementation is based on work by: + * Erdinc Ozturk + * Vinodh Gopal + * James Guilford + * + * "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction" + * URL: http://download.intel.com/design/intarch/papers/323102.pdf + */ + +#ifndef __CRC_H__ +#define __CRC_H__ + +#include + +#include "crcext.h" +#include "types.h" +#include +#include + +/** + * PCLMULQDQ CRC computation context structure + */ +struct crc_pclmulqdq_ctx { + /** + * K1 = reminder X^128 / P(X) : 0-63 + * K2 = reminder X^192 / P(X) : 64-127 + */ + uint64_t k1; + uint64_t k2; + + /** + * K3 = reminder X^64 / P(X) : 0-63 + * q = quotient X^64 / P(X) : 64-127 + */ + uint64_t k3; + uint64_t q; + + /** + * p = polynomial / P(X) : 0-63 + * res = reserved : 64-127 + */ + uint64_t p; + uint64_t res; +}; + +/** + * Functions and prototypes + */ + +/** + * @brief Initializes look-up-table (LUT) for given 8 bit polynomial + * + * @param poly CRC polynomial + * @param lut pointer to look-up-table to be initialized + */ +void crc8_init_lut(const uint8_t poly, uint8_t *lut); + +/** + * @brief Calculates 8 bit CRC using LUT method. + * + * @param crc CRC initial value + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param lut 256x8bits look-up-table pointer + * + * @return New CRC value + */ +__forceinline +uint8_t crc8_calc_lut(const uint8_t *data, + uint32_t data_len, + uint8_t crc, + const uint8_t *lut) +{ + if (unlikely(data == NULL || lut == NULL)) + return crc; + + while (data_len--) + crc = lut[*data++ ^ crc]; + + return crc; +} + +/** + * @brief Initializes look-up-table (LUT) for given 16 bit polynomial + * + * @param poly CRC polynomial + * @param lut pointer to 256x16bits look-up-table to be initialized + */ +void crc16_init_lut(const uint16_t poly, uint16_t *lut); + +/** + * @brief Calculates 16 bit CRC using LUT method. + * + * @param crc CRC initial value + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param lut 256x16bits look-up-table pointer + * + * @return New CRC value + */ +__forceinline +uint16_t crc16_calc_lut(const uint8_t *data, + uint32_t data_len, + uint16_t crc, + const uint16_t *lut) +{ + if (unlikely(data == NULL || lut == NULL)) + return crc; + + while (data_len--) + crc = lut[(crc >> 8) ^ *data++] ^ (crc << 8); + + return crc; +} + +/** + * @brief Initializes look-up-table (LUT) for given 32 bit polynomial + * + * @param poly CRC polynomial + * @param lut pointer to 256x32bits look-up-table to be initialized + */ +void crc32_init_lut(const uint32_t poly, uint32_t *lut); + +/** + * @brief Calculates 32 bit CRC using LUT method. + * + * @param crc CRC initial value + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param lut 256x32bits look-up-table pointer + * + * @return New CRC value + */ +__forceinline +uint32_t crc32_calc_lut(const uint8_t *data, + uint32_t data_len, + uint32_t crc, + const uint32_t *lut) +{ + if (unlikely(data == NULL || lut == NULL)) + return crc; + + while (data_len--) + crc = lut[(crc >> 24) ^ *data++] ^ (crc << 8); + + return crc; +} + +/** + * @brief Initializes look up tables for slice-By-2 method. + * + * @param poly CRC polynomial + * @param slice1 slice-by-2 look-up-table 1 + * @param slice2 slice-by-2 look-up-table 2 + * + * @return New CRC value + */ +void crc16_init_slice2(const uint16_t poly, + uint16_t *slice1, + uint16_t *slice2); + +/** + * @brief Calculates 16 bit CRC using Slice-By-2 method. + * + * @param crc CRC initial value + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param slice1 256x16bits slice look-up-table 1 + * @param slice2 256x16bits slice look-up-table 2 + * + * @return New CRC value + */ +__forceinline +uint16_t crc16_calc_slice2(const uint8_t *data, + uint32_t data_len, + uint16_t crc, + const uint16_t *slice1, + const uint16_t *slice2) +{ + uint_fast32_t i; + + if (unlikely(data == NULL)) + return crc; + + if (unlikely(slice1 == NULL || slice2 == NULL)) + return crc; + + crc = bswap2(crc); + for (i = (data_len & (~1)), data += (data_len & (~1)); i != 0; + i -= sizeof(uint16_t)) { + crc ^= (*((const uint16_t *)(data - i))); + crc = slice2[(uint8_t)crc] ^ slice1[(uint8_t)(crc >> 8)]; + } + crc = bswap2(crc); + if (data_len & 1) + crc = (crc << 8) ^ bswap2(slice1[(crc >> 8) ^ *data]); + + return crc; +} + +/** + * @brief Initializes look up tables for slice-By-4 method. + * + * @param poly CRC polynomial + * @param slice1 256x32bits slice look-up-table 1 + * @param slice2 256x32bits slice look-up-table 2 + * @param slice3 256x32bits slice look-up-table 3 + * @param slice4 256x32bits slice look-up-table 4 + * + * @return New CRC value + */ +void crc32_init_slice4(const uint32_t poly, + uint32_t *slice1, uint32_t *slice2, + uint32_t *slice3, uint32_t *slice4); + +/** + * @brief Calculates 32 bit CRC using Slice-By-4 method. + * + * @param data pointer to data block to calculate CRC for + * @param data_len size of data block + * @param crc CRC initial value + * @param slice1 256x32bits slice look-up-table 1 + * @param slice2 256x32bits slice look-up-table 2 + * @param slice3 256x32bits slice look-up-table 3 + * @param slice4 256x32bits slice look-up-table 4 + * + * @return New CRC value + */ +__forceinline +uint32_t crc32_calc_slice4(const uint8_t *data, + uint32_t data_len, uint32_t crc, + const uint32_t *slice1, const uint32_t *slice2, + const uint32_t *slice3, const uint32_t *slice4) +{ + uint_fast32_t i; + + if (unlikely(data == NULL)) + return crc; + + if (unlikely(slice1 == NULL || slice2 == NULL || + slice3 == NULL || slice4 == NULL)) + return crc; + + crc = bswap4(crc); + for (i = data_len & (~3), data += (data_len & (~3)); i != 0; + i -= sizeof(uint32_t)) { + crc ^= (*((const uint32_t *)(data - i))); + crc = slice4[(uint8_t)(crc)] ^ + slice3[(uint8_t)(crc >> 8)] ^ + slice2[(uint8_t)(crc >> 16)] ^ + slice1[(uint8_t)(crc >> 24)]; + } + crc = bswap4(crc); + for (i = data_len & 3, data += (data_len & 3); i != 0; i--) + crc = (crc << 8) ^ + bswap4(slice1[(crc >> 24) ^ *(data - i)]); + + return crc; +} + +/** + * @brief Performs one folding round + * + * Logically function operates as follows: + * DATA = READ_NEXT_16BYTES(); + * F1 = LSB8(FOLD) + * F2 = MSB8(FOLD) + * T1 = CLMUL( F1, K1 ) + * T2 = CLMUL( F2, K2 ) + * FOLD = XOR( T1, T2, DATA ) + * + * @param data_block 16 byte data block + * @param k1_k2 k1 and k2 constanst enclosed in XMM register + * @param fold running 16 byte folded data + * + * @return New 16 byte folded data + */ +__forceinline +__m128i crc32_folding_round(const __m128i data_block, + const __m128i k1_k2, + const __m128i fold) +{ + __m128i tmp = _mm_clmulepi64_si128(fold, k1_k2, 0x11); + + return _mm_xor_si128(_mm_clmulepi64_si128(fold, k1_k2, 0x00), + _mm_xor_si128(data_block, tmp)); +} + +/** + * @brief Performs Barret's reduction from 128 bits to 64 bits + * + * @param data128 128 bits data to be reduced + * @param k3_q k3 and Q constants enclosed in XMM register + * + * @return data reduced to 64 bits + */ +__forceinline +__m128i crc32_reduce_128_to_64(__m128i data128, const __m128i k3_q) +{ + __m128i tmp; + + tmp = _mm_xor_si128(_mm_clmulepi64_si128(data128, k3_q, 0x01 /* k3 */), + data128); + + data128 = _mm_xor_si128(_mm_clmulepi64_si128(tmp, k3_q, 0x01 /* k3 */), + data128); + + return _mm_srli_si128(_mm_slli_si128(data128, 8), 8); +} + +/** + * @brief Performs Barret's reduction from 64 bits to 32 bits + * + * @param data64 64 bits data to be reduced + * @param k3_q k3 and Q constants enclosed in XMM register + * @param p_res P constant enclosed in XMM register + * + * @return data reduced to 32 bits + */ +__forceinline +uint32_t +crc32_reduce_64_to_32(__m128i fold, const __m128i k3_q, const __m128i p_res) +{ + __m128i temp; + + temp = _mm_clmulepi64_si128(_mm_srli_si128(fold, 4), + k3_q, 0x10 /* Q */); + temp = _mm_srli_si128(_mm_xor_si128(temp, fold), 4); + temp = _mm_clmulepi64_si128(temp, p_res, 0 /* P */); + return _mm_extract_epi32(_mm_xor_si128(temp, fold), 0); +} + +/** + * @brief Calculates 32 bit CRC for given \a data block by applying folding and + * reduction methods. + * + * Algorithm operates on 32 bit CRCs so polynomials and initial values may + * need to be promoted to 32 bits where required. + * + * @param crc initial CRC value (32 bit value) + * @param data pointer to data block + * @param data_len length of \a data block in bytes + * @param params pointer to PCLMULQDQ CRC calculation context + * + * @return CRC for given \a data block (32 bits wide). + */ +__forceinline +uint32_t +crc32_calc_pclmulqdq(const uint8_t *data, + uint32_t data_len, uint32_t crc, + const struct crc_pclmulqdq_ctx *params) +{ + __m128i temp, fold, k, swap; + uint32_t n; + + if (unlikely(data == NULL || data_len == 0 || params == NULL)) + return crc; + +#ifdef __KERNEL__ + /** + * Preserve FPU context + */ + kernel_fpu_begin(); +#endif + + /** + * Add 4 bytes to data block size + * This is to secure the following: + * CRC32 = M(X)^32 mod P(X) + * M(X) - message to compute CRC on + * P(X) - CRC polynomial + */ + data_len += 4; + + /** + * Load first 16 data bytes in \a fold and + * set \a swap BE<->LE 16 byte conversion variable + */ + fold = _mm_loadu_si128((__m128i *)data); + swap = crc_xmm_be_le_swap128; + + /** + * ------------------------------------------------- + * Folding all data into single 16 byte data block + * Assumes: \a fold holds first 16 bytes of data + */ + + if (unlikely(data_len <= 16)) { + /** + * Data block fits into 16 byte block + * - adjust data block + * - 4 least significant bytes need to be zero + */ + fold = _mm_shuffle_epi8(fold, swap); + fold = _mm_slli_si128(xmm_shift_right(fold, 20 - data_len), 4); + + /** + * Apply CRC init value + */ + temp = _mm_insert_epi32(_mm_setzero_si128(), bswap4(crc), 0); + temp = xmm_shift_left(temp, data_len - 4); + fold = _mm_xor_si128(fold, temp); + } else { + /** + * There are 2x16 data blocks or more + */ + __m128i next_data; + + /** + * n = number of bytes required to align \a data_len + * to multiple of 16 + */ + n = ((~data_len) + 1) & 15; + + /** + * Apply CRC initial value and + * get \a fold to BE format + */ + fold = _mm_xor_si128(fold, + _mm_insert_epi32(_mm_setzero_si128(), + crc, 0)); + fold = _mm_shuffle_epi8(fold, swap); + + /** + * Load next 16 bytes of data and + * adjust \a fold & \a next_data as follows: + * + * CONCAT(fold,next_data) >> (n*8) + */ + next_data = _mm_loadu_si128((__m128i *)&data[16]); + next_data = _mm_shuffle_epi8(next_data, swap); + next_data = _mm_or_si128(xmm_shift_right(next_data, n), + xmm_shift_left(fold, 16 - n)); + fold = xmm_shift_right(fold, n); + + if (unlikely(data_len <= 32)) + /** + * In such unlikely case clear 4 least significant bytes + */ + next_data = + _mm_slli_si128(_mm_srli_si128(next_data, 4), 4); + + /** + * Do the initial folding round on 2 first 16 byte chunks + */ + k = _mm_load_si128((__m128i *)(¶ms->k1)); + fold = crc32_folding_round(next_data, k, fold); + + if (likely(data_len > 32)) { + /** + * \a data_block needs to be at least 48 bytes long + * in order to get here + */ + __m128i new_data; + + /** + * Main folding loop + * - n is adjusted to point to next 16 data block + * to read + * (16+16) = 2x16; represents 2 first data blocks + * processed above + * (- n) is the number of zero bytes padded to + * the message in order to align it to 16 bytes + * - the last 16 bytes is processed separately + */ + for (n = 16 + 16 - n; n < (data_len - 16); n += 16) { + new_data = _mm_loadu_si128((__m128i *)&data[n]); + new_data = _mm_shuffle_epi8(new_data, swap); + fold = crc32_folding_round(new_data, k, fold); + } + + /** + * The last folding round works always on 12 bytes + * (12 bytes of data and 4 zero bytes) + * Read from offset -4 is to avoid one + * shift right operation. + */ + new_data = _mm_loadu_si128((__m128i *)&data[n - 4]); + new_data = _mm_shuffle_epi8(new_data, swap); + new_data = _mm_slli_si128(new_data, 4); + fold = crc32_folding_round(new_data, k, fold); + } /* if (data_len > 32) */ + } + + /** + * ------------------------------------------------- + * Reduction 128 -> 32 + * Assumes: \a fold holds 128bit folded data + */ + + /** + * REDUCTION 128 -> 64 + */ + k = _mm_load_si128((__m128i *)(¶ms->k3)); + fold = crc32_reduce_128_to_64(fold, k); + + /** + * REDUCTION 64 -> 32 + */ + n = crc32_reduce_64_to_32(fold, k, + _mm_load_si128((__m128i *)(¶ms->p))); + +#ifdef __KERNEL__ + /** + * - restore FPU context + */ + kernel_fpu_end(); +#endif + + return n; +} + +#endif /* __CRC_H__ */ diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 287cbcd1f4..d1c3917c2c 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -30,10 +30,17 @@ Modified in June, 2001, to include the length non multiple of 8 */ +#ifndef __SSE4_1__ +#define USE_INTEL_CRC 0 +#else +#define USE_INTEL_CRC __SSE4_1__ +#endif #include "coding_defs.h" #include "assertions.h" - +#if USE_INTEL_CRC +#include "crc.h" +#endif /*ref 36-212 v8.6.0 , pp 8-9 */ /* the highest degree is set by default */ @@ -94,6 +101,28 @@ static unsigned short crc11Table[256]; static unsigned char crc8Table[256]; static unsigned char crc6Table[256]; +#if USE_INTEL_CRC +static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24a_pclmulqdq, 16) = { + 0x64e4d700, /**< k1 */ + 0x2c8c9d00, /**< k2 */ + 0xd9fe8c00, /**< k3 */ + 0xf845fe24, /**< q */ + 0x864cfb00, /**< p */ + 0ULL /**< res */ +}; +__m128i crc_xmm_be_le_swap128; + +DECLARE_ALIGNED(const uint8_t crc_xmm_shift_tab[48], 16) = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +}; + +#endif + void crcTableInit (void) { unsigned char c = 0; @@ -108,23 +137,29 @@ void crcTableInit (void) crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24); crc6Table[c] = (unsigned char) (crcbit (&c, 1, poly6) >> 24); } while (++c); +#if USE_INTEL_CRC + crc_xmm_be_le_swap128 = _mm_setr_epi32(0x0c0d0e0f, 0x08090a0b, + 0x04050607, 0x00010203); + +#endif } /********************************************************* -Byte by byte implementations, +Byte by byte LUT implementations, assuming initial byte is 0 padded (in MSB) if necessary - +can use SIMD optimized Intel CRC for LTE/NR 24a/24b variants *********************************************************/ + unsigned int crc24a (unsigned char * inptr, int bitlen) { + int octetlen = bitlen / 8; /* Change in octets */ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - + if ( bitlen % 8 || !USE_INTEL_CRC ) { + unsigned int crc = 0; + int resbit= (bitlen % 8); + while (octetlen-- > 0) { // printf("crc24a: in %x => crc %x\n",crc,*inptr); crc = (crc << 8) ^ crc24aTable[(*inptr++) ^ (crc >> 24)]; @@ -132,17 +167,35 @@ unsigned int crc24a (unsigned char * inptr, if (resbit > 0) crc = (crc << resbit) ^ crc24aTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; - return crc; + } + #if USE_INTEL_CRC + else { + return crc32_calc_pclmulqdq(inptr, octetlen, 0, + <e_crc24a_pclmulqdq); + } + #endif + } +#if USE_INTEL_CRC +static DECLARE_ALIGNED(struct crc_pclmulqdq_ctx lte_crc24b_pclmulqdq, 16) = { + 0x80140500, /**< k1 */ + 0x42000100, /**< k2 */ + 0x90042100, /**< k3 */ + 0xffff83ff, /**< q */ + 0x80006300, /**< p */ + 0ULL /**< res */ +}; +#endif unsigned int crc24b (unsigned char * inptr, - int bitlen) + int bitlen) { - int octetlen, resbit; + int octetlen = bitlen / 8; /* Change in octets */ + + if ( bitlen % 8 || !USE_INTEL_CRC ) { unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); + int resbit = (bitlen % 8); while (octetlen-- > 0) { // printf("crc24b: in %x => crc %x (%x)\n",crc,*inptr,crc24bTable[(*inptr) ^ (crc >> 24)]); @@ -153,6 +206,13 @@ unsigned int crc24b (unsigned char * inptr, crc = (crc << resbit) ^ crc24bTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; return crc; + } +#if USE_INTEL_CRC + else { + return crc32_calc_pclmulqdq(inptr, octetlen, 0, + <e_crc24b_pclmulqdq); + } +#endif } unsigned int crc24c (unsigned char * inptr, diff --git a/openair1/PHY/CODING/crcext.h b/openair1/PHY/CODING/crcext.h new file mode 100644 index 0000000000..f441f25e50 --- /dev/null +++ b/openair1/PHY/CODING/crcext.h @@ -0,0 +1,89 @@ +/******************************************************************************* + Copyright (c) 2009-2018, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/** + * Header file with CRC external definitions + * + */ + +#ifndef __CRCEXT_H__ +#define __CRCEXT_H__ + +#include +#include "types.h" +/** + * Flag indicating availability of PCLMULQDQ instruction + * Only valid after running CRCInit() function. + */ +extern int pclmulqdq_available; + +/** + * Flag indicating availability of PCLMULQDQ instruction + * Only valid after running CRCInit() function. + */ +extern __m128i crc_xmm_be_le_swap128; +extern const uint8_t crc_xmm_shift_tab[48]; + +/** + * @brief Shifts right 128 bit register by specified number of bytes + * + * @param reg 128 bit value + * @param num number of bytes to shift right \a reg by (0-16) + * + * @return \a reg >> (\a num * 8) + */ +__forceinline +__m128i xmm_shift_right(__m128i reg, const unsigned int num) +{ + const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 + num); + + return _mm_shuffle_epi8(reg, _mm_loadu_si128(p)); +} + +/** + * @brief Shifts left 128 bit register by specified number of bytes + * + * @param reg 128 bit value + * @param num number of bytes to shift left \a reg by (0-16) + * + * @return \a reg << (\a num * 8) + */ +__forceinline +__m128i xmm_shift_left(__m128i reg, const unsigned int num) +{ + const __m128i *p = (const __m128i *)(crc_xmm_shift_tab + 16 - num); + + return _mm_shuffle_epi8(reg, _mm_loadu_si128(p)); +} + +/** + * @brief Initializes CRC module. + * @note It is mandatory to run it before using any of CRC API's. + */ +extern void CRCInit(void); + +#endif /* __CRCEXT_H__ */ diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index 321ecaab7d..0d7ff9ef9f 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -22,6 +22,7 @@ // encoder interface #ifndef __NRLDPC_DEFS__H__ #define __NRLDPC_DEFS__H__ +#include #include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h" /** \brief LDPC encoder @@ -36,17 +37,31 @@ \param 9-12 time_stats_t *tinput,*tprep, *tparity,*toutput */ typedef struct { - int n_segments; // optim8seg - unsigned int macro_num; // optim8segmulti - unsigned char gen_code; //orig - time_stats_t *tinput; - time_stats_t *tprep; - time_stats_t *tparity; - time_stats_t *toutput; -}encoder_implemparams_t; + unsigned int n_segments; // optim8seg + unsigned int macro_num; // optim8segmulti + unsigned char gen_code; //orig + time_stats_t *tinput; + time_stats_t *tprep; + time_stats_t *tparity; + time_stats_t *toutput; + int Kr; + uint32_t Kb; + uint32_t *Zc; + void *harq; + /// Encoder BG + uint8_t BG; + /// Interleaver outputs + unsigned char *output; + /// Number of bits in "small" code segments + uint32_t K; + /// Number of "Filler" bits + uint32_t F; + /// LDPC-code outputs + uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; +} encoder_implemparams_t; #define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL} -typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out); -typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t*); +typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out); +typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t *); //============================================================================================================================ // decoder interface /** @@ -56,5 +71,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho \param p_llrOut Output vector \param p_profiler LDPC profiler statistics */ -typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* ); +typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_procBuf *, t_nrLDPC_time_stats * ); #endif diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c index 738fd49b7d..69d2ac4972 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c @@ -38,8 +38,6 @@ #include "common/utils/LOG/log.h" -//#define DEBUG_LDPC - #include "ldpc384_byte.c" #include "ldpc352_byte.c" #include "ldpc320_byte.c" @@ -73,9 +71,18 @@ -static inline void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,short Kb) +static void encode_parity_check_part_optim(uint8_t *cc,uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols) { - + unsigned char c[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c + + for (int i1=0; i1 < ncols; i1++) { + memcpy(&c[2*i1*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); + memcpy(&c[(2*i1+1)*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); + } + for (int i1=1;i1tinput != NULL) start_meas(impp->tinput); - for (i=0; i>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); } @@ -108,24 +103,10 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); - for (i1=0; i1 < ncols; i1++) - { - memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - } - for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); + encode_parity_check_part_optim(c, d, BG, Zc, Kb,simd_size, ncols); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c index a974e86e27..6fa9c5ff53 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c @@ -38,7 +38,6 @@ #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" -//#define DEBUG_LDPC #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" @@ -102,7 +101,6 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size - unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c // calculate number of punctured bits no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc; @@ -151,24 +149,10 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); - for (i1=0; i1 < ncols; i1++) - { - memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - } - for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); + encode_parity_check_part_optim(c, d, BG, Zc, Kb, simd_size, ncols); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c index b21f875b32..15d4481eb6 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c @@ -39,17 +39,17 @@ #include "PHY/TOOLS/time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" -//#define DEBUG_LDPC - #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" -int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) +int nrLDPC_encod(unsigned char **input,unsigned char **output,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) { + //set_log(PHY, 4); + - short nrows=0,ncols=0; - int i,i1,j,rate=3; + int nrows=0,ncols=0; + int rate=3; int no_punctured_columns,removed_bit; //Table of possible lifting sizes char temp; @@ -95,8 +95,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc } #ifdef DEBUG_LDPC - LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,n_segments); - LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",test_input[0][0],test_input[0][1],test_input[0][2],test_input[0][3]); + LOG_D(PHY,"ldpc_encoder_optim_8seg: BG %d, Zc %d, Kb %d, block_length %d, segments %d\n",BG,Zc,Kb,block_length,impp->n_segments); + LOG_D(PHY,"ldpc_encoder_optim_8seg: PDU (seg 0) %x %x %x %x\n",input[0][0],input[0][1],input[0][2],input[0][3]); #endif AssertFatal(Zc>0,"no valid Zc found for block length %d\n",block_length); @@ -104,10 +104,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((Zc&31) > 0) simd_size = 16; else simd_size = 32; - unsigned char c[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size - unsigned char d[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size - - unsigned char c_extension[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c + unsigned char cc[22*Zc] __attribute__((aligned(32))); //padded input, unpacked, max size + unsigned char dd[46*Zc] __attribute__((aligned(32))); //coded parity part output, unpacked, max size // calculate number of punctured bits no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*rate)/Zc; @@ -115,8 +113,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc //printf("%d\n",no_punctured_columns); //printf("%d\n",removed_bit); // unpack input - memset(c,0,sizeof(unsigned char) * ncols * Zc); - memset(d,0,sizeof(unsigned char) * nrows * Zc); + memset(cc,0,sizeof(unsigned char) * ncols * Zc); + memset(dd,0,sizeof(unsigned char) * nrows * Zc); if(impp->tinput != NULL) start_meas(impp->tinput); #if 0 @@ -124,29 +122,29 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc //for (j=0; j>(i&7); + temp = (input[j][i/8]&(1<<(i&7)))>>(i&7); //printf("c(%d,%d)=%d\n",j,i,temp); c[i] |= (temp << (j-macro_segment)); } } #else #ifdef __AVX2__ - for (i=0; i>5; i++) { - c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)test_input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]); + for (int i=0; i>5; i++) { + c256 = _mm256_and_si256(_mm256_cmpeq_epi8(_mm256_andnot_si256(_mm256_shuffle_epi8(_mm256_set1_epi32(((uint32_t*)input[macro_segment])[i]), shufmask),andmask),zero256),masks[0]); //for (j=1; j>5)<<5;i>5)<<5;i>(i&7)))>>(7-(i&7)); + temp = (input[j][i/8]&(128>>(i&7)))>>(7-(i&7)); //printf("c(%d,%d)=%d\n",j,i,temp); - c[i] |= (temp << (j-macro_segment)); + cc[i] |= (temp << (j-macro_segment)); } } #else @@ -159,28 +157,14 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if ((BG==1 && Zc>176) || (BG==2 && Zc>64)) { // extend matrix if(impp->tprep != NULL) start_meas(impp->tprep); - for (i1=0; i1 < ncols; i1++) - { - memcpy(&c_extension[2*i1*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - memcpy(&c_extension[(2*i1+1)*Zc], &c[i1*Zc], Zc*sizeof(unsigned char)); - } - for (i1=1;i1tprep != NULL) stop_meas(impp->tprep); //parity check part if(impp->tparity != NULL) start_meas(impp->tparity); - encode_parity_check_part_optim(c_extension, d, BG, Zc, Kb); + encode_parity_check_part_optim(cc, dd, BG, Zc, Kb, simd_size, ncols); if(impp->tparity != NULL) stop_meas(impp->tparity); } else { - if (encode_parity_check_part_orig(c, d, BG, Zc, Kb, block_length)!=0) { + if (encode_parity_check_part_orig(cc, dd, BG, Zc, Kb, block_length)!=0) { printf("Problem with encoder\n"); return(-1); } @@ -188,8 +172,8 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc if(impp->toutput != NULL) start_meas(impp->toutput); // information part and puncture columns /* - memcpy(&channel_input[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char)); - memcpy(&channel_input[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char)); + memcpy(&output[0], &c[2*Zc], (block_length-2*Zc)*sizeof(unsigned char)); + memcpy(&output[block_length-2*Zc], &d[0], ((nrows-no_punctured_columns) * Zc-removed_bit)*sizeof(unsigned char)); */ #ifdef __AVX2__ if ((((2*Zc)&31) == 0) && (((block_length-(2*Zc))&31) == 0)) { @@ -197,34 +181,34 @@ int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc //AssertFatal(((block_length-(2*Zc))&31) == 0,"block_length-(2*Zc) needs to be a multiple of 32 for now\n"); uint32_t l1 = (block_length-(2*Zc))>>5; uint32_t l2 = ((nrows-no_punctured_columns) * Zc-removed_bit)>>5; - __m256i *c256p = (__m256i *)&c[2*Zc]; - __m256i *d256p = (__m256i *)&d[0]; + __m256i *c256p = (__m256i *)&cc[2*Zc]; + __m256i *d256p = (__m256i *)&dd[0]; // if (((block_length-(2*Zc))&31)>0) l1++; - for (i=0;i0) l2++; - for (i1=0;i1>(j-macro_segment))&1; - for (i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++) + for (int j=macro_segment; j < macro_segment_end; j++) + output[j][i] = (cc[2*Zc+i]>>(j-macro_segment))&1; + for (int i=0;i<((nrows-no_punctured_columns) * Zc-removed_bit);i++) //for (j=0; j>(j-macro_segment))&1; + for (int j=macro_segment; j < macro_segment_end; j++) + output[j][block_length-2*Zc+i] = (dd[i]>>(j-macro_segment))&1; } #else diff --git a/openair1/PHY/CODING/types.h b/openair1/PHY/CODING/types.h new file mode 100644 index 0000000000..2bc7739e36 --- /dev/null +++ b/openair1/PHY/CODING/types.h @@ -0,0 +1,98 @@ +/******************************************************************************* + Copyright (c) 2009-2018, Intel Corporation + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*******************************************************************************/ + +/* Common data types, macros and functions used across the CRC library */ + +#ifndef CRC_TYPES_H_ +#define CRC_TYPES_H_ + +#ifdef __KERNEL__ +#include +#include +typedef uint32_t uint_fast32_t; +typedef uint16_t uint_fast16_t; +typedef uint8_t uint_fast8_t; +#else +#include +#include +#endif + +/* Declare variable at address aligned to a boundary */ +#define DECLARE_ALIGNED(_declaration, _boundary) \ + _declaration __attribute__((aligned(_boundary))) + +/* Macro to make function to be always inlined */ +#ifndef DEBUG +#define __forceinline \ + static inline __attribute__((always_inline)) +#else +#define __forceinline \ + static +#endif + +/* Likely & unliekly hints for the compiler */ +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + +/* Macro to get dimension of an array */ +#ifndef DIM +#define DIM(x) (sizeof(x)/sizeof(x[0])) +#endif + +/** + * Common functions + */ + +/** + * @brief Swaps bytes in 16 bit word + * + * @param val 16 bit data value + * + * @return byte swapped value + */ +__forceinline uint16_t bswap2(const uint16_t val) +{ + return (uint16_t) ((val >> 8) | (val << 8)); +} + +/** + * @brief Swaps bytes in 32 bit word + * ABCD -> DCBA + * + * @param val 32 bit data value + * + * @return byte swapped value + */ +__forceinline uint32_t bswap4(const uint32_t val) +{ + return ((val >> 24) | /**< A*/ + ((val & 0xff0000) >> 8) | /**< B*/ + ((val & 0xff00) << 8) | /**< C*/ + (val << 24)); /**< D*/ +} + +#endif /* CRC_TYPES_H_ */ diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b60e77e814..f664a03ba0 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -458,7 +458,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->decode_SIB = 1; init_nr_prach_tables(839); - + init_symbol_rotation(fp); return 0; } diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 42d4a30e3b..347155ed3b 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -209,7 +209,6 @@ uint32_t get_samples_per_slot(int slot, NR_DL_FRAME_PARMS* fp) return samp_count; } - uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, NR_DL_FRAME_PARMS* fp) { uint32_t slot_idx = 0; diff --git a/openair1/PHY/LTE_REFSIG/lte_refsig.h b/openair1/PHY/LTE_REFSIG/lte_refsig.h index 84a2676082..9d3bae503b 100644 --- a/openair1/PHY/LTE_REFSIG/lte_refsig.h +++ b/openair1/PHY/LTE_REFSIG/lte_refsig.h @@ -36,8 +36,7 @@ \param reset resets the generator \return 32 bits of the gold sequence */ -uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); - +#include /*!\brief This function generates the LTE Gold sequence (36-211, Sec 7.2), specifically for DL reference signals. @param frame_parms LTE DL Frame parameters diff --git a/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c b/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c deleted file mode 100644 index a23f8db4f2..0000000000 --- a/openair1/PHY/LTE_TRANSPORT/lte_gold_generic.c +++ /dev/null @@ -1,75 +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 - */ - -#include "PHY/types.h" - -/** - \brief Gold Sequence Generation defined in 3x.211 - \param x1 x1 shift register - \param x2 x2 shift register / cinit if reset is set - \param reset Reset flag / reinitialize the generator - \return c 32 bits of gold output -*/ -extern inline uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) -{ - int32_t n; - - // 3GPP 3x.211 - // Nc = 1600 - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - // x1(n+31) = [x1(n+3) + x1(n)]mod2 - // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 - if (reset) - { - // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 - // x1(31) = [x1(3) + x1(0)]mod2 = 1 - *x1 = 1 + (1U<<31); - // Init value for x2: cinit = sum_{i=0}^30 x2*2^i - // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 - // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 - *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); - - // x1 and x2 contain bits n = 0,1,...,31 - - // Nc = 1600 bits are skipped at the beginning - // i.e., 1600 / 32 = 50 32bit words - - for (n = 1; n < 50; n++) - { - // Compute x1(0),...,x1(27) - *x1 = (*x1>>1) ^ (*x1>>4); - // Compute x1(28),..,x1(31) and xor - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - // Compute x2(0),...,x2(27) - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - // Compute x2(28),..,x2(31) and xor - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - } - } - - *x1 = (*x1>>1) ^ (*x1>>4); - *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); - *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); - *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); - - // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 - return(*x1^*x2); -} diff --git a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c index 6144b978bf..38914506ee 100644 --- a/openair1/PHY/LTE_TRANSPORT/lte_mcs.c +++ b/openair1/PHY/LTE_TRANSPORT/lte_mcs.c @@ -147,10 +147,10 @@ uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb) { } } -int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) { +int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc, uint8_t mod_order, uint8_t subframe, uint8_t symbol) { int rb,re_pbch_sss=0; int rb_alloc_ind,nsymb; - nsymb = (frame_parms->Ncp==NORMAL) ? 14 : 12; + nsymb = (Ncp==NORMAL) ? 14 : 12; // printf("adjust_G2 : symbol %d, subframe %d\n",symbol,subframe); if ((subframe!=0) && (subframe!=5) && (subframe!=6)) // if not PBCH/SSS or SSS @@ -158,12 +158,12 @@ int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_o //first half of slot and TDD (no adjustments in first slot except for subframe 6 - PSS) if ((symbol<(nsymb>>1))&& - (frame_parms->frame_type == TDD)&& + (frame_type == TDD)&& (subframe!=6)) return(0); // after PBCH - if (frame_parms->frame_type==TDD) { //TDD + if (frame_type==TDD) { //TDD if ((symbol>((nsymb>>1)+3)) && (symbol!=(nsymb-1))) ///SSS return(0); @@ -185,9 +185,9 @@ int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_o return(0); } - if ((frame_parms->N_RB_DL&1) == 1) { // ODD N_RB_DL - for (rb=((frame_parms->N_RB_DL>>1)-3); - rb<=((frame_parms->N_RB_DL>>1)+3); + if ((N_RB_DL&1) == 1) { // ODD N_RB_DL + for (rb=((N_RB_DL>>1)-3); + rb<=((N_RB_DL>>1)+3); rb++) { if (rb < 32) rb_alloc_ind = (rb_alloc[0]>>rb) & 1; @@ -201,16 +201,16 @@ int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms, uint32_t *rb_alloc, uint8_t mod_o rb_alloc_ind = 0; if (rb_alloc_ind==1) { - if ((rb==(frame_parms->N_RB_DL>>1)-3) || - (rb==((frame_parms->N_RB_DL>>1)+3))) { + if ((rb==(N_RB_DL>>1)-3) || + (rb==((N_RB_DL>>1)+3))) { re_pbch_sss += 6; } else re_pbch_sss += 12; } } } else { - for (rb=((frame_parms->N_RB_DL>>1)-3); - rb<((frame_parms->N_RB_DL>>1)+3); + for (rb=((N_RB_DL>>1)-3); + rb<((N_RB_DL>>1)+3); rb++) { if (rb < 32) rb_alloc_ind = (rb_alloc[0]>>rb) & 1; diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c index 3646732ce3..0ba63019a1 100644 --- a/openair1/PHY/LTE_TRANSPORT/pcfich.c +++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c @@ -44,7 +44,7 @@ void pcfich_scrambling(LTE_DL_FRAME_PARMS *frame_parms, { uint32_t i; uint8_t reset; - uint32_t x1, x2, s=0; + uint32_t x1=0, x2, s=0; reset = 1; // x1 is set in lte_gold_generic diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c index 3270066448..998edf235f 100644 --- a/openair1/PHY/LTE_TRANSPORT/pucch.c +++ b/openair1/PHY/LTE_TRANSPORT/pucch.c @@ -895,7 +895,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint8_t pucch1_thres, - uint8_t br_flag + int br_flag ) //----------------------------------------------------------------------------- { diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h index 622f37b3bc..af8e63c3ed 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h @@ -101,7 +101,7 @@ int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint int get_G_khz_1dot25(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode); int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); +int adjust_G2(int Ncp, int frame_type, int N_RB_DL, uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); #ifndef modOrder diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h index 19af50056c..1fbd1266d7 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h @@ -700,7 +700,51 @@ int find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type); int find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type); -uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); +static inline uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset) +{ + int32_t n; + + // 3GPP 3x.211 + // Nc = 1600 + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + // x1(n+31) = [x1(n+3) + x1(n)]mod2 + // x2(n+31) = [x2(n+3) + x2(n+2) + x2(n+1) + x2(n)]mod2 + if (reset) + { + // Init value for x1: x1(0) = 1, x1(n) = 0, n=1,2,...,30 + // x1(31) = [x1(3) + x1(0)]mod2 = 1 + *x1 = 1 + (1U<<31); + // Init value for x2: cinit = sum_{i=0}^30 x2*2^i + // x2(31) = [x2(3) + x2(2) + x2(1) + x2(0)]mod2 + // = (*x2>>3) ^ (*x2>>2) + (*x2>>1) + *x2 + *x2 = *x2 ^ ((*x2 ^ (*x2>>1) ^ (*x2>>2) ^ (*x2>>3))<<31); + + // x1 and x2 contain bits n = 0,1,...,31 + + // Nc = 1600 bits are skipped at the beginning + // i.e., 1600 / 32 = 50 32bit words + + for (n = 1; n < 50; n++) + { + // Compute x1(0),...,x1(27) + *x1 = (*x1>>1) ^ (*x1>>4); + // Compute x1(28),..,x1(31) and xor + *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); + // Compute x2(0),...,x2(27) + *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); + // Compute x2(28),..,x2(31) and xor + *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); + } + } + + *x1 = (*x1>>1) ^ (*x1>>4); + *x1 = *x1 ^ (*x1<<31) ^ (*x1<<28); + *x2 = (*x2>>1) ^ (*x2>>2) ^ (*x2>>3) ^ (*x2>>4); + *x2 = *x2 ^ (*x2<<31) ^ (*x2<<30) ^ (*x2<<29) ^ (*x2<<28); + + // c(n) = [x1(n+Nc) + x2(n+Nc)]mod2 + return(*x1^*x2); +} /**@}*/ diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index 4f65edd6d5..efde277203 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -1293,7 +1293,7 @@ void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms, } granted_re = nb_rb_alloc * (12-crs_re); - pbch_pss_sss_re = adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); + pbch_pss_sss_re = adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol); pbch_pss_sss_re = (double)pbch_pss_sss_re * ((double)(12-crs_re)/12); data_re = granted_re - pbch_pss_sss_re; llr_offset = data_re * dlsch0_harq->Qm * 2; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index 91de5386ae..6afd028099 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -837,7 +837,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, first_symbol_flag, nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } else if (codeword_TB0 == -1) { dlsch_qpsk_llr(frame_parms, @@ -846,7 +846,7 @@ int rx_pdsch(PHY_VARS_UE *ue, symbol, first_symbol_flag, nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { if (dlsch1_harq->Qm == 2) { @@ -856,7 +856,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -866,7 +866,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -877,7 +877,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -888,7 +888,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -899,7 +899,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -910,7 +910,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } @@ -925,7 +925,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[0], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); } else if (codeword_TB0 == -1) { @@ -934,7 +934,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[1], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream, beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -946,7 +946,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -957,7 +957,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -969,7 +969,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -981,7 +981,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -993,7 +993,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1005,7 +1005,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } @@ -1021,7 +1021,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (codeword_TB0 == -1) { @@ -1031,7 +1031,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } else if (rx_type >= rx_IC_single_stream) { @@ -1043,7 +1043,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1054,7 +1054,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,2,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else if (dlsch1_harq->Qm == 4) { @@ -1066,7 +1066,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, pdsch_vars[eNB_id]->llr[0], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr128); if (rx_type==rx_IC_dual_stream) { @@ -1078,7 +1078,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[eNB_id]->llr[1], symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128_2ndstream); } } else { @@ -1090,7 +1090,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho2_ext, (int16_t *)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol]); if (rx_type==rx_IC_dual_stream) { @@ -1102,7 +1102,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round], (int16_t *)pllr_symbol_cw1, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch1_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol]); } } @@ -1124,7 +1124,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->rxdataF_comp0, (int16_t *)pllr_symbol_cw0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,2,subframe,symbol), beamforming_mode); } @@ -1137,7 +1137,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->llr[0], pdsch_vars[eNB_id]->dl_ch_mag0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,4,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,4,subframe,symbol), pdsch_vars[eNB_id]->llr128, beamforming_mode); } @@ -1152,7 +1152,7 @@ int rx_pdsch(PHY_VARS_UE *ue, pdsch_vars[eNB_id]->dl_ch_mag0, pdsch_vars[eNB_id]->dl_ch_magb0, symbol,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol), + adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,dlsch0_harq->rb_alloc_even,6,subframe,symbol), pdsch_vars[eNB_id]->llr_offset[symbol], beamforming_mode); } diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c index 4c74377ef6..43f3b5451f 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c @@ -746,7 +746,7 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,2,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL ,&rb_alloc,2,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { if (frame_parms->nb_antenna_ports_eNB!=1) @@ -981,7 +981,7 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,4,subframe,symbol); + pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,&rb_alloc,4,subframe,symbol); if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { amp_tmp=0x1fff;//dlsch0->sqrt_rho_b; already taken into account @@ -1281,7 +1281,7 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,6,subframe,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 diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c index 1f9fb86f80..9427ec3a5b 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c @@ -336,8 +336,8 @@ void generate_pucch1x(int32_t **txdataF, -inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) __attribute__((always_inline)); -inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) { +static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) __attribute__((always_inline)); +static inline void pucch2x_scrambling(LTE_DL_FRAME_PARMS *fp,int subframe,uint16_t rnti,uint32_t B,uint8_t *btilde) { uint32_t x1, x2, s=0; int i; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index 7ab795cae9..c5d096ceb7 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -1303,7 +1303,7 @@ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL); int get_G(LTE_DL_FRAME_PARMS *frame_parms,uint16_t nb_rb,uint32_t *rb_alloc,uint8_t mod_order,uint8_t Nl,uint8_t num_pdcch_symbols,int frame,uint8_t subframe, uint8_t beamforming_mode); int adjust_G(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -int adjust_G2(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); + #ifndef modOrder diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index fa1b6c955b..9bbc61d4b6 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -180,13 +180,15 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /// CRC, coding, interleaving and rate matching AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); start_meas(dlsch_encoding_stats); - if (nr_dlsch_encoding(gNB, - harq->pdu, frame, slot, dlsch, frame_parms,tinput,tprep,tparity,toutput, - dlsch_rate_matching_stats, - dlsch_interleaving_stats, - dlsch_segmentation_stats) == -1) - return; + nr_dlsch_encoding(gNB, + harq->pdu, frame, slot, dlsch, frame_parms, output, + tinput,tprep,tparity,toutput, + dlsch_rate_matching_stats, + dlsch_interleaving_stats, + dlsch_segmentation_stats); stop_meas(dlsch_encoding_stats); #ifdef DEBUG_DLSCH printf("PDSCH encoding:\nPayload:\n"); @@ -198,7 +200,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("\nEncoded payload:\n"); for (int i=0; i>3; i++) { for (int j=0; j<8; j++) - printf("%d", harq->f[(i<<3)+j]); + printf("%d", output[(i<<3)+j]); printf("\t"); } printf("\n"); @@ -211,7 +213,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, for (int q=0; qNrOfCodewords; q++) memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t)); for (int q=0; qNrOfCodewords; q++) - nr_pdsch_codeword_scrambling_optim(harq->f, + nr_pdsch_codeword_scrambling_optim(output, encoded_length, q, rel15->dataScramblingId, @@ -248,7 +250,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } #endif - + start_meas(&gNB->dlsch_layer_mapping_stats); /// Layer mapping nr_layer_mapping(mod_symbs, rel15->nrOfLayers, @@ -266,6 +268,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } #endif + stop_meas(&gNB->dlsch_layer_mapping_stats); /// Resource mapping // Non interleaved VRB to PRB mapping @@ -279,7 +282,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif - + start_meas(&gNB->dlsch_resource_mapping_stats); for (int ap=0; apnrOfLayers; ap++) { // DMRS params for this ap @@ -321,20 +324,13 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, dmrs_idx = (rel15->rbStart+rel15->BWPStart)*4; } } - } - - // Update l_prime in the case of double DMRS config - if ((dmrs_symbol_map & (1 << l))){ //DMRS time occasion if (l==(l_overline+1)) //take into account the double DMRS symbols l_prime = 1; else if (l>(l_overline+1)) {//new DMRS pair l_overline = l; l_prime = 0; } - } - - /// DMRS QPSK modulation - if (rel15->dlDmrsSymbPos & (1 << l)) { + /// DMRS QPSK modulation nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated #ifdef DEBUG_DLSCH @@ -355,73 +351,143 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, ptrs_symbol = is_ptrs_symbol(l,dlPtrsSymPos); if(ptrs_symbol) { /* PTRS QPSK Modulation for each OFDM symbol in a slot */ + printf("Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs); nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs); } } uint16_t k = start_sc; - // Loop Over SCs: - for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) { - /* check if cuurent RE is PTRS RE*/ - is_ptrs_re=0; - /* check for PTRS symbol and set flag for PTRS RE */ - if(ptrs_symbol){ - is_ptrs_re = is_ptrs_subcarrier(k, - rel15->rnti, - ap, - rel15->dmrsConfigType, - rel15->PTRSFreqDensity, - rel15->rbSize, - rel15->PTRSReOffset, - start_sc, - frame_parms->ofdm_symbol_size); - } + if (ptrs_symbol || dmrs_symbol_map & (1 << l)) { - /* Map DMRS Symbol */ - if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + // Loop Over SCs: + for (int i=0; irbSize*NR_NB_SC_PER_RB; i++) { + /* check if cuurent RE is PTRS RE*/ + is_ptrs_re = 0; + if (ptrs_symbol) + is_ptrs_re = is_ptrs_subcarrier(k, + rel15->rnti, + ap, + rel15->dmrsConfigType, + rel15->PTRSFreqDensity, + rel15->rbSize, + rel15->PTRSReOffset, + start_sc, + frame_parms->ofdm_symbol_size); + /* Map DMRS Symbol */ + if ( (dmrs_symbol_map & (1 << l)) && + (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", + dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - dmrs_idx++; - k_prime++; - k_prime&=1; - n+=(k_prime)?0:1; - } - /* Map PTRS Symbol */ - else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + dmrs_idx++; + k_prime++; + k_prime&=1; + n+=(k_prime)?0:1; + } + else if(is_ptrs_re){ + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", + ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)],mod_ptrs[ptrs_idx<<1],mod_ptrs[(ptrs_idx<<1)+1]); #endif - ptrs_idx++; - } + ptrs_idx++; + } /* Map DATA Symbol */ - else if( (!(dmrs_symbol_map & (1 << l))) || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING - printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", + m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); #endif - m++; + m++; + } + /* mute RE */ + else { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + } + if (++k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; + } //RE loop + } + else { // no PTRS or DMRS in this symbol + // Loop Over SCs: + int upper_limit=rel15->rbSize*NR_NB_SC_PER_RB; + int remaining_re = 0; + if (start_sc + upper_limit > frame_parms->ofdm_symbol_size) { + remaining_re = upper_limit + start_sc - frame_parms->ofdm_symbol_size; + upper_limit = frame_parms->ofdm_symbol_size - start_sc; + } + // fix the alignment issues later, use 64-bit SIMD below instead of 128. + if (0/*(frame_parms->N_RB_DL&1)==0*/) { + __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + + __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; + __m128i amp128=_mm_set1_epi16(amp); + for (int i=0; i<(upper_limit>>2); i++) { + txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); + } //RE loop, first part + m+=upper_limit; + if (remaining_re > 0) { + txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txl = (__m128i*)&tx_layers[ap][m<<1]; + for (int i=0; i<(remaining_re>>2); i++) { + txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); + } + } } - /* mute RE */ else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; - } - if (++k >= frame_parms->ofdm_symbol_size) - k -= frame_parms->ofdm_symbol_size; - } //RE loop + __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + + __m64 *txl = (__m64*)&tx_layers[ap][m<<1]; + __m64 amp64=_mm_set1_pi16(amp); + for (int i=0; i<(upper_limit>>1); i++) { + + txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); +#ifdef DEBUG_DLSCH_MAPPING + if ((i&1) > 0) + printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", + m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]); +#endif + /* handle this, mute RE */ + /*else { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + }*/ + } //RE loop, first part + m+=upper_limit; + if (remaining_re > 0) { + txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txl = (__m64*)&tx_layers[ap][m<<1]; + for (int i=0; i<(remaining_re>>1); i++) { + txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); +#ifdef DEBUG_DLSCH_MAPPING + if ((i&1) > 0) + printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", + m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]); +#endif + /* handle this, mute RE */ + /*else { + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + }*/ + } //RE loop, second part + } // + m+=remaining_re; + } // N_RB_DL even + } // no DMRS/PTRS in symbol } // symbol loop }// layer loop + stop_meas(&gNB->dlsch_resource_mapping_stats); ///Layer Precoding and Antenna port mapping // tx_layers 1-8 are mapped on antenna ports 1000-1007 @@ -430,7 +496,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, // pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1 // The Precoding matrix: // The Codebook Type I and Type II are not supported yet. - // We adopt the precoding matrices of PUSCH for 4 layers. + // We`adopt the precoding matrices of PUSCH for 4 layers. + start_meas(&gNB->dlsch_precoding_stats); + for (int ap=0; apnb_antennas_tx; ap++) { for (int l=rel15->StartSymbolIndex; lStartSymbolIndex+rel15->NrOfSymbols; l++) { @@ -505,6 +573,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } // symbol loop }// port loop + stop_meas(&gNB->dlsch_precoding_stats); dlsch->slot_tx[slot]=0; // TODO: handle precoding diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index 181c2ab273..77db12672f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -43,8 +43,6 @@ void nr_check_time_alloc(uint8_t S, uint8_t L,nfapi_nr_dl_tti_pdsch_pdu_rel15_t uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB); -uint16_t get_SLIV(uint8_t S, uint8_t L); - uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t dmrs_typeA_position); void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type); @@ -85,6 +83,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, uint8_t slot, NR_gNB_DLSCH_t *dlsch, NR_DL_FRAME_PARMS* frame_parms, + unsigned char * output, time_stats_t *tinput, time_stats_t *tprep, time_stats_t *tparity, diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 0bcd1e3e51..5620018b73 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -50,70 +50,47 @@ //#define DEBUG_DLSCH_FREE 1 -void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) -{ +void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) { int r; - NR_gNB_DLSCH_t *dlsch = *dlschptr; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated - if (dlsch) { + if (dlsch) { if (N_RB != 273) { a_segments = a_segments*N_RB; a_segments = a_segments/273 +1; } - + #ifdef DEBUG_DLSCH_FREE LOG_D(PHY,"Freeing dlsch %p\n",dlsch); #endif NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; + if (harq->b) { free16(harq->b, a_segments * 1056); harq->b = NULL; #ifdef DEBUG_DLSCH_FREE LOG_D(PHY, "Freeing harq->b (%p)\n", harq->b); #endif - - if (harq->e) { - free16(harq->e, 14 * N_RB * 12 * 8); - harq->e = NULL; + } + #ifdef DEBUG_DLSCH_FREE - printf("Freeing dlsch process %d e (%p)\n", i, harq->e); + LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); #endif - } - - if (harq->f) { - free16(harq->f, 14 * N_RB * 12 * 8); - harq->f = NULL; + + for (r = 0; r < a_segments; r++) { #ifdef DEBUG_DLSCH_FREE - printf("Freeing dlsch process %d f (%p)\n", i, harq->f); + LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); #endif - } - -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); -#endif - - for (r = 0; r < a_segments; r++) { -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); -#endif - - if (harq->c[r]) { - free16(harq->c[r], 1056); - harq->c[r] = NULL; - } - if (harq->d[r]) { - free16(harq->d[r], 3 * 8448); - harq->d[r] = NULL; - } + + if (harq->c[r]) { + free16(harq->c[r], 1056); + harq->c[r] = NULL; } } + free16(dlsch, sizeof(NR_gNB_DLSCH_t)); + *dlschptr = NULL; } - - free16(dlsch, sizeof(NR_gNB_DLSCH_t)); - *dlschptr = NULL; } NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, @@ -121,8 +98,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, unsigned char Mdlharq, uint32_t Nsoft, uint8_t abstraction_flag, - uint16_t N_RB) -{ + uint16_t N_RB) { unsigned char i,r,aa,layer; int re; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated @@ -133,10 +109,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, } uint16_t dlsch_bytes = a_segments*1056; // allocated bytes per segment - NR_gNB_DLSCH_t *dlsch = malloc16(sizeof(NR_gNB_DLSCH_t)); AssertFatal(dlsch, "cannot allocate dlsch\n"); - bzero(dlsch,sizeof(NR_gNB_DLSCH_t)); dlsch->Kmimo = Kmimo; dlsch->Mdlharq = Mdlharq; @@ -144,11 +118,12 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, dlsch->Nsoft = Nsoft; for (layer=0; layerue_spec_bf_weights[layer] = (int32_t**)malloc16(64*sizeof(int32_t*)); + dlsch->ue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *)); for (aa=0; aa<64; aa++) { dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); - for (re=0;reue_spec_bf_weights[layer][aa][re] = 0x00007fff; } } @@ -160,7 +135,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t)); - dlsch->calib_dl_ch_estimates = (int32_t**)malloc16(64*sizeof(int32_t*)); + dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *)); + for (aa=0; aa<64; aa++) { dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); } @@ -172,7 +148,6 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; bzero(harq, sizeof(NR_DL_gNB_HARQ_t)); - harq->b = malloc16(dlsch_bytes); AssertFatal(harq->b, "cannot allocate memory for harq->b\n"); harq->pdu = malloc16(dlsch_bytes); @@ -188,71 +163,33 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, // In section 5.3.2 in 38.212, the for loop is up to N + 2*Zc (maximum size of N is 66*Zc, therefore 68*Zc) harq->c[r] = malloc16(8448); AssertFatal(harq->c[r], "cannot allocate harq->c[%d]\n", r); - harq->d[r] = malloc16(68 * 384); - AssertFatal(harq->d[r], "cannot allocate harq->d[%d]\n", r); // max size for coded output bzero(harq->c[r], 8448); - bzero(harq->d[r], (3 * 8448)); } - harq->e = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); - AssertFatal(harq->e, "cannot allocate harq->e\n"); - bzero(harq->e, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); - harq->f = malloc16(N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); - AssertFatal(harq->f, "cannot allocate harq->f\n"); - bzero(harq->f, N_RB * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); - return(dlsch); } -void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) -{ - - unsigned char Mdlharq; - unsigned char i,j,r; - +void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch) { AssertFatal(dlsch!=NULL,"dlsch is null\n"); - Mdlharq = dlsch->Mdlharq; + unsigned char Mdlharq = dlsch->Mdlharq; dlsch->rnti = 0; dlsch->active = 0; - NR_DL_gNB_HARQ_t *harq=&dlsch->harq_process; - - for (i=0; i<10; i++) { + for (int i=0; i<10; i++) { dlsch->harq_ids[0][i] = Mdlharq; dlsch->harq_ids[1][i] = Mdlharq; } - for (i=0; id[r]) - harq->d[r][j] = NR_NULL; - } } -int nr_dlsch_encoding(PHY_VARS_gNB *gNB, - unsigned char *a, - int frame, - uint8_t slot, - NR_gNB_DLSCH_t *dlsch, - NR_DL_FRAME_PARMS* frame_parms, - time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, - time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats, - time_stats_t *dlsch_segmentation_stats) -{ - - unsigned int G; - unsigned int crc=1; - NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; +void ldpc8blocks( void *p) { + encoder_implemparams_t *impp=(encoder_implemparams_t *) p; + NR_DL_gNB_HARQ_t *harq = (NR_DL_gNB_HARQ_t *)impp->harq; + uint16_t Kr= impp->K; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; + uint8_t mod_order = rel15->qamModOrder[0]; uint16_t nb_rb = rel15->rbSize; uint8_t nb_symb_sch = rel15->NrOfSymbols; - uint32_t A, Kb, F=0; - uint32_t *Zc = &dlsch->harq_process.Z; - uint8_t mod_order = rel15->qamModOrder[0]; - uint16_t Kr=0,r; - uint32_t r_offset=0; - uint32_t E; - uint8_t Ilbrm = 1; - uint32_t Tbslbrm = 950984; //max tbs + uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); + uint32_t A = rel15->TBSize[0]<<3; uint8_t nb_re_dmrs; if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) @@ -260,24 +197,115 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, else nb_re_dmrs = 4*rel15->numDmrsCdmGrpsNoData; - uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); - uint16_t R=rel15->targetCodeRate[0]; + unsigned int G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers); + LOG_D(PHY,"dlsch coding A %d Kr %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", + A,impp->K,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); + // nrLDPC_encoder output is in "d" + // let's make this interface happy! + uint8_t tmp[8][68 * 384]__attribute__((aligned(32))); + for (int rr=impp->macro_num*8, i=0; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++,i++ ) + impp->d[rr]=tmp[i]; + nrLDPC_encoder(harq->c,impp->d,*impp->Zc, impp->Kb,Kr,impp->BG,impp); + // Compute where to place in output buffer that is concatenation of all segments + uint32_t r_offset=0; + for (int i=0; i < impp->macro_num*8; i++ ) + r_offset+=nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, i); + for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) { + if (impp->F>0) { + // writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212 + memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL); + } + +#ifdef DEBUG_DLSCH_CODING + LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]); +#endif + uint32_t E = nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, rr); + //#ifdef DEBUG_DLSCH_CODING + LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", + rr, + impp->n_segments, + G, + E, + impp->F, + Kr-impp->F-2*(*impp->Zc), + mod_order,nb_rb); + // for tbslbrm calculation according to 5.4.2.1 of 38.212 + uint8_t Nl = 4; + + if (rel15->nrOfLayers < Nl) + Nl = rel15->nrOfLayers; + + uint32_t Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); + uint8_t Ilbrm = 1; + + uint8_t e[E]; + bzero (e, E); + nr_rate_matching_ldpc(Ilbrm, + Tbslbrm, + impp->BG, + *impp->Zc, + impp->d[rr], + e, + impp->n_segments, + impp->F, + Kr-impp->F-2*(*impp->Zc), + rel15->rvIndex[0], + E); +#ifdef DEBUG_DLSCH_CODING + + for (int i =0; i<16; i++) + printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); + +#endif + nr_interleaving_ldpc(E, + mod_order, + e, + impp->output+r_offset); +#ifdef DEBUG_DLSCH_CODING + + for (int i =0; i<16; i++) + printf("output interleaving f[%d]= %d r_offset %u\n", i,impp->output[i+r_offset], r_offset); + + if (r==impp->n_segments-1) + write_output("enc_output.m","enc",impp->output,G,1,4); + +#endif + r_offset += E; + } +} + +int nr_dlsch_encoding(PHY_VARS_gNB *gNB, + unsigned char *a, + int frame, + uint8_t slot, + NR_gNB_DLSCH_t *dlsch, + NR_DL_FRAME_PARMS *frame_parms, + unsigned char * output, + time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, + time_stats_t *dlsch_rate_matching_stats,time_stats_t *dlsch_interleaving_stats, + time_stats_t *dlsch_segmentation_stats) { + encoder_implemparams_t impp; + impp.output=output; + unsigned int crc=1; + NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; + nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; + impp.Zc = &dlsch->harq_process.Z; float Coderate = 0.0; - uint8_t Nl = 4; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); + uint32_t A = rel15->TBSize[0]<<3; - A = rel15->TBSize[0]<<3; if ( dlsch->rnti != SI_RNTI ) - trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); + trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, dlsch->rnti, frame, slot,0, 0); NR_gNB_SCH_STATS_t *stats=NULL; int first_free=-1; - for (int i=0;idlsch_stats[i].rnti == 0 && first_free == -1) { first_free = i; stats=&gNB->dlsch_stats[i]; } + if (gNB->dlsch_stats[i].rnti == dlsch->rnti) { stats=&gNB->dlsch_stats[i]; break; @@ -290,181 +318,94 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, stats->current_RI = rel15->nrOfLayers; stats->current_Qm = rel15->qamModOrder[0]; } - G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs,mod_order,rel15->nrOfLayers); - - LOG_D(PHY,"dlsch coding A %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", - A,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); if (A > 3824) { // Add 24-bit crc (polynomial A) to payload crc = crc24a(a,A)>>8; - a[A>>3] = ((uint8_t*)&crc)[2]; - a[1+(A>>3)] = ((uint8_t*)&crc)[1]; - a[2+(A>>3)] = ((uint8_t*)&crc)[0]; + a[A>>3] = ((uint8_t *)&crc)[2]; + a[1+(A>>3)] = ((uint8_t *)&crc)[1]; + a[2+(A>>3)] = ((uint8_t *)&crc)[0]; //printf("CRC %x (A %d)\n",crc,A); //printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]); - harq->B = A+24; // harq->b = a; - AssertFatal((A / 8) + 4 <= MAX_NR_DLSCH_PAYLOAD_BYTES, "A %d is too big (A/8+4 = %d > %d)\n", A, (A / 8) + 4, MAX_NR_DLSCH_PAYLOAD_BYTES); - memcpy(harq->b, a, (A / 8) + 4); // why is this +4 if the CRC is only 3 bytes? - } - else { + } else { // Add 16-bit crc (polynomial A) to payload crc = crc16(a,A)>>16; - a[A>>3] = ((uint8_t*)&crc)[1]; - a[1+(A>>3)] = ((uint8_t*)&crc)[0]; + a[A>>3] = ((uint8_t *)&crc)[1]; + a[1+(A>>3)] = ((uint8_t *)&crc)[0]; //printf("CRC %x (A %d)\n",crc,A); //printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]); - harq->B = A+16; // harq->b = a; - AssertFatal((A / 8) + 3 <= MAX_NR_DLSCH_PAYLOAD_BYTES, "A %d is too big (A/8+3 = %d > %d)\n", A, (A / 8) + 3, MAX_NR_DLSCH_PAYLOAD_BYTES); - memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc } - if (R<1000) - Coderate = (float) R /(float) 1024; + + if (rel15->targetCodeRate[0]<1000) + Coderate = (float)rel15->targetCodeRate[0] /(float) 1024; else // to scale for mcs 20 and 26 in table 5.1.3.1-2 which are decimal and input 2* in nr_tbs_tools - Coderate = (float) R /(float) 2048; + Coderate = (float)rel15->targetCodeRate[0] /(float) 2048; if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25) - harq->BG = 2; + impp.BG = 2; else - harq->BG = 1; + impp.BG = 1; start_meas(dlsch_segmentation_stats); - Kb = nr_segmentation(harq->b, harq->c, harq->B, &harq->C, &harq->K, Zc, &harq->F, harq->BG); + impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG); stop_meas(dlsch_segmentation_stats); - F = harq->F; - Kr = harq->K; -#ifdef DEBUG_DLSCH_CODING - uint16_t Kr_bytes; - Kr_bytes = Kr>>3; -#endif - - //printf("segment Z %d k %d Kr %d BG %d C %d\n", *Zc,harq->K,Kr,BG,harq->C); - - for (r=0; rC; r++) { + for (int r=0; rd[r][0]; //channel_input[r] = &harq->d[r][0]; #ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, harq->F); - LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,harq->C); + LOG_D(PHY,"Encoder: B %d F %d \n",harq->B, impp->F); + LOG_D(PHY,"start ldpc encoder segment %d/%d\n",r,impp.n_segments); LOG_D(PHY,"input %d %d %d %d %d \n", harq->c[r][0], harq->c[r][1], harq->c[r][2],harq->c[r][3], harq->c[r][4]); - for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++){ + + for (int cnt =0 ; cnt < 22*(*Zc)/8; cnt ++) { LOG_D(PHY,"%d ", harq->c[r][cnt]); } - LOG_D(PHY,"\n"); + LOG_D(PHY,"\n"); #endif //ldpc_encoder_orig((unsigned char*)harq->c[r],harq->d[r],*Zc,Kb,Kr,BG,0); //ldpc_encoder_optim((unsigned char*)harq->c[r],(unsigned char*)&harq->d[r][0],*Zc,Kb,Kr,BG,NULL,NULL,NULL,NULL); } - encoder_implemparams_t impp; - impp.n_segments=harq->C; + impp.tprep = tprep; impp.tinput = tinput; impp.tparity = tparity; impp.toutput = toutput; - for(int j=0;j<(harq->C/8+1);j++) { - impp.macro_num=j; - nrLDPC_encoder(harq->c,harq->d,*Zc,Kb,Kr,harq->BG,&impp); + impp.harq=harq; + notifiedFIFO_t nf; + initNotifiedFIFO(&nf); + int nbJobs=0; + for(int j=0; j<(impp.n_segments/8+((impp.n_segments&7)==0 ? 0 : 1)); j++) { + notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(impp), j, &nf, ldpc8blocks); + encoder_implemparams_t* perJobImpp=(encoder_implemparams_t*)NotifiedFifoData(req); + *perJobImpp=impp; + perJobImpp->macro_num=j; + pushTpool(gNB->threadPool,req); + nbJobs++; } - -#ifdef DEBUG_DLSCH_CODING - write_output("enc_input0.m","enc_in0",&harq->c[0][0],Kr_bytes,1,4); - write_output("enc_output0.m","enc0",&harq->d[0][0],(3*8*Kr_bytes)+12,1,4); -#endif - - F = harq->F; - - Kr = harq->K; - for (r=0; rC; r++) { - - if (F>0) { - for (int k=(Kr-F-2*(*Zc)); kd[r][k] = NR_NULL; - //if (k<(Kr-F+8)) - //printf("r %d filler bits [%d] = %d \n", r,k, harq->d[r][k]); - } - } - -#ifdef DEBUG_DLSCH_CODING - LOG_D(PHY,"rvidx in encoding = %d\n", rel15->rvIndex[0]); -#endif - - E = nr_get_E(G, harq->C, mod_order, rel15->nrOfLayers, r); - - //#ifdef DEBUG_DLSCH_CODING - LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", - r, - harq->C, - G, - E, - F, - Kr-F-2*(*Zc), - mod_order,nb_rb); - - // for tbslbrm calculation according to 5.4.2.1 of 38.212 - if (rel15->nrOfLayers < Nl) - Nl = rel15->nrOfLayers; - - Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); - - start_meas(dlsch_rate_matching_stats); - if (nr_rate_matching_ldpc(Ilbrm, - Tbslbrm, - harq->BG, - *Zc, - harq->d[r], - harq->e+r_offset, - harq->C, - F, - Kr-F-2*(*Zc), - rel15->rvIndex[0], - E) == -1) - return -1; - - stop_meas(dlsch_rate_matching_stats); -#ifdef DEBUG_DLSCH_CODING - for (int i =0; i<16; i++) - printf("output ratematching e[%d]= %d r_offset %u\n", i,harq->e[i+r_offset], r_offset); -#endif - - start_meas(dlsch_interleaving_stats); - nr_interleaving_ldpc(E, - mod_order, - harq->e+r_offset, - harq->f+r_offset); - stop_meas(dlsch_interleaving_stats); - -#ifdef DEBUG_DLSCH_CODING - for (int i =0; i<16; i++) - printf("output interleaving f[%d]= %d r_offset %u\n", i,harq->f[i+r_offset], r_offset); - - if (r==harq->C-1) - write_output("enc_output.m","enc",harq->f,G,1,4); -#endif - - r_offset += E; + while(nbJobs) { + notifiedFIFO_elt_t *req=pullTpool(&nf, gNB->threadPool); + delNotifiedFIFO_elt(req); + nbJobs--; } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_OUT); - return 0; } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c index 3ba13d2f44..26b45eb9f7 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c @@ -96,11 +96,6 @@ void nr_get_time_domain_allocation_type(nfapi_nr_config_request_t config, } } - -uint16_t get_SLIV(uint8_t S, uint8_t L) { - return ( (uint16_t)(((L-1)<=7)? (14*(L-1)+S) : (14*(15-L)+(13-S))) ); -} - static inline uint8_t get_K0(uint8_t row_idx, uint8_t time_alloc_type) { return ( (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_A)|| (time_alloc_type == NFAPI_NR_PDSCH_TIME_DOMAIN_ALLOC_TYPE_DEFAULT_C)? 0 : diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 1ce8c238cb..c4b40ec4cc 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -376,9 +376,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", + frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif @@ -397,11 +399,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, nb_rb_pdsch); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { if (beamforming_mode==0){ @@ -458,9 +460,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, #endif stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); @@ -509,11 +512,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { @@ -568,11 +571,11 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; @@ -651,9 +654,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, } stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - -#ifdef DEBUG_PDSCH_RX - LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#if DISABLE_LOG_X + printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); +#else + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); #endif // Please keep it: useful for debugging 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 a064a91d87..7c75884fa6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c @@ -947,7 +947,7 @@ void nr_dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - pbch_pss_sss_adjust=adjust_G2(frame_parms,&rb_alloc,6,subframe,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 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 0ab17c11e6..3cb002f9e1 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1286,8 +1286,8 @@ uint8_t get_transmission_mode(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti); */ 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); +//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 @@ -1313,16 +1313,6 @@ uint8_t I_TBS2I_MCS(uint8_t I_TBS); uint8_t SE2I_TBS(float SE, uint8_t N_PRB, uint8_t symbPerRB); -/** \brief This function generates the sounding reference symbol (SRS) for the uplink according to 36.211 v8.6.0. If IFFT_FPGA is defined, the SRS is quantized to a QPSK sequence. - @param frame_parms LTE DL Frame Parameters - @param soundingrs_ul_config_dedicated Dynamic configuration from RRC during Connection Establishment - @param txdataF pointer to the frequency domain TX signal - @returns 0 on success*/ -int generate_srs(NR_DL_FRAME_PARMS *frame_parms, - SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, - int *txdataF, - int16_t amp, - uint32_t subframe); /*! @@ -1352,12 +1342,6 @@ int32_t generate_drs_pusch(PHY_VARS_NR_UE *phy_vars_ue, uint32_t nb_rb, uint8_t ant); -/*! - \brief This function initializes the Group Hopping, Sequence Hopping and nPRS sequences for PUCCH/PUSCH according to 36.211 v8.6.0. It should be called after configuration of UE (reception of SIB2/3) and initial configuration of eNB (or after reconfiguration of cell-specific parameters). - @param frame_parms Pointer to a NR_DL_FRAME_PARMS structure (eNB or UE)*/ -void init_ul_hopping(NR_DL_FRAME_PARMS *frame_parms); - - /*! \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 @@ -1422,8 +1406,6 @@ double sinr_eff_cqi_calc(PHY_VARS_NR_UE *phy_vars_ue, uint8_t sinr2cqi(double sinr,uint8_t trans_mode); -int dump_dci(NR_DL_FRAME_PARMS *frame_parms, DCI_ALLOC_t *dci); - 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); @@ -1513,18 +1495,11 @@ int get_nCCE_offset_l1(int *CCE_table, const unsigned short rnti, const unsigned char subframe); -uint16_t get_nCCE(uint8_t num_pdcch_symbols,NR_DL_FRAME_PARMS *frame_parms,uint8_t mi); -uint16_t get_nquad(uint8_t num_pdcch_symbols,NR_DL_FRAME_PARMS *frame_parms,uint8_t mi); - -uint8_t get_mi(NR_DL_FRAME_PARMS *frame,uint8_t 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); -uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); - -void pdcch_interleaving(NR_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi); - void nr_pdcch_unscrambling(int16_t *z, uint16_t scrambling_RNTI, uint32_t length, @@ -1539,7 +1514,6 @@ void dlsch_unscrambling(NR_DL_FRAME_PARMS *frame_parms, uint8_t q, uint8_t Ns); -void init_ncs_cell(NR_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]); void generate_pucch1x(int32_t **txdataF, NR_DL_FRAME_PARMS *frame_parms, @@ -1587,7 +1561,7 @@ void init_ulsch_power_LUT(void); @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); +//int is_prach_subframe(NR_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe); /*! \brief Generate PRACH waveform @@ -1653,8 +1627,6 @@ void init_scrambling_lut(void); @param frame_parms Pointer to frame parameters @returns 1 if subframe is for MBSFN */ -int is_pmch_subframe(frame_t frame, int subframe, NR_DL_FRAME_PARMS *frame_parms); - 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); @@ -1691,8 +1663,7 @@ uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms, uint8_t n_ra_prboffset, uint8_t tdd_mapindex, uint16_t Nf); - -uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset); +#include uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 99dc2b658e..914523bc70 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -105,7 +105,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5]; int16_t **tx_layers; int32_t **txdataF; - int8_t Wf[2], Wt[2], l_prime[2], delta; + int8_t Wf[2], Wt[2]; + int l_prime[2], delta; uint8_t nb_dmrs_re_per_rb; int ap, i; int sample_offsetF, N_RE_prime; @@ -411,7 +412,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (is_dmrs == 1) { // if transform precoding is enabled if (pusch_pdu->transform_precoding == 0) { - + ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[2*dmrs_idx]) >> 15; ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[(2*dmrs_idx) + 1]) >> 15; diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index cb929f1642..ddec605253 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -805,8 +805,8 @@ void nr_generate_pucch1_old(PHY_VARS_NR_UE *ue, } #endif //0 -inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) __attribute__((always_inline)); -inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) { +static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) __attribute__((always_inline)); +static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_t n_id,uint64_t *B64,uint8_t *btilde) { uint32_t x1, x2, s=0; int i; uint8_t c; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 11b5112a6c..fb4f9a0092 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -96,20 +96,6 @@ typedef struct { uint32_t subframe; /// MIMO mode for this DLSCH MIMO_mode_t mimo_mode; - /// Concatenated sequences - uint8_t *e; - /// LDPC-code outputs - uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; - /// Interleaver outputs - uint8_t *f; - /// Number of code segments - uint32_t C; - /// Number of bits in "small" code segments - uint32_t K; - /// Number of "Filler" bits - uint32_t F; - /// Encoder BG - uint8_t BG; /// LDPC lifting size uint32_t Z; } NR_DL_gNB_HARQ_t; @@ -868,6 +854,9 @@ typedef struct PHY_VARS_gNB_s { time_stats_t dlsch_encoding_stats; time_stats_t dlsch_modulation_stats; time_stats_t dlsch_scrambling_stats; + time_stats_t dlsch_resource_mapping_stats; + time_stats_t dlsch_layer_mapping_stats; + time_stats_t dlsch_precoding_stats; time_stats_t tinput; time_stats_t tprep; time_stats_t tparity; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 1685e206ae..792667d510 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -263,7 +263,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0); //dumpsig=1; } else { - LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", + LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n", gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot, rdata->harq_pid, pusch_pdu->pusch_data.new_data_indicator, ulsch_harq->status, ulsch_harq->round, @@ -358,10 +358,11 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); - LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", + LOG_D(PHY,"rb_size %d, number_symbols %d, nb_re_dmrs %d, dmrs symbol positions %d, number_dmrs_symbols %d, qam_mod_order %d, nrOfLayer %d\n", pusch_pdu->rb_size, number_symbols, nb_re_dmrs, + pusch_pdu->ul_dmrs_symb_pos, number_dmrs_symbols, // number of dmrs symbols irrespective of single or double symbol dmrs pusch_pdu->qam_mod_order, pusch_pdu->nrOfLayers); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 0b543da275..20b6e67aa9 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1022,14 +1022,14 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_D(PHY, "In %s DL PDU length in bits: %d, in bytes: %d \n", __FUNCTION__, dlsch0->harq_processes[harq_pid]->TBS, dlsch0->harq_processes[harq_pid]->TBS / 8); - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); -#ifdef NR_PDSCH_DEBUG - LOG_I(PHY, " --> Unscrambling for CW0 %5.3f\n", + + + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); + LOG_D(PHY, " --> Unscrambling for CW0 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - LOG_I(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", + LOG_D(PHY, "AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); -#endif if(is_cw1_active) { // start ldpc decode for CW 1 @@ -1081,21 +1081,13 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); } - stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); -#if PHYSIM - printf(" --> Unscrambling for CW1 %5.3f\n", - (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); - printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", - frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); -#else + stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); + LOG_D(PHY, " --> Unscrambling for CW1 %5.3f\n", (ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0)); LOG_D(PHY, "AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); -#endif - - LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n", frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0)); @@ -1404,7 +1396,6 @@ void *UE_thread_slot1_dl_processing(void *arg) { stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); - 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)); @@ -1495,7 +1486,6 @@ void *UE_thread_slot1_dl_processing(void *arg) { //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]); - 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) { @@ -1867,7 +1857,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, dlsch_parallel); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); - LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0)); @@ -1945,7 +1934,6 @@ if (nr_slot_rx==9) { } stop_meas(&ue->generic_stat); - LOG_D(PHY,"after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); #ifdef EMOS phy_procedures_emos_UE_RX(ue,slot,gNB_id); @@ -1955,7 +1943,6 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_rx[proc->thread_id]); - LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); //#endif //pdsch diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 1d9584b30b..ff07422c6b 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -118,7 +118,8 @@ int main(int argc, char **argv) uint8_t mcs_table = 0; double DS_TDL = .03; cpuf = get_cpu_freq_GHz(); - + char gNBthreads[128]="n"; + if (load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY) == 0) { exit_fun("[NR_DLSCHSIM] Error, configuration module init failed\n"); } @@ -126,7 +127,7 @@ int main(int argc, char **argv) //logInit(); randominit(0); - while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:")) != -1) { + while ((c = getopt(argc, argv, "df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:X:")) != -1) { switch (c) { /*case 'f': write_output_file = 1; @@ -292,6 +293,11 @@ int main(int argc, char **argv) nb_rb = atoi(optarg); break; + case 'X': + strncpy(gNBthreads, optarg, sizeof(gNBthreads)); + gNBthreads[sizeof(gNBthreads)-1]=0; + break; + /*case 'x': transmission_mode = atoi(optarg); break;*/ @@ -352,6 +358,8 @@ int main(int argc, char **argv) RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *)); RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; + gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); + initTpool(gNBthreads, gNB->threadPool, true); //gNB_config = &gNB->gNB_config; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; @@ -468,7 +476,6 @@ int main(int argc, char **argv) double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); - double errors_bit_uncoded = 0; //unsigned char *estimated_output; unsigned char *estimated_output_bit; unsigned char *test_input_bit; @@ -506,8 +513,10 @@ int main(int argc, char **argv) //printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32)); // generate signal + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { - nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } for (SNR = snr0; SNR < snr1; SNR += snr_step) { @@ -515,7 +524,6 @@ int main(int argc, char **argv) n_false_positive = 0; for (trial = 0; trial < n_trials; trial++) { - errors_bit_uncoded = 0; for (i = 0; i < available_bits; i++) { #ifdef DEBUG_CODER if ((i&0xf)==0) @@ -524,11 +532,12 @@ int main(int argc, char **argv) //if (i<16) // printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]); - if (dlsch->harq_process.f[i] == 0) + + if (output[i] == 0) modulated_input[i] = 1.0; ///sqrt(2); //QPSK else modulated_input[i] = -1.0; ///sqrt(2); - + //if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]); //SNR =10; SNR_lin = pow(10, SNR / 10.0); @@ -546,18 +555,14 @@ int main(int argc, char **argv) i,modulated_input[i], i,channel_output_fixed[i]); */ + //Uncoded BER if (channel_output_fixed[i] < 0) channel_output_uncoded[i] = 1; //QPSK demod else channel_output_uncoded[i] = 0; - - if (channel_output_uncoded[i] != dlsch->harq_process.f[i]) - errors_bit_uncoded = errors_bit_uncoded + 1; } - //if (errors_bit_uncoded>10) - //printf("errors bits uncoded %f\n", errors_bit_uncoded); #ifdef DEBUG_CODER printf("\n"); exit(-1); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 50e21ac02b..fa868a6896 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -277,7 +277,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, UE_info->CellGroup[0], sched_ctrl->active_bwp, NULL, - /* tda = */ 2, + /* tda = */ 0, dci_format, ps); @@ -369,6 +369,7 @@ int main(int argc, char **argv) uint8_t n_tx=1,n_rx=1; uint8_t round; uint8_t num_rounds = 4; + char gNBthreads[128]="n"; channel_desc_t *gNB2UE; //uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0; @@ -430,9 +431,7 @@ int main(int argc, char **argv) FILE *scg_fd=NULL; - - while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:m:w:T:U:q")) != -1) { - + while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:m:w:T:U:qX:")) != -1) { switch (c) { case 'f': scg_fd = fopen(optarg,"r"); @@ -635,7 +634,12 @@ int main(int argc, char **argv) dmrs_arg[i] = atoi(argv[optind++]); } break; - + + case 'X': + strncpy(gNBthreads, optarg, sizeof(gNBthreads)); + gNBthreads[sizeof(gNBthreads)-1]=0; + break; + default: case 'h': printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", @@ -671,7 +675,8 @@ int main(int argc, char **argv) printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n"); printf("-P Print DLSCH performances\n"); printf("-w Write txdata to binary file (one frame)\n"); - printf("-D number of dlsch threads, 0: no dlsch parallelization\n"); + printf("-d number of dlsch threads, 0: no dlsch parallelization\n"); + printf("-X gNB thread pool configuration, n => no threads"); exit (-1); break; } @@ -762,7 +767,7 @@ int main(int argc, char **argv) NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup)); prepare_scc(rrc.carrier.servingcellconfigcommon); uint64_t ssb_bitmap = 1; - fill_scc(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); + fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); ssb_bitmap = 1;// Enable only first SSB with index ssb_indx=0 fix_scc(scc,ssb_bitmap); @@ -827,6 +832,14 @@ int main(int argc, char **argv) fs = 61.44e6; bw = 40e6; } + else if (mu == 1 && N_RB_DL == 133) { + fs = 61.44e6; + bw = 50e6; + } + else if (mu == 1 && N_RB_DL == 162) { + fs = 61.44e6; + bw = 60e6; + } else if (mu == 3 && N_RB_DL == 66) { fs = 122.88e6; bw = 100e6; @@ -966,8 +979,7 @@ int main(int argc, char **argv) snrRun = 0; gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); - char tp_param[] = "n"; - initTpool(tp_param, gNB->threadPool, true); + initTpool(gNBthreads, gNB->threadPool, true); gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->resp_L1_tx); // we create 2 threads for L1 tx processing @@ -1217,8 +1229,8 @@ int main(int argc, char **argv) UE->dlsch[UE_proc.thread_id][0][0]->max_ldpc_iterations+1) n_errors++; - NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id]; - int16_t *UE_llr = pdsch_vars[0]->llr[0]; + //NR_UE_PDSCH **pdsch_vars = UE->pdsch_vars[UE_proc.thread_id]; + //int16_t *UE_llr = pdsch_vars[0]->llr[0]; TBS = UE_harq_process->TBS;//rel15->TBSize[0]; uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos); @@ -1233,6 +1245,7 @@ int main(int argc, char **argv) printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) ); } + /* for (i = 0; i < available_bits; i++) { if(((gNB_dlsch->harq_process.f[i] == 0) && (UE_llr[i] <= 0)) || @@ -1246,6 +1259,7 @@ int main(int argc, char **argv) } } + */ for (i = 0; i < TBS; i++) { estimated_output_bit[i] = (UE_harq_process->b[i/8] & (1 << (i & 7))) >> (i & 7); @@ -1289,11 +1303,9 @@ int main(int argc, char **argv) printf("\n"); if (print_perf==1) { - printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d, Kr %d (Zc %d))\n", + printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d)\n", 1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex, - msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3, - msgDataTx->dlsch[0][0]->harq_process.K, - msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10)); + msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3); printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); @@ -1305,6 +1317,9 @@ int main(int argc, char **argv) printStatIndent3(&gNB->dlsch_interleaving_stats, "DLSCH Interleaving time"); printStatIndent2(&gNB->dlsch_modulation_stats,"DLSCH modulation time"); printStatIndent2(&gNB->dlsch_scrambling_stats, "DLSCH scrambling time"); + printStatIndent2(&gNB->dlsch_layer_mapping_stats, "DLSCH Layer Mapping time"); + printStatIndent2(&gNB->dlsch_resource_mapping_stats, "DLSCH Resource Mapping time"); + printStatIndent2(&gNB->dlsch_precoding_stats,"DLSCH Layer Precoding time"); printf("\nUE RX function statistics (per %d us slot)\n",1000>>*scc->ssbSubcarrierSpacing); diff --git a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h index 8d4acd1af1..805913d055 100644 --- a/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h +++ b/openair1/SIMULATION/NR_PHY/nr_unitary_defs.h @@ -59,167 +59,7 @@ int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {return(0);} //NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);} int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); } - -void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) { - - *scc->physCellId=0; \ - // *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0; - *scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; - scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; - *scc->ssbSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; - *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB=641032; - *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]=78; - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA=640000; - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; - - scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_DL; - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth=13036; - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing=mu_dl;//NR_SubcarrierSpacing_kHz30; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=12; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero=0; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0=0; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=40; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0=0; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=53; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0=0; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength=54; - *scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0=-1; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength=54; - *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=78; - *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; - scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_UL; - *scc->uplinkConfigCommon->frequencyInfoUL->p_Max=20; - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth=13036; - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing=mu_ul;//NR_SubcarrierSpacing_kHz30; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex=98; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM=NR_RACH_ConfigGeneric__msg1_FDM_one; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart=0; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig=13; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower=-118; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax=NR_RACH_ConfigGeneric__preambleTransMax_n10; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep=NR_RACH_ConfigGeneric__powerRampingStep_dB2; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer=NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; - *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB=19; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0; - scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2=6; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2=6; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength=69; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2=6; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2=33; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength=55; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; - *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; - scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40; - *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90; - scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; - *ssb_bitmap=0xff; - scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots=7; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols=6; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots=2; - scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols=4; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity=321; - - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots=-1; - scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols=-1; - scc->ss_PBCH_BlockPower=20; - *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1; -} - +void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul); void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap); void prepare_scc(NR_ServingCellConfigCommon_t *scc); void prepare_scd(NR_ServingCellConfig_t *scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index a7075eb218..97c753d455 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -707,7 +707,7 @@ int main(int argc, char **argv) NR_CellGroupConfig_t *secondaryCellGroup=calloc(1,sizeof(*secondaryCellGroup)); prepare_scc(rrc.carrier.servingcellconfigcommon); uint64_t ssb_bitmap; - fill_scc(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); + fill_scc_sim(rrc.carrier.servingcellconfigcommon,&ssb_bitmap,N_RB_DL,N_RB_DL,mu,mu); fix_scc(scc,ssb_bitmap); @@ -732,17 +732,13 @@ int main(int argc, char **argv) nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; cfg->carrier_config.num_tx_ant.value = n_tx; cfg->carrier_config.num_rx_ant.value = n_rx; - nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); +// nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); phy_init_nr_gNB(gNB,0,1); N_RB_DL = gNB->frame_parms.N_RB_DL; NR_BWP_Uplink_t *ubwp=secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]; - //crcTableInit(); - - //nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_UL, mu, Nid_cell, SSB_positions); - //configure UE UE = malloc(sizeof(PHY_VARS_NR_UE)); diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index f61648d8b4..e1886b57ff 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -412,7 +412,7 @@ typedef struct NRRrcConfigurationReq_s { int sib1_tda; int pdsch_AntennaPorts; int pusch_AntennaPorts; - int minRXTXTIMEpdsch; + int minRXTXTIME; int do_CSIRS; int pusch_TargetSNRx10; int pucch_TargetSNRx10; diff --git a/openair2/GNB_APP/RRC_nr_paramsvalues.h b/openair2/GNB_APP/RRC_nr_paramsvalues.h index 70295b1c31..8a7ce64d91 100644 --- a/openair2/GNB_APP/RRC_nr_paramsvalues.h +++ b/openair2/GNB_APP/RRC_nr_paramsvalues.h @@ -58,56 +58,6 @@ #define GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO "initialDLBWPcontrolResourceSetZero" #define GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO "initialDLBWPsearchSpaceZero" - -#define GNB_CONFIG_STRING_INITIALDLBWPK0_0 "initialDLBWPk0_0" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0 "initialDLBWPmappingType_0" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0 "initialDLBWPstartSymbolAndLength_0" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_1 "initialDLBWPk0_1" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1 "initialDLBWPmappingType_1" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1 "initialDLBWPstartSymbolAndLength_1" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_2 "initialDLBWPk0_2" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2 "initialDLBWPmappingType_2" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2 "initialDLBWPstartSymbolAndLength_2" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_3 "initialDLBWPk0_3" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3 "initialDLBWPmappingType_3" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3 "initialDLBWPstartSymbolAndLength_3" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_4 "initialDLBWPk0_4" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4 "initialDLBWPmappingType_4" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4 "initialDLBWPstartSymbolAndLength_4" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_5 "initialDLBWPk0_5" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5 "initialDLBWPmappingType_5" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5 "initialDLBWPstartSymbolAndLength_5" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_6 "initialDLBWPk0_6" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6 "initialDLBWPmappingType_6" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6 "initialDLBWPstartSymbolAndLength_6" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_7 "initialDLBWPk0_7" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7 "initialDLBWPmappingType_7" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7 "initialDLBWPstartSymbolAndLength_7" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_8 "initialDLBWPk0_8" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8 "initialDLBWPmappingType_8" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8 "initialDLBWPstartSymbolAndLength_8" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_9 "initialDLBWPk0_9" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9 "initialDLBWPmappingType_9" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9 "initialDLBWPstartSymbolAndLength_9" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_10 "initialDLBWPk0_10" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10 "initialDLBWPmappingType_10" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10 "initialDLBWPstartSymbolAndLength_10" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_11 "initialDLBWPk0_11" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11 "initialDLBWPmappingType_11" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11 "initialDLBWPstartSymbolAndLength_11" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_12 "initialDLBWPk0_12" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12 "initialDLBWPmappingType_12" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12 "initialDLBWPstartSymbolAndLength_12" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_13 "initialDLBWPk0_13" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13 "initialDLBWPmappingType_13" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13 "initialDLBWPstartSymbolAndLength_13" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_14 "initialDLBWPk0_14" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14 "initialDLBWPmappingType_14" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14 "initialDLBWPstartSymbolAndLength_14" -#define GNB_CONFIG_STRING_INITIALDLBWPK0_15 "initialDLBWPk0_15" -#define GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15 "initialDLBWPmappingType_15" -#define GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15 "initialDLBWPstartSymbolAndLength_15" - #define GNB_CONFIG_STRING_ULFREQUENCYBAND "ul_frequencyBand" #define GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA "ul_absoluteFrequencyPointA" #define GNB_CONFIG_STRING_ULOFFSETTOCARRIER "ul_offstToCarrier" @@ -142,54 +92,6 @@ #define GNB_CONFIG_STRING_HOPPINGID "hoppingId" #define GNB_CONFIG_STRING_P0NOMINAL "p0_nominal" #define GNB_CONFIG_STRING_PUCCHRES "pucch_ResourceCommon" -#define GNB_CONFIG_STRING_INITIALULBWPK2_0 "initialULBWPk2_0" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0 "initialULBWPmappingType_0" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0 "initialULBWPstartSymbolAndLength_0" -#define GNB_CONFIG_STRING_INITIALULBWPK2_1 "initialULBWPk2_1" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1 "initialULBWPmappingType_1" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1 "initialULBWPstartSymbolAndLength_1" -#define GNB_CONFIG_STRING_INITIALULBWPK2_2 "initialULBWPk2_2" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2 "initialULBWPmappingType_2" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2 "initialULBWPstartSymbolAndLength_2" -#define GNB_CONFIG_STRING_INITIALULBWPK2_3 "initialULBWPk2_3" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3 "initialULBWPmappingType_3" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3 "initialULBWPstartSymbolAndLength_3" -#define GNB_CONFIG_STRING_INITIALULBWPK2_4 "initialULBWPk2_4" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4 "initialULBWPmappingType_4" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4 "initialULBWPstartSymbolAndLength_4" -#define GNB_CONFIG_STRING_INITIALULBWPK2_5 "initialULBWPk2_5" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5 "initialULBWPmappingType_5" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5 "initialULBWPstartSymbolAndLength_5" -#define GNB_CONFIG_STRING_INITIALULBWPK2_6 "initialULBWPk2_6" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6 "initialULBWPmappingType_6" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6 "initialULBWPstartSymbolAndLength_6" -#define GNB_CONFIG_STRING_INITIALULBWPK2_7 "initialULBWPk2_7" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7 "initialULBWPmappingType_7" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7 "initialULBWPstartSymbolAndLength_7" -#define GNB_CONFIG_STRING_INITIALULBWPK2_8 "initialULBWPk2_8" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8 "initialULBWPmappingType_8" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8 "initialULBWPstartSymbolAndLength_8" -#define GNB_CONFIG_STRING_INITIALULBWPK2_9 "initialULBWPk2_9" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9 "initialULBWPmappingType_9" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9 "initialULBWPstartSymbolAndLength_9" -#define GNB_CONFIG_STRING_INITIALULBWPK2_10 "initialULBWPk2_10" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10 "initialULBWPmappingType_10" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10 "initialULBWPstartSymbolAndLength_10" -#define GNB_CONFIG_STRING_INITIALULBWPK2_11 "initialULBWPk2_11" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11 "initialULBWPmappingType_11" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11 "initialULBWPstartSymbolAndLength_11" -#define GNB_CONFIG_STRING_INITIALULBWPK2_12 "initialULBWPk2_12" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12 "initialULBWPmappingType_12" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12 "initialULBWPstartSymbolAndLength_12" -#define GNB_CONFIG_STRING_INITIALULBWPK2_13 "initialULBWPk2_13" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13 "initialULBWPmappingType_13" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13 "initialULBWPstartSymbolAndLength_13" -#define GNB_CONFIG_STRING_INITIALULBWPK2_14 "initialULBWPk2_14" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14 "initialULBWPmappingType_14" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14 "initialULBWPstartSymbolAndLength_14" -#define GNB_CONFIG_STRING_INITIALULBWPK2_15 "initialULBWPk2_15" -#define GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15 "initialULBWPmappingType_15" -#define GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15 "initialULBWPstartSymbolAndLength_15" #define GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR "ssb_PositionsInBurst_PR" @@ -273,54 +175,6 @@ {GNB_CONFIG_STRING_INITIALDLBWPSUBCARRIERSPACING,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0/*12*/},\ {GNB_CONFIG_STRING_INITIALDLBWPCONTROLRESOURCESETZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero,defint64val:12,TYPE_INT64,0/*13*/},\ {GNB_CONFIG_STRING_INITIALDLBWPSEARCHSPACEZERO,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero,defint64val:0,TYPE_INT64,0/*14*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_0,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->k0,defint64val:-1,TYPE_INT64,0/*15*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:-1,TYPE_INT64,0/*16*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:-1,TYPE_INT64,0/*17*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_1,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0,defint64val:-1,TYPE_INT64,0/*18*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*19*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*20*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPK0_2,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0,defint64val:-1,TYPE_INT64,0/*21*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*22*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*23*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_3,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->k0,defint64val:-1,TYPE_INT64,0/*24*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*25*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*26*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_4,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->k0,defint64val:-1,TYPE_INT64,0/*27*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*28*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*29*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_5,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->k0,defint64val:-1,TYPE_INT64,0/*30*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*31*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*32*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_6,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->k0,defint64val:-1,TYPE_INT64,0/*33*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*34*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*35*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_7,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->k0,defint64val:-1,TYPE_INT64,0/*36*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*37*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*38*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_8,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->k0,defint64val:-1,TYPE_INT64,0/*39*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*40*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*41*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_9,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->k0,defint64val:-1,TYPE_INT64,0/*42*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*43*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*44*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_10,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->k0,defint64val:-1,TYPE_INT64,0/*45*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*46*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*47*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_11,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->k0,defint64val:-1,TYPE_INT64,0/*48*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*49*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*50*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPK0_12,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->k0,defint64val:-1,TYPE_INT64,0/*51*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*52*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*53*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_13,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->k0,defint64val:-1,TYPE_INT64,0/*54*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*55*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*56*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_14,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->k0,defint64val:-1,TYPE_INT64,0/*57*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*58*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*59*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPK0_15,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->k0,defint64val:-1,TYPE_INT64,0/*60*/}, \ -{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*61*/},\ -{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*62*/},\ {GNB_CONFIG_STRING_ULFREQUENCYBAND,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0],defint64val:-1,TYPE_INT64,0/*63*/},\ {GNB_CONFIG_STRING_ULABSOLUEFREQUENCYPOINTA,NULL,0,i64ptr:scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA,defint64val:-1,TYPE_INT64,0/*64*/},\ {GNB_CONFIG_STRING_ULOFFSETTOCARRIER,NULL,0,i64ptr:&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier,defint64val:0,TYPE_INT64,0/*65*/},\ @@ -345,54 +199,6 @@ {GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139,defint64val:0,TYPE_INT64,0/*84*/},\ {GNB_CONFIG_STRING_RESTRICTEDSETCONFIG,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,defintval:NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \ {GNB_CONFIG_STRING_MSG3TRANSFPREC,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder,defintval:1,TYPE_INT64,0/*86*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPK2_0,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2,defint64val:-1,TYPE_INT64,0/*87*/},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,/*88*/},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:55,TYPE_INT64,0/*89*/},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_1,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2,defint64val:-1,TYPE_INT64,0/*90*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_2,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_3,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_4,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*100*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_5,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_6,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_7,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*110*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPK2_8,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_9,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_9,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[9]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_10,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_11,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2,defint64val:-1,TYPE_INT64,0/*120*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_12,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_12,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_13,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_14,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*130*/}, \ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPK2_15,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2,defint64val:-1,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\ -{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\ {GNB_CONFIG_STRING_MSG3DELTAPREABMLE, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble,defint64val:1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_P0NOMINALWITHGRANT, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant,defint64val:1,TYPE_INT64,0},\ {GNB_CONFIG_STRING_PUCCHGROUPHOPPING, NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping,defint64val:NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither,TYPE_INT64,0},\ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 9851d14b91..d069bfe2f4 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -94,8 +94,6 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { NR_FreqBandIndicatorNR_t *dl_frequencyBandList,*ul_frequencyBandList; struct NR_SCS_SpecificCarrier *dl_scs_SpecificCarrierList,*ul_scs_SpecificCarrierList; - struct NR_PDSCH_TimeDomainResourceAllocation *bwp_dl_timedomainresourceallocation; - struct NR_PUSCH_TimeDomainResourceAllocation *pusch_configcommontimedomainresourceallocation; // struct NR_RateMatchPattern *ratematchpattern; // NR_RateMatchPatternId_t *ratematchpatternid; // NR_TCI_StateId_t *TCI_StateId; @@ -143,14 +141,6 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->present = NR_SetupRelease_PDSCH_ConfigCommon_PR_setup; scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PDSCH_ConfigCommon)); scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList = CALLOC(1,sizeof(struct NR_PDSCH_TimeDomainResourceAllocationList)); - // - for (int i=0;ik0 = CALLOC(1,sizeof(long)); - *bwp_dl_timedomainresourceallocation->k0=0; - ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, - bwp_dl_timedomainresourceallocation); - } ul_frequencyBandList = CALLOC(1,sizeof(NR_FreqBandIndicatorNR_t)); scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList = CALLOC(1,sizeof(struct NR_MultiFrequencyBandListNR)); @@ -199,12 +189,6 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { ul_scs_SpecificCarrierList = CALLOC(1,sizeof(struct NR_SCS_SpecificCarrier)); ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list,ul_scs_SpecificCarrierList); - for (int i=0;ik2 = CALLOC(1,sizeof(long)); - *pusch_configcommontimedomainresourceallocation->k2=0; - ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_configcommontimedomainresourceallocation); - } //ratematchpattern = CALLOC(1,sizeof(struct NR_RateMatchPattern)); //ratematchpattern->patternType.choice.bitmaps = CALLOC(1,sizeof(struct NR_RateMatchPattern__patternType__bitmaps)); //ratematchpattern->patternType.choice.bitmaps->resourceBlocks.buf = MALLOC(35); @@ -223,6 +207,92 @@ void prepare_scc(NR_ServingCellConfigCommon_t *scc) { } +void fill_scc_sim(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) { + + *scc->physCellId=0; \ + // *scc->n_TimingAdvanceOffset=NR_ServingCellConfigCommon__n_TimingAdvanceOffset_n0; + *scc->ssb_periodicityServingCell=NR_ServingCellConfigCommon__ssb_periodicityServingCell_ms20; + scc->dmrs_TypeA_Position=NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2; + *scc->ssbSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; + *scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB=641032; + *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]=78; + scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA=640000; + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; + + scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_DL; + scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth=13036; + scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing=mu_dl;//NR_SubcarrierSpacing_kHz30; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero=12; + *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero=0; + struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation0 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + timedomainresourceallocation0->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + timedomainresourceallocation0->startSymbolAndLength=54; + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + timedomainresourceallocation0); + struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation1 = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + timedomainresourceallocation1->mappingType=NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + timedomainresourceallocation1->startSymbolAndLength=57; + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + timedomainresourceallocation1); + *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0]=78; + *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA=-1; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier=0; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing=NR_SubcarrierSpacing_kHz30; + scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth=N_RB_UL; + *scc->uplinkConfigCommon->frequencyInfoUL->p_Max=20; + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth=13036; + scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing=mu_ul;//NR_SubcarrierSpacing_kHz30; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.prach_ConfigurationIndex=98; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM=NR_RACH_ConfigGeneric__msg1_FDM_one; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart=0; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig=13; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower=-118; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleTransMax=NR_RACH_ConfigGeneric__preambleTransMax_n10; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.powerRampingStep=NR_RACH_ConfigGeneric__powerRampingStep_dB2; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow=NR_RACH_ConfigGeneric__ra_ResponseWindow_sl20; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR_one; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->choice.one=NR_RACH_ConfigCommon__ssb_perRACH_OccasionAndCB_PreamblesPerSSB__one_n64; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ra_ContentionResolutionTimer=NR_RACH_ConfigCommon__ra_ContentionResolutionTimer_sf64; + *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB=19; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present=NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139=0; + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig=NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet; + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation0 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); + pusch_timedomainresourceallocation0->k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation0->k2=6; + pusch_timedomainresourceallocation0->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation0->startSymbolAndLength=55; + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation0); + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation1 = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); + pusch_timedomainresourceallocation1->k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation1->k2=6; + pusch_timedomainresourceallocation1->mappingType=NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation1->startSymbolAndLength=38; + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation1); + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->msg3_DeltaPreamble=1; + *scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant=-90; + scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping=NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither; + *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId=40; + *scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal=-90; + scc->ssb_PositionsInBurst->present=NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap; + *ssb_bitmap=0xff; + scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing=NR_SubcarrierSpacing_kHz30; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity=NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots=7; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols=6; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots=2; + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols=4; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity=321; + + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSymbols=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots=-1; + scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols=-1; + scc->ss_PBCH_BlockPower=20; + *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing=-1; +} + void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { @@ -273,24 +343,9 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { if (*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder!=0) scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = NULL; - // fix DL and UL Allocation lists - - for (int i=scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count-1;i>=0;i--) { - printf("Checking element %d : %ld\n",i,*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0); - if (*scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0>32) { - printf("removing pdsch_TimeDomainAllocationList element %d\n",i); - free(scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0); - asn_sequence_del(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,i,1); - printf("List size now %d\n",scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count); - } - } + // prepare DL Allocation lists + nr_rrc_config_dl_tda(scc); - for (int i=scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.count-1;i>=0;i--) { - if (*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[i]->k2>32) { - free(scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[i]->k2); - asn_sequence_del(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,i,1); - } - } if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { free(scc->tdd_UL_DL_ConfigurationCommon->pattern2); scc->tdd_UL_DL_ConfigurationCommon->pattern2=NULL; @@ -1107,11 +1162,9 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; - printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; + printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - printf("minTXRXTIMEpdsch %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIMEpdsch = *GNBParamList.paramarray[i][GNB_MINRXTXTIMEPDSCH_IDX].iptr; printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 0c3d971569..730b6b85b6 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -119,7 +119,7 @@ typedef enum { #define GNB_CONFIG_STRING_SIB1TDA "sib1_tda" #define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" -#define GNB_CONFIG_STRING_MINRXTXTIMEPDSCH "min_rxtxtime_pdsch" +#define GNB_CONFIG_STRING_MINRXTXTIME "min_rxtxtime" #define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" @@ -148,7 +148,7 @@ typedef enum { {GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ -{GNB_CONFIG_STRING_MINRXTXTIMEPDSCH, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_MINRXTXTIME, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ } @@ -172,7 +172,7 @@ typedef enum { #define GNB_SIB1_TDA_IDX 17 #define GNB_DO_CSIRS_IDX 18 #define GNB_NRCELLID_IDX 19 -#define GNB_MINRXTXTIMEPDSCH_IDX 20 +#define GNB_MINRXTXTIME_IDX 20 #define GNB_ULPRBBLACKLIST_IDX 21 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index f67a3e1fa5..764c92ecb7 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -44,46 +44,9 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int nrofUplinkSlots, int nrofUplinkSymbols) { int slot_number = 0; - int nb_periods_per_frame; + int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period); int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period) { - case 0: - nb_periods_per_frame = 20; // 10ms/0p5ms - break; - - case 1: - nb_periods_per_frame = 16; // 10ms/0p625ms - break; - - case 2: - nb_periods_per_frame = 10; // 10ms/1ms - break; - - case 3: - nb_periods_per_frame = 8; // 10ms/1p25ms - break; - - case 4: - nb_periods_per_frame = 5; // 10ms/2ms - break; - - case 5: - nb_periods_per_frame = 4; // 10ms/2p5ms - break; - - case 6: - nb_periods_per_frame = 2; // 10ms/5ms - break; - - case 7: - nb_periods_per_frame = 1; // 10ms/10ms - break; - - default: - AssertFatal(1==0,"Undefined tdd period %d\n", cfg->tdd_table.tdd_period); - } - int nb_slots_per_period = ((1<tdd_table.tdd_period_in_slots = nb_slots_per_period; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index a5f6e4a7d1..2f4ceb48ec 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -944,6 +944,10 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr return -1; } + if(rnti != ra->ra_rnti && rnti != SI_RNTI) + AssertFatal(1+dci->pdsch_to_harq_feedback_timing_indicator.val>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d).\n", + 1+dci->pdsch_to_harq_feedback_timing_indicator.val,DURATION_RX_TO_TX); + // set the harq status at MAC for feedback set_harq_status(mac,dci->pucch_resource_indicator, dci->harq_pid, @@ -1232,7 +1236,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; - AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d)\n", + AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d). Min feedback time set in config file (min_rxtxtime).\n", feedback_ti,DURATION_RX_TO_TX); // set the harq status at MAC for feedback @@ -3160,10 +3164,10 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac, pos+=fsize; dci_pdu_rel15->frequency_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<time_domain_assignment.nbits; - dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&0x3; + dci_pdu_rel15->time_domain_assignment.val = (*dci_pdu>>(dci_size-pos))&((1<time_domain_assignment.nbits)-1); // Not supported yet - skip for now // Frequency hopping flag – 1 bit diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index c142af13ba..3d45877979 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -129,7 +129,7 @@ long get_k2(NR_UE_MAC_INST_t *mac, uint8_t time_domain_ind) { } AssertFatal(k2 >= DURATION_RX_TO_TX, - "Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d)\n", + "Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d). K2 set according to min_rxtxtime in config file.\n", k2,DURATION_RX_TO_TX); LOG_D(NR_MAC, "get_k2(): k2 is %ld\n", k2); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 25aeea70a6..2705b85b8c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -870,9 +870,6 @@ void nr_get_Msg3alloc(module_id_t module_id, int mu = ubwp ? ubwp->bwp_Common->genericParameters.subcarrierSpacing : scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; - int StartSymbolIndex = 0; - int NrOfSymbols = 0; - int startSymbolAndLength = 0; int temp_slot = 0; ra->Msg3_tda_id = 16; // initialization to a value above limit @@ -881,20 +878,29 @@ void nr_get_Msg3alloc(module_id_t module_id, scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; uint8_t k2 = 0; - for (int i=0; ilist.count; i++) { - startSymbolAndLength = pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; - SLIV2SL(startSymbolAndLength, &StartSymbolIndex, &NrOfSymbols); - // we want to transmit in the uplink symbols of mixed slot - if (NrOfSymbols == scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols) { + lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + if (frame_type == TDD) { + int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); + int nb_slots_per_period = ((1<list.count; i++) { k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2; - temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 - ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; - if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { - ra->Msg3_tda_id = i; - break; + // we want to transmit in the uplink symbols of mixed slot + if ((k2 + DELTA[mu])%nb_slots_per_period == 0) { + temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 + ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; + if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { + ra->Msg3_tda_id = i; + break; + } } } } + else { + ra->Msg3_tda_id = 0; + k2 = *pusch_TimeDomainAllocationList->list.array[0]->k2; + temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 + ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; + } AssertFatal(ra->Msg3_tda_id<16,"Unable to find Msg3 time domain allocation in list\n"); @@ -915,7 +921,7 @@ void nr_get_Msg3alloc(module_id_t module_id, tdd_beam_association[num_tdd_period] = ra->beam_id; } - LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u start symbol index %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id, StartSymbolIndex); + LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id); uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[ra->Msg3_slot * MAX_BWP_SIZE]; @@ -972,7 +978,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->bwp_size = bwp_size; pusch_pdu->subcarrier_spacing = scs; pusch_pdu->cyclic_prefix = 0; - pusch_pdu->mcs_index = 0; + pusch_pdu->mcs_index = 1; pusch_pdu->mcs_table = 0; pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); @@ -1009,11 +1015,14 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->pusch_data.harq_process_id = 0; pusch_pdu->pusch_data.new_data_indicator = 1; pusch_pdu->pusch_data.num_cb = 0; + int num_dmrs_symb = 0; + for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) + num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, pusch_pdu->target_code_rate, pusch_pdu->rb_size, pusch_pdu->nr_of_symbols, - 12, // nb dmrs set for no data in dmrs symbol + num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol 0, //nb_rb_oh 0, // to verify tb scaling pusch_pdu->nrOfLayers)>>3; @@ -1074,7 +1083,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t fh = ubwp->bwp_Dedicated->pusch_Config->choice.setup->frequencyHopping ? 1 : 0; } - LOG_D(NR_MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", + LOG_D(NR_MAC, "Frame %d, Slot %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", frameP, slotP, ra->Msg3_frame, @@ -1105,7 +1114,12 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if ((ra->Msg2_frame == frameP) && (ra->Msg2_slot == slotP)) { - uint8_t time_domain_assignment = 1; + //TODO time domain assignment for msg2 needs to be improved + uint8_t time_domain_assignment; + if(cc->frame_type == TDD) + time_domain_assignment = 1; + else + time_domain_assignment = 0; uint8_t mcsIndex = 0; int rbStart = 0; int rbSize = 8; @@ -1245,6 +1259,8 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type) dmrsConfigType = 1; + NR_PDSCH_Config_t *pdsch_config = bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pdsch_Config ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL; + pdsch_pdu_rel15->pduBitmap = 0; pdsch_pdu_rel15->rnti = ra->RA_rnti; pdsch_pdu_rel15->pduIndex = pduindex; @@ -1273,7 +1289,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra pdsch_pdu_rel15->VRBtoPRBMapping = 0; pdsch_pdu_rel15->StartSymbolIndex = startSymbolIndex; pdsch_pdu_rel15->NrOfSymbols = nrOfSymbols; - pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(NULL, + pdsch_pdu_rel15->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 33cb2b1b1d..7b7b5c771b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -351,7 +351,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, - const NR_BWP_UplinkDedicated_t *ubwpd, + const NR_BWP_UplinkDedicated_t *ubwpd, long dci_format, int tda, uint8_t num_dmrs_cdm_grps_no_data, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 313dd6236e..c68b16b553 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -104,7 +104,6 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* check that TDA index 1 fits into UL slot and does not overlap with PUCCH */ const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; - AssertFatal(tdaList->list.count >= 3, "need to have at least three TDAs for UL slots\n"); const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_UL = tdaList->list.array[0]; const int k2 = get_K2(scc, (NR_BWP_Uplink_t*)ubwp,0, mu); int start, len; @@ -117,27 +116,28 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub // get largest time domain allocation (TDA) for UL slot and UL in mixed slot int tdaMi = -1; - const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; - AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), - "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", - k2, - get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); - SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); - const uint16_t symb_tda_mi = ((1 << len) - 1) << start; - // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check - // whether TDA is entirely within mixed slot, UL. Note that here we assume - // that the PUCCH is scheduled in every slot, and on all RBs (which is - // mostly not true, this is a simplification) - if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { - tdaMi = 1; - } else { - LOG_E(NR_MAC, - "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", - symb_pucch, - symb_ulMixed, - symb_tda_mi); + if(tdaList->list.count > 1) { + const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; + AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), + "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", + k2, + get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); + SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); + const uint16_t symb_tda_mi = ((1 << len) - 1) << start; + // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check + // whether TDA is entirely within mixed slot, UL. Note that here we assume + // that the PUCCH is scheduled in every slot, and on all RBs (which is + // mostly not true, this is a simplification) + if ((symb_pucch & symb_tda_mi) == 0 && (symb_ulMixed & symb_tda_mi) == symb_tda_mi) { + tdaMi = 1; + } else { + LOG_E(NR_MAC, + "TDA index 1 UL overlaps with PUCCH or is not entirely in mixed slot (symb_pucch %x symb_ulMixed %x symb_tda_mi %x), won't schedule UL mixed slot\n", + symb_pucch, + symb_ulMixed, + symb_tda_mi); + } } - const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index 547c5da00c..5e5de9a8e1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -64,7 +64,7 @@ void *nrmac_stats_thread(void *arg) { fseek(fd,0,SEEK_SET); } fclose(fd); - return (void *)0; + return NULL; } void clear_mac_stats(gNB_MAC_INST *gNB) { diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index ff6923429e..bdd1cf5261 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1185,9 +1185,9 @@ void fill_initial_SpCellConfig(rnti_t rnti, long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - AssertFatal(carrier->minRXTXTIMEpdsch >=2 && carrier->minRXTXTIMEpdsch <7, - "check minRXTXTIMEpdsch %d\n",carrier->minRXTXTIMEpdsch); - *delay[i] = (i+carrier->minRXTXTIMEpdsch); + AssertFatal(carrier->minRXTXTIME >=2 && carrier->minRXTXTIME <7, + "check minRXTXTIME %d\n",carrier->minRXTXTIME); + *delay[i] = (i+carrier->minRXTXTIME); ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index dedd4cf839..6b7f9a21b9 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -29,96 +29,79 @@ */ #include "nr_rrc_config.h" +#include "common/utils/nr/nr_common.h" -void rrc_config_rlc_bearer(uint8_t Mod_id, - int CC_id, - rlc_bearer_config_t *rlc_config - ){ - rlc_config->LogicalChannelIdentity[CC_id] = 0; - rlc_config->servedRadioBearer_present[CC_id] = 0; - rlc_config->srb_Identity[CC_id] = 0; - rlc_config->drb_Identity[CC_id] = 0; - rlc_config->reestablishRLC[CC_id] = 0; - rlc_config->rlc_Config_present[CC_id] = 0; - rlc_config->ul_AM_sn_FieldLength[CC_id] = 0; - rlc_config->t_PollRetransmit[CC_id] = 0; - rlc_config->pollPDU[CC_id] = 0; - rlc_config->pollByte[CC_id] = 0; - rlc_config->maxRetxThreshold[CC_id] = 0; - rlc_config->dl_AM_sn_FieldLength[CC_id] = 0; - rlc_config->dl_AM_t_Reassembly[CC_id] = 0; - rlc_config->t_StatusProhibit[CC_id] = 0; - rlc_config->ul_UM_sn_FieldLength[CC_id] = 0; - rlc_config->dl_UM_sn_FieldLength[CC_id] = 0; - rlc_config->dl_UM_t_Reassembly[CC_id] = 0; - rlc_config->priority[CC_id] = 0; - rlc_config->prioritisedBitRate[CC_id] = 0; - rlc_config->bucketSizeDuration[CC_id] = 0; - rlc_config->allowedServingCells[CC_id] = 0; - rlc_config->subcarrierspacing[CC_id] = 0; - rlc_config->maxPUSCH_Duration[CC_id] = 0; - rlc_config->configuredGrantType1Allowed[CC_id] = 0; - rlc_config->logicalChannelGroup[CC_id] = 0; - rlc_config->schedulingRequestID[CC_id] = 0; - rlc_config->logicalChannelSR_Mask[CC_id] = 0; - rlc_config->logicalChannelSR_DelayTimerApplied[CC_id] = 0; +void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ + + lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + + // setting default TDA for DL with + struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,13); // basic slot configuration starting in symbol 1 til the end of the slot + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + timedomainresourceallocation); + + if(frame_type==TDD) { + // TDD + if(scc->tdd_UL_DL_ConfigurationCommon) { + int dl_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols; + if(dl_symb > 1) { + timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); + timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; + timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,dl_symb-1); // mixed slot configuration starting in symbol 1 til the end of the dl allocation + ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, + timedomainresourceallocation); + } + } + } } -void rrc_config_mac_cellgroup(uint8_t Mod_id, - int CC_id, - mac_cellgroup_t *mac_cellgroup_config - ){ - mac_cellgroup_config->DRX_Config_PR[CC_id] = 0; - mac_cellgroup_config->drx_onDurationTimer_PR[CC_id] = 0; - mac_cellgroup_config->subMilliSeconds[CC_id] = 0; - mac_cellgroup_config->milliSeconds[CC_id] = 0; - mac_cellgroup_config->drx_InactivityTimer[CC_id] = 0; - mac_cellgroup_config->drx_HARQ_RTT_TimerDL[CC_id] = 0; - mac_cellgroup_config->drx_HARQ_RTT_TimerUL[CC_id] = 0; - mac_cellgroup_config->drx_RetransmissionTimerDL[CC_id] = 0; - mac_cellgroup_config->drx_RetransmissionTimerUL[CC_id] = 0; - mac_cellgroup_config->drx_LongCycleStartOffset_PR[CC_id] = 0; - mac_cellgroup_config->drx_LongCycleStartOffset[CC_id] = 0; - mac_cellgroup_config->drx_ShortCycle[CC_id] = 0; - mac_cellgroup_config->drx_ShortCycleTimer[CC_id] = 0; - mac_cellgroup_config->drx_SlotOffset[CC_id] = 0; - mac_cellgroup_config->schedulingRequestId[CC_id] = 0; - mac_cellgroup_config->sr_ProhibitTimer[CC_id] = 0; - mac_cellgroup_config->sr_TransMax[CC_id] = 0; - mac_cellgroup_config->periodicBSR_Timer[CC_id] = 0; - mac_cellgroup_config->retxBSR_Timer[CC_id] = 0; - mac_cellgroup_config->logicalChannelSR_DelayTimer[CC_id] = 0; - mac_cellgroup_config->tag_Id[CC_id] = 0; - mac_cellgroup_config->timeAlignmentTimer[CC_id] = 0; - mac_cellgroup_config->PHR_Config_PR[CC_id] = 0; - mac_cellgroup_config->phr_PeriodicTimer[CC_id] = 0; - mac_cellgroup_config->phr_ProhibitTimer[CC_id] = 0; - mac_cellgroup_config->phr_Tx_PowerFactorChange[CC_id] = 0; - mac_cellgroup_config->multiplePHR[CC_id] = 0; - mac_cellgroup_config->phr_Type2SpCell[CC_id] = 0; - mac_cellgroup_config->phr_Type2OtherCell[CC_id] = 0; - mac_cellgroup_config->phr_ModeOtherCG[CC_id] = 0; - mac_cellgroup_config->skipUplinkTxDynamic[CC_id] = 0; + +void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ + + //TODO change to accomodate for SRS + + int temp_min_delay = 6; // k2 = 2 or 3 won'r work as well as higher values + int k2 = (min_fb_delayuplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; + lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + + struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); + pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation->k2 = k2; + pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(0,13); // basic slot configuration starting in symbol 0 til the last but one symbol + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); + + if(frame_type==TDD) { + // TDD + if(scc->tdd_UL_DL_ConfigurationCommon) { + int ul_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; + pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); + pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation->k2 = k2; + pusch_timedomainresourceallocation->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); + + // for msg3 in the mixed slot + int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); + int nb_slots_per_period = ((1<k2 = CALLOC(1,sizeof(long)); + *pusch_timedomainresourceallocation_msg3->k2 = nb_slots_per_period - DELTA[mu]; + if(*pusch_timedomainresourceallocation_msg3->k2 < min_fb_delay) + *pusch_timedomainresourceallocation_msg3->k2 += nb_slots_per_period; + AssertFatal(*pusch_timedomainresourceallocation_msg3->k2<33,"Computed k2 for msg3 %ld is larger than the range allowed by RRC (0..32)\n", + *pusch_timedomainresourceallocation_msg3->k2); + pusch_timedomainresourceallocation_msg3->mappingType = NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB; + pusch_timedomainresourceallocation_msg3->startSymbolAndLength = get_SLIV(14-ul_symb,ul_symb-1); // starting in fist ul symbol til the last but one + ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation_msg3); + } + } + } -void rrc_config_physicalcellgroup(uint8_t Mod_id, - int CC_id, - physicalcellgroup_t *physicalcellgroup_config - ){ - physicalcellgroup_config->harq_ACK_SpatialBundlingPUCCH[CC_id] = 0; - physicalcellgroup_config->harq_ACK_SpatialBundlingPUSCH[CC_id] = 0; - physicalcellgroup_config->p_NR[CC_id] = 0; - physicalcellgroup_config->pdsch_HARQ_ACK_Codebook[CC_id] = 0; - physicalcellgroup_config->tpc_SRS_RNTI[CC_id] = 0; - physicalcellgroup_config->tpc_PUCCH_RNTI[CC_id] = 0; - physicalcellgroup_config->tpc_PUSCH_RNTI[CC_id] = 0; - physicalcellgroup_config->sp_CSI_RNTI[CC_id] = 0; - physicalcellgroup_config->RNTI_Value[CC_id] = 0; -} - -void rrc_config_rachdedicated(uint8_t Mod_id, - int CC_id, - physicalcellgroup_t *physicalcellgroup_config - ){ - -} diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index e19d94b341..192fee754e 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -111,29 +111,8 @@ typedef struct physicalcellgroup_s{ long RNTI_Value[MAX_NUM_CCs]; }physicalcellgroup_t; -typedef struct rach_dedicated_s{ - - -}rach_dedicated_t; +void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); +void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); -void rrc_config_servingcellconfigcommon(uint8_t Mod_id, - int CC_id, - gNB_RrcConfigurationReq *common_configuration - ); - -void rrc_config_rlc_bearer(uint8_t Mod_id, - int CC_id, - rlc_bearer_config_t *rlc_config - ); - -void rrc_config_mac_cellgroup(uint8_t Mod_id, - int CC_id, - mac_cellgroup_t *mac_cellgroup_config - ); - -void rrc_config_physicalcellgroup(uint8_t Mod_id, - int CC_id, - physicalcellgroup_t *physicalcellgroup_config - ); #endif diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index ad31e8cac7..d71393bc2d 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -447,7 +447,7 @@ typedef struct { int sib1_tda; int pdsch_AntennaPorts; int pusch_AntennaPorts; - int minRXTXTIMEpdsch; + int minRXTXTIME; int do_CSIRS; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 34e570070d..7f7353f9af 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -136,80 +136,6 @@ void openair_nr_rrc_on(const protocol_ctxt_t *const ctxt_pP) { ///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------/// -void rrc_gNB_process_SgNBAdditionRequest( - const protocol_ctxt_t *const ctxt_pP, - rrc_gNB_ue_context_t *ue_context_pP -) { - rrc_gNB_generate_SgNBAdditionRequestAcknowledge(ctxt_pP,ue_context_pP); -} - -void rrc_gNB_generate_SgNBAdditionRequestAcknowledge( - const protocol_ctxt_t *const ctxt_pP, - rrc_gNB_ue_context_t *const ue_context_pP) { - //uint8_t size; - //uint8_t buffer[100]; - //int CC_id = ue_context_pP->ue_context.primaryCC_id; - //OCTET_STRING_t *secondaryCellGroup; - NR_CellGroupConfig_t *cellGroupconfig; - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_BearerToAddModList; - struct NR_MAC_CellGroupConfig *mac_CellGroupConfig; - struct NR_PhysicalCellGroupConfig *physicalCellGroupConfig; - struct NR_SpCellConfig *spCellConfig; - //struct NR_CellGroupConfig__sCellToAddModList *sCellToAddModList; - cellGroupconfig = CALLOC(1,sizeof(NR_CellGroupConfig_t)); - cellGroupconfig->rlc_BearerToAddModList = CALLOC(1,sizeof(struct NR_CellGroupConfig__rlc_BearerToAddModList)); - cellGroupconfig->mac_CellGroupConfig = CALLOC(1,sizeof(struct NR_MAC_CellGroupConfig)); - cellGroupconfig->physicalCellGroupConfig = CALLOC(1,sizeof(struct NR_PhysicalCellGroupConfig)); - cellGroupconfig->spCellConfig = CALLOC(1,sizeof(struct NR_SpCellConfig)); - //cellGroupconfig->sCellToAddModList = CALLOC(1,sizeof(struct NR_CellGroupConfig__sCellToAddModList)); - rlc_BearerToAddModList = cellGroupconfig->rlc_BearerToAddModList; - mac_CellGroupConfig = cellGroupconfig->mac_CellGroupConfig; - physicalCellGroupConfig = cellGroupconfig->physicalCellGroupConfig; - spCellConfig = cellGroupconfig->spCellConfig; - //sCellToAddModList = cellGroupconfig->sCellToAddModList; - rlc_bearer_config_t *rlc_config; - rlc_config = CALLOC(1,sizeof(rlc_bearer_config_t)); - //Fill rlc_bearer config value - rrc_config_rlc_bearer(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - rlc_config - ); - //Fill rlc_bearer config to structure - do_RLC_BEARER(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - rlc_BearerToAddModList, - rlc_config); - mac_cellgroup_t *mac_cellgroup_config; - mac_cellgroup_config = CALLOC(1,sizeof(mac_cellgroup_t)); - //Fill mac_cellgroup_config config value - rrc_config_mac_cellgroup(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - mac_cellgroup_config - ); - //Fill mac_cellgroup config to structure - do_MAC_CELLGROUP(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - mac_CellGroupConfig, - mac_cellgroup_config); - physicalcellgroup_t *physicalcellgroup_config; - physicalcellgroup_config = CALLOC(1,sizeof(physicalcellgroup_t)); - //Fill physicalcellgroup_config config value - rrc_config_physicalcellgroup(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - physicalcellgroup_config - ); - //Fill physicalcellgroup config to structure - do_PHYSICALCELLGROUP(ctxt_pP->module_id, - ue_context_pP->ue_context.primaryCC_id, - physicalCellGroupConfig, - physicalcellgroup_config); - do_SpCellConfig(RC.nrrrc[ctxt_pP->module_id], - spCellConfig); -} - -///---------------------------------------------------------------------------------------------------------------/// -///---------------------------------------------------------------------------------------------------------------/// - static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) { LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__); if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { @@ -330,9 +256,10 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset; rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts; - rrc->carrier.minRXTXTIMEpdsch = configuration->minRXTXTIMEpdsch; + rrc->carrier.minRXTXTIME = configuration->minRXTXTIME; rrc->carrier.sib1_tda = configuration->sib1_tda; rrc->carrier.do_CSIRS = configuration->do_CSIRS; + nr_rrc_config_ul_tda(configuration->scc,configuration->minRXTXTIME); /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); rrc->cell_info_configured = 0; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 2104d5cdd7..3311779235 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -241,7 +241,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, - carrier->minRXTXTIMEpdsch, + carrier->minRXTXTIME, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); @@ -251,7 +251,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, carrier->pdsch_AntennaPorts, - carrier->minRXTXTIMEpdsch, + carrier->minRXTXTIME, carrier->do_CSIRS, carrier->initial_csi_index[ue_context_p->local_uid + 1], ue_context_p->local_uid); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 4b8fd77dc5..30604cd015 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -55,7 +55,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int scg_id, int servCellIndex, int dl_antenna_ports, - int minRXTXTIMEpdsch, + int minRXTXTIME, int do_csirs, int initial_csi_index, int uid) { @@ -483,10 +483,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_PDSCH_TimeDomainResourceAllocation_t *pdschi; for (int i=0;idownlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;i++) { pdschi= calloc(1,sizeof(*pdschi)); - AssertFatal(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0!=NULL,"element %d is null\n",i); - - pdschi->k0 = calloc(1,sizeof(*pdschi->k0)); - *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0; + if(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0){ + pdschi->k0 = calloc(1,sizeof(*pdschi->k0)); + *pdschi->k0 = *servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->k0; + } pdschi->mappingType = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType; pdschi->startSymbolAndLength = servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength; ASN_SEQUENCE_ADD(&bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,pdschi); @@ -946,7 +946,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = i+minRXTXTIMEpdsch; + *delay[i] = i+minRXTXTIME; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); @@ -1349,7 +1349,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, int dl_antenna_ports, - int minRXTXTIMEpdsch, + int minRXTXTIME, int do_csirs, int initial_csi_index, int uid) { @@ -1365,7 +1365,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon 1, 1, dl_antenna_ports, - minRXTXTIMEpdsch, + minRXTXTIME, do_csirs, initial_csi_index, uid); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index b260eaa58d..c6a4a90a14 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -55,15 +55,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -120,19 +111,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; #p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index 0306fe5d0b..fd9399f89e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,20 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 4; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index c14ad17b42..59e71a6225 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 4; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index ff0fdd96bb..3fc81c0d6c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot (but is not used here) - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,19 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot (not used here) - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index 937790d4ac..a40a93c789 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 4; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index c9a95d59e8..3860aba935 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,18 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 524407c4de..7c527e07c8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -118,18 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf index d191b67988..a171f2aae0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 2dfa329346..4f8c785baa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf index 7f0829e40a..012f46401e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot (but not used here) - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 63; # this is SS=7 L=5 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 91; # this is SS=7 L=7 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index 6248afab2f..b6b9252560 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,20 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 6f28cd36c1..0817d7373e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index 30194647b8..fd4c23cfdb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; #12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; # used for (full) DL slot - initialDLBWPmappingType_0 = 0; # 0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; # this is SS=1,L=13 - - initialDLBWPk0_1 = 0; # used for DL part mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; # this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for (full) UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for UL part mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index fcbd3c0f02..965408332c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -54,16 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 - #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index 63123b8201..e36748a3a9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 217ff76376..7b2d369919 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index a1acfc313b..dbf4f58348 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -54,16 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 - #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 540dddad21..6d23726a78 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -54,16 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 - #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index edc5eaa0d4..c3fa56f15e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -54,16 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_3 = 0; #for mixed slot - initialDLBWPmappingType_3 = 0; - initialDLBWPstartSymbolAndLength_3 = 57; #this is SS=1,L=5 - #uplinkConfigCommon #frequencyInfoUL @@ -118,19 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 362a280ccb..15aa368fdf 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 69; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index e541607559..1583e07ca1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -54,29 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -131,22 +108,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index b1c78bc978..8dfcfb2b88 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index 96f2909031..d01b0947c0 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -55,28 +55,7 @@ gNBs = initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=4 //5 (4 is for 43, 5 is for 57) - initialDLBWPstartSymbolAndLength_3 = 57; //43; //57; #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -130,21 +109,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=13 - initialULBWPstartSymbolAndLength_0 = 41; - - initialULBWPk2_1 = 2; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf index f51f59ae30..198ad8471c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf @@ -54,15 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -117,18 +108,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 59e507ed3e..2f4839fd3b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -56,15 +56,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -119,18 +110,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 24; # this is SS=10 L=2 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 05e441d396..7f9e4d2d44 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -81,29 +81,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 53; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 81; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -158,22 +135,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=2 L=12 - initialULBWPstartSymbolAndLength_0 = 53; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index 3bd884b602..ab4713f8b5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -69,29 +69,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -146,21 +123,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index de6bafc9f7..9238ea1809 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -73,15 +73,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -136,19 +127,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index c4b06c1139..86318d80e2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -74,15 +74,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -137,19 +128,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 2; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 2; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index c7531f39ba..bbdd8b9c0f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -74,15 +74,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -137,19 +128,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index a0d25053b6..e9577ee265 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -70,29 +70,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL @@ -147,22 +124,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; From ddfd22d0fda91ed1e84f149e2c15510c1650e955 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 5 Jan 2022 14:10:12 +0000 Subject: [PATCH 248/883] Fix memset input parameters --- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 5620018b73..afd1fc6e0d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -213,7 +213,7 @@ void ldpc8blocks( void *p) { for (int rr=impp->macro_num*8; rr < impp->n_segments && rr < (impp->macro_num+1)*8; rr++ ) { if (impp->F>0) { // writing into positions d[r][k-2Zc] as in clause 5.3.2 step 2) in 38.212 - memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], impp->F, NR_NULL); + memset(&impp->d[rr][Kr-impp->F-2*(*impp->Zc)], NR_NULL, impp->F); } #ifdef DEBUG_DLSCH_CODING From d1db83caabdb7d6eb8bc78779588f4e3b7b6f041 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 5 Jan 2022 14:12:20 +0000 Subject: [PATCH 249/883] Rename min_rxtxtime in config files after merge --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf index ff05aa6e65..a2b4d86dfc 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.usrpn310.conf @@ -11,7 +11,7 @@ gNBs = # cell_type = "CELL_MACRO_GNB"; gNB_name = "gNB-OAI"; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 86318d80e2..6cb7ca5270 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -35,7 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; ul_prbblacklist = "51,52,53,54" pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index bbdd8b9c0f..bf68970100 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -35,7 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( From a15f1947d8394c5f376aa641af9bc4825e08c783 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 5 Jan 2022 16:51:39 +0100 Subject: [PATCH 250/883] remove limitation for first symbol with data in dlsch --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 850b41d2fb..f5cd53ee3c 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -816,7 +816,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ dual_stream_UE = 0; gNB_id_i = gNB_id+1; i_mod = 0; - if (( m==first_symbol_with_data ) && (m<4)) + if (m==first_symbol_with_data) first_symbol_flag = 1; else first_symbol_flag = 0; From d385c2126b1e0850ac369fe3310ebcfa6e861ca6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 6 Jan 2022 09:30:42 +0100 Subject: [PATCH 251/883] fixes for TDA in case of double symbol pdcch --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 4 +++- openair2/RRC/NR/nr_rrc_config.c | 9 ++++++--- .../CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index a87f8b765a..f4bd30e247 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2660,6 +2660,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, LOG_D(NR_MAC,"DAI1 nbits %d\n",dci_pdu->dai[0].nbits); // 2nd DAI if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig && + cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup && cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { //TODO not sure about that dci_pdu->dai[1].nbits = 2; size += dci_pdu->dai[1].nbits; @@ -2930,7 +2931,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, dci_pdu->srs_request.nbits = 3; size += dci_pdu->srs_request.nbits; // CBGTI - if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig&& + if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig && + cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup && cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { uint8_t maxCBGperTB = (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock + 1) * 2; long *maxCWperDCI_rrc = pdsch_Config->maxNrofCodeWordsScheduledByDCI; diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 6b7f9a21b9..82c3931421 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -34,14 +34,17 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; + int len_coreset = 1; + if (curr_bwp < 48) + len_coreset = 2; // setting default TDA for DL with struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,13); // basic slot configuration starting in symbol 1 til the end of the slot + timedomainresourceallocation->startSymbolAndLength = get_SLIV(len_coreset,14-len_coreset); // basic slot configuration starting in symbol 1 til the end of the slot ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, timedomainresourceallocation); - if(frame_type==TDD) { // TDD if(scc->tdd_UL_DL_ConfigurationCommon) { @@ -49,7 +52,7 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ if(dl_symb > 1) { timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; - timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,dl_symb-1); // mixed slot configuration starting in symbol 1 til the end of the dl allocation + timedomainresourceallocation->startSymbolAndLength = get_SLIV(len_coreset,dl_symb-len_coreset); // mixed slot configuration starting in symbol 1 til the end of the dl allocation ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, timedomainresourceallocation); } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf index c1bab381ec..bd3076a014 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.24PRB.usrpb210.conf @@ -36,6 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; sib1_tda = 15; + min_rxtxtime = 6; pdcch_ConfigSIB1 = ( { From b6b79d555eb44a7dd7df86ebff3b95d88831c3aa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 6 Jan 2022 10:49:00 +0100 Subject: [PATCH 252/883] Clean up nr_pbchsim program options --- openair1/SIMULATION/NR_PHY/pbchsim.c | 164 +++++++++++++-------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index a5c6222fe5..60866b5089 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -211,7 +211,7 @@ int main(int argc, char **argv) randominit(0); - while ((c = getopt (argc, argv, "f:hA:pf:g:i:j:n:o:s:S:t:x:y:z:M:N:F:GR:dP:IL:m:")) != -1) { + while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:P:R:s:S:x:y:z:")) != -1) { switch (c) { /*case 'f': write_output_file=1; @@ -228,6 +228,14 @@ int main(int argc, char **argv) frame_type = 1; break;*/ + case 'F': + input_fd = fopen(optarg,"r"); + if (input_fd==NULL) { + printf("Problem with filename %s. Exiting.\n", optarg); + exit(-1); + } + break; + case 'g': switch((char)*optarg) { case 'A': @@ -265,18 +273,42 @@ int main(int argc, char **argv) break; - /*case 'i': + /* + case 'i': interf1=atoi(optarg); break; + */ + case 'I': + run_initial_sync=1; + target_error_rate=0.1; + break; + + /* case 'j': interf2=atoi(optarg); break;*/ + case 'L': + loglvl = atoi(optarg); + break; + + case 'm': + mu = atoi(optarg); + break; + + case 'M': + SSB_positions = atoi(optarg); + break; + case 'n': n_trials = atoi(optarg); break; + case 'N': + Nid_cell = atoi(optarg); + break; + case 'o': cfo = atof(optarg); #ifdef DEBUG_NR_PBCHSIM @@ -284,6 +316,30 @@ int main(int argc, char **argv) #endif break; + /*case 'p': + extended_prefix_flag=1; + break;*/ + + case 'P': + pbch_phase = atoi(optarg); + if (pbch_phase>3) + printf("Illegal PBCH phase (0-3) got %d\n",pbch_phase); + break; + + /* + case 'r': + ricean_factor = pow(10,-.1*atof(optarg)); + if (ricean_factor>1) { + printf("Ricean factor must be between 0 and 1\n"); + exit(-1); + } + break; + */ + + case 'R': + N_RB_DL = atoi(optarg); + break; + case 's': snr0 = atof(optarg); #ifdef DEBUG_NR_PBCHSIM @@ -304,19 +360,7 @@ int main(int argc, char **argv) Td= atof(optarg); break; */ - /*case 'p': - extended_prefix_flag=1; - break;*/ - /* - case 'r': - ricean_factor = pow(10,-.1*atof(optarg)); - if (ricean_factor>1) { - printf("Ricean factor must be between 0 and 1\n"); - exit(-1); - } - break; - */ case 'x': transmission_mode=atoi(optarg); @@ -329,94 +373,50 @@ int main(int argc, char **argv) case 'y': n_tx=atoi(optarg); - if ((n_tx==0) || (n_tx>2)) { - printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx); + printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx); exit(-1); } - break; case 'z': n_rx=atoi(optarg); - if ((n_rx==0) || (n_rx>2)) { - printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx); + printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx); exit(-1); } - - break; - - case 'M': - SSB_positions = atoi(optarg); - break; - - case 'N': - Nid_cell = atoi(optarg); - break; - - case 'R': - N_RB_DL = atoi(optarg); - break; - - case 'F': - input_fd = fopen(optarg,"r"); - - if (input_fd==NULL) { - printf("Problem with filename %s. Exiting.\n", optarg); - exit(-1); - } - - break; - - case 'P': - pbch_phase = atoi(optarg); - - if (pbch_phase>3) - printf("Illegal PBCH phase (0-3) got %d\n",pbch_phase); - - break; - - case 'I': - run_initial_sync=1; - target_error_rate=0.1; - break; - - case 'L': - loglvl = atoi(optarg); - break; - - case 'm': - mu = atoi(optarg); break; default: case 'h': - printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", + printf("%s -F input_filename -g channel_mod -h(elp) -I(nitial sync) -L log_lvl -n n_frames -M SSBs -n frames -N cell_id -o FO -P phase -R RBs -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant\n", argv[0]); - printf("-h This message\n"); - //printf("-p Use extended prefix mode\n"); + //printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); + //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); //printf("-d Use TDD\n"); - printf("-n Number of frames to simulate\n"); - printf("-m Numerology index\n"); - printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n"); - printf("-S Ending SNR, runs from SNR0 to SNR1\n"); - printf("-t Delay spread for multipath channel\n"); + //printf("-f Output filename (.txt format) for Pe/SNR results\n"); + printf("-F Input filename (.txt format) for RX conformance testing\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("-h This message\n"); + //printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n"); + printf("-I run initial sync with target error rate 0.1\n"); + //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); + printf("-L set the log level (-1 disable, 0 error, 1 warning, 2 info, 3 debug, 4 trace)\n"); + printf("-m Numerology index\n"); + printf("-M Multiple SSB positions in burst\n"); + printf("-n Number of frames to simulate\n"); + printf("-N Nid_cell\n"); + printf("-o Carrier frequency offset in Hz\n"); + //printf("-O oversampling factor (1,2,4,8,16)\n"); + //printf("-p Use extended prefix mode\n"); + printf("-P PBCH phase, allowed values 0-3\n"); + printf("-R N_RB_DL\n"); + printf("-s Starting SNR, runs from SNR0 to SNR0 + 10 dB if not -S given. If -n 1, then just SNR is simulated\n"); + printf("-S Ending SNR, runs from SNR0 to SNR1\n"); + //printf("-t Delay spread for multipath channel\n"); printf("-x Transmission mode (1,2,6 for the moment)\n"); printf("-y Number of TX antennas used in eNB\n"); printf("-z Number of RX antennas used in UE\n"); - //printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n"); - //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); - printf("-o Carrier frequency offset in Hz\n"); - printf("-M Multiple SSB positions in burst\n"); - printf("-N Nid_cell\n"); - printf("-R N_RB_DL\n"); - printf("-O oversampling factor (1,2,4,8,16)\n"); - printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); - //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); - //printf("-f Output filename (.txt format) for Pe/SNR results\n"); - printf("-F Input filename (.txt format) for RX conformance testing\n"); exit (-1); break; } From 513eebee1e69bc0cc9c7cbba58b1cbd8a6e9a5e0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 6 Jan 2022 10:53:22 +0100 Subject: [PATCH 253/883] Add nr_pbchsim option to select random number seed --- openair1/SIMULATION/NR_PHY/pbchsim.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 60866b5089..3a769a3cfb 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -203,15 +203,15 @@ int main(int argc, char **argv) float target_error_rate = 0.01; + int seed = 0; + cpuf = get_cpu_freq_GHz(); if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) { exit_fun("[NR_PBCHSIM] Error, configuration module init failed\n"); } - randominit(0); - - while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:P:R:s:S:x:y:z:")) != -1) { + while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:P:r:R:s:S:x:y:z:")) != -1) { switch (c) { /*case 'f': write_output_file=1; @@ -336,6 +336,10 @@ int main(int argc, char **argv) break; */ + case 'r': + seed = atoi(optarg); + break; + case 'R': N_RB_DL = atoi(optarg); break; @@ -389,7 +393,7 @@ int main(int argc, char **argv) default: case 'h': - printf("%s -F input_filename -g channel_mod -h(elp) -I(nitial sync) -L log_lvl -n n_frames -M SSBs -n frames -N cell_id -o FO -P phase -R RBs -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant\n", + printf("%s -F input_filename -g channel_mod -h(elp) -I(nitial sync) -L log_lvl -n n_frames -M SSBs -n frames -N cell_id -o FO -P phase -r seed -R RBs -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant\n", argv[0]); //printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n"); //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n"); @@ -410,6 +414,7 @@ int main(int argc, char **argv) //printf("-O oversampling factor (1,2,4,8,16)\n"); //printf("-p Use extended prefix mode\n"); printf("-P PBCH phase, allowed values 0-3\n"); + printf("-r set the random number generator seed (default: 0 = current time)\n"); printf("-R N_RB_DL\n"); printf("-s Starting SNR, runs from SNR0 to SNR0 + 10 dB if not -S given. If -n 1, then just SNR is simulated\n"); printf("-S Ending SNR, runs from SNR0 to SNR1\n"); @@ -422,6 +427,8 @@ int main(int argc, char **argv) } } + randominit(seed); + logInit(); set_glog(loglvl); T_stdout = 1; From 56714b2c8224b139e25af1457e7abeb59ad72694 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Fri, 24 Dec 2021 12:24:35 +0000 Subject: [PATCH 254/883] Fix warnings after merge with develop --- openair1/PHY/INIT/nr_init_ue.c | 11 +---------- openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c | 11 +++++------ .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 9 ++++++--- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index f664a03ba0..fd5cc962b1 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -20,23 +20,14 @@ */ #include "phy_init.h" -#include "SCHED_UE/sched_UE.h" #include "PHY/phy_extern_nr_ue.h" -//#include "SIMULATION/TOOLS/sim.h" -/*#include "RadioResourceConfigCommonSIB.h" -#include "RadioResourceConfigDedicated.h" -#include "TDD-Config.h" -#include "MBSFN-SubframeConfigList.h"*/ #include "openair1/PHY/defs_RU.h" #include "openair1/PHY/impl_defs_nr.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "assertions.h" -#include +#include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" -//#include "PHY/LTE_REFSIG/lte_refsig.h" -#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h" -#include "PHY/INIT/phy_init.h" #include "PHY/NR_REFSIG/pss_nr.h" #include "PHY/NR_REFSIG/ul_ref_seq_nr.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h" diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c index 82bb0a2659..66ed4593d8 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pcfich_ue.c @@ -44,15 +44,14 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, int16_t *d) { - uint32_t i; - uint8_t reset; - uint32_t x1, x2, s=0; + uint8_t reset = 1; + uint32_t x1 = 0; + uint32_t s = 0; - reset = 1; // x1 is set in lte_gold_generic - x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 + uint32_t x2 = ((((2*frame_parms->Nid_cell)+1)*(1+subframe))<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.7.1 - for (i=0; i<32; i++) { + for (uint32_t i=0; i<32; i++) { if ((i&0x1f)==0) { s = lte_gold_generic(&x1, &x2, reset); //printf("lte_gold[%d]=%x\n",i,s); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9238ea1809..ef96df2995 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -35,6 +35,7 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; pdcch_ConfigSIB1 = ( @@ -66,7 +67,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952 + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -86,7 +87,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 12952; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -218,7 +219,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - pusch_proc_threads = 8; + pusch_proc_threads = 4; prach_dtx_threshold = 120; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 @@ -296,5 +297,7 @@ log_config : rrc_log_verbosity ="medium"; ngap_log_level ="debug"; ngap_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; }; From 7f20ad6c6e71508e44a17b977d3592a8d6440f32 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 6 Jan 2022 14:40:52 +0100 Subject: [PATCH 255/883] dynamic mcs selection for msg2 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 2705b85b8c..e186b7d514 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1120,7 +1120,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra time_domain_assignment = 1; else time_domain_assignment = 0; - uint8_t mcsIndex = 0; + int mcsIndex = -1; // initialization value int rbStart = 0; int rbSize = 8; @@ -1269,9 +1269,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra pdsch_pdu_rel15->SubcarrierSpacing = genericParameters->subcarrierSpacing; pdsch_pdu_rel15->CyclicPrefix = 0; pdsch_pdu_rel15->NrOfCodewords = 1; - pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(mcsIndex,mcsTableIdx); - pdsch_pdu_rel15->qamModOrder[0] = 2; - pdsch_pdu_rel15->mcsIndex[0] = mcsIndex; pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx; pdsch_pdu_rel15->rvIndex[0] = 0; pdsch_pdu_rel15->dataScramblingId = *scc->physCellId; @@ -1295,9 +1292,38 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra startSymbolIndex, mappingtype); - int x_Overhead = 0; uint8_t tb_scaling = 0; - nr_get_tbs_dl(&dl_tti_pdsch_pdu->pdsch_pdu, x_Overhead, pdsch_pdu_rel15->numDmrsCdmGrpsNoData, tb_scaling); + int R, Qm; + uint8_t N_PRB_DMRS; + uint32_t TBS=0; + if (dmrsConfigType == NFAPI_NR_DMRS_TYPE1) { + // if no data in dmrs cdm group is 1 only even REs have no data + // if no data in dmrs cdm group is 2 both odd and even REs have no data + N_PRB_DMRS = pdsch_pdu_rel15->numDmrsCdmGrpsNoData*6; + } + else { + N_PRB_DMRS = pdsch_pdu_rel15->numDmrsCdmGrpsNoData*4; + } + uint16_t dmrs_length = get_num_dmrs(pdsch_pdu_rel15->dlDmrsSymbPos); + + while(TBS<9) { // min TBS for RAR is 9 bytes + mcsIndex++; + R = nr_get_code_rate_dl(mcsIndex, mcsTableIdx); + Qm = nr_get_Qm_dl(mcsIndex, mcsTableIdx); + TBS = nr_compute_tbs(Qm, + R, + rbSize, + nrOfSymbols, + N_PRB_DMRS*dmrs_length, + 0, // overhead + tb_scaling, // tb scaling + 1)>>3; // layers + + pdsch_pdu_rel15->targetCodeRate[0] = R; + pdsch_pdu_rel15->qamModOrder[0] = Qm; + pdsch_pdu_rel15->mcsIndex[0] = mcsIndex; + pdsch_pdu_rel15->TBSize[0] = TBS; + } // Fill PDCCH DL DCI PDU nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci]; From 10e4ce2dce3aa1f266630fc8c0347e0b0451eebe Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 6 Jan 2022 15:04:42 +0100 Subject: [PATCH 256/883] dynamic mcs selection for msg4 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index e186b7d514..71ccd6c98b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1597,12 +1597,15 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra uint8_t tb_scaling = 0; uint16_t *vrb_map = cc[CC_id].vrb_map; do { - rbSize++; + if(rbSize < BWPSize) + rbSize++; + else + mcsIndex++; LOG_D(NR_MAC,"Calling nr_compute_tbs with N_PRB_DMRS %d, N_DMRS_SLOT %d\n",N_PRB_DMRS,N_DMRS_SLOT); harq->tb_size = nr_compute_tbs(nr_get_Qm_dl(mcsIndex, mcsTableIdx), - nr_get_code_rate_dl(mcsIndex, mcsTableIdx), - rbSize, nrOfSymbols, N_PRB_DMRS * N_DMRS_SLOT, 0, tb_scaling,1) >> 3; - } while (rbSize < BWPSize && harq->tb_size < ra->mac_pdu_length); + nr_get_code_rate_dl(mcsIndex, mcsTableIdx), + rbSize, nrOfSymbols, N_PRB_DMRS * N_DMRS_SLOT, 0, tb_scaling,1) >> 3; + } while (harq->tb_size < ra->mac_pdu_length); int i = 0; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { From b8daf747bd8d234c04c0ca0a6999057df5acbd9f Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 6 Jan 2022 14:39:31 +0000 Subject: [PATCH 257/883] Increase nr_pbchsim test requirements to pass in CI --- cmake_targets/autotests/test_case_list.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 3472b14efc..09207555ba 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1069,12 +1069,13 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15 - -s0 -S1 -n1000 -R106 - -s0 -S1 -n10 -I -R106 - -s0 -S1 -n1000 -R217 - -s0 -S1 -n10 -I -R217 - -s0 -S1 -n1000 -R273 - -s0 -S1 -n10 -I -R273 + -s-11 -S-8 -n10 -R106 + -s-11 -S-8 -n10 -o8000 -I -R106 + -s-11 -S-8 -n10 -R217 + -s-11 -S-8 -n10 -o8000 -I -R217 + -s-11 -S-8 -n10 -R273 + -s-11 -S-8 -n10 -o8000 -I -R273 + nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6 PBCH test OK segmentation fault|assertion|exiting|fatal From 395c211e6def48e4605653f80559754ebefc4a62 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 6 Jan 2022 16:18:55 +0000 Subject: [PATCH 258/883] Fix indentation --- cmake_targets/autotests/test_case_list.xml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 09207555ba..6450b64298 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1069,13 +1069,12 @@ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash $OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15 - -s-11 -S-8 -n10 -R106 - -s-11 -S-8 -n10 -o8000 -I -R106 - -s-11 -S-8 -n10 -R217 - -s-11 -S-8 -n10 -o8000 -I -R217 - -s-11 -S-8 -n10 -R273 - -s-11 -S-8 -n10 -o8000 -I -R273 - + -s-11 -S-8 -n10 -R106 + -s-11 -S-8 -n10 -o8000 -I -R106 + -s-11 -S-8 -n10 -R217 + -s-11 -S-8 -n10 -o8000 -I -R217 + -s-11 -S-8 -n10 -R273 + -s-11 -S-8 -n10 -o8000 -I -R273 nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6 PBCH test OK segmentation fault|assertion|exiting|fatal From d4d7173265dab588277e387597d2208990e835c1 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 7 Jan 2022 16:58:53 +0100 Subject: [PATCH 259/883] dynamic mcs selection for msg3 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 71ccd6c98b..22f2ea05d9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -970,6 +970,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, int start_symbol_index,nr_of_symbols; SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols); + int mcsindex = -1; // init value pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; pusch_pdu->rnti = rnti; @@ -978,10 +979,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->bwp_size = bwp_size; pusch_pdu->subcarrier_spacing = scs; pusch_pdu->cyclic_prefix = 0; - pusch_pdu->mcs_index = 1; pusch_pdu->mcs_table = 0; - pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); - pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table); if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) pusch_pdu->transform_precoding = 1; else @@ -1018,15 +1016,24 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, int num_dmrs_symb = 0; for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; - pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, - pusch_pdu->target_code_rate, - pusch_pdu->rb_size, - pusch_pdu->nr_of_symbols, - num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol - 0, //nb_rb_oh - 0, // to verify tb scaling - pusch_pdu->nrOfLayers)>>3; + int TBS = 0; + while(TBS<7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented) + mcsindex++; + pusch_pdu->target_code_rate = nr_get_code_rate_ul(mcsindex,pusch_pdu->mcs_table); + pusch_pdu->qam_mod_order = nr_get_Qm_ul(mcsindex,pusch_pdu->mcs_table); + TBS = nr_compute_tbs(pusch_pdu->qam_mod_order, + pusch_pdu->target_code_rate, + pusch_pdu->rb_size, + pusch_pdu->nr_of_symbols, + num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol + 0, //nb_rb_oh + 0, // to verify tb scaling + pusch_pdu->nrOfLayers)>>3; + + pusch_pdu->mcs_index = mcsindex; + pusch_pdu->pusch_data.tb_size = TBS; + } } void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, NR_RA_t *ra, uint8_t *RAR_pdu) From ef298dc36c940723ee36b12b6dec4cc50fc12247 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 7 Jan 2022 18:02:24 +0000 Subject: [PATCH 260/883] Add ffo compensation based on SSS --- openair1/PHY/NR_REFSIG/sss_nr.h | 2 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 29 ++++++++++++++++++- openair1/PHY/NR_UE_TRANSPORT/sss_nr.c | 16 +++++++++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/sss_nr.h b/openair1/PHY/NR_REFSIG/sss_nr.h index e413400097..03610ae30f 100644 --- a/openair1/PHY/NR_REFSIG/sss_nr.h +++ b/openair1/PHY/NR_REFSIG/sss_nr.h @@ -96,7 +96,7 @@ int pss_ch_est_nr(PHY_VARS_NR_UE *ue, int32_t pss_ext[NB_ANTENNAS_RX][LENGTH_PSS_NR], int32_t sss_ext[NB_ANTENNAS_RX][LENGTH_SSS_NR]); -int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max); +int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max, int *freq_offset_sss); #undef INIT_VARIABLES_SSS_NR_H #undef EXTERN diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index dcb8035e8a..0bcdfa68db 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -295,7 +295,34 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, LOG_I(PHY,"Calling sss detection (normal CP)\n"); #endif - rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp); + int freq_offset_sss = 0; + rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp, &freq_offset_sss); + + accumulated_freq_offset += freq_offset_sss; + + // digital compensation of FFO for SSB symbols + if (ue->UE_fo_compensation){ + double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time + double off_angle = -2*M_PI*s_time*freq_offset_sss; // offset rotation angle compensation per sample + + // In SA we need to perform frequency offset correction until the end of buffer because we need to decode SIB1 + // and we do not know yet in which slot it goes. + + // start for offset correction + int start = sa ? is*fp->samples_per_frame : is*fp->samples_per_frame + ue->ssb_offset; + + // loop over samples + int end = sa ? n_frames*fp->samples_per_frame-1 : start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples); + + for(int n=start; nnb_antennas_rx; ar++) { + re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]); + im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]); + ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle))); + ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle))); + } + } + } nr_gold_pbch(ue); ret = nr_pbch_detection(proc, ue, 1); // start pbch detection at first symbol after pss diff --git a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c index 9339f3974d..dc73fe0add 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c @@ -420,7 +420,7 @@ int pss_sss_extract_nr(PHY_VARS_NR_UE *phy_vars_ue, * *********************************************************************/ -int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max) +int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max, int *freq_offset_sss) { uint8_t i; int32_t pss_ext[NB_ANTENNAS_RX][LENGTH_PSS_NR]; @@ -558,5 +558,19 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, } //#endif + int re = 0; + int im = 0; + d = (int16_t *)&d_sss[Nid2][Nid1]; + for(i = 0; isubcarrier_spacing); + + double ffo_pss = ((double)ue->common_vars.freq_offset)/frame_parms->subcarrier_spacing; + LOG_I(NR_PHY, "ffo_pss %f (%i Hz), ffo_sss %f (%i Hz), ffo_pss+ffo_sss %f (%i Hz)\n", + ffo_pss, (int)(ffo_pss*frame_parms->subcarrier_spacing), ffo_sss, *freq_offset_sss, ffo_pss+ffo_sss, (int)((ffo_pss+ffo_sss)*frame_parms->subcarrier_spacing)); + return(0); } From f6c735f5605c7f913f7bb81e8877b4dc5e1a0449 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 7 Jan 2022 18:54:31 +0000 Subject: [PATCH 261/883] Revert to timing adjustment based on cyclic prefix and improves it --- executables/nr-ue.c | 25 ++------ openair1/PHY/NR_REFSIG/pss_nr.h | 2 - .../PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c | 6 -- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 59 ------------------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 +- 5 files changed, 7 insertions(+), 91 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 6694635e26..db3c1c9ac1 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -456,26 +456,10 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) { } int computeSamplesShift(PHY_VARS_NR_UE *UE) { - - // compute TO compensation that should be applied for this frame - if ( UE->rx_offset < UE->frame_parms.samples_per_frame/2 && - UE->rx_offset > 0 ) { - LOG_I(PHY,"!!!adjusting -1 samples!!! rx_offset == %d\n", UE->rx_offset); - UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame - UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied - return -1 ; - } - - if ( UE->rx_offset > UE->frame_parms.samples_per_frame/2 && - UE->rx_offset < UE->frame_parms.samples_per_frame ) { - int rx_offset = UE->rx_offset - UE->frame_parms.samples_per_frame; - LOG_I(PHY,"!!!adjusting +1 samples!!! rx_offset == %d\n", rx_offset); - UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame - UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied - return 1; - } - - return 0; + int samples_shift = -(UE->rx_offset>>1); + UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame + UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied + return samples_shift; } static inline int get_firstSymSamp(uint16_t slot, NR_DL_FRAME_PARMS *fp) { @@ -642,6 +626,7 @@ void *UE_thread(void *arg) { readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms); writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms); } else { + UE->rx_offset_diff = computeSamplesShift(UE); readBlockSize=get_readBlockSize(slot_nr, &UE->frame_parms) - UE->rx_offset_diff; writeBlockSize=UE->frame_parms.get_samples_per_slot((slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH) % nb_slot_frame, &UE->frame_parms)- UE->rx_offset_diff; diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index 3b480d7fab..b32d48a2e9 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -141,8 +141,6 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain int *eNB_id, int *f_off); -int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue); - #endif #undef EXTERN diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index 19d4bf5079..15f3abad79 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -115,12 +115,6 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, } } - if (ue->rx_offset < 0) - ue->rx_offset += frame_parms->samples_per_frame; - - if (ue->rx_offset >= frame_parms->samples_per_frame) - ue->rx_offset -= frame_parms->samples_per_frame; - #ifdef DEBUG_PHY LOG_D(PHY,"AbsSubframe %d: diff = %i, rx_offset (final) = %i : clear = %d, max_pos = %d, max_pos_fil = %d, max_val = %d, sync_pos %d\n", subframe, diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 8ff0795871..4fc11d5fc6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -976,62 +976,3 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain return(peak_position); } -int nr_adjust_pss_synch(PHY_VARS_NR_UE *ue) { - - int **rxdata = ue->common_vars.rxdata; - NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - uint8_t Nid2 = GET_NID2(frame_parms->Nid_cell); - int peak_position_ref = ((frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)<<1) + frame_parms->nb_prefix_samples0; - - int maxval=0; - for (int i=0;i<2*(frame_parms->ofdm_symbol_size);i++) { - maxval = max(maxval,primary_synchro_time_nr[Nid2][i]); - maxval = max(maxval,-primary_synchro_time_nr[Nid2][i]); - } - int shift = log2_approx(maxval); - - /* Search pss in the received buffer each 4 samples which ensures a memory alignment on 128 bits (32 bits x 4 ) */ - /* This is required by SIMD (single instruction Multiple Data) Extensions of Intel processors. */ - /* Correlation computation is based on a dot product which is realized thank to SIMS extensions */ - int64_t peak_value = 0; - int peak_position = 0; - int64_t result = 0; - int64_t avg=0; - int start = peak_position_ref - (frame_parms->ofdm_symbol_size>>3); - int length = frame_parms->ofdm_symbol_size + (frame_parms->ofdm_symbol_size>>3); - memset(pss_corr_ue[Nid2],0,(start+length)*sizeof(int64_t)); - for (int n=start; n < start+length; n+=4) { // - for (int ar=0; arnb_antennas_rx; ar++) { - result = dot_product64((short*)primary_synchro_time_nr[Nid2], - (short*) &(rxdata[ar][n]), - frame_parms->ofdm_symbol_size, - shift); - pss_corr_ue[Nid2][n] += abs64(result); - } - avg+=pss_corr_ue[Nid2][n]; - if (pss_corr_ue[Nid2][n] > peak_value) { - peak_value = pss_corr_ue[Nid2][n]; - peak_position = n; - } - } - - avg/=(length/4); - if (peak_value < 5*avg) { - return 0; - } - - int peak_position_diff = peak_position_ref - peak_position; - - ue->rx_offset_diff = 0; - if(peak_position_diff != 0) { - ue->rx_offset_diff = peak_position_diff>>3; - if (ue->rx_offset_diff == 0) { - ue->rx_offset_diff = peak_position_diff > 0 ? 1 : -1; - } - } - - LOG_D(NR_PHY,"nr_adjust_pss_synch: peak_position %d, peak_position_diff %d, peak_value %d dB, avg %d dB\n", - peak_position, peak_position_diff, dB_fixed64(peak_value),dB_fixed64(avg)); - - return peak_position_diff; -} diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 20b6e67aa9..a948dffce8 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1638,12 +1638,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { - nr_adjust_pss_synch(ue); - LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); nr_ue_pbch_procedures(gNB_id, ue, proc, 0); - /* if (ue->no_timing_correction==0) { + if (ue->no_timing_correction==0) { LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction); nr_adjust_synch_ue(fp, ue, @@ -1652,7 +1650,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, nr_slot_rx, 0, 16384); - }*/ + } LOG_D(PHY, "Doing N0 measurements in %s\n", __FUNCTION__); nr_ue_rrc_measurements(ue, proc, nr_slot_rx); From af56207fdf1e7077a42a5da0f0dfaa97944f4aa3 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Sat, 8 Jan 2022 13:19:41 +0000 Subject: [PATCH 262/883] Fix after merge --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 1 + openair2/RRC/LTE/MESSAGES/asn1_msg.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 539d0557a4..023f57d81a 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -35,6 +35,7 @@ #include "PHY/MODULATION/nr_modulation.h" #include "PHY/NR_UE_TRANSPORT/srs_modulation_nr.h" #include "T.h" +#include "executables/nr-softmodem.h" #include "executables/softmodem-common.h" #include "assertions.h" diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b1f2e6d9b3..b069591316 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,7 +4293,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); //measresult_cgi2->cellGlobalId= {0}; //measresult_cgi2->trackingAreaCode= {0}; struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; From 2c289c45d11eb8636ac9349f98c744d0e6c6fe7a Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 10 Jan 2022 12:18:25 +0100 Subject: [PATCH 263/883] Minor fixes after code review --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 16 ++++++++-------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 7e0609f554..24b983aba5 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -42,14 +42,14 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu, NR_TDD_UL_DL_ConfigCommon_t *tdd_config) { - int nrofDownlinkSlots = tdd_config->pattern1.nrofDownlinkSlots; - int nrofDownlinkSymbols = tdd_config->pattern1.nrofDownlinkSymbols; - int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots; - int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols; + const int nrofDownlinkSlots = tdd_config->pattern1.nrofDownlinkSlots; + const int nrofDownlinkSymbols = tdd_config->pattern1.nrofDownlinkSymbols; + const int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots; + const int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols; int slot_number = 0; - int nb_periods_per_frame = get_nb_periods_per_frame(tdd_config->pattern1.dl_UL_TransmissionPeriodicity); - int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<pattern1.dl_UL_TransmissionPeriodicity); + const int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period_in_slots = nb_slots_per_period; if ( (nrofDownlinkSymbols + nrofUplinkSymbols) == 0 ) @@ -105,7 +105,7 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, } } - LOG_I(NR_MAC, "TDD has been properly configurated\n"); + LOG_I(NR_MAC, "TDD has been properly configured\n"); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 75b018c901..28e1fd67c5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -422,7 +422,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, } else{ if(frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); + AssertFatal(frame_type == FDD, "Dynamic TDD not handled yet\n"); } From 1efef96e64d4577538ca0e1a7a7548b81dd5d152 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 10 Jan 2022 14:28:17 +0100 Subject: [PATCH 264/883] Using ASN_STRUCT_FREE instead of free --- openair2/GNB_APP/gnb_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index f97b2061c6..c6eab03ebd 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -348,7 +348,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { lte_frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); if (frame_type == FDD) { - free(scc->tdd_UL_DL_ConfigurationCommon); + ASN_STRUCT_FREE(asn_DEF_NR_TDD_UL_DL_ConfigCommon, scc->tdd_UL_DL_ConfigurationCommon); scc->tdd_UL_DL_ConfigurationCommon = NULL; } else { // TDD if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) { From ef6c93b8425db7b527954cd3fa2fc1c4f7d303fa Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 10 Jan 2022 14:29:21 +0100 Subject: [PATCH 265/883] Updating IF configuration description in RUNMODE file --- doc/RUNMODEM.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 057be0d6cf..7a4dbefa3d 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -179,15 +179,15 @@ With the RF simulator (on the same machine): ## IF setup with OAI -The `if_freq` and `if_freq_off` options can be used to set (via command line) custom downlink and uplink FR1 arbitrary frequencies for the IF equipment both. +OAI is also compatible with Intermediate Frequency (IF) equipment. This allows to use RF front-end that with arbitrary frequencies bands that do not comply with the standardised 3GPP NR bands. -In the same way, the following parameters must be configured in the RUs section of the gNB configuration file: +To configure the IF frequencies it is necessary to use two command-line options at UE side: +- `if_freq`, downlink frequency in Hz +- `if_freq_off`, uplink frequency offset in Hz -`if_freq` - -`if_offset` - -The values must be given in Hz. +Accordingly, the following parameters must be configured in the RUs section of the gNB configuration file: +- `if_freq` +- `if_offset` ### Run OAI with custom DL/UL arbitrary frequencies From 0e0b7a34f79966d46bc614041528fd12de42862a Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Mon, 10 Jan 2022 15:07:12 +0100 Subject: [PATCH 266/883] Restored check on pattern1.ext1 --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 24b983aba5..3b10167e03 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -105,6 +105,13 @@ void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, } } + if (tdd_config->pattern1.ext1 == NULL) { + cfg->tdd_table.tdd_period = tdd_config->pattern1.dl_UL_TransmissionPeriodicity; + } else { + AssertFatal(tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n"); + cfg->tdd_table.tdd_period = *tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530; + } + LOG_I(NR_MAC, "TDD has been properly configured\n"); } From fb7795a0f427bd256883b89dee66b9963bc5354b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 10 Jan 2022 14:20:41 +0000 Subject: [PATCH 267/883] Fix build warning after merge with develop --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b1f2e6d9b3..b069591316 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,7 +4293,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); //measresult_cgi2->cellGlobalId= {0}; //measresult_cgi2->trackingAreaCode= {0}; struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; From 52b05b8fe0860cd47806afb6a9a777b86e52b084 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 10 Jan 2022 16:20:05 +0100 Subject: [PATCH 268/883] review changes --- openair2/GNB_APP/gnb_config.c | 12 ++++++------ openair2/LAYER2/NR_MAC_gNB/config.c | 18 ++++++++---------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 7 +++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 7 +++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 7 +++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 7 +++---- 6 files changed, 26 insertions(+), 32 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index f97b2061c6..50acd69994 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1160,17 +1160,17 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { (NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d", NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l]); } - printf("SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); + LOG_I(RRC,"SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr; - printf("pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); + LOG_I(RRC,"pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; - printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); + LOG_I(RRC,"pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; - printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); + LOG_I(RRC,"minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; - printf("SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); + LOG_I(RRC,"SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); + LOG_I(RRC,"Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 0c397187b5..e9fdcf1647 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -445,13 +445,12 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, RC.nrmac[Mod_idP]->UL_tti_req_ahead[0] = calloc(n, sizeof(nfapi_nr_ul_tti_request_t)); AssertFatal(RC.nrmac[Mod_idP]->UL_tti_req_ahead[0], "could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n"); - /* fill in slot/frame numbers: slot is fixed, frame will be updated by - * scheduler */ - uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); - uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); + /* fill in slot/frame numbers: slot is fixed, frame will be updated by scheduler + extern sf_ahead is initialized in ru_thread but that function is not executed yet here*/ + const uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); + const uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); /* consider that scheduler runs sl_ahead: the first sl_ahead slots are - * already "in the past" and thus we put frame 1 instead of 0! Note that - * extern variable sl_ahead is not initialized yet, so computing it above */ + * already "in the past" and thus we put frame 1 instead of 0!*/ for (int i = 0; i < n; ++i) { nfapi_nr_ul_tti_request_t *req = &RC.nrmac[Mod_idP]->UL_tti_req_ahead[0][i]; req->SFN = i < (sl_ahead-1); @@ -501,10 +500,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0); nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(RC.nrmac[Mod_idP]->common_channels[0].frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD,"Dynamic TDD not handled yet\n"); for (int slot = 0; slot < n; ++slot) { /* FIXME: it seems there is a problem with slot 0/10/slots right after UL: diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 75b018c901..39fd4671cb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -487,10 +487,9 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // go to previous slot if the current scheduled slot is beyond the response window // and if the slot is not among the PDCCH monitored ones (38.213 10.1) - while ((*msg2_frame>frame_limit) || - ((*msg2_frame==frame_limit) && - (*msg2_slot>slot_limit)) || - ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) { + while (*msg2_frame > frame_limit + || (*msg2_frame == frame_limit && *msg2_slot > slot_limit) + || ((*msg2_frame * nr_slots_per_frame[mu] + *msg2_slot - monitoring_offset) % monitoring_slot_period != 0)) { if(!tdd || ((*msg2_slot%tdd_period_slot) > 0)) { if (*msg2_slot==0) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 7a495865d3..f11c1bf899 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -75,10 +75,9 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n"); int target_ss; if (bwp) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 231f505564..8066e79e2f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1200,10 +1200,9 @@ int nr_acknack_scheduling(int mod_id, first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); first_ul_slot_period = tdd->nrofDownlinkSlots; } - else{ - if(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD,"Dynamic TDD not handled yet\n"); NR_sched_pucch_t *csi_pucch; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 61fa42bbd9..3c600e69c9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -74,10 +74,9 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0; nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); } - else{ - if(frame_type == TDD) - AssertFatal(1==0,"Dynamic TDD not handled yet\n"); - } + else + // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration + AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n"); const struct NR_PUCCH_Config__resourceToAddModList *resList = ubwp->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList; // for the moment, just block any symbol that might hold a PUCCH, regardless From d14d36747d92b4c339d9d4ba3980cc4d659e32b8 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 10 Jan 2022 19:08:08 +0000 Subject: [PATCH 269/883] SRS channel interpolation improved for comb_size 2 --- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 46 +++++++++---------- openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c | 13 ++++++ openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h | 6 +++ 3 files changed, 42 insertions(+), 23 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index a168430937..109bfbb812 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1107,7 +1107,6 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, uint16_t noise_real[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length]; uint16_t noise_imag[frame_parms->nb_antennas_rx*nr_srs_info->sc_list_length]; - int16_t prev_ls_estimated[2]; int16_t ls_estimated[2]; for (int ant = 0; ant < frame_parms->nb_antennas_rx; ant++) { @@ -1131,27 +1130,25 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, ls_estimated[1] = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]] = ls_estimated[0] + (((int32_t)ls_estimated[1] << 16) & 0xFFFF0000); - if(sc_idx>0 && nr_srs_info->sc_list[sc_idx] > nr_srs_info->sc_list[sc_idx - 1]) { - ls_estimated[0] = (ls_estimated[0] + prev_ls_estimated[0])>>1; - ls_estimated[1] = (ls_estimated[1] + prev_ls_estimated[1])>>1; - } - prev_ls_estimated[0] = (int16_t)(((int32_t)generated_real*received_real + (int32_t)generated_imag*received_imag)>>nr_srs_info->srs_generated_signal_bits); - prev_ls_estimated[1] = (int16_t)(((int32_t)generated_real*received_imag - (int32_t)generated_imag*received_real)>>nr_srs_info->srs_generated_signal_bits); - // Channel interpolation if(srs_pdu->comb_size == 0) { - if(sc_idx == 0) { - multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); - } else if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { + if(sc_idx == 0) { // First subcarrier case + // filt8_start is {12288,8192,4096,0,0,0,0,0} + multadd_real_vector_complex_scalar(filt8_start, ls_estimated, srs_estimated_channel16, 8); + } else if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { // Start of OFDM symbol case + // filt8_start is {12288,8192,4096,0,0,0,0,0} srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 2]] - 8; - multadd_real_vector_complex_scalar(filt8_l0, ls_estimated, srs_estimated_channel16, 8); - } else if((sc_idx < (nr_srs_info->sc_list_length - 1) && nr_srs_info->sc_list[sc_idx + 1] < nr_srs_info->sc_list[sc_idx]) || (sc_idx == (nr_srs_info->sc_list_length - 1))) { - multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); - srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx] + 1] = srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; - } else if(sc_idx%2 == 1) { - multadd_real_vector_complex_scalar(filt8_m0, ls_estimated, srs_estimated_channel16, 8); - } else if(sc_idx%2 == 0) { - multadd_real_vector_complex_scalar(filt8_mm0, ls_estimated, srs_estimated_channel16, 8); + multadd_real_vector_complex_scalar(filt8_start, ls_estimated, srs_estimated_channel16, 8); + } else if((sc_idx < (nr_srs_info->sc_list_length - 1) && nr_srs_info->sc_list[sc_idx + 1] < nr_srs_info->sc_list[sc_idx]) + || (sc_idx == (nr_srs_info->sc_list_length - 1))) { // End of OFDM symbol or last subcarrier cases + // filt8_end is {4096,8192,12288,16384,0,0,0,0} + multadd_real_vector_complex_scalar(filt8_end, ls_estimated, srs_estimated_channel16, 8); + } else if(sc_idx%2 == 1) { // 1st middle case + // filt8_middle2 is {4096,8192,8192,8192,4096,0,0,0} + multadd_real_vector_complex_scalar(filt8_middle2, ls_estimated, srs_estimated_channel16, 8); + } else if(sc_idx%2 == 0) { // 2nd middle case + // filt8_middle4 is {0,0,4096,8192,8192,8192,4096,0} + multadd_real_vector_complex_scalar(filt8_middle4, ls_estimated, srs_estimated_channel16, 8); srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; } } else { @@ -1173,9 +1170,6 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, } } - noise_real[ant*nr_srs_info->sc_list_length + sc_idx] = abs(prev_ls_estimated[0] - (int16_t)(srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]] & 0xFFFF)); - noise_imag[ant*nr_srs_info->sc_list_length + sc_idx] = abs(prev_ls_estimated[1] - (int16_t)((srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]] >> 16) & 0xFFFF)); - #ifdef SRS_DEBUG uint64_t subcarrier_offset = frame_parms->first_carrier_offset + srs_pdu->bwp_start*12; int subcarrier_log = nr_srs_info->sc_list[sc_idx]-subcarrier_offset; @@ -1193,10 +1187,16 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, subcarrier_log, generated_real, generated_imag, received_real, received_imag, - prev_ls_estimated[0], prev_ls_estimated[1]); + ls_estimated[0], ls_estimated[1]); #endif } + // Compute noise + for(int sc_idx = 0; sc_idx < nr_srs_info->sc_list_length; sc_idx++) { + noise_real[ant*nr_srs_info->sc_list_length + sc_idx] = abs((int16_t)((srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]]-srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]) & 0xFFFF)); + noise_imag[ant*nr_srs_info->sc_list_length + sc_idx] = abs((int16_t)(((srs_ls_estimated_channel[ant][nr_srs_info->sc_list[sc_idx]]-srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]) >> 16) & 0xFFFF)); + } + // Convert to time domain freq2time(gNB->frame_parms.ofdm_symbol_size, (int16_t*) srs_estimated_channel_freq[ant], diff --git a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c index 65ae288252..5152f6eb65 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c +++ b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c @@ -260,3 +260,16 @@ short filt8_avlip5[8] = { short filt8_avlip6[8] = { 13653,15019,16384,16384,16384,16384,16384,16384}; + +// Comb size 2 +short filt8_start[8] = { + 12288,8192,4096,0,0,0,0,0}; + +short filt8_middle2[8] = { + 4096,8192,8192,8192,4096,0,0,0}; + +short filt8_middle4[8] = { + 0,0,4096,8192,8192,8192,4096,0}; + +short filt8_end[8] = { + 4096,8192,12288,16384,0,0,0,0}; \ No newline at end of file diff --git a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h index e28736b51d..6ddc03ecd9 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h +++ b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h @@ -182,4 +182,10 @@ extern short filt8_avlip4[8]; extern short filt8_avlip5[8]; extern short filt8_avlip6[8]; + +/*Comb size 2*/ +extern short filt8_start[8]; +extern short filt8_middle2[8]; +extern short filt8_middle4[8]; +extern short filt8_end[8]; #endif From 6c7b71bbd4474ce35a875cf4484bee5e81ff982b Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Sat, 8 Jan 2022 20:39:14 +0530 Subject: [PATCH 270/883] Removed global variables --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 39 +++++++++---------- openair1/PHY/NR_TRANSPORT/nr_dci.h | 4 +- openair1/PHY/NR_TRANSPORT/nr_dci_tools.c | 4 +- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 5 ++- openair1/PHY/NR_TRANSPORT/nr_pss.c | 4 +- openair1/PHY/NR_TRANSPORT/nr_sss.c | 4 +- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 9 ++--- openair1/PHY/defs_gNB.h | 4 -- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 ++--- 9 files changed, 37 insertions(+), 45 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index f26464fd70..523a86b99d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -66,12 +66,11 @@ void nr_pdcch_scrambling(uint32_t *in, } } -void nr_generate_dci(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { +void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1] __attribute__((aligned(16))); // 3 for the max coreset duration uint16_t cset_start_sc; @@ -84,7 +83,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int n_rb; // compute rb_offset and n_prb based on frequency allocation - nr_fill_cce_list(gNB,0,pdcch_pdu_rel15); + nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; + nr_fill_cce_list(cce_list,0,pdcch_pdu_rel15); get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset); cset_start_sc = frame_parms->first_carrier_offset + (pdcch_pdu_rel15->BWPStart + rb_offset) * NR_NB_SC_PER_RB; @@ -175,7 +175,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int reg_list_order[NR_MAX_PDCCH_AGG_LEVEL] = {}; for (int p = 0; p < NR_MAX_PDCCH_AGG_LEVEL; p++) { for(int p2 = 0; p2 < dci_pdu->AggregationLevel; p2++) { - if(gNB->cce_list[d][p2].reg_list[0].reg_idx == p * NR_NB_REG_PER_CCE) { + if(cce_list[d][p2].reg_list[0].reg_idx == p * NR_NB_REG_PER_CCE) { reg_list_order[reg_list_index] = p2; reg_list_index++; break; @@ -191,7 +191,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) { - k = cset_start_sc + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx; + k = cset_start_sc + cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx; if (k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; @@ -200,9 +200,9 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, // dmrs index depends on reference point for k according to 38.211 7.4.1.3.2 if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG) - dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3; + dmrs_idx = (cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3; else - dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3; + dmrs_idx = (cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3; k_prime = 0; @@ -250,21 +250,20 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, } // for (int d=0;dnumDlDci;d++) } -void nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { +void nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, + nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n"); if (pdcch_pdu) { - nr_generate_dci(gNB,&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); } if (ul_dci_pdu) { - nr_generate_dci(gNB,&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 07baaf2728..d763891f28 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -29,7 +29,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format, nfapi_nr_rnti_type_e rnti_type, uint16_t N_RB); -void nr_generate_dci_top(PHY_VARS_gNB *gNB, +void nr_generate_dci_top( nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, nfapi_nr_dl_tti_pdcch_pdu *ul_pdcch_pdu, uint32_t **gold_pdcch_dmrs, @@ -57,6 +57,6 @@ void nr_fill_ul_dci(PHY_VARS_gNB *gNB, int slot, nfapi_nr_ul_dci_request_pdus_t *pdcch_pdu); -void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *); +void nr_fill_cce_list(nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL], uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15); #endif //__PHY_NR_TRANSPORT_DCI__H diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c index 1675045443..8d5eb4a660 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c @@ -119,7 +119,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint16_t n_shift, uint8_t m) { */ -void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15) { +void nr_fill_cce_list(nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL], uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15) { nr_cce_t* cce; nr_reg_t* reg; @@ -156,7 +156,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r if (pdcch_pdu_rel15->dci_pdu[d].RNTI != 0xFFFF) LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex); for (uint8_t cce_idx=0; cce_idxcce_list[d][cce_idx]; + cce = &cce_list[d][cce_idx]; cce->cce_idx = pdcch_pdu_rel15->dci_pdu[d].CceIndex + cce_idx; LOG_D(PHY, "cce_idx %d\n", cce->cce_idx); diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index a4cec432de..bf5edccb1b 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -219,8 +219,7 @@ void nr_init_pbch_interleaver(uint8_t *interleaver) { *(interleaver+i) = *(nr_pbch_payload_interleaving_pattern+j_ssb++); } -int nr_generate_pbch(NR_gNB_PBCH *pbch, - nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, +int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, uint8_t *interleaver, int32_t *txdataF, int16_t amp, @@ -239,6 +238,8 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, uint64_t a_reversed=0; LOG_D(PHY, "PBCH generation started\n"); ///Payload generation + NR_gNB_PBCH m_pbch; + NR_gNB_PBCH *pbch = &m_pbch; memset((void *)pbch, 0, sizeof(NR_gNB_PBCH)); pbch->pbch_a=0; uint8_t ssb_index = ssb_pdu->ssb_pdu_rel15.SsbBlockIndex; diff --git a/openair1/PHY/NR_TRANSPORT/nr_pss.c b/openair1/PHY/NR_TRANSPORT/nr_pss.c index 535ce99143..44f74f1230 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pss.c @@ -24,8 +24,7 @@ //#define NR_PSS_DEBUG -int nr_generate_pss( int16_t *d_pss, - int32_t *txdataF, +int nr_generate_pss( int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t* config, @@ -33,6 +32,7 @@ int nr_generate_pss( int16_t *d_pss, { int i,k,l,m; int16_t a; + int16_t d_pss[NR_PSS_LENGTH]; int16_t x[NR_PSS_LENGTH]; const int x_initial[7] = {0, 1, 1 , 0, 1, 1, 1}; diff --git a/openair1/PHY/NR_TRANSPORT/nr_sss.c b/openair1/PHY/NR_TRANSPORT/nr_sss.c index de92237f6c..12f89ba36f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sss.c @@ -23,8 +23,7 @@ //#define NR_SSS_DEBUG -int nr_generate_sss( int16_t *d_sss, - int32_t *txdataF, +int nr_generate_sss( int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t* config, @@ -34,6 +33,7 @@ int nr_generate_sss( int16_t *d_sss, int m0, m1; int Nid, Nid1, Nid2; //int16_t a; + int16_t d_sss[NR_SSS_LENGTH]; int16_t x0[NR_SSS_LENGTH], x1[NR_SSS_LENGTH]; const int x0_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; const int x1_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 4fed3a468f..5cc246fd29 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -44,8 +44,7 @@ @param @returns 0 on success */ -int nr_generate_pss(int16_t *d_pss, - int32_t *txdataF, +int nr_generate_pss(int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t *config, @@ -57,8 +56,7 @@ int nr_generate_pss(int16_t *d_pss, @param @returns 0 on success */ -int nr_generate_sss(int16_t *d_sss, - int32_t *txdataF, +int nr_generate_sss(int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t *config, @@ -83,8 +81,7 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, @param @returns 0 on success */ -int nr_generate_pbch(NR_gNB_PBCH *pbch, - nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, +int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, uint8_t *interleaver, int32_t *txdataF, int16_t amp, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index edcac7a91d..e0a67f29e7 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -753,7 +753,6 @@ typedef struct PHY_VARS_gNB_s { // nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu; uint16_t num_pdsch_rnti[80]; NR_gNB_PBCH pbch; - nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; NR_gNB_COMMON common_vars; NR_gNB_PRACH prach_vars; NR_gNB_PUSCH *pusch_vars[NUMBER_OF_NR_ULSCH_MAX]; @@ -776,9 +775,6 @@ typedef struct PHY_VARS_gNB_s { // PUCCH0 Look-up table for cyclic-shifts NR_gNB_PUCCH0_LUT_t pucch0_lut; - /// NR synchronization sequences - int16_t d_pss[NR_PSS_LENGTH]; - int16_t d_sss[NR_SSS_LENGTH]; /// PBCH DMRS sequence uint32_t nr_gold_pbch_dmrs[2][64][NR_PBCH_DMRS_LENGTH_DWORD]; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c86f5bd682..4086a3227c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -91,8 +91,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol); - nr_generate_pss(gNB->d_pss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); - nr_generate_sss(gNB->d_sss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_sss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); if (cfg->carrier_config.num_tx_ant.value <= 4) nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); @@ -114,8 +114,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value; } - nr_generate_pbch(&gNB->pbch, - &ssb_pdu, + nr_generate_pbch(&ssb_pdu, gNB->nr_pbch_interleaver, &txdataF[0][txdataF_offset], AMP, @@ -168,7 +167,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); - nr_generate_dci_top(gNB, + nr_generate_dci_top( num_dl_dci > 0 ? &msgTx->pdcch_pdu : NULL, num_ul_dci > 0 ? &msgTx->ul_pdcch_pdu.pdcch_pdu : NULL, gNB->nr_gold_pdcch_dmrs[slot], From 5a34801a9404dc9f17896488298e2434db9e42ee Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 11 Jan 2022 10:32:48 +0000 Subject: [PATCH 271/883] SRS channel interpolation improved for comb_size 4 --- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 30 +++++++++---------- openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c | 12 +++++++- openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h | 5 ++++ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 109bfbb812..56f8415d3e 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1152,21 +1152,21 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; } } else { - if(sc_idx>0) { - multadd_real_vector_complex_scalar(filt8_dcr0_h, ls_estimated, srs_estimated_channel16, 8); - if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 1]] - 8; - } else { - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; - } - srs_estimated_channel16[0] = 0; - srs_estimated_channel16[1] = 0; - } - multadd_real_vector_complex_scalar(filt8_dcl0_h, ls_estimated, srs_estimated_channel16, 8); - if(sc_idx == (nr_srs_info->sc_list_length - 1)) { - srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx] + 1] = srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; - srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx] + 2] = srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; - srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx] + 3] = srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; + if(sc_idx == 0) { // First subcarrier case + // filt16_start is {12288,8192,8192,8192,4096,0,0,0,0,0,0,0,0,0,0,0} + multadd_real_vector_complex_scalar(filt16_start, ls_estimated, srs_estimated_channel16, 16); + } else if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { // Start of OFDM symbol case + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 1]] - 8; + // filt16_start is {12288,8192,8192,8192,4096,0,0,0,0,0,0,0,0,0,0,0} + multadd_real_vector_complex_scalar(filt16_start, ls_estimated, srs_estimated_channel16, 16); + } else if((sc_idx < (nr_srs_info->sc_list_length - 1) && nr_srs_info->sc_list[sc_idx + 1] < nr_srs_info->sc_list[sc_idx]) + || (sc_idx == (nr_srs_info->sc_list_length - 1))) { // End of OFDM symbol or last subcarrier cases + // filt16_end is {4096,8192,8192,8192,12288,16384,16384,16384,0,0,0,0,0,0,0,0} + multadd_real_vector_complex_scalar(filt16_end, ls_estimated, srs_estimated_channel16, 16); + } else { // Middle case + // filt16_middle4 is {4096,8192,8192,8192,8192,8192,8192,8192,4096,0,0,0,0,0,0,0} + multadd_real_vector_complex_scalar(filt16_middle4, ls_estimated, srs_estimated_channel16, 16); + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx]]; } } diff --git a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c index 5152f6eb65..0c520aabe7 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c +++ b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.c @@ -272,4 +272,14 @@ short filt8_middle4[8] = { 0,0,4096,8192,8192,8192,4096,0}; short filt8_end[8] = { - 4096,8192,12288,16384,0,0,0,0}; \ No newline at end of file + 4096,8192,12288,16384,0,0,0,0}; + +// Comb size 4 +short filt16_start[16] = { + 12288,8192,8192,8192,4096,0,0,0,0,0,0,0,0,0,0,0}; + +short filt16_middle4[16] = { + 4096,8192,8192,8192,8192,8192,8192,8192,4096,0,0,0,0,0,0,0}; + +short filt16_end[16] = { + 4096,8192,8192,8192,12288,16384,16384,16384,0,0,0,0,0,0,0,0}; \ No newline at end of file diff --git a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h index 6ddc03ecd9..72d1318545 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h +++ b/openair1/PHY/NR_UE_ESTIMATION/filt16a_32.h @@ -188,4 +188,9 @@ extern short filt8_start[8]; extern short filt8_middle2[8]; extern short filt8_middle4[8]; extern short filt8_end[8]; + +/*Comb size 4*/ +extern short filt16_start[16]; +extern short filt16_middle4[16]; +extern short filt16_end[16]; #endif From 30ae13a279326f1ad9b04c6ffc4fafbbdc09d982 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 11 Jan 2022 10:44:23 +0000 Subject: [PATCH 272/883] Replace hardcoded 8 by sizeof(uint64_t) related to memory alignment of 8 bytes --- openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 56f8415d3e..9aaba7fb66 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -1137,7 +1137,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, multadd_real_vector_complex_scalar(filt8_start, ls_estimated, srs_estimated_channel16, 8); } else if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { // Start of OFDM symbol case // filt8_start is {12288,8192,4096,0,0,0,0,0} - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 2]] - 8; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 2]] - sizeof(uint64_t); multadd_real_vector_complex_scalar(filt8_start, ls_estimated, srs_estimated_channel16, 8); } else if((sc_idx < (nr_srs_info->sc_list_length - 1) && nr_srs_info->sc_list[sc_idx + 1] < nr_srs_info->sc_list[sc_idx]) || (sc_idx == (nr_srs_info->sc_list_length - 1))) { // End of OFDM symbol or last subcarrier cases @@ -1156,7 +1156,7 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, // filt16_start is {12288,8192,8192,8192,4096,0,0,0,0,0,0,0,0,0,0,0} multadd_real_vector_complex_scalar(filt16_start, ls_estimated, srs_estimated_channel16, 16); } else if(nr_srs_info->sc_list[sc_idx] < nr_srs_info->sc_list[sc_idx - 1]) { // Start of OFDM symbol case - srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 1]] - 8; + srs_estimated_channel16 = (int16_t *)&srs_estimated_channel_freq[ant][nr_srs_info->sc_list[sc_idx + 1]] - sizeof(uint64_t); // filt16_start is {12288,8192,8192,8192,4096,0,0,0,0,0,0,0,0,0,0,0} multadd_real_vector_complex_scalar(filt16_start, ls_estimated, srs_estimated_channel16, 16); } else if((sc_idx < (nr_srs_info->sc_list_length - 1) && nr_srs_info->sc_list[sc_idx + 1] < nr_srs_info->sc_list[sc_idx]) From 391a5eee71c12d4604e30634c60105ee9906bfa6 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Wed, 12 Jan 2022 14:50:33 +0530 Subject: [PATCH 273/883] Removed reuse of txdataF buffer on 2 slot basis --- openair1/PHY/NR_TRANSPORT/nr_csi_rs.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 54 +++++++++++------------ openair1/SCHED_NR/nr_ru_procedures.c | 6 +-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c b/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c index ac0eac8a79..4f5baacc34 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c +++ b/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c @@ -35,7 +35,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS frame_parms=gNB->frame_parms; int32_t **txdataF = gNB->common_vars.txdataF; - int txdataF_offset = (slot%2)*frame_parms.samples_per_slot_wCP; + int txdataF_offset = slot*frame_parms.samples_per_slot_wCP; uint32_t **gold_csi_rs = gNB->nr_gold_csi_rs[slot]; int16_t mod_csi[frame_parms.symbols_per_slot][NR_MAX_CSI_RS_LENGTH>>1] __attribute__((aligned(16)));; uint16_t b = csi_params.freq_domain; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 9bbc61d4b6..2e8813cbd2 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -276,7 +276,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if (start_sc >= frame_parms->ofdm_symbol_size) start_sc -= frame_parms->ofdm_symbol_size; - int txdataF_offset = (slot%2)*frame_parms->samples_per_slot_wCP; + int txdataF_offset = slot*frame_parms->samples_per_slot_wCP; #ifdef DEBUG_DLSCH_MAPPING printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", @@ -375,12 +375,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /* Map DMRS Symbol */ if ( (dmrs_symbol_map & (1 << l)) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); #endif dmrs_idx++; k_prime++; @@ -388,8 +388,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, n+=(k_prime)?0:1; } else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], @@ -399,19 +399,19 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } /* Map DATA Symbol */ else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (amp * tx_layers[ap][m<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); #endif m++; } /* mute RE */ else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; } if (++k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; @@ -427,7 +427,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } // fix the alignment issues later, use 64-bit SIMD below instead of 128. if (0/*(frame_parms->N_RB_DL&1)==0*/) { - __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; __m128i amp128=_mm_set1_epi16(amp); @@ -436,7 +436,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } //RE loop, first part m+=upper_limit; if (remaining_re > 0) { - txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)]; txl = (__m128i*)&tx_layers[ap][m<<1]; for (int i=0; i<(remaining_re>>2); i++) { txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); @@ -444,7 +444,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } } else { - __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m64 *txl = (__m64*)&tx_layers[ap][m<<1]; __m64 amp64=_mm_set1_pi16(amp); @@ -454,31 +454,31 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, #ifdef DEBUG_DLSCH_MAPPING if ((i&1) > 0) printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]); + m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1]); #endif /* handle this, mute RE */ /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; }*/ } //RE loop, first part m+=upper_limit; if (remaining_re > 0) { - txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)]; txl = (__m64*)&tx_layers[ap][m<<1]; for (int i=0; i<(remaining_re>>1); i++) { txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); #ifdef DEBUG_DLSCH_MAPPING if ((i&1) > 0) printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]); + m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) ], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1]); #endif /* handle this, mute RE */ /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; }*/ } //RE loop, second part } // @@ -515,7 +515,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if (pmi == 0) {//unitary Precoding if(apnrOfLayers) memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], - (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + txdataF_offset+ k)], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], NR_NB_SC_PER_RB*sizeof(int32_t)); else memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], @@ -556,7 +556,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } for (int i=0; iofdm_symbol_size + k; - int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset+txdataF_offset); + int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset); ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0]; ((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1]; #ifdef DEBUG_DLSCH_MAPPING diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 3f4c2f71fb..4d3174007a 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -155,7 +155,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { int aa = 0;//physical antenna number int ret = 0; int ofdm_mask_full = (1<<(ru->nb_tx*2))-1; - int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP); + int txdataF_offset = (tti_tx*fp->samples_per_slot_wCP); if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT) return; for (aa=0; aanb_tx; aa++) memset(ru->common.txdataF[aa],0,fp->samples_per_slot_wCP*sizeof(int32_t)); @@ -300,7 +300,7 @@ static void *nr_feptx_thread(void *param) { ofdm_mask_full = (1<<(ru->nb_tx*2))-1; if(ru->num_gNB != 0){ - txdataF_offset = ((slot%2)*fp->samples_per_slot_wCP); + txdataF_offset = (slot*fp->samples_per_slot_wCP); ////////////precoding//////////// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 1); @@ -464,7 +464,7 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) { int32_t ***bw; int i=0; int slot_tx = tti_tx; - int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP); + int txdataF_offset = (tti_tx*fp->samples_per_slot_wCP); start_meas(&ru->precoding_stats); AssertFatal(ru->nb_log_antennas > 0,"ru->nb_log_antennas is 0!\n"); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 4086a3227c..4a916593c3 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -74,7 +74,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ int **txdataF = gNB->common_vars.txdataF; uint8_t ssb_index, n_hf; uint16_t ssb_start_symbol; - int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + int txdataF_offset = slot*fp->samples_per_slot_wCP; uint16_t slots_per_hf = (fp->slots_per_frame)>>1; if (slotframe_parms; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; int offset = gNB->CC_id; - int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + int txdataF_offset = slot*fp->samples_per_slot_wCP; if ((cfg->cell_config.frame_duplex_type.value == TDD) && (nr_slot_select(cfg,frame,slot) == NR_UPLINK_SLOT)) return; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 6dc8dcfa4a..1d134a50d2 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1102,7 +1102,7 @@ int main(int argc, char **argv) else phy_procedures_gNB_TX(msgDataTx,frame,slot,1); - int txdataF_offset = (slot%2) * frame_parms->samples_per_slot_wCP; + int txdataF_offset = slot * frame_parms->samples_per_slot_wCP; if (n_trials==1) { LOG_M("txsigF0.m","txsF0=", &gNB->common_vars.txdataF[0][txdataF_offset+2*frame_parms->ofdm_symbol_size],frame_parms->ofdm_symbol_size,1,1); From fa216870f3b4203df806cd894f8ad616010b403d Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 12 Jan 2022 13:34:54 +0000 Subject: [PATCH 274/883] Update documentation with SRS --- doc/FEATURE_SET.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index 2fc7115193..eaa691d6ef 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -294,6 +294,10 @@ The following features are valid for the gNB and the 5G-NR UE. * NR-PUCCH - Format 0 (2 bits, for ACK/NACK and SR) - Format 2 (up to 11 bits, mainly for CSI feedback) +* NR-SRS + - SRS signal reception + - Channel estimation (with T tracer real time monitoring) + - Power noise estimation * NR-PRACH - Formats 0,1,2,3, A1-A3, B1-B3 * Highly efficient 3GPP compliant LDPC encoder and decoder (BG1 and BG2 are supported) @@ -322,6 +326,8 @@ The following features are valid for the gNB and the 5G-NR UE. - phy-test scheduler (fixed allocation) - regular scheduler with dynamic allocation - HARQ procedures for uplink +- Scheduler procedures for SRS reception + - Periodic SRS reception - MAC procedures to handle CSI measurement report - evalution of RSRP report - evaluation of CQI report @@ -433,11 +439,12 @@ The following features are valid for the gNB and the 5G-NR UE. - Format 0 (2 bits for ACK/NACK and SR) - Format 2 (up to 64 bits, mainly for CSI feedback) - Format 1, 3 and 4 present but old code never dested (need restructuring before verification) -* NR-PRACH +* NR-SRS + - Generation of sequence at PHY + - SRS signal transmission +* NR-PRACH - Formats 0,1,2,3, A1-A3, B1-B3 -* NR-SRS - - Old code never dested (need restructuring before verification) -* SS-RSRP +* SS-RSRP - RSRP measured on synchronization SSB (ok only for single SSB) * Highly efficient 3GPP compliant LDPC encoder and decoder (BG1 and BG2 are supported) * Highly efficient 3GPP compliant polar encoder and decoder @@ -452,21 +459,21 @@ The following features are valid for the gNB and the 5G-NR UE. ## NR UE Higher Layers ## **UE MAC** -* Minimum system information (MSI) +* Minimum system information (MSI) - MIB processing - Scheduling of system information block 1 (SIB1) reception -* Random access procedure (needs improvement, there is still not a clear separation between MAC and PHY) +* Random access procedure (needs improvement, there is still not a clear separation between MAC and PHY) - Mapping SSBs to multiple ROs - Scheduling of PRACH - Processing of RAR - Transmission and re-transmission of Msg3 - Msg4 and contention resolution -* DCI processing +* DCI processing - format 10 (RA-RNTI, C-RNTI, SI-RNTI, TC-RNTI) - format 00 (C-RNTI, TC-RNTI) - format 11 (C-RNTI) - format 01 (C-RNTI) -* UCI processing +* UCI processing - ACK/NACK processing - Triggering periodic SR - CSI measurement reporting (SSB RSRP only) @@ -475,6 +482,8 @@ The following features are valid for the gNB and the 5G-NR UE. - HARQ procedures * ULSCH scheduler - Configuration of fapi PDU according to DCI +* Scheduler procedures for SRS transmission + - Periodic SRS transmission **UE RLC** From 1c3310f955901b3a203da791e743cfc78380b106 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 12 Jan 2022 13:52:00 +0000 Subject: [PATCH 275/883] Activate SRS in some CI tests --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 1 + ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 16456f939c..394d5d8a0d 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -41,6 +41,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; ul_prbblacklist = "51,52,53,54" + do_SRS = 1; pdcch_ConfigSIB1 = ( { diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 70892930c9..804cd96a27 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -44,6 +44,7 @@ gNBs = #pucch_TargetSNRx10 = 200; ul_prbblacklist = "51,52,53,54" min_rxtxtime = 6; + do_SRS = 1; pdcch_ConfigSIB1 = ( { From d318f09142a6081020e3e36c6691e3cb49dc29d4 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 13 Jan 2022 09:37:53 +0000 Subject: [PATCH 276/883] Fix L1s indentation in config files --- ci-scripts/conf_files/benetel-5g.conf | 4 ++-- ...sci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 14 +++++------ ...oxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 14 +++++------ ci-scripts/conf_files/gNB_SA_DU.conf | 16 ++++++------- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 4 ++-- ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 12 +++++----- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 12 +++++----- ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 12 +++++----- .../gnb.band78.tm1.106PRB.usrpn300.conf | 4 ++-- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 4 ++-- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 4 ++-- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 4 ++-- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 4 ++-- .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 4 ++-- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 4 ++-- .../CONF/oaiL1.nfapi.usrpx300.conf | 24 +++++++++---------- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 4 ++-- .../CONF/testing_gnb_24PRB.conf | 4 ++-- .../CONF/testing_gnb_nsa_n310.conf | 4 ++-- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 4 ++-- ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 4 ++-- 21 files changed, 80 insertions(+), 80 deletions(-) diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 73b1da8c50..dc86567c1f 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -216,8 +216,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 01add06e3a..234050a8a5 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -241,13 +241,13 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index ab0cf5f469..2f8c621526 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -242,13 +242,13 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index b03758a006..adcbcd45d0 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -227,14 +227,14 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - pusch_proc_threads = 8; - prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; - ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b891af747a..adb79ceb8d 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; prach_dtx_threshold = 120; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index cfcdcd44dc..e718112199 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -231,12 +231,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 4c3d25b33d..11931d1700 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -236,12 +236,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 4c3d25b33d..11931d1700 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -236,12 +236,12 @@ MACRLCs = ( ); L1s = ( - { - num_cc = 1; - tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; - } +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} ); RUs = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 7efdf159eb..9cc8f554e8 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -195,8 +195,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index b90acb8e97..575fddda2b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -217,8 +217,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index 51c9076fe7..813a0e58e3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index f536fd4d47..af26091260 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -193,8 +193,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 375bb5f54c..928c70113f 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -193,8 +193,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index 07939f4d95..5c0434b57e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -193,8 +193,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6b5baef5ce..4b1476a76d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -193,8 +193,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 97f20c1461..0b384958ae 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -18,18 +18,18 @@ log_config = { L1s = ( - { - num_cc = 1; - tr_n_preference = "nfapi"; - local_n_if_name = "lo"; - remote_n_address = "127.0.0.2"; // vnf addr - local_n_address = "127.0.0.1"; // pnf addr - local_n_portc = 50000; // pnf p5 port [!] - remote_n_portc = 50001; // vnf p5 port - local_n_portd = 50010; // pnf p7 port - remote_n_portd = 50011; // vnf p7 port - thread_pool_size = 8; - } +{ + num_cc = 1; + tr_n_preference = "nfapi"; + local_n_if_name = "lo"; + remote_n_address = "127.0.0.2"; // vnf addr + local_n_address = "127.0.0.1"; // pnf addr + local_n_portc = 50000; // pnf p5 port [!] + remote_n_portc = 50001; // vnf p5 port + local_n_portd = 50010; // pnf p7 port + remote_n_portd = 50011; // vnf p7 port + thread_pool_size = 8; +} ); RUs = ( diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 5aade8ab21..5591ed082d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index fd4a722fc7..dd8113e059 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -212,8 +212,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2ecd4b1426..96335f23ca 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index db4bf5e167..1de2a1bd4f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -211,8 +211,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 2; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index 564b284f06..c8a0bace37 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -226,8 +226,8 @@ MACRLCs = ( L1s = ( { - num_cc = 1; - tr_n_preference = "local_mac"; + num_cc = 1; + tr_n_preference = "local_mac"; thread_pool_size = 8; } ); From 24ebf98ebfa731f69f282a1e8f6acea6b7e72f34 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 13 Jan 2022 09:55:11 +0000 Subject: [PATCH 277/883] Add descriptive help string for CONFIG_STRING_L1_THREAD_POOL_SIZE --- openair2/GNB_APP/L1_nr_paramdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/GNB_APP/L1_nr_paramdef.h b/openair2/GNB_APP/L1_nr_paramdef.h index ccff1ca995..90cd9aae29 100644 --- a/openair2/GNB_APP/L1_nr_paramdef.h +++ b/openair2/GNB_APP/L1_nr_paramdef.h @@ -65,7 +65,7 @@ {CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \ -{CONFIG_STRING_L1_THREAD_POOL_SIZE, NULL, 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ +{CONFIG_STRING_L1_THREAD_POOL_SIZE, "Maximum number of CPU cores for L1 processing (either max HW CPU cores or this value is used)", 0, uptr:NULL, defintval:4, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_OFDM_OFFSET_DIVISOR, NULL, 0, uptr:NULL, defuintval:8, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PUCCH0_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:100, TYPE_UINT, 0}, \ {CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, uptr:NULL, defintval:150, TYPE_UINT, 0}, \ From eb56a40d1193fb87381246831fef13abef8ef0f6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 13 Jan 2022 17:43:53 +0100 Subject: [PATCH 278/883] bugfix in msg2 frame and slot re-selection --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 1d93e8ea8d..43e5c944bc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -405,7 +405,6 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, // preferentially we schedule the msg2 in the mixed slot or in the last dl slot // if they are allowed by search space configuration - uint8_t mu = *scc->ssbSubcarrierSpacing; uint8_t response_window = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow; uint8_t slot_window; @@ -491,10 +490,16 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, || (*msg2_frame == frame_limit && *msg2_slot > slot_limit) || ((*msg2_frame * nr_slots_per_frame[mu] + *msg2_slot - monitoring_offset) % monitoring_slot_period != 0)) { - if(!tdd || ((*msg2_slot%tdd_period_slot) > 0)) { - if (*msg2_slot==0) - (*msg2_frame)--; - (*msg2_slot)--; + if((frame_type == FDD) || ((*msg2_slot%tdd_period_slot) > 0)) { + if (*msg2_slot==0) { + if(*msg2_frame != 0) + (*msg2_frame)--; + else + *msg2_frame = 1023; + *msg2_slot = nr_slots_per_frame[mu] - 1; + } + else + (*msg2_slot)--; } else AssertFatal(1==0,"No available DL slot to schedule msg2 has been found"); From 26ce5a7236e90ff5af9d455e1ca6c3496593c0c2 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Sat, 13 Nov 2021 15:49:12 +0100 Subject: [PATCH 279/883] NR_UE: fix PDSCH HARQ round calculation --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 1 - openair1/SCHED_NR_UE/harq_nr.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index b8cd59eead..0eb5addbf0 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -271,7 +271,6 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool //LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n", // phy_vars_ue->Mod_id, frame, nr_slot_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round); harq_process->ack = 0; - harq_process->round++; if (harq_process->round >= dlsch->Mlimit) { harq_process->status = SCH_IDLE; harq_process->round = 0; diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c index 5b65131934..4d92509d48 100644 --- a/openair1/SCHED_NR_UE/harq_nr.c +++ b/openair1/SCHED_NR_UE/harq_nr.c @@ -349,7 +349,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int dl_harq->DCINdi = ndi; break; case 1: - dl_harq->round = 2; + dl_harq->round = 3; dl_harq->status = ACTIVE; dl_harq->first_rx = 0; if (dl_harq->DCINdi != ndi) { @@ -373,7 +373,7 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int dl_harq->status = SCH_IDLE; break; case 3: - dl_harq->round = 3; + dl_harq->round = 2; dl_harq->status = ACTIVE; dl_harq->first_rx = 0; if (dl_harq->DCINdi != ndi) { From 9e2b05a0aad3fa6238a2f0f4eaa5df0a6de417cd Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Sat, 13 Nov 2021 15:50:31 +0100 Subject: [PATCH 280/883] gNB: fix PUSCH HARQ round calculation --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 5286fe8780..d5c13777ec 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -463,7 +463,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,1); harq_process->TBS = pusch_pdu->pusch_data.tb_size; - harq_process->round = nr_rv_round_map[pusch_pdu->pusch_data.rv_index]; + for (int round = 0; round < 4; round++) { + if (nr_rv_round_map[round] == pusch_pdu->pusch_data.rv_index) { + harq_process->round = round; + break; + } + } harq_process->new_rx = false; // flag to indicate if this is a new reception for this harq (initialized to false) if (harq_process->round == 0) { From ca5512594b75d82b11bd564c46d759b1557fdc04 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 18 Jan 2022 18:55:23 +0100 Subject: [PATCH 281/883] refactor open-coded conversion of rv_index to HARQ round into new function nr_rv_to_round() --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 7 +------ openair1/PHY/defs_nr_common.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index d5c13777ec..33071e4070 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -463,12 +463,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,1); harq_process->TBS = pusch_pdu->pusch_data.tb_size; - for (int round = 0; round < 4; round++) { - if (nr_rv_round_map[round] == pusch_pdu->pusch_data.rv_index) { - harq_process->round = round; - break; - } - } + harq_process->round = nr_rv_to_round(pusch_pdu->pusch_data.rv_index); harq_process->new_rx = false; // flag to indicate if this is a new reception for this harq (initialized to false) if (harq_process->round == 0) { diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index c385d323e3..d487616f91 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -115,6 +115,16 @@ extern const uint8_t nr_rv_round_map[4]; extern const uint8_t nr_rv_round_map_ue[4]; +static inline +uint8_t nr_rv_to_round(uint8_t rv) +{ + for (uint8_t round = 0; round < 4; round++) { + if (nr_rv_round_map[round] == rv) + return round; + } + return 0; +} + typedef enum { NR_MU_0=0, NR_MU_1, From 7ef0da0143802128ad1f448c2604128faaeb566b Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 18 Jan 2022 18:58:58 +0100 Subject: [PATCH 282/883] remove unused array nr_rv_round_map_ue --- openair1/PHY/defs_nr_common.h | 1 - openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 -- openair1/SIMULATION/NR_PHY/dlschsim.c | 1 - openair1/SIMULATION/NR_PHY/pbchsim.c | 1 - openair1/SIMULATION/NR_PHY/pucchsim.c | 1 - openair1/SIMULATION/NR_PHY/ulschsim.c | 1 - 6 files changed, 7 deletions(-) diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index d487616f91..979b98e536 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -113,7 +113,6 @@ #define NR_NB_TH_SLOT 2 extern const uint8_t nr_rv_round_map[4]; -extern const uint8_t nr_rv_round_map_ue[4]; static inline uint8_t nr_rv_to_round(uint8_t rv) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index e403c7410b..1cfcaab4ec 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -78,8 +78,6 @@ fifo_dump_emos_UE emos_dump_UE; char nr_mode_string[NUM_UE_MODE][20] = {"NOT SYNCHED","PRACH","RAR","RA_WAIT_CR", "PUSCH", "RESYNCH"}; -const uint8_t nr_rv_round_map_ue[4] = {0, 2, 1, 3}; - #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; #endif diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index ff07422c6b..959fbf67e9 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -60,7 +60,6 @@ double cpuf; uint16_t NB_UE_INST = 1; uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; -uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; // needed for some functions PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } }; diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 2413a86912..ca2e1f4c57 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -64,7 +64,6 @@ uint16_t NB_UE_INST = 1; openair0_config_t openair0_cfg[MAX_CARDS]; uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; -uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; uint64_t get_softmodem_optmask(void) {return 0;} softmodem_params_t *get_softmodem_params(void) {return 0;} diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 213924e5fd..f4d9b3f9f5 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -57,7 +57,6 @@ double cpuf; //uint8_t nfapi_mode = 0; uint16_t NB_UE_INST = 1; uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; -uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; // needed for some functions PHY_VARS_NR_UE * PHY_vars_UE_g[1][1]={{NULL}}; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 94aea36a67..556f787d70 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -57,7 +57,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; -uint8_t const nr_rv_round_map_ue[4] = {0, 2, 1, 3}; double cpuf; //uint8_t nfapi_mode = 0; From 38d5b38910832f5ee5938c8c2c852816d2de8f17 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 18 Jan 2022 18:02:07 +0000 Subject: [PATCH 283/883] Revert ulsch scheduler min_rb to 5 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index af756844e4..c3a5d0b957 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1081,7 +1081,7 @@ void pf_ul(module_id_t module_id, gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; NR_UE_info_t *UE_info = &nrmac->UE_info; - const int min_rb = 40; + const int min_rb = 5; float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled int ue_array[MAX_MOBILES_PER_GNB]; From eb14a6a45f7ba7d9c2adfb216734f2ed922dfbd9 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 19 Jan 2022 14:43:01 +0100 Subject: [PATCH 284/883] consistently make nr_rv_round_map[4] = {0, 2, 3, 1} --- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 2 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 959fbf67e9..ee1eca1e06 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -59,7 +59,7 @@ double cpuf; //uint8_t nfapi_mode = 0; uint16_t NB_UE_INST = 1; -uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; // needed for some functions PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } }; diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index ca2e1f4c57..8baaf62416 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -63,7 +63,7 @@ uint16_t NB_UE_INST = 1; // needed for some functions openair0_config_t openair0_cfg[MAX_CARDS]; -uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; uint64_t get_softmodem_optmask(void) {return 0;} softmodem_params_t *get_softmodem_params(void) {return 0;} diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index f4d9b3f9f5..d07469a4b7 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -56,7 +56,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; double cpuf; //uint8_t nfapi_mode = 0; uint16_t NB_UE_INST = 1; -uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; // needed for some functions PHY_VARS_NR_UE * PHY_vars_UE_g[1][1]={{NULL}}; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 556f787d70..931a63a77e 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -56,7 +56,7 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} -uint8_t const nr_rv_round_map[4] = {0, 2, 1, 3}; +uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1}; double cpuf; //uint8_t nfapi_mode = 0; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index db8d54f86d..74f6256353 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -243,7 +243,6 @@ nrUE_params_t *get_nrUE_params(void) { // needed for some functions uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; -//const uint8_t nr_rv_round_map[4] = {0, 2, 1, 3}; channel_desc_t *UE2gNB[NUMBER_OF_UE_MAX][NUMBER_OF_gNB_MAX]; From df98bdb372093712356ead399066b9dbbbd6a866 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 19 Jan 2022 15:17:26 +0100 Subject: [PATCH 285/883] move nr_rv_round_map from gNB_scheduler_phytest.c to gNB_scheduler.c --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ae52f8cc60..f24d6e686b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -55,6 +55,7 @@ #include #include +const uint8_t nr_rv_round_map[4] = { 0, 2, 3, 1 }; uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 }; uint8_t vnf_first_sched_entry = 1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c0107c5fc6..9ec126d429 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -53,7 +53,6 @@ //#define UL_HARQ_PRINT extern RAN_CONTEXT_t RC; -const uint8_t nr_rv_round_map[4] = {0, 2, 3, 1}; //#define ENABLE_MAC_PAYLOAD_DEBUG 1 //uint8_t mac_pdu[MAX_NR_DLSCH_PAYLOAD_BYTES]; From 86096894a0f2943b8fc0d3dbdb7494f16cf92a29 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 20 Jan 2022 11:53:17 +0000 Subject: [PATCH 286/883] Fix build warning after merge with develop --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b1f2e6d9b3..b069591316 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,7 +4293,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); //measresult_cgi2->cellGlobalId= {0}; //measresult_cgi2->trackingAreaCode= {0}; struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; From a8a5897a986ae5de561e85521c68e8718317fc2b Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 20 Jan 2022 21:08:44 +0530 Subject: [PATCH 287/883] Cherry pick ldpc-decoder-crc-check commit: 3cfefe3c6f7b2854a14d94fb7072ece2ff4c5c0a --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 9 +- .../PHY/CODING/nrLDPC_decoder/nrLDPC_bnProc.h | 13 +- .../PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h | 20 +- .../CODING/nrLDPC_decoder/nrLDPC_decoder.c | 201 ++++-------------- .../PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h | 32 +-- .../nrLDPC_tools/nrLDPC_debug.h | 14 +- openair1/PHY/CODING/nrLDPC_defs.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 73 +++++-- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 9 - .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 2 - openair1/PHY/defs_gNB.h | 2 - 11 files changed, 121 insertions(+), 256 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 371deba3f2..3ae15293cb 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -139,8 +139,6 @@ int test_ldpc(short No_iteration, //double code_rate_actual_vec[8] = {0.2, 0.33333, 0.4, 0.5, 0.66667, 0.73333, 0.81481, 0.88}; t_nrLDPC_dec_params decParams; - t_nrLDPC_procBuf nrLDPC_procBuf; - t_nrLDPC_procBuf* p_nrLDPC_procBuf = &nrLDPC_procBuf; t_nrLDPC_time_stats decoder_profiler = {0}; t_nrLDPC_time_stats* p_decoder_profiler =&decoder_profiler ; @@ -194,9 +192,6 @@ int test_ldpc(short No_iteration, reset_meas(&decoder_profiler.llr2bit); //reset_meas(&decoder_profiler.total); - // Allocate LDPC decoder buffers - p_nrLDPC_procBuf = nrLDPC_init_mem(); - for (j=0;jnumBnInBnGroups; const uint32_t* lut_startAddrBnGroups = p_lut->startAddrBnGroups; const uint16_t* lut_startAddrBnGroupsLlr = p_lut->startAddrBnGroupsLlr; - int8_t* bnProcBuf = p_procBuf->bnProcBuf; - int8_t* bnProcBufRes = p_procBuf->bnProcBufRes; - int8_t* llrRes = p_procBuf->llrRes; - int8_t* llrProcBuf = p_procBuf->llrProcBuf; - __m128i* p_bnProcBuf; __m256i* p_bnProcBufRes; __m128i* p_llrProcBuf; @@ -1681,7 +1676,7 @@ static inline void nrLDPC_bnProcPc(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_proc \param p_lut Pointer to decoder LUTs \param Z Lifting size */ -static inline void nrLDPC_bnProc(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_bnProc(t_nrLDPC_lut* p_lut, int8_t* bnProcBuf, int8_t* bnProcBufRes, int8_t* llrRes, uint16_t Z) { // BN Processing calculating the values to send back to the CNs for next iteration // bnProcBufRes contains the sum of all edges to each BN at the start of each group @@ -1690,10 +1685,6 @@ static inline void nrLDPC_bnProc(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBu const uint32_t* lut_startAddrBnGroups = p_lut->startAddrBnGroups; const uint16_t* lut_startAddrBnGroupsLlr = p_lut->startAddrBnGroupsLlr; - int8_t* bnProcBuf = p_procBuf->bnProcBuf; - int8_t* bnProcBufRes = p_procBuf->bnProcBufRes; - int8_t* llrRes = p_procBuf->llrRes; - __m256i* p_bnProcBuf; __m256i* p_bnProcBufRes; __m256i* p_llrRes; diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h index db9d6e4119..6d82fe5f11 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h @@ -37,14 +37,11 @@ \param p_procBuf Pointer to processing buffers \param Z Lifting size */ -static inline void nrLDPC_cnProc_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_cnProc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) { const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; - int8_t* cnProcBuf = p_procBuf->cnProcBuf; - int8_t* cnProcBufRes = p_procBuf->cnProcBufRes; - __m256i* p_cnProcBuf; __m256i* p_cnProcBufRes; @@ -372,14 +369,11 @@ static inline void nrLDPC_cnProc_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_pr \param p_lut Pointer to decoder LUTs \param Z Lifting size */ -static inline void nrLDPC_cnProc_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_cnProc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) { const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; - int8_t* cnProcBuf = p_procBuf->cnProcBuf; - int8_t* cnProcBufRes = p_procBuf->cnProcBufRes; - __m256i* p_cnProcBuf; __m256i* p_cnProcBufRes; @@ -871,14 +865,11 @@ static inline void nrLDPC_cnProc_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_pr \param Z Lifting size \return 32-bit parity check indicator */ -static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) { const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; - int8_t* cnProcBuf = p_procBuf->cnProcBuf; - int8_t* cnProcBufRes = p_procBuf->cnProcBufRes; - __m256i* p_cnProcBuf; __m256i* p_cnProcBufRes; @@ -1506,14 +1497,11 @@ static inline uint32_t nrLDPC_cnProcPc_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf \param Z Lifting size \return 32-bit parity check indicator */ -static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline uint32_t nrLDPC_cnProcPc_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBuf, int8_t* cnProcBufRes, uint16_t Z) { const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; - int8_t* cnProcBuf = p_procBuf->cnProcBuf; - int8_t* cnProcBufRes = p_procBuf->cnProcBufRes; - __m256i* p_cnProcBuf; __m256i* p_cnProcBufRes; diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c index 166cd9a5a3..bf0f401e97 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c @@ -45,22 +45,22 @@ #include "nrLDPC_tools/nrLDPC_debug.h" #endif -static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDPC_procBuf* p_procBuf, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_time_stats* p_profiler); +static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_time_stats* p_profiler); +int check_crc(uint8_t* decoded_bytes, uint32_t n, uint32_t F, uint8_t crc_type); void nrLDPC_initcall(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out) { } -int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out, t_nrLDPC_procBuf* p_procBuf, t_nrLDPC_time_stats* p_profiler) +int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out, t_nrLDPC_time_stats* p_profiler) { uint32_t numLLR; uint32_t numIter = 0; t_nrLDPC_lut lut; t_nrLDPC_lut* p_lut = &lut; - //printf("p_procBuf->cnProcBuf = %p\n", p_procBuf->cnProcBuf); // Initialize decoder core(s) with correct LUTs numLLR = nrLDPC_init(p_decParams, p_lut); // Launch LDPC decoder core for one segment - numIter = nrLDPC_decoder_core(p_llr, p_out, p_procBuf, numLLR, p_lut, p_decParams, p_profiler); + numIter = nrLDPC_decoder_core(p_llr, p_out, numLLR, p_lut, p_decParams, p_profiler); return numIter; } @@ -74,13 +74,20 @@ int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_ \param p_decParams LDPC decoder parameters \param p_profiler LDPC profiler statistics */ -static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDPC_procBuf* p_procBuf, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_time_stats* p_profiler) +static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_time_stats* p_profiler) { uint16_t Z = p_decParams->Z; uint8_t BG = p_decParams->BG; uint8_t numMaxIter = p_decParams->numMaxIter; e_nrLDPC_outMode outMode = p_decParams->outMode; + int8_t cnProcBuf[NR_LDPC_SIZE_CN_PROC_BUF] __attribute__ ((aligned(32))) = {0}; + int8_t cnProcBufRes[NR_LDPC_SIZE_CN_PROC_BUF] __attribute__ ((aligned(32))) = {0}; + int8_t bnProcBuf[NR_LDPC_SIZE_BN_PROC_BUF] __attribute__ ((aligned(32))) = {0}; + int8_t bnProcBufRes[NR_LDPC_SIZE_BN_PROC_BUF] __attribute__ ((aligned(32))) = {0}; + int8_t llrRes[NR_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32))) = {0}; + int8_t llrProcBuf[NR_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32))) = {0}; + int8_t llrOut[NR_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32))) = {0}; // Minimum number of iterations is 1 // 0 iterations means hard-decision on input LLRs uint32_t i = 1; @@ -95,9 +102,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP else { // Use LLR processing buffer as temporary output buffer - p_llrOut = p_procBuf->llrProcBuf; - // Clear llrProcBuf - memset(p_llrOut,0, NR_LDPC_MAX_NUM_LLR*sizeof(int8_t)); + p_llrOut = llrOut; } @@ -105,14 +110,14 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #ifdef NR_LDPC_PROFILER_DETAIL start_meas(&p_profiler->llr2llrProcBuf); #endif - nrLDPC_llr2llrProcBuf(p_lut, p_llr, p_procBuf, Z, BG); + nrLDPC_llr2llrProcBuf(p_lut, p_llr, llrProcBuf, Z, BG); #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->llr2llrProcBuf); #endif #ifdef NR_LDPC_DEBUG_MODE nrLDPC_debug_initBuffer2File(nrLDPC_buffers_LLR_PROC); - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_LLR_PROC, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_LLR_PROC, llrProcBuf); #endif #ifdef NR_LDPC_PROFILER_DETAIL @@ -120,11 +125,11 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #endif if (BG == 1) { - nrLDPC_llr2CnProcBuf_BG1(p_lut, p_llr, p_procBuf, Z); + nrLDPC_llr2CnProcBuf_BG1(p_lut, p_llr, cnProcBuf, Z); } else { - nrLDPC_llr2CnProcBuf_BG2(p_lut, p_llr, p_procBuf, Z); + nrLDPC_llr2CnProcBuf_BG2(p_lut, p_llr, cnProcBuf, Z); } #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->llr2CnProcBuf); @@ -132,7 +137,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #ifdef NR_LDPC_DEBUG_MODE nrLDPC_debug_initBuffer2File(nrLDPC_buffers_CN_PROC); - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC, cnProcBuf); #endif // First iteration @@ -143,11 +148,11 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #endif if (BG == 1) { - nrLDPC_cnProc_BG1(p_lut, p_procBuf, Z); + nrLDPC_cnProc_BG1(p_lut, cnProcBuf, cnProcBufRes, Z); } else { - nrLDPC_cnProc_BG2(p_lut, p_procBuf, Z); + nrLDPC_cnProc_BG2(p_lut, cnProcBuf, cnProcBufRes, Z); } #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->cnProc); @@ -155,7 +160,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #ifdef NR_LDPC_DEBUG_MODE nrLDPC_debug_initBuffer2File(nrLDPC_buffers_CN_PROC_RES); - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC_RES, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC_RES, cnProcBufRes); #endif #ifdef NR_LDPC_PROFILER_DETAIL @@ -163,11 +168,11 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #endif if (BG == 1) { - nrLDPC_cn2bnProcBuf_BG1(p_lut, p_procBuf, Z); + nrLDPC_cn2bnProcBuf_BG1(p_lut, cnProcBufRes, bnProcBuf, Z); } else { - nrLDPC_cn2bnProcBuf_BG2(p_lut, p_procBuf, Z); + nrLDPC_cn2bnProcBuf_BG2(p_lut, cnProcBufRes, bnProcBuf, Z); } #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->cn2bnProcBuf); @@ -175,34 +180,34 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #ifdef NR_LDPC_DEBUG_MODE nrLDPC_debug_initBuffer2File(nrLDPC_buffers_BN_PROC); - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC, bnProcBuf); #endif // BN processing #ifdef NR_LDPC_PROFILER_DETAIL start_meas(&p_profiler->bnProcPc); #endif - nrLDPC_bnProcPc(p_lut, p_procBuf, Z); + nrLDPC_bnProcPc(p_lut, bnProcBuf, bnProcBufRes, llrProcBuf, llrRes, Z); #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->bnProcPc); #endif #ifdef NR_LDPC_DEBUG_MODE nrLDPC_debug_initBuffer2File(nrLDPC_buffers_LLR_RES); - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_LLR_RES, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_LLR_RES, llrRes); #endif #ifdef NR_LDPC_PROFILER_DETAIL start_meas(&p_profiler->bnProc); #endif - nrLDPC_bnProc(p_lut, p_procBuf, Z); + nrLDPC_bnProc(p_lut, bnProcBuf, bnProcBufRes, llrRes, Z); #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->bnProc); #endif #ifdef NR_LDPC_DEBUG_MODE nrLDPC_debug_initBuffer2File(nrLDPC_buffers_BN_PROC_RES); - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC_RES, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC_RES, bnProcBufRes); #endif // BN results to CN processing buffer @@ -211,18 +216,18 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #endif if (BG == 1) { - nrLDPC_bn2cnProcBuf_BG1(p_lut, p_procBuf, Z); + nrLDPC_bn2cnProcBuf_BG1(p_lut, bnProcBufRes, cnProcBuf, Z); } else { - nrLDPC_bn2cnProcBuf_BG2(p_lut, p_procBuf, Z); + nrLDPC_bn2cnProcBuf_BG2(p_lut, bnProcBufRes, cnProcBuf, Z); } #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->bn2cnProcBuf); #endif #ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC, cnProcBuf); #endif // Parity Check not necessary here since it will fail @@ -242,18 +247,18 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #endif if (BG == 1) { - nrLDPC_cnProc_BG1(p_lut, p_procBuf, Z); + nrLDPC_cnProc_BG1(p_lut, cnProcBuf, cnProcBufRes, Z); } else { - nrLDPC_cnProc_BG2(p_lut, p_procBuf, Z); + nrLDPC_cnProc_BG2(p_lut, cnProcBuf, cnProcBufRes, Z); } #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->cnProc); #endif #ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC_RES, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC_RES, cnProcBufRes); #endif // Send CN results back to BNs @@ -262,43 +267,43 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #endif if (BG == 1) { - nrLDPC_cn2bnProcBuf_BG1(p_lut, p_procBuf, Z); + nrLDPC_cn2bnProcBuf_BG1(p_lut, cnProcBufRes, bnProcBuf, Z); } else { - nrLDPC_cn2bnProcBuf_BG2(p_lut, p_procBuf, Z); + nrLDPC_cn2bnProcBuf_BG2(p_lut, cnProcBufRes, bnProcBuf, Z); } #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->cn2bnProcBuf); #endif #ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC, bnProcBuf); #endif // BN Processing #ifdef NR_LDPC_PROFILER_DETAIL start_meas(&p_profiler->bnProcPc); #endif - nrLDPC_bnProcPc(p_lut, p_procBuf, Z); + nrLDPC_bnProcPc(p_lut, bnProcBuf, bnProcBufRes, llrProcBuf, llrRes, Z); #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->bnProcPc); #endif #ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_LLR_RES, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_LLR_RES, llrRes); #endif #ifdef NR_LDPC_PROFILER_DETAIL start_meas(&p_profiler->bnProc); #endif - nrLDPC_bnProc(p_lut, p_procBuf, Z); + nrLDPC_bnProc(p_lut, bnProcBuf, bnProcBufRes, llrRes, Z); #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->bnProc); #endif #ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC_RES, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC_RES, bnProcBufRes); #endif // BN results to CN processing buffer @@ -307,18 +312,18 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #endif if (BG == 1) { - nrLDPC_bn2cnProcBuf_BG1(p_lut, p_procBuf, Z); + nrLDPC_bn2cnProcBuf_BG1(p_lut, bnProcBufRes, cnProcBuf, Z); } else { - nrLDPC_bn2cnProcBuf_BG2(p_lut, p_procBuf, Z); + nrLDPC_bn2cnProcBuf_BG2(p_lut, bnProcBufRes, cnProcBuf, Z); } #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->bn2cnProcBuf); #endif #ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC, p_procBuf); + nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC, cnProcBuf); #endif // Parity Check @@ -328,123 +333,11 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #endif if (BG == 1) { - pcRes = nrLDPC_cnProcPc_BG1(p_lut, p_procBuf, Z); + pcRes = nrLDPC_cnProcPc_BG1(p_lut, cnProcBuf, cnProcBufRes, Z); } else { - pcRes = nrLDPC_cnProcPc_BG2(p_lut, p_procBuf, Z); - } -#ifdef NR_LDPC_PROFILER_DETAIL - stop_meas(&p_profiler->cnProcPc); -#endif -#endif - } - - // Last iteration - if ( (i < numMaxIter) && (pcRes != 0) ) - { - // Increase iteration counter - i++; - - // CN processing -#ifdef NR_LDPC_PROFILER_DETAIL - start_meas(&p_profiler->cnProc); -#endif - if (BG == 1) - { - nrLDPC_cnProc_BG1(p_lut, p_procBuf, Z); - } - else - { - nrLDPC_cnProc_BG2(p_lut, p_procBuf, Z); - } -#ifdef NR_LDPC_PROFILER_DETAIL - stop_meas(&p_profiler->cnProc); -#endif - -#ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC_RES, p_procBuf); -#endif - - // Send CN results back to BNs -#ifdef NR_LDPC_PROFILER_DETAIL - start_meas(&p_profiler->cn2bnProcBuf); -#endif - if (BG == 1) - { - nrLDPC_cn2bnProcBuf_BG1(p_lut, p_procBuf, Z); - } - else - { - nrLDPC_cn2bnProcBuf_BG2(p_lut, p_procBuf, Z); - } -#ifdef NR_LDPC_PROFILER_DETAIL - stop_meas(&p_profiler->cn2bnProcBuf); -#endif - -#ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC, p_procBuf); -#endif - - // BN Processing -#ifdef NR_LDPC_PROFILER_DETAIL - start_meas(&p_profiler->bnProcPc); -#endif - nrLDPC_bnProcPc(p_lut, p_procBuf, Z); -#ifdef NR_LDPC_PROFILER_DETAIL - stop_meas(&p_profiler->bnProcPc); -#endif - -#ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_LLR_RES, p_procBuf); -#endif - - // If parity check not enabled, no need to send the BN proc results - // back to CNs -#ifdef NR_LDPC_ENABLE_PARITY_CHECK -#ifdef NR_LDPC_PROFILER_DETAIL - start_meas(&p_profiler->bnProc); -#endif - nrLDPC_bnProc(p_lut, p_procBuf, Z); -#ifdef NR_LDPC_PROFILER_DETAIL - stop_meas(&p_profiler->bnProc); -#endif - -#ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_BN_PROC_RES, p_procBuf); -#endif - - // BN results to CN processing buffer -#ifdef NR_LDPC_PROFILER_DETAIL - start_meas(&p_profiler->bn2cnProcBuf); -#endif - if (BG == 1) - { - nrLDPC_bn2cnProcBuf_BG1(p_lut, p_procBuf, Z); - } - else - { - nrLDPC_bn2cnProcBuf_BG2(p_lut, p_procBuf, Z); - } -#ifdef NR_LDPC_PROFILER_DETAIL - stop_meas(&p_profiler->bn2cnProcBuf); -#endif - -#ifdef NR_LDPC_DEBUG_MODE - nrLDPC_debug_writeBuffer2File(nrLDPC_buffers_CN_PROC, p_procBuf); -#endif - - // Parity Check -#ifdef NR_LDPC_PROFILER_DETAIL - start_meas(&p_profiler->cnProcPc); -#endif - if (BG == 1) - { - pcRes = nrLDPC_cnProcPc_BG1(p_lut, p_procBuf, Z); - } - else - { - pcRes = nrLDPC_cnProcPc_BG2(p_lut, p_procBuf, Z); + pcRes = nrLDPC_cnProcPc_BG2(p_lut, cnProcBuf, cnProcBufRes, Z); } #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->cnProcPc); @@ -466,7 +359,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP #ifdef NR_LDPC_PROFILER_DETAIL start_meas(&p_profiler->llrRes2llrOut); #endif - nrLDPC_llrRes2llrOut(p_lut, p_llrOut, p_procBuf, Z, BG); + nrLDPC_llrRes2llrOut(p_lut, p_llrOut, llrRes, Z, BG); #ifdef NR_LDPC_PROFILER_DETAIL stop_meas(&p_profiler->llrRes2llrOut); #endif diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h index b76750459d..7f514d5cfa 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h @@ -97,7 +97,7 @@ static inline void *nrLDPC_circ_memcpy(int8_t *str1, const int8_t *str2, uint16_ \param Z Lifting size \param BG Base graph */ -static inline void nrLDPC_llr2llrProcBuf(t_nrLDPC_lut* p_lut, int8_t* llr, t_nrLDPC_procBuf* p_procBuf, uint16_t Z, uint8_t BG) +static inline void nrLDPC_llr2llrProcBuf(t_nrLDPC_lut* p_lut, int8_t* llr, int8_t* llrProcBuf, uint16_t Z, uint8_t BG) { uint32_t i; const uint8_t numBn2CnG1 = p_lut->numBnInBnGroups[0]; @@ -109,7 +109,6 @@ static inline void nrLDPC_llr2llrProcBuf(t_nrLDPC_lut* p_lut, int8_t* llr, t_nrL const uint8_t* lut_llr2llrProcBufBnPos = p_lut->llr2llrProcBufBnPos; uint32_t idxBn; - int8_t* llrProcBuf = p_procBuf->llrProcBuf; // Copy LLRs connected to 1 CN if (numBn2CnG1 > 0) @@ -133,7 +132,7 @@ static inline void nrLDPC_llr2llrProcBuf(t_nrLDPC_lut* p_lut, int8_t* llr, t_nrL \param p_procBuf Pointer to the processing buffers \param Z Lifting size */ -static inline void nrLDPC_llr2CnProcBuf_BG1(t_nrLDPC_lut* p_lut, int8_t* llr, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_llr2CnProcBuf_BG1(t_nrLDPC_lut* p_lut, int8_t* llr, int8_t* cnProcBuf, uint16_t Z) { const uint16_t (*lut_circShift_CNG3) [lut_numCnInCnGroups_BG1_R13[0]] = (const uint16_t(*)[lut_numCnInCnGroups_BG1_R13[0]]) p_lut->circShift[0]; const uint16_t (*lut_circShift_CNG4) [lut_numCnInCnGroups_BG1_R13[1]] = (const uint16_t(*)[lut_numCnInCnGroups_BG1_R13[1]]) p_lut->circShift[1]; @@ -158,7 +157,6 @@ static inline void nrLDPC_llr2CnProcBuf_BG1(t_nrLDPC_lut* p_lut, int8_t* llr, t_ const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; - int8_t* cnProcBuf = p_procBuf->cnProcBuf; uint32_t i; uint32_t j; @@ -342,7 +340,7 @@ static inline void nrLDPC_llr2CnProcBuf_BG1(t_nrLDPC_lut* p_lut, int8_t* llr, t_ \param p_procBuf Pointer to the processing buffers \param Z Lifting size */ -static inline void nrLDPC_llr2CnProcBuf_BG2(t_nrLDPC_lut* p_lut, int8_t* llr, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_llr2CnProcBuf_BG2(t_nrLDPC_lut* p_lut, int8_t* llr, int8_t* cnProcBuf, uint16_t Z) { const uint16_t (*lut_circShift_CNG3) [lut_numCnInCnGroups_BG2_R15[0]] = (const uint16_t(*)[lut_numCnInCnGroups_BG2_R15[0]]) p_lut->circShift[0]; const uint16_t (*lut_circShift_CNG4) [lut_numCnInCnGroups_BG2_R15[1]] = (const uint16_t(*)[lut_numCnInCnGroups_BG2_R15[1]]) p_lut->circShift[1]; @@ -361,7 +359,6 @@ static inline void nrLDPC_llr2CnProcBuf_BG2(t_nrLDPC_lut* p_lut, int8_t* llr, t_ const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; - int8_t* cnProcBuf = p_procBuf->cnProcBuf; uint32_t i; uint32_t j; @@ -478,7 +475,7 @@ static inline void nrLDPC_llr2CnProcBuf_BG2(t_nrLDPC_lut* p_lut, int8_t* llr, t_ \param p_procBuf Pointer to the processing buffers \param Z Lifting size */ -static inline void nrLDPC_cn2bnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_cn2bnProcBuf_BG2(t_nrLDPC_lut* p_lut, int8_t* cnProcBufRes, int8_t* bnProcBuf, uint16_t Z) { const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; @@ -504,9 +501,6 @@ static inline void nrLDPC_cn2bnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf const uint8_t (*lut_bnPosBnProcBuf_CNG8) [lut_numCnInCnGroups[4]] = (const uint8_t(*)[lut_numCnInCnGroups[4]]) p_lut->bnPosBnProcBuf[4]; const uint8_t (*lut_bnPosBnProcBuf_CNG10) [lut_numCnInCnGroups[5]] = (const uint8_t(*)[lut_numCnInCnGroups[5]]) p_lut->bnPosBnProcBuf[5]; - int8_t* cnProcBufRes = p_procBuf->cnProcBufRes; - int8_t* bnProcBuf = p_procBuf->bnProcBuf; - int8_t* p_cnProcBufRes; uint32_t bitOffsetInGroup; uint32_t i; @@ -621,7 +615,7 @@ static inline void nrLDPC_cn2bnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf \param p_procBuf Pointer to the processing buffers \param Z Lifting size */ -static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, int8_t* cnProcBufRes, int8_t* bnProcBuf, uint16_t Z) { const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; @@ -655,9 +649,6 @@ static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf const uint8_t (*lut_bnPosBnProcBuf_CNG10)[lut_numCnInCnGroups[7]] = (const uint8_t(*)[lut_numCnInCnGroups[7]]) p_lut->bnPosBnProcBuf[7]; const uint8_t (*lut_bnPosBnProcBuf_CNG19)[lut_numCnInCnGroups[8]] = (const uint8_t(*)[lut_numCnInCnGroups[8]]) p_lut->bnPosBnProcBuf[8]; - int8_t* cnProcBufRes = p_procBuf->cnProcBufRes; - int8_t* bnProcBuf = p_procBuf->bnProcBuf; - int8_t* p_cnProcBufRes; uint32_t bitOffsetInGroup; uint32_t i; @@ -819,7 +810,7 @@ static inline void nrLDPC_cn2bnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf \param p_procBuf Pointer to the processing buffers \param Z Lifting size */ -static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, int8_t* bnProcBufRes, int8_t* cnProcBuf, uint16_t Z) { const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; @@ -845,9 +836,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf const uint8_t (*lut_bnPosBnProcBuf_CNG8) [lut_numCnInCnGroups[4]] = (const uint8_t(*)[lut_numCnInCnGroups[4]]) p_lut->bnPosBnProcBuf[4]; const uint8_t (*lut_bnPosBnProcBuf_CNG10) [lut_numCnInCnGroups[5]] = (const uint8_t(*)[lut_numCnInCnGroups[5]]) p_lut->bnPosBnProcBuf[5]; - int8_t* cnProcBuf = p_procBuf->cnProcBuf; - int8_t* bnProcBufRes = p_procBuf->bnProcBufRes; - int8_t* p_cnProcBuf; uint32_t bitOffsetInGroup; uint32_t i; @@ -961,7 +949,7 @@ static inline void nrLDPC_bn2cnProcBuf_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf \param p_procBuf Pointer to the processing buffers \param Z Lifting size */ -static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z) +static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, int8_t* bnProcBufRes, int8_t* cnProcBuf, uint16_t Z) { const uint8_t* lut_numCnInCnGroups = p_lut->numCnInCnGroups; const uint32_t* lut_startAddrCnGroups = p_lut->startAddrCnGroups; @@ -995,9 +983,6 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf const uint8_t (*lut_bnPosBnProcBuf_CNG10)[lut_numCnInCnGroups[7]] = (const uint8_t(*)[lut_numCnInCnGroups[7]]) p_lut->bnPosBnProcBuf[7]; const uint8_t (*lut_bnPosBnProcBuf_CNG19)[lut_numCnInCnGroups[8]] = (const uint8_t(*)[lut_numCnInCnGroups[8]]) p_lut->bnPosBnProcBuf[8]; - int8_t* cnProcBuf = p_procBuf->cnProcBuf; - int8_t* bnProcBufRes = p_procBuf->bnProcBufRes; - int8_t* p_cnProcBuf; uint32_t bitOffsetInGroup; uint32_t i; @@ -1157,7 +1142,7 @@ static inline void nrLDPC_bn2cnProcBuf_BG1(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf \param Z Lifting size \param BG Base graph */ -static inline void nrLDPC_llrRes2llrOut(t_nrLDPC_lut* p_lut, int8_t* llrOut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z, uint8_t BG) +static inline void nrLDPC_llrRes2llrOut(t_nrLDPC_lut* p_lut, int8_t* llrOut, int8_t* llrRes, uint16_t Z, uint8_t BG) { uint32_t i; const uint8_t numBn2CnG1 = p_lut->numBnInBnGroups[0]; @@ -1168,7 +1153,6 @@ static inline void nrLDPC_llrRes2llrOut(t_nrLDPC_lut* p_lut, int8_t* llrOut, t_n const uint16_t* lut_llr2llrProcBufAddr = p_lut->llr2llrProcBufAddr; const uint8_t* lut_llr2llrProcBufBnPos = p_lut->llr2llrProcBufBnPos; - int8_t* llrRes = p_procBuf->llrRes; int8_t* p_llrOut = &llrOut[0]; uint32_t idxBn; diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/nrLDPC_debug.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/nrLDPC_debug.h index e4dcb56edd..41c0a474a4 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/nrLDPC_debug.h +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/nrLDPC_debug.h @@ -87,38 +87,38 @@ static inline void nrLDPC_initFile(const char* fileName) \brief Writes data of predefined buffers to file \param buffer Enum of buffer name to write */ -static inline void nrLDPC_debug_writeBuffer2File(e_nrLDPC_buffers buffer, t_nrLDPC_procBuf* p_procBuf) +static inline void nrLDPC_debug_writeBuffer2File(e_nrLDPC_buffers buffer, int8_t* p_buffer) { switch (buffer) { case nrLDPC_buffers_LLR_PROC: { - nrLDPC_writeFile("llrProcBuf.txt", p_procBuf->llrProcBuf, NR_LDPC_MAX_NUM_LLR); + nrLDPC_writeFile("llrProcBuf.txt", p_buffer, NR_LDPC_MAX_NUM_LLR); break; } case nrLDPC_buffers_CN_PROC: { - nrLDPC_writeFile("cnProcBuf.txt", p_procBuf->cnProcBuf, NR_LDPC_SIZE_CN_PROC_BUF); + nrLDPC_writeFile("cnProcBuf.txt", p_buffer, NR_LDPC_SIZE_CN_PROC_BUF); break; } case nrLDPC_buffers_CN_PROC_RES: { - nrLDPC_writeFile("cnProcBufRes.txt", p_procBuf->cnProcBufRes, NR_LDPC_SIZE_CN_PROC_BUF); + nrLDPC_writeFile("cnProcBufRes.txt", p_buffer, NR_LDPC_SIZE_CN_PROC_BUF); break; } case nrLDPC_buffers_BN_PROC: { - nrLDPC_writeFile("bnProcBuf.txt", p_procBuf->bnProcBuf, NR_LDPC_SIZE_BN_PROC_BUF); + nrLDPC_writeFile("bnProcBuf.txt", p_buffer, NR_LDPC_SIZE_BN_PROC_BUF); break; } case nrLDPC_buffers_BN_PROC_RES: { - nrLDPC_writeFile("bnProcBufRes.txt", p_procBuf->bnProcBufRes, NR_LDPC_SIZE_BN_PROC_BUF); + nrLDPC_writeFile("bnProcBufRes.txt", p_buffer, NR_LDPC_SIZE_BN_PROC_BUF); break; } case nrLDPC_buffers_LLR_RES: { - nrLDPC_writeFile("llrRes.txt", p_procBuf->llrRes, NR_LDPC_MAX_NUM_LLR); + nrLDPC_writeFile("llrRes.txt", p_buffer, NR_LDPC_MAX_NUM_LLR); break; } } diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index 0d7ff9ef9f..7628fe98ee 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -71,5 +71,5 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho \param p_llrOut Output vector \param p_profiler LDPC profiler statistics */ -typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_procBuf *, t_nrLDPC_time_stats * ); +typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_time_stats* ); #endif diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 5286fe8780..51d051e0ca 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -91,12 +91,6 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr,uint8_t N_RB_UL) ulsch->harq_processes[i]->w[r] = NULL; } } - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r]){ - nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]); - ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL; - } - } free16(ulsch->harq_processes[i],sizeof(NR_UL_gNB_HARQ_t)); ulsch->harq_processes[i] = NULL; } @@ -120,21 +114,57 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint } uint16_t ulsch_bytes = a_segments*1056; // allocated bytes per segment - ulsch = (NR_gNB_ULSCH_t *)malloc16_clear(sizeof(NR_gNB_ULSCH_t)); - - ulsch->max_ldpc_iterations = max_ldpc_iterations; - ulsch->Mlimit = 4; - - for (i=0; iharq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t)); - ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes); - if (abstraction_flag == 0) { - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); - ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t)); - ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t)); - ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t)); + ulsch = (NR_gNB_ULSCH_t *)malloc16(sizeof(NR_gNB_ULSCH_t)); + + if (ulsch) { + + memset(ulsch,0,sizeof(NR_gNB_ULSCH_t)); + + ulsch->max_ldpc_iterations = max_ldpc_iterations; + ulsch->Mlimit = 4; + + for (i=0; iharq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16(sizeof(NR_UL_gNB_HARQ_t)); + + if (ulsch->harq_processes[i]) { + + memset(ulsch->harq_processes[i],0,sizeof(NR_UL_gNB_HARQ_t)); + + ulsch->harq_processes[i]->b = (uint8_t*)malloc16(ulsch_bytes); + + if (ulsch->harq_processes[i]->b) + memset(ulsch->harq_processes[i]->b,0,ulsch_bytes); + else + exit_flag=3; + + if (abstraction_flag == 0) { + for (r=0; rharq_processes[i]->c[r] = (uint8_t*)malloc16(8448*sizeof(uint8_t)); + + if (ulsch->harq_processes[i]->c[r]) + memset(ulsch->harq_processes[i]->c[r],0,8448*sizeof(uint8_t)); + else + exit_flag=2; + + ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16((68*384)*sizeof(int16_t)); + + if (ulsch->harq_processes[i]->d[r]) + memset(ulsch->harq_processes[i]->d[r],0,(68*384)*sizeof(int16_t)); + else + exit_flag=2; + + ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16((3*(6144+64))*sizeof(int16_t)); + + if (ulsch->harq_processes[i]->w[r]) + memset(ulsch->harq_processes[i]->w[r],0,(3*(6144+64))*sizeof(int16_t)); + else + exit_flag=2; + } + } + } else { + exit_flag=1; } } } @@ -382,7 +412,6 @@ void nr_processULSegment(void* arg) { no_iteration_ldpc = nrLDPC_decoder(p_decoderParms, (int8_t*)&pl[0], llrProcBuf, - ulsch_harq->p_nrLDPC_procBuf[r], p_procTime); if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 95c451fa1a..c07492cce9 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -114,13 +114,6 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) { dlsch->harq_processes[i]->w[r] = NULL; } - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r]) { - nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]); - dlsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL; - } - } - free16(dlsch->harq_processes[i],sizeof(NR_DL_UE_HARQ_t)); dlsch->harq_processes[i] = NULL; } @@ -169,7 +162,6 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint if (abstraction_flag == 0) { for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); if (dlsch->harq_processes[i]->c[r]) @@ -441,7 +433,6 @@ void nr_processDLSegment(void* arg) { no_iteration_ldpc = nrLDPC_decoder(p_decoderParms, (int8_t *)&pl[0], llrProcBuf, - p_nrLDPC_procBuf[r], p_procTime); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index b4ee4f5b41..ecb22d8c7c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -240,8 +240,6 @@ typedef struct { //double w_abs[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448]; /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) int16_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; - /// LDPC processing buffers - t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_DLSCH_SEGMENTS]; /// Number of code segments uint32_t C; /// Number of bits in code segments diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index fb4f9a0092..047ff802a6 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -282,8 +282,6 @@ typedef struct { uint32_t C; /// Pointers to code blocks after LDPC coding (38.212 V15.4.0 section 5.3.2) int16_t *d[MAX_NUM_NR_ULSCH_SEGMENTS]; - /// LDPC processing buffer - t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_ULSCH_SEGMENTS]; /// LDPC lifting size (38.212 V15.4.0 table 5.3.2-1) uint32_t Z; /// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1) From b2b95bb9ffafc932fd4baf31983fa5a77faa566a Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 21 Jan 2022 11:49:55 +0100 Subject: [PATCH 288/883] feat(ci): adding more 4G RF sim tests -- currently TDD not working Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 43 ++- ci-scripts/main.py | 6 +- ...m.xml => container_4g_rfsim_fdd_05MHz.xml} | 19 +- ... => container_4g_rfsim_fdd_05MHz_down.xml} | 6 +- .../container_4g_rfsim_fdd_05MHz_noS1.xml | 109 +++++++ ...container_4g_rfsim_fdd_05MHz_noS1_down.xml | 38 +++ .../container_4g_rfsim_fdd_10MHz.xml | 129 +++++++++ .../container_4g_rfsim_fdd_10MHz_down.xml | 38 +++ .../container_4g_rfsim_fdd_20MHz.xml | 129 +++++++++ .../container_4g_rfsim_fdd_20MHz_down.xml | 38 +++ .../container_4g_rfsim_tdd_05MHz.xml | 130 +++++++++ .../container_4g_rfsim_tdd_05MHz_down.xml | 38 +++ .../README.md | 0 .../docker-compose.yml | 0 .../oai_db.cql | 0 .../docker-compose.yml | 75 +++++ .../docker-compose.yml | 272 ++++++++++++++++++ .../docker-compose.yml | 272 ++++++++++++++++++ .../docker-compose.yml | 271 +++++++++++++++++ 19 files changed, 1586 insertions(+), 27 deletions(-) rename ci-scripts/xml_files/{container_4g_rfsim.xml => container_4g_rfsim_fdd_05MHz.xml} (87%) rename ci-scripts/xml_files/{container_4g_rfsim_down.xml => container_4g_rfsim_fdd_05MHz_down.xml} (87%) create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml create mode 100644 ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml rename ci-scripts/yaml_files/{4g_rfsimulator => 4g_rfsimulator_fdd_05MHz}/README.md (100%) rename ci-scripts/yaml_files/{4g_rfsimulator => 4g_rfsimulator_fdd_05MHz}/docker-compose.yml (100%) rename ci-scripts/yaml_files/{4g_rfsimulator => 4g_rfsimulator_fdd_05MHz}/oai_db.cql (100%) create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index ba5ce49e8d..37e22acc3c 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -715,7 +715,7 @@ class Containerize(): logging.debug(cmd) networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - def UndeployGenObject(self, HTML, RAN): + def UndeployGenObject(self, HTML, RAN, UE): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') logPath = '../cmake_targets/log/' + ymlPath[1] @@ -751,7 +751,7 @@ class Containerize(): logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - # Analyzing log file! + # Analyzing log file(s)! listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du'] for container in listOfPossibleRanContainers: filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' @@ -766,7 +766,6 @@ class Containerize(): continue logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') - # For the moment just assume this exists logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) if (logStatus < 0): fullStatus = False @@ -774,6 +773,27 @@ class Containerize(): else: HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) + listOfPossibleUeContainers = ['lte-ue*', 'nr-ue*'] + for container in listOfPossibleUeContainers: + filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' + cmd = 'ls ' + filename + containerStatus = True + try: + lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + filename = str(lsStatus).strip() + except: + containerStatus = False + if not containerStatus: + continue + + logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m') + logStatus = UE.AnalyzeLogFile_UE(filename, HTML, RAN) + if (logStatus < 0): + fullStatus = False + HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus) + else: + HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK) + cmd = 'rm ' + self.yamlPath[0] + '/*.log' logging.debug(cmd) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) @@ -789,6 +809,7 @@ class Containerize(): cmd = 'sudo rm /tmp/capture_' + ymlPath[1] + '.pcap' logging.debug(cmd) copyStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + self.tsharkStarted = False logging.debug('\u001B[1m Undeploying \u001B[0m') cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml down' @@ -814,7 +835,7 @@ class Containerize(): HTML.CreateHtmlTestRow('n/a', 'KO', CONST.ALL_PROCESSES_OK) logging.info('\u001B[1m Undeploying OAI Object(s) FAIL\u001B[0m') - def PingFromContainer(self, HTML): + def PingFromContainer(self, HTML, RAN, UE): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') logPath = '../cmake_targets/log/' + ymlPath[1] @@ -828,17 +849,17 @@ class Containerize(): result = re.search(', (?P[0-9\.]+)% packet loss, time [0-9\.]+ms', deployStatus) if result is None: - self.PingExit(HTML, False, 'Packet Loss Not Found') + self.PingExit(HTML, RAN, UE, False, 'Packet Loss Not Found') return packetloss = result.group('packetloss') if float(packetloss) == 100: - self.PingExit(HTML, False, 'Packet Loss is 100%') + self.PingExit(HTML, RAN, UE, False, 'Packet Loss is 100%') return result = re.search('rtt min\/avg\/max\/mdev = (?P[0-9\.]+)\/(?P[0-9\.]+)\/(?P[0-9\.]+)\/[0-9\.]+ ms', deployStatus) if result is None: - self.PingExit(HTML, False, 'Ping RTT_Min RTT_Avg RTT_Max Not Found!') + self.PingExit(HTML, RAN, UE, False, 'Ping RTT_Min RTT_Avg RTT_Max Not Found!') return rtt_min = result.group('rtt_min') @@ -860,7 +881,7 @@ class Containerize(): packetLossOK = False elif float(packetloss) > 0: message += '\nPacket Loss is not 0%' - self.PingExit(HTML, packetLossOK, message) + self.PingExit(HTML, RAN, UE, packetLossOK, message) if packetLossOK: logging.debug('\u001B[1;37;44m ping result \u001B[0m') @@ -870,7 +891,7 @@ class Containerize(): logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m') logging.info('\u001B[1m Ping Test PASS\u001B[0m') - def PingExit(self, HTML, status, message): + def PingExit(self, HTML, RAN, UE, status, message): html_queue = SimpleQueue() html_cell = '
UE\n' + message + '
' html_queue.put(html_cell) @@ -885,10 +906,10 @@ class Containerize(): logging.debug('----------------------------------------') HTML.testCase_id = 'AUTO-UNDEPLOY' HTML.desc = 'Automatic Un-Deployment' - self.UndeployGenObject(HTML) + self.UndeployGenObject(HTML, RAN, UE) self.exitStatus = 1 - def IperfFromContainer(self, HTML): + def IperfFromContainer(self, HTML, RAN): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5b5eec285c..b5a5e4db92 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -909,15 +909,15 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'UndeployGenObject': - CONTAINERS.UndeployGenObject(HTML, RAN) + CONTAINERS.UndeployGenObject(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'PingFromContainer': - CONTAINERS.PingFromContainer(HTML) + CONTAINERS.PingFromContainer(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'IperfFromContainer': - CONTAINERS.IperfFromContainer(HTML) + CONTAINERS.IperfFromContainer(HTML, RAN) if CONTAINERS.exitStatus==1: RAN.prematureExit = True else: diff --git a/ci-scripts/xml_files/container_4g_rfsim.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml similarity index 87% rename from ci-scripts/xml_files/container_4g_rfsim.xml rename to ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index 2466f55800..fd254f1856 100644 --- a/ci-scripts/xml_files/container_4g_rfsim.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -21,10 +21,9 @@ --> - rfsim-4glte - Testing 4G LTE RF sim - Monolithic eNB + rfsim-4glte-fdd05mhz + Monolithic eNB - FDD 05MHz wrench - 2 100011 000011 @@ -46,7 +45,7 @@ DeployGenObject Deploy Cassandra Database - yaml_files/4g_rfsimulator + yaml_files/4g_rfsimulator_fdd_05MHz cassandra db_init 1 @@ -66,23 +65,23 @@ DeployGenObject Deploy OAI 4G CoreNetwork - yaml_files/4g_rfsimulator + yaml_files/4g_rfsimulator_fdd_05MHz oai_hss oai_mme oai_spgwc oai_spgwu trf_gen 6 DeployGenObject - Deploy OAI 4G eNB RF sim - yaml_files/4g_rfsimulator + Deploy OAI 4G eNB RF sim (FDD 05MHz) + yaml_files/4g_rfsimulator_fdd_05MHz enb 7 DeployGenObject - Deploy OAI 4G NR-UE RF sim - yaml_files/4g_rfsimulator + Deploy OAI 4G NR-UE RF sim (FDD 05MHz) + yaml_files/4g_rfsimulator_fdd_05MHz oai_ue0 8 @@ -124,7 +123,7 @@ UndeployGenObject Undeploy all OAI 4G stack - yaml_files/4g_rfsimulator + yaml_files/4g_rfsimulator_fdd_05MHz diff --git a/ci-scripts/xml_files/container_4g_rfsim_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml similarity index 87% rename from ci-scripts/xml_files/container_4g_rfsim_down.xml rename to ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml index 651447a9ca..1c3b1d5a7c 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_down.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_down.xml @@ -21,8 +21,8 @@ --> - rfsim-4glte-down - CleanUp 4G RF - Monolithic eNB + rfsim-4glte-fdd05mhz-down + CleanUp 4G RF trash 100011 @@ -32,7 +32,7 @@ UndeployGenObject Undeploy all OAI 4G stack - yaml_files/4g_rfsimulator + yaml_files/4g_rfsimulator_fdd_05MHz diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml new file mode 100644 index 0000000000..2ff9461b93 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml @@ -0,0 +1,109 @@ + + + rfsim-4glte-fdd05mhz-noS1 + Monolithic eNB - FDD 05MHz - noS1 + wrench + + 100011 + 000013 + 000001 + 000014 + 000002 + 020011 + 020012 + 030011 + 030012 + 100011 + + + + + IdleSleep + Sleep + 30 + + + + IdleSleep + Sleep + 10 + + + + DeployGenObject + Deploy OAI 4G eNB RF sim (FDD 05MHz) + yaml_files/4g_rfsimulator_fdd_05MHz_noS1 + enb + 1 + + + + DeployGenObject + Deploy OAI 4G NR-UE RF sim (FDD 05MHz) + yaml_files/4g_rfsimulator_fdd_05MHz_noS1 + oai_ue0 + 2 + + + + PingFromContainer + Ping Traffic-Gen from LTE-UE + rfsim4g-oai-lte-ue0 + -I oaitun_ue1 -c 20 10.0.1.1 + 5 + + + + PingFromContainer + Ping LTE-UE from eNB + rfsim4g-oai-enb + -I oaitun_enb1 -c 20 10.0.1.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim4g-oai-lte-ue0 + rfsim4g-oai-enb + -B 10.0.1.2 -u -i 1 -s + -B 10.0.1.1 -c 10.0.1.2 -u -i 1 -t 30 -b 2M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim4g-oai-enb + rfsim4g-oai-lte-ue0 + -B 10.0.1.1 -u -i 1 -s + -B 10.0.1.2 -c 10.0.1.1 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_05MHz_noS1 + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml new file mode 100644 index 0000000000..6db1dfd9de --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1_down.xml @@ -0,0 +1,38 @@ + + + rfsim-4glte-fdd05mhz-nos1-down + CleanUp 4G RF + trash + + 100011 + + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_05MHz_noS1 + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml new file mode 100644 index 0000000000..f00e277c36 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -0,0 +1,129 @@ + + + rfsim-4glte-fdd10mhz + Monolithic eNB - FDD 10MHz + wrench + + 100011 + 000011 + 000001 + 000012 + 000002 + 000013 + 000001 + 000014 + 000002 + 020011 + 020012 + 030011 + 030012 + 100011 + + + + + DeployGenObject + Deploy Cassandra Database + yaml_files/4g_rfsimulator_fdd_10MHz + cassandra db_init + 1 + + + + IdleSleep + Sleep + 30 + + + + IdleSleep + Sleep + 10 + + + + DeployGenObject + Deploy OAI 4G CoreNetwork + yaml_files/4g_rfsimulator_fdd_10MHz + oai_hss oai_mme oai_spgwc oai_spgwu trf_gen + 6 + + + + DeployGenObject + Deploy OAI 4G eNB RF sim (FDD 10MHz) + yaml_files/4g_rfsimulator_fdd_10MHz + enb + 7 + + + + DeployGenObject + Deploy OAI 4G NR-UE RF sim (FDD 10MHz) + yaml_files/4g_rfsimulator_fdd_10MHz + oai_ue0 + 8 + + + + PingFromContainer + Ping Traffic-Gen from LTE-UE + rfsim4g-oai-lte-ue0 + -I oaitun_ue1 -c 20 192.168.61.11 + 5 + + + + PingFromContainer + Ping LTE-UE from Traffic-Gen + rfsim4g-trf-gen + -c 20 12.0.0.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim4g-oai-lte-ue0 + rfsim4g-trf-gen + -B 12.0.0.2 -u -i 1 -s + -c 12.0.0.2 -u -i 1 -t 30 -b 2M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim4g-trf-gen + rfsim4g-oai-lte-ue0 + -u -i 1 -s + -B 12.0.0.2 -c 192.168.61.11 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_10MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml new file mode 100644 index 0000000000..7d03d56ff4 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz_down.xml @@ -0,0 +1,38 @@ + + + rfsim-4glte-fdd10mhz-down + CleanUp 4G RF + trash + + 100011 + + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_10MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml new file mode 100644 index 0000000000..52e1ac7de1 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -0,0 +1,129 @@ + + + rfsim-4glte-fdd20mhz + Monolithic eNB - FDD 20MHz + wrench + + 100011 + 000011 + 000001 + 000012 + 000002 + 000013 + 000001 + 000014 + 000002 + 020011 + 020012 + 030011 + 030012 + 100011 + + + + + DeployGenObject + Deploy Cassandra Database + yaml_files/4g_rfsimulator_fdd_20MHz + cassandra db_init + 1 + + + + IdleSleep + Sleep + 30 + + + + IdleSleep + Sleep + 10 + + + + DeployGenObject + Deploy OAI 4G CoreNetwork + yaml_files/4g_rfsimulator_fdd_20MHz + oai_hss oai_mme oai_spgwc oai_spgwu trf_gen + 6 + + + + DeployGenObject + Deploy OAI 4G eNB RF sim (FDD 20MHz) + yaml_files/4g_rfsimulator_fdd_20MHz + enb + 7 + + + + DeployGenObject + Deploy OAI 4G NR-UE RF sim (FDD 20MHz) + yaml_files/4g_rfsimulator_fdd_20MHz + oai_ue0 + 8 + + + + PingFromContainer + Ping Traffic-Gen from LTE-UE + rfsim4g-oai-lte-ue0 + -I oaitun_ue1 -c 20 192.168.61.11 + 5 + + + + PingFromContainer + Ping LTE-UE from Traffic-Gen + rfsim4g-trf-gen + -c 20 12.0.0.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim4g-oai-lte-ue0 + rfsim4g-trf-gen + -B 12.0.0.2 -u -i 1 -s + -c 12.0.0.2 -u -i 1 -t 30 -b 2M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim4g-trf-gen + rfsim4g-oai-lte-ue0 + -u -i 1 -s + -B 12.0.0.2 -c 192.168.61.11 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_20MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml new file mode 100644 index 0000000000..0a721c5091 --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz_down.xml @@ -0,0 +1,38 @@ + + + rfsim-4glte-fdd20mhz-down + CleanUp 4G RF + trash + + 100011 + + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_fdd_20MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml new file mode 100644 index 0000000000..cdaee430ef --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -0,0 +1,130 @@ + + + rfsim-4glte-tdd05mhz + Monolithic eNB - TDD 05MHz + wrench + 2 + + 100011 + 000011 + 000001 + 000012 + 000002 + 000013 + 000001 + 000014 + 000002 + 020011 + 020012 + 030011 + 030012 + 100011 + + + + + DeployGenObject + Deploy Cassandra Database + yaml_files/4g_rfsimulator_tdd_05MHz + cassandra db_init + 1 + + + + IdleSleep + Sleep + 30 + + + + IdleSleep + Sleep + 10 + + + + DeployGenObject + Deploy OAI 4G CoreNetwork + yaml_files/4g_rfsimulator_tdd_05MHz + oai_hss oai_mme oai_spgwc oai_spgwu trf_gen + 6 + + + + DeployGenObject + Deploy OAI 4G eNB RF sim (TDD 05MHz) + yaml_files/4g_rfsimulator_tdd_05MHz + enb + 7 + + + + DeployGenObject + Deploy OAI 4G NR-UE RF sim (TDD 05MHz) + yaml_files/4g_rfsimulator_tdd_05MHz + oai_ue0 + 8 + + + + PingFromContainer + Ping Traffic-Gen from LTE-UE + rfsim4g-oai-lte-ue0 + -I oaitun_ue1 -c 20 192.168.61.11 + 5 + + + + PingFromContainer + Ping LTE-UE from Traffic-Gen + rfsim4g-trf-gen + -c 20 12.0.0.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim4g-oai-lte-ue0 + rfsim4g-trf-gen + -B 12.0.0.2 -u -i 1 -s + -c 12.0.0.2 -u -i 1 -t 30 -b 2M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim4g-trf-gen + rfsim4g-oai-lte-ue0 + -u -i 1 -s + -B 12.0.0.2 -c 192.168.61.11 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_tdd_05MHz + + + diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml new file mode 100644 index 0000000000..7e27bac73c --- /dev/null +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz_down.xml @@ -0,0 +1,38 @@ + + + rfsim-4glte-tdd05mhz-down + CleanUp 4G RF + trash + + 100011 + + + + + UndeployGenObject + Undeploy all OAI 4G stack + yaml_files/4g_rfsimulator_tdd_05MHz + + + diff --git a/ci-scripts/yaml_files/4g_rfsimulator/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md similarity index 100% rename from ci-scripts/yaml_files/4g_rfsimulator/README.md rename to ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md diff --git a/ci-scripts/yaml_files/4g_rfsimulator/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml similarity index 100% rename from ci-scripts/yaml_files/4g_rfsimulator/docker-compose.yml rename to ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml diff --git a/ci-scripts/yaml_files/4g_rfsimulator/oai_db.cql b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/oai_db.cql similarity index 100% rename from ci-scripts/yaml_files/4g_rfsimulator/oai_db.cql rename to ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/oai_db.cql diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml new file mode 100644 index 0000000000..6e3916b8ca --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz_noS1/docker-compose.yml @@ -0,0 +1,75 @@ +version: '3.8' + +services: + enb: + image: oai-enb:develop + privileged: true + container_name: rfsim4g-oai-enb + networks: + public_net: + ipv4_address: 192.168.61.20 + environment: + TZ: Europe/Paris + USE_FDD_MONO: 'yes' + RFSIMULATOR: enb + ENB_NAME: eNB-rf-sim + MCC: '208' + MNC: '96' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 10 + NB_PRB: 25 + MME_S1C_IP_ADDRESS: 192.168.61.3 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 192.168.61.20 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 192.168.61.20 + ENB_X2_IP_ADDRESS: 192.168.61.20 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 192.168.61.10 + USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time --noS1 + healthcheck: + test: /bin/bash -c "pgrep lte-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai_ue0: + image: oai-lte-ue:develop + privileged: true + container_name: rfsim4g-oai-lte-ue0 + networks: + public_net: + ipv4_address: 192.168.61.30 + expose: + - "10000" + environment: + TZ: Europe/Paris + HOSTNAME: oai_ue0 + RFSIMULATOR: 192.168.61.20 + MCC: '208' + MNC: '96' + SHORT_IMSI: '0100000001' + LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'c42449363bbad02b66d16bc975d77cc1' + MSISDN: '001011234561010' + HPLMN: 20896 + USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time --noS1 + healthcheck: + test: /bin/bash -c "pgrep lte-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + public_net: + name: rfsim4g-oai-public-net + ipam: + config: + - subnet: 192.168.61.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-public" diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml new file mode 100644 index 0000000000..4c1ceb424a --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml @@ -0,0 +1,272 @@ +version: '3.8' + +services: + cassandra: + image: cassandra:2.1 + container_name: rfsim4g-cassandra + networks: + private_net: + ipv4_address: 192.168.68.2 + environment: + CASSANDRA_CLUSTER_NAME: "OAI HSS Cluster" + CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch + healthcheck: + test: /bin/bash -c "nodetool status" + interval: 10s + timeout: 5s + retries: 5 + + db_init: + image: cassandra:2.1 + container_name: rfsim4g-db-init + depends_on: [cassandra] + deploy: + restart_policy: + condition: on-failure + max_attempts: 10 + networks: + private_net: + ipv4_address: 192.168.68.4 + volumes: + - ../4g_rfsimulator_fdd_05MHz/oai_db.cql:/home/oai_db.cql + entrypoint: /bin/bash -c "cqlsh --file /home/oai_db.cql 192.168.68.2 && echo 'OK'" + + oai_hss: + image: oai-hss:latest + container_name: rfsim4g-oai-hss + privileged: true + depends_on: [cassandra] + networks: + private_net: + ipv4_address: 192.168.68.3 + public_net: + ipv4_address: 192.168.61.2 + environment: + REALM: openairinterface.org + HSS_FQDN: hss.openairinterface.org + PREFIX: /openair-hss/etc + cassandra_Server_IP: 192.168.68.2 + OP_KEY: 1006020f0a478bf6b699f15c062e42b3 + LTE_K: fec86ba6eb707ed08905757b1bb44b8f + APN1: oai.ipv4 + APN2: internet + FIRST_IMSI: 208960100000001 + NB_USERS: 10 + healthcheck: + test: /bin/bash -c "pgrep oai_hss" + interval: 10s + timeout: 5s + retries: 5 + + oai_mme: + image: oai-mme:latest + container_name: rfsim4g-oai-mme + privileged: true + depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.3 + environment: + REALM: openairinterface.org + PREFIX: /openair-mme/etc + INSTANCE: 1 + PID_DIRECTORY: /var/run + HSS_IP_ADDR: 192.168.61.2 + HSS_HOSTNAME: hss + HSS_FQDN: hss.openairinterface.org + HSS_REALM: openairinterface.org + MCC: '208' + MNC: '96' + MME_GID: 32768 + MME_CODE: 3 + TAC_0: 1 + TAC_1: 2 + TAC_2: 3 + MME_FQDN: mme.openairinterface.org + MME_S6A_IP_ADDR: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S1_MME: eth0 + MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S11: eth0 + MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S10: lo + MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 + OUTPUT: CONSOLE + SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 + PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 + PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 + MCC_SGW_0: '208' + MNC3_SGW_0: '096' + TAC_LB_SGW_0: '01' + TAC_HB_SGW_0: '00' + MCC_MME_0: '208' + MNC3_MME_0: '096' + TAC_LB_MME_0: '02' + TAC_HB_MME_0: '00' + MCC_MME_1: '208' + MNC3_MME_1: '096' + TAC_LB_MME_1: '03' + TAC_HB_MME_1: '00' + TAC_LB_SGW_TEST_0: '03' + TAC_HB_SGW_TEST_0: '00' + SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + healthcheck: + test: /bin/bash -c "pgrep oai_mme" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwc: + image: oai-spgwc:latest + privileged: true + depends_on: [oai_mme] + container_name: rfsim4g-oai-spgwc + networks: + public_net: + ipv4_address: 192.168.61.4 + environment: + TZ: Europe/Paris + SGW_INTERFACE_NAME_FOR_S11: eth0 + PGW_INTERFACE_NAME_FOR_SX: eth0 + DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 + PUSH_PROTOCOL_OPTION: 'true' + APN_NI_1: oai.ipv4 + APN_NI_2: oai.ipv4_2 + DEFAULT_APN_NI_1: oai.ipv4 + UE_IP_ADDRESS_POOL_1: '12.0.0.2 - 12.0.0.254' + UE_IP_ADDRESS_POOL_2: '12.1.1.2 - 12.1.1.254' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwc" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwu: + image: oai-spgwu-tiny:latest + privileged: true + container_name: rfsim4g-oai-spgwu-tiny + depends_on: [oai_spgwc] + networks: + public_net: + ipv4_address: 192.168.61.5 + environment: + TZ: Europe/Paris + PID_DIRECTORY: /var/run + INSTANCE: 1 + SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP: eth0 + PGW_INTERFACE_NAME_FOR_SGI: eth0 + SGW_INTERFACE_NAME_FOR_SX: eth0 + SPGWC0_IP_ADDRESS: 192.168.61.4 + NETWORK_UE_IP: '12.0.0.0/24' + NETWORK_UE_NAT_OPTION: 'yes' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwu" + interval: 10s + timeout: 5s + retries: 5 + + trf_gen: + image: trf-gen:production + privileged: true + container_name: rfsim4g-trf-gen + networks: + public_net: + ipv4_address: 192.168.61.11 + entrypoint: /bin/bash -c "ip route add 12.0.0.0/24 via 192.168.61.5 dev eth0; sleep infinity" + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.61.5" + interval: 10s + timeout: 5s + retries: 5 + + enb: + image: oai-enb:develop + privileged: true + container_name: rfsim4g-oai-enb + networks: + public_net: + ipv4_address: 192.168.61.20 + environment: + TZ: Europe/Paris + USE_FDD_MONO: 'yes' + RFSIMULATOR: enb + ENB_NAME: eNB-rf-sim + MCC: '208' + MNC: '96' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 10 + NB_PRB: 50 + MME_S1C_IP_ADDRESS: 192.168.61.3 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 192.168.61.20 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 192.168.61.20 + ENB_X2_IP_ADDRESS: 192.168.61.20 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 192.168.61.10 + USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai_ue0: + image: oai-lte-ue:develop + privileged: true + container_name: rfsim4g-oai-lte-ue0 + networks: + public_net: + ipv4_address: 192.168.61.30 + expose: + - "10000" + environment: + TZ: Europe/Paris + HOSTNAME: oai_ue0 + RFSIMULATOR: 192.168.61.20 + MCC: '208' + MNC: '96' + SHORT_IMSI: '0100000001' + LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'c42449363bbad02b66d16bc975d77cc1' + MSISDN: '001011234561010' + HPLMN: 20896 + USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 50 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + private_net: + name: rfsim4g-oai-private-net + ipam: + config: + - subnet: 192.168.68.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-private" + public_net: + name: rfsim4g-oai-public-net + ipam: + config: + - subnet: 192.168.61.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-public" diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml new file mode 100644 index 0000000000..4a61181afb --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml @@ -0,0 +1,272 @@ +version: '3.8' + +services: + cassandra: + image: cassandra:2.1 + container_name: rfsim4g-cassandra + networks: + private_net: + ipv4_address: 192.168.68.2 + environment: + CASSANDRA_CLUSTER_NAME: "OAI HSS Cluster" + CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch + healthcheck: + test: /bin/bash -c "nodetool status" + interval: 10s + timeout: 5s + retries: 5 + + db_init: + image: cassandra:2.1 + container_name: rfsim4g-db-init + depends_on: [cassandra] + deploy: + restart_policy: + condition: on-failure + max_attempts: 10 + networks: + private_net: + ipv4_address: 192.168.68.4 + volumes: + - ../4g_rfsimulator_fdd_05MHz/oai_db.cql:/home/oai_db.cql + entrypoint: /bin/bash -c "cqlsh --file /home/oai_db.cql 192.168.68.2 && echo 'OK'" + + oai_hss: + image: oai-hss:latest + container_name: rfsim4g-oai-hss + privileged: true + depends_on: [cassandra] + networks: + private_net: + ipv4_address: 192.168.68.3 + public_net: + ipv4_address: 192.168.61.2 + environment: + REALM: openairinterface.org + HSS_FQDN: hss.openairinterface.org + PREFIX: /openair-hss/etc + cassandra_Server_IP: 192.168.68.2 + OP_KEY: 1006020f0a478bf6b699f15c062e42b3 + LTE_K: fec86ba6eb707ed08905757b1bb44b8f + APN1: oai.ipv4 + APN2: internet + FIRST_IMSI: 208960100000001 + NB_USERS: 10 + healthcheck: + test: /bin/bash -c "pgrep oai_hss" + interval: 10s + timeout: 5s + retries: 5 + + oai_mme: + image: oai-mme:latest + container_name: rfsim4g-oai-mme + privileged: true + depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.3 + environment: + REALM: openairinterface.org + PREFIX: /openair-mme/etc + INSTANCE: 1 + PID_DIRECTORY: /var/run + HSS_IP_ADDR: 192.168.61.2 + HSS_HOSTNAME: hss + HSS_FQDN: hss.openairinterface.org + HSS_REALM: openairinterface.org + MCC: '208' + MNC: '96' + MME_GID: 32768 + MME_CODE: 3 + TAC_0: 1 + TAC_1: 2 + TAC_2: 3 + MME_FQDN: mme.openairinterface.org + MME_S6A_IP_ADDR: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S1_MME: eth0 + MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S11: eth0 + MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S10: lo + MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 + OUTPUT: CONSOLE + SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 + PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 + PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 + MCC_SGW_0: '208' + MNC3_SGW_0: '096' + TAC_LB_SGW_0: '01' + TAC_HB_SGW_0: '00' + MCC_MME_0: '208' + MNC3_MME_0: '096' + TAC_LB_MME_0: '02' + TAC_HB_MME_0: '00' + MCC_MME_1: '208' + MNC3_MME_1: '096' + TAC_LB_MME_1: '03' + TAC_HB_MME_1: '00' + TAC_LB_SGW_TEST_0: '03' + TAC_HB_SGW_TEST_0: '00' + SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + healthcheck: + test: /bin/bash -c "pgrep oai_mme" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwc: + image: oai-spgwc:latest + privileged: true + depends_on: [oai_mme] + container_name: rfsim4g-oai-spgwc + networks: + public_net: + ipv4_address: 192.168.61.4 + environment: + TZ: Europe/Paris + SGW_INTERFACE_NAME_FOR_S11: eth0 + PGW_INTERFACE_NAME_FOR_SX: eth0 + DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 + PUSH_PROTOCOL_OPTION: 'true' + APN_NI_1: oai.ipv4 + APN_NI_2: oai.ipv4_2 + DEFAULT_APN_NI_1: oai.ipv4 + UE_IP_ADDRESS_POOL_1: '12.0.0.2 - 12.0.0.254' + UE_IP_ADDRESS_POOL_2: '12.1.1.2 - 12.1.1.254' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwc" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwu: + image: oai-spgwu-tiny:latest + privileged: true + container_name: rfsim4g-oai-spgwu-tiny + depends_on: [oai_spgwc] + networks: + public_net: + ipv4_address: 192.168.61.5 + environment: + TZ: Europe/Paris + PID_DIRECTORY: /var/run + INSTANCE: 1 + SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP: eth0 + PGW_INTERFACE_NAME_FOR_SGI: eth0 + SGW_INTERFACE_NAME_FOR_SX: eth0 + SPGWC0_IP_ADDRESS: 192.168.61.4 + NETWORK_UE_IP: '12.0.0.0/24' + NETWORK_UE_NAT_OPTION: 'yes' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwu" + interval: 10s + timeout: 5s + retries: 5 + + trf_gen: + image: trf-gen:production + privileged: true + container_name: rfsim4g-trf-gen + networks: + public_net: + ipv4_address: 192.168.61.11 + entrypoint: /bin/bash -c "ip route add 12.0.0.0/24 via 192.168.61.5 dev eth0; sleep infinity" + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.61.5" + interval: 10s + timeout: 5s + retries: 5 + + enb: + image: oai-enb:develop + privileged: true + container_name: rfsim4g-oai-enb + networks: + public_net: + ipv4_address: 192.168.61.20 + environment: + TZ: Europe/Paris + USE_FDD_MONO: 'yes' + RFSIMULATOR: enb + ENB_NAME: eNB-rf-sim + MCC: '208' + MNC: '96' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 10 + NB_PRB: 100 + MME_S1C_IP_ADDRESS: 192.168.61.3 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 192.168.61.20 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 192.168.61.20 + ENB_X2_IP_ADDRESS: 192.168.61.20 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 192.168.61.10 + USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai_ue0: + image: oai-lte-ue:develop + privileged: true + container_name: rfsim4g-oai-lte-ue0 + networks: + public_net: + ipv4_address: 192.168.61.30 + expose: + - "10000" + environment: + TZ: Europe/Paris + HOSTNAME: oai_ue0 + RFSIMULATOR: 192.168.61.20 + MCC: '208' + MNC: '96' + SHORT_IMSI: '0100000001' + LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'c42449363bbad02b66d16bc975d77cc1' + MSISDN: '001011234561010' + HPLMN: 20896 + USE_ADDITIONAL_OPTIONS: --rfsim -C 2680000000 -r 100 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + private_net: + name: rfsim4g-oai-private-net + ipam: + config: + - subnet: 192.168.68.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-private" + public_net: + name: rfsim4g-oai-public-net + ipam: + config: + - subnet: 192.168.61.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-public" diff --git a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml new file mode 100644 index 0000000000..3424780791 --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml @@ -0,0 +1,271 @@ +version: '3.8' + +services: + cassandra: + image: cassandra:2.1 + container_name: rfsim4g-cassandra + networks: + private_net: + ipv4_address: 192.168.68.2 + environment: + CASSANDRA_CLUSTER_NAME: "OAI HSS Cluster" + CASSANDRA_ENDPOINT_SNITCH: GossipingPropertyFileSnitch + healthcheck: + test: /bin/bash -c "nodetool status" + interval: 10s + timeout: 5s + retries: 5 + + db_init: + image: cassandra:2.1 + container_name: rfsim4g-db-init + depends_on: [cassandra] + deploy: + restart_policy: + condition: on-failure + max_attempts: 10 + networks: + private_net: + ipv4_address: 192.168.68.4 + volumes: + - ../4g_rfsimulator_fdd_05MHz/oai_db.cql:/home/oai_db.cql + entrypoint: /bin/bash -c "cqlsh --file /home/oai_db.cql 192.168.68.2 && echo 'OK'" + + oai_hss: + image: oai-hss:latest + container_name: rfsim4g-oai-hss + privileged: true + depends_on: [cassandra] + networks: + private_net: + ipv4_address: 192.168.68.3 + public_net: + ipv4_address: 192.168.61.2 + environment: + REALM: openairinterface.org + HSS_FQDN: hss.openairinterface.org + PREFIX: /openair-hss/etc + cassandra_Server_IP: 192.168.68.2 + OP_KEY: 1006020f0a478bf6b699f15c062e42b3 + LTE_K: fec86ba6eb707ed08905757b1bb44b8f + APN1: oai.ipv4 + APN2: internet + FIRST_IMSI: 208960100000001 + NB_USERS: 10 + healthcheck: + test: /bin/bash -c "pgrep oai_hss" + interval: 10s + timeout: 5s + retries: 5 + + oai_mme: + image: oai-mme:latest + container_name: rfsim4g-oai-mme + privileged: true + depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.3 + environment: + REALM: openairinterface.org + PREFIX: /openair-mme/etc + INSTANCE: 1 + PID_DIRECTORY: /var/run + HSS_IP_ADDR: 192.168.61.2 + HSS_HOSTNAME: hss + HSS_FQDN: hss.openairinterface.org + HSS_REALM: openairinterface.org + MCC: '208' + MNC: '96' + MME_GID: 32768 + MME_CODE: 3 + TAC_0: 1 + TAC_1: 2 + TAC_2: 3 + MME_FQDN: mme.openairinterface.org + MME_S6A_IP_ADDR: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S1_MME: eth0 + MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S11: eth0 + MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 + MME_INTERFACE_NAME_FOR_S10: lo + MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 + OUTPUT: CONSOLE + SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 + PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 + PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 + MCC_SGW_0: '208' + MNC3_SGW_0: '096' + TAC_LB_SGW_0: '01' + TAC_HB_SGW_0: '00' + MCC_MME_0: '208' + MNC3_MME_0: '096' + TAC_LB_MME_0: '02' + TAC_HB_MME_0: '00' + MCC_MME_1: '208' + MNC3_MME_1: '096' + TAC_LB_MME_1: '03' + TAC_HB_MME_1: '00' + TAC_LB_SGW_TEST_0: '03' + TAC_HB_SGW_TEST_0: '00' + SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + healthcheck: + test: /bin/bash -c "pgrep oai_mme" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwc: + image: oai-spgwc:latest + privileged: true + depends_on: [oai_mme] + container_name: rfsim4g-oai-spgwc + networks: + public_net: + ipv4_address: 192.168.61.4 + environment: + TZ: Europe/Paris + SGW_INTERFACE_NAME_FOR_S11: eth0 + PGW_INTERFACE_NAME_FOR_SX: eth0 + DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 + PUSH_PROTOCOL_OPTION: 'true' + APN_NI_1: oai.ipv4 + APN_NI_2: oai.ipv4_2 + DEFAULT_APN_NI_1: oai.ipv4 + UE_IP_ADDRESS_POOL_1: '12.0.0.2 - 12.0.0.254' + UE_IP_ADDRESS_POOL_2: '12.1.1.2 - 12.1.1.254' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwc" + interval: 10s + timeout: 5s + retries: 5 + + oai_spgwu: + image: oai-spgwu-tiny:latest + privileged: true + container_name: rfsim4g-oai-spgwu-tiny + depends_on: [oai_spgwc] + networks: + public_net: + ipv4_address: 192.168.61.5 + environment: + TZ: Europe/Paris + PID_DIRECTORY: /var/run + INSTANCE: 1 + SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP: eth0 + PGW_INTERFACE_NAME_FOR_SGI: eth0 + SGW_INTERFACE_NAME_FOR_SX: eth0 + SPGWC0_IP_ADDRESS: 192.168.61.4 + NETWORK_UE_IP: '12.0.0.0/24' + NETWORK_UE_NAT_OPTION: 'yes' + MCC: '208' + MNC: '96' + MNC03: '096' + TAC: 1 + GW_ID: 1 + REALM: openairinterface.org + healthcheck: + test: /bin/bash -c "pgrep oai_spgwu" + interval: 10s + timeout: 5s + retries: 5 + + trf_gen: + image: trf-gen:production + privileged: true + container_name: rfsim4g-trf-gen + networks: + public_net: + ipv4_address: 192.168.61.11 + entrypoint: /bin/bash -c "ip route add 12.0.0.0/24 via 192.168.61.5 dev eth0; sleep infinity" + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.61.5" + interval: 10s + timeout: 5s + retries: 5 + + enb: + image: oai-enb:develop + privileged: true + container_name: rfsim4g-oai-enb + networks: + public_net: + ipv4_address: 192.168.61.20 + environment: + TZ: Europe/Paris + USE_TDD_MONO: 'yes' + RFSIMULATOR: enb + ENB_NAME: eNB-rf-sim + MCC: '208' + MNC: '96' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 38 + DL_FREQUENCY_IN_MHZ: 2605 + UL_FREQUENCY_OFFSET_IN_MHZ: 0 + NID_CELL: 10 + NB_PRB: 25 + MME_S1C_IP_ADDRESS: 192.168.61.3 + S1C_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 192.168.61.20 + S1U_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 192.168.61.20 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 192.168.61.10 + USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + oai_ue0: + image: oai-lte-ue:develop + privileged: true + container_name: rfsim4g-oai-lte-ue0 + networks: + public_net: + ipv4_address: 192.168.61.30 + expose: + - "10000" + environment: + TZ: Europe/Paris + HOSTNAME: oai_ue0 + RFSIMULATOR: 192.168.61.20 + MCC: '208' + MNC: '96' + SHORT_IMSI: '0100000001' + LTE_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'c42449363bbad02b66d16bc975d77cc1' + MSISDN: '001011234561010' + HPLMN: 20896 + USE_ADDITIONAL_OPTIONS: --rfsim -T -C 2605000000 -r 25 --ue-rxgain 140 --ue-txgain 120 --nokrnmod 1 --log_config.global_log_options level,nocolor,time + healthcheck: + test: /bin/bash -c "pgrep lte-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + private_net: + name: rfsim4g-oai-private-net + ipam: + config: + - subnet: 192.168.68.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-private" + public_net: + name: rfsim4g-oai-public-net + ipam: + config: + - subnet: 192.168.61.0/26 + driver_opts: + com.docker.network.bridge.name: "rfsim4g-public" From 34409bacc0dc12d65e7d92b5f88e6a1e66c438ef Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 21 Jan 2022 10:52:39 +0000 Subject: [PATCH 289/883] Address review comments --- executables/nr-ue.c | 3 +++ openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 3 ++- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index ed1a7d262d..cd78449574 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -843,6 +843,9 @@ int computeSamplesShift(PHY_VARS_NR_UE *UE) { int samples_shift = -(UE->rx_offset>>1); UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied + if (samples_shift != 0) { + LOG_I(NR_PHY,"Adjusting frame in time by %i samples\n", samples_shift); + } return samples_shift; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index d10fe67726..6acafe4653 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -247,11 +247,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, LOG_I(PHY,"sync_pos %d ssb_offset %d \n",sync_pos,ue->ssb_offset); #endif + accumulated_freq_offset += ue->common_vars.freq_offset; + // digital compensation of FFO for SSB symbols if (ue->UE_fo_compensation){ double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample - accumulated_freq_offset += ue->common_vars.freq_offset; // In SA we need to perform frequency offset correction until the end of buffer because we need to decode SIB1 // and we do not know yet in which slot it goes. diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index ef96df2995..c8fc2ba761 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -53,7 +53,7 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL - # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + # this is 2574.270 MHz + 53 PRBs@30kHz SCS (same as initial BWP) absoluteFrequencySSB = 518670; dl_frequencyBand = 41; # this is 3600 MHz @@ -66,7 +66,7 @@ gNBs = dl_carrierBandwidth = 106; #initialDownlinkBWP #genericParameters - # this is RBstart=27,L=48 (275*(L-1))+RBstart + # this is RBstart=0,L=106 (275*(L-1))+RBstart initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 From aa4db6057b18fe2273c5ea04cc44a8ec860e29cb Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Tue, 4 Jan 2022 18:39:45 +0530 Subject: [PATCH 290/883] updated ldpctest --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 65 ++++++++++++------- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 10 ++- 2 files changed, 50 insertions(+), 25 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 3ae15293cb..875cdf6cdc 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -30,6 +30,7 @@ #include "openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.h" #include "openair1/PHY/defs_nr_common.h" #include "coding_unitary_defs.h" +#include "common/utils/LOG/log.h" #define MAX_BLOCK_LENGTH 8448 @@ -78,9 +79,12 @@ char quantize8bit(double D,double x) } typedef struct { - double n_iter_mean; - double n_iter_std; - int n_iter_max; + double n_iter_mean[100]; + double n_iter_std[100]; + int n_iter_max[100]; + double snr[100]; + double ber[100]; + double bler[100]; } n_iter_stats_t; nrLDPC_encoderfunc_t encoder_orig; @@ -101,8 +105,8 @@ int test_ldpc(short No_iteration, unsigned int *crc_misses, time_stats_t *time_optim, time_stats_t *time_decoder, - n_iter_stats_t *dec_iter - ) + n_iter_stats_t *dec_iter, + int nsnr) { //clock initiate //time_stats_t time,time_optim,tinput,tprep,tparity,toutput, time_decoder; @@ -280,6 +284,15 @@ int test_ldpc(short No_iteration, // printf("puncture:%d\n",no_punctured_columns); removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate)); encoder_implemparams_t impp=INIT0_LDPCIMPLEMPARAMS; + + // CRC attachement + for (j=0; j>8; + test_input[j][(block_length-24)>>3] = ((uint8_t*)&crc)[2]; + test_input[j][1+((block_length-24)>>3)] = ((uint8_t*)&crc)[1]; + test_input[j][2+((block_length-24)>>3)] = ((uint8_t*)&crc)[0]; + } impp.gen_code=1; if (ntrials==0) @@ -402,7 +415,7 @@ int test_ldpc(short No_iteration, //count errors for(j=0;j>3; i++) + for (i=0; i<(block_length-24)>>3; i++) { //printf("block_length>>3: %d \n",block_length>>3); /// printf("i: %d \n",i); @@ -416,7 +429,7 @@ int test_ldpc(short No_iteration, } } - for (i=0; i>(i&7); test_input_bit[i] = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments @@ -446,9 +459,9 @@ int test_ldpc(short No_iteration, } - dec_iter->n_iter_mean = n_iter_mean/(double)ntrials/(double)n_segments - 1; - dec_iter->n_iter_std = sqrt(n_iter_std/(double)ntrials/(double)n_segments - pow(n_iter_mean/(double)ntrials/(double)n_segments - 1,2)); - dec_iter->n_iter_max = n_iter_max -1; + dec_iter->n_iter_mean[nsnr] = n_iter_mean/(double)ntrials/(double)n_segments - 1; + dec_iter->n_iter_std[nsnr] = sqrt(n_iter_std/(double)ntrials/(double)n_segments - pow(n_iter_mean/(double)ntrials/(double)n_segments - 1,2)); + dec_iter->n_iter_max[nsnr] = n_iter_max -1; *errors_bit_uncoded = *errors_bit_uncoded / (double)((Kb+nrows-no_punctured_columns-2) * Zc-removed_bit); @@ -515,7 +528,7 @@ int main(int argc, char *argv[]) int test_uncoded= 0; time_stats_t time_optim[10], time_decoder[10]; - n_iter_stats_t dec_iter[3]; + n_iter_stats_t dec_iter; short BG=0,Zc,Kb=0; if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) { @@ -682,14 +695,18 @@ int main(int argc, char *argv[]) &crc_misses, time_optim, time_decoder, - dec_iter); + &dec_iter, + i); - printf("SNR %f, BLER %f (%u/%d)\n", SNR, (float)decoded_errors[i]/(float)n_trials, decoded_errors[i], n_trials); - printf("SNR %f, BER %f (%u/%d)\n", SNR, (float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments, decoded_errors[i], n_trials); + dec_iter.snr[i] = SNR; + dec_iter.ber[i] = (float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments; + dec_iter.bler[i] = (float)decoded_errors[i]/(float)n_trials; + printf("SNR %f, BLER %f (%u/%d)\n", SNR, dec_iter.bler[i], decoded_errors[i], n_trials); + printf("SNR %f, BER %f (%u/%d)\n", SNR, dec_iter.ber[i], decoded_errors[i], n_trials); printf("SNR %f, Uncoded BER %f (%u/%d)\n",SNR, errors_bit_uncoded/(float)n_trials/(double)n_segments, decoded_errors[i], n_trials); - printf("SNR %f, Mean iterations: %f\n",SNR, dec_iter->n_iter_mean); - printf("SNR %f, Std iterations: %f\n",SNR, dec_iter->n_iter_std); - printf("SNR %f, Max iterations: %d\n",SNR, dec_iter->n_iter_max); + printf("SNR %f, Mean iterations: %f\n",SNR, dec_iter.n_iter_mean[i]); + printf("SNR %f, Std iterations: %f\n",SNR, dec_iter.n_iter_std[i]); + printf("SNR %f, Max iterations: %d\n",SNR, dec_iter.n_iter_max[i]); printf("\n"); printf("Encoding time mean: %15.3f us\n",(double)time_optim->diff/time_optim->trials/1000.0/get_cpu_freq_GHz()); printf("Encoding time std: %15.3f us\n",sqrt((double)time_optim->diff_square/time_optim->trials/pow(1000,2)/pow(get_cpu_freq_GHz(),2)-pow((double)time_optim->diff/time_optim->trials/1000.0/get_cpu_freq_GHz(),2))); @@ -710,16 +727,20 @@ int main(int argc, char *argv[]) (double)time_decoder->diff/time_decoder->trials/1000.0/get_cpu_freq_GHz(), sqrt((double)time_decoder->diff_square/time_decoder->trials/pow(1000,2)/pow(get_cpu_freq_GHz(),2)-pow((double)time_decoder->diff/time_decoder->trials/1000.0/get_cpu_freq_GHz(),2)), (double)time_decoder->max/1000.0/get_cpu_freq_GHz(), - dec_iter->n_iter_mean, - dec_iter->n_iter_std, - dec_iter->n_iter_max + dec_iter.n_iter_mean[i], + dec_iter.n_iter_std[i], + dec_iter.n_iter_max[i] ); - if (decoded_errors[i] == 0) break; - i=i+1; + if (decoded_errors[i-1] == 0) break; + } fclose(fd); + LOG_M("ldpctestStats.m","SNR",&dec_iter.snr[0],i,1,7); + LOG_MM("ldpctestStats.m","BLER",&dec_iter.bler[0],i,1,7); + LOG_MM("ldpctestStats.m","BER",&dec_iter.ber[0],i,1,7); + LOG_MM("ldpctestStats.m","meanIter",&dec_iter.n_iter_mean[0],i,1,7); return(0); } diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 51d051e0ca..d9b075e2ed 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -105,7 +105,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint { NR_gNB_ULSCH_t *ulsch; - uint8_t i,r; + uint8_t exit_flag = 0,i,r; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated if (N_RB_UL != 273) { @@ -167,9 +167,13 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint exit_flag=1; } } + + if (exit_flag==0) + return(ulsch); } - - return(ulsch); + printf("new_gNB_ulsch with size %zu: exit_flag = %hhu\n",sizeof(NR_UL_gNB_HARQ_t), exit_flag); + free_gNB_ulsch(&ulsch,N_RB_UL); + return(NULL); } void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch) From 4fb330e4cc2fee53bda96c63a144600ec9bec5db Mon Sep 17 00:00:00 2001 From: Sofia Pison Date: Fri, 21 Jan 2022 14:27:40 +0100 Subject: [PATCH 291/883] Modified CMakeLists to enable the run with address sanitizer without specifying LD_LIBRARY_PATH --- cmake_targets/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f2eda66fc0..7160a52620 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -343,8 +343,8 @@ set(CMAKE_CXX_FLAGS if (SANITIZE_ADDRESS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-common") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-common") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common") endif () add_definitions("-DASN_DISABLE_OER_SUPPORT") From 9b9d0d6f0638a9db39ef73804bef58975e163423 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 24 Jan 2022 11:51:38 +0100 Subject: [PATCH 292/883] addressing review comments --- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 13 ++++++------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- openair2/RRC/NR/nr_rrc_config.c | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index a7332a3220..c07cb70d21 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -180,17 +180,16 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, } int rb_count = 0; + int data_sc = 9; // 9 sub-carriers with data per PRB for (int c_id = 0; c_id < number_of_candidates; c_id++ ) { for (int symbol_idx = start_symbol; symbol_idx < start_symbol+coreset_time_dur; symbol_idx++) { for (int cce_count = 0; cce_count < L[c_id]; cce_count ++) { - for (int k=0; k<6/reg_bundle_size_L; k++) { // loop over REG bundles - int f = f_bundle_j_list_ord[c_id][k+6*cce_count/reg_bundle_size_L]; + for (int k=0; k \t llr[%d]=(%d,%d) \n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 22f2ea05d9..5dc10b2317 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1612,7 +1612,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra harq->tb_size = nr_compute_tbs(nr_get_Qm_dl(mcsIndex, mcsTableIdx), nr_get_code_rate_dl(mcsIndex, mcsTableIdx), rbSize, nrOfSymbols, N_PRB_DMRS * N_DMRS_SLOT, 0, tb_scaling,1) >> 3; - } while (harq->tb_size < ra->mac_pdu_length); + } while (harq->tb_size < ra->mac_pdu_length && mcsIndex<=28); int i = 0; while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 82c3931421..ba969ac1be 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -35,10 +35,10 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; + // coreset duration setting to be improved in the framework of RRC harmonization, potentially using a common function int len_coreset = 1; if (curr_bwp < 48) len_coreset = 2; - // setting default TDA for DL with struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; From c4f88781e56437f49e6927cf3c7fa5bb1bd67580 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 24 Jan 2022 14:19:31 +0100 Subject: [PATCH 293/883] ue sync, assert in wrong PUCCH decoded values --- openair1/SCHED/phy_procedures_lte_eNb.c | 130 ++++++++++++++---------- targets/RT/USER/lte-ue.c | 12 ++- 2 files changed, 88 insertions(+), 54 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 569d2a464a..3d655bc464 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1939,6 +1939,8 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har pthread_mutex_unlock(&eNB->UL_INFO_mutex); } +#define packetError(ConD, fmt, args...) if (!(ConD)) { LOG_E(PHY, fmt, args); discard=true; } + void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) { if ( split73 == SPLIT73_DU ) { sendFs6Ulharq(fs6ULindicationHarq, UEid, eNB, uci, frame, subframe, harq_ack, tdd_mapping_mode, tdd_multiplexing_mask, 0, 0); @@ -1954,6 +1956,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in } pthread_mutex_lock(&eNB->UL_INFO_mutex); + bool discard=false; nfapi_harq_indication_t *ind = &eNB->UL_INFO.harq_ind; nfapi_harq_indication_body_t *body = &ind->harq_indication_body; assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU); @@ -1986,73 +1989,87 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG; pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1; - AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]); - pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; - // release DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]); + if (!discard) { + pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; + // release DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->pucch_fmt == pucch_format1b) { pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG; pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2; - AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]); - AssertFatal (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]); - pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; - pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1]; - // release DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); - } else AssertFatal(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt); + packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]); + packetError (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]); + if (!discard) { + pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; + pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1]; + // release DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } + } else + packetError(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt); } else { // TDD - AssertFatal (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode); - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; - LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, - tdd_mapping_mode,harq_ack[0],harq_ack[1]); + packetError (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode); + if (!discard) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; + LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, + tdd_mapping_mode,harq_ack[0],harq_ack[1]); - switch (tdd_mapping_mode) { + switch (tdd_mapping_mode) { case 0: // bundling if (uci->pucch_fmt == pucch_format1a) { pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; LOG_D(PHY,"bundling, pucch1a, number of ack nack %d\n",pdu->harq_indication_tdd_rel13.number_of_ack_nack); - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; - // release all bundled DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; + // release all bundled DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->pucch_fmt == pucch_format1b) { pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); - AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; - pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + if (!discard) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } } break; case 1: // multiplexing - AssertFatal (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt); - - if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) { - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); - pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt); + if (!discard) { + if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1b) { - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); - AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); - pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; - pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } } else { // num_pucch_resources (M) > 1 pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.number_of_ack_nack = uci->num_pucch_resources; @@ -2068,7 +2085,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in release_harq(eNB,DLSCH_id,1,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */); } - break; + break; case 2: // special bundling (SR collision) pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; @@ -2118,16 +2135,23 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in } else { pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0; } - + break; } break; + } + } } } //TDD - - eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++; - LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs); + + if (!discard) { + eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++; + LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs); + } else { + LOG_W(PHY,"discarded a PUCCH because the decoded values are impossible\n"); + } + pthread_mutex_unlock(&eNB->UL_INFO_mutex); } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 1643ca36ca..a48bef64b6 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -2023,8 +2023,18 @@ void *UE_thread(void *arg) if (is_synchronized == 0) { if (instance_cnt_synch < 0) { // we can invoke the synch - // grab 10 ms of signal and wakeup synch thread + // we shift in time flow because the UE doesn't detect sync when frame alignment is not easy + for (int i=0; iframe_parms.nb_antennas_rx; i++) + rxp[i] = (void *)&dummy_rx[i][0]; + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + rxp, + UE->frame_parms.samples_per_tti/2, + UE->frame_parms.nb_antennas_rx); + + // grab 10 ms of signal and wakeup synch thread + if (UE->mode != loop_through_memory) { if (IS_SOFTMODEM_RFSIM ) { for(int sf=0; sf<10; sf++) { From 13a16bc29f4a89252eb7af74756c89aaa1ee028e Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 24 Jan 2022 14:59:12 +0100 Subject: [PATCH 294/883] remove separate dir from phy_simulators binaries and compile options --- ci-scripts/cls_physim.py | 2 +- cmake_targets/build_oai | 17 +++++++-------- .../install_external_packages.ubuntu20 | 1 - cmake_targets/phy_simulators | 1 + cmake_targets/phy_simulators/CMakeLists.txt | 21 ------------------- cmake_targets/tools/build_helper | 2 +- doc/BUILD.md | 2 +- docker/Dockerfile.phySim.rhel8.2 | 8 +++---- 8 files changed, 15 insertions(+), 39 deletions(-) create mode 120000 cmake_targets/phy_simulators delete mode 100755 cmake_targets/phy_simulators/CMakeLists.txt diff --git a/ci-scripts/cls_physim.py b/ci-scripts/cls_physim.py index e825b2f7bd..33792f6ca4 100644 --- a/ci-scripts/cls_physim.py +++ b/ci-scripts/cls_physim.py @@ -183,7 +183,7 @@ class PhySim: mySSH.open(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord) mySSH.command('cd '+self.__workSpacePath,'\$',5) #run and redirect the results to a log file - mySSH.command(self.__workSpacePath+'phy_simulators/build/ldpctest ' + self.runargs + ' >> '+self.__runLogFile, '\$', 30) + mySSH.command(self.__workSpacePath+'ran_build/build/ldpctest ' + self.runargs + ' >> '+self.__runLogFile, '\$', 30) mySSH.close() #return updated HTML to main lHTML = html.HTMLManagement() diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 68aef48c6b..2ffc4a7a08 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -57,7 +57,7 @@ BUILD_DOXYGEN=0 BUILD_COVERITY_SCAN=0 T_TRACER="True" DISABLE_HARDWARE_DEPENDENCY="False" -CMAKE_BUILD_TYPE="" +CMAKE_BUILD_TYPE="RelWithDebInfo" CMAKE_CMD="$CMAKE" UE_AUTOTEST_TRACE="False" UE_DEBUG_TRACE="False" @@ -585,15 +585,12 @@ function main() { echo_info "3. building the compilation directives ..." DIR=$OPENAIR_DIR/cmake_targets - if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then - build_dir=phy_simulators - else - if [ "$T_TRACER" = "False" ] ; then + if [ "$T_TRACER" = "False" ] ; then build_dir=ran_build_noLOG - else + else build_dir=ran_build - fi fi + [ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build mkdir -p $DIR/$build_dir/build @@ -742,11 +739,11 @@ function main() { # simlist="ldpctest" for f in $simlist ; do compilations \ - phy_simulators $f \ + ran_build $f \ $f $dbin/$f.$REL done compilations \ - phy_simulators coding \ + ran_build coding \ libcoding.so $dbin/libcoding.so # compilations \ # lte-simulators $config_libconfig_shlib \ @@ -761,7 +758,7 @@ function main() { simlist="secu_knas_encrypt_eia1 secu_kenb aes128_ctr_encrypt aes128_ctr_decrypt secu_knas_encrypt_eea2 secu_knas secu_knas_encrypt_eea1 kdf aes128_cmac_encrypt secu_knas_encrypt_eia2" for f in $simlist ; do compilations \ - phy_simulators test_$f \ + ran_build test_$f \ test_$f $dbin/test_$f.$REL done fi diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index 0023c8d3c8..ebbfb5ada9 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -134,7 +134,6 @@ clean_all_files() { rm -rf "$dir"/ran_build/build rm -rf "$dir"/ran_build_noLOG/build rm -rf "$dir"/lte-simulators/build - rm -rf "$dir"/phy_simulators/build rm -rf "$dir"/nas_sim_tools/build rm -rf "$dir"/oaisim_build_oai/build rm -rf "$dir"/oaisim_build_oai/CMakeLists.txt diff --git a/cmake_targets/phy_simulators b/cmake_targets/phy_simulators new file mode 120000 index 0000000000..2a12e92f3e --- /dev/null +++ b/cmake_targets/phy_simulators @@ -0,0 +1 @@ +ran_build/ \ No newline at end of file diff --git a/cmake_targets/phy_simulators/CMakeLists.txt b/cmake_targets/phy_simulators/CMakeLists.txt deleted file mode 100755 index f8c659959f..0000000000 --- a/cmake_targets/phy_simulators/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project (OpenAirInterface) -set ( CMAKE_BUILD_TYPE ) -set ( CFLAGS_PROCESSOR_USER "" ) -set ( UE_EXPANSION False ) -set ( PRE_SCD_THREAD False ) -set ( ENABLE_VCD_FIFO False ) -set ( RF_BOARD "None") -set ( TRANSP_PRO "None") -set ( PACKAGE_NAME "") -set ( DEADLINE_SCHEDULER "False" ) -set ( CPU_AFFINITY "False" ) -set ( T_TRACER True ) -set ( UE_AUTOTEST_TRACE False ) -set ( UE_DEBUG_TRACE False ) -set ( UE_TIMING_TRACE False ) -set ( USRP_REC_PLAY False ) -set ( SKIP_SHARED_LIB_FLAG False ) -set ( PHYSIM True) -set ( RU 0) -include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 1df7808b0f..ec5de6a0d1 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -168,7 +168,7 @@ clean_all_files() { rm -rf $dir/log $OPENAIR_DIR/targets/bin/* rm -rf $dir/ran_build $dir/ran_build_noLOG rm -rf $dir/lte-simulators/build - rm -rf $dir/phy_simulators/build $dir/nas_sim_tools/build + rm -rf $dir/nas_sim_tools/build rm -rf $dir/oaisim_build_oai/build $dir/oaisim_build_oai/CMakeLists.txt rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build } diff --git a/doc/BUILD.md b/doc/BUILD.md index 40b63ac697..852a248659 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -60,7 +60,7 @@ cd cmake_targets/ ./build_oai -I --phy_simulators ``` -After completing the build, the binaries are available in the cmake_targets/phy_simulators/build directory. +After completing the build, the binaries are available in the cmake_targets/ran_build/build directory. A copy is also available in the target/bin directory, with all binaries suffixed by the 3GPP release number, today **.Rel15**. diff --git a/docker/Dockerfile.phySim.rhel8.2 b/docker/Dockerfile.phySim.rhel8.2 index 141a80cb50..9f4b27ec0e 100644 --- a/docker/Dockerfile.phySim.rhel8.2 +++ b/docker/Dockerfile.phySim.rhel8.2 @@ -85,10 +85,10 @@ COPY --from=phy-sim-build \ /lib64/liblapack.so.3 \ /lib64/libexslt.so.0 \ /lib64/libxslt.so.1 \ - /oai-ran/cmake_targets/phy_simulators/build/libdfts.so \ - /oai-ran/cmake_targets/phy_simulators/build/libSIMU.so \ - /oai-ran/cmake_targets/phy_simulators/build/libldpc.so \ - /oai-ran/cmake_targets/phy_simulators/build/libldpc_orig.so \ + /oai-ran/cmake_targets/ran_build/build/libdfts.so \ + /oai-ran/cmake_targets/ran_build/build/libSIMU.so \ + /oai-ran/cmake_targets/ran_build/build/libldpc.so \ + /oai-ran/cmake_targets/ran_build/build/libldpc_orig.so \ /usr/local/lib/ RUN ldconfig From cd5e07b67cf933df873e2ea6775300dcb3494d75 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 24 Jan 2022 15:06:02 +0100 Subject: [PATCH 295/883] minor change after merge with develop --- executables/nr-ru.c | 1 + 1 file changed, 1 insertion(+) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 6891a360f3..c7375601a6 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1312,6 +1312,7 @@ void *ru_thread( void *param ) { else LOG_I(PHY,"RU %d rf device ready\n",ru->idx); } else LOG_I(PHY,"RU %d no rf device\n",ru->idx); + LOG_I(PHY,"RU %d RF started\n",ru->idx); // start trx write thread if(usrp_tx_thread == 1) { if (ru->start_write_thread) { From 504c529c205ebf15fd773ef708b05654d0a4bd7a Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 24 Jan 2022 15:27:08 +0100 Subject: [PATCH 296/883] small optimisation in build_oai script --- cmake_targets/build_oai | 130 +++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 68 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 2ffc4a7a08..92bcfd88e2 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -598,84 +598,81 @@ function main() { config_libconfig_shlib=params_libconfig # first generate the CMakefile in the right directory - if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$RU" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" -o "$ittiSIM" = "1" -o "$rfsimNas" = "1" ] ; then + # softmodem compilation + + cmake_file=$DIR/$build_dir/CMakeLists.txt + echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file + echo "project (OpenAirInterface)" >> $cmake_file + echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file + echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file + echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file + # echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file + echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file + echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file + echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file + echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file + echo "set ( PACKAGE_NAME \"${exec}\")" >> $cmake_file + echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >> $cmake_file + echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file + echo "set ( T_TRACER $T_TRACER )" >> $cmake_file + echo "set ( UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE )" >> $cmake_file + echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )" >> $cmake_file + echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file + echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file + echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file + echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file + echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file + echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file + cd $DIR/$build_dir/build + eval $CMAKE_CMD - # softmodem compilation - - cmake_file=$DIR/$build_dir/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "project (OpenAirInterface)" >> $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file -# echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file - echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file - echo "set ( PACKAGE_NAME \"${exec}\")" >> $cmake_file - echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >> $cmake_file - echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file - echo "set ( T_TRACER $T_TRACER )" >> $cmake_file - echo "set ( UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE )" >> $cmake_file - echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )" >> $cmake_file - echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file - echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file - echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file - echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file - echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file - cd $DIR/$build_dir/build - eval $CMAKE_CMD - - execlist="" - if [ "$eNB" = "1" ] ; then + execlist="" + if [ "$eNB" = "1" ] ; then execlist="$execlist lte-softmodem" - fi - if [ "$eNBocp" = "1" ] ; then + fi + if [ "$eNBocp" = "1" ] ; then execlist="$execlist ocp-enb" - fi - if [ "$gNB" = "1" ] ; then + fi + if [ "$gNB" = "1" ] ; then execlist="$execlist nr-softmodem" - fi - if [ "$RU" = "1" ] ; then + fi + if [ "$RU" = "1" ] ; then execlist="$execlist oairu" - fi - if [ "$UE" = 1 ] ; then + fi + if [ "$UE" = 1 ] ; then execlist="$execlist lte-uesoftmodem" - fi - if [ "$nrUE" = 1 ] ; then + fi + if [ "$nrUE" = 1 ] ; then execlist="$execlist nr-uesoftmodem" - fi - - if [ "$ittiSIM" = "1" ] ; then + fi + + if [ "$ittiSIM" = "1" ] ; then execlist="$execlist nr-ittisim" - fi - - for f in $execlist ; do + fi + + for f in $execlist ; do echo_info "Compiling $f..." compilations \ - $build_dir $f \ - $f $dbin/$f.$REL - done - - -# mandatory shared libraries common to UE and (e/g)NB - - if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then + $build_dir $f \ + $f $dbin/$f.$REL + done + + + # mandatory shared libraries common to UE and (e/g)NB + + if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then echo_info "Building shared libraries common to UE and gNB" - + + compilations \ + $build_dir $config_libconfig_shlib \ + lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so + compilations \ - $build_dir $config_libconfig_shlib \ - lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so - - compilations \ $build_dir coding \ libcoding.so $dbin/libcoding.so - - fi + fi - + if [ "$UE" = 1 ] ; then echo_info "Compiling UE specific part" @@ -724,11 +721,8 @@ function main() { fi fi - if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then - cd $DIR/$build_dir/build - eval $CMAKE_CMD - fi - + cd $DIR/$build_dir/build + ################## # PHY simulators # ################## From fe4c988c977990b2433c4e95f9b7a31b7a358915 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 24 Jan 2022 15:54:39 +0100 Subject: [PATCH 297/883] nr ue: fix security setting of DRB Maybe this fix won't work for non-openair gNB. We use the same keys and algorithms as for SRBs, which is what openair gNB does. (I hope I'm right there.) To be changed if needed. --- openair2/RRC/NR_UE/rrc_UE.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index bc209afd02..f910ff68d4 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2180,7 +2180,8 @@ nr_rrc_ue_establish_srb2( NULL, radioBearerConfig->drb_ToAddModList, NULL, - 0, + NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm + | (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4), NULL, NULL, kUPenc, From 1d7569b4af5fd53640ed4b0dd9b8246d1d4e3a49 Mon Sep 17 00:00:00 2001 From: sfn Date: Tue, 21 Dec 2021 12:48:21 +0100 Subject: [PATCH 298/883] clean up and optimize UE --- openair1/PHY/INIT/nr_init_ue.c | 50 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 8 +- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 4 +- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 752 ++++-------------- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 15 +- openair1/PHY/defs_nr_UE.h | 2 +- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 4 +- 7 files changed, 190 insertions(+), 645 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index d31c3d806c..d3d36343e8 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -64,7 +64,7 @@ extern uint16_t beta_cqi[16]; * \param[in] frame_parms LTE_DL_FRAME_PARMS structure. * \note This function is optimistic in that it expects malloc() to succeed. */ -void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch, +void phy_init_nr_ue_PDSCH(NR_UE_PDSCH *const pdsch, const NR_DL_FRAME_PARMS *const fp) { AssertFatal( pdsch, "pdsch==0" ); @@ -132,7 +132,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, NR_UE_COMMON *const common_vars = &ue->common_vars; NR_UE_PBCH **const pbch_vars = ue->pbch_vars; NR_UE_PRACH **const prach_vars = ue->prach_vars; - int i,j,k,l,slot,symb,q; + int i,j,slot,symb,q; int gNB_id; int th_id; uint32_t ****pusch_dmrs; @@ -317,56 +317,18 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, if (abstraction_flag == 0) { for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); + phy_init_nr_ue_PDSCH( ue->pdsch_vars[th_id][gNB_id], fp ); } for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448 } - for (int i=0; ipdsch_vars[th_id][gNB_id]->layer_llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448 } } - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - } - - for (i=0; inb_antennas_rx; i++) - for (j=0; j<4; j++) { - const int idx = (j*fp->nb_antennas_rx)+i; - const size_t num = 7*2*fp->N_RB_DL*12+4; - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); - } - } - - //const size_t num = 7*2*fp->N_RB_DL*12+4; - for (k=0; k<8; k++) { //harq_pid - for (l=0; l<8; l++) { //round - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - } - - for (int i=0; inb_antennas_rx; i++) - for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) - const int idx = (j*fp->nb_antennas_rx)+i; - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - } - } - } - } - + // PDCCH // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 5286fe8780..8de8383ecc 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -386,15 +386,15 @@ void nr_processULSegment(void* arg) { p_procTime); if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) { -#ifdef PRINT_CRC_CHECK +//#ifdef PRINT_CRC_CHECK LOG_I(PHY, "Segment %d CRC OK, iterations %d/%d\n",r,no_iteration_ldpc,max_ldpc_iterations); -#endif +//#endif rdata->decodeIterations = no_iteration_ldpc; if (rdata->decodeIterations > p_decoderParms->numMaxIter) rdata->decodeIterations--; } else { -#ifdef PRINT_CRC_CHECK +//#ifdef PRINT_CRC_CHECK LOG_I(PHY, "CRC NOK\n"); -#endif +//#endif rdata->decodeIterations = max_ldpc_iterations + 1; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 95c451fa1a..4a86af0d57 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -447,7 +447,7 @@ void nr_processDLSegment(void* arg) { // Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) { - LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r); + LOG_I(PHY,"Segment %u CRC OK\n",r); if (r==0) { for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]); @@ -457,7 +457,7 @@ void nr_processDLSegment(void* arg) { no_iteration_ldpc = dlsch->max_ldpc_iterations; rdata->decodeIterations = no_iteration_ldpc; } else { - LOG_D(PHY,"CRC NOT OK\n\033[0m"); + LOG_I(PHY,"CRC NOT OK\n"); } nb_total_decod++; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 08374b30ac..16f2310041 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -82,15 +82,6 @@ unsigned char offset_mumimo_llr_drange[29][3]={{8,8,8},{7,7,7},{7,7,7},{7,7,7},{ #define print_ints(s,x) printf("%s = %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3]) #define print_shorts(s,x) printf("%s = [%d+j*%d, %d+j*%d, %d+j*%d, %d+j*%d]\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) -static void nr_dlsch_dual_stream_correlation_core(int **dl_ch_estimates_ext, - int **dl_ch_estimates_ext_i, - int **dl_ch_rho_ext, - unsigned char n_tx, - unsigned char n_rx, - unsigned char output_shift, - int length, - int start_point); - uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp, int **dl_ch_mag, int **dl_ch_magb, @@ -162,7 +153,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, unsigned char aatx=0,aarx=0; - unsigned short nb_rb = 0, round; + unsigned short round; int avgs = 0;// rb; NR_DL_UE_HARQ_t *dlsch0_harq, *dlsch1_harq = NULL; @@ -181,7 +172,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, //uint16_t bundle_L = 2; uint16_t n_tx=1, n_rx=1; int32_t median[16]; - uint32_t len; + uint32_t nb_re_pdsch; uint16_t startSymbIdx=0; uint16_t nbSymb=0; uint16_t pduBitmap=0x0; @@ -206,7 +197,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, dlsch = ue->dlsch[proc->thread_id][gNB_id]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch1_harq = dlsch[1]->harq_processes[harq_pid]; - beamforming_mode = ue->transmission_mode[gNB_id] < 7 ? 0 :ue->transmission_mode[gNB_id]; break; default: @@ -315,79 +305,42 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, return(-1); } - if (dlsch0_harq->mimo_mode>NR_DUALSTREAM) { - LOG_E(PHY,"This transmission mode is not yet supported!\n"); - return(-1); - } - - if (dlsch0_harq->mimo_mode==NR_DUALSTREAM) { - DevAssert(dlsch1_harq); - } - if(symbol > ue->frame_parms.symbols_per_slot>>1) { slot = 1; } -#ifdef DEBUG_HARQ - printf("Demod dlsch0_harq->pmi_alloc %d\n", dlsch0_harq->pmi_alloc); -#endif - uint8_t pilots = (dlsch0_harq->dlDmrsSymbPos >> symbol) & 1; uint8_t config_type = dlsch0_harq->dmrsConfigType; - - if (beamforming_mode==0) {//No beamforming - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - if (dlsch0_harq->Nl > 1)//More than or equal 2 layers - nb_rb = nr_dlsch_extract_rbs_multiple(common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, - pdsch_vars[gNB_id]->dl_ch_estimates, - pdsch_vars[gNB_id]->rxdataF_ext, - pdsch_vars[gNB_id]->dl_ch_estimates_ext, - symbol, - pilots, - config_type, - start_rb + dlsch0_harq->BWPStart, - nb_rb_pdsch, - dlsch0_harq->n_dmrs_cdm_groups, - dlsch0_harq->Nl, - frame_parms, - dlsch0_harq->dlDmrsSymbPos); - else// one layer - nb_rb = nr_dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, - pdsch_vars[gNB_id]->dl_ch_estimates, - pdsch_vars[gNB_id]->rxdataF_ext, - pdsch_vars[gNB_id]->dl_ch_estimates_ext, - symbol, - pilots, - config_type, - start_rb + dlsch0_harq->BWPStart, - nb_rb_pdsch, - dlsch0_harq->n_dmrs_cdm_groups, - frame_parms, - dlsch0_harq->dlDmrsSymbPos); - } - else if(beamforming_mode>7) { - LOG_W(PHY,"dlsch_demodulation: beamforming mode not supported yet.\n"); - } - - //printf("nb_rb = %d, gNB_id %d\n",nb_rb,gNB_id); - if (nb_rb==0) { - LOG_D(PHY,"dlsch_demodulation.c: nb_rb=0\n"); - return(-1); - } - - len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12); - + //---------------------------------------------------------- + //--------------------- RBs extraction --------------------- + //---------------------------------------------------------- + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); + nr_dlsch_extract_rbs(common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, + pdsch_vars[gNB_id]->dl_ch_estimates, + pdsch_vars[gNB_id]->rxdataF_ext, + pdsch_vars[gNB_id]->dl_ch_estimates_ext, + symbol, + pilots, + config_type, + start_rb + dlsch0_harq->BWPStart, + nb_rb_pdsch, + dlsch0_harq->n_dmrs_cdm_groups, + dlsch0_harq->Nl, + frame_parms, + dlsch0_harq->dlDmrsSymbPos); stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); - - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); n_tx = dlsch0_harq->Nl; n_rx = frame_parms->nb_antennas_rx; - + nb_re_pdsch = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb_pdsch*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb_pdsch*(12-4*dlsch0_harq->n_dmrs_cdm_groups)) : (nb_rb_pdsch*12); + //---------------------------------------------------------- + //--------------------- Channel Scaling -------------------- + //---------------------------------------------------------- + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); nr_dlsch_scale_channel(pdsch_vars[gNB_id]->dl_ch_estimates_ext, frame_parms, n_tx, @@ -395,50 +348,48 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, dlsch, symbol, pilots, - len, + nb_re_pdsch, nb_rb_pdsch); + stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); + //---------------------------------------------------------- + //--------------------- Channel Level Calc. ---------------- + //---------------------------------------------------------- + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (first_symbol_flag==1) { - if (beamforming_mode==0){ - nr_dlsch_channel_level(pdsch_vars[gNB_id]->dl_ch_estimates_ext, - frame_parms, - n_tx, - avg, - symbol, - len, - nb_rb_pdsch); - avgs = 0; - for (aatx=0;aatxnb_antennas_rx+aarx]); - avgs = cmax(avgs,avg[(aatx*frame_parms->nb_antennas_rx)+aarx]); - //LOG_I(PHY, "avgs Power per SC is %d\n", avgs); - median[(aatx*frame_parms->nb_antennas_rx)+aarx] = avg[(aatx*frame_parms->nb_antennas_rx)+aarx]; - } - - if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) { - nr_dlsch_channel_level_median(pdsch_vars[gNB_id]->dl_ch_estimates_ext, - median, - n_tx, - n_rx, - len, - symbol*nb_rb*12); - - for (aatx = 0; aatx < n_tx; aatx++) { - for (aarx = 0; aarx < n_rx; aarx++) { - avgs = cmax(avgs, median[aatx*n_rx + aarx]); - } + nr_dlsch_channel_level(pdsch_vars[gNB_id]->dl_ch_estimates_ext, + frame_parms, + n_tx, + avg, + symbol, + nb_re_pdsch, + nb_rb_pdsch); + avgs = 0; + for (aatx=0;aatxnb_antennas_rx+aarx]); + avgs = cmax(avgs,avg[(aatx*frame_parms->nb_antennas_rx)+aarx]); + //LOG_I(PHY, "avgs Power per SC is %d\n", avgs); + median[(aatx*frame_parms->nb_antennas_rx)+aarx] = avg[(aatx*frame_parms->nb_antennas_rx)+aarx]; + } + if (dlsch0_harq->Nl > 1) { + nr_dlsch_channel_level_median(pdsch_vars[gNB_id]->dl_ch_estimates_ext, + median, + n_tx, + n_rx, + nb_re_pdsch, + symbol*nb_rb_pdsch*12); + for (aatx = 0; aatx < n_tx; aatx++) { + for (aarx = 0; aarx < n_rx; aarx++) { + avgs = cmax(avgs, median[aatx*n_rx + aarx]); } } - - pdsch_vars[gNB_id]->log2_maxh = (log2_approx(avgs)/2) + 1; - //LOG_I(PHY, "avgs Power per SC is %d lg2_maxh %d\n", avgs, pdsch_vars[gNB_id]->log2_maxh); } + pdsch_vars[gNB_id]->log2_maxh = (log2_approx(avgs)/2) + 1; + //LOG_I(PHY, "avgs Power per SC is %d lg2_maxh %d\n", avgs, pdsch_vars[gNB_id]->log2_maxh); LOG_D(PHY,"[DLSCH] AbsSubframe %d.%d log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n", frame%1024, nr_slot_rx, @@ -448,64 +399,40 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, avg[0], avgs); } + stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); #if T_TRACER - if (type == PDSCH) - { - T(T_UE_PHY_PDSCH_ENERGY, T_INT(gNB_id), T_INT(0), T_INT(frame%1024), T_INT(nr_slot_rx), - T_INT(avg[0]), T_INT(avg[1]), T_INT(avg[2]), T_INT(avg[3])); - } + if (type == PDSCH) + { + T(T_UE_PHY_PDSCH_ENERGY, T_INT(gNB_id), T_INT(0), T_INT(frame%1024), T_INT(nr_slot_rx), + T_INT(avg[0]), T_INT(avg[1]), T_INT(avg[2]), T_INT(avg[3])); + } #endif - stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); - - start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); -// Now channel compensation - if (dlsch0_harq->mimo_moderxdataF_ext, - pdsch_vars[gNB_id]->dl_ch_estimates_ext, - pdsch_vars[gNB_id]->dl_ch_mag0, - pdsch_vars[gNB_id]->dl_ch_magb0, - pdsch_vars[gNB_id]->dl_ch_magr0, - pdsch_vars[gNB_id]->rxdataF_comp0, - (n_tx>1) ? pdsch_vars[gNB_id]->rho : NULL, - frame_parms, - n_tx, - symbol, - len, - first_symbol_flag, - dlsch0_harq->Qm, - nb_rb_pdsch, - pdsch_vars[gNB_id]->log2_maxh, - measurements); // log2_maxh+I0_shift - } - - else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) { - nr_dlsch_channel_compensation_core(pdsch_vars[gNB_id]->rxdataF_ext, - pdsch_vars[gNB_id]->dl_ch_estimates_ext, - pdsch_vars[gNB_id]->dl_ch_mag0, - pdsch_vars[gNB_id]->dl_ch_magb0, - pdsch_vars[gNB_id]->rxdataF_comp0, //rxdataF_comp - NULL, - n_tx, - n_rx, - dlsch0_harq->Qm, - pdsch_vars[gNB_id]->log2_maxh, - 2*len, // subcarriers Re Im - 0); // we start from the beginning of the vector - // compute correlation between signal and interference channels (rho12 and rho21) - nr_dlsch_dual_stream_correlation_core(pdsch_vars[gNB_id]->dl_ch_estimates_ext, - &(pdsch_vars[gNB_id]->dl_ch_estimates_ext[2]), - pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round], - n_tx, - n_rx, - pdsch_vars[gNB_id]->log2_maxh, - 2*len, - 0); - } + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + //---------------------------------------------------------- + //--------------------- channel compensation --------------- + //---------------------------------------------------------- + // Disable correlation measurement for optimizing UE + start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); + nr_dlsch_channel_compensation(pdsch_vars[gNB_id]->rxdataF_ext, + pdsch_vars[gNB_id]->dl_ch_estimates_ext, + pdsch_vars[gNB_id]->dl_ch_mag0, + pdsch_vars[gNB_id]->dl_ch_magb0, + pdsch_vars[gNB_id]->dl_ch_magr0, + pdsch_vars[gNB_id]->rxdataF_comp0, + NULL,//NULL:disable meas. pdsch_vars[gNB_id]->rho:enable meas. + frame_parms, + n_tx, + symbol, + nb_re_pdsch, + first_symbol_flag, + dlsch0_harq->Qm, + nb_rb_pdsch, + pdsch_vars[gNB_id]->log2_maxh, + measurements); // log2_maxh+I0_shift stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); @@ -513,63 +440,41 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (frame_parms->nb_antennas_rx > 1) { - if (dlsch0_harq->mimo_moderxdataF_comp0, - (n_tx>1)? pdsch_vars[gNB_id]->rho : NULL, - pdsch_vars[gNB_id]->dl_ch_mag0, - pdsch_vars[gNB_id]->dl_ch_magb0, - pdsch_vars[gNB_id]->dl_ch_magr0, - n_tx, - n_rx, - symbol, - nb_rb_pdsch, - len); - if (n_tx == 2)//Apply zero forcing for 2 Tx layers - nr_zero_forcing_rx_2layers(pdsch_vars[gNB_id]->rxdataF_comp0, - pdsch_vars[gNB_id]->dl_ch_mag0, - pdsch_vars[gNB_id]->dl_ch_magb0, - pdsch_vars[gNB_id]->dl_ch_magr0, - pdsch_vars[gNB_id]->dl_ch_estimates_ext, - nb_rb_pdsch, - n_rx, - dlsch0_harq->Qm, - pdsch_vars[gNB_id]->log2_maxh, - symbol, - len); - } - else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) { - nr_dlsch_detection_mrc_core(pdsch_vars[gNB_id]->rxdataF_comp0, - NULL, - pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round], - pdsch_vars[gNB_id]->dl_ch_rho2_ext, - pdsch_vars[gNB_id]->dl_ch_mag0, - pdsch_vars[gNB_id]->dl_ch_magb0, - NULL, - NULL, - n_tx, - n_rx, - 2*len, - 0); - } + nr_dlsch_detection_mrc(pdsch_vars[gNB_id]->rxdataF_comp0, + (n_tx>1)? pdsch_vars[gNB_id]->rho : NULL, + pdsch_vars[gNB_id]->dl_ch_mag0, + pdsch_vars[gNB_id]->dl_ch_magb0, + pdsch_vars[gNB_id]->dl_ch_magr0, + n_tx, + n_rx, + symbol, + nb_rb_pdsch, + nb_re_pdsch); + if (n_tx == 2)//Apply zero forcing for 2 Tx layers + nr_zero_forcing_rx_2layers(pdsch_vars[gNB_id]->rxdataF_comp0, + pdsch_vars[gNB_id]->dl_ch_mag0, + pdsch_vars[gNB_id]->dl_ch_magb0, + pdsch_vars[gNB_id]->dl_ch_magr0, + pdsch_vars[gNB_id]->dl_ch_estimates_ext, + nb_rb_pdsch, + n_rx, + dlsch0_harq->Qm, + pdsch_vars[gNB_id]->log2_maxh, + symbol, + nb_re_pdsch); } + stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); + //printf("start compute LLR\n"); - if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) { - rxdataF_comp_ptr = pdsch_vars[gNB_id]->rxdataF_comp1[harq_pid][round]; - dl_ch_mag_ptr = pdsch_vars[gNB_id]->dl_ch_mag1[harq_pid][round]; - } - else { - rxdataF_comp_ptr = pdsch_vars[gNB_id_i]->rxdataF_comp0; - dl_ch_mag_ptr = pdsch_vars[gNB_id_i]->dl_ch_mag0; - //i_mod should have been passed as a parameter - } + rxdataF_comp_ptr = pdsch_vars[gNB_id_i]->rxdataF_comp0; + dl_ch_mag_ptr = pdsch_vars[gNB_id_i]->dl_ch_mag0; - stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ - pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len; + pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = nb_re_pdsch; if(dlsch0_harq->status == ACTIVE) { startSymbIdx = dlsch0_harq->start_symbol; @@ -592,7 +497,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, gNB_id, nr_slot_rx, symbol, - (nb_rb*12), + (nb_rb_pdsch*12), dlsch[0]->rnti,rx_type); pdsch_vars[gNB_id]->dl_valid_re[symbol-1] -= pdsch_vars[gNB_id]->ptrs_re_per_slot[0][symbol]; } @@ -614,7 +519,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, rx_type, harq_pid, gNB_id, gNB_id_i, first_symbol_flag, - i, nb_rb, round, + i, nb_rb_pdsch, round, codeword_TB0, codeword_TB1, pdsch_vars[gNB_id]->dl_valid_re[i-1], nr_slot_rx, beamforming_mode); @@ -670,13 +575,13 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, for (int i=0; i < 2; i++){ snprintf(filename, 40, "llr%d_symb_%d_nr_slot_rx_%d.m", i, symbol, nr_slot_rx); - write_output(filename,"llr", &pdsch_vars[gNB_id]->llr[i][0], (NR_SYMBOLS_PER_SLOT*nb_rb*NR_NB_SC_PER_RB*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm), 1, 0); + write_output(filename,"llr", &pdsch_vars[gNB_id]->llr[i][0], (NR_SYMBOLS_PER_SLOT*nb_rb_pdsch*NR_NB_SC_PER_RB*dlsch1_harq->Qm) - 4*(nb_rb_pdsch*4*dlsch1_harq->Qm), 1, 0); } #endif #if T_TRACER T(T_UE_PHY_PDSCH_IQ, T_INT(gNB_id), T_INT(ue->Mod_id), T_INT(frame%1024), - T_INT(nr_slot_rx), T_INT(nb_rb), + T_INT(nr_slot_rx), T_INT(nb_rb_pdsch), T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_slot), T_BUFFER(&pdsch_vars[gNB_id]->rxdataF_comp0[gNB_id][0], 2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_slot*2)); #endif @@ -928,8 +833,8 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, //rho[aarx][nb_aatx*nb_aatx] = [cov(H_aarx_0,H_aarx_0) cov(H_aarx_0,H_aarx_1) // cov(H_aarx_1,H_aarx_0) cov(H_aarx_1,H_aarx_1)], aarx=0,...,nb_antennas_rx-1 - int avg_rho_re[frame_parms->nb_antennas_rx][nb_aatx*nb_aatx]; - int avg_rho_im[frame_parms->nb_antennas_rx][nb_aatx*nb_aatx]; + //int avg_rho_re[frame_parms->nb_antennas_rx][nb_aatx*nb_aatx]; + //int avg_rho_im[frame_parms->nb_antennas_rx][nb_aatx*nb_aatx]; for (aarx=0; aarxnb_antennas_rx; aarx++) { @@ -937,8 +842,8 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][symbol*nb_rb*12]; for (atx=0; atxnb_antennas_rx+aarx][symbol*nb_rb*12]; @@ -966,15 +871,14 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, //print_shorts("ch:",dl_ch128); //print_shorts("pack:",rho128); - avg_rho_re[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[0])[0]+ + /*avg_rho_re[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[0])[0]+ ((int16_t*)&rho128[0])[2] + ((int16_t*)&rho128[0])[4] + - ((int16_t*)&rho128[0])[6])/16;// - - avg_rho_im[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[0])[1]+ + ((int16_t*)&rho128[0])[6])/16;*/ + /*avg_rho_im[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[0])[1]+ ((int16_t*)&rho128[0])[3] + ((int16_t*)&rho128[0])[5] + - ((int16_t*)&rho128[0])[7])/16;// + ((int16_t*)&rho128[0])[7])/16;*/ // multiply by conjugated channel mmtmpD0 = _mm_madd_epi16(dl_ch128[1],dl_ch128_2[1]); @@ -994,15 +898,14 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, //print_shorts("pack:",rho128+1); // multiply by conjugated channel - avg_rho_re[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[1])[0]+ + /*avg_rho_re[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[1])[0]+ ((int16_t*)&rho128[1])[2] + ((int16_t*)&rho128[1])[4] + - ((int16_t*)&rho128[1])[6])/16; - - avg_rho_im[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[1])[1]+ + ((int16_t*)&rho128[1])[6])/16;*/ + /*avg_rho_im[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[1])[1]+ ((int16_t*)&rho128[1])[3] + ((int16_t*)&rho128[1])[5] + - ((int16_t*)&rho128[1])[7])/16; + ((int16_t*)&rho128[1])[7])/16;*/ mmtmpD0 = _mm_madd_epi16(dl_ch128[2],dl_ch128_2[2]); // mmtmpD0 contains real part of 4 consecutive outputs (32-bit) @@ -1020,25 +923,28 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, //print_shorts("rx:",dl_ch128_2+2); //print_shorts("ch:",dl_ch128+2); //print_shorts("pack:",rho128+2); - avg_rho_re[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[2])[0]+ + + /*avg_rho_re[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[2])[0]+ ((int16_t*)&rho128[2])[2] + ((int16_t*)&rho128[2])[4] + - ((int16_t*)&rho128[2])[6])/16; - - avg_rho_im[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[2])[1]+ + ((int16_t*)&rho128[2])[6])/16;*/ + /*avg_rho_im[aarx][aatx*nb_aatx+atx] +=(((int16_t*)&rho128[2])[1]+ ((int16_t*)&rho128[2])[3] + ((int16_t*)&rho128[2])[5] + - ((int16_t*)&rho128[2])[7])/16; + ((int16_t*)&rho128[2])[7])/16;*/ dl_ch128+=3; dl_ch128_2+=3; rho128+=3; } if (first_symbol_flag==1) { - //measurements->rx_correlation[0][0][aarx] = signal_energy(&rho[aarx][aatx*nb_aatx+atx][symbol*nb_rb*12],rb*12); - avg_rho_re[aarx][aatx*nb_aatx+atx] = 16*avg_rho_re[aarx][aatx*nb_aatx+atx]/(nb_rb*12); - avg_rho_im[aarx][aatx*nb_aatx+atx] = 16*avg_rho_im[aarx][aatx*nb_aatx+atx]/(nb_rb*12); + //rho_nm = H_arx_n.conj(H_arx_m) + //rho_rx_corr[arx][nm] = |H_arx_n|^2.|H_arx_m|^2 &rho[aarx][aatx*nb_aatx+atx][symbol*nb_rb*12] + measurements->rx_correlation[0][aarx][aatx*nb_aatx+atx] = signal_energy(&rho[aarx][aatx*nb_aatx+atx][symbol*nb_rb*12],length); + //avg_rho_re[aarx][aatx*nb_aatx+atx] = 16*avg_rho_re[aarx][aatx*nb_aatx+atx]/length; + //avg_rho_im[aarx][aatx*nb_aatx+atx] = 16*avg_rho_im[aarx][aatx*nb_aatx+atx]/length; //printf("rho[rx]%d tx%d tx%d = Re: %d Im: %d\n",aarx, aatx,atx, avg_rho_re[aarx][aatx*nb_aatx+atx], avg_rho_im[aarx][aatx*nb_aatx+atx]); + //printf("rho_corr[rx]%d tx%d tx%d = %d ...\n",aarx, aatx,atx, measurements->rx_correlation[0][aarx][aatx*nb_aatx+atx]); } } } @@ -1691,310 +1597,22 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext, } -static void nr_dlsch_dual_stream_correlation_core(int **dl_ch_estimates_ext, - int **dl_ch_estimates_ext_i, - int **dl_ch_rho_ext, - unsigned char n_tx, - unsigned char n_rx, - unsigned char output_shift, - int length, - int start_point) -{ -#if defined(__x86_64__)||defined(__i386__) - - __m128i *dl_ch128,*dl_ch128i,*dl_ch_rho128,mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3; - unsigned char aarx; - int ii, length2, length_mod8; - - - for (aarx=0; aarx>3; - - for (ii=0; ii1) { - - for (aatx=0; aatx>2; - - for (i=0; i>2; - - for (i=0; i>2; - - for (i=0; i>2; - - for (i=0; i1) { - - for (aatx=0; aatx>2; - - for (i=0; i>2; - - for (i=0; i>2; - - for (i=0; illr_offset[symbol], (int16_t*)pdsch_vars[gNB_id]->llr[0], pllr_symbol_cw0);*/ - - /*printf("compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %p @LLR Buff(symb) %p\n", - symbol, - nb_rb,dlsch0_harq->Qm, - pdsch_vars[gNB_id]->llr_length[symbol], - pdsch_vars[gNB_id]->llr_offset[symbol], - pdsch_vars[gNB_id]->llr[0], - pllr_symbol_cw0);*/ switch (dlsch0_harq->Qm) { case 2 : @@ -3032,27 +2641,14 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars, nb_rb, beamforming_mode); break; - case rx_IC_single_stream ://not implemented yet - /*nr_dlsch_qpsk_qpsk_llr(frame_parms, - pdsch_vars[gNB_id]->rxdataF_comp0, - rxdataF_comp_ptr, - pdsch_vars[gNB_id]->dl_ch_rho2_ext, - pdsch_vars[gNB_id]->layer_llr[0], - symbol,len,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,nr_slot_rx,symbol), - pdsch_vars[gNB_id]->llr128);*/ + case rx_IC_single_stream ://From LTE Code!! + //not implemented yet break; - case rx_IC_dual_stream ://not implemented yet - /*nr_dlsch_qpsk_qpsk_llr(frame_parms, - rxdataF_comp_ptr, - pdsch_vars[gNB_id]->rxdataF_comp0, - pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round], - pdsch_vars[gNB_id]->layer_llr[1], - symbol,len,first_symbol_flag,nb_rb, - adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,2,nr_slot_rx,symbol), - pdsch_vars[gNB_id]->llr128_2ndstream);*/ + case rx_IC_dual_stream : + //not implemented yet break; - case rx_SIC_dual_stream ://not implemented yet + case rx_SIC_dual_stream : + //not implemented yet break; } break; 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 3cb002f9e1..f2d470e81f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -734,7 +734,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, @param n_dmrs_cdm_groups @param frame_parms Pointer to frame descriptor */ -unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF, +void nr_dlsch_extract_rbs(int **rxdataF, int **dl_ch_estimates, int **rxdataF_ext, int **dl_ch_estimates_ext, @@ -898,19 +898,6 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp, unsigned short nb_rb, int length); -void nr_dlsch_detection_mrc_core(int **rxdataF_comp, - int **rxdataF_comp_i, - int **rho, - int **rho_i, - int **dl_ch_mag, - int **dl_ch_magb, - int **dl_ch_mag_i, - int **dl_ch_magb_i, - unsigned char n_tx, - unsigned char n_rx, - int length, - int start_point); - void det_HhH(int32_t *after_mf_00, int32_t *after_mf_01, int32_t *after_mf_10, diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 69978f5548..24f954aefe 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -184,7 +184,7 @@ typedef struct { //! estimated rssi (dBm) short rx_rssi_dBm[NUMBER_OF_CONNECTED_gNB_MAX]; //! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation) - int rx_correlation[NUMBER_OF_CONNECTED_gNB_MAX][4][4]; + int rx_correlation[NUMBER_OF_CONNECTED_gNB_MAX][NB_ANTENNAS_RX][NR_MAX_NB_LAYERS*NR_MAX_NB_LAYERS];// //! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation) int rx_correlation_dB[NUMBER_OF_CONNECTED_gNB_MAX][2]; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index f7e6b71040..b682f130b1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -216,11 +216,11 @@ RUs = ( ## beamforming 1x4 matrix: 1 layer x 4 antennas #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + #bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; ## beamforming 2x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000]; ## beamforming 4x4 matrix: - bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2"; clock_src = "external"; } From 8381cba16dd7a04b743b6b71880d39c379caca20 Mon Sep 17 00:00:00 2001 From: sfn Date: Sun, 9 Jan 2022 21:59:45 +0100 Subject: [PATCH 299/883] re-implement zero forcing rx for dlsch --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 1021 ++++++++--------- 1 file changed, 503 insertions(+), 518 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 16f2310041..2db09e2380 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -82,18 +82,21 @@ unsigned char offset_mumimo_llr_drange[29][3]={{8,8,8},{7,7,7},{7,7,7},{7,7,7},{ #define print_ints(s,x) printf("%s = %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3]) #define print_shorts(s,x) printf("%s = [%d+j*%d, %d+j*%d, %d+j*%d, %d+j*%d]\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) -uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp, +/* compute H_h_H matrix inversion up to 4x4 matrices */ +uint8_t nr_zero_forcing_rx(int **rxdataF_comp, int **dl_ch_mag, int **dl_ch_magb, int **dl_ch_magr, int **dl_ch_estimates_ext, unsigned short nb_rb, unsigned char n_rx, + unsigned char n_tx,//number of layer unsigned char mod_order, int shift, unsigned char symbol, int length); +/* Apply layer demapping */ static void nr_dlsch_layer_demapping(int16_t **llr_cw, uint8_t Nl, uint8_t mod_order, @@ -102,7 +105,6 @@ static void nr_dlsch_layer_demapping(int16_t **llr_cw, int32_t codeword_TB1, int16_t **llr_layers); - /* compute LLR */ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars, NR_DL_FRAME_PARMS *frame_parms, @@ -450,14 +452,15 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, symbol, nb_rb_pdsch, nb_re_pdsch); - if (n_tx == 2)//Apply zero forcing for 2 Tx layers - nr_zero_forcing_rx_2layers(pdsch_vars[gNB_id]->rxdataF_comp0, + if (n_tx >= 2)//Apply zero forcing for 2, 3, and 4 Tx layers + nr_zero_forcing_rx(pdsch_vars[gNB_id]->rxdataF_comp0, pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->dl_ch_magb0, pdsch_vars[gNB_id]->dl_ch_magr0, pdsch_vars[gNB_id]->dl_ch_estimates_ext, nb_rb_pdsch, n_rx, + n_tx, dlsch0_harq->Qm, pdsch_vars[gNB_id]->log2_maxh, symbol, @@ -1860,67 +1863,278 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp, #endif } -/* Zero Forcing Rx function: nr_det_HhH() - * +/* Zero Forcing Rx function: nr_det_2x2() + * Compute the Matrix determinant for 2x2 * * */ -void nr_det_HhH(int32_t *after_mf_00,//a - int32_t *after_mf_01,//b - int32_t *after_mf_10,//c - int32_t *after_mf_11,//d - int32_t *det_fin,//1/ad-bc +void nr_det_2x2(int32_t *a,//a + int32_t *b,//b + int32_t *c,//c + int32_t *d,//d + int32_t *ad_bc,//ad-bc unsigned short nb_rb, - unsigned char symbol, - int32_t shift) + int32_t sign, + int32_t shift0) { int16_t nr_conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ; unsigned short rb; - __m128i *after_mf_00_128,*after_mf_01_128, *after_mf_10_128, *after_mf_11_128, ad_re_128, bc_re_128; //ad_im_128, bc_im_128; - __m128i *det_fin_128, det_re_128; //det_im_128, tmp_det0, tmp_det1; + __m128i *a_128,*b_128, *c_128, *d_128, ad_re_128, bc_re_128, ad_im_128, bc_im_128; + __m128i *ad_bc_128, det_re_128, det_im_128, tmp_det0, tmp_det1; - after_mf_00_128 = (__m128i *)after_mf_00; - after_mf_01_128 = (__m128i *)after_mf_01; - after_mf_10_128 = (__m128i *)after_mf_10; - after_mf_11_128 = (__m128i *)after_mf_11; + a_128 = (__m128i *)a; + b_128 = (__m128i *)b; + c_128 = (__m128i *)c; + d_128 = (__m128i *)d; - det_fin_128 = (__m128i *)det_fin; + ad_bc_128 = (__m128i *)ad_bc; for (rb=0; rb<3*nb_rb; rb++) { //complex multiplication (I_a+jQ_a)(I_d+jQ_d) = (I_aI_d - Q_aQ_d) + j(Q_aI_d + I_aQ_d) - //The imag part is often zero, we compute only the real part - ad_re_128 = _mm_sign_epi16(after_mf_00_128[0],*(__m128i*)&nr_conjug2[0]); - ad_re_128 = _mm_madd_epi16(ad_re_128,after_mf_11_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1 - //ad_im_128 = _mm_shufflelo_epi16(after_mf_00_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits - //ad_im_128 = _mm_shufflehi_epi16(ad_im_128,_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits - //ad_im_128 = _mm_madd_epi16(ad_im_128,after_mf_11_128[0]);//Im: (Q_aI_d + I_aQ_d) + //The real part + ad_re_128 = _mm_sign_epi16(a_128[0],*(__m128i*)&nr_conjug2[0]); + ad_re_128 = _mm_madd_epi16(ad_re_128,d_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1 + //The Imag part + ad_im_128 = _mm_shufflelo_epi16(a_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits + ad_im_128 = _mm_shufflehi_epi16(ad_im_128,_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits + ad_im_128 = _mm_madd_epi16(ad_im_128,d_128[0]);//Im: (Q_aI_d + I_aQ_d) //complex multiplication (I_b+jQ_b)(I_c+jQ_c) = (I_bI_c - Q_bQ_c) + j(Q_bI_c + I_bQ_c) - //The imag part is often zero, we compute only the real part - bc_re_128 = _mm_sign_epi16(after_mf_01_128[0],*(__m128i*)&nr_conjug2[0]); - bc_re_128 = _mm_madd_epi16(bc_re_128,after_mf_10_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1 - //bc_im_128 = _mm_shufflelo_epi16(after_mf_01_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_b0 Q_b1 I_b2 Q_b3]_64bits to [Q_b1 I_b0 Q_b3 I_b2]_64bits - //bc_im_128 = _mm_shufflehi_epi16(bc_im_128,_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 64 bits as [I_b0 Q_b1 I_b2 Q_b3]_64bits to [Q_b1 I_b0 Q_b3 I_b2]_64bits - //bc_im_128 = _mm_madd_epi16(bc_im_128,after_mf_10_128[0]);//Im: (Q_bI_c + I_bQ_c) + //The real part + bc_re_128 = _mm_sign_epi16(b_128[0],*(__m128i*)&nr_conjug2[0]); + bc_re_128 = _mm_madd_epi16(bc_re_128,c_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1 + //The imag part + bc_im_128 = _mm_shufflelo_epi16(b_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_b0 Q_b1 I_b2 Q_b3]_64bits to [Q_b1 I_b0 Q_b3 I_b2]_64bits + bc_im_128 = _mm_shufflehi_epi16(bc_im_128,_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 64 bits as [I_b0 Q_b1 I_b2 Q_b3]_64bits to [Q_b1 I_b0 Q_b3 I_b2]_64bits + bc_im_128 = _mm_madd_epi16(bc_im_128,c_128[0]);//Im: (Q_bI_c + I_bQ_c) - det_re_128 = _mm_sub_epi32(ad_re_128, bc_re_128); - //det_im_128 = _mm_sub_epi32(ad_im_128, bc_im_128); + if (sign>0){ + det_re_128 = _mm_sub_epi32(ad_re_128, bc_re_128); + det_im_128 = _mm_sub_epi32(ad_im_128, bc_im_128); + }else{ + det_re_128 = _mm_sub_epi32(bc_re_128,ad_re_128); + det_im_128 = _mm_sub_epi32(bc_im_128,ad_im_128); + } + //convert back to Q15 before packing + det_re_128 = _mm_srai_epi32(det_re_128,shift0); + det_im_128 = _mm_srai_epi32(det_im_128,shift0); - //det in Q30 format - det_fin_128[0] = _mm_abs_epi32(det_re_128); + tmp_det0 = _mm_unpacklo_epi32(det_re_128,det_im_128); + //print_ints("unpack lo:",&tmp_det0[0]); + tmp_det1 = _mm_unpackhi_epi32(det_re_128,det_im_128); + //print_ints("unpack hi:",&tmp_det1[0]); + ad_bc_128[0] = _mm_packs_epi32(tmp_det0,tmp_det1); #ifdef DEBUG_DLSCH_DEMOD - printf("\n Computing det_HhH_inv \n"); + printf("\n Computing det_2x2 \n"); //print_ints("det_re_128:",(int32_t*)&det_re_128); //print_ints("det_im_128:",(int32_t*)&det_im_128); - print_ints("det_fin_128:",(int32_t*)&det_fin_128[0]); + print_shorts("ad-bc_128:",(int32_t*)&ad_bc_128[0]); #endif - det_fin_128+=1; - after_mf_00_128+=1; - after_mf_01_128+=1; - after_mf_10_128+=1; - after_mf_11_128+=1; + ad_bc_128+=1; + a_128+=1; + b_128+=1; + c_128+=1; + d_128+=1; + } + _mm_empty(); + _m_empty(); +} + +/* Zero Forcing Rx function: nr_a_mult_b() + * Compute the complex Multiplication c=a*b + * + * */ +void nr_a_mult_b(int *a, + int *b, + int32_t *c, + unsigned short nb_rb, + unsigned char output_shift0) +{ + //This function is used to compute complex multiplications + short nr_conjugate[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1}; + unsigned short rb; + __m128i *a_128,*b_128, *c_128, mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3; + + a_128 = (__m128i *)a; + b_128 = (__m128i *)b; + + c_128 = (__m128i *)c; + + for (rb=0; rb<3*nb_rb; rb++) { + // the real part + mmtmpD0 = _mm_sign_epi16(a_128[0],*(__m128i*)&nr_conjugate[0]); + mmtmpD0 = _mm_madd_epi16(mmtmpD0,b_128[0]); //Re: (a_re*b_re - a_im*b_im) + + // the imag part + mmtmpD1 = _mm_shufflelo_epi16(a_128[0],_MM_SHUFFLE(2,3,0,1)); + mmtmpD1 = _mm_shufflehi_epi16(mmtmpD1,_MM_SHUFFLE(2,3,0,1)); + mmtmpD1 = _mm_madd_epi16(mmtmpD1,b_128[0]);//Im: (x_im*y_re + x_re*y_im) + + mmtmpD0 = _mm_srai_epi32(mmtmpD0,output_shift0); + mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift0); + mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1); + mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1); + + c_128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3); + + /*printf("\n Computing mult \n"); + print_shorts("a:",(int16_t*)&a_128[0]); + print_shorts("b:",(int16_t*)&b_128[0]); + print_shorts("pack:",(int16_t*)&c_128[0]);*/ + + a_128+=1; + b_128+=1; + c_128+=1; + } + _mm_empty(); + _m_empty(); +} + +/* Zero Forcing Rx function: nr_det_3x3() + * Compute the matrix determinant for 3x3 + * + * */ +void nr_det_3x3(int32_t *a11,// + int32_t *a12,// + int32_t *a13,// + int32_t *a21,// + int32_t *a22,// + int32_t *a23,// + int32_t *a31,// + int32_t *a32,// + int32_t *a33,// + int32_t *ad_bc,//ad-bc + unsigned short nb_rb, + int32_t sign, + int32_t shift0){ + int32_t outtemp[12*nb_rb] __attribute__((aligned(32))); + int32_t out1[12*nb_rb] __attribute__((aligned(32))); + int32_t out2[12*nb_rb] __attribute__((aligned(32))); + int32_t out3[12*nb_rb] __attribute__((aligned(32))); + + //a11 + nr_det_2x2(a22,//a + a23,//b + a32,//c + a33,//d + outtemp,//ad-bc + nb_rb, + +1, + shift0); + nr_a_mult_b(a11, + outtemp, + out1, + nb_rb, + shift0); + //a12 + nr_det_2x2(a21,//a + a23,//b + a31,//c + a33,//d + outtemp,//ad-bc + nb_rb, + -1, + shift0); + nr_a_mult_b(a12, + outtemp, + out2, + nb_rb, + shift0); + //a13 + nr_det_2x2(a21,//a + a22,//b + a31,//c + a32,//d + outtemp,//ad-bc + nb_rb, + +1, + shift0); + nr_a_mult_b(a13, + outtemp, + out3, + nb_rb, + shift0); + + __m128i *out1_128,*out2_128,*out3_128,*det_128; + + out1_128 = (__m128i *)out1; + out2_128 = (__m128i *)out2; + out3_128 = (__m128i *)out3; + det_128 = (__m128i *)ad_bc; + + for (int rb=0; rb<3*nb_rb; rb++) { + det_128[0] = _mm_adds_epi16(out1_128[0],out2_128[0]); + det_128[0] = _mm_adds_epi16(det_128[0],out3_128[0]); + out1_128+=1; + out2_128+=1; + out3_128+=1; + det_128+=1; + } + _mm_empty(); + _m_empty(); +} + +/* Zero Forcing Rx function: nr_element_sign() + * Compute b=sign*a + * + * */ +void nr_element_sign(int32_t *a,//a + int32_t *b,//b + unsigned short nb_rb, + int32_t sign) +{ + int16_t nr_sign[8]__attribute__((aligned(16))) = {-1,-1,-1,-1,-1,-1,-1,-1} ; + unsigned short rb; + __m128i *a_128,*b_128; + + a_128 = (__m128i *)a; + b_128 = (__m128i *)b; + + for (rb=0; rb<3*nb_rb; rb++) { + + if (sign < 0) + b_128[0] = _mm_sign_epi16(a_128[0],*(__m128i*)&nr_sign[0]); + else + b_128[0] = a_128[0]; + +#ifdef DEBUG_DLSCH_DEMOD + printf("\n Out \n"); + //print_ints("det_re_128:",(int32_t*)&det_re_128); + //print_ints("det_im_128:",(int32_t*)&det_im_128); + print_shorts("b:",(int32_t*)&b_128[0]); +#endif + a_128+=1; + b_128+=1; + } + _mm_empty(); + _m_empty(); +} + +/* Zero Forcing Rx function: nr_construct_HhH_elements() + * + * + * */ +void nr_construct_HhH_elements(int **conjH_H_elements, + unsigned char n_rx, + unsigned short nb_rb) +{ + //This function is used to construct the (H_hermitian * H matrix) matrix elements + unsigned short rb; + __m128i *conjH_H_elements_0_128, *conjH_H_elements_aarx_128; + + + for (rb=0; rb<3*nb_rb; rb++) { + conjH_H_elements_0_128 = (__m128i *)&conjH_H_elements[0][rb*4]; + for (int aarx=1;aarx>2); - //printf("det_%d = %d log2 =%d \n",k,(((int *)&det[0])[k]),log2_approx(((int *)&det[0])[k])); - } - - xy_re_128 = _mm_slli_epi32(xy_re_128,5); - xy_re_128 = _mm_srai_epi32(xy_re_128,log2_approx(sum_det)); - xy_re_128 = _mm_slli_epi32(xy_re_128,5); - - xy_im_128 = _mm_slli_epi32(xy_im_128,5); - xy_im_128 = _mm_srai_epi32(xy_im_128,log2_approx(sum_det)); - xy_im_128 = _mm_slli_epi32(xy_im_128,5); - + +//convert back to Q15 before packing + xy_re_128 = _mm_srai_epi32(xy_re_128,output_shift0); + xy_im_128 = _mm_srai_epi32(xy_im_128,output_shift0); + tmp_z0 = _mm_unpacklo_epi32(xy_re_128,xy_im_128); //print_ints("unpack lo:",&tmp_z0[0]); tmp_z1 = _mm_unpackhi_epi32(xy_re_128,xy_im_128); @@ -2071,486 +2276,266 @@ __m128i nr_comp_muli_sum(__m128i input_x, _m_empty(); return(output); } -/* Zero Forcing Rx function: nr_construct_HhH_elements() + +/* Zero Forcing Rx function: up to 4 layers * * * */ -void nr_construct_HhH_elements(int *conjch00_ch00, - int *conjch01_ch01, - int *conjch11_ch11, - int *conjch10_ch10,// - int *conjch20_ch20, - int *conjch21_ch21, - int *conjch30_ch30, - int *conjch31_ch31, - int *conjch00_ch01,//00_01 - int *conjch01_ch00,//01_00 - int *conjch10_ch11,//10_11 - int *conjch11_ch10,//11_10 - int *conjch20_ch21, - int *conjch21_ch20, - int *conjch30_ch31, - int *conjch31_ch30, - int32_t *after_mf_00, - int32_t *after_mf_01, - int32_t *after_mf_10, - int32_t *after_mf_11, - unsigned short nb_rb, - unsigned char symbol) -{ - //This function is used to construct the (H_hermitian * H matrix) matrix elements - unsigned short rb; - __m128i *conjch00_ch00_128, *conjch01_ch01_128, *conjch11_ch11_128, *conjch10_ch10_128; - __m128i *conjch20_ch20_128, *conjch21_ch21_128, *conjch30_ch30_128, *conjch31_ch31_128; - __m128i *conjch00_ch01_128, *conjch01_ch00_128, *conjch10_ch11_128, *conjch11_ch10_128; - __m128i *conjch20_ch21_128, *conjch21_ch20_128, *conjch30_ch31_128, *conjch31_ch30_128; - __m128i *after_mf_00_128, *after_mf_01_128, *after_mf_10_128, *after_mf_11_128; - - conjch00_ch00_128 = (__m128i *)conjch00_ch00; - conjch01_ch01_128 = (__m128i *)conjch01_ch01; - conjch11_ch11_128 = (__m128i *)conjch11_ch11; - conjch10_ch10_128 = (__m128i *)conjch10_ch10; - - conjch20_ch20_128 = (__m128i *)conjch20_ch20; - conjch21_ch21_128 = (__m128i *)conjch21_ch21; - conjch30_ch30_128 = (__m128i *)conjch30_ch30; - conjch31_ch31_128 = (__m128i *)conjch31_ch31; - - conjch00_ch01_128 = (__m128i *)conjch00_ch01; - conjch01_ch00_128 = (__m128i *)conjch01_ch00; - conjch10_ch11_128 = (__m128i *)conjch10_ch11; - conjch11_ch10_128 = (__m128i *)conjch11_ch10; - - conjch20_ch21_128 = (__m128i *)conjch20_ch21; - conjch21_ch20_128 = (__m128i *)conjch21_ch20; - conjch30_ch31_128 = (__m128i *)conjch30_ch31; - conjch31_ch30_128 = (__m128i *)conjch31_ch30; - - after_mf_00_128 = (__m128i *)after_mf_00; - after_mf_01_128 = (__m128i *)after_mf_01; - after_mf_10_128 = (__m128i *)after_mf_10; - after_mf_11_128 = (__m128i *)after_mf_11; - - for (rb=0; rb<3*nb_rb; rb++) { - - after_mf_00_128[0] =_mm_adds_epi16(conjch00_ch00_128[0],conjch10_ch10_128[0]);//00_00 + 10_10 - if (conjch20_ch20 != NULL) after_mf_00_128[0] =_mm_adds_epi16(after_mf_00_128[0],conjch20_ch20_128[0]); - if (conjch30_ch30 != NULL) after_mf_00_128[0] =_mm_adds_epi16(after_mf_00_128[0],conjch30_ch30_128[0]); - - after_mf_11_128[0] =_mm_adds_epi16(conjch01_ch01_128[0], conjch11_ch11_128[0]); //01_01 + 11_11 - if (conjch21_ch21 != NULL) after_mf_11_128[0] =_mm_adds_epi16(after_mf_11_128[0],conjch21_ch21_128[0]); - if (conjch31_ch31 != NULL) after_mf_11_128[0] =_mm_adds_epi16(after_mf_11_128[0],conjch31_ch31_128[0]); - - after_mf_01_128[0] =_mm_adds_epi16(conjch00_ch01_128[0], conjch10_ch11_128[0]);//00_01 + 10_11 - if (conjch20_ch21 != NULL) after_mf_01_128[0] =_mm_adds_epi16(after_mf_01_128[0],conjch20_ch21_128[0]); - if (conjch30_ch31 != NULL) after_mf_01_128[0] =_mm_adds_epi16(after_mf_01_128[0],conjch30_ch31_128[0]); - - after_mf_10_128[0] =_mm_adds_epi16(conjch01_ch00_128[0], conjch11_ch10_128[0]);//01_00 + 11_10 - if (conjch21_ch20 != NULL) after_mf_10_128[0] =_mm_adds_epi16(after_mf_10_128[0],conjch21_ch20_128[0]); - if (conjch31_ch30 != NULL) after_mf_10_128[0] =_mm_adds_epi16(after_mf_10_128[0],conjch31_ch30_128[0]); - -#ifdef DEBUG_DLSCH_DEMOD - if ((rb<=30)) - { - printf(" \n construct_HhH_elements \n"); - print_shorts("after_mf_00_128:",(int16_t*)&after_mf_00_128[0]); - print_shorts("after_mf_01_128:",(int16_t*)&after_mf_01_128[0]); - print_shorts("after_mf_10_128:",(int16_t*)&after_mf_10_128[0]); - print_shorts("after_mf_11_128:",(int16_t*)&after_mf_11_128[0]); - } -#endif - conjch00_ch00_128+=1; - conjch10_ch10_128+=1; - conjch01_ch01_128+=1; - conjch11_ch11_128+=1; - - if (conjch20_ch20 != NULL) conjch20_ch20_128+=1; - if (conjch21_ch21 != NULL) conjch21_ch21_128+=1; - if (conjch30_ch30 != NULL) conjch30_ch30_128+=1; - if (conjch31_ch31 != NULL) conjch31_ch31_128+=1; - - conjch00_ch01_128+=1; - conjch01_ch00_128+=1; - conjch10_ch11_128+=1; - conjch11_ch10_128+=1; - - if (conjch20_ch21 != NULL) conjch20_ch21_128+=1; - if (conjch21_ch20 != NULL) conjch21_ch20_128+=1; - if (conjch30_ch31 != NULL) conjch30_ch31_128+=1; - if (conjch31_ch30 != NULL) conjch31_ch30_128+=1; - - after_mf_00_128 += 1; - after_mf_01_128 += 1; - after_mf_10_128 += 1; - after_mf_11_128 += 1; - } - _mm_empty(); - _m_empty(); -} - -/* Zero Forcing Rx function: nr_zero_forcing_rx_2layers() - * - * - * */ -uint8_t nr_zero_forcing_rx_2layers(int **rxdataF_comp, +uint8_t nr_zero_forcing_rx(int **rxdataF_comp, int **dl_ch_mag, int **dl_ch_magb, int **dl_ch_magr, int **dl_ch_estimates_ext, unsigned short nb_rb, unsigned char n_rx, + unsigned char n_tx,//number of layer unsigned char mod_order, int shift, unsigned char symbol, int length) { - int *ch00, *ch01, *ch10, *ch11; - int *ch20, *ch30, *ch21, *ch31; - uint32_t nb_rb_0 = length/12 + ((length%12)?1:0); - /* we need at least alignment to 16 bytes, let's put 32 to be sure - * (maybe not necessary but doesn't hurt) - */ - int32_t conjch00_ch01[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch01_ch00[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch10_ch11[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch11_ch10[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch00_ch00[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch01_ch01[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch10_ch10[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch11_ch11[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch20_ch20[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch21_ch21[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch30_ch30[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch31_ch31[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch20_ch21[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch30_ch31[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch21_ch20[12*nb_rb] __attribute__((aligned(32))); - int32_t conjch31_ch30[12*nb_rb] __attribute__((aligned(32))); - - int32_t af_mf_00[12*nb_rb] __attribute__((aligned(32))); - int32_t af_mf_01[12*nb_rb] __attribute__((aligned(32))); - int32_t af_mf_10[12*nb_rb] __attribute__((aligned(32))); - int32_t af_mf_11[12*nb_rb] __attribute__((aligned(32))); + int *ch0r, *ch0c; int32_t determ_fin[12*nb_rb] __attribute__((aligned(32))); - switch (n_rx) { - case 2:// - ch00 = (int *)&dl_ch_estimates_ext[0][symbol*nb_rb*12]; - ch01 = (int *)&dl_ch_estimates_ext[2][symbol*nb_rb*12]; - ch10 = (int *)&dl_ch_estimates_ext[1][symbol*nb_rb*12]; - ch11 = (int *)&dl_ch_estimates_ext[3][symbol*nb_rb*12]; - ch20 = NULL; - ch21 = NULL; - ch30 = NULL; - ch31 = NULL; - break; + int32_t *** conjH_H_elements; - case 4:// - ch00 = (int *)&dl_ch_estimates_ext[0][symbol*nb_rb*12]; - ch01 = (int *)&dl_ch_estimates_ext[4][symbol*nb_rb*12]; - ch10 = (int *)&dl_ch_estimates_ext[1][symbol*nb_rb*12]; - ch11 = (int *)&dl_ch_estimates_ext[5][symbol*nb_rb*12]; - ch20 = (int *)&dl_ch_estimates_ext[2][symbol*nb_rb*12]; - ch21 = (int *)&dl_ch_estimates_ext[6][symbol*nb_rb*12]; - ch30 = (int *)&dl_ch_estimates_ext[3][symbol*nb_rb*12]; - ch31 = (int *)&dl_ch_estimates_ext[7][symbol*nb_rb*12]; - break; + uint32_t nb_rb_0 = length/12 + ((length%12)?1:0); - default: - return -1; - break; - } - - /* 1- Compute the rx channel matrix after compensation: (1/2^log2_max)x(H_herm x H) - * for n_rx = 2 - * |conj_H_00 conj_H_10| | H_00 H_01| |(conj_H_00xH_00+conj_H_10xH_10) (conj_H_00xH_01+conj_H_10xH_11)| - * | | x | | = | | - * |conj_H_01 conj_H_11| | H_10 H_11| |(conj_H_01xH_00+conj_H_11xH_10) (conj_H_01xH_01+conj_H_11xH_11)| - * - */ - - if (n_rx>=2){ - // (1/2^log2_maxh)*conj_H_00xH_00: (1/(64*2))conjH_00*H_00*2^15 - nr_conjch0_mult_ch1(ch00, - ch00, - conjch00_ch00, - nb_rb_0, - shift); - // (1/2^log2_maxh)*conj_H_10xH_10: (1/(64*2))conjH_10*H_10*2^15 - nr_conjch0_mult_ch1(ch10, - ch10, - conjch10_ch10, - nb_rb_0, - shift); - // conj_H_00xH_01 - nr_conjch0_mult_ch1(ch00, - ch01, - conjch00_ch01, - nb_rb_0, - shift); // this shift is equal to the channel level log2_maxh - // conj_H_10xH_11 - nr_conjch0_mult_ch1(ch10, - ch11, - conjch10_ch11, - nb_rb_0, - shift); - // conj_H_01xH_01 - nr_conjch0_mult_ch1(ch01, - ch01, - conjch01_ch01, - nb_rb_0, - shift); - // conj_H_11xH_11 - nr_conjch0_mult_ch1(ch11, - ch11, - conjch11_ch11, - nb_rb_0, - shift); - // conj_H_01xH_00 - nr_conjch0_mult_ch1(ch01, - ch00, - conjch01_ch00, - nb_rb_0, - shift); - // conj_H_11xH_10 - nr_conjch0_mult_ch1(ch11, - ch10, - conjch11_ch10, - nb_rb_0, - shift); - } - if (n_rx==4){ - // (1/2^log2_maxh)*conj_H_20xH_20: (1/(64*2*16))conjH_20*H_20*2^15 - nr_conjch0_mult_ch1(ch20, - ch20, - conjch20_ch20, - nb_rb_0, - shift); - - // (1/2^log2_maxh)*conj_H_30xH_30: (1/(64*2*4))conjH_30*H_30*2^15 - nr_conjch0_mult_ch1(ch30, - ch30, - conjch30_ch30, - nb_rb_0, - shift); - - // (1/2^log2_maxh)*conj_H_20xH_20: (1/(64*2))conjH_20*H_20*2^15 - nr_conjch0_mult_ch1(ch20, - ch21, - conjch20_ch21, - nb_rb_0, - shift); - - nr_conjch0_mult_ch1(ch30, - ch31, - conjch30_ch31, - nb_rb_0, - shift); - - nr_conjch0_mult_ch1(ch21, - ch21, - conjch21_ch21, - nb_rb_0, - shift); - - nr_conjch0_mult_ch1(ch31, - ch31, - conjch31_ch31, - nb_rb_0, - shift); - - // (1/2^log2_maxh)*conj_H_20xH_20: (1/(64*2))conjH_20*H_20*2^15 - nr_conjch0_mult_ch1(ch21, - ch20, - conjch21_ch20, - nb_rb_0, - shift); - - nr_conjch0_mult_ch1(ch31, - ch30, - conjch31_ch30, - nb_rb_0, - shift); - - nr_construct_HhH_elements(conjch00_ch00, - conjch01_ch01, - conjch11_ch11, - conjch10_ch10,// - conjch20_ch20, - conjch21_ch21, - conjch30_ch30, - conjch31_ch31, - conjch00_ch01, - conjch01_ch00, - conjch10_ch11, - conjch11_ch10,// - conjch20_ch21, - conjch21_ch20, - conjch30_ch31, - conjch31_ch30, - af_mf_00, - af_mf_01, - af_mf_10, - af_mf_11, - nb_rb_0, - symbol); - } - if (n_rx==2){ - nr_construct_HhH_elements(conjch00_ch00, - conjch01_ch01, - conjch11_ch11, - conjch10_ch10,// - NULL, - NULL, - NULL, - NULL, - conjch00_ch01, - conjch01_ch00, - conjch10_ch11, - conjch11_ch10,// - NULL, - NULL, - NULL, - NULL, - af_mf_00, - af_mf_01, - af_mf_10, - af_mf_11, - nb_rb_0, - symbol); - } - //det_HhH = ad -bc - nr_det_HhH(af_mf_00,//a - af_mf_01,//b - af_mf_10,//c - af_mf_11,//d - determ_fin, - nb_rb_0, - symbol, - shift); - /* 2- Compute the channel matrix inversion ********************************** - * - * |(conj_H_00xH_00+conj_H_10xH_10) (conj_H_00xH_01+conj_H_10xH_11)| - * A= | | - * |(conj_H_01xH_00+conj_H_11xH_10) (conj_H_01xH_01+conj_H_11xH_11)| - * - * - * - *inv(A) =(1/det)*[d -b - * -c a] - * - * - **************************************************************************/ - __m128i *rxdataF_comp128_0,*rxdataF_comp128_1,*dl_ch_mag128_0=NULL,*dl_ch_mag128b_0=NULL,*dl_ch_mag128r_0=NULL,*determ_fin_128;//*dl_ch_mag128_1,*dl_ch_mag128b_1,*dl_ch_mag128r_1 - __m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3; - __m128i *after_mf_a_128,*after_mf_b_128, *after_mf_c_128, *after_mf_d_128; - __m128i QAM_amp128={0},QAM_amp128b={0},QAM_amp128r={0}; - - determ_fin_128 = (__m128i *)&determ_fin[0]; - - rxdataF_comp128_0 = (__m128i *)&rxdataF_comp[0][symbol*nb_rb*12];//aatx=0 @ aarx =0 - rxdataF_comp128_1 = (__m128i *)&rxdataF_comp[n_rx][symbol*nb_rb*12];//aatx=1 @ aarx =0 - - after_mf_a_128 = (__m128i *)af_mf_00; - after_mf_b_128 = (__m128i *)af_mf_01; - after_mf_c_128 = (__m128i *)af_mf_10; - after_mf_d_128 = (__m128i *)af_mf_11; - - if (mod_order>2) { - if (mod_order == 4) { - QAM_amp128 = _mm_set1_epi16(QAM16_n1); //2/sqrt(10) - QAM_amp128b = _mm_setzero_si128(); - QAM_amp128r = _mm_setzero_si128(); - } else if (mod_order == 6) { - QAM_amp128 = _mm_set1_epi16(QAM64_n1); //4/sqrt{42} - QAM_amp128b = _mm_set1_epi16(QAM64_n2); //2/sqrt{42} - QAM_amp128r = _mm_setzero_si128(); - } else if (mod_order == 8) { - QAM_amp128 = _mm_set1_epi16(QAM256_n1); //8/sqrt{170} - QAM_amp128b = _mm_set1_epi16(QAM256_n2);//4/sqrt{170} - QAM_amp128r = _mm_set1_epi16(QAM256_n3);//2/sqrt{170} + //Allocate H^*H matrix elements and sub elements + conjH_H_elements = (int32_t ***)malloc16_clear( n_tx*n_tx*sizeof(int32_t **) ); + for (int rtx=0;rtx2) { - int sum_det =0; - for (int k=0; k<4;k++) { - sum_det += ((((int *)&determ_fin_128[0])[k])>>2); - //printf("det_%d = %d\n",k,sum_det); - } - - mmtmpD2 = _mm_slli_epi32(determ_fin_128[0],5); - mmtmpD2 = _mm_srai_epi32(mmtmpD2,log2_approx(sum_det)); - mmtmpD2 = _mm_slli_epi32(mmtmpD2,5); - - mmtmpD3 = _mm_unpacklo_epi32(mmtmpD2,mmtmpD2); - - mmtmpD2 = _mm_unpackhi_epi32(mmtmpD2,mmtmpD2); - - mmtmpD2 = _mm_packs_epi32(mmtmpD3,mmtmpD2); - - dl_ch_mag128_0[0] = mmtmpD2; - dl_ch_mag128b_0[0] = mmtmpD2; - dl_ch_mag128r_0[0] = mmtmpD2; - - dl_ch_mag128_0[0] = _mm_mulhi_epi16(dl_ch_mag128_0[0],QAM_amp128); - dl_ch_mag128_0[0] = _mm_slli_epi16(dl_ch_mag128_0[0],1); - - dl_ch_mag128b_0[0] = _mm_mulhi_epi16(dl_ch_mag128b_0[0],QAM_amp128b); - dl_ch_mag128b_0[0] = _mm_slli_epi16(dl_ch_mag128b_0[0],1); - - dl_ch_mag128r_0[0] = _mm_mulhi_epi16(dl_ch_mag128r_0[0],QAM_amp128r); - dl_ch_mag128r_0[0] = _mm_slli_epi16(dl_ch_mag128r_0[0],1); - - //print_shorts("mag layer 1:",(int16_t*)&dl_ch_mag128_0[0]); - //print_shorts("mag layer 2:",(int16_t*)&dl_ch_mag128_1[0]); - //print_shorts("magb layer 1:",(int16_t*)&dl_ch_mag128b_0[0]); - //print_shorts("magb layer 2:",(int16_t*)&dl_ch_mag128b_1[0]); - //print_shorts("magr layer 1:",(int16_t*)&dl_ch_mag128r_0[0]); - //print_shorts("magr layer 2:",(int16_t*)&dl_ch_mag128r_1[0]); } - // multiply by channel Inv - //rxdataF_zf128_0 = rxdataF_comp128_0*d - b*rxdataF_comp128_1 - //rxdataF_zf128_1 = rxdataF_comp128_1*a - c*rxdataF_comp128_0 - //printf("layer_1 \n"); - mmtmpD0 = nr_comp_muli_sum(rxdataF_comp128_0[0], - after_mf_d_128[0], - rxdataF_comp128_1[0], - after_mf_b_128[0], - determ_fin_128[0]); - - //printf("layer_2 \n"); - mmtmpD1 = nr_comp_muli_sum(rxdataF_comp128_1[0], - after_mf_a_128[0], - rxdataF_comp128_0[0], - after_mf_c_128[0], - determ_fin_128[0]); - - rxdataF_comp128_0[0] = mmtmpD0; - rxdataF_comp128_1[0] = mmtmpD1; -#ifdef DEBUG_DLSCH_DEMOD - printf("\n Rx signal after ZF l%d rb%d\n",symbol,rb); - print_shorts(" Rx layer 1:",(int16_t*)&rxdataF_comp128_0[0]); - print_shorts(" Rx layer 2:",(int16_t*)&rxdataF_comp128_1[0]); -#endif - determ_fin_128 += 1; - dl_ch_mag128_0 += 1; - dl_ch_mag128b_0 += 1; - dl_ch_mag128r_0 += 1; - rxdataF_comp128_0 += 1; - rxdataF_comp128_1 += 1; - after_mf_a_128 += 1; - after_mf_b_128 += 1; - after_mf_c_128 += 1; - after_mf_d_128 += 1; } - _mm_empty(); - _m_empty(); - return(0); + + //Compute H^*H matrix elements and sub elements:(1/2^log2_maxh)*conjH_H_elements + for (int rtx=0;rtx2) { + if (mod_order == 4) { + QAM_amp128 = _mm_set1_epi16(QAM16_n1); //2/sqrt(10) + QAM_amp128b = _mm_setzero_si128(); + QAM_amp128r = _mm_setzero_si128(); + } else if (mod_order == 6) { + QAM_amp128 = _mm_set1_epi16(QAM64_n1); //4/sqrt{42} + QAM_amp128b = _mm_set1_epi16(QAM64_n2); //2/sqrt{42} + QAM_amp128r = _mm_setzero_si128(); + } else if (mod_order == 8) { + QAM_amp128 = _mm_set1_epi16(QAM256_n1); //8/sqrt{170} + QAM_amp128b = _mm_set1_epi16(QAM256_n2);//4/sqrt{170} + QAM_amp128r = _mm_set1_epi16(QAM256_n3);//2/sqrt{170} + } + dl_ch_mag128_0 = (__m128i *)&dl_ch_mag[0][symbol*nb_rb*12]; + dl_ch_mag128b_0 = (__m128i *)&dl_ch_magb[0][symbol*nb_rb*12]; + dl_ch_mag128r_0 = (__m128i *)&dl_ch_magr[0][symbol*nb_rb*12]; + } + + for (int rb=0; rb<3*nb_rb_0; rb++) { + if (mod_order>2) { + /*int sum_det =0; + for (int k=0; k<4;k++) { + sum_det += ((((int *)&determ_fin_128[0])[k])>>2); + //printf("det_%d = %d\n",k,sum_det); + }*/ + + mmtmpD2 = _mm_sign_epi16(determ_fin_128[0],*(__m128i*)&nr_realpart[0]); + //mmtmpD2 = _mm_slli_epi32(mmtmpD2,5); + + mmtmpD3 = _mm_unpacklo_epi32(mmtmpD2,mmtmpD2); + + mmtmpD2 = _mm_unpackhi_epi32(mmtmpD2,mmtmpD2); + + mmtmpD2 = _mm_packs_epi32(mmtmpD3,mmtmpD2); + + dl_ch_mag128_0[0] = mmtmpD2; + dl_ch_mag128b_0[0] = mmtmpD2; + dl_ch_mag128r_0[0] = mmtmpD2; + + dl_ch_mag128_0[0] = _mm_mulhi_epi16(dl_ch_mag128_0[0],QAM_amp128); + dl_ch_mag128_0[0] = _mm_slli_epi16(dl_ch_mag128_0[0],1); + + dl_ch_mag128b_0[0] = _mm_mulhi_epi16(dl_ch_mag128b_0[0],QAM_amp128b); + dl_ch_mag128b_0[0] = _mm_slli_epi16(dl_ch_mag128b_0[0],1); + + dl_ch_mag128r_0[0] = _mm_mulhi_epi16(dl_ch_mag128r_0[0],QAM_amp128r); + dl_ch_mag128r_0[0] = _mm_slli_epi16(dl_ch_mag128r_0[0],1); + + //print_shorts("mag layer 1:",(int16_t*)&dl_ch_mag128_0[0]); + //print_shorts("mag layer 2:",(int16_t*)&dl_ch_mag128_1[0]); + //print_shorts("magb layer 1:",(int16_t*)&dl_ch_mag128b_0[0]); + //print_shorts("magb layer 2:",(int16_t*)&dl_ch_mag128b_1[0]); + //print_shorts("magr layer 1:",(int16_t*)&dl_ch_mag128r_0[0]); + //print_shorts("magr layer 2:",(int16_t*)&dl_ch_mag128r_1[0]); + } + // multiply by channel Inv + //rxdataF_zf128_0 = rxdataF_comp128_0*d - b*rxdataF_comp128_1 + //rxdataF_zf128_1 = rxdataF_comp128_1*a - c*rxdataF_comp128_0 + //printf("layer_1 \n"); + mmtmpD0 = nr_comp_muli_sum(rxdataF_comp128_0[0], + after_mf_d_128[0], + rxdataF_comp128_1[0], + after_mf_b_128[0], + 9); + + //printf("layer_2 \n"); + mmtmpD1 = nr_comp_muli_sum(rxdataF_comp128_1[0], + after_mf_a_128[0], + rxdataF_comp128_0[0], + after_mf_c_128[0], + 9); + + rxdataF_comp128_0[0] = mmtmpD0; + rxdataF_comp128_1[0] = mmtmpD1; + //#ifdef DEBUG_DLSCH_DEMOD + printf("\n Rx signal after ZF l%d rb%d\n",symbol,rb); + print_shorts(" Rx layer 1:",(int16_t*)&rxdataF_comp128_0[0]); + print_shorts(" Rx layer 2:",(int16_t*)&rxdataF_comp128_1[0]); + //#endif + determ_fin_128 += 1; + dl_ch_mag128_0 += 1; + dl_ch_mag128b_0 += 1; + dl_ch_mag128r_0 += 1; + rxdataF_comp128_0 += 1; + rxdataF_comp128_1 += 1; + after_mf_a_128 += 1; + after_mf_b_128 += 1; + after_mf_c_128 += 1; + after_mf_d_128 += 1; + } + } + _mm_empty(); + _m_empty(); + return(0); } static void nr_dlsch_layer_demapping(int16_t **llr_cw, From 9ca7f14ce8cbb8808044e8a8854e07c74287e12e Mon Sep 17 00:00:00 2001 From: sfn Date: Sat, 22 Jan 2022 07:47:24 +0100 Subject: [PATCH 300/883] Fix 2,3 , and 4 layers zero forcing Rx with fixed point implementation (tested in dlsim) --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 456 +++++++++--------- openair1/SIMULATION/NR_PHY/dlsim.c | 8 +- 2 files changed, 229 insertions(+), 235 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 2db09e2380..bc98539783 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -1942,6 +1942,29 @@ void nr_det_2x2(int32_t *a,//a _m_empty(); } +/* Zero Forcing Rx function: nr_a_sum_b() + * Compute the complex addition x=x+y + * + * */ +void nr_a_sum_b(__m128i *input_x, + __m128i *input_y, + unsigned short nb_rb) +{ + unsigned short rb; + + for (rb=0; rb2) { - if (mod_order == 4) { - QAM_amp128 = _mm_set1_epi16(QAM16_n1); //2/sqrt(10) - QAM_amp128b = _mm_setzero_si128(); - QAM_amp128r = _mm_setzero_si128(); - } else if (mod_order == 6) { - QAM_amp128 = _mm_set1_epi16(QAM64_n1); //4/sqrt{42} - QAM_amp128b = _mm_set1_epi16(QAM64_n2); //2/sqrt{42} - QAM_amp128r = _mm_setzero_si128(); - } else if (mod_order == 8) { - QAM_amp128 = _mm_set1_epi16(QAM256_n1); //8/sqrt{170} - QAM_amp128b = _mm_set1_epi16(QAM256_n2);//4/sqrt{170} - QAM_amp128r = _mm_set1_epi16(QAM256_n3);//2/sqrt{170} - } - dl_ch_mag128_0 = (__m128i *)&dl_ch_mag[0][symbol*nb_rb*12]; - dl_ch_mag128b_0 = (__m128i *)&dl_ch_magb[0][symbol*nb_rb*12]; - dl_ch_mag128r_0 = (__m128i *)&dl_ch_magr[0][symbol*nb_rb*12]; - } - - for (int rb=0; rb<3*nb_rb_0; rb++) { - if (mod_order>2) { - /*int sum_det =0; - for (int k=0; k<4;k++) { - sum_det += ((((int *)&determ_fin_128[0])[k])>>2); - //printf("det_%d = %d\n",k,sum_det); - }*/ - - mmtmpD2 = _mm_sign_epi16(determ_fin_128[0],*(__m128i*)&nr_realpart[0]); - //mmtmpD2 = _mm_slli_epi32(mmtmpD2,5); - - mmtmpD3 = _mm_unpacklo_epi32(mmtmpD2,mmtmpD2); - - mmtmpD2 = _mm_unpackhi_epi32(mmtmpD2,mmtmpD2); - - mmtmpD2 = _mm_packs_epi32(mmtmpD3,mmtmpD2); - - dl_ch_mag128_0[0] = mmtmpD2; - dl_ch_mag128b_0[0] = mmtmpD2; - dl_ch_mag128r_0[0] = mmtmpD2; - - dl_ch_mag128_0[0] = _mm_mulhi_epi16(dl_ch_mag128_0[0],QAM_amp128); - dl_ch_mag128_0[0] = _mm_slli_epi16(dl_ch_mag128_0[0],1); - - dl_ch_mag128b_0[0] = _mm_mulhi_epi16(dl_ch_mag128b_0[0],QAM_amp128b); - dl_ch_mag128b_0[0] = _mm_slli_epi16(dl_ch_mag128b_0[0],1); - - dl_ch_mag128r_0[0] = _mm_mulhi_epi16(dl_ch_mag128r_0[0],QAM_amp128r); - dl_ch_mag128r_0[0] = _mm_slli_epi16(dl_ch_mag128r_0[0],1); - - //print_shorts("mag layer 1:",(int16_t*)&dl_ch_mag128_0[0]); - //print_shorts("mag layer 2:",(int16_t*)&dl_ch_mag128_1[0]); - //print_shorts("magb layer 1:",(int16_t*)&dl_ch_mag128b_0[0]); - //print_shorts("magb layer 2:",(int16_t*)&dl_ch_mag128b_1[0]); - //print_shorts("magr layer 1:",(int16_t*)&dl_ch_mag128r_0[0]); - //print_shorts("magr layer 2:",(int16_t*)&dl_ch_mag128r_1[0]); - } - // multiply by channel Inv - //rxdataF_zf128_0 = rxdataF_comp128_0*d - b*rxdataF_comp128_1 - //rxdataF_zf128_1 = rxdataF_comp128_1*a - c*rxdataF_comp128_0 - //printf("layer_1 \n"); - mmtmpD0 = nr_comp_muli_sum(rxdataF_comp128_0[0], - after_mf_d_128[0], - rxdataF_comp128_1[0], - after_mf_b_128[0], - 9); - - //printf("layer_2 \n"); - mmtmpD1 = nr_comp_muli_sum(rxdataF_comp128_1[0], - after_mf_a_128[0], - rxdataF_comp128_0[0], - after_mf_c_128[0], - 9); - - rxdataF_comp128_0[0] = mmtmpD0; - rxdataF_comp128_1[0] = mmtmpD1; - //#ifdef DEBUG_DLSCH_DEMOD - printf("\n Rx signal after ZF l%d rb%d\n",symbol,rb); - print_shorts(" Rx layer 1:",(int16_t*)&rxdataF_comp128_0[0]); - print_shorts(" Rx layer 2:",(int16_t*)&rxdataF_comp128_1[0]); - //#endif - determ_fin_128 += 1; - dl_ch_mag128_0 += 1; - dl_ch_mag128b_0 += 1; - dl_ch_mag128r_0 += 1; - rxdataF_comp128_0 += 1; - rxdataF_comp128_1 += 1; - after_mf_a_128 += 1; - after_mf_b_128 += 1; - after_mf_c_128 += 1; - after_mf_d_128 += 1; - } + fpshift);//(64*2=2^7)/2^15 + print_shorts(" nr_det_2x2 ",(int16_t*)&determ_fin[0]); } - _mm_empty(); - _m_empty(); - return(0); + else if(n_tx==3) { + nr_det_3x3(conjH_H_elements[0][0],//a11 + conjH_H_elements[n_tx][0],//a12 + conjH_H_elements[2*n_tx][0],//a13 + conjH_H_elements[1][0],//a21 + conjH_H_elements[n_tx+1][0],//a22 + conjH_H_elements[2*n_tx+1][0],//a23 + conjH_H_elements[2][0],//a31 + conjH_H_elements[n_tx+2][0],//a32 + conjH_H_elements[2*n_tx+2][0],//a33 + determ_fin, + nb_rb, + +1, + fpshift); + print_shorts(" nr_det_3x3",(int16_t*)&determ_fin[0]); + } + else if(n_tx==4) { + nr_det_4x4(conjH_H_elements,// + determ_fin,//ad-bc + nb_rb, + +1, + fpshift); + print_shorts(" nr_det_4x4",(int16_t*)&determ_fin[0]); + } + + + // multiply Matrix inversion pf H_h_H by the rx signal vector + int32_t outtemp[12*nb_rb] __attribute__((aligned(32))); + int32_t **rxdataF_zforcing; + + //Allocate rxdataF for zforcing out + rxdataF_zforcing = (int32_t **)malloc16_clear( n_tx*sizeof(int32_t *) ); + for (int rtx=0;rtx Date: Sat, 22 Jan 2022 15:41:28 +0100 Subject: [PATCH 302/883] re-write the matrix inversion in zero forcing --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 432 ++++-------------- 1 file changed, 96 insertions(+), 336 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index d746cf0632..fe4338297b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -1863,85 +1863,6 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp, #endif } -/* Zero Forcing Rx function: nr_det_2x2() - * Compute the Matrix determinant for 2x2 - * - * */ -void nr_det_2x2(int32_t *a,//a - int32_t *b,//b - int32_t *c,//c - int32_t *d,//d - int32_t *ad_bc,//ad-bc - unsigned short nb_rb, - int32_t sign, - int32_t shift0) -{ - int16_t nr_conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ; - unsigned short rb; - __m128i *a_128,*b_128, *c_128, *d_128, ad_re_128, bc_re_128, ad_im_128, bc_im_128; - __m128i *ad_bc_128, det_re_128, det_im_128, tmp_det0, tmp_det1; - - a_128 = (__m128i *)a; - b_128 = (__m128i *)b; - c_128 = (__m128i *)c; - d_128 = (__m128i *)d; - - ad_bc_128 = (__m128i *)ad_bc; - - for (rb=0; rb<3*nb_rb; rb++) { - - //complex multiplication (I_a+jQ_a)(I_d+jQ_d) = (I_aI_d - Q_aQ_d) + j(Q_aI_d + I_aQ_d) - //The real part - ad_re_128 = _mm_sign_epi16(a_128[0],*(__m128i*)&nr_conjug2[0]); - ad_re_128 = _mm_madd_epi16(ad_re_128,d_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1 - //The Imag part - ad_im_128 = _mm_shufflelo_epi16(a_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits - ad_im_128 = _mm_shufflehi_epi16(ad_im_128,_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits - ad_im_128 = _mm_madd_epi16(ad_im_128,d_128[0]);//Im: (Q_aI_d + I_aQ_d) - - //complex multiplication (I_b+jQ_b)(I_c+jQ_c) = (I_bI_c - Q_bQ_c) + j(Q_bI_c + I_bQ_c) - //The real part - bc_re_128 = _mm_sign_epi16(b_128[0],*(__m128i*)&nr_conjug2[0]); - bc_re_128 = _mm_madd_epi16(bc_re_128,c_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1 - //The imag part - bc_im_128 = _mm_shufflelo_epi16(b_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_b0 Q_b1 I_b2 Q_b3]_64bits to [Q_b1 I_b0 Q_b3 I_b2]_64bits - bc_im_128 = _mm_shufflehi_epi16(bc_im_128,_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 64 bits as [I_b0 Q_b1 I_b2 Q_b3]_64bits to [Q_b1 I_b0 Q_b3 I_b2]_64bits - bc_im_128 = _mm_madd_epi16(bc_im_128,c_128[0]);//Im: (Q_bI_c + I_bQ_c) - - if (sign>0){ - det_re_128 = _mm_sub_epi32(ad_re_128, bc_re_128); - det_im_128 = _mm_sub_epi32(ad_im_128, bc_im_128); - }else{ - det_re_128 = _mm_sub_epi32(bc_re_128,ad_re_128); - det_im_128 = _mm_sub_epi32(bc_im_128,ad_im_128); - } - //convert back to Q15 before packing - det_re_128 = _mm_srai_epi32(det_re_128,shift0); - det_im_128 = _mm_srai_epi32(det_im_128,shift0); - - tmp_det0 = _mm_unpacklo_epi32(det_re_128,det_im_128); - //print_ints("unpack lo:",&tmp_det0[0]); - tmp_det1 = _mm_unpackhi_epi32(det_re_128,det_im_128); - //print_ints("unpack hi:",&tmp_det1[0]); - ad_bc_128[0] = _mm_packs_epi32(tmp_det0,tmp_det1); - - -#ifdef DEBUG_DLSCH_DEMOD - printf("\n Computing det_2x2 \n"); - //print_ints("det_re_128:",(int32_t*)&det_re_128); - //print_ints("det_im_128:",(int32_t*)&det_im_128); - print_shorts("ad-bc_128:",(int32_t*)&ad_bc_128[0]); -#endif - ad_bc_128+=1; - a_128+=1; - b_128+=1; - c_128+=1; - d_128+=1; - } - _mm_empty(); - _m_empty(); -} - /* Zero Forcing Rx function: nr_a_sum_b() * Compute the complex addition x=x+y * @@ -2015,147 +1936,6 @@ void nr_a_mult_b(int *a, _m_empty(); } -/* Zero Forcing Rx function: nr_det_3x3() - * Compute the matrix determinant for 3x3 - * - * */ -void nr_det_3x3(int32_t *a11,// - int32_t *a12,// - int32_t *a13,// - int32_t *a21,// - int32_t *a22,// - int32_t *a23,// - int32_t *a31,// - int32_t *a32,// - int32_t *a33,// - int32_t *ad_bc,//ad-bc - unsigned short nb_rb, - int32_t sign, - int32_t shift0){ - int32_t outtemp[12*nb_rb] __attribute__((aligned(32))); - int32_t out1[12*nb_rb] __attribute__((aligned(32))); - int32_t out2[12*nb_rb] __attribute__((aligned(32))); - int32_t out3[12*nb_rb] __attribute__((aligned(32))); - - //a11 - nr_det_2x2(a22,//a - a23,//b - a32,//c - a33,//d - outtemp,//ad-bc - nb_rb, - +1*sign, - shift0); - //print_shorts(" out1 det2x2 ",(int16_t*)&outtemp[0]); - nr_a_mult_b(a11, - outtemp, - out1, - nb_rb, - shift0); - //print_shorts(" a11*out1 ",(int16_t*)&out1[0]); - //a12 - nr_det_2x2(a21,//a - a23,//b - a31,//c - a33,//d - outtemp,//ad-bc - nb_rb, - -1*sign, - shift0); - //print_shorts(" out2 det2x2 ",(int16_t*)&outtemp[0]); - nr_a_mult_b(a12, - outtemp, - out2, - nb_rb, - shift0); - //print_shorts(" a12*out2 ",(int16_t*)&out2[0]); - //a13 - nr_det_2x2(a21,//a - a22,//b - a31,//c - a32,//d - outtemp,//ad-bc - nb_rb, - +1*sign, - shift0); - //print_shorts(" out3 det2x2 ",(int16_t*)&outtemp[0]); - nr_a_mult_b(a13, - outtemp, - out3, - nb_rb, - shift0); - //print_shorts(" a13*out3 ",(int16_t*)&out3[0]); - __m128i *out1_128,*out2_128,*out3_128,*det_128; - - out1_128 = (__m128i *)out1; - out2_128 = (__m128i *)out2; - out3_128 = (__m128i *)out3; - det_128 = (__m128i *)ad_bc; - - for (int rb=0; rb<3*nb_rb; rb++) { - det_128[0] = _mm_adds_epi16(out1_128[0],out2_128[0]); - det_128[0] = _mm_adds_epi16(det_128[0],out3_128[0]); - //if (rb==0) print_shorts(" out det3x3 ",(int16_t*)&det_128[0]); - out1_128+=1; - out2_128+=1; - out3_128+=1; - det_128+=1; - } - _mm_empty(); - _m_empty(); -} - -/* Zero Forcing Rx function: nr_det_4x4() - * Compute the matrix determinant for 4x4 Matrix - * - * */ -void nr_det_4x4(int32_t ***a44,// - int32_t *ad_bc,//ad-bc - unsigned short nb_rb, - int32_t sign, - int32_t shift0){ - int32_t outtemp[12*nb_rb] __attribute__((aligned(32))); - int32_t outtemp1[12*nb_rb] __attribute__((aligned(32))); - int16_t k,rr[3],cc[3]; - for (int rtx=0;rtx<4;rtx++) {//row - k=0; - for(int rrtx=0;rrtx<4;rrtx++) - if(rrtx != rtx) rr[k++] = rrtx; - int ctx=0; - k=0; - for(int cctx=0;cctx<4;cctx++) - if(cctx != ctx) cc[k++] = cctx; - - nr_det_3x3(a44[cc[0]*4+rr[0]][0],//a11 - a44[cc[1]*4+rr[0]][0],//a12 - a44[cc[2]*4+rr[0]][0],//a13 - a44[cc[0]*4+rr[1]][0],//a21 - a44[cc[1]*4+rr[1]][0],//a22 - a44[cc[2]*4+rr[1]][0],//a23 - a44[cc[0]*4+rr[2]][0],//a31 - a44[cc[1]*4+rr[2]][0],//a32 - a44[cc[2]*4+rr[2]][0],//a33 - outtemp, - nb_rb, - ((rtx&1)==1?-1:1)*((ctx&1)==1?-1:1), - shift0); - - nr_a_mult_b(a44[ctx*4+rtx][0], - outtemp, - rtx==0? ad_bc:outtemp1, - nb_rb, - shift0); - - if (rtx != 0) nr_a_sum_b((__m128i *)ad_bc, - (__m128i *)outtemp1, - nb_rb); - - } - - _mm_empty(); - _m_empty(); -} - /* Zero Forcing Rx function: nr_element_sign() * Compute b=sign*a * @@ -2192,29 +1972,65 @@ void nr_element_sign(int32_t *a,//a _m_empty(); } -/* Zero Forcing Rx function: nr_construct_HhH_elements() - * +/* Zero Forcing Rx function: nr_det_4x4() + * Compute the matrix determinant for 4x4 Matrix * * */ -void nr_construct_HhH_elements(int **conjH_H_elements, - unsigned char n_rx, - unsigned short nb_rb) -{ - //This function is used to construct the (H_hermitian * H matrix) matrix elements - unsigned short rb; - __m128i *conjH_H_elements_0_128, *conjH_H_elements_aarx_128; - - - for (rb=0; rb<3*nb_rb; rb++) { - conjH_H_elements_0_128 = (__m128i *)&conjH_H_elements[0][rb*4]; - for (int aarx=1;aarx Date: Sun, 23 Jan 2022 23:48:38 +0100 Subject: [PATCH 303/883] implement and test foating point calc for zero forcing --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 318 +++++++++++++----- 1 file changed, 226 insertions(+), 92 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index fe4338297b..7e95033a26 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -42,6 +42,7 @@ #include "PHY/NR_REFSIG/nr_refsig.h" #include "PHY/NR_REFSIG/dmrs_nr.h" #include "common/utils/nr/nr_common.h" +#include /* dynamic shift for LLR computation for TM3/4 * set as command line argument, see lte-softmodem.c @@ -2021,13 +2022,13 @@ void nr_determin(int32_t **a44,// nb_rb, ((rtx&1)==1?-1:1)*((ctx&1)==1?-1:1)*sign, shift0); - nr_a_mult_b(a44[ctx*size+rtx], - outtemp, - rtx==0? ad_bc:outtemp1, - nb_rb, - shift0); + nr_a_mult_b(a44[ctx*size+rtx], + outtemp, + rtx==0? ad_bc:outtemp1, + nb_rb, + shift0); - if (rtx != 0) nr_a_sum_b((__m128i *)ad_bc, + if (rtx != 0) nr_a_sum_b((__m128i *)ad_bc, (__m128i *)outtemp1, nb_rb); } @@ -2036,6 +2037,172 @@ void nr_determin(int32_t **a44,// _m_empty(); } +double complex nr_determin_cpx(double complex *a44_cpx,// + int32_t size,//size + int32_t sign){ + double complex outtemp, outtemp1; + //Allocate the submatrix elements + double complex sub_matrix[(size-1)*(size-1)]; + int16_t k,rr[size-1],cc[size-1]; + + if(size==1) { + return((double complex)a44_cpx[0]*sign); + }else { + outtemp1 = 0; + for (int rtx=0;rtx inv_H_h_H(%d,%d) = %d+j%d \n",rtx,ctx,((short *)a44[ctx*size+rtx])[0],((short *)a44[ctx*size+rtx])[1],ctx,rtx,((short *)inv_H_h_H[rtx*size+ctx])[0],((short *)inv_H_h_H[rtx*size+ctx])[1]); + } + } + _mm_empty(); + _m_empty(); + } + else {//floating point calc. + //Allocate the submatrix elements + double complex sub_matrix_cpx[(size-1)*(size-1)]; + //Convert the IQ samples (in Q15 format) to float complex + double complex a44_cpx[size*size]; + double complex inv_H_h_H_cpx[size*size]; + double complex determin_cpx; + for (int i=0; i<12*nb_rb; i++) { + + for (int rtx=0;rtx0)//determin of the symmetric matrix is real part only + ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)/(1<<(size-1)*shift0))+0.5);// + else + ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)/(1<<(size-1)*shift0))-0.5);// + ((short*) ad_bc)[(i<<1)+1] = (short) 0;//Imag=0 + + //Compute Inversion of the H^*H matrix + for (int rtx=0;rtx inv_H_h_H(%d,%d) = %lf+j%lf \n",rtx,ctx,creal(a44_cpx[ctx*size+rtx]),cimag(a44_cpx[ctx*size+rtx]),ctx,rtx,creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15),cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15)); + + if (creal(inv_H_h_H_cpx[rtx*size+ctx])>0) + ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15))+0.5);// + else + ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15))-0.5);// + + if (cimag(inv_H_h_H_cpx[rtx*size+ctx])>0) + ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15))+0.5);// + else + ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15))-0.5);// + } + } + } + } + return(0); +} + /* Zero Forcing Rx function: nr_conjch0_mult_ch1() * * @@ -2101,11 +2268,9 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, int length) { int *ch0r, *ch0c; - int32_t determ_fin[12*nb_rb] __attribute__((aligned(32))); - int32_t *** conjH_H_elements; - uint32_t nb_rb_0 = length/12 + ((length%12)?1:0); + int32_t determ_fin[12*nb_rb_0] __attribute__((aligned(32))); ///Allocate H^*H matrix elements and sub elements conjH_H_elements = (int32_t ***)malloc16_clear( n_rx*sizeof(int32_t **) ); @@ -2113,94 +2278,55 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, conjH_H_elements[aarx] = (int32_t **)malloc16_clear( n_tx*n_tx*sizeof(int32_t) ); for (int rtx=0;rtx Date: Sun, 23 Jan 2022 23:50:16 +0100 Subject: [PATCH 304/883] fix code book I gene. --- openair1/PHY/INIT/nr_init.c | 360 +++++++++++++++------------ openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 3 +- 2 files changed, 205 insertions(+), 158 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 0fa740d506..f19c1a9520 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -100,7 +100,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction: N1=2; N2=1; - O1=4; + O1=1;//or 4 O2=1; CSI_RS_antenna_ports=4; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_one\n",CSI_RS_antenna_ports); @@ -108,15 +108,15 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction: N1=2; N2=2; - O1=4; - O2=4; + O1=1;//or 4 + O2=1;// or 4 CSI_RS_antenna_ports=8; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_two_TypeI\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction: N1=4; N2=1; - O1=4; + O1=1;//or 4 O2=1; CSI_RS_antenna_ports=8; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_one\n",CSI_RS_antenna_ports); @@ -124,15 +124,15 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction: N1=3; N2=2; - O1=4; - O2=4; + O1=1;//or 4 + O2=1;// or 4 CSI_RS_antenna_ports=12; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_three_two\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction: N1=6; N2=1; - O1=4; + O1=1; O2=1; CSI_RS_antenna_ports=12; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_one\n",CSI_RS_antenna_ports); @@ -140,15 +140,15 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction: N1=4; N2=2; - O1=4; - O2=4; + O1=1; + O2=1; CSI_RS_antenna_ports=16; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_two\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction: N1=8; N2=1; - O1=4; + O1=1; O2=1; CSI_RS_antenna_ports=16; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_one\n",CSI_RS_antenna_ports); @@ -156,23 +156,23 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction: N1=4; N2=3; - O1=4; - O2=4; + O1=1; + O2=1; CSI_RS_antenna_ports=24; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_three\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction: N1=6; N2=2; - O1=4; - O2=4; + O1=1; + O2=1; CSI_RS_antenna_ports=24; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_two\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction: N1=12; N2=1; - O1=4; + O1=1; O2=1; CSI_RS_antenna_ports=24; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_twelve_one\n",CSI_RS_antenna_ports); @@ -180,23 +180,23 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction: N1=4; N2=4; - O1=4; - O2=4; + O1=1; + O2=1; CSI_RS_antenna_ports=32; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_four\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction: N1=8; N2=2; - O1=4; - O2=4; + O1=1; + O2=1; CSI_RS_antenna_ports=32; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_two\n",CSI_RS_antenna_ports); break; case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction: N1=16; N2=1; - O1=4; + O1=1; O2=1; CSI_RS_antenna_ports=32; LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_sixteen_one\n",CSI_RS_antenna_ports); @@ -269,7 +269,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { for(int j_col=0; j_col<1; j_col++) { //1 layer for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna if(j_col==i_rows) { - ((short*) &mat[0][0][i_rows+j_col])[0] = 32768; + mat[0][0][i_rows+j_col] = (1<<14); } } } @@ -314,7 +314,21 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { double complex phase_sign; //Table 5.2.2.2.1-6: //Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; + //Compute the code book size for generating 2 layers out of Tx antenna ports + + //pmi_size is computed as follows + pmiq_size = 1;//1 for unity matrix + for(int llb=0; llb0) - ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); - } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + if((llb != ll) || (mmb != mm)){ + pmiq += 1; + mat[1][pmiq] = (int32_t *)malloc16((2*N1*N2)*(2)*sizeof(int32_t)); + LOG_I(PHY, "layer 2 Codebook pmiq = %d\n",pmiq); + for(int j_col=0; j_col<2; j_col++) { + if (j_col==0) { + llc = llb; + mmc = mmb; + phase_sign = 1; + } + if (j_col==1) { + llc = ll; + mmc = mm; + phase_sign = -1; + } + for (int i_rows=0; i_rows0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_I(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_I(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + } } } } @@ -381,67 +398,82 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Table 5.2.2.2.1-7: //Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS if(CSI_RS_antenna_ports>=3) { - pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; - mat[2] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + //pmi_size is computed as follows + pmiq_size = 1;//unity matrix + for(int llb=0; llb0) - ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); - } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + if((llb != ll) || (mmb != mm)){ + pmiq += 1; + mat[2][pmiq] = (int32_t *)malloc16((2*N1*N2)*(3)*sizeof(int32_t)); + LOG_I(PHY, "layer 3 Codebook pmiq = %d\n",pmiq); + for(int j_col=0; j_col<3; j_col++) { + if (j_col==0) { + llc = llb; + mmc = mmb; + phase_sign = 1; + } + if (j_col==1) { + llc = ll; + mmc = mm; + phase_sign = 1; + } + if (j_col==3) { + llc = llb; + mmc = mmb; + phase_sign = -1; + } + for (int i_rows=0; i_rows0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_I(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + } + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_I(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + } } } } @@ -454,73 +486,89 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Table 5.2.2.2.1-8: //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS if(CSI_RS_antenna_ports>=4) { - pmiq_size = N1*O1*N2*O2*N1*O1*N2*O2*2+1; - mat[3] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + //pmi_size is computed as follows + pmiq_size = 1;//unity matrix + for(int llb=0; llb0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); - } - for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { - res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; - if (creal(res_code)>0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 - if (cimag(res_code)>0) - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 - else - ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + if((llb != ll) || (mmb != mm)){ + pmiq += 1; + mat[3][pmiq] = (int32_t *)malloc16((2*N1*N2)*4*sizeof(int32_t)); + LOG_I(PHY, "layer 4 pmiq = %d\n",pmiq); + for(int j_col=0; j_col<4; j_col++) { + if (j_col==0) { + llc = llb; + mmc = mmb; + phase_sign = 1; + } + if (j_col==1) { + llc = ll; + mmc = mm; + phase_sign = 1; + } + if (j_col==3) { + llc = llb; + mmc = mmb; + phase_sign = -1; + } + if (j_col==4) { + llc = ll; + mmc = mm; + phase_sign = -1; + } + for (int i_rows=0; i_rows0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_I(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + } + + for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { + res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; + if (creal(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15 + if (cimag(res_code)>0) + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 + else + ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 + LOG_I(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + } } } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index dd76d38aa2..1e3db85a0a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -495,8 +495,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, // The same precoding matrix is applied on prg_size RBs, Thus // pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1 // The Precoding matrix: - // The Codebook Type I and Type II are not supported yet. - // We`adopt the precoding matrices of PUSCH for 4 layers. + // The Codebook Type I start_meas(&gNB->dlsch_precoding_stats); for (int ap=0; apnb_antennas_tx; ap++) { From b66c3e0b7b47ddca5c8c204595f62258b898898e Mon Sep 17 00:00:00 2001 From: sfn Date: Tue, 25 Jan 2022 08:25:40 +0100 Subject: [PATCH 305/883] Fix Codebook gen. for 3 and 4 layers --- openair1/PHY/INIT/nr_init.c | 158 +++++------------------------------- 1 file changed, 21 insertions(+), 137 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index f19c1a9520..3f72075ac9 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -87,130 +87,14 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { // N2 . . . . ... . // X X X X ... X // |<-----N1---->| - if (gNB->frame_parms.nb_antennas_tx == 2) {//nrOfAntennaPorts = two - N1=1; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=2; - LOG_D(PHY, "NR Codebook Config: antenna ports: %d\n",CSI_RS_antenna_ports); - } else if(gNB->frame_parms.nb_antennas_tx > 2) {//nrOfAntennaPorts moreThanTwo - //Type 1 Single Panel : Based on 38.214 v15.3-Table 5.2.2.2.1-2: Supported configurations of (N1,N2) and (O1,O2) - switch(gNB->frame_parms.antennas_tx_n1_n2) { - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction: - N1=2; - N2=1; - O1=1;//or 4 - O2=1; - CSI_RS_antenna_ports=4; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction: - N1=2; - N2=2; - O1=1;//or 4 - O2=1;// or 4 - CSI_RS_antenna_ports=8; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_two_two_TypeI\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction: - N1=4; - N2=1; - O1=1;//or 4 - O2=1; - CSI_RS_antenna_ports=8; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction: - N1=3; - N2=2; - O1=1;//or 4 - O2=1;// or 4 - CSI_RS_antenna_ports=12; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_three_two\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction: - N1=6; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=12; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction: - N1=4; - N2=2; - O1=1; - O2=1; - CSI_RS_antenna_ports=16; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_two\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction: - N1=8; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=16; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction: - N1=4; - N2=3; - O1=1; - O2=1; - CSI_RS_antenna_ports=24; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_three\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction: - N1=6; - N2=2; - O1=1; - O2=1; - CSI_RS_antenna_ports=24; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_six_two\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction: - N1=12; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=24; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_twelve_one\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction: - N1=4; - N2=4; - O1=1; - O2=1; - CSI_RS_antenna_ports=32; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_four_four\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction: - N1=8; - N2=2; - O1=1; - O2=1; - CSI_RS_antenna_ports=32; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_eight_two\n",CSI_RS_antenna_ports); - break; - case NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction: - N1=16; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=32; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d n1_n2_PR_sixteen_one\n",CSI_RS_antenna_ports); - break; - default: - N1=1; - N2=1; - O1=1; - O2=1; - CSI_RS_antenna_ports=2; - LOG_D(PHY, "NR Codebook Config: codebookType: type1, antenna ports: %d \n",CSI_RS_antenna_ports); - break; - } - } + int x_polarization=2;//1 or 2 + //Get the uniform planar array parameters + N2 = 1;//one-dimenstional array (1, 2, 3, 4 are supported in 5G) + O2 = 1;//Vertical beam oversampling (1 or 4) + N1 = gNB->frame_parms.nb_antennas_tx/(N2*x_polarization);// + O1=1;//Horizontal beam oversampling (1 or 4) + CSI_RS_antenna_ports=N1*N2*x_polarization; + LOG_D(PHY, "NR Codebook Config: antenna ports: %d N1 %d N2 %d\n",CSI_RS_antenna_ports,N1,N2); // Generation of codebook Type1 with codebookMode 1 (CSI_RS_antenna_ports < 16) if (CSI_RS_antenna_ports < 16) { @@ -269,7 +153,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { for(int j_col=0; j_col<1; j_col++) { //1 layer for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna if(j_col==i_rows) { - mat[0][0][i_rows+j_col] = (1<<14); + mat[0][0][i_rows+j_col] = 0x7fff; } } } @@ -323,7 +207,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { for(int ll=0; ll Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); } for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { @@ -567,7 +451,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); } } } From 631cd33f152bad951f751a2148e126892d0af73a Mon Sep 17 00:00:00 2001 From: sfn Date: Tue, 25 Jan 2022 11:34:57 +0100 Subject: [PATCH 306/883] Adjust ZF Rx fixed point shift --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 66 ++++++++++--------- targets/ARCH/rfsimulator/simulator.c | 8 +-- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 2 +- 3 files changed, 40 insertions(+), 36 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 7e95033a26..7fc1e99c31 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -474,7 +474,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, dl_ch_mag_ptr = pdsch_vars[gNB_id_i]->dl_ch_mag0; if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine and zero forcing %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); /* Store the valid DL RE's */ @@ -2104,7 +2104,7 @@ uint8_t nr_matrix_inverse(int32_t **a44,//Input matrix//conjH_H_elements[0] nb_rb, +1, shift0); - print_shorts("nr_det_",(int16_t*)&ad_bc[0]); + //print_shorts("nr_det_",(int16_t*)&ad_bc[0]); //Compute Inversion of the H^*H matrix /* For 2x2 MIMO matrix, we compute @@ -2135,7 +2135,7 @@ uint8_t nr_matrix_inverse(int32_t **a44,//Input matrix//conjH_H_elements[0] nb_rb, ((rtx&1)==1?-1:1)*((ctx&1)==1?-1:1), shift0); - printf("H_h_H(r%d,c%d)=%d+j%d --> inv_H_h_H(%d,%d) = %d+j%d \n",rtx,ctx,((short *)a44[ctx*size+rtx])[0],((short *)a44[ctx*size+rtx])[1],ctx,rtx,((short *)inv_H_h_H[rtx*size+ctx])[0],((short *)inv_H_h_H[rtx*size+ctx])[1]); + //printf("H_h_H(r%d,c%d)=%d+j%d --> inv_H_h_H(%d,%d) = %d+j%d \n",rtx,ctx,((short *)a44[ctx*size+rtx])[0],((short *)a44[ctx*size+rtx])[1],ctx,rtx,((short *)inv_H_h_H[rtx*size+ctx])[0],((short *)inv_H_h_H[rtx*size+ctx])[1]); } } _mm_empty(); @@ -2159,15 +2159,18 @@ uint8_t nr_matrix_inverse(int32_t **a44,//Input matrix//conjH_H_elements[0] determin_cpx = nr_determin_cpx(a44_cpx,// size,//size +1); - if (i<4) printf("nr_det_cpx = %lf+j%lf \n",creal(determin_cpx)/(1<<(size-1)*shift0),cimag(determin_cpx)/(1<<(size-1)*shift0)); - //Round and convert to Q15 - if (creal(determin_cpx)>0)//determin of the symmetric matrix is real part only - ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)/(1<<(size-1)*shift0))+0.5);// - else - ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)/(1<<(size-1)*shift0))-0.5);// - ((short*) ad_bc)[(i<<1)+1] = (short) 0;//Imag=0 + //if (i<4) printf("order %d nr_det_cpx = %lf+j%lf \n",log2_approx(creal(determin_cpx)),creal(determin_cpx)/(1<<((size-1)*shift0)),cimag(determin_cpx)/(1<<((size-1)*shift0))); - //Compute Inversion of the H^*H matrix + //Round and convert to Q15 (Out in the same format as Fixed point). + if (creal(determin_cpx)>0) {//determin of the symmetric matrix is real part only + ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)/(1<<((size-1)*shift0)))+0.5);// + ((short*) ad_bc)[(i<<1)+1] = (short) ((cimag(determin_cpx)/(1<<((size-1)*shift0)))+0.5);// + } else { + ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)/(1<<((size-1)*shift0)))-0.5);// + ((short*) ad_bc)[(i<<1)+1] = (short) ((cimag(determin_cpx)/(1<<((size-1)*shift0)))-0.5);// + } + //if (i<4) printf("nr_det_FP= %d+j%d \n",((short*) ad_bc)[i<<1],((short*) ad_bc)[(i<<1)+1]); + //Compute Inversion of the H^*H matrix (normalized output divide by determinant) for (int rtx=0;rtx inv_H_h_H(%d,%d) = %lf+j%lf \n",rtx,ctx,creal(a44_cpx[ctx*size+rtx]),cimag(a44_cpx[ctx*size+rtx]),ctx,rtx,creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15),cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15)); + ((rtx&1)==1?-1:1)*((ctx&1)==1?-1:1))/(determin_cpx); + //if (i==0) printf("H_h_H(r%d,c%d)=%lf+j%lf --> inv_H_h_H(%d,%d) = %lf+j%lf \n",rtx,ctx,creal(a44_cpx[ctx*size+rtx]),cimag(a44_cpx[ctx*size+rtx]),ctx,rtx,creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18),cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18)); if (creal(inv_H_h_H_cpx[rtx*size+ctx])>0) - ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15))+0.5);// + ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18))+0.5);//Convert to Q 18 else - ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15))-0.5);// + ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18))-0.5);// if (cimag(inv_H_h_H_cpx[rtx*size+ctx])>0) - ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15))+0.5);// + ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18))+0.5);// else - ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<15))-0.5);// + ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18))-0.5);// + + //if (i<4) printf("inv_H_h_H_FP(%d,%d)= %d+j%d \n",ctx,rtx, ((short *) inv_H_h_H[rtx*size+ctx])[i<<1],((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1]); } } } @@ -2310,15 +2315,15 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, inv_H_h_H[ctx*n_tx+rtx] = (int32_t *)malloc16_clear( 12*nb_rb_0*sizeof(int32_t) ); } } - int fpshift = 5; - int fp_flag = 0; + int fp_flag = 1;//0: float point calc 1: Fixed point calc + int fpshift = 8; nr_matrix_inverse(conjH_H_elements[0],//Input matrix inv_H_h_H,//Inverse determ_fin,//determin n_tx,//size nb_rb_0, fp_flag,//fixed point flag - fpshift); + fpshift);//the out put is Q15 // multiply Matrix inversion pf H_h_H by the rx signal vector int32_t outtemp[12*nb_rb_0] __attribute__((aligned(32))); @@ -2339,17 +2344,17 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, (int *)&rxdataF_comp[ctx*n_rx][symbol*nb_rb*12], outtemp, nb_rb_0, - fpshift);//9 + fpshift + (fp_flag? 0: 2));//out in 15-fpshift nr_a_sum_b((__m128i *)rxdataF_zforcing[rtx], - (__m128i *)outtemp, - nb_rb_0);//a =a + b + (__m128i *)outtemp, + nb_rb_0);//a =a + b } -//#ifdef DEBUG_DLSCH_DEMOD +#ifdef DEBUG_DLSCH_DEMOD printf("Computing layer_%d \n",rtx);; print_shorts(" Rx signal:=",(int16_t*)&rxdataF_zforcing[rtx][0]); print_shorts(" Rx signal:=",(int16_t*)&rxdataF_zforcing[rtx][4]); print_shorts(" Rx signal:=",(int16_t*)&rxdataF_zforcing[rtx][8]); -//#endif +#endif } //Copy zero_forcing out to output array @@ -2387,9 +2392,8 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, for (int rb=0; rb<3*nb_rb_0; rb++) { //for symmetric H_h_H matrix, the determinant is only real values if (fp_flag) { - mmtmpD2 = _mm_sign_epi16(determ_fin_128[0],*(__m128i*)&nr_realpart[0]); - mmtmpD3 = mmtmpD2; - mmtmpD3 = _mm_shufflelo_epi16(mmtmpD3,_MM_SHUFFLE(2,3,0,1)); + mmtmpD2 = _mm_sign_epi16(determ_fin_128[0],*(__m128i*)&nr_realpart[0]);//set imag part to 0 + mmtmpD3 = _mm_shufflelo_epi16(mmtmpD2,_MM_SHUFFLE(2,3,0,1)); mmtmpD3 = _mm_shufflehi_epi16(mmtmpD3,_MM_SHUFFLE(2,3,0,1)); mmtmpD2 = _mm_add_epi16(mmtmpD2,mmtmpD3); @@ -2406,11 +2410,11 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, dl_ch_mag128r_0[0] = _mm_slli_epi16(dl_ch_mag128r_0[0],1); } else{ dl_ch_mag128_0[0] = QAM_amp128; - dl_ch_mag128_0[0] = _mm_srai_epi16(dl_ch_mag128_0[0],fpshift); + dl_ch_mag128_0[0] = _mm_srai_epi16(dl_ch_mag128_0[0],fpshift-1); dl_ch_mag128b_0[0] = QAM_amp128b; - dl_ch_mag128b_0[0] = _mm_srai_epi16(dl_ch_mag128b_0[0],fpshift); + dl_ch_mag128b_0[0] = _mm_srai_epi16(dl_ch_mag128b_0[0],fpshift-1); dl_ch_mag128r_0[0] = QAM_amp128r; - dl_ch_mag128r_0[0] = _mm_srai_epi16(dl_ch_mag128r_0[0],fpshift); + dl_ch_mag128r_0[0] = _mm_srai_epi16(dl_ch_mag128r_0[0],fpshift-1); } determ_fin_128 += 1; diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index bff62e522d..24a0348d35 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -736,10 +736,10 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest CirSize ); else { // no channel modeling - double H_awgn_mimo[4][4] ={{1.0, 0.0, 0.0, 0.0},//rx 0 - {0.0, 1.0, 0.0, 0.0}, //rx 1 - {0.0, 0.0, 1.0, 0.0}, //rx 2 - {0.0, 0.0, 0.0, 1.0}};//rx 3 + 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 sample_t *out=(sample_t *)samplesVoid[a]; int nbAnt_tx = ptr->th.nbAnt;//number of Tx antennas diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index b682f130b1..e5348ab605 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -219,7 +219,7 @@ RUs = ( #bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; ## beamforming 2x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000]; - ## beamforming 4x4 matrix: + #beamforming 4x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2"; clock_src = "external"; From 918862475cf82f07bc68684aa7c2281af1bd1107 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 25 Jan 2022 05:53:41 -0800 Subject: [PATCH 307/883] Removing log_minimal and adding new run-time logging opts --- common/utils/LOG/log.c | 123 ++++++++++++++++++++--------------------- common/utils/LOG/log.h | 43 +++++--------- 2 files changed, 72 insertions(+), 94 deletions(-) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index 28134d6db1..0679e0b521 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -65,6 +65,7 @@ char logmem_filename[1024] = {0}; mapping log_level_names[] = { {"error", OAILOG_ERR}, {"warn", OAILOG_WARNING}, + {"analysis", OAILOG_ANALYSIS}, {"info", OAILOG_INFO}, {"debug", OAILOG_DEBUG}, {"trace", OAILOG_TRACE}, @@ -78,6 +79,7 @@ mapping log_options[] = { {"line_num", FLAG_FILE_LINE }, {"function", FLAG_FUNCT}, {"time", FLAG_TIME}, + {"thread_id", FLAG_THREAD_ID}, {NULL,-1} }; @@ -501,6 +503,7 @@ int logInit (void) return 0; } +#include static inline int log_header(log_component_t *c, char *log_buffer, int buffsize, @@ -514,32 +517,43 @@ static inline int log_header(log_component_t *c, char threadname[64]; if (flag & FLAG_THREAD ) { threadname[0]='{'; - if ( pthread_getname_np(pthread_self(), threadname+1,61) != 0) + if (pthread_getname_np(pthread_self(), threadname + 1, sizeof(threadname) - 3) != 0) strcpy(threadname+1, "?thread?"); - strcat(threadname,"}"); + strcat(threadname,"} "); } else { threadname[0]=0; } - + char l[32]; if (flag & FLAG_FILE_LINE && flag & FLAG_FUNCT ) - snprintf(l, sizeof l," (%s:%d) ", func, line); + snprintf(l, sizeof l, "(%s:%d) ", func, line); else if (flag & FLAG_FILE_LINE) - sprintf(l," (%d) ", line); + snprintf(l, sizeof l, "(%d) ", line); else - l[0]=0; + l[0] = 0; char timeString[32]; if ( flag & FLAG_TIME ) { struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); - snprintf(timeString, sizeof t,"%05.3f",t.tv_sec+t.tv_nsec/1.0e9); + if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) + abort(); + snprintf(timeString, sizeof(timeString), "%lu.%06lu ", + t.tv_sec, + t.tv_nsec / 1000); } else { - timeString[0]=0; + timeString[0] = 0; } - return snprintf(log_buffer, buffsize, "%s%s[%s]%c%s %s ", + + char threadIdString[32]; + if (flag & FLAG_THREAD_ID) { + snprintf(threadIdString, sizeof(threadIdString), "%08lx ", syscall(__NR_gettid)); + } else { + threadIdString[0] = 0; + } + return snprintf(log_buffer, buffsize, "%s%s%s[%s] %c %s%s", timeString, flag & FLAG_NOCOLOR ? "" : log_level_highlight_start[level], + threadIdString, c->name, flag & FLAG_LEVEL ? g_log->level2string[level] : ' ', l, @@ -547,53 +561,6 @@ static inline int log_header(log_component_t *c, ); } -#if LOG_MINIMAL -#include -void logMinimal(int comp, int level, const char *format, ...) -{ - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) - abort(); - - char buf[MAX_LOG_TOTAL]; - int n = snprintf(buf, sizeof(buf), "%lu.%06lu %08lx [%s] %c ", - ts.tv_sec, - ts.tv_nsec / 1000, - syscall(__NR_gettid), - g_log->log_component[comp].name, - level); - if (n < 0 || n >= sizeof(buf)) - { - fprintf(stderr, "%s: n=%d\n", __func__, n); - return; - } - - va_list args; - va_start(args, format); - int m = vsnprintf(buf + n, sizeof(buf) - n, format, args); - va_end(args); - - if (m < 0) - { - fprintf(stderr, "%s: n=%d m=%d\n", __func__, n, m); - return; - } - - int len = n + m; - if (len > sizeof(buf) - 1) - { - len = sizeof(buf) - 1; - } - if (buf[len - 1] != '\n') - { - buf[len++] = '\n'; - } - - __attribute__((unused)) - int unused = write(STDOUT_FILENO, buf, len); -} -#endif // LOG_MINIMAL - void logRecord_mt(const char *file, const char *func, int line, @@ -864,7 +831,14 @@ void flush_mem_to_file(void) } } -char logmem_log_level[NUM_LOG_LEVEL]={'E','W','I','D','T'}; +const char logmem_log_level[NUM_LOG_LEVEL] = { + [OAILOG_ERR] = 'E', + [OAILOG_WARNING] = 'W', + [OAILOG_ANALYSIS] = 'A', + [OAILOG_INFO] = 'I', + [OAILOG_DEBUG] = 'D', + [OAILOG_TRACE] = 'T', +}; static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args) { @@ -878,12 +852,32 @@ static void log_output_memory(log_component_t *c, const char *file, const char * char log_buffer[MAX_LOG_TOTAL]; // make sure that for log trace the extra info is only printed once, reset when the level changes - if (level < OAILOG_TRACE) - len += log_header(c, log_buffer, MAX_LOG_TOTAL, file, func, line, level); - len += vsnprintf(log_buffer+len, MAX_LOG_TOTAL-len, format, args); - if ( !((g_log->flag | c->flag) & FLAG_NOCOLOR) ) - len+=snprintf(log_buffer+len, MAX_LOG_TOTAL-len, "%s", log_level_highlight_end[level]); - + if (level < OAILOG_TRACE) { + int n = log_header(c, log_buffer+len, MAX_LOG_TOTAL, file, func, line, level); + if (n > 0) { + len += n; + if (len > MAX_LOG_TOTAL) { + len = MAX_LOG_TOTAL; + } + } + } + int n = vsnprintf(log_buffer+len, MAX_LOG_TOTAL-len, format, args); + if (n > 0) { + len += n; + if (len > MAX_LOG_TOTAL) { + len = MAX_LOG_TOTAL; + } + } + if ( !((g_log->flag | c->flag) & FLAG_NOCOLOR) ) { + int n = snprintf(log_buffer+len, MAX_LOG_TOTAL-len, "%s", log_level_highlight_end[level]); + if (n > 0) { + len += n; + if (len > MAX_LOG_TOTAL) { + len = MAX_LOG_TOTAL; + } + } + } + // OAI printf compatibility if(log_mem_flag==1){ if(log_mem_d[log_mem_side].enable_flag==1){ @@ -919,6 +913,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char * } } }else{ + AssertFatal(len >= 0 && len <= MAX_LOG_TOTAL, "Bad len %d\n", len); if (write(fileno(c->stream), log_buffer, len)) {}; } } diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 350337b61b..42e49747a1 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -90,11 +90,12 @@ extern "C" { # define OAILOG_DISABLE -1 /*!< \brief disable all LOG messages, cannot be used in LOG macros, use only in LOG module */ # define OAILOG_ERR 0 /*!< \brief critical error conditions, impact on "must have" functionalities */ # define OAILOG_WARNING 1 /*!< \brief warning conditions, shouldn't happen but doesn't impact "must have" functionalities */ -# define OAILOG_INFO 2 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */ -# define OAILOG_DEBUG 3 /*!< \brief first level debug-level messages, for developers, may impact real-time behavior */ -# define OAILOG_TRACE 4 /*!< \brief second level debug-level messages, for developers, likely impact real-time behavior*/ +# define OAILOG_ANALYSIS 2 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */ +# define OAILOG_INFO 3 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */ +# define OAILOG_DEBUG 4 /*!< \brief first level debug-level messages, for developers, may impact real-time behavior */ +# define OAILOG_TRACE 5 /*!< \brief second level debug-level messages, for developers, likely impact real-time behavior*/ -#define NUM_LOG_LEVEL 5 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/ +#define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG (OAILOG_DISABLE is not available to user as a level, so it is not included)*/ /* @}*/ @@ -127,6 +128,7 @@ extern "C" { #define FLAG_FUNCT 0x0020 #define FLAG_FILE_LINE 0x0040 #define FLAG_TIME 0x0100 +#define FLAG_THREAD_ID 0x0200 #define FLAG_INITIALIZED 0x8000 #define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O) @@ -408,32 +410,14 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int // debugging macros #define LOG_F LOG_I /* because LOG_F was originaly to dump a message or buffer but is also used as a regular level...., to dump use LOG_DUMPMSG */ -#if LOG_MINIMAL - - void logMinimal(int component, int level, const char *format, ...) __attribute__((format(printf, 3, 4))); -# define LOG_E(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'E', __VA_ARGS__); while (0) -# define LOG_W(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'W', __VA_ARGS__); while (0) -# define LOG_A(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'A', __VA_ARGS__); while (0) /* logs intended for analysis */ -# define LOG_I(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'I', __VA_ARGS__); while (0) -# define LOG_D(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0) -# define LOG_T(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'T', __VA_ARGS__); while (0) - -# define LOG_M(FILE, VECTOR, DATA, LEN, DEC, FORMAT) ((void) 0) -# define LOG_DUMPFLAG(D) 0 -# define LOG_DEBUGFLAG(D) 0 -# define LOG_DUMPMSG(C, B, S, X...) ((void) 0) -# define VLOG(C, L, F, ARGS) ((void) 0) - -#else // LOG_MINIMAL - # if T_TRACER /* per component, level dependent macros */ -# define LOG_E(c, x...) do { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} } while (0) -# define LOG_W(c, x...) do { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)); if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x);} } while (0) -# define LOG_A LOG_I -# define LOG_I(c, x...) do { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} } while (0) -# define LOG_D(c, x...) do { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} } while (0) -# define LOG_T(c, x...) do { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ; if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} } while (0) +# define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0) +# define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0) +# define LOG_A(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) +# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) +# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0) +# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0) # define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0) /* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */ # define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */ @@ -449,8 +433,8 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int # define LOG_E(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} while (0) # define LOG_W(c, x...) do { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} while (0) +# define LOG_A(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ANALYSIS) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ANALYSIS, x);} while (0) # define LOG_I(c, x...) do { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} while (0) -# define LOG_A LOG_I # define LOG_D(c, x...) do { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} while (0) # define LOG_T(c, x...) do { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} while (0) # define VLOG(c,l, f, args) do { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ; } while (0) @@ -464,7 +448,6 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int # define LOG_VAR(A,B) A B # define T_ACTIVE(a) (0) # endif /* T_TRACER */ -#endif // LOG_MINIMAL /* avoid warnings for variables only used in LOG macro's but set outside debug section */ #define GCC_NOTUSED __attribute__((unused)) From fd54f2cf760716fcc4871e81de205d61f07f70fd Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 12 Jan 2022 16:05:24 -0800 Subject: [PATCH 308/883] This commit includes several nfapi bug fixes -cell_config.phy_cell_id is a uint16 and was being push/pulled as a uint8_t -several members of the p5 message we not push/pulled -the second member of the ssb_mask_list is causing invalid tag length -the error code of the push response was push8 when it should have been a push32 -packing vendor extension causes invalid tag id(0x000) --- nfapi/open-nFAPI/nfapi/src/nfapi_p5.c | 81 ++++++++++++++++----------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c index 32b87f80e0..ce9c22f7f7 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p5.c @@ -263,8 +263,8 @@ static uint8_t pack_nr_pnf_config_request(void *msg, uint8_t **ppWritePackedMsg, static uint8_t pack_pnf_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { nfapi_pnf_config_request_t *pNfapiMsg = (nfapi_pnf_config_request_t *)msg; - return (pack_tlv(NFAPI_PNF_PHY_RF_TAG, &pNfapiMsg->pnf_phy_rf_config, ppWritePackedMsg, end, &pack_pnf_phy_rf_config_value) && - push8(pNfapiMsg->num_tlvs,ppWritePackedMsg,end) && + return (push8(pNfapiMsg->num_tlvs,ppWritePackedMsg,end) && + pack_tlv(NFAPI_PNF_PHY_RF_TAG, &pNfapiMsg->pnf_phy_rf_config, ppWritePackedMsg, end, &pack_pnf_phy_rf_config_value) && pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); } @@ -697,8 +697,7 @@ static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_ pack_tlv(NFAPI_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_gsm_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) && pack_tlv(NFAPI_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_umts_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) && pack_tlv(NFAPI_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG, &(pNfapiMsg->nfapi_config.nmm_lte_frequency_bands), ppWritePackedMsg, end, &pack_nmm_frequency_bands_value) && - pack_tlv(NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, &(pNfapiMsg->nfapi_config.nmm_uplink_rssi_supported), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) ); + pack_tlv(NFAPI_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG, &(pNfapiMsg->nfapi_config.nmm_uplink_rssi_supported), ppWritePackedMsg, end, &pack_uint8_tlv_value)); } @@ -724,47 +723,50 @@ static uint8_t pack_nr_config_request(void *msg, uint8_t **ppWritePackedMsg, uin pack_tlv(NFAPI_NR_CONFIG_UL_K0_TAG, &(pNfapiMsg->carrier_config.ul_k0[1]), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG, &(pNfapiMsg->carrier_config.uplink_bandwidth), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.uplink_frequency), ppWritePackedMsg, end, &pack_uint32_tlv_value) && - + pack_tlv(NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG, &(pNfapiMsg->carrier_config.frequency_shift_7p5khz), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, &(pNfapiMsg->cell_config.frame_duplex_type), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - + pack_tlv(NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), ppWritePackedMsg, end, &pack_uint16_tlv_value) && + + pack_tlv(NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_PRACH_CONFIG_INDEX_TAG, &(pNfapiMsg->prach_config.prach_ConfigurationIndex), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG, &(pNfapiMsg->prach_config.prach_sequence_length), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG, &(pNfapiMsg->prach_config.restricted_set_config), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_PER_RACH_TAG, &(pNfapiMsg->prach_config.ssb_per_rach), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG, &(pNfapiMsg->prach_config.prach_sub_c_spacing), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_root_sequence_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_K1_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].k1), ppWritePackedMsg, end, &pack_uint16_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_PRACH_ZERO_CORR_CONF_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_zero_corr_conf), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG, &(pNfapiMsg->prach_config.prach_sub_c_spacing), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_root_sequence_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_K1_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].k1), ppWritePackedMsg, end, &pack_uint16_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_PRACH_ZERO_CORR_CONF_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_zero_corr_conf), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_NUM_ROOT_SEQUENCES_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].num_root_sequences), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_SCS_COMMON_TAG, &(pNfapiMsg->ssb_config.scs_common), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG, &(pNfapiMsg->ssb_config.bch_payload), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG, &(pNfapiMsg->ssb_config.ss_pbch_power), ppWritePackedMsg, end, &pack_uint32_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_BETA_PSS_TAG, &(pNfapiMsg->ssb_table.beta_pss), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_MIB_TAG, &(pNfapiMsg->ssb_table.MIB), ppWritePackedMsg, end, &pack_uint32_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[0].ssb_mask), ppWritePackedMsg, end, &pack_uint32_tlv_value) && - pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), ppWritePackedMsg, end, &pack_uint32_tlv_value) && - + // TODO: Not sure what's going on, ssb_mask_list[1] packing below seems to match unpack, but is causing problems + // pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), ppWritePackedMsg, end, &pack_uint32_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_BEAM_ID_TAG, &(pNfapiMsg->ssb_table.ssb_beam_id_list[0].beam_id), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG, &(pNfapiMsg->ssb_table.ssb_offset_point_a), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_PERIOD_TAG, &(pNfapiMsg->ssb_table.ssb_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->ssb_table.ss_pbch_multiple_carriers_in_a_band), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_CONFIG_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG, &(pNfapiMsg->ssb_table.multiple_cells_ss_pbch_in_a_carrier), ppWritePackedMsg, end, &pack_uint8_tlv_value) && pack_tlv(NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) && - pack_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) && - pack_tlv(NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) && + pack_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) && pack_tlv(NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) && pack_tlv(NFAPI_NR_NFAPI_P7_VNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) && - //pack_tlv(NFAPI_NR_NFAPI_RF_BANDS_TAG, &(pNfapiMsg->nfapi_config.rf_bands), ppWritePackedMsg, end, &pack_rf_bands_value) && - pack_tlv(NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - pack_tlv(NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), ppWritePackedMsg, end, &pack_ipv4_address_value) && + pack_tlv(NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), ppWritePackedMsg, end, &pack_ipv6_address_value) && + pack_tlv(NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), ppWritePackedMsg, end, &pack_uint16_tlv_value) && pack_tlv(NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - //pack_tlv(NFAPI_NR_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG, &(pNfapiMsg->nfapi_config.ul_ue_per_sf), ppWritePackedMsg, end, &pack_uint8_tlv_value) && - - pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) ); + pack_tlv(NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), ppWritePackedMsg, end, &pack_uint8_tlv_value) && + pack_tlv(NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), ppWritePackedMsg, end, &pack_uint8_tlv_value)); } static uint8_t pack_nr_config_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { @@ -775,7 +777,7 @@ static uint8_t pack_nr_config_response(void *msg, uint8_t **ppWritePackedMsg, ui static uint8_t pack_config_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { nfapi_config_response_t *pNfapiMsg = (nfapi_config_response_t *)msg; - return ( push8(pNfapiMsg->error_code, ppWritePackedMsg, end) && + return ( push32(pNfapiMsg->error_code, ppWritePackedMsg, end) && pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config) ); } @@ -1346,7 +1348,8 @@ static uint8_t unpack_pnf_config_request(uint8_t **ppReadPackedMsg, uint8_t *end unpack_tlv_t unpack_fns[] = { { NFAPI_PNF_PHY_RF_TAG, &pNfapiMsg->pnf_phy_rf_config, &unpack_pnf_phy_rf_config_value}, }; - return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension); + return (pull8(ppReadPackedMsg, &pNfapiMsg->num_tlvs, end) && + unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension)); } @@ -1722,13 +1725,14 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, for(int i=0;i<40;i++) pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list = (nfapi_nr_max_num_of_symbol_per_slot_t*) malloc(14*sizeof(nfapi_nr_max_num_of_symbol_per_slot_t)); - pNfapiMsg->prach_config.num_prach_fd_occasions_list=(nfapi_nr_num_prach_fd_occasions_t *) malloc(sizeof(nfapi_nr_num_prach_fd_occasions_t)); for(int i = 0; i < 40; i++){ //unpacking tdd slot config for(int symbol = 0; symbol<14;symbol++){ pull8(ppReadPackedMsg,&pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list[symbol].slot_config.value, end); } } + pNfapiMsg->prach_config.num_prach_fd_occasions_list=(nfapi_nr_num_prach_fd_occasions_t *) malloc(sizeof(nfapi_nr_num_prach_fd_occasions_t)); + unpack_tlv_t unpack_fns[] = { { NFAPI_NR_CONFIG_DL_BANDWIDTH_TAG, &(pNfapiMsg->carrier_config.dl_bandwidth), &unpack_uint16_tlv_value}, @@ -1741,8 +1745,13 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, { NFAPI_NR_CONFIG_UL_K0_TAG, &(pNfapiMsg->carrier_config.ul_k0[1]), &unpack_uint16_tlv_value}, { NFAPI_NR_CONFIG_UPLINK_BANDWIDTH_TAG, &(pNfapiMsg->carrier_config.uplink_bandwidth), &unpack_uint16_tlv_value}, { NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.uplink_frequency), &unpack_uint32_tlv_value}, + { NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG, &(pNfapiMsg->carrier_config.frequency_shift_7p5khz), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, &(pNfapiMsg->cell_config.frame_duplex_type), &unpack_uint8_tlv_value}, - { NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), &unpack_uint16_tlv_value}, + + { NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_PRACH_CONFIG_INDEX_TAG, &(pNfapiMsg->prach_config.prach_ConfigurationIndex), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG, &(pNfapiMsg->prach_config.prach_sequence_length), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG, &(pNfapiMsg->prach_config.restricted_set_config), &unpack_uint8_tlv_value}, @@ -1754,24 +1763,32 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, { NFAPI_NR_CONFIG_NUM_ROOT_SEQUENCES_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].num_root_sequences), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SCS_COMMON_TAG, &(pNfapiMsg->ssb_config.scs_common), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG, &(pNfapiMsg->ssb_config.bch_payload), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG, &(pNfapiMsg->ssb_config.ss_pbch_power), &unpack_uint32_tlv_value}, + { NFAPI_NR_CONFIG_BETA_PSS_TAG, &(pNfapiMsg->ssb_table.beta_pss), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_MIB_TAG, &(pNfapiMsg->ssb_table.MIB), &unpack_uint32_tlv_value}, { NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[0].ssb_mask), &unpack_uint32_tlv_value}, - { NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), &unpack_uint32_tlv_value}, - + // TODO: Not sure what's going on, ssb_mask_list[1] unpacking below seems to match pack, but is causing problems + // { NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), &unpack_uint32_tlv_value}, + { NFAPI_NR_CONFIG_BEAM_ID_TAG, &(pNfapiMsg->ssb_table.ssb_beam_id_list[0].beam_id), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG, &(pNfapiMsg->ssb_table.ssb_offset_point_a), &unpack_uint16_tlv_value}, { NFAPI_NR_CONFIG_SSB_PERIOD_TAG, &(pNfapiMsg->ssb_table.ssb_period), &unpack_uint8_tlv_value}, { NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG, &(pNfapiMsg->ssb_table.ssb_subcarrier_offset), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->ssb_table.ss_pbch_multiple_carriers_in_a_band), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG, &(pNfapiMsg->ssb_table.multiple_cells_ss_pbch_in_a_carrier), &unpack_uint8_tlv_value}, + { NFAPI_NR_CONFIG_TDD_PERIOD_TAG, &(pNfapiMsg->tdd_table.tdd_period), &unpack_uint8_tlv_value}, - { NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), &unpack_ipv6_address_value}, - { NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), &unpack_uint16_tlv_value}, + { NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv4), &unpack_ipv4_address_value}, { NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_address_ipv6), &unpack_ipv6_address_value}, { NFAPI_NR_NFAPI_P7_VNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_vnf_port), &unpack_uint16_tlv_value}, + { NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv4), &unpack_ipv4_address_value}, + { NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_address_ipv6), &unpack_ipv6_address_value}, + { NFAPI_NR_NFAPI_P7_PNF_PORT_TAG, &(pNfapiMsg->nfapi_config.p7_pnf_port), &unpack_uint16_tlv_value}, + { NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), &unpack_uint8_tlv_value}, { NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG, &(pNfapiMsg->nfapi_config.timing_info_mode), &unpack_uint8_tlv_value}, { NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG, &(pNfapiMsg->nfapi_config.timing_info_period), &unpack_uint8_tlv_value}, - { NFAPI_NR_NFAPI_TIMING_WINDOW_TAG, &(pNfapiMsg->nfapi_config.timing_window), &unpack_uint8_tlv_value}, }; return ( pull8(ppReadPackedMsg, &pNfapiMsg->num_tlv, end) && From 4c4d317822d7f462494d6bc6aaf0eff05d0f25fe Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 24 Jan 2022 12:28:29 -0800 Subject: [PATCH 309/883] Removing commented code that causes SEG_FAULT in NSA mode --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b069591316..b1f2e6d9b3 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,7 +4293,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); //measresult_cgi2->cellGlobalId= {0}; //measresult_cgi2->trackingAreaCode= {0}; struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; From 0e106543efc2872cff068042a3d29bcbbafc348c Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 25 Jan 2022 18:54:33 +0100 Subject: [PATCH 310/883] clean up of ulsch ue structures --- executables/nr-ue.c | 2 + openair1/PHY/INIT/nr_init_ue.c | 6 +- openair1/PHY/MODULATION/nr_modulation.c | 96 +------ openair1/PHY/MODULATION/nr_modulation.h | 2 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 +- .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 44 +-- .../PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 90 +++--- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 266 +++++++++--------- openair1/PHY/defs_nr_UE.h | 2 +- openair1/PHY/defs_nr_common.h | 2 - openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 6 +- openair1/SCHED_NR_UE/harq_nr.c | 8 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 17 +- openair1/SIMULATION/NR_PHY/ulsim.c | 22 +- 15 files changed, 204 insertions(+), 365 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2e7b2ea0e1..cbe87f665c 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -19,6 +19,8 @@ * contact@openairinterface.org */ +#define _GNU_SOURCE +#include #include #include "executables/nr-uesoftmodem.h" #include "PHY/phy_extern_nr_ue.h" diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index c193733aef..99f869c9b7 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -470,8 +470,10 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue, for (int k=0; kdlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n"); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]); - AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES, abstraction_flag))!=NULL,"Can't get ue ulsch structures\n"); - LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]); + if (j==0) { + AssertFatal((ue->ulsch[k][i] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES, abstraction_flag))!=NULL,"Can't get ue ulsch structures\n"); + LOG_D(PHY,"ulsch[%d][%d] => %p\n",k,i,ue->ulsch[k][i]); + } } } diff --git a/openair1/PHY/MODULATION/nr_modulation.c b/openair1/PHY/MODULATION/nr_modulation.c index c81a88ff30..4cb3185b67 100644 --- a/openair1/PHY/MODULATION/nr_modulation.c +++ b/openair1/PHY/MODULATION/nr_modulation.c @@ -320,98 +320,16 @@ void nr_layer_mapping(int16_t **mod_symbs, } } -void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue, +void nr_ue_layer_mapping(int16_t *mod_symbs, uint8_t n_layers, uint16_t n_symbs, - int16_t **tx_layers) -{ - int16_t *mod_symbs; + int16_t **tx_layers) { - switch (n_layers) { - - case 1: - mod_symbs = (int16_t *)ulsch_ue[0]->d_mod; - for (int i=0; i>15; - tx_layers[0][(i<<1)+1] = (mod_symbs[(i<<1)+1]*AMP)>>15; - } - break; - - case 2: - case 3: - case 4: - mod_symbs = (int16_t *)ulsch_ue[0]->d_mod; - - for (int i=0; i>15; - tx_layers[l][(i<<1)+1] = (mod_symbs[((n_layers*i+l)<<1)+1]*AMP)>>15; - } - } - break; - - case 5: - mod_symbs = (int16_t *)ulsch_ue[0]->d_mod; - - for (int i=0; i>1; i++) - for (int l=0; l<2; l++) { - tx_layers[l][i<<1] = (mod_symbs[((i<<1)+l)<<1]*AMP)>>15; - tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<1)+l)<<1)+1]*AMP)>>15; - } - - mod_symbs = (int16_t *)ulsch_ue[1]->d_mod; - - for (int i=0; i>15; - tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15; - } - break; - - case 6: - for (int q=0; q<2; q++) { - mod_symbs = (int16_t *)ulsch_ue[q]->d_mod; - - for (int i=0; i>15; - tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15; - } - } - break; - - case 7: - mod_symbs = (int16_t *)ulsch_ue[1]->d_mod; - - for (int i=0; i>15; - tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15; - } - - mod_symbs = (int16_t *)ulsch_ue[0]->d_mod; - - for (int i=0; i>15; - tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<2)+l)<<1)+1]*AMP)>>15; - } - break; - - case 8: - for (int q=0; q<2; q++) { - mod_symbs = (int16_t *)ulsch_ue[q]->d_mod; - - for (int i=0; i>2; i++) - for (int l=0; l<3; l++) { - tx_layers[l][i<<1] = (mod_symbs[((i<<2)+l)<<1]*AMP)>>15; - tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<2)+l)<<1)+1]*AMP)>>15; - } - } - break; - - default: - AssertFatal(0, "Invalid number of layers %d\n", n_layers); + for (int i=0; i>15; + tx_layers[l][(i<<1)+1] = (mod_symbs[((n_layers*i+l)<<1)+1]*AMP)>>15; + } } } diff --git a/openair1/PHY/MODULATION/nr_modulation.h b/openair1/PHY/MODULATION/nr_modulation.h index 75541a1361..db15e3d9ef 100644 --- a/openair1/PHY/MODULATION/nr_modulation.h +++ b/openair1/PHY/MODULATION/nr_modulation.h @@ -66,7 +66,7 @@ void nr_layer_mapping(int16_t **mod_symbs, @param[out] tx_layers, modulated symbols for each layer */ -void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue, +void nr_ue_layer_mapping(int16_t *mod_symbs, uint8_t n_layers, uint16_t n_symbs, int16_t **tx_layers); diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 22c8ff0b0e..b44f7e3b02 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -449,7 +449,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = !(index&0x01); uci_pdu->harq->harq_list[0].harq_value = !((index>>1)&0x01); - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index b4ee4f5b41..76b68a265f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -88,9 +88,9 @@ typedef struct { /// LDPC-code outputs uint8_t *d[MAX_NUM_NR_ULSCH_SEGMENTS]; /// LDPC-code outputs (TS 36.212 V15.4.0, Sec 5.3.2 p. 17) - uint8_t *e; + uint8_t *e; /// Rate matching (Interleaving) outputs (TS 36.212 V15.4.0, Sec 5.4.2.2 p. 30) - uint8_t *f; + uint8_t *f; /// Number of code segments uint32_t C; /// Number of bits in code segments @@ -122,55 +122,15 @@ typedef struct { typedef struct { /// SRS active flag uint8_t srs_active; -//#if defined(UPGRADE_RAT_NR) -#if 1 // Pointers to HARQ processes for the ULSCH NR_UL_UE_HARQ_t *harq_processes[NR_MAX_ULSCH_HARQ_PROCESSES]; int harq_process_id[NR_MAX_SLOTS_PER_FRAME]; // UL number of harq processes uint8_t number_harq_processes_for_pusch; -#endif - /* - /// Pointer to CQI data (+1 for 8 bits crc) - uint8_t o[1+MAX_CQI_BYTES]; - /// Length of CQI data (bits) - uint8_t O; - /// Format of CQI data - UCI_format_t uci_format; - /// Rank information - uint8_t o_RI[2]; - /// Length of rank information (bits) - uint8_t O_RI; - /// Pointer to ACK - uint8_t o_ACK[4]; - */ /// Minimum number of CQI bits for PUSCH (36-212 r8.6, Sec 5.2.4.1 p. 37) uint8_t O_CQI_MIN; /// ACK/NAK Bundling flag uint8_t bundling; - /// Concatenated "g"-sequences (for definition see 36-212 V15.4.0 2018-12, p.31) - uint8_t g[MAX_NUM_NR_CHANNEL_BITS]; - /// Interleaved "h"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) - uint8_t h[MAX_NUM_NR_CHANNEL_BITS]; - /// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14) - uint8_t b_tilde[MAX_NUM_NR_CHANNEL_BITS]; - /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14) - int32_t d_mod[MAX_NUM_NR_RE] __attribute__ ((aligned(16))); - /// Transform-coded "y"-sequences (for definition see 38-211 V15.3.0 2018-09, subsection 6.3.1.4) - int32_t y[MAX_NUM_NR_RE] __attribute__ ((aligned(16))); - /* - /// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27) - uint8_t q[MAX_CQI_PAYLOAD]; - - /// coded and interleaved CQI bits - uint8_t o_w[(MAX_CQI_BITS+8)*3]; - /// coded CQI bits - uint8_t o_d[96+((MAX_CQI_BITS+8)*3)]; - /// coded ACK bits - uint8_t q_ACK[MAX_ACK_PAYLOAD]; - /// coded RI bits - uint8_t q_RI[MAX_RI_PAYLOAD]; - */ /// beta_offset_cqi times 8 uint16_t beta_offset_cqi_times8; /// beta_offset_ri times 8 diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index b2e2476670..5a9fbd9648 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -221,43 +221,23 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, unsigned int G) { start_meas(&ue->ulsch_encoding_stats); -/////////////////////////parameters and variables declaration///////////////////////// -/////////// - - unsigned int crc; - NR_UL_UE_HARQ_t *harq_process; - uint16_t nb_rb ; - uint32_t A, F; - uint32_t *pz; - uint8_t mod_order; - uint16_t Kr,r; - uint32_t r_offset; - uint32_t E,Kb; - uint8_t Ilbrm; - uint32_t Tbslbrm; - uint16_t R; - float Coderate; - -/////////// -/////////////////////////////////////////////////////////////////////////////////////// - /////////////////////////parameters and variables initialization///////////////////////// /////////// - crc = 1; - harq_process = ulsch->harq_processes[harq_pid]; - nb_rb = harq_process->pusch_pdu.rb_size; - A = harq_process->pusch_pdu.pusch_data.tb_size*8; - pz = &harq_process->Z; - mod_order = nr_get_Qm_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table); - R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table); - Kr=0; - r_offset=0; - F=0; - Ilbrm = 0; - Tbslbrm = 950984; //max tbs - Coderate = 0.0; + unsigned int crc = 1; + NR_UL_UE_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; + uint16_t nb_rb = harq_process->pusch_pdu.rb_size; + uint32_t A = harq_process->pusch_pdu.pusch_data.tb_size*8; + uint32_t *pz = &harq_process->Z; + uint8_t mod_order = nr_get_Qm_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table); + uint16_t R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table); + uint16_t Kr=0; + uint32_t r_offset=0; + uint32_t F=0; + uint8_t Ilbrm = 0; + uint32_t Tbslbrm = 950984; //max tbs + float Coderate = 0.0; /////////// ///////////////////////////////////////////////////////////////////////////////////////// @@ -333,14 +313,14 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN); start_meas(&ue->ulsch_segmentation_stats); - Kb=nr_segmentation(harq_process->b, - harq_process->c, - harq_process->B, - &harq_process->C, - &harq_process->K, - pz, - &harq_process->F, - harq_process->BG); + uint32_t Kb=nr_segmentation(harq_process->b, + harq_process->c, + harq_process->B, + &harq_process->C, + &harq_process->K, + pz, + &harq_process->F, + harq_process->BG); stop_meas(&ue->ulsch_segmentation_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT); @@ -357,7 +337,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, //printf("segment Z %d k %d Kr %d BG %d\n", *pz,harq_process->K,Kr,BG); //start_meas(te_stats); - for (r=0; rC; r++) { + for (int r=0; rC; r++) { //channel_input[r] = &harq_process->d[r][0]; #ifdef DEBUG_ULSCH_CODING printf("Encoder: B %d F %d \n",harq_process->B, harq_process->F); @@ -392,8 +372,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN); start_meas(&ue->ulsch_ldpc_encoding_stats); - for(int j = 0; j < (harq_process->C/8 + 1); j++) - { + for(int j = 0; j < (harq_process->C/8 + 1); j++) { impp.macro_num = j; nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,harq_process->BG,&impp); } @@ -416,14 +395,13 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, F = harq_process->F; Kr = harq_process->K; - for (r=0; rC; r++) { // looping over C segments - + for (int r=0; rC; r++) { // looping over C segments if (harq_process->F>0) { - for (int k=(Kr-F-2*(*pz)); kd[r][k] = NR_NULL; - //if (k<(Kr-F+8)) - //printf("r %d filler bits [%d] = %d \n", r,k, harq_process->d[r][k]); - } + for (int k=(Kr-F-2*(*pz)); kd[r][k] = NR_NULL; + //if (k<(Kr-F+8)) + //printf("r %d filler bits [%d] = %d \n", r,k, harq_process->d[r][k]); + } } @@ -438,7 +416,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, ///////////////////////// d---->| Rate matching bit selection |---->e ///////////////////////// /////////// - E = nr_get_E(G, harq_process->C, mod_order, harq_process->pusch_pdu.nrOfLayers, r); + uint32_t E = nr_get_E(G, harq_process->C, mod_order, harq_process->pusch_pdu.nrOfLayers, r); Tbslbrm = nr_compute_tbslbrm(0,nb_rb,harq_process->pusch_pdu.nrOfLayers); @@ -481,9 +459,9 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, start_meas(&ue->ulsch_interleaving_stats); nr_interleaving_ldpc(E, - mod_order, - harq_process->e+r_offset, - harq_process->f+r_offset); + mod_order, + harq_process->e+r_offset, + harq_process->f+r_offset); stop_meas(&ue->ulsch_interleaving_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INTERLEAVING_LDPC, VCD_FUNCTION_OUT); @@ -505,8 +483,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, } - memcpy(ulsch->g,harq_process->f,G); // g is the concatenated code block - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT); stop_meas(&ue->ulsch_encoding_stats); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 73615ffb6e..13ca3bde6b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -93,17 +93,16 @@ void nr_pusch_codeword_scrambling(uint8_t *in, } void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, - unsigned char harq_pid, - uint32_t frame, - uint8_t slot, - uint8_t thread_id, - int gNB_id) { + unsigned char harq_pid, + uint32_t frame, + uint8_t slot, + uint8_t thread_id, + int gNB_id) { LOG_D(PHY,"nr_ue_ulsch_procedures hard_id %d %d.%d\n",harq_pid,frame,slot); uint32_t available_bits; - uint8_t cwd_index, l; - uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5]; + uint32_t scrambled_output[NR_MAX_PDSCH_ENCODED_LENGTH>>5]; int16_t **tx_layers; int32_t **txdataF; int8_t Wf[2], Wt[2]; @@ -115,96 +114,96 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, NR_DL_FRAME_PARMS *frame_parms = &UE->frame_parms; NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id]; - uint8_t num_of_codewords = 1; // tmp assumption int Nid_cell = 0; int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig uint16_t number_dmrs_symbols = 0; - for (cwd_index = 0;cwd_index < num_of_codewords; cwd_index++) { + NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[thread_id][gNB_id]; + NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid]; + nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu; - NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[thread_id][gNB_id][cwd_index]; - NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid]; - nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu; + int start_symbol = pusch_pdu->start_symbol_index; + uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos; + uint8_t number_of_symbols = pusch_pdu->nr_of_symbols; + uint8_t dmrs_type = pusch_pdu->dmrs_config_type; + uint16_t start_rb = pusch_pdu->rb_start; + uint16_t nb_rb = pusch_pdu->rb_size; + uint8_t Nl = pusch_pdu->nrOfLayers; + uint8_t mod_order = pusch_pdu->qam_mod_order; + uint16_t rnti = pusch_pdu->rnti; + uint8_t cdm_grps_no_data = pusch_pdu->num_dmrs_cdm_grps_no_data; + uint16_t start_sc = frame_parms->first_carrier_offset + (start_rb+pusch_pdu->bwp_start)*NR_NB_SC_PER_RB; - int start_symbol = pusch_pdu->start_symbol_index; - uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos; - uint8_t number_of_symbols = pusch_pdu->nr_of_symbols; - uint8_t dmrs_type = pusch_pdu->dmrs_config_type; - uint16_t start_rb = pusch_pdu->rb_start; - uint16_t nb_rb = pusch_pdu->rb_size; - uint8_t Nl = pusch_pdu->nrOfLayers; - uint8_t mod_order = pusch_pdu->qam_mod_order; - uint16_t rnti = pusch_pdu->rnti; - uint8_t cdm_grps_no_data = pusch_pdu->num_dmrs_cdm_grps_no_data; - uint16_t start_sc = frame_parms->first_carrier_offset + (start_rb+pusch_pdu->bwp_start)*NR_NB_SC_PER_RB; + if (start_sc >= frame_parms->ofdm_symbol_size) + start_sc -= frame_parms->ofdm_symbol_size; - if (start_sc >= frame_parms->ofdm_symbol_size) - start_sc -= frame_parms->ofdm_symbol_size; + ulsch_ue->Nid_cell = Nid_cell; - ulsch_ue->Nid_cell = Nid_cell; + for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) { + if((ul_dmrs_symb_pos >> i) & 0x01) + number_dmrs_symbols += 1; + } - for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) { - if((ul_dmrs_symb_pos >> i) & 0x01) - number_dmrs_symbols += 1; - } + nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*cdm_grps_no_data; - nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*cdm_grps_no_data; + LOG_D(PHY,"ulsch %x : start_rb %d bwp_start %d start_sc %d start_symbol %d num_symbols %d cdmgrpsnodata %d num_dmrs %d dmrs_re_per_rb %d\n", + rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb); - LOG_D(PHY,"ulsch %x : start_rb %d bwp_start %d start_sc %d start_symbol %d num_symbols %d cdmgrpsnodata %d num_dmrs %d dmrs_re_per_rb %d\n", - rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb); + // TbD num_of_mod_symbols is set but never used + N_RE_prime = NR_NB_SC_PER_RB*number_of_symbols - nb_dmrs_re_per_rb*number_dmrs_symbols - N_PRB_oh; + harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb; - // TbD num_of_mod_symbols is set but never used - N_RE_prime = NR_NB_SC_PER_RB*number_of_symbols - nb_dmrs_re_per_rb*number_dmrs_symbols - N_PRB_oh; - harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*num_of_codewords; + /////////////////////////ULSCH coding///////////////////////// + /////////// - /////////////////////////ULSCH coding///////////////////////// - /////////// - - unsigned int G = nr_get_G(nb_rb, number_of_symbols, - nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl); + unsigned int G = nr_get_G(nb_rb, number_of_symbols, + nb_dmrs_re_per_rb, number_dmrs_symbols, mod_order, Nl); - trace_NRpdu(DIRECTION_UPLINK, - ulsch_ue->harq_processes[harq_pid]->a, - ulsch_ue->harq_processes[harq_pid]->pusch_pdu.pusch_data.tb_size, - 0, WS_C_RNTI, rnti, frame, slot, 0, 0); + trace_NRpdu(DIRECTION_UPLINK, + harq_process_ul_ue->a, + harq_process_ul_ue->pusch_pdu.pusch_data.tb_size, + 0, WS_C_RNTI, rnti, frame, slot, 0, 0); - if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1) - return; + if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, G) == -1) + return; - /////////// - //////////////////////////////////////////////////////////////////// + /////////// + //////////////////////////////////////////////////////////////////// - /////////////////////////ULSCH scrambling///////////////////////// - /////////// + /////////////////////////ULSCH scrambling///////////////////////// + /////////// - available_bits = G; + available_bits = G; - memset(scrambled_output[cwd_index], 0, ((available_bits>>5)+1)*sizeof(uint32_t)); + memset(scrambled_output, 0, ((available_bits>>5)+1)*sizeof(uint32_t)); - nr_pusch_codeword_scrambling(ulsch_ue->g, - available_bits, - ulsch_ue->Nid_cell, - rnti, - scrambled_output[cwd_index]); // assume one codeword for the moment + nr_pusch_codeword_scrambling(harq_process_ul_ue->f, + available_bits, + ulsch_ue->Nid_cell, + rnti, + scrambled_output); // assume one codeword for the moment - ///////////// - ////////////////////////////////////////////////////////////////////////// + ///////////// + ////////////////////////////////////////////////////////////////////////// - /////////////////////////ULSCH modulation///////////////////////// - /////////// + /////////////////////////ULSCH modulation///////////////////////// + /////////// - nr_modulation(scrambled_output[cwd_index], // assume one codeword for the moment - available_bits, - mod_order, - (int16_t *)ulsch_ue->d_mod); + int max_num_re = number_of_symbols*nb_rb*NR_NB_SC_PER_RB; + int32_t d_mod[max_num_re] __attribute__ ((aligned(16))); + + nr_modulation(scrambled_output, // assume one codeword for the moment + available_bits, + mod_order, + (int16_t *)d_mod); - /////////// - //////////////////////////////////////////////////////////////////////// + /////////// + //////////////////////////////////////////////////////////////////////// /////////////////////////DMRS Modulation///////////////////////// /////////// @@ -246,7 +245,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, tx_layers = (int16_t **)pusch_ue->txdataF_layers; - nr_ue_layer_mapping(UE->ulsch[thread_id][gNB_id], + nr_ue_layer_mapping((int16_t *)d_mod, Nl, available_bits/mod_order, tx_layers); @@ -264,13 +263,16 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint8_t u = 0, v = 0; int16_t *dmrs_seq = NULL; + /// Transform-coded "y"-sequences (for definition see 38-211 V15.3.0 2018-09, subsection 6.3.1.4) + int32_t y[max_num_re] __attribute__ ((aligned(16))); + // if transform precoding is enbaled (value 0) if (pusch_pdu->transform_precoding == 0) { uint32_t nb_re_pusch=nb_rb * NR_NB_SC_PER_RB; uint32_t y_offset = 0; uint16_t num_dmrs_res_per_symbol = nb_rb*(NR_NB_SC_PER_RB/2); - + // Calculate index to dmrs seq array based on number of DMRS Subcarriers on this symbol index = get_index_for_dmrs_lowpapr_seq(num_dmrs_res_per_symbol); u = pusch_pdu->dfts_ofdm.low_papr_group_number; @@ -279,60 +281,52 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, AssertFatal(index >= 0, "Num RBs not configured according to 3GPP 38.211 section 6.3.1.4. For PUSCH with transform precoding, num RBs cannot be multiple of any other primenumber other than 2,3,5\n"); AssertFatal(dmrs_seq != NULL, "DMRS low PAPR seq not found, check if DMRS sequences are generated"); - + LOG_D(PHY,"Transform Precoding params. u: %d, v: %d, index for dmrsseq: %d\n", u, v, index); - for (l = start_symbol; l < start_symbol + number_of_symbols; l++) { + for (int l = start_symbol; l < start_symbol + number_of_symbols; l++) { if((ul_dmrs_symb_pos >> l) & 0x01) /* In the symbol with DMRS no data would be transmitted CDM groups is 2*/ continue; - nr_dft(&ulsch_ue->y[y_offset], &((int32_t*)tx_layers[0])[y_offset], nb_re_pusch); + nr_dft(&y[y_offset], &((int32_t*)tx_layers[0])[y_offset], nb_re_pusch); y_offset = y_offset + nb_re_pusch; LOG_D(PHY,"Transform precoding being done on data- symbol: %d, nb_re_pusch: %d, y_offset: %d\n", l, nb_re_pusch, y_offset); - #ifdef DEBUG_PUSCH_MAPPING - printf("NR_ULSCH_UE: y_offset %d\t nb_re_pusch %d \t Symbol %d \t nb_rb %d \n", - y_offset, nb_re_pusch, l, nb_rb); - #endif +#ifdef DEBUG_PUSCH_MAPPING + printf("NR_ULSCH_UE: y_offset %d\t nb_re_pusch %d \t Symbol %d \t nb_rb %d \n", + y_offset, nb_re_pusch, l, nb_rb); +#endif } - #ifdef DEBUG_DFT_IDFT - int32_t debug_symbols[MAX_NUM_NR_RE] __attribute__ ((aligned(16))); - int offset = 0; - printf("NR_ULSCH_UE: available_bits: %d, mod_order: %d", available_bits,mod_order); +#ifdef DEBUG_DFT_IDFT + int32_t debug_symbols[max_num_re] __attribute__ ((aligned(16))); + int offset = 0; + printf("NR_ULSCH_UE: available_bits: %d, mod_order: %d", available_bits,mod_order); - for (int ll = 0; ll < (available_bits/mod_order); ll++) { - debug_symbols[ll] = ulsch_ue->y[ll]; - } - - printf("NR_ULSCH_UE: numSym: %d, num_dmrs_sym: %d", number_of_symbols,number_dmrs_symbols); - for (int ll = 0; ll < (number_of_symbols-number_dmrs_symbols); ll++) { + for (int ll = 0; ll < (available_bits/mod_order); ll++) { + debug_symbols[ll] = y[ll]; + } - nr_idft(&debug_symbols[offset], nb_re_pusch); - - offset = offset + nb_re_pusch; - - } - LOG_M("preDFT_all_symbols.m","UE_preDFT", tx_layers[0],number_of_symbols*nb_re_pusch,1,1); - LOG_M("postDFT_all_symbols.m","UE_postDFT", ulsch_ue->y,number_of_symbols*nb_re_pusch,1,1); - LOG_M("DEBUG_IDFT_SYMBOLS.m","UE_Debug_IDFT", debug_symbols,number_of_symbols*nb_re_pusch,1,1); - LOG_M("UE_DMRS_SEQ.m","UE_DMRS_SEQ", dmrs_seq,nb_re_pusch,1,1); - #endif + printf("NR_ULSCH_UE: numSym: %d, num_dmrs_sym: %d", number_of_symbols,number_dmrs_symbols); + for (int ll = 0; ll < (number_of_symbols-number_dmrs_symbols); ll++) { + nr_idft(&debug_symbols[offset], nb_re_pusch); + offset = offset + nb_re_pusch; + } + LOG_M("preDFT_all_symbols.m","UE_preDFT", tx_layers[0],number_of_symbols*nb_re_pusch,1,1); + LOG_M("postDFT_all_symbols.m","UE_postDFT", y,number_of_symbols*nb_re_pusch,1,1); + LOG_M("DEBUG_IDFT_SYMBOLS.m","UE_Debug_IDFT", debug_symbols,number_of_symbols*nb_re_pusch,1,1); + LOG_M("UE_DMRS_SEQ.m","UE_DMRS_SEQ", dmrs_seq,nb_re_pusch,1,1); +#endif } else - memcpy(ulsch_ue->y, tx_layers[0], (available_bits/mod_order)*sizeof(int32_t)); + memcpy(y, tx_layers[0], (available_bits/mod_order)*sizeof(int32_t)); - /////////// - //////////////////////////////////////////////////////////////////////// - - - /////////////////////////ULSCH RE mapping///////////////////////// /////////// @@ -344,18 +338,16 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, uint16_t m = 0; - #ifdef DEBUG_PUSCH_MAPPING - printf("NR_ULSCH_UE: Value of CELL ID %d /t, u %d \n", frame_parms->Nid_cell, u); - #endif - - +#ifdef DEBUG_PUSCH_MAPPING + printf("NR_ULSCH_UE: Value of CELL ID %d /t, u %d \n", frame_parms->Nid_cell, u); +#endif // DMRS params for this ap get_Wt(Wt, ap, dmrs_type); get_Wf(Wf, ap, dmrs_type); delta = get_delta(ap, dmrs_type); - for (l=start_symbol; lpdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { AssertFatal(pusch_pdu->transform_precoding == 1, "PTRS NOT SUPPORTED IF TRANSFORM PRECODING IS ENABLED\n"); @@ -405,15 +394,15 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (k == ((start_sc+get_dmrs_freq_idx_ul(n, k_prime, delta, dmrs_type))%frame_parms->ofdm_symbol_size)) is_dmrs = 1; } else if (is_ptrs_sym) { - is_ptrs = is_ptrs_subcarrier(k, - rnti, - ap, - dmrs_type, - K_ptrs, - nb_rb, - pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset, - start_sc, - frame_parms->ofdm_symbol_size); + is_ptrs = is_ptrs_subcarrier(k, + rnti, + ap, + dmrs_type, + K_ptrs, + nb_rb, + pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset, + start_sc, + frame_parms->ofdm_symbol_size); } if (is_dmrs == 1) { @@ -422,19 +411,19 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[2*dmrs_idx]) >> 15; ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*dmrs_seq[(2*dmrs_idx) + 1]) >> 15; - + } else { - ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[dmrs_idx<<1]) >> 15; - ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[dmrs_idx<<1]) >> 15; + ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; - } + } - #ifdef DEBUG_PUSCH_MAPPING - printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t dmrs: %d %d\n", - dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(sample_offsetF)<<1], - ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1]); - #endif +#ifdef DEBUG_PUSCH_MAPPING + printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t dmrs: %d %d\n", + dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(sample_offsetF)<<1], + ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1]); +#endif dmrs_idx++; @@ -451,14 +440,14 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, } else if (!is_dmrs_sym || allowed_xlsch_re_in_dmrs_symbol(k, start_sc, frame_parms->ofdm_symbol_size, cdm_grps_no_data, dmrs_type)) { - ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = ((int16_t *) ulsch_ue->y)[m<<1]; - ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = ((int16_t *) ulsch_ue->y)[(m<<1) + 1]; + ((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = ((int16_t *) y)[m<<1]; + ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = ((int16_t *) y)[(m<<1) + 1]; - #ifdef DEBUG_PUSCH_MAPPING +#ifdef DEBUG_PUSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, ((int16_t*)txdataF[ap])[(sample_offsetF)<<1], - ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1]); - #endif + m, l, k, ((int16_t*)txdataF[ap])[(sample_offsetF)<<1], + ((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1]); +#endif m++; @@ -474,10 +463,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, } } } - } NR_UL_UE_HARQ_t *harq_process_ulsch=NULL; - harq_process_ulsch = UE->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid]; + harq_process_ulsch = UE->ulsch[thread_id][gNB_id]->harq_processes[harq_pid]; harq_process_ulsch->status = SCH_IDLE; /////////// diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 69978f5548..7aca95cb1e 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -818,7 +818,7 @@ typedef struct { NR_UE_PUSCH *pusch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PUCCH *pucch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two RxTx Threads - NR_UE_ULSCH_t *ulsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two code words + NR_UE_ULSCH_t *ulsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_gNB_MAX]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index c385d323e3..8245da9737 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -107,8 +107,6 @@ #define MAX_NUM_NR_ULSCH_SEGMENTS 34 #define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056) -#define MAX_NUM_NR_CHANNEL_BITS (14*273*12*8) // 14 symbols, 273 RB -#define MAX_NUM_NR_RE (14*273*12) #define NR_RX_NB_TH 1 #define NR_NB_TH_SLOT 2 diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4fd337eb09..b0b1a0f261 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -224,7 +224,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ thread_id = scheduled_response->thread_id; NR_UE_DLSCH_t *dlsch0 = NULL; NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0]; - NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0]; + NR_UE_ULSCH_t *ulsch = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0]; NR_UE_PUCCH *pucch_vars = PHY_vars_UE_g[module_id][cc_id]->pucch_vars[thread_id][0]; if(scheduled_response->dl_config != NULL){ @@ -343,7 +343,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ // pusch config pdu pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu; current_harq_pid = pusch_config_pdu->pusch_data.harq_process_id; - NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch0->harq_processes[current_harq_pid]; + NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch->harq_processes[current_harq_pid]; harq_process_ul_ue->status = 0; if (harq_process_ul_ue){ @@ -352,7 +352,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t)); - ulsch0->f_pusch = pusch_config_pdu->absolute_delta_PUSCH; + ulsch->f_pusch = pusch_config_pdu->absolute_delta_PUSCH; if (scheduled_response->tx_request) { for (int j=0; jtx_request->number_of_pdus; j++) { diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c index 5b65131934..9dc82ee358 100644 --- a/openair1/SCHED_NR_UE/harq_nr.c +++ b/openair1/SCHED_NR_UE/harq_nr.c @@ -123,7 +123,7 @@ void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, i memset(ulsch,0,sizeof(NR_UE_ULSCH_t)); - ue->ulsch[thread_id][gNB_id][code_word_idx] = ulsch; + ue->ulsch[thread_id][gNB_id] = ulsch; } else { LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__); @@ -148,7 +148,7 @@ void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, i } for (int slot_tx = 0; slot_tx < NR_MAX_SLOTS_PER_FRAME; slot_tx++) { - ue->ulsch[thread_id][gNB_id][code_word_idx]->harq_process_id[slot_tx] = NR_MAX_HARQ_PROCESSES; + ue->ulsch[thread_id][gNB_id]->harq_process_id[slot_tx] = NR_MAX_HARQ_PROCESSES; } } @@ -167,7 +167,7 @@ void config_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, i void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, int code_word_idx) { - NR_UE_ULSCH_t *ulsch = ue->ulsch[thread_id][gNB_id][code_word_idx]; + NR_UE_ULSCH_t *ulsch = ue->ulsch[thread_id][gNB_id]; for (int process_id = 0; process_id < ulsch->number_harq_processes_for_pusch; process_id++) { @@ -178,7 +178,7 @@ void release_uplink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int thread_id, free16(ulsch, sizeof(NR_UE_ULSCH_t)); - ue->ulsch[thread_id][gNB_id][code_word_idx] = NULL; + ue->ulsch[thread_id][gNB_id] = NULL; } /******************************************************************* diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index b0ad4b4a83..81b747e950 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -291,8 +291,8 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, if (ue->UE_mode[gNB_id] <= PUSCH){ - for (uint8_t harq_pid = 0; harq_pid < ue->ulsch[proc->thread_id][gNB_id][0]->number_harq_processes_for_pusch; harq_pid++) { - if (ue->ulsch[proc->thread_id][gNB_id][0]->harq_processes[harq_pid]->status == ACTIVE) + for (uint8_t harq_pid = 0; harq_pid < ue->ulsch[proc->thread_id][gNB_id]->number_harq_processes_for_pusch; harq_pid++) { + if (ue->ulsch[proc->thread_id][gNB_id]->harq_processes[harq_pid]->status == ACTIVE) nr_ue_ulsch_procedures(ue, harq_pid, frame_tx, slot_tx, proc->thread_id, gNB_id); } diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 94aea36a67..007fd18ac6 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -407,15 +407,10 @@ int main(int argc, char **argv) } for (sf = 0; sf < 2; sf++) { - for (i = 0; i < 2; i++) { - - UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); - - if (!UE->ulsch[sf][0][i]) { - printf("Can't get ue ulsch structures.\n"); - exit(-1); - } - + UE->ulsch[sf][0] = new_nr_ue_ulsch(N_RB_UL, 8, 0); + if (!UE->ulsch[sf][0]) { + printf("Can't get ue ulsch structures.\n"); + exit(-1); } } @@ -435,7 +430,7 @@ int main(int argc, char **argv) NR_UL_gNB_HARQ_t *harq_process_gNB = ulsch_gNB->harq_processes[harq_pid]; nfapi_nr_pusch_pdu_t *rel15_ul = &harq_process_gNB->ulsch_pdu; - NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0][0]; + NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0]; mod_order = nr_get_Qm_ul(Imcs, 0); code_rate = nr_get_code_rate_ul(Imcs, 0); @@ -532,7 +527,7 @@ int main(int argc, char **argv) } */ - if (ulsch_ue->g[i] == 0) + if (ulsch_ue->harq_processes[harq_pid]->f[i] == 0) modulated_input[i] = 1.0; ///sqrt(2); //QPSK else modulated_input[i] = -1.0; ///sqrt(2); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index ac991ae940..329415a87c 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -814,7 +814,7 @@ int main(int argc, char **argv) nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu; - NR_UE_ULSCH_t **ulsch_ue = UE->ulsch[0][0]; + NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[0][0]; unsigned char *estimated_output_bit; unsigned char *test_input_bit; @@ -1045,7 +1045,7 @@ int main(int argc, char **argv) memset((void*)roundStats,0,50*sizeof(roundStats[0])); while (roundharq_processes[harq_pid]->round = round; + ulsch_ue->harq_processes[harq_pid]->round = round; gNB->ulsch[0][0]->harq_processes[harq_pid]->round = round; rv_index = nr_rv_round_map[round]; @@ -1187,7 +1187,7 @@ int main(int argc, char **argv) //nr_fill_ulsch(gNB,frame,slot,pusch_pdu); // Not needed as its its already filled as apart of "nr_schedule_response(Sched_INFO);" - for (int i=0;i<(TBS/8);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff; + for (int i=0;i<(TBS/8);i++) ulsch_ue->harq_processes[harq_pid]->a[i]=i&0xff; if (input_fd == NULL) { // set FAPI parameters for UE, put them in the scheduled response and call @@ -1388,8 +1388,8 @@ int main(int argc, char **argv) for (i = 0; i < available_bits; i++) { - if(((ulsch_ue[0]->g[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) || - ((ulsch_ue[0]->g[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0))) + if(((ulsch_ue->harq_processes[harq_pid]->f[i] == 0) && (gNB->pusch_vars[UE_id]->llr[i] <= 0)) || + ((ulsch_ue->harq_processes[harq_pid]->f[i] == 1) && (gNB->pusch_vars[UE_id]->llr[i] >= 0))) { /*if(errors_scrambling == 0) printf("\x1B[34m" "[frame %d][trial %d]\t1st bit in error in unscrambling = %d\n" "\x1B[0m", frame, trial, i);*/ @@ -1407,7 +1407,7 @@ int main(int argc, char **argv) for (i = 0; i < TBS; i++) { estimated_output_bit[i] = (ulsch_gNB->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7); - test_input_bit[i] = (ulsch_ue[0]->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7); + test_input_bit[i] = (ulsch_ue->harq_processes[harq_pid]->b[i/8] & (1 << (i & 7))) >> (i & 7); if (estimated_output_bit[i] != test_input_bit[i]) { /*if(errors_decoding == 0) @@ -1416,13 +1416,13 @@ int main(int argc, char **argv) } } if (n_trials == 1) { - for (int r=0;rharq_processes[harq_pid]->C;r++) - for (int i=0;iharq_processes[harq_pid]->K>>3;i++) { - if ((ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************"); + for (int r=0;rharq_processes[harq_pid]->C;r++) + for (int i=0;iharq_processes[harq_pid]->K>>3;i++) { + if ((ulsch_ue->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]) != 0) printf("************"); /*printf("r %d: in[%d] %x, out[%d] %x (%x)\n",r, - i,ulsch_ue[0]->harq_processes[harq_pid]->c[r][i], + i,ulsch_ue->harq_processes[harq_pid]->c[r][i], i,ulsch_gNB->harq_processes[harq_pid]->c[r][i], - ulsch_ue[0]->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/ + ulsch_ue->harq_processes[harq_pid]->c[r][i]^ulsch_gNB->harq_processes[harq_pid]->c[r][i]);*/ } } if (errors_decoding > 0 && error_flag == 0) { From 0e17edc16526c146fe79165fa798f94c1e02c07c Mon Sep 17 00:00:00 2001 From: sfn Date: Wed, 26 Jan 2022 03:34:29 +0100 Subject: [PATCH 311/883] solve division by null for floating point zero forcing, fix fp shift --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 41 ++++++++----------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 7fc1e99c31..756278d51d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -2150,24 +2150,26 @@ uint8_t nr_matrix_inverse(int32_t **a44,//Input matrix//conjH_H_elements[0] double complex determin_cpx; for (int i=0; i<12*nb_rb; i++) { + //Convert Q15 to floating point for (int rtx=0;rtx0) {//determin of the symmetric matrix is real part only - ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)/(1<<((size-1)*shift0)))+0.5);// - ((short*) ad_bc)[(i<<1)+1] = (short) ((cimag(determin_cpx)/(1<<((size-1)*shift0)))+0.5);// + ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)*(1<<(shift0)))+0.5);// + //((short*) ad_bc)[(i<<1)+1] = (short) ((cimag(determin_cpx)*(1<<(shift0)))+0.5);// } else { - ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)/(1<<((size-1)*shift0)))-0.5);// - ((short*) ad_bc)[(i<<1)+1] = (short) ((cimag(determin_cpx)/(1<<((size-1)*shift0)))-0.5);// + ((short*) ad_bc)[i<<1] = (short) ((creal(determin_cpx)*(1<<(shift0)))-0.5);// + //((short*) ad_bc)[(i<<1)+1] = (short) ((cimag(determin_cpx)*(1<<(shift0)))-0.5);// } //if (i<4) printf("nr_det_FP= %d+j%d \n",((short*) ad_bc)[i<<1],((short*) ad_bc)[(i<<1)+1]); //Compute Inversion of the H^*H matrix (normalized output divide by determinant) @@ -2187,18 +2189,18 @@ uint8_t nr_matrix_inverse(int32_t **a44,//Input matrix//conjH_H_elements[0] inv_H_h_H_cpx[rtx*size+ctx] = nr_determin_cpx(sub_matrix_cpx,// size-1,//size - ((rtx&1)==1?-1:1)*((ctx&1)==1?-1:1))/(determin_cpx); - //if (i==0) printf("H_h_H(r%d,c%d)=%lf+j%lf --> inv_H_h_H(%d,%d) = %lf+j%lf \n",rtx,ctx,creal(a44_cpx[ctx*size+rtx]),cimag(a44_cpx[ctx*size+rtx]),ctx,rtx,creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18),cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18)); + ((rtx&1)==1?-1:1)*((ctx&1)==1?-1:1)); + //if (i==0) printf("H_h_H(r%d,c%d)=%lf+j%lf --> inv_H_h_H(%d,%d) = %lf+j%lf \n",rtx,ctx,creal(a44_cpx[ctx*size+rtx]),cimag(a44_cpx[ctx*size+rtx]),ctx,rtx,creal(inv_H_h_H_cpx[rtx*size+ctx]),cimag(inv_H_h_H_cpx[rtx*size+ctx])); if (creal(inv_H_h_H_cpx[rtx*size+ctx])>0) - ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18))+0.5);//Convert to Q 18 + ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<(shift0-1)))+0.5);//Convert to Q 18 else - ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18))-0.5);// + ((short *) inv_H_h_H[rtx*size+ctx])[i<<1] = (short) ((creal(inv_H_h_H_cpx[rtx*size+ctx])*(1<<(shift0-1)))-0.5);// if (cimag(inv_H_h_H_cpx[rtx*size+ctx])>0) - ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18))+0.5);// + ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<(shift0-1)))+0.5);// else - ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<18))-0.5);// + ((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1] = (short) ((cimag(inv_H_h_H_cpx[rtx*size+ctx])*(1<<(shift0-1)))-0.5);// //if (i<4) printf("inv_H_h_H_FP(%d,%d)= %d+j%d \n",ctx,rtx, ((short *) inv_H_h_H[rtx*size+ctx])[i<<1],((short *) inv_H_h_H[rtx*size+ctx])[(i<<1)+1]); } @@ -2316,14 +2318,13 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, } } int fp_flag = 1;//0: float point calc 1: Fixed point calc - int fpshift = 8; nr_matrix_inverse(conjH_H_elements[0],//Input matrix inv_H_h_H,//Inverse determ_fin,//determin n_tx,//size nb_rb_0, fp_flag,//fixed point flag - fpshift);//the out put is Q15 + shift-(fp_flag==1?2:0));//the out put is Q15 // multiply Matrix inversion pf H_h_H by the rx signal vector int32_t outtemp[12*nb_rb_0] __attribute__((aligned(32))); @@ -2344,7 +2345,7 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, (int *)&rxdataF_comp[ctx*n_rx][symbol*nb_rb*12], outtemp, nb_rb_0, - fpshift + (fp_flag? 0: 2));//out in 15-fpshift + shift-(fp_flag==1?2:0)); nr_a_sum_b((__m128i *)rxdataF_zforcing[rtx], (__m128i *)outtemp, nb_rb_0);//a =a + b @@ -2391,7 +2392,6 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, for (int rb=0; rb<3*nb_rb_0; rb++) { //for symmetric H_h_H matrix, the determinant is only real values - if (fp_flag) { mmtmpD2 = _mm_sign_epi16(determ_fin_128[0],*(__m128i*)&nr_realpart[0]);//set imag part to 0 mmtmpD3 = _mm_shufflelo_epi16(mmtmpD2,_MM_SHUFFLE(2,3,0,1)); mmtmpD3 = _mm_shufflehi_epi16(mmtmpD3,_MM_SHUFFLE(2,3,0,1)); @@ -2408,14 +2408,7 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, dl_ch_mag128b_0[0] = _mm_slli_epi16(dl_ch_mag128b_0[0],1); dl_ch_mag128r_0[0] = _mm_mulhi_epi16(dl_ch_mag128r_0[0],QAM_amp128r); dl_ch_mag128r_0[0] = _mm_slli_epi16(dl_ch_mag128r_0[0],1); - } else{ - dl_ch_mag128_0[0] = QAM_amp128; - dl_ch_mag128_0[0] = _mm_srai_epi16(dl_ch_mag128_0[0],fpshift-1); - dl_ch_mag128b_0[0] = QAM_amp128b; - dl_ch_mag128b_0[0] = _mm_srai_epi16(dl_ch_mag128b_0[0],fpshift-1); - dl_ch_mag128r_0[0] = QAM_amp128r; - dl_ch_mag128r_0[0] = _mm_srai_epi16(dl_ch_mag128r_0[0],fpshift-1); - } + determ_fin_128 += 1; dl_ch_mag128_0 += 1; From 5eb9e1f421d30155dc57a2b8d56a34e70764a86f Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 26 Jan 2022 10:31:10 +0100 Subject: [PATCH 312/883] compute Y every time --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 ++-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 18 ++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 ++ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 - 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8c3b839f5a..0e98f4d3c9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -613,7 +613,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* Find a free CCE */ const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels @@ -775,7 +775,7 @@ void pf_dl(module_id_t module_id, /* Find a free CCE */ const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 8f32cf136e..c447708125 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -345,7 +345,7 @@ void nr_preprocessor_phytest(module_id_t module_id, AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); int CCEIndex = find_pdcch_candidate(RC.nrmac[module_id], CC_id, @@ -511,7 +511,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ AssertFatal(nr_of_candidates>0,"nr_of_candidates is 0\n"); const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = UE_info->Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); int CCEIndex = find_pdcch_candidate(nr_mac, CC_id, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 4f3e04bd07..89e8d344ed 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1936,19 +1936,18 @@ int find_nr_UE_id(module_id_t mod_idP, rnti_t rntiP) return -1; } -void set_Y(int Y[3][160], rnti_t rnti) { +uint16_t get_Y(int cid, int slot, rnti_t rnti) { + const int A[3] = {39827, 39829, 39839}; const int D = 65537; + int Y; - Y[0][0] = (A[0] * rnti) % D; - Y[1][0] = (A[1] * rnti) % D; - Y[2][0] = (A[2] * rnti) % D; + Y = (A[cid] * rnti) % D; - for (int s = 1; s < 160; s++) { - Y[0][s] = (A[0] * Y[0][s - 1]) % D; - Y[1][s] = (A[1] * Y[1][s - 1]) % D; - Y[2][s] = (A[2] * Y[2][s - 1]) % D; - } + for (int s = 0; s < slot; s++) + Y = (A[cid] * Y) % D; + + return Y; } int find_nr_RA_id(module_id_t mod_idP, int CC_idP, rnti_t rntiP) { @@ -2032,7 +2031,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG UE_info->CellGroup[UE_id] = CellGroup; add_nr_list(&UE_info->list, UE_id); memset(&UE_info->mac_stats[UE_id], 0, sizeof(NR_mac_stats_t)); - set_Y(UE_info->Y[UE_id], rntiP); if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 8db8062280..e4fcecf059 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1012,7 +1012,7 @@ bool allocate_ul_retransmission(module_id_t module_id, /* Find a free CCE */ const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels @@ -1158,7 +1158,7 @@ void pf_ul(module_id_t module_id, /* if no data, pre-allocate 5RB */ /* Find a free CCE */ const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels @@ -1268,7 +1268,7 @@ void pf_ul(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const int cid = sched_ctrl->coreset->controlResourceSetId; - const uint16_t Y = RC.nrmac[module_id]->UE_info.Y[UE_id][cid%3][slot]; + const uint16_t Y = get_Y(cid%3, slot, UE_info->rnti[UE_id]); uint8_t nr_of_candidates; for (int i=0; i<5; i++) { // for now taking the lowest value among the available aggregation levels diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 4b876fcf04..ed125fddb0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -318,6 +318,8 @@ void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, uint8_t num_dmrs_cdm_grps_no_data, NR_pusch_semi_static_t *ps); +uint16_t get_Y(int cid, int slot, rnti_t rnti); + uint8_t nr_get_tpc(int target, uint8_t cqi, int incr); int get_spf(nfapi_nr_config_request_scf_t *cfg); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 1073cef16c..ac0711e936 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -669,7 +669,6 @@ typedef struct { rnti_t rnti[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB]; /// CCE indexing - int Y[MAX_MOBILES_PER_GNB][3][160]; int m[MAX_MOBILES_PER_GNB]; // UE selected beam index uint8_t UE_beam_index[MAX_MOBILES_PER_GNB]; From 3e7c22e7c6f7027b15a961e6e77b9e5e5ca5b359 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 26 Jan 2022 11:27:02 +0100 Subject: [PATCH 313/883] gtp-u old code delete --- cmake_targets/CMakeLists.txt | 55 +- common/ran_context.h | 10 +- common/utils/assertions.h | 18 +- common/utils/lte/ue_power.h | 34 - common/utils/ocp_itti/intertask_interface.h | 6 +- doc/SW_archi.md | 2 +- executables/nr-softmodem.c | 2 +- executables/nr-ue.c | 3 +- openair1/PHY/TOOLS/lte_enb_scope.c | 6 - openair1/SCHED_NR/vars.h | 0 openair1/SIMULATION/NR_PHY/dlsim.c | 7 +- openair1/SIMULATION/NR_PHY/prachsim.c | 7 +- openair1/SIMULATION/NR_PHY/ulsim.c | 7 +- openair2/COMMON/gtpv1_u_messages_def.h | 10 +- openair2/COMMON/gtpv1_u_messages_types.h | 8 - openair2/ENB_APP/enb_config.c | 2 +- openair2/F1AP/f1ap_cu_task.c | 2 +- openair2/F1AP/f1ap_du_task.c | 2 +- openair2/GNB_APP/gnb_config.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 5 +- openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 2 - openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 4 +- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 +- openair2/LAYER2/rlc_v2/rlc_oai_api.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 4 + openair2/RRC/LTE/rrc_eNB.c | 14 - openair2/RRC/LTE/rrc_eNB_GTPV1U.c | 4 +- openair2/RRC/LTE/rrc_eNB_S1AP.c | 1 - openair2/RRC/NR/rrc_gNB.c | 23 +- openair2/RRC/NR/rrc_gNB_NGAP.c | 13 +- openair2/UTIL/MATH/crc_byte.c | 185 -- openair2/UTIL/MATH/random_proto_extern.h | 30 - openair2/UTIL/MATH/taus.c | 116 -- openair3/GTPV1-U/Makefile.am | 58 - openair3/GTPV1-U/Makefile.eNB | 67 - openair3/GTPV1-U/gtpv1u.h | 55 - openair3/GTPV1-U/gtpv1u_eNB.c | 1600 ----------------- openair3/GTPV1-U/gtpv1u_eNB_task.h | 69 - openair3/GTPV1-U/gtpv1u_gNB.c | 1012 ----------- openair3/GTPV1-U/gtpv1u_gNB_defs.h | 108 -- openair3/GTPV1-U/gtpv1u_sgw_defs.h | 97 - openair3/GTPV1-U/gtpv1u_teid_pool.c | 47 - openair3/GTPV1-U/nw-gtpv1u/AUTHORS | 1 - openair3/GTPV1-U/nw-gtpv1u/COPYING | 26 - openair3/GTPV1-U/nw-gtpv1u/ChangeLog | 0 openair3/GTPV1-U/nw-gtpv1u/NEWS | 0 openair3/GTPV1-U/nw-gtpv1u/README | 0 .../GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h | 83 - .../nw-gtpv1u/include/NwGtpv1uPrivate.h | 227 --- .../GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h | 88 - .../include/NwGtpv1uTunnelEndPoint.h | 85 - openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h | 562 ------ .../GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h | 63 - .../GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h | 66 - .../GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h | 317 ---- openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h | 88 - openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h | 78 - openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h | 68 - openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c | 1025 ----------- openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c | 558 ------ openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c | 399 ---- .../nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c | 135 -- .../GTPV1-U/nw-gtpv1u/test-app/Makefile.am | 5 - .../GTPV1-U/nw-gtpv1u/test-app/Makefile.in | 461 ----- .../test-app/nw-helloworld/Makefile.am | 17 - .../test-app/nw-helloworld/Makefile.in | 433 ----- .../nw-gtpv1u/test-app/nw-helloworld/NwEvt.h | 80 - .../nw-helloworld/NwMiniLogMgrEntity.c | 62 - .../nw-helloworld/NwMiniLogMgrEntity.h | 57 - .../nw-helloworld/NwMiniTmrMgrEntity.c | 101 -- .../nw-helloworld/NwMiniTmrMgrEntity.h | 53 - .../test-app/nw-helloworld/NwMiniUdpEntity.c | 157 -- .../test-app/nw-helloworld/NwMiniUdpEntity.h | 51 - .../test-app/nw-helloworld/NwMiniUlpEntity.c | 309 ---- .../test-app/nw-helloworld/NwMiniUlpEntity.h | 64 - .../test-app/nw-helloworld/helloworld.c | 207 --- openair3/UDP/udp_eNB_task.c | 447 ----- openair3/UDP/udp_eNB_task.h | 97 - openair3/ocp-gtpu/gtp_itf.cpp | 104 +- openair3/ocp-gtpu/gtp_itf.h | 31 +- .../gtpv1u_eNB_task.h} | 112 +- .../{GTPV1-U => ocp-gtpu}/gtpv1u_gNB_task.h | 3 + targets/COMMON/create_tasks.c | 9 +- targets/COMMON/create_tasks_mbms.c | 39 +- targets/COMMON/create_tasks_ue.c | 1 - targets/RT/USER/TOOLS/thread_ipc.h | 83 - 86 files changed, 214 insertions(+), 10339 deletions(-) delete mode 100644 common/utils/lte/ue_power.h delete mode 100644 openair1/SCHED_NR/vars.h delete mode 100644 openair2/UTIL/MATH/crc_byte.c delete mode 100644 openair2/UTIL/MATH/random_proto_extern.h delete mode 100644 openair2/UTIL/MATH/taus.c delete mode 100644 openair3/GTPV1-U/Makefile.am delete mode 100644 openair3/GTPV1-U/Makefile.eNB delete mode 100644 openair3/GTPV1-U/gtpv1u.h delete mode 100644 openair3/GTPV1-U/gtpv1u_eNB.c delete mode 100644 openair3/GTPV1-U/gtpv1u_eNB_task.h delete mode 100644 openair3/GTPV1-U/gtpv1u_gNB.c delete mode 100644 openair3/GTPV1-U/gtpv1u_gNB_defs.h delete mode 100644 openair3/GTPV1-U/gtpv1u_sgw_defs.h delete mode 100644 openair3/GTPV1-U/gtpv1u_teid_pool.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/AUTHORS delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/COPYING delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/ChangeLog delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/NEWS delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/README delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uPrivate.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.am delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.in delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.am delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.in delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwEvt.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.c delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.h delete mode 100644 openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/helloworld.c delete mode 100644 openair3/UDP/udp_eNB_task.c delete mode 100644 openair3/UDP/udp_eNB_task.h rename openair3/{GTPV1-U/gtpv1u_eNB_defs.h => ocp-gtpu/gtpv1u_eNB_task.h} (61%) rename openair3/{GTPV1-U => ocp-gtpu}/gtpv1u_gNB_task.h (94%) delete mode 100644 targets/RT/USER/TOOLS/thread_ipc.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f2eda66fc0..ff6169b704 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1019,7 +1019,6 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE ########################## #add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver") #add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)") -add_definitions(-DNEW_GTPU=1) ########################## # RRC LAYER OPTIONS @@ -1097,8 +1096,7 @@ include_directories("${OPENAIR3_DIR}/S1AP") include_directories("${OPENAIR2_DIR}/X2AP") include_directories("${OPENAIR2_DIR}/M2AP") include_directories("${OPENAIR2_DIR}/F1AP") -include_directories("${OPENAIR3_DIR}/UDP") -include_directories("${OPENAIR3_DIR}/GTPV1-U") +include_directories("${OPENAIR3_DIR}/ocp-gtpu") include_directories("${OPENAIR3_DIR}/M3AP") include_directories("${OPENAIR3_DIR}/MME_APP") include_directories("${OPENAIR_DIR}/targets/COMMON") @@ -1124,8 +1122,6 @@ include_directories("${OPENAIR2_DIR}/UTIL/CLI") include_directories("${OPENAIR2_DIR}/UTIL/OPT") include_directories("${OPENAIR2_DIR}/UTIL/OMV") include_directories("${OPENAIR2_DIR}/RRC/LTE/MESSAGES") -include_directories("${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/shared") -include_directories("${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/include") include_directories("${OPENAIR_DIR}") # Utilities Library @@ -2158,7 +2154,6 @@ add_library(L2_NR ${MAC_NR_SRC} ${GNB_APP_SRC} ) -target_compile_definitions(L2_NR PUBLIC NEW_GTPU) add_library(L2_LTE_NR ${L2_RRC_SRC} @@ -2166,7 +2161,6 @@ add_library(L2_LTE_NR ${ENB_APP_SRC} ${MCE_APP_SRC} ) -target_compile_definitions(L2_LTE_NR PUBLIC NEW_GTPU) add_dependencies(L2_NR rrc_flag nr_rrc_flag s1ap_flag x2_flag) @@ -2207,32 +2201,14 @@ add_library(CN_UTILS ${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c ) -set(GTPV1U_DIR ${OPENAIR3_DIR}/GTPV1-U) - -add_library (GTPV1U_OCP +add_library (GTPV1U ${NR_RRC_DIR}/rrc_gNB_GTPV1U.c ${RRC_DIR}/rrc_eNB_GTPV1U.c ${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp ) -target_compile_definitions(GTPV1U_OCP PUBLIC NEW_GTPU) -add_dependencies(GTPV1U_OCP rrc_flag) +add_dependencies(GTPV1U rrc_flag) include_directories(${OPENAIR3_DIR}/ocp-gtp) -#NR case -set (NR_GTPV1U_SRC - ${NR_RRC_DIR}/rrc_gNB_GTPV1U.c - ${RRC_DIR}/rrc_eNB_GTPV1U.c - ${GTPV1U_DIR}/gtpv1u_eNB.c - ${GTPV1U_DIR}/gtpv1u_gNB.c - ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c - ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTrxn.c - ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uMsg.c - ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1u.c - ${GTPV1U_DIR}/gtpv1u_teid_pool.c - ) -add_library(NR_GTPV1U ${NR_GTPV1U_SRC}) -add_dependencies(NR_GTPV1U rrc_flag) - set (MME_APP_SRC ${OPENAIR3_DIR}/MME_APP/mme_app.c ${OPENAIR3_DIR}/MME_APP/mme_config.c @@ -2248,9 +2224,6 @@ set(SCTP_SRC add_library(SCTP_CLIENT ${SCTP_SRC}) add_dependencies(SCTP_CLIENT rrc_flag) -add_library(UDP ${OPENAIR3_DIR}/UDP/udp_eNB_task.c) -add_dependencies(UDP rrc_flag) - set(NAS_SRC ${OPENAIR3_DIR}/NAS/) set(libnas_api_OBJS ${NAS_SRC}COMMON/API/NETWORK/as_message.c @@ -2805,7 +2778,7 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer) target_link_libraries (lte-softmodem -Wl,--start-group - RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB + RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) @@ -2849,7 +2822,7 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l target_link_libraries (ocp-enb -Wl,--start-group - RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB + RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) @@ -2943,7 +2916,7 @@ endif() target_link_libraries (lte-uesoftmodem -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB - SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON + SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES} -Wl,--end-group z dl) @@ -2985,10 +2958,9 @@ add_executable(nr-softmodem ${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c ) -target_compile_definitions(nr-softmodem PUBLIC NEW_GTPU) target_link_libraries (nr-softmodem -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} @@ -3028,7 +3000,7 @@ add_executable(ocp-gnb target_link_libraries (ocp-gnb -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON @@ -3072,7 +3044,7 @@ add_executable(nr-uesoftmodem target_link_libraries (nr-uesoftmodem -Wl,--start-group - RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB + RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} @@ -3326,7 +3298,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) add_executable(test_epc_play_scenario @@ -3345,7 +3317,7 @@ add_executable(test_epc_play_scenario ) target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) @@ -3391,7 +3363,7 @@ if (${T_TRACER}) NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB - CN_UTILS GTPV1U_OCP GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB + CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts) if (TARGET ${i}) add_dependencies(${i} generate_T) @@ -3496,11 +3468,10 @@ add_executable(nr-ittisim ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) -target_compile_definitions(nr-ittisim PUBLIC NEW_GTPU) target_link_libraries (nr-ittisim -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} diff --git a/common/ran_context.h b/common/ran_context.h index db981e9182..055c6f783e 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -42,17 +42,11 @@ //#include "ENB_APP/enb_config.h" #include "flexran_agent_defs.h" -#include "gtpv1u.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1uPrivate.h" -#include "gtpv1u_eNB_defs.h" -#include "gtpv1u_gNB_defs.h" - #include "PHY/defs_L1_NB_IoT.h" #include "RRC/LTE/defs_NB_IoT.h" #include "RRC/LTE/rrc_defs.h" #include "RRC/NR/nr_rrc_defs.h" +#include typedef struct { @@ -110,8 +104,6 @@ typedef struct { struct gNB_MAC_INST_s **nrmac; /// GTPu descriptor gtpv1u_data_t *gtpv1u_data_g; - /// NR GTPu descriptor - nr_gtpv1u_data_t *nr_gtpv1u_data_g; /// RU descriptors. These describe what each radio unit is supposed to do and contain the necessary functions for fronthaul interfaces struct RU_t_s **ru; /// Mask to indicate fronthaul setup status of RU (hard-limit to 64 RUs) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index d85dab79a0..57c50a65e0 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -25,14 +25,22 @@ #include #include #include +#include +#include #include #include "backtrace.h" -#define _Assert_Exit_ \ - fprintf(stderr, "\nExiting execution\n"); \ - fflush(stdout); \ - fflush(stderr); \ - abort(); +#define _Assert_Exit_ \ + if (getenv("gdbStacks")) { \ + char tmp [1000]; \ + sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d > /tmp/full_stacks.%d < /dev/null", \ + getpid(), getpid()); \ + system(tmp); \ + } \ + fprintf(stderr, "\nExiting execution\n"); \ + fflush(stdout); \ + fflush(stderr); \ + abort(); #define _Assert_(cOND, aCTION, fORMAT, aRGS...) \ do { \ diff --git a/common/utils/lte/ue_power.h b/common/utils/lte/ue_power.h deleted file mode 100644 index caeebec2c8..0000000000 --- a/common/utils/lte/ue_power.h +++ /dev/null @@ -1,34 +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 ue_power.h -* \brief support routines used in MAC and PHY -* \author R. Knopp, F. Kaltenberger -* \date 2020 -* \version 0.1 -* \company Eurecom -* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr -* \note -* \warning -*/ - -int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs); - diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h index 3188e5889f..5ea2e0f87a 100644 --- a/common/utils/ocp_itti/intertask_interface.h +++ b/common/utils/ocp_itti/intertask_interface.h @@ -256,8 +256,8 @@ typedef struct IttiMsgText_s { #include //#include -#include -#include +#include +#include void *rrc_enb_process_itti_msg(void *); #include #include @@ -340,8 +340,6 @@ void *rrc_enb_process_msg(void *); TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\ TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ - TASK_DEF(OCP_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ - TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\ TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \ diff --git a/doc/SW_archi.md b/doc/SW_archi.md index 0e77cfa580..7648fb2e16 100644 --- a/doc/SW_archi.md +++ b/doc/SW_archi.md @@ -369,7 +369,7 @@ gtpv1u_create_s1u_tunnel(), delete tunnel, ... functions are called inside the o # New GTP ## initialization -ocp_gtpv1uTask(): this creates only the thread, doesn't configure anything +gtpv1uTask(): this creates only the thread, doesn't configure anything gtpv1Init(): creates a listening socket to Linux for a given reception and select a local IP address ## newGtpuCreateTunnel() diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 5f57919645..184b9caa8f 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -365,7 +365,7 @@ int create_gNB_tasks(uint32_t gnb_nb) { //Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario if(is_x2ap_enabled() || AMF_MODE_ENABLED) { - if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) { + if (itti_create_task (TASK_GTPV1_U, >pv1uTask, NULL) < 0) { LOG_E(GTPU, "Create task for GTPV1U failed\n"); return -1; } diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2e7b2ea0e1..71f99f543d 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -18,7 +18,8 @@ * For more information about the OpenAirInterface (OAI) Software Alliance: * contact@openairinterface.org */ - +#define _GNU_SOURCE +#include #include #include "executables/nr-uesoftmodem.h" #include "PHY/phy_extern_nr_ue.h" diff --git a/openair1/PHY/TOOLS/lte_enb_scope.c b/openair1/PHY/TOOLS/lte_enb_scope.c index 7fde9f244c..0e873addbc 100644 --- a/openair1/PHY/TOOLS/lte_enb_scope.c +++ b/openair1/PHY/TOOLS/lte_enb_scope.c @@ -49,12 +49,6 @@ void reset_stats(FL_OBJECT *button, long arg) { int i,j,k; PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; - printf("XXX %d %d %d\n", - sizeofArray(phy_vars_eNB->UE_stats), - sizeofArray( phy_vars_eNB->UE_stats[i].dlsch_NAK), - sizeofArray( *phy_vars_eNB->UE_stats[i].dlsch_NAK) - ); - for (i=0; iUE_stats); i++) { for (k=0; kUE_stats[i].dlsch_NAK); k++) { //harq_processes for (j=0; jUE_stats[i].dlsch_NAK); j++) { diff --git a/openair1/SCHED_NR/vars.h b/openair1/SCHED_NR/vars.h deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 6a2aba5944..2a4fdf64d2 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -175,7 +175,12 @@ gtpv1u_update_ngu_tunnel( return 0; } -int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { +int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + return 0; +} + +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t *req) { return 0; } diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index fb0f37d7ac..d7c29e8ff3 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -143,7 +143,12 @@ gtpv1u_update_ngu_tunnel( return 0; } -int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { +int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + return 0; +} + +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t *req) { return 0; } diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index ac991ae940..b296b6ef36 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -139,7 +139,12 @@ gtpv1u_create_s1u_tunnel( return 0; } -int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { +int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + return 0; +} + +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t *req) { return 0; } diff --git a/openair2/COMMON/gtpv1_u_messages_def.h b/openair2/COMMON/gtpv1_u_messages_def.h index 2835d07e4a..44e9d4fbdf 100644 --- a/openair2/COMMON/gtpv1_u_messages_def.h +++ b/openair2/COMMON/gtpv1_u_messages_def.h @@ -19,18 +19,12 @@ * contact@openairinterface.org */ -MESSAGE_DEF(GTPV1U_ENB_UPDATE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_update_tunnel_req_t, Gtpv1uUpdateTunnelReq) -MESSAGE_DEF(GTPV1U_ENB_UPDATE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_update_tunnel_resp_t, Gtpv1uUpdateTunnelResp) -MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_req_t, Gtpv1uDeleteTunnelReq) -MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_resp_t, Gtpv1uDeleteTunnelResp) -MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_ind_t, Gtpv1uTunnelDataInd) + MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq) MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_req_t,Gtpv1uDataForwardingReq) MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd) MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq) MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd) -MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq) +MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq) -MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_req_t, NRGtpv1uDeleteTunnelReq) -MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_resp_t, NRGtpv1uDeleteTunnelResp) MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq) diff --git a/openair2/COMMON/gtpv1_u_messages_types.h b/openair2/COMMON/gtpv1_u_messages_types.h index 2dd476ab68..096f0f4697 100644 --- a/openair2/COMMON/gtpv1_u_messages_types.h +++ b/openair2/COMMON/gtpv1_u_messages_types.h @@ -28,10 +28,6 @@ #define GTPV1U_MAX_BEARERS_PER_UE max_val_LTE_DRB_Identity #define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity -#define GTPV1U_ENB_UPDATE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelReq -#define GTPV1U_ENB_UPDATE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelResp -#define GTPV1U_ENB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelReq -#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp #define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd #define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq #define GTPV1U_ENB_DATA_FORWARDING_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingReq @@ -41,8 +37,6 @@ #define GTPV1U_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uReq -#define GTPV1U_GNB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelReq -#define GTPV1U_GNB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelResp #define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq #define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF @@ -200,7 +194,6 @@ typedef struct gtpv1u_gnb_create_tunnel_resp_s { pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE]; transport_layer_addr_t gnb_addr; } gtpv1u_gnb_create_tunnel_resp_t; - typedef struct gtpv1u_gnb_delete_tunnel_req_s { rnti_t rnti; uint8_t num_pdusession; @@ -212,7 +205,6 @@ typedef struct gtpv1u_gnb_delete_tunnel_resp_s { uint8_t status; ///< Status of NGU endpoint deleteion (Failed = 0xFF or Success = 0x0) teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted } gtpv1u_gnb_delete_tunnel_resp_t; - typedef struct gtpv1u_gnb_tunnel_data_req_s { uint8_t *buffer; uint32_t length; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index a08bcf4baf..f5493a839a 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2080,7 +2080,7 @@ int RCconfig_gtpu(void ) { GTPV1U_REQ(message).localPort = enb_port_for_S1U; strcpy(GTPV1U_REQ(message).localAddrStr,address); sprintf(GTPV1U_REQ(message).localPortStr,"%d", enb_port_for_S1U); - itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id) + itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id) } else LOG_E(GTPU,"invalid address for S1U\n"); diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c index 13f08b9458..8d4f896250 100644 --- a/openair2/F1AP/f1ap_cu_task.c +++ b/openair2/F1AP/f1ap_cu_task.c @@ -47,7 +47,7 @@ static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) { strncpy(tmp.destinationHost, IPaddrs->remote_addr, sizeof(tmp.destinationHost)-1); sprintf(tmp.originService, "%d", IPaddrs->my_portd); sprintf(tmp.destinationService, "%d", IPaddrs->remote_portd); - return ocp_gtpv1Init(tmp); + return gtpv1Init(tmp); } static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind, diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c index 537f0060ae..1d5d24f5ca 100644 --- a/openair2/F1AP/f1ap_du_task.c +++ b/openair2/F1AP/f1ap_du_task.c @@ -103,7 +103,7 @@ static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, c strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1); sprintf(tmp.originService, "%d", DUport); sprintf(tmp.destinationService, "%d", CUport); - return ocp_gtpv1Init(tmp); + return gtpv1Init(tmp); } void *F1AP_DU_task(void *arg) { diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 9710dd1814..65f2b58d8d 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1220,7 +1220,7 @@ int RCconfig_nr_gtpu(void ) { GTPV1U_REQ(message).localPort = port; strcpy(GTPV1U_REQ(message).localAddrStr,address); sprintf(GTPV1U_REQ(message).localPortStr,"%d", port); - itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id) + itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id) } else LOG_E(GTPU,"invalid address for NGU or S1U\n"); diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 4d2e157728..68bc9aedb2 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -60,7 +60,6 @@ #include # include "gtpv1u_eNB_task.h" -# include "gtpv1u.h" #include #include "ENB_APP/enb_config.h" @@ -229,7 +228,7 @@ rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt, LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n", __func__, rb_id, size); extern instance_t CUuniqInstance; - itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p); return TRUE; } @@ -1078,7 +1077,7 @@ pdcp_data_ind( GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX; GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti; GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4; - itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); packet_forwarded = TRUE; } } else { diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index b49b020428..c3bffc0d2a 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -85,8 +85,6 @@ extern struct msghdr nas_msg_rx; # include "gtpv1u_eNB_task.h" -# include "gtpv1u_eNB_defs.h" - extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP); uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index ab8578a0e7..c75132564c 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -674,7 +674,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, sdap_gnb_ul_header_handler(buf[0]); // Handler for the UL gNB SDAP Header } LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset); - itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); } } } @@ -728,7 +728,7 @@ rb_found: LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size); extern instance_t CUuniqInstance; - itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p); } else { memblock = get_free_mem_block(size, __FUNCTION__); diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 78e06d37e2..dcf2694d1a 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -518,7 +518,7 @@ rb_found: req->pdusession_id=rb_id; LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); extern instance_t DUuniqInstance; - itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg); + itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg); return; } } diff --git a/openair2/LAYER2/rlc_v2/rlc_oai_api.c b/openair2/LAYER2/rlc_v2/rlc_oai_api.c index 16c3db0cae..2a6f00c13c 100644 --- a/openair2/LAYER2/rlc_v2/rlc_oai_api.c +++ b/openair2/LAYER2/rlc_v2/rlc_oai_api.c @@ -440,7 +440,7 @@ rb_found: req->rnti=ue->rnti; req->rab_id=rb_id+4; LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size); - itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg); + itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg); return; } } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c7b54950d7..08807e0202 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -30,6 +30,10 @@ * \warning */ +#include +#include +#include + #include "PHY/defs_nr_UE.h" #include "NR_IF_Module.h" #include "NR_MAC_UE/mac_proto.h" diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 260b6fceaa..8d21663d51 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -9572,20 +9572,6 @@ void *rrc_enb_process_itti_msg(void *notUsed) { rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND(msg_p, msg_name_p, instance); break; - case GTPV1U_ENB_DELETE_TUNNEL_RESP: { - rrc_eNB_ue_context_t *ue = rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti); - - if (ue != NULL - && ue->ue_context.ue_release_timer_rrc > 0 - && (ue->ue_context.handover_info == NULL || - (ue->ue_context.handover_info->state != HO_RELEASE && - ue->ue_context.handover_info->state != HO_CANCEL))) { - ue->ue_context.ue_release_timer_rrc = ue->ue_context.ue_release_timer_thres_rrc; - } - - break; - } - case S1AP_PATH_SWITCH_REQ_ACK: LOG_I(RRC, "[eNB %ld] received path switch ack %s\n", instance, msg_name_p); rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK(msg_p, msg_name_p, instance); diff --git a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c index 3fa17bcd6b..7afec416c6 100644 --- a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c +++ b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c @@ -210,7 +210,7 @@ boolean_t gtpv_data_req_new ( GTPV1U_ENB_END_MARKER_REQ(msg).offset = GTPU_HEADER_OVERHEAD_MAX; LOG_I(GTPU, "Send End Marker to GTPV1-U at frame %d and subframe %d \n", ctxt->frame,ctxt->subframe); itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(ctxt->module_id), msg); - return NW_GTPV1U_OK; + return 0; } /* target enb */ @@ -225,7 +225,7 @@ boolean_t gtpv_data_req_new ( gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req; memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req)); delete_tunnel_req.rnti = ctxt->rnti; - gtpv1u_delete_x2u_tunnel(ctxt->module_id, &delete_tunnel_req, GTPV1U_TARGET_ENB); + gtpv1u_delete_x2u_tunnel(ctxt->module_id, &delete_tunnel_req); return true; } else { /* data packet */ diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 1a5fe55c26..96b8cd0a99 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -36,7 +36,6 @@ #include "rrc_eNB_S1AP.h" #include "enb_config.h" #include "common/ran_context.h" -#include "gtpv1u.h" #include "s1ap_eNB.h" #include "s1ap_eNB_defs.h" diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2c2020412d..5b370d3614 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -30,6 +30,10 @@ #define RRC_GNB_C #define RRC_GNB_C +#include +#include +#include + #include "nr_rrc_config.h" #include "nr_rrc_defs.h" #include "nr_rrc_extern.h" @@ -2190,7 +2194,6 @@ rrc_gNB_decode_dcch( asn_dec_rval_t dec_rval; NR_UL_DCCH_Message_t *ul_dcch_msg = NULL; struct rrc_gNB_ue_context_s *ue_context_p = NULL; - MessageDef *msg_delete_tunnels_p = NULL; uint8_t xid; int i; @@ -2289,21 +2292,17 @@ rrc_gNB_decode_dcch( xid = ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier; ue_context_p->ue_context.pdu_session_release_command_flag = 0; //gtp tunnel delete - msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, 0, GTPV1U_GNB_DELETE_TUNNEL_REQ); - memset(>PV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p))); - GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; - + gtpv1u_gnb_delete_tunnel_req_t req={0}; for(i = 0; i < NB_RB_MAX; i++) { if(xid == ue_context_p->ue_context.pduSession[i].xid) { - GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).pdusession_id[GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_pdusession++] = + req.pdusession_id[req.num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i]; ue_context_p->ue_context.gnb_gtp_teid[i] = 0; memset(&ue_context_p->ue_context.gnb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.gnb_gtp_addrs[i])); ue_context_p->ue_context.gnb_gtp_psi[i] = 0; } } - - itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->instance, msg_delete_tunnels_p); + gtpv1u_delete_ngu_tunnel(ctxt_pP->instance, &req); //NGAP_PDUSESSION_RELEASE_RESPONSE rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(ctxt_pP, ue_context_p, xid); } else if (ue_context_p->ue_context.established_pdu_sessions_flag != 1) { @@ -3636,9 +3635,6 @@ void *rrc_gnb_task(void *args_p) { rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(msg_p, msg_name_p, instance); break; - case GTPV1U_GNB_DELETE_TUNNEL_RESP: - break; - /* Messages from gNB app */ case NRRRC_CONFIGURATION_REQ: LOG_I(NR_RRC, "[gNB %ld] Received %s : %p\n", instance, msg_name_p,&NRRRC_CONFIGURATION_REQ(msg_p)); @@ -3688,11 +3684,6 @@ void *rrc_gnb_task(void *args_p) { rrc_gNB_process_dc_overall_timeout(GNB_INSTANCE_TO_MODULE_ID(instance), &X2AP_ENDC_DC_OVERALL_TIMEOUT(msg_p)); break; - /* Messages from GTP */ - case GTPV1U_ENB_DELETE_TUNNEL_RESP: - /* nothing to do? */ - break; - case NGAP_UE_CONTEXT_RELEASE_REQ: rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_REQ(msg_p, msg_name_p, instance); break; diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 043d136604..a05698bd5a 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -33,7 +33,6 @@ #include "rrc_eNB_S1AP.h" #include "gnb_config.h" #include "common/ran_context.h" -#include "gtpv1u.h" #include "asn1_conversions.h" #include "intertask_interface.h" @@ -44,6 +43,7 @@ #include "gtpv1u_eNB_task.h" #include "gtpv1u_gNB_task.h" +#include #include "RRC/LTE/rrc_eNB_GTPV1U.h" #include "RRC/NR/rrc_gNB_GTPV1U.h" @@ -1395,7 +1395,6 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( protocol_ctxt_t ctxt; pdusession_release_t pdusession_release_params[NGAP_MAX_PDUSESSION]; uint8_t nb_pdusessions_torelease; - MessageDef *msg_delete_tunnels_p = NULL; uint8_t xid; int i, pdusession; uint8_t b_existed,is_existed; @@ -1473,20 +1472,18 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( } else { //gtp tunnel delete LOG_I(NR_RRC, "gtp tunnel delete \n"); - msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, 0, GTPV1U_GNB_DELETE_TUNNEL_REQ); - memset(>PV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p))); - GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; + gtpv1u_gnb_delete_tunnel_req_t req={0}; + req.rnti = ue_context_p->ue_context.rnti; for(i = 0; i < NB_RB_MAX; i++) { if(xid == ue_context_p->ue_context.pduSession[i].xid) { - GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).pdusession_id[GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i]; + req.pdusession_id[req.num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i]; ue_context_p->ue_context.gnb_gtp_teid[i] = 0; memset(&ue_context_p->ue_context.gnb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.gnb_gtp_addrs[i])); ue_context_p->ue_context.gnb_gtp_psi[i] = 0; } } - - itti_send_msg_to_task(TASK_GTPV1_U, instance, msg_delete_tunnels_p); + gtpv1u_delete_ngu_tunnel(instance, &req); //NGAP_PDUSESSION_RELEASE_RESPONSE rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(&ctxt, ue_context_p, xid); LOG_I(NR_RRC, "Send PDU Session Release Response \n"); diff --git a/openair2/UTIL/MATH/crc_byte.c b/openair2/UTIL/MATH/crc_byte.c deleted file mode 100644 index a3ff00fec1..0000000000 --- a/openair2/UTIL/MATH/crc_byte.c +++ /dev/null @@ -1,185 +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 - */ - -/* - May 10, 2001 - Modified in June, 2001, to include the length non multiple of 8 - crc_byte.c - Byte oriented implementation of CRC's - - */ -#include "rtos_header.h" -#include "platform_types.h" - - -/*ref 25.222 v4.0.0 , p12 */ -/* the highest degree is set by default */ -unsigned int poly24 = 0x80006100; // 1000 0000 0000 0000 0110 0001 D^24 + D^23 + D^6 + D^5 + D + 1 -unsigned int poly16 = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1 -unsigned int poly12 = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1 -unsigned int poly8 = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1 -/********************************************************* - -For initialization && verification purposes, - bit by bit implementation with any polynomial - -The first bit is in the MSB of each byte - -*********************************************************/ -static unsigned int -crcbit (unsigned char * inputptr, int octetlen, unsigned int poly) -{ - unsigned int i, crc = 0, c; - - while (octetlen-- > 0) { - c = (*inputptr++) << 24; - - for (i = 8; i != 0; i--) { - if ((1 << 31) & (c ^ crc)) - crc = (crc << 1) ^ poly; - else - crc <<= 1; - - c <<= 1; - } - } - - return crc; -} - -/********************************************************* - -crc table initialization - -*********************************************************/ -static unsigned int crc24Table[256]; -static unsigned short crc16Table[256]; -static unsigned short crc12Table[256]; -static unsigned char crc8Table[256]; -void -crcTableInit () -{ - unsigned char c = 0; - - do { - crc24Table[c] = crcbit (&c, 1, poly24); - crc16Table[c] = (unsigned short) (crcbit (&c, 1, poly16) >> 16); - crc12Table[c] = (unsigned short) (crcbit (&c, 1, poly12) >> 16); - crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24); - } while (++c); -} - -/********************************************************* - -Byte by byte implementations, -assuming initial byte is 0 padded (in MSB) if necessary - -*********************************************************/ -unsigned int -crc24 (unsigned char * inptr, int bitlen) -{ - - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - - while (octetlen-- > 0) { - crc = (crc << 8) ^ crc24Table[(*inptr++) ^ (crc >> 24)]; - } - - if (resbit > 0) - crc = (crc << resbit) ^ crc24Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))]; - - return crc; -} - -unsigned int -crc16 (unsigned char * inptr, int bitlen) -{ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - - while (octetlen-- > 0) { - crc = (crc << 8) ^ (crc16Table[(*inptr++) ^ (crc >> 24)] << 16); - } - - if (resbit > 0) - crc = (crc << resbit) ^ (crc16Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 16); - - return crc; -} - -unsigned int -crc12 (unsigned char * inptr, int bitlen) -{ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - - while (octetlen-- > 0) { - crc = (crc << 8) ^ (crc12Table[(*inptr++) ^ (crc >> 24)] << 16); - } - - if (resbit > 0) - crc = (crc << resbit) ^ (crc12Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 16); - - return crc; -} - -unsigned int -crc8 (unsigned char * inptr, int bitlen) -{ - int octetlen, resbit; - unsigned int crc = 0; - octetlen = bitlen / 8; /* Change in octets */ - resbit = (bitlen % 8); - - while (octetlen-- > 0) { - crc = crc8Table[(*inptr++) ^ (crc >> 24)] << 24; - } - - if (resbit > 0) - crc = (crc << resbit) ^ (crc8Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 24); - - return crc; -} - -/*******************************************************************/ -/** - Test code -********************************************************************/ - -/* #ifdef MAIN - #include - main() - { - unsigned char test[] = "Thebigredfox"; - crcTableInit(); - printf("%x\n", crcbit(test, sizeof(test) - 1, poly24)); - printf("%x\n", crc24(test, (sizeof(test) - 1)*8)); - printf("%x\n", crcbit(test, sizeof(test) - 1, poly8)); - printf("%x\n", crc8(test, (sizeof(test) - 1)*8)); - } - #endif */ diff --git a/openair2/UTIL/MATH/random_proto_extern.h b/openair2/UTIL/MATH/random_proto_extern.h deleted file mode 100644 index 45db565217..0000000000 --- a/openair2/UTIL/MATH/random_proto_extern.h +++ /dev/null @@ -1,30 +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 - */ - -/* - - random_proto_extern.h - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - ***************************************************************************/ -extern int uniform (void); diff --git a/openair2/UTIL/MATH/taus.c b/openair2/UTIL/MATH/taus.c deleted file mode 100644 index 6b5e03588d..0000000000 --- a/openair2/UTIL/MATH/taus.c +++ /dev/null @@ -1,116 +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 taus.c -* \brief random number generator per OAI component -* \author Navid Nikaein -* \date 2011 - 2014 -* \version 0.1 -* \email navid.nikaein@eurecom.fr -* \warning -* @ingroup util -*/ - -#include -#include -#include -#include -#include -#include "oml.h" - -unsigned int s0[MAX_NUM_COMPS], s1[MAX_NUM_COMPS], s2[MAX_NUM_COMPS], b[MAX_NUM_COMPS], r[MAX_NUM_COMPS]; - - - - -inline unsigned int taus(unsigned int comp) { - b[comp] = (((s0[comp] << 13) ^ s0[comp]) >> 19); - s0[comp] = (((s0[comp] & 0xFFFFFFFE) << 12)^ b[comp]); - b[comp] = (((s1[comp] << 2) ^ s1[comp]) >> 25); - s1[comp] = (((s1[comp] & 0xFFFFFFF8) << 4)^ b[comp]); - b[comp] = (((s2[comp] << 3) ^ s2[comp]) >> 11); - s2[comp] = (((s2[comp] & 0xFFFFFFF0) << 17)^ b[comp]); - r[comp] = s0[comp] ^ s1[comp] ^ s2[comp]; - return r[comp]; -} - -/*void set_taus_seed(unsigned int seed_type) { - unsigned int i; // i index of component - - for (i=MIN_NUM_COMPS; i < MAX_NUM_COMPS ; i ++) { - switch (seed_type) { - case 0: // use rand func - if (i == 0) srand(time(NULL)); - - s0[i] = ((unsigned int)rand()); - s1[i] = ((unsigned int)rand()); - s2[i] = ((unsigned int)rand()); - printf("Initial seeds use rand: s0[%u] = 0x%x, s1[%u] = 0x%x, s2[%u] = 0x%x\n", i, s0[i], i, s1[i], i, s2[i]); - break; - - case 1: // use rand with seed - if (i == 0) srand(0x1e23d851); - - s0[i] = ((unsigned int)rand()); - s1[i] = ((unsigned int)rand()); - s2[i] = ((unsigned int)rand()); - printf("Initial seeds use rand with seed : s0[%u] = 0x%x, s1[%u] = 0x%x, s2[%u] = 0x%x\n", i, s0[i], i, s1[i], i, s2[i]); - break; - - default: - break; - } - } -}*/ - -int get_rand (unsigned int comp) { - if ((comp > MIN_NUM_COMPS) && (comp < MAX_NUM_COMPS)) - return r[comp]; - else { - //LOG_E(RNG,"unknown component %d\n",comp); - return -1; - } -} - -unsigned int dtaus(unsigned int comp, unsigned int a, unsigned b) { - return (int) (((double)taus(comp)/(double)0xffffffff)* (double)(b-a) + (double)a); -} -/* -#ifdef STANDALONE -main() { - - unsigned int i,randomg, randphy; - - set_taus_seed(0); - printf("dtaus %d \n",dtaus(PHY, 1000, 1000000)); - - do {//for (i=0;i<10;i++){ - randphy = taus(PHY); - randomg = taus(OTG); - i++; - // printf("rand for OMG (%d,0x%x) PHY (%d,0x%x)\n",OMG, randomg, PHY, randphy); - } while (randphy != randomg); - printf("after %d run: get rand for (OMG 0x%x, PHY 0x%x)\n",i, get_rand(OTG), get_rand(PHY)); - -} -#endif - -*/ diff --git a/openair3/GTPV1-U/Makefile.am b/openair3/GTPV1-U/Makefile.am deleted file mode 100644 index 30ea61d6c1..0000000000 --- a/openair3/GTPV1-U/Makefile.am +++ /dev/null @@ -1,58 +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 -# */ - -AM_CFLAGS = @ADD_CFLAGS@ \ - -I$(top_srcdir)/COMMON \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/api/network \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/include \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/ies \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/emm/msg \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/esm/msg \ - -I$(top_srcdir)/NAS/EURECOM-NAS/src/util \ - -I$(top_srcdir)/INTERTASK_INTERFACE \ - -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/include \ - -I$(top_srcdir)/GTPV1-U/nw-gtpv1u/shared \ - -I$(top_srcdir)/UTILS \ - -I$(top_srcdir)/UTILS/HASHTABLE \ - -I$(top_srcdir)/UTILS/TIMER - -noinst_LTLIBRARIES = libgtpv1u.la - -libgtpv1u_la_LDFLAGS = -all-static - -libgtpv1u_la_SOURCES = \ - gtpv1u_task.c gtpv1u.h \ - gtpv1u_teid_pool.c \ - nw-gtpv1u/shared/NwTypes.h \ - nw-gtpv1u/shared/NwUtils.h \ - nw-gtpv1u/shared/NwGtpv1uError.h \ - nw-gtpv1u/shared/NwLog.h \ - nw-gtpv1u/shared/NwGtpv1uIe.h \ - nw-gtpv1u/shared/NwGtpv1uMsg.h \ - nw-gtpv1u/shared/NwGtpv1u.h \ - nw-gtpv1u/include/NwGtpv1uPrivate.h \ - nw-gtpv1u/include/NwGtpv1uLog.h \ - nw-gtpv1u/include/NwGtpv1uTrxn.h \ - nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h \ - nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c \ - nw-gtpv1u/src/NwGtpv1uTrxn.c \ - nw-gtpv1u/src/NwGtpv1uMsg.c \ - nw-gtpv1u/src/NwGtpv1u.c diff --git a/openair3/GTPV1-U/Makefile.eNB b/openair3/GTPV1-U/Makefile.eNB deleted file mode 100644 index b469dc756d..0000000000 --- a/openair3/GTPV1-U/Makefile.eNB +++ /dev/null @@ -1,67 +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 -# */ - -OUTDIR = . - -libgtpv1u_OBJECTS = \ - nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.o \ - nw-gtpv1u/src/NwGtpv1uTrxn.o \ - nw-gtpv1u/src/NwGtpv1uMsg.o \ - nw-gtpv1u/src/NwGtpv1u.o \ - gtpv1u_eNB.o \ - gtpv1u_teid_pool.o - -# pull in dependency info for *existing* .o files --include $(OUTDIR)/*.d - -CFLAGS = \ - -Wall \ - $(GTPV1U_CFLAGS) \ - -DENB_MODE \ - -Werror=uninitialized \ - -Werror=implicit-function-declaration - -$(OUTDIR)/%.o : %.c - @echo "Compiling $<" - @if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi; - @$(CC) -c $(CFLAGS) -o $@ $< - @$(CC) -MM $(CFLAGS) $< > $(basename $@).d - @mv -f $(basename $@).d $(basename $@).d.tmp - @sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d - @sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \ - sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d - @rm -f $(basename $@).d.tmp - -objsdir: - @if [ ! -d $(OUTDIR) ]; then mkdir -p $(OUTDIR); fi; - -$(OUTDIR)/libgtpv1u.a: $(addprefix $(OUTDIR)/,$(libgtpv1u_OBJECTS)) - @echo Creating GTPV1U archive - @$(AR) rcs $@ $(addprefix $(OUTDIR)/,$(libgtpv1u_OBJECTS)) - -clean: - @$(RM_F_V) $(OUTDIR)/nw-gtpv1u/src/*.o - @$(RM_F_V) $(OUTDIR)/nw-gtpv1u/src/*.d - @$(RM_F_V) $(OUTDIR)/*.o - @$(RM_F_V) $(OUTDIR)/*.d - @$(RM_F_V) $(OUTDIR)/libgtpv1u.a - -cleanall: clean diff --git a/openair3/GTPV1-U/gtpv1u.h b/openair3/GTPV1-U/gtpv1u.h deleted file mode 100644 index 9466f024bc..0000000000 --- a/openair3/GTPV1-U/gtpv1u.h +++ /dev/null @@ -1,55 +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 gtpv1u.h -* \brief -* \author Sebastien ROUX, Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ - -#ifndef GTPV1_U_H_ -#define GTPV1_U_H_ - -#define GTPU_STACK_ENB 0 -#define GTPU_STACK_SGW 1 - -/* When gtpv1u is compiled for eNB use MACRO from UTILS/log.h, - * otherwise use standard fprintf as logger. - */ -#if defined(ENB_MODE) -# define GTPU_DEBUG(x, args...) LOG_D(GTPU, x, ##args) -# define GTPU_INFO(x, args...) LOG_I(GTPU, x, ##args) -# define GTPU_WARNING(x, args...) LOG_W(GTPU, x, ##args) -# define GTPU_ERROR(x, args...) LOG_E(GTPU, x, ##args) -#else -# define GTPU_DEBUG(x, args...) fprintf(stdout, "[GTPU][D]"x, ##args) -# define GTPU_INFO(x, args...) fprintf(stdout, "[GTPU][I]"x, ##args) -# define GTPU_WARNING(x, args...) fprintf(stdout, "[GTPU][W]"x, ##args) -# define GTPU_ERROR(x, args...) fprintf(stderr, "[GTPU][E]"x, ##args) -#endif - -//#warning "TO BE REFINED" -# define GTPU_HEADER_OVERHEAD_MAX 64 - -uint32_t gtpv1u_new_teid(void); - -#endif /* GTPV1_U_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c deleted file mode 100644 index 6f5ef004b5..0000000000 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ /dev/null @@ -1,1600 +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 gtpv1u_eNB.c - * \brief - * \author Sebastien ROUX, Lionel GAUTHIER, Navid Nikaein - * \version 1.0 - * \company Eurecom - * \email: lionel.gauthier@eurecom.fr - */ -#include -#include - -#include "mme_config.h" - -#include "assertions.h" -#include "intertask_interface.h" -#include "msc.h" - -#include "gtpv1u.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1uPrivate.h" -#include "NwLog.h" -#include "gtpv1u_eNB_defs.h" -#include "gtpv1_u_messages_types.h" -#include "udp_eNB_task.h" -#include "common/utils/LOG/log.h" -#include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#include "common/ran_context.h" -#include "gtpv1u_eNB_defs.h" -#include "gtpv1u_eNB_task.h" -#include "rrc_eNB_GTPV1U.h" -#include - -#undef GTP_DUMP_SOCKET - -extern unsigned char NB_eNB_INST; -extern RAN_CONTEXT_t RC; - -extern struct rrc_eNB_ue_context_s * -rrc_eNB_get_ue_context( - eNB_RRC_INST *rrc_instance_pP, - rnti_t rntiP); - -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 -#include -static int gtpv1u_dump_socket_g; - -//----------------------------------------------------------------------------- -int gtpv1u_eNB_create_dump_socket(void) { - struct ifreq ifr; - int hdrincl=1; - - if ((gtpv1u_dump_socket_g = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0 ) { - LOG_E(GTPU, "Could not create dump socket %d:%s\n", errno, strerror(errno)); - return -1; - } - - if (setsockopt(gtpv1u_dump_socket_g, - IPPROTO_IP, - IP_HDRINCL, - &hdrincl, - sizeof(hdrincl))==-1) { - LOG_E(GTPU, "%s:%d set IP_HDRINCL %d:%s\n", - __FILE__, __LINE__, errno, strerror(errno)); - } - - memset(&ifr, 0, sizeof(ifr)); - snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "lo"); - - if (setsockopt(gtpv1u_dump_socket_g, SOL_SOCKET, SO_BINDTODEVICE, (void *)&ifr, sizeof(ifr)) < 0) { - LOG_E(GTPU, "%s:%d setsockopt SO_BINDTODEVICE %d:%s\n", - __FILE__, __LINE__, errno, strerror(errno)); - close(gtpv1u_dump_socket_g); - return -1; - } -} - -//----------------------------------------------------------------------------- -static void gtpv1u_eNB_write_dump_socket(uint8_t *buffer_pP, uint32_t buffer_lengthP) { - struct sockaddr_in sin; - memset(&sin, 0, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = INADDR_LOOPBACK; - - if (sendto(gtpv1u_dump_socket_g, buffer_pP, (size_t)buffer_lengthP, 0, (struct sockaddr *)&sin, sizeof(struct sockaddr)) < 0) { - LOG_E(GTPU, "%s:%s:%d sendto %d:%s\n", - __FILE__, __FUNCTION__, __LINE__, errno, strerror(errno)); - } -} - -#endif - -//----------------------------------------------------------------------------- -static int gtpv1u_eNB_get_msgsource(struct rrc_eNB_ue_context_s *ue_context_p, teid_t teid) { - int erab_index = 0; - - /* source enb */ - if(ue_context_p->ue_context.handover_info != NULL && ue_context_p->ue_context.handover_info->state == HO_COMPLETE) { - return GTPV1U_MSG_FROM_SPGW; - } - - /* target enb */ - for (erab_index = 0; erab_index < ue_context_p->ue_context.nb_x2u_e_rabs; erab_index++) { - if(ue_context_p->ue_context.enb_gtp_x2u_teid[erab_index] == teid) { - return GTPV1U_MSG_FROM_SOURCE_ENB; - } - } - - return GTPV1U_MSG_FROM_SPGW; -} - -//----------------------------------------------------------------------------- -static int gtpv1u_eNB_send_init_udp(const Gtpv1uS1Req *req) { - // Create and alloc new message - MessageDef *message_p; - struct in_addr addr= {0}; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, UDP_INIT); - - if (message_p == NULL) { - return -1; - } - - UDP_INIT(message_p).port = req->enb_port_for_S1u_S12_S4_up; - addr.s_addr = req->enb_ip_address_for_S1u_S12_S4_up; - UDP_INIT(message_p).address = inet_ntoa(addr); - LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port); - MSC_LOG_EVENT( - MSC_GTPU_ENB, - "0 UDP bind %s:%u", - UDP_INIT(message_p).address, - UDP_INIT(message_p).port); - return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); -} - -static int gtpv1u_s1_req( - const instance_t instanceP, - const Gtpv1uS1Req *const req) { - memcpy(&RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, - &req->enb_ip_address_for_S1u_S12_S4_up, - sizeof (req->enb_ip_address_for_S1u_S12_S4_up)); - gtpv1u_eNB_send_init_udp(req); - return 0; -} - -//----------------------------------------------------------------------------- -NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr, - uint32_t logLevel, - NwCharT *file, - uint32_t line, - NwCharT *logStr) { - LOG_D(GTPU, "%s\n", logStr); - return NW_GTPV1U_OK; -} - -//----------------------------------------------------------------------------- -NwGtpv1uRcT gtpv1u_eNB_send_udp_msg( - NwGtpv1uUdpHandleT udpHandle, - uint8_t *buffer, - uint32_t buffer_len, - uint32_t buffer_offset, - uint32_t peerIpAddr, - uint16_t peerPort) { - // Create and alloc new message - MessageDef *message_p = NULL; - udp_data_req_t *udp_data_req_p = NULL; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, UDP_DATA_REQ); - - if (message_p) { -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_D(GTPU, "Sending UDP_DATA_REQ length %u offset %u", buffer_len, buffer_offset); -#endif - udp_data_req_p = &message_p->ittiMsg.udp_data_req; - udp_data_req_p->peer_address = peerIpAddr; - udp_data_req_p->peer_port = peerPort; - udp_data_req_p->buffer = buffer; - udp_data_req_p->buffer_length = buffer_len; - udp_data_req_p->buffer_offset = buffer_offset; - return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); - } else { - return NW_GTPV1U_FAILURE; - } -} - - -//----------------------------------------------------------------------------- -/* Callback called when a gtpv1u message arrived on UDP interface */ -NwGtpv1uRcT gtpv1u_eNB_process_stack_req( - NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi) { - boolean_t result = FALSE; - teid_t teid = 0; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - protocol_ctxt_t ctxt; - NwGtpv1uRcT rc; - - switch(pUlpApi->apiType) { - /* Here there are two type of messages handled: - * - T-PDU - * - END-MARKER - */ - case NW_GTPV1U_ULP_API_RECV_TPDU: { - uint8_t buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - uint32_t buffer_len; - struct rrc_eNB_ue_context_s *ue_context_p; - uint16_t msgType = NW_GTP_GPDU; - NwGtpv1uMsgT *pMsg = NULL; - /* Nw-gptv1u stack has processed a PDU. we can schedule it to PDCP - * for transmission. - */ - teid = pUlpApi->apiInfo.recvMsgInfo.teid; - pMsg = (NwGtpv1uMsgT *) pUlpApi->apiInfo.recvMsgInfo.hMsg; - msgType = pMsg->msgType; - - if (NW_GTPV1U_OK != nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, - buffer, &buffer_len)) { - LOG_E(GTPU, "Error while retrieving T-PDU"); - } - - itti_free(TASK_UDP, ((NwGtpv1uMsgT *)pUlpApi->apiInfo.recvMsgInfo.hMsg)->msgBuf); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(buffer,buffer_len); -#endif - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - pUlpApi->apiInfo.recvMsgInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_D(GTPU, "Received T-PDU from gtpv1u stack teid %u size %d -> enb module id %u ue module id %u rab id %u\n", - teid, - buffer_len, - gtpv1u_teid_data_p->enb_id, - gtpv1u_teid_data_p->ue_id, - gtpv1u_teid_data_p->eps_bearer_id); -#endif - //#warning "LG eps bearer mapping to DRB id to do (offset -4)" - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_PDCP_ENB, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - 0,0, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - buffer_len); - ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id], ctxt.rnti); - - if((ue_context_p != NULL) && - (ue_context_p->ue_context.handover_info != NULL) && - (ue_context_p->ue_context.handover_info->state < HO_FORWARDING_COMPLETE)) { - if(msgType == NW_GTP_END_MARKER) { - /* in the source enb, UE in RRC_HO_EXECUTION mode */ - if (ue_context_p->ue_context.StatusRrc == RRC_HO_EXECUTION && ue_context_p->ue_context.handover_info->state == HO_COMPLETE) { - /* set handover state */ - //ue_context_p->ue_context.handover_info->state = HO_END_MARKER; - MessageDef *msg; - // Configure end marker - msg = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_END_MARKER_REQ); - GTPV1U_ENB_END_MARKER_REQ(msg).buffer = itti_malloc(TASK_GTPV1_U, TASK_GTPV1_U, GTPU_HEADER_OVERHEAD_MAX + buffer_len); - memcpy(>PV1U_ENB_END_MARKER_REQ(msg).buffer[GTPU_HEADER_OVERHEAD_MAX], buffer, buffer_len); - GTPV1U_ENB_END_MARKER_REQ(msg).length = buffer_len; - GTPV1U_ENB_END_MARKER_REQ(msg).rnti = ctxt.rnti; - GTPV1U_ENB_END_MARKER_REQ(msg).rab_id = gtpv1u_teid_data_p->eps_bearer_id; - GTPV1U_ENB_END_MARKER_REQ(msg).offset = GTPU_HEADER_OVERHEAD_MAX; - LOG_I(GTPU, "Send End Marker to GTPV1-U at frame %d and subframe %d \n", ctxt.frame,ctxt.subframe); - itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(ctxt.module_id), msg); - return NW_GTPV1U_OK; - } - } - - if (ue_context_p->ue_context.StatusRrc == RRC_HO_EXECUTION || ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) { - int msgsrc = gtpv1u_eNB_get_msgsource(ue_context_p, teid); - LOG_D(GTPU,"UE INFO.ueStatus %d, handover state %d, forwarding state %d, from %s. message type %s\n", - ue_context_p->ue_context.StatusRrc, - ue_context_p->ue_context.handover_info->state, - ue_context_p->ue_context.handover_info->forwarding_state, - msgsrc == GTPV1U_MSG_FROM_SOURCE_ENB?"Source eNB":"EPC", - msgsrc != GTPV1U_MSG_FROM_SOURCE_ENB? "UDP DATA" : - msgType == NW_GTP_END_MARKER?"END MARKER":"DATA FORWARDING"); - - /* target enb */ - if(msgType == NW_GTP_END_MARKER) { - LOG_I(GTPU, "target end receive END MARKER\n"); - ue_context_p->ue_context.handover_info->state = HO_END_MARKER; - gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req; - memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req)); - delete_tunnel_req.rnti = ctxt.rnti; - gtpv1u_delete_x2u_tunnel(ctxt.module_id, &delete_tunnel_req, GTPV1U_TARGET_ENB); - return NW_GTPV1U_OK; - } - - /* form source eNB message */ - if(msgsrc == GTPV1U_MSG_FROM_SOURCE_ENB) { - LOG_I(GTPU, "Received a message data forwarding length %d\n", buffer_len); -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_T(GTPU, "forwarding data info:\n", buffer_len); - - for(int i=1; i<=buffer_len; i++) { - LOG_T(GTPU, "%02x ", buffer[i-1]); - - if(i%20 == 0)LOG_T(GTPU, "\n"); - } - - LOG_T(GTPU, "\n"); -#endif - result = gtpv_data_req( - &ctxt, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA, - TASK_DATA_FORWARDING - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "DATA FORWARDING message save failed\n"); - return NW_GTPV1U_FAILURE; - } - - ue_context_p->ue_context.handover_info->forwarding_state = FORWARDING_NO_EMPTY; - return NW_GTPV1U_OK; - } - /* from epc message */ - else { - /* in the source enb, UE in RRC_HO_EXECUTION mode */ - if (ue_context_p->ue_context.handover_info->state == HO_COMPLETE) { - MessageDef *msg; - // Configure target - msg = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_DATA_FORWARDING_REQ); - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).buffer = itti_malloc(TASK_GTPV1_U, TASK_GTPV1_U, GTPU_HEADER_OVERHEAD_MAX + buffer_len); - memcpy(>PV1U_ENB_DATA_FORWARDING_REQ(msg).buffer[GTPU_HEADER_OVERHEAD_MAX], buffer, buffer_len); - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).length = buffer_len; - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).rnti = ctxt.rnti; - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).rab_id = gtpv1u_teid_data_p->eps_bearer_id; - GTPV1U_ENB_DATA_FORWARDING_REQ(msg).offset = GTPU_HEADER_OVERHEAD_MAX; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_T(GTPU, "Send data forwarding sdu_buffer to target enb. len %d info\n", buffer); - - for(int i=1; i<=buffer_len; i++) { - LOG_T(GTPU, "%02x ", buffer[i-1]); - - if(i%20 == 0)LOG_T(GTPU, "\n"); - } - - LOG_T(GTPU, "\n"); -#endif - LOG_I(GTPU, "Send data forwarding to GTPV1-U at frame %d and subframe %d \n", ctxt.frame,ctxt.subframe); - itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(ctxt.module_id), msg); - return NW_GTPV1U_OK; - } - - /* target eNB. x2ho forwarding is processing. spgw message save to TASK_END_MARKER */ - if(ue_context_p->ue_context.handover_info->state != HO_COMPLETE && - ue_context_p->ue_context.handover_info->state != HO_END_MARKER ) { - LOG_I(GTPU, "x2ho forwarding is processing. Received a spgw message. length %d\n", buffer_len); -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_T(GTPU, "spgw data info:\n", buffer_len); - - for(int i=1; i<=buffer_len; i++) { - LOG_T(GTPU, "%02x ", buffer[i-1]); - - if(i%20 == 0)LOG_T(GTPU, "\n"); - } - - LOG_T(GTPU, "\n"); -#endif - result = gtpv_data_req( - &ctxt, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA, - TASK_END_MARKER - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "DATA FORWARDING message save failed\n"); - return NW_GTPV1U_FAILURE; - } - - ue_context_p->ue_context.handover_info->endmark_state = ENDMARK_NO_EMPTY; - return NW_GTPV1U_OK; - } - } - } - } - - result = pdcp_data_req( - &ctxt, - SRB_FLAG_NO, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA,NULL, NULL - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "PDCP data request failed\n"); - return NW_GTPV1U_FAILURE; - } - } else { - LOG_W(GTPU, "Received T-PDU from gtpv1u stack teid %u unknown size %u", teid, buffer_len); - } - } - break; - - default: { - LOG_E(GTPU, "Received undefined UlpApi (%02x) from gtpv1u stack!\n", - pUlpApi->apiType); - } - } // end of switch - - return NW_GTPV1U_OK; -} - - -//----------------------------------------------------------------------------- -int data_recv_callback(uint16_t portP, - uint32_t address, - uint8_t *buffer, - uint32_t length, - void *arg_p) { - gtpv1u_data_t *gtpv1u_data_p; - - if (arg_p == NULL) { - return -1; - } - - gtpv1u_data_p = (gtpv1u_data_t *)arg_p; - return nwGtpv1uProcessUdpReq(gtpv1u_data_p->gtpv1u_stack, - buffer, - length, - portP, - address); -} - -//int -//gtpv1u_create_tunnel_endpoint( -// gtpv1u_data_t *gtpv1u_data_pP, -// uint8_t ue_idP, -// uint8_t rab_idP, -// char *sgw_ip_addr_pP, -// uint16_t portP) -//{ -// uint32_t teid; -// uint8_t max_attempt = 100; -// NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; -// NwGtpv1uUlpApiT ulp_req; -// struct gtpv1u_ue_data_s *new_ue_p = NULL; -// struct gtpv1u_bearer_s *bearer_p = NULL; -// hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;; -// -// if (rab_idP > GTPV1U_MAX_BEARERS_PER_UE) { -// LOG_E(GTPU, "Could not use rab_id %d > max %d\n", -// rab_idP, GTPV1U_MAX_BEARERS_PER_UE); -// return -1; -// } -// -// -// if ((hash_rc = hashtable_get(gtpv1u_data_pP->ue_mapping, (uint64_t)ue_idP, (void**)&new_ue_p)) == HASH_TABLE_OK) { -// /* A context for this UE already exist in the tree, use it */ -// /* We check that the tunnel is not already configured */ -// if (new_ue_p->bearers[rab_idP].state != BEARER_DOWN) { -// LOG_E(GTPU, "Cannot create new end-point over already existing tunnel\n"); -// return -1; -// } -// } else { -// /* Context doesn't exist, create it */ -// if (rab_idP != 0) { -// /* UE should first establish Default bearer before trying to setup -// * additional bearers. -// */ -// LOG_E(GTPU, "UE context is not known and rab_id != 0\n"); -// return -1; -// } -// new_ue_p = calloc(1, sizeof(struct gtpv1u_ue_data_s)); -// new_ue_p->ue_id = ue_idP; -// -// hash_rc = hashtable_insert(gtpv1u_data_pP->ue_mapping, (uint64_t)ue_idP, new_ue_p); -// -// if ((hash_rc != HASH_TABLE_OK) && (hash_rc != HASH_TABLE_INSERT_OVERWRITTEN_DATA)) { -// LOG_E(GTPU, "Failed to insert new UE context\n"); -// free(new_ue_p); -// return -1; -// } -// } -// -// bearer_p = &new_ue_p->bearers[rab_idP]; -// -// /* Configure the bearer */ -// bearer_p->state = BEARER_IN_CONFIG; -// bearer_p->sgw_ip_addr = inet_addr(sgw_ip_addr_pP); -// bearer_p->port = portP; -// -// /* Create the new stack api request */ -// memset(&ulp_req, 0, sizeof(NwGtpv1uUlpApiT)); -// ulp_req.apiType = NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; -// -// /* Try to create new tunnel-endpoint. -// * If teid generated is already present in the stack, just peek another random -// * teid. This could be ok for small number of tunnel but more errors could be -// * thrown if we reached high number of tunnels. -// * TODO: find a solution for teid -// */ -// do { -// /* Request for a new random TEID */ -// teid = gtpv1u_new_teid(); -// ulp_req.apiInfo.createTunnelEndPointInfo.teid = teid; -// -// rc = nwGtpv1uProcessUlpReq(gtpv1u_data_pP->gtpv1u_stack, &ulp_req); -// -// if (rc == NW_GTPV1U_OK) { -//// LOG_D(GTPU, "Successfully created new tunnel endpoint for teid 0x%x\n", -//// teid); -// bearer_p->teid_eNB = teid; -//// gtpv1u_initial_req(gtpv1u_data_pP, teid, GTPV1U_UDP_PORT, -//// inet_addr("192.168.56.101")); -// LOG_I(GTPU, "Created eNB tunnel endpoint %u for ue id %u, rab id %u\n", teid, ue_idP, rab_idP); -// return 0; -// } else { -// LOG_W(GTPU, "Teid %u already in use... %s\n", -// teid, (max_attempt > 1) ? "Trying another one" : "Last chance"); -// } -// } while(max_attempt-- && rc != NW_GTPV1U_OK); -// -// bearer_p->state = BEARER_DOWN; -// LOG_I(GTPU, "Failed to created eNB tunnel endpoint %u for ue id %u, rab id %u, bearer down\n", teid, ue_idP, rab_idP); -// -// return -1; -//} - - -//----------------------------------------------------------------------------- -static NwGtpv1uRcT gtpv1u_start_timer_wrapper( - NwGtpv1uTimerMgrHandleT tmrMgrHandle, - uint32_t timeoutSec, - uint32_t timeoutUsec, - uint32_t tmrType, - void *timeoutArg, - NwGtpv1uTimerHandleT *hTmr) { - NwGtpv1uRcT rc = NW_GTPV1U_OK; - long timer_id; - - if (tmrType == NW_GTPV1U_TMR_TYPE_ONE_SHOT) { - timer_setup(timeoutSec, - timeoutUsec, - TASK_GTPV1_U, - INSTANCE_DEFAULT, - TIMER_ONE_SHOT, - timeoutArg, - &timer_id); - } else { - timer_setup(timeoutSec, - timeoutUsec, - TASK_GTPV1_U, - INSTANCE_DEFAULT, - TIMER_PERIODIC, - timeoutArg, - &timer_id); - } - - return rc; -} - - -//----------------------------------------------------------------------------- -static NwGtpv1uRcT -gtpv1u_stop_timer_wrapper( - NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NwGtpv1uTimerHandleT hTmr) { - NwGtpv1uRcT rc = NW_GTPV1U_OK; - return rc; -} - - -//----------------------------------------------------------------------------- -int -gtpv1u_initial_req( - gtpv1u_data_t *gtpv1u_data_pP, - teid_t teidP, - tcp_udp_port_t portP, - uint32_t address) { - NwGtpv1uUlpApiT ulp_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - memset(&ulp_req, 0, sizeof(NwGtpv1uUlpApiT)); - ulp_req.apiType = NW_GTPV1U_ULP_API_INITIAL_REQ; - ulp_req.apiInfo.initialReqInfo.teid = teidP; - ulp_req.apiInfo.initialReqInfo.peerPort = portP; - ulp_req.apiInfo.initialReqInfo.peerIp = address; - rc = nwGtpv1uProcessUlpReq(gtpv1u_data_pP->gtpv1u_stack, &ulp_req); - - if (rc == NW_GTPV1U_OK) { - LOG_D(GTPU, "Successfully sent initial req for teid %u\n", teidP); - } else { - LOG_W(GTPU, "Could not send initial req for teid %u\n", teidP); - } - - return (rc == NW_GTPV1U_OK) ? 0 : -1; -} - -//----------------------------------------------------------------------------- -int -gtpv1u_new_data_req( - uint8_t enb_module_idP, - rnti_t ue_rntiP, - uint8_t rab_idP, - uint8_t *buffer_pP, - uint32_t buf_lenP, - uint32_t buf_offsetP -) { - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - struct gtpv1u_ue_data_s ue; - struct gtpv1u_ue_data_s *ue_inst_p = NULL; - struct gtpv1u_bearer_s *bearer_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;; - gtpv1u_data_t *gtpv1u_data_p = NULL; - memset(&ue, 0, sizeof(struct gtpv1u_ue_data_s)); - ue.ue_id = ue_rntiP; - AssertFatal(enb_module_idP >=0, "Bad parameter enb module id %u\n", enb_module_idP); - AssertFatal((rab_idP - GTPV1U_BEARER_OFFSET)< GTPV1U_MAX_BEARERS_ID, "Bad parameter rab id %u\n", rab_idP); - AssertFatal((rab_idP - GTPV1U_BEARER_OFFSET) >= 0, "Bad parameter rab id %u\n", rab_idP); - gtpv1u_data_p = RC.gtpv1u_data_g; - /* Check that UE context is present in ue map. */ - hash_rc = hashtable_get(gtpv1u_data_p->ue_mapping, (uint64_t)ue_rntiP, (void **)&ue_inst_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS ) { - LOG_E(GTPU, "[UE %d] Trying to send data on non-existing UE context\n", ue_rntiP); - return -1; - } - - bearer_p = &ue_inst_p->bearers[rab_idP - GTPV1U_BEARER_OFFSET]; - - /* Ensure the bearer in ready. - * TODO: handle the cases where the bearer is in HANDOVER state. - * In such case packets should be placed in FIFO. - */ - if (bearer_p->state != BEARER_UP) { - LOG_W(GTPU, "Trying to send data over bearer with state(%u) != BEARER_UP\n", - bearer_p->state); - //#warning LG: HACK WHILE WAITING FOR NAS, normally return -1 - - if (bearer_p->state != BEARER_IN_CONFIG) - return -1; - } - - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = bearer_p->teid_sgw; - stack_req.apiInfo.sendtoInfo.ipAddr = bearer_p->sgw_ip_addr; - LOG_D(GTPU, "TX TO TEID %u addr 0x%x\n",bearer_p->teid_sgw, bearer_p->sgw_ip_addr); - rc = nwGtpv1uGpduMsgNew(gtpv1u_data_p->gtpv1u_stack, - bearer_p->teid_sgw, - NW_FALSE, - gtpv1u_data_p->seq_num++, - buffer_pP, - buf_lenP, - buf_offsetP, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - return -1; - } - - rc = nwGtpv1uProcessUlpReq(gtpv1u_data_p->gtpv1u_stack, - &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - return -1; - } - - rc = nwGtpv1uMsgDelete(gtpv1u_data_p->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - return -1; - } - - LOG_D(GTPU, "%s() return code OK\n", __FUNCTION__); - return 0; -} - -//----------------------------------------------------------------------------- -int -gtpv1u_create_x2u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, - gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP -) { - /* Create a new nw-gtpv1-u stack req using API */ - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - /* Local tunnel end-point identifier */ - teid_t x2u_teid = 0; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i; - ebi_t eps_bearer_id = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_X2U_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u ebid %u enb-x2u teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->eps_bearer_id[0], - create_tunnel_req_pP->tenb_X2u_teid[0]); - create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; - create_tunnel_resp_pP->status = 0; - create_tunnel_resp_pP->num_tunnels = 0; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - eps_bearer_id = create_tunnel_req_pP->eps_bearer_id[i]; - LOG_D(GTPU, "Rx GTPV1U_ENB_CREATE_X2U_TUNNEL_REQ ue rnti %x eps bearer id %u\n", - create_tunnel_req_pP->rnti, eps_bearer_id); - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; - - do { - x2u_teid = gtpv1u_new_teid(); - LOG_D(GTPU, "gtpv1u_create_x2u_tunnel() 0x%x %u(dec)\n", x2u_teid, x2u_teid); - stack_req.apiInfo.createTunnelEndPointInfo.teid = x2u_teid; - stack_req.apiInfo.createTunnelEndPointInfo.hUlpSession = 0; - stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0; - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - } while (rc != NW_GTPV1U_OK); - - memcpy(&create_tunnel_resp_pP->enb_addr.buffer, - &RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, - sizeof (in_addr_t)); - LOG_D(GTPU, "gtpv1u_create_x2u_tunnel() end addr %d.%d.%d.%d\n", - create_tunnel_resp_pP->enb_addr.buffer[0], - create_tunnel_resp_pP->enb_addr.buffer[1], - create_tunnel_resp_pP->enb_addr.buffer[2], - create_tunnel_resp_pP->enb_addr.buffer[3]); - create_tunnel_resp_pP->enb_addr.length = sizeof (in_addr_t); - create_tunnel_resp_pP->eps_bearer_id[i] = eps_bearer_id; - create_tunnel_resp_pP->num_tunnels += 1; - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - create_tunnel_resp_pP->enb_X2u_teid[i] = x2u_teid; - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, x2u_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_teid_data_p = calloc (1, sizeof(gtpv1u_teid_data_t)); - gtpv1u_teid_data_p->enb_id = 0; // TO DO - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->eps_bearer_id = eps_bearer_id; - hash_rc = hashtable_insert(RC.gtpv1u_data_g->teid_mapping, x2u_teid, gtpv1u_teid_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting teid mapping in GTPV1U hashtable"); - } else { - create_tunnel_resp_pP->enb_X2u_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - } - - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - x2u_teid); - LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", - create_tunnel_req_pP->rnti, - create_tunnel_resp_pP->status); - return 0; -} - -//----------------------------------------------------------------------------- -int gtpv1u_delete_x2u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t *const req_pP, - int enbflag) { - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int erab_index = 0; - ebi_t eps_bearer_id = 0; - struct rrc_eNB_ue_context_s *ue_context_p = NULL; - ue_context_p = rrc_eNB_get_ue_context(RC.rrc[instanceP], req_pP->rnti); - - if(ue_context_p != NULL) { - /* in the source enb */ - if(enbflag == GTPV1U_SOURCE_ENB) { - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, req_pP->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_OK) { - for (erab_index = 0; erab_index < ue_context_p->ue_context.nb_x2u_e_rabs; erab_index++) { - eps_bearer_id = ue_context_p->ue_context.enb_gtp_x2u_ebi[erab_index]; - LOG_I(GTPU, "gtpv1u_delete_x2u_tunnel user rnti %x teNB X2U teid %u eps bearer id %ld\n", - req_pP->rnti, - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_teNB, - ue_context_p->ue_context.enb_gtp_x2u_ebi[erab_index]); - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_teNB = 0; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].tenb_ip_addr = 0; - //gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].tenb_ip6_addr = 0; - } - - ue_context_p->ue_context.nb_x2u_e_rabs = 0; - } - } - /* in the target enb */ - else { - for (erab_index = 0; erab_index < ue_context_p->ue_context.nb_x2u_e_rabs; erab_index++) { - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_remove(RC.gtpv1u_data_g->teid_mapping, ue_context_p->ue_context.enb_gtp_x2u_teid[erab_index]); - LOG_I(GTPU, "Removed user rnti %x , enb X2U teid %u\n", req_pP->rnti, ue_context_p->ue_context.enb_gtp_x2u_teid[erab_index]); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , enb X2U teid %u not found\n", req_pP->rnti, ue_context_p->ue_context.enb_gtp_x2u_teid[erab_index]); - } - } - - ue_context_p->ue_context.nb_x2u_e_rabs = 0; - } - } - - return 0; -} - -//----------------------------------------------------------------------------- -int -gtpv1u_create_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP, - gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP -) { - /* Create a new nw-gtpv1-u stack req using API */ - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - /* Local tunnel end-point identifier */ - teid_t s1u_teid = 0; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - //MessageDef *message_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i; - ebi_t eps_bearer_id = 0; - // int ipv4_addr = 0; - int ip_offset = 0; - in_addr_t in_addr; - int addrs_length_in_bytes= 0; - int loop_counter = 0; - int ret = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u ebid %u sgw-s1u teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->eps_bearer_id[0], - create_tunnel_req_pP->sgw_S1u_teid[0]); - create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; - create_tunnel_resp_pP->status = 0; - create_tunnel_resp_pP->num_tunnels = 0; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - ip_offset = 0; - loop_counter = 0; - eps_bearer_id = create_tunnel_req_pP->eps_bearer_id[i]; - LOG_D(GTPU, "Rx GTPV1U_ENB_CREATE_TUNNEL_REQ ue rnti %x eps bearer id %u\n", - create_tunnel_req_pP->rnti, eps_bearer_id); - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; - - do { - s1u_teid = gtpv1u_new_teid(); - LOG_I(GTPU, "gtpv1u_data_g %p\n", RC.gtpv1u_data_g); - LOG_I(GTPU, "gtpv1u_create_s1u_tunnel() 0x%x %u(dec)\n", s1u_teid, s1u_teid); - stack_req.apiInfo.createTunnelEndPointInfo.teid = s1u_teid; - stack_req.apiInfo.createTunnelEndPointInfo.hUlpSession = 0; - stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0; - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - loop_counter++; - } while (rc != NW_GTPV1U_OK && loop_counter < 10); - - if ( rc != NW_GTPV1U_OK && loop_counter == 10 ) { - LOG_E(GTPU,"NwGtpv1uCreateTunnelEndPoint failed 10 times,start next loop\n"); - ret = -1; - continue; - } - - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, (void **)>pv1u_ue_data_p); - - if ((hash_rc == HASH_TABLE_KEY_NOT_EXISTS) || (hash_rc == HASH_TABLE_OK)) { - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_ue_data_p = calloc (1, sizeof(gtpv1u_ue_data_t)); - hash_rc = hashtable_insert(RC.gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable"); - } - - gtpv1u_ue_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_ue_data_p->instance_id = 0; // TO DO - memcpy(&create_tunnel_resp_pP->enb_addr.buffer, - &RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, - sizeof (in_addr_t)); - - LOG_I(GTPU,"Configured GTPu address : %x\n",RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up); - create_tunnel_resp_pP->enb_addr.length = sizeof (in_addr_t); - addrs_length_in_bytes = create_tunnel_req_pP->sgw_addr[i].length / 8; - AssertFatal((addrs_length_in_bytes == 4) || - (addrs_length_in_bytes == 16) || - (addrs_length_in_bytes == 20), - "Bad transport layer address length %d (bits) %d (bytes)", - create_tunnel_req_pP->sgw_addr[i].length, addrs_length_in_bytes); - - if ((addrs_length_in_bytes == 4) || - (addrs_length_in_bytes == 20)) { - in_addr = *((in_addr_t *)create_tunnel_req_pP->sgw_addr[i].buffer); - ip_offset = 4; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].sgw_ip_addr = in_addr; - } - - if ((addrs_length_in_bytes == 16) || - (addrs_length_in_bytes == 20)) { - memcpy(gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].sgw_ip6_addr.s6_addr, - &create_tunnel_req_pP->sgw_addr[i].buffer[ip_offset], - 16); - } - - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].state = BEARER_IN_CONFIG; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_eNB = s1u_teid; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_eNB_stack_session = stack_req.apiInfo.createTunnelEndPointInfo.hStackSession; - gtpv1u_ue_data_p->bearers[eps_bearer_id - GTPV1U_BEARER_OFFSET].teid_sgw = create_tunnel_req_pP->sgw_S1u_teid[i]; - gtpv1u_ue_data_p->num_bearers++; - create_tunnel_resp_pP->enb_S1u_teid[i] = s1u_teid; - - LOG_I(GTPU,"Copied to create_tunnel_resp tunnel: index %d target gNB ip %d.%d.%d.%d length %d gtp teid %u\n", - i, - create_tunnel_resp_pP->enb_addr.buffer[0], - create_tunnel_resp_pP->enb_addr.buffer[1], - create_tunnel_resp_pP->enb_addr.buffer[2], - create_tunnel_resp_pP->enb_addr.buffer[3], - create_tunnel_resp_pP->enb_addr.length, - create_tunnel_resp_pP->enb_S1u_teid[i]); - } else { - create_tunnel_resp_pP->enb_S1u_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - - create_tunnel_resp_pP->eps_bearer_id[i] = eps_bearer_id; - create_tunnel_resp_pP->num_tunnels += 1; - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, s1u_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_teid_data_p = calloc (1, sizeof(gtpv1u_teid_data_t)); - gtpv1u_teid_data_p->enb_id = 0; // TO DO - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->eps_bearer_id = eps_bearer_id; - hash_rc = hashtable_insert(RC.gtpv1u_data_g->teid_mapping, s1u_teid, gtpv1u_teid_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting teid mapping in GTPV1U hashtable"); - } else { - create_tunnel_resp_pP->enb_S1u_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - } - - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - s1u_teid); - LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", - create_tunnel_req_pP->rnti, - create_tunnel_resp_pP->status); - //return 0; - return ret; -} - -int gtpv1u_update_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP, - const rnti_t prior_rnti -) { - /* Local tunnel end-point identifier */ - teid_t s1u_teid = 0; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - gtpv1u_ue_data_t *gtpv1u_ue_data_new_p = NULL; - //MessageDef *message_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i,j; - uint8_t bearers_num = 0,bearers_total = 0; - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, prior_rnti, (void **)>pv1u_ue_data_p); - - if(hash_rc != HASH_TABLE_OK) { - LOG_E(GTPU,"Error get ue_mapping(rnti=%x) from GTPV1U hashtable error\n", prior_rnti); - return -1; - } - - gtpv1u_ue_data_new_p = calloc (1, sizeof(gtpv1u_ue_data_t)); - memcpy(gtpv1u_ue_data_new_p,gtpv1u_ue_data_p,sizeof(gtpv1u_ue_data_t)); - gtpv1u_ue_data_new_p->ue_id = create_tunnel_req_pP->rnti; - hash_rc = hashtable_insert(RC.gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_new_p); - - //AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable"); - if ( hash_rc != HASH_TABLE_OK ) { - LOG_E(GTPU,"Failed to insert ue_mapping(rnti=%x) in GTPV1U hashtable\n",create_tunnel_req_pP->rnti); - return -1; - } else { - LOG_I(GTPU, "inserting ue_mapping(rnti=%x) in GTPV1U hashtable\n", - create_tunnel_req_pP->rnti); - } - - hash_rc = hashtable_remove(RC.gtpv1u_data_g->ue_mapping, prior_rnti); - LOG_I(GTPU, "hashtable_remove ue_mapping(rnti=%x) in GTPV1U hashtable\n", - prior_rnti); - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - bearers_total =gtpv1u_ue_data_new_p->num_bearers; - - for(j = 0; jbearers[j].state != BEARER_IN_CONFIG) - continue; - - bearers_num++; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - if(j == (create_tunnel_req_pP->eps_bearer_id[i]-GTPV1U_BEARER_OFFSET)) - break; - } - - if(i < create_tunnel_req_pP->num_tunnels) { - s1u_teid = gtpv1u_ue_data_new_p->bearers[j].teid_eNB; - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, s1u_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->eps_bearer_id = create_tunnel_req_pP->eps_bearer_id[i]; - LOG_I(GTPU, "updata teid_mapping te_id %u (prior_rnti %x rnti %x) in GTPV1U hashtable\n", - s1u_teid,prior_rnti,create_tunnel_req_pP->rnti); - } else { - LOG_W(GTPU, "Error get teid mapping(s1u_teid=%u) from GTPV1U hashtable", s1u_teid); - } - } else { - s1u_teid = gtpv1u_ue_data_new_p->bearers[j].teid_eNB; - hash_rc = hashtable_remove(RC.gtpv1u_data_g->teid_mapping, s1u_teid); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , enb S1U teid %u not found\n", prior_rnti, s1u_teid); - } - - gtpv1u_ue_data_new_p->bearers[j].state = BEARER_DOWN; - gtpv1u_ue_data_new_p->num_bearers--; - LOG_I(GTPU, "delete teid_mapping te_id %u (rnti%x) bearer_id %d in GTPV1U hashtable\n", - s1u_teid,prior_rnti,j+GTPV1U_BEARER_OFFSET);; - } - - if(bearers_num > bearers_total) - break; - } - - return 0; -} - -//----------------------------------------------------------------------------- -int gtpv1u_delete_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - MessageDef *message_p = NULL; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - teid_t teid_eNB = 0; - int erab_index = 0; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_ENB_DELETE_TUNNEL_RESP); - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti = req_pP->rnti; - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status = 0; - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, req_pP->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_OK) { - for (erab_index = 0; erab_index < req_pP->num_erab; erab_index++) { - teid_eNB = gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].teid_eNB; - LOG_D(GTPU, "Rx GTPV1U_ENB_DELETE_TUNNEL user rnti %x eNB S1U teid %u eps bearer id %u\n", - req_pP->rnti, teid_eNB, req_pP->eps_bearer_id[erab_index]); - { - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT; - LOG_D(GTPU, "gtpv1u_delete_s1u_tunnel erab %u %u\n", - req_pP->eps_bearer_id[erab_index], - teid_eNB); - stack_req.apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle = gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].teid_eNB_stack_session; - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - } - - if (rc != NW_GTPV1U_OK) { - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status |= 0xFF; - LOG_E(GTPU, "NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT failed"); - } - - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].state = BEARER_DOWN; - gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].teid_eNB = 0; - gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].teid_sgw = 0; - gtpv1u_ue_data_p->bearers[req_pP->eps_bearer_id[erab_index] - GTPV1U_BEARER_OFFSET].sgw_ip_addr = 0; - gtpv1u_ue_data_p->num_bearers -= 1; - - if (gtpv1u_ue_data_p->num_bearers == 0) { - hash_rc = hashtable_remove(RC.gtpv1u_data_g->ue_mapping, req_pP->rnti); - LOG_D(GTPU, "Removed user rnti %x,no more bearers configured\n", req_pP->rnti); - } - - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_remove(RC.gtpv1u_data_g->teid_mapping, teid_eNB); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , enb S1U teid %u not found\n", req_pP->rnti, teid_eNB); - } - } - }// else silently do nothing - - LOG_D(GTPU, "Tx GTPV1U_ENB_DELETE_TUNNEL_RESP user rnti %x eNB S1U teid %u status %u\n", - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti, - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).enb_S1u_teid, - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_DELETE_TUNNEL_RESP rnti %x teid %x", - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti, - teid_eNB); - if (req_pP->from_gnb) - return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p); - else - return itti_send_msg_to_task(TASK_RRC_ENB, instanceP, message_p); -} - - -//----------------------------------------------------------------------------- -int gtpv1u_eNB_init(void) { - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uLogMgrEntityT log; - NwGtpv1uTimerMgrEntityT tmr; - // enb_properties_p = enb_config_get()->properties[0]; - RC.gtpv1u_data_g = (gtpv1u_data_t *)calloc(sizeof(gtpv1u_data_t),1); - LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.gtpv1u_data_g); - //gtpv1u_data_g.gtpv1u_stack; - /* Initialize UE hashtable */ - RC.gtpv1u_data_g->ue_mapping = hashtable_create (32, NULL, NULL); - AssertFatal(RC.gtpv1u_data_g->ue_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create returned %p\n", RC.gtpv1u_data_g->ue_mapping); - RC.gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL); - AssertFatal(RC.gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n"); - // RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U; - //gtpv1u_data_g.udp_data; - RC.gtpv1u_data_g->seq_num = 0; - RC.gtpv1u_data_g->restart_counter = 0; - RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up = 0; - /* Initializing GTPv1-U stack */ - if ((rc = nwGtpv1uInitialize(&RC.gtpv1u_data_g->gtpv1u_stack, GTPU_STACK_ENB)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup nwGtpv1u stack %x\n", rc); - return -1; - } - - if ((rc = nwGtpv1uSetLogLevel(RC.gtpv1u_data_g->gtpv1u_stack, - NW_LOG_LEVEL_DEBG)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup loglevel for stack %x\n", rc); - return -1; - } - - /* Set the ULP API callback. Called once message have been processed by the - * nw-gtpv1u stack. - */ - ulp.ulpReqCallback = gtpv1u_eNB_process_stack_req; - memset((void *)&(ulp.hUlp), 0, sizeof(NwGtpv1uUlpHandleT)); - - if ((rc = nwGtpv1uSetUlpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &ulp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUlpEntity: %x", rc); - return -1; - } - - /* nw-gtpv1u stack requires an udp callback to send data over UDP. - * We provide a wrapper to UDP task. - */ - udp.udpDataReqCallback = gtpv1u_eNB_send_udp_msg; - memset((void *)&(udp.hUdp), 0, sizeof(NwGtpv1uUdpHandleT)); - - if ((rc = nwGtpv1uSetUdpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &udp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUdpEntity: %x", rc); - return -1; - } - - log.logReqCallback = gtpv1u_eNB_log_request; - memset((void *)&(log.logMgrHandle), 0, sizeof(NwGtpv1uLogMgrHandleT)); - - if ((rc = nwGtpv1uSetLogMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &log)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetLogMgrEntity: %x", rc); - return -1; - } - - /* Timer interface is more complicated as both wrappers doesn't send a message - * to the timer task but call the timer API functions start/stop timer. - */ - tmr.tmrMgrHandle = 0; - tmr.tmrStartCallback = gtpv1u_start_timer_wrapper; - tmr.tmrStopCallback = gtpv1u_stop_timer_wrapper; - - if ((rc = nwGtpv1uSetTimerMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &tmr)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetTimerMgrEntity: %x", rc); - return -1; - } - -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - - if ((ret = gtpv1u_eNB_create_dump_socket()) < 0) { - return -1; - } - -#endif - LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n"); - return 0; -} - -//----------------------------------------------------------------------------- -void *gtpv1u_eNB_process_itti_msg(void *notUsed) { - /* Trying to fetch a message from the message queue. - * If the queue is empty, this function will block till a - * message is sent to the task. - */ - instance_t instance; - MessageDef *received_message_p = NULL; - int rc = 0; - itti_receive_msg(TASK_GTPV1_U, &received_message_p); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_IN); - DevAssert(received_message_p != NULL); - instance = ITTI_MSG_DESTINATION_INSTANCE(received_message_p); - //msg_name_p = ITTI_MSG_NAME(received_message_p); - - switch (ITTI_MSG_ID(received_message_p)) { - case GTPV1U_ENB_S1_REQ: - gtpv1u_s1_req(instance, &received_message_p->ittiMsg.gtpv1uS1Req); - - case GTPV1U_ENB_DELETE_TUNNEL_REQ: { - gtpv1u_delete_s1u_tunnel(instance, &received_message_p->ittiMsg.Gtpv1uDeleteTunnelReq); - } - break; - - // DATA COMING FROM UDP - case UDP_DATA_IND: { - udp_data_ind_t *udp_data_ind_p; - udp_data_ind_p = &received_message_p->ittiMsg.udp_data_ind; - nwGtpv1uProcessUdpReq(RC.gtpv1u_data_g->gtpv1u_stack, - udp_data_ind_p->buffer, - udp_data_ind_p->buffer_length, - udp_data_ind_p->peer_port, - udp_data_ind_p->peer_address); - //itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), udp_data_ind_p->buffer); - } - break; - - // DATA TO BE SENT TO UDP - case GTPV1U_ENB_TUNNEL_DATA_REQ: { - gtpv1u_enb_tunnel_data_req_t *data_req_p = NULL; - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - teid_t enb_s1u_teid = 0; - teid_t sgw_s1u_teid = 0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_IN); - data_req_p = >PV1U_ENB_TUNNEL_DATA_REQ(received_message_p); - //ipv4_send_data(ipv4_data_p->sd, data_ind_p->buffer, data_ind_p->length); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(&data_req_p->buffer[data_req_p->offset],data_req_p->length); -#endif - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, (uint64_t)data_req_p->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); - } else { - if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id < max_val_LTE_DRB_Identity)) { - enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; - sgw_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_sgw; - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = sgw_s1u_teid; - stack_req.apiInfo.sendtoInfo.ipAddr = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].sgw_ip_addr; - rc = nwGtpv1uGpduMsgNew( - RC.gtpv1u_data_g->gtpv1u_stack, - sgw_s1u_teid, - NW_FALSE, - RC.gtpv1u_data_g->seq_num++, - data_req_p->buffer, - data_req_p->length, - data_req_p->offset, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,sgw_s1u_teid,data_req_p->length); - (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ - } else { - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,sgw_s1u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - sgw_s1u_teid, - data_req_p->length); - } - - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_OUT); - /* Buffer still needed, do not free it */ - //itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), data_req_p->buffer); - } - break; - - case GTPV1U_ENB_DATA_FORWARDING_REQ: { - gtpv1u_enb_data_forwarding_req_t *data_req_p = NULL; - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - teid_t enb_s1u_teid = 0; - teid_t tenb_x2u_teid = 0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_IN); - data_req_p = >PV1U_ENB_DATA_FORWARDING_REQ(received_message_p); - //ipv4_send_data(ipv4_data_p->sd, data_ind_p->buffer, data_ind_p->length); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(&data_req_p->buffer[data_req_p->offset],data_req_p->length); -#endif - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, (uint64_t)data_req_p->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); - } else { - if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id <= max_val_LTE_DRB_Identity)) { - enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; - tenb_x2u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_teNB; // target enb teid - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = tenb_x2u_teid; - stack_req.apiInfo.sendtoInfo.ipAddr = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].tenb_ip_addr;// target enb ip - rc = nwGtpv1uGpduMsgNew( - RC.gtpv1u_data_g->gtpv1u_stack, - tenb_x2u_teid, - NW_FALSE, - RC.gtpv1u_data_g->seq_num++, - data_req_p->buffer, - data_req_p->length, - data_req_p->offset, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ - } else { - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - tenb_x2u_teid, - data_req_p->length); - } - - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_OUT); - /* Buffer still needed, do not free it */ - //itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), data_req_p->buffer) - } - break; - - case GTPV1U_ENB_END_MARKER_REQ: { - gtpv1u_enb_end_marker_req_t *data_req_p = NULL; - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - teid_t enb_s1u_teid = 0; - teid_t tenb_x2u_teid = 0; - NwGtpv1uMsgT *pMsg = NULL; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_IN); - data_req_p = >PV1U_ENB_END_MARKER_REQ(received_message_p); - //ipv4_send_data(ipv4_data_p->sd, data_ind_p->buffer, data_ind_p->length); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(&data_req_p->buffer[data_req_p->offset],data_req_p->length); -#endif - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - hash_rc = hashtable_get(RC.gtpv1u_data_g->ue_mapping, (uint64_t)data_req_p->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); - } else { - if ((data_req_p->rab_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->rab_id <= max_val_LTE_DRB_Identity)) { - enb_s1u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_eNB; - tenb_x2u_teid = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].teid_teNB; // target enb teid - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = tenb_x2u_teid; - stack_req.apiInfo.sendtoInfo.ipAddr = gtpv1u_ue_data_p->bearers[data_req_p->rab_id - GTPV1U_BEARER_OFFSET].tenb_ip_addr;// target enb ip - rc = nwGtpv1uGpduMsgNew( - RC.gtpv1u_data_g->gtpv1u_stack, - tenb_x2u_teid, - NW_FALSE, - RC.gtpv1u_data_g->seq_num++, - data_req_p->buffer, - data_req_p->length, - data_req_p->offset, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ - } else { - pMsg = (NwGtpv1uMsgT *) stack_req.apiInfo.sendtoInfo.hMsg; - pMsg->msgType = NW_GTP_END_MARKER; - rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - tenb_x2u_teid, - data_req_p->length); - } - - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - - gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req; - memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req)); - delete_tunnel_req.rnti = data_req_p->rnti; - gtpv1u_delete_x2u_tunnel(instance, &delete_tunnel_req, GTPV1U_SOURCE_ENB); - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_OUT); - } - break; - - case TERMINATE_MESSAGE: { - if (RC.gtpv1u_data_g->ue_mapping != NULL) { - hashtable_destroy (&(RC.gtpv1u_data_g->ue_mapping)); - } - - if (RC.gtpv1u_data_g->teid_mapping != NULL) { - hashtable_destroy (&(RC.gtpv1u_data_g->teid_mapping)); - } - - LOG_W(GTPU, " *** Exiting GTPU thread\n"); - itti_exit_task(); - } - break; - - case TIMER_HAS_EXPIRED: - nwGtpv1uProcessTimeout(&received_message_p->ittiMsg.timer_has_expired.arg); - break; - - default: { - LOG_E(GTPU, "Unkwnon message ID %d:%s\n", - ITTI_MSG_ID(received_message_p), - ITTI_MSG_NAME(received_message_p)); - } - break; - } - - rc = itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p); - AssertFatal(rc == EXIT_SUCCESS, "Failed to free memory (%d)!\n", rc); - received_message_p = NULL; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_OUT); - return NULL; -} - -//----------------------------------------------------------------------------- -void *gtpv1u_eNB_task(void *args) { - int rc = 0; - rc = gtpv1u_eNB_init(); - AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); - itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); - - while(1) { - (void) gtpv1u_eNB_process_itti_msg (NULL); - } - - return NULL; -} - diff --git a/openair3/GTPV1-U/gtpv1u_eNB_task.h b/openair3/GTPV1-U/gtpv1u_eNB_task.h deleted file mode 100644 index a6e2625941..0000000000 --- a/openair3/GTPV1-U/gtpv1u_eNB_task.h +++ /dev/null @@ -1,69 +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 gtpv1u_eNB_task.h -* \brief -* \author Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ - -#ifndef GTPV1U_ENB_TASK_H_ -#define GTPV1U_ENB_TASK_H_ - - -/* -int -gtpv1u_new_data_req( - uint8_t enb_id, - uint8_t ue_id, - uint8_t rab_id, - uint8_t *buffer, - uint32_t buf_len, - uint32_t buf_offset);*/ - -int gtpv1u_eNB_init(void); -void *gtpv1u_eNB_process_itti_msg(void*); -void *gtpv1u_eNB_task(void *args); - -int -gtpv1u_create_x2u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_x2u_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_enb_create_x2u_tunnel_resp_t * const create_tunnel_resp_pP); - -int -gtpv1u_create_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP); - -int -gtpv1u_update_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, - const rnti_t prior_rnti); - -int gtpv1u_delete_x2u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t * const req_pP, - int enbflag); -#endif /* GTPV1U_ENB_TASK_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_gNB.c b/openair3/GTPV1-U/gtpv1u_gNB.c deleted file mode 100644 index ff7c8c0604..0000000000 --- a/openair3/GTPV1-U/gtpv1u_gNB.c +++ /dev/null @@ -1,1012 +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 gtpv1u_gNB.c - * \brief - * \author Sebastien ROUX, Lionel GAUTHIER, Navid Nikaein, Panos MATZAKOS - * \version 1.0 - * \company Eurecom - * \email: lionel.gauthier@eurecom.fr - */ -#include -#include - -#include "mme_config.h" -#include "intertask_interface.h" -#include "msc.h" - -#include "gtpv1u.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1uPrivate.h" -#include "NwLog.h" -#include "gtpv1u_eNB_defs.h" -#include "gtpv1u_gNB_defs.h" -#include "gtpv1_u_messages_types.h" -#include "udp_eNB_task.h" -#include "common/utils/LOG/log.h" -#include "COMMON/platform_types.h" -#include "COMMON/platform_constants.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#include "common/ran_context.h" -#include "gtpv1u_eNB_task.h" -#include "gtpv1u_gNB_task.h" -#include "rrc_eNB_GTPV1U.h" - -#undef GTP_DUMP_SOCKET - -#undef GTPV1U_BEARER_OFFSET -#define GTPV1U_BEARER_OFFSET 1 - -extern unsigned char NB_eNB_INST; - -extern RAN_CONTEXT_t RC; - -extern NwGtpv1uRcT gtpv1u_eNB_send_udp_msg( - NwGtpv1uUdpHandleT udpHandle, - uint8_t *buffer, - uint32_t buffer_len, - uint32_t buffer_offset, - uint32_t peerIpAddr, - uint16_t peerPort); - -extern NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr, - uint32_t logLevel, - NwCharT *file, - uint32_t line, - NwCharT *logStr); - -static NwGtpv1uRcT gtpv1u_start_timer_wrapper( - NwGtpv1uTimerMgrHandleT tmrMgrHandle, - uint32_t timeoutSec, - uint32_t timeoutUsec, - uint32_t tmrType, - void *timeoutArg, - NwGtpv1uTimerHandleT *hTmr) { - NwGtpv1uRcT rc = NW_GTPV1U_OK; - long timer_id; - - if (tmrType == NW_GTPV1U_TMR_TYPE_ONE_SHOT) { - timer_setup(timeoutSec, - timeoutUsec, - TASK_GTPV1_U, - INSTANCE_DEFAULT, - TIMER_ONE_SHOT, - timeoutArg, - &timer_id); - } else { - timer_setup(timeoutSec, - timeoutUsec, - TASK_GTPV1_U, - INSTANCE_DEFAULT, - TIMER_PERIODIC, - timeoutArg, - &timer_id); - } - - return rc; -} - - -static NwGtpv1uRcT -gtpv1u_stop_timer_wrapper( - NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NwGtpv1uTimerHandleT hTmr) { - NwGtpv1uRcT rc = NW_GTPV1U_OK; - return rc; -} - -/* Callback called when a gtpv1u message arrived on UDP interface */ -NwGtpv1uRcT gtpv1u_gNB_process_stack_req( - NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi) { - boolean_t result = FALSE; - teid_t teid = 0; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - protocol_ctxt_t ctxt; - NwGtpv1uRcT rc; - - switch(pUlpApi->apiType) { - /* Here there are two type of messages handled: - * - T-PDU - * - END-MARKER - */ - case NW_GTPV1U_ULP_API_RECV_TPDU: { - uint8_t buffer[4096]; - uint32_t buffer_len; - //uint16_t msgType = NW_GTP_GPDU; - //NwGtpv1uMsgT *pMsg = NULL; - /* Nw-gptv1u stack has processed a PDU. we can schedule it to PDCP - * for transmission. - */ - teid = pUlpApi->apiInfo.recvMsgInfo.teid; - //pMsg = (NwGtpv1uMsgT *) pUlpApi->apiInfo.recvMsgInfo.hMsg; - //msgType = pMsg->msgType; - - if (NW_GTPV1U_OK != nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, - buffer, &buffer_len)) { - LOG_E(GTPU, "Error while retrieving T-PDU"); - } - - itti_free(TASK_UDP, ((NwGtpv1uMsgT *)pUlpApi->apiInfo.recvMsgInfo.hMsg)->msgBuf); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(buffer,buffer_len); -#endif - rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, - pUlpApi->apiInfo.recvMsgInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - - hash_rc = hashtable_get(RC.gtpv1u_data_g->teid_mapping, teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { -#if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_D(GTPU, "Received T-PDU from gtpv1u stack teid %u size %d -> enb module id %u ue module id %u rab id %u\n", - teid, - buffer_len, - gtpv1u_teid_data_p->enb_id, - gtpv1u_teid_data_p->ue_id, - gtpv1u_teid_data_p->eps_bearer_id); -#endif - //warning "LG eps bearer mapping to DRB id to do (offset -4)" - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_PDCP_ENB, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - 0,0, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - buffer_len); - - result = pdcp_data_req( - &ctxt, - SRB_FLAG_NO, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA,NULL, NULL - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "PDCP data request failed\n"); - - return NW_GTPV1U_FAILURE; - } - } else { - LOG_W(GTPU, "Received T-PDU from gtpv1u stack teid %u unknown size %u", teid, buffer_len); - } - } - break; - - default: { - LOG_E(GTPU, "Received undefined UlpApi (%02x) from gtpv1u stack!\n", - pUlpApi->apiType); - } - } // end of switch - - return NW_GTPV1U_OK; -} - -int gtpv1u_gNB_init(void) { - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uLogMgrEntityT log; - NwGtpv1uTimerMgrEntityT tmr; - // enb_properties_p = enb_config_get()->properties[0]; - RC.gtpv1u_data_g = (gtpv1u_data_t *)calloc(sizeof(gtpv1u_data_t),1); - LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.gtpv1u_data_g); - //gtpv1u_data_g.gtpv1u_stack; - /* Initialize UE hashtable */ - RC.gtpv1u_data_g->ue_mapping = hashtable_create (32, NULL, NULL); - AssertFatal(RC.gtpv1u_data_g->ue_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create returned %p\n", RC.gtpv1u_data_g->ue_mapping); - RC.gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL); - AssertFatal(RC.gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n"); - // RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U; - //gtpv1u_data_g.udp_data; - RC.gtpv1u_data_g->seq_num = 0; - RC.gtpv1u_data_g->restart_counter = 0; - - /* Initializing GTPv1-U stack */ - if ((rc = nwGtpv1uInitialize(&RC.gtpv1u_data_g->gtpv1u_stack, GTPU_STACK_ENB)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup nwGtpv1u stack %x\n", rc); - return -1; - } - - if ((rc = nwGtpv1uSetLogLevel(RC.gtpv1u_data_g->gtpv1u_stack, - NW_LOG_LEVEL_DEBG)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup loglevel for stack %x\n", rc); - return -1; - } - - /* Set the ULP API callback. Called once message have been processed by the - * nw-gtpv1u stack. - */ - ulp.ulpReqCallback = gtpv1u_gNB_process_stack_req; - memset((void *)&(ulp.hUlp), 0, sizeof(NwGtpv1uUlpHandleT)); - - if ((rc = nwGtpv1uSetUlpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &ulp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUlpEntity: %x", rc); - return -1; - } - - /* nw-gtpv1u stack requires an udp callback to send data over UDP. - * We provide a wrapper to UDP task. - */ - udp.udpDataReqCallback = gtpv1u_eNB_send_udp_msg; - memset((void *)&(udp.hUdp), 0, sizeof(NwGtpv1uUdpHandleT)); - - if ((rc = nwGtpv1uSetUdpEntity(RC.gtpv1u_data_g->gtpv1u_stack, &udp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUdpEntity: %x", rc); - return -1; - } - - log.logReqCallback = gtpv1u_eNB_log_request; - memset((void *)&(log.logMgrHandle), 0, sizeof(NwGtpv1uLogMgrHandleT)); - - if ((rc = nwGtpv1uSetLogMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &log)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetLogMgrEntity: %x", rc); - return -1; - } - - /* Timer interface is more complicated as both wrappers doesn't send a message - * to the timer task but call the timer API functions start/stop timer. - */ - tmr.tmrMgrHandle = 0; - tmr.tmrStartCallback = gtpv1u_start_timer_wrapper; - tmr.tmrStopCallback = gtpv1u_stop_timer_wrapper; - - if ((rc = nwGtpv1uSetTimerMgrEntity(RC.gtpv1u_data_g->gtpv1u_stack, &tmr)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetTimerMgrEntity: %x", rc); - return -1; - } - -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - - if ((ret = gtpv1u_eNB_create_dump_socket()) < 0) { - return -1; - } - -#endif - LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n"); - return 0; -} - -void *gtpv1u_gNB_task(void *args) { - int rc = 0; - rc = gtpv1u_gNB_init(); - AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); - itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); - - while(1) { - (void) gtpv1u_eNB_process_itti_msg (NULL); - } - - return NULL; -} - -/* Callback called when a gtpv1u message arrived on UDP interface */ -NwGtpv1uRcT nr_gtpv1u_gNB_process_stack_req( - NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi) { - boolean_t result = FALSE; - teid_t teid = 0; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - nr_gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - protocol_ctxt_t ctxt; - NwGtpv1uRcT rc; - - switch(pUlpApi->apiType) { - /* Here there are two type of messages handled: - * - T-PDU - * - END-MARKER - */ - case NW_GTPV1U_ULP_API_RECV_TPDU: { - uint8_t buffer[4096]; - uint32_t buffer_len; - //uint16_t msgType = NW_GTP_GPDU; - //NwGtpv1uMsgT *pMsg = NULL; - /* Nw-gptv1u stack has processed a PDU. we can schedule it to PDCP - * for transmission. - */ - teid = pUlpApi->apiInfo.recvMsgInfo.teid; - //pMsg = (NwGtpv1uMsgT *) pUlpApi->apiInfo.recvMsgInfo.hMsg; - //msgType = pMsg->msgType; - - if (NW_GTPV1U_OK != nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, - buffer, &buffer_len)) { - LOG_E(GTPU, "Error while retrieving T-PDU"); - } - - itti_free(TASK_UDP, ((NwGtpv1uMsgT *)pUlpApi->apiInfo.recvMsgInfo.hMsg)->msgBuf); -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - gtpv1u_eNB_write_dump_socket(buffer,buffer_len); -#endif - rc = nwGtpv1uMsgDelete(RC.nr_gtpv1u_data_g->gtpv1u_stack, - pUlpApi->apiInfo.recvMsgInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->teid_mapping, teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { -// #if defined(LOG_GTPU) && LOG_GTPU > 0 - LOG_D(GTPU, "Received T-PDU from gtpv1u stack teid %u size %d -> gnb module id %u ue module id %u pdu session id %u\n", - teid, - buffer_len, - gtpv1u_teid_data_p->gnb_id, - gtpv1u_teid_data_p->ue_id, - gtpv1u_teid_data_p->pdu_session_id); -// #endif - //warning "LG eps bearer mapping to DRB id to do (offset -4)" - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->gnb_id, GNB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->gnb_id); - // MSC_LOG_TX_MESSAGE( - // MSC_GTPU_ENB, - // MSC_PDCP_ENB, - // NULL,0, - // MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - // 0,0, - // (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - // buffer_len); - - result = pdcp_data_req( - &ctxt, - SRB_FLAG_NO, - 1, - 0, // mui - SDU_CONFIRM_NO, // confirm - buffer_len, - buffer, - PDCP_TRANSMISSION_MODE_DATA,NULL, NULL - ); - - if ( result == FALSE ) { - LOG_W(GTPU, "PDCP data request failed\n"); - - return NW_GTPV1U_FAILURE; - } - } else { - LOG_W(GTPU, "Received T-PDU from gtpv1u stack teid %u unknown size %u", teid, buffer_len); - } - } - break; - - default: { - LOG_E(GTPU, "Received undefined UlpApi (%02x) from gtpv1u stack!\n", - pUlpApi->apiType); - } - } // end of switch - - return NW_GTPV1U_OK; -} - -int nr_gtpv1u_gNB_init(void) { - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uLogMgrEntityT log; - NwGtpv1uTimerMgrEntityT tmr; - // enb_properties_p = enb_config_get()->properties[0]; - RC.nr_gtpv1u_data_g = (nr_gtpv1u_data_t *)calloc(sizeof(nr_gtpv1u_data_t),1); - LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.nr_gtpv1u_data_g); - - /* Initialize UE hashtable */ - RC.nr_gtpv1u_data_g->ue_mapping = hashtable_create (32, NULL, NULL); - AssertFatal(RC.nr_gtpv1u_data_g->ue_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create returned %p\n", RC.gtpv1u_data_g->ue_mapping); - RC.nr_gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL); - AssertFatal(RC.nr_gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n"); - // RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U; - //gtpv1u_data_g.udp_data; - RC.nr_gtpv1u_data_g->seq_num = 0; - RC.nr_gtpv1u_data_g->restart_counter = 0; - - /* Initializing GTPv1-U stack */ - if ((rc = nwGtpv1uInitialize(&RC.nr_gtpv1u_data_g->gtpv1u_stack, GTPU_STACK_ENB)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup nwGtpv1u stack %x\n", rc); - return -1; - } - - if ((rc = nwGtpv1uSetLogLevel(RC.nr_gtpv1u_data_g->gtpv1u_stack, - NW_LOG_LEVEL_DEBG)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "Failed to setup loglevel for stack %x\n", rc); - return -1; - } - - /* Set the ULP API callback. Called once message have been processed by the - * nw-gtpv1u stack. - */ - ulp.ulpReqCallback = nr_gtpv1u_gNB_process_stack_req; - memset((void *)&(ulp.hUlp), 0, sizeof(NwGtpv1uUlpHandleT)); - - if ((rc = nwGtpv1uSetUlpEntity(RC.nr_gtpv1u_data_g->gtpv1u_stack, &ulp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUlpEntity: %x", rc); - return -1; - } - - /* nw-gtpv1u stack requires an udp callback to send data over UDP. - * We provide a wrapper to UDP task. - */ - udp.udpDataReqCallback = gtpv1u_eNB_send_udp_msg; - memset((void *)&(udp.hUdp), 0, sizeof(NwGtpv1uUdpHandleT)); - - if ((rc = nwGtpv1uSetUdpEntity(RC.nr_gtpv1u_data_g->gtpv1u_stack, &udp)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetUdpEntity: %x", rc); - return -1; - } - - log.logReqCallback = gtpv1u_eNB_log_request; - memset((void *)&(log.logMgrHandle), 0, sizeof(NwGtpv1uLogMgrHandleT)); - - if ((rc = nwGtpv1uSetLogMgrEntity(RC.nr_gtpv1u_data_g->gtpv1u_stack, &log)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetLogMgrEntity: %x", rc); - return -1; - } - - /* Timer interface is more complicated as both wrappers doesn't send a message - * to the timer task but call the timer API functions start/stop timer. - */ - tmr.tmrMgrHandle = 0; - tmr.tmrStartCallback = gtpv1u_start_timer_wrapper; - tmr.tmrStopCallback = gtpv1u_stop_timer_wrapper; - - if ((rc = nwGtpv1uSetTimerMgrEntity(RC.nr_gtpv1u_data_g->gtpv1u_stack, &tmr)) != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uSetTimerMgrEntity: %x", rc); - return -1; - } - -#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0 - - if ((ret = gtpv1u_eNB_create_dump_socket()) < 0) { - return -1; - } - -#endif - LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n"); - return 0; -} - -//----------------------------------------------------------------------------- -int -gtpv1u_create_ngu_tunnel( - const instance_t instanceP, - const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP, - gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp_pP) -{ - /* Create a new nw-gtpv1-u stack req using API */ - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - /* Local tunnel end-point identifier */ - teid_t ngu_teid = 0; - nr_gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - //MessageDef *message_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i; - pdusessionid_t pdusession_id = 0; - // int ipv4_addr = 0; - int ip_offset = 0; - in_addr_t in_addr; - int addrs_length_in_bytes= 0; - int loop_counter = 0; - int ret = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u psid %u upf-ngu teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->pdusession_id[0], - create_tunnel_req_pP->outgoing_teid[0]); - create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; - create_tunnel_resp_pP->status = 0; - create_tunnel_resp_pP->num_tunnels = 0; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - ip_offset = 0; - loop_counter = 0; - pdusession_id = create_tunnel_req_pP->pdusession_id[i]; - LOG_D(GTPU, "Rx GTPV1U_GNB_CREATE_TUNNEL_REQ ue rnti %x pdu session id %u\n", - create_tunnel_req_pP->rnti, pdusession_id); - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; - - do { - ngu_teid = gtpv1u_new_teid(); - LOG_D(GTPU, "gtpv1u_create_ngu_tunnel() 0x%x %u(dec)\n", ngu_teid, ngu_teid); - stack_req.apiInfo.createTunnelEndPointInfo.teid = ngu_teid; - stack_req.apiInfo.createTunnelEndPointInfo.hUlpSession = 0; - stack_req.apiInfo.createTunnelEndPointInfo.hStackSession = 0; - rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - loop_counter++; - } while (rc != NW_GTPV1U_OK && loop_counter < 10); - - if ( rc != NW_GTPV1U_OK && loop_counter == 10 ) { - LOG_E(GTPU,"NwGtpv1uCreateTunnelEndPoint failed 10 times,start next loop\n"); - ret = -1; - continue; - } - - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, (void **)>pv1u_ue_data_p); - - if ((hash_rc == HASH_TABLE_KEY_NOT_EXISTS) || (hash_rc == HASH_TABLE_OK)) { - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_ue_data_p = calloc (1, sizeof(gtpv1u_ue_data_t)); - hash_rc = hashtable_insert(RC.nr_gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable"); - } - - gtpv1u_ue_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_ue_data_p->instance_id = 0; // TO DO - memcpy(&create_tunnel_resp_pP->gnb_addr.buffer, - &RC.nr_gtpv1u_data_g->gnb_ip_address_for_NGu_up, - sizeof (in_addr_t)); - - LOG_I(GTPU,"Configured GTPu address : %x\n",RC.nr_gtpv1u_data_g->gnb_ip_address_for_NGu_up); - create_tunnel_resp_pP->gnb_addr.length = sizeof (in_addr_t); - addrs_length_in_bytes = create_tunnel_req_pP->dst_addr[i].length / 8; - AssertFatal((addrs_length_in_bytes == 4) || - (addrs_length_in_bytes == 16) || - (addrs_length_in_bytes == 20), - "Bad transport layer address length %d (bits) %d (bytes)", - create_tunnel_req_pP->dst_addr[i].length, addrs_length_in_bytes); - - if ((addrs_length_in_bytes == 4) || - (addrs_length_in_bytes == 20)) { - in_addr = *((in_addr_t *)create_tunnel_req_pP->dst_addr[i].buffer); - ip_offset = 4; - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].upf_ip_addr = in_addr; - } - - if ((addrs_length_in_bytes == 16) || - (addrs_length_in_bytes == 20)) { - memcpy(gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].upf_ip6_addr.s6_addr, - &create_tunnel_req_pP->dst_addr[i].buffer[ip_offset], - 16); - } - - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].state = BEARER_IN_CONFIG; - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].teid_gNB = ngu_teid; - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].teid_gNB_stack_session = stack_req.apiInfo.createTunnelEndPointInfo.hStackSession; - gtpv1u_ue_data_p->bearers[pdusession_id - GTPV1U_BEARER_OFFSET].teid_upf = create_tunnel_req_pP->outgoing_teid[i]; - gtpv1u_ue_data_p->num_bearers++; - create_tunnel_resp_pP->gnb_NGu_teid[i] = ngu_teid; - - LOG_I(GTPU,"Copied to create_tunnel_resp tunnel: index %d target gNB ip %d.%d.%d.%d length %d gtp teid %u\n", - i, - create_tunnel_resp_pP->gnb_addr.buffer[0], - create_tunnel_resp_pP->gnb_addr.buffer[1], - create_tunnel_resp_pP->gnb_addr.buffer[2], - create_tunnel_resp_pP->gnb_addr.buffer[3], - create_tunnel_resp_pP->gnb_addr.length, - create_tunnel_resp_pP->gnb_NGu_teid[i]); - } else { - create_tunnel_resp_pP->gnb_NGu_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - - create_tunnel_resp_pP->pdusession_id[i] = pdusession_id; - create_tunnel_resp_pP->num_tunnels += 1; - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - gtpv1u_teid_data_p = calloc (1, sizeof(nr_gtpv1u_teid_data_t)); - gtpv1u_teid_data_p->gnb_id = 0; // TO DO - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->pdu_session_id = pdusession_id; - hash_rc = hashtable_insert(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid, gtpv1u_teid_data_p); - AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting teid mapping in GTPV1U hashtable"); - } else { - create_tunnel_resp_pP->gnb_NGu_teid[i] = 0; - create_tunnel_resp_pP->status = 0xFF; - } - } - - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - "0 GTPV1U_GNB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - ngu_teid); - LOG_D(GTPU, "Tx GTPV1U_GNB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", - create_tunnel_req_pP->rnti, - create_tunnel_resp_pP->status); - //return 0; - return ret; -} - -int gtpv1u_update_ngu_tunnel( - const instance_t instanceP, - const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP, - const rnti_t prior_rnti -) { - /* Local tunnel end-point identifier */ - teid_t ngu_teid = 0; - nr_gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_new_p = NULL; - //MessageDef *message_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - int i,j; - uint8_t bearers_num = 0,bearers_total = 0; - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, prior_rnti, (void **)>pv1u_ue_data_p); - - if(hash_rc != HASH_TABLE_OK) { - LOG_E(GTPU,"Error get ue_mapping(rnti=%x) from GTPV1U hashtable error\n", prior_rnti); - return -1; - } - - gtpv1u_ue_data_new_p = calloc (1, sizeof(nr_gtpv1u_ue_data_t)); - memcpy(gtpv1u_ue_data_new_p,gtpv1u_ue_data_p,sizeof(nr_gtpv1u_ue_data_t)); - gtpv1u_ue_data_new_p->ue_id = create_tunnel_req_pP->rnti; - hash_rc = hashtable_insert(RC.nr_gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_new_p); - - //AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable"); - if ( hash_rc != HASH_TABLE_OK ) { - LOG_E(GTPU,"Failed to insert ue_mapping(rnti=%x) in GTPV1U hashtable\n",create_tunnel_req_pP->rnti); - return -1; - } else { - LOG_I(GTPU, "inserting ue_mapping(rnti=%x) in GTPV1U hashtable\n", - create_tunnel_req_pP->rnti); - } - - hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->ue_mapping, prior_rnti); - LOG_I(GTPU, "hashtable_remove ue_mapping(rnti=%x) in GTPV1U hashtable\n", - prior_rnti); - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - bearers_total =gtpv1u_ue_data_new_p->num_bearers; - - for(j = 0; jbearers[j].state != BEARER_IN_CONFIG) - continue; - - bearers_num++; - - for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) { - if(j == (create_tunnel_req_pP->pdusession_id[i]-GTPV1U_BEARER_OFFSET)) - break; - } - - if(i < create_tunnel_req_pP->num_tunnels) { - ngu_teid = gtpv1u_ue_data_new_p->bearers[j].teid_gNB; - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid, (void **)>pv1u_teid_data_p); - - if (hash_rc == HASH_TABLE_OK) { - gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti; - gtpv1u_teid_data_p->pdu_session_id = create_tunnel_req_pP->pdusession_id[i]; - LOG_I(GTPU, "updata teid_mapping te_id %u (prior_rnti %x rnti %x) in GTPV1U hashtable\n", - ngu_teid,prior_rnti,create_tunnel_req_pP->rnti); - } else { - LOG_W(GTPU, "Error get teid mapping(s1u_teid=%u) from GTPV1U hashtable", ngu_teid); - } - } else { - ngu_teid = gtpv1u_ue_data_new_p->bearers[j].teid_gNB; - hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , enb S1U teid %u not found\n", prior_rnti, ngu_teid); - } - - gtpv1u_ue_data_new_p->bearers[j].state = BEARER_DOWN; - gtpv1u_ue_data_new_p->num_bearers--; - LOG_I(GTPU, "delete teid_mapping te_id %u (rnti%x) bearer_id %d in GTPV1U hashtable\n", - ngu_teid,prior_rnti,j+GTPV1U_BEARER_OFFSET);; - } - - if(bearers_num > bearers_total) - break; - } - - return 0; -} - -//----------------------------------------------------------------------------- -int gtpv1u_delete_ngu_tunnel( - const instance_t instanceP, - const gtpv1u_gnb_delete_tunnel_req_t *const req_pP) { - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - MessageDef *message_p = NULL; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - teid_t teid_gNB = 0; - int pdusession_index = 0; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, GTPV1U_GNB_DELETE_TUNNEL_RESP); - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti = req_pP->rnti; - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status = 0; - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, req_pP->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_OK) { - for (pdusession_index = 0; pdusession_index < req_pP->num_pdusession; pdusession_index++) { - teid_gNB = gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB; - LOG_D(GTPU, "Rx GTPV1U_ENB_DELETE_TUNNEL user rnti %x eNB S1U teid %u eps bearer id %u\n", - req_pP->rnti, teid_gNB, req_pP->pdusession_id[pdusession_index]); - { - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - stack_req.apiType = NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT; - LOG_D(GTPU, "gtpv1u_delete_ngu_tunnel pdusession %u %u\n", - req_pP->pdusession_id[pdusession_index], - teid_gNB); - stack_req.apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle = - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB_stack_session; - rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req); - LOG_D(GTPU, ".\n"); - } - - if (rc != NW_GTPV1U_OK) { - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status |= 0xFF; - LOG_E(GTPU, "NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT failed"); - } - - //----------------------- - // PDCP->GTPV1U mapping - //----------------------- - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].state = BEARER_DOWN; - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB = 0; - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_upf = 0; - gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].upf_ip_addr = 0; - gtpv1u_ue_data_p->num_bearers -= 1; - - if (gtpv1u_ue_data_p->num_bearers == 0) { - hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->ue_mapping, req_pP->rnti); - LOG_D(GTPU, "Removed user rnti %x,no more bearers configured\n", req_pP->rnti); - } - - //----------------------- - // GTPV1U->PDCP mapping - //----------------------- - hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->teid_mapping, teid_gNB); - - if (hash_rc != HASH_TABLE_OK) { - LOG_D(GTPU, "Removed user rnti %x , gNB NGU teid %u not found\n", req_pP->rnti, teid_gNB); - } - } - }// else silently do nothing - - LOG_D(GTPU, "Tx GTPV1U_GNB_DELETE_TUNNEL_RESP user rnti %x gNB NGU teid %u status %u\n", - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti, - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).gnb_NGu_teid, - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - "0 GTPV1U_GNB_DELETE_TUNNEL_RESP rnti %x teid %x", - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti, - teid_gNB); - return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p); -} - -//----------------------------------------------------------------------------- -static int gtpv1u_gNB_send_init_udp(const Gtpv1uNGReq *req) { - // Create and alloc new message - MessageDef *message_p; - struct in_addr addr= {0}; - message_p = itti_alloc_new_message(TASK_GTPV1_U, 0, UDP_INIT); - - if (message_p == NULL) { - return -1; - } - - UDP_INIT(message_p).port = req->gnb_port_for_NGu_up; - addr.s_addr = req->gnb_ip_address_for_NGu_up; - UDP_INIT(message_p).address = inet_ntoa(addr); - LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port); - MSC_LOG_EVENT( - MSC_GTPU_ENB, - "0 UDP bind %s:%u", - UDP_INIT(message_p).address, - UDP_INIT(message_p).port); - return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); -} - -static int gtpv1u_ng_req( - const instance_t instanceP, - const Gtpv1uNGReq *const req) { - memcpy(&RC.nr_gtpv1u_data_g->gnb_ip_address_for_NGu_up, - &req->gnb_ip_address_for_NGu_up, - sizeof (req->gnb_ip_address_for_NGu_up)); - gtpv1u_gNB_send_init_udp(req); - return 0; -} - -static int gtpv1u_gnb_tunnel_data_req(gtpv1u_gnb_tunnel_data_req_t *gnb_tunnel_data_req) { - gtpv1u_gnb_tunnel_data_req_t *data_req_p = NULL; - NwGtpv1uUlpApiT stack_req; - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; - nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL; - teid_t gnb_ngu_teid = 0; - teid_t outgoing_teid = 0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_IN); - data_req_p = gnb_tunnel_data_req; - - memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT)); - hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, (uint64_t)data_req_p->rnti, (void **)>pv1u_ue_data_p); - - if (hash_rc == HASH_TABLE_KEY_NOT_EXISTS) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: while getting ue rnti %x in hashtable ue_mapping\n", data_req_p->rnti); - } else { - if ((data_req_p->pdusession_id >= GTPV1U_BEARER_OFFSET) && (data_req_p->pdusession_id < max_val_NR_DRB_Identity)) { - gnb_ngu_teid = gtpv1u_ue_data_p->bearers[data_req_p->pdusession_id - GTPV1U_BEARER_OFFSET].teid_gNB; - outgoing_teid = gtpv1u_ue_data_p->bearers[data_req_p->pdusession_id - GTPV1U_BEARER_OFFSET].teid_upf; - stack_req.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - stack_req.apiInfo.sendtoInfo.teid = outgoing_teid; - stack_req.apiInfo.sendtoInfo.ipAddr = gtpv1u_ue_data_p->bearers[data_req_p->pdusession_id - GTPV1U_BEARER_OFFSET].upf_ip_addr; - rc = nwGtpv1uGpduMsgNew( - RC.nr_gtpv1u_data_g->gtpv1u_stack, - outgoing_teid, - NW_FALSE, - RC.nr_gtpv1u_data_g->seq_num++, - data_req_p->buffer, - data_req_p->length, - data_req_p->offset, - &(stack_req.apiInfo.sendtoInfo.hMsg)); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_GNB,"0 Failed send G-PDU ltid %u rtid %u size %u", - gnb_ngu_teid,outgoing_teid,data_req_p->length); - (void)gnb_ngu_teid; /* avoid gcc warning "set but not used" */ - } else { - rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_GNB,"0 Failed send G-PDU ltid %u rtid %u size %u", - gnb_ngu_teid,outgoing_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - gnb_ngu_teid, - outgoing_teid, - data_req_p->length); - } - - rc = nwGtpv1uMsgDelete(RC.nr_gtpv1u_data_g->gtpv1u_stack, - stack_req.apiInfo.sendtoInfo.hMsg); - - if (rc != NW_GTPV1U_OK) { - LOG_E(GTPU, "nwGtpv1uMsgDelete failed: 0x%x\n", rc); - } - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_TUNNEL_DATA_REQ, VCD_FUNCTION_OUT); - /* Buffer still needed, do not free it */ - //itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), data_req_p->buffer); - - return 0; -} - -//----------------------------------------------------------------------------- -void *gtpv1u_gNB_process_itti_msg(void *notUsed) { - /* Trying to fetch a message from the message queue. - * If the queue is empty, this function will block till a - * message is sent to the task. - */ - instance_t instance; - MessageDef *received_message_p = NULL; - int rc = 0; - itti_receive_msg(TASK_GTPV1_U, &received_message_p); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_IN); - DevAssert(received_message_p != NULL); - instance = received_message_p->ittiMsgHeader.originInstance; - - switch (ITTI_MSG_ID(received_message_p)) { - case GTPV1U_GNB_NG_REQ: - gtpv1u_ng_req(instance, &received_message_p->ittiMsg.gtpv1uNGReq); - break; - - case GTPV1U_GNB_DELETE_TUNNEL_REQ: - gtpv1u_delete_ngu_tunnel(instance, &received_message_p->ittiMsg.NRGtpv1uDeleteTunnelReq); - break; - - // DATA COMING FROM UDP - case UDP_DATA_IND: { - udp_data_ind_t *udp_data_ind_p; - udp_data_ind_p = &received_message_p->ittiMsg.udp_data_ind; - nwGtpv1uProcessUdpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, - udp_data_ind_p->buffer, - udp_data_ind_p->buffer_length, - udp_data_ind_p->peer_port, - udp_data_ind_p->peer_address); - } - break; - - // DATA TO BE SENT TO UDP - case GTPV1U_GNB_TUNNEL_DATA_REQ: - LOG_I(GTPU, "Received message %s\n", ITTI_MSG_NAME(received_message_p)); - gtpv1u_gnb_tunnel_data_req(>PV1U_GNB_TUNNEL_DATA_REQ(received_message_p)); - break; - - case TERMINATE_MESSAGE: { - if (RC.nr_gtpv1u_data_g->ue_mapping != NULL) { - hashtable_destroy (&(RC.nr_gtpv1u_data_g->ue_mapping)); - } - - if (RC.nr_gtpv1u_data_g->teid_mapping != NULL) { - hashtable_destroy (&(RC.nr_gtpv1u_data_g->teid_mapping)); - } - - LOG_W(GTPU, " *** Exiting GTPU thread\n"); - itti_exit_task(); - } - break; - - case TIMER_HAS_EXPIRED: - nwGtpv1uProcessTimeout(&received_message_p->ittiMsg.timer_has_expired.arg); - break; - - default: { - LOG_E(GTPU, "Unkwnon message ID %d:%s\n", - ITTI_MSG_ID(received_message_p), - ITTI_MSG_NAME(received_message_p)); - } - break; - } - - rc = itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p); - AssertFatal(rc == EXIT_SUCCESS, "Failed to free memory (%d)!\n", rc); - received_message_p = NULL; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_OUT); - return NULL; -} - -void *nr_gtpv1u_gNB_task(void *args) { - int rc = 0; - rc = nr_gtpv1u_gNB_init(); - AssertFatal(rc == 0, "gtpv1u_gNB_init Failed"); - itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); - - while(1) { - (void) gtpv1u_gNB_process_itti_msg (NULL); - } - - return NULL; -} diff --git a/openair3/GTPV1-U/gtpv1u_gNB_defs.h b/openair3/GTPV1-U/gtpv1u_gNB_defs.h deleted file mode 100644 index d4356aa3cf..0000000000 --- a/openair3/GTPV1-U/gtpv1u_gNB_defs.h +++ /dev/null @@ -1,108 +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 gtpv1u_gNB_defs.h - * \brief - * \author Yoshio INOUE, Masayuki HARADA - * \date 2020 - * \version 0.1 - * \email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com - * (yoshio.inoue%40fujitsu.com%2cmasayuki.harada%40fujitsu.com) - */ - -#include "hashtable.h" -#include "NR_asn_constant.h" - -#ifndef GTPV1U_GNB_DEFS_H_ -#define GTPV1U_GNB_DEFS_H_ - -#include "NwGtpv1u.h" - -#define GTPV1U_UDP_PORT (2152) - -#define NR_GTPV1U_MAX_BEARERS_ID (max_val_NR_DRB_Identity - 3) - -#define GTPV1U_SOURCE_GNB (0) -#define GTPV1U_TARGET_GNB (1) -#define GTPV1U_MSG_FROM_SOURCE_GNB (0) -#define GTPV1U_MSG_FROM_UPF (1) - - -typedef struct nr_gtpv1u_teid_data_s { - /* UE identifier for oaisim stack */ - module_id_t gnb_id; - rnti_t ue_id; - pdusessionid_t pdu_session_id; -} nr_gtpv1u_teid_data_t; - - -typedef struct nr_gtpv1u_bearer_s { - /* TEID used in dl and ul */ - teid_t teid_gNB; ///< gNB TEID - uintptr_t teid_gNB_stack_session; ///< gNB TEID - teid_t teid_upf; ///< Remote TEID - in_addr_t upf_ip_addr; - struct in6_addr upf_ip6_addr; - teid_t teid_tgNB; - in_addr_t tgnb_ip_addr; ///< target gNB ipv4 - struct in6_addr tgnb_ip6_addr; ///< target gNB ipv6 - tcp_udp_port_t port; - //NwGtpv1uStackSessionHandleT stack_session; - bearer_state_t state; -} nr_gtpv1u_bearer_t; - -typedef struct nr_gtpv1u_ue_data_s { - /* UE identifier for oaisim stack */ - rnti_t ue_id; - - /* Unique identifier used between PDCP and GTP-U to distinguish UEs */ - uint32_t instance_id; - int num_bearers; - /* Bearer related data. - * Note that the first LCID available for data is 3 and we fixed the maximum - * number of e-rab per UE to be (32 [id range]), max RB is 11. The real rb id will 3 + rab_id (3..32). - */ - nr_gtpv1u_bearer_t bearers[NR_GTPV1U_MAX_BEARERS_ID]; - - //RB_ENTRY(gtpv1u_ue_data_s) gtpv1u_ue_node; -} nr_gtpv1u_ue_data_t; - -typedef struct nr_gtpv1u_data_s { - /* nwgtpv1u stack internal data */ - NwGtpv1uStackHandleT gtpv1u_stack; - - /* RB tree of UEs */ - hash_table_t *ue_mapping; // PDCP->GTPV1U - hash_table_t *teid_mapping; // GTPV1U -> PDCP - - //RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head; - /* Local IP address to use */ - in_addr_t gnb_ip_address_for_NGu_up; - /* UDP internal data */ - //udp_data_t udp_data; - - uint16_t seq_num; - uint8_t restart_counter; - -} nr_gtpv1u_data_t; - - -#endif /* GTPV1U_GNB_DEFS_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_sgw_defs.h b/openair3/GTPV1-U/gtpv1u_sgw_defs.h deleted file mode 100644 index 1d62c18bf6..0000000000 --- a/openair3/GTPV1-U/gtpv1u_sgw_defs.h +++ /dev/null @@ -1,97 +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 - */ - -#ifndef GTPV1U_SGW_DEFS_H_ -#define GTPV1U_SGW_DEFS_H_ - -#include "mme_config.h" -#include "NwGtpv1u.h" -#include "gtpv1u.h" -#include "hashtable.h" -#include "common_types.h" - -#define GTPV1U_UDP_PORT (2152) - -#define MAX_BEARERS_PER_UE (11) - -typedef enum { - BEARER_DOWN = 0, - BEARER_IN_CONFIG, - BEARER_UP, - BEARER_DL_HANDOVER, - BEARER_UL_HANDOVER, - BEARER_MAX, -} bearer_state_t; - -#define BUFFER_TO_uint32_t(buf, x) \ -do { \ - x = ((uint32_t)((buf)[0]) ) | \ - ((uint32_t)((buf)[1]) << 8) | \ - ((uint32_t)((buf)[2]) << 16) | \ - ((uint32_t)((buf)[3]) << 24); \ -} while(0) - - - -typedef struct gtpv1u_teid2enb_info_s { - /* TEID used in dl and ul */ - uint32_t teid_enb; ///< Remote eNB TEID - ip_address_t enb_ip_addr; - bearer_state_t state; - uint16_t port; /// LG ??? -} gtpv1u_teid2enb_info_t; - -/*struct gtpv1u_ue_data_s { - // UE identifier for oaisim stack - uint8_t ue_id; - - // Unique identifier used between PDCP and GTP-U to distinguish UEs - uint32_t instance_id; - - // Bearer related data. - // Note that the first LCID available for data is 3 and we fixed the maximum - // number of e-rab per UE to be 11. The real rb id will 3 + rab_id (0..10). - // - struct gtpv1u_bearer_s bearers[MAX_BEARERS_PER_UE]; - - RB_ENTRY(gtpv1u_ue_data_s) gtpv1u_ue_node; -};*/ - -typedef struct { - /* nwgtpv1u stack internal data */ - NwGtpv1uStackHandleT gtpv1u_stack; - /* RB tree of UEs */ - //RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head; - /* Local IP address to use */ - uint32_t sgw_ip_address_for_S1u_S12_S4_up; - char *ip_addr; - - uint16_t seq_num; - uint8_t restart_counter; - //gtpv1u_teid2enb_info_t* teid2enb_mapping[]; - hash_table_t *S1U_mapping; - -} gtpv1u_data_t; - - -int gtpv1u_init(const mme_config_t *mme_config); - -#endif /* GTPV1U_SGW_DEFS_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_teid_pool.c b/openair3/GTPV1-U/gtpv1u_teid_pool.c deleted file mode 100644 index ff0ac6f183..0000000000 --- a/openair3/GTPV1-U/gtpv1u_teid_pool.c +++ /dev/null @@ -1,47 +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 gtpv1u_task.c -* \brief -* \author Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ -#include -#include - -#include "gtpv1u.h" - -//#define GTPV1U_LINEAR_TEID_ALLOCATION 1 - -#ifdef GTPV1U_LINEAR_TEID_ALLOCATION -static uint32_t g_gtpv1u_teid = 0; -#endif - -uint32_t gtpv1u_new_teid(void) -{ -#ifdef GTPV1U_LINEAR_TEID_ALLOCATION - g_gtpv1u_teid = g_gtpv1u_teid + 1; - return g_gtpv1u_teid; -#else - return random() + random() % (RAND_MAX - 1) + 1; -#endif -} diff --git a/openair3/GTPV1-U/nw-gtpv1u/AUTHORS b/openair3/GTPV1-U/nw-gtpv1u/AUTHORS deleted file mode 100644 index b068a40fdd..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Amit Chawre diff --git a/openair3/GTPV1-U/nw-gtpv1u/COPYING b/openair3/GTPV1-U/nw-gtpv1u/COPYING deleted file mode 100644 index d27832d6c1..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/COPYING +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2010-2011 Amit Chawre -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products -derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/openair3/GTPV1-U/nw-gtpv1u/ChangeLog b/openair3/GTPV1-U/nw-gtpv1u/ChangeLog deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair3/GTPV1-U/nw-gtpv1u/NEWS b/openair3/GTPV1-U/nw-gtpv1u/NEWS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair3/GTPV1-U/nw-gtpv1u/README b/openair3/GTPV1-U/nw-gtpv1u/README deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h b/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h deleted file mode 100644 index 3fb5c8dd05..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uLog.h +++ /dev/null @@ -1,83 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_GTPV1U_LOG_H__ -#define __NW_GTPV1U_LOG_H__ - -#include -#include "NwLog.h" - -/** - * @file NwGtpv1uLog.h - * @brief This header contains logging related definitions. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Log Macro Definition - *--------------------------------------------------------------------------*/ - -#define NW_LOG(_gtpv1uHandle, _logLevel, ...) \ - do { \ - if(((NwGtpv1uStackT*)(_gtpv1uHandle))->logLevel >= _logLevel) \ - { \ - char _logBuf[1024]; \ - snprintf(_logBuf, 1024, __VA_ARGS__); \ - ((NwGtpv1uStackT*)(_gtpv1uHandle))->logMgr.logReqCallback(((NwGtpv1uStackT*)_gtpv1uHandle)->logMgr.logMgrHandle, _logLevel, __FILE__, __LINE__, _logBuf);\ - } \ - } while(0) - -#define NW_ENTER(_gtpv1uHandle) \ - do { \ - NW_LOG(_gtpv1uHandle, NW_LOG_LEVEL_DEBG, "Entering '%s'", __func__);\ - } while(0) - -#define NW_LEAVE(_gtpv1uHandle) \ - do { \ - NW_LOG(_gtpv1uHandle, NW_LOG_LEVEL_DEBG, "Leaving '%s'", __func__);\ - } while(0) - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_TYPES_H__ */ - - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uPrivate.h b/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uPrivate.h deleted file mode 100644 index 59ffb1e174..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uPrivate.h +++ /dev/null @@ -1,227 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_GTPV1U_PRIVATE_H__ -#define __NW_GTPV1U_PRIVATE_H__ - -#include "tree.h" -#include "queue.h" - -#include "NwTypes.h" -#include "NwGtpv1uError.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uMsg.h" - - -/** - * @file NwGtpv1uPrivate.h - * @brief This header file contains nw-gtpv1u private definitions not to be - * exposed to user application. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#define NW_GTPV1U_MALLOC(_stack, _size, _mem, _type) \ - do { \ - if(((NwGtpv1uStackT*)(_stack))->memMgr.memAlloc && ((NwGtpv1uStackT*)(_stack))->memMgr.memFree )\ - { \ - _mem = (_type) ((NwGtpv1uStackT*) (_stack))->memMgr.memAlloc(((NwGtpv1uStackT*) (_stack))->memMgr.hMemMgr, _size, __FILE__, __LINE__);\ - } \ - else \ - { \ - _mem = (_type) malloc (_size); \ - } \ - } while (0) - -/*--------------------------------------------------------------------------* - * G T P U S T A C K O B J E C T T Y P E D E F I N I T I O N * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------* - * GRPS Tunneling Protocol Stack Class Definition - *--------------------------------------------------------------------------*/ - -/** - * gtpv1u stack class definition - */ - -typedef struct NwGtpv1uStack { - uint32_t stackType;/**< GTPU_STACK_ENB or GTPU_STACK_SGW */ - NwPtrT id; - uint32_t seq; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uMemMgrEntityT memMgr; - NwGtpv1uTimerMgrEntityT tmrMgr; - NwGtpv1uLogMgrEntityT logMgr; - uint32_t logLevel; - RB_HEAD( NwGtpv1uOutstandingTxSeqNumTrxnMap, NwGtpv1uTrxn) outstandingTxSeqNumMap; - RB_HEAD( NwGtpv1uOutstandingRxSeqNumTrxnMap, NwGtpv1uTrxn) outstandingRxSeqNumMap; - RB_HEAD(NwGtpv1uTunnelEndPointTMap, NwGtpv1uTunnelEndPoint) sessionMap; - RB_HEAD(NwGtpv1uTunnelEndPointIdentifierMap, NwGtpv1uTunnelEndPoint) teidMap; -} NwGtpv1uStackT; - -/** - * GTP Tunnel End Point class definition - */ - -typedef struct NwGtpv1uTunnelEndPoint { - uint32_t teid; /**< Gtpu Tunnel End Point Identifier */ - uint32_t peerAddr; /**< Peer IP address for the session */ - NwGtpv1uStackT* pStack; /**< Pointer to the parent stack */ - NwGtpv1uUlpSessionHandleT hUlpSession; /**< ULP session handle for the session */ - RB_ENTRY (NwGtpv1uTunnelEndPoint) sessionMapRbtNode; /**< RB Tree Data Structure Node */ - struct NwGtpv1uTunnelEndPoint *next; -} NwGtpv1uTunnelEndPointT; - - -/*--------------------------------------------------------------------------* - * Timeout Info Type Definition - *--------------------------------------------------------------------------*/ - -/** - * gtpv1u timeout info - */ - -typedef struct NwGtpv1uTimeoutInfo { - NwGtpv1uStackHandleT hStack; - void* timeoutArg; - NwGtpv1uRcT (*timeoutCallbackFunc)(void*); -} NwGtpv1uTimeoutInfoT; - -/** - * Start a transaction response timer - * - * @param[in] thiz Pointer to stack instance - * @param[in] timeoutArg Arg to timeout function. - * @param[out] phTmr Pointer to timer handle. - * @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpStartTrxnPeerRspTimer(NwGtpv1uStackT* thiz, NwGtpv1uTimeoutInfoT* timeoutInfo, NwGtpv1uTimerHandleT* phTmr); - -/** - * Stop a transaction response timer - * - * @param[in] thiz Pointer to stack instance - * @param[out] phTmr Pointer to timer handle. - * @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpStopTrxnPeerRspTimer(NwGtpv1uStackT* thiz, NwGtpv1uTimerHandleT* phTmr); - - -#define NW_GTPV1U_MAX_MSG_LEN (4096) /**< Maximum supported gtpv1u packet length including header */ - -/** - * NwGtpv1uMsgT holds gtpv1u messages to/from the peer. - */ -typedef struct NwGtpv1uMsg { - uint8_t version; - uint8_t protocolType; - uint8_t extHdrFlag; - uint8_t seqNumFlag; - uint16_t npduNumFlag; - uint32_t msgType; - uint16_t msgLen; - uint32_t teid; - uint16_t seqNum; - uint8_t npduNum; - uint8_t nextExtHdrType; - uint8_t* msgBuf; - uint32_t msgBufLen; - uint32_t msgBufOffset; - struct NwGtpv1uMsg* next; -} NwGtpv1uMsgT; - - -/*--------------------------------------------------------------------------* - * R6/R4 Transaction Context Type Definition - *--------------------------------------------------------------------------*/ - -/** - * Transaction structure - */ - -typedef struct NwGtpv1uTrxn { - uint32_t seqNum; - uint32_t peerIp; - uint32_t peerPort; - uint8_t maxRetries; - uint8_t t3Timer; - NwGtpv1uTimerHandleT hRspTmr; - NwGtpv1uTimeoutInfoT peerRspTimeoutInfo; - NwGtpv1uStackT* pStack; - NwGtpv1uTunnelEndPointT* pSession; - uint32_t hUlpTrxn; - NwGtpv1uMsgT* pMsg; - RB_ENTRY (NwGtpv1uTrxn) outstandingTxSeqNumMapRbtNode; /**< RB Tree Data Structure Node */ - RB_ENTRY (NwGtpv1uTrxn) outstandingRxSeqNumMapRbtNode; /**< RB Tree Data Structure Node */ - struct NwGtpv1uTrxn* next; -} NwGtpv1uTrxnT; - - -/** - * GTPv2 message header structure - */ - -#pragma pack(1) - -typedef struct NwGtpv1uMsgHeader { - uint8_t PN:1; - uint8_t S:1; - uint8_t E:1; - uint8_t spare:1; - uint8_t PT:1; - uint8_t version:3; - uint8_t msgType; - uint16_t msgLength; - uint32_t teid; -} NwGtpv1uMsgHeaderT; - -#pragma pack() - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_GTPV1U_PRIVATE_H__ */ -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h b/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h deleted file mode 100644 index 76228416a9..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTrxn.h +++ /dev/null @@ -1,88 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -/** - * @file NwGtpv1uTrxn.h - * @author Amit Chawre - * @brief - * - * This header file contains required definitions and functions - * prototypes used by gtpv1u transactions. - * - **/ - - -#ifndef __NW_GTPV1U_TRXN_H__ -#define __NW_GTPV1U_TRXN_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT -nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT* thiz, - NW_OUT NwGtpv1uTrxnT **ppTrxn); - - -NwGtpv1uRcT -nwGtpv1uTrxnWithSeqNew( NW_IN NwGtpv1uStackT* thiz, - NW_IN uint32_t seqNum, - NW_OUT NwGtpv1uTrxnT **ppTrxn); - -NwGtpv1uRcT -nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **ppTrxn); - -NwGtpv1uRcT -nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT* thiz, - NW_OUT NwGtpv1uTrxnT **ppTrxn); - -NwGtpv1uRcT -nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **pthiz); - -NwGtpv1uRcT -nwGtpv1uTrxnCreateAndSendMsg( NW_IN NwGtpv1uStackT* thiz, - NW_IN NwGtpv1uTrxnT *pTrxn, - NW_IN uint32_t peerIp, - NW_IN uint32_t peerPort, - NW_IN NwGtpv1uMsgT *pMsg); - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_GTPV1U_TRXN_H__ */ - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h b/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h deleted file mode 100644 index dc4fbab264..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/include/NwGtpv1uTunnelEndPoint.h +++ /dev/null @@ -1,85 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwUtils.h" -#include "NwGtpv1uError.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uLog.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifndef __NW_GTPV1U_CONNECTION_H__ -#define __NW_GTPV1U_CONNECTION_H__ - -/** - Constructor - - @return Pointer to session on success, NULL n failure. - */ - -NwGtpv1uTunnelEndPointT* -nwGtpTunnelEndPointNew(struct NwGtpv1uStack* pStack); - -/** - Destructor - - @param[in] thiz: Pointer to session - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpTunnelEndPointDestroy(struct NwGtpv1uStack* pStack, NwGtpv1uTunnelEndPointT* thiz); - -NwGtpv1uRcT -nwGtpSessionSendMsgApiToUlpEntity(NwGtpv1uTunnelEndPointT* thiz, - NwGtpv1uMsgT *pMsg); - -#ifdef __cplusplus -} -#endif - -#endif -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h deleted file mode 100644 index c6f7c3d6fa..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1u.h +++ /dev/null @@ -1,562 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_GTPV1U_H__ -#define __NW_GTPV1U_H__ - -#include -#include -#include -#include "NwTypes.h" -#include "NwGtpv1uError.h" - - -/** - * @file NwGtpv1u.h - * @author Amit Chawre - * @brief - * - * This header file contains all required definitions and functions - * prototypes for using nw-gtpv1u library. - * - **/ - -#define NW_GTPU_VERSION (0x01) -#define NW_GTP_PROTOCOL_TYPE_GTP (0x01) -#define NW_GTP_PROTOCOL_TYPE_GTP_PRIME (0x00) - -/*--------------------------------------------------------------------------* - * S H A R E D A P I M A C R O S * - *--------------------------------------------------------------------------*/ - -#define NW_GTP_ECHO_REQ (1) -#define NW_GTP_ECHO_RSP (2) -#define NW_GTP_ERROR_INDICATION (26) -#define NW_GTP_SUPPORTED_EXTENSION_HEADER_INDICATION (31) -#define NW_GTP_END_MARKER (254) -#define NW_GTP_GPDU (255) - -/*--------------------------------------------------------------------------- - * Opaque Gtpv2 Stack Handles - *--------------------------------------------------------------------------*/ - -typedef NwPtrT NwGtpv1uStackHandleT; /**< Gtpv2 Stack Handle */ -typedef NwPtrT NwGtpv1uUlpHandleT; /**< Gtpv2 Stack Ulp Entity Handle */ -typedef NwPtrT NwGtpv1uUdpHandleT; /**< Gtpv2 Stack Udp Entity Handle */ -typedef NwPtrT NwGtpv1uMemMgrHandleT; /**< Gtpv2 Stack Mem Manager Handle */ -typedef NwPtrT NwGtpv1uTimerMgrHandleT; /**< Gtpv2 Stack Timer Manager Handle */ -typedef NwPtrT NwGtpv1uLogMgrHandleT; /**< Gtpv2 Stack Log Mnagaer Handle */ -typedef NwPtrT NwGtpv1uTimerHandleT; /**< Gtpv2 Stack Timer Handle */ -typedef NwPtrT NwGtpv1uMsgHandleT; /**< Gtpv2 Msg Handle */ - -typedef struct NwGtpv1uStackConfig { - uint16_t udpSrcPort; -} NwGtpv1uStackConfigT; - -/*--------------------------------------------------------------------------* - * S T A C K A P I D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------- - * Gtpv2 Stack ULP API type definitions - *--------------------------------------------------------------------------*/ - -/** - * APIs types between ULP and Stack - */ - -typedef enum { - /* APIs from ULP to stack */ - - NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT = 0x00000000, /**< Create a local teid context on stack */ - NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT, /**< Delete a local teid context on stack */ - NW_GTPV1U_ULP_API_INITIAL_REQ, /**< Send a Initial Request over a session */ - NW_GTPV1U_ULP_API_TRIGGERED_REQ, /**< Send a Initial Request over a session */ - NW_GTPV1U_ULP_API_TRIGGERED_RSP, /**< Send a Trigger Response over a session */ - NW_GTPV1U_ULP_API_SEND_TPDU, /**< Send a T-PDU message over teid context */ - - /* APIs from stack to ULP */ - - NW_GTPV1U_ULP_API_RECV_TPDU, /**< Receive a gtpv1u T-PDU from stack */ - NW_GTPV1U_ULP_API_RECV_MSG, /**< Receive a gtpv1u message from stack */ - NW_GTPV1U_ULP_API_RSP_FAILURE, /**< Rsp failure for gtpv2 message from stack */ - - /* Do not add below this */ - - NW_GTPV1U_ULP_API_END = 0xFFFFFFFF, -} NwGtpv1uUlpApiTypeT; - -/*--------------------------------------------------------------------------- - * Gtpv2 Stack API information elements definitions - *--------------------------------------------------------------------------*/ - -typedef NwPtrT NwGtpv1uStackSessionHandleT;/**< Gtpv2 Stack session Handle */ -typedef uint8_t NwGtpv1uMsgTypeT; /**< Gtpv2 Msg Type */ -typedef NwPtrT NwGtpv1uTrxnHandleT; /**< Gtpv2 Transaction Handle */ -typedef NwPtrT NwGtpv1uUlpTrxnHandleT; /**< Gtpv2 Ulp Transaction Handle */ -typedef NwPtrT NwGtpv1uUlpSessionHandleT; /**< Gtpv2 Ulp session Handle */ - -/** - * API information elements between ULP and Stack for - * creating a session. - */ - -typedef struct { - NW_IN uint32_t teid; - NW_IN NwGtpv1uUlpSessionHandleT hUlpSession; - NW_OUT NwGtpv1uStackSessionHandleT hStackSession; -} NwGtpv1uCreateTunnelEndPointT; - -/** - * API information elements between ULP and Stack for - * destroying a session. - */ - -typedef struct { - NW_IN NwGtpv1uStackSessionHandleT hStackSessionHandle; -} NwGtpv1uDestroyTunnelEndPointT; - -/** - * API information elements between ULP and Stack for - * sending a Gtpv1u initial message. - */ - -typedef struct { - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN uint32_t peerIp; - NW_IN uint32_t peerPort; - NW_IN uint8_t flags; - NW_IN uint32_t teid; -} NwGtpv1uInitialReqInfoT; - -/** - * API information elements between ULP and Stack for - * sending a Gtpv1u triggered response message. - */ - -typedef struct { - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN uint32_t peerIp; - NW_IN uint32_t peerPort; - NW_IN uint8_t flags; - NW_IN uint32_t teid; - NW_IN uint32_t seqNum; - NW_IN NwGtpv1uMsgHandleT hMsg; -} NwGtpv1uTriggeredRspInfoT; - -/** - * API information elements between ULP and Stack for - * sending a Gtpv1u triggered request message. - */ - -typedef struct { - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN uint32_t peerIp; - NW_IN uint32_t peerPort; - NW_IN uint8_t flags; - NW_IN uint32_t teid; - NW_IN uint32_t seqNum; - NW_IN NwGtpv1uMsgHandleT hMsg; -} NwGtpv1uTriggeredReqInfoT; - - -/** - * API information elements between ULP and Stack for - * sending a Gtpv2 message over a session. - */ - -typedef struct { - NW_IN uint32_t teid; - NW_IN uint32_t ipAddr; - NW_IN uint8_t flags; - NW_IN NwGtpv1uMsgHandleT hMsg; -} NwGtpv1uSendtoInfoT; - - -/** - * API information elements between ULP and Stack for - * sending a Gtpv2 message over a session. - */ - -typedef struct { - NW_OUT NwGtpv1uStackSessionHandleT hStackSessionHandle; - NW_INOUT NwGtpv1uTrxnHandleT hTrxn; - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN NwGtpv1uMsgTypeT msgType; - NW_IN uint8_t flags; - NW_IN NwGtpv1uMsgHandleT hMsg; -} NwGtpv1uSendMsgInfoT; - -/** - * API information elements between ULP and Stack for - * receiving a Gtpv2 message over a session from stack. - */ - -typedef struct { - NW_IN NwGtpv1uUlpSessionHandleT hUlpSession; - NW_IN NwGtpv1uUlpTrxnHandleT hUlpTrxn; - NW_IN uint32_t teid; - NW_IN uint32_t peerIp; - NW_IN uint32_t peerPort; - NW_IN uint32_t msgType; /**< Message type */ - NW_IN NwGtpv1uMsgHandleT hMsg; /**< Gtp Message handle */ -} NwGtpv1uRecvMsgInfoT; - -/** - * API information elements between ULP and Stack for - * receiving a Gtpv2 message over a session from stack. - */ - -typedef struct { - NW_IN NwGtpv1uUlpSessionHandleT hUlpSession; - NW_IN NwGtpv1uTrxnHandleT hTrxn; -} NwGtpv1uNackInfoT; - -/*--------------------------------------------------------------------------- - * Gtpv2 Stack API structure definition - *--------------------------------------------------------------------------*/ - -/** - * API structure between ULP and Stack - */ - -typedef struct { - NwGtpv1uUlpApiTypeT apiType; - NwGtpv1uMsgHandleT hMsg; - union { - NwGtpv1uCreateTunnelEndPointT createTunnelEndPointInfo; - NwGtpv1uDestroyTunnelEndPointT destroyTunnelEndPointInfo; - NwGtpv1uInitialReqInfoT initialReqInfo; - NwGtpv1uTriggeredRspInfoT triggeredRspInfo; - NwGtpv1uTriggeredReqInfoT triggeredReqInfo; - NwGtpv1uSendtoInfoT sendtoInfo; - NwGtpv1uSendMsgInfoT sendMsgInfo; - NwGtpv1uRecvMsgInfoT recvMsgInfo; - NwGtpv1uNackInfoT nackMsgInfo; - } apiInfo; -} NwGtpv1uUlpApiT; - - -/*--------------------------------------------------------------------------* - * S T A C K E N T I T I E S D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------- - * ULP Entity Definitions - *--------------------------------------------------------------------------*/ - -/** - * Gtpv2 ULP entity definition - */ - -typedef struct { - NwGtpv1uUlpHandleT hUlp; - NwGtpv1uRcT (*ulpReqCallback) ( NW_IN NwGtpv1uUlpHandleT hUlp, - NW_IN NwGtpv1uUlpApiT *pUlpApi); -} NwGtpv1uUlpEntityT; - - -/*--------------------------------------------------------------------------- - * UDP Entity Definitions - *--------------------------------------------------------------------------*/ - -/** - * Gtpv2 UDP entity definition - */ - -typedef struct { - NwGtpv1uUdpHandleT hUdp; - NwGtpv1uRcT (*udpDataReqCallback) ( NW_IN NwGtpv1uUdpHandleT udpHandle, - NW_IN uint8_t* dataBuf, - NW_IN uint32_t dataSize, - NW_IN uint32_t dataOffset, - NW_IN uint32_t peerIP, - NW_IN uint16_t peerPort); -} NwGtpv1uUdpEntityT; - -/** - * Gtpv1u Memory Manager entity definition - */ - -typedef struct { - NwGtpv1uMemMgrHandleT hMemMgr; - void* (*memAlloc)( NW_IN NwGtpv1uMemMgrHandleT hMemMgr, - NW_IN uint32_t memSize, - NW_IN NwCharT* fileName, - NW_IN uint32_t lineNumber); - - void (*memFree) ( NW_IN NwGtpv1uMemMgrHandleT hMemMgr, - NW_IN void* hMem, - NW_IN NwCharT* fileName, - NW_IN uint32_t lineNumber); -} NwGtpv1uMemMgrEntityT; - - -/*--------------------------------------------------------------------------- - * Timer Entity Definitions - *--------------------------------------------------------------------------*/ - -#define NW_GTPV1U_TMR_TYPE_ONE_SHOT (0) -#define NW_GTPV1U_TMR_TYPE_REPETITIVE (1) - -/** - * Gtpv2 Timer Manager entity definition - */ - -typedef struct { - NwGtpv1uTimerMgrHandleT tmrMgrHandle; - NwGtpv1uRcT (*tmrStartCallback)( NW_IN NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NW_IN uint32_t timeoutSecs, - NW_IN uint32_t timeoutUsec, - NW_IN uint32_t tmrType, - NW_IN void* tmrArg, - NW_OUT NwGtpv1uTimerHandleT* tmrHandle); - - NwGtpv1uRcT (*tmrStopCallback) ( NW_IN NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NW_IN NwGtpv1uTimerHandleT tmrHandle); -} NwGtpv1uTimerMgrEntityT; - - -/*--------------------------------------------------------------------------- - * Log Entity Definitions - *--------------------------------------------------------------------------*/ - -/** - * Gtpv2 Log manager entity definition - */ - -typedef struct { - NwGtpv1uLogMgrHandleT logMgrHandle; - NwGtpv1uRcT (*logReqCallback) (NW_IN NwGtpv1uLogMgrHandleT logMgrHandle, - NW_IN uint32_t logLevel, - NW_IN NwCharT* file, - NW_IN uint32_t line, - NW_IN NwCharT* logStr); -} NwGtpv1uLogMgrEntityT; - - -/*--------------------------------------------------------------------------* - * P U B L I C F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Constructor - *--------------------------------------------------------------------------*/ - -/** - Initialize the nw-gtpv1u stack. - - @param[in,out] phGtpv1uStackHandle : Pointer to stack handle - @param[in] stackType : GTPU_STACK_ENB or GTPU_STACK_SGW - */ - -NwGtpv1uRcT -nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT* phGtpv1uStackHandle, uint32_t stackType); - -/*--------------------------------------------------------------------------- - * Destructor - *--------------------------------------------------------------------------*/ - -/** - Destroy the nw-gtpv1u stack. - - @param[in] hGtpv1uStackHandle : Stack handle - */ - -NwGtpv1uRcT -nwGtpv1uFinalize( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle); - -/*--------------------------------------------------------------------------- - * Configuration Get/Set Operations - *--------------------------------------------------------------------------*/ - -/** - Set Configuration for the nw-gtpv1u stack. - - @param[in,out] phGtpv1uStackHandle : Pointer to stack handle - */ - -NwGtpv1uRcT -NwGtpv1uConfigSet( NW_IN NwGtpv1uStackHandleT* phGtpv1uStackHandle, NW_IN NwGtpv1uStackConfigT* pConfig); - -/** - Get Configuration for the nw-gtpv1u stack. - - @param[in,out] phGtpv1uStackHandle : Pointer to stack handle - */ - -NwGtpv1uRcT -NwGtpv1uConfigGet( NW_IN NwGtpv1uStackHandleT* phGtpv1uStackHandle, NW_OUT NwGtpv1uStackConfigT* pConfig); - -/** - Set ULP entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pUlpEntity : Pointer to ULP entity. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetUlpEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uUlpEntityT* pUlpEntity); - -/** - Set UDP entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pUdpEntity : Pointer to UDP entity. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetUdpEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uUdpEntityT* pUdpEntity); - -/** - Set MemMgr entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pMemMgr : Pointer to Memory Manager. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetMemMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uMemMgrEntityT* pMemMgr); - - -/** - Set TmrMgr entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pTmrMgr : Pointer to Timer Manager. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetTimerMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uTimerMgrEntityT* pTmrMgr); - -/** - Set LogMgr entity for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pLogMgr : Pointer to Log Manager. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetLogMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uLogMgrEntityT* pLogMgr); - -/** - Set log level for the stack. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] logLevel : Log level. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uSetLogLevel( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint32_t logLevel); -/*--------------------------------------------------------------------------- - * Process Request from Udp Layer - *--------------------------------------------------------------------------*/ - -/** - Process Data Request from UDP entity. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] udpData : Pointer to received UDP data. - @param[in] udpDataLen : Received data length. - @param[in] dstPort : Received on port. - @param[in] from : Received from peer information. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uProcessUdpReq( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN uint8_t* udpData, - NW_IN uint32_t udpDataLen, - NW_IN uint16_t peerPort, - NW_IN uint32_t peerIP); - -/*--------------------------------------------------------------------------- - * Process Request from Upper Layer - *--------------------------------------------------------------------------*/ - -/** - Process Request from ULP entity. - - @param[in] hGtpv1uStackHandle : Stack handle - @param[in] pLogMgr : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uProcessUlpReq( NW_IN NwGtpv1uStackHandleT hGtpv1uStackHandle, - NW_IN NwGtpv1uUlpApiT *ulpReq); - - -/*--------------------------------------------------------------------------- - * Process Timer timeout Request from Timer Manager - *--------------------------------------------------------------------------*/ - -/** - Process Timer timeout Request from Timer Manager - - @param[in] pLogMgr : Pointer timeout arguments. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpv1uProcessTimeout( NW_IN void* timeoutArg); - -NwGtpv1uRcT -nwGtpv1uPeerRspTimeout(void* arg); - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_GTPV1U_H__ */ - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h deleted file mode 100644 index 6da3b80dfa..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uError.h +++ /dev/null @@ -1,63 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 c * - * G P R S T u n n e l i n g P r o t o c o l v 2 c S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - - -#ifndef __NW_GTPV1U_ERROR_H__ -#define __NW_GTPV1U_ERROR_H__ - -/** - * @file NwGtpv1uError.h - * @brief This header file contains return error code type definitions. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - - NW_GTPV1U_OK = 0x00000000, - NW_GTPV1U_MANDATORY_IE_DUPLICATE, - NW_GTPV1U_MANDATORY_IE_MISSING, - NW_GTPV1U_MSG_MALFORMED, - NW_GTPV1U_FAILURE = 0xFFFFFFFE -} -NwGtpv1uRcT; - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_GTPV1U_ERROR_H__*/ - - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h deleted file mode 100644 index 7bb51dcda0..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uIe.h +++ /dev/null @@ -1,66 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -/** - * @file NwGtpv1uIe.h - * @brief This header file contains Information Element definitions for GTPv1u - * as per 3GPP TS 29281-930. -*/ - -#ifndef __NW_GTPV1U_IE_H__ -#define __NW_GTPV1U_IE_H__ - -/*--------------------------------------------------------------------------* - * G T P V 2 U I E T Y P E M A C R O D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -#define NW_GTPV1U_IE_RECOVERY (14) -#define NW_GTPV1U_IE_TEID_DATA_I (15) -#define NW_GTPV1U_IE_GSN_ADDRESS (133) -#define NW_GTPV1U_IE_EXT_HDR_TYPE_LIST (141) -#define NW_GTPV1U_IE_PRIVATE_EXTENSION (255) - - -/*--------------------------------------------------------------------------* - * G T P V 2 U C A U S E V A L U E D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -#define NW_GTPV1U_CAUSE_REQUEST_ACCEPTED (16) -#define NW_GTPV1U_CAUSE_MANDATORY_IE_MISSING (70) - -#endif /* __NW_GTPV1U_IE_H__ */ - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h deleted file mode 100644 index f6bc0415f2..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwGtpv1uMsg.h +++ /dev/null @@ -1,317 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_GTPV1U_MSG_H__ -#define __NW_GTPV1U_MSG_H__ - -#include "NwTypes.h" -#include "NwGtpv1u.h" - -/** - * @file NwGtpv1uMsg.h - * @brief This file defines APIs for to build new outgoing gtpv1u messages and to parse incoming messages. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------* - * G T P V 2 C I E D A T A - T Y P E D E F I N I T I O N S * - *--------------------------------------------------------------------------*/ - -#pragma pack(1) - -typedef struct NwGtpv1uIeTv1 { - uint8_t t; - uint8_t v; -} NwGtpv1uIeTv1T; - -typedef struct NwGtpv1uIeTv2 { - uint8_t t; - uint8_t v; -} NwGtpv1uIeTv2T; - -typedef struct NwGtpv1uIeTv4 { - uint8_t t; - uint32_t v; -} NwGtpv1uIeTv4T; - -typedef struct NwGtpv1uIeTlv { - uint8_t t; - uint16_t l; -} NwGtpv1uIeTlvT; - -#pragma pack() - - -/** - * Allocate a GPDU gtpv1u message. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[in] teidPresent : TEID is present flag. - * @param[in] teid : TEID for this message. - * @param[in] seqNum : Sequence number for this message. - * @param[out] phMsg : Pointer to message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t seqNumFlag, - NW_IN uint8_t npduNumFlag, - NW_IN uint8_t extHdrFlag, - NW_IN uint8_t msgType, - NW_IN uint8_t teid, - NW_IN uint16_t seqNum, - NW_IN uint8_t npduNum, - NW_IN uint8_t nextExtHeader, - NW_OUT NwGtpv1uMsgHandleT *phMsg); - - -/** - * Allocate a gtpv1u message. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[in] teid : TEID for this message. - * @param[in] seqNumFlag : Sequence number flag for this message. - * @param[in] seqNum : Sequence number for this message. - * @param[in] pTpdu: T-PDU for this message. - * @param[in] tpduLength: T-PDU length for this message. - * @param[out] phMsg : Pointer to message handle. - */ - -NwGtpv1uRcT -nwGtpv1uGpduMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint32_t teid, - NW_IN uint8_t seqNumFlag, - NW_IN uint16_t seqNum, - NW_IN uint8_t* tpdu, - NW_IN uint16_t tpduLength, - NW_IN uint32_t tpduOffset, - NW_OUT NwGtpv1uMsgHandleT *phMsg); - -/** - * Allocate a gtpv1u message from another gtpv1u message. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[out] hMsg : Handle to input message. - * @param[out] phMsg : Pointer to message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgFromMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMsgHandleT hMsg, - NW_OUT NwGtpv1uMsgHandleT *phMsg); -/** - * Allocate a gtpv1u message from data buffer. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[in] pBuf: Buffer to be copied in this message. - * @param[in] bufLen: Buffer length to be copied in this message. - * @param[out] phMsg : Pointer to message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgFromBufferNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t* pBuf, - NW_IN uint32_t bufLen, - NW_OUT NwGtpv1uMsgHandleT *phMsg); - -/** - * Free a gtpv1u message. - * - * @param[in] hGtpuStackHandle : gtpv1u stack handle. - * @param[in] hMsg : Message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgDelete( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Set TEID for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] teid: TEID value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetTeid(NW_IN NwGtpv1uMsgHandleT hMsg, uint32_t teid); - -/** - * Set TEID present flag for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] teidPesent: Flag boolean value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetTeidPresent(NW_IN NwGtpv1uMsgHandleT hMsg, NwBoolT teidPresent); - -/** - * Set sequence for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] seqNum: Flag boolean value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetSeqNumber(NW_IN NwGtpv1uMsgHandleT hMsg, uint32_t seqNum); - -/** - * Get TEID present for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetTeid(NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Get TEID present for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -NwBoolT -nwGtpv1uMsgGetTeidPresent(NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Get sequence number for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetSeqNumber(NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Get tpdu for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[inout] pTpduBuf : Buffer to copy the T-PDU. - * @param[out] hMsg : T-PDU length. - */ - -uint32_t -nwGtpv1uMsgGetTpdu(NW_IN NwGtpv1uMsgHandleT hMsg, uint8_t* pTpduBuf, uint32_t* pTpduLength); - -uint8_t* -nwGtpv1uMsgGetTpduHandle(NW_IN NwGtpv1uMsgHandleT hMsg); - -uint32_t -nwGtpv1uMsgGetTpduLength(NW_IN NwGtpv1uMsgHandleT hMsg); - -/** - * Add a gtpv1u information element of length 1 to gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] type : IE type. - * @param[in] value : IE value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV1(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint8_t value); - - -/** - * Add a gtpv1u information element of length 2 to gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] type : IE type. - * @param[in] value : IE value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV2(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint16_t value); - - -/** - * Add a gtpv1u information element of length 4 to gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] type : IE type. - * @param[in] value : IE value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV4(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint32_t value); - - -/** - * Add a gtpv1u information element of variable length to gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] type : IE type. - * @param[in] length : IE length. - * @param[in] value : IE value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgAddIe(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint8_t* pVal); - -/** - * Dump the contents of gtpv1u mesasge. - * - * @param[in] hMsg : Handle to gtpv1u message. - * @param[in] fp: Pointer to output file. - */ - -NwGtpv1uRcT -nwGtpv1uMsgHexDump(NwGtpv1uMsgHandleT hMsg, FILE* fp); - -uint32_t -nwGtpv1uMsgGetMsgType(NW_IN NwGtpv1uMsgHandleT hMsg); - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_TYPES_H__ */ - - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h deleted file mode 100644 index 7215216e68..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwLog.h +++ /dev/null @@ -1,88 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 c * - * G P R S T u n n e l i n g P r o t o c o l v 2 c S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - - -#ifndef __NW_LOG_H__ -#define __NW_LOG_H__ - -#include - -#include "NwTypes.h" - -/** - * @file NwLog.h - * @brief This header file contains global shared logging definitions. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Log Level Definitions - *--------------------------------------------------------------------------*/ - -#define NW_LOG_LEVEL_EMER (0) /**< system is unusable */ -#define NW_LOG_LEVEL_ALER (1) /**< action must be taken immediately*/ -#define NW_LOG_LEVEL_CRIT (2) /**< critical conditions */ -#define NW_LOG_LEVEL_ERRO (3) /**< error conditions */ -#define NW_LOG_LEVEL_WARN (4) /**< warning conditions */ -#define NW_LOG_LEVEL_NOTI (5) /**< normal but signification condition */ -#define NW_LOG_LEVEL_INFO (6) /**< informational */ -#define NW_LOG_LEVEL_DEBG (7) /**< debug-level messages */ - -// static -// NwCharT* gLogLevelStr[] = {"EMER", "ALER", "CRIT", "ERRO", "WARN", "NOTI", "INFO", "DEBG"}; - -/*--------------------------------------------------------------------------- - * IPv4 logging macros - *--------------------------------------------------------------------------*/ -#define NW_IPV4_ADDR "%u.%u.%u.%u" -#define NW_IPV4_ADDR_FORMAT(__addr) (uint8_t)((__addr) & 0x000000ff), \ - (uint8_t)(((__addr) & 0x0000ff00) >> 8 ), \ - (uint8_t)(((__addr) & 0x00ff0000) >> 16), \ - (uint8_t)(((__addr) & 0xff000000) >> 24) - -#define NW_IPV4_ADDR_FORMATP(__paddr) (uint8_t)(*((uint8_t*)(__paddr)) & 0x000000ff), \ - (uint8_t)(*((uint8_t*)(__paddr + 1)) & 0x000000ff), \ - (uint8_t)(*((uint8_t*)(__paddr + 2)) & 0x000000ff), \ - (uint8_t)(*((uint8_t*)(__paddr + 3)) & 0x000000ff) - - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_LOG_H__ */ - - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h deleted file mode 100644 index aae5c8a95b..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwTypes.h +++ /dev/null @@ -1,78 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 c * - * G P R S T u n n e l i n g P r o t o c o l v 2 c S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - - -#include -#include - -#ifndef __NW_TYPES_H__ -#define __NW_TYPES_H__ - -/** - * @file NwTypes.h - * @brief This header file contains basic type definitions. -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#define NW_IN /**< An input argument */ -#define NW_OUT /**< An output argumnet */ -#define NW_INOUT /**< An input and output argument */ - -#define NW_TRUE (1) /**< Truth value */ -#define NW_FALSE (0) /**< False value */ - -typedef signed char NwS8T; /**< Signed 1 byte */ -typedef signed short NwS16T; /**< Signed 2 byte */ -typedef signed int NwS32T; /**< Signed 4 byte */ -typedef signed long long NwS64T; /**< Signed 8 byte */ - -typedef uintptr_t NwPtrT; /**< Use this for generic pointers */ -typedef unsigned int NwHandleT; /**< Use this for generic handles */ - -typedef char NwBoolT; /**< Use this for booleans */ - -typedef char NwCharT; /**< Use this for strings */ - -typedef signed int NwFdT; /**< Use this for file descriptor */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __NW_TYPES_H__ */ - - diff --git a/openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h b/openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h deleted file mode 100644 index c197ab323e..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/shared/NwUtils.h +++ /dev/null @@ -1,68 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 c * - * G P R S T u n n e l i n g P r o t o c o l v 2 c S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include - -#ifndef __NW_UTILS_H__ -#define __NW_UTILS_H__ - - -/** - * @file NwUtils.h - * @brief This header file contains utility macro and function definitions. -*/ - -#define NW_ASSERT assert /**< Assertion */ - -#define NW_CHK_NULL_PTR(_ptr) NW_ASSERT(_ptr != NULL) /**< Null pointer check */ - -#define NW_HTONS(x) ( ( ((x) & 0xff00) >> 8 ) | ( ((x) & 0x00ff) << 8 ) ) - -#define NW_HTONL(x) ( ( ((x) & 0xff000000) >> 24 ) | ( ( (x) & 0x00ff0000 ) >> 8 ) | \ - ( ( (x) & 0x0000ff00 ) << 8 ) | ( ( (x) & 0x000000ff) << 24 ) ) - -#define NW_HTONLL(x) ( \ - ( ( ((uint64_t)x) & 0xff00000000000000ULL ) >> 56 ) | ( ( ((uint64_t)x) & 0x00ff000000000000ULL ) >> 40 ) | \ - ( ( ((uint64_t)x) & 0x0000ff0000000000ULL ) >> 24 ) | ( ( ((uint64_t)x) & 0x000000ff00000000ULL ) >> 8 ) | \ - ( ( ((uint64_t)x) & 0x000000000000ff00ULL ) << 40 ) | ( ( ((uint64_t)x) & 0x00000000000000ffULL ) << 56 ) | \ - ( ( ((uint64_t)x) & 0x0000000000ff0000ULL ) << 24 ) | ( ( ((uint64_t)x) & 0x00000000ff000000ULL ) << 8 ) \ - ) - -#define NW_NTOHS NW_HTONS -#define NW_NTOHL NW_HTONL -#define NW_NTOHLL NW_HTONLL - - -#endif /* __NW_UTILS_H__ */ - - diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c deleted file mode 100644 index 0d962cad7d..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c +++ /dev/null @@ -1,1025 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwUtils.h" -#include "NwGtpv1uError.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uTunnelEndPoint.h" -#include "NwGtpv1uTrxn.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uIe.h" -#include "NwGtpv1uLog.h" - -#include "assertions.h" -#include "intertask_interface.h" -#include "msc.h" - -#include "gtpv1u.h" -#if defined(ENB_MODE) -#include "common/utils/LOG/log.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -//#define LOG_GTPU 1 -/*--------------------------------------------------------------------------* - * P R I V A T E F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -#define NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE (12) /**< Size of GTPv1u EPC specific header */ -#define NW_GTPV1U_EPC_MIN_HEADER_SIZE (8) - - -void -nwGtpv1uDisplayBanner(void) -{ - printf(" *----------------------------------------------------------------------------*\n"); - printf(" * *\n"); - printf(" * n w - g t p v 2 u *\n"); - printf(" * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k *\n"); - printf(" * *\n"); - printf(" * *\n"); - printf(" * Copyright (c) 2010-2011 Amit Chawre *\n"); - printf(" * All rights reserved. *\n"); - printf(" * *\n"); - printf(" * Redistribution and use in source and binary forms, with or without *\n"); - printf(" * modification, are permitted provided that the following conditions *\n"); - printf(" * are met: *\n"); - printf(" * *\n"); - printf(" * 1. Redistributions of source code must retain the above copyright *\n"); - printf(" * notice, this list of conditions and the following disclaimer. *\n"); - printf(" * 2. Redistributions in binary form must reproduce the above copyright *\n"); - printf(" * notice, this list of conditions and the following disclaimer in the *\n"); - printf(" * documentation and/or other materials provided with the distribution. *\n"); - printf(" * 3. The name of the author may not be used to endorse or promote products *\n"); - printf(" * derived from this software without specific prior written permission. *\n"); - printf(" * *\n"); - printf(" * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *\n"); - printf(" * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *\n"); - printf(" * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. *\n"); - printf(" * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *\n"); - printf(" * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT *\n"); - printf(" * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *\n"); - printf(" * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *\n"); - printf(" * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *\n"); - printf(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *\n"); - printf(" * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *\n"); - printf(" *----------------------------------------------------------------------------*\n\n"); - -} -/*--------------------------------------------------------------------------- - * RBTree Search Functions - *--------------------------------------------------------------------------*/ - -static inline NwS32T -nwGtpv1uCompareTeid(struct NwGtpv1uTunnelEndPoint *a, - struct NwGtpv1uTunnelEndPoint *b); - -static inline NwS32T -nwGtpv1uCompareSeqNum(struct NwGtpv1uTrxn *a, struct NwGtpv1uTrxn *b); - -RB_PROTOTYPE(NwGtpv1uOutstandingTxSeqNumTrxnMap, NwGtpv1uTrxn, - outstandingTxSeqNumMapRbtNode, nwGtpv1uCompareSeqNum) -RB_PROTOTYPE(NwGtpv1uOutstandingRxSeqNumTrxnMap, NwGtpv1uTrxn, - outstandingRxSeqNumMapRbtNode, nwGtpv1uCompareSeqNum) -RB_PROTOTYPE(NwGtpv1uTunnelEndPointTMap, NwGtpv1uTunnelEndPoint, - sessionMapRbtNode, nwGtpv1uCompareTeid) -RB_PROTOTYPE(NwGtpv1uTunnelEndPointIdentifierMap, NwGtpv1uTunnelEndPoint, - sessionMapRbtNode, nwGtpv1uCompareTeid) - -RB_GENERATE(NwGtpv1uOutstandingTxSeqNumTrxnMap, NwGtpv1uTrxn, - outstandingTxSeqNumMapRbtNode, nwGtpv1uCompareSeqNum) -RB_GENERATE(NwGtpv1uOutstandingRxSeqNumTrxnMap, NwGtpv1uTrxn, - outstandingRxSeqNumMapRbtNode, nwGtpv1uCompareSeqNum) -RB_GENERATE(NwGtpv1uTunnelEndPointTMap, NwGtpv1uTunnelEndPoint, - sessionMapRbtNode, nwGtpv1uCompareTeid) -RB_GENERATE(NwGtpv1uTunnelEndPointIdentifierMap, NwGtpv1uTunnelEndPoint, - sessionMapRbtNode, nwGtpv1uCompareTeid) - -/** - Comparator funtion for comparing two sessions. - - @param[in] a: Pointer to session a. - @param[in] b: Pointer to session b. - @return An integer greater than, equal to or less than zero according to whether the - object pointed to by a is greater than, equal to or less than the object pointed to by b. - */ - -static inline NwS32T -nwGtpv1uCompareTeid(struct NwGtpv1uTunnelEndPoint *a, - struct NwGtpv1uTunnelEndPoint *b) -{ - if(a->teid > b->teid) { - return 1; - } - - if(a->teid < b->teid) { - return -1; - } - - return 0; -} - -/** - Comparator funtion for comparing two sequence number transactions. - - @param[in] a: Pointer to session a. - @param[in] b: Pointer to session b. - @return An integer greater than, equal to or less than zero according to whether the - object pointed to by a is greater than, equal to or less than the object pointed to by b. - */ - -static inline NwS32T -nwGtpv1uCompareSeqNum(struct NwGtpv1uTrxn *a, struct NwGtpv1uTrxn *b) -{ - if(a->seqNum > b->seqNum) { - return 1; - } - - if(a->seqNum < b->seqNum) { - return -1; - } - - if(a->peerIp > b->peerIp) { - return 1; - } - - if(a->peerIp < b->peerIp) { - return -1; - } - - return 0; -} - -/** - Create and Send GTPU message. - - @param[in] thiz: Stack handle - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uCreateAndSendMsg( NwGtpv1uStackT *thiz, uint32_t peerIp, uint16_t peerPort, - NwGtpv1uMsgT *pMsg) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - uint8_t *msgHdr; - - NW_ASSERT(thiz); - NW_ASSERT(pMsg); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - msgHdr = &pMsg->msgBuf[pMsg->msgBufOffset]; - NW_ASSERT(msgHdr != NULL); - - *(msgHdr++) = (pMsg->version << 5) | - (pMsg->protocolType << 4) | - (pMsg->extHdrFlag << 2) | - (pMsg->seqNumFlag << 1) | - (pMsg->npduNumFlag); - - *(msgHdr++) = (pMsg->msgType); - *((uint16_t *) msgHdr) = htons(pMsg->msgLen); - msgHdr += 2; - - *((uint32_t *) msgHdr) = htonl(pMsg->teid); - msgHdr += 4; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("nwGtpv1uCreateAndSendMsg to teid %u length %d offset %d\n", - pMsg->teid, - pMsg->msgLen, - pMsg->msgBufOffset); -#endif - - if(pMsg->seqNumFlag || pMsg->extHdrFlag || pMsg->npduNumFlag) { - *((uint16_t *) msgHdr) = (pMsg->seqNumFlag ? htons(pMsg->seqNum) : 0x0000); - msgHdr += 2; - - *((uint8_t *) msgHdr) = (pMsg->npduNumFlag ? htons(pMsg->npduNum) : 0x00); - msgHdr++; - - *((uint8_t *) msgHdr) = (pMsg->extHdrFlag ? htons(pMsg->nextExtHdrType) : 0x00); - msgHdr++; - } - - rc = thiz->udp.udpDataReqCallback(thiz->udp.hUdp, - pMsg->msgBuf, - pMsg->msgBufLen, - pMsg->msgBufOffset, - peerIp, - peerPort); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - * Send GTPv1u Message Indication to ULP entity. - * - * @param[in] hGtpuStackHandle : Stack handle - * @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uSendUlpMessageIndication( NW_IN NwGtpv1uStackT *thiz, - NW_IN uint32_t hUlpTrxn, - NW_IN uint32_t apiType, - NW_IN uint32_t msgType, - NW_IN uint32_t peerIp, - NW_IN uint16_t peerPort, - NW_IN uint8_t *pMsgBuf, - NW_IN uint16_t msgLength) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uUlpApiT ulpApi; - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - ulpApi.apiType = apiType; - ulpApi.apiInfo.recvMsgInfo.msgType = msgType; - ulpApi.apiInfo.recvMsgInfo.hUlpTrxn = hUlpTrxn; - ulpApi.apiInfo.recvMsgInfo.peerIp = peerIp; - ulpApi.apiInfo.recvMsgInfo.peerPort = peerPort; - - if(pMsgBuf && msgLength) { - rc = nwGtpv1uMsgFromBufferNew((NwGtpv1uStackHandleT)thiz, pMsgBuf, msgLength, - &(ulpApi.apiInfo.recvMsgInfo.hMsg)); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - rc = thiz->ulp.ulpReqCallback(thiz->ulp.hUlp, &ulpApi); - NW_ASSERT(rc == NW_GTPV1U_OK); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - - return rc; -} - -NwGtpv1uRcT -nwGtpv1uPeerRspTimeout(void *arg) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTrxnT *thiz; - NwGtpv1uTimeoutInfoT *timeoutInfo = arg; - - GTPU_WARNING( "Retransmission timer expired\n"); - - thiz = ((NwGtpv1uTrxnT *)timeoutInfo->timeoutArg); - rc = thiz->pStack->udp.udpDataReqCallback(thiz->pStack->udp.hUdp, - thiz->pMsg->msgBuf, - thiz->pMsg->msgLen, - thiz->pMsg->msgBufOffset, - thiz->peerIp, - thiz->peerPort); - - if(thiz->maxRetries) { - rc = thiz->pStack->tmrMgr.tmrStartCallback(thiz->pStack->tmrMgr.tmrMgrHandle, - 5, 0, NW_GTPV1U_TMR_TYPE_ONE_SHOT, (void *)timeoutInfo, &thiz->hRspTmr); - thiz->maxRetries--; - } else { - /* Inform session layer about path fialure */ - GTPU_WARNING("Max retries over!\n"); - } - - return rc; -} - -/*--------------------------------------------------------------------------- - * ULP API Processing Functions - *--------------------------------------------------------------------------*/ - -/** - Process NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT Request from ULP entity. - - @param[in] hGtpuStackHandle : Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -NwGtpv1uCreateTunnelEndPoint( NW_IN NwGtpv1uStackT *thiz, - NW_IN uint32_t teid, - NW_IN NwGtpv1uUlpSessionHandleT hUlpSession, - NW_OUT NwGtpv1uStackSessionHandleT *phStackSession ) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTunnelEndPointT *pTunnelEndPoint; - NwGtpv1uTunnelEndPointT *pCollision; - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - pTunnelEndPoint = nwGtpTunnelEndPointNew(thiz); - - if(pTunnelEndPoint) { - - pTunnelEndPoint->teid = teid; - pTunnelEndPoint->pStack = thiz; - pTunnelEndPoint->hUlpSession = hUlpSession; - - pCollision = RB_INSERT(NwGtpv1uTunnelEndPointIdentifierMap, &(thiz->teidMap), - pTunnelEndPoint); - - if(pCollision) { - GTPU_ERROR("Tunnel end-point cannot be created for teid 0x%x. " - "Tunnel already exists", teid); - rc = nwGtpTunnelEndPointDestroy(thiz, pTunnelEndPoint); - NW_ASSERT(rc == NW_GTPV1U_OK); - *phStackSession = (NwGtpv1uStackSessionHandleT) NULL; - NW_ASSERT(0); - rc = NW_GTPV1U_FAILURE; - } else { - *phStackSession = (NwGtpv1uStackSessionHandleT) pTunnelEndPoint; - pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap, - &(thiz->teidMap), pTunnelEndPoint); - //NW_ASSERT(pTunnelEndPoint); - if (!pTunnelEndPoint) { - GTPU_ERROR("Tunnel end-point cannot be NULL"); - rc = NW_GTPV1U_FAILURE; - } else { - GTPU_DEBUG("Tunnel end-point 0x%p creation successful for teid 0x%x %u(dec)", - pTunnelEndPoint, (unsigned int)teid, (unsigned int)teid); - } - } - - } else { - *phStackSession = (NwGtpv1uStackSessionHandleT) NULL; - rc = NW_GTPV1U_FAILURE; - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - Process NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT Request from ULP entity. - - @param[in] hGtpuStackHandle : Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uDestroyTunnelEndPoint( NwGtpv1uStackT *thiz, - NW_IN NwGtpv1uUlpApiT *pUlpReq) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTunnelEndPointT *pRemovedTeid; - - if(pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle) { - GTPU_DEBUG( "Destroying Tunnel end-point '%lx'", - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle); - pRemovedTeid = RB_REMOVE(NwGtpv1uTunnelEndPointIdentifierMap, &(thiz->teidMap), - (NwGtpv1uTunnelEndPointT *)( - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle)); - - NW_ASSERT(pRemovedTeid == (NwGtpv1uTunnelEndPointT *)( - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle)); - - rc = nwGtpTunnelEndPointDestroy(thiz, - (NwGtpv1uTunnelEndPointT *) - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle); - } else { - GTPU_WARNING("Non-existent Tunnel end-point handle '%lx'", - pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle); - } - - return rc; -} - -/** - Process NW_GTPV1U_ULP_API_INITIAL_REQ Request from ULP entity. - - @param[in] hGtpuStackHandle : Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uInitialReq( NW_IN NwGtpv1uStackT *thiz, NW_IN NwGtpv1uUlpApiT *pUlpReq) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uTrxnT *pTrxn; - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - /* Create New Transaction */ - rc = nwGtpv1uTrxnNew(thiz, &pTrxn); - - if(pTrxn) { - rc = nwGtpv1uTrxnCreateAndSendMsg(thiz, - pTrxn, - pUlpReq->apiInfo.initialReqInfo.peerIp, - pUlpReq->apiInfo.initialReqInfo.peerPort, - (NwGtpv1uMsgT *) pUlpReq->hMsg); - - if(rc == NW_GTPV1U_OK) { - /* Insert into search tree */ - RB_INSERT(NwGtpv1uOutstandingTxSeqNumTrxnMap, &(thiz->outstandingTxSeqNumMap), - pTrxn); - } else { - rc = nwGtpv1uTrxnDelete(&pTrxn); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - Process NW_GTPV1U_ULP_API_SEND_TPDU Request from ULP entity. - - @param[in] thiz: Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uSendto( NwGtpv1uStackT *thiz, NW_IN NwGtpv1uUlpApiT *pUlpReq) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - - NW_ASSERT(thiz); -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - (void) nwGtpv1uMsgSetTeid(pUlpReq->apiInfo.sendtoInfo.hMsg, - pUlpReq->apiInfo.sendtoInfo.teid); - - rc = nwGtpv1uCreateAndSendMsg(thiz, - pUlpReq->apiInfo.sendtoInfo.ipAddr, - 2152, - (NwGtpv1uMsgT *) (NwGtpv1uMsgT *) pUlpReq->apiInfo.sendtoInfo.hMsg); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - Process GPDU from UDP entity. - - @param[in] thiz: Stack handle - @param[in] pUlpReq : Pointer to Ulp Req. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz, - NW_IN uint8_t *gpdu, - NW_IN uint32_t gpduLen, - NW_IN uint32_t peerIp) - -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uMsgHeaderT *msgHdr = NULL; - NwGtpv1uTunnelEndPointT *pTunnelEndPoint = NULL; - NwGtpv1uTunnelEndPointT tunnelEndPointKey; - // uint16_t hdr_len = 0; - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - // no buffer offset - msgHdr = (NwGtpv1uMsgHeaderT *) gpdu; - - tunnelEndPointKey.teid = ntohl(msgHdr->teid); - - pTunnelEndPoint = RB_FIND(NwGtpv1uTunnelEndPointIdentifierMap, - &(thiz->teidMap), &tunnelEndPointKey); - - if(pTunnelEndPoint) { - NwGtpv1uMsgHandleT hMsg; - - rc = nwGtpv1uMsgFromBufferNew( (NwGtpv1uStackHandleT)thiz, - (uint8_t *)gpdu, - gpduLen, - &hMsg); - - /* - uint8_t* msgBuf; - uint32_t msgBufLen; - uint32_t msgBufOffset; - */ - if(NW_GTPV1U_OK == rc) { - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("Received T-PDU over tunnel end-point '%x' of size %u (%u) (decapsulated %u)from "NW_IPV4_ADDR"\n", - ntohl(msgHdr->teid), gpduLen, pMsg->msgLen, pMsg->msgBufLen, NW_IPV4_ADDR_FORMAT((peerIp))); -#endif - MSC_LOG_RX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - " G-PDU ltid %u size %u", - tunnelEndPointKey.teid, - gpduLen); - - rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg); - } - } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - " G-PDU ltid %u size %u", - tunnelEndPointKey.teid, - gpduLen); - GTPU_DEBUG("Received T-PDU over non-existent tunnel end-point '%x' from "NW_IPV4_ADDR"\n", - ntohl(msgHdr->teid), NW_IPV4_ADDR_FORMAT((peerIp))); - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/** - Handle Echo Request from Peer Entity. - - @param[in] thiz : Stack context - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, - NW_IN uint8_t *msgBuf, - NW_IN uint32_t msgBufLen, - NW_IN uint16_t peerPort, - NW_IN uint32_t peerIp) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - uint16_t seqNum = 0; - NwGtpv1uMsgHandleT hMsg = 0; - int bufLen = 0; - - seqNum = ntohs(*(uint16_t *) (msgBuf + (((*msgBuf) & 0x02) ? 8 : 4))); - - MSC_LOG_RX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" ECHO-REQ seq %u size %u", - 0,0,seqNum, msgBufLen); - /* Send Echo Response */ - - rc = nwGtpv1uMsgNew( (NwGtpv1uStackHandleT)thiz, - NW_TRUE, /* SeqNum flag */ - NW_FALSE, - NW_FALSE, - NW_GTP_ECHO_RSP, /* Msg Type */ - 0x00000000U, /* TEID */ - seqNum, /* Seq Number */ - 0, - 0, - (&hMsg)); - - bufLen = sizeof(NwGtpv1uIeTv1T)+ ((NwGtpv1uMsgT*)hMsg)->msgLen; - -//#warning CROUX DIRTY +16, TO BE FIXED!!! - /* the +16 is there because by analyzing memory allocation with some external - * tool, I saw that there were 6 bytes accessed after bufLen in nwGtpv1uCreateAndSendMsg - * the value "16" has been chosen arbitrarily, just bigger than 6 - */ - ((NwGtpv1uMsgT*)hMsg)->msgBuf = itti_malloc( - TASK_GTPV1_U, - TASK_UDP, - bufLen + 16 /* CROUX - dirty +16, to be fixed! */); - ((NwGtpv1uMsgT*)hMsg)->msgBufLen = bufLen; - NW_ASSERT(NW_GTPV1U_OK == rc); - - /* - * The Restart Counter value in the Recovery information element shall - * not be used, i.e. it shall be set to zero by the sender and shall be - * ignored by the receiver. - */ - rc = nwGtpv1uMsgAddIeTV1(hMsg, NW_GTPV1U_IE_RECOVERY, 0x00); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_INFO("Sending NW_GTP_ECHO_RSP message to %x:%x with seq %u\n", - peerIp, - peerPort, - seqNum); -#endif - MSC_LOG_TX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" ECHO-RSP seq %u", - 0,0,seqNum); - rc = nwGtpv1uCreateAndSendMsg( - thiz, - peerIp, - peerPort, - (NwGtpv1uMsgT *) hMsg); - - rc = nwGtpv1uMsgDelete((NwGtpv1uStackHandleT)thiz, hMsg); - NW_ASSERT(NW_GTPV1U_OK == rc); - - return rc; -} - -/*--------------------------------------------------------------------------* - * P U B L I C F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------- - * Constructor - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, uint32_t stackType) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz; - - thiz = (NwGtpv1uStackT *) malloc( sizeof(NwGtpv1uStackT)); - - if(thiz) { - memset(thiz, 0, sizeof(NwGtpv1uStackT)); - thiz->id = (NwPtrT)thiz; - thiz->stackType = stackType; - thiz->seq = (uint16_t) ((uintptr_t)thiz) ; // FIXME interesting casts... don't know what this is good for... - RB_INIT(&(thiz->outstandingTxSeqNumMap)); - RB_INIT(&(thiz->outstandingRxSeqNumMap)); - RB_INIT(&(thiz->sessionMap)); - RB_INIT(&(thiz->teidMap)); - - if (0 == 1) { - nwGtpv1uDisplayBanner(); - } - - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - - *hGtpuStackHandle = (NwGtpv1uStackHandleT) thiz; - return rc; -} - - -/*--------------------------------------------------------------------------- - * Destructor - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uFinalize( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - - if(hGtpuStackHandle) { - free((void *)hGtpuStackHandle); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - - -/*--------------------------------------------------------------------------- - * Configuration Get/Set - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uSetUlpEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uUlpEntityT *pUlpEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pUlpEntity) { - thiz->ulp = *(pUlpEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - - -NwGtpv1uRcT -nwGtpv1uSetUdpEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uUdpEntityT *pUdpEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pUdpEntity) { - thiz->udp = *(pUdpEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - -NwGtpv1uRcT -nwGtpv1uSetMemMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMemMgrEntityT *pMemMgrEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pMemMgrEntity) { - thiz->memMgr = *(pMemMgrEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - - -NwGtpv1uRcT -nwGtpv1uSetTimerMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uTimerMgrEntityT *pTmrMgrEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pTmrMgrEntity) { - thiz->tmrMgr = *(pTmrMgrEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - - -NwGtpv1uRcT -nwGtpv1uSetLogMgrEntity( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uLogMgrEntityT *pLogMgrEntity) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - if(pLogMgrEntity) { - thiz->logMgr = *(pLogMgrEntity); - rc = NW_GTPV1U_OK; - } else { - rc = NW_GTPV1U_FAILURE; - } - - return rc; -} - -NwGtpv1uRcT -nwGtpv1uSetLogLevel( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint32_t logLevel) -{ - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - thiz->logLevel = logLevel; - return NW_GTPV1U_OK; -} - -/*--------------------------------------------------------------------------- - * Process Request from Udp Layer - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uProcessUdpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t *udpData, - NW_IN uint32_t udpDataLen, - NW_IN uint16_t peerPort, - NW_IN uint32_t peerIp) -{ - NwGtpv1uRcT ret = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz; - uint16_t msgType; - -#if defined(ENB_MODE) - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_UDP_REQ, VCD_FUNCTION_IN); -#endif - thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - NW_ASSERT(thiz); - - msgType = *((uint8_t *)(udpData + 1)); - - switch(msgType) { - case NW_GTP_ECHO_REQ: - GTPU_DEBUG("NW_GTP_ECHO_REQ\n"); - ret = nwGtpv1uHandleEchoReq( thiz, udpData, udpDataLen, peerPort, peerIp); - break; - - case NW_GTP_ERROR_INDICATION: - GTPU_DEBUG("NW_GTP_ERROR_INDICATION\n"); - ret = nwGtpv1uSendUlpMessageIndication( thiz, - 0, - NW_GTPV1U_ULP_API_RECV_MSG, - msgType, - peerIp, - peerPort, - udpData, - udpDataLen); - - NW_ASSERT(ret == NW_GTPV1U_OK); - break; - - case NW_GTP_ECHO_RSP: - GTPU_DEBUG("NW_GTP_ECHO_RSP\n"); - ret = NW_GTPV1U_OK; - break; - - case NW_GTP_GPDU: -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("NW_GTP_GPDU: DATA COMING FROM UDP\n"); -#endif - ret = nwGtpv1uProcessGpdu(thiz, udpData, udpDataLen, peerIp); - break; - - case NW_GTP_END_MARKER: -#if defined(LOG_GTPU) && LOG_GTPU > 0 - for(int i =1; i<= udpDataLen; i++){ - printf("%02x ", (uint8_t)udpData[i-1]); - if(i % 20 == 0)printf("\n"); - } -#endif - GTPU_INFO("NW_GTP_END_MARKER\n"); - ret = nwGtpv1uProcessGpdu(thiz, udpData, udpDataLen, peerIp); - break; - - default: - ret = NW_GTPV1U_FAILURE; - NW_ASSERT(0); - break; - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif -#if defined(ENB_MODE) - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_PROCESS_UDP_REQ, VCD_FUNCTION_OUT); -#endif - return ret; -} - - -/*--------------------------------------------------------------------------- - * Process Request from Upper Layer - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uProcessUlpReq( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uUlpApiT *pUlpReq) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz = (NwGtpv1uStackT *) hGtpuStackHandle; - - NW_ASSERT(thiz); - NW_ASSERT(pUlpReq != NULL); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - - switch(pUlpReq->apiType) { - case NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT: { - GTPU_DEBUG("Received NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT from ulp\n"); - rc = NwGtpv1uCreateTunnelEndPoint(thiz, - pUlpReq->apiInfo.createTunnelEndPointInfo.teid, - pUlpReq->apiInfo.createTunnelEndPointInfo.hUlpSession, - &(pUlpReq->apiInfo.createTunnelEndPointInfo.hStackSession)); - } - break; - - case NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT: { - GTPU_DEBUG("Received destroy session req from ulp\n"); - rc = nwGtpv1uDestroyTunnelEndPoint(thiz, pUlpReq); - } - break; - - case NW_GTPV1U_ULP_API_INITIAL_REQ: { - GTPU_DEBUG("Received initial req from ulp\n"); - rc = nwGtpv1uInitialReq(thiz, pUlpReq); - } - break; - - case NW_GTPV1U_ULP_API_SEND_TPDU: { -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("Received send tpdu req from ulp\n"); -#endif - rc = nwGtpv1uSendto(thiz, pUlpReq); - } - break; - - default: - GTPU_DEBUG("Unsupported API received from ulp\n"); - rc = NW_GTPV1U_FAILURE; - break; - } - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -/*--------------------------------------------------------------------------- - * Process Timer timeout Request from Timer Manager - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwGtpv1uProcessTimeout(void *timeoutInfo) -{ - NwGtpv1uRcT rc = NW_GTPV1U_FAILURE; - NwGtpv1uStackT *thiz; - - NW_ASSERT(timeoutInfo != NULL); - - thiz = (NwGtpv1uStackT *) (((NwGtpv1uTimeoutInfoT *) timeoutInfo)->hStack); - - NW_ASSERT(thiz != NULL); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_ENTER(thiz); -#endif - GTPU_DEBUG("Received timeout event from ULP with timeoutInfo 0x%p!\n", - timeoutInfo); - - rc = (((NwGtpv1uTimeoutInfoT *) timeoutInfo)->timeoutCallbackFunc) (timeoutInfo); - -#if defined(LOG_GTPU) && LOG_GTPU > 0 - NW_LEAVE(thiz); -#endif - return rc; -} - -#ifdef __cplusplus -} -#endif - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ - diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c deleted file mode 100644 index 365d6d23a5..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uMsg.c +++ /dev/null @@ -1,558 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwLog.h" -#include "NwUtils.h" -#include "NwGtpv1uLog.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uMsg.h" -#include "assertions.h" - -#include "gtpv1u.h" -#if defined(ENB_MODE) -#include "common/utils/LOG/log.h" -#endif - -#define NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE (12) /**< Size of GTPv1u EPC specific header */ -#define NW_GTPV1U_EPC_MIN_HEADER_SIZE (8) - -#ifdef __cplusplus -extern "C" { -#endif - -static NwGtpv1uMsgT *gpGtpv1uMsgPool = NULL; - -NwGtpv1uRcT -nwGtpv1uMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t seqNumFlag, - NW_IN uint8_t npduNumFlag, - NW_IN uint8_t extHdrFlag, - NW_IN uint8_t msgType, - NW_IN uint8_t teid, - NW_IN uint16_t seqNum, - NW_IN uint8_t npduNum, - NW_IN uint8_t nextExtHeader, - NW_OUT NwGtpv1uMsgHandleT *phMsg) -{ - NwGtpv1uStackT *pStack = (NwGtpv1uStackT *) hGtpuStackHandle; - NwGtpv1uMsgT *pMsg; - - if(gpGtpv1uMsgPool) { - pMsg = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = gpGtpv1uMsgPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uMsgT), pMsg, NwGtpv1uMsgT *); - } - - - if(pMsg) { - pMsg->version = NW_GTPU_VERSION; - pMsg->protocolType = NW_GTP_PROTOCOL_TYPE_GTP; - pMsg->seqNumFlag = seqNumFlag; - pMsg->npduNumFlag = npduNumFlag; - pMsg->extHdrFlag = extHdrFlag; - pMsg->msgType = msgType; - - if(seqNumFlag) { - pMsg->seqNum = seqNum; - } - - if(npduNumFlag) { - pMsg->npduNum = npduNum; - } - - if(extHdrFlag) { - pMsg->nextExtHdrType = nextExtHeader; - } - - pMsg->msgLen = ((pMsg->seqNumFlag || pMsg->npduNumFlag - || pMsg->extHdrFlag) ? - 4 : 0); - //NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE : (NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE - 4)); - - pMsg->msgBuf = NULL; - pMsg->msgBufLen = 0; - pMsg->msgBufOffset = 0; - *phMsg = (NwGtpv1uMsgHandleT) pMsg; - return NW_GTPV1U_OK; - } - - return NW_GTPV1U_FAILURE; -} - -NwGtpv1uRcT -nwGtpv1uGpduMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint32_t teid, - NW_IN uint8_t seqNumFlag, - NW_IN uint16_t seqNum, - NW_IN uint8_t *tpdu, - NW_IN uint16_t tpduLength, - NW_IN uint32_t tpduOffset, - NW_OUT NwGtpv1uMsgHandleT *phMsg) -{ - NwGtpv1uStackT *pStack = (NwGtpv1uStackT *) hGtpuStackHandle; - NwGtpv1uMsgT *pMsg; - //uint32_t header_len = 0; - uint32_t msgExtraLen = 0; - - if(gpGtpv1uMsgPool) { - pMsg = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = gpGtpv1uMsgPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uMsgT), pMsg, NwGtpv1uMsgT *); - } - - if(pMsg) { - msgExtraLen = (((seqNumFlag) || (NW_FALSE) || (NW_FALSE) ) ? - (NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE - NW_GTPV1U_EPC_MIN_HEADER_SIZE) : 0); - AssertFatal((msgExtraLen + NW_GTPV1U_EPC_MIN_HEADER_SIZE) <= tpduOffset, - "Mismatch GTPU len, msgExtraLen %u tpduOffset %u", - msgExtraLen, - (uint32_t) tpduOffset); - pMsg->msgBuf = tpdu; - pMsg->msgBufLen = tpduLength + msgExtraLen + NW_GTPV1U_EPC_MIN_HEADER_SIZE; - pMsg->msgBufOffset = tpduOffset - (msgExtraLen + NW_GTPV1U_EPC_MIN_HEADER_SIZE); -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("MSG length %u, offset %u -> length %u offset %u\n", - tpduLength, tpduOffset, - pMsg->msgBufLen, pMsg->msgBufOffset); -#endif - - // Version field: This field is used to determine the version of the GTP-U protocol. - // The version number shall be set to '1'. - pMsg->version = NW_GTPU_VERSION; - // Protocol Type (PT): This bit is used as a protocol discriminator between GTP (when PT is '1') - // and GTP' (when PT is '0'). GTP is described in this document and the GTP' protocol in 3GPP TS 32.295 [8]. - // Note that the interpretation of the header fields may be different in GTP' than in GTP. - pMsg->protocolType = NW_GTP_PROTOCOL_TYPE_GTP; - // Extension Header flag (E): This flag indicates the presence of a meaningful value of the Next Extension - // Header field. When it is set to '0', the Next Extension Header field either is not present or, if present, - // shall not be interpreted. - pMsg->extHdrFlag = NW_FALSE; - // Sequence number flag (S): This flag indicates the presence of a meaningful value of the Sequence Number field. - // When it is set to '0', the Sequence Number field either is not present or, if present, shall not be interpreted. - // When it is set to '1', the Sequence Number field is present, and shall be interpreted, as described below in - // this section. - // For the Echo Request, Echo Response, Error Indication and Supported Extension Headers Notification - // messages, the S flag shall be set to '1'. Since the use of Sequence Numbers is optional for G-PDUs, the PGW, - // SGW, ePDG and eNodeB should set the flag to '0'. However, when a G-PDU (T-PDU+header) is being relayed - // by the Indirect Data Forwarding for Inter RAT HO procedure, then if the received G-PDU has the S flag set to - // '1', then the relaying entity shall set S flag to '1' and forward the G-PDU (T-PDU+header). In an End marker - // message the S flag shall be set to '0'. - pMsg->seqNumFlag = (seqNumFlag? NW_TRUE : NW_FALSE); - pMsg->seqNum = seqNum; - // N-PDU Number flag (PN): This flag indicates the presence of a meaningful value of the N-PDU Number field. - // When it is set to '0', the N-PDU Number field either is not present, or, if present, shall not be interpreted. - // When it is set to '1', the N-PDU Number field is present, and shall be interpreted. - pMsg->npduNumFlag = NW_FALSE; - pMsg->npduNum = 0x00; - // Message Type: This field indicates the type of GTP-U message. - pMsg->msgType = NW_GTP_GPDU; - // Length: This field indicates the length in octets of the payload, i.e. the rest of the packet following the - // mandatory part of the GTP header (that is the first 8 octets). - // The Sequence Number, the N-PDU Number or any Extension headers shall be considered to be part of the payload, - // i.e. included in the length count. - //header_len = ((pMsg->seqNumFlag || pMsg->npduNumFlag || pMsg->extHdrFlag ) ? - // NW_GTPV1U_EPC_SPECIFIC_HEADER_SIZE : NW_GTPV1U_EPC_MIN_HEADER_SIZE); - pMsg->msgLen = msgExtraLen + tpduLength; - - // Tunnel Endpoint Identifier (TEID): This field unambiguously identifies a tunnel endpoint in the receiving - // GTP-U protocol entity. The receiving end side of a GTP tunnel locally assigns the TEID value the transmitting - // side has to use. The TEID shall be used by the receiving entity to find the PDP context, except for the - // following cases: - // - The Echo Request/Response and Supported Extension Headers notification messages, where the Tunnel - // Endpoint Identifier shall be set to all zeroes. - // - The Error Indication message where the Tunnel Endpoint Identifier shall be set to all zeros. - pMsg->teid = teid; - pMsg->nextExtHdrType= 0x00; - - //memcpy(pMsg->msgBuf + header_len, tpdu, tpduLength); - *phMsg = (NwGtpv1uMsgHandleT) pMsg; - return NW_GTPV1U_OK; - } - - return NW_GTPV1U_FAILURE; -} - -NwGtpv1uRcT -nwGtpv1uMsgFromMsgNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMsgHandleT hMsg, - NW_OUT NwGtpv1uMsgHandleT *phMsg) -{ - NwGtpv1uStackT *pStack = (NwGtpv1uStackT *) hGtpuStackHandle; - NwGtpv1uMsgT *pMsg; - - if(gpGtpv1uMsgPool) { - pMsg = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = gpGtpv1uMsgPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uMsgT), pMsg, NwGtpv1uMsgT *); - } - - - if(pMsg) { - memcpy(pMsg, (NwGtpv1uMsgT *)hMsg, sizeof(NwGtpv1uMsgT)); - *phMsg = (NwGtpv1uMsgHandleT) pMsg; - return NW_GTPV1U_OK; - } - - return NW_GTPV1U_FAILURE; -} - -NwGtpv1uRcT -nwGtpv1uMsgFromBufferNew( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN uint8_t *pBuf, - NW_IN uint32_t bufLen, - NW_OUT NwGtpv1uMsgHandleT *phMsg) -{ - NwGtpv1uStackT *pStack = (NwGtpv1uStackT *) hGtpuStackHandle; - NwGtpv1uMsgT *pMsg; - - if(gpGtpv1uMsgPool) { - pMsg = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = gpGtpv1uMsgPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uMsgT), pMsg, NwGtpv1uMsgT *); - } - - - if(pMsg) { - pMsg->msgBuf = pBuf; - - pMsg->version = ((*pBuf) & 0xE0) >> 5; - pMsg->protocolType = ((*pBuf) & 0x10) >> 4; - pMsg->extHdrFlag = ((*pBuf) & 0x04) >> 2; - pMsg->seqNumFlag = ((*pBuf) & 0x02) >> 1; - pMsg->npduNumFlag = ((*pBuf) & 0x01); - pBuf++; - - pMsg->msgType = *(pBuf); - pBuf++; - - pBuf += 2; - - pMsg->teid = ntohl(*((uint32_t *)pBuf)); - pBuf += 4; - - if(pMsg->extHdrFlag || pMsg->seqNumFlag || pMsg->npduNumFlag) { - pMsg->seqNum = ntohs(*(((uint16_t *)pBuf))); - pBuf += 2; - pMsg->npduNum = *(pBuf++); - pMsg->nextExtHdrType = *(pBuf++); - } - - pMsg->msgBufOffset = (uint32_t)(pBuf - pMsg->msgBuf); - pMsg->msgBufLen = bufLen - pMsg->msgBufOffset; - pMsg->msgLen = bufLen; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("nwGtpv1uMsgFromBufferNew() msgLen %u msgBufLen %u msgBufOffset %u ", - pMsg->msgLen, pMsg->msgBufLen, pMsg->msgBufOffset); -#endif - *phMsg = (NwGtpv1uMsgHandleT) pMsg; - return NW_GTPV1U_OK; - } - - return NW_GTPV1U_FAILURE; -} - -NwGtpv1uRcT -nwGtpv1uMsgDelete( NW_IN NwGtpv1uStackHandleT hGtpuStackHandle, - NW_IN NwGtpv1uMsgHandleT hMsg) -{ - ((NwGtpv1uMsgT *)hMsg)->next = gpGtpv1uMsgPool; - gpGtpv1uMsgPool = (NwGtpv1uMsgT *) hMsg; - return NW_GTPV1U_OK; -} - -/** - * Set TEID for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] teid: TEID value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetTeid(NW_IN NwGtpv1uMsgHandleT hMsg, uint32_t teid) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - thiz->teid = teid; -#if defined(LOG_GTPU) && LOG_GTPU > 0 - GTPU_DEBUG("nwGtpv1uMsgSetTeid() teid %u", teid); -#endif - return NW_GTPV1U_OK; -} - -/** - * Set sequence for gtpv1u message. - * - * @param[in] hMsg : Message handle. - * @param[in] seqNum: Flag boolean value. - */ - -NwGtpv1uRcT -nwGtpv1uMsgSetSeqNumber(NW_IN NwGtpv1uMsgHandleT hMsg, uint32_t seqNum) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - thiz->seqNum = seqNum; - return NW_GTPV1U_OK; -} - -/** - * Get TEID present for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetTeid(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->teid); -} - - -/** - * Get sequence number for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetSeqNumber(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->seqNum); -} - -/** - * Get msg type for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -uint32_t -nwGtpv1uMsgGetMsgType(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->msgType); -} - -/** - * Get tpdu for gtpv1u message. - * - * @param[in] hMsg : Message handle. - */ - -NwGtpv1uRcT -nwGtpv1uMsgGetTpdu(NW_IN NwGtpv1uMsgHandleT hMsg, uint8_t *pTpduBuf, - uint32_t *pTpduLength) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - uint8_t headerLength = ((thiz->seqNumFlag || thiz->extHdrFlag - || thiz->npduNumFlag) ? 12 : 8); - - *pTpduLength = thiz->msgLen - headerLength; - memcpy(pTpduBuf, thiz->msgBuf + headerLength, *pTpduLength); - return NW_GTPV1U_OK; -} - -uint8_t * -nwGtpv1uMsgGetTpduHandle(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->msgBuf + ((thiz->seqNumFlag || thiz->extHdrFlag - || thiz->npduNumFlag) ? 12 : 8)); -} - -uint32_t -nwGtpv1uMsgGetTpduLength(NW_IN NwGtpv1uMsgHandleT hMsg) -{ - NwGtpv1uMsgT *thiz = (NwGtpv1uMsgT *) hMsg; - return (thiz->msgLen - ((thiz->seqNumFlag || thiz->extHdrFlag - || thiz->npduNumFlag) ? 12 : 8)); -} - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV1(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint8_t value) -{ - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - NwGtpv1uIeTv1T *pIe; - - pIe = (NwGtpv1uIeTv1T *) (pMsg->msgBuf + pMsg->msgLen); - - pIe->t = type; - pIe->v = value; - - pMsg->msgLen += sizeof(NwGtpv1uIeTv1T); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV2(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint16_t value) -{ - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - NwGtpv1uIeTv2T *pIe; - - pIe = (NwGtpv1uIeTv2T *) (pMsg->msgBuf + pMsg->msgLen); - - pIe->t = type; - pIe->v = htons(value); - - pMsg->msgLen += sizeof(NwGtpv1uIeTv2T); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwGtpv1uMsgAddIeTV4(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint32_t value) -{ - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - NwGtpv1uIeTv4T *pIe; - - pIe = (NwGtpv1uIeTv4T *) (pMsg->msgBuf + pMsg->msgLen); - - pIe->t = type; - pIe->v = htonl(value); - - pMsg->msgLen += sizeof(NwGtpv1uIeTv4T); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwGtpv1uMsgAddIe(NW_IN NwGtpv1uMsgHandleT hMsg, - NW_IN uint8_t type, - NW_IN uint16_t length, - NW_IN uint8_t *pVal) -{ - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - NwGtpv1uIeTlvT *pIe; - - pIe = (NwGtpv1uIeTlvT *) (pMsg->msgBuf + pMsg->msgLen); - - pIe->t = type; - pIe->l = htons(length); - - memcpy(pIe + 4, pVal, length); - pMsg->msgLen += (4 + length); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwGtpv1uMsgHexDump(NwGtpv1uMsgHandleT hMsg, FILE *fp) -{ - - NwGtpv1uMsgT *pMsg = (NwGtpv1uMsgT *) hMsg; - uint8_t *data = pMsg->msgBuf; - uint32_t size = pMsg->msgLen; - - unsigned char *p = (unsigned char *)data; - unsigned char c; - int n; - char bytestr[4] = {0}; - char addrstr[10] = {0}; - char hexstr[ 16*3 + 5] = {0}; - char charstr[16*1 + 5] = {0}; - fprintf((FILE *)fp, "\n"); - - for(n=1; n<=size; n++) { - if (n%16 == 1) { - /* store address for this line */ - snprintf(addrstr, sizeof(addrstr), "%.4lx", - (p-data) ); - } - - c = *p; - - if (isalnum(c) == 0) { - c = '.'; - } - - /* store hex str (for left side) */ - snprintf(bytestr, sizeof(bytestr), "%02X ", *p); - strncat(hexstr, bytestr, sizeof(hexstr)-strlen(hexstr)-1); - - /* store char str (for right side) */ - snprintf(bytestr, sizeof(bytestr), "%c", c); - strncat(charstr, bytestr, sizeof(charstr)-strlen(charstr)-1); - - if(n%16 == 0) { - /* line completed */ - fprintf((FILE *)fp, "[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr); - hexstr[0] = 0; - charstr[0] = 0; - } else if(n%8 == 0) { - /* half line: add whitespaces */ - strncat(hexstr, " ", sizeof(hexstr)-strlen(hexstr)-1); - strncat(charstr, " ", sizeof(charstr)-strlen(charstr)-1); - } - - p++; /* next byte */ - } - - if (strlen(hexstr) > 0) { - /* print rest of buffer if not empty */ - fprintf((FILE *)fp, "[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr); - - } - - fprintf((FILE *)fp, "\n"); - - return NW_GTPV1U_OK; -} - -#ifdef __cplusplus -} -#endif - - - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c deleted file mode 100644 index 27cb59050f..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTrxn.c +++ /dev/null @@ -1,399 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwLog.h" -#include "NwUtils.h" -#include "NwGtpv1uLog.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uTrxn.h" - -/*--------------------------------------------------------------------------* - * P R I V A T E D E C L A R A T I O N S * - *--------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" { -#endif - -static NwGtpv1uTrxnT *gpGtpv1uTrxnPool = NULL; - -/*--------------------------------------------------------------------------* - * P R I V A T E F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -/*--------------------------------------------------------------------------- - * Send msg retransmission to peer via data request to UDP Entity - *--------------------------------------------------------------------------*/ - -static NwGtpv1uRcT -nwGtpv1uTrxnSendMsgRetransmission(NwGtpv1uTrxnT *thiz) -{ - NwGtpv1uRcT rc; - - NW_ASSERT(thiz); - NW_ASSERT(thiz->pMsg); - - rc = thiz->pStack->udp.udpDataReqCallback(thiz->pStack->udp.hUdp, - thiz->pMsg->msgBuf, - thiz->pMsg->msgLen, - thiz->pMsg->msgBufOffset, - thiz->peerIp, - thiz->peerPort); - - return rc; -} - -static NwGtpv1uRcT -nwGtpv1uTrxnPeerRspTimeout(void *arg) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTrxnT *thiz; - NwGtpv1uStackT *pStack; - NwGtpv1uTimeoutInfoT *timeoutInfo = arg; - - thiz = ((NwGtpv1uTrxnT *)timeoutInfo->timeoutArg); - pStack = thiz->pStack; - - NW_ASSERT(pStack); - - NW_LOG(pStack, NW_LOG_LEVEL_WARN, "T3 timer expired for transaction 0x%p", - thiz); - - rc = nwGtpv1uTrxnSendMsgRetransmission(thiz); - - if(thiz->maxRetries) { - rc = pStack->tmrMgr.tmrStartCallback(pStack->tmrMgr.tmrMgrHandle, - thiz->t3Timer, 0, NW_GTPV1U_TMR_TYPE_ONE_SHOT, (void *)timeoutInfo, - &thiz->hRspTmr); - thiz->maxRetries--; - } else { - NwGtpv1uUlpApiT ulpApi; - ulpApi.apiType = NW_GTPV1U_ULP_API_RSP_FAILURE; - ulpApi.apiInfo.recvMsgInfo.msgType = nwGtpv1uMsgGetMsgType(( - NwGtpv1uMsgHandleT)thiz->pMsg); - ulpApi.apiInfo.recvMsgInfo.hUlpTrxn = thiz->hUlpTrxn; - ulpApi.apiInfo.recvMsgInfo.peerIp = thiz->peerIp; - ulpApi.apiInfo.recvMsgInfo.peerPort = thiz->peerPort; - thiz->hRspTmr = 0; - - rc = nwGtpv1uTrxnDelete(&thiz); - NW_ASSERT(rc == NW_GTPV1U_OK); - - rc = pStack->ulp.ulpReqCallback(pStack->ulp.hUlp, &ulpApi); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - return rc; -} - -/** - Send timer start request to TmrMgr Entity. - - @param[in] thiz : Pointer to transaction - @param[in] timeoutCallbackFunc : Timeout handler callback function. - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uTrxnStartPeerRspTimer(NwGtpv1uTrxnT *thiz, - NwGtpv1uRcT (*timeoutCallbackFunc)(void *)) -{ - NwGtpv1uRcT rc; - NwGtpv1uTimeoutInfoT *timeoutInfo; - - NW_ASSERT(thiz->pStack->tmrMgr.tmrStartCallback != NULL); - - timeoutInfo = &thiz->peerRspTimeoutInfo; - timeoutInfo->timeoutArg = thiz; - timeoutInfo->timeoutCallbackFunc = timeoutCallbackFunc; - timeoutInfo->hStack = (NwGtpv1uStackHandleT)thiz->pStack; - - rc = thiz->pStack->tmrMgr.tmrStartCallback(thiz->pStack->tmrMgr.tmrMgrHandle, - thiz->t3Timer, 0, NW_GTPV1U_TMR_TYPE_ONE_SHOT, (void *)timeoutInfo, - &thiz->hRspTmr); - - return rc; -} - -/** - Send timer stop request to TmrMgr Entity. - - @param[in] thiz : Pointer to transaction - @return NW_GTPV1U_OK on success. - */ - -static NwGtpv1uRcT -nwGtpv1uTrxnStopPeerRspTimer(NwGtpv1uTrxnT *thiz) -{ - NwGtpv1uRcT rc; - - NW_ASSERT(thiz->pStack->tmrMgr.tmrStopCallback != NULL); - - rc = thiz->pStack->tmrMgr.tmrStopCallback(thiz->pStack->tmrMgr.tmrMgrHandle, - thiz->hRspTmr); - - thiz->hRspTmr = 0; - - return rc; -} - -/*--------------------------------------------------------------------------* - * P U B L I C F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -/** - * Constructor - * - * @param[in] thiz : Pointer to stack - * @param[out] ppTrxn : Pointer to pointer to Trxn object. - * @return NW_GTPV1U_OK on success. - */ -NwGtpv1uRcT -nwGtpv1uTrxnNew( NW_IN NwGtpv1uStackT *thiz, - NW_OUT NwGtpv1uTrxnT **ppTrxn) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTrxnT *pTrxn; - - if(gpGtpv1uTrxnPool) { - pTrxn = gpGtpv1uTrxnPool; - gpGtpv1uTrxnPool = gpGtpv1uTrxnPool->next; - } else { - NW_GTPV1U_MALLOC(thiz, sizeof(NwGtpv1uTrxnT), pTrxn, NwGtpv1uTrxnT *); - } - - if (pTrxn) { - pTrxn->maxRetries = 2; - pTrxn->pStack = thiz; - pTrxn->t3Timer = 2; - pTrxn->seqNum = thiz->seq; - - /* Increment sequence number */ - thiz->seq++; - - if(thiz->seq == 0x800000) { - thiz->seq = 0; - } - - } else { - rc = NW_GTPV1U_FAILURE; - } - - NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%p", pTrxn); - - *ppTrxn = pTrxn; - - return rc; -} - -/** - * Overloaded Constructor - * - * @param[in] thiz : Pointer to stack. - * @param[in] seqNum : Sequence number for this transaction. - * @param[out] ppTrxn : Pointer to pointer to Trxn object. - * @return NW_GTPV1U_OK on success. - */ -NwGtpv1uRcT -nwGtpv1uTrxnWithSeqNew( NW_IN NwGtpv1uStackT *thiz, - NW_IN uint32_t seqNum, - NW_OUT NwGtpv1uTrxnT **ppTrxn) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uTrxnT *pTrxn; - - if(gpGtpv1uTrxnPool) { - pTrxn = gpGtpv1uTrxnPool; - gpGtpv1uTrxnPool = gpGtpv1uTrxnPool->next; - } else { - NW_GTPV1U_MALLOC(thiz, sizeof(NwGtpv1uTrxnT), pTrxn, NwGtpv1uTrxnT *); - } - - - if (pTrxn) { - pTrxn->maxRetries = 2; - pTrxn->pStack = thiz; - pTrxn->t3Timer = 2; - pTrxn->seqNum = seqNum; - pTrxn->pMsg = NULL; - } else { - rc = NW_GTPV1U_FAILURE; - } - - NW_LOG(thiz, NW_LOG_LEVEL_DEBG, "Created transaction 0x%p", pTrxn); - - *ppTrxn = pTrxn; - - return rc; -} - -/** - * Destructor - * - * @param[out] pthiz : Pointer to pointer to Trxn object. - * @return NW_GTPV1U_OK on success. - */ -NwGtpv1uRcT -nwGtpv1uTrxnDelete( NW_INOUT NwGtpv1uTrxnT **pthiz) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uStackT *pStack; - NwGtpv1uTrxnT *thiz = *pthiz; - - pStack = thiz->pStack; - - if(thiz->hRspTmr) { - rc = nwGtpv1uTrxnStopPeerRspTimer(thiz); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - if(thiz->pMsg) { - rc = nwGtpv1uMsgDelete((NwGtpv1uStackHandleT)pStack, - (NwGtpv1uMsgHandleT)thiz->pMsg); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - thiz->next = gpGtpv1uTrxnPool; - gpGtpv1uTrxnPool = thiz; - - NW_LOG(pStack, NW_LOG_LEVEL_DEBG, "Purged transaction 0x%p", thiz); - - *pthiz = NULL; - return rc; -} - - -#if 1 -/** - * Send msg to peer via data request to UDP Entity - * - * @param[in] thiz : Pointer to stack. - * @param[in] pTrxn : Pointer to Trxn object. - * @param[in] peerIp : Peer Ip address. - * @param[in] peerPort : Peer Ip port. - * @param[in] pMsg : Message to be sent. - * @return NW_GTPV1U_OK on success. - */ -NwGtpv1uRcT -nwGtpv1uTrxnCreateAndSendMsg( NW_IN NwGtpv1uStackT *thiz, - NW_IN NwGtpv1uTrxnT *pTrxn, - NW_IN uint32_t peerIp, - NW_IN uint32_t peerPort, - NW_IN NwGtpv1uMsgT *pMsg) -{ - NwGtpv1uRcT rc; - uint8_t *msgHdr; - - NW_ASSERT(thiz); - NW_ASSERT(pMsg); - - msgHdr = &pMsg->msgBuf[pMsg->msgBufOffset]; - - NW_ASSERT(msgHdr != NULL); - - *(msgHdr++) = (pMsg->version << 5) | - (pMsg->protocolType << 4) | - (pMsg->extHdrFlag << 2) | - (pMsg->seqNumFlag << 1) | - (pMsg->npduNumFlag); - - *(msgHdr++) = (pMsg->msgType); - *((uint16_t *) msgHdr) = htons(pMsg->msgLen); - msgHdr += 2; - - *((uint32_t *) msgHdr) = htonl(pMsg->teid); - msgHdr += 4; - - if(pMsg->seqNumFlag | pMsg->extHdrFlag | pMsg->npduNumFlag) { - if(pMsg->seqNumFlag) { - *((uint16_t *) msgHdr) = htons((pTrxn ? pTrxn->seqNum : pMsg->seqNum)); - } else { - *((uint16_t *) msgHdr) = 0x0000; - } - - msgHdr += 2; - - if(pMsg->npduNumFlag) { - *((uint8_t *) msgHdr) = pMsg->npduNumFlag; - } else { - *((uint8_t *) msgHdr) = 0x00; - } - - msgHdr++; - - if(pMsg->extHdrFlag) { - *((uint8_t *) msgHdr) = pMsg->extHdrFlag; - } else { - *((uint8_t *) msgHdr) = 0x00; - } - - msgHdr++; - } - - NW_ASSERT(thiz->udp.udpDataReqCallback != NULL); - - rc = thiz->udp.udpDataReqCallback(thiz->udp.hUdp, - pMsg->msgBuf, - pMsg->msgLen, - pMsg->msgBufOffset, - peerIp, - peerPort); - - /* Save the message for retransmission */ - if(rc == NW_GTPV1U_OK && pTrxn) { - pTrxn->pMsg = pMsg; - pTrxn->peerIp = peerIp; - pTrxn->peerPort = peerPort; - - rc = nwGtpv1uTrxnStartPeerRspTimer(pTrxn, nwGtpv1uTrxnPeerRspTimeout); - NW_ASSERT(rc == NW_GTPV1U_OK); - } - - return rc; -} -#endif - - -#ifdef __cplusplus -} -#endif - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c deleted file mode 100644 index c62f60edc2..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c +++ /dev/null @@ -1,135 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "NwTypes.h" -#include "NwUtils.h" -#include "NwGtpv1uError.h" -#include "NwGtpv1uPrivate.h" -#include "NwGtpv1uMsg.h" -#include "NwGtpv1uTunnelEndPoint.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uLog.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------* - * P R I V A T E D E C L A R A T I O N S * - *--------------------------------------------------------------------------*/ - -static NwGtpv1uTunnelEndPointT *gpTunnelEndPointPool = NULL; - -/*--------------------------------------------------------------------------* - * P U B L I C F U N C T I O N S * - *--------------------------------------------------------------------------*/ - -/** - Constructor - - @param[in] msid: MSID - @param[in] peerAddr: Address of the peer. - @return Pointer to Session on success, NULL on failure. - */ - - -NwGtpv1uTunnelEndPointT * -nwGtpTunnelEndPointNew(struct NwGtpv1uStack *pStack) -{ - NwGtpv1uTunnelEndPointT *thiz; - - if(gpTunnelEndPointPool) { - thiz = gpTunnelEndPointPool; - gpTunnelEndPointPool = gpTunnelEndPointPool->next; - } else { - NW_GTPV1U_MALLOC(pStack, sizeof(NwGtpv1uTunnelEndPointT), thiz, - NwGtpv1uTunnelEndPointT *); - } - - return thiz; -} - -/** - Destructor - - @param[in] thiz: Pointer to session - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpTunnelEndPointDestroy(struct NwGtpv1uStack *pStack, - NwGtpv1uTunnelEndPointT *thiz) -{ - thiz->next = gpTunnelEndPointPool; - gpTunnelEndPointPool = thiz; - return NW_GTPV1U_OK; -} - -/** - Purge a Transaction for a Session. - - @param[in] thiz: Pointer to session - @param[in,out] pTrxn: Pointer to the trxn. - @return NW_GTPV1U_OK on success. - */ - -NwGtpv1uRcT -nwGtpSessionSendMsgApiToUlpEntity(NwGtpv1uTunnelEndPointT *thiz, - NwGtpv1uMsgT *pMsg) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwGtpv1uUlpApiT api; - - api.apiType = NW_GTPV1U_ULP_API_RECV_TPDU; - api.apiInfo.recvMsgInfo.hUlpSession = thiz->hUlpSession; - api.apiInfo.recvMsgInfo.teid = thiz->teid; - api.apiInfo.recvMsgInfo.hMsg = (NwGtpv1uMsgHandleT)pMsg; - - NW_ASSERT(thiz->pStack->ulp.ulpReqCallback != NULL); - - thiz->pStack->ulp.ulpReqCallback(thiz->pStack->ulp.hUlp, &api); - - return rc; -} - -#ifdef __cplusplus -} -#endif - -/*--------------------------------------------------------------------------* - * E N D O F F I L E * - *--------------------------------------------------------------------------*/ diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.am b/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.am deleted file mode 100644 index 69b8e698e9..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# this is example-file: Makefile.am - -# the subdirectories of the project to go into -SUBDIRS = \ - nw-helloworld diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.in b/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.in deleted file mode 100644 index 46928b9e3c..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/Makefile.in +++ /dev/null @@ -1,461 +0,0 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# this is example-file: Makefile.am -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -subdir = nw-gtpv1u/test-app -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ -AM_LDFLAGS = @AM_LDFLAGS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ - -# the subdirectories of the project to go into -SUBDIRS = \ - nw-helloworld - -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu nw-gtpv1u/test-app/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu nw-gtpv1u/test-app/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-exec-am: - -install-html: install-html-recursive - -install-info: install-info-recursive - -install-man: - -install-pdf: install-pdf-recursive - -install-ps: install-ps-recursive - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic ctags \ - ctags-recursive distclean distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ - tags-recursive uninstall uninstall-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.am b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.am deleted file mode 100644 index f60cd93f55..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -bin_PROGRAMS = helloworld - -AM_CFLAGS = -D__WITH_LIBEVENT__ -I../../shared -I../../include -I../../test-app/nw-udp -I../../test-app/nw-log @AM_CFLAGS@ - -helloworld_SOURCES = \ - NwEvt.h\ - NwMiniLogMgrEntity.h\ - NwMiniTmrMgrEntity.h\ - NwMiniUlpEntity.h\ - NwMiniUdpEntity.h\ - NwMiniLogMgrEntity.c\ - NwMiniTmrMgrEntity.c\ - NwMiniUlpEntity.c\ - NwMiniUdpEntity.c\ - helloworld.c - -helloworld_LDADD = ../../src/libNwGtpv1u.a -levent $(AM_LDFLAGS) diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.in b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.in deleted file mode 100644 index 769d75c16b..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/Makefile.in +++ /dev/null @@ -1,433 +0,0 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -bin_PROGRAMS = helloworld$(EXEEXT) -subdir = nw-gtpv1u/test-app/nw-helloworld -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am_helloworld_OBJECTS = NwMiniLogMgrEntity.$(OBJEXT) \ - NwMiniTmrMgrEntity.$(OBJEXT) NwMiniUlpEntity.$(OBJEXT) \ - NwMiniUdpEntity.$(OBJEXT) helloworld.$(OBJEXT) -helloworld_OBJECTS = $(am_helloworld_OBJECTS) -am__DEPENDENCIES_1 = -helloworld_DEPENDENCIES = ../../src/libNwGtpv1u.a \ - $(am__DEPENDENCIES_1) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(helloworld_SOURCES) -DIST_SOURCES = $(helloworld_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_CFLAGS = -D__WITH_LIBEVENT__ -I../../shared -I../../include -I../../test-app/nw-udp -I../../test-app/nw-log @AM_CFLAGS@ -AM_LDFLAGS = @AM_LDFLAGS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -helloworld_SOURCES = \ - NwEvt.h\ - NwMiniLogMgrEntity.h\ - NwMiniTmrMgrEntity.h\ - NwMiniUlpEntity.h\ - NwMiniUdpEntity.h\ - NwMiniLogMgrEntity.c\ - NwMiniTmrMgrEntity.c\ - NwMiniUlpEntity.c\ - NwMiniUdpEntity.c\ - helloworld.c - -helloworld_LDADD = ../../src/libNwGtpv1u.a -levent $(AM_LDFLAGS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu nw-gtpv1u/test-app/nw-helloworld/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu nw-gtpv1u/test-app/nw-helloworld/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -helloworld$(EXEEXT): $(helloworld_OBJECTS) $(helloworld_DEPENDENCIES) - @rm -f helloworld$(EXEEXT) - $(LINK) $(helloworld_OBJECTS) $(helloworld_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NwMiniLogMgrEntity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NwMiniTmrMgrEntity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NwMiniUdpEntity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NwMiniUlpEntity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helloworld.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-binPROGRAMS - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwEvt.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwEvt.h deleted file mode 100644 index 6df5794a5f..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwEvt.h +++ /dev/null @@ -1,80 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * Copyright (c) 2010-2011 Amit Chawre * - * All rights reserved. * - * * - * Redistribution and use in source and binary forms, with or without * - * modification, are permitted provided that the following conditions * - * are met: * - * * - * 1. Redistributions of source code must retain the above copyright * - * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above copyright * - * notice, this list of conditions and the following disclaimer in the * - * documentation and/or other materials provided with the distribution. * - * 3. The name of the author may not be used to endorse or promote products * - * derived from this software without specific prior written permission. * - * * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - *----------------------------------------------------------------------------*/ - -#ifndef __NW_EVT_H__ -#define __NW_EVT_H__ -/** - * @file NwEvt.h - * @brief -*/ - -#ifdef __WITH_LIBEVENT__ - -#include - -typedef struct event NwEventT; - -#define NW_EVT_READ (EV_READ) -#define NW_EVT_PERSIST (EV_PERSIST) -#define NW_EVT_CALLBACK(__cbFunc) __cbFunc(int fd, short event, void *arg) -#define NW_TMR_CALLBACK(__cbFunc) __cbFunc(int fd, short event, void *arg) - -#define NW_EVT_INIT event_init -#define NW_EVT_LOOP event_dispatch - -#define NW_EVENT_ADD(__ev, __evSelObj, __evCallback, __evCallbackArg, __evFlags) \ - do { \ - event_set(&(__ev), __evSelObj, __evFlags, __evCallback, __evCallbackArg); \ - event_add(&(__ev), NULL); \ - } while(0) - -#else - -#warning "Event library not defined!" - -/* HACK : Defining dummy values for compilation!*/ - -typedef struct { - int __tbd; -} NwEventT; - -#define NW_EVT_READ (0) -#define NW_EVT_PERSIST (1) -#define NW_EVT_CALLBACK(__cbFunc) __cbFunc(void *arg) -#define NW_TMR_CALLBACK(__cbFunc) __cbFunc(void *arg) - - -#define NW_EVT_INIT() do { printf("error: Event library not defined!\n"); exit (0); } while(0) -#define NW_EVT_LOOP() do { printf("error: Event library not defined!\n"); exit (0); } while(0) -#define NW_EVENT_ADD(...) do { printf("error: Event library not defined!\n"); exit (0); } while(0) - - -#endif - -#endif /* __NW_EVT_H__ */ diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.c deleted file mode 100644 index c50e6a17db..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.c +++ /dev/null @@ -1,62 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C L O G M G R E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file hello-world.c - * @brief This file contains example of a minimalistic log manager entity. -*/ - -#include -#include -#include "NwLog.h" -#include "NwEvt.h" -#include "NwGtpv1u.h" - -#include "NwMiniLogMgrEntity.h" - -#ifdef __cplusplus -extern "C" { -#endif - -uint32_t g_log_level = NW_LOG_LEVEL_INFO; - -/*--------------------------------------------------------------------------- - * Public functions - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT nwMiniLogMgrInit(NwMiniLogMgrT *thiz, uint32_t logLevel ) -{ - thiz->logLevel = logLevel; - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT nwMiniLogMgrSetLogLevel(NwMiniLogMgrT *thiz, uint32_t logLevel) -{ - thiz->logLevel = logLevel; -} - -NwGtpv1uRcT nwMiniLogMgrLogRequest (NwGtpv1uLogMgrHandleT hLogMgr, - uint32_t logLevel, - NwCharT *file, - uint32_t line, - NwCharT *logStr) -{ - NwMiniLogMgrT *thiz = (NwMiniLogMgrT *) hLogMgr; - - if(thiz->logLevel >= logLevel) { - printf("NWGTPv2U-STK %s - %s <%s,%u>\n", gLogLevelStr[logLevel], logStr, - basename(file), line); - } - - return NW_GTPV1U_OK; -} - -#ifdef __cplusplus -} -#endif - diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h deleted file mode 100644 index 18b60aa611..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniLogMgrEntity.h +++ /dev/null @@ -1,57 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C L O G M G R E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file hello-world.c - * @brief This file contains example of a minimalistic log manager entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwLog.h" - -#ifndef __NW_MINI_LOG_MGR_H__ -#define __NW_MINI_LOG_MGR_H__ - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -extern uint32_t g_log_level; - - -#define NW_LOG( _logLevel, ...) \ - do { \ - if(g_log_level >= _logLevel) \ - { \ - char _logStr[1024]; \ - snprintf(_logStr, 1024, __VA_ARGS__); \ - printf("NWGTPv2U-APP %s - %s <%s,%d>\n", gLogLevelStr[_logLevel], _logStr, basename(__FILE__), __LINE__);\ - } \ - } while(0) - -typedef struct { - uint8_t logLevel; -} NwMiniLogMgrT; - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT nwMiniLogMgrLogRequest (NwGtpv1uLogMgrHandleT logMgrHandle, - uint32_t logLevel, - NwCharT* file, - uint32_t line, - NwCharT* logStr); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c deleted file mode 100644 index 63ad59b23f..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.c +++ /dev/null @@ -1,101 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C T M R M G R E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file NwMiniTmrMgrEntity.c - * @brief This file ontains example of a minimalistic timer manager entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwGtpv1u.h" -#include "NwMiniLogMgrEntity.h" -#include "NwMiniTmrMgrEntity.h" - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Private functions - *--------------------------------------------------------------------------*/ - -static void -NW_TMR_CALLBACK(nwMiniTmrMgrHandleTimeout) -{ - NwGtpv1uRcT rc; - NwMiniTmrMgrEntityT *pTmr = (NwMiniTmrMgrEntityT *) arg; - - /*--------------------------------------------------------------------------- - * Send Timeout Request to GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - rc = nwGtpv1uProcessTimeout(pTmr->timeoutArg); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - free(pTmr); - - return; -} - -/*--------------------------------------------------------------------------- - * Public functions - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT nwTimerStart( NwGtpv1uTimerMgrHandleT tmrMgrHandle, - uint32_t timeoutSec, - uint32_t timeoutUsec, - uint32_t tmrType, - void *timeoutArg, - NwGtpv1uTimerHandleT *hTmr) -{ - NwGtpv1uRcT rc = NW_GTPV1U_OK; - NwMiniTmrMgrEntityT *pTmr; - struct timeval tv; - - NW_LOG(NW_LOG_LEVEL_INFO, - "Received start timer request from stack with timer type %d , arg %x, for %d sec and %d usec", - tmrType, (unsigned int)timeoutArg, timeoutSec, timeoutUsec); - - pTmr = (NwMiniTmrMgrEntityT *) malloc (sizeof(NwMiniTmrMgrEntityT)); - - /* set the timevalues*/ - timerclear(&tv); - tv.tv_sec = timeoutSec; - tv.tv_usec = timeoutUsec; - - pTmr->timeoutArg = timeoutArg; - evtimer_set(&pTmr->ev, nwMiniTmrMgrHandleTimeout, pTmr); - - /*add event*/ - - event_add(&(pTmr->ev), &tv); - - *hTmr = (NwGtpv1uTimerHandleT)pTmr; - - return rc; -} - -NwGtpv1uRcT nwTimerStop( NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NwGtpv1uTimerHandleT hTmr) -{ - NW_LOG(NW_LOG_LEVEL_INFO, - "Received stop timer request from stack for timer handle %d", hTmr); - evtimer_del(&(((NwMiniTmrMgrEntityT *)hTmr)->ev)); - free((void *)hTmr); - return NW_GTPV1U_OK; -} - -#ifdef __cplusplus -} -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.h deleted file mode 100644 index a1f16ff89b..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniTmrMgrEntity.h +++ /dev/null @@ -1,53 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C T M R M G R E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - - -/** - * @file NwMiniTmrMgrEntity.c - * @brief This file ontains example of a minimalistic timer manager entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwLog.h" - -#ifndef __NW_MINI_TMR_MGR_H__ -#define __NW_MINI_TMR_MGR_H__ - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -typedef struct { - NwEventT ev; - void* timeoutArg; -} NwMiniTmrMgrEntityT; - - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT nwTimerStart( NwGtpv1uTimerMgrHandleT tmrMgrHandle, - uint32_t timeoutSec, - uint32_t timeoutUsec, - uint32_t tmrType, - void* timeoutArg, - NwGtpv1uTimerHandleT* hTmr); - - -NwGtpv1uRcT nwTimerStop( NwGtpv1uTimerMgrHandleT tmrMgrHandle, - NwGtpv1uTimerHandleT hTmr); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.c deleted file mode 100644 index a63b02985c..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.c +++ /dev/null @@ -1,157 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C U D P E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - - -/** - * @file NwMiniUdpEntity.c - * @brief This file contains example of a minimalistic ULP entity. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "NwEvt.h" -#include "NwGtpv1u.h" -#include "NwMiniLogMgrEntity.h" -#include "NwMiniUdpEntity.h" - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -#define MAX_UDP_PAYLOAD_LEN (4096) - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Private functions - *--------------------------------------------------------------------------*/ - -static -void NW_TMR_CALLBACK(nwUdpDataIndicationCallbackData) -{ - NwGtpv1uRcT rc; - uint8_t udpBuf[MAX_UDP_PAYLOAD_LEN]; - NwS32T bytesRead; - uint32_t peerLen; - struct sockaddr_in peer; - NwMiniUdpEntityT *thiz = (NwMiniUdpEntityT *) arg; - - peerLen = sizeof(peer); - - bytesRead = recvfrom(thiz->hSocket, udpBuf, MAX_UDP_PAYLOAD_LEN , 0, - (struct sockaddr *) &peer,(socklen_t *) &peerLen); - - if(bytesRead) { - NW_LOG(NW_LOG_LEVEL_DEBG, "Received UDP message of length %u from %X:%u", - bytesRead, ntohl(peer.sin_addr.s_addr), ntohs(peer.sin_port)); - rc = nwGtpv1uProcessUdpReq(thiz->hGtpv1uStack, udpBuf, bytesRead, - peer.sin_port, peer.sin_addr.s_addr); - } else { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - } -} - - -/*--------------------------------------------------------------------------- - * Public functions - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT nwMiniUdpInit(NwMiniUdpEntityT *thiz, - NwGtpv1uStackHandleT hGtpv1uStack, uint8_t *ipAddr) -{ - int sd; - struct sockaddr_in addr; - - sd = socket(AF_INET, SOCK_DGRAM, 0); - - if (sd < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - addr.sin_family = AF_INET; - addr.sin_port = htons(2152); - addr.sin_addr.s_addr = inet_addr(ipAddr); - memset(addr.sin_zero, '\0', sizeof (addr.sin_zero)); - - if(bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - event_set(&(thiz->ev), sd, EV_READ|EV_PERSIST, nwUdpDataIndicationCallbackData, - thiz); - event_add(&(thiz->ev), NULL); - - thiz->hSocket = sd; - thiz->hGtpv1uStack = hGtpv1uStack; - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT nwMiniUdpDestroy(NwMiniUdpEntityT *thiz) -{ - close(thiz->hSocket); -} - -NwGtpv1uRcT nwMiniUdpDataReq(NwGtpv1uUdpHandleT udpHandle, - uint8_t *dataBuf, - uint32_t dataSize, - uint32_t peerIpAddr, - uint32_t peerPort) -{ - struct sockaddr_in peerAddr; - NwS32T bytesSent; - NwMiniUdpEntityT *thiz = (NwMiniUdpEntityT *) udpHandle; - - peerAddr.sin_family = AF_INET; - peerAddr.sin_port = htons(peerPort); - peerAddr.sin_addr.s_addr = (peerIpAddr); - memset(peerAddr.sin_zero, '\0', sizeof (peerAddr.sin_zero)); - - NW_LOG(NW_LOG_LEVEL_DEBG, - "Sending %u bytes on handle 0x%x to peer %u.%u.%u.%u:%u", dataSize, udpHandle, - (peerIpAddr & 0x000000ff), - (peerIpAddr & 0x0000ff00) >> 8, - (peerIpAddr & 0x00ff0000) >> 16, - (peerIpAddr & 0xff000000) >> 24, - peerPort); - - bytesSent = sendto (thiz->hSocket, dataBuf, dataSize, 0, - (struct sockaddr *) &peerAddr, sizeof(peerAddr)); - - if(bytesSent < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - } else { - NW_LOG(NW_LOG_LEVEL_DEBG, "Sent %u bytes on handle 0x%x to peer %u.%u.%u.%u", - dataSize, udpHandle, - (peerIpAddr & 0x000000ff), - (peerIpAddr & 0x0000ff00) >> 8, - (peerIpAddr & 0x00ff0000) >> 16, - (peerIpAddr & 0xff000000) >> 24); - - } - - return NW_GTPV1U_OK; -} - - - -#ifdef __cplusplus -} -#endif - diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.h deleted file mode 100644 index 568c5b0796..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUdpEntity.h +++ /dev/null @@ -1,51 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C U D P E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - - -/** - * @file NwMiniUdpEntity.h - * @brief This file contains example of a minimalistic ULP entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwLog.h" - -#ifndef __NW_MINI_UDP_ENTITY_H__ -#define __NW_MINI_UDP_ENTITY_H__ - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -typedef struct { - uint32_t hSocket; - NwEventT ev; - NwGtpv1uStackHandleT hGtpv1uStack; -} NwMiniUdpEntityT; - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT nwMiniUdpInit(NwMiniUdpEntityT* thiz, NwGtpv1uStackHandleT hGtpv1uStack, uint8_t* ipAddr); - -NwGtpv1uRcT nwMiniUdpDestroy(NwMiniUdpEntityT* thiz); - -NwGtpv1uRcT nwMiniUdpDataReq(NwGtpv1uUdpHandleT udpHandle, - uint8_t* dataBuf, - uint32_t dataSize, - uint32_t peerAddr, - uint32_t peerPort); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.c deleted file mode 100644 index e2f505b4eb..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.c +++ /dev/null @@ -1,309 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C U L P E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file NwMiniUlpEntity.c - * @brief This file contains example of a minimalistic ULP entity. -*/ - -#include -#include -#include -#include -#include "NwEvt.h" -#include "NwGtpv1u.h" -#include "NwGtpv1uIe.h" -#include "NwMiniLogMgrEntity.h" -#include "NwMiniUlpEntity.h" - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/*--------------------------------------------------------------------------- - * Private Functions - *--------------------------------------------------------------------------*/ - -#define MAX_UDP_PAYLOAD_LEN (4096) - -NwGtpv1uRcT -nwMiniUlpSendEchoRequestToPeer(NwMiniUlpEntityT *thiz, uint32_t peerIp) -{ - NwGtpv1uRcT rc; - NwGtpv1uUlpApiT ulpReq; - - /* - * Send Message Request to Gtpv1u Stack Instance - */ - - ulpReq.apiType = NW_GTPV1U_ULP_API_INITIAL_REQ; - - ulpReq.apiInfo.initialReqInfo.hUlpTrxn = (NwGtpv1uUlpTrxnHandleT)thiz; - ulpReq.apiInfo.initialReqInfo.teid = 0x00; - ulpReq.apiInfo.initialReqInfo.peerIp = (peerIp); - ulpReq.apiInfo.initialReqInfo.peerPort = 2152; - - /* Send Echo Request*/ - - rc = nwGtpv1uMsgNew( thiz->hGtpv1uStack, - NW_TRUE, /* SeqNum flag */ - NW_FALSE, - NW_FALSE, - NW_GTP_ECHO_REQ, /* Msg Type */ - 0x00000000UL, /* TEID */ - 0x5678, /* Seq Number */ - 0, - 0, - (&ulpReq.hMsg)); - - NW_ASSERT( rc == NW_GTPV1U_OK ); - - rc = nwGtpv1uMsgAddIeTV1((ulpReq.hMsg), NW_GTPV1U_IE_RECOVERY, - thiz->restartCounter); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - rc = nwGtpv1uProcessUlpReq(thiz->hGtpv1uStack, &ulpReq); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - return NW_GTPV1U_OK; -} - -static -void NW_EVT_CALLBACK(nwMiniUlpDataIndicationCallbackData) -{ - NwMiniUlpEntityT *thiz = (NwMiniUlpEntityT *) arg; - NwGtpv1uRcT rc; - uint8_t udpBuf[MAX_UDP_PAYLOAD_LEN]; - NwS32T bytesRead; - uint32_t peerLen; - struct sockaddr_in peer; - - peerLen = sizeof(peer); - - bytesRead = recvfrom(thiz->hSocket, udpBuf, MAX_UDP_PAYLOAD_LEN , 0, - (struct sockaddr *) &peer,(socklen_t *) &peerLen); - - if(bytesRead) { - NW_LOG(NW_LOG_LEVEL_DEBG, "Received UDP message of length %u from %X:%u", - bytesRead, ntohl(peer.sin_addr.s_addr), ntohs(peer.sin_port)); - rc = nwMiniUlpTpduSend(thiz, udpBuf, bytesRead, thiz->localPort[fd]); - } else { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - } -} - -/*--------------------------------------------------------------------------- - * Public Functions - *--------------------------------------------------------------------------*/ - -NwGtpv1uRcT -nwMiniUlpInit(NwMiniUlpEntityT *thiz, NwGtpv1uStackHandleT hGtpv1uStack) -{ - NwGtpv1uRcT rc; - thiz->hGtpv1uStack = hGtpv1uStack; - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwMiniUlpDestroy(NwMiniUlpEntityT *thiz) -{ - NW_ASSERT(thiz); - memset(thiz, 0, sizeof(NwMiniUlpEntityT)); - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwMiniUlpCreateConn(NwMiniUlpEntityT *thiz, char *localIpStr, uint16_t localport, - char *peerIpStr) -{ - NwGtpv1uRcT rc; - int sd; - struct sockaddr_in addr; - NwGtpv1uUlpApiT ulpReq; - - strcpy(thiz->peerIpStr, peerIpStr); - - /* - * Create local tunnel endpoint - */ - - NW_LOG(NW_LOG_LEVEL_NOTI, "Creating tunnel endpoint with teid %d", localport); - ulpReq.apiType = - NW_GTPV1U_ULP_API_CREATE_TUNNEL_ENDPOINT; - ulpReq.apiInfo.createTunnelEndPointInfo.teid = localport; - ulpReq.apiInfo.createTunnelEndPointInfo.hUlpSession = - (NwGtpv1uUlpSessionHandleT)thiz; - - rc = nwGtpv1uProcessUlpReq(thiz->hGtpv1uStack, &ulpReq); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - thiz->hGtpv1uConn = ulpReq.apiInfo.createTunnelEndPointInfo.hStackSession; - - /* - * Create local udp listening endpoint - */ - - sd = socket(AF_INET, SOCK_DGRAM, 0); - - if (sd < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - addr.sin_family = AF_INET; - addr.sin_port = htons(localport); - addr.sin_addr.s_addr = inet_addr(localIpStr); - memset(addr.sin_zero, '\0', sizeof (addr.sin_zero)); - - if(bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - event_set(&(thiz->ev[sd]), sd, EV_READ|EV_PERSIST, - nwMiniUlpDataIndicationCallbackData, thiz); - event_add(&(thiz->ev[sd]), NULL); - - thiz->localPort[sd] = localport; - - /* - * Create local udp for sendign data - */ - - sd = socket(AF_INET, SOCK_DGRAM, 0); - - if (sd < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } - - - thiz->hSocket = sd; - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwMiniUlpDestroyConn(NwMiniUlpEntityT *thiz) -{ - NwGtpv1uRcT rc; - NwGtpv1uUlpApiT ulpReq; - /*--------------------------------------------------------------------------- - * Send Destroy Session Request to GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - ulpReq.apiType = NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT; - ulpReq.apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle = thiz->hGtpv1uConn; - - rc = nwGtpv1uProcessUlpReq(thiz->hGtpv1uStack, &ulpReq); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - thiz->hGtpv1uConn = 0; - - return NW_GTPV1U_OK; -} - - -NwGtpv1uRcT -nwMiniUlpTpduSend(NwMiniUlpEntityT *thiz, uint8_t *tpduBuf, uint32_t tpduLen , - uint16_t fromPort) -{ - NwGtpv1uRcT rc; - NwGtpv1uUlpApiT ulpReq; - - /* - * Send Message Request to GTPv1u Stack Instance - */ - - ulpReq.apiType = NW_GTPV1U_ULP_API_SEND_TPDU; - ulpReq.apiInfo.sendtoInfo.teid = fromPort; - ulpReq.apiInfo.sendtoInfo.ipAddr = inet_addr(thiz->peerIpStr); - - rc = nwGtpv1uGpduMsgNew( thiz->hGtpv1uStack, - fromPort, - NW_FALSE, - thiz->seqNum++, - tpduBuf, - tpduLen, - &(ulpReq.apiInfo.sendtoInfo.hMsg)); - - NW_ASSERT( rc == NW_GTPV1U_OK ); - - rc = nwGtpv1uProcessUlpReq(thiz->hGtpv1uStack, &ulpReq); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - rc = nwGtpv1uMsgDelete(thiz->hGtpv1uStack, (ulpReq.apiInfo.sendtoInfo.hMsg)); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - return NW_GTPV1U_OK; -} - -NwGtpv1uRcT -nwMiniUlpProcessStackReqCallback (NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi) -{ - NwMiniUlpEntityT *thiz; - NW_ASSERT(pUlpApi != NULL); - - thiz = (NwMiniUlpEntityT *) hUlp; - - switch(pUlpApi->apiType) { - case NW_GTPV1U_ULP_API_RECV_TPDU: { - struct sockaddr_in peerAddr; - NwS32T bytesSent; - uint8_t dataBuf[4096]; - uint32_t dataSize; - uint32_t peerIpAddr = (inet_addr(thiz->peerIpStr)); - - NW_ASSERT( NW_GTPV1U_OK == nwGtpv1uMsgGetTpdu(pUlpApi->apiInfo.recvMsgInfo.hMsg, - dataBuf, &dataSize) ); - - NW_LOG(NW_LOG_LEVEL_DEBG, "Received TPDU from gtpv1u stack %u!", - pUlpApi->apiInfo.recvMsgInfo.teid); - - peerAddr.sin_family = AF_INET; - peerAddr.sin_port = htons(pUlpApi->apiInfo.recvMsgInfo.teid); - peerAddr.sin_addr.s_addr = (peerIpAddr); - memset(peerAddr.sin_zero, '\0', sizeof (peerAddr.sin_zero)); - - bytesSent = sendto (thiz->hSocket, dataBuf, dataSize, 0, - (struct sockaddr *) &peerAddr, sizeof(peerAddr)); - - if(bytesSent < 0) { - NW_LOG(NW_LOG_LEVEL_ERRO, "%s", strerror(errno)); - NW_ASSERT(0); - } else { - NW_LOG(NW_LOG_LEVEL_DEBG, "Sent %u bytes to peer %u.%u.%u.%u", dataSize, - (peerIpAddr & 0x000000ff), - (peerIpAddr & 0x0000ff00) >> 8, - (peerIpAddr & 0x00ff0000) >> 16, - (peerIpAddr & 0xff000000) >> 24); - } - - NW_ASSERT(nwGtpv1uMsgDelete(thiz->hGtpv1uStack, - (pUlpApi->apiInfo.recvMsgInfo.hMsg)) == NW_GTPV1U_OK); - - } - break; - - default: - NW_LOG(NW_LOG_LEVEL_WARN, "Received undefined UlpApi (%d) from gtpv1u stack!", - pUlpApi->apiType); - } - - return NW_GTPV1U_OK; -} - -#ifdef __cplusplus -} -#endif - diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.h b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.h deleted file mode 100644 index dd55e8ed7c..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/NwMiniUlpEntity.h +++ /dev/null @@ -1,64 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * M I N I M A L I S T I C U L P E N T I T Y * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - -/** - * @file NwMiniUlpEntity.h - * @brief This file contains example of a minimalistic ULP entity. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwLog.h" - -#ifndef __NW_MINI_ULP_H__ -#define __NW_MINI_ULP_H__ - -typedef struct { - int hSocket; - uint16_t seqNum; - uint8_t restartCounter; - uint8_t localIpStr[16]; - uint8_t peerIpStr[16]; - uint32_t localPort[1025]; - NwEventT ev[1025]; - NwGtpv1uStackHandleT hGtpv1uStack; - NwGtpv1uStackSessionHandleT hGtpv1uConn; -} NwMiniUlpEntityT; - -#ifdef __cplusplus -extern "C" { -#endif - -NwGtpv1uRcT -nwMiniUlpInit(NwMiniUlpEntityT* thiz, NwGtpv1uStackHandleT hGtpv1uStack); - -NwGtpv1uRcT -nwMiniUlpDestroy(NwMiniUlpEntityT* thiz); - -NwGtpv1uRcT -nwMiniUlpCreateConn(NwMiniUlpEntityT* thiz, char* localIpStr, uint16_t localPort, char* peerIpStr); - -NwGtpv1uRcT -nwMiniUlpDestroyConn(NwMiniUlpEntityT* thiz); - -NwGtpv1uRcT -nwMiniUlpSendMsg(NwMiniUlpEntityT* thiz); - -NwGtpv1uRcT -nwMiniUlpTpduSend(NwMiniUlpEntityT* thiz, uint8_t* tpduBuf, uint32_t tpduLen , uint16_t fromPort); - -NwGtpv1uRcT -nwMiniUlpProcessStackReqCallback (NwGtpv1uUlpHandleT hUlp, - NwGtpv1uUlpApiT *pUlpApi); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/helloworld.c b/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/helloworld.c deleted file mode 100644 index 2f618ad642..0000000000 --- a/openair3/GTPV1-U/nw-gtpv1u/test-app/nw-helloworld/helloworld.c +++ /dev/null @@ -1,207 +0,0 @@ -/*----------------------------------------------------------------------------* - * * - * n w - g t p v 2 u * - * G P R S T u n n e l i n g P r o t o c o l v 2 u S t a c k * - * * - * M I N I M A L I S T I C D E M O N S T R A T I O N * - * * - * Copyright (C) 2010 Amit Chawre. * - * * - *----------------------------------------------------------------------------*/ - - -/** - * @file hello-world.c - * @brief This is a test program demostrating usage of nw-gtpv2 library. -*/ - -#include -#include -#include "NwEvt.h" -#include "NwGtpv1u.h" - -#include "NwMiniLogMgrEntity.h" -#include "NwMiniTmrMgrEntity.h" -#include "NwMiniUdpEntity.h" -#include "NwMiniUlpEntity.h" - -#ifndef NW_ASSERT -#define NW_ASSERT assert -#endif - -/*--------------------------------------------------------------------------- - * T H E M A I N F U N C T I O N - *--------------------------------------------------------------------------*/ - -int main(int argc, char *argv[]) -{ - NwGtpv1uRcT rc; - char *logLevelStr; - uint32_t logLevel; - uint32_t num_of_connections; - - NwGtpv1uStackHandleT hGtpv1uStack = 0; - NwMiniUlpEntityT ulpObj; - NwMiniUdpEntityT udpObj; - NwMiniLogMgrT logObj; - NwGtpv1uUlpEntityT ulp; - NwGtpv1uUdpEntityT udp; - NwGtpv1uTimerMgrEntityT tmrMgr; - NwGtpv1uLogMgrEntityT logMgr; - - if(argc != 4) { - printf("Usage: %s \n", argv[0]); - exit(0); - } - - - logLevelStr = getenv ("NW_LOG_LEVEL"); - - if(logLevelStr == NULL) { - logLevel = NW_LOG_LEVEL_INFO; - } else { - if(strncmp(logLevelStr, "EMER",4) == 0) { - logLevel = NW_LOG_LEVEL_EMER; - } else if(strncmp(logLevelStr, "ALER",4) == 0) { - logLevel = NW_LOG_LEVEL_ALER; - } else if(strncmp(logLevelStr, "CRIT",4) == 0) { - logLevel = NW_LOG_LEVEL_CRIT; - } else if(strncmp(logLevelStr, "ERRO",4) == 0) { - logLevel = NW_LOG_LEVEL_ERRO ; - } else if(strncmp(logLevelStr, "WARN",4) == 0) { - logLevel = NW_LOG_LEVEL_WARN; - } else if(strncmp(logLevelStr, "NOTI",4) == 0) { - logLevel = NW_LOG_LEVEL_NOTI; - } else if(strncmp(logLevelStr, "INFO",4) == 0) { - logLevel = NW_LOG_LEVEL_INFO; - } else if(strncmp(logLevelStr, "DEBG",4) == 0) { - logLevel = NW_LOG_LEVEL_DEBG; - } - } - - /*--------------------------------------------------------------------------- - * Initialize event library - *--------------------------------------------------------------------------*/ - - NW_EVT_INIT(); - - /*--------------------------------------------------------------------------- - * Initialize Log Manager - *--------------------------------------------------------------------------*/ - - nwMiniLogMgrInit(&logObj, logLevel); - - /*--------------------------------------------------------------------------- - * Create GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - rc = nwGtpv1uInitialize(&hGtpv1uStack, GTPU_STACK_ENB); - - if(rc != NW_GTPV1U_OK) { - NW_LOG(NW_LOG_LEVEL_ERRO, - "Failed to create gtpv1u stack instance. Error '%u' occured", rc); - exit(1); - } - - NW_LOG(NW_LOG_LEVEL_INFO, "Gtpv1u Stack Handle '%X' Creation Successful!", - hGtpv1uStack); - - /*--------------------------------------------------------------------------- - * Set up Ulp Entity - *--------------------------------------------------------------------------*/ - - rc = nwMiniUlpInit(&ulpObj, hGtpv1uStack); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - ulp.hUlp = (NwGtpv1uUlpHandleT) &ulpObj; - ulp.ulpReqCallback = nwMiniUlpProcessStackReqCallback; - - rc = nwGtpv1uSetUlpEntity(hGtpv1uStack, &ulp); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - - /*--------------------------------------------------------------------------- - * Set up Udp Entity - *--------------------------------------------------------------------------*/ - - rc = nwMiniUdpInit(&udpObj, hGtpv1uStack, (argv[2])); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - udp.hUdp = (NwGtpv1uUdpHandleT) &udpObj; - udp.udpDataReqCallback = nwMiniUdpDataReq; - - rc = nwGtpv1uSetUdpEntity(hGtpv1uStack, &udp); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - /*--------------------------------------------------------------------------- - * Set up Log Entity - *--------------------------------------------------------------------------*/ - - tmrMgr.tmrMgrHandle = 0; - tmrMgr.tmrStartCallback = nwTimerStart; - tmrMgr.tmrStopCallback = nwTimerStop; - - rc = nwGtpv1uSetTimerMgrEntity(hGtpv1uStack, &tmrMgr); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - /*--------------------------------------------------------------------------- - * Set up Log Entity - *--------------------------------------------------------------------------*/ - - logMgr.logMgrHandle = (NwGtpv1uLogMgrHandleT) &logObj; - logMgr.logReqCallback = nwMiniLogMgrLogRequest; - - rc = nwGtpv1uSetLogMgrEntity(hGtpv1uStack, &logMgr); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - /*--------------------------------------------------------------------------- - * Set GTPv1u log level - *--------------------------------------------------------------------------*/ - - rc = nwGtpv1uSetLogLevel(hGtpv1uStack, logLevel); - - /*--------------------------------------------------------------------------- - * Send Create Session Request to GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - num_of_connections = atoi(argv[1]); - - while ( num_of_connections-- ) { - //rc = nwMiniUlpCreateConn(&ulpObj, argv[2], 1234 + num_of_connections, argv[3]); - rc = nwMiniUlpSendEchoRequestToPeer(&ulpObj, inet_addr(argv[3])); - NW_ASSERT( rc == NW_GTPV1U_OK ); - } - - /*--------------------------------------------------------------------------- - * Event loop - *--------------------------------------------------------------------------*/ - - NW_EVT_LOOP(); - - NW_LOG(NW_LOG_LEVEL_ERRO, "Exit from eventloop, no events to process!"); - - /*--------------------------------------------------------------------------- - * Send Destroy Session Request to GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - rc = nwMiniUlpDestroyConn(&ulpObj); - NW_ASSERT( rc == NW_GTPV1U_OK ); - - - /*--------------------------------------------------------------------------- - * Destroy GTPv1u Stack Instance - *--------------------------------------------------------------------------*/ - - rc = nwGtpv1uFinalize(hGtpv1uStack); - - if(rc != NW_GTPV1U_OK) { - NW_LOG(NW_LOG_LEVEL_ERRO, - "Failed to finalize gtpv1u stack instance. Error '%u' occured", rc); - } else { - NW_LOG(NW_LOG_LEVEL_INFO, "Gtpv1u Stack Handle '%X' Finalize Successful!", - hGtpv1uStack); - } - - - return rc; -} diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c deleted file mode 100644 index 8b9fc77bb1..0000000000 --- a/openair3/UDP/udp_eNB_task.c +++ /dev/null @@ -1,447 +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 udp_eNB_task.c -* \brief -* \author Sebastien ROUX, Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "queue.h" -#include "intertask_interface.h" -#include "assertions.h" -#include "udp_eNB_task.h" - -#include "common/utils/LOG/log.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#include "msc.h" - - -#define IPV4_ADDR "%u.%u.%u.%u" -#define IPV4_ADDR_FORMAT(aDDRESS) \ - (uint8_t)((aDDRESS) & 0x000000ff), \ - (uint8_t)(((aDDRESS) & 0x0000ff00) >> 8 ), \ - (uint8_t)(((aDDRESS) & 0x00ff0000) >> 16), \ - (uint8_t)(((aDDRESS) & 0xff000000) >> 24) - - -struct udp_socket_desc_s { - int sd; /* Socket descriptor to use */ - - pthread_t listener_thread; /* Thread affected to recv */ - - char *local_address; /* Local ipv4 address to use */ - uint16_t local_port; /* Local port to use */ - - task_id_t task_id; /* Task who has requested the new endpoint */ - - STAILQ_ENTRY(udp_socket_desc_s) entries; -}; - -static STAILQ_HEAD(udp_socket_list_s, udp_socket_desc_s) udp_socket_list; -static pthread_mutex_t udp_socket_list_mutex = PTHREAD_MUTEX_INITIALIZER; - - -static -struct udp_socket_desc_s * -udp_eNB_get_socket_desc(task_id_t task_id); - -void udp_eNB_process_file_descriptors( - struct epoll_event *events, - int nb_events); - -static -int -udp_eNB_create_socket( - int port, - char *ip_addr, - task_id_t task_id); - -int -udp_eNB_send_to( - int sd, - uint16_t port, - uint32_t address, - const uint8_t *buffer, - uint32_t length); - -void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP); - -void *udp_eNB_task(void *args_p); - -int udp_enb_init(void); -/* @brief Retrieve the descriptor associated with the task_id - */ -static -struct udp_socket_desc_s *udp_eNB_get_socket_desc(task_id_t task_id) -{ - struct udp_socket_desc_s *udp_sock_p = NULL; - -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_T(UDP_, "Looking for task %d\n", task_id); -#endif - - STAILQ_FOREACH(udp_sock_p, &udp_socket_list, entries) { - if (udp_sock_p->task_id == task_id) { -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_T(UDP_, "Found matching task desc\n"); -#endif - break; - } - } - return udp_sock_p; -} - -void udp_eNB_process_file_descriptors(struct epoll_event *events, int nb_events) -{ - int i; - struct udp_socket_desc_s *udp_sock_p = NULL; - - if (events == NULL) { - return; - } - - for (i = 0; i < nb_events; i++) { - STAILQ_FOREACH(udp_sock_p, &udp_socket_list, entries) { - if (udp_sock_p->sd == events[i].data.fd) { -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "Found matching task desc\n"); -#endif - udp_eNB_receiver(udp_sock_p); - break; - } - } - } -} - -static -int udp_eNB_create_socket(int port, char *ip_addr, task_id_t task_id) -{ - - struct udp_socket_desc_s *udp_socket_desc_p = NULL; - int sd, rc; - struct sockaddr_in sin; - - LOG_I(UDP_, "Initializing UDP for local address %s with port %d\n", ip_addr, port); - - sd = socket(AF_INET, SOCK_DGRAM, 0); - AssertFatal(sd > 0, "UDP: Failed to create new socket: (%s:%d)\n", strerror(errno), errno); - - memset(&sin, 0, sizeof(struct sockaddr_in)); - sin.sin_family = AF_INET; - sin.sin_port = htons(port); - - if (ip_addr == NULL) { - sin.sin_addr.s_addr = inet_addr(INADDR_ANY); - } else { - sin.sin_addr.s_addr = inet_addr(ip_addr); - } - - if ((rc = bind(sd, (struct sockaddr *)&sin, sizeof(struct sockaddr_in))) < 0) { - close(sd); - LOG_E(UDP_, "Failed to bind socket: (%s:%d) address %s port %d\n", strerror(errno), errno, ip_addr, port); - return -1; - } - - /* Create a new descriptor for this connection */ - udp_socket_desc_p = calloc(1, sizeof(struct udp_socket_desc_s)); - - DevAssert(udp_socket_desc_p != NULL); - - udp_socket_desc_p->sd = sd; - udp_socket_desc_p->local_address = ip_addr; - udp_socket_desc_p->local_port = port; - udp_socket_desc_p->task_id = task_id; - - LOG_I(UDP_, "Inserting new descriptor for task %d, sd %d\n", udp_socket_desc_p->task_id, udp_socket_desc_p->sd); - pthread_mutex_lock(&udp_socket_list_mutex); - STAILQ_INSERT_TAIL(&udp_socket_list, udp_socket_desc_p, entries); - pthread_mutex_unlock(&udp_socket_list_mutex); - - itti_subscribe_event_fd(TASK_UDP, sd); - LOG_I(UDP_, "Initializing UDP for local address %s with port %d: DONE\n", ip_addr, port); - return sd; -} - -int -udp_eNB_send_to( - int sd, - uint16_t port, - uint32_t address, - const uint8_t *buffer, - uint32_t length) -{ - struct sockaddr_in to; - socklen_t to_length; - - if (sd <= 0 || ((buffer == NULL) && (length > 0))) { - LOG_E(UDP_, "udp_send_to: bad param\n"); - return -1; - } - - memset(&to, 0, sizeof(struct sockaddr_in)); - to_length = sizeof(to); - - to.sin_family = AF_INET; - to.sin_port = htons(port); - to.sin_addr.s_addr = address; - - if (sendto(sd, (void *)buffer, (size_t)length, 0, (struct sockaddr *)&to, - to_length) < 0) { - LOG_E(UDP_, - "[SD %d] Failed to send data to "IPV4_ADDR" on port %d, buffer size %u\n", - sd, IPV4_ADDR_FORMAT(address), port, length); - return -1; - } - -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_I(UDP_, "[SD %d] Successfully sent to "IPV4_ADDR - " on port %d, buffer size %u, buffer address %x\n", - sd, IPV4_ADDR_FORMAT(address), port, length, buffer); -#endif - return 0; -} - - -void udp_eNB_receiver(struct udp_socket_desc_s *udp_sock_pP) -{ - uint8_t l_buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - int n; - socklen_t from_len; - struct sockaddr_in addr; - MessageDef *message_p = NULL; - udp_data_ind_t *udp_data_ind_p = NULL; - uint8_t *forwarded_buffer = NULL; - - if (1) { - from_len = (socklen_t)sizeof(struct sockaddr_in); - - if ((n = recvfrom(udp_sock_pP->sd, l_buffer, sizeof(l_buffer), MSG_TRUNC, - (struct sockaddr *)&addr, &from_len)) < 0) { - LOG_E(UDP_, "Recvfrom failed %s\n", strerror(errno)); - return; - } else if (n > sizeof(l_buffer)) { - LOG_E(UDP_, "%s(%d). Message truncated. %d\n", __FUNCTION__, __LINE__, n); - return; - } else if (n == 0) { - LOG_W(UDP_, "Recvfrom returned 0\n"); - return; - } else { - forwarded_buffer = itti_malloc(TASK_UDP, udp_sock_pP->task_id, n*sizeof(uint8_t)); - DevAssert(forwarded_buffer != NULL); - memcpy(forwarded_buffer, l_buffer, n); - message_p = itti_alloc_new_message(TASK_UDP, 0, UDP_DATA_IND); - DevAssert(message_p != NULL); - udp_data_ind_p = &message_p->ittiMsg.udp_data_ind; - udp_data_ind_p->buffer = forwarded_buffer; - udp_data_ind_p->buffer_length = n; - udp_data_ind_p->peer_port = htons(addr.sin_port); - udp_data_ind_p->peer_address = addr.sin_addr.s_addr; - -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_I(UDP_, "Msg of length %d received from %s:%u\n", - n, inet_ntoa(addr.sin_addr), ntohs(addr.sin_port)); -#endif - - /* TODO: this is a hack. Let's accept failures and do nothing when - * it happens. Since itti_send_msg_to_task crashes when the message - * queue is full we wrote itti_try_send_msg_to_task that returns -1 - * if the queue is full. - */ - /* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */ - if (itti_send_msg_to_task(udp_sock_pP->task_id, INSTANCE_DEFAULT, message_p) < 0) { - LOG_E(UDP_, "Failed to send message %d to task %d\n", - UDP_DATA_IND, - udp_sock_pP->task_id); - itti_free(TASK_UDP, message_p); - itti_free(TASK_UDP, forwarded_buffer); - return; - } - } - } - - //close(udp_sock_p->sd); - //udp_sock_p->sd = -1; - - //pthread_mutex_lock(&udp_socket_list_mutex); - //STAILQ_REMOVE(&udp_socket_list, udp_sock_p, udp_socket_desc_s, entries); - //pthread_mutex_unlock(&udp_socket_list_mutex); -} - - -void *udp_eNB_task(void *args_p) -{ - int nb_events; - struct epoll_event *events; - MessageDef *received_message_p = NULL; - //const char *msg_name = NULL; - //instance_t instance = 0; - udp_enb_init(); - - itti_mark_task_ready(TASK_UDP); - MSC_START_USE(); - - while(1) { - itti_receive_msg(TASK_UDP, &received_message_p); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UDP_ENB_TASK, VCD_FUNCTION_IN); -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "Got message %p\n", &received_message_p); -#endif - - if (received_message_p != NULL) { - - //msg_name = ITTI_MSG_NAME (received_message_p); - //instance = ITTI_MSG_DESTINATION_INSTANCE (received_message_p); - - switch (ITTI_MSG_ID(received_message_p)) { - case UDP_INIT: { - LOG_D(UDP_, "Received UDP_INIT\n"); - udp_init_t *udp_init_p; - udp_init_p = &received_message_p->ittiMsg.udp_init; - udp_eNB_create_socket( - udp_init_p->port, - udp_init_p->address, - ITTI_MSG_ORIGIN_ID(received_message_p)); - } - break; - - case UDP_DATA_REQ: { -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "Received UDP_DATA_REQ\n"); -#endif - int udp_sd = -1; - ssize_t bytes_written; - - struct udp_socket_desc_s *udp_sock_p = NULL; - udp_data_req_t *udp_data_req_p; - struct sockaddr_in peer_addr; - - udp_data_req_p = &received_message_p->ittiMsg.udp_data_req; - - memset(&peer_addr, 0, sizeof(struct sockaddr_in)); - - peer_addr.sin_family = AF_INET; - peer_addr.sin_port = htons(udp_data_req_p->peer_port); - peer_addr.sin_addr.s_addr = udp_data_req_p->peer_address; - - pthread_mutex_lock(&udp_socket_list_mutex); - udp_sock_p = udp_eNB_get_socket_desc(ITTI_MSG_ORIGIN_ID(received_message_p)); - - if (udp_sock_p == NULL) { - LOG_E(UDP_, - "Failed to retrieve the udp socket descriptor " - "associated with task %d\n", - ITTI_MSG_ORIGIN_ID(received_message_p)); - pthread_mutex_unlock(&udp_socket_list_mutex); - - if (udp_data_req_p->buffer) { - itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), udp_data_req_p->buffer); - } - - goto on_error; - } - - udp_sd = udp_sock_p->sd; - pthread_mutex_unlock(&udp_socket_list_mutex); - -//#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "[%d] Sending message of size %u to "IPV4_ADDR" and port %u\n", - udp_sd, - udp_data_req_p->buffer_length, - IPV4_ADDR_FORMAT(udp_data_req_p->peer_address), - udp_data_req_p->peer_port); -//#endif - bytes_written = sendto( - udp_sd, - &udp_data_req_p->buffer[udp_data_req_p->buffer_offset], - udp_data_req_p->buffer_length, - 0, - (struct sockaddr *)&peer_addr, - sizeof(struct sockaddr_in)); - - if (bytes_written != udp_data_req_p->buffer_length) { - LOG_E(UDP_, "There was an error while writing to socket %d rc %zd" - "(%d:%s) May be normal if GTPU kernel module loaded on same host (may NF_DROP IP packet)\n", - udp_sd, bytes_written, errno, strerror(errno)); - } - - itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), udp_data_req_p->buffer); - } - break; - - case TERMINATE_MESSAGE: { - LOG_W(UDP_, " *** Exiting UDP thread\n"); - itti_exit_task(); - } - break; - - case MESSAGE_TEST: { - } break; - - default: { - LOG_W(UDP_, "Unkwnon message ID %d:%s\n", - ITTI_MSG_ID(received_message_p), - ITTI_MSG_NAME(received_message_p)); - } - break; - } - -on_error: - itti_free (ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p); - received_message_p = NULL; - } - - nb_events = itti_get_events(TASK_UDP, &events); - - /* Now handle notifications for other sockets */ - if (nb_events > 0) { -#if defined(LOG_UDP) && LOG_UDP > 0 - LOG_D(UDP_, "UDP task Process %d events\n",nb_events); -#endif - udp_eNB_process_file_descriptors(events, nb_events); - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UDP_ENB_TASK, VCD_FUNCTION_OUT); - } - - LOG_I(UDP_, "Task UDP eNB exiting\n"); - return NULL; -} - -int udp_enb_init(void) -{ - LOG_I(UDP_, "Initializing UDP task interface\n"); - STAILQ_INIT(&udp_socket_list); - LOG_I(UDP_, "Initializing UDP task interface: DONE\n"); - return 0; -} diff --git a/openair3/UDP/udp_eNB_task.h b/openair3/UDP/udp_eNB_task.h deleted file mode 100644 index 8b783f7455..0000000000 --- a/openair3/UDP/udp_eNB_task.h +++ /dev/null @@ -1,97 +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 udp_eNB_task.h -* \brief -* \author Sebastien ROUX, Lionel Gauthier -* \company Eurecom -* \email: lionel.gauthier@eurecom.fr -*/ -#include -#include - -#ifndef UDP_ENB_TASK_H_ -#define UDP_ENB_TASK_H_ -#include "enb_config.h" - - -/** \brief UDP recv callback prototype. Will be called every time a payload is - * received on socket. - * \param port Port on which data had been received - * \param address Sender Ipv4 address - * \param buffer Pointer to data (should be freed by user) - * \param length Length of message received - * \param arg_p User provided argument (transparent for wrappers) - * @returns Execution result - */ -typedef int (*udp_recv_callback)(uint16_t port, - uint32_t address, - uint8_t *buffer, - uint32_t length, - void *arg_p); - -typedef struct { - int sd; /* Socket descriptor to use */ - pthread_t listener_thread; /* Thread affected to recv */ - char *local_address; /* Local ipv4 address to use */ - uint16_t local_port; /* Local port to use */ - task_id_t task_id; /* Task who has requested the new endpoint */ -} udp_data_t; - -/** \brief Create new datagram connection-less socket and create new thread - * for data in downstream. - * \param ip_addr Local IPv4 address to use - * \param port Local port to use - * \param udp_data_p - * \param recv_callback Pointer to data (should be freed by user) - * \param arg_p Optionnal argument to pass to recv_callback - * @returns < 0 on failure or socket descriptor on success - */ -int udp_create_connection(char *ip_addr, uint16_t port, - udp_data_t *udp_data_p, - udp_recv_callback recv_callback, - void *arg_p); - -/** \brief Send buffer to remote peer. - * \param sd socket descriptor to use - * \param port remote port - * \param address remote address - * \param buffer Data buffer to send - * \param length Buffer length - * @returns < 0 on failure or socket descriptor on success - */ -int udp_send_to(int sd, uint16_t port, uint32_t address, - const uint8_t *buffer, uint32_t length); - - -/** \brief UDP ITTI task on eNB. - * \param args_p - * @returns always NULL - */ -void *udp_eNB_task(void *args_p); - -/** \brief init UDP layer. - * \param enb_config_p configuration of eNB - * @returns always 0 - */ -int udp_enb_init(void); - -#endif /* UDP_ENB_TASK_H_ */ diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 64146bc7ca..379ec415dc 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -46,7 +46,7 @@ typedef struct Gtpv1uMsgHeader { #define GTP_GPDU (255) -typedef struct ocp_gtpv1u_bearer_s { +typedef struct gtpv1u_bearer_s { /* TEID used in dl and ul */ teid_t teid_incoming; ///< eNB TEID teid_t teid_outgoing; ///< Remote TEID @@ -55,10 +55,10 @@ typedef struct ocp_gtpv1u_bearer_s { tcp_udp_port_t outgoing_port; uint16_t seqNum; uint8_t npduNum; -} ocp_gtpv1u_bearer_t; +} gtpv1u_bearer_t; typedef struct { - map bearers; + map bearers; } teidData_t; typedef struct { @@ -173,7 +173,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b return; } - map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); + map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); if ( ptr2 == ptrRnti->second.bearers.end() ) { LOG_E(GTPU,"[%ld] GTP-U instance: sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id); @@ -191,7 +191,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b ptr2->second.npduNum++; // copy to release the mutex - ocp_gtpv1u_bearer_t tmp=ptr2->second; + gtpv1u_bearer_t tmp=ptr2->second; pthread_mutex_unlock(&globGtp.gtp_lock); gtpv1uCreateAndSendMsg(compatInst(instance), tmp.outgoing_ip_addr, @@ -216,7 +216,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req, return; } - map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); + map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); if ( ptr2 == ptrRnti->second.bearers.end() ) { LOG_D(GTPU,"GTP-U instance: %ld sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id); @@ -234,7 +234,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req, ptr2->second.npduNum++; // copy to release the mutex - ocp_gtpv1u_bearer_t tmp=ptr2->second; + gtpv1u_bearer_t tmp=ptr2->second; pthread_mutex_unlock(&globGtp.gtp_lock); gtpv1uCreateAndSendMsg(compatInst(instance), tmp.outgoing_ip_addr, @@ -257,7 +257,7 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r return; } - map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); + map::iterator ptr2=ptrRnti->second.bearers.find(rab_id); if ( ptr2 == ptrRnti->second.bearers.end() ) { LOG_E(GTPU,"[%ld] GTP-U sending a packet to a non existant RNTI:RAB: %x/%x\n", instance, rnti, rab_id); @@ -267,7 +267,7 @@ static void gtpv1uEndTunnel(instance_t instance, gtpv1u_enb_tunnel_data_req_t *r LOG_D(GTPU,"[%ld] sending a end packet packet to RNTI:RAB:teid %x/%x/%x\n", instance, rnti, rab_id,ptr2->second.teid_outgoing); - ocp_gtpv1u_bearer_t tmp=ptr2->second; + gtpv1u_bearer_t tmp=ptr2->second; pthread_mutex_unlock(&globGtp.gtp_lock); Gtpv1uMsgHeaderT msgHdr; // N should be 0 for us (it was used only in 2G and 3G) @@ -383,12 +383,12 @@ static int udpServerSocket(openAddr_s addr) { return sockfd; } -instance_t ocp_gtpv1Init(openAddr_t context) { +instance_t gtpv1Init(openAddr_t context) { pthread_mutex_lock(&globGtp.gtp_lock); int id=udpServerSocket(context); if (id>=0) { - itti_subscribe_event_fd(OCP_GTPV1_U, id); + itti_subscribe_event_fd(TASK_GTPV1_U, id); } else LOG_E(GTPU,"can't create GTP-U instance\n"); @@ -408,7 +408,7 @@ void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer return; } - map::iterator ptr2=ptrRnti->second.bearers.find(bearer_id); + map::iterator ptr2=ptrRnti->second.bearers.find(bearer_id); if ( ptr2 == ptrRnti->second.bearers.end() ) { LOG_E(GTPU,"[%ld] Update tunnel for a existing rnti %x, but wrong bearer_id %u\n", instance, rnti, bearer_id); @@ -447,7 +447,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer inst->te2ue_mapping[incoming_teid].callBack=callBack; - ocp_gtpv1u_bearer_t *tmp=&inst->ue2te_mapping[rnti].bearers[outgoing_bearer_id]; + gtpv1u_bearer_t *tmp=&inst->ue2te_mapping[rnti].bearers[outgoing_bearer_id]; int addrs_length_in_bytes = remoteAddr.length / 8; @@ -487,7 +487,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer return incoming_teid; } -int ocp_gtpv1u_create_s1u_tunnel(instance_t instance, +int gtpv1u_create_s1u_tunnel(instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) { LOG_D(GTPU, "[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x\n", @@ -521,7 +521,7 @@ int ocp_gtpv1u_create_s1u_tunnel(instance_t instance, return !GTPNOK; } -int ocp_gtpv1u_update_s1u_tunnel( +int gtpv1u_update_s1u_tunnel( const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req, const rnti_t prior_rnti @@ -546,7 +546,7 @@ int ocp_gtpv1u_update_s1u_tunnel( LOG_W(GTPU,"[%ld] Update a not existing tunnel, start create the new one (new rnti %x, old rnti %x)\n", instance, create_tunnel_req->rnti, prior_rnti); pthread_mutex_unlock(&globGtp.gtp_lock); gtpv1u_enb_create_tunnel_resp_t tmp; - (void)ocp_gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp); + (void)gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp); return 0; } @@ -593,14 +593,14 @@ int gtpv1u_update_ngu_tunnel( return GTPNOK; } -int ocp_gtpv1u_create_x2u_tunnel( +int gtpv1u_create_x2u_tunnel( const instance_t instanceP, const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP) { AssertFatal( false, "to be developped\n"); } -int newGtpuDeleteTunnel(instance_t instance, rnti_t rnti) { + int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { LOG_D(GTPU, "[%ld] Start delete tunnels for RNTI %x\n", instance, rnti); pthread_mutex_lock(&globGtp.gtp_lock); @@ -627,20 +627,58 @@ int newGtpuDeleteTunnel(instance_t instance, rnti_t rnti) { LOG_I(GTPU, "[%ld] Deleted all tunnels for RNTI %x (%d tunnels deleted)\n", instance, rnti, nb); return !GTPNOK; } - -// Legacy delete tunnel finish by deleting all the rnti -// so the list of bearer provided is only a design bug -int ocp_gtpv1u_delete_s1u_tunnel( const instance_t instance, + + // Legacy delete tunnel finish by deleting all the rnti + // so the list of bearer provided is only a design bug + int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { - return newGtpuDeleteTunnel(instance, req_pP->rnti); + return newGtpuDeleteAllTunnels(instance, req_pP->rnti); } + + int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id) { + LOG_D(GTPU, "[%ld] Start delete tunnels for RNTI %x\n", + instance, rnti); + pthread_mutex_lock(&globGtp.gtp_lock); + auto inst=&globGtp.instances[compatInst(instance)]; + auto ptrRNTI=inst->ue2te_mapping.find(rnti); + if ( ptrRNTI == inst->ue2te_mapping.end() ) { + LOG_W(GTPU,"[%ld] Delete GTP tunnels for rnti: %x, but no tunnel exits\n", instance, rnti); + pthread_mutex_unlock(&globGtp.gtp_lock); + return -1; + } + + int nb=0; + + for (int i=0; isecond.bearers.find(pdusession_id[i]); + if ( ptr2 == ptrRNTI->second.bearers.end() ) { + LOG_E(GTPU,"[%ld] GTP-U instance: delete of not existing tunnel RNTI:RAB: %x/%x\n", instance, rnti,pdusession_id[i]); + } else { + inst->te2ue_mapping.erase(ptr2->second.teid_incoming); + nb++; + } + } + + if (ptrRNTI->second.bearers.size() == 0 ) + // no tunnels on this rnti, erase the ue entry + inst->ue2te_mapping.erase(ptrRNTI); + pthread_mutex_unlock(&globGtp.gtp_lock); + LOG_I(GTPU, "[%ld] Deleted all tunnels for RNTI %x (%d tunnels deleted)\n", instance, rnti, nb); + return !GTPNOK; + } + int gtpv1u_delete_x2u_tunnel( const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t *const req_pP, - int enbflag) { + const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + LOG_E(GTPU,"x2 tunnel not implemented\n"); return 0; } - + +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t * req) { + return newGtpuDeleteTunnels(instance, req->rnti, req->num_pdusession, req->pdusession_id); +} + static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, uint32_t msgBufLen, @@ -871,14 +909,14 @@ void gtpv1uReceiver(int h) { #include -void *ocp_gtpv1uTask(void *args) { +void *gtpv1uTask(void *args) { while(1) { /* Trying to fetch a message from the message queue. If the queue is empty, this function will block till a message is sent to the task. */ MessageDef *message_p = NULL; - itti_receive_msg(OCP_GTPV1_U, &message_p); + itti_receive_msg(TASK_GTPV1_U, &message_p); if (message_p != NULL ) { openAddr_t addr= {0}; @@ -888,7 +926,7 @@ void *ocp_gtpv1uTask(void *args) { case GTPV1U_ENB_TUNNEL_DATA_REQ: { gtpv1uSend(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)), >PV1U_ENB_TUNNEL_DATA_REQ(message_p), false, false); - itti_free(OCP_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); + itti_free(TASK_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); } break; @@ -908,7 +946,7 @@ void *ocp_gtpv1uTask(void *args) { case GTPV1U_ENB_END_MARKER_REQ: gtpv1uEndTunnel(compatInst(ITTI_MSG_DESTINATION_INSTANCE(message_p)), >PV1U_ENB_TUNNEL_DATA_REQ(message_p)); - itti_free(OCP_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); + itti_free(TASK_GTPV1_U, GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).buffer); break; case GTPV1U_ENB_DATA_FORWARDING_REQ: @@ -923,7 +961,7 @@ void *ocp_gtpv1uTask(void *args) { strcpy(addr.originHost, GTPV1U_REQ(message_p).localAddrStr); strcpy(addr.originService, GTPV1U_REQ(message_p).localPortStr); strcpy(addr.destinationService,addr.originService); - AssertFatal((legacyInstanceMapping=ocp_gtpv1Init(addr))!=0,"Instance 0 reserved for legacy\n"); + AssertFatal((legacyInstanceMapping=gtpv1Init(addr))!=0,"Instance 0 reserved for legacy\n"); break; default: @@ -932,12 +970,12 @@ void *ocp_gtpv1uTask(void *args) { break; } - AssertFatal(EXIT_SUCCESS==itti_free(OCP_GTPV1_U, message_p), "Failed to free memory!\n"); + AssertFatal(EXIT_SUCCESS==itti_free(TASK_GTPV1_U, message_p), "Failed to free memory!\n"); } struct epoll_event *events; - int nb_events = itti_get_events(OCP_GTPV1_U, &events); + int nb_events = itti_get_events(TASK_GTPV1_U, &events); for (int i = 0; i < nb_events; i++) if ((events[i].events&EPOLLIN)) diff --git a/openair3/ocp-gtpu/gtp_itf.h b/openair3/ocp-gtpu/gtp_itf.h index 3893acf40f..22a86bc887 100644 --- a/openair3/ocp-gtpu/gtp_itf.h +++ b/openair3/ocp-gtpu/gtp_itf.h @@ -8,19 +8,6 @@ extern "C" { #endif -#include -#if defined(NEW_GTPU) -#define gtpv1u_create_s1u_tunnel ocp_gtpv1u_create_s1u_tunnel -#define gtpv1u_update_s1u_tunnel ocp_gtpv1u_update_s1u_tunnel -#define gtpv1u_delete_s1u_tunnel ocp_gtpv1u_delete_s1u_tunnel -#define gtpv1u_create_x2u_tunnel ocp_gtpv1u_create_x2u_tunnel -#define gtpv1u_eNB_task ocp_gtpv1uTask -#define nr_gtpv1u_gNB_task ocp_gtpv1uTask -#define TASK_VARIABLE OCP_GTPV1_U -#else -#define TASK_VARIABLE TASK_GTPV1_U -#endif - typedef boolean_t (*gtpCallback)( protocol_ctxt_t *ctxt_pP, const srb_flag_t srb_flagP, @@ -43,18 +30,18 @@ typedef struct openAddr_s { // the init function create a gtp instance and return the gtp instance id // the parameter originInstance will be sent back in each message from gtp to the creator -void ocp_gtpv1uReceiver(int h); -void ocp_gtpv1uProcessTimeout(int handle,void *arg); -int ocp_gtpv1u_create_s1u_tunnel(const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, +void gtpv1uReceiver(int h); +void gtpv1uProcessTimeout(int handle,void *arg); +int gtpv1u_create_s1u_tunnel(const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp); -int ocp_gtpv1u_update_s1u_tunnel(const instance_t instanceP, +int gtpv1u_update_s1u_tunnel(const instance_t instanceP, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req_pP, const rnti_t prior_rnti ); -int ocp_gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); +int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); -int ocp_gtpv1u_create_x2u_tunnel( +int gtpv1u_create_x2u_tunnel( const instance_t instanceP, const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP); @@ -64,8 +51,10 @@ int ocp_gtpv1u_create_x2u_tunnel( teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer_id, int outgoing_rb_id, teid_t teid, transport_layer_addr_t remoteAddr, int port, gtpCallback callBack); void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer_id, teid_t newOutgoingTeid); -instance_t ocp_gtpv1Init(openAddr_t context); -void *ocp_gtpv1uTask(void *args); +int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti); + int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id); +instance_t gtpv1Init(openAddr_t context); +void *gtpv1uTask(void *args); #ifdef __cplusplus } diff --git a/openair3/GTPV1-U/gtpv1u_eNB_defs.h b/openair3/ocp-gtpu/gtpv1u_eNB_task.h similarity index 61% rename from openair3/GTPV1-U/gtpv1u_eNB_defs.h rename to openair3/ocp-gtpu/gtpv1u_eNB_task.h index fb317e4ca6..dbfb6ae917 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB_defs.h +++ b/openair3/ocp-gtpu/gtpv1u_eNB_task.h @@ -19,32 +19,23 @@ * contact@openairinterface.org */ -/*! \file gtpv1u_eNB_defs.h - * \brief - * \author Sebastien ROUX, Lionel GAUTHIER - * \version 1.0 - * \company Eurecom - * \email: lionel.gauthier@eurecom.fr - */ +/*! \file gtpv1u_eNB_task.h +* \brief +* \author Lionel Gauthier +* \company Eurecom +* \email: lionel.gauthier@eurecom.fr +*/ -#include "hashtable.h" -#include "LTE_asn_constant.h" +#ifndef GTPV1U_ENB_TASK_H_ +#define GTPV1U_ENB_TASK_H_ -#ifndef GTPV1U_ENB_DEFS_H_ -#define GTPV1U_ENB_DEFS_H_ +typedef struct gtpv1u_data_s { + /* RB tree of UEs */ + hash_table_t *ue_mapping; +} gtpv1u_data_t; -#include "NwGtpv1u.h" - -#define GTPV1U_UDP_PORT (2152) #define GTPV1U_BEARER_OFFSET 3 - #define GTPV1U_MAX_BEARERS_ID (max_val_LTE_DRB_Identity - GTPV1U_BEARER_OFFSET) - -#define GTPV1U_SOURCE_ENB (0) -#define GTPV1U_TARGET_ENB (1) -#define GTPV1U_MSG_FROM_SOURCE_ENB (0) -#define GTPV1U_MSG_FROM_SPGW (1) - typedef enum { BEARER_DOWN = 0, BEARER_IN_CONFIG, @@ -54,16 +45,7 @@ typedef enum { BEARER_MAX, } bearer_state_t; - -typedef struct gtpv1u_teid_data_s { - /* UE identifier for oaisim stack */ - module_id_t enb_id; - rnti_t ue_id; - ebi_t eps_bearer_id; -} gtpv1u_teid_data_t; - - -typedef struct gtpv1u_bearer_s { +typedef struct fixMe_gtpv1u_bearer_s { /* TEID used in dl and ul */ teid_t teid_eNB; ///< eNB TEID uintptr_t teid_eNB_stack_session; ///< eNB TEID @@ -76,7 +58,7 @@ typedef struct gtpv1u_bearer_s { tcp_udp_port_t port; //NwGtpv1uStackSessionHandleT stack_session; bearer_state_t state; -} gtpv1u_bearer_t; +} fixMe_gtpv1u_bearer_t; typedef struct gtpv1u_ue_data_s { /* UE identifier for oaisim stack */ @@ -89,45 +71,43 @@ typedef struct gtpv1u_ue_data_s { * Note that the first LCID available for data is 3 and we fixed the maximum * number of e-rab per UE to be (32 [id range]), max RB is 11. The real rb id will 3 + rab_id (3..32). */ - gtpv1u_bearer_t bearers[GTPV1U_MAX_BEARERS_ID]; + fixMe_gtpv1u_bearer_t bearers[GTPV1U_MAX_BEARERS_ID]; //RB_ENTRY(gtpv1u_ue_data_s) gtpv1u_ue_node; } gtpv1u_ue_data_t; - -typedef struct gtpv1u_data_s { - /* nwgtpv1u stack internal data */ - NwGtpv1uStackHandleT gtpv1u_stack; - - /* RB tree of UEs */ - hash_table_t *ue_mapping; // PDCP->GTPV1U - hash_table_t *teid_mapping; // GTPV1U -> PDCP - - //RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head; - /* Local IP address to use */ - in_addr_t enb_ip_address_for_S1u_S12_S4_up; - /* UDP internal data */ - //udp_data_t udp_data; - - uint16_t seq_num; - uint8_t restart_counter; - -} gtpv1u_data_t; - +/* int gtpv1u_new_data_req( - uint8_t enb_module_idP, - rnti_t ue_rntiP, - uint8_t rab_idP, - uint8_t *buffer_pP, - uint32_t buf_lenP, - uint32_t buf_offsetP -); + uint8_t enb_id, + uint8_t ue_id, + uint8_t rab_id, + uint8_t *buffer, + uint32_t buf_len, + uint32_t buf_offset);*/ + +int gtpv1u_eNB_init(void); +void *gtpv1u_eNB_process_itti_msg(void*); +void *gtpv1u_eNB_task(void *args); int -gtpv1u_initial_req( - gtpv1u_data_t *gtpv1u_data_p, - uint32_t teid, - uint16_t port, - uint32_t address); +gtpv1u_create_x2u_tunnel( + const instance_t instanceP, + const gtpv1u_enb_create_x2u_tunnel_req_t * const create_tunnel_req_pP, + gtpv1u_enb_create_x2u_tunnel_resp_t * const create_tunnel_resp_pP); -#endif /* GTPV1U_ENB_DEFS_H_ */ +int +gtpv1u_create_s1u_tunnel( + const instance_t instanceP, + const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, + gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP); + +int +gtpv1u_update_s1u_tunnel( + const instance_t instanceP, + const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, + const rnti_t prior_rnti); + +int gtpv1u_delete_x2u_tunnel( + const instance_t instanceP, + const gtpv1u_enb_delete_tunnel_req_t * const req_pP); +#endif /* GTPV1U_ENB_TASK_H_ */ diff --git a/openair3/GTPV1-U/gtpv1u_gNB_task.h b/openair3/ocp-gtpu/gtpv1u_gNB_task.h similarity index 94% rename from openair3/GTPV1-U/gtpv1u_gNB_task.h rename to openair3/ocp-gtpu/gtpv1u_gNB_task.h index fcfaa90304..cc36ee26fc 100644 --- a/openair3/GTPV1-U/gtpv1u_gNB_task.h +++ b/openair3/ocp-gtpu/gtpv1u_gNB_task.h @@ -47,5 +47,8 @@ gtpv1u_update_ngu_tunnel( const rnti_t prior_rnti ); +int gtpv1u_delete_ngu_tunnel( const instance_t instance, + gtpv1u_gnb_delete_tunnel_req_t *req); + #endif /* GTPV1U_GNB_TASK_H_ */ diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c index 4463228dc7..a6ae906d9d 100644 --- a/targets/COMMON/create_tasks.c +++ b/targets/COMMON/create_tasks.c @@ -28,7 +28,6 @@ #include "sctp_eNB_task.h" #include "x2ap_eNB.h" #include "s1ap_eNB.h" - #include "udp_eNB_task.h" #include "gtpv1u_eNB_task.h" #if ENABLE_RAL #include "lteRALue.h" @@ -67,11 +66,7 @@ int create_tasks(uint32_t enb_nb) { if (EPC_MODE_ENABLED && !NODE_IS_DU(type) && ! ( split73==SPLIT73_DU ) ) { rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL); AssertFatal(rc >= 0, "Create task for S1AP failed\n"); - if (!(get_softmodem_params()->emulate_rf)){ - rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL); - AssertFatal(rc >= 0, "Create task for UDP failed\n"); - } - rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL); + rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL); AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); } @@ -91,7 +86,7 @@ int create_tasks(uint32_t enb_nb) { rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL); AssertFatal(rc >= 0, "Create task for DU F1AP failed\n"); // DU is now GTP-U instead of protobuf - rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL); + rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL); AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); } diff --git a/targets/COMMON/create_tasks_mbms.c b/targets/COMMON/create_tasks_mbms.c index 1cd3bb2f3a..b82b4f158b 100644 --- a/targets/COMMON/create_tasks_mbms.c +++ b/targets/COMMON/create_tasks_mbms.c @@ -28,7 +28,6 @@ #include "sctp_eNB_task.h" #include "x2ap_eNB.h" #include "s1ap_eNB.h" - #include "udp_eNB_task.h" #include "gtpv1u_eNB_task.h" #include "m2ap_eNB.h" #include "m2ap_MCE.h" @@ -75,46 +74,10 @@ int create_tasks_mbms(uint32_t enb_nb) { rc = itti_create_task (TASK_MCE_APP, MCE_app_task, NULL); AssertFatal(rc >= 0, "Create task for MCE APP failed\n"); - -// LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n"); -// rc = itti_create_task (TASK_ENB_APP, eNB_app_task, NULL); -// AssertFatal(rc >= 0, "Create task for eNB APP failed\n"); -// -// LOG_I(RRC,"Creating RRC eNB Task\n"); -// rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL); -// AssertFatal(rc >= 0, "Create task for RRC eNB failed\n"); -// -// if (EPC_MODE_ENABLED) { -// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for SCTP failed\n"); -// } -// rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for SCTP failed\n"); -// -// -// if (EPC_MODE_ENABLED && !NODE_IS_DU(type)) { -// rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for S1AP failed\n"); -// if (!(get_softmodem_params()->emulate_rf)){ -// rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for UDP failed\n"); -// } -// rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL); -// AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); -// if (is_x2ap_enabled()) { -// rc = itti_create_task(TASK_X2AP, x2ap_task, NULL); -// AssertFatal(rc >= 0, "Create task for X2AP failed\n"); -// } else { -// LOG_I(X2AP, "X2AP is disabled.\n"); -// } -// } -//// if(!EPC_MODE_ENABLED){ // rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL); // AssertFatal(rc >= 0, "Create task for SCTP failed\n"); - rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL); - AssertFatal(rc >= 0, "Create task for UDP failed\n"); - rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL); + rc = itti_create_task(TASK_GTPV1_U, gtpv1uTask, NULL); AssertFatal(rc >= 0, "Create task for GTPV1U failed\n"); } /// diff --git a/targets/COMMON/create_tasks_ue.c b/targets/COMMON/create_tasks_ue.c index 9341107af9..cdca62c399 100644 --- a/targets/COMMON/create_tasks_ue.c +++ b/targets/COMMON/create_tasks_ue.c @@ -27,7 +27,6 @@ #include "sctp_eNB_task.h" #include "s1ap_eNB.h" #include "openair3/NAS/UE/nas_ue_task.h" - #include "udp_eNB_task.h" #include "gtpv1u_eNB_task.h" #if ENABLE_RAL #include "lteRALue.h" diff --git a/targets/RT/USER/TOOLS/thread_ipc.h b/targets/RT/USER/TOOLS/thread_ipc.h deleted file mode 100644 index ec008c30df..0000000000 --- a/targets/RT/USER/TOOLS/thread_ipc.h +++ /dev/null @@ -1,83 +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 - */ - -#ifndef __THREAD_IPC_H__ -#define __THREAD_IPC_H__ - - -#define SUB_FRAME_LENGTH 7680 -#define FRAME_LENGTH 76800 - -#define UE_UL_DELAY 6 /*设置上行组帧在同步时钟基础上的延时(子帧个数)*/ -#define UE_UL_SEND_DELAY 6 /*上行发送子帧号在接收子帧时间戳上的延时(子帧个数)*/ - -#define BUFFERMAX 5 /*环形缓冲区个数*/ -#define LOWBUFFER 3 /*环形缓冲区下限, 不能为0*/ -#define HIGHBUFFER 4 /*环形缓冲区上限*/ - -typedef struct { - long long subframe_num; /*子帧编号*/ - int buffer[SUB_FRAME_LENGTH * 2]; /*一子帧数据*/ -} buffer_t; - -typedef struct { - int packet_num; /*环形缓冲区数据包计数器,表示环形缓冲区有效数据包个数*/ - int isfull; /*标记环形缓冲区有效数据包是否达到上限标志*/ - int isempty; /*标记环形缓冲区有效数据包是否达到下限标志*/ - - pthread_mutex_t buffer_mutex; /*环形缓冲区操作保护锁*/ - pthread_cond_t full_cond; /*环形缓冲区上限条件变量,配合isfull使用 */ - pthread_cond_t empty_cond; /*环形缓冲区下限条件变量,配合isempty使用*/ - - buffer_t loop_buf[BUFFERMAX]; /*环形缓冲区*/ -} loop_buffer_op_t; - -typedef struct { - int decoding_subframe_num; /*待解码子帧的编号*/ - pthread_mutex_t buffer_mutex; /*对sync_buffer临界区的保护锁*/ - int sync_buffer[SUB_FRAME_LENGTH * 10]; /*同步线程与下行解码线程数据共享缓冲区*/ -} sync_buffer_t; - -typedef struct { - unsigned int rx_timestamp; /*接收数据包第一个sample时间戳*/ - unsigned int tx_timestamp; /*待发送数据包的时间戳*/ - unsigned long long current_subframe; /*当前子帧编号*/ - - int ue_sync_state; /*表示UE是否在同步状态,0表示失同步,1表示同步*/ - pthread_mutex_t sync_mutex; /*根据ue_sync_state标志,唤醒组帧线程*/ - - pthread_mutex_t ul_send_mutex; /*用于sync线程唤醒发送线程发送数据*/ - pthread_mutex_t dl_decode_mutex;/*下行解码保护锁,用于sync线程唤醒解码线程解码*/ - - loop_buffer_op_t loop_buffer; - sync_buffer_t sync_buffer; -} g_thread_ipc_t; - -void loop_buffer_reset(buffer_t *loop_buf); -int thread_ipc_init(void); -int thread_ipc_deinit(void); -int set_thread_attr(pthread_attr_t *attr, int policy, int priority, int cpuid); -int find_subframe_num(unsigned long long current_subframe_num, buffer_t *buf, int *flag); -int ue_unsync_thread_ipc_reset(void); - -extern g_thread_ipc_t thread_ipc; - -#endif From 00e058537d0bbc05da3cf4564179474484685e3d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 26 Jan 2022 16:34:41 +0100 Subject: [PATCH 314/883] Remove MSC library, it is not used anywhere --- ci-scripts/yaml_files/fr1_epc_20897/mme.conf | 1 - .../yaml_files/magma_nsa_20897/mme.conf | 1 - cmake_targets/CMakeLists.txt | 31 +- cmake_targets/at_commands/CMakeLists.txt | 2 - cmake_targets/build_oai | 2 +- cmake_targets/epc_test/CMakeLists.template | 1 - .../install_external_packages.ubuntu20 | 1 - .../s1c_mme_test/CMakeLists.template | 1 - cmake_targets/tools/build_helper | 3 +- .../tools/example_enb_exmimo_mme_hss.txt | 13 +- .../example_oaisim_enb_ue_mme_virtual.txt | 13 +- cmake_targets/tools/run_enb_s1_usrp | 38 - cmake_targets/tools/run_enb_ue_virt_noS1 | 32 - cmake_targets/tools/run_enb_ue_virt_s1 | 35 - common/config/DOC/config/rtusage.md | 1 - common/utils/LOG/DOC/rtusage.md | 3 - common/utils/LOG/log.c | 1 - common/utils/LOG/log.h | 1 - common/utils/msc/msc.c | 785 ------------------ common/utils/msc/msc.h | 131 --- common/utils/ocp_itti/intertask_interface.h | 2 - common/utils/telnetsrv/DOC/telnetlog.md | 1 - .../oai_enb.log | 1 - .../oai_gnb.log | 1 - executables/nr-softmodem-common.h | 3 - executables/nr-softmodem.c | 3 - executables/ocp-gnb.c | 1 - executables/softmodem-common.c | 1 - executables/softmodem-common.h | 4 - openair1/PHY/INIT/lte_init.c | 2 - openair1/PHY/INIT/nr_init.c | 1 - openair1/PHY/INIT/nr_init_ue.c | 1 - openair1/PHY/defs_UE.h | 1 - openair1/PHY/defs_common.h | 1 - openair1/PHY/defs_eNB.h | 1 - openair1/PHY/defs_nr_UE.h | 1 - openair1/SCHED/phy_procedures_lte_eNb.c | 1 - openair1/SCHED/prach_procedures.c | 1 - openair1/SCHED/ru_procedures.c | 1 - openair1/SCHED_NR/nr_prach_procedures.c | 1 - openair1/SCHED_NR/nr_ru_procedures.c | 1 - openair1/SCHED_NR/phy_procedures_nr_gNB.c | 1 - openair1/SIMULATION/NR_PHY/prachsim.c | 2 - openair2/F1AP/f1ap_common.h | 1 - openair2/F1AP/f1ap_du_interface_management.c | 16 - openair2/LAYER2/MAC/eNB_scheduler_RA.c | 3 - openair2/LAYER2/MAC/main.c | 1 - openair2/LAYER2/MAC/ra_procedures.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp.c | 23 - openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 58 -- openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c | 2 - openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c | 6 - openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c | 195 +---- openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h | 9 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c | 11 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c | 1 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c | 1 - .../LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c | 1 - .../AM_v9.3.0/rlc_am_timer_poll_retransmit.c | 16 - .../RLC/AM_v9.3.0/rlc_am_timer_reordering.c | 17 - .../AM_v9.3.0/rlc_am_timer_status_prohibit.c | 17 - openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c | 182 +--- openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h | 15 - .../RLC/UM_v9.3.0/rlc_um_control_primitives.c | 50 -- openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c | 1 - .../LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c | 12 - .../LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c | 1 - openair2/M2AP/m2ap_MCE_generate_messages.c | 18 - openair2/M2AP/m2ap_MCE_handler.c | 1 - openair2/M2AP/m2ap_MCE_interface_management.c | 56 +- openair2/M2AP/m2ap_eNB_generate_messages.c | 25 - openair2/M2AP/m2ap_eNB_handler.c | 1 - openair2/M2AP/m2ap_eNB_interface_management.c | 71 -- openair2/M2AP/m2ap_handler.c | 1 - openair2/RRC/LTE/L2_interface.c | 1 - openair2/RRC/LTE/L2_interface_common.c | 11 - openair2/RRC/LTE/L2_interface_ue.c | 11 - openair2/RRC/LTE/rrc_UE.c | 11 - openair2/RRC/LTE/rrc_eNB.c | 266 ------ openair2/RRC/LTE/rrc_eNB_GTPV1U.c | 10 - openair2/RRC/LTE/rrc_eNB_M2AP.c | 1 - openair2/RRC/LTE/rrc_eNB_S1AP.c | 104 --- openair2/RRC/LTE/rrc_eNB_UE_context.c | 5 - openair2/RRC/NR/L2_nr_interface.c | 11 - openair2/RRC/NR/rrc_gNB.c | 177 ---- openair2/RRC/NR/rrc_gNB_GTPV1U.c | 19 - openair2/RRC/NR/rrc_gNB_NGAP.c | 74 -- openair2/RRC/NR/rrc_gNB_UE_context.c | 5 - openair2/RRC/NR_UE/rrc_UE.c | 11 - openair2/SIMULATION/NR_RRC/itti_sim.c | 5 - openair2/X2AP/x2ap_eNB_generate_messages.c | 28 - openair2/X2AP/x2ap_eNB_handler.c | 1 - openair3/GTPV1-U/gtpv1u_eNB.c | 98 --- openair3/GTPV1-U/gtpv1u_gNB.c | 61 -- openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c | 31 - openair3/M3AP/m3ap_MCE_generate_messsages.c | 24 - openair3/M3AP/m3ap_MCE_handler.c | 1 - openair3/M3AP/m3ap_MCE_interface_management.c | 44 +- openair3/M3AP/m3ap_MME_generate_messages.c | 18 - openair3/M3AP/m3ap_MME_handler.c | 1 - openair3/M3AP/m3ap_MME_interface_management.c | 37 - openair3/M3AP/m3ap_handler.c | 1 - openair3/NAS/COMMON/UTIL/nas_timer.c | 1 - openair3/NAS/NR_UE/nr_nas_msg_sim.c | 1 - openair3/NAS/TEST/MSC/ActivatePDN.png | Bin 9430 -> 0 bytes .../NAS/TEST/MSC/AuthenticationReject.png | Bin 21465 -> 0 bytes openair3/NAS/TEST/MSC/DeactivatePDN.png | Bin 8833 -> 0 bytes openair3/NAS/TEST/MSC/InitialAttach.png | Bin 32243 -> 0 bytes openair3/NAS/TEST/MSC/InitialAttachReject.png | Bin 16271 -> 0 bytes openair3/NAS/TEST/MSC/NomalDetach.png | Bin 5844 -> 0 bytes openair3/NAS/TEST/MSC/README | 34 - openair3/NAS/TEST/MSC/SwitchOffDetach.png | Bin 3697 -> 0 bytes openair3/NAS/TEST/MSC/msc_gen.py | 354 -------- openair3/NAS/UE/EMM/Detach.c | 1 - openair3/NAS/UE/EMM/Identification.c | 1 - openair3/NAS/UE/EMM/SAP/emm_as.c | 1 - openair3/NAS/UE/EMM/SecurityModeControl.c | 1 - openair3/NAS/UE/nas_itti_messaging.c | 43 - openair3/NAS/UE/nas_itti_messaging.h | 1 - openair3/NAS/UE/nas_proc.c | 1 - openair3/NAS/UE/nas_ue_task.c | 4 - openair3/NGAP/ngap_gNB.c | 2 - .../ngap_gNB_context_management_procedures.c | 21 - openair3/NGAP/ngap_gNB_handlers.c | 15 - openair3/NGAP/ngap_gNB_nas_procedures.c | 96 --- openair3/S1AP/s1ap_eNB.c | 2 - .../s1ap_eNB_context_management_procedures.c | 21 - openair3/S1AP/s1ap_eNB_handlers.c | 15 - openair3/S1AP/s1ap_eNB_nas_procedures.c | 106 --- openair3/SCTP/sctp_eNB_task.c | 3 - openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 2 - .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 1 - openair3/UDP/udp_eNB_task.c | 2 - targets/RT/USER/lte-ru.c | 1 - targets/RT/USER/lte-softmodem.c | 10 - targets/RT/USER/lte-softmodem.h | 1 - targets/RT/USER/lte-uesoftmodem.c | 7 - targets/RT/USER/ru_control.c | 1 - targets/SCRIPTS/msc_gen.py | 329 -------- 139 files changed, 65 insertions(+), 4023 deletions(-) delete mode 100644 common/utils/msc/msc.c delete mode 100644 common/utils/msc/msc.h delete mode 100644 openair3/NAS/TEST/MSC/ActivatePDN.png delete mode 100644 openair3/NAS/TEST/MSC/AuthenticationReject.png delete mode 100644 openair3/NAS/TEST/MSC/DeactivatePDN.png delete mode 100644 openair3/NAS/TEST/MSC/InitialAttach.png delete mode 100644 openair3/NAS/TEST/MSC/InitialAttachReject.png delete mode 100644 openair3/NAS/TEST/MSC/NomalDetach.png delete mode 100644 openair3/NAS/TEST/MSC/README delete mode 100644 openair3/NAS/TEST/MSC/SwitchOffDetach.png delete mode 100755 openair3/NAS/TEST/MSC/msc_gen.py delete mode 100755 targets/SCRIPTS/msc_gen.py diff --git a/ci-scripts/yaml_files/fr1_epc_20897/mme.conf b/ci-scripts/yaml_files/fr1_epc_20897/mme.conf index 9dcb44ef2a..923bf1c388 100644 --- a/ci-scripts/yaml_files/fr1_epc_20897/mme.conf +++ b/ci-scripts/yaml_files/fr1_epc_20897/mme.conf @@ -114,7 +114,6 @@ MME : MME_APP_LOG_LEVEL = "TRACE"; S6A_LOG_LEVEL = "TRACE"; UTIL_LOG_LEVEL = "ERROR"; - MSC_LOG_LEVEL = "ERROR"; ITTI_LOG_LEVEL = "ERROR"; ASN1_VERBOSITY = "annoying"; }; diff --git a/ci-scripts/yaml_files/magma_nsa_20897/mme.conf b/ci-scripts/yaml_files/magma_nsa_20897/mme.conf index 242b780a40..6bdace2c28 100644 --- a/ci-scripts/yaml_files/magma_nsa_20897/mme.conf +++ b/ci-scripts/yaml_files/magma_nsa_20897/mme.conf @@ -121,7 +121,6 @@ MME : S11_LOG_LEVEL = "DEBUG"; S6A_LOG_LEVEL = "DEBUG"; UTIL_LOG_LEVEL = "INFO"; - MSC_LOG_LEVEL = "ERROR"; ITTI_LOG_LEVEL = "ERROR"; MME_SCENARIO_PLAYER_LOG_LEVEL = "ERROR"; ASN1_VERBOSITY = "INFO"; diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f2eda66fc0..7ec3590857 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -938,10 +938,6 @@ add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only vali add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????") add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????") -add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams") -add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams") -add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams") - add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE") add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE") add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE") @@ -1301,11 +1297,6 @@ add_library(HASHTABLE ) include_directories(${OPENAIR_DIR}/common/utils/hashtable) -add_library(msc MODULE ${OPENAIR_DIR}/common/utils/msc/msc.c ) -target_link_libraries (msc LFDS) - -include_directories(${OPENAIR_DIR}/common/utils/msc) - set(UTIL_SRC # ${OPENAIR2_DIR}/UTIL/CLI/cli.c # ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c @@ -2807,7 +2798,7 @@ target_link_libraries (lte-softmodem -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7 - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) @@ -2851,7 +2842,7 @@ target_link_libraries (ocp-enb RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} -Wl,--end-group z dl) target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB}) @@ -2945,7 +2936,7 @@ target_link_libraries (lte-uesoftmodem RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES} -Wl,--end-group z dl) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) @@ -2989,7 +2980,7 @@ target_compile_definitions(nr-softmodem PUBLIC NEW_GTPU) target_link_libraries (nr-softmodem -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB + ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) @@ -3029,7 +3020,7 @@ add_executable(ocp-gnb target_link_libraries (ocp-gnb -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB + ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON -Wl,--end-group z dl) @@ -3075,9 +3066,9 @@ target_link_libraries (nr-uesoftmodem RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} NFAPI_USER_LIB S1AP_LIB S1AP_ENB - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} -Wl,--end-group z dl) target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) @@ -3326,7 +3317,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) add_executable(test_epc_play_scenario @@ -3345,7 +3336,7 @@ add_executable(test_epc_play_scenario ) target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) @@ -3386,7 +3377,7 @@ if (${T_TRACER}) ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai - coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO + coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX @@ -3501,7 +3492,7 @@ target_compile_definitions(nr-ittisim PUBLIC NEW_GTPU) target_link_libraries (nr-ittisim -Wl,--start-group UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB + ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE diff --git a/cmake_targets/at_commands/CMakeLists.txt b/cmake_targets/at_commands/CMakeLists.txt index bd71125cf0..dc91f3c31c 100755 --- a/cmake_targets/at_commands/CMakeLists.txt +++ b/cmake_targets/at_commands/CMakeLists.txt @@ -409,7 +409,6 @@ set(emm_HDR add_library(emm ${emm_SRC} ${emm_HDR}) target_include_directories(emm PRIVATE - ${OPENAIR_DIR}/common/utils/msc ${OPENAIR_DIR}/common/utils ${OPENAIR_DIR}/openair2/COMMON ${OPENAIR_NAS_DIR}/UE @@ -693,7 +692,6 @@ include_directories( ${OPENAIR_TARGETS}/COMMON ${OPENAIR_NAS_DIR}/UE ${OPENAIR_DIR}/common/utils - ${OPENAIR_DIR}/common/utils/msc ${OPENAIR3_DIR}/COMMON ${OPENAIR3_DIR}/SECU ${OPENAIR_NAS_DIR}/src diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 68aef48c6b..fdb4875cfb 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -67,7 +67,7 @@ BUILD_ECLIPSE=0 NR="False" ITTI_SIM="False" SANITIZE_ADDRESS="False" -OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope msc" +OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope" RU=0 trap handle_ctrl_c INT diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template index 7a097fffb0..28da13437c 100755 --- a/cmake_targets/epc_test/CMakeLists.template +++ b/cmake_targets/epc_test/CMakeLists.template @@ -26,7 +26,6 @@ set ( LOG_NO_THREAD True ) set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False) set ( MSG_PRINT False ) set ( MU_RECEIVER False ) set ( NAS_ADDRESS_FIX False ) diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index 33e558a234..226d4c40c6 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -410,7 +410,6 @@ check_install_ubuntu_packages() { libxml2 \ libxml2-dev \ libxslt1-dev \ - mscgen \ octave-signal \ openssh-client \ openssh-server \ diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template index e62df04bc6..d2d2d3e053 100755 --- a/cmake_targets/s1c_mme_test/CMakeLists.template +++ b/cmake_targets/s1c_mme_test/CMakeLists.template @@ -26,7 +26,6 @@ set ( LOG_NO_THREAD True ) set ( DEADLINE_SCHEDULER False ) set ( MAC_CONTEXT 1 ) set ( MAX_NUM_CCs 1 ) -set ( MESSAGE_CHART_GENERATOR False) set ( MSG_PRINT False ) set ( MU_RECEIVER False ) set ( NAS_ADDRESS_FIX False ) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 1df7808b0f..955fde4dba 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -765,7 +765,6 @@ check_install_oai_software() { libxml2 \ libxml2-dev \ libxslt1-dev \ - mscgen \ octave-signal \ openssh-client \ openssh-server \ @@ -793,7 +792,7 @@ check_install_oai_software() { fi $SUDO $INSTALLER install -y python-epdb vim-common else - $SUDO $INSTALLER install -y mscgen pydb + $SUDO $INSTALLER install -y pydb fi $SUDO $INSTALLER install -y \ diff --git a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt index 238554f8e2..b55266dfe7 100755 --- a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt +++ b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt @@ -85,18 +85,7 @@ Tools available: 1) itti_analyser (list messages exchanged between protocol layers) 2) xforms (Layer 1) -3) mscgen (under construction, but can give some results now) - (http://www.mcternan.me.uk/mscgen/) - We use the software to generate sequence diagrams - with traces generated during the execution of the eNB. - After the enb execution: - yang@yang:...$ cd /tmp - yang@yang:/tmp$ /home/yang/openair4G/trunk/targets/SCRIPTS/msc_gen.py - The results are located in the current directory (/tmp in this example) in a folder. The name of the folder - is the current date (for example: 2015-04-08_20.34.10). - The results are input files for the mscgen tool containing events or messages and the - corresponding generated png files. -4) vcd (timing mesurements) +3) vcd (timing mesurements) diff --git a/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt b/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt index 9996a53e19..805d121e6d 100755 --- a/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt +++ b/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt @@ -92,18 +92,7 @@ Tools available: 1) itti_analyser (list messages exchanged between protocol layers) 2) xforms (Layer 1) -3) mscgen (under construction, but can give some results now) - (http://www.mcternan.me.uk/mscgen/) - We use the software to generate sequence diagrams - with traces generated during the execution of the eNB. - After the enb execution: - yang@yang:...$ cd /tmp - yang@yang:/tmp$ /home/yang/openair4G/trunk/targets/SCRIPTS/msc_gen.py - The results are located in the current directory (/tmp in this example) in a folder. The name of the folder - is the current date (for example: 2015-04-08_20.34.10). - The results are input files for the mscgen tool containing events or messages and the - corresponding generated png files. -4) vcd (timing mesurements) +3) vcd (timing mesurements) diff --git a/cmake_targets/tools/run_enb_s1_usrp b/cmake_targets/tools/run_enb_s1_usrp index 1a4c6b10b8..db22e31493 100755 --- a/cmake_targets/tools/run_enb_s1_usrp +++ b/cmake_targets/tools/run_enb_s1_usrp @@ -32,8 +32,6 @@ ################################ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) source $THIS_SCRIPT_PATH/build_helper -declare -i g_run_msc_gen=0 -declare g_msc_dir="/tmp" function help() @@ -55,7 +53,6 @@ function help() echo_error " -M, --target-dl-mcs mcs Downlink target MCS." echo_error " -n, --T-no-wait don't wait for tracer, start immediately" echo_error " -p, --T-port port use given port" - echo_error " -m, --mscgen directory Generate mscgen output files in a directory" echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt." echo_error " -S, --enable-missed-slot Continue execution in case of missed slot." echo_error " -T, --target-ul-mcs mcs Uplink target MCS." @@ -68,30 +65,10 @@ function help() } -function do_msc_gen() -{ - cd $g_msc_dir - last_created_file=`ls -t mscgen* | head -1 | tr -d ':'` - $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py - sync - last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'` - - if [ x"$last_created_file" != x"$last_created_file2" ]; then - if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then - command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png - fi - fi - -} - - function control_c() # run if user hits control-c { echo_warning "\nExiting by ctrl+c\n" - if [ $g_run_msc_gen -eq 1 ]; then - do_msc_gen - fi exit $? } @@ -153,18 +130,6 @@ function main() exe_arguments="$exe_arguments --rf-config-file=$rf_config_file" fi ;; - -m | --mscgen) - g_msc_dir=$2 - # can omit file name if last arg on the line - if [ -d "$g_msc_dir" ]; then - echo "setting mscgen log files to dir: $g_msc_dir" - g_run_msc_gen=1 - shift 2; - else - echo_error "Mscgen log dir does not exist" - exit -1 - fi - ;; -M | --target-dl-mcs) echo "setting target dl MCS to $2" exe_arguments="$exe_arguments -m $2" @@ -251,9 +216,6 @@ function main() else gdb -n -x ~/.gdb_lte_softmodem fi - if [ $g_run_msc_gen -eq 1 ]; then - do_msc_gen - fi fi } diff --git a/cmake_targets/tools/run_enb_ue_virt_noS1 b/cmake_targets/tools/run_enb_ue_virt_noS1 index 79d5bc35dc..5f8e7e5374 100755 --- a/cmake_targets/tools/run_enb_ue_virt_noS1 +++ b/cmake_targets/tools/run_enb_ue_virt_noS1 @@ -57,7 +57,6 @@ function help() echo_error " -l, --log-level set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim." echo_error " -h, --help Print this help." echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)" - echo_error " -m, --mscgen directory Generate mscgen output files in a directory" echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format." echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark." echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE," @@ -75,11 +74,9 @@ function main() cecho "OPENAIR_DIR = $OPENAIR_DIR" $green local -i run_gdb=0 - local -i run_mscgen=0 local exe_arguments="" local DEFAULT_CONFIG_FILE_ENB=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf local CONFIG_FILE_ENB=$DEFAULT_CONFIG_FILE_ENB - local MSC_DIR="/tmp" local abstraction_flag=0 until [ -z "$1" ] @@ -136,17 +133,6 @@ function main() exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE" ;; - -m | --mscgen) - MSC_DIR=$2 - if [ -d "$MSC_DIR" ]; then - echo "setting mscgen log files to dir: $MSC_DIR" - run_mscgen=1 - shift 2; - else - echo_error "Mscgen log dir does not exist" - exit -1 - fi - ;; # -u | --num-ue ) -V | --vcd) @@ -212,10 +198,6 @@ function main() cd $OPENAIR_DIR/targets/bin - if [ $run_mscgen -eq 1 ]; then - $SUDO rm -f /tmp/openair.msc.* - fi - if [ $run_gdb -eq 0 ]; then exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt else @@ -227,20 +209,6 @@ function main() cat ~/.gdb_enb_ue_nos1 $SUDO gdb -n -x ~/.gdb_enb_ue_nos1 fi - - if [ $run_mscgen -eq 1 ]; then - cd $MSC_DIR - last_created_file=`ls -t mscgen* | head -1 | tr -d ':'` - $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN - sync - last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'` - - if [ x"$last_created_file" != x"$last_created_file2" ]; then - if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then - command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png - fi - fi - fi } main "$@" diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1 index 50fc819ec8..76bc3c2b39 100755 --- a/cmake_targets/tools/run_enb_ue_virt_s1 +++ b/cmake_targets/tools/run_enb_ue_virt_s1 @@ -81,7 +81,6 @@ function help() echo_error " -g, --gdb Run with GDB." echo_error " -h, --help Print this help." echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)" - echo_error " -m, --mscgen directory Generate mscgen output files in a directory" echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format." echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark." echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE," @@ -100,11 +99,9 @@ function main() cecho "OPENAIR_DIR = $OPENAIR_DIR" $green local -i run_gdb=0 - local -i run_mscgen=0 local exe_arguments="" local DEFAULT_CONFIG_FILE_ENB=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf local CONFIG_FILE_ENB=$DEFAULT_CONFIG_FILE_ENB - local MSC_DIR="/tmp" until [ -z "$1" ] do @@ -160,19 +157,6 @@ function main() exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE" ;; - -m | --mscgen) - MSC_DIR=$2 - # can omit file name if last arg on the line - if [ -d "$MSC_DIR" ]; then - echo "setting mscgen log files to dir: $MSC_DIR" - run_mscgen=1 - shift 2; - else - echo_error "Mscgen log dir does not exist" - exit -1 - fi - ;; - -V | --vcd) echo "setting gtk-wave output" exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd" @@ -258,10 +242,6 @@ function main() cd $OPENAIR_DIR/targets/bin - if [ $run_mscgen -eq 1 ]; then - rm -f /tmp/openair.msc.* - fi - if [ $run_gdb -eq 0 ]; then exec $OPENAIR_DIR/targets/bin/oaisim.Rel14 $exe_arguments | tee /tmp/enb_ue_s1.log.txt else @@ -273,21 +253,6 @@ function main() cat ~/.gdb_enb_ue_s1 gdb -n -x ~/.gdb_enb_ue_s1 fi - - if [ $run_mscgen -eq 1 ]; then - cd $MSC_DIR - last_created_file=`ls -t mscgen* | head -1 | tr -d ':'` - $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN - sync - last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'` - - if [ x"$last_created_file" != x"$last_created_file2" ]; then - if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then - command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png - fi - fi - fi - } sudo echo diff --git a/common/config/DOC/config/rtusage.md b/common/config/DOC/config/rtusage.md index 10cbee2495..8db58ddac3 100644 --- a/common/config/DOC/config/rtusage.md +++ b/common/config/DOC/config/rtusage.md @@ -65,7 +65,6 @@ To get help on supported parameters you can use specific options: -R: Enable online log -g: Set the global log level, valide options: (4:trace, 3:debug, 2:info, 1:warn, (0:error)) --telnetsrv: Start embedded telnet server - --msc: Enable the MSC tracing utility -------------------------------------------------------------------- [LIBCONFIG] loader: 2/2 parameters successfully set, (2 to default value) diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md index d7c748952d..6af7cdb08c 100644 --- a/common/utils/LOG/DOC/rtusage.md +++ b/common/utils/LOG/DOC/rtusage.md @@ -49,7 +49,6 @@ The list of components defined within oai can be retrieved from the [config mod [CONFIG] log_config.perf_log_level set to default value "info" [CONFIG] log_config.oip_log_level set to default value "info" [CONFIG] log_config.cli_log_level set to default value "info" -[CONFIG] log_config.msc_log_level set to default value "info" [CONFIG] log_config.ocm_log_level set to default value "info" [CONFIG] log_config.udp_log_level set to default value "info" [CONFIG] log_config.gtpv1u_log_level set to default value "info" @@ -108,8 +107,6 @@ The list of components defined within oai can be retrieved from the [config mod [CONFIG] log_config.oip_log_infile set to default value [CONFIG] cli_log_infile: 0 [CONFIG] log_config.cli_log_infile set to default value -[CONFIG] msc_log_infile: 0 -[CONFIG] log_config.msc_log_infile set to default value [CONFIG] ocm_log_infile: 0 [CONFIG] log_config.ocm_log_infile set to default value [CONFIG] udp_log_infile: 0 diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index 28134d6db1..8034119a99 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -447,7 +447,6 @@ int logInit (void) register_log_component("OCG","",OCG); register_log_component("PERF","",PERF); register_log_component("OIP","",OIP); - register_log_component("MSC","log",MSC); register_log_component("OCM","log",OCM); register_log_component("HW","",HW); register_log_component("OSA","",OSA); diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 350337b61b..7179079dd5 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -210,7 +210,6 @@ typedef enum { PERF, OIP, CLI, - MSC, OCM, UDP_, GTPU, diff --git a/common/utils/msc/msc.c b/common/utils/msc/msc.c deleted file mode 100644 index 84b723b022..0000000000 --- a/common/utils/msc/msc.c +++ /dev/null @@ -1,785 +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 msc.c - * \brief Message chart generator logging utility (generated files to processed by a script to produce a mscgen input file for generating a sequence diagram document) - * \author Lionel GAUTHIER - * \date 2015 - * \email: lionel.gauthier@eurecom.fr - */ -#include -#include -#include -#include -#include -#include - -#define MSC_LIBRARY -#include "msc.h" - -#include "liblfds611.h" -#include "intertask_interface.h" - - - -#include "assertions.h" - -//------------------------------- -#define MSC_MAX_QUEUE_ELEMENTS 1024 -#define MSC_MAX_PROTO_NAME_LENGTH 16 -#define MSC_MAX_MESSAGE_LENGTH 512 - -//------------------------------- - -FILE *g_msc_fd; -char g_msc_proto2str[MAX_MSC_PROTOS][MSC_MAX_PROTO_NAME_LENGTH]; - -msc_interface_t msc_interface; - -typedef unsigned long msc_message_number_t; -typedef struct msc_queue_item_s { - char *message_str; - uint32_t message_str_size; - uint8_t *message_bin; - uint32_t message_bin_size; -} msc_queue_item_t; - -msc_message_number_t g_message_number = 0; -struct lfds611_queue_state *g_msc_message_queue_p = NULL; -struct lfds611_stack_state *g_msc_memory_stack_p = NULL; - -//------------------------------------------------------------------------------ -void *msc_task(void *args_p) -//------------------------------------------------------------------------------ -{ - MessageDef *received_message_p = NULL; - // const char *msg_name = NULL; - // instance_t instance = 0; - long timer_id; - itti_mark_task_ready(TASK_MSC); - msc_start_use(); - timer_setup(0, // seconds - 50000, // usec - TASK_MSC, - INSTANCE_DEFAULT, - TIMER_PERIODIC, - NULL, - &timer_id); - - while(1) { - itti_receive_msg(TASK_MSC, &received_message_p); - - if (received_message_p != NULL) { - // msg_name = ITTI_MSG_NAME (received_message_p); - // instance = ITTI_MSG_DESTINATION_INSTANCE (received_message_p); - switch (ITTI_MSG_ID(received_message_p)) { - case TIMER_HAS_EXPIRED: { - msc_flush_messages(); - } - break; - - case TERMINATE_MESSAGE: { - fprintf(stderr, " *** Exiting MSC thread\n"); - timer_remove(timer_id); - msc_end(); - itti_exit_task(); - } - break; - - case MESSAGE_TEST: { - } - break; - - default: { - } - break; - } - } - } - - fprintf(stderr, "Task MSC exiting\n"); - return NULL; -} - -//------------------------------------------------------------------------------ -int msc_init(const msc_env_t envP, const int max_threadsP) -//------------------------------------------------------------------------------ -{ - int i; - int rv; - void *pointer_p; - char msc_filename[256]; - fprintf(stderr, "Initializing MSC logs\n"); - rv = snprintf(msc_filename, 256, "/tmp/openair.msc.%i.log", envP); // TODO NAME - - if ((0 >= rv) || (256 < rv)) { - fprintf(stderr, "Error in MSC log file name"); - } - - g_msc_fd = fopen(msc_filename,"w"); - AssertFatal(g_msc_fd != NULL, "Could not open MSC log file %s : %s", msc_filename, strerror(errno)); - rv = lfds611_stack_new(&g_msc_memory_stack_p, (lfds611_atom_t)max_threadsP + 2); - - if (0 >= rv) { - AssertFatal (0, "lfds611_stack_new failed!\n"); - } - - rv = lfds611_queue_new(&g_msc_message_queue_p, (lfds611_atom_t)MSC_MAX_QUEUE_ELEMENTS); - AssertFatal (rv, "lfds611_queue_new failed!\n"); - AssertFatal (g_msc_message_queue_p != NULL, "g_msc_message_queue_p is NULL!\n"); - msc_start_use(); - - for (i=0; i < max_threadsP * 30; i++) { - pointer_p = malloc(MSC_MAX_MESSAGE_LENGTH); - AssertFatal (pointer_p, "malloc failed!\n"); - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, pointer_p ); - AssertFatal (rv, "lfds611_stack_guaranteed_push failed for item %d\n", i); - } - - for (i = MIN_MSC_PROTOS; i < MAX_MSC_PROTOS; i++) { - switch (i) { - case MSC_IP_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_IP_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if (envP == MSC_E_UTRAN_LIPA) { - msc_log_declare_proto(i); - } - - break; - - case MSC_NAS_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_RRC_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_PDCP_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_RLC_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_MAC_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_PHY_UE: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_UE"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_PHY_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_MAC_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_RLC_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_PDCP_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_RRC_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_S1AP_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_GTPU_ENB: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_ENB"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_GTPU_SGW: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_SGW"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_S1AP_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_MME"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_MMEAPP_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MME_APP"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_NAS_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_MME"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - msc_log_declare_proto(i); - break; - - case MSC_NAS_EMM_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_EMM"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_NAS_ESM_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_ESM"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_SP_GWAPP_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "SP_GW_MME"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if (envP == MSC_MME_GW) { - msc_log_declare_proto(i); - } - - break; - - case MSC_S11_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S11_MME"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if (envP == MSC_MME) { - msc_log_declare_proto(i); - } - - break; - - case MSC_S6A_MME: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S6A"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - - case MSC_HSS: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "HSS"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - - if ((envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - } - - break; - case MSC_F1AP_CU: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "F1AP_CU"); - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;} - //if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - //} - break; - case MSC_F1AP_DU: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "F1AP_DU"); - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;} - //if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) { - msc_log_declare_proto(i); - //} - break; - default: - rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "UNKNOWN"); - - if (rv >= MSC_MAX_PROTO_NAME_LENGTH) { - g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0; - } - } - } - - rv = itti_create_task (TASK_MSC, msc_task, NULL); - AssertFatal (rv == 0, "Create task for MSC failed!\n"); - fprintf(stderr, "Initializing MSC logs Done\n"); - return 0; -} - -//------------------------------------------------------------------------------ -void msc_start_use(void) -//------------------------------------------------------------------------------ -{ - lfds611_queue_use(g_msc_message_queue_p); - lfds611_stack_use(g_msc_memory_stack_p); -} - - -//------------------------------------------------------------------------------ -void msc_flush_messages(void) -//------------------------------------------------------------------------------ -{ - int rv; - msc_queue_item_t *item_p = NULL; - - while ((rv = lfds611_queue_dequeue( g_msc_message_queue_p, (void **)&item_p )) == 1) { - if (NULL != item_p->message_str) { - fputs(item_p->message_str, g_msc_fd); - // TODO BIN DATA - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, item_p->message_str ); - } - - // TODO FREE BIN DATA - free(item_p); - } - - fflush(g_msc_fd); -} - - -//------------------------------------------------------------------------------ -void msc_end(void) -//------------------------------------------------------------------------------ -{ - int rv; - - if (NULL != g_msc_fd ) { - msc_flush_messages(); - rv = fflush(g_msc_fd); - - if (rv != 0) { - fprintf(stderr, "Error while flushing stream of MSC log file: %s", strerror(errno)); - } - - rv = fclose(g_msc_fd); - - if (rv != 0) { - fprintf(stderr, "Error while closing MSC log file: %s", strerror(errno)); - } - } -} - -//------------------------------------------------------------------------------ -void msc_log_declare_proto( - const msc_proto_t protoP -) -//------------------------------------------------------------------------------ -{ - int rv = 0; - msc_queue_item_t *new_item_p = NULL; - char *char_message_p = NULL; - - if ((MIN_MSC_PROTOS <= protoP) && (MAX_MSC_PROTOS > protoP)) { - // may be build a memory pool for that also ? - new_item_p = malloc(sizeof(msc_queue_item_t)); - - if (NULL != new_item_p) { - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - - if (0 == rv) { - msc_flush_messages(); - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - } - - if (1 == rv) { - rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [PROTO] %d %s\n", __sync_fetch_and_add (&g_message_number, 1), protoP, &g_msc_proto2str[protoP][0]); - - if (0 > rv) { - fprintf(stderr, "Error while declaring new protocol in MSC: %s", strerror(errno)); - } - - new_item_p->message_str = char_message_p; - new_item_p->message_str_size = rv; - new_item_p->message_bin = NULL; - new_item_p->message_bin_size = 0; - rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p ); - - if (0 == rv) { - rv = lfds611_queue_guaranteed_enqueue(g_msc_message_queue_p, new_item_p ); - - if (0 == rv) { - fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p); - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); - } - } - - return; - } else { - fprintf(stderr, "Error while lfds611_stack_pop()\n"); - } - - free(new_item_p); - } else { - fprintf(stderr, "Error while malloc in MSC"); - } - } -} -//------------------------------------------------------------------------------ -void msc_log_event( - const msc_proto_t protoP, - char *format, ...) -//------------------------------------------------------------------------------ -{ - va_list args; - int rv; - int rv2; - msc_queue_item_t *new_item_p = NULL; - char *char_message_p = NULL; - - if ((MIN_MSC_PROTOS > protoP) || (MAX_MSC_PROTOS <= protoP)) { - return; - } - - new_item_p = malloc(sizeof(msc_queue_item_t)); - - if (NULL != new_item_p) { - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - - if (0 == rv) { - msc_flush_messages(); - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - } - - if (1 == rv) { - rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [EVENT] %d ", __sync_fetch_and_add (&g_message_number, 1), protoP); - - if ((0 > rv) || (MSC_MAX_MESSAGE_LENGTH < rv)) { - fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]); - goto error_event; - } - - va_start(args, format); - rv2 = vsnprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, format, args); - va_end(args); - - if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) { - fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]); - goto error_event; - } - - rv += rv2; - rv2 = snprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, "\n"); - - if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) { - fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]); - goto error_event; - } - - rv += rv2; - new_item_p->message_str = char_message_p; - new_item_p->message_str_size = rv; - new_item_p->message_bin = NULL; - new_item_p->message_bin_size = 0; - rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p ); - - if (0 == rv) { - fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p); - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); - } - } else { - fprintf(stderr, "Error while lfds611_stack_pop()\n"); - } - } - - return; -error_event: - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); -} -//------------------------------------------------------------------------------ -void msc_log_message( - const char *const message_operationP, - const msc_proto_t proto1P, - const msc_proto_t proto2P, - const uint8_t *const bytesP, - const unsigned int num_bytes, - char *format, ...) -//------------------------------------------------------------------------------ -{ - va_list args; - uint64_t mac = 0; // TO DO mac on bytesP param - int rv; - int rv2; - msc_queue_item_t *new_item_p = NULL; - char *char_message_p = NULL; - - if ((MIN_MSC_PROTOS > proto1P) || (MAX_MSC_PROTOS <= proto1P) || - (MIN_MSC_PROTOS > proto2P) || (MAX_MSC_PROTOS <= proto2P) ) { - return; - } - - new_item_p = malloc(sizeof(msc_queue_item_t)); - - if (NULL != new_item_p) { - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - - if (0 == rv) { - msc_flush_messages(); - rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p); - } - - if (1 == rv) { - rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [MESSAGE] %d %s %d %"PRIu64" ", - __sync_fetch_and_add (&g_message_number, 1), proto1P, message_operationP, proto2P, mac); - - if ((0 > rv) || (MSC_MAX_MESSAGE_LENGTH < rv)) { - fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]); - goto error_event; - } - - va_start(args, format); - rv2 = vsnprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, format, args); - va_end(args); - - if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) { - fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]); - goto error_event; - } - - rv += rv2; - rv2 = snprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, "\n"); - - if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) { - fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]); - goto error_event; - } - - rv += rv2; - new_item_p->message_str = char_message_p; - new_item_p->message_str_size = rv; - new_item_p->message_bin = NULL; // TO DO - new_item_p->message_bin_size = 0; // TO DO - rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p ); - - if (0 == rv) { - fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p); - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); - } - } else { - fprintf(stderr, "Error while lfds611_stack_pop()\n"); - msc_flush_messages(); - } - } - - return; -error_event: - rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p ); - free(new_item_p); -} - -//------------------------------------------------------------------------------ -// function called when oai loader loads the msc shared lib -int msc_autoinit(msc_interface_t *msc_interface) -//------------------------------------------------------------------------------ -{ - msc_interface->msc_init = msc_init; - msc_interface->msc_start_use = msc_start_use; - msc_interface->msc_end = msc_end; - msc_interface->msc_log_event = msc_log_event; - msc_interface->msc_log_message = msc_log_message; - msc_interface->msc_loaded = 1; - return 0; -} diff --git a/common/utils/msc/msc.h b/common/utils/msc/msc.h deleted file mode 100644 index adb0d9e657..0000000000 --- a/common/utils/msc/msc.h +++ /dev/null @@ -1,131 +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 - */ - -#ifndef MSC_H_ -#define MSC_H_ -#include -#include - -typedef enum { - MIN_MSC_ENV = 0, - MSC_E_UTRAN = MIN_MSC_ENV, - MSC_E_UTRAN_LIPA, - MSC_MME_GW, - MSC_MME, - MSC_SP_GW, - MAX_MSC_ENV -} msc_env_t; - - -typedef enum { - MIN_MSC_PROTOS = 0, - MSC_IP_UE = MIN_MSC_PROTOS, - MSC_NAS_UE, - MSC_RRC_UE, - MSC_PDCP_UE, - MSC_RLC_UE, - MSC_MAC_UE, - MSC_PHY_UE, - MSC_PHY_ENB, - MSC_MAC_ENB, - MSC_RLC_ENB, - MSC_PDCP_ENB, - MSC_PDCP_GNB, - MSC_RRC_ENB, - MSC_RRC_GNB, - MSC_IP_ENB, - MSC_S1AP_ENB, - MSC_NGAP_GNB, - MSC_GTPU_ENB, - MSC_GTPU_GNB, - MSC_GTPU_SGW, - MSC_S1AP_MME, - MSC_NGAP_AMF, - MSC_MMEAPP_MME, - MSC_NAS_MME, - MSC_NAS_EMM_MME, - MSC_NAS_ESM_MME, - MSC_SP_GWAPP_MME, - MSC_S11_MME, - MSC_S6A_MME, - MSC_HSS, - MSC_F1AP_CU, - MSC_F1AP_DU, - MSC_X2AP_SRC_ENB, - MSC_X2AP_TARGET_ENB, - MAX_MSC_PROTOS, -} msc_proto_t; - - - -// Access stratum -#define MSC_AS_TIME_FMT "%05u:%02u" - -#define MSC_AS_TIME_ARGS(CTXT_Pp) \ - (CTXT_Pp)->frame, \ - (CTXT_Pp)->subframe - -typedef int(*msc_init_t)(const msc_env_t, const int ); -typedef void(*msc_start_use_t)(void ); -typedef void(*msc_end_t)(void); -typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...); -typedef void(*msc_log_message_t)(const char *const, const msc_proto_t, const msc_proto_t, - const uint8_t *const, const unsigned int, char *, ...); -typedef struct msc_interface { - int msc_loaded; - msc_init_t msc_init; - msc_start_use_t msc_start_use; - msc_end_t msc_end; - msc_log_event_t msc_log_event; - msc_log_message_t msc_log_message; -} msc_interface_t; - -#ifdef MSC_LIBRARY -int msc_init(const msc_env_t envP, const int max_threadsP); -void msc_start_use(void); -void msc_flush_messages(void); -void msc_end(void); -void msc_log_declare_proto(const msc_proto_t protoP); -void msc_log_event(const msc_proto_t protoP,char *format, ...); -void msc_log_message( - const char *const message_operationP, - const msc_proto_t receiverP, - const msc_proto_t senderP, - const uint8_t *const bytesP, - const unsigned int num_bytes, - char *format, ...); - -#else - -#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded - -extern msc_interface_t msc_interface; -#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2) -#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use -#define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end -#define MSC_LOG_EVENT(mScPaRaMs, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_event(mScPaRaMs, fORMAT, ##aRGS) -#define MSC_LOG_RX_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("<-",rECEIVER, sENDER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) -#define MSC_LOG_RX_DISCARDED_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("x-",rECEIVER, sENDER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) -#define MSC_LOG_TX_MESSAGE(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("->",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) -#define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("-x",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS) -#endif - -#endif diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h index 3188e5889f..97042842e4 100644 --- a/common/utils/ocp_itti/intertask_interface.h +++ b/common/utils/ocp_itti/intertask_interface.h @@ -338,7 +338,6 @@ void *rrc_enb_process_msg(void *); TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \ TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \ - TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\ TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ TASK_DEF(OCP_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\ TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\ @@ -560,7 +559,6 @@ MessageDef *itti_alloc_new_message_sized( This function should be called from the main thread after having created all ITTI tasks. **/ void itti_wait_tasks_end(void); -#define ADDED_QUEUES_MAX 10 // Fix me: MSC component too hard to understand, we keep room for 10 queues created dynamically void itti_set_task_real_time(task_id_t task_id); /** \brief Send a termination message to all tasks. diff --git a/common/utils/telnetsrv/DOC/telnetlog.md b/common/utils/telnetsrv/DOC/telnetlog.md index 36c5cfb348..cb008fc8bb 100644 --- a/common/utils/telnetsrv/DOC/telnetlog.md +++ b/common/utils/telnetsrv/DOC/telnetlog.md @@ -62,7 +62,6 @@ component verbosity level enabled 16 PERF: medium info N 17 OIP: medium info N 18 CLI: medium info N -19 MSC: medium info N 20 OCM: medium info N 21 UDP: medium info N 22 GTPV1U: medium info N diff --git a/doc/testing_gnb_w_cots_ue_resources/oai_enb.log b/doc/testing_gnb_w_cots_ue_resources/oai_enb.log index 9b9de24a86..7356c0c88d 100755 --- a/doc/testing_gnb_w_cots_ue_resources/oai_enb.log +++ b/doc/testing_gnb_w_cots_ue_resources/oai_enb.log @@ -62,7 +62,6 @@ ITTI init, useMME: 1 [TMR] Starting itti queue: TASK_RRC_UE as task 31 [TMR] Starting itti queue: TASK_NAS_UE as task 32 [TMR] Starting itti queue: TASK_RAL_UE as task 33 -[TMR] Starting itti queue: TASK_MSC as task 34 [TMR] Starting itti queue: TASK_GTPV1_U as task 35 [TMR] Starting itti queue: TASK_UDP as task 36 [TMR] Starting itti queue: TASK_CU_F1 as task 37 diff --git a/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log b/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log index 37b3c10516..3c76c0d0d6 100755 --- a/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log +++ b/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log @@ -58,7 +58,6 @@ CPU Freq is 3.092986 [TMR] Starting itti queue: TASK_RRC_UE as task 31 [TMR] Starting itti queue: TASK_NAS_UE as task 32 [TMR] Starting itti queue: TASK_RAL_UE as task 33 -[TMR] Starting itti queue: TASK_MSC as task 34 [TMR] Starting itti queue: TASK_GTPV1_U as task 35 [TMR] Starting itti queue: TASK_UDP as task 36 [TMR] Starting itti queue: TASK_CU_F1 as task 37 diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index 45d7852adc..47fd816db5 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -104,7 +104,6 @@ #define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" #define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" -#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n" #define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n" #define CONFIG_HLP_NOS1 "Disable s1 interface\n" #define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n" @@ -112,13 +111,11 @@ /* command line parameters for LOG utility */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*--------------------------------------------------------------------------------------------------------------------------------*/ -#define START_MSC softmodem_params.start_msc #define CMDLINE_LOGPARAMS_DESC_NR { \ {"R" , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ {"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ {"G" , CONFIG_HLP_LOGV, 0, uptr:&glog_verbosity, defintval:0, TYPE_UINT16, 0}, \ {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ - {"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \ } #define CMDLINE_ONLINELOG_IDX 0 diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 5f57919645..82567e534e 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -29,8 +29,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include -#include "msc.h" - #include "PHY/types.h" #include "common/ran_context.h" @@ -684,7 +682,6 @@ int main( int argc, char **argv ) { cpuf=get_cpu_freq_GHz(); itti_init(TASK_MAX, tasks_info); // initialize mscgen log after ITTI - MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); init_opt(); if(PDCP_USE_NETLINK && !IS_SOFTMODEM_NOS1) { netlink_init(); diff --git a/executables/ocp-gnb.c b/executables/ocp-gnb.c index 462a07c707..23fd3ae132 100644 --- a/executables/ocp-gnb.c +++ b/executables/ocp-gnb.c @@ -93,7 +93,6 @@ time_stats_t softmodem_stats_rx_sf; // total rx time // not used but needed for link openair0_config_t openair0_cfg[MAX_CARDS]; uint16_t slot_ahead=6; -msc_interface_t msc_interface; AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]; AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; int flexran_agent_start(mid_t mod_id) { diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c index 3e20081b18..12c60e98fd 100644 --- a/executables/softmodem-common.c +++ b/executables/softmodem-common.c @@ -45,7 +45,6 @@ static softmodem_params_t softmodem_params; char *parallel_config=NULL; char *worker_config=NULL; -msc_interface_t msc_interface; int usrp_tx_thread = 0; uint8_t nfapi_mode=0; diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 9aca677473..47d5556c17 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -173,19 +173,16 @@ extern int usrp_tx_thread; #define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" #define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" -#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n" #define CONFIG_FLOG_OPT "R" #define CONFIG_LOGL_OPT "g" /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ /* command line parameters for LOG utility */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ -#define START_MSC softmodem_params.start_msc #define CMDLINE_LOGPARAMS_DESC { \ {CONFIG_FLOG_OPT , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \ {CONFIG_LOGL_OPT , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \ {"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \ - {"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \ {"log-mem", NULL, 0, strptr:(char **)&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \ {"telnetclt", NULL, 0, uptr:&start_telnetclt, defstrval:NULL, TYPE_UINT, 0}, \ } @@ -250,7 +247,6 @@ typedef struct { int chain_offset; int numerology; int band; - unsigned int start_msc; uint32_t clock_source; uint32_t timing_source; int hw_timing_advance; diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 308a059d51..c92d926a8f 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -415,10 +415,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset ); - LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02"PRIu8"][]\n", eNB->Mod_id); LOG_I (PHY, "[eNB %" PRIu8 "] Initializing DL_FRAME_PARMS : N_RB_DL %" PRIu8 ", PHICH Resource %d, PHICH Duration %d\n", eNB->Mod_id, fp->N_RB_DL, fp->phich_config_common.phich_resource, fp->phich_config_common.phich_duration); - LOG_D (PHY, "[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02" PRIu8 "][]\n", eNB->Mod_id); crcTableInit(); lte_gold (fp, eNB->lte_gold_table, fp->Nid_cell); generate_pcfich_reg_mapping (fp); diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 9e1e472fd6..31ec287c3f 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -104,7 +104,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, load_dftslib(); - LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id); crcTableInit(); init_scrambling_luts(); init_pucch2_luts(); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index c193733aef..ab63d939d8 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -145,7 +145,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int n_scid; abstraction_flag = 0; LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx); - //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST); phy_init_nr_top(ue); // many memory allocation sizes are hard coded AssertFatal( fp->nb_antennas_rx <= 4, "hard coded allocation for ue_common_vars->dl_ch_estimates[gNB_id]" ); diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 2d2697a4b7..fc3d939f65 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -55,7 +55,6 @@ #include #include #include "common_lib.h" -#include "msc.h" #include "defs_common.h" #include "impl_defs_top.h" diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index a371b2334b..c79530434a 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -54,7 +54,6 @@ #include #include #include "common_lib.h" -#include "msc.h" #include #include "assertions.h" diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 030d50bc04..995a4a934e 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -55,7 +55,6 @@ #include #include "common_lib.h" -#include "msc.h" #include "defs_common.h" #include "defs_RU.h" #include "impl_defs_top.h" diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 69978f5548..650025a1be 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -44,7 +44,6 @@ #include #include #include "common_lib.h" -#include "msc.h" #include "fapi_nr_ue_interface.h" #include "assertions.h" diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 569d2a464a..ee1e0be49a 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -43,7 +43,6 @@ #include #include "assertions.h" -#include "msc.h" #include diff --git a/openair1/SCHED/prach_procedures.c b/openair1/SCHED/prach_procedures.c index 4d0fe428e8..805354ce1b 100644 --- a/openair1/SCHED/prach_procedures.c +++ b/openair1/SCHED/prach_procedures.c @@ -40,7 +40,6 @@ #include "assertions.h" -#include "msc.h" #include diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index 15eba7b5bc..dc84279a96 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -69,7 +69,6 @@ #include "assertions.h" #include "common/utils/system.h" -#include "msc.h" #include diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 1ea8dbdf3c..b0f59d5f47 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -41,7 +41,6 @@ #include "assertions.h" -#include "msc.h" #include diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 3f4c2f71fb..5efdc52601 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -44,7 +44,6 @@ #include "T.h" #include "assertions.h" -#include "msc.h" #include // RU OFDM Modulator gNodeB diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c86f5bd682..82748cfe79 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -44,7 +44,6 @@ #include "executables/softmodem-common.h" #include "assertions.h" -#include "msc.h" #include diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index fb0f37d7ac..1b7e0a36a1 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -72,13 +72,11 @@ openair0_config_t openair0_cfg[MAX_CARDS]; uint64_t downlink_frequency[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; uint16_t sl_ahead = 0; -msc_interface_t msc_interface; uint32_t N_RB_DL = 106; //void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); /* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */ -msc_interface_t msc_interface; uint64_t get_softmodem_optmask(void) {return 0;} softmodem_params_t *get_softmodem_params(void) {return 0;} int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); } diff --git a/openair2/F1AP/f1ap_common.h b/openair2/F1AP/f1ap_common.h index a393930c81..66451530a6 100644 --- a/openair2/F1AP/f1ap_common.h +++ b/openair2/F1AP/f1ap_common.h @@ -357,7 +357,6 @@ #include #include "T.h" #include "common/ran_context.h" -#include "msc.h" /* Checking version of ASN1C compiler */ #if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION) diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c index ce54e90191..6d4757be6f 100644 --- a/openair2/F1AP/f1ap_du_interface_management.c +++ b/openair2/F1AP/f1ap_du_interface_management.c @@ -481,14 +481,6 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance, for (int i=0; i 0, "System Information %d is missing",i); - MSC_LOG_RX_MESSAGE( - MSC_F1AP_DU, - MSC_F1AP_CU, - 0, - 0, - MSC_AS_TIME_FMT" DU_handle_F1_SETUP_RESPONSE successfulOutcome assoc_id %d", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - assoc_id); LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message\n"); itti_send_msg_to_task(TASK_F1APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); return 0; @@ -910,14 +902,6 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, AssertFatal(TransactionId!=-1,"TransactionId was not sent\n"); LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate); F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_cells_to_activate = num_cells_to_activate; - MSC_LOG_RX_MESSAGE( - MSC_F1AP_DU, - MSC_F1AP_CU, - 0, - 0, - MSC_AS_TIME_FMT" DU_handle_GNB_CU_CONFIGURATION_UPDATE initiatingMessage assoc_id %d", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - assoc_id); LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message \n"); itti_send_msg_to_task(TASK_F1APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); return 0; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index e62978782c..e5b95a7f47 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -34,7 +34,6 @@ #include "assertions.h" #include "platform_types.h" -#include "msc.h" #include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac_extern.h" @@ -1421,8 +1420,6 @@ cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rnti) { unsigned char i; RA_t *ra = (RA_t *) & RC.mac[module_idP]->common_channels[CC_id].ra[0]; - MSC_LOG_EVENT(MSC_PHY_ENB, "RA Cancelling procedure ue %" PRIx16 " ", - rnti); LOG_D(MAC, "[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n", module_idP, CC_id, frameP, rnti); diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index a4e924c68b..3eaeedee3f 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -215,7 +215,6 @@ void mac_init_cell_params(int Mod_idP, int CC_idP) int j; UE_TEMPLATE *UE_template; - LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", Mod_idP); //COMMON_channels_t *cc = &RC.mac[Mod_idP]->common_channels[CC_idP]; memset(&RC.mac[Mod_idP]->eNB_stats, 0, sizeof(eNB_STATS)); diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c index 1aa959e103..af68cebbe1 100644 --- a/openair2/LAYER2/MAC/ra_procedures.c +++ b/openair2/LAYER2/MAC/ra_procedures.c @@ -348,7 +348,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id, Size16 = (uint16_t) Size; // LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",module_idP,frameP,Size); LOG_I(RRC, - "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n", + "[FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n", frameP, module_idP, eNB_indexP, module_idP); LOG_I(MAC, "[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n", diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 4d2e157728..9fb290e6a1 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -48,7 +48,6 @@ #include "platform_constants.h" #include "nfapi/oai_integration/vendor_ext.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "msc.h" #include "common/ngran_types.h" #include "targets/COMMON/openairinterface5g_limits.h" #include "targets/RT/USER/lte-softmodem.h" @@ -1058,14 +1057,6 @@ pdcp_data_ind( ctxt_pP->rnti, rb_id + 4, sdu_buffer_sizeP - payload_offset ); - MSC_LOG_TX_MESSAGE( - MSC_PDCP_ENB, - MSC_GTPU_ENB, - NULL,0, - "0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u", - ctxt_pP->rnti, - rb_id + 4, - sdu_buffer_sizeP - payload_offset); //LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset); gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U, sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX); @@ -2228,20 +2219,6 @@ pdcp_config_set_security( pdcp_pP->kUPenc = kUPenc; /* Activate security */ pdcp_pP->security_activated = 1; - MSC_LOG_EVENT( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - "0 Set security ciph %X integ %x UE %"PRIx16" ", - pdcp_pP->cipheringAlgorithm, - pdcp_pP->integrityProtAlgorithm, - ctxt_pP->rnti); - } else { - MSC_LOG_EVENT( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - "0 Set security failed UE %"PRIx16" ", - ctxt_pP->rnti); - LOG_E(PDCP,PROTOCOL_PDCP_CTXT_FMT" bad security mode %d", - PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP), - security_modeP); } } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index b49b020428..1e126f878a 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -58,7 +58,6 @@ extern int otg_enabled; #include "nfapi/oai_integration/vendor_ext.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "platform_constants.h" -#include "msc.h" #include "pdcp.h" #include "assertions.h" @@ -343,12 +342,6 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %ld][RB %ld][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %04x][RB %ld]\n", ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id, ctxt.rnti, rab_id); - MSC_LOG_RX_MESSAGE((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt.instance, rab_id, rab_id, len); pdcp_data_req( &ctxt, SRB_FLAG_NO, @@ -368,14 +361,6 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p // , NULL, NULL // ); } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt.instance, rab_id, rab_id, len); LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %ld][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %04x][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n", ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id, @@ -566,17 +551,6 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx (NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id ); } else { /* else of h_rc == HASH_TABLE_OK */ - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - pdcp_read_header_g.inst, - pdcp_read_header_g.rb_id, - rab_id, - pdcp_read_header_g.data_size); LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n", ctxt.frame, @@ -739,17 +713,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP) ctxt.module_id, ctxt.rnti, rab_id); - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - pc5s_header->inst, - pc5s_header->rb_id, - rab_id, - pc5s_header->data_size); /* pointers to pc5s_header fields possibly not aligned because pc5s_header points to a packed structure * Using these possibly unaligned pointers in a function call may trigger alignment errors at run time and * gcc, from v9, now warns about it. fix these warnings by using local variables @@ -771,17 +734,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP) pc5s_header->sourceL2Id = sourceL2Id; pc5s_header->destinationL2Id=destinationL2Id; } else { /* else of h_rc == HASH_TABLE_OK */ - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - pc5s_header->inst, - pc5s_header->rb_id, - rab_id, - pc5s_header->data_size); LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n", ctxt.frame, @@ -803,16 +755,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP) ctxt.module_id, ctxt.rnti, DEFAULT_RAB_ID); - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u default rab %u size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - pc5s_header->inst, - pc5s_header->rb_id, - DEFAULT_RAB_ID, - pc5s_header->data_size); /* pointers to pc5s_header fields possibly not aligned because pc5s_header points to a packed structure * Using these possibly unaligned pointers in a function call may trigger alignment errors at run time and * gcc, from v9, now warns about it. fix these warnings by using local variables diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c index 891c38209b..0bd1b8fa8d 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c @@ -60,7 +60,6 @@ #include "pdcp.h" #include "pdcp_primitives.h" -#include "msc.h" #define PDCP_QUEUE_NB_ELEMENTS 200 @@ -187,7 +186,6 @@ void *pdcp_netlink_thread_fct(void *arg) pdcp_thread_read_state = 0; memset(nl_rx_buf, 0, NL_MAX_PAYLOAD); LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd); - MSC_START_USE(); while (1) { len = recvmsg(nas_sock_fd, &nas_msg_rx, 0); diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c index cb108f5d26..6664dd2a33 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c @@ -37,7 +37,6 @@ #include "LAYER2/MAC/mac_extern.h" #include "pdcp.h" -#include "msc.h" #include "pdcp_primitives.h" //----------------------------------------------------------------------------- @@ -223,11 +222,6 @@ pdcp_validate_security( if (stream_check_integrity(pdcp_pP->integrityProtAlgorithm, &decrypt_params, &pdcp_pdu_buffer[sdu_buffer_size]) != 0) { - MSC_LOG_EVENT( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - " Security: failed MAC-I Algo %X UE %"PRIx16" ", - pdcp_pP->integrityProtAlgorithm, - ctxt_pP->rnti); LOG_E(PDCP, "[OSA][RB %ld] %s failed to validate MAC-I (key %llx) of incoming PDU\n", rb_id, (pdcp_pP->is_ue != 0) ? "UE" : "eNB",((long long unsigned int*)decrypt_params.key)[0]); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index de947225bb..4eb0907046 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -27,7 +27,6 @@ //----------------------------------------------------------------------------- #include "assertions.h" -#include "msc.h" #include "hashtable.h" #include "rlc_am.h" #include "rlc_am_segment.h" @@ -238,17 +237,6 @@ void config_req_rlc_am_asn1 ( (config_am_pP->ul_AM_RLC.t_PollRetransmitdl_AM_RLC.t_Reordering<32) && (config_am_pP->dl_AM_RLC.t_StatusProhibitenb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_PollRetx %u t_Reord %u t_StatusPro %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit], - am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], - t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d)\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p), maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold], @@ -267,14 +255,6 @@ void config_req_rlc_am_asn1 ( am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p)); LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold=%ld poll_pdu=%ld poll_byte=%ld t_poll_retransmit=%ld t_reord=%ld t_status_prohibit=%ld), RLC-AM NOT CONFIGURED\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p), @@ -537,27 +517,6 @@ rlc_am_mac_status_indication ( } } - if (MESSAGE_CHART_GENERATOR) { - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE, - NULL,0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-IND %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc)); - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE, - NULL,0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-RESP BO:%u/n%u(%u) %s sdu remain %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc), - status_resp.buffer_occupancy_in_bytes, - status_resp.buffer_occupancy_in_pdus,rlc->nb_sdu, - (status_resp.head_sdu_is_segmented)?"sdu seg":"sdu not seg", - status_resp.head_sdu_remaining_size_to_send); - } - if (LOG_DEBUGFLAG(DEBUG_RLC)) { LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" MAC_STATUS_INDICATION (DATA) -> %d bytes\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc), @@ -610,7 +569,7 @@ rlc_am_mac_data_request ( data_req.rlc_info.rlc_protocol_state = l_rlc_p->protocol_state; - if ( (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC))&& data_req.data.nb_elements > 0) { + if ( (LOG_DEBUGFLAG(DEBUG_RLC))&& data_req.data.nb_elements > 0) { tb_p = data_req.data.head; while (tb_p != NULL) { @@ -619,39 +578,6 @@ rlc_am_mac_data_request ( if ((((struct mac_tb_req *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) { if (rlc_am_get_data_pdu_infos(ctxt_pP,l_rlc_p,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) { - if (MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA SN %u size %u RF %u P %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.rf, - pdu_info.p, - pdu_info.fi); - - if (pdu_info.rf) { - message_string_size += sprintf(&message_string[message_string_size], " LSF %u\n", pdu_info.lsf); - message_string_size += sprintf(&message_string[message_string_size], " SO %u\n", pdu_info.so); - } - - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "| HE:"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } - } - - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)rlc_am_pdu_sn_10_p, - tb_size_in_bytes, - message_string); - } - if ( LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size = 0; message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -723,34 +649,6 @@ rlc_am_mac_data_request ( if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) { tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size; //tb_size_in_bytes modified by rlc_am_get_control_pdu_infos! - if (MESSAGE_CHART_GENERATOR ) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS ACK_SN %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - l_rlc_p->control_pdu_info.ack_sn); - - for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) { - if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) { - message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u", - l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn, - l_rlc_p->control_pdu_info.nack_list[num_nack].so_start, - l_rlc_p->control_pdu_info.nack_list[num_nack].so_end); - } else { - message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u", - l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn); - } - } - - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)rlc_am_pdu_sn_10_p, - tb_size_in_bytes, - message_string); - } - if ( LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size = 0; message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -780,7 +678,7 @@ rlc_am_mac_data_request ( tb_p = tb_p->next; } /* while */ - } /* MESSAGE_CHART_GENERATOR && data_req.data.nb_elements > 0 */ + } /* data_req.data.nb_elements > 0 */ data_req.buffer_occupancy_in_pdus = 0; return data_req; @@ -812,7 +710,7 @@ rlc_am_mac_data_indication ( (void)index; (void)l_rlc_p; /* avoid gcc warning "unused variable" */ - if ( LOG_DEBUGFLAG(DEBUG_RLC) || MESSAGE_CHART_GENERATOR ) { + if ( LOG_DEBUGFLAG(DEBUG_RLC)) { if (data_indP.data.nb_elements > 0) { tb_p = data_indP.data.head; @@ -822,39 +720,6 @@ rlc_am_mac_data_indication ( if ((((struct mac_tb_ind *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) { if (rlc_am_get_data_pdu_infos(ctxt_pP,l_rlc_p,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) { - if (MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA SN %u size %u RF %u P %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.rf, - pdu_info.p, - pdu_info.fi); - - if (pdu_info.rf) { - message_string_size += sprintf(&message_string[message_string_size], " LSF %u\n", pdu_info.lsf); - message_string_size += sprintf(&message_string[message_string_size], " SO %u\n", pdu_info.so); - } - - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "| HE:"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } - } - - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)rlc_am_pdu_sn_10_p, - tb_size_in_bytes, - message_string); - } - if ( LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes); @@ -923,34 +788,6 @@ rlc_am_mac_data_indication ( } } else { if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) { - if (MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS size ACK_SN %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - l_rlc_p->control_pdu_info.ack_sn); - - for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) { - if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) { - message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u", - l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn, - l_rlc_p->control_pdu_info.nack_list[num_nack].so_start, - l_rlc_p->control_pdu_info.nack_list[num_nack].so_end); - } else { - message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u", - l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn); - } - } - - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)rlc_am_pdu_sn_10_p, - tb_size_in_bytes, - message_string); - } - if ( LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size = 0; message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -1009,16 +846,6 @@ rlc_am_data_req ( mui = ((struct rlc_am_data_req *) (sdu_pP->data))->mui; data_offset = ((struct rlc_am_data_req *) (sdu_pP->data))->data_offset; data_size = ((struct rlc_am_data_req *) (sdu_pP->data))->data_size; - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (const char *)(&sdu_pP->data[data_offset]), - data_size, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-REQ size %u mui %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - data_size, - mui); if (LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -1094,22 +921,6 @@ rlc_am_data_req ( l_rlc_p->vt_s); } } else { - if( MESSAGE_CHART_GENERATOR) { - mui = ((struct rlc_am_data_req *) (sdu_pP->data))->mui; - data_offset = ((struct rlc_am_data_req *) (sdu_pP->data))->data_offset; - data_size = ((struct rlc_am_data_req *) (sdu_pP->data))->data_size; - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (const char *)(&sdu_pP->data[data_offset]), - data_size, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-REQ size %u mui %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p), - data_size, - mui); - } - LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RLC_AM_DATA_REQ BUFFER FULL, NB SDU %d current_sdu_index=%d next_sdu_index=%d size_input_sdus_buffer=%d vtA=%d vtS=%d\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p), l_rlc_p->nb_sdu, diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h index 3127f67eca..b4073303dd 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h @@ -78,16 +78,7 @@ int pmtl_rc = pthread_mutex_trylock(mUTEX);\ if (pmtl_rc != 0){\ if (pmtl_rc == EBUSY) {\ - MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 " PROTOCOL_RLC_AM_MSC_FMT " Warning try lock %s busy",\ - PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\ - #mUTEX);\ pthread_mutex_lock(mUTEX);\ - } else {\ - MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 " PROTOCOL_RLC_AM_MSC_FMT " Error try lock %s %d",\ - PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\ - #mUTEX, pmtl_rc);\ }\ }\ } while (0); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c index 793d0057ac..0957c20bdf 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c @@ -30,7 +30,6 @@ #include "list.h" //#include "LAYER2/MAC/extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- inline void @@ -152,16 +151,6 @@ rlc_am_send_sdu ( #if !ENABLE_ITTI RLC_AM_MUTEX_UNLOCK(&rlc_pP->lock_input_sdus); #endif - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (const char *)(rlc_pP->output_sdu_in_construction->data), - rlc_pP->output_sdu_size_to_write, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-IND size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), - rlc_pP->output_sdu_size_to_write - ); rlc_data_ind (ctxt_pP, BOOL_NOT(rlc_pP->is_data_plane), MBMS_FLAG_NO, diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c index f9a4affb6b..916d1513b0 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c @@ -24,7 +24,6 @@ #include "platform_types.h" //----------------------------------------------------------------------------- #include "assertions.h" -#include "msc.h" #include "rlc.h" #include "rlc_am.h" #include "list.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c index 4d34338ea9..56b37e1e39 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c @@ -28,7 +28,6 @@ #include "rlc.h" #include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- boolean_t rlc_am_nack_pdu ( const protocol_ctxt_t* const ctxt_pP, diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c index dbe55c483d..ed81e119ac 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c @@ -26,7 +26,6 @@ //----------------------------------------------------------------------------- #include "platform_types.h" //----------------------------------------------------------------------------- -#include "msc.h" #include "list.h" #include "rlc_am.h" #include "LAYER2/MAC/mac_extern.h" diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c index e421a36619..969ed2d7a5 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c @@ -29,7 +29,6 @@ #include "rlc_am.h" #include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- void rlc_am_check_timer_poll_retransmit( @@ -69,11 +68,6 @@ rlc_am_check_timer_poll_retransmit( rlc_pP->t_poll_retransmit.running = 0; rlc_pP->t_poll_retransmit.timed_out = 1; rlc_pP->stat_timer_poll_retransmit_timed_out += 1; -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit timed-out",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] TIME-OUT\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); @@ -144,11 +138,6 @@ rlc_am_stop_and_reset_timer_poll_retransmit( rlc_pP->t_poll_retransmit.ms_time_out = 0; rlc_pP->t_poll_retransmit.ms_start = 0; rlc_pP->t_poll_retransmit.timed_out = 0; -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit stopped & reseted",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif } //----------------------------------------------------------------------------- void @@ -167,11 +156,6 @@ rlc_am_start_timer_poll_retransmit( LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] STARTED (TIME-OUT = FRAME %05d)\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out); -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit started (TO %u ms)",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out); -#endif } else { LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c index 262b8a8391..d161d29a65 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c @@ -28,7 +28,6 @@ #include "rlc_am.h" # include "LAYER2/MAC/mac_extern.h" #include "common/utils//LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- void rlc_am_check_timer_reordering( @@ -64,12 +63,6 @@ rlc_am_check_timer_reordering( // - start t-Reordering; // - set VR(X) to VR(H). -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering timed out",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif - //AssertFatal (rlc_pP->vr_x != RLC_SN_UNDEFINED, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id); if(rlc_pP->vr_x == RLC_SN_UNDEFINED){ LOG_E(RLC, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id); @@ -153,11 +146,6 @@ rlc_am_stop_and_reset_timer_reordering( rlc_pP->t_reordering.ms_time_out = 0; rlc_pP->t_reordering.ms_start = 0; rlc_pP->t_reordering.timed_out = 0; -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering stopped & reseted",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif } //----------------------------------------------------------------------------- void @@ -175,11 +163,6 @@ rlc_am_start_timer_reordering( LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] STARTED (TIME-OUT = %5u ms)\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_reordering.ms_time_out); -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering started (TO %u ms)",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_reordering.ms_time_out); -#endif } else { LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] NOT STARTED, CAUSE CONFIGURED 0 ms\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c index 5b0b0a70fa..aae7465bcf 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c @@ -28,7 +28,6 @@ #include "rlc_am.h" #include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- void rlc_am_check_timer_status_prohibit( @@ -60,12 +59,6 @@ rlc_am_check_timer_status_prohibit( rlc_pP->t_status_prohibit.running = 0; rlc_pP->t_status_prohibit.timed_out = 1; rlc_pP->stat_timer_status_prohibit_timed_out += 1; - -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit timed out",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] TIME-OUT\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); //#warning TO DO rlc_am_check_timer_status_prohibit @@ -91,11 +84,6 @@ rlc_am_stop_and_reset_timer_status_prohibit( rlc_pP->t_status_prohibit.ms_time_out = 0; rlc_pP->t_status_prohibit.ms_start = 0; rlc_pP->t_status_prohibit.timed_out = 0; -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit stopped & reseted",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP)); -#endif } } //----------------------------------------------------------------------------- @@ -117,11 +105,6 @@ rlc_am_start_timer_status_prohibit( PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_status_prohibit.ms_time_out); LOG_D(RLC, "TIME-OUT = FRAME %u\n", rlc_pP->t_status_prohibit.ms_time_out); -#if MESSAGE_CHART_GENERATOR_RLC_MAC - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit started (TO %u ms)",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_status_prohibit.ms_time_out); -#endif } else { LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP)); diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c index 654ddb8da7..1d40b12cc8 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c @@ -30,7 +30,6 @@ #include "intertask_interface.h" #endif #include "assertions.h" -#include "msc.h" #include "rlc_um.h" #include "list.h" #include "rlc_primitives.h" @@ -166,7 +165,6 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind char message_string[10000]; mem_block_t *tb_p; int16_t tb_size_in_bytes; - size_t message_string_size = 0; rlc_um_pdu_info_t pdu_info; int index; int octet_index; @@ -183,38 +181,15 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind LOG_I(RLC, PROTOCOL_RLC_UM_CTXT_FMT" ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p)); - if (data_indP.data.nb_elements > 0 && MESSAGE_CHART_GENERATOR) { + if (data_indP.data.nb_elements > 0) { tb_p = data_indP.data.head; while (tb_p != NULL) { tb_size_in_bytes = ((struct mac_tb_ind *) (tb_p->data))->size; rlc_um_get_pdu_infos(ctxt_pP,l_rlc_p,(rlc_um_pdu_sn_10_t *) ((struct mac_tb_ind *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length); - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT"DATA SN %u size %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.fi); - - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "| HE:"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } - } - - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (const char *)pdu_info.payload, - tb_size_in_bytes, - message_string); tb_p = tb_p->next; } - }/*MESSAGE_CHART_GENERATOR*/ + } list_free (&data_indP.data); break; @@ -237,7 +212,7 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind // - enters the LOCAL_SUSPEND state. data_indP.tb_size = data_indP.tb_size >> 3; - if (data_indP.data.nb_elements > 0 && (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC))) { + if (data_indP.data.nb_elements > 0 && (LOG_DEBUGFLAG(DEBUG_RLC))) { LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" MAC_DATA_IND %d TBs\n", PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p), data_indP.data.nb_elements); @@ -251,32 +226,6 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind &pdu_info, l_rlc_p->rx_sn_length); - if (MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT"DATA SN %u size %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.fi); - - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "| HE:"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } - } - - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (char *)pdu_info.payload, - tb_size_in_bytes, - message_string); - } - if (LOG_DEBUGFLAG(DEBUG_RLC)) { message_string_size = 0; message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); @@ -483,89 +432,61 @@ rlc_um_mac_data_request (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP,cons continue; } - if (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC) ) { + if (LOG_DEBUGFLAG(DEBUG_RLC) ) { rlc_um_get_pdu_infos(ctxt_pP, l_rlc_p,(rlc_um_pdu_sn_10_t *) ((struct mac_tb_req *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length); - if(MESSAGE_CHART_GENERATOR) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA SN %u size %u FI %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p), - pdu_info.sn, - tb_size_in_bytes, - pdu_info.fi); + message_string_size = 0; + message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); + message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes); + message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size); + message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size); + message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n"); + message_string_size += sprintf(&message_string[message_string_size], "Header :\n"); + message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi); + message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e); + message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn); - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "|HE:"); + if (pdu_info.e) { + message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n"); - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]); - } + for (index=0; index < pdu_info.num_li; index++) { + message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]); } - - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB, - (const char *)pdu_info.payload, - pdu_info.payload_size, - message_string); } - if(LOG_DEBUGFLAG(DEBUG_RLC)) { - message_string_size = 0; - message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id); - message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes); - message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size); - message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size); - message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n"); - message_string_size += sprintf(&message_string[message_string_size], "Header :\n"); - message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi); - message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e); - message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn); + message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n"); + message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n"); + message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n"); + message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n"); - if (pdu_info.e) { - message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n"); - - for (index=0; index < pdu_info.num_li; index++) { - message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]); - } - } - - message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n"); - message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n"); - message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n"); - message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n"); - - for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) { - if ((octet_index % 16) == 0) { - if (octet_index != 0) { - message_string_size += sprintf(&message_string[message_string_size], " |\n"); - } - - message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index); + for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) { + if ((octet_index % 16) == 0) { + if (octet_index != 0) { + message_string_size += sprintf(&message_string[message_string_size], " |\n"); } - /* - * Print every single octet in hexadecimal form - */ - message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]); - /* - * Align newline and pipes according to the octets in groups of 2 - */ + message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index); } /* - * Append enough spaces and put final pipe + * Print every single octet in hexadecimal form */ - for (index = octet_index; index < 16; ++index) { - message_string_size += sprintf(&message_string[message_string_size], " "); - } + message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]); + /* + * Align newline and pipes according to the octets in groups of 2 + */ + } - message_string_size += sprintf(&message_string[message_string_size], " |\n"); - LOG_UI(RLC, "%s\n", message_string); - } /*LOG_DEBUGFLAG(DEBUG_RLC) */ - } /* MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC) */ + /* + * Append enough spaces and put final pipe + */ + for (index = octet_index; index < 16; ++index) { + message_string_size += sprintf(&message_string[message_string_size], " "); + } + + message_string_size += sprintf(&message_string[message_string_size], " |\n"); + LOG_UI(RLC, "%s\n", message_string); + } /* LOG_DEBUGFLAG(DEBUG_RLC) */ tb_p = tb_p->next; } /* while (tb_p != NULL) */ @@ -607,15 +528,6 @@ rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t //rlc_p->next_sdu_index = (rlc_p->next_sdu_index + 1) % rlc_p->size_input_sdus_buffer; rlc_p->stat_tx_pdcp_sdu += 1; rlc_p->stat_tx_pdcp_bytes += ((struct rlc_um_tx_sdu_management *) (sdu_pP->data))->sdu_size; - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA-REQ size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, rlc_p), - ((struct rlc_um_tx_sdu_management *) (sdu_pP->data))->sdu_size); if (LOG_DEBUGFLAG(DEBUG_RLC) ) { data_offset = sizeof (struct rlc_um_data_req_alloc); @@ -660,14 +572,6 @@ rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t list_add_tail_eurecom(sdu_pP, &rlc_p->input_sdus); RLC_UM_MUTEX_UNLOCK(&rlc_p->lock_input_sdus); - if (MESSAGE_CHART_GENERATOR) { - if (rlc_p->buffer_occupancy > 4096) { - MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 "PROTOCOL_RLC_AM_MSC_FMT" BO %u bytes",\ - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_p), rlc_p->buffer_occupancy); - } - } - LOG_T(RLC, PROTOCOL_RLC_UM_CTXT_FMT" BO %d , NB SDU %d\n", PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p), rlc_p->buffer_occupancy, diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h index be06551dde..bd04ff3ece 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h @@ -56,28 +56,13 @@ rLC_Pp->rb_id,\ __FUNCTION__ -#define PROTOCOL_RLC_UM_MSC_FMT "[RNTI %" PRIx16 " %s %02ld]" -#define PROTOCOL_RLC_UM_MSC_ARGS(CTXT_Pp, rLC_Pp) \ - CTXT_Pp->rnti,\ - (rLC_Pp->is_data_plane) ? "DRB UM" : "SRB UM",\ - rLC_Pp->rb_id - #if defined(TRACE_RLC_MUTEX) #define RLC_UM_MUTEX_LOCK(mUTEX, cTXT, rLC) \ do {\ int pmtl_rc = pthread_mutex_trylock(mUTEX);\ if (pmtl_rc != 0){\ if (pmtl_rc == EBUSY) {\ - MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 " PROTOCOL_RLC_UM_MSC_FMT " Warning try lock %s busy",\ - PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\ - #mUTEX);\ pthread_mutex_lock(mUTEX);\ - } else {\ - MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\ - "0 " PROTOCOL_RLC_UM_MSC_FMT " Error try lock %s %d",\ - PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\ - #mUTEX, pmtl_rc);\ }\ }\ } while (0); diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c index 05c3423f76..bec815ac5d 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c @@ -32,7 +32,6 @@ #include "rlc_um_control_primitives.h" #include "LTE_T-Reordering.h" -#include "msc.h" //----------------------------------------------------------------------------- void config_req_rlc_um ( @@ -173,15 +172,6 @@ void config_req_rlc_um_asn1 ( PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p), rlc_p->rb_id, ul_rlc_pP->sn_FieldLength); - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ UL sn_FieldLength %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - ul_rlc_pP->sn_FieldLength); return; } } @@ -201,15 +191,6 @@ void config_req_rlc_um_asn1 ( PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p), rlc_p->rb_id, dl_rlc_pP->sn_FieldLength); - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ DL sn_FieldLength %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - dl_rlc_pP->sn_FieldLength); return; } @@ -220,15 +201,6 @@ void config_req_rlc_um_asn1 ( PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p), rlc_p->rb_id, dl_rlc_pP->t_Reordering); - MSC_LOG_RX_DISCARDED_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - dl_rlc_pP->t_Reordering); return; } } @@ -239,34 +211,12 @@ void config_req_rlc_um_asn1 ( ul_sn_FieldLength, dl_sn_FieldLength, mbms_flagP); - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - t_Reordering, - ul_sn_FieldLength, - dl_sn_FieldLength); } else { rlc_um_configure(ctxt_pP,rlc_p, t_Reordering, dl_sn_FieldLength, ul_sn_FieldLength, mbms_flagP); - MSC_LOG_RX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, - NULL, - 0, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p), - t_Reordering, - dl_sn_FieldLength, - ul_sn_FieldLength); } } } diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c index c8faa08358..6d2380d4ff 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c @@ -24,7 +24,6 @@ #include "platform_types.h" #include "assertions.h" //----------------------------------------------------------------------------- -#include "msc.h" #include "rlc.h" #include "rlc_um.h" #include "rlc_primitives.h" diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c index 2eba223803..ca43dab667 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c @@ -35,7 +35,6 @@ #include "list.h" #include "LAYER2/MAC/mac_extern.h" #include "common/utils/LOG/log.h" -#include "msc.h" //----------------------------------------------------------------------------- inline void @@ -117,17 +116,6 @@ rlc_um_send_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP) rlc_pP->stat_rx_pdcp_sdu += 1; rlc_pP->stat_rx_pdcp_bytes += rlc_pP->output_sdu_size_to_write; - MSC_LOG_TX_MESSAGE( - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE, - (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, - (const char*)(rlc_pP->output_sdu_in_construction->data), - rlc_pP->output_sdu_size_to_write, - MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA-IND size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP,rlc_pP), - rlc_pP->output_sdu_size_to_write - ); - #if TEST_RLC_UM #if TRACE_RLC_UM_DISPLAY_ASCII_DATA rlc_pP->output_sdu_in_construction->data[rlc_pP->output_sdu_size_to_write] = 0; diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c index 932bb1376e..4c047e3d92 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c @@ -27,7 +27,6 @@ //----------------------------------------------------------------------------- #include #include "assertions.h" -#include "msc.h" #include "list.h" #include "rlc_um.h" #include "rlc_primitives.h" diff --git a/openair2/M2AP/m2ap_MCE_generate_messages.c b/openair2/M2AP/m2ap_MCE_generate_messages.c index a28097cf1a..969863b445 100644 --- a/openair2/M2AP/m2ap_MCE_generate_messages.c +++ b/openair2/M2AP/m2ap_MCE_generate_messages.c @@ -39,7 +39,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -174,8 +173,6 @@ int m2ap_MCE_generate_m2_setup_request( return -1; } - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); - m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0); return ret; @@ -311,8 +308,6 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC m2ap_MCE_data_p->state = M2AP_MCE_STATE_READY; - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id); - m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0); return ret; @@ -367,11 +362,6 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance, return -1; } - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, - // MSC_M2AP_TARGET_MCE, NULL, 0, - // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", - // assoc_id, cause_type, cause_value); - m2ap_MCE_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); return ret; @@ -557,8 +547,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -650,8 +638,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -712,8 +698,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -796,8 +780,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; diff --git a/openair2/M2AP/m2ap_MCE_handler.c b/openair2/M2AP/m2ap_MCE_handler.c index 5a0e303218..3f6d5ff64d 100644 --- a/openair2/M2AP/m2ap_MCE_handler.c +++ b/openair2/M2AP/m2ap_MCE_handler.c @@ -44,7 +44,6 @@ #include "m2ap_MCE_interface_management.h" //#include "m2ap_eNB_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair2/M2AP/m2ap_MCE_interface_management.c b/openair2/M2AP/m2ap_MCE_interface_management.c index 3b12f41cbe..28f5fccffa 100644 --- a/openair2/M2AP/m2ap_MCE_interface_management.c +++ b/openair2/M2AP/m2ap_MCE_interface_management.c @@ -210,16 +210,7 @@ int MCE_handle_MBMS_SESSION_START_RESPONSE(instance_t instance, AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n"); AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n"); //M2AP_SESSION_START_RESP(msg_p). -// MSC_LOG_RX_MESSAGE( -// MSC_M2AP_MCE, -// MSC_M2AP_ENB, - //return 0; -// 0, -// 0, -// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d", -// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// assoc_id); -// + LOG_D(M2AP, "Sending M2AP_SESSION_START_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_g); @@ -348,14 +339,6 @@ int MCE_handle_MBMS_SESSION_STOP_RESPONSE(instance_t instance, AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n"); AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n"); // M2AP_SESSION_STOP_RESP(msg_p). - // MSC_LOG_RX_MESSAGE( - // MSC_M2AP_MCE, - // MSC_M2AP_ENB, - // 0, - // 0, - // MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_STOP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); // LOG_D(M2AP, "Sending M2AP_SESSION_START_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); @@ -645,14 +628,6 @@ int MCE_handle_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, // } // // M2AP_SESSION_STOP_RESP(msg_p). -// MSC_LOG_RX_MESSAGE( -// MSC_M2AP_MCE, -// MSC_M2AP_ENB, -// 0, -// 0, -// MSC_AS_TIME_FMT" MCE_handle_M2_SCHEDULING_INFORMATION_RESPONSE successfulOutcome assoc_id %d", -// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// assoc_id); // // LOG_D(M2AP, "Sending M2AP_SCHEDULING_INFO_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); @@ -836,15 +811,6 @@ int MCE_handle_M2_SETUP_REQUEST(instance_t instance, *m2ap_mce_data_from_enb = M2AP_SETUP_REQ(message_p); //printf("m2ap_mce_data_from_enb->assoc_id %d %d\n",m2ap_mce_data_from_enb->assoc_id,assoc_id); -// MSC_LOG_TX_MESSAGE( -// MSC_M2AP_MCE, -// MSC_RRC_ENB, -// 0, -// 0, -// MSC_AS_TIME_FMT" MCE_handle_M2_SETUP_REQUEST", -// 0,0//MSC_AS_TIME_ARGS(ctxt_pP), -// ); -// if (num_mbms_available > 0) { itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(instance), message_p); } else { @@ -1217,15 +1183,6 @@ int MCE_handle_MCE_CONFIGURATION_UPDATE_FAILURE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id)); @@ -1430,16 +1387,7 @@ int MCE_handle_MBMS_SERVICE_COUNTING_RESPONSE(instance_t instance, //AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n"); //AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n"); //M2AP_SESSION_START_RESP(msg_p). -// MSC_LOG_RX_MESSAGE( -// MSC_M2AP_MCE, -// MSC_M2AP_ENB, - //return 0; -// 0, -// 0, -// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d", -// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// assoc_id); -// + //LOG_D(M2AP, "Sending ITTI message to ENB_APP with assoc_id (%d->%d)\n", //assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); diff --git a/openair2/M2AP/m2ap_eNB_generate_messages.c b/openair2/M2AP/m2ap_eNB_generate_messages.c index b6c821e1ce..6496d608b8 100644 --- a/openair2/M2AP/m2ap_eNB_generate_messages.c +++ b/openair2/M2AP/m2ap_eNB_generate_messages.c @@ -39,7 +39,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -169,15 +168,6 @@ // // // LOG_W(M2AP,"pdu.present %d\n",pdu.present); -// // MSC_LOG_TX_MESSAGE( -// // MSC_M2AP_eNB, -// // MSC_M2AP_MCE, -// // (const char *)buffer, -// // len, -// // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", -// // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// // m2ap_eNB_data_p->ENBname); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p, m2ap_eNB_data_p->assoc_id, buffer, len, 0); // // return 0; @@ -315,8 +305,6 @@ // // m2ap_eNB_data_p->state = M2AP_ENB_STATE_READY; // -// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 0); // // return ret; @@ -371,11 +359,6 @@ // return -1; // } // -// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, -// // MSC_M2AP_TARGET_ENB, NULL, 0, -// // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", -// // assoc_id, cause_type, cause_value); -// // m2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); // // return ret; @@ -561,8 +544,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -654,8 +635,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -716,8 +695,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -800,8 +777,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; diff --git a/openair2/M2AP/m2ap_eNB_handler.c b/openair2/M2AP/m2ap_eNB_handler.c index 9abc337408..7c4a9758da 100644 --- a/openair2/M2AP/m2ap_eNB_handler.c +++ b/openair2/M2AP/m2ap_eNB_handler.c @@ -44,7 +44,6 @@ //#include "m2ap_MCE_interface_management.h" #include "m2ap_eNB_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair2/M2AP/m2ap_eNB_interface_management.c b/openair2/M2AP/m2ap_eNB_interface_management.c index 486e382e69..9bab800525 100644 --- a/openair2/M2AP/m2ap_eNB_interface_management.c +++ b/openair2/M2AP/m2ap_eNB_interface_management.c @@ -44,7 +44,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -255,15 +254,6 @@ int eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, m2ap_mbms LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); - m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0); return 0; } @@ -359,14 +349,6 @@ int eNB_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m2ap_session_start LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0); return 0; @@ -531,14 +513,6 @@ int eNB_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m2ap_session_stop_r LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0); return 0; @@ -700,15 +674,6 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t* LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); - // buffer = &bytes[0]; // len = 40; @@ -826,15 +791,6 @@ int eNB_handle_M2_SETUP_RESPONSE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id)); //itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p2); @@ -880,15 +836,6 @@ int eNB_handle_M2_SETUP_FAILURE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id)); @@ -1025,15 +972,6 @@ int eNB_send_eNB_CONFIGURATION_UPDATE(instance_t instance, m2ap_enb_configuratio LOG_D(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); - // buffer = &bytes[0]; // len = 40; @@ -1086,15 +1024,6 @@ int eNB_handle_eNB_CONFIGURATION_UPDATE_FAILURE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id)); diff --git a/openair2/M2AP/m2ap_handler.c b/openair2/M2AP/m2ap_handler.c index 1221bcedb5..6d8405db14 100644 --- a/openair2/M2AP/m2ap_handler.c +++ b/openair2/M2AP/m2ap_handler.c @@ -44,7 +44,6 @@ #include "m2ap_MCE_interface_management.h" #include "m2ap_eNB_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair2/RRC/LTE/L2_interface.c b/openair2/RRC/LTE/L2_interface.c index 3759519228..0a63acc8fb 100644 --- a/openair2/RRC/LTE/L2_interface.c +++ b/openair2/RRC/LTE/L2_interface.c @@ -43,7 +43,6 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" -#include "msc.h" #include "common/ran_context.h" #include "intertask_interface.h" diff --git a/openair2/RRC/LTE/L2_interface_common.c b/openair2/RRC/LTE/L2_interface_common.c index f70cc68550..1993fe7de0 100644 --- a/openair2/RRC/LTE/L2_interface_common.c +++ b/openair2/RRC/LTE/L2_interface_common.c @@ -34,7 +34,6 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" -#include "msc.h" #include "common/ran_context.h" #include "intertask_interface.h" @@ -62,16 +61,6 @@ rrc_data_req( return FALSE; } - MSC_LOG_TX_MESSAGE( - ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE, - ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE, - buffer_pP, - sdu_sizeP, - MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - muiP, - sdu_sizeP); MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). uint8_t *message_buffer; diff --git a/openair2/RRC/LTE/L2_interface_ue.c b/openair2/RRC/LTE/L2_interface_ue.c index 5c1800cdd4..534030864a 100644 --- a/openair2/RRC/LTE/L2_interface_ue.c +++ b/openair2/RRC/LTE/L2_interface_ue.c @@ -44,7 +44,6 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" #include "pdcp.h" -#include "msc.h" #include "intertask_interface.h" @@ -274,16 +273,6 @@ rrc_data_req_ue( ) //------------------------------------------------------------------------------ { - MSC_LOG_TX_MESSAGE( - ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE, - ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE, - buffer_pP, - sdu_sizeP, - MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - muiP, - sdu_sizeP); { MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index d0b89abb51..b46bba2492 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -71,7 +71,6 @@ #include "pdcp.h" #include "plmn_data.h" -#include "msc.h" #include #include "intertask_interface.h" @@ -1390,16 +1389,6 @@ rrc_ue_process_radioResourceConfigDedicated( uint8_t *kUPenc = NULL; derive_key_up_enc(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm, UE_rrc_inst[ctxt_pP->module_id].kenb, &kUPenc); - MSC_LOG_TX_MESSAGE( - MSC_RRC_UE, - MSC_PDCP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security %X)", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm | - (UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4)); // Refresh DRBs rrc_pdcp_config_asn1_req(ctxt_pP, (LTE_SRB_ToAddModList_t *)NULL, diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 260b6fceaa..b78c6d0c62 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -58,7 +58,6 @@ #include "rlc.h" #include "rrc_eNB_UE_context.h" #include "platform_types.h" -#include "msc.h" #include "LTE_SL-CommConfig-r12.h" #include "LTE_PeriodicBSR-Timer-r12.h" #include "LTE_RetxBSR-Timer-r12.h" @@ -1247,16 +1246,6 @@ rrc_eNB_generate_SecurityModeCommand( size, rrc_eNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" securityModeCommand UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); if (!NODE_IS_DU(RC.rrc[ctxt_pP->module_id]->node_type)) { LOG_I(RRC,"calling rrc_data_req :securityModeCommand\n"); @@ -1301,16 +1290,6 @@ rrc_eNB_generate_UECapabilityEnquiry( size, rrc_eNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcUECapabilityEnquiry UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -1352,16 +1331,6 @@ rrc_eNB_generate_NR_UECapabilityEnquiry( size, rrc_eNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcNRUECapabilityEnquiry UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -1391,15 +1360,6 @@ rrc_eNB_generate_RRCConnectionReject( (char *)(ue_p->Srb0.Tx_buffer.Payload), ue_p->Srb0.Tx_buffer.payload_size, "[MSG] RRCConnectionReject\n"); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReject UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReject (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -1509,14 +1469,6 @@ rrc_eNB_generate_RRCConnectionReestablishment( } // for (int cnt = 0; cnt < (*SRB_configList)->list.count; cnt++) } // if (*SRB_configList != NULL) - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_RRC_UE, - ue_context->Srb0.Tx_buffer.Header, - ue_context->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishment UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context->rnti, - ue_context->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishment (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ue_context->Srb0.Tx_buffer.payload_size); @@ -2058,16 +2010,6 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -2154,15 +2096,6 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject( (char *)(ue_p->Srb0.Tx_buffer.Payload), ue_p->Srb0.Tx_buffer.payload_size, "[MSG] RRCConnectionReestablishmentReject\n"); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishmentReject UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishmentReject (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -2230,16 +2163,6 @@ rrc_eNB_generate_RRCConnectionRelease( size, rrc_eNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionRelease UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); pthread_mutex_lock(&rrc_release_freelist); for (release_num = 0; release_num < NUMBER_OF_UE_MAX; release_num++) { @@ -2525,16 +2448,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *co LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -2773,16 +2686,6 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *cons LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -2883,16 +2786,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release( const protocol_ LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -3603,15 +3496,6 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req(ctxt_pP, DCCH, rrc_eNB_mui++, @@ -4316,15 +4200,6 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req(ctxt_pP, DCCH, rrc_eNB_mui++, @@ -4392,16 +4267,6 @@ rrc_eNB_generate_RRCConnectionReconfiguration_SCell( ); LOG_I(RRC,"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n", ctxt_pP->module_id,ctxt_pP->frame, size, ue_context_pP->ue_context.rnti); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); rrc_data_req( ctxt_pP, DCCH, @@ -4996,7 +4861,6 @@ void rrc_eNB_handover_ue_context_release( //msg_release_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE); //itti_send_msg_to_task(TASK_S1AP, ctxt_pP->module_id, msg_release_p); s1ap_ue_context_release(ctxt_pP->instance, ue_context_p->ue_context.eNB_ue_s1ap_id); - //MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_GTPU_ENB, NULL,0, "0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", eNB_ue_s1ap_id); gtpv1u_enb_delete_tunnel_req_t delete_tunnels={0}; delete_tunnels.rnti = ue_context_p->ue_context.rnti; delete_tunnels.from_gnb = 0; @@ -6330,16 +6194,6 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct LOG_D(RRC, "[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration handover to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcConnectionReconfiguration handover UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_eNB_mui, - size); /* Refresh SRBs/DRBs */ rrc_pdcp_config_asn1_req(ctxt_pP, *SRB_configList2, // NULL, @@ -6535,9 +6389,6 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( ue_context_pP->ue_context.kenb, &kRRCint); /* Refresh SRBs/DRBs */ - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_PDCP_ENB, NULL, 0, MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti); rrc_pdcp_config_asn1_req(ctxt_pP, SRB_configList, // NULL, DRB_configList, @@ -6906,15 +6757,6 @@ rrc_eNB_generate_RRCConnectionSetup( LOG_W(RRC, "Unknown node type %d\n", RC.rrc[ctxt_pP->module_id]->node_type); } - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, // LG WARNING - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" RRCConnectionSetup UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCConnectionSetup (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -7326,13 +7168,6 @@ rrc_eNB_decode_ccch( LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), Idx); - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_PDCP_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti); rrc_pdcp_config_asn1_req(ctxt_pP, ue_context_p->ue_context.SRB_configList, (LTE_DRB_ToAddModList_t *) NULL, @@ -7373,15 +7208,6 @@ rrc_eNB_decode_ccch( if (ue_context_p != NULL) { // erase content rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_p); - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - dec_rval.consumed, - MSC_AS_TIME_FMT" LTE_RRCConnectionRequest UE %x size %u (UE already in context)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - dec_rval.consumed); } else { rrcConnectionRequest = &ul_ccch_msg->message.choice.c1.choice.rrcConnectionRequest.criticalExtensions.choice.rrcConnectionRequest_r8; { @@ -7467,18 +7293,6 @@ rrc_eNB_decode_ccch( } } - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - buffer, - dec_rval.consumed, - MSC_AS_TIME_FMT" RRCConnectionRequest UE %x size %u (s-TMSI mmec %u m_TMSI %u random UE id (0x%" PRIx64 ")", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - dec_rval.consumed, - ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code, - ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi, - ue_context_p->ue_context.random_ue_identity); } else { LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionRequest without random UE identity or S-TMSI not supported, let's reject the UE\n", @@ -7567,14 +7381,6 @@ rrc_eNB_decode_ccch( LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), Idx); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_PDCP_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti); rrc_pdcp_config_asn1_req(ctxt_pP, ue_context_p->ue_context.SRB_configList, (LTE_DRB_ToAddModList_t *) NULL, @@ -7949,15 +7755,6 @@ rrc_eNB_decode_dcch( LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)(Rx_sdu),sdu_sizeP, "[MSG] RRC Connection Reconfiguration Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfigurationComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(RRCConnectionReconfigurationComplete) ---> RRC_eNB]\n", @@ -8169,15 +7966,6 @@ rrc_eNB_decode_dcch( T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC Connection Reestablishment Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishmentComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(rrcConnectionReestablishmentComplete) ---> RRC_eNB\n", @@ -8254,15 +8042,6 @@ rrc_eNB_decode_dcch( LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC Connection SetupComplete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" LTE_RRCConnectionSetupComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(RRCConnectionSetupComplete) ---> RRC_eNB\n", @@ -8308,15 +8087,6 @@ rrc_eNB_decode_dcch( LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC Security Mode Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" securityModeComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" received securityModeComplete on UL-DCCH %d from UE\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -8345,15 +8115,6 @@ rrc_eNB_decode_dcch( T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC Security Mode Failure\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" securityModeFailure UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_W(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(securityModeFailure) ---> RRC_eNB\n", @@ -8383,15 +8144,6 @@ rrc_eNB_decode_dcch( LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC UECapablility Information\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" ueCapabilityInformation UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" received ueCapabilityInformation on UL-DCCH %d from UE\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -8569,15 +8321,6 @@ rrc_eNB_decode_dcch( LOG_D(RRC,"[MSG] RRC UL Information Transfer \n"); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC UL Information Transfer \n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" ulInformationTransfer UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); if (EPC_MODE_ENABLED == 1) { rrc_eNB_send_S1AP_UPLINK_NAS(ctxt_pP, @@ -8668,15 +8411,6 @@ rrc_eNB_decode_dcch( LOG_I(RRC,"THINH [LTE_UL_DCCH_MessageType__messageClassExtension_PR_c2]\n"); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC SidelinkUEInformation \n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" SidelinkUEInformation UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(SidelinkUEInformation) ---> RRC_eNB\n", diff --git a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c index 3fa17bcd6b..918c84d565 100644 --- a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c +++ b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c @@ -32,7 +32,6 @@ # include "RRC/LTE/MESSAGES/asn1_msg.h" # include "rrc_eNB_GTPV1U.h" # include "rrc_eNB_UE_context.h" -# include "msc.h" #include "asn1_conversions.h" @@ -77,15 +76,6 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP( create_tunnel_resp_pP->enb_addr.length); } - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_GTPU_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u ebid %u enb-s1u teid %u", - 0,0,rnti, - create_tunnel_resp_pP->num_tunnels, - ue_context_p->ue_context.enb_gtp_ebi[0], - ue_context_p->ue_context.enb_gtp_teid[0]); (void)rnti; /* avoid gcc warning "set but not used" */ return 0; } else { diff --git a/openair2/RRC/LTE/rrc_eNB_M2AP.c b/openair2/RRC/LTE/rrc_eNB_M2AP.c index a9c65eae1a..5516308a10 100644 --- a/openair2/RRC/LTE/rrc_eNB_M2AP.c +++ b/openair2/RRC/LTE/rrc_eNB_M2AP.c @@ -32,7 +32,6 @@ # include "RRC/LTE/MESSAGES/asn1_msg.h" # include "rrc_eNB_M2AP.h" //# include "rrc_eNB_UE_context.h" -# include "msc.h" # include "asn1_conversions.h" # include "intertask_interface.h" # include "common/ran_context.h" diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 1a5fe55c26..4af9b9ff66 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -48,7 +48,6 @@ #include "pdcp_primitives.h" #include "UTIL/OSA/osa_defs.h" -#include #include "LTE_UERadioAccessCapabilityInformation.h" @@ -586,17 +585,6 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP( // TODO add cause when it will be integrated } } - - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p), - sizeof(s1ap_initial_context_setup_resp_t), - MSC_AS_TIME_FMT" INITIAL_CONTEXT_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).eNB_ue_s1ap_id, - e_rabs_done, e_rabs_failed); } //------------------------------------------------------------------------------ @@ -804,14 +792,6 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( ue_context_pP->ue_context.ue_gummei.mnc_len = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len; ue_context_pP->ue_context.ue_gummei.mme_code = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code; ue_context_pP->ue_context.ue_gummei.mme_group_id = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_group_id; - MSC_LOG_TX_MESSAGE(MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)&message_p->ittiMsg.s1ap_nas_first_req, - sizeof(s1ap_nas_first_req_t), - MSC_AS_TIME_FMT" S1AP_NAS_FIRST_REQ eNB %u UE %x", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->module_id, - ctxt_pP->rnti); LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI mme_code %u mme_group_id %u ue %x\n", ctxt_pP->module_id, S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code, @@ -852,15 +832,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( eNB_ue_s1ap_id); if (ue_context_p == NULL) { - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u eNB_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - eNB_ue_s1ap_id); /* Can not associate this message to an UE index, send a failure to S1AP and discard it! */ MessageDef *msg_fail_p; LOG_W(RRC, "[eNB %ld] In S1AP_DOWNLINK_NAS: unknown UE from S1AP ids (%d, %d)\n", instance, ue_initial_id, eNB_ue_s1ap_id); @@ -869,15 +840,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.length = S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length; S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.buffer = S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer; // TODO add failure cause when defined! - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" S1AP_NAS_NON_DELIVERY_IND UE initial id %u eNB_ue_s1ap_id %u (ue ctxt !found)", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - eNB_ue_s1ap_id); itti_send_msg_to_task (TASK_S1AP, instance, msg_fail_p); return (-1); } else { @@ -889,15 +851,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id; } - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u eNB_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id); /* Create message for PDCP (DLInformationTransfer_t) */ length = do_DLInformationTransfer ( instance, @@ -1195,12 +1148,6 @@ rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ( if (ue_context_pP == NULL) { LOG_E(RRC, "[eNB] In S1AP_UE_CONTEXT_RELEASE_REQ: invalid UE\n"); } else { - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_S1AP_ENB, - NULL, - 0, - "0 S1AP_UE_CONTEXT_RELEASE_REQ eNB_ue_s1ap_id 0x%06"PRIX32" ", - ue_context_pP->ue_context.eNB_ue_s1ap_id); MessageDef *msg_context_release_req_p = NULL; msg_context_release_req_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_REQ); S1AP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id; @@ -1214,9 +1161,6 @@ void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT( module_id_t enb_mod_idP, uint32_t eNB_ue_s1ap_id ) { - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_S1AP_ENB, NULL, 0, - "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ", - eNB_ue_s1ap_id); MessageDef *msg = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_COMPLETE); S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg).eNB_ue_s1ap_id = eNB_ue_s1ap_id; itti_send_msg_to_task(TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_mod_idP), msg); @@ -1247,14 +1191,6 @@ rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND( LOG_W(RRC, "[eNB %ld] In S1AP_UE_CONTEXT_RELEASE_COMMAND: unknown UE from eNB_ue_s1ap_id (%d)\n", instance, eNB_ue_s1ap_id); - MSC_LOG_EVENT(MSC_RRC_ENB, "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" context not found", - eNB_ue_s1ap_id); - MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, - MSC_S1AP_ENB, - NULL, - 0, - "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ", - eNB_ue_s1ap_id); msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_COMPLETE); S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id; itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p); @@ -1432,16 +1368,6 @@ int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t *const ctxt_pP, if ((e_rabs_done > 0) ) { LOG_I(RRC,"S1AP_E_RAB_SETUP_RESP: sending the message: nb_of_erabs %d, total e_rabs %d, index %d\n", ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_E_RAB_SETUP_RESP (msg_p), - sizeof(s1ap_e_rab_setup_resp_t), - MSC_AS_TIME_FMT" E_RAB_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_E_RAB_SETUP_RESP (msg_p).eNB_ue_s1ap_id, - e_rabs_done, e_rabs_failed); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); } @@ -1667,16 +1593,6 @@ int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t *const ctxt_pP, if (e_rabs_done > 0 || e_rabs_failed > 0) { LOG_D(RRC,"S1AP_E_RAB_MODIFY_RESP: sending the message: nb_of_modify_e_rabs %d, total e_rabs %d, index %d\n", ue_context_pP->ue_context.nb_of_modify_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_E_RAB_SETUP_RESP (msg_p), - sizeof(s1ap_e_rab_setup_resp_t), - MSC_AS_TIME_FMT" E_RAB_MODIFY_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_E_RAB_MODIFY_RESP (msg_p).eNB_ue_s1ap_id, - e_rabs_done, e_rabs_failed); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); } else { itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); @@ -2067,16 +1983,6 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP, if (e_rabs_done > 0) { LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n", S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_PATH_SWITCH_REQ (msg_p), - sizeof(s1ap_path_switch_req_t), - MSC_AS_TIME_FMT" PATH_SWITCH_REQ UE %X eNB_ue_s1ap_id %u e_rabs:%u succ", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id, - e_rabs_done); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); } else { itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p); @@ -2355,16 +2261,6 @@ int rrc_eNB_send_E_RAB_Modification_Indication(const protocol_ctxt_t *const ctxt if (e_rab_modify_index > 0) { LOG_I(RRC,"S1AP_E_RAB_MODIFICATION_IND: sending the message: nb_of_erabstobemodified %d, total e_rabs %d, index %d\n", S1AP_E_RAB_MODIFICATION_IND (msg_p).nb_of_e_rabs_tobemodified, ue_context_pP->ue_context.setup_e_rabs, e_rab); - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_S1AP_ENB, - (const char *)&S1AP_E_RAB_MODIFICATION_IND (msg_p), - sizeof(s1ap_e_rab_modification_ind_t), - MSC_AS_TIME_FMT" E RAB MODIFICATION IND UE %X eNB_ue_s1ap_id %u e_rabs:%u succ", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - S1AP_E_RAB_MODIFICATION_IND (msg_p).eNB_ue_s1ap_id, - e_rab_modify_index); itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p); } else { itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p); diff --git a/openair2/RRC/LTE/rrc_eNB_UE_context.c b/openair2/RRC/LTE/rrc_eNB_UE_context.c index 2cc89adf15..0d262064b5 100644 --- a/openair2/RRC/LTE/rrc_eNB_UE_context.c +++ b/openair2/RRC/LTE/rrc_eNB_UE_context.c @@ -35,7 +35,6 @@ #include "common/utils/LOG/log.h" #include "rrc_eNB_UE_context.h" -#include "msc.h" //------------------------------------------------------------------------------ @@ -210,10 +209,6 @@ void rrc_eNB_remove_ue_context( } RB_REMOVE(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP); - MSC_LOG_EVENT( - MSC_RRC_ENB, - "0 Removed UE %"PRIx16" ", - ue_context_pP->ue_context.rnti); rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_pP); uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid); free(ue_context_pP); diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index eb402092b9..eb0996b6f4 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -34,7 +34,6 @@ #include "nr_rrc_extern.h" #include "common/utils/LOG/log.h" #include "pdcp.h" -#include "msc.h" #include "common/ran_context.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_common.h" #include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" @@ -172,16 +171,6 @@ nr_rrc_data_req( return FALSE; } - MSC_LOG_TX_MESSAGE( - ctxt_pP->enb_flag ? MSC_RRC_GNB : MSC_RRC_UE, - ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE, - buffer_pP, - sdu_sizeP, - MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - muiP, - sdu_sizeP); MessageDef *message_p; // Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling). uint8_t *message_buffer; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2c2020412d..49ebedaf95 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -66,7 +66,6 @@ #include "rlc.h" #include "rrc_eNB_UE_context.h" #include "platform_types.h" -#include "msc.h" #include "common/utils/LOG/vcd_signal_dumper.h" #include "T.h" @@ -421,15 +420,6 @@ rrc_gNB_generate_RRCSetup( LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" RRC_gNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_gNB\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, // LG WARNING - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" RRCSetup UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -499,15 +489,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( (NR_CellGroupConfig_t *)NULL ); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, // LG WARNING - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" RRCSetup UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -549,14 +530,6 @@ rrc_gNB_generate_RRCReject( (char *)(ue_p->Srb0.Tx_buffer.Payload), ue_p->Srb0.Tx_buffer.payload_size, "[MSG] RRCReject \n"); - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_RRC_UE, - ue_p->Srb0.Tx_buffer.Header, - ue_p->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" NR_RRCReject UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti, - ue_p->Srb0.Tx_buffer.payload_size); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating NR_RRCReject (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -817,15 +790,6 @@ rrc_gNB_generate_defaultRRCReconfiguration( rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" NR_RRCReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, @@ -1047,16 +1011,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( LOG_D(NR_RRC, "[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated RRCReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; @@ -1155,16 +1109,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( LOG_D(NR_RRC, "[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated NR_RRCReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; uint8_t *message_buffer; @@ -1229,9 +1173,6 @@ rrc_gNB_process_RRCReconfigurationComplete( ue_context_pP->ue_context.kgnb, &kRRCint); /* Refresh SRBs/DRBs */ - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_PDCP_ENB, NULL, 0, MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti); #ifndef ITTI_SIM LOG_D(NR_RRC,"Configuring PDCP DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti); @@ -1459,14 +1400,6 @@ rrc_gNB_generate_RRCReestablishment( } } // if (*SRB_configList != NULL) - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_RRC_UE, - ue_context->Srb0.Tx_buffer.Header, - ue_context->Srb0.Tx_buffer.payload_size, - MSC_AS_TIME_FMT" NR_RRCReestablishment UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context->rnti, - ue_context->Srb0.Tx_buffer.payload_size); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-DCCH, Generating NR_RRCReestablishment (bytes %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), ue_context->Srb0.Tx_buffer.payload_size); @@ -1729,16 +1662,6 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( LOG_D(NR_RRC, "[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; uint8_t *message_buffer; @@ -1809,15 +1732,6 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, ue_context_p = rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti); if (ue_context_p != NULL) { rrc_gNB_free_mem_UE_context(ctxt_pP, ue_context_p); - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - dec_rval.consumed, - MSC_AS_TIME_FMT" NR_RRCSetupRequest UE %x size %u (UE already in context)", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - dec_rval.consumed); } else { rrcSetupRequest = &ul_ccch_msg->message.choice.c1->choice.rrcSetupRequest->rrcSetupRequest; if (NR_InitialUE_Identity_PR_randomValue == rrcSetupRequest->ue_Identity.present) { @@ -2109,13 +2023,6 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), Idx); - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_PDCP_GNB, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti); // nr_rrc_pdcp_config_asn1_req(ctxt_pP, // ue_context_p->ue_context.SRB_configList, // NULL, @@ -2259,15 +2166,6 @@ rrc_gNB_decode_dcch( LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)(Rx_sdu), sdu_sizeP, "[MSG] RRC Connection Reconfiguration Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" NR_RRCReconfigurationComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(RRCReconfigurationComplete) ---> RRC_gNB]\n", @@ -2329,15 +2227,6 @@ rrc_gNB_decode_dcch( LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC SetupComplete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" NR_RRCSetupComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_D(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(RRCSetupComplete) ---> RRC_gNB\n", @@ -2416,15 +2305,6 @@ rrc_gNB_decode_dcch( LOG_D(NR_RRC,"[MSG] RRC UL Information Transfer \n"); LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] RRC UL Information Transfer \n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" ulInformationTransfer UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); if (AMF_MODE_ENABLED == 1) { rrc_gNB_send_NGAP_UPLINK_NAS(ctxt_pP, @@ -2464,15 +2344,6 @@ rrc_gNB_decode_dcch( case NR_UL_DCCH_MessageType__c1_PR_securityModeFailure: LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] NR RRC Security Mode Failure\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" securityModeFailure UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_W(NR_RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(securityModeFailure) ---> RRC_gNB\n", @@ -2495,15 +2366,6 @@ rrc_gNB_decode_dcch( LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] NR_RRC UECapablility Information\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" ueCapabilityInformation UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" received ueCapabilityInformation on UL-DCCH %d from UE\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP), @@ -2609,15 +2471,6 @@ rrc_gNB_decode_dcch( case NR_UL_DCCH_MessageType__c1_PR_rrcReestablishmentComplete: LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP, "[MSG] NR_RRC Connection Reestablishment Complete\n"); - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - Rx_sdu, - sdu_sizeP, - MSC_AS_TIME_FMT" NR_RRCConnectionReestablishmentComplete UE %x size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->ue_context.rnti, - sdu_sizeP); LOG_I(NR_RRC, PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes " "(rrcConnectionReestablishmentComplete) ---> RRC_gNB\n", @@ -3766,16 +3619,6 @@ rrc_gNB_generate_SecurityModeCommand( size, rrc_gNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" securityModeCommand UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; uint8_t *message_buffer; @@ -3848,16 +3691,6 @@ rrc_gNB_generate_UECapabilityEnquiry( size, rrc_gNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" rrcNRUECapabilityEnquiry UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; uint8_t *message_buffer; @@ -3917,16 +3750,6 @@ rrc_gNB_generate_RRCRelease( size, rrc_gNB_mui, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" NR_RRCRelease UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; diff --git a/openair2/RRC/NR/rrc_gNB_GTPV1U.c b/openair2/RRC/NR/rrc_gNB_GTPV1U.c index 293f9e8b9f..f7b491af14 100644 --- a/openair2/RRC/NR/rrc_gNB_GTPV1U.c +++ b/openair2/RRC/NR/rrc_gNB_GTPV1U.c @@ -32,7 +32,6 @@ # include "RRC/LTE/MESSAGES/asn1_msg.h" # include "rrc_eNB_GTPV1U.h" # include "rrc_eNB_UE_context.h" -# include "msc.h" # include "openair2/RRC/NR/rrc_gNB_UE_context.h" //# if defined(ENABLE_ITTI) @@ -77,15 +76,6 @@ rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP( create_tunnel_resp_pP->enb_addr.length); } - MSC_LOG_RX_MESSAGE( - MSC_RRC_ENB, - MSC_GTPU_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u ebid %u enb-s1u teid %u", - 0,0,rnti, - create_tunnel_resp_pP->num_tunnels, - ue_context_p->ue_context.gnb_gtp_ebi[0], - ue_context_p->ue_context.gnb_gtp_teid[0]); (void)rnti; /* avoid gcc warning "set but not used" */ return 0; } else { @@ -126,15 +116,6 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP( create_tunnel_resp_pP->gnb_addr.length); } - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_GTPU_GNB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u psid %u enb-s1u teid %u", - 0,0,rnti, - create_tunnel_resp_pP->num_tunnels, - ue_context_p->ue_context.gnb_gtp_psi[0], - ue_context_p->ue_context.gnb_gtp_teid[0]); (void)rnti; /* avoid gcc warning "set but not used" */ return 0; } else { diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 043d136604..14c0ee4d68 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -40,8 +40,6 @@ #include "pdcp.h" #include "pdcp_primitives.h" -#include "msc.h" - #include "gtpv1u_eNB_task.h" #include "gtpv1u_gNB_task.h" #include "RRC/LTE/rrc_eNB_GTPV1U.h" @@ -453,14 +451,6 @@ rrc_gNB_send_NGAP_NAS_FIRST_REQ( ue_context_pP->ue_context.ue_guami.amf_set_id = NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.amf_set_id; ue_context_pP->ue_context.ue_guami.amf_pointer = NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.amf_pointer; - MSC_LOG_TX_MESSAGE(MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)&message_p->ittiMsg.ngap_nas_first_req, - sizeof(ngap_nas_first_req_t), - MSC_AS_TIME_FMT" NGAP_NAS_FIRST_REQ gNB %u UE %x", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->module_id, - ctxt_pP->rnti); LOG_I(NGAP, "[gNB %d] Build NGAP_NAS_FIRST_REQ adding in s_TMSI: GUAMI amf_set_id %u amf_region_id %u ue %x\n", ctxt_pP->module_id, NGAP_NAS_FIRST_REQ (message_p).ue_identity.guami.amf_set_id, @@ -636,16 +626,6 @@ rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP( } } - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_S1AP_ENB, - (const char *)&NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p), - sizeof(ngap_initial_context_setup_resp_t), - MSC_AS_TIME_FMT" INITIAL_CONTEXT_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).gNB_ue_ngap_id, - pdu_sessions_done, pdu_sessions_failed); NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).nb_of_pdusessions = pdu_sessions_done; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).nb_of_pdusessions_failed = pdu_sessions_failed; itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p); @@ -794,15 +774,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( gNB_ue_ngap_id); if (ue_context_p == NULL) { - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_NGAP_GNB, - NULL, - 0, - MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u gNB_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - gNB_ue_ngap_id); /* Can not associate this message to an UE index, send a failure to NGAP and discard it! */ MessageDef *msg_fail_p; LOG_W(NR_RRC, "[gNB %ld] In NGAP_DOWNLINK_NAS: unknown UE from NGAP ids (%d, %u)\n", instance, ue_initial_id, gNB_ue_ngap_id); @@ -811,15 +782,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( NGAP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.length = NGAP_DOWNLINK_NAS (msg_p).nas_pdu.length; NGAP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.buffer = NGAP_DOWNLINK_NAS (msg_p).nas_pdu.buffer; // TODO add failure cause when defined! - MSC_LOG_TX_MESSAGE( - MSC_RRC_ENB, - MSC_NGAP_GNB, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" NGAP_NAS_NON_DELIVERY_IND UE initial id %u gNB_ue_ngap_id %u (ue ctxt !found)", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - gNB_ue_ngap_id); itti_send_msg_to_task (TASK_NGAP, instance, msg_fail_p); return (-1); } else { @@ -830,15 +792,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS( ue_context_p->ue_context.gNB_ue_ngap_id = NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id; } - MSC_LOG_RX_MESSAGE( - MSC_RRC_GNB, - MSC_NGAP_GNB, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u gNB_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_initial_id, - NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id); /* Create message for PDCP (DLInformationTransfer_t) */ length = do_NR_DLInformationTransfer ( instance, @@ -997,16 +950,6 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP( if ((pdu_sessions_done > 0) ) { LOG_I(NR_RRC,"NGAP_PDUSESSION_SETUP_RESP: sending the message: nb_of_pdusessions %d, total pdu_sessions %d, index %d\n", ue_context_pP->ue_context.nb_of_pdusessions, ue_context_pP->ue_context.setup_pdu_sessions, pdusession); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_NGAP_GNB, - (const char *)&NGAP_PDUSESSION_SETUP_RESP (msg_p), - sizeof(ngap_pdusession_setup_resp_t), - MSC_AS_TIME_FMT" PDUSESSION_SETUP_RESP UE %X gNB_ue_ngap_id %u pdu_sessions:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - NGAP_PDUSESSION_SETUP_RESP (msg_p).gNB_ue_ngap_id, - pdu_sessions_done, pdu_sessions_failed); itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p); } @@ -1126,12 +1069,6 @@ rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( if (ue_context_pP == NULL) { LOG_E(RRC, "[gNB] In NGAP_UE_CONTEXT_RELEASE_REQ: invalid UE\n"); } else { - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_NGAP_GNB, - NULL, - 0, - "0 NGAP_UE_CONTEXT_RELEASE_REQ gNB_ue_ngap_id 0x%06"PRIX32" ", - ue_context_pP->ue_context.gNB_ue_ngap_id); MessageDef *msg_context_release_req_p = NULL; msg_context_release_req_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_REQ); NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id; @@ -1204,14 +1141,6 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND( LOG_W(NR_RRC, "[gNB %ld] In NGAP_UE_CONTEXT_RELEASE_COMMAND: unknown UE from gNB_ue_ngap_id (%u)\n", instance, gNB_ue_ngap_id); - MSC_LOG_EVENT(MSC_RRC_GNB, "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" context not found", - gNB_ue_ngap_id); - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, - MSC_NGAP_GNB, - NULL, - 0, - "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" ", - gNB_ue_ngap_id); msg_complete_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE); NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).gNB_ue_ngap_id = gNB_ue_ngap_id; itti_send_msg_to_task(TASK_NGAP, instance, msg_complete_p); @@ -1235,9 +1164,6 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND( void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE( instance_t instance, uint32_t gNB_ue_ngap_id) { - MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_NGAP_GNB, NULL, 0, - "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" ", - gNB_ue_ngap_id); MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE); NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = gNB_ue_ngap_id; itti_send_msg_to_task(TASK_NGAP, instance, msg); diff --git a/openair2/RRC/NR/rrc_gNB_UE_context.c b/openair2/RRC/NR/rrc_gNB_UE_context.c index ad8bd01470..b8ff19b749 100644 --- a/openair2/RRC/NR/rrc_gNB_UE_context.c +++ b/openair2/RRC/NR/rrc_gNB_UE_context.c @@ -35,7 +35,6 @@ #include "common/utils/LOG/log.h" #include "rrc_gNB_UE_context.h" -#include "msc.h" //------------------------------------------------------------------------------ @@ -208,10 +207,6 @@ void rrc_gNB_remove_ue_context( } RB_REMOVE(rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP); - MSC_LOG_EVENT( - MSC_RRC_ENB, - "0 Removed UE %"PRIx16" ", - ue_context_pP->ue_context.rnti); rrc_gNB_free_mem_UE_context(ctxt_pP, ue_context_pP); nr_uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid); free(ue_context_pP); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index bc209afd02..1ac4bef17c 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2164,17 +2164,6 @@ nr_rrc_ue_establish_srb2( nr_derive_key_up_int(NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm, NR_UE_rrc_inst[ctxt_pP->module_id].kgnb, &kUPint); - MSC_LOG_TX_MESSAGE( - MSC_RRC_UE, - MSC_PDCP_UE, - NULL, - 0, - MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security %X)", - MSC_AS_TIME_ARGS(ctxt_pP), - ctxt_pP->rnti, - NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm | - (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4)); - // Refresh DRBs nr_rrc_pdcp_config_asn1_req(ctxt_pP, NULL, diff --git a/openair2/SIMULATION/NR_RRC/itti_sim.c b/openair2/SIMULATION/NR_RRC/itti_sim.c index 28de1ca3b8..a6ac444e45 100644 --- a/openair2/SIMULATION/NR_RRC/itti_sim.c +++ b/openair2/SIMULATION/NR_RRC/itti_sim.c @@ -36,8 +36,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include -#include "msc.h" - #include "common/ran_context.h" #include "common/config/config_userapi.h" @@ -572,9 +570,6 @@ int main( int argc, char **argv ) cpuf=get_cpu_freq_GHz(); itti_init(TASK_MAX, tasks_info); - // initialize mscgen log after ITTI - MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); - init_opt(); diff --git a/openair2/X2AP/x2ap_eNB_generate_messages.c b/openair2/X2AP/x2ap_eNB_generate_messages.c index 9724e0cc38..be5ab82740 100644 --- a/openair2/X2AP/x2ap_eNB_generate_messages.c +++ b/openair2/X2AP/x2ap_eNB_generate_messages.c @@ -40,7 +40,6 @@ #include "x2ap_eNB_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -260,8 +259,6 @@ int x2ap_eNB_generate_x2_setup_request( return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -486,8 +483,6 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN x2ap_eNB_data_p->state = X2AP_ENB_STATE_READY; - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/successfulOutcome assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -542,11 +537,6 @@ int x2ap_eNB_generate_x2_setup_failure(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, - MSC_X2AP_TARGET_ENB, NULL, 0, - "0 X2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", - assoc_id, cause_type, cause_value); - x2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); return ret; @@ -732,8 +722,6 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -846,8 +834,6 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p, return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -908,8 +894,6 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2 return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -992,8 +976,6 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_ return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -1090,8 +1072,6 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2 return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2SeNBAdditionRequest/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1); return ret; @@ -1367,8 +1347,6 @@ MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -1578,8 +1556,6 @@ int x2ap_eNB_generate_ENDC_x2_setup_response( return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -1737,8 +1713,6 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request( # if 0 // TODO: Sanitizer complains we are trying to access this after free. free(ie->value.choice.MeNBtoSgNBContainer.buf); #endif - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; @@ -1844,8 +1818,6 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in return -1; } - MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id); - x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0); return ret; diff --git a/openair2/X2AP/x2ap_eNB_handler.c b/openair2/X2AP/x2ap_eNB_handler.c index f71229f066..f70cd632aa 100644 --- a/openair2/X2AP/x2ap_eNB_handler.c +++ b/openair2/X2AP/x2ap_eNB_handler.c @@ -41,7 +41,6 @@ #include "x2ap_eNB_management_procedures.h" #include "x2ap_eNB_generate_messages.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" #include "X2AP_FreqBandNrItem.h" diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c index 6f5ef004b5..290a5a4aa8 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ b/openair3/GTPV1-U/gtpv1u_eNB.c @@ -33,7 +33,6 @@ #include "assertions.h" #include "intertask_interface.h" -#include "msc.h" #include "gtpv1u.h" #include "NwGtpv1u.h" @@ -51,7 +50,6 @@ #include "gtpv1u_eNB_defs.h" #include "gtpv1u_eNB_task.h" #include "rrc_eNB_GTPV1U.h" -#include #undef GTP_DUMP_SOCKET @@ -146,11 +144,6 @@ static int gtpv1u_eNB_send_init_udp(const Gtpv1uS1Req *req) { addr.s_addr = req->enb_ip_address_for_S1u_S12_S4_up; UDP_INIT(message_p).address = inet_ntoa(addr); LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port); - MSC_LOG_EVENT( - MSC_GTPU_ENB, - "0 UDP bind %s:%u", - UDP_INIT(message_p).address, - UDP_INIT(message_p).port); return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); } @@ -266,14 +259,6 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( #endif //#warning "LG eps bearer mapping to DRB id to do (offset -4)" PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_PDCP_ENB, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - 0,0, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - buffer_len); ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id], ctxt.rnti); if((ue_context_p != NULL) && @@ -736,14 +721,6 @@ gtpv1u_create_x2u_tunnel( hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; int i; ebi_t eps_bearer_id = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_X2U_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u ebid %u enb-x2u teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->eps_bearer_id[0], - create_tunnel_req_pP->tenb_X2u_teid[0]); create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; create_tunnel_resp_pP->status = 0; create_tunnel_resp_pP->num_tunnels = 0; @@ -795,13 +772,6 @@ gtpv1u_create_x2u_tunnel( } } - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - x2u_teid); LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", create_tunnel_req_pP->rnti, create_tunnel_resp_pP->status); @@ -885,14 +855,6 @@ gtpv1u_create_s1u_tunnel( int addrs_length_in_bytes= 0; int loop_counter = 0; int ret = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u ebid %u sgw-s1u teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->eps_bearer_id[0], - create_tunnel_req_pP->sgw_S1u_teid[0]); create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; create_tunnel_resp_pP->status = 0; create_tunnel_resp_pP->num_tunnels = 0; @@ -1005,13 +967,6 @@ gtpv1u_create_s1u_tunnel( } } - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - s1u_teid); LOG_D(GTPU, "Tx GTPV1U_ENB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", create_tunnel_req_pP->rnti, create_tunnel_resp_pP->status); @@ -1175,13 +1130,6 @@ int gtpv1u_delete_s1u_tunnel( GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti, GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).enb_S1u_teid, GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).status); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_RRC_ENB, - NULL,0, - "0 GTPV1U_ENB_DELETE_TUNNEL_RESP rnti %x teid %x", - GTPV1U_ENB_DELETE_TUNNEL_RESP(message_p).rnti, - teid_eNB); if (req_pP->from_gnb) return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p); else @@ -1351,27 +1299,12 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,sgw_s1u_teid,data_req_p->length); (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ } else { rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,sgw_s1u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - sgw_s1u_teid, - data_req_p->length); } rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, @@ -1428,27 +1361,12 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ } else { rc = nwGtpv1uProcessUlpReq(RC.gtpv1u_data_g->gtpv1u_stack, &stack_req); if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - tenb_x2u_teid, - data_req_p->length); } rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, @@ -1506,8 +1424,6 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */ } else { pMsg = (NwGtpv1uMsgT *) stack_req.apiInfo.sendtoInfo.hMsg; @@ -1516,19 +1432,6 @@ void *gtpv1u_eNB_process_itti_msg(void *notUsed) { if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u", - enb_s1u_teid,tenb_x2u_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - enb_s1u_teid, - tenb_x2u_teid, - data_req_p->length); } rc = nwGtpv1uMsgDelete(RC.gtpv1u_data_g->gtpv1u_stack, @@ -1589,7 +1492,6 @@ void *gtpv1u_eNB_task(void *args) { rc = gtpv1u_eNB_init(); AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); while(1) { (void) gtpv1u_eNB_process_itti_msg (NULL); diff --git a/openair3/GTPV1-U/gtpv1u_gNB.c b/openair3/GTPV1-U/gtpv1u_gNB.c index ff7c8c0604..7be922f4c2 100644 --- a/openair3/GTPV1-U/gtpv1u_gNB.c +++ b/openair3/GTPV1-U/gtpv1u_gNB.c @@ -30,7 +30,6 @@ #include "mme_config.h" #include "intertask_interface.h" -#include "msc.h" #include "gtpv1u.h" #include "NwGtpv1u.h" @@ -170,14 +169,6 @@ NwGtpv1uRcT gtpv1u_gNB_process_stack_req( #endif //warning "LG eps bearer mapping to DRB id to do (offset -4)" PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_ENB, - MSC_PDCP_ENB, - NULL,0, - MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - 0,0, - (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - buffer_len); result = pdcp_data_req( &ctxt, @@ -300,7 +291,6 @@ void *gtpv1u_gNB_task(void *args) { rc = gtpv1u_gNB_init(); AssertFatal(rc == 0, "gtpv1u_eNB_init Failed"); itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); while(1) { (void) gtpv1u_eNB_process_itti_msg (NULL); @@ -366,14 +356,6 @@ NwGtpv1uRcT nr_gtpv1u_gNB_process_stack_req( // #endif //warning "LG eps bearer mapping to DRB id to do (offset -4)" PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->gnb_id, GNB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->gnb_id); - // MSC_LOG_TX_MESSAGE( - // MSC_GTPU_ENB, - // MSC_PDCP_ENB, - // NULL,0, - // MSC_AS_TIME_FMT" DATA-REQ rb %u size %u", - // 0,0, - // (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, - // buffer_len); result = pdcp_data_req( &ctxt, @@ -515,14 +497,6 @@ gtpv1u_create_ngu_tunnel( int addrs_length_in_bytes= 0; int loop_counter = 0; int ret = 0; - MSC_LOG_RX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - MSC_AS_TIME_FMT" CREATE_TUNNEL_REQ RNTI %"PRIx16" inst %u ntuns %u psid %u upf-ngu teid %u", - 0,0,create_tunnel_req_pP->rnti, instanceP, - create_tunnel_req_pP->num_tunnels, create_tunnel_req_pP->pdusession_id[0], - create_tunnel_req_pP->outgoing_teid[0]); create_tunnel_resp_pP->rnti = create_tunnel_req_pP->rnti; create_tunnel_resp_pP->status = 0; create_tunnel_resp_pP->num_tunnels = 0; @@ -634,13 +608,6 @@ gtpv1u_create_ngu_tunnel( } } - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - "0 GTPV1U_GNB_CREATE_TUNNEL_RESP rnti %x teid %x", - create_tunnel_resp_pP->rnti, - ngu_teid); LOG_D(GTPU, "Tx GTPV1U_GNB_CREATE_TUNNEL_RESP ue rnti %x status %d\n", create_tunnel_req_pP->rnti, create_tunnel_resp_pP->status); @@ -805,13 +772,6 @@ int gtpv1u_delete_ngu_tunnel( GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti, GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).gnb_NGu_teid, GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status); - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_RRC_GNB, - NULL,0, - "0 GTPV1U_GNB_DELETE_TUNNEL_RESP rnti %x teid %x", - GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti, - teid_gNB); return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p); } @@ -830,11 +790,6 @@ static int gtpv1u_gNB_send_init_udp(const Gtpv1uNGReq *req) { addr.s_addr = req->gnb_ip_address_for_NGu_up; UDP_INIT(message_p).address = inet_ntoa(addr); LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port); - MSC_LOG_EVENT( - MSC_GTPU_ENB, - "0 UDP bind %s:%u", - UDP_INIT(message_p).address, - UDP_INIT(message_p).port); return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p); } @@ -883,27 +838,12 @@ static int gtpv1u_gnb_tunnel_data_req(gtpv1u_gnb_tunnel_data_req_t *gnb_tunnel_d if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_GNB,"0 Failed send G-PDU ltid %u rtid %u size %u", - gnb_ngu_teid,outgoing_teid,data_req_p->length); (void)gnb_ngu_teid; /* avoid gcc warning "set but not used" */ } else { rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req); if (rc != NW_GTPV1U_OK) { LOG_E(GTPU, "nwGtpv1uProcessUlpReq failed: 0x%x\n", rc); - MSC_LOG_EVENT(MSC_GTPU_GNB,"0 Failed send G-PDU ltid %u rtid %u size %u", - gnb_ngu_teid,outgoing_teid,data_req_p->length); - } else { - MSC_LOG_TX_MESSAGE( - MSC_GTPU_GNB, - MSC_GTPU_SGW, - NULL, - 0, - MSC_AS_TIME_FMT" G-PDU ltid %u rtid %u size %u", - 0,0, - gnb_ngu_teid, - outgoing_teid, - data_req_p->length); } rc = nwGtpv1uMsgDelete(RC.nr_gtpv1u_data_g->gtpv1u_stack, @@ -1002,7 +942,6 @@ void *nr_gtpv1u_gNB_task(void *args) { rc = nr_gtpv1u_gNB_init(); AssertFatal(rc == 0, "gtpv1u_gNB_init Failed"); itti_mark_task_ready(TASK_GTPV1_U); - MSC_START_USE(); while(1) { (void) gtpv1u_gNB_process_itti_msg (NULL); diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c index 0d962cad7d..53bb9127df 100644 --- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c +++ b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c @@ -47,7 +47,6 @@ #include "assertions.h" #include "intertask_interface.h" -#include "msc.h" #include "gtpv1u.h" #if defined(ENB_MODE) @@ -563,26 +562,10 @@ nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz, GTPU_DEBUG("Received T-PDU over tunnel end-point '%x' of size %u (%u) (decapsulated %u)from "NW_IPV4_ADDR"\n", ntohl(msgHdr->teid), gpduLen, pMsg->msgLen, pMsg->msgBufLen, NW_IPV4_ADDR_FORMAT((peerIp))); #endif - MSC_LOG_RX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - " G-PDU ltid %u size %u", - tunnelEndPointKey.teid, - gpduLen); rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg); } } else { - MSC_LOG_RX_DISCARDED_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - " G-PDU ltid %u size %u", - tunnelEndPointKey.teid, - gpduLen); GTPU_DEBUG("Received T-PDU over non-existent tunnel end-point '%x' from "NW_IPV4_ADDR"\n", ntohl(msgHdr->teid), NW_IPV4_ADDR_FORMAT((peerIp))); } @@ -614,13 +597,6 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, seqNum = ntohs(*(uint16_t *) (msgBuf + (((*msgBuf) & 0x02) ? 8 : 4))); - MSC_LOG_RX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" ECHO-REQ seq %u size %u", - 0,0,seqNum, msgBufLen); /* Send Echo Response */ rc = nwGtpv1uMsgNew( (NwGtpv1uStackHandleT)thiz, @@ -661,13 +637,6 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, peerPort, seqNum); #endif - MSC_LOG_TX_MESSAGE( - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, - (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, - NULL, - 0, - MSC_AS_TIME_FMT" ECHO-RSP seq %u", - 0,0,seqNum); rc = nwGtpv1uCreateAndSendMsg( thiz, peerIp, diff --git a/openair3/M3AP/m3ap_MCE_generate_messsages.c b/openair3/M3AP/m3ap_MCE_generate_messsages.c index 8d8c7f3853..4822a09db9 100644 --- a/openair3/M3AP/m3ap_MCE_generate_messsages.c +++ b/openair3/M3AP/m3ap_MCE_generate_messsages.c @@ -39,7 +39,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -169,14 +168,6 @@ int m2ap_eNB_generate_m2_setup_request( LOG_W(M2AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M2AP_eNB, - // MSC_M2AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m2ap_eNB_data_p->ENBname); m2ap_eNB_itti_send_sctp_data_req(instance_p, m2ap_eNB_data_p->assoc_id, buffer, len, 0); @@ -315,8 +306,6 @@ int m2ap_eNB_generate_m2_setup_request( // // m2ap_eNB_data_p->state = M2AP_ENB_STATE_READY; // -// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 0); // // return ret; @@ -371,11 +360,6 @@ int m2ap_eNB_generate_m2_setup_request( // return -1; // } // -// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, -// // MSC_M2AP_TARGET_ENB, NULL, 0, -// // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", -// // assoc_id, cause_type, cause_value); -// // m2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); // // return ret; @@ -561,8 +545,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -654,8 +636,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -716,8 +696,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -800,8 +778,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id); -// // m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1); // // return ret; diff --git a/openair3/M3AP/m3ap_MCE_handler.c b/openair3/M3AP/m3ap_MCE_handler.c index 21d10d1b04..3da0c00145 100644 --- a/openair3/M3AP/m3ap_MCE_handler.c +++ b/openair3/M3AP/m3ap_MCE_handler.c @@ -44,7 +44,6 @@ //#include "m3ap_MME_interface_management.h" #include "m3ap_MCE_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair3/M3AP/m3ap_MCE_interface_management.c b/openair3/M3AP/m3ap_MCE_interface_management.c index fb54579258..ef26312245 100644 --- a/openair3/M3AP/m3ap_MCE_interface_management.c +++ b/openair3/M3AP/m3ap_MCE_interface_management.c @@ -44,7 +44,6 @@ #include "m3ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -149,15 +148,7 @@ int MCE_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m3ap_session_start // // // LOG_W(M3AP,"pdu.present %d\n",pdu.present); -// // MSC_LOG_TX_MESSAGE( -// // MSC_M3AP_MCE, -// // MSC_M3AP_MCE, -// // (const char *)buffer, -// // len, -// // MSC_AS_TIME_FMT" M3_SETUP_REQUEST initiatingMessage MCEname %s", -// // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// // m3ap_MCE_data_p->MCEname); -// + m3ap_MCE_itti_send_sctp_data_req(instance, m3ap_mce_data_g->assoc_id, buffer, len, 0); return 0; } @@ -318,14 +309,6 @@ int MCE_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m3ap_session_start_ LOG_D(M3AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M3AP_MCE, - // MSC_M3AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M3_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m3ap_MCE_data_p->MCEname); m3ap_MCE_itti_send_sctp_data_req(instance, m3ap_mce_data_g->assoc_id, buffer, len, 0); return 0; @@ -425,14 +408,6 @@ int MCE_send_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, m3ap_mbms_session LOG_D(M3AP,"pdu.present %d\n",pdu.present); - // MSC_LOG_TX_MESSAGE( - // MSC_M3AP_MCE, - // MSC_M3AP_MCE, - // (const char *)buffer, - // len, - // MSC_AS_TIME_FMT" M3_SETUP_REQUEST initiatingMessage MCEname %s", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // m3ap_MCE_data_p->MCEname); m3ap_MCE_itti_send_sctp_data_req(instance, m3ap_mce_data_g->assoc_id, buffer, len, 0); return 0; @@ -646,14 +621,6 @@ int MCE_send_M3_SETUP_REQUEST(m3ap_MCE_instance_t *instance_p, m3ap_MCE_data_t * // // // LOG_W(M3AP,"pdu.present %d\n",pdu.present); -// // MSC_LOG_TX_MESSAGE( -// // MSC_M3AP_MCE, -// // MSC_M3AP_MCE, -// // (const char *)buffer, -// // len, -// // MSC_AS_TIME_FMT" M3_SETUP_REQUEST initiatingMessage MCEname %s", -// // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -// // m3ap_MCE_data_p->MCEname); // // //// buffer = &bytes[0]; @@ -725,15 +692,6 @@ int MCE_handle_M3_SETUP_RESPONSE(instance_t instance, //for (int i=0;i 0, "System Information %d is missing",i); - //MSC_LOG_RX_MESSAGE( - // MSC_M3AP_MCE, - // MSC_M3AP_CU, - // 0, - // 0, - // MSC_AS_TIME_FMT" MCE_handle_M3_SETUP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); - //LOG_D(M3AP, "Sending M3AP_SETUP_RESP ITTI message to MCE_APP with assoc_id (%d->%d)\n", // assoc_id,MCE_MOMCELE_ID_TO_INSTANCE(assoc_id)); itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p); diff --git a/openair3/M3AP/m3ap_MME_generate_messages.c b/openair3/M3AP/m3ap_MME_generate_messages.c index a28097cf1a..969863b445 100644 --- a/openair3/M3AP/m3ap_MME_generate_messages.c +++ b/openair3/M3AP/m3ap_MME_generate_messages.c @@ -39,7 +39,6 @@ #include "m2ap_itti_messaging.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -174,8 +173,6 @@ int m2ap_MCE_generate_m2_setup_request( return -1; } - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); - m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0); return ret; @@ -311,8 +308,6 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC m2ap_MCE_data_p->state = M2AP_MCE_STATE_READY; - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id); - m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0); return ret; @@ -367,11 +362,6 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance, return -1; } - //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, - // MSC_M2AP_TARGET_MCE, NULL, 0, - // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u", - // assoc_id, cause_type, cause_value); - m2ap_MCE_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0); return ret; @@ -557,8 +547,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -650,8 +638,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -712,8 +698,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; @@ -796,8 +780,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p, // return -1; // } // -// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id); -// // m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1); // // return ret; diff --git a/openair3/M3AP/m3ap_MME_handler.c b/openair3/M3AP/m3ap_MME_handler.c index 688e3937e1..eaba0e8ef1 100644 --- a/openair3/M3AP/m3ap_MME_handler.c +++ b/openair3/M3AP/m3ap_MME_handler.c @@ -43,7 +43,6 @@ #include "m3ap_MME_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair3/M3AP/m3ap_MME_interface_management.c b/openair3/M3AP/m3ap_MME_interface_management.c index ccdfa4fc5e..fd50e80618 100644 --- a/openair3/M3AP/m3ap_MME_interface_management.c +++ b/openair3/M3AP/m3ap_MME_interface_management.c @@ -296,16 +296,6 @@ int MME_handle_MBMS_SESSION_START_RESPONSE(instance_t instance, //AssertFatal(MME_MBMS_M3AP_ID!=-1,"MME_MBMS_M3AP_ID was not sent\n"); //AssertFatal(MCE_MBMS_M3AP_ID!=-1,"MCE_MBMS_M3AP_ID was not sent\n"); ////M3AP_SESSION_START_RESP(msg_p). -//// MSC_LOG_RX_MESSAGE( -//// MSC_M3AP_MME, -//// MSC_M3AP_MCE, - // //return 0; -//// 0, -//// 0, -//// MSC_AS_TIME_FMT" MME_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d", -//// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -//// assoc_id); -//// // LOG_W(M3AP, "Sending M3AP_SESSION_START_RESP ITTI message to MCE_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); itti_send_msg_to_task(TASK_MME_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_g); @@ -434,14 +424,6 @@ int MME_handle_MBMS_SESSION_STOP_RESPONSE(instance_t instance, //AssertFatal(MME_MBMS_M3AP_ID!=-1,"MME_MBMS_M3AP_ID was not sent\n"); //AssertFatal(MCE_MBMS_M3AP_ID!=-1,"MCE_MBMS_M3AP_ID was not sent\n"); // M3AP_SESSION_STOP_RESP(msg_p). - // MSC_LOG_RX_MESSAGE( - // MSC_M3AP_MME, - // MSC_M3AP_MCE, - // 0, - // 0, - // MSC_AS_TIME_FMT" MME_handle_M2_SESSION_STOP_RESPONSE successfulOutcome assoc_id %d", - // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - // assoc_id); // LOG_D(M3AP, "Sending M3AP_SESSION_START_RESP ITTI message to MCE_APP with assoc_id (%d->%d)\n", // assoc_id,MCE_MODULE_ID_TO_INSTANCE(assoc_id)); @@ -628,15 +610,6 @@ int MME_handle_M3_SETUP_REQUEST(instance_t instance, *m3ap_mme_data_from_mce = M3AP_SETUP_REQ(message_p); //printf("m3ap_mme_data_from_mce->assoc_id %d %d\n",m3ap_mme_data_from_mce->assoc_id,assoc_id); // -//// MSC_LOG_TX_MESSAGE( -//// MSC_M3AP_MME, -//// MSC_RRC_MCE, -//// 0, -//// 0, -//// MSC_AS_TIME_FMT" MME_handle_M3_SETUP_REQUEST", -//// 0,0//MSC_AS_TIME_ARGS(ctxt_pP), -//// ); -//// itti_send_msg_to_task(TASK_MME_APP, ENB_MODULE_ID_TO_INSTANCE(instance), message_p); // if (num_mbms_available > 0) { // itti_send_msg_to_task(TASK_MME_APP, MCE_MODULE_ID_TO_INSTANCE(instance), message_p); @@ -1086,16 +1059,6 @@ int MME_handle_MBMS_SESSION_UPDATE_RESPONSE(instance_t instance, //AssertFatal(MME_MBMS_M3AP_ID!=-1,"MME_MBMS_M3AP_ID was not sent\n"); //AssertFatal(MCE_MBMS_M3AP_ID!=-1,"MCE_MBMS_M3AP_ID was not sent\n"); ////M3AP_SESSION_START_RESP(msg_p). -//// MSC_LOG_RX_MESSAGE( -//// MSC_M3AP_MME, -//// MSC_M3AP_MCE, - // //return 0; -//// 0, -//// 0, -//// MSC_AS_TIME_FMT" MME_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d", -//// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), -//// assoc_id); -//// // LOG_W(M3AP, "Sending M3AP_SESSION_START_RESP ITTI message to MCE_APP with assoc_id (%d->%d)\n", // assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id)); itti_send_msg_to_task(TASK_MME_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_g); diff --git a/openair3/M3AP/m3ap_handler.c b/openair3/M3AP/m3ap_handler.c index 832aa0dbac..583552528b 100644 --- a/openair3/M3AP/m3ap_handler.c +++ b/openair3/M3AP/m3ap_handler.c @@ -44,7 +44,6 @@ #include "m3ap_MME_interface_management.h" #include "m3ap_MCE_interface_management.h" -#include "msc.h" #include "assertions.h" #include "conversions.h" diff --git a/openair3/NAS/COMMON/UTIL/nas_timer.c b/openair3/NAS/COMMON/UTIL/nas_timer.c index 9ccca12520..8448d9a78c 100644 --- a/openair3/NAS/COMMON/UTIL/nas_timer.c +++ b/openair3/NAS/COMMON/UTIL/nas_timer.c @@ -46,7 +46,6 @@ Description Timer utilities #include "intertask_interface.h" #include "nas_timer.h" #include "commonDef.h" -#include "msc.h" /****************************************************************************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/ diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 2628c5b0b2..8c8c88beb9 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -812,7 +812,6 @@ void *nas_nrue_task(void *args_p) ue_security_key=(ue_sa_security_key_t **)calloc(1,sizeof(ue_sa_security_key_t*)*NB_UE_INST); itti_mark_task_ready (TASK_NAS_NRUE); - MSC_START_USE(); while(1) { // Wait for a message or an event diff --git a/openair3/NAS/TEST/MSC/ActivatePDN.png b/openair3/NAS/TEST/MSC/ActivatePDN.png deleted file mode 100644 index 7bdfb63d699e306fd53e495fc0b4cc7d13cd98e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9430 zcmch7cT`i`x9&!dat??bML?0FVxyzdtBQaaLZp{aL;i}BzK2%?{D1u-uvg>SMtXmYh>&-_g-tx_04a7b3eIlV#voM z!UF&RpV7@5W&ps=0>{I@?*p%=RuOsN6)?JS%_1DVKruz-77YO7Q)O3j>s@Xo7kU~a zK2Nb=#RZ2pe?n#pEGLByZC=P zXurD1h+5xd)vTHA2M!-Y5SYKXV`*Pm1dOlgZ?OS8L81Fvzvg>rXdVE@uQHg3jQrV_ zHPW&n){PqozJmNEjNkl~5b&DL4*==P!i-!eCT3@qAFw_;I`1^R?|FL(@;Jr*z_Jq; zaQtI5f2*M`aOma{;B(G8f9{$yKQM?_8X6P53e;w=w`&joBuRXB{wM(ewH4Il;D(kZ zZUC^(TL*3LH(lfgVvpD?b00ivvY3fw#kH`RqY{9<;|6;_(0b|^*B#LT#&4WWiG_R^ z2WNmk`=@=n|GmL;T1*QjYag&|rnAd+M@eVb+2$5|&y>H^e;zc({el-vV~5)H(zvY_ zPkj0zQr8Gq35V`uy1Fd-U5q-DWIje1cqZKdn?{v0o1OVUpV2_)`8P9nb)e?!O0usF zVCEzxZOJbFih$wAb!n=2effmQjdu{kIrCwOsWkOLo2JjG!%|}sgvBdi?7HdF&s^Xd zuYr#DukeO$ppF^W48YQVmWYQGzjnp!`d({K->*_FKH7KlLYg6bCegGfF1G?YC~7%W zorkX|L?sVr5a*Op+L=_HUPMX;BHMxu8Vvt{>@fj=(N6m&2kFVtz_cIprg6V_m%2}4 z`Lj>-ut! z4gmh<+uX5_f~C$eiVO|cro#;2Y55ddJYhgVwDq;sk}!Cf(%nmufC;`TpWU}T4{!I? zE_ZR=;j<1W&IH|fnTCKd3b&44RSBPH&G7PeT*j6Y&AyYpx|(=QR(zMhXlRvrL+5YZ zdS~>Lie8!d6hz=Q$Q!-yq6F2+QgceRR8NS{6c|FMZx|;NtZLG?Eyt`*lOyz5iY6Jb ziEEMlrQywlulF$dNXgR;u+38qFcrNJq{+Q)(DI?qrFV+*t*nDZA&%|Ojd9rooGg7GnU4joSgm@lLOn_ToNU@(-R;8gbu;1)I}9Y6x($jI)vC;4P8i~)W6erE%; z-H65tieI|oQ2-G!g<&p@VUx>A;G3{mI-0xyF#a1D`1ZHdDr4j)btDYwwAn}ZAvxoj zrAG!|XC6KYEoMWyeF*9lY>seooh2bDIuujcV~xvhi;65;4hj_l*P<@FxxY0}OQw;e z6qh$z(9eqAsj`#dfAn}eUrY|0>SpuZOs%L?n7ZNKiiIMan!W}sZe6a%6j!u?n|EhG z7ifPY^M&$k6Jp+LU309jpfDhT%qCc{01PHc67jC!YSvZT*rg}8 zH(BkgtP|j@tBGuM)*i?J-%|g($h9~Be*nJLw;;yvlIACJ?z0zA* zaYlDqyu0N2EH`9)KIG6RBUAV+1?tY{%?k=T5J!%7C*IpgGyA<6`6H?JHrJ-w9`s4p zk1c@?gyo9mdq@laiS>vycrBsjq7(OtM82)u=G}R6gGrbJT)VCc)PmaDu*u2xJ$Lm!WGObziM5FgG4Tw!`axV2RyCZb#&5#F$YRdQN8+o8|g~UxfG>h~@j;X(HG5AwC zCF^PPu$5j*8#dEUw?;T6_yw<+LZ-kX>*-BNg+y4+wo@wkWHX9O?b)7d5W#2(iq%Ks zWY1zL!-U6`oxHtmMT>npODZ~R8ySDM4I}hu^ev^osh39(#D#Z+FUnEkE9dr?b=PRe z%7W1e0QFQyvC%?^X|1)Zdd61sm0??*Dq)BWJNm`_D%~n!(R=jKvx=v@I0^m`Hqb2~ zD5WaqH2wPH_|VExe~}Osj6iCMw}yjbp}IxWuXR^kLBvN)9->Y6Lj#>)9A@M23Yon6 zP&en%(ed1-kti{L`AQau&jzm?=CskO!}uF4QLT~Nr&E8mMz|<_)XEBUOr4#(zMK|7 zP*+%ZBc4`ju0SttF8$)!Qn6KnXZ>{i@scF04P{qcuZJPNUu@4i1;@?)TKwb_5gj^O zNN7f#cxukyr9=1fZH>V&^{s)oi7=#2oL5@S^v@|iIf}ezb26{}BM^DOU(v;!)oUf} z{f{a+xOnJ>U@UCH?!b3ql+<%$sssQWyxS}d*c<0Gv%|GwVqzTM99q`-4`Kzzg`&S^MT9AXxgVurI8t^KMX* z&lB=v%5day~!?vH8{dPW<|1O8YjYq@1Z0O+n8M^gK>ltTa z;61&jM0CURwVk{N<&A=tYoxE^IZDF=`R!LuPFEJvv-+a@?x~1bij$#Ia{4C9$uOMt z;1I6er=njJ)f{Lwy?LHp@6$SVuHc;4<|RW~cFho45Y`923nr(%XF z{xkJwi7Cb6%vkWp_mgPtP?|$AVZduWQkg7z88@1G7_wWCy&B4M+lX@vHWfR_ws@i5 zq|W!Nom_^p?xv~6r~CVoD+EF+qg1*u4hwepo@^nOG#sZzk2^6ilrC3uG)us@ z_y93LWdVtrsUv4DUTmBwFtFCQDH@HWhZ^NabqzKar*~ijEmZSFs##JBO5>OJV#m7J z_LbzzvO!aukGWbax;wo=0cjcM6y8H;a`2I?IRF# zY0;Mp`fwUVa3|yAn`AlrH_H5dxrAMU+sp1!(Yo%w0`R2l;$FpjNv4S{6ZZ4w_$r(r zt290Bgd56QvPBvfPLj28S$Iv2w3K#4|Lz0xaN2`_Eh0DYeCCnPF2BR=pQZClR2qzy zBbObO7V5X_O8H~yr~{oI_%n}nBzOCWQA|C**c3nXE zsT2Swjf?KpN?R*y*J@p38iT_(gER6ox-_+W`&?WX zf{NRB7q23+Ad%+9yWsXHol%$~EcTM^GHC9O+H@qM7U6Ybg=JXx>7eOU`ID{uw#E@p^!j)2p3FX( zDsiE=B*z=@wnYo^G@tsJ0z#QwbsDrfx_=xu zb`T^~ImGijBx<>+|0uY&f;sQ)ij63lF-G-RJ6m`~21LTR!X?}|`LPCr z!ARy;ui9!1?DD2y1c~u=vyc?8qZet__hU40J64y{G)3R!AtDoPpx7Bas=4s?2{{c< zouxDn?>?G*+d{eR8c9MqD%4Lb_7Yeh0DvBoF@|I_$Jp6f2WF$DHBQG(502ePHw(l? z23y39o$#^D2*sV0#_d#cr}s}A2m_OfG%#E~(`kbWA?!`Tnde zn`$~Vw_(;YHzNIB1NTMZv(cKA*3D#|HKQm~lk-faxxnpBA$t?&AZ4dco8cUP3p{pc z&^jYJIQ)?}jO#cF4yynT(`QH}KgJ+8`fwwc*! zs|6z=w$}#SErZE0ch~s`*(=EXpwSj)dpRexVsmWSV1Si%AaswXYq9}F5e#eZqA0sZd%)N; z;~*U8X#W2m{F;nuNl3<2=sIX+at&_~4tqS% z)9sAE3!gjfad5J@!n~8Ub z3w$cDppJ2s-xQ9sqNW=5MRO{o&@MU`u&8MF1=~2dl{6aLd&E0pf!GS+S|>9pI~u9{_!O z86<#Rimq5k-ud?dN$~aaPlv1u7U<;1zg`fwsB5NiLZlPxK9PyU{QHox@cRP+t~rjM z5UL!hjFS$=71%8166Y*eR>nf8X2%vSZIj%Zm!5~B_!mC)5p==(zGd06TiHxHExlfs zug}%8qG3THEarBK>T0}Kwfma-rLTm1(sWve9vRXSc2w?{uI}OVf?LA776H#icE^!ZlOt`Y=*U$%{pE0Tl>E0xT{M z#=LnPpxtQ%p3O#Gp!HMjo8N%ke-{}Jb%W;;{P}AyGC$Ui`b-Cao4CW40OIcs=pO2{ zV=Gqu$Dw4a1F_EnCP9k_CpZZaJhF-+Yb@X&xocoMp%;NbKuPPnyG_)B`#s~k$-g{8 zT|{!0)t;s%qG#|KL^Jg2WYwqAt@ou0iO%pAf=jIw=K4Meyh76IJ}vwCT%S&NZtn}{ zjRL~y`f2%>WX!pn3h89Hr@?+wmI*kJA0M2Cs90(Z;+}j z7aHvUh#TzT7EC8Sjp%(Xp49OeQGWOe1D~ zy5ZN$v4C|_bX5?XzlnW(L$1;wq&_Ky;dL=I0p^D!_L|hlYV)~osw5kQeqI?E7%{np zqbYV{%i){rR@$p^h~Xqce!7mM*!RGxy0cBg+c|ya=0RUw!#d;T=B_5yl;{HjPRv*o&sMbKd7>Qoi!EZRdh6etu|LqxfBy#eat{|SZ=sNV>NA3z{e<= zkWI2o!(Q&bFtSowYF!i|XPEmzBQ`E^s64KWF0wqok;iyk8X#ha^8oduw=c(J?%4aJ z#TD3GkrVbIE%c(8m~+?i?;P|x4$|}Uv%ze#u@$rW81{T|AiVgA&w};vvw~9S)~l$L z?hDWZoAKdp@Le{-uzFAzRt^c&go_ zZonVShrFhg`d0^cT^L#SO0uh$P|+=TKE%+s8~fP@tE5ohZ8a{P7?s=2)s?$*3@Ak3%xVPo9^ZgW}|ranIVeq}`7$419~+l2xc~Hfoo{-0VJXfbi4oOv|kg zzB4jyA)roi_k#1`rpu|@+)aXedV_^i z(igHua~-$PBRE>(91XXj2iIbJib||WQXSO#(sQ`j{_MZf_ygjGFZ&TyO|TwLCDjx1v$mG`2$z}L6E=!n*aBDB>R^&7|f>fbGsh(K^KQ@T42zi zv?qDas`~OvC_cy3)|jE!%#*iZ-8pmcpY1S8q{b&xi#LeXU8LsN6;3kP|r#ynGUQge&yvE9Wb@aLZ9ja$3!;22r$vJDcSdPj7Qti#L;k0JfDC({s}U@0 zAA&eL4f;LS`Y$(s81e^8-o&SL#Ek*7_VY8=7_`UT_N#4+Qo%^REa6b^?sTByBQJNp zwOhRsyKx-mjL9okhL{!-17CzirGkXR@heEX9q)ypBH?^WMI-XnCl~+RJ@=iE>x;xm z3mDwI&@;H6r*(?{FOkf5Pb9luwDxqz8LfnAd$e8vUx`jj{i*|H8(a^?EME)7c*oDN zM7!6)(|8=^q~>gY%cT5CdKc|P(EZz+%oC~#GQja<7|4V<(%ASmsEUE*2iU?o1Qi5S zR$fMEyBrpaxW)yvs=Z=4-)~;$287KEmUP9F!J^0dJa{wulc$rSJZ+b&l`fmcLb6%A zbo%tagl4c?QkEZ~|11gO{9}pXUZv>f3@IqBYdV4Z^dogNKi<**&gq_Oh{r)7`-YL$ z>GY7$GvKb$z*ZZ;!VcQMzHisP=3(KKgl`;CLRT&7x^L>F#@D|;LSH|zhS>gHQ(HWF zX=$ml67;+YM=#HNe1$f9d2ubkq9sP>FZ?l{<{^=Q#5!tuZ`F27|Brk$2_X{sAp@Q_ z|HYl5PK&0`Ni||;d34>~K?k7QAA;f@p|VXAYHl-^cx!>!0V}RvRlHf?H{2Vj;SnDv z7neI6nc|B)7(Lw2AZLosW-FL8>!f9Nz~_Tlr--h5_@n8s79~MM2;_8PhDeyrF3vb4 zHAr|zeKDF`wfS)7t-_$(Kdq)a#-xpN6fdC{9>0$adNy=-3T4sWu34&Wm>Yl@9H;;* zhT4+6eT$6@}gGkZ5_3&LiS_l2i$)fXt&|58yf01LGGM|L;h{-{`&doc2O1YkV1-SB{_ zL|N$Jtl>nkbm!9mYo)|ZSq7%#s>rd$U^7<2wY18YO ze`0>=MSZARC2~J8VCqF(6XtWu+b2)t6ytz!y8PLf6dx}xr3PeuOk}+tLcrm$anpp- zoVU(}^R`35^^Imh1(ChfPWf(Kh0V$;;(EsdtU5U43A@~oT5~l?({}m*@;djqR_=(J zFqLupe|+IoRU2L36F&0yY{9;Ue&1R>Je{1|me~8-S}-93>SQJS5ck}?C&GicUf`V- zS?EOf(YIozb-P!C4V<4Sbn`Ed?R3FD#9X_<3Hbw3IOeNF0kH-p9nB>R{n=izhn+$1 z9t>e)3i-Y-1+@(D097kg;%p#&6>pD5`%-7VMO%M8$K$fsT?MX6>RXPY=*T<%LOY-i z{-9vra-Dq>0FRh`oWdaktyjBD4#Yl_>SstKcYwl*Oe)uC0=fB){Qz@+Z13he_}zo8 z^ezaWOd72dyH_oN`?mjy^bLmYJM2)R$K$riizX_886%!LkN`q5NvLKf72m8B@3SkN zJdq#G^M|a@*Cd;q(x}Tt5auzn;fx8-F&Z2uP_RYy>>?nB&sgA_gY8aq|EFdw`YVWc z0Fb*^+*8;2_bGc@^7ZghoV9{k;a*S#yUQFB@9} zLNur-JT8BnQF>JT*w+17ym%!0()`I#lMwSZIIewB?})NS*o4rJ`qyl}CHeQT_OqG9 zaZzbPQ7QckRe{HGzOIcpWD6{{?Y+6T;-FCt>X?l6U0dxUIg?B>K0DX6va!qDrfK1_ zNK+R!#GHmJk(C%^Y(e%r$01lEAI&45ovCV}`tRgMOT&@Vw1=wq;v`OSI-)@9#UvTt zfg8TXF9wYF>y|mi;b$bsC0EQVqoKpk^6&(vDAroQXO>pmjM0?R5lhU%9V6{$Thsx^n=7q}cUUUd__c&dGcg-Sb_A97P zh43g|-jkIMTG|+Ey^_1H^4Gv$3QMV3#~t5X#XIo@cqR>lVX^gC)ee;;{o}dO6V%3Wx^{!k=t6+|El#-6pj_3gba##gNUmK1CRZh{?a9)kga$dg zJ{e39GlXoa-IL?@d^9A2yG-vmiqqr((BqU_rcJBrHBQ!IWPasv2A5hoM@<924k_%} q?{B%cC19faFJG*H^Zu9ru(>n;$|n4AA$o{&hmpR?jk4=^9{wA%N>}3m diff --git a/openair3/NAS/TEST/MSC/AuthenticationReject.png b/openair3/NAS/TEST/MSC/AuthenticationReject.png deleted file mode 100644 index de5d3ead9db8457be75a1d26a9eb8d73c3d0655b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21465 zcmce;c|2R|`aYbtyYpaoP_40Zi-uNFHFi=%l$zUwsA_14v1Wpfc4?@pm}wEJhLl81 z4azAchDuB^tBuAKN@57|KGD6;@0|1g{&~OW`+4(+&-x_Rv!3;==f3ajzV7Q@FK!v? z?A{@|0|J5U*3-Ri0)cE@gFrUSZ`%mIDL=l?5&}5_(Yt=d%r|MW58WBRs??1843)fWcu!Rk(^nGnO7csmW3;=jSy_ho1kKoguDX-2_QFv;1bERR}T`y(%BT{ zb6fGcx=IFPhG3n(2~rlXIWMadIA7y+nvDpk6+>sdo(Oljz`1r(zLDdZKePGw7s?wN)JjAAL;F3WlIy!;NHC|maTOp8U z%!;hWG@G{pQgugfbrYoOneGDkD-3>=J7Lv(5xTmQ&u0e&L)`qC16v^>;jexRnfO?F zdVN)r!gdF*9}JphtZfh+{eM0fDtm6*rS=3AAs(ntVg;^5RRI4z5q&CyyE2Wg0K6ygRC_o-2ABTx&9+#Cn2hR1~kR1$(cyQ>s zyLft*t%;I^PN;I1 z>~L7T2X5IbGS2SZIx3m$OQyJymaiW0p!vnDiVKVxg8 z)!aOLYCvr(qj3IxxMx%V%x3CIf@CNz_r1B)mmMrm6pehbYqeUi9Jt)&ts#e5j`K*m z*GTbm^C{Cj{jyTaM(E+GY$B7b*XZJXpu<07bYfz{a>7ew=oGtUc2~{J+#Jd000dIi z44%;4+C#qHI;K8|?)Z+cm8VW7ukC)~bphX@+MW8lZawdzfsKt#&AFAOIS2M-aK%2| z)lF_H1dUZ#K#9CFrQmzig=SpgHD7wC2t45?t*sdHK@pkV<*{lYwr1AwCc&C~bN}Rz zxw*NC2`Ba$FaUOuC~Xz{=Yg%3M)Sp4Y*=t^k;%yH5rh3i6@?xTtm`Ts&iW(Gn!}Ko z6Tuzp@lbtl!ba0r6?|spZ?{t0YoQ@BA_l|5AB(sOLFB^n`P#09g@x6iRHWC7ja3A} zUimp1I`MN>=u=9n`V5A^{>RGNDsOnWCg68Ser=YPRR@u}39Mbp^xWJ-I1iXkQVK7~ z&H8j#ojBxn1Dg+VleSo`LEYg9#f}b3K@2lJocKYN{FRkY3Wp$&yYkb#&t9c-z)tOm z!H^?=GNj}tD#3^$>0-}qzihcvW7Eo*3UEgC=%qH}>m^xfb|mOcl#Zj(g}A`r;K<>{ z+1Uc0BVh3-z)DuV^m4i{SyWv%Y=bDIM=Gfqt3^I(WsnUh*~hcKB90|(N!-K#dhJPP z$pCv;WqG0k?7u5q@XYz!A2tzQ^5@6ro0xbwjv8u2x=GlYb*}nVA*z~-aBT01|6tH$ zNOIq4pWSANy~W&Cqr!+|+z2GbhX+i~{CfPFg548L&OIy?-8xldkK;SOAnohFwmk9# zM~}KOa4yb2*R$+FhHW0J;xSp%tZN9^;78!|)(TJosj=B(6%#qb7Zczx%hk%uWn4a& zeQ_7O;vr;gv;q913osKmacIwA?;gsi#?60R?AVc-FKJkYXiZxU2kSqW3pU@Nl-j8X z#B$TLd#cN`0lFonW1RDo`6*aB1J9L3tiYzhle(PTrUh9^pLf78+DACvba-oOjWyJu z(1CB}O5PiM`($^7R^m0A14tEX+bnBJukP2>T}f z9D}r&!Eljir4wy@Di`n z*~xgKlPDBf#)>jI!BL1r+DE=|Y=;?c_;l(??>=wq;g{wz&x=Te2CodID5jUmsii_I{mldVJg))kTK88aKUbe)YzS<*HYam(omIB* z7KQ@dj1{)Sbt8d#9VOFbh|;%wGpPl}3Ro)gfk0k$I`u7_;Ke-VBCE#WQ&rf zG_W&Ym5liPYfV{3G z$(mn^$5aG-=}>IB%?XBiG~jY3v*0nF4~cOBD01pWdi!kK9ESmou1$Wt{9F(PCP2Vj z8E#3{N=;1-(Akj8X{fI_TTt$Po_7N7Q+X+W%^&CKGj?b*_}47kcC8sL;K6>bO}=;E zy+#*zf(N1Zt;FfgX#=O#U$RHRj+MG6LU}$_G8D0#fzof1>(1N`&P3LK2p;qoMr>TWvq^H*xr-py6q>f;N}HZS$7Av^GJeXj|nSN$bA#=*4G2FYDc)cV) zSusUF5@-C3w;9FXcxAqGFI~nsk`*hQ=9GIf2n_El$(MdM;h#Z}QCnGDft5uT!1XH^k^6B*ef5V_j?s6!tuv5#bdo_r^v?NU(kKF`O zIeZZW+QDPJ3r{A%Z(tZN5So=VSBDBGIYO2Tv$N+ThJlmpe{^g9yKn-vOzioPQdE{i zOoYMK(95w9i#PEauW@eL@!TV^<6WZ|)2ZXm=o7hJ9?qVn@aMs(NOji(62v8aT1!bI znAB~ZajB9%mtx+kX2kGn(16Mmt)Rg%CVXsB5kjX{4(4=)zAy zrDEbwozp0JZ;)MnEk3!18`T`vT~FyXu}?mKOZ8`l@%_l$SKK0(ZD4TqMB+-7*X~mJ z)n`2Z;*#5Mwy#}OkK4)-Ju~Qr*|&Z54E)-E=-RPa?Mh;{8k5Vqq(1YAH4 z>g>lkqhDmvwNI=3VIgGD5db&TYPT8$f`73uYO1I@OCop< zHeBD2`_Vp33v$5rzbxANO_uhF`Z?X&D<{S!=2@L(uVKKfZYM4cbu_pQp53+A@FZA$ zFXfdDzGBArhl^O?|k~D7RHUU zcCOsUD+XRnaeoH2JZ9tRSNu}Z`CZ%S+>P@+_Ovtf*xp@WWR)X)^CuIpbN!Ap9G8Ef z6E^n;89H3F*5ftQ?$-vJk9+Jar)c);oU#@=P~5`C`jmtv#UT40YLIZyr5^tCM}w8~ z7xP#g32Q~b_XOCy8-Zi#XZ%;IT9EOYH~YiqHbX3jK_sRnO6Ak)w0Ityr$=%x@E^M; zr|*<&R@(B{ug|q0lQpiX0hcBkEALv3{Q&MiME2FcAWAUP|G=34vu}Ja)SP=7DOE_s ze+ZQkcA#Z!9)Fkbl4WM^{SjK&Wbcq}X=9z>$jX@=q}!7^Tj&w`L(t@aq=+_BOvka>HaRUGDi@$d_VR6Xvp3D!Cy!Pv z@5+Cb{FK~?QL}ywZf!6Iz#Ly!BmH_M7fhiXLNpKM!g^0Ipmbo^6YBE26RdAbNMygf zXLlE8bH_I>#qe{R>t4bbR@)bCgNvV-qJ~aAjbENDeP1lq?wC~L<=>}0i2Dx^-QQJl zm|EMP{s#L-MNZfWErXTTr`d06=2jTP*x2#_`sI#z>UoCysO7+K+nAzEVUQ)D!Dx*Y}+EhsPu*g^@I_CP!G z{OTFx5r@-`>4XVRfBMc6R~u?$&<0eWHlk9=1pUe6Je8=78mnQSeEOvjL^MNGHBBvd zg!kLlg{7q>4yR}x`)jU*?#_objNaV+tmz+FPjIE|a~I;APxCxgKb- zh27=A^LEDdL{nijF`WYc+Cr+1*wX zSjO}%eAKREd6<(Cw3}>oVp5K3J-@n&tsKa*Ojd!E97tVryVJkoX05q)DH?m>_0M-1 zR@)~D^EaagDuaUq14|S({EJunaip96rwMfvd2wYWsbdX5!mP0hDXUJB4`eH3&)5Gk zVt;$8anK+#v~pZHU4f)ih&7jtjZmcYDuiKZ;SCEh5l&y!9eTFg$Y>arPbjs>m%~M= z756CFI!>%V3UvxaYSN}DH>{i=20X<{P&4llk{x!<{8mv}S?9j8xY(ukJJ@+%n8i(Q zp1>6ZYkP0QV|G0o5o0Pu-YE3SszX09WrugX$S{{NidC+NrRQeq*pK;n2f5TYIvCxG z_3K}CWWBenWTIdGq_sw+Ti2kMc@OsXt3Eq`BYV0dJ3#zjTkBT?gvZ^jz&R91M;#bd ztvOCmd_c7zr27|0$CkNBJHgg+_Ss6C_ZbI}h7u;|rQ60n@JhQLwCa|(tl(we5e$fN zB!^4Rl=+C9`SRtnS?tev9~7Ur^!Kdus{lO;>HZGokEq5T@pc4j#xtQ=1Yzd^MR(pJ+chZj0r(l3hb z&muv!*k^@;ZyGrSpSmvMh_;fw5v8FCplG(gKXzcQh*r*l{+(*PePGa$W1(*-d%MRe z?~nWF82pz`PEm0S(on7Zr_VET(HJgGBeK*p18bMRuqJ0oJHd;XNK>q09*;Q(_vp3d zR-SLu=H86bVh0w@FFu}*7)?mu0)ZR@D|VqUz#@bGC))0ylH)rfdTI(2-@vGQBIm?q z+`#8wk;}gL^V7ptg&Ny>?#3L4Adb4!xMO^KQ29N&2i{V#r*m(Ri+W9Tvn64=yb(mW zs%VhT9nh{%S4=$Y%y37P(3a*DOxcNCN1OLz&Ul4W<(X&4eQ2IgRo2$|<-ypLk%rkP zpN7Znk6V>(GO9bYEQiyoTLJ+|kdA}|XCRET>PH%$kUR2xHs%mUF!64TDStJN@OPFB zn;xZDXBl7c{@H6!smMvgv$pZbv3uUNg?6r&M3{1L5IB}gQhbWqp6CtBo4cmAcm8ps z`{#vsBd6|-l}XnJZsQ!FHdVij#Wx{7re z-0WQm?;rWi`e@9j?^csRtBqyVFM57h_dkJLmKUH)fnN>CT2gZPayezbJ#2puHqBe; zZEN{IO234imkfqSNF4^4uu2MmTVHw{7m_(oS2M5V!hBG2*lbau*4>$7EDd%S+VD+ znxQ?+G`x8*?V`P%dW)Fr@JweB$z2BGs|*rCNJ#STnsX6$i;K1mna?6gk|Q-+i?8+v zI|j;#o9hL%Y)Nvy^eOmUk70J>fksT0F#0&t9)>Mi=vT2bYS#?&Ki>M~8?81z_z`RB zWBxrNgt9aEb?<8*6hU93b-={FZbB+#-}+@Vw3%fl``pm>P)Fr}6IitM4u#y5Elj$- zFZp#{%tSdF5+J>YAi-A9NG=0a<0dNKqPm~`?jv+ zit*C?@*}^;IJkWsS#|wft}w2M$Rs3_8=p*SRkf}NP$C3!FLGBmzNiX>-Fx}{KQZh` z@d3;u{EajPW3HQSg-{gs6&@XB{Z*WjG=;UWYXmS=r;t(MQd?+iwA;Q%np2TRY%>4lTU4nUkWa1;XSUuiP*Jo6NGp|KuWr)^e_Tr>|LMDf5-PT+AE;ATrqoi zNhf@G?4%+ImXUru#u&2;(`tDzGmC+X*XPjvY($aWmM}GIfB9!-s{I}X&s_7fYDsAl zF9Jd)){)xXf-_s;4PKNCQCUv$vc zf%YuwE=V~EWJQpw6#A5A;g^&*_h1X0>2?fJVc5o6)at%5yJg#3`cIN+{g6f^vmYTh z*pB7U2_v;PWabzbQ*QZRbXoMd#%H;!4h`+mW^9(4CYj0aSMK+@1;K#y5)9m2jbbxn zMrA!5hYEXp1~7e-qFn8XUfCDj?O1|dE!Vrcnwc>+86}r~d%^lqt#|cjd!2&i#2v;R zC4_~^#+Dl;Cr4-6YvE{hLP4?B_86yJk1ZliEqHdqQ!PDumazzHxYnNZ=jw(%Un2pd zQJJ(sK#Gn{-QOQ8!jgEqQ>$W7V2i+%-%@fzf))U&NLgR2!4hs$DQ$5R#I+%HNstf! zzrbxs0=kaR0t_^!-ehNwoi8#5>hC3TQyTIyf(nvK$lZd;)D6D$fh~ug56xZ-72*|d z_19J@a{Kf1#wx`6HA41CIGNYvu%+aULu6H?%R z4~p>}rI#N2!ZU)C?$R~BHuxN<#snQQTJ$*pzqdv5x$WZ85>su*pj+>S(1}9FE$a+l zZgjqeO_@H`L^H74XC%O^1bcvbELR8Fec=6p3%3-gM#22G)!EsoigE03o%aP#5Tb63 ztx3I=-AESK)DORy|12^LrX zs?AH4T2|5Kd|+Ki*8mN9+O)JNxN;ykCs70aF9(Z~G^gnvR0jG0N7u!g z__Vf)?uXQHdxqX+fDM&6Mke|FV7sXn;0N^PpQNolJf674`nR;GNQpjziAnaVOEj!^#?P&d}ltU^eZLWTKKTe@ybA7Uj6LYfVhOB6Pgpcua zcRPsjA&KZgV_xy|8CCB-pKTMPmjY1s2t&p!v}k-bV=JQBL)yWb7$Z!*NYatH7T!-I z@UC%gq-EL*HLvwPX!Dt5MR_XAoG)&?p-d4bMIl=V3avLQ$QHCN64a<$CjpTAcA=@v z8zJEzhk%{TIM&z@i5%U8PxfAO(8YV7-7`?y1h4+f;t$xmS^L zgLn5t9~r*t5jM^AOf8^CKGT1sjdQJhkp3xnq@6HFLQO(1O`qcpNSc?6RATA)MQ-k5W6rb7#3;N zaN1?*;FqufGbX%6MFjEl(>t#@(mcLrF24pZ^>r#QFZ|)K5oL<{GI(LLqn5lH5?A#_ zP)matk==_hamW`Ik0bdm6;|UpW=`7bP$nM}!y+J^LS5@i^jqzB=9X;OZ~oH0qMVR3 zjQAd(T!4eS?Cd*;+}@Hn<|z_|u`yDuWR?EWZ^c@<-t)DMLF}nPNULviQOOU7w z{yq!i8WI7-R4UWS(w;bjIqw(zHd*Shn{^Nx5|VRiGKR|q@`$PnB?^}3(2!5b|Cd_o7r@Ox zAg-rYHpMVf4;V(0SK1#Gc!#Rc6>K2xA}sFeeQvW)MS%9?luN9ZfaG}yQM$V z@+wy}k-ATR3M17WMtWFv$5~w4lW`33Hpm;IvQZ3Fn;|p*I9cD)yu~nl)~7{XZk#&X zUvzGEIg&xfzvD@9kf!JvB z$iYAXf>^KVx*ahN@`lNkcdGVIb`NY(yTKIqCa&3;F6+7@d>IKK;z0 zvcACoc@0E=VDF3E6#Nt7v6htZ2SFB!oXI;kd-UY<=pJilK2}6QW_GP3?XC0*OQYLC zKIQVoHs|do?io69x;szeKEC-*lqW_YceonPch6_Gb#CBt=xYS7e|@%P7F{F5MJVPWz|UX&Zh(JbM*Pz*!CRx9dBt$$^lX+ zw3_v#QV#TFjl87Z#HLS50Rl@9Z=Sf|B7gfq@AvHO%XqV&bidmguFSil(S7K6y!?jy zV#MHrx8yw2@>v^LPG#fx%{fb}{?LT>9}*&z!;%<3%QAC_o1%qasH7{j=O>~(iLV=` zPja5|hhULywzQ68*J@J7oTV9Z-5u&;b7n`>!n}?b6IDh2)&eB&KBaN{k{VQq4lh0t zkBGd)n|k!I17Dz{?{JA)OR<5r9&Xf3iAkQR4U5Tik&kc3>9cqG1&5^1rXS9y$vdo* z?D8(O4p}yeryI$)_q+3SV$E|Zz;E?i{<$3SP}(jz+J|6(x?m-S;|@Gs;swi-Iy^PH z5vTAx($Qi=m!Px-fqaU07>gkB=;}pvvgdLD)vqAyR0gVvlgi^w2m zKD*ZXSzm{s!1|1_;k>s;iDh5x=|bB*wZ0MMOc5}V0ZoB+J`)1!@e;cgaU|f`#T&OB zNo^j4S-CNHyPc3vM4NReQ8lqkkQ#ZO2vm)*gP)T5y(k)+l=*;!l971Ur*tsCI6Cu6 zvErd3D_6(XSLILJ3Zgpy(R(cH&snl05`HRiL5OzUT3wQyG;)x6Fh!9Ho!eCPLV#Hy zZo;7UmvFGrzFwAokZzA?Q2cPVE~Uf5=!<=i-h|w$$7PCJ_QJUh$q~m?_wC6lu%JwU z;^#G4PR#Biq!U`5`H2rLu_8HKfSUU6%!tLB`LcLv#;m|53%%3IGNz&;5RqSqU7LXZ zhRf?)%cMA1+J>5sk4&_~ghQX3b7Rb0?c_;U@ZZIYb(09 zDrxKyyJMWA8753;HQPlX8&#W_JAK##kWZU)1kt3Yr6m&e4x>2YCX1q@+Mq@7 z>(E>pj=Su5)f+}&5_)arO3X4Vz6E$a3@@oA_fq zxxz4NTG~w7)Y02JHf#QFtn1x3ZCS_6WG<+ALz1Jg@i=A4})q!f=!7WSgb)uP$vV3nGaY=P+W(EI4vzM9;%z= z@dDO04-Nv+Nr-Hjpa$R1UZ8FQICgn1Myf>4W_eRcPJPgFC@5C-K_G^;{9m*Puy_(5 zZ0MxOe@Pd9A^zBPLOuLME zBiB6Au_HbEebn+@hpb~5Kjmr+qzCl`^D>Y!Qum}*Z(9qC-k*9g3}Xs~7C%)Cc;+K6 zD57Vb<_J~!8_Ov)!6Jrlw^(LgYMLBAvp-=f=j8dalkdcf82jksc!#+)V&mpYj8)47 z)lQ8Wh^1MllJ5a3{?GACfc74I42Z=lee^+(MOpQ@rq`B=qx0z%7FpLp5ihnncq09e z9cGTu1e`y6DEX!5fz~KD60uHH8@LH3 zXN3ppk|)FI=IYeIZs)?A<`sv(^>c15Qm$m*CK#MV_jJ)PuLxyKE@LYrVfN@9_?pUV zYcok)P61JPSii;2j?IfW_S(<`H3$ZqQ3ny{u$GqAL42Xv0A}<}jWgS6#fjH0R`k*3 z0hN+yR0(%?x}B=o{=xM+$+IX3_EgMCiDI!_TjMCtD$S@5>KnAvgkMYQZAqI76fnl-coZg(B++=!r3$B z%>yNX<>hX*9sK}^2A1`#g&Cl_4d;t*r(0uXs9E+-MU(A8JH7i};FF49`gk8-to2UY zQe(Vc-}W1)mvr;O8Y5)IS}<&R$uH1L*jC28yle&vp3wAq0i>C4llj-Gy)+7SVNYYC&KCtb* z0>O>Ig7a(3v_KLps2y;ZLvwil$3_Q*pI4@3F^@++8QQ^Q=@RY*sKw04Ox@>=@3Y1B zTeSHx{r%LHouxv*ADaFlCCDpT&hp;Sy!4E8jMRVrn1>=P`+SGY))dlagyY& zRZOMzJES)SjSX^r-eDI_R>L>uR2t31bzxp{zM}ZRiKv{<4jz=^@*gSkKDkEt_D!oA z=hgj=R1QP4u)f9VYd4?G+T@f6&FX^x9gJIfCsdN(7b{sKS1qfBO{$Qu9ww9_BCZn+ zBWrN}j8Gf3^k4Yip|gUa~D##(NB2my{j#QIw8Osp?&(!VIZSQ5aL6d2(?w9qb-M=) z!0jkYs(ZIjO=Lvxnsoru=<&kp{)(Y6&Y6_?md&A$Vs1o1Nyp+$9tpA4}8N)^O7 zs|n!rL4%b_k$l+bPHqu4JnlKK^bn8$5Jsqy5ZFs)9P)~z54 zxXO=6@8VSJV_=q$Q)`Wa2l>C_I*Au{U7Mdj%5$XnpXt%15XlDF7TNw98Tx(xG|oNF zHrWlBSWxBBVX*=}aFKM`huXt9orBhby6ng1b#E#o;4}*6=e^5u!*P-?cU%{ijU-8E zNX9zm%{+jLjolyt9oFLkl`!rrRpp-vaftiGMt@)C&TK*>-ANLR(*fdqh-F+8PwV~# zmN4^1T5Z6HxzwYk{M$yA$Xg$Z9%OL(YyR{od#|plAo22Eep`cgpGl7U142dNyACHP zF3S^T7<-S4$wZ~matVz!zea_FB%(?)({qg5wvwLB>#U?E_jU zshV*X386aGa3h__QKCh>FooT;V=t{Q-F8-5BcHD z4%{Us!6}CX`;z53GdX&pryMaAqBo9FZ`oG3dhdbIDfrp|^1O`JC}lKNc_sUew31o? z&TC0?!+k)h1!1vM5`YW+D8%o1I`P`|J15O^eE3QkDlkAmHr+GszSuC-p|&IZ+0wxB z89LlnmudY|EWjuf-?#Y;LU!tWLYg84cf4uOhqi$3pK+7CRLN|exQMh9)c1vU+3I@` zvQ0JPPLc=p*k0J+-~sjm%iK}|VihKk_P7R>$Vu@({!!dG5&!V^yLqM9U-eF3#5$uJ zN?R7Fs~}a3U(_D}lMDf#nRvi^xd|daxBxi713=RY$lg%c-0XjFf8drx7FGw#dY86_ z%oPB}`}dzLp;*p9{|3lqhn$O~@sgb#=XOPQR4dEsT%9QE5p^$Wn%b-EJ)aO3bUhXB(z44F`yGZ(;=PlAR|&4`trNt z^a4+yEiwl4Rs)3apjmYc$5eD-R;6*waQnay-IGI!O?!*u%J!(;B=HH;2frlY@0<_A zU`Wu|o`&}#U~&QDECm>YK{Lt2{Xpzs=K97lSUu=L%Y#V%xR^IN z)=<=TM3>M}1~fx06f4IMDae6^KrgLGx8DH*gg`({9rVcD<*{%g2ra!l8Kr;d7qfI| z{1`9uYpPEL+&}P&&$rl#g8znh@K0zTLiyF5R=_;3=J!(`0A|G|ri`s{0o;&) zv93bL>?>i+7L@JA-X~hkV4lK!23d!$4G?C>RBXWixcvq)>ZF_A#duHIr60Z}c`Fn5 zR%Hza94;0S#r33mDJLt^r=E-_P8Lt=VBr}y-Woso~dZr(}~jA>6;>(@!E1_ z*QGV@YnCeRR!K$zu2&G|fTO(}Y`NIy|K(7m7PKxB)RZCc|K;)-n8>f{TkN@AHSQ55mLHv5gg z2w+frObN47bKI9Z0S@P_?_`L2-??4GDw>i;LM~UXx{23)G#H;Xxt;k_WlBR#k6L#p zGLGc#qNpZTd}I-q{y-=jc6=gjN~sDtbv@lzJx>UVIMu|{LD7{hTWnACR7cBY;FmTG z2Cf%7R7y=6Y*=I*)daPV8^(} zEPt3^`)-`U;?*%&8=H}vjN@y)^|vo;&-K1XjgrjijJ+{>b$hCW*SVJ}|H%9I(5nId zCmOZn%1)kB%q=vEPGrJk4q7avIBQ|gK`Zt|J}oNDA*H)3af|L*4KcK-Y_%|5)%uu6 zoq6RJhzw}#Xx3|DahO!d4nal+$$tQIR8k!A6XBGTJDi>I7xIc+23b%Xq9$!}@)QiM zPMXU7!_6+QwnKlw_jcZJ^HuBo8L!UqG(19|JC!hZ`1#P-m;?JvNX@zk{%xW(U(6-v zwM$K5x*WO}oz1HyV|{W}iTU=9dGwq(Ym`{w=C+szyvlPNUGMNJ4jyTGb8d*)h2Sq@%QH6W)qS<6C zM+XIo(veYzfQky#WKt~v%6Iuv0#T+*5NLZ?8WCDYmTX!(&9+p9Y0V1i2LMbTthXpIwSHj-fIRcQiRa06Y3=;BiCOEj{)Ox;rb!F_IV(*@X ze@zYrO$bX}6H;H-Wy8R6lnoJopt)a%@5YTMM3~7?icPl@>4vm3g(!MIV);YkpZJPG zosN1+v}Q7NuHpC;DJt1OB?7=hcX2Q~pz!I6Uhk3UVyZ;cR8E*=)iGv0+Z`$T{^!(R z|AL$!o5+pBx)g&02Gr!T<*u4@t(I=3Hfefb;vRgaFMg>kMHa?N(gD5eniTj#plN=tF7fAOJ4t;>Tk0=@?1^^ zOR$MKgVo*?QL{(ua)W>!fb>_*ndC!Zl$ry<(kYXg%7ki;Z<@DigofjI_Tedi5@E`d z8*}3rt7W!S<YRPMV-E!>*Dam`jr>92(uV%t;YZ1VqB}9*FK>OYh?1yGv24)eAK%IGWcNKKiqXd z!g0AgumM;#VTY4@2BG3OEDs`S<3O z|N5H}ARn);6JlDz+OOfDv5xKKvR>q?lqhC@55gs>7{5iNp2Bo0OF8h6QtovUAwx-8 zm?VfJyU!L`p+C|5db>74*b{;#6Ogy6)|`7eeA`bw!p>Kn<0}o_Pf$q5*Hqi8 z78R6ZBE!{HWt1wuO#be2WkyV=RnnyH26F$y@H4OR6Q`lkO}tQ4VW%VQj!TsDkRGE) z0W=xK32KlK%htHx0AE*54y2v@9P4d)Cqg4HFD0yr65V0FJQ9K#GGW_pRF%;7JRxpq zmxt+u7Kw&hjLV8SQak9rg?@a5+v@!md-y3T%Dik(dbMo72vmQ}iK4GsU>xtomWLSD ztP`l=J03npbZpLIwIQLMJbm8HaPtN;6Dp3{xaH1=#C3nnlzhFJRWragX**p>C33Ia zjI6m~(e@$o-ZRg#LX2^7ThLeLBwyd9% zPbA9w@nLAIzDmW@VsiKMiMLy(lY(Xr%xoyuZ>gPod89`^j(az4gg+&m{*yW3&^?o7 zlG!#nDQCp`EH_YfCfi8+z1b+V-v*){xn3LA1`Ne|$@=r2G~6&FxlV1mOtQ#IDD#Bl zY3EW@=t6d~=TIQccLGP${ixh*G(T=8o7g9Z%b^nW-?#SPG^Pn?aa(oPneor}Q*T@| zlp1(Ulb+0EaH(35l{LjF(&R@=>ZwsyfPq_UylS2#qB8YW@BSn z^B>wkf(JMNw>$qVY71I!N<{e!>mqnS?9l4!>Qo{?m3bYqs)q|0HLKRuAgQ|9ph~s` zP?Ud56$r|g=u!}?n_PxgFTakx1>&Z##{SEOtrAv)L6`^>i03^(1Q4_c{YsV3t_N-K z+yA(aO<;Ea&FNi0@jEknjoWU*`Id%vh%{SvJj4v_Vtw|H;o`-{@(7=`1+63xS{vod zo{qN{lNnt>>yS)-)Qz6vUJI_TA`2XC2k1-!-6XR$Z_;;3IcPM53T1YrA*=C-2(z+8 zoTJ4dN02t)CvM(+g1srXh#K}svL$-96PH-5Nx;t;EGzmC8)PcTs||zONeTgLEUSI# z+iT&ahFW|&@?eY*PX?Ns;v!@4Z!G;x1xz*UhptLeEu5K;aLg04%qHp!NTXLY-oWE< z^?=>iQSfeQ&KZFi_;UI>FTp?b`cp7j)E~{Mt&Ry}z+x0)GMxVpAFqBaX^pxXFm`uY z^a|={4-bAme}bUD2tWcZ)fl+`Wb?mwpFCcO z?n}eM`YY+MF5hh8M}126`+MCUG~|@28te5Oezw`=w}CFhw!11}`t@WBWutYvJ&Ng$ z8jhb@{gPgCGE3fH)GJEU1)~h>mjbi(UK85h$@zNB9GL3d2EbfvocJs0P+oZiBh`S1 z0v`4{eXY~uCJwqMEBTwM2ml+$qKLsIWZvr9+?=U@yZlyQO)e{-JyctOt-x4??bOkscUX{3MeW*P*-U+#i5m$}Qxhre zVe#pFMRZRh)?~@QetuVe;v5}ytLz@b34@Mg9?EyiSWPaRR=1FJAmX8Y=KjGWQJz+u zdojmb!b@oZfJDA44LCJ`5kX$65&=+OY=5YLop~*OxNf#U*Vg}*^g;ZK?ncT5iS1AP z;y&o?bwN9LD}%1Gl0s-p^9^{8yG2$R$C44}x|R3+>w&Qg30M1Is+ z5@LGXxpWWWK2NnS$}?{0WlTS9;^!Jv>vtD^#Xx{{F|YaI@{K>9cc{!6;cjukV*6@< zDFp**ut0e9-7t&%b3^oTyH|>p5(?E`2MLuhKmO$Gvc%)%4?V2e$%bAGiE|H~_pz>a zTe^yCA`u6)b27{)SXcBsC=4|lc6ZiC7>EwY%QlbB1>KO~@9N*dPIlXauwTpGn`s2L zFY+>=BkQhk`RLZy?=|2Ql-J{u*FH|UoF8SKn5XeYwRnU@pQdCd?M(vq!OP%=rkmz; zkQomgORAw`JlUS%!gC*|CzGzBJ{jLzp5-3qQ(G5BNn`WS=DXbF#DhD>E~)!=xq}N~ zfXeT_I+yQv$7jN%2dzBrx0LO**JV<+F^_o25*?Vva!}#58DeCgmG`am#(VS z0Qw*5FlGWbY*IvrHxG}e8gm{lXF7aD?HO4WkSnBdskaY^C&|$59fX2BNtkq;TL4bj z_BxH<`Neyp;HaKr7)HHSe~3Kus;3&I{8N~;x2QL+!b;Rg9_ny9x#pp`9zmY4U$VKK zE<1iWB6tg8^c*iD;`!X9?B`^lGalpsceLlU!4N7tQP4WoCVUMM$2~!%lb67W+p#^mWS*=@$RpKHOlJFr}WzdHut!cjYw5NNO zl`Gy4>=%DwpS^~xP-+}X(?fRutmW-cYko-6MFd^dRI>L25$&$Xn(W5TlZOk+&-78g zd#bz$f2!A&#VzdAtKaiY`{#7hm1Pg@zgVZg8fJfK#@2ge@$2Hh|0;M1{KvnCPTw-y zLo!B)9T_9nz&2-0Mlq+;#yPKKye6QX;V3cJ?RU#Di9Ko!DHUUAHi|`vgED+ilv#)! z2UZ<&5M-|EodPo9xe*X)4YxAdR3ajkv$mS5F`{Nz=|%IppiQg#e1}lJQ)z#jA{jJs z2jC_^3%4$@ojF5SfLi)`=Jku_`+<4gz7F`-(+$#d$6X+h{eKAF3ovRz+Kjj7Pe`B$ zn}NWL>*aJCl^Qhk*35~eD@zT%c$Ka_!m>OD82$h3>^3d4s6pr$vzZDcOJ5c|W>ruI zS&wH`&phuykqU&H4gu&=qiiVQtSlyE-wsR7X|CzirGRTZ}6`Z$D-!q zP1sOp?-x@Y(!2pnbl=0%?RvLQrdh6fN~m^r|qpf8*tP;N$N_jXqf zumQv-?gD1s75+Dv70?8bZA+jDeVr?KOKMNNp<4U?mx!c6l z{BM5IS8F+RWO5p$?&5Wkk&)|#Wn>+wXwUHd^PauHx2vbzSQ`29wG}^IB8kVJTJYVtAhgnZuJu_a!g&Ft83y&SdgUe8TS; z(sB=J|LW<`zK{wfbuJ}n?40S4RQqdR2muX~n@r>`wn~KUhl~0}T9R612Xb97XSZ56 z>@@D9M}~=0-I=YesbUMDZWNW%XM2O$^4 zp1=D^CR~PVzL9LvbXGTck%z>1TZJQ?BR}q|@@6WRd$y_Mlk0@3TCN9}nQ*wvcIg0Z zZOg^N%MUNy@w-^0Q=z&A(meH7ntxW1<{#3$x%0YCt@}$y!sbF~Y>K92vG^U;vNNNY zB(bLETIjZ*;WORW#_3LNr6p zWFYtJHRb63eq)O|Gj^VB4Ay%$Crp0p*>Men{aLh{^y7@rXGZncGyD!*PMalRK_oKG z^O=!|8&~v?21N>EB$@tiJnLVQpY7=B!r_Ji>1dVm%Rw^xN2Nrx75*!-^^G9^gHUv zc%NDMk9k~a-cr`?V0~0|fH0#Ht#$|fD9gToLTv4+K1#Ii3vU^?@Ab0%;F*;Y@Oq1# zAfLq<@ttH&4lr^T((>9tLLM~2#I-V>KzUhN(9oV8N|dCg%{n^W0g;ZVxk>^Y9of2F z->yf64jm5rj=uDSD6UPpoIQ<61f}isEy}NP%A)8+M{G)+WTME@5f#Eb+B4e0VhVO~u}yyaje-q>$yQe@fSV0}6A*o5se*$XuzCBYzj9 zaxQhJj6$k*F8z9q=zUfH`@yBnUQa^MsA|fL%??IMg?fY2r2sw~20>mF7jL-I) z5XL$C<|+yw_KXC^7!IWAHET9=+xOXaH)A51aSp^(&q+eg$sUaN=)@Fx*QGo<-I}^H zV)$R&FZX^8cwiw<*59@B?$g~l_fIBA&f+OnuBXRUc`9LUc4{2v8Qig4L~1@0pZ=(^ z!EpE(A)aY`;6~k?a1ld=i)24Oh(2!2MmI8z8zVHt9&-KVHsdM1n&jGt35L9~1rd4g z%7Mzt%7uuHD!&Q*N67IVj6ZZ>#oDFS*2j9WLH26cvr!TI>WV$8Y?YPOP4wG3oMOJ~ zm8(7W@8^4e6*PyGFBG*-YJ4z>Eabb671XqV>YI-3`pix1r;qKE@cWa^{X>p;GNsn~ zX4&mdOLR(2D?!I(*oL6MXqe45@Xw%6lE*)pVY~;en>*8^PA7l!a`@QEOY1CBEi%1i zgIErmmZ46rez^b|@pOMl^KMPh-KJ<&#Q~_abLD2GFdFN6USa`qt~bR`D0)!`)@{*j zsn|lwo`OT{m#NPZrvMkx5 z-8CoRe^|@lPc=CVN5TU>SM$mGgluLT*J;}M`tZ0ft|->;vu@~!|58ELN4B0Z_)|)gYwdq z7-#(@FcBsmn)ua~O(i5x)z7~tA{4mH{;c--p;;53Ru2v)kL=GnaD9#eWNPL@CDsHY zW+t0?$x7rQF)Cloa=7s#Qi}wKPkZFyZyaR{&2+4^J)ig)0I&vleM7%CuR~G%3UQ9} zX>K~~dxM}ge|`O`3ci|9W07MMeq(*Yo2xdjOVWTx`Hz=Kh47u&{jc|TK7xdN|G+dZ zJayajHlr~iQ0x6{`wx_@+Iiivz}Z)DsNGfiK~OBUHvWrx&OalN!2%-1@{OR>1cH>T zzQADt0!)|yHW~Q*2%~GQA9!lBqyVDZ#!zf$YrYY^zv+2l0TdJ2B}6BVLisJ)X;A5!aTH4}!BWlJhg$fS%jN;WQYz zsyHzdoiaA#!eWka)mw~-Ux%|l-t_(hB+p&cmr%N*8IFeVFPwxYKe+ z?^Js6OA~kmH8&5LkXNh6)8qlFd6@pgc7tlN_Pnl2axIei4&kq4n5Sr=-0n|wn3GO! zp|KLMN(^Pfg$o)}>9vUiB3^_}ry`jD-E?Jw--d4&*RNAsSf;RCUI!nK%(2`olSyIk zFaVMXSwerUu|@P*PE)Os>sc5jOCSr4noO8}fW+Aq89A0pY+-)O(G1^BuZeLcJ$#c) z_qoF2d=PJEIBckr1!*Rz8uhY$a;{wZFkLC?u$E&M*MG@hvE%s>G|`zw=v0>54J#%6 zKb@RwP*Q0a$8o!DWw|z)mT9exX$tDPWLj!%7NjQSH7zn+bAVEbRxJ_4EbV4fnM&Sh z)ks}$Wf!wBNq4m(Kv7e0T{2QLFIb3zDDL|@J3F&8?T6j-;e0vsat`mj|K~l=|M{KA z)S9D-46dlp31gItw-~J{+FfUE#gmWrS`N>ftZ|v9bv1srBa!3P9}sCg=o_0z!58D; zomC`ERxDVk*$sj%$e{t4q!tt)Wa@Duf-PrLju00+oy*)zbt`X z6Nzp6Kzx$-ZUHcv`;}&%PC~aR$b_!oKI8kSBjdEXh{ju9xqe+8huPvq2AYK!&zb$_ zyrO~zmhWJ}B1@8Ck75!~WpS&f^M+H0dqZt~QL2;s3mnXBZC+pmc72(A-zqeYzg*#+ z2kmD1(DN-TgYRRD+8swSE23Hb9qvJv9mBRa`~7RLPb^V-5`Fh=OxTihlBV@LZTtX0 zq3u75%Rc4V*M(}UT+ANN7$PXYUQIM%9nm2O=)Z~3xHV%{X?n%46R4LO?m~hIF%KBc zyn8DH^-lX#YM(#G116%CD|PBa@C?Rkwx`V*%?{UwRJ3}Tx5#E0ASCeW^I;*%rE-WL zVW7`!a;1JIEO?Fwy+^0hUn{3os@OOSu+C3G)g>7ouIh|uS9K0aE`r7140uozmi>$# zk5qk2*QzpCrE5SBOf<;AeYP<`l5gbYXUBO_~lfv;i zqwfC)f+W-(@-H%m_2w4~^&{4KdSpu5vB+4-dehtHkEkt8`Ucs%og(FDO)Y8$rrS3K zD4tp2!l$!dpf**odu5+4fvIlEhVtiWv%e^QQn}xnvWKnc#wc^8%>r4t>cZjV_osw~ zZXA!~Nd830Vsj%ahH*I#)xA+Wu~_Cz<_nrZzL`XY@X}A!Mxwhvlv-q0q;KE+Bj@+* zxbD^ys4}On&Cs(q4;Q98$OQt7GY$XAyg zrhGpe>q2{45MK8-bVNeO?X9MMh)LiG3Z%R3k39a3`QU7e7#VegU6$!Qm=>xThsIP4 z$k&UWX!4BwAwybi|rHkNj%;ZW5Y)bGIa+!#Hng92pG(oN?LT z7K)*C{pX~6G&WR155j_J#;3FFpXBO@DGz+SyO5y&5XcENZH7%MYxBPx=B;wEAtDV_ zSM))J*8x43HX?Q~@snq%by9aZ6eh^C^+65I1h`LOq|PB#Vm*ruLC~0{6d3Hz4JA6* zfiFjRq;l=Nq*l=CEe!0U7}(!Pqy%n-%OB9t>e%^Ta|_8i{qdC20@@*W)YEbF=zF+( zuWi^ql|+p&7JYR+W*>X3t}SsJqdDa&YwFDgmLuH>m*Y7&;1SbfvCV5M-t9(K^W>@d z=G+hv2;D)Tsu$vb^Lv1mYI|T zbJ`0qyAv%g6Nz+}r4D>pw5^K=TlALSJ+Z(Rz!*A40tki{YDoA_@P4!IH{Y6BGxN=?;g7>!S?9btd++ys-sgFCUfeT) z^6`l9006*u`<9L|0C2Ox@$lh&;Pv;F@Ivqk+}62n8l3fG%qS3r`wh6q%%&JQ-|a-a zR$eQ6vGG9(mHO0VAS#8A;2p>Vy#F(&Z$|Mb zwS`1lf})+d0j0~~v%+JQGwTJ3&nDB+p3 z-~whp`18MqLID3;zXIEN4F0B7M}A;KMU^rkb`8KG8HB6DUrCbNjvpie09QR#@88g} z$PEBNg$yvZxDlNjh?1~e;@0@hfSy^zj^5qfXo3K^riI1*z_oJ%T)C2;Hx6(XCCcXQ zB=`jQHySqp`9B*l=C@!u+53PcV=Wd}uBsL*&*skVUMO$5e-3Q58S;ZGqy>6jm$;mb z?nSch1=a3D*xP@!c=WKuoecl-`5tB!X5=(t>UAV`QS>tyqA>@2shKb>BtcQfknqHn zp`?72aKbS(IidP)x=jeRu4DQhRT^=$K&y~--9E!Fq0QaHD{Y09=aK2UNln!g2iFA9 z0N3w*XO%JqYOH8y1IdoB#*tC?Q^VIA4vIF5RhDinrRr*wXbxZUeCc~(0siBiGqx*_ zxCXyl+ejXU31QzZQ1nN1Hg38Nzck(D0)XJRExiT+P~lWM-V67U#NY7>#A-hyHn~vI z{2z~^BPAop)zgcAhd8Fq^i<1|}nDcXnGMSlgSMOLP1{)AAhuSk-3;5L6vu(Z7F6L=b2<$17-0QQjE1%0J* zXPC%P8cNM_hNyrjaH{shvVjYUW}d=jsjes>T6 zB)}47xLURpgc0{$5^b%k{jx}Niti2hv?aU1yZ}7}rfC&tHs$zz^qO$#3pXUyF+z>$ zQ>7Vf>{cp)_DEID0ldfiAQ)%#ZeVSyzs%O7FkIQrye~`s{Dg~et%ApGNzHY^X4Lf4 zuJ{FV8MNlhWZ5b_(ce!Rd=Muv;Sw8R)xR&1bVDYD5Z1AlCi;EquYPqT8~7xOWPg&c zW^?5>Nkr6-D}J1pOr3WD6B|%w2L*B}2mr3>{S#w2pZrJE`QQ8`J5&p~W?0=2o1Z{Q zjdvB$AnHn=!>c_*FuIN`q$N-aP+dNSSG{IgIHQL*hIA@!%Y@y$NnU-Y;|IOOyd!g9 zB62hlcaJOhN@R96=c~^JbHMAFA?gqaVV(nrjItJ}zR95vv?yW-oeQyUT3Kyx5C}U>wJi7X0xm|RCvflFNvLNVthd>*yxP_hU3_VpOWS#7ja25C`;CkKZ#O)47$1~e zG)I4_^j};3soG-?yBSikT9JkVck4Cf zXvxmhXIF}n-0L2O8P*GkyiAhgHdYhyd)4g|NHd{0U;I^!~JgmpCQ$#E_)vxeQ%AVf@`QLjD6ZL?| zWImsPagscru=NX%c(EU~Aq$j_2S2pR%%MX&{;k2%33YYzOPkQGvhU$7N`D~w&TPoX zR^AOvGj$9>Zu^)?Bv30{ya+syYh5730s#B6#oMc`N=B@MXD2-eP;cc|M#&=UNljCE zBgy*KFPn$|#lUBB^{3*)d56~Veuy9U(bUs^{1rUE>+MZ%*EBU5p})g_qg>W*NPp+? z*I8vV1FPz@4IMqdMr!9aZ&=((+IrzcA|)LHRGm2~02ox_5M45?A~!Et56fK_Gp6>X z=zGzf3;m}r`vvTJ>WRWd3!0#EKNjYijHeUwh0j-3yKJ4A05iI0@0IWH#MhArvkA3# zB(694-b#Inr5MkKZ~C=ud54`cNbt_twEfnK8>St`jZ4b4H$S4sfiRWZ13k#-R*2sNZn19?@u>@vZ8CZr zVq_|Q@x(YbR}d>Tn`*TS&SSwhDSv=%G)h&|?-lPQ9+LvO9!ORIU{by$X+PixwjA&- zVAA}*IACjB;RNbkhH1q*rb{I8x5|^K_%Q;Spg8E!xo-B{w%4)$ge;G-#PHYmgpT-= z&d0wfWIlAFO;?hrGtcC=ZX0DG6(3Rkq1)4~AeszC<*$ET4mr@-QY0|qW=nlK|0bzAU>Ctu zjqZvVmTEGW3~<5gs$vlbmJBUq;qZ(iFBp-{3ry^rDtYHY^tg-j!_;tHiy-vJyg z1=2?>7ON1jt0gEDd*p`|gZ6w9>;H*oG3?>0`svQDw`k8UJwWhDng#wyB*Lya^4}@2 ztRY2j8|RLKNo#YT1>Sq^3AU@-Aivw**0{pk`{qK61bf!U(pAfj(O6_<`X&6pR@!P$ zYLH|AN{${4gyL zXt7%R5`QSVsp<@|xq09lYD~2wQ6NgoF7)+5@8WpF>U{u06vE<_+u0lgEDH&{CjM#< z$Ft*w-Z}m334#&8`aSJ~lXkd8Zk8`7Cqw;eqr17HgqI>CXHz&em3sz>L_#1CKZuzK z5S8gem3-&atH9_60bw=)ydhVWz4((L1B_`Z^}&f44hSCyGbAyeqbIL!@9c=hOo1(C zK?elob=Wlb_B6=9KV>eUBXR7c2|i%bd1nHQ%3&$~L=JQJhR~VUTSm9IqsBKGdzVFwHKuzt_em+bn$IfHOtKog2;v_d365EQw!{9y(xqRx+JK{&?Q)wavi_qL#od8nD_UW z+QfvM!eoM)WPQ~K{jb@Z@J3K@iStd4SxY>~oD1V?w?_&LQE9hBueL0_1iO;=Igq?A z2%6oTi7RKyr5i!v5QIBK^=&9jlht53PNX-icXLrb`ZdJ{Sq=QN-aV;^dCVtfJaoBd zh$Z>qYT$f4z+Z_oq%gaV?rT80MDhRAhUMtX1VMA6W)m7phGls{A1)~a|a zU{;C)z*oS{-J72KoxX;=1Rqnk~W z);}mP1O2M1dH;|?V&3PyJw;<}6!)DOcRo=rv+w?*f<)UH_3(ZYLqV><)2-DRq`Cl5`RA^_cFRX! zW5;O8MSf6`dP#9zdkovYQ4g{XyXw|GZ)G%z8Sx2=Dc3v(G)7JAa^=c7vu@Ovt?}D2 zcXoERwlbI{4#&U}8r=k?u>q%yIbxOZu@M5+r(xu5sxX8BmjCV^0L6(k&M|MOA$`QO zl?Xl}77X4`gJqQ#!&0L1p<-|foj|LauM0E0d+uk`JjQV}$Fu~U{ zFWqfoC{04EM~=%$5*X_<*_i+pFT@rBljv!Qb5NpOPaX`qV*a zj;QaJc-1eBRq;VVOs;*vuN+mT5HV}9y}Y}&CRnk%TC~UyzgaU2RlbQ?F+|;S6)$i0 zH={hh+hYzzvDM0mA?FFo5MHa1kF_(8Jg$)4Mc)KbR^!>U@E}^FCsuAJjfQhS&+3<( z;G%_6b|Wm0yU^|Oof|1Io-m>(J|!&a7;tL~v<6sM3fogWeYXPA{R{OXI9m-pZj-@k~)XQ@?rUtqM?t2jq_ox7Y05$ zW~*L}>8JV^P~N(v$f(*BvagA6XfzR-j{Z|aZ#L1XMxhE3`@v#Tdolo7icLyNay-%8 z($Z&8@V0K~T_6GAslL_9soQzu`nlq@uL8WCxivo}`s&J4Tz6i}LJtwrr2LpXz=+6{u)2eR7= z=-&ZLi5FC@ehbbxQ+nBANna@B7IeGk?oy9L!a_3vNves32zNa{-REQmiBp={UZK-a zzpmBFB3GoVwhHh=VsG23Q|hoMEvB9m#R>QWLVW>w;lW0Q*X!(V#{VFoMSDAjQ{yQy z8xRRSvVP$2eyCe#pbxN}>Q~~VZ%v70`aW9IAkzGnHwbu5Qk1(x_*@c?1#MV0r9P0F z#|2n%Og@gneXmZt6Y=<0^|9vFG`!LbBAv-h&@LZ#dV9=rb{6LVOG-q-t7_!!s6Ajq6nt>l$N1czDb!)kZzAa2Y*MAi&$&He5CBo|xT1 zj7-gtFm>4Ziufwu(0hcP%4n?RP;;{Wslm~t7|7MQiIhiLH8mUB#b!;=gY?>xq6U4N z&$>Ax7Kse_&F?5?Xxat=>MQ;I@}gT8*p)uwjav+@Vbt+CL)vuUcdIr72ESt#{(_C82gC} z^;)Q>6jNfxyIn#mHk4-YYID=VUi`=HVafE`^oNBA_p(uD9ohA}-8g?Y7N_*KZ0X*h zq)R{~NNZDfCJt>EzVi_;Pt{lVpM%G5ITQV*`(2sZhRkbKSj!Kb+S7L%joBHGL3F0E;|-UT~}g+MVFP|0`|w{XA%uwWc!A zuGCMXiLOumAJh?J{;Im(wckq2*(oOaz6a<-V&DV_b0xVDF$1+zF%1;+p^vF*aw-R(n zWer>CzpORmEb8VFO|r2nWDAv{6?^y9j0SlnyEsa9MqNfjBd@2fJ2nJ-!(vAeX3srR zCWTz+u++Qj@{l|lAsuYqQ)MWJr!=XE{n<8Ny-eaJ>92b0;Vc4WLzODJn!j@^Up@BJ z;|oSJj&Fbf_cS@~M%Mtn^e7s~CCjV%a@A|X3N~T>wtVY!YmC}d7NgDVHOKYPz@9X< zX6MW|X^LxY_YVf2-?oslEt#@=wtO99w`^x;V=<**8U}){-gA%`gUYn2`gX(@pX-6FJk^t0oNL) zf;{uOOe}1;h^7ZnCZokka+mE8|Bd3dfi7=5emL{!-!AXc>G7OM{?g$|0|2lOKvKPFfx#>G*C3W%O&t>JY&}H`tT&LC8hZ=!q+E5*h(EA* zd09yURnEr72E_`@qjUGb>@;u9STi{p1QQ#=wsZHVYJX6*Ia6^lKs*p(zB}{I2JScP zOpq4x!@Rk=LQ!$a#+sjrcK_*6fN&rtw8J%N{*h-<@u*{os%&ji5;VScMe$a#=WxHT zhHFf;d~{P?!s#)sLt^D3%&&J7{rb{MSfg-|`vU-|D+rkFpjq>WypG<@EhvK zRMiT$d#%0_hO`@Ot~?vQ^u=N`F_m9dp~|6JqW}KW>RtwfuRJ`^n5W~z&D`gO7Y*G+f*BSJ?4{n zF+!zJ>Q#4M(V=+x%;3Mp0Yk%9%)0LG`o5foN9a>Z>Qu^MZo6CG*+BT7897NCxZ@PK z9#r?bS=Pg8%J;^!QkI;Zmx?MuL$vbt|IGUhrhR88P44Tp-*1%JrRH~V+pHaLO#G+) z>wO(0+~7i>6-z>HBzIUo(U&W~GSdM89Raj5Wx-z5*K*;iC?s5wc#^;VS(wu~IP^cO z1bZR7CceT~Gl_bdUFtWM-5fSlJ$KzGR?2ga3EUP$xd5WZ)>^C>-C^5-gDPjX{)`hug2m zqow#noz#R28tEn~1~rSL%ajnbY~Q_vtFz ztSm1&?UTPn=UJYg))4SsH?Gt+buBX24+IS$DzSLqQnPIn;2tvbEQfQ{eGS@Ua4;%U zW^e-(Kamj;_8CXL#m$*dBCJ4x5=te3=glq^jNN%MHYtgp!{os>0sxBhCvVk1TPrGF zH?6kVR{E!y@KdkX5K#`3KjwIWpyd1J1|I9${nbAD&1Ywv+WPi5>400ryA#z_#Ja=q zroL?R;^luJ>fZ+OS(1PM%wh>@?!dq@)a0p)Vy8bW%S)1~nO20-eKqrSFzLRRt!wYJ z+8Pw)i)|Yx9j#V(;qM(j6OflG2>|;vIll!+9do}>*c#Hu`P!~=xsjd(uZs(HljWgF zf$GvH=`)}|!DKQQ&PVBicnpf*w910aa%%~JEj4l<-t&vhkl7LJ)kPxz&A~aPXHf6? z``fCG4ar)3DWkAM=zB)yBcVyfY?BAJQ!`);Oy!=lJ#Sj^SJh|JdOMr1Wt}c>iC@Bq zE0<7}p$$`y#Qcv+esHuMV#>*NwO)8OKqz5&1&cQ3A#`sZ07x$wQ~SMh@4JswW{Yqz6r=!Z>q_Ho{{xz|@RZ+L#G zcU%O1`FW<#ZEYr?<#T-%MYbrBX(y*Gj5v#ydripFzNTgmc<|cwu%zvLUA(4BJi9gE zqJs*m-$VhRY|q01&d%LG-!HN}cOklsNa|p^BjUHflPCD<17iR4cj>8uU34?t)+=XA zd!6R0W8;;%wi%9uaTGy$2j3MLs7EwY4H6Ox0uAHYaQbslC|9QP^UtO^NbdbSU`_{f z)3n#_<+PjL2U~gMVBTY&aY%?mh5g^w@aP@PX)?a83IqRMk=hp@palcQU+sCrQT1pI oe&E#J$q-0@1pgNX@ZJ52k#}6ZwbR~!jRd%T(?F*}`;RC825=%T&Hw-a diff --git a/openair3/NAS/TEST/MSC/InitialAttach.png b/openair3/NAS/TEST/MSC/InitialAttach.png deleted file mode 100644 index 35723a48fe2593974950dcfaee36faffed9518ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32243 zcmb@ucRXAD`#*j<-JR|Zv=m)xHB_rM>7=D7HHx5CHTGUXbf~)&r9`c|OJi5;y;`+b z1tmz(6b)i0Au)chxbOG){Jx*Z_xJmZ^GACm=e*AAyvFmouIKf<^6I{p+M)ft`ymKA zbob6JT?pdXgrJ?nzwHE{_)FD^LeOdG?yc*3K1s7gQ?E3+GU$GlVYi5Kdf&TfDgE$Q ztT7Y+(9Pd(oZzDeX4)Kc_1G<^#c#c)qS<>0v;aYJVdx00?K9}aU5eoLnbz(9@rlIG zz&f?ac{qO@FO;A5%amjShmy4Eb?X%F+faD~I#LUg8nR zHG!bAK&bpQX!tM|U9R9vhg_Vnt(%k3&ib{F&T~E7^P4XG-0M4_peu=+>Se4zICyVy zEEhwa^e5Z*v%f6pa%tGoZI7* z6p9BefaAY>f*9Bcge&ZU#WJapH27q3#H1uW0YH1$ax#;p0|!gx$QAt9Y| z#3Jxb_**LD1O8&ir($feVa-HRy}MWo3|Y3@_i-1D8<&EYpq&luyMQXG?sElQ7%Pm~ z+~FfnsHDO~v-3U`V1C5BkUdC$*T4DO!%)PuGSNQpRP3i2lueZrA;hU{k`KcBG2977^kGnP0%Hma`p^EX2uV9YPEk(dlq-r7NsqyWY@V|SC-;^coIp` z;h~&oU}}druEGyL_n6feydARQVl!OKaVpRP^rc=^eGAHeRCjWOQoXb`sxIogse|pz zOfnH0ayPfY)*k<4w$UwfIL?9BrqA?6VkI2ce03iLjes|J)YBXKByGB<$A7KU7j~z2 zj_(GA@3>h-#9CX0t4)~q?_eGD7JY|9k{QM6XyhSAi3Ojx(q}g+;moX5UQ<7{R|Y1y zvt=)CcF=93Sku+c5zay@+utaY2UQBg!3^Z0^);Bq}l%)HcfnRj>4%;FqpoXuyjIpyFpTVQao z4;MHjG`S!jl{()s5wid=;QZ=aE=ZLX4oLVx);u~eFc6J~UpWaTRm6bxY^IPT2)19= z$`*?;9~sFxzX`cqC2fos=F&K!19J>iv)D;SU24WK&qzzt-4uz^R;QDej|MUK2~oy_ zyC0jIoA*iw`1_wq{tbc_l-M)#r*lMy70zXpf`jQ(nv;@6x~!~Lq#fTLqO}PvVGd4x zPH#X@eE96{9~h|ByRx?C>v0zJyU1up5ZV;Zy&5OBxvV{<-BmiDw5`RU2 zJ8hU@EWObeZ7Wn0veLl8hdmdrVsVM_kmAvQr=ez&wZDyd-y#?cUVSbaTD53jQqg{Z z3mC9%c9vGtu-$-PS72<>myhj*rN{@lyH9}CD+{2(hac8HHe%+`g);ubc|_cQNIA)) zBvpTgX9sA=NOWUYJtqfugbA}V&oxCNcoc8wg_~PjB2=P9v6$6Zp-nCZxbROc0HlE; z0pX4cRn-E*L~*9Vh?7N>GE2Xv=f?WDM337#ftQ)R@}+^xOToG|8E?qSW^bQs$y+iF zo}x+Dr+?tW!Z-!<>f292c}-Pt#CN!wFa%Za-x6YDhCA5!L0dYkz2Fb6YyV@=2Caa0 z0Qd(DxYdmgr#$xN)c3kKoa=b0EX$b^HgY2Srp)A<2;OG>Ay*$2!hKj&(Uiwx8>0Fr zxNi)}MvpTLRzO1f0Lb~5=&xCZf7i-sLy3*3}HL=&R%^nQh`eMz0BGJHAfr7S( zakJs&eb3djd7P(SI2MxakjusHY)ljd(_nVHR6S8;e$>n9L1mKO7MKRPwmSBx`KC<<*pgp7DB>f( z@cdaK%Q^J?Kj0E=#n;%c@3!6tr`eo<`}X9IT+5g!uP6JCYW~Fi4NKPqi#DIWo}YKV zqAy=Ihegug(a;)pZQ(_;Q#E1}lREPA9>R~u?o=&j4a`iLTnHE66Ryd&8O(Py&h>?< z?v$-f*8H!FW4Dz*-q}yH;RN#Bqf9^6?G7{23BKz;CjaKycr!#cJ2b1u?tFiov8aaeq3DL75A9E zx4<9^GB(C4&8(%Ipt1P%4NfS|@;e-XDcKyytH9xPb#)qWTJsKYGao=Omm_nm&z@{F z$ZM*GL*=}{LK}T&hUBnTSKp;mW@cu7-4gLzI@qa01ZHi@`n{Ll&}HXpj+f`Z^*naf zkZFjJq2A5AdTG)!lO9#Nd!M&Mh0IF?jFD1kLg#C&x34|w8`*vkjEsudb3Y8f?;;j9PN(3gw2{Ws$i(7+zQ-y-lqP*gbz)6Sqt&1a{9UgyH;9@6XgxPUzY6>&?nEqT}&AxA)8-l==DIKJr+?;D(5U;ERvfY7vWEDyGMSZ z9U|BueWSfx-F0Z0B7p4sbK*qpkcfJX-j^l2B+d*jN=Jcuq4P(kry}P1M5b`9V@rmQaC*+7j1DJEtyuUgSvvq z6!|5(9PAv`hbm3q?9fqKw;o9IrL#j_V_C9ds(VJXro zhrQ>W-bRQIrx#nJ~2fCYr?N*PMNy6=1KiM!@ye|JF&@BYBP#lKi1?KApts8 zzLV{;fjXnkp_q+-J4J(`Wh zHHF(ZJjP{~@W}D08GVH|%@}gE&pzcTIncd);2ziWm54g}-+VZ1NRj*KIC%u-WgNA)^(BnfPePH84C}K*rmsI9 zPP-k&Co3?qaOK^8w8lvEfT2yC-w`;Uupd(wKnN7Xfkg)y^60Oq@A+2JUnb&Ejy;-P zph6;{N^zKX6l}m%gS;|EpoSC5 z`kY!;>CaxDgRIw;Vf8caslee)1XH4@P@3Co%80c46Ptk4cv^^mEQZ!SlejRbuWsxo zI7}p&=Hi#GKh;qS?9=>nj+BFk5Sm?DA~}- ze--1TMpJA)+5ebnf2UsGfL5!vGqwdK*(g9-emJXK`LUUPRbAQ5Y9L4JYqr(HyBAo- z?|IgZn}VD z7N_;1T3B$4bjlN7Mw6Tc*&)lrwf&9GN`S$iQd)9@vm%x7tlyIv7*dg1pi~1)UhUYj z30-|TtE?kJnIAcEy>j4_-`<&4>lD=x36`JpTJjt0+*aGYEe~qFL}l9WNY&aHx(3~;&3=*f{Kbtgch(>J_2mG%w%l{1lrCj zzsqu!>=+oD zNi_EQ3`$=iTQ<=?E8v)+Nw#V1K@IHm)1ii!?s*zhXO#>Zx*JtU<^3AGyU}p5W?~zEZz=$s3|H!@E zgNB^S9$}v7O@@_ToQn-V79Yqf7pj)QU$(!}`I3_G62d4?FmG+F?n}iJ>FE~luf8QY zLMTj{E{ft=dBV4@$bZW|uyR%LOyzwI^7M(@UM$O>x|vMP2&-;GB#VqVwPYN4)nFC8 zT?don4^3b@)Z2ac+Oy2~<8z5v?5chWs;W0RsENe-*hA;LjpBEw-f5mh%x{?HVT|Zp zvbT^yVJ2e8;=b~RX|z>#&MA}Kqx1gye$^Y*9~(}+e^Vb;-uDP>)1v^`s%I0pvK+8T zDK}n=T;DmWWnx=z^Yb(A^xo6Wwlp3izq7)Q7a7S>#6M9r&oNqUxCw5v0fvX^h? zw`leY9_2#~Qv6Gn&j2Xi4(Tm*vP3>TR&DnfG01bPHRqoW2t!bN-O?I$)2;hs^f#R3 z5jk4S1Ac)^_T6qatgz}I)7)1ORXe-uPc>=1KnE|=zDuftg{%yaX~YRG-eU17dlBp? zM~}}1LT;s+<-fd?wE|xHD704<3w`>mAMx<`hx4W-=c<%%9&AUCz%a`zPu8>=2Qe1)`5T;DcUPJXF?3fnJkdI-; z+RP`b)9H*n&()_2N>5eiqo=s}t^AuCmLlW<${zfq^w7f8j7C77aA(B=?BE_#gkBJ4ud7*>QGODy;A_*VO=58G-$fSLzCgB3xdxHdHhp ztgc$*B?m_q2~Zn2%5Lm|AB?4n+r15c%YQ@7oM4KVS^k4t@zb5>)(se@-F%JBN0hzb zZRHjRR537rO=%st^jdy3p?uTTstF9rGtMiEhiNi&%4cKO@7n~F+%>&K@!0k6-+NN? z$1#mRP=go3i?SIG=CBta!gsz*q_y*eu!VJW4>EOy0l zQ)_IGJ$#Lzh&#%_%{={?O|{c<18R#MSA4qrH=N<-M9PU?!#T^O;?C#O@cOV-wpE3o zRdl2u0TW-R{XSqlb5WnS`*wYaBR=xBx&6JvIti{6!4J7Zc zg~;w5MXu^K-Yfk9n1*w`g#$l=jdc|iErwueK9eUAG0Gm;r-lx#JGS{T0D)Y?VSeE? zv$Ddn;UkwbYoBI>tA*RwkyDb-@;hezrzW-J>q$IH6pN>0!eF_?`2=mXQ^Ba9-Un=^ zt~}`}S8L{8h5hTotBotRix0x+Su5--<51>aw@Kd4ERD zAxNzN@J>+u4t%3>VP`2%-(&>-KH+wK^Y?k<{mJ2u>2)u6BW(2NQRnZ!s`eI@ubwIx zM70YMi31`x&&ux2I+aqe_5xq!O36W)EoAgvs2-Z23UdX8Hcm7K9oWW}AbzU!Ky3}4r@yyo&B16Pqwp(Q#z8~n8b|Ne(>L4Ha^DMa zy0vguh&@wn)E6~eJ=R_AY&?S-SpBlQaLu~8KVzkH$1=Sbhaq3NbhG?7a9@1lQy0^8 zKq0b8<=zFiy^muPZDs2u#=dO37!dS`KUnEeRDbc<4-m9N5Kk(|DGZDU22v3&U&gY?bo|Imvwh*O zu+0^y*Y;OND01HG9=WsS_>3^eLKE()2m$8`V|6&u=e$PT=O%lr*+CP(lR|CoRxiW( zm2I2-l4kFk57Pz)2Bb9w1qE+j-c5=Dh93$NoMW)0H5qkpcMEQjp36U{U_5XO8H}sT zhk9#L1NhEK&c*WI{{CYyMU*PbYsiR-v?kwLENd}?BcHc<4!+Y?E7h^Yl6Xpz!sc8( zf4-spvPY@qTz(a((}#Ap4tviZ@`RLAh&_5~L-~>cg{y2ZUD<~*$QkvXVc5PPBZ4iS z8(nhJ_uU7$&cJ{GN9}`hJFuWzV`ye*HLb?%lUc86jj6-$2Im{17hxiEF{!uvQ_gUF zI(NsbI!Ej^-?2aNCm!yO{4vUl=NqIAo>}3anvIPQPr{H*=-E?mogC!bu?e05xZGbQ z@kHH|#w*4WM8Ry1S2tizi1nJDC$odSFiKD6&k;B2!V1q*;VXU;C9j;8u&9#P%6z`x zYjbeWd!xF1j(o~A9y_KZ@8*irU(*ZCU)JaO&Pd!VbH}5^+Pp$X zJv^j%e)U#OMzigojRl6KeUT48PCT(LlT?)m&K~{w4p*Gt`viv({}8<}6h+#6AE9qc z*bl$f21r?GEMzWw(K1mqUd8CuG448rrMrxT_vHrKLyehucOf^Auiqo2J6$r)$?!-G zO!j8z-9(H?@%ub{Y8rcU)QrzYk)LKaZBUn#ijrxFd`KC%f&H94HY_=mIcL5`86p?i z%)+kDsJZa`Qu4bJbmt$@1i%pqqk0>{Db1QL16ux?w^7shB94w{c9UP1~_U< z@x=EQHkT>cQJDQ3IX{YDr;>Ck=V$H>&eyuVJRY2OFLjlm<=kC4(CkVby#BU_auYBUcaehW-A&TlMQQGHwGoaa)3M<>lYrvSd zPYZd6OoRPx}?SlgcCtV>~-b zRWX~jD{MVIXlAKwCxqzCsbM*r9~{T39w+7aB5%x%K$OV60T)gP{^S$*f=G3-h0ni}|@Y3LGXiRS#`0|ZcO{12}Sm`Fl zwa{sn;|`h}0cO!5f|YJiPn4c&1a#OZ!2-H}rJAv>`5r}9FDAICOft_@KDq&=-QAU! zx^j4Hvi}V3S+VBv@$V@8zHY5{afvE2NleXQQP!Gn(wo+dy$^M4KlL)V{axgBF%t;~ zoMK!XlORXIs6THeJ7i`yf zQ7n0F`4L?|-V1LwJZ@O2P(+x1b>Si}F)ESK%0w(-k%F1k(X8qs9Th)RcU0J)`7_LY ztfFOaolxV-u~YqxaoUtSwO{51gACKy=5e6`;h8)n=+2W1x95dci&PNr1c> z3TB{Wc>C~_x^3i5y|{adRE@MvWMt+a)djd(fBcWl>>8*3v`R5-TX@JF#-i_{f*T!C zj2_H9Za1Hn&~#Vw6W(J}q@W-kN{VH#+j`FMi6TRBIKK+9miz~80+C(Hi7=S>9eH;n zeogQ3j2gGFjV&KMbkpSWJ?~LZ3+x$Hn}waNztoKcAD!DC;n!1!$#ikgPodTJJ8BjicGwSWQ6zLT!Y;(#a5P{4Xr-Up z_`zmomLQa9?B}dRLyni*?EBMUfmul{OQA6$j%`SkkmtB^42U{DpVN3vxd@bXYTQIs zl2cH|w#$7Y%|<8UPNkWe&7Mf+*R3b}R-0n4&7teuJ*^VGdhjGdQjx~6t?>P_NDry_ z;qIX)$o3ySe{|g;D=}w96#TR~`thjB0NWEE|DgqNo@jIMeKV&oXejg6!HL!q0780T zn9$f;hR*cG)Y%=*BLzpN=`m@QIu!3`l>me#)ygH%0z25w1AL@@!pLld9wkud(H*EP zz?$YGv3g$~BMB+Y%uLj4Y-jA{(C1b`xva6LZJ=h zkX+vhnGx51jQTuHiO1%7UxSR-(7W+BI@S#`AjIP9X8&JOu)+3`tagfrgoFC%ku;z>N<2>+OP`Rezwf8 zAQVr${AyXxj9|PpqQ~kwTSa9FMga?#x+6A84OBu{j z2|Y|1Z!0AXwyRQd{`9C7Q}Y}!v4^S^LBbmf8fGvU0&gFVpE3FQ>3F&9tMpVUHu#wXXINS_jP8ekA~PD=d(-C5j(8*Tl-VjXyYE_*#ye2>%KHTz-T@q7uRbqd?2?@~X;Jb2 z-N3j(AAzqrOc9&XN%Zqx)(o4)V4_HF$EHjot||MVl0+WKg{rrE;2b=wr1R*tVp)&7 zA0=o5rqS@7wnC`iWkN>Jo8IQKk^aQeR%|; zc0#JY)ht7U)y1+M`8|8K;#@zUSvEtYx)^N>Rt^+=;jDicnhjN7V5iqc)_@W8EwO0> zLG1z>U4Fryt&j<3d!A@?Twt~|1PPOyfO{@q=VA&5tG=HdFy%FE{hjNF29_2Vr8Iki z58d+$>^Kw~fP%!C>+4DB6yW*)x&fvJSc|pV5yyQYz2%0bGng7?lm2uLp7mDEmCc@fwn?ekn<@iyRaf4Y3EXGQ z_w0if=wB+`88Ooy&AORtjYZPF)m3w&mqXXoVr61e9sjlOl`bc3)d<;MTGv5>UGMo? z+`lrLVWoEDE~lH#80hAuB%`fsO$KlOjl|!Wy4g2|Bd8abEQTl%O zY`-y1diopO77zIGVYogvSe1)GJP&Su1Oth2!OiuxQ%v_+*+O)kn}`zV>QyP6RA3F{%O&3sXT}r<;3o%cV)biC2)QG*`^-M zFG8DXTrVacBNG=`s9xOuOx&Rf1GX#Y2^uLIrqTh!J~MzzD;jgW)&4c4v9tMkZSZUZ zM~~qLQnY7a>cp5hs=rD+Jk{nCU0zFJqI%-DixRs>PYCZn5s`|&OcXcCkOAw-~6dF65Y$AtXXGt#4L(uKbncoIzA_Dqghq87+T1}tM{WC@PRHNw2 z_JU7}WCgmI;!3;ZpoQI=n;bzJQZs@Q?Z!Zo1Bmg_(NSy)lMJL4P2p%j9R0@L$!z6~ zp%swj{FM!~-)QIu3Y&YqD>Ry?$JvF0Y&i}A78yQ%kl?Ff(@d9(T@iCF3^>%9A2^~w zA8Pn9*eipDX}9u#@rd}a!a3qpHas;oC9Me_s3yFV<=5f0Z>stpy0c_VbYbvl?5iok zV8_%Jf=u|y@5>dV^TwE8h&__rMumYR$m6uLA^b)qVrq9X17*r$AQ_8<~3ENX=e^> z7JE~hz$K9IW8lp2L+`w*dyX}vy8W&SBbC+DI#z=Kvj$F0jqJq(mBe?s2FBLWtOTD~k z3qSuBrm8sw#tGWXrh=F@hAjE>Y~uORq1o**?mN9lw?j`xNc$-EXRzkK*`@0%hb1SJ3{K( z&Sk^Wnv|x@>oQtHI$5L5WDgA)trWF&hsm1&|AHG%;whHuyPhivPjM6MOWvE&@pi}} zx;|(K$^oL6`UvisO-@3kFKSTzXJ%ZZTzJhW?_+{3Jnh@!c#wWgNaKWuu5Ymo>BIzr zAU^EbZWex1oEEEDQado@uRbvC@A|m=@ld*ljlqyoZU7f(^;$3>6_xrCBO{kT%M;6# zht55%;2n;uud%=c7`JxL^}Dhx3K$OSE1#8ml}3)v#U_Uegy$6C=+`?V8&311`qg^Q zC?g0mun#Y**|OR{ZveehhTqU-NvwR|P3|Vjuy^!6KsHU#%rTQ(Q9-9WqP}{{3JH>RQbVcI zR2^Bp_iH5_3klrwdw_Mxu>FLFy!y)h*Yfm-FrHQlmJ$1D&%~>3*`5o%Jxw`&p<#E9 z*XtqMxXF~iGNq=~EySEh<%TRGxL@flc>P&%V|A6P4vl6@#`yC~4wXWPUl)en&FQz* z9T!WukfN33e9|;vC=iw8*M-GU%m~w7NCY)NUpLwCCnx#inx4Q%6ft`$=lwl8lF7f1 zAT$2lAyEgn^N9r$4nYXamhBhMEa~flxa2AKjt{02_E((DG$9vdc6MbuhMuzB0N7Z5 z9LQ#|Sv#-&b)khK?i~1#Ey0x*WbO)jo7KmFZ!3RN;(-*$<#wuL(=?iA%aDwaAN%}!PMZc~Hnq1E%#)-?P zCT3>r6Vf9iBh!wtxvb`Aa0o%n6us2rkkH(l87<)GTSAaU7O?s+S07Rr{lx0F5R4Sm z?tJru2vk6Tpaa$k^oDKayG|z=!Fe17Bh#|y$k&Upx}r*hbyLY;RbJr$fV&fHp~gW0?67Yky;|zxQddz$n%lbN z&u@dpy|*8y9uzkbL(#&|Rs~48iRx`!XfBw_al83N8r}7IKN#vDFqeo%#B~9)uacU# z%|~?areT}-4Yv3mm`)6yT@9Sd!IP;|XWK%3|ygLR`;2V_g!6qL_is(Lp*#O1Sh@{-rtb@3!gA)t7M zv{b=zecO`P87(0s=*Srti#E$c-yW4teEg6Qty1nN-mKQn(a%G0Hi~>w@L6ZdzW)vw z>@og$^45{K6ik66{nH#(Q|7s5o?%!U5p z*9mZy>D7*5lcNXh8T>V6Q@uxQTdvkkctgPSH)I;D$#FDL;;GjsJnyemd)2IDKIAg_nBJ0K=~C zTaeXuIO1X)=8k7^S8)p7gV#x19f~%sRjNFBKR(x(lS}iGc1BX!YbVz;t4(sWBn=o? zMV{06@*!5}#R&1lZp(RXfkv2oKu_;VA{SnUYLRwO<0O@Sf)xSIvJT#jXK0%s0H+*jW2FbnCg1^yy~12QB7m-IiN zXZb~T00_C{v&?&XXEDu9`F&TNvt|bcGNR3dwAw|0GKplu%s$l$3$Q6$Y2DU#`%Yr$ zX;I4W78Gi0Ytxa;)m1r#BV%{AGXrCfdZmfzE{$Zt?%`ge9FR^9AICT(HXWQ$?zkqU-zF2poZ|h%v^~L)Jt7Ca>$1t z=rnY7)6QsNivGT236oSb8Uv&PE!+Ld&kanp=;QxmPLALE zI+J~ou%h>74>3E`w{jp829vj)Z|+Eo;NIiL2L%~gvB@%sL!-TrqAQPewsy>FiOlYJ zSwv3r{~|q|Gi*ED0dFhKLi0Jw)R;63iU&BtEs+j#X zhpi|elvWAtIMM}FR$0;nH{mx$elt&Wko`87Gxn2LJeH8Knw^i7499lV8r#_@(3Q&k zoJvm!6TPV+y9&cKYC`t>@;KguaghuEf7h~Tm(HONNQ})A?hW6HLky+&k%tV`)9`D? zBSOmgI*B|L7Q5=-{sk*Ai*Yyd${IeBcP86pvTpQ1ih#(~oZ_q)KR%Svy~1K=nLy^F z_sBr)3m@U7))}d4WIML3e3^XdPO}+J$KwvCVQFWRnT)#mbL_Ide0F%*ij2_y`r+-@ zC=WoR=cQi74oJrtF%qj0*(`VlV*zPSyh6;uolh1BF=^17%jZVeJxKXQOtz@O;f1+) z({7`bC4!oJ$0sN{-bb9OIulaN_rPEwjKlR@+a@TE{!azET%;eduFw!gzIjkoC^B13 zO@B4KhZ~EGto%?oVI?@Sm-uVvST2y#KtVH1+Du&K7MFAvZq)24HHQ__n_^z!Rngmg zytHMqNG+NgcOP}RXJw1dpGJS+w8n;J^+eslM*a7N18ac;svGwKCPP88+l(=y2cR0x zye^{a+0-k{EA4@k+kD%bJdO9nXyBuIV|9vi7gU<>3U|qpu$j{Kk;nENRMYuevfk7m z@Uvl+aOK_P13++dO}>ptWjnFbKUWq%xzI}eFQ)bVS!hV%;-Q)-nDfoc+oroA+xvaV18~LkZ09H zmnVQCbF~hRc*{R3^<4iZL5OIr}Lt3md>aUPSf(klVu*uSsy3lhw~|( zEt{&IP6bI8AuX$QObblZMsjuGPpWGZa46+Y{*!FmmI_<{EfsF(x|Y^LsAaZQA(K?x zm%{!}vTdLFp5@-gDivhntc_r8%wzY&jAV8Z8z~N$(V1IZ-O(letWS(- zr3G<~=QUW5$r+piC%d*tfh75NaMd@YSFhR#u>X{9107AARc6VV)O0$bZ_EcMM^wU( zP>*&=;BFY$wu)$_Y@FuHwC z`_e}drR>5}o&KXIs3Oh^p#ybnrp)KTcQ*HkN6g~0Cy4mp!rkkq=5GZ|7*8L_>o-&Q z)ZJ~ZKR{VhCw>^Zo#D(})9iE4=r^r%${sH1MSTM+ej41O2<#Zf>4u&aeNqUmwIZ^^**(T@eI-ZWMY+#Hp1M z_C9?y_f08sUm_N0N}&3)Tb?gwbd`4gr7>YUI1=sK_7yx7h=SOBBqQh3jl=B4E?o#} zV;WN6Xi!5_msZ672x0;-Uhf8Y(zgNL7aAjizu8pSKSAd0fjU#MfK#8OXoHtOc9PY` zftw_q6CsC{Qf>ZlycBOZdZ)-yeNv(@?TOOM5R`RnjZ9%=LqOT7HTp^_$$a`3Xx4=n z6xVqgtd7f1CLpuE#bb=bJMk?vIau(RNJF^mwAwkM_z-r2`$oGNRTLzFma|g6-MqE- zk>Z&&kz1=%w!-fIO?J&*=YF`7n%+efg=E3hrI`bd2QyG&%pY_n|FaN0X3Z6=DdbQ? zNUiB!`XQp_6%HP~&~{H66eFO1#N&k?C~#Y~O2l4K%ju4pXHkYQSpVrG>f~&}0uS8U zpZacHZCV&@*;2K)TmVA^Ml4Tl-+x`OBsMob5A4s*7U?^`=VF=t1&0;{gc z<>@9BwmidCqSDVr;Z ziHBcHZwzW?&5#Xvbj|4bOa}^NQ~!QN^nao6DUv`qy;l328_2EMq!_{SYZ# zb;O~YJ#J-b9{duIQ@2;C`|6f3!mxBF?Qi?JI5^KS=+qAj)!i-G`zWSL7zx18nXty3;+s5}PaZ5D|1i=elBaG)WZd2^6Och`*wrfGyX%%pc z>HRz9$33#Ehu%iUn-S#)-R59n0}rhd+nOrrGrpukY?bCF% z^KXAMS^%1v0$KZfhs}uZ6-^$Xwj-kqu_j8)(JqxVA=$T6Gcr5L$PHe5U6Q5|L`L2u`>n$^oflPQk2bd@$)+3N-ASaVBgka)XY=fQ}hdZEavah6`n|w8H}k zOX((JQy%KI9yvJ8(yH5Oc~cHQ+s(!U&K=@3M&eBV>Jhpfh&%yhH$4i}wQ{f2s7U>O zPsdjn@8ao;l4dussgC41E121`VeOX&OOH`pFuuSM-cHNGo;wZR!}%6P@R5=6mn#i1 z);rX6VOqLEkXgqQoKw^j$*X$W?=&szM#E!P;1K zQwfZCw{cj6@9;vDbKEfdRX|BeMZrU+unvJu|;b?OseBPP5iN)X%A^% z`Vlg-MCUXdi#_~eT?^UEVNgl{n{zD7!|8Zk} z9BaeOcL;ylQBb|i@NCGTLRb9hScjQTZnetk44t1%X?;gsVjViD{5IOZ0*6pWDA&is z(oV1P8k!D*HT&le_RNkYZ42_)mG%WOphou zF`(AA`42yG)kQO3J&oYx$emWcD3S5Dtv6EfRt?bhu`58EKEyKH(v3&$9aXS7-nDW? zwpSdBK*m*~t^~)Xp6&pI-VSiH zoLxdJenMAWKtD3V>4n4VQV~s5-=SFBKLx*f0Rs_?MbU1!m$9*#)h+}KgysyEI0D^J#a z4^-gEh5m!^_z#-Xe`d;dxf~@PFgl3XK?d62)L`s#QVq?B} zvpC0g^J{DWDlQ2Eewyv?UAZY?rIF1#`iw>3>Wa>*Uj0G8u`uE}h&0}i^ehvbD%NZk zDXf60O3=9Y*Blbly4W=;PtOR5ubV-`%`3SMcLhgEW65a~&!@v?%W~C<2gfp(OYF9Ddl4P3&u1>T zbG@wkQn|oir$7R7KJg^=yw-m=dXL_Tuiqs~HF+ytoPT!(Jgnnyu`)=Aod=Nt`}kks zFoKR%j?Twszz*T*A3RV(Zhe0WrL<{_!+IkOZvWqTVlIK=@Q@#iPZu2$cYG6miW-g4oZ7ogF6m$Miqx^bB6zeyKsW4=-qCgs7QJhU;|2))bnS&GyUY>6*uqQj|jRSK;P(g8gZ`-V?Sh z_8B_uQQdRV?;|ohk2z`X*!JLo`MdaO@lY0`dhu|wsrc3Ebyr9b@-LZ z2uIQSV~WK2l{ZZhvRS0ZeMk5_{U@ogSHW?&)aI#c9$!yh9u8=yrZ%;}U<{PeVuXM6 zu9j_0{3Epn`_B!BME6H#UsSs?Dyyp4mKc#*ywuJ2DuSLE@$7IIga7FP5CE`kp-1;` zq>_;ewS}iwCwP)nlRKyC&+}Dj#TiZ??w3#qAYj*~_Mp{4HHFjXodz_a&4we`l%0fm z>wcc~ebg98a;85pa!2!De33(;Msc_Mjb2z;9^PN?&L>7}*ACoN(V$_u)c*Hc^3ErT zKW;1lA74JsI2~m((}#5}VQ?9pGL%VaWDmND8#6V7A}jvUai~G{q=7+Ic8KP`lf$IA z-u)dU+Bt`MuX)xP1L)64Z*ykCr#2MG_V3EnUuw&({%vNfzR_p_ z1oslRxPq>@D(~uBQ{HE|Ev4hJln{fG?qO^HSzQ=3U{NAjE-?cz6e#yNf|f;NH_*0l~^L5$zZz=8WNKwKXOa{H_d{O#XE%=-hT6#~er4 za=Ez)(WFRf>|To^X*Xr9K2N%9%sAlF)1v0MsL|o49Fde7feZ=Mqk+khj6NFGSzngu zrg2z9Lj`N~(9S?%i5P$_H1v_t)8HK#(cRK-Xa{&X zPOajMJ?1Ta%G)`+F?|q+0n_+%4y|9Rx4$IhSGzFpz_~kWNtq0Xq?HqNN{cTuOKORJ zz9Dqsrk{@f{*~A(&fvTySGI8Ysp2^%N!tirN8#^T#1l!^;{uT zef6)t>p#3@X0r3}bL(9gx_WzXKuy_K+`j)BvdlP)zHn-kcvz0zbRs(fsPD z7Wrd{kmE7^ah@<5C88`v?cA(ofhLd_XB7ZXeC*!30PtqxPHo$1(m;X62(&do;qe)z(Lo)cgkWoV;Px0iaR&^8E9#N%p|{vzrNx{wgWq zh7Yd##4WGB?B%FGvb|!HzCZi`e(Y*tRX@VvI7g0WcT?|&uN99p&OP-?{G)KeZ$_{0 zz0%9F^J|P4OH}v_ZA@;0JRQtaf$q(mjdN_8!+6Rc?*EOCpXBxtN_w}4Z3?@PZZaNe zr7AhMPQ0pi&`^3BH;!bct&Gyk3-^ZCObVo^&LekJp1NHs#INOovm1!2d3KX;CMUrT zg{xS5Z93kt2cev3lUT5}IdR~Oy%Hn#sI*t@1#eMKhwqc8WgQ?N&h1qpVX>hgbLeJC zK}|$k&BGrT3T^(M*1j{W$!*;>7IdMMW>gqO?> ztNrBeKr9D>0hg3kyR(qSRZVf>eOX)}*PR_Vh!syW`3BQYF@85R8`d@m6@5AFk$EsA z7VxtG@e{DeY-YAkE2;Qs;@8^ckx%4fTM`fh51uj=^VU%@wr+F91};ilT13QpV9dAK zBa_KjFiME~r(u41)>Bj~k@>4J17~(YG$TMCAL4eM&2|Xd8c;i^1hWd#u!5h$rVa~` zw~D(R2S|lQsKXSaqmc?K#YFRALSxh)YQE|Q0_Vl9XCf>IW9rn!<=2DK z9XX=c)skj^BNWu5j=@GMU z&9r@gKm|8xOt5m^!7iHhwl%tv3nq{qX4Yd2M8e~iu9M8`sujSEaTrx+ z70Yi!U2Ip3sn;v~e|-HrDy#>TVPnY$?5ZKjjkj3I?e;S4xBxRn)c3vm85X`i9#JZo z_op4p@vqcg*tlkWn@mz8IKABfmD3;bARzpbl-f7={zIbTlCKWAg-l!s{=^d2JC2Fn z7oZ`&?aYi89$GaYJ4kg@@QYmv) z3|hbUN+AgPE+MD6u;y@Ve6eJp>@nEJLsJ?n>cm~~iKaR>NFWHfp)WErBzkn=QrJoy zclVjjguwXto;Pz;r1?XE`|vm3GOh9MkLf)m^vP_GeOvN`sIL46h!J12{PDIcgcmFq z;P?Xh)fV8tiEIZYz%dUlhf&L*+do@Qpi64$ZXb zR%e<7YkI@TPUy|tZ0L)cq&)!p?yzq@8ETbCl9uH=nwUm>7`}tzdh>8S*W=4hA~gdi zd~qyJ(gVwWaQ=dG9E7&mDaoo6O-8wDW_h;3UyWS4D){wO^H>&dn^KIdNxgEc!Yuab zfW_P|x8(LpM8M8Dgo$GZt@GqKt8v&@{EKZ<+n^e%I51pMg!QZS9M@{3{oeuwj}{PD1Zkd zX#Y24YlugK>bWRmWAgtoDLF7OP$Q!Y*hCQyzbR%(PlKG8FT7|i+OIRvDH{|Z498&pL|G#Hb#;)%jGlXSP16tdk6f5qUYaN^GV(W|CJp|n zQyNI_(662&d}04s(I8P}!|&ruzM2`)%?R4HAM7H1=a{2k*C(?SBgIbHb)%MF-F$yF zTxR&_m&MTg&zwNuw8gPqb{6>1yW;O#E{I-q$K%ZygT0@Ux=-i*gt*wFZ35E4@53&+h(@#+*l>vn0wij4F?Xb4DfmW3{4F3$z zQtr=QNYd7GT9~&Btd^^O&P;a}630Qq}GpQlX_{=&b>J-w>_?uiO-4WfH6V+k=Q9aHePOVC+nRg;em*KEgvsTUFJC(G{ zQC%H7d)Oml_gGF}EHCVL*{O62mN+>-FA$V8=Y+z|+@dc$n?0_Qvuld~&-KSzgip1! z?ql~BEw2fK0WBT^!9n>=NrI}97Xfv5NSasqmNU`$wghTQUFn5xYEwmTj&P)9K~U`W z`zoZoZXuYxqT{hgzd3fs;J2++VCYuw!5{tw-ol4kPkWR`B02E7+oA2y{e9V=8mQM2 zZmF10=&gV92}OLjEJz79lZZPPC`K>c13@)|p|ZQ8D3@xRi(3b%ji<$%5Z?pZ^Yb*% zu<51(g&dB>f139FfBSVpEC5v+lQY@m7@F^%H)tJLF&(22@Mq;V`!eYKl$LRnZN4XN>%oIf)!ODe)%t`LEoXmmWpMFYPH<1hGEiWGDhky++)7n|GMV9k*Rlb#bR~)G)Kd ztiRQ%op8WkWxxV(ffo$`iKZ}o=C}Fz@b?GLrISrqSTAbH<;n~A34b-?UbKq4rhFBn zWXm_zyAvTxBIJ?hi`*Moj#Svf$id`^v;W0BiuNallG1U>bPSzPmFL%*oeiY`C;P;vaCSf+>es+t-(9$Yu*<{Ny5xo)m!E zesSjl_95FZ5}Ht`8?v)5&P^S!W)*n6SJK6(?)dvI7i{}UplM292Zi^58tBK31_G*Y z9eFi*cWlQyKaGxa)0BkF4&vE}Asy0U@7Zkpg4UBjjUWxht1k?hzUsuyq>ozT@#7W6zXG^BoWTl#tL;>J<37w1)lyW@h#x&5_|iR2MpKLYhKO?9%t84=&Jlp zmdBPPORpFihLN2NrB-HLGWqaVf( zCyG>k%$-OM*Z`Bj&IQIfFNTtxIa<*sF1SJ*I+OS2 zM2zHF6Wn_^F3npI*No|dsnZ)(AZ|DRzRNVWmm@t%vqLybORUTmZQ^rQGFn4SyjDC; zt4-K=Pv`0Zi;jTo)^Shiuo_}dYh2Y{c!D!-7vsfU!V&6KY}wh_Z8G+f$dyC|YfRyn zr&&N^$;IKlrQWPo)k4Wk`NL+vFGabO%1?f_`^DM?E|n%dXvi(RCIt>;_^dV=V3Re z10if;0hnF8`P@&^5g}Kdi&8I%@uwu{+n@3TDKXRu&kmT+{tlR_OPqjd+XS8|-mwQ#aH_eNhe@La#U8ahz1n?o8+ZJUT3oi~L*B`+nc zjl8XH@9Lq2U|U11$g`a31&Z}j3o_Nwe{x)VqUnrOGZB@A+?>%p zU4HQz-;qTiPYcilZ6t=l-u_q)gfj|6<~-5Gxp=Ztwqt6^*6d};D{8GJUx!=#P)88= zi{;vs;WRSwCWSH6AKLt8(5e2y6Hm0dIJ?-k-zEB(v&1(~8R;)rxQplY&zpM>h5qbPRKUydFs*9Q0!;XL1O0fm7u6`9yR<&{@Wbn8yKby zm|rBli{(Ex2e00Lx)7?HJD#=X!Ijl2H@tK7K!q^w_-l?k2XJSa6)fQ{C=A}+r3D59 zY2o1hbc+7>=5!~2bnm+=n6R7KwI5}d z)2hHc}}DMyJ>znSi}%sO{s5Hn{Rml!?{O7Q&*{hFdpGk-BPz}{qMjB zf$-T^8>O8%4zYa1nFlZv|A8#Qj(q>E|1f-NM??&5EUcS^BTEgLc})(NesOW&v7d84 z*=d&2`c22U!8AGmN344CV&&+d@+H*ji)88-Gk?$MfaXw@S@KtG4@Sl}`$k8t@&@aVIM~v_fTvG0r!9P{H%ZyI=FDQKYcvhnuI)j%>?WYIlq4y`EdpoKpKW z>0W1SV7x`%vp~ur>^qIU`AtHzftPI}x;*@CPoQN}3dB_eCqt3W308>gnfu{9=eH#x ze4xGsbIPF85oOf*~;H=Jj-P5;_?^|mg#_37Q+q4117cRa}H|fz}BGG z?rc~42n4*khb*jVK0jxzQIFL2`$(7{&k%6M-+2)r^ylV%@;DM(p7%89J8vMGP-rsen2_1k!{rUgWq_aEy1rD^_94}tX!%F<*$eFeS8 z!DcoVTKlxnu6GCD1h7TVMN-1Ss+9I!6@GW>p8g$V3PXK*KT5HZz0minkIw|UBQf3oM zRwl#R+zoyOnF!nF*6sHEOh6{G)LfYMLqPg+f^(R1@ox`kiqf$~lnsY@JgN-U>n)UZ z$gloPm@;x=^o-PaoM9;X`X@9_>by|p7Z?TQt3JEdE{5LZQDWTeiHLmrP{MEIn6(Yr zTFR!9ti&8B)nKv(*&!G}{a+MPO4C(~n`v9GnGce5mXD#Gx)t`Jtkp4!xs*gIuhmOJ zvPREz%QBZ*zbv)Xr=Dh=D>vq6;U!J=(Z85s6na^Yi2@muD=pU;=1PwOmoB8%yluPF zep6=lz1T^8Dc@#LFNS0SFNrmj)d4s12`~6QP*o!NkQ2K7NGn)v{;wl}rW4kAhq1-7 zm^=BmQ1!4sx-_9KSY-z-il`O)uDFw$V^`PhdMyev6V zp=m5^E8}77?U~szm_!PMoef_ZF0cMj{p!^6^+(n^#6JDk(N#OUKHHJbgbdSv@()`ts6^3Ed^*Lf_2PtApFE60h&Zv{*nJ(}(G=<_MPlM1&1t zrAlh#bq&sxc}n;dkvfO7b?ufp;?cP2*V@Y<736td(}rT=njH<>`CaOtVe>r}@32(**yC(+ZZc zo*O-*)<{hRZ=1XR_gL;>rHI;!ChPb~8@^-IQ?nPAXH0?S3!==oa}_XvGrtWotZ;*l z({&g8bl7xhu=LoO_f(1R_A0kOxDX=OX}hF2d#dmbrTjOQ5J{JRwF7k z?Uig1@mB#I%mI+iUF@&<6mknZY(Yn|vMYrk{j+*x1RWa~Y41g`hD#8+;6 zed+foY4h+N7K{$OE9TmXyikrd1S6{uW~-Fp-*OU5Y=xj_%9-Zpt5uForFlMMF}!vx z0&w?7yeBM-q9SSJ&K&jKG1%-2Bf$&$5qMwWvpIaBH)lJMCRJ&z`0?0<{$Iq4Jmz98 z>?TE3gkvkY;`=;HJLYMRjF~SY2?J80rQtEJf#;Ui`|>B40PKmguC3W60mRU5 z4xD<%el90S<#|f#K5D-^Uf=YiwP?frR z5Q#S^)9*#%N2r_Q#ddSCV%dn1_vZ+!rC$<;_n-~?C|2dmIj$|=Rt7Hv$Snd;RxAeq zUPK!Ku+P}Z^x&HNxbbG8w_f22&t*<7x9w<@e$dq{=TAk_RYRao@>;V?x&BglypMIp z9|+XE?u}eY-;4)Q1JZk&ed@zMTZ&f-VD5#HJ%qWnG9wnV{Mikf{c zM)UYmfTl!r^KiJO6^_yiO16n8&zC)I_X?Taw+F0~+Rgld>k&~Y?|ee@`a1L6%;b`g z@Fm8~EANE+$%X^pO}{>_jzfwN46U`QSFEE5{+|R+$7-4>FmyxZJs1^pTf^gC=7f*f z4o*KOVM*d#MSX_f6qxrZe|z6ViACY>>Ti_M*@kSpH;>Lh?8LF%q=f^E6(3I)ap z)B3hHV73(zg-n^TS#B4%cRvv*S z;IcK6?p$l+pB6ELMld}Gwg+=v!atq$iTo7KG?5Zgm&YX37eUcp(PA0PqtG>{E>C_~ zmcAPl*vUc`?SSs$TFg#r&QU5JW$aRW^!l*wM3Hjr)iZj>Can=i`{7)V9m6mIP4YYm z!zaei?den%j@j)lIW^OojNUgTPA+oq(8xoex#-+wNw;1Ld%Ltp5un(_>jhUEE6S|* z=Plh_f9)AVIPjRJ3reD<8095mo-0&3+Iw@TLM+E$;?y#OIEPOX1zVv+aE8|Qb)e)p z4Qkvqb%&+*`7#gB+8ax{I*$zBZPp44#GbyIw?CiM-j<_!YCWhnN3j$|>hHNMqU*6aCjrl7S@npH4@DB5i` z6xk}`^k)kjj?`4fCu(!w>$N70$tY0zZvXY*bdS>!Dn`TO3TYVK(LCpI@$uA&V=A)m zO`av0WIlfS!M6`7T)wp1rWDr_Ie?VvVyU@unM9jq!q*u`M?5Sx_L-&ETc1dZ#9(D; zcBe+YJ7XT@S8`txvY!(>-tEeI?Ywoihge;BJ^FGz>~61JM~vY}Nhkq;q84{Io*}pe z;>%Jl35M6q)h^XL{B`gIbe3SgP1G0Lbll}GvutZKuSA_DU$?a+El-z}|07Hzv97%L$1O zOzn7EWMif1bvI2{93=*Esxk~Yvh(8=U2X~6_S?+Z?SqV=w@mM$%D~cx?Wf=NeaMvC zAf6o8hys#tQbE@_OltO_!J_u5G-&_)#z4VB?H_((j4F9Sn>$j=VCCh2?v&`4jikJ# zs7;A&$GW@nPlV`5}=|V0uvoY;IEP70NVS6aQ+Sr|q;xKRrhepNr3pa=M(_VqF~d z4IhwRT3T655Wa+H;}KD5&hfxOKV57x5lA^Pbv+lUTfT)lUH3q=OqRd#Xs(twmgFHA77V;NU`(HXB zshi&HhU`y!RPe{Y10-j+2Iq622tXgZi@6Oi;i@iq*7E=!mUgsqC|_9puR4G7t68EKjA87= z#tWN{8a>b*e5h=tnszG}@sc?qdWX<7Fl_?;pqnCNH^EU&oCM6RA5fz-TwZU-xR}W$ z?J8?iRA9EM3WBgP8OCM9_lk@*x0E{_Z*LKXfp=mEc~&}%1ANZ;ILEws!uRhA-m83q z_N%A_XT0>e?(fJ2EVxO?O?Ee|5>HGLxCAqB>l}-WziZQhA8@Kdy3=Bd=SVkQyl`CQ z5>jYf6I6mnp##_uTa$BtP%0h=HtttcHwcyK$7;ObYHKiYKFm#?<#+}~RYp*1LLonNE3j(#<%QF*i7Uo2DtNGKdNElvuFqA60# zr$QVTo1);XneNSoJ{@+(Z(u#KVDg#tWf&-iLVN&P8ln%-Z9~C(xpH**@-d>?JK4F8?Oi6^;~R{CZqVffp`H5 zfRvwxJ2o4@aL3^*6C^pH08onsc|YUN|H%zrkNimsUR|B+`B|uQ&}`+DMrrehmInYs zqxNm~1rZA)Qk6x@l5xA@bjQpOUNxmL)J5(7zW==|2-(T$vwVdz@0fKkwdpJqbrv>& zGbQBJJG0)%IoL`DHmY|XyPpk`uB|PC50H=5@v)T#@el2`ZZ`#Lbk6kQ_EQqH>&wk0 zqmES>sL5h?5JMepm8jx-M?h9>5*<+5VLgTI)BX0!T6%Mit)3|4XR9a9;SSJ1FI|rS z&)r&GL*h--_uW|4SF=aC^1m9q`?3O?Hk)cST zjUgi#rC-(^=U8WTK+*-tV-M#;(e8!9EsABBW-(0GSH1zRur)%Leb)HJz>Ns58U2N$ zu9$I@oitjeFdo9!nUfnj=0u#F<4C`eX2l2T0DIE@Qb9^|zRpF;JsjO6>Y@7?@J8h$ zBlgc`@o%|MQwOpqxM;sO+qnEVa5^f2{;%2H588oR3+S=&C4SP90`MRUdA>tY1CtJ3 zuTOI@pMR%v;-6uT`~b5L5hF5By-`-3zS<+-s#~mE2hY1u{qTq=j57XsxLoAAqVY+O zli4#zNXcFZpCkW$r4kZ>2U&vgU@ zzi{IzY#y5&fe>k4K3kn)qNP7|vpfaUQCP5Vt{ZJGC71K;U*n&-Qb7?>m{99?B(~3N zRrn09K{vH%_g4P6=n)lwy|(qll=?M%I1BN%XT!R6NzUfuB90M=;-O2j^22+I=R__Y zTjR(IT-Iq!gE=BET6DDId!EEQ{U9QdzcRY z^*%g0#`T=c^Vm+g3=UI*MVZFK7V$Tr;ar4fI{eoh66SqW-=^7wE=iVX3rb85%h=L@ zxiR55jh zgWF$4u@-H}oC8d4Z($PrE42aY;N1W#HfaDfSjK&tN8adDOzXgI0oVIfc**478I{p6u4jNg|J?ciC5F4@wU$m0pNYDeJyd20LkxY)FyP zd{N|%nG_P@D{P-#{SnW_W(I(#HsVeC_PMI~#uZ0D4XP6yS!3P{9gj5Gqy{3X0NZ&v zHQ(jDNAc#5PF~2U9j6Uu2K}(s+&B1uR+^9M>vtM4LYL0MpB;SF7;#Xpll{Yc(E))q1U6EN1BqwSYDUlte4s^0C{AUDo?Ai<$V zL7l_<^O4#k`b=>ZI0WT!bE>~Gg);5nRsJa@^CoI^Y529Mm7}x^Ys0@8ioZhUb54N8 z;h@k9e_IFD9dc$WKDIJWT!qCwkqrQ+#%6Q@`8DD2F2+yGBIOq)n&P%$cdrtp_r~C7?<#LOqoa4`GMb<&J+Ji@? z{C;KJUEuVxj#G~kVm-3a!QNzhS9|4p93e4O%pyuszQFN&EZT(baPoYD=jwCC4dJp| z3uN6~cQI21)I^VFUd-MTT9{2C@@lZ7m&`}okJCNNCA-~BIksd|m*CT+nNj3)nfZnM zgidNq^VluEH!_bC(HOF={ZZA>(l6RHWDe#*jC=ep&@j<$t%&hlwe8Rdt-I;Qe`#_QSBT%Mu0eXOwytBg)(uAZxwa#}pe9GVq zQ81!P20V+YNGX=^O>8WEuvnQ8r46m8dD{|dJ+0Th5naUK+hWFE;cud>5*-GcTu&RL zqXSrbL+C$G`zc<#A}w<2*YKKrQ6bAk`^ytZ0*o|Lo*OD*xp=xCR^8#P+FM<{GVC)hlw(U{$1wk3U;yIQCp|dY)b-}|b zt?`Y(9JR;?qM62tL7lFX=JaA!{QDMC?LA`I$vHEkNJ3*L zA&ejxtaq=TH{LrG&n&X4G1z6$#Q`-u9C%CaNaPD#6nridKWuimHqACqwE%grR7b!p zTA~5Do^{E*iQzaHc^1s~pxl^iQGcL%Llgn*sqoGEFb};6lk?sJQa-K8vOfano`YbV zn$GmEkgJ{NaBipWiaLM!%X)oIt)N((JdfH)pXN;}cQ2}EBQoIUFB1K5lPsMP*zDDt yx$#C$GXOGN$B|hDIB?$+&vqXj~T*(R=#8`ll462{Q=^o|XYCQ9#!0x|U71GrV#ihzg#=?Vm-1_^{3K(i$R z0@4i~148H}B#=OumALmg=iW0jznOby@`rxLFY8<1T5oyY=Y7_*JGZqt5Aq*`Kp>nt zw{93gAnXhXgzeG(UErJXuW{!fkdqLd8&^$&(icW-19FtAAa{C-oL|3a;WL)WE4}P3 z5|(DzC35ZFV~3?^tHTL#ahKwZ*)92+z3bV)2oMN#rE~NE>k49RL}O=OMH=7z?_NZ6 z@I{>pQQN}UyFi+_wU$;#X>8+Ry!mtGJzHUeof zTm7X3Hb`2^C|O*)ejVp;vCaj7~5+-@Y1b!?}tn$Hq>Zq*VA$S-verk5M*u86_%sz< z*xvnLy1@B!;>rRKLYnk~sqB$OD~nvoNHTa1_~d8*%SF>wtt`Egh?E84*%_swyzpFU zp9k*`6W+|Rw`NXG!$h1&dlTJdLvx9{z&s+4-=VRO{}JVI0)Lq%BT;zMKCjt3?8X~m zN1`Jh{$7s5S6t}gdSO-i(IA7pHRl$RPNKfne4bx7o;8yGq3vF7-uAA8`8v$0G)*|p zVXAW9*H$!JJvTl&dMT*6kfPmWG}%1^Ly^2qFs0Pi!z0~A-Y&=w6mO-H*E z^K3CD*Iiffw#g1KtM4OOSZ+w8Im~v3jIPwdjtA{<_YK^?KK+SjzvkZ~DQTqk! zR7}w^h{v52!p@>+US^iMrBNc&>`#EHl)WZpz4PQ( zQ5SXcBXDn*ULdh?6wy6KvkbwWfq{Wbhaz?uBdWiFpD2Q#2;PPn?sN+;>fsau)O&6 z8|=3+y9Vj)5B<8y_{U}X!`_YxK5)qa1T5Gocm?MlOlP<2G!zcPbVKhm zwy9(B@m#2@kZS%VhL>doD2cM}r$Q?gT^ zrcG*91VkyNwPc&V%~)GoYjp%hgsom;ADHR@J{FH&(%!27MfB$xiXFOn%xbkbm-;e%;~vs4uS@h$-f!ZMrBY$vU29Qq zi@A6LHo&Y|Kk0W{T9a8H421h{=^9t~_3d!vy6$*3YC3#dP1&uaXs!Vk)fkLTd`Q?g z9Z)8}1UuF6!FeoH;oOi)~4_JRF)1e#ZEtEX?6zlNtTAuJW3xeIq+!We>$4FOl zMcjHzd=a?Ym5gpp$d(aJ7DJj{4N0#sCr^9TJ=LPjXU)bc{NSp)F|-18or&q@Ff>=1 zId8rAno)t81-lCA-Sm{TN&du_E5)d--XKpLtpCb3?!q*XZFC@5$GaQS%*dYpm^ps@ zpdz^T+69c8`SB9_?_UVET{^U2?_3w1{g{x1e&-xrBtnWAK2dmG;ph3?@*PFJ-fLmy z@2pN&*@&UtGgpSeWUib+MnDcbo`~`m#7XDuBP#Wa7ZQ~;PU~|CUl#e4#@6#u_xxSd zycb$q7dtDNzsJt_s)tTp>B4JZJB=QTgtH-W~_;4W@YaTF@WXH3hY##EorQ)lcX>E3%-UU_N z-n^p$F2=R#zk*d8D_GT+^urB5UGu7zt3%N-Bm*|R1awY5mvH4z(%8^a2(3awo&R*< z9mTjljRK^1_w(R3ebtIR&v;h{c6)?7fEis8DPlZ&k(DJPZmOK}{`?SDzFpRAd+b%J z4^fO>V2&KFH|?-Ct;kaBSqz(9r;(C$h_|l}Xef@kb((r89hsCKODa&o`Lz<^`CrJVg))u+?#b0?t^ z+dUts@PN5F*CmPZ0siF~Pn^`qLycp75!L~o zhC_~_PI@iqU`$0ydw#df0;0qt*~hM;4t@^Tpaj!E{3d`tNabi{?EQTPbtcy~`?nr0 z@f!mcdd!r#ti~`tIIw;}&op3TWsMDTyV>C4UqMM>>yaKB$4YVO@$_&nTXw<=0Z7of zf5szJM0Eu#4jI!*?GHo79fvnSN{;aw<0@^l+ktq=_iwW`^#xI*+sX$tZAS2Tyi(lQ z*jT9OwXPWRhaU37mkyy?)P&yqIjSh_QP6pt(>|Zz7A539m}ujIdxL&A2pv3ncK*AM zyPHqtp+={8HBVjvyEVj@&g!pV>N7cHu3@k;+u9w_KKDXJv;EZiQ;BQ_$|+p6v&VW|6X4SeYKBiR82_oZPjxdR_0q zHBu(5_wAIRusbjEu9$-|f9ElXO)Lo962MCA=XZSNh!JglxUoK~{;fQ372fHa*IzfM z3Sm7*{03cd>jP+v$^(MJ0_-azRpZcgqyg1)v!_5xy^SC)Ti&M}CRor}(RnNwo}QEv zP#?gr9Wf;#yv2SLSkw4c6=$j5#7|ojvu|UJBAWZE38wgZXB^@ucX+UMLu$30*~JcE z{L<}SDEvf1tJPAR=?>{5$y@tt(uYBjKol)L?`7WIte>)Wu6kzzJF|O>aH(5_3{eh9 zX>*;XO+V8k@1?vyLKqd_^1+R5b%&J)p26_1I5na*mR?kfmYE`g;Y~TV{v*0ot)GZO zRXuiUJq?x>5|i=Sh*Y780uYJcc0_4HJkN-IbrLUgRoLS5P3zN-DW-7|8J^FGcg_h82v5-^sl}u3JBL}CT)YhcS=(2B~%RIBQM@V(; zRUSI;uAq7Z46a%}D>CkW!xUrmS<+h5R`#1Lf8g<8+@rg$r`G&iUXa z@|0kc&6Z!AbsF8~`?BF=w_WH2@dwEEJbX+?rGqvRm5x zcFoYz0Bmp`^Vv`UJS_9i!idPKWXYCFj+j7WtS6>DdwkvSl-g-&ckVvH=;2fv`6_r` zMFXE!N1R5{U;O%AAy>Wg~~-w zxyuSb69F&-v9gH4HabLmHEiNiEHN%wNh(UZ>6$Wky{f8(0=&6%t@SN|F4dLLDq(iM zeq z+LlE|L@H8vd9d#tMR?-$+O4i3$DX&ACoJ!4e#Q6Il@C5Nktvs;fmU=@P+J>Oe59ar zPhW$#=eY7hpCZaU)#J9Hvd(#XdwVeCHa&3Z1_*s4z!K|Yn|Y|xbs}XgS0tVOY*tv{ z`QGlDtfx2BDV~{^kY)QmHmP(#J6>ws9Y5GQ&whs{HApK-V8U#2!=On9muB)2g*ME^ zrx}A!k^{fbNiJ&G5kLY1xP8S^~|&FM(ErolF!4xSy#5i zvj#m=a|`tWX+GknLHKhPUGz1?sBxc_)X{+CQ7IaO(J;2u6R7SD@wzy=JyBl2F;QE; z?R%bXcDC=jPR-HpdZfhDI}G{~9v>~v{V$O$lJkajs*Q_ZByUz$R?lDrh@j+Q>f^Z( z%HeTH6Wivt2t?|0AuDW8bk}e1ZfY^{SQuNPg1gPn1J9iQ4A-od3S@u^dLC57PyT`R zdY|y5lUA0qLh$cF(wnzH;E`uy6Re#RV(Z^;W4eR=)2H3im#vX_l9zSHbh52vtlijU zf!W_AGwxDuQSMvF4G+F3x;y~=uJp}S#q5XLgWpA$x3|^fh#<+1J_AdPdVmv&%n^t> zwIyDDz0C2!1&OgQnBYAvlnmi~w*0Q+CEPl7CJi?HVbVx+s&I;WCwh81DSdOEyP_p{ zblZjS&5Y=5_`t+IE>3WP|90D$cH1)Mu5OpU-tlRtktOQV(h{q73V2KAI+Au!$Du@4 z%}DHVf2ircLd7(f0=S-~^{hSOkREcDvoe}Qo85-6js+VrzSLelF^#n*&LN}s5nc<_|BVBPYaU=z@q|!D;xHzZh-|f+unUF zwk4!bw+*(}H53)6pA-PI470TlrO!`Qpv5CpbGtGXV<;*=yHh;UeBtE48msdJ^WpQl z-0A8@IyuN@A+sF;V_V0uqnm4)sHETQFAaCu`1S*|d4nW!?`A;fa}z5y_u}lEzhUG{ zuo>>go2x7L66NWzmq^!_db3wEsWuhq6J<`Jj~8Xf;F(%q*KwAgQTicAnb<-9vru>Q*+ehUlnJJq9vgOZ|$N);(mEUB3Q| zfg(hwq~<)Xl}^umbo~3aOK`I2%t7R2-1L3w9JHS&vl=lvCBGly_8DM}B)~LyF3B}E z`|D5Yh?FRO7%}W!JRld6tTr(7hPYzbwjv9_L=Y#aU`8zhsCgY`7fp;Phy5a&j*Zr{!i9f6i_2w4yNeYhy-JTYZprUP-i4*Y&?U`-XHD8H zV%d|U3{Y8dk90|r>T3d-Uz6^{WPa3={@NUtsW{e5qJFjv7J~#SfC)n)GdOXV;vQ^l zI27hRjYkVF;Mig5Zj;OR3Jeq`=8u&-=y~h9=NVsCeW=BMRsbVsMxTj=&KC?q?{Xcr zJ0M^c{L}tk$O74aSnSdIr>wJ8lcts=BWZF~1!0B8{uY=ZAWjVLR+gIVv9Y(*JEMI) zFztt9q8s1o`n9_>a+9C$Y4`rBMGa1)XTz6cmT%rVR^!c!_U@Jz2(5f5qMp{|HrZ+c zLz7mr*LoDGTGKTeG3FYNua_=HaM&Tb-Vzify}K2-3U?sdYtSXI3y?q5#U8rOu69N5 z%N}<~P;oORA@*gte>-~Ch1--XdUEXufgP5{OL+R#VRC*3&F`BjB(DBSeE|-YNTVFP zB#ZfKur-1MKi&C_Dvaf{DA| zk(4$RJ@@9?m>gQf{^3%?g;le1z1*BL2+Lx9w=QkoJn4J^S;Qi88V(B~Sx9;-@L^vY zk%HPjCyiQ#8fgf5A6sNAz0O>zaWRErnwI=GqY^Z-*8(Q15O(ks{Zy1e#fydouTJ6n z2}xWB-TZ%6)gJJ>&{-#wRoGBu7%Bh>fTEZ?sg4|iJEoOLf54XC8Zer1bCYF26C-0J z__z5En4H$Edo4J+_C^RhwQEt>RXpv6#~~wS&7q&%x=YQRjf&(f;e1iG;dc*f$8qqa zS@%!lL$?n`%7da1*so>vyn0=CeNLX)b8dxOLlRcgb{Bgwe-=1eXbK>e9EfgRzJTsQ z&(MpnJV^H{Cs_JL7&%Y|Z)taCZW0a+ObUiqeK1coge^*%Uz_4DQhOZJVMvu#T93^{ zk@2@^yP=edPRv~@yV6O`)QQ?HpM4N>;z(9iqNI(TqhF-K#>!qMDFt?yz0!Fvxi0=N zq%4Z%N%%_7cH7S)kRW5mS81k){hN#R>Z>vgI9@rw*xdnk$#nj+Rukt-DOBMOa%@BH;l>R8% z;Y4_NIHhBkk|6c#L~U^@8;cQ!cUMm9nHQK3M%#PTt*W~WYs8eu6hrL>kG+2_dq)O) zdxypQ#gpsow7m>Kf&tNwyH9cJ0Af(TZ6c>Uh-kI(-V$Se(IhacXXI%^Sma>4=7YMK&NZ{6?~7AW`L-=koMyIa-Du;~mScX6X_S{4 zX&VhPHGNwHKG4Qq+7csD+BT%gsx*~2rJ?tXXft0QfcjQyyqqzg!Q7^@7uSR@&8@BZ zTG6>|UjE~e-|q-Oq`vHIPoy#pFOp*=>p#(uk;Jl}$4lD^nF|e3V&Y!N_|Z>wjIPxt zZ^523FjN_lc<-2OUE#?WYU{fA)Y#$g;;J#lel7@Uac(z}`>?3ABF!bzR9B`QMfVob z??x$C2;GyHFjp4dp1&z)=O6p*DK^h!2zvaf)mp7ZL1q}Ww^sI9RMF0hR!oa z+K9Q{RQ^<|EMaxcE76>4hI-w7!8&F8!19Ync0C`Ciqcl z!6M|hECi*{^)ZZxL5iG-hJxrwCgUvp;(Z-l>eC5O#AVRfqOdbQV3sQ$_+?!^(^weHndHlgMDtGQBId)@F+Cv zX<6N@rp-&H^L|5le)P1zDmE)`Z8)ElbZeHXDF!&uxdbSJSKjIi#6mNRcDF{-YFz)AaY6b5S+0X(@!yv?AVj%iKw@b*7c+qXVk60Tf% zENH(t z%~Z`IV%K`%`}*-qZ(soq8~ozQ5g0el4;NOu(NE}HSA9Rpq!s~FOb04l#O>1@T zDz%<{o+U)4r0)u`*O1n8zHVJot~s~a5;EFZ3-_;o+y9j;czkzRCUbquEbz~}2vS0A zUk8pE4aIcbZJW7;IX@(#W}4akEtcaJR1yDXp`oG;!!MhqE)d%@=4$Cd z{llaaC`Zq<=&ydf?44fYedy%$82UxnCi zNSbvc56&q<>%dZs;KCunOUR*cy`QR%#_B&U4W7yqs%}-|67zVY)aMDRZuh0XU8WK} z70EX>Pdqway%--f-r6|H)+8TH)qFc|bjOgJeX@1FtZ&-?9;dWjwFIm6H~*8bF0M(o zT1Hg~2AQ8>vQ(@OCim~&-F+NbqDVz{`{Q=+Vnn@PqWCFyZmnuldk#s`h>vLgRAE~{7^amkZTn)v zHjdauG`avee2uva<6h2l4`G+3ti{}mRmXns4$w;{-$H&QdMlX7-G}8lq%EpEn0kTm zDaBu0cj>&OE`ZL_Y+39ZBI|y!dw@2-cCmw2;IF32u2vL_{=>t{QJ^iXsR^ z&0A*`UG%8u{?>?ie9TSHdd1}9K$h;ZfLs9T62L3=Ks-K;+%=q@0~_&urH= zG}H>YwD1bk88x_4++ml3+}Ekp0x5Q2=JlpWH`WRAmGdS26V3yN^IePbJxfGpQfrGwR?y$|6C-d zwT%3nBP*t)^!;>3UrD&fe6=zUWPt_sMh)p6#I)DH^(c8()!@R2HL-FIzRAz9{w8Xt?*&M(jCSZzI@A4WW0pgvI2WyXYU>Q@fwlWQ1V;V>sQH{ z(Ti(I26-R8XJBBPN3JLYZ9m?Nbk7)!ZIoPK$c&`@473@IRw?QdmwLe`>=tZVYYOp_ zVZO0=S)G&_g7^K2_hf)%C)O^>mwz>R(r|4Gi>aXMFEUZ}lWbSo1 zxJ6~UaPnb)l^24lUd+WY}Xm`Pi%Qyq)1kNEQ30cw+M)ZP9TB~5xmby$+ zv7ZEF_e5&_1x}zW-mxoTxeZ_ng}aY0+@`F|UqS9COw77lsr@uP*w8%BS7&P2ChI1T z!ap9E96sGTx#FabtuVkWieR2a1*ts@PGWoe7!;16Z-|h@=l6YeLu~Qw_Gg!t#D}Y8 zGBRv?vli;eI5t8vvJ1D%PbFsNmQqHu9pRmIi2UsmIWvX65EOFLagI?n?$fT3221Nk zq}WmJ64y~2kXx2a)dOe(iQ%Kqb@{pb*S-pgeYb$#bsZ;0*Da{>eoZ*52S=~;u=nV$ zow9t%P@{Cb5ihNr7ha???2MCRVZzm*Y<<*yBVG`vN7&Yt9Y>_G~MApqU?XIcbO`txDk z^W6~X@g0Vj0ki6e5C$ZJ7BU(Zz!`I>qH<1cmGuyIk zlyL;duTskCp3Uoj{@+H@L{EK475wNLkQ;e`)&U011+2wV1tZCc?KTMpYdi zlfIa|%?jzOqI()%84-bu#;|HTK`WDhPP2)g$2|$_rlI~3kRa8aU&RB!Hs@HS7AOID z{vTeL@kKd=9C_YgP0C#03Afa=@Vvuc6dYc8hx9Qdneruey5!vWX~LVdLlrY$wGCbI zfM}tcNPUvO=p_A93w0j6^&6&a2{QWq(jlVKZTqPB{4;mcDy|+Ar7H=X6+<|maf~ji zf~~wUzqrAVhR!PlS}9P=gVjCBoWvXGpfJlUD~y2^m21e+Iw0#h7*6U-VFW}4Y5HZp zb&Wa$Frg!MoFS_}T=! zS+~JXPEplS(TuJHX-_az9Ih~8JfLm_)Y%OU4U~@Gsod^@StB_SFr-XuVys|_`%8B- ze%AmeIOa~MYueKM&E;6{?8pfTG07e~f{H)PZsCEJ^E9Fz8UWV&N0J)6E4k|kiP&6b zIm>K(SFAFh*5>d(X$>bdE=o@F`T#a65R&Kvb619NrQ<<{9CVk zQr)cJiK}Vzj(+99*1jSj$!=_ zK^l$i#&>;#J?XYUxP(%t4+tCjQF8k_b6Khub^xKb?(c|lZEw9OgzTlFbBP3LarTKf zHl@FU-Y*VAt*ecfF~C8^$7{x}_HIaaYGDo9q;AFxc80X4FqtKH0?-p;x_r{!J=n>b zK8N=CgQCKy2)>Ps%yjQb7%~%JRB$acGq<1J5rAONlf$#>YCarE{`qx_`tjmU!*Z+q z69-o=WL@6${pfHXY3VrRch*@1k z6ro^Ago&xN$9IanY{ksJLAR4+lHu!>`t=O$y^)Ce^1r&r%(UC)Ru11fpHd%_grr$Z zPJ?+vJV11ALi;aK*3$jJKgYMWQtZLs|8HWg9rQ%hOk4DPAbR9F@+8{bDvG1g8kQ1e zd#q+uLZJTKqxJI316;2)QM!-+2gy9 z-#?&uA3HVVT=Z)0%(Po(+KtlagZb!|x9E%RCnn{UtG?K!tdqMH2x1X~&Lnw|Em=~U zaUSP61{XmWki8S1X8qna+@Cu$KL33E{Z-^Zc1piCS4K; zD|Rbfx6@m@Xq(c5d;?eLQ9ugZMksKl*)VPF2nb1$a1-4%aRjd=*VFjD6$1QbgnY!X z8!B#y3!MWc=5ysCev%FZgJ`P7il+43JiNopIJ)%%aCeUt#O5v0&_S$HLj0_=Ih6c!HwQswxZP=+G`M-V4p6}ac^WHMb~`85E<`C@WZdSUnBR7{IxWNCBm(MKD zBxJq)bZD4@&qWh#eZ$gP<>uOcc86$C$u1p?;w4_$n|Dppa=+@>BM7G1g z^s4i`HPb1>KU#6{rYPIiZ%{k;ePvs0^7bJ!i0wI6lOATQ|E|051zJmBNgV~jmG6RaY z!Zni{9XDr|zbL0o>!N`K_H3gM@4`j*qq)*UCFiS6(;xE2OV1g%VRYsgchlsYsmgmI zff5WX)r?7@$xS>OL5};7?LS4j0C&hAN9Rk)WGY%x?W?kluZVg@y-YN|?%z;>J&&Et0W)!E9Ib znM7D54py+0L@_6{{UACRB+nvfB5xzyy_~r)Ulxzba&CKZn9%|ceaL$-8yQ*& zT_ap>X@1u;SEy=IH$!UkXxDV#Fm_3_OF>(2Ma%jWK_W|7rx30*5=>{|Lt};?ad(06 zRbORLpFL;qPtvQkq?)fDd&W*cyXw1_q7rrIdXd4E@jNLR<_cK^<|10JlC|vfA}mk2 z_XsPr-Wd^zbPu+FG`E^|j@3fB6>JNc{+Tamlf=nfSCEoTSgcgFRE)!;K*d8i5S@VB zC7O6f)5}(a%+73{i9kA_w4UF7X-%|gwm|*;s}Tfg8lnSL5352RzrY%2ygF~azK1wb z<<@5OWL+7eO<7w5-J0=_|0o^-#H`O*M$m)m$(8l1m1Bw*mSvD>zVX`;^+6y2{?*dy z&!HUW-2mz(R-f$Qdm5MLG{^)@$>iQL0nZ^X+i-7C+kS9juP^ZHi=dTQFRrmwMF~Ls z37vxEr@JUWm<2MEB`OK0}`Rw^;=87n@ zjAdS7Ri-k^>zKk8@E*YDI!B9~{MDm`)Qe}evHfDh!2kS{*!sXE2OvN^IClcJ!nh(uwI=X%&wLf!P!J2H8epN5hpk9il zSE$L9mUi)s)@^31yuc8s}6)O%D2SoC+nLiuEm8#EfMc9)sd) zpvkqG1=+S-pwNp-lUwnkr&^y22 zG9{@D-7(q)G?%|xs&?B7IJ3Z$wM4(+y(9tGt&(HPwyI+*iad5@pCisq&u_nh^>^i6 z@!0)0rCNrrkVx}DaQ8dlWL)*M!i!qns#P>vMMr8Hdewm6zo`ESv6Bf?+mhF9AAhK$F1ehyptu{pDWgz2w znBpwv=RX|f`EP&2%qvggMast{{kcq4Zfcj?I>(#bL`^G;3*-u8yuURcQcTfOa3g+1 zI#j8w#p2d0-ALb8>!H$ZUNolO(gy!4;f=?#v>;O}N^uh_y+rG~X>L<;hY)dnKDn>1 zU=3pMe;~(Qzh>gBUv9NpR^(SWykt_J*uzl6aLWCnsusIh$xaza1$velb#KQaTHOr7 z?tY)Sc@6fOa>|+e!v8(>S=h#;J}E_tF7;%P0C`vxcv)h`xAxwBuD8@m9da5II!yhe1(!^}~<-$c3HR*F$Q{-Ob{5 zLDI^Y6RqCf+OlwI4KYqx-y4&x_rR&GA#IXdYo=&94@=YSCXK}X&k=X;+=`!O!*KnP z#=odfRw5n$C-qqt8(56=Fwz|@6c#d_Fu$3G$iwz=B9J0VkjOPqEkGcpb8~ZgBU$qN z<~^RKgQd|SV=7B*fkB-=*It|*l72^V%%0j=5Xzwtiah=T*a6A;RBRNR(n%K0`urcH zh3p@gXNJ`NrJ*kxVMi8pMdH%pc+U4%4@C5yU+62x(Ivn8i?-%Z9qN5tg@3jy3jMx9 zKh&vch?$2>b>!(`$W0T_CioQAZP}aH63%C!9O{Iz!7>>Pw>J7go8&PG5N?H+7zm;8 zEf0ub(oW+Q5tPuco>$Y;?-QVIEN%K*g6I;5Nl{`J-Ah~pj!b1r^~=B2``tjG@j_t7 z%d&s#lRp!CnLhwGRP*or((VItqwSyS{atbg%;zL=-t{OLzBVKWAxdgb^KW78!5=L5A%dn z%^H{~NUEcEiG@3EZR8bN7ySn$bfxua8;vPc22k^`6*G*EzGhLE>1J?T7Gbd``jCX+ zzDVjX?1<-C91vN=ax1)v)89)2C0yMOWlt{vqO6WE0IOO~R5uWL4KjG!L2byBa+=*1f0D znWO}$($fRi4MZp9E60=D=Yn%QPl$%`48L-%>_&#;P69kNS`{^L9E=FSewn_>iiD+A zhCc4L_Uyavy9-%C=D$f|X+KT* zi)3gq(94svpl@Q;ZnvAXt_Cz+*(?IdpC!oisKQi!?{b-$`M5lGbR(`SdeZmMx-&un zk?l^rfYwQ(IfF`FnD6$^sL%8zq0|2kPrbn$zo(n-Txss?j9<@{3pu8kT)Ms}i}1_e zwTKqa@5-e`>4mQMh4mO}F=@|y>MbK{^~V6FYIW&m1I$j8f})e(8Q<_Ocmb>fsc<^Wk!SRxIY_3DyPBJUfV zT2oI2_%&e%^$h3cWG&_VYOzLv?*qDelCfs_oDsV2pBl%~7zL5E(K{YI;F))zeVSf% zBg}>mOY-w^=!?gfhVn%bsfdQ{(kD^Y{Wow(?Q(B19O6gCe4oZ=o#gbY^hbo)ae;q! zOZ;b<-IC{DJH*pE=VzodKbLrUJMZkeO7VX1T>^0R5Qy_8>Ws}mPLK&<0^i9FQR1tL z`-^u1yqHw`VNGxk#7l$eUjJ5o12(gJky&*clIp^hA(4sRL=Y~eJ~1N<=!!J;Sx|qW zTq$t=$ID+tLZ#iO}-1M@AmZC5R8nVuHbgmEu5%S-MeO;c%kaJN;lDIElua&y0}5 z_8Jm}*gR}=lN(Aq4e0$l5TxYORWq6NHGN-qJI zC8x7&SA^DQ?bby&;Z3GH4(}RQJ>f10(;WobswJ#Hs)&K(Qn|rrwayi5llZSB=vJc< zX_F6I?%hFE^`27DxqwaVGP-GaM$MZ1EZU9P5ou}%ih=a+-PvC7>GZhm-!c5P*N;hZ zY6v~UaJjtL>E(=wJFfy*pu|~iaQ8SEx)Zgpk=4bv z3Pls2)!JT8fvV^iTMim+HgWc0s3!CwFhc~Z1O!jN&5}(0pI%JuKo;og*D7Z^uYjLG ObhK{YD7|*?_x}O>%now^ diff --git a/openair3/NAS/TEST/MSC/NomalDetach.png b/openair3/NAS/TEST/MSC/NomalDetach.png deleted file mode 100644 index e5ca319adaa40233cc3e0ac570d547f6ebfa7093..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5844 zcmcIoc{J4f-~URbDGZ-_T@A%#GoZorQbIx;~?fb`f-sd}?<-NY%%O5t@roV_E6bAs{ z7qcsuYym(_0Mgi9+rYQ>$H-OykjXT=biqCnWvu%wA?*%uI z^(>J$!4~QKc9HFgg7@xoT{0sA9mzeQ*3MJ%pxv{AdQi3%bD@Mgj}C$29V;G%Nc^!~Rh45S?A10j<&Pt?=jf8N{_7oIydk)&U}mNRiPs zR9LWQj%lVKZKKN&!*c9u8x1zyf@dHEVm2`@HR^cff(8x|P`}IrUL1Ap-6a_w~JK^Mu|@5!-nFF!nvHd(wr2 z{u!oShlku~C-vS=?weiO*bZ`526|s&Lm48l$K{q90|{T-2tMLcRq@^SRh{>1s)V`~ zO1m7MEvdx!)l$&H6ETYOM-Abu{l6SE;DRpu1oUbJFO2;Xd~Mpdext>=pgU;(w($f_ zOwz-$fV)QoNSt$KDkY|C7BU*jjCjNwIfYd>y*GYwilT6)9$7o4p3}5j-g{m@>aAz{ zX?^WgyW>RZ2)05v;jUdReF~Ix!Q7iK8dC53JnD>3ZS-PR*q7sd^0$)nTJcg-0Wl79 z#?9@21mfMVmq_huqoiJ zuP@C)fZWAdNONgF6sYrqcX@ur>3|M(%tek^tlZl_*nf!dWw5&re=z34my22VT6RsX zudThxV=$RaR;thiZ+=z+R#CC-5B|vOGaNQqoA7NTSv8w23&J5IKHZ&KLyt_>AFUbP zyq^+ONvBXKv^sE?^clV#mH^L(h znv@Jwn$ynZXomMM4g|bk$Uda8ku|gj07eyLHbmZNq)E){THW|~%Dfy3hklwQHy?f* zPg2yxr*n#naW)0Fq!}F3#w2`8eN6iJ;5fn`T36ZxTFwKMw)xfX-$<&9n7ns{AT?yJ z%2!42O%2lei*VVE({oXMWvh25J={BB;8h?RHonZ8!XOFG=kt!R>K*B~;1$!ZVv2-| zLsx0PgYrC82IZ+l@2^_sBQ%__0|_F$A{9;tEp&+x^}5M@lcol9b&4}neIs&aN~lbAw_b$^xX~x zpZoS<%|73F+NX4z?%WLdcRT^zuu)*L+HkvBZUj|Xi-Ld<{ifyr1K`2%ep5sZ;L`)y zHf6tQI`*W5m8{?=tcxVymL@%r48){VTNr1Io5KQq`Bm4vjQcJXF>E=>k2|KO&S2^3 zG!5L|I9|fpzb@?<9p6eR$y;eax;{nRvd7-~FqjcQ{EGTB?qzy*7ux$qaGN~+D8{&5 zG}_9RjTk>u#8w=CKQ%LR=NsB=#01gQ!!AJ(jv4J}N}(Ua|Ky8AJryP_Ict3kRwmXt z@9h4L3@uq0_Qva9sw|kxsbp(NTE%zyTq9Y3L}pQbpMDXpLcFjcO4?$|KPpyD@uq#= z$qo&|UF^A>!smxlKYYIsDGjU|G<3{?b^uiAp=fT_vq8D=4i6dIS2VvNzru%J)Ba4_ zD&vVMWD2E?8ae$^>DVLeH|xvpw+e2!j?wWh&`9ZLNLAUL@CqsoCKc_sDP6j$SNEJN z=Ak0YvW-UFD?!W2j0y>FmjX?^g2QefjO@Dy&O^A9vF%DD0h{0H0cT_m4L_8ZTWhPl zOO0D^oRaMHy&a%90Pyk3+ocPiHbw6dM?sZJT#`w=I_A3LM~9DEvgKCB_pDb3ka z8isRAidJorro-ny5YP}L#B3^t7=s-5auyU^IYo={xq!J`=Yx{Y5iM-WU1%{8!& z=JmPDg{P8ZFdB&5u&Kmx_>FRGIUk*onVCIS{IG8k3SV##uwgGpdzt} zZD{9#(ign}OiO)hY19)IEmP)^b<>CIR;UWE6>_1|PBVA>P=K71u~MmjM~&NwA-D^_ z*PMjOo?$EQ%EiIdd-$et+fKNJ79eKsol4_NcZEV%Dgua#!5x=>OXFDrMt6m7wg8>@ z$s$ec!7k$qb~I&q=thR!Zt-2NrLw-y6|-@SS&IJ3r@Fj3eb(bi$xA~9$H&Ug>`UPG za}_Vr6FT6sv~PZA>hm0{p^O$RzxD-Di%NcM^lK?h-1te+;B<>aM55o*9 z$~iT!WGC`+Qfl2e`okN!)43-G;H$`6!_aF?hJe;J^J5QevL-gZ+dKGtManr|$x}_6 z4-Vlfy~*ziC3Fsh1r#86#VX=W*ubd&m~LG+I`i9PkQTwE;K(gc-u7-Vc2(~i$)8S< z(pzUGSo6X=7eChK7E>1ovOh`&ln*&ZPgoJca%0`v+R1o3tG}Y2;2^k*ckp-TPg>M1 zFiH@cfxq(njmLgK*5997A3VN?z^CfgO{i#fiU_YB)z9iEph4Xjm7 zm~*g*5vHJZU@@IjsOxG2Ga2~W3h1T_A=O{+JH)N9TPHuxVxUZApHjPFd_}e0(h1U3 zIc6vP^d02w(B!@uiX+VlL1~N4O;F9!)2yuia&PI6j5Os8s(pU228{XWW{EOI-k%Po z42PYaGyGJ$SN-*p^tJdh9EGBG{U^S(T8d&a+G7Ux8s{s!qw{FAPK5ka!Nc9DAK0hE zB3j3BM!}4$Rvah{A?Sh=BZ-R|$C99KHEyB#*Y_#Q>!f7K_*U_y96m9|WGEe}BZ#yE zF}8N~ON^)Zj^=SrIMVGz`R&d{tF+5yIX!$SH^qq+CMSp*=dT&RelC`yUsg};t8-#9 zesI^{Tcz>PB~t+4Gi58#cx$-HE%m58%yOPN& zAMMA}+lyFZw%>8z9*mL{zNYL0R$c$jkc99$INndaHakykFgs@BxO%#ZSME292TpeB zv|;_Ieq_S<@flLt&8O6rYLl4$!nutyOZ|BzbZd5jo@up-e$xe#)3B09 z2w2zvK=M(to0hTy(RpdT_`x^KL@ea0UZt*LY&PtiEG#9xKb|v|7&wOOZ!W>-KB~Ci zoc}4~R!yGcL??QH98vDdqzSy11(;D}`=RzSOC%YGK)b|oYCe=9YaI*TpVe1iRyh?2 z7(8*_1XDpS{iX6J%a!@=>GHXb&*h%z_#=HV8rfeJGvhsu*PeVeN%gw8&ZZEh{iM38 z)af6UdNDHhNdMa0{m4S6Cs5&#kw&oRAFvY=Iz4)n&$B4+>zIJs|sDD>TjHEkz2B%$t2t?bMUL= z*1TOJLt{H}Zb3+q&T~YtclU4|85vm;7^|JwAvKVl-fnVb`P=f!RAh(Sp|U2P3{9ZW z)k-eGBghuOfx8%|>fI=;TRjTCfVc5hW6h{vrQxrqo;^h-9YxxR0jo%%g&H4$vT?aw zTHWY&h9`3@O{>s?o}}HKL9X;t%`NZB{c}!P?ppN}ZDkG@R68-s4t_59! zhm;;7gjJJV8kRy%~S|2 zN6P`C>0r6X9_{R3Fj(L~J3LXGk>bb+!Cdodb_@!9QPJzv#LKbSt@&Znchb-@_WVFtpGP5R)23xH2?)s1grTs*ItOanHL&m5|W#|!DI4+ zgZw<%&++;pE=WY~>Skkt?cqTo(4k00czb}JS3C{JYxZr1l9qvE9=L__z_ z{Hz=!s``jZbVNmh735U^$K;BYKaGisPBH_FhRAeqf1*AZNvJhGj|(>Du@TyDzVN2Z zBF)6-Gn`Ys>w}Xc&=AEh-DIJc6w88FZLSFfXf7UJ^T@p72j{1^l{weW_Cs)$V{8Rf zHKMeXfsDpY+OXd>%W5qu6&}`=wP?GKYBz8X72b zJ91QA42&!zjo@XPx0LE1^{@Sbz6aR^&c8_46my>mZ+Dpu&q9);+oPOh?-G)wc1W0B zJN~MlJeiMaaTsy*y6s96e5w%Y{CTr%oz-UPMVCC4Ky& zBtCkd4cRNJ2qd>uLM50~nj!$0qk}}V4uR$aqF~?%B=KrF^^Bok){xU`tKgdZavJ!@ z=wZ;XjZeN;&$G5~kpB_&(s< ASprocess.msc - --------------------------------------------------------------------------------- - How to generate PNG file ? --------------------------------------------------------------------------------- - -Parse the MSC description file using the Python script msc_gen.py: - -./msc_gen.py ASprocess.msc - -Warning: msc_gen.py needs mscgen utility to be installed. mscgen is a C -program that uses the GD graphics library for PNG output. - diff --git a/openair3/NAS/TEST/MSC/SwitchOffDetach.png b/openair3/NAS/TEST/MSC/SwitchOffDetach.png deleted file mode 100644 index 77b28c11a52b7f5b8b6af762c6ea7bc3c77c6c93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3697 zcmcIndo+~m+kVw9o06SMg-nONQ_c#7&=yHKG)`fLAqhDo$#undY+7n zjImzgBPY_wZ#^?=1)Gzs-p91W$TYZ%hvPEC9UhEeWqTHOa3Gm&_I}S*}4}iGo zy_Owa>E=LYSV&!y$t^JBQmc9Y_a4ZY-(O%sdzcIOXmZmmSV?IvSkJADbNr1!^H%NE zjXUHt_&66y3rCVPs|cj!i=>(5q>#(z|5c{)kM-c+Wni6(|3&0tf(7i^=qS;v}VrPI{uuIT1oqrI0P2&au+W_}3Sa8h?*Y(BeA_WP-2N@JpP0L?XA zE`3(D56pzbfJlr)3oNb9`g-fV;3Z>%Hmy2!*@jqb>=!zk6{eH_G$HFb?eydsQ}#y< z|Jv7y*R;HGd;} z(i~a#hofc=u|~BNy@gQc&FFop*6)sBUZfG&S%G{tntEr0{Sv&ayyM}NB?t&v;eV9@ znkhBR0i5B?q5MyseVPrQ2NQ{+rT1Db%bd0ptXhrBLaA=uj&HHTmyq5y)6lXK_xPO( zUs!oMEr zy`KOeEfALi=n@I#lD@U6Sz}@N`|N^w)!I2s7B_RhRvQLYB~Us|oVR*k7!~S0S8?%b zHIo(9Q7^B1gCqnq%-LNPZH%A<<;Ix?Hpb5vMZQ1sRW&TL{8PmaZpd@Zw$F1B2UQo{ zKQ*`;lPN~EYgGA?TCIij>9YBqK4k>;_akoG4hxM%s&dR@!w*9XLhmhz;UAY$0052R z*!cO>K_5kWBQZ(al6Hw3KD6$V1s3Ng6npB1z|@)aHIQokU0cM>y;o%RkG@?!B~-I$ zC2R(O#Yb!DRe~=NU~Bm!jzl03EOO}@cflsEy-d(U=P!!^-&3$ENs3s&W#ADOA{k#} z3z45!-xyN_6g;aV3amx%^2+0yLMVp34 zG}UecIb2oSA_kfz%Y|EZI8?_|vKDCFD6&JV-J&?;9>2h__qWWTGQ9EZ@v|q#xm+%P zmUGD#{1^D?Nyx2|d&hYU!x`SqCr!ze`^23}RHoXEECTOUkD;*XD+^{&5ukGRwJPkz z6o!s^Ga0w6a&)jKBo$j-3N}ZrbZ@6Ew9o0%l*$uIU4^`5T6pcL&|iB`Oa++~8@9Bd ztZ+nV*#JU;+Gw=GN>^j3>$wQ`=Iu%bXV;5m&|QVU&tTqh3Lj9(FMc`ekZsl>zLd6x z3fcX`WH#>W((3J*XL?*6aG4*0)Hu?F7v3_o_xF4bMUX|tda!8RVC&^B*f9nY-n4dXYC8Y2@BcfQE=n%Lpw^aTU`VOi^8HOGx8VFs!*kGXJzT@m0 zkF}o2N8~e=nXi6nzQHsmN4uKTHngR&>8duwszOwVRXYaSE%@Q{?2UN=#aTWJ!nqz; zR0$yWNp0iSUUMuxz_Wz}y&d4$F840L(?_R9&nJvpV@D6VP_N&=@PUY;Ip8)5?46hW zM@;ej?CCP@(R!VAWB#D?JyBRUm-i)7-~{R-`9oL{Ic^e8t|>dMpI zJy7UZ9QNwMEHAs=QSpDu*fmv#J0g{BdFlZ!$_Ux`B-=pKh1sQnzf)+A#pSAJS9aJr z?F3d$QxNM;xtr`)8`0^j>|DSMW(DKYu8fDzGFN(b<9}wPKqN_#uadL&PaZVel|;g) z-AKL8nH2Ryt-ln*_rx((BKTSd!{S3EJL@DyP}ZE+<{`~>|6KZG?EBL|ds2XYk5`z< zXyy5nyUQ{2Bm(%WGomldLIGr)`zDkC~!(Ew?4xf%wuQY!{4s4Wm z9soRhYG^iSj`$INs_pS*$}w7Z2mdb4d-Q_sYr+D3w;i_Hdzaja24ScY`Vm3u-{meQ z^?#b!6}lryRoNz^s*a^yAENvo<#|`ow2V%;>6s##F9eKDDa7`BDVIr+8IlO=iBCxO zUz&QWJ4}xP)PB~?&1OP}G&LF;Q^k*92Ms6*LPlUP;=zmuIMvefFGsmXH)eEyLNFao z#&Eg8xKK<&2z)uoCZ;VfE0Dxj%=!L@8g)EuEq~XSW6Paqw}%@o%m~!XDRH5**tlnveZj9glN=oijI60HpG%gP`%umos5w(#pN5}9W-VNwt6x?^~KlWUCFtvU6Yq6qz z*Bz-WZubPJsZqOzPV$}61yZxMe}{Af_She2k}NKQa)@=>ym2u7E7jMhPbfXs+&WMo zJ@9ZeiZ~?k_NG_Ob=ngsLip-xiVjL_(2UF2U_@awz&*9h9@G#XlCBjWP_ZfTh}LFn za(;167$>P{W1+((nZ#b}T#SFPnSxHfS<(-)2UC01DcgAJCRkqU!-VU5Zsu#vJS%)W zd7R-N10N+Li1snGaK;4Yx&=(0KYS>$Zp?9DbaE!~MHywuIV!xUyIWRMx&M<-?%2;Q z=cLE3A*~ljY2&fWh9dsCNCTq`F_EnWW8?Dn*|>X@Q~UN#@+aF`F66|msC`qoexfQ? zzp*WaUU}Tvn|ZNx_zK_N;gs#Mgi*GZsvV+Y*eJ95Kw6FAbYd>9?E*Qr$*^(B6|cBI zREOnUFk?BQ`}*elX;jtq#`vlH``L+jGZk9nM2`I&jbz7 znLMq5$ii%Vm0Pw3%cCAkitHQp^6cJsnEXP&VSL-?7=f+Bboi7Joih8aM`wb4|&~p1q$k$BsfrZJTa{&^+J<{Ezf8QtLDRJvL*en#sszD%NJ-1sSHrF;( ztJ#<;5cN&Wi(kSW5hz<|FdwaM;?vzYmKIZ(-uGMeuB*p+kbOy|BXn2!L^D>+>7^bxg0yw-`xl{ZjjA0c*P?c*8v(3rGid=DB0i`rux9qtz~#D8Tx zHmX{gs|c*f(hN*E>t`rSG>aADV&v-)Au3fS%A?s|-f9FWsTyKUymMQize0sfM+o+O zuDj1&1PN}3_gpER!PZb?r-VU&KFiLG&U`HMkNT+Rl*bp7-Bb?Wh1kWS0&{EYRqA;* zy|E3ju{f3A!iF(b1uf6d^CFT2s(F5D}d)>yXhYg%v4Oo^*6f-mG zVN6=c9Q4LyU&EW5eberzu3Or27u^vW`#4J;) z=*^-eIJL2PKKbhWL;m=qk1VY2`(UFjJ21n{%L`)tt&HOxG!0YW;>hY9Ino-!cD3fa z1vKk#jM>V|ql*f4CG04Cc}vmMrJn|e%1UhLn`Yne!&Se@8fJ<>Q%~y7+8%U#)>{=V zkc0vH6$O@}`o~8qSgH}mj7xWYIE>r(dE3haq<0!$WMB /tmp/msc_log1.txt - - -# Now, examples of how to generate a mscgen trace in a C executable: -# -First you have to declare the instance(s) of the protocol(s) that will send or receive messages. -# This is done with the following line: -# [MSC_NEW][system time][protocol_name=instance_name] -# examples: -# printf("[MSC_NEW][%s][MIH-F=%s]\n", getTimeStamp4Log(), g_mihf_id); for declaring a new instance of a protocol entity of type MIH-F -# with an instance name g_mihf_id (of type char*) -# printf("[MSC_NEW][%s][NAS=%s]\n", getTimeStamp4Log(), "nas"); other example. -# This declaration of instances of protocols is mandatory to for this script to work. -# -# -Then for tracing a message you have to log a line following this format: -# [MSC_MSG][system time][source instance_name][--- message_name --->][destination instance_name] -# Note: -# ---> means a message that has been received correctly by destination -# ---x means a message lost by destination -# example -# NOTICE("[MSC_MSG][%s][%s][--- Link_Register.indication\\n%s ---x][%s]\n",getTimeStamp4Log(),g_link_id,g_msc_gen_buf,g_mihf_id); -# - - - - -import sys -import subprocess -import re -import socket -import datetime -import os.path -from datetime import date - -MSCGEN_OUTPUT_TYPE = "png" -MAX_MESSAGES_PER_PAGE = 36 - -SYSTEM_FRAME_NUMBER_STR = 'FRAME' -MODULE_STR = 'MOD' -RADIO_BEARER_STR = 'RB' -MSC_NEW_STR = '[MSC_NEW]' -MSC_MSG_STR = '[MSC_MSG]' -MSC_NBOX_STR = '[MSC_NBOX]' -MSC_BOX_STR = '[MSC_BOX]' -MSC_ABOX_STR = '[MSC_ABOX]' -MSC_RBOX_STR = '[MSC_RBOX]' - -# This dic is filled as follow : g_entities_dic[protocol_instance_name].append(protocol_name) -# where protocol_name can be any of the following MI-USER, MIH-F, RAL, LINK-SAP -g_entities_dic = {} -g_reverse_entities_dic = {} - - -# g_messages is filled with dictionnaries: -# message_dic['entity_src'] = protocol_entity_src -# message_dic['entity_dst'] = protocol_entity_dest -# message_dic['msg'] = message -# message_dic['line_color'] = g_display_color[entity_name] -# message_dic['text_color'] = g_display_color[entity_name] -# message_dic['time'] = system_frame_number -# message_dic['seq_no'] = sequence_number_generator() -# g_messages.append(message_dic) -g_messages = [] -g_messages_dic = {} - - -# g_display_order_dic is a dictionnary where the order of the display of entities sharing the same module identifier is hardcoded -#MAC and PHY valus have to be above num max radio bearer value -#g_display_order_dic = {'MIH-USER': 0, 'MIH-F': 1, 'RAL': 3, 'NAS': 4} -g_display_order_dic = {'NAS-UE': 0, 'AS': 1, 'NAS-MME': 3} - -# Display color of messages of sending entities -g_display_color = {'IP': '\"teal\"', - 'RRC_UE': '\"red\"', - 'MIH-USER': '\"black\"', - 'MIH-F': '\"black\"', - 'RAL': '\"black\"', - 'RAL_M': '\"black\"', - 'RLC_UM': '\"navy\"', - 'RLC_TM': '\"navy\"', - 'NAS': '\"black\"', - 'MAC_eNB': '\"indigo\"', - 'PHY': '\"purple\"', - 'NAS-UE': '\"black\"', - 'NAS-MME': '\"black\"', - 'AS': '\"black\"'} - - -g_final_display_order_list = [] -g_sequence_generator = 0 - -def sequence_number_generator(): - global g_sequence_generator - l_seq = g_sequence_generator - g_sequence_generator = g_sequence_generator + 1 - return l_seq - -def parse_log_file_for_discovering_protocol_entities(filename): - global g_entities_dic - global g_entities - global g_messages - global g_final_display_order_list - #open TXT file that contain OAI filtered traces for mscgen - - fhandle = open(filename, 'r') - fcontent = fhandle.read() - fhandle.close() - - # split file content in lines - lines = fcontent.splitlines() - for line in lines: - system_time = 'unknown' - - # if line is a trace of the creation of a new protocol instance - if MSC_NEW_STR in line: - partition = line.rpartition(MSC_NEW_STR) - msc_log_string = partition[2] - #print (" %s " % msc_log_string) - partition = msc_log_string.split('[') - print ("\n\n %s \n" % partition) - #if len(partition) == 2: - - item = partition[1] - item = item.strip() - item = item.strip(']') - system_time = item.split(' ')[-1] - print ("NEW system_time %s " % system_time) - - item = partition[2] - item = item.strip() - item = item.strip(']') - protocol_entity_type = item.split('=')[0] - protocol_entity_name = item.split('=')[-1] - print ("NEW protocol_entity_type %s " % protocol_entity_type) - print ("NEW protocol_entity_name %s " % protocol_entity_name) - - if protocol_entity_name not in g_entities_dic: - g_entities_dic[protocol_entity_name] = protocol_entity_type - - if protocol_entity_type not in g_reverse_entities_dic: - g_reverse_entities_dic[protocol_entity_type] = protocol_entity_name - else: - entity_name_list = g_reverse_entities_dic[protocol_entity_type] - entity_name_list.append(protocol_entity_name) - g_reverse_entities_dic[protocol_entity_type] = entity_name_list - #print (" g_entities_dic[%d][%d].append(%s)" % (module_id_int, radio_bearer_id_int, entity_name_src)) - print (" g_entities_dic= %s\n\n" % (g_entities_dic)) - print (" g_reverse_entities_dic= %s\n\n" % (g_reverse_entities_dic)) - - #g_entities.append(protocol_entity_type) - #print (" %s \n" % protocol_entity) - - - - - -def parse_log_file(filename): - global g_entities_dic - global g_entities - global g_messages - global g_final_display_order_list - #open TXT file that contain OAI filtered traces for mscgen - fhandle = open(filename, 'r') - fcontent = fhandle.read() - fhandle.close() - - # split file content in lines - lines = fcontent.splitlines() - for line in lines: - system_time = 'unknown' - message = 'unknown' - entity_name_src = 'unknown' - entity_name_dest = 'unknown' - - - # if line is a trace of the creation of a new protocol instance - if MSC_MSG_STR in line: - partition = line.strip().rpartition(MSC_MSG_STR) - msc_log_string = partition[2].strip() - print (" ++++ %s " % msc_log_string) - partition = msc_log_string.split('[') - print (" ++++ %s " % partition) - - #if len(partition) == 9: - message_dic = {} - - system_time = partition[1].strip().split(' ')[-1].strip(']') - message_dic['display_time'] = system_time - seconds_int = int(system_time.split(':')[0]) - micro_seconds_int = int(system_time.split(':')[-1]) - system_time_int = seconds_int*1000000 + micro_seconds_int - system_time=str(system_time_int) - print ('system_time %s' % system_time) - - entity_name_src = partition[2].strip().split(' ')[-1].strip(']') - print ('entity_name_src %s' % entity_name_src) - - message = partition[3].strip().strip(']').strip() - if (message[-1] == 'x') or (message[-1] == 'X'): - message_dic['arc'] = '-x' - elif message[-1] == '>': - message_dic['arc'] = '=>' - message = message.strip('<').strip('>').strip('x').strip('X').strip('-').strip('=').strip() - print ('message %s' % message) - - entity_name_dest = partition[4].strip().split(' ')[-1].strip(']') - print ('entity_name_dest %s' % entity_name_dest) - message_dic['entity_src'] = entity_name_src - message_dic['entity_dst'] = entity_name_dest - message_dic['msg'] = message - message_dic['line_color'] = g_display_color[g_entities_dic[entity_name_src]] - message_dic['text_color'] = g_display_color[g_entities_dic[entity_name_src]] - message_dic['time'] = system_time - #message_dic['seq_no'] = sequence_number_generator() - print ('%s\n\n' % message_dic) - g_messages_dic[system_time_int] = message_dic - #g_messages.append(message_dic) - -#TODO !!! - if MSC_RBOX_STR in line: - partition = line.strip().rpartition(MSC_RBOX_STR) - msc_log_string = partition[2].strip() - print (" ==== %s " % msc_log_string) - partition = msc_log_string.split('[') - print (" ==== %s " % partition) -#TODO !!! - -def generate_sorted_message_list(): - first_time_stamp = 0 - for system_time_int in sorted(g_messages_dic.iterkeys()): - if first_time_stamp == 0: - first_time_stamp = system_time_int - message_dic = g_messages_dic[system_time_int] - message_dic['seq_no'] = sequence_number_generator() - message_dic['display_time'] = str(system_time_int - first_time_stamp) - g_messages.append(message_dic) - -def generate_sorted_entity_display_list(): - module_display_order_dic = {} - for entity_name in sorted(g_entities_dic.iterkeys()): - module_display_order_dic[g_display_order_dic[g_entities_dic[entity_name]]] = entity_name - - - print("------------------------------------") - print(" %s " % (module_display_order_dic)) - - for display_priority in sorted(module_display_order_dic.iterkeys()): - g_final_display_order_list.append(module_display_order_dic[display_priority]) - -def msc_chart_write_header(fileP): - global g_final_display_order_list - fileP.write("msc {\n") - fileP.write("width = \"2048\";\n") - - entity_line_list_str = '' - for entity in g_final_display_order_list: - entity_line_list_str = entity_line_list_str + ' ' + entity + ',' - - entity_line_list_str = entity_line_list_str.rstrip().strip(',') - fileP.write(" %s;" % (entity_line_list_str)) - - -def msc_chart_write_footer(fileP): - fileP.write("\n}\n") - -def msc_chart_generate(file_nameP): - global MSCGEN_OUTPUT_TYPE - command_line = "mscgen -T " + MSCGEN_OUTPUT_TYPE + " -i " + file_nameP + "; chmod 777 " +file_nameP + ";" - - print("Command Line: %s " % (command_line)) - fi,fo,fe=os.popen3(command_line) - for i in fe.readlines(): - print "error:",i - -def get_nem_file_descriptor(): - global g_base_file_name - global g_page_index - l_file_name = g_base_file_name + str(g_page_index)+'.txt' - l_file = open(l_file_name, "w", 0777) - return l_file - - -###### MAIN START HERE ################# -num_args = len(sys.argv) -if num_args < 2: # the program name and the arguments - # stop the program and print an error message - sys.exit("Must provide at least one file to parse") - -for i in range(1,num_args): - print sys.argv[i] - -for i in range(1,num_args): - parse_log_file_for_discovering_protocol_entities(sys.argv[i]) - -for i in range(1,num_args): - parse_log_file(sys.argv[i]) - -generate_sorted_message_list() -generate_sorted_entity_display_list() - -g_page_index = 0 -g_message_index = 0 -g_message_index_in_current_page = 0 -g_now = datetime.datetime.now() -g_now_formated = g_now.strftime("%Y-%m-%d_%H.%M.%S") -g_currentdir = os.curdir -g_resultdir = os.path.join(g_currentdir, g_now_formated) -os.mkdir(g_resultdir, 0777) -os.chdir(g_resultdir) - -g_base_file_name = 'mih_mscgen_page_' - -g_file = get_nem_file_descriptor() -msc_chart_write_header(g_file) - -for message in g_messages: - - if 'msg' in message: - print ('message %s' % message) - g_file.write(" %s%s%s [ label = \"(%d) T%s %s\", linecolour=%s , textcolour=%s ] ;\n" % (message['entity_src'], message['arc'], message['entity_dst'], message['seq_no'], message['display_time'], message['msg'], message['line_color'], message['text_color'])) - elif 'box' in message: - g_file.write(" %s %s %s [ label = \"%s\", textbgcolour=%s , textcolour=%s ] ;\n" % (message['entity_src'], message['box_type'], message['entity_dst'], message['box'], message['textbg_color'], message['text_color'])) - - g_message_index = g_message_index + 1 - g_message_index_in_current_page = g_message_index_in_current_page + 1 - - if (g_message_index_in_current_page == MAX_MESSAGES_PER_PAGE): - msc_chart_write_footer(g_file) - g_file.close() - msc_chart_generate(g_file.name) - g_page_index = g_page_index + 1 - g_message_index_in_current_page = 0 - - g_file = get_nem_file_descriptor() - msc_chart_write_header(g_file) - - -msc_chart_write_footer(g_file) -g_file.close() -if g_message_index_in_current_page >= 1: - msc_chart_generate(g_file.name) -else: - print("Removing empty seq diagram file: %s " % (g_file.name)) - os.remove(g_file.name) diff --git a/openair3/NAS/UE/EMM/Detach.c b/openair3/NAS/UE/EMM/Detach.c index 719e18dd05..b61bcdc14d 100644 --- a/openair3/NAS/UE/EMM/Detach.c +++ b/openair3/NAS/UE/EMM/Detach.c @@ -53,7 +53,6 @@ Description Defines the detach related EMM procedure executed by the #include "emm_sap.h" #include "esm_sap.h" -#include "msc.h" #include // free diff --git a/openair3/NAS/UE/EMM/Identification.c b/openair3/NAS/UE/EMM/Identification.c index b5807973a2..0364c6d22f 100644 --- a/openair3/NAS/UE/EMM/Identification.c +++ b/openair3/NAS/UE/EMM/Identification.c @@ -48,7 +48,6 @@ Description Defines the identification EMM procedure executed by the #include "emmData.h" #include "emm_sap.h" -#include "msc.h" #include "user_defs.h" #include // malloc, free diff --git a/openair3/NAS/UE/EMM/SAP/emm_as.c b/openair3/NAS/UE/EMM/SAP/emm_as.c index 6b226be380..ea4eefadeb 100644 --- a/openair3/NAS/UE/EMM/SAP/emm_as.c +++ b/openair3/NAS/UE/EMM/SAP/emm_as.c @@ -61,7 +61,6 @@ Description Defines the EMMAS Service Access Point that provides #if defined(NAS_BUILT_IN_UE) # include "nas_itti_messaging.h" #endif -#include "msc.h" /****************************************************************************/ /**************** E X T E R N A L D E F I N I T I O N S ****************/ diff --git a/openair3/NAS/UE/EMM/SecurityModeControl.c b/openair3/NAS/UE/EMM/SecurityModeControl.c index b27270fadc..f9a02b1a70 100644 --- a/openair3/NAS/UE/EMM/SecurityModeControl.c +++ b/openair3/NAS/UE/EMM/SecurityModeControl.c @@ -63,7 +63,6 @@ Description Defines the security mode control EMM procedure executed by the # include "assertions.h" #include "secu_defs.h" -#include "msc.h" #include "SecurityModeControl.h" #if defined(NAS_BUILT_IN_UE) diff --git a/openair3/NAS/UE/nas_itti_messaging.c b/openair3/NAS/UE/nas_itti_messaging.c index 8016e0d791..c6762a7128 100644 --- a/openair3/NAS/UE/nas_itti_messaging.c +++ b/openair3/NAS/UE/nas_itti_messaging.c @@ -23,7 +23,6 @@ #include "intertask_interface.h" #include "nas_itti_messaging.h" -#include "msc.h" # define TASK_ORIGIN TASK_NAS_UE @@ -104,27 +103,6 @@ int nas_itti_kenb_refresh_req(const Byte_t kenb[32], int user_id) { MessageDef *message_p; message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_KENB_REFRESH_REQ); memcpy(NAS_KENB_REFRESH_REQ(message_p).kenb, kenb, sizeof(NAS_KENB_REFRESH_REQ(message_p).kenb)); - MSC_LOG_TX_MESSAGE( - MSC_NAS_UE, - MSC_RRC_UE, - NULL,0, - "0 NAS_KENB_REFRESH_REQ KeNB " - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x" - "%02x%02x%02x%02x", - kenb[0], kenb[1], kenb[2], kenb[3], - kenb[4], kenb[5], kenb[6], kenb[7], - kenb[8], kenb[9], kenb[10], kenb[11], - kenb[12], kenb[13], kenb[14], kenb[15], - kenb[16], kenb[17], kenb[18], kenb[19], - kenb[20], kenb[21], kenb[22], kenb[23], - kenb[24], kenb[25], kenb[26], kenb[27], - kenb[28], kenb[29], kenb[30], kenb[31]); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } @@ -133,13 +111,6 @@ int nas_itti_cell_info_req(const plmn_t plmnID, const Byte_t rat, int user_id) { message_p = itti_alloc_new_message(TASK_NAS_UE, 0, NAS_CELL_SELECTION_REQ); NAS_CELL_SELECTION_REQ(message_p).plmnID = plmnID; NAS_CELL_SELECTION_REQ(message_p).rat = rat; - MSC_LOG_TX_MESSAGE( - MSC_NAS_UE, - MSC_RRC_UE, - NULL,0, - "0 NAS_CELL_SELECTION_REQ PLMN %X%X%X.%X%X%X", - plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3, - plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } @@ -152,14 +123,6 @@ int nas_itti_nas_establish_req(as_cause_t cause, as_call_type_t type, as_stmsi_t NAS_CONN_ESTABLI_REQ(message_p).plmnID = plmnID; NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.data = data; NAS_CONN_ESTABLI_REQ(message_p).initialNasMsg.length = length; - MSC_LOG_TX_MESSAGE( - MSC_NAS_UE, - MSC_RRC_UE, - NULL,0, - "0 NAS_CONN_ESTABLI_REQ MME code %u m-TMSI %u PLMN %X%X%X.%X%X%X", - s_tmsi.MMEcode, s_tmsi.m_tmsi, - plmnID.MCCdigit1, plmnID.MCCdigit2, plmnID.MCCdigit3, - plmnID.MNCdigit1, plmnID.MNCdigit2, plmnID.MNCdigit3); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } @@ -178,11 +141,5 @@ int nas_itti_rab_establish_rsp(const as_stmsi_t s_tmsi, const as_rab_id_t rabID, NAS_RAB_ESTABLI_RSP(message_p).s_tmsi = s_tmsi; NAS_RAB_ESTABLI_RSP(message_p).rabID = rabID; NAS_RAB_ESTABLI_RSP(message_p).errCode = errCode; - MSC_LOG_TX_MESSAGE( - MSC_NAS_UE, - MSC_RRC_UE, - NULL,0, - "0 NAS_RAB_ESTABLI_RSP MME code %u m-TMSI %u rb id %u status %u", - s_tmsi.MMEcode, s_tmsi.m_tmsi,rabID, errCode ); return itti_send_msg_to_task(TASK_RRC_UE, NB_eNB_INST + user_id, message_p); } diff --git a/openair3/NAS/UE/nas_itti_messaging.h b/openair3/NAS/UE/nas_itti_messaging.h index 967bbb3059..79b70394f0 100644 --- a/openair3/NAS/UE/nas_itti_messaging.h +++ b/openair3/NAS/UE/nas_itti_messaging.h @@ -26,7 +26,6 @@ #include "assertions.h" #include "intertask_interface.h" #include "esm_proc.h" -#include "msc.h" #ifndef NAS_ITTI_MESSAGING_H_ #define NAS_ITTI_MESSAGING_H_ diff --git a/openair3/NAS/UE/nas_proc.c b/openair3/NAS/UE/nas_proc.c index 6312a7dc97..9350590788 100644 --- a/openair3/NAS/UE/nas_proc.c +++ b/openair3/NAS/UE/nas_proc.c @@ -46,7 +46,6 @@ Description NAS procedure call manager #include "esm_main.h" #include "esm_sap.h" -#include "msc.h" #include // sprintf diff --git a/openair3/NAS/UE/nas_ue_task.c b/openair3/NAS/UE/nas_ue_task.c index 88938c3c37..a94445349c 100644 --- a/openair3/NAS/UE/nas_ue_task.c +++ b/openair3/NAS/UE/nas_ue_task.c @@ -29,12 +29,9 @@ # include "user_api.h" # include "nas_parser.h" # include "nas_proc.h" -# include "msc.h" # include "memory.h" #include "nas_user.h" -#include - // FIXME make command line option for NAS_UE_AUTOSTART # define NAS_UE_AUTOSTART 1 @@ -97,7 +94,6 @@ void *nas_ue_task(void *args_p) nas_user_container_t *users=args_p; itti_mark_task_ready (TASK_NAS_UE); - MSC_START_USE(); LOG_I(NAS, "ue_idx_standalone val:: %u\n", ue_idx_standalone); /* Initialize UE NAS (EURECOM-NAS) */ // Intead of for loop for standalone mode diff --git a/openair3/NGAP/ngap_gNB.c b/openair3/NGAP/ngap_gNB.c index a5dfc88b35..9d6bd7f07f 100644 --- a/openair3/NGAP/ngap_gNB.c +++ b/openair3/NGAP/ngap_gNB.c @@ -57,7 +57,6 @@ #include "ngap_gNB_itti_messaging.h" #include "ngap_gNB_ue_context.h" // test, to be removed -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -273,7 +272,6 @@ void ngap_gNB_init(void) { NGAP_DEBUG("Starting NGAP layer\n"); ngap_gNB_prepare_internal_data(); itti_mark_task_ready(TASK_NGAP); - MSC_START_USE(); } void *ngap_gNB_process_itti_msg(void *notUsed) { diff --git a/openair3/NGAP/ngap_gNB_context_management_procedures.c b/openair3/NGAP/ngap_gNB_context_management_procedures.c index 73e4498f19..ea22c91bc2 100644 --- a/openair3/NGAP/ngap_gNB_context_management_procedures.c +++ b/openair3/NGAP/ngap_gNB_context_management_procedures.c @@ -50,7 +50,6 @@ #include "ngap_gNB_management_procedures.h" #include "ngap_gNB_context_management_procedures.h" #include "NGAP_PDUSessionResourceItemCxtRelReq.h" -#include "msc.h" int ngap_ue_context_release_complete(instance_t instance, @@ -116,16 +115,6 @@ int ngap_ue_context_release_complete(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - buffer, - length, - MSC_AS_TIME_FMT" UEContextRelease successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %lu", - 0,0, //MSC_AS_TIME_ARGS(ctxt_pP), - ue_release_complete_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); - /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -267,16 +256,6 @@ int ngap_ue_context_release_req(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - buffer, - length, - MSC_AS_TIME_FMT" UEContextReleaseRequest initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %lu", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_release_req_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); - /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, diff --git a/openair3/NGAP/ngap_gNB_handlers.c b/openair3/NGAP/ngap_gNB_handlers.c index 2b0e8aab7c..4692d2cd32 100644 --- a/openair3/NGAP/ngap_gNB_handlers.c +++ b/openair3/NGAP/ngap_gNB_handlers.c @@ -48,7 +48,6 @@ #include "assertions.h" #include "conversions.h" -#include "msc.h" #include "NGAP_NonDynamic5QIDescriptor.h" static @@ -1208,14 +1207,6 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id, case NGAP_UE_NGAP_IDs_PR_uE_NGAP_ID_pair: gnb_ue_ngap_id = ie->value.choice.UE_NGAP_IDs.choice.uE_NGAP_ID_pair->rAN_UE_NGAP_ID; asn_INTEGER2ulong(&(ie->value.choice.UE_NGAP_IDs.choice.uE_NGAP_ID_pair->aMF_UE_NGAP_ID), &amf_ue_ngap_id); - MSC_LOG_RX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - NULL,0, - "0 UEContextRelease/%s gNB_ue_ngap_id "NGAP_UE_ID_FMT" amf_ue_ngap_id "NGAP_UE_ID_FMT" len %u", - ngap_direction2String(pdu->present - 1), - gnb_ue_ngap_id, - amf_ue_ngap_id); if ((ue_desc_p = ngap_gNB_get_ue_context(amf_desc_p->ngap_gNB_instance, gnb_ue_ngap_id)) == NULL) { @@ -1225,12 +1216,6 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id, gnb_ue_ngap_id); return -1; } else { - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_RRC_GNB, - NULL,0, - "0 NGAP_UE_CONTEXT_RELEASE_COMMAND/%d gNB_ue_ngap_id "NGAP_UE_ID_FMT" ", - gnb_ue_ngap_id); message_p = itti_alloc_new_message(TASK_NGAP, 0, NGAP_UE_CONTEXT_RELEASE_COMMAND); if (ue_desc_p->amf_ue_ngap_id == 0) { // case of Detach Request and switch off from RRC_IDLE mode diff --git a/openair3/NGAP/ngap_gNB_nas_procedures.c b/openair3/NGAP/ngap_gNB_nas_procedures.c index 6686f8c19e..a40e8328da 100644 --- a/openair3/NGAP/ngap_gNB_nas_procedures.c +++ b/openair3/NGAP/ngap_gNB_nas_procedures.c @@ -48,7 +48,6 @@ #include "ngap_gNB_ue_context.h" #include "ngap_gNB_nas_procedures.h" #include "ngap_gNB_management_procedures.h" -#include "msc.h" //------------------------------------------------------------------------------ int ngap_gNB_handle_nas_first_req( @@ -312,14 +311,6 @@ int ngap_gNB_handle_nas_first_req( } ue_desc_p->tx_stream = amf_desc_p->nextstream; - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" initialUEMessage initiatingMessage gNB_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_desc_p->gNB_ue_ngap_id); /* Send encoded message over sctp */ ngap_gNB_itti_send_sctp_data_req(instance_p->instance, amf_desc_p->assoc_id, buffer, length, ue_desc_p->tx_stream); @@ -371,14 +362,6 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id, if ((ue_desc_p = ngap_gNB_get_ue_context(ngap_gNB_instance, gnb_ue_ngap_id)) == NULL) { - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - NULL, - 0, - MSC_AS_TIME_FMT" downlinkNASTransport gNB_ue_ngap_id %u amf_ue_ngap_id %u", - gnb_ue_ngap_id, - amf_ue_ngap_id); NGAP_ERROR("[SCTP %d] Received NAS downlink message for non existing UE context gNB_UE_NGAP_ID: 0x%lx\n", assoc_id, gnb_ue_ngap_id); @@ -410,15 +393,6 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id, } } - MSC_LOG_RX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - NULL, - 0, - MSC_AS_TIME_FMT" downlinkNASTransport gNB_ue_ngap_id %u amf_ue_ngap_id %u", - assoc_id, - amf_ue_ngap_id); - NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_DownlinkNASTransport_IEs_t, ie, container, NGAP_ProtocolIE_ID_id_NAS_PDU, true); /* Forward the NAS PDU to NR-RRC */ @@ -532,15 +506,6 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_ return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" uplinkNASTransport initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -571,10 +536,6 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, /* The context for this gNB ue ngap id doesn't exist in the map of gNB UEs */ NGAP_WARN("Failed to find ue context associated with gNB ue ngap id: %08x\n", ngap_nas_non_delivery_ind->gNB_ue_ngap_id); - MSC_LOG_EVENT( - MSC_NGAP_GNB, - MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to AMF failed, no context for gNB_ue_ngap_id %08x", - ngap_nas_non_delivery_ind->gNB_ue_ngap_id); return -1; } @@ -621,21 +582,9 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) { NGAP_ERROR("Failed to encode NAS NON delivery indication\n"); /* Encode procedure has failed... */ - MSC_LOG_EVENT( - MSC_NGAP_GNB, - MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to AMF failed (encoding)"); return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" NASNonDeliveryIndication initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %lu", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -868,15 +817,6 @@ int ngap_gNB_initial_ctxt_resp( return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" InitialContextSetup successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - initial_ctxt_resp_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ LOG_I(NR_RRC,"Send message to sctp: NGAP_InitialContextSetupResponse\n"); ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, @@ -961,15 +901,6 @@ int ngap_gNB_ue_capabilities(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" UECapabilityInfoIndication initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_cap_info_ind_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -1179,15 +1110,6 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" PduSession Setup successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - pdusession_setup_resp_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -1353,15 +1275,6 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Modify successful Outcome gNB_ue_ngap_id %u amf_ue_ngap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - pdusession_modify_resp_p->gNB_ue_ngap_id, - ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, @@ -1464,15 +1377,6 @@ int ngap_gNB_pdusession_release_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_NGAP_GNB, - MSC_NGAP_AMF, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Release successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %lu", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - pdusession_release_resp_p->gNB_ue_ngap_id, - (uint64_t)ue_context_p->amf_ue_ngap_id); /* UE associated signalling -> use the allocated stream */ ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, diff --git a/openair3/S1AP/s1ap_eNB.c b/openair3/S1AP/s1ap_eNB.c index e528c9e53e..5f30386bb3 100644 --- a/openair3/S1AP/s1ap_eNB.c +++ b/openair3/S1AP/s1ap_eNB.c @@ -56,7 +56,6 @@ #include "s1ap_eNB_itti_messaging.h" #include "s1ap_eNB_ue_context.h" // test, to be removed -#include "msc.h" #include "assertions.h" #include "conversions.h" @@ -507,7 +506,6 @@ void s1ap_eNB_init(void) { S1AP_DEBUG("Starting S1AP layer\n"); s1ap_eNB_prepare_internal_data(); itti_mark_task_ready(TASK_S1AP); - MSC_START_USE(); } void *s1ap_eNB_process_itti_msg(void *notUsed) { diff --git a/openair3/S1AP/s1ap_eNB_context_management_procedures.c b/openair3/S1AP/s1ap_eNB_context_management_procedures.c index 374da7272f..6255abb14d 100644 --- a/openair3/S1AP/s1ap_eNB_context_management_procedures.c +++ b/openair3/S1AP/s1ap_eNB_context_management_procedures.c @@ -47,7 +47,6 @@ #include "s1ap_eNB_nas_procedures.h" #include "s1ap_eNB_management_procedures.h" #include "s1ap_eNB_context_management_procedures.h" -#include "msc.h" int s1ap_ue_context_release_complete(instance_t instance, @@ -111,16 +110,6 @@ int s1ap_ue_context_release_complete(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - buffer, - length, - MSC_AS_TIME_FMT" UEContextRelease successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0, //MSC_AS_TIME_ARGS(ctxt_pP), - ue_release_complete_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); - /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -246,16 +235,6 @@ int s1ap_ue_context_release_req(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - buffer, - length, - MSC_AS_TIME_FMT" UEContextReleaseRequest initiatingMessage eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_release_req_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); - /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c index 9ee3287b94..b3b38e7017 100644 --- a/openair3/S1AP/s1ap_eNB_handlers.c +++ b/openair3/S1AP/s1ap_eNB_handlers.c @@ -51,7 +51,6 @@ #include "assertions.h" #include "conversions.h" -#include "msc.h" static int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id, @@ -1025,14 +1024,6 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id, case S1AP_UE_S1AP_IDs_PR_uE_S1AP_ID_pair: enb_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.eNB_UE_S1AP_ID; mme_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID; - MSC_LOG_RX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - NULL,0, - "0 UEContextRelease/%s eNB_ue_s1ap_id "S1AP_UE_ID_FMT" mme_ue_s1ap_id "S1AP_UE_ID_FMT" len %u", - s1ap_direction2String(pdu->present - 1), - enb_ue_s1ap_id, - mme_ue_s1ap_id); if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance, enb_ue_s1ap_id)) == NULL) { @@ -1042,12 +1033,6 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id, enb_ue_s1ap_id); return -1; } else { - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_RRC_ENB, - NULL,0, - "0 S1AP_UE_CONTEXT_RELEASE_COMMAND/%d eNB_ue_s1ap_id "S1AP_UE_ID_FMT" ", - enb_ue_s1ap_id); message_p = itti_alloc_new_message(TASK_S1AP, 0, S1AP_UE_CONTEXT_RELEASE_COMMAND); if (ue_desc_p->mme_ue_s1ap_id == 0) { // case of Detach Request and switch off from RRC_IDLE mode diff --git a/openair3/S1AP/s1ap_eNB_nas_procedures.c b/openair3/S1AP/s1ap_eNB_nas_procedures.c index b55bc06e11..0b56d31211 100644 --- a/openair3/S1AP/s1ap_eNB_nas_procedures.c +++ b/openair3/S1AP/s1ap_eNB_nas_procedures.c @@ -46,7 +46,6 @@ #include "s1ap_eNB_ue_context.h" #include "s1ap_eNB_nas_procedures.h" #include "s1ap_eNB_management_procedures.h" -#include "msc.h" //------------------------------------------------------------------------------ int s1ap_eNB_handle_nas_first_req( @@ -310,14 +309,6 @@ int s1ap_eNB_handle_nas_first_req( } ue_desc_p->tx_stream = mme_desc_p->nextstream; - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" initialUEMessage initiatingMessage eNB_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_desc_p->eNB_ue_s1ap_id); /* Send encoded message over sctp */ s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, mme_desc_p->assoc_id, buffer, length, ue_desc_p->tx_stream); @@ -374,14 +365,6 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id, if ((ue_desc_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance, enb_ue_s1ap_id)) == NULL) { - MSC_LOG_RX_DISCARDED_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - NULL, - 0, - MSC_AS_TIME_FMT" downlinkNASTransport eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - enb_ue_s1ap_id, - mme_ue_s1ap_id); S1AP_ERROR("[SCTP %d] Received NAS downlink message for non existing UE context eNB_UE_S1AP_ID: 0x%lx\n", assoc_id, enb_ue_s1ap_id); @@ -413,15 +396,6 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id, } } - MSC_LOG_RX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - NULL, - 0, - MSC_AS_TIME_FMT" downlinkNASTransport eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - assoc_id, - mme_ue_s1ap_id); - S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container, S1AP_ProtocolIE_ID_id_NAS_PDU, true); if(ie == NULL) @@ -536,15 +510,6 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_ return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)NULL, - 0, - MSC_AS_TIME_FMT" uplinkNASTransport initiatingMessage eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -574,10 +539,6 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance, /* The context for this eNB ue s1ap id doesn't exist in the map of eNB UEs */ S1AP_WARN("Failed to find ue context associated with eNB ue s1ap id: %06x\n", s1ap_nas_non_delivery_ind->eNB_ue_s1ap_id); - MSC_LOG_EVENT( - MSC_S1AP_ENB, - MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to MME failed, no context for eNB_ue_s1ap_id %06x", - s1ap_nas_non_delivery_ind->eNB_ue_s1ap_id); return -1; } @@ -623,21 +584,9 @@ int s1ap_eNB_nas_non_delivery_ind(instance_t instance, if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { S1AP_ERROR("Failed to encode NAS NON delivery indication\n"); /* Encode procedure has failed... */ - MSC_LOG_EVENT( - MSC_S1AP_ENB, - MSC_AS_TIME_FMT" Sent of NAS_NON_DELIVERY_IND to MME failed (encoding)"); return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" NASNonDeliveryIndication initiatingMessage eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -802,15 +751,6 @@ int s1ap_eNB_initial_ctxt_resp( return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" InitialContextSetup successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - initial_ctxt_resp_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -891,15 +831,6 @@ int s1ap_eNB_ue_capabilities(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" UECapabilityInfoIndication initiatingMessage eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_cap_info_ind_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -1075,15 +1006,6 @@ int s1ap_eNB_e_rab_setup_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Setup successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - e_rab_setup_resp_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -1238,15 +1160,6 @@ int s1ap_eNB_e_rab_modify_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Modify successful Outcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - e_rab_modify_resp_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -1378,15 +1291,6 @@ int s1ap_eNB_e_rab_release_resp(instance_t instance, return -1; } - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Release successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - e_rab_release_resp_p->eNB_ue_s1ap_id, - ue_context_p->mme_ue_s1ap_id); /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, ue_context_p->mme_ref->assoc_id, buffer, @@ -1615,16 +1519,6 @@ int s1ap_eNB_path_switch_req(instance_t instance, ue_context_p->tx_stream = mme_desc_p->nextstream; - MSC_LOG_TX_MESSAGE( - MSC_S1AP_ENB, - MSC_S1AP_MME, - (const char *)buffer, - length, - MSC_AS_TIME_FMT" E_RAN Setup successfulOutcome eNB_ue_s1ap_id %u mme_ue_s1ap_id %u", - 0,0,//MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_p->eNB_ue_s1ap_id, - path_switch_req_p->mme_ue_s1ap_id); - /* UE associated signalling -> use the allocated stream */ s1ap_eNB_itti_send_sctp_data_req(s1ap_eNB_instance_p->instance, mme_desc_p->assoc_id, buffer, diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index 8d0166f805..ab49125856 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -48,7 +48,6 @@ #include "sctp_default_values.h" #include "sctp_common.h" #include "sctp_eNB_itti_messaging.h" -#include "msc.h" /* Used to format an uint32_t containing an ipv4 address */ #define IPV4_ADDR "%u.%u.%u.%u" @@ -1097,8 +1096,6 @@ void sctp_eNB_init(void) STAILQ_INIT(&sctp_cnx_list); itti_mark_task_ready(TASK_SCTP); - MSC_START_USE(); - } //------------------------------------------------------------------------------ diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c index c4674e8901..fe132fd2f5 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c @@ -44,7 +44,6 @@ #include "s1ap_common.h" #include "play_scenario_s1ap_eNB_defs.h" #include "play_scenario.h" -#include "msc.h" //------------------------------------------------------------------------------ s1ap_eNB_internal_data_t s1ap_eNB_internal_data; RB_GENERATE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, et_s1ap_eNB_compare_assoc_id); @@ -1084,7 +1083,6 @@ void *et_s1ap_eNB_task(void *arg) et_s1ap_eNB_prepare_internal_data(); itti_mark_task_ready(TASK_S1AP); - MSC_START_USE(); while (1) { itti_receive_msg(TASK_S1AP, &received_msg); diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c index bc7ca6afbd..40654fc771 100644 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c @@ -49,7 +49,6 @@ #include "s1ap_common.h" #include "play_scenario_s1ap_eNB_defs.h" #include "play_scenario.h" -#include "msc.h" //------------------------------------------------------------------------------ extern et_scenario_t *g_scenario; extern uint32_t g_constraints; diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c index 8b9fc77bb1..470d6a7942 100644 --- a/openair3/UDP/udp_eNB_task.c +++ b/openair3/UDP/udp_eNB_task.c @@ -44,7 +44,6 @@ #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" -#include "msc.h" #define IPV4_ADDR "%u.%u.%u.%u" @@ -309,7 +308,6 @@ void *udp_eNB_task(void *args_p) udp_enb_init(); itti_mark_task_ready(TASK_UDP); - MSC_START_USE(); while(1) { itti_receive_msg(TASK_UDP, &received_message_p); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 8ad610f1af..15b4319260 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -48,7 +48,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" -#include "msc.h" #include "PHY/defs_common.h" #include "PHY/types.h" #include "PHY/INIT/phy_init.h" diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 85e493f194..3420182bfe 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -34,13 +34,9 @@ #define _GNU_SOURCE /* See feature_test_macros(7) */ #include -#include - - #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" -#include "msc.h" #include "PHY/types.h" @@ -555,13 +551,7 @@ int main ( int argc, char **argv ) cpuf=get_cpu_freq_GHz(); printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED); itti_init(TASK_MAX, tasks_info); - // allows to forward in wireshark L2 protocol for decoding - // initialize mscgen log after ITTI - if (get_softmodem_params()->start_msc) { - load_module_shlib("msc",NULL,0,&msc_interface); - } - MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); init_opt(); // to make a graceful exit when ctrl-c is pressed set_softmodem_sighandler(); diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index cf35a13fe9..ba024f75d2 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -23,7 +23,6 @@ #include "../../ARCH/COMMON/common_lib.h" //#undef MALLOC #include "assertions.h" -#include "msc.h" #include "PHY/types.h" #include "PHY/defs_eNB.h" #include "PHY/defs_UE.h" diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 4395694bf4..2b39bd3f0f 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -37,7 +37,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" -#include "msc.h" #include "PHY/types.h" @@ -596,12 +595,6 @@ int main( int argc, char **argv ) { printf("ITTI init\n"); itti_init(TASK_MAX, tasks_info); - // initialize mscgen log after ITTI - if (get_softmodem_params()->start_msc) { - load_module_shlib("msc",NULL,0,&msc_interface); - } - - MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX); init_opt(); ue_id_g = (node_number == 0) ? 0 : node_number-2; //ue_id_g = 0, 1, ..., if(node_number == 0) diff --git a/targets/RT/USER/ru_control.c b/targets/RT/USER/ru_control.c index 7280c78523..083b5f91ef 100644 --- a/targets/RT/USER/ru_control.c +++ b/targets/RT/USER/ru_control.c @@ -46,7 +46,6 @@ #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #include "assertions.h" -#include "msc.h" #include "PHY/types.h" diff --git a/targets/SCRIPTS/msc_gen.py b/targets/SCRIPTS/msc_gen.py deleted file mode 100755 index ed5d337fc2..0000000000 --- a/targets/SCRIPTS/msc_gen.py +++ /dev/null @@ -1,329 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# The aim of this script is to collect some traces from oai stack and generate a sequence diagram image (png or jpeg). -# -# It is supposed that a protocol name (MSC_NEW_STR) starts with...its name (RRC, MAC, NAS, S1AP, etc) then is followed by an underscore and whatever (RRC_UE, RRC_eNB) -# Like this it is possible to distinguish between PDUS, SDUs or other messages only by reading source ans destination - -import sys -import subprocess -import re -import socket -import datetime -from datetime import date -import os, errno -import argparse - - - - -parser = argparse.ArgumentParser() -parser.add_argument("--diag_rlc_um", "-u", type=str,help="Try to find RLC protocol diagnostics", default="no") -parser.add_argument("--dir", "-d", type=str,help="Directory where msc logs can be found", default="/tmp") -parser.add_argument("--profile", "-p", type=str,help="E_UTRAN, EPC", default="EPC") -parser.add_argument("--no_message", "-M", type=str,help="Trace PDUs, not messages, SDUs", default="no") -parser.add_argument("--no_pdu", "-P", type=str,help="Trace messages, SDUs, not PDUs", default="no") -parser.add_argument("--no_event", "-E", type=str,help="Do not trace events", default="no") -args = parser.parse_args() - -MSCGEN_OUTPUT_TYPE = "png" -MAX_MESSAGES_PER_PAGE = 36 - -MSC_NEW_STR = '[PROTO]' -MSC_MSG_STR = '[MESSAGE]' -MSC_BOX_STR = '[EVENT]' - - -# This list is filled as follow : g_proto_names[module_id_int] = (proto_name), example RRC_UE -g_proto_names = [] -# This list is filled as follow : g_proto_names[module_id_int] = (basename proto_name) example: RRC -g_proto_types = [] - - - -# list of messages -g_messages = {} - - -# Display color of messages of sending entities -g_display_color = ['\"teal\"', # To check in msc.h: MSC_NAS_UE - '\"red\"', # To check in msc.h: MSC_RRC_UE - '\"red\"', # To check in msc.h: MSC_NAS_UE - '\"red\"', # To check in msc.h: MSC_PDCP_UE - '\"red\"', # To check in msc.h: MSC_RLC_UE - '\"red\"', # To check in msc.h: MSC_MAC_UE - '\"red\"', # To check in msc.h: MSC_PHY_UE - '\"indigo\"', # To check in msc.h: MSC_PHY_ENB - '\"indigo\"', # To check in msc.h: MSC_MAC_ENB - '\"indigo\"', # To check in msc.h: MSC_RLC_ENB - '\"indigo\"', # To check in msc.h: MSC_PDCP_ENB - '\"orange\"', # To check in msc.h: MSC_RRC_ENB - '\"black\"', # To check in msc.h: MSC_IP_ENB - '\"black\"', # To check in msc.h: MSC_S1AP_ENB - '\"black\"', # To check in msc.h: MSC_GTPU_ENB - '\"black\"', # To check in msc.h: MSC_GTPU_SGW - '\"black\"', # To check in msc.h: MSC_S1AP_MME - '\"black\"', # To check in msc.h: MSC_MMEAPP_MME - '\"black\"', # To check in msc.h: MSC_NAS_MME - '\"black\"', # To check in msc.h: MSC_NAS_EMM_MME - '\"black\"', # To check in msc.h: MSC_NAS_ESM_MME - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"', - '\"black\"'] - - -# helper for diagnostic of RLC -g_diag_rlc_sn = {} - -g_sequence_generator = 0 - - -g_filenames = [] -if "E_UTRAN" == args.profile.strip(): - g_filenames = [ - args.dir+'/openair.msc.0.log', - args.dir+'/openair.msc.1.log'] -elif "EPC" == args.profile.strip(): - g_filenames = [ - args.dir+'/openair.msc.2.log', - args.dir+'/openair.msc.3.log', - args.dir+'/openair.msc.4.log'] - -def sequence_number_generator(): - global g_sequence_generator - l_seq = g_sequence_generator - g_sequence_generator = g_sequence_generator + 1 - return l_seq - -def file_is_empty(fpath): - return False if os.path.isfile(fpath) and os.path.getsize(fpath) > 0 else True - -def parse_oai_log_files(): - global g_entities_dic - global g_entities - global g_messages - global g_final_display_order_list - #open TXT file that contain OAI filtered traces for mscgen - - # we may insert diagnostic events - event_id_offset = 0 - for filename in g_filenames: - if file_is_empty(filename): - continue - try: - fhandle = open(filename, 'r') - fcontent = fhandle.read() - fhandle.close() - - # split file content in lines - lines = fcontent.splitlines() - for line in lines: - print ("INPUT LINE: %s " % line) - if line.strip() != "" and not line.strip().startswith('#'): - partition = line.split(' ',3) - event_id = int(partition[0]) + event_id_offset - event_type = partition[1] - entity_id = int(partition[2]) - if MSC_NEW_STR == event_type: - entity_name = partition[3] - if len(g_proto_names) <= entity_id: - for i in range(len(g_proto_names),(entity_id +1)): - g_proto_names.append("NotDeclared") - g_proto_types.append("NotDeclared") - g_proto_names[entity_id] = entity_name - partition_name1 = entity_name.split('_',1); - partition_name2 = partition_name1[0].split('-',1); - partition_name3 = partition_name2[0].split(); - g_proto_types[entity_id] = partition_name3 - print ("entity name %s , entity type %s" % (g_proto_names[entity_id],g_proto_types[entity_id]) ) - # if line is a trace of a message between 2 protocol entities or layers - elif MSC_MSG_STR == event_type: - #print ("partition[3]:%s" % partition[3]) - sub_partition = partition[3].split(' ',4) - arrow = sub_partition[0] - entity2_id = int(sub_partition[1]) - mac = int(sub_partition[2]) - time = sub_partition[3] - message = sub_partition[4] - Message = {} - Message['mac'] = mac - Message['time'] = time - Message['message'] = message - Message['line_color'] = g_display_color[entity_id] - Message['text_color'] = g_display_color[entity_id] - if arrow == '<-': - if "yes" == args.diag_rlc_um.strip() and "DATA SN " in message and "RB UM " in message: - rlc_key = re.match(r"[^[]*\[([^]]*)\]", message).groups()[0] - sn_info = message.partition("SN")[2] - if sn_info.strip() != "": - sn_str = sn_info.strip().partition(" ")[0] - sn = int(sn_str) - if rlc_key in g_diag_rlc_sn: - previous_sn = g_diag_rlc_sn[rlc_key] - if (previous_sn + 1) % 1024 != sn: - print ("DIAG missing SN: %s " % line) - MessageDiag = {} - MessageDiag['type'] = "box" - MessageDiag['tx'] = entity_id - MessageDiag['rx'] = entity_id - MessageDiag['discarded'] = False - MessageDiag['time'] = time - MessageDiag['message'] = "Missing SN "+ sn_str + " detected" - MessageDiag['line_color'] = '\"red\"' - MessageDiag['text_color'] = '\"red\"' - g_messages[event_id + event_id_offset] = MessageDiag - event_id_offset = event_id_offset + 1 - g_diag_rlc_sn[rlc_key] = int(sn) - Message['type'] = "rx" - Message['tx'] = entity2_id - Message['rx'] = entity_id - Message['discarded'] = False - g_messages[event_id + event_id_offset] = Message - - elif arrow == '->': - Message['type'] = "tx" - Message['tx'] = entity_id - Message['rx'] = entity2_id - Message['discarded'] = False - g_messages[event_id + event_id_offset] = Message - elif arrow == 'x-': - Message['type'] = "rx" - Message['tx'] = entity2_id - Message['rx'] = entity_id - Message['discarded'] = True - g_messages[event_id + event_id_offset] = Message - elif arrow == '-x': - Message['type'] = "tx" - Message['tx'] = entity_id - Message['rx'] = entity2_id - Message['discarded'] = True - g_messages[event_id + event_id_offset] = Message - - elif MSC_BOX_STR == event_type: - sub_partition = partition[3].split(' ',1) - time = sub_partition[0] - message = sub_partition[1] - Message = {} - Message['type'] = "box" - Message['tx'] = entity_id - Message['rx'] = entity_id - Message['discarded'] = False - Message['time'] = time - Message['message'] = message - Message['line_color'] = g_display_color[entity_id] - Message['text_color'] = g_display_color[entity_id] - g_messages[event_id + event_id_offset] = Message - - except IOError, e: - print ("File %s INPUT LINE: %s " % (filename, line)) - print 'err message' - - #print("------------------------------------") - #print (" %s " % ( g_messages ) ) - -# for event_id_int in sorted(g_messages.iterkeys()): - - - -def msc_chart_write_header(fileP): - global g_final_display_order_list - fileP.write("msc {\n") - fileP.write("width = \"2048\";\n") - - entity_line_list_str = '' - #print (" %s " % ( g_proto_names ) ) - for entity in g_proto_names: - if entity != 'NotDeclared': - entity_line_list_str = entity_line_list_str + ' ' + entity + ',' - - entity_line_list_str = entity_line_list_str.rstrip().strip(',') - fileP.write(" %s;\n" % (entity_line_list_str)) - - -def msc_chart_write_footer(fileP): - fileP.write("\n}\n") - -def msc_chart_generate(file_nameP): - global MSCGEN_OUTPUT_TYPE - print "Generating sequence diagram for ",file_nameP - command_line = "mscgen -T " + MSCGEN_OUTPUT_TYPE + " -i " + file_nameP - fi,fo,fe=os.popen3(command_line) - for i in fe.readlines(): - print "error:",i - -def get_new_file_descriptor(): - global g_base_file_name - global g_page_index - l_file_name = g_base_file_name + str(g_page_index)+'.txt' - l_file = open(l_file_name, "wb") - print "Generating mscgen input file ",l_file_name; - return l_file - - -###### MAIN STAR HERE ################# -parse_oai_log_files() - -g_page_index = 0 -g_message_index = 0 -g_now = datetime.datetime.now() -g_now_formated = 'mscgen_' + args.profile.strip() + '_'+ g_now.strftime("%Y-%m-%d_%H.%M.%S") -#g_currentdir = os.curdir -g_resultdir = os.path.join(args.dir, g_now_formated) -os.mkdir(g_resultdir) -os.chdir(g_resultdir) - -g_base_file_name = args.profile.strip() + '_mscgen_page_' - -g_file = get_new_file_descriptor() -msc_chart_write_header(g_file) - -for event_id_int in sorted(g_messages.iterkeys()): - message = g_messages[event_id_int] - if 'tx' in message['type']: - if "yes" == args.no_message.strip(): - if g_proto_types[message['tx']] != g_proto_types[message['rx']]: - continue - if "yes" == args.no_pdu.strip(): - if g_proto_types[message['tx']] == g_proto_types[message['rx']]: - continue - g_file.write(" %s=>%s [ label = \"(%d|%s) %s\", linecolour=%s , textcolour=%s ] ;\n" % (g_proto_names[message['tx']], g_proto_names[message['rx']], event_id_int, message['time'], message['message'], message['line_color'], message['text_color'])) - - elif 'rx' in message['type']: - if "yes" == args.no_message.strip(): - if g_proto_types[message['tx']] != g_proto_types[message['rx']]: - continue - if "yes" == args.no_pdu.strip(): - if g_proto_types[message['tx']] == g_proto_types[message['rx']]: - continue - g_file.write(" %s<=%s [ label = \"(%d|%s) %s\", linecolour=%s , textcolour=%s ] ;\n" % (g_proto_names[message['rx']], g_proto_names[message['tx']], event_id_int, message['time'], message['message'], message['line_color'], message['text_color'])) - - elif 'box' in message['type']: - if "yes" == args.no_event.strip(): - continue - g_file.write(" %s note %s [ label = \"%s\", textcolour=%s ] ;\n" % (g_proto_names[message['tx']], g_proto_names[message['rx']], message['message'], message['text_color'])) - - g_message_index = g_message_index + 1 - - if ((g_message_index % MAX_MESSAGES_PER_PAGE) == 0): - msc_chart_write_footer(g_file) - g_file.close() - msc_chart_generate(g_file.name) - g_page_index = g_page_index + 1 - - g_file = get_new_file_descriptor() - msc_chart_write_header(g_file) - - -msc_chart_write_footer(g_file) -g_file.close() -msc_chart_generate(g_file.name) From a1520aacd18bd37d07e66de2c5c51ce7bc6841a6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 26 Jan 2022 19:17:24 +0100 Subject: [PATCH 315/883] Remove useless MSCGEN macro --- openair3/NAS/TEST/AS_SIMULATOR/as_data.h | 8 ---- openair3/NAS/TEST/AS_SIMULATOR/as_process.c | 42 +++++++++---------- openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c | 6 +-- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/openair3/NAS/TEST/AS_SIMULATOR/as_data.h b/openair3/NAS/TEST/AS_SIMULATOR/as_data.h index 24c6473730..9888db69ac 100644 --- a/openair3/NAS/TEST/AS_SIMULATOR/as_data.h +++ b/openair3/NAS/TEST/AS_SIMULATOR/as_data.h @@ -47,14 +47,6 @@ Description Defines constants and functions used by the AS simulator /********************* G L O B A L C O N S T A N T S *******************/ /****************************************************************************/ -/* - * Constansts used for MSCGEN (Message Sequence Chart Generator) - */ -#define MSCGEN(args...) fprintf(stderr, ##args); -#define _ue_id "UE" -#define _mme_id "MME" -#define _as_id "AS" - /****************************************************************************/ /************************ G L O B A L T Y P E S ************************/ /****************************************************************************/ diff --git a/openair3/NAS/TEST/AS_SIMULATOR/as_process.c b/openair3/NAS/TEST/AS_SIMULATOR/as_process.c index 21e484e40a..9a9b4da5bb 100644 --- a/openair3/NAS/TEST/AS_SIMULATOR/as_process.c +++ b/openair3/NAS/TEST/AS_SIMULATOR/as_process.c @@ -102,7 +102,7 @@ int process_cell_info_req(int msg_id, const cell_info_req_t* req, index += _process_plmn(_mscgen_buffer, &req->plmnID, MSCGEN_BUFFER_SIZE); snprintf(_mscgen_buffer + index, MSCGEN_BUFFER_SIZE - index, ", rat = 0x%x%c", req->rat, '\0'); - MSCGEN("[MSC_MSG][%s][%s][--- Cell Information Request (0x%.4x)\\n%s --->][%s]\n", + printf("[%s][%s][--- Cell Information Request (0x%.4x)\\n%s --->][%s]\n", getTime(), _ue_id, msg_id, _mscgen_buffer, _as_id); /* Setup cell information confirm message */ @@ -116,7 +116,7 @@ int process_cell_info_req(int msg_id, const cell_info_req_t* req, snprintf(_mscgen_buffer, MSCGEN_BUFFER_SIZE, "tac = 0x%.4x, cellID = 0x%.8x, rat = 0x%x, RSRQ = %u, RSRP = %u%c", cnf->tac, cnf->cellID, cnf->rat, cnf->rsrq, cnf->rsrp, '\0'); - MSCGEN("[MSC_MSG][%s][%s][--- Cell Information Confirm (0x%.4x)\\n%s --->][%s]\n", + printf("[%s][%s][--- Cell Information Confirm (0x%.4x)\\n%s --->][%s]\n", getTime(), _as_id, AS_CELL_INFO_CNF, _mscgen_buffer, _ue_id); printf("INFO\t: %s - Send cell informtion confirm\n", __FUNCTION__); @@ -146,13 +146,13 @@ int process_nas_establish_req(int msg_id, const nas_establish_req_t* req, "cause = %s, type = %s, tmsi = {MMEcode = %d, m_tmsi = %u}%c", rrcCause(req->cause), rrcType(req->type), req->s_tmsi.MMEcode, req->s_tmsi.m_tmsi, '\0'); - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment Request " + printf("[%s][%s][--- NAS Signalling Connection Establishment Request " "(0x%.4x)\\n%s --->][%s]\n", getTime(), _ue_id, msg_id, _mscgen_buffer, _as_id); _process_dump(_mscgen_buffer, MSCGEN_BUFFER_SIZE, (char*)req->initialNasMsg.data, req->initialNasMsg.length); - MSCGEN("[MSC_RBOX][%s][%s][%s]\n", _ue_id, _as_id, _mscgen_buffer); + printf("[%s][%s][%s]\n", _ue_id, _as_id, _mscgen_buffer); /* Process initial NAS message */ bytes = nas_process(_mscgen_buffer, MSCGEN_BUFFER_SIZE, @@ -160,7 +160,7 @@ int process_nas_establish_req(int msg_id, const nas_establish_req_t* req, req->initialNasMsg.length); if (bytes < 0) { - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment " + printf("[%s][%s][--- NAS Signalling Connection Establishment " "Indication (0x%.4x)\\ntac = 0x%.4x\\n%s ---x][%s]\n", getTime(), _as_id, AS_NAS_ESTABLISH_IND, ind->tac, _mscgen_buffer, _mme_id); /* Setup NAS signalling connection establishment confirmation message */ @@ -190,7 +190,7 @@ int process_nas_establish_req(int msg_id, const nas_establish_req_t* req, // Transmission failure of Attach Request message //cnf->errCode = AS_FAILURE; // UE DEBUG - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment Indication " + printf("[%s][%s][--- NAS Signalling Connection Establishment Indication " "(0x%.4x)\\nUEid = %u, tac = 0x%.4x\\n%s --->][%s]\n", getTime(), _as_id, AS_NAS_ESTABLISH_IND, ind->UEid, ind->tac, _mscgen_buffer, _mme_id); @@ -224,13 +224,13 @@ int process_ul_info_transfer_req(int msg_id, const ul_info_transfer_req_t* req, snprintf(_mscgen_buffer, MSCGEN_BUFFER_SIZE, "tmsi = {MMEcode = %d, m_tmsi = %u}%c", req->s_tmsi.MMEcode, req->s_tmsi.m_tmsi, '\0'); - MSCGEN("[MSC_MSG][%s][%s][--- Uplink Information Request " + printf("[%s][%s][--- Uplink Information Request " "(0x%.4x)\\n%s --->][%s]\n", getTime(), _ue_id, msg_id, _mscgen_buffer, _as_id); _process_dump(_mscgen_buffer, MSCGEN_BUFFER_SIZE, (char*)req->nasMsg.data, req->nasMsg.length); - MSCGEN("[MSC_RBOX][%s][%s][%s]\n", _ue_id, _as_id, _mscgen_buffer); + printf("[%s][%s][%s]\n", _ue_id, _as_id, _mscgen_buffer); /* Process NAS message */ bytes = nas_process(_mscgen_buffer, MSCGEN_BUFFER_SIZE, @@ -238,7 +238,7 @@ int process_ul_info_transfer_req(int msg_id, const ul_info_transfer_req_t* req, req->nasMsg.length); if (bytes < 0) { - MSCGEN("[MSC_MSG][%s][%s][--- Uplink Information Indication " + printf("[%s][%s][--- Uplink Information Indication " "(0x%.4x)\\n%s ---x][%s]\n", getTime(), _as_id, AS_UL_INFO_TRANSFER_IND, _mscgen_buffer, _mme_id); /* Setup uplink information confirmation message */ @@ -279,7 +279,7 @@ int process_ul_info_transfer_req(int msg_id, const ul_info_transfer_req_t* req, // cnf->errCode = AS_FAILURE; // UE DEBUG //} - MSCGEN("[MSC_MSG][%s][%s][--- Uplink Information Indication " + printf("[%s][%s][--- Uplink Information Indication " "(0x%.4x), UEid = %u\\n%s --->][%s]\n", getTime(), _as_id, AS_UL_INFO_TRANSFER_IND, ind->UEid, _mscgen_buffer, _mme_id); @@ -297,7 +297,7 @@ int process_nas_release_req(int msg_id, const nas_release_req_t* req) printf("INFO\t: %s - Process NAS signalling connection release request\n", __FUNCTION__); - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Release Request " + printf("[%s][%s][--- NAS Signalling Release Request " "(0x%.4x), tmsi = {MMEcode = %d, m_tmsi = %u}, " "cause = %s (%u) --->][%s]\n", getTime(), _ue_id, msg_id, req->s_tmsi.MMEcode, req->s_tmsi.m_tmsi, @@ -332,14 +332,14 @@ int process_nas_establish_rsp(int msg_id, const nas_establish_rsp_t* rsp, //rsp->nasMsg.data[21] = 0xc4; // MME DEBUG (Send ESM status) //} - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment " + printf("[%s][%s][--- NAS Signalling Connection Establishment " "Response (0x%.4x)\\nerrCode = %s, UEid = %u --->][%s]\n", getTime(), _mme_id, msg_id, rrcErrCode(rsp->errCode), rsp->UEid, _as_id); _process_dump(_mscgen_buffer, MSCGEN_BUFFER_SIZE, (char*)rsp->nasMsg.data, rsp->nasMsg.length); - MSCGEN("[MSC_RBOX][%s][%s][%s]\n", _mme_id, _as_id, _mscgen_buffer); + printf("[%s][%s][%s]\n", _mme_id, _as_id, _mscgen_buffer); // Discard Attach Accept message //return (0); // UE DEBUG @@ -350,7 +350,7 @@ int process_nas_establish_rsp(int msg_id, const nas_establish_rsp_t* rsp, rsp->nasMsg.length); if (bytes < 0) { - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment " + printf("[%s][%s][--- NAS Signalling Connection Establishment " "Confirm (0x%.4x)\\n%s ---x][%s]\n", getTime(), _as_id, AS_NAS_ESTABLISH_CNF, _mscgen_buffer, _ue_id); return (0); @@ -369,7 +369,7 @@ int process_nas_establish_rsp(int msg_id, const nas_establish_rsp_t* rsp, } } - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Establishment " + printf("[%s][%s][--- NAS Signalling Connection Establishment " "Confirm (0x%.4x)\\n%s --->][%s]\n", getTime(), _as_id, AS_NAS_ESTABLISH_CNF, _mscgen_buffer, _ue_id); @@ -401,13 +401,13 @@ int process_dl_info_transfer_req(int msg_id, const dl_info_transfer_req_t* req, // req->nasMsg.data[6] = 0x02; // UE DEBUG //} - MSCGEN("[MSC_MSG][%s][%s][--- Downlink Information Request " + printf("[%s][%s][--- Downlink Information Request " "(0x%.4x), UEid = %u --->][%s]\n", getTime(), _mme_id, msg_id, req->UEid, _as_id); _process_dump(_mscgen_buffer, MSCGEN_BUFFER_SIZE, (char*)req->nasMsg.data, req->nasMsg.length); - MSCGEN("[MSC_RBOX][%s][%s][%s]\n", _mme_id, _as_id, _mscgen_buffer); + printf("[%s][%s][%s]\n", _mme_id, _as_id, _mscgen_buffer); /* Process NAS message */ bytes = nas_process(_mscgen_buffer, MSCGEN_BUFFER_SIZE, @@ -415,7 +415,7 @@ int process_dl_info_transfer_req(int msg_id, const dl_info_transfer_req_t* req, req->nasMsg.length); if (bytes < 0) { - MSCGEN("[MSC_MSG][%s][%s][--- Downlink Information Indication " + printf("[%s][%s][--- Downlink Information Indication " "(0x%.4x)\\n%s ---x][%s]\n", getTime(), _as_id, AS_DL_INFO_TRANSFER_IND, _mscgen_buffer, _ue_id); /* Setup downlink information confirmation message */ @@ -445,7 +445,7 @@ int process_dl_info_transfer_req(int msg_id, const dl_info_transfer_req_t* req, // return (0); // MME DEBUG //} - MSCGEN("[MSC_MSG][%s][%s][--- Downlink Information Indication " + printf("[%s][%s][--- Downlink Information Indication " "(0x%.4x)\\n%s --->][%s]\n", getTime(), _as_id, AS_DL_INFO_TRANSFER_IND, _mscgen_buffer, _ue_id); @@ -464,14 +464,14 @@ int process_nas_release_ind(int msg_id, const nas_release_req_t* req, printf("INFO\t: %s - Process NAS signalling connection release request\n", __FUNCTION__); - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Release Request " + printf("[%s][%s][--- NAS Signalling Connection Release Request " "(0x%.4x), UEid = %u, cause = %s (%u) --->][%s]\n", getTime(), _mme_id, msg_id, req->UEid, rrcReleaseCause(req->cause), req->cause, _as_id); /* Forward NAS release indication to the UE */ ind->cause = req->cause; - MSCGEN("[MSC_MSG][%s][%s][--- NAS Signalling Connection Release Indication " + printf("[%s][%s][--- NAS Signalling Connection Release Indication " "(0x%.4x), cause = %s (%u) --->][%s]\n", getTime(), _as_id, msg_id, rrcReleaseCause(req->cause), ind->cause, _ue_id); diff --git a/openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c b/openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c index efe2c1af72..bbc37d18a3 100644 --- a/openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c +++ b/openair3/NAS/TEST/AS_SIMULATOR/as_simulator.c @@ -193,7 +193,7 @@ int main (int argc, const char* argv[]) printf("INFO\t: %s - The RRC Simulator is now connected to %s/%s (%d)\n", __FUNCTION__, mhost, mport, socket_get_fd(_as_simulator_mme_sid)); - MSCGEN("[MSC_NEW][%s][AS=%s]\n", getTime(), _as_id); + printf("[%s][AS=%s]\n", getTime(), _as_id); /* * Set up signal handler @@ -325,7 +325,7 @@ static void* _as_simulator_ue_mngr(void* args) printf("INFO\t: %s - UE connection manager started\n", __FUNCTION__); - MSCGEN("[MSC_NEW][%s][NAS-UE=%s]\n", getTime(), _ue_id); + printf("[%s][NAS-UE=%s]\n", getTime(), _ue_id); /* Receiving loop */ while (_as_simulator_ue_is_running) { @@ -407,7 +407,7 @@ static void* _as_simulator_mme_mngr(void* args) printf("INFO\t: %s - MME connection manager started\n", __FUNCTION__); - MSCGEN("[MSC_NEW][%s][NAS-MME=%s]\n", getTime(), _mme_id); + printf("[%s][NAS-MME=%s]\n", getTime(), _mme_id); /* Receiving loop */ while (_as_simulator_mme_is_running) { From 8c5059214e7b3305d8b4725532f92b0c93bb2c01 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 26 Jan 2022 19:19:18 +0100 Subject: [PATCH 316/883] Remove log verbosity level from all conf files: it is not used --- ci-scripts/conf_files/benetel-4g.conf | 7 ----- ci-scripts/conf_files/benetel-5g.conf | 7 ----- .../conf_files/cu.band7.tm1.100PRB.conf | 5 ---- ci-scripts/conf_files/cu.band7.tm1.25PRB.conf | 5 ---- ci-scripts/conf_files/cu.band7.tm1.50PRB.conf | 5 ---- .../du.band7.tm1.100PRB.usrpb210.conf | 6 ----- .../du.band7.tm1.25PRB.usrpb210.conf | 6 ----- .../du.band7.tm1.50PRB.usrpb210.conf | 6 ----- .../enb.band13.tm1.25PRB.usrpb210.conf | 7 ----- .../conf_files/enb.band13.tm1.50PRB.emtc.conf | 14 ---------- .../enb.band17.tm1.25PRB.usrpb210.conf | 7 ----- .../enb.band17.tm1.mbms.25PRB.usrpb210.conf | 7 ----- .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 7 ----- ...nb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 7 ----- .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 7 ----- ...d40.tm1.100PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm1.25PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm1.50PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm2.25PRB.FairScheduler.usrpb210.conf | 7 ----- .../enb.band7.tm1.100PRB.usrpb210.conf | 7 ----- .../enb.band7.tm1.25PRB.slave.usrpb210.conf | 7 ----- .../enb.band7.tm1.25PRB.usrpb210.conf | 7 ----- .../enb.band7.tm1.50PRB.usrpb210.conf | 7 ----- .../enb.band7.tm1.fr1.25PRB.usrpb210.conf | 7 ----- .../enb.band7.tm2.25PRB.usrpb210.conf | 7 ----- .../enb.slave.band13.tm1.25PRB.usrpb210.conf | 7 ----- ...sci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 8 ------ .../conf_files/episci/episci_nr-ue.nfapi.conf | 7 ----- .../episci/episci_nr-ue0.nfapi.conf | 7 ----- .../episci/episci_nr-ue1.nfapi.conf | 7 ----- .../episci/episci_nr-ue2.nfapi.conf | 7 ----- .../episci/episci_nr-ue3.nfapi.conf | 7 ----- .../episci/episci_rcc.band7.tm1.nfapi.conf | 7 ----- .../episci_rcc.band78.tm1.106PRB.nfapi.conf | 7 ----- .../conf_files/episci/episci_ue.nfapi.conf | 7 ----- ...oxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 8 ------ .../conf_files/episci/proxy_nr-ue.nfapi.conf | 7 ----- .../episci/proxy_rcc.band7.tm1.nfapi.conf | 7 ----- .../proxy_rcc.band78.tm1.106PRB.nfapi.conf | 7 ----- .../conf_files/episci/proxy_ue.nfapi.conf | 7 ----- ci-scripts/conf_files/gNB_SA_CU.conf | 9 ------- ci-scripts/conf_files/gNB_SA_DU.conf | 9 ------- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 8 ------ .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 8 ------ .../gnb.band261.tm1.32PRB.usrpn300.conf | 7 ----- .../gnb.band66.tm1.106PRB.usrpn300.conf | 7 ----- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 7 ----- ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 8 ------ .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 8 ------ ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 8 ------ .../gnb.band78.tm1.106PRB.usrpn300.conf | 7 ----- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 7 ----- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 7 ----- ci-scripts/conf_files/lte-fdd-basic-sim.conf | 7 ----- .../conf_files/lte-fdd-fembms-basic-sim.conf | 7 ----- .../conf_files/lte-fdd-mbms-basic-sim.conf | 7 ----- ci-scripts/conf_files/lte-tdd-basic-sim.conf | 7 ----- ci-scripts/conf_files/nr-ue.nfapi.conf | 7 ----- .../rcc.band38.tm1.50PRB.multi.rru.conf | 7 ----- ...d40.tm1.100PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm1.25PRB.FairScheduler.usrpb210.conf | 7 ----- ...nd40.tm1.50PRB.FairScheduler.usrpb210.conf | 7 ----- ...cc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf | 7 ----- ...rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf | 7 ----- ...rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf | 7 ----- ...cc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf | 7 ----- .../rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf | 7 ----- .../conf_files/rcc.band7.tm1.nfapi.conf | 7 ----- .../conf_files/rru.band38.tm1.master.conf | 7 ----- .../conf_files/rru.band38.tm1.slave.conf | 7 ----- ci-scripts/conf_files/rru.fdd.band7.conf | 7 ----- ci-scripts/conf_files/rru.tdd.band40.conf | 7 ----- ci-scripts/conf_files/ue.nfapi.conf | 7 ----- .../enb.band38.tm1.usrpb210.tdd.10MHz.conf | 7 ----- .../enb.band38.tm1.usrpb210.tdd.20MHz.conf | 7 ----- .../enb.band38.tm1.usrpb210.tdd.5MHz.conf | 7 ----- .../enb.band7.tm1.usrpb210.fdd.10MHz.conf | 7 ----- .../enb.band7.tm1.usrpb210.fdd.20MHz.conf | 7 ----- .../enb.band7.tm1.usrpb210.fdd.5MHz.conf | 7 ----- .../v2/config/rcc.band7.tm1.if4p5.10MHz.conf | 7 ----- .../v2/config/rcc.band7.tm1.if4p5.20MHz.conf | 7 ----- .../v2/config/rcc.band7.tm1.if4p5.5MHz.conf | 7 ----- ...ru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf | 7 ----- ...ru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf | 7 ----- ...rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf | 7 ----- configuration/bladeRF/enb-band7-5mhz.conf | 14 ---------- doc/testing_gnb_w_cots_ue_resources/enb.conf | 14 ---------- doc/testing_gnb_w_cots_ue_resources/gnb.conf | 7 ----- executables/softmodem-common.h | 1 - .../enb.band7.tm1.usrpb210.epc.local.conf | 9 ------- .../TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf | 8 ------ .../CONF/enb.centos.memphis.conf | 8 ------ .../GENERIC-LTE-EPC/CONF/benetel-4g.conf | 7 ----- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 7 ----- .../PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf | 5 ---- .../CONF/du.lte.band7.10MHz.if4p5.conf | 6 ----- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 25 ------------------ .../CONF/enb.band38.tm1.100PRB.usrpx310.conf | 7 ----- .../CONF/enb.band38.tm1.25PRB.iris030.conf | 7 ----- .../CONF/enb.band38.tm1.usrpx310.conf | 7 ----- .../CONF/enb.band42.tm1.25PRB.iris030.conf | 7 ----- .../CONF/enb.band7.master.conf | 7 ----- .../CONF/enb.band7.tm1.100PRB.usrpx310.conf | 7 ----- .../CONF/enb.band7.tm1.25PRB.iris030.conf | 7 ----- .../enb.band7.tm1.25PRB.usrpb210.replay.conf | 26 ------------------- .../enb.band7.tm1.50PRB.usrpb210-d2d.conf | 7 ----- .../CONF/enb.band7.tm1.50PRB.usrpb210.conf | 7 ----- ...band7.tm1.50PRB.usrpb210_ue_expansion.conf | 7 ----- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 7 ----- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 7 ----- .../gnb.band78.106PRB.30kHz,usrpb2x0.conf | 7 ----- .../CONF/gnb.band78.106PRB.slave.conf | 7 ----- .../CONF/gnb.band78.slave.conf | 7 ----- .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 7 ----- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 7 ----- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 7 ----- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 7 ----- .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 7 ----- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 7 ----- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 7 ----- .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 7 ----- .../CONF/oaiL1.nfapi.usrpb210.conf | 7 ----- .../CONF/oaiL1.nfapi.usrpx300.conf | 7 ----- .../CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf | 7 ----- .../CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf | 7 ----- .../CONF/rcc.band7.tm1.50PRB.nfapi.conf | 7 ----- .../CONF/rcc.band7.tm1.if4p5.50PRB.conf | 7 ----- .../CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf | 7 ----- .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 7 ----- .../CONF/rcc_b38_if5_ENDC.conf | 7 ----- .../GENERIC-LTE-EPC/CONF/rru.oaisim.conf | 7 ----- .../GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf | 7 ----- .../CONF/testing_eNB_band13.conf | 26 ------------------- .../GENERIC-LTE-EPC/CONF/testing_enb.conf | 26 ------------------- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 7 ----- .../CONF/testing_gnb_24PRB.conf | 7 ----- .../CONF/testing_gnb_n310.conf | 7 ----- .../CONF/testing_gnb_nsa_n310.conf | 7 ----- .../PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf | 9 ------- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 9 ------- ...b.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 8 ------ .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 8 ------ ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 9 ------- .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 8 ------ ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 8 ------ 151 files changed, 1160 deletions(-) diff --git a/ci-scripts/conf_files/benetel-4g.conf b/ci-scripts/conf_files/benetel-4g.conf index 9423ebe56e..e2974a171d 100644 --- a/ci-scripts/conf_files/benetel-4g.conf +++ b/ci-scripts/conf_files/benetel-4g.conf @@ -269,17 +269,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index 79b2f7f877..651fe459d9 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -262,18 +262,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf index e2c94b14ab..1102528cd3 100644 --- a/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf +++ b/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf @@ -201,15 +201,10 @@ eNBs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; pdcp_log_level = "info"; - pdcp_log_verbosity = "high"; rrc_log_level = "info"; - rrc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; gtp_log_level = "info"; - gtp_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf index 5b994ed29b..ec7620a724 100644 --- a/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf +++ b/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf @@ -201,15 +201,10 @@ eNBs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; pdcp_log_level = "info"; - pdcp_log_verbosity = "high"; rrc_log_level = "info"; - rrc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; gtp_log_level = "info"; - gtp_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf index 148c5a9903..7e64ad8039 100644 --- a/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf +++ b/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf @@ -201,15 +201,10 @@ eNBs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; pdcp_log_level = "info"; - pdcp_log_verbosity = "high"; rrc_log_level = "info"; - rrc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; gtp_log_level = "info"; - gtp_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf index a3ecffb9be..217c694055 100644 --- a/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf @@ -96,17 +96,11 @@ RUs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; hw_log_level = "info"; - hw_log_verbosity = "medium"; phy_log_level = "info"; - phy_log_verbosity = "medium"; mac_log_level = "info"; - mac_log_verbosity = "high"; rlc_log_level = "info"; - rlc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf index 1920992d70..61d4cff51b 100644 --- a/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf @@ -96,17 +96,11 @@ RUs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; hw_log_level = "info"; - hw_log_verbosity = "medium"; phy_log_level = "info"; - phy_log_verbosity = "medium"; mac_log_level = "info"; - mac_log_verbosity = "high"; rlc_log_level = "info"; - rlc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf index 5df8da05a3..4342e8f4b4 100644 --- a/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf @@ -96,17 +96,11 @@ RUs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; hw_log_level = "info"; - hw_log_verbosity = "medium"; phy_log_level = "info"; - phy_log_verbosity = "medium"; mac_log_level = "info"; - mac_log_verbosity = "high"; rlc_log_level = "info"; - rlc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf index e70ca78205..122654df26 100644 --- a/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf @@ -257,18 +257,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf index 400d1a6c9d..ae572f9e05 100644 --- a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf +++ b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf @@ -385,19 +385,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); @@ -457,17 +450,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf index bd2999b5d5..5a4be9f187 100644 --- a/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf @@ -260,18 +260,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf index 19ef6d0797..7ac056b75e 100644 --- a/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf @@ -404,18 +404,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index d2e91fb872..24c35dedbf 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -264,18 +264,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf index f116c3708d..4a16a64105 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -264,18 +264,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 6c8d5ba6f0..bccd37abe9 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -264,18 +264,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf index f34878c569..0633d233ef 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf index e2e482a7c7..4de8a3f759 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf index bfea139e92..df902faf8b 100644 --- a/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf index 4e0025770b..0da4b1181a 100644 --- a/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf @@ -163,19 +163,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf index 1627d21e1a..bd7e19ca60 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf @@ -256,18 +256,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf index efa1fa64b8..fdd2304ba5 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf @@ -265,18 +265,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf index 6fc8401236..5b05627700 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf @@ -263,18 +263,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf index 087ee37f01..44d22a8953 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf @@ -263,19 +263,12 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; @include "channelmod_rfsimu.conf" diff --git a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf index 64bcb4b35f..38cd90cd44 100644 --- a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf @@ -264,18 +264,11 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf index 72754165d0..c8223d0c42 100644 --- a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf @@ -258,17 +258,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf index da65aad775..609d76d720 100644 --- a/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf @@ -262,18 +262,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 01add06e3a..8114a530db 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -306,20 +306,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf index f5563ecc02..22ffb4cd3d 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf index f5563ecc02..22ffb4cd3d 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf index 5df3ccf6cc..3d1c008f23 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf index b1ce5fee8d..73c3292809 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf index aea5104f1c..1f8f7306c6 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf index 4e596f81b5..81951e5219 100644 --- a/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf @@ -231,17 +231,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf index b64b88ddea..9b3f205a0f 100644 --- a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf @@ -248,18 +248,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/episci_ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf index 0170a46655..8f7c8ee68a 100644 --- a/ci-scripts/conf_files/episci/episci_ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index ab0cf5f469..f86d4f98a8 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -307,20 +307,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf index 8411ed8fc6..b6c0e9b5a1 100644 --- a/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; uicc0 = { diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf index d4c72d6c14..50ece56b23 100644 --- a/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf @@ -231,17 +231,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf index 0ef317d63e..3410104199 100644 --- a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf @@ -288,18 +288,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf index 3f227d573c..51c30fb42d 100644 --- a/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf index d3cfbfc973..1e84e479bc 100644 --- a/ci-scripts/conf_files/gNB_SA_CU.conf +++ b/ci-scripts/conf_files/gNB_SA_CU.conf @@ -254,22 +254,13 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index b03758a006..240627d04a 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -273,22 +273,13 @@ serveraddr = "server"; log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 16f72c68e5..40752e2206 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -291,19 +291,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 1a940a51c4..d118676bb2 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -287,19 +287,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index 4338c00b36..5965ca38e7 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -266,18 +266,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 1c2133bebe..d0624e2e9a 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -259,18 +259,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index b0a757c9d0..c047fc6837 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -266,18 +266,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 16456f939c..9163946aaa 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -293,19 +293,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 70892930c9..55060873d0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -298,19 +298,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 70892930c9..55060873d0 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -298,19 +298,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6ade355053..6667d0f1e7 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -255,18 +255,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index b7a04b1f36..9cfd9acfc3 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -263,19 +263,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; uicc: { diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index 3aa8696234..764514c385 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -265,19 +265,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; uicc: { diff --git a/ci-scripts/conf_files/lte-fdd-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-basic-sim.conf index a4d8e007dc..6c81d512a6 100644 --- a/ci-scripts/conf_files/lte-fdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-basic-sim.conf @@ -257,17 +257,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf index 458ab7cf89..c2f6ab9d6c 100644 --- a/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf @@ -406,19 +406,12 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; //rfsimulator : diff --git a/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf index e80ff2b9cb..9c74d2e328 100644 --- a/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf +++ b/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf @@ -406,19 +406,12 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; //rfsimulator : diff --git a/ci-scripts/conf_files/lte-tdd-basic-sim.conf b/ci-scripts/conf_files/lte-tdd-basic-sim.conf index f443a907f2..ddfdddda83 100644 --- a/ci-scripts/conf_files/lte-tdd-basic-sim.conf +++ b/ci-scripts/conf_files/lte-tdd-basic-sim.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/nr-ue.nfapi.conf b/ci-scripts/conf_files/nr-ue.nfapi.conf index b12e0c8d05..90798702cf 100644 --- a/ci-scripts/conf_files/nr-ue.nfapi.conf +++ b/ci-scripts/conf_files/nr-ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; diff --git a/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf b/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf index 502e3c548a..6651f380e4 100644 --- a/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf +++ b/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf @@ -227,17 +227,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf index d01e4e1c4e..47bcc35cb3 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.100PRB.FairScheduler.usrpb210.conf @@ -168,19 +168,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf index 7f6bff304d..660478ca11 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.25PRB.FairScheduler.usrpb210.conf @@ -168,19 +168,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf index d4f2eb9ef2..6997c80234 100644 --- a/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band40.tm1.50PRB.FairScheduler.usrpb210.conf @@ -168,19 +168,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf index 683fff0bc8..798871edce 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.100PRB.usrpb210.conf @@ -263,17 +263,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf index 574c8b2545..628188aea2 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.25PRB.usrpb210.conf @@ -263,17 +263,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf index 49365a1f61..75d947c009 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.if4p5.lo.50PRB.usrpb210.conf @@ -263,17 +263,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf b/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf index 640b85930a..1bcd26b931 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf @@ -365,17 +365,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf b/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf index 7fe682f29e..e398310a35 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf @@ -365,17 +365,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf index 281f7433af..6f7a5d2dfd 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf @@ -230,17 +230,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rru.band38.tm1.master.conf b/ci-scripts/conf_files/rru.band38.tm1.master.conf index 101ce83892..e6bd0b75aa 100644 --- a/ci-scripts/conf_files/rru.band38.tm1.master.conf +++ b/ci-scripts/conf_files/rru.band38.tm1.master.conf @@ -30,18 +30,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rru.band38.tm1.slave.conf b/ci-scripts/conf_files/rru.band38.tm1.slave.conf index d5efe6bd61..2bc79028b4 100644 --- a/ci-scripts/conf_files/rru.band38.tm1.slave.conf +++ b/ci-scripts/conf_files/rru.band38.tm1.slave.conf @@ -30,18 +30,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rru.fdd.band7.conf b/ci-scripts/conf_files/rru.fdd.band7.conf index 057f518046..a3b297049d 100644 --- a/ci-scripts/conf_files/rru.fdd.band7.conf +++ b/ci-scripts/conf_files/rru.fdd.band7.conf @@ -31,17 +31,10 @@ THREAD_STRUCT = log_config = { global_log_level ="error"; - global_log_verbosity ="medium"; hw_log_level ="error"; - hw_log_verbosity ="medium"; phy_log_level ="error"; - phy_log_verbosity ="medium"; mac_log_level ="error"; - mac_log_verbosity ="high"; rlc_log_level ="error"; - rlc_log_verbosity ="medium"; pdcp_log_level ="error"; - pdcp_log_verbosity ="medium"; rrc_log_level ="error"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/rru.tdd.band40.conf b/ci-scripts/conf_files/rru.tdd.band40.conf index 5ce3a515f5..40af241cca 100644 --- a/ci-scripts/conf_files/rru.tdd.band40.conf +++ b/ci-scripts/conf_files/rru.tdd.band40.conf @@ -31,17 +31,10 @@ THREAD_STRUCT = log_config = { global_log_level ="error"; - global_log_verbosity ="medium"; hw_log_level ="error"; - hw_log_verbosity ="medium"; phy_log_level ="error"; - phy_log_verbosity ="medium"; mac_log_level ="error"; - mac_log_verbosity ="high"; rlc_log_level ="error"; - rlc_log_verbosity ="medium"; pdcp_log_level ="error"; - pdcp_log_verbosity ="medium"; rrc_log_level ="error"; - rrc_log_verbosity ="medium"; }; diff --git a/ci-scripts/conf_files/ue.nfapi.conf b/ci-scripts/conf_files/ue.nfapi.conf index 2b602cbcf2..09ad7529b1 100644 --- a/ci-scripts/conf_files/ue.nfapi.conf +++ b/ci-scripts/conf_files/ue.nfapi.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="full"; }; diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf index 7158790b28..df4ec5d01c 100755 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf index 70819d0e29..f9bb8338bf 100755 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf index 7381fefc1a..5c3d9214bc 100755 --- a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf index 8eecfa2ac5..f214f12783 100755 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf index ce2b71bdd2..f9f70281ca 100755 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf index 11e6e24418..87deb03172 100755 --- a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf +++ b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf @@ -165,19 +165,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf index 11f6adbb4d..039b1d8aa3 100755 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf @@ -182,19 +182,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf index 3bf79f94bf..3c70040bfc 100755 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf @@ -182,19 +182,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf index 67a2bae08c..f9d3da2c35 100755 --- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf +++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf @@ -182,19 +182,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf index 02f29c4c2e..c4b3e00a75 100755 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf @@ -184,19 +184,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf index 71a479a512..e2786ef21c 100755 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf @@ -184,19 +184,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf index 09958d62e4..8cd9bd6c67 100755 --- a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf +++ b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf @@ -184,19 +184,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } ); diff --git a/configuration/bladeRF/enb-band7-5mhz.conf b/configuration/bladeRF/enb-band7-5mhz.conf index 9d19207522..985f4eb378 100644 --- a/configuration/bladeRF/enb-band7-5mhz.conf +++ b/configuration/bladeRF/enb-band7-5mhz.conf @@ -206,19 +206,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } @@ -267,17 +260,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/doc/testing_gnb_w_cots_ue_resources/enb.conf b/doc/testing_gnb_w_cots_ue_resources/enb.conf index a6bbd98bda..027b6f2499 100755 --- a/doc/testing_gnb_w_cots_ue_resources/enb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/enb.conf @@ -206,19 +206,12 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } @@ -267,17 +260,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/doc/testing_gnb_w_cots_ue_resources/gnb.conf b/doc/testing_gnb_w_cots_ue_resources/gnb.conf index aae22a92ba..c96d207445 100755 --- a/doc/testing_gnb_w_cots_ue_resources/gnb.conf +++ b/doc/testing_gnb_w_cots_ue_resources/gnb.conf @@ -258,18 +258,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 47d5556c17..16014c6024 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -171,7 +171,6 @@ extern int usrp_tx_thread; #define CONFIG_HLP_NSA "Enable NSA mode \n" #define CONFIG_HLP_FLOG "Enable online log \n" #define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" -#define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n" #define CONFIG_FLOG_OPT "R" #define CONFIG_LOGL_OPT "g" diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf index 85cee4dda0..ad6c81f56b 100644 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf +++ b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf @@ -148,23 +148,14 @@ eNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; gtpu_log_level ="info"; - gtpu_log_verbosity ="medium"; udp_log_level ="info"; - udp_log_verbosity ="medium"; }; } diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf index df06231e4a..9ffed9c5fe 100644 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf +++ b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf @@ -148,19 +148,11 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf index 84c669571c..0e88f49021 100644 --- a/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf +++ b/targets/PROJECTS/CENTOS-LTE-EPC-INTEGRATION/CONF/enb.centos.memphis.conf @@ -70,23 +70,15 @@ eNBs = ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; # available options for level: error, warn, notice, info, debug, trace -# available options for verbosity: none, low, medium, high, full log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="debug"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-4g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-4g.conf index aab3876d96..0561c563dd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-4g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-4g.conf @@ -269,17 +269,10 @@ NETWORK_CONTROLLER : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index c6a4a90a14..4b775fce30 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -263,18 +263,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf index 38d3f5eac9..0e1080043a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/cu.lte.conf @@ -200,15 +200,10 @@ eNBs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; pdcp_log_level = "info"; - pdcp_log_verbosity = "high"; rrc_log_level = "info"; - rrc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; gtp_log_level = "info"; - gtp_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/du.lte.band7.10MHz.if4p5.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/du.lte.band7.10MHz.if4p5.conf index 8e786be5e9..0485957a8a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/du.lte.band7.10MHz.if4p5.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/du.lte.band7.10MHz.if4p5.conf @@ -96,17 +96,11 @@ RUs = ( log_config = { global_log_level = "info"; - global_log_verbosity = "medium"; hw_log_level = "info"; - hw_log_verbosity = "medium"; phy_log_level = "info"; - phy_log_verbosity = "medium"; mac_log_level = "info"; - mac_log_verbosity = "high"; rlc_log_level = "info"; - rlc_log_verbosity = "medium"; flexran_agent_log_level = "info"; - flexran_agent_log_verbosity = "medium"; }; NETWORK_CONTROLLER : { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 67044f38d9..cc8df8185a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -382,24 +382,6 @@ eNBs = ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.2/24"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; } ); @@ -438,17 +420,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf index e044c186b9..4723fd3cba 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.100PRB.usrpx310.conf @@ -176,19 +176,12 @@ THREAD_STRUCT = ( log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf index 5a547622ab..d811fb068e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.25PRB.iris030.conf @@ -256,17 +256,10 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf index 27826e5ce2..6669cef9a6 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.tm1.usrpx310.conf @@ -176,19 +176,12 @@ THREAD_STRUCT = ( log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf index 5df0f107ea..1b4224da08 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band42.tm1.25PRB.iris030.conf @@ -256,17 +256,10 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.master.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.master.conf index cb50cccf2b..ad95557bb9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.master.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.master.conf @@ -284,17 +284,10 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf index 245e4ecf94..8c0f57c65d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf @@ -212,18 +212,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf index 86b481f9d8..506966d167 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.iris030.conf @@ -256,17 +256,10 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf index 1eb5da6a18..177cddec12 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.replay.conf @@ -251,41 +251,15 @@ THREAD_STRUCT = ( worker_config = "WORKER_ENABLE"; } ); -/* - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; -*/ log_config : { global_log_level ="crit"; - global_log_verbosity ="crit"; hw_log_level ="crit"; - hw_log_verbosity ="crit"; phy_log_level ="crit"; - phy_log_verbosity ="crit"; mac_log_level ="crit"; - mac_log_verbosity ="crit"; rlc_log_level ="crit"; - rlc_log_verbosity ="crit"; pdcp_log_level ="crit"; - pdcp_log_verbosity ="crit"; rrc_log_level ="crit"; - rrc_log_verbosity ="crit"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf index a929c439be..aac2ec5f5e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210-d2d.conf @@ -244,18 +244,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 43288ba324..07cebbe75b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -298,18 +298,11 @@ rfsimulator : log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf index 92f2d4e6f1..222b203f71 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210_ue_expansion.conf @@ -211,18 +211,11 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index fd9399f89e..96414d6a1d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -265,18 +265,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 59e71a6225..4bbb9ef506 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -251,18 +251,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index 3fc81c0d6c..21f6da23b9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -245,18 +245,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index a40a93c789..26ee3cc12d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -265,18 +265,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index 3860aba935..1d555c863c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -257,18 +257,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index 7c527e07c8..f2eb7a8d8b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -257,18 +257,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf index a171f2aae0..683cdaeb2c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf @@ -258,18 +258,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 4f8c785baa..8d5e15a1aa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -262,17 +262,10 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf index 012f46401e..e1c9e9e167 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf @@ -260,17 +260,10 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index b6b9252560..4e4c0252fb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -303,17 +303,10 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index 0817d7373e..f457ca0d6e 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -254,18 +254,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index fd4c23cfdb..ab076ab492 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -253,18 +253,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 965408332c..21d0c636bf 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -253,18 +253,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index e36748a3a9..c23ce26ed8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -270,18 +270,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7b2d369919..3ccef009ef 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -245,18 +245,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index dbf4f58348..0b71da2c5c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -255,18 +255,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 6d23726a78..83e4f68ab2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -253,18 +253,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index c3fa56f15e..0835db0474 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -253,18 +253,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index 15aa368fdf..46620ceeb5 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -246,18 +246,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf index b13962aee9..a52841158c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpb210.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="debug"; - rrc_log_verbosity ="full"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf index 06ae5af066..c9658fc0eb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/oaiL1.nfapi.usrpx300.conf @@ -1,18 +1,11 @@ log_config = { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="medium"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="debug"; - rrc_log_verbosity ="full"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf index e05c64b4e8..4554a32a18 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band38.tm1.if4p5.50PRB.lo.conf @@ -217,17 +217,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf index 1ef71bedc2..c8bca91ccd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi-STUB.conf @@ -200,19 +200,12 @@ THREAD_STRUCT = ( log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="high"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf index 9ce9f28cc2..1f72077ba3 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.nfapi.conf @@ -239,17 +239,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf index 30cb852a28..401c42e503 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf @@ -217,17 +217,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf index 519305b68d..22da6735a2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -218,17 +218,10 @@ THREAD_STRUCT = ( log_config = { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="debug"; - phy_log_verbosity ="medium"; mac_log_level ="debug"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index 1583e07ca1..004ad4db78 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -235,18 +235,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc_b38_if5_ENDC.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc_b38_if5_ENDC.conf index 9b611b3f07..6a76028d25 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc_b38_if5_ENDC.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc_b38_if5_ENDC.conf @@ -168,19 +168,12 @@ eNBs = log_config : { global_log_level ="debug"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf index 3dc8e7dd32..c14cc9589a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf @@ -29,18 +29,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf index 494086defd..4f1a7fee30 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.tdd.conf @@ -29,18 +29,11 @@ THREAD_STRUCT = ( log_config = { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_eNB_band13.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_eNB_band13.conf index 1d8f61e442..d2ef01392b 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_eNB_band13.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_eNB_band13.conf @@ -204,25 +204,6 @@ eNBs = ENB_IPV4_ADDRESS_FOR_X2C = "192.168.18.199/24"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="debug"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } ); @@ -269,17 +250,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf index 6df25273c8..d493f29906 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_enb.conf @@ -205,25 +205,6 @@ eNBs = ENB_IPV4_ADDRESS_FOR_X2C = "192.168.18.199/24"; ENB_PORT_FOR_X2C = 36422; # Spec 36422 }; - - log_config : - { - global_log_level ="info"; - global_log_verbosity ="high"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="debug"; - rlc_log_verbosity ="high"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - }; - } ); @@ -270,17 +251,10 @@ RUs = ( log_config : { global_log_level ="info"; - global_log_verbosity ="high"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="high"; pdcp_log_level ="info"; - pdcp_log_verbosity ="high"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 8dfcfb2b88..88628f9cfc 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -263,18 +263,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index d01b0947c0..057444953d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -272,18 +272,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf index 198ad8471c..57aa459d49 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf @@ -261,18 +261,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 2f4839fd3b..407211ead4 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -258,18 +258,11 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf index 680a6cb4ae..43c2ab20ad 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf @@ -78,22 +78,13 @@ gNBs = log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 01050b0d00..2112be3996 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -254,22 +254,13 @@ THREAD_STRUCT = ( log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="debug"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index ab4713f8b5..b0e02ff2bc 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -265,20 +265,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="info"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9238ea1809..2c5b6dbe27 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -281,20 +281,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 9717462176..10e78b648d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -281,21 +281,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index d9b62064c1..639182f755 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -281,20 +281,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index e9577ee265..fa0f86772e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -287,20 +287,12 @@ security = { log_config : { global_log_level ="info"; - global_log_verbosity ="medium"; hw_log_level ="info"; - hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; mac_log_level ="info"; - mac_log_verbosity ="high"; rlc_log_level ="info"; - rlc_log_verbosity ="medium"; pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; rrc_log_level ="info"; - rrc_log_verbosity ="medium"; ngap_log_level ="debug"; - ngap_log_verbosity ="medium"; }; From aa47fa4c41786dcc16d9c9059bb836d8b96108d6 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 27 Jan 2022 11:57:19 +0100 Subject: [PATCH 317/883] remove F1-U protobuf implementation --- cmake_targets/CMakeLists.txt | 55 +- executables/nr-softmodem.c | 36 +- executables/nr-softmodem.h | 2 +- openair2/ENB_APP/enb_config.c | 1 - openair2/F1AP/f1ap_cu_task.c | 1 - openair2/F1AP/f1ap_du_task.c | 1 - openair2/GNB_APP/gnb_app.c | 30 +- openair2/LAYER2/PROTO_AGENT/cu_test.c | 172 ----- openair2/LAYER2/PROTO_AGENT/du_test.c | 163 ---- openair2/LAYER2/PROTO_AGENT/proto_agent.c | 278 ------- openair2/LAYER2/PROTO_AGENT/proto_agent.h | 49 -- .../LAYER2/PROTO_AGENT/proto_agent_async.c | 93 --- .../LAYER2/PROTO_AGENT/proto_agent_async.h | 56 -- .../LAYER2/PROTO_AGENT/proto_agent_common.c | 719 ------------------ .../LAYER2/PROTO_AGENT/proto_agent_common.h | 138 ---- .../LAYER2/PROTO_AGENT/proto_agent_defs.h | 118 --- .../LAYER2/PROTO_AGENT/proto_agent_handler.c | 138 ---- .../LAYER2/PROTO_AGENT/proto_agent_net_comm.c | 152 ---- .../LAYER2/PROTO_AGENT/proto_agent_net_comm.h | 82 -- .../LAYER2/RLC/rlc_proto_agent_primitives.h | 16 - openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 2 - openair2/MCE_APP/mce_config.c | 2 - openair3/MME_APP/mme_config.c | 1 - targets/RT/USER/lte-softmodem.c | 2 - targets/RT/USER/lte-softmodem.h | 1 - 25 files changed, 13 insertions(+), 2295 deletions(-) delete mode 100644 openair2/LAYER2/PROTO_AGENT/cu_test.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/du_test.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent.h delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_async.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_async.h delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_common.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_common.h delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c delete mode 100644 openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h delete mode 100644 openair2/LAYER2/RLC/rlc_proto_agent_primitives.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index ff6169b704..51aef0446d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1109,7 +1109,6 @@ include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/S1AP") include_directories("${OPENAIR2_DIR}/UTIL/OSA") include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc") include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc") -include_directories("${OPENAIR2_DIR}/LAYER2/PROTO_AGENT") include_directories("${OPENAIR2_DIR}/UTIL/MEM") include_directories("${OPENAIR2_DIR}/UTIL/LISTS") include_directories("${OPENAIR2_DIR}/UTIL/FIFO") @@ -1275,18 +1274,6 @@ include_directories (${FSPT_C_DIR}) # set(ASYNC_IF_LIB ASYNC_IF) # include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF) -add_library(PROTO_AGENT - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c - ) -set(PROTO_AGENT_LIB PROTO_AGENT) -include_directories(${OPENAIR2_DIR}/LAYER2/PROTO_AGENT) - - - set(PROTOBUF_LIB "protobuf-c") #set(PROTOBUF_LIB "protobuf") #for Cpp @@ -2780,7 +2767,7 @@ target_link_libraries (lte-softmodem -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7 - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} + ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) @@ -2824,38 +2811,10 @@ target_link_libraries (ocp-enb RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} + ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB}) -add_executable(cu_test - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/cu_test.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c - ${T_SOURCE} -) -target_link_libraries(cu_test - ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB} - ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ITTI -) - -add_executable(du_test - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/du_test.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c - ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c - ${T_SOURCE} -) -target_link_libraries(du_test - ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB} - ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ITTI -) - add_executable(oairu ${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/ru_control.c @@ -2922,7 +2881,7 @@ target_link_libraries (lte-uesoftmodem -Wl,--end-group z dl) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${T_LIB}) @@ -2963,7 +2922,7 @@ target_link_libraries (nr-softmodem UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} + X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES}) @@ -3053,7 +3012,7 @@ target_link_libraries (nr-uesoftmodem -Wl,--end-group z dl) target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${T_LIB}) @@ -3364,7 +3323,7 @@ if (${T_TRACER}) PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB - ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts) + ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts) if (TARGET ${i}) add_dependencies(${i} generate_T) endif() @@ -3474,7 +3433,7 @@ target_link_libraries (nr-ittisim UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} + X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB} PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE -Wl,--end-group z dl) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 184b9caa8f..159b46b6cc 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -589,48 +589,20 @@ static void wait_nfapi_init(char *thread_name) { } void init_pdcp(void) { + uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? + PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT: + LINK_ENB_PDCP_TO_GTPV1U_BIT; + if (!get_softmodem_params()->nsa) { if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) { - //pdcp_layer_init(); - uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? - (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; - - if (IS_SOFTMODEM_NOS1) { - printf("IS_SOFTMODEM_NOS1 option enabled \n"); - pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT; - } - nr_pdcp_module_init(pdcp_initmask, 0); - - if (NODE_IS_CU(RC.nrrrc[0]->node_type)) { - LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n"); - pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req); - } else { - LOG_I(PDCP, "node is gNB \n"); - pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); - pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind); - } - } else { - LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n"); - pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind); } } else { pdcp_layer_init(); - uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? - (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; - - if (IS_SOFTMODEM_NOS1) { - printf("IS_SOFTMODEM_NOS1 option enabled \n"); - pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT; - } - nr_pdcp_module_init(pdcp_initmask, 0); - pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req); - pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind); } } - int main( int argc, char **argv ) { int ru_id, CC_id = 0; start_background_system(); diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h index 4190a6074b..834e89b403 100644 --- a/executables/nr-softmodem.h +++ b/executables/nr-softmodem.h @@ -5,7 +5,6 @@ #include "flexran_agent.h" #include "PHY/defs_gNB.h" -#include "proto_agent.h" #define DEFAULT_DLF 2680000000 @@ -65,5 +64,6 @@ void init_gNB_afterRU(void); extern int stop_L1L2(module_id_t gnb_id); extern int restart_L1L2(module_id_t gnb_id); +void init_pdcp(void); #endif diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index f5493a839a..f4550f63a1 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -55,7 +55,6 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" -#include "proto_agent.h" #include "executables/thread-common.h" #include diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c index 8d4f896250..b3c7363ca4 100644 --- a/openair2/F1AP/f1ap_cu_task.c +++ b/openair2/F1AP/f1ap_cu_task.c @@ -35,7 +35,6 @@ #include "f1ap_cu_rrc_message_transfer.h" #include "f1ap_cu_ue_context_management.h" #include "f1ap_cu_task.h" -#include "proto_agent.h" #include //Fixme: Uniq dirty DU instance, by global var, datamodel need better management diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c index 1d5d24f5ca..c8cfadb999 100644 --- a/openair2/F1AP/f1ap_du_task.c +++ b/openair2/F1AP/f1ap_du_task.c @@ -35,7 +35,6 @@ #include "f1ap_du_ue_context_management.h" #include "f1ap_du_rrc_message_transfer.h" #include "f1ap_du_task.h" -#include "proto_agent.h" #include //Fixme: Uniq dirty DU instance, by global var, datamodel need better management diff --git a/openair2/GNB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c index 7d51d95840..821e2def84 100644 --- a/openair2/GNB_APP/gnb_app.c +++ b/openair2/GNB_APP/gnb_app.c @@ -31,8 +31,8 @@ #include #include #include +#include #include -#include #include "gnb_app.h" #include "gnb_config.h" @@ -135,34 +135,6 @@ static uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end) /*------------------------------------------------------------------------------*/ -static void init_pdcp(void) { - if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) { - pdcp_layer_init(); - uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? - (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; - if (IS_SOFTMODEM_NOS1) { - LOG_I(PDCP, "IS_SOFTMODEM_NOS1 option enabled\n"); - pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT; - } - - nr_pdcp_module_init(pdcp_initmask, 0); - - if (NODE_IS_CU(RC.nrrrc[0]->node_type)) { - LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n"); - pdcp_set_rlc_data_req_func(proto_agent_send_rlc_data_req); - } else { - LOG_I(PDCP, "node is gNB \n"); - pdcp_set_rlc_data_req_func(rlc_data_req); - pdcp_set_pdcp_data_ind_func(pdcp_data_ind); - } - } else { - LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n"); - pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind); - } -} - -/*------------------------------------------------------------------------------*/ - void *gNB_app_task(void *args_p) { diff --git a/openair2/LAYER2/PROTO_AGENT/cu_test.c b/openair2/LAYER2/PROTO_AGENT/cu_test.c deleted file mode 100644 index a26b06dd41..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/cu_test.c +++ /dev/null @@ -1,172 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "ENB_APP/enb_paramdef.h" -#include "LAYER2/PROTO_AGENT/proto_agent.h" -#define BUF_MAX 1400 - -int recv_client = 0; -FILE *output; - -void usage(char *prg_name) { - fprintf(stderr, "usage: %s \n", prg_name); - fprintf(stderr, " - is stdin\n"); - fprintf(stderr, " received packets are written to stdout\n"); -} - -long uelapsed(struct timeval *s, struct timeval *e) { - return e->tv_sec * 1000000 + e->tv_usec - (s->tv_sec * 1000000 + s->tv_usec); -} - -boolean_t -pdcp_data_ind( - const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, - const sdu_size_t sdu_buffer_sizeP, - mem_block_t *const sdu_buffer_pP -) { - fwrite(sdu_buffer_pP->data, sdu_buffer_sizeP, 1, stdout); - fflush(stdout); - free_mem_block(sdu_buffer_pP, __func__); - /* cannot free because of const */ - //free(ctxt_pP); - recv_client = 1; - return 0; -} - -void close_proto_agent(void) { - proto_agent_stop(0); -} - -int main(int argc, char *argv[]) { - const cudu_params_t params = { - .local_ipv4_address = "192.168.12.45", - .local_port = 6464, - .remote_ipv4_address = "192.168.12.45", - .remote_port = 6465 - }; - protocol_ctxt_t p; - memset(&p, 0, sizeof p); - mem_block_t mem; - char s[BUF_MAX]; - size_t size, totsize = 0; - struct timeval t_start, t_end; - FILE *f; - - if (argc != 2) { - usage(argv[0]); - return 1; - } - - if (strcmp(argv[1], "-") == 0) { - f = stdin; - } else { - f = fopen(argv[1], "r"); - } - - if (!f) { - fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno)); - return 2; - } - - pool_buffer_init(); - - if (proto_agent_start(0, ¶ms) != 0) { - fprintf(stderr, "error on proto_agent_start()\n"); - fclose(f); - return 3; - } - - atexit(close_proto_agent); - - /* wait for first packet of client */ - while (!recv_client) sleep(1); - - fprintf(stderr, "reading file\n"); - /* now send back at the same time */ - gettimeofday(&t_start, NULL); - - while ((size = fread(s, 1, BUF_MAX, f)) > 0) { - usleep(10); - totsize += size; - mem.data = &s[0]; - proto_agent_send_rlc_data_req(&p, 0, 0, 0, 0, 0, size, &mem); - } - - gettimeofday(&t_end, NULL); - fclose(f); - long us = uelapsed(&t_start, &t_end); - fprintf(stderr, "read %zu bytes in %ld ms -> %.3fMB/s, %.3fMbps\n", - totsize, us / 1000, ((float) totsize ) / us, - ((float) totsize) / us * 8); - fprintf(stderr, "check files using 'diff afile bfile'\n"); - /* give some time in case the other direction is slower */ - sleep(5); - return 0; -} - -/* - ********************************************************* - * arbitrary functions, needed for linking (used or not) * - ********************************************************* - */ - -rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, - const mui_t muiP, - confirm_t confirmP, - sdu_size_t sdu_sizeP, - mem_block_t *sdu_pP, - const uint32_t *const sourceL2Id, - const uint32_t *const destinationL2Id - ) { - fprintf(stderr, "This should never be called on the CU\n"); - exit(1); -} - -pthread_t new_thread(void *(*f)(void *), void *b) { - pthread_t t; - pthread_attr_t att; - - if (pthread_attr_init(&att)) { - fprintf(stderr, "pthread_attr_init err\n"); - exit(1); - } - - if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) { - fprintf(stderr, "pthread_attr_setdetachstate err\n"); - exit(1); - } - - if (pthread_create(&t, &att, f, b)) { - fprintf(stderr, "pthread_create err\n"); - exit(1); - } - - if (pthread_attr_destroy(&att)) { - fprintf(stderr, "pthread_attr_destroy err\n"); - exit(1); - } - - return t; -} - -int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) { - return 0; -} - -int config_get(paramdef_t *params,int numparams, char *prefix) { - return 0; -} - -int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) { - return 0; -} diff --git a/openair2/LAYER2/PROTO_AGENT/du_test.c b/openair2/LAYER2/PROTO_AGENT/du_test.c deleted file mode 100644 index ee62298438..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/du_test.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "ENB_APP/enb_paramdef.h" -#include "LAYER2/PROTO_AGENT/proto_agent.h" - -#define BUF_MAX 1400 - -void usage(char *prg_name) { - fprintf(stderr, "usage: %s \n", prg_name); - fprintf(stderr, " - is stdin\n"); - fprintf(stderr, " received packets are written to stdout\n"); -} - -long uelapsed(struct timeval *s, struct timeval *e) { - return e->tv_sec * 1000000 + e->tv_usec - (s->tv_sec * 1000000 + s->tv_usec); -} - - -rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, - const mui_t muiP, - confirm_t confirmP, - sdu_size_t sdu_sizeP, - mem_block_t *sdu_pP, - const uint32_t *const sourceL2Id, - const uint32_t *const destinationL2Id - ) { - fwrite(sdu_pP->data, sdu_sizeP, 1, stdout); - fflush(stdout); - free_mem_block(sdu_pP, __func__); - //free(ctxt_pP); - return 0; -} - -void close_proto_agent(void) { - proto_agent_stop(0); -} - -int main(int argc, char *argv[]) { - const cudu_params_t params = { - .local_ipv4_address = "192.168.12.45", - .local_port = 6465, - .remote_ipv4_address = "192.168.12.45", - .remote_port = 6464 - }; - protocol_ctxt_t p; - memset(&p, 0, sizeof p); - mem_block_t mem; - char s[BUF_MAX]; - size_t size, totsize = 0; - struct timeval t_start, t_end; - FILE *f; - - if (argc != 2) { - usage(argv[0]); - return 1; - } - - if (strcmp(argv[1], "-") == 0) { - f = stdin; - } else { - f = fopen(argv[1], "r"); - } - - if (!f) { - fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno)); - return 2; - } - - pool_buffer_init(); - - if (proto_agent_start(0, ¶ms) != 0) { - fprintf(stderr, "error on proto_agent_start()\n"); - fclose(f); - return 3; - } - - atexit(close_proto_agent); - gettimeofday(&t_start, NULL); - - while ((size = fread(s, 1, BUF_MAX, f)) > 0) { - usleep(10); - totsize += size; - mem.data = &s[0]; - proto_agent_send_pdcp_data_ind(&p, 0, 0, 0, size, &mem); - } - - gettimeofday(&t_end, NULL); - fclose(f); - long us = uelapsed(&t_start, &t_end); - fprintf(stderr, "read %zu bytes in %ld ms -> %.3fMB/s, %.3fMbps\n", - totsize, us / 1000, ((float) totsize ) / us, - ((float) totsize) / us * 8); - fprintf(stderr, "check files using 'diff afile bfile'\n"); - /* wait, we are possibly receiving data */ - sleep(5); - return 0; -} - -/* - ********************************************************* - * arbitrary functions, needed for linking (used or not) * - ********************************************************* - */ - -boolean_t -pdcp_data_ind( - const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, - const sdu_size_t sdu_buffer_sizeP, - mem_block_t *const sdu_buffer_pP -) { - fprintf(stderr, "This should never be called on the DU\n"); - exit(1); -} - -pthread_t new_thread(void *(*f)(void *), void *b) { - pthread_t t; - pthread_attr_t att; - - if (pthread_attr_init(&att)) { - fprintf(stderr, "pthread_attr_init err\n"); - exit(1); - } - - if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) { - fprintf(stderr, "pthread_attr_setdetachstate err\n"); - exit(1); - } - - if (pthread_create(&t, &att, f, b)) { - fprintf(stderr, "pthread_create err\n"); - exit(1); - } - - if (pthread_attr_destroy(&att)) { - fprintf(stderr, "pthread_attr_destroy err\n"); - exit(1); - } - - return t; -} - -int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) { - return 0; -} - -int config_get(paramdef_t *params,int numparams, char *prefix) { - return 0; -} - -int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) { - return 0; -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.c b/openair2/LAYER2/PROTO_AGENT/proto_agent.c deleted file mode 100644 index 5cf71b826d..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent.c +++ /dev/null @@ -1,278 +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 enb_agent.h - * \brief top level enb agent receive thread and itti task - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ -#define _GNU_SOURCE -#include "proto_agent_common.h" -#include "common/utils/LOG/log.h" -#include "proto_agent.h" -#include "assertions.h" -#include "proto_agent_net_comm.h" -#include "proto_agent_async.h" -#include -#include - -#define ENB_AGENT_MAX 9 - -proto_agent_instance_t proto_agent[MAX_DU]; - -//pthread_t new_thread(void *(*f)(void *), void *b); - -Protocol__FlexsplitMessage *proto_agent_timeout_fsp(void *args); - -#define TEST_MOD 0 - -#define ECHO - -/* Server side function; upon a new connection - reception, sends the hello packets -*/ -int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) { - int channel_id; - // RS: CUDU does not work! - //DevAssert(p->local_interface); - //DevAssert(p->local_ipv4_address); - //DevAssert(p->local_port > 1024); // "unprivileged" port - //DevAssert(p->remote_ipv4_address); - //DevAssert(p->remote_port > 1024); // "unprivileged" port - proto_agent[mod_id].mod_id = mod_id; - proto_agent[mod_id].exit = 0; - /* Initialize the channel container */ - /* TODO only initialize the first time */ - proto_agent_init_channel_container(); - /*Create the async channel info*/ - proto_agent_async_channel_t *channel_info; - channel_info = proto_agent_async_channel_info(mod_id, p->local_ipv4_address, p->local_port, - p->remote_ipv4_address, p->remote_port); - - if (!channel_info) goto error; - - /* Create a channel using the async channel info */ - channel_id = proto_agent_create_channel((void *) channel_info, - proto_agent_async_msg_send, - proto_agent_async_msg_recv, - proto_agent_async_release); - - if (channel_id <= 0) goto error; - - proto_agent_channel_t *channel = proto_agent_get_channel(channel_id); - - if (!channel) goto error; - - proto_agent[mod_id].channel = channel; - /* Register the channel for all underlying agents (use ENB_AGENT_MAX) */ - proto_agent_register_channel(mod_id, channel, ENB_AGENT_MAX); - // Code for sending the HELLO/ECHO_REQ message once a connection is established - //uint8_t *msg = NULL; - //Protocol__FlexsplitMessage *init_msg=NULL; - //if (udp == 0) - //{ - // // If the comm is not UDP, allow the server to send the first packet over the channel - // //printf( "Proto agent Server: Calling the echo_request packet constructor\n"); - // msg_flag = proto_agent_echo_request(mod_id, NULL, &init_msg); - // if (msg_flag != 0) - // goto error; - // - // int msgsize = 0; - // if (init_msg != NULL) - // msg = proto_agent_pack_message(init_msg, &msgsize); - // if (msg!= NULL) - // { - // LOG_D(PROTO_AGENT, "Server sending the message over the async channel\n"); - // proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, (void *) channel_info); - // } - // /* After sending the message, wait for any replies; - // the server thread blocks until it reads any data - // over the channel - // */ - //} - //proto_agent[mod_id].recv_thread = new_thread(proto_agent_receive, &proto_agent[mod_id]); - threadCreate(&proto_agent[mod_id].recv_thread, proto_agent_receive, &proto_agent[mod_id], "proto", -1, OAI_PRIORITY_RT_LOW); - fprintf(stderr, "[PROTO_AGENT] server started at port %s:%d\n", p->local_ipv4_address, p->local_port); - return 0; -error: - LOG_E(PROTO_AGENT, "there was an error\n"); - return 1; -} - -void proto_agent_stop(mod_id_t mod_id) { - if (!proto_agent[mod_id].channel) return; - - /* unlock the independent read thread proto_agent_receive() */ - proto_agent[mod_id].exit = 1; - proto_agent_async_msg_recv_unlock(proto_agent[mod_id].channel->channel_info); - proto_agent_async_release(proto_agent[mod_id].channel); - proto_agent_destroy_channel(proto_agent[mod_id].channel->channel_id); - free(proto_agent[mod_id].channel); - proto_agent[mod_id].channel = NULL; - LOG_W(PROTO_AGENT, "server stopped\n"); -} - -//void -//proto_agent_send_hello(void) -//{ -// uint8_t *msg = NULL; -// Protocol__FlexsplitMessage *init_msg=NULL; -// int msg_flag = 0; -// -// -// //printf( "PDCP agent: Calling the HELLO packet constructor\n"); -// msg_flag = proto_agent_hello(proto_agent[TEST_MOD].mod_id, NULL, &init_msg); -// -// int msgsize = 0; -// if (msg_flag == 0) -// { -// proto_agent_serialize_message(init_msg, &msg, &msgsize); -// } -// -// LOG_D(PROTO_AGENT, "Agent sending the message over the async channel\n"); -// proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, (void *) client_channel[TEST_MOD]); -//} - - - -rlc_op_status_t proto_agent_send_rlc_data_req(const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, const mui_t muiP, - confirm_t confirmP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP,const uint32_t *const SrcID, const uint32_t *const DstID) { - uint8_t *msg = NULL; - Protocol__FlexsplitMessage *init_msg=NULL; - int msg_flag = 0; - int msgsize = 0; - mod_id_t mod_id = ctxt_pP->module_id; - data_req_args args; - DevAssert(proto_agent[mod_id].channel); - DevAssert(proto_agent[mod_id].channel->channel_info); - args.ctxt = ctxt_pP; - args.srb_flag = srb_flagP; - args.MBMS_flag = MBMS_flagP; - args.rb_id = rb_idP; - args.mui = muiP; - args.confirm = confirmP; - args.sdu_size = sdu_sizeP; - args.sdu_p = sdu_pP; - msg_flag = proto_agent_pdcp_data_req(mod_id, (void *) &args, &init_msg); - - if (msg_flag != 0 || !init_msg) goto error; - - msg = proto_agent_pack_message(init_msg, &msgsize); - - if (!msg) goto error; - - proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info); - free_mem_block(sdu_pP, __func__); - return RLC_OP_STATUS_OK; -error: - LOG_E(PROTO_AGENT, "PROTO_AGENT there was an error\n"); - return RLC_OP_STATUS_INTERNAL_ERROR; -} - - -boolean_t proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP, const srb_flag_t srb_flagP, - const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, - sdu_size_t sdu_sizeP, mem_block_t *sdu_pP, - const uint32_t *const SrcID, const uint32_t *const DstID) { - uint8_t *msg = NULL; - Protocol__FlexsplitMessage *init_msg = NULL; - int msg_flag = 0; - int msgsize = 0; - mod_id_t mod_id = ctxt_pP->module_id; - data_req_args args; - DevAssert(proto_agent[mod_id].channel); - DevAssert(proto_agent[mod_id].channel->channel_info); - args.ctxt = ctxt_pP; - args.srb_flag = srb_flagP; - args.MBMS_flag = MBMS_flagP; - args.rb_id = rb_idP; - args.sdu_size = sdu_sizeP; - args.sdu_p = sdu_pP; - msg_flag = proto_agent_pdcp_data_ind(mod_id, (void *) &args, &init_msg); - - if (msg_flag != 0 || !init_msg) goto error; - - msg = proto_agent_pack_message(init_msg, &msgsize); - - if (!msg) goto error; - - proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info); - free_mem_block(sdu_pP, __func__); - return TRUE; -error: - LOG_E(PROTO_AGENT, "there was an error in %s\n", __func__); - return FALSE; -} - -void * -proto_agent_receive(void *args) { - proto_agent_instance_t *inst = args; - void *data = NULL; - int size; - int priority; - err_code_t err_code; - pthread_setname_np(pthread_self(), "proto_rx"); - Protocol__FlexsplitMessage *msg; - uint8_t *ser_msg; - - while (1) { - msg = NULL; - ser_msg = NULL; - - if ((size = proto_agent_async_msg_recv(&data, &priority, inst->channel->channel_info)) < 0) { - err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING; - goto error; - } - - if (inst->exit) break; - - LOG_D(PROTO_AGENT, "Server side Received message with size %d and priority %d, calling message handle\n", size, priority); - msg = proto_agent_handle_message(inst->mod_id, data, size); - - if (!msg) { - LOG_D(PROTO_AGENT, "msg to send back is NULL\n"); - continue; - } - - ser_msg = proto_agent_pack_message(msg, &size); - - if (!ser_msg) { - continue; - } - - LOG_D(PROTO_AGENT, "Server sending the reply message over the async channel\n"); - - if (proto_agent_async_msg_send((void *)ser_msg, (int) size, 1, inst->channel->channel_info)) { - err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING; - goto error; - } - - LOG_D(PROTO_AGENT, "sent message with size %d\n", size); - } - - return NULL; -error: - LOG_E(PROTO_AGENT, "proto_agent_receive(): error %d occured\n",err_code); - return NULL; -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.h b/openair2/LAYER2/PROTO_AGENT/proto_agent.h deleted file mode 100644 index 4badda43b7..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent.h +++ /dev/null @@ -1,49 +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 proto_agent.h - * \brief top level protocol agent - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - -#ifndef PROTO_AGENT_H_ -#define PROTO_AGENT_H_ -#include "ENB_APP/enb_config.h" // for enb properties -#include "proto_agent_common.h" -#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h" -#include "RRC/NR/nr_rrc_defs.h" - - -void *proto_agent_receive(void *args); - -int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p); -void proto_agent_stop(mod_id_t mod_id); - -rlc_op_status_t proto_agent_send_rlc_data_req( const protocol_ctxt_t *const ctxt_pP, - const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, - const rb_id_t rb_idP, const mui_t muiP, confirm_t confirmP, - sdu_size_t sdu_sizeP, mem_block_t *sdu_pP,const uint32_t *const SrcID, const uint32_t *const DstID); - -pdcp_data_ind_t proto_agent_send_pdcp_data_ind; - -#endif diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c deleted file mode 100644 index df3684ee27..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c +++ /dev/null @@ -1,93 +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 - */ - -#include "proto_agent_async.h" -#include "proto_agent_defs.h" - - -#include "common/utils/LOG/log.h" - -proto_agent_async_channel_t * -proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bind_port, - const char* peer_ip, uint16_t peer_port) -{ - proto_agent_async_channel_t *channel; - channel = malloc(sizeof(proto_agent_async_channel_t)); - - if (channel == NULL) - goto error; - - channel->enb_id = mod_id; - channel->link = new_link_udp_server(bind_ip, bind_port); - - if (channel->link == NULL) goto error; - - channel->send_queue = new_message_queue(); - if (channel->send_queue == NULL) goto error; - channel->receive_queue = new_message_queue(); - if (channel->receive_queue == NULL) goto error; - - channel->manager = create_link_manager(channel->send_queue, - channel->receive_queue, - channel->link); - /* manually set remote IP&port for UDP server remote end */ - channel->manager->peer_port = peer_port; - channel->manager->peer_addr = peer_ip; - - if (channel->manager == NULL) goto error; - - return channel; - - error: - if (channel) - free(channel); - LOG_E(PROTO_AGENT, "error creating proto_agent_async_channel_t\n"); - return NULL; -} - -int proto_agent_async_msg_send(void *data, int size, int priority, void *channel_info) -{ - proto_agent_async_channel_t *channel = channel_info; - return message_put(channel->send_queue, data, size, priority); -} - -int proto_agent_async_msg_recv(void **data, int *priority, void *channel_info) -{ - proto_agent_async_channel_t *channel = channel_info; - return message_get(channel->receive_queue, data, priority); -} - -void proto_agent_async_msg_recv_unlock(proto_agent_async_channel_t *channel) { - message_get_unlock(channel->receive_queue); -} - -void proto_agent_async_release(proto_agent_channel_t *channel) -{ - proto_agent_async_channel_t *channel_info = channel->channel_info; - - destroy_link_manager(channel_info->manager); - - destroy_message_queue(channel_info->send_queue); - destroy_message_queue(channel_info->receive_queue); - - close_link(channel_info->link); - free(channel_info); -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h deleted file mode 100644 index 6bc952e804..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h +++ /dev/null @@ -1,56 +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 enb_agent_async.h - * \brief channel implementation for async interface - * \author Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - -#ifndef PROTO_AGENT_ASYNC_H_ -#define PROTO_AGENT_ASYNC_H_ - -#include "proto_agent_net_comm.h" - -typedef struct proto_agent_async_channel_s { - mod_id_t enb_id; - socket_link_t *link; - message_queue_t *send_queue; - message_queue_t *receive_queue; - link_manager_t *manager; -} proto_agent_async_channel_t; - -proto_agent_async_channel_t * -proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bind_port, - const char *peer_ip, uint16_t peer_port); - -int proto_agent_async_msg_send(void *data, int size, int priority, void *channel_info); - -int proto_agent_async_msg_recv(void **data, int *priority, void *channel_info); - -/* unlocks a running proto_agent_async_msg_recv() */ -void proto_agent_async_msg_recv_unlock(proto_agent_async_channel_t *channel); - -void proto_agent_async_release(proto_agent_channel_t *channel); - - -#endif /*PROTO_AGENT_ASYNC_H_*/ diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c deleted file mode 100644 index d3d00d1ada..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c +++ /dev/null @@ -1,719 +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 proto_agent_common.c - * \brief common primitives for all agents - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - -#include -#include -#include - -#include "PHY/phy_extern.h" -#include "proto_agent_common.h" -#include "common/utils/LOG/log.h" -#include "common/ran_context.h" - -extern RAN_CONTEXT_t RC; - -/* - * message primitives - */ - -// Function to fill in the dl_data header (32bits) with the appropriate fields (doing bitwise operations) -void fill_dl_data_header(int pdu_type, int spare, int seq_no, uint32_t *header) { - uint32_t type = pdu_type; - uint32_t spare_ = spare; - uint32_t seq = seq_no; - type = type << 28; - spare_ = spare_ << 24; - *header = (type | spare_); - *header = (*header | seq); - return; -} - - -// Function to retrieve data from the dl_data header (32bits) (doing bitwise operations) -void read_dl_data_header(int *pdu_type, int *spare, int *seqno, uint32_t header) { - *pdu_type = header; - *spare = header; - *seqno = header; - *pdu_type = *pdu_type >> 28; - *spare = *spare << 4; - *spare = *spare >> 28; - *seqno = *seqno << 8; - *seqno = *seqno >> 8; - return; -} - -int f1u_serialize_message(Protocol__F1uMessage *msg, void **buf,int *size) { - *size = protocol__f1u_message__get_packed_size(msg); - *buf = malloc(*size); - - if (!(*buf)) - goto error; - - protocol__f1u_message__pack(msg, *buf); - return 0; -error: - LOG_E(F1U, "an error occured\n"); - return -1; -} - -int f1u_deserialize_message(void *data, int size, Protocol__F1uMessage **msg) { - *msg = protocol__f1u_message__unpack(NULL, size, data); - - if (*msg == NULL) - goto error; - - return 0; -error: - LOG_E(F1U, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int f1u_dl_data_create_header(uint32_t pdu_type, uint32_t f1u_sn, Protocol__DlDataHeader **header) { - *header = malloc(sizeof(Protocol__DlDataHeader)); - - if(*header == NULL) - goto error; - - protocol__dl_data_header__init(*header); - LOG_D(F1U, "Initialized the DL Data User header\n"); - fill_dl_data_header(pdu_type, 0, f1u_sn, &(*header)->fields); - return 0; -error: - LOG_E(F1U, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int f1u_dl_data(const void *params, Protocol__F1uMessage **msg) { - // Initialize the PDCP params - dl_data_args *args = (dl_data_args *)params; - Protocol__DlDataHeader *header; - - if (f1u_dl_data_create_header(args->pdu_type, args->sn, &header) != 0) - goto error; - - Protocol__DlUserData *dl_data = NULL; - *msg = malloc(sizeof(Protocol__DlUserData)); - - if(*msg == NULL) - goto error; - - // FIXME: Is the following used? It seems to be overwritten by the function - // protocol__dl_user_data__init() anyway - //dl_data = *msg; - protocol__dl_user_data__init(dl_data); - // Copy data to the bytes structure - dl_data->pdu.data = malloc(args->sdu_size); - dl_data->pdu.len = args->sdu_size; - memcpy(dl_data->pdu.data, args->sdu_p, args->sdu_size); - dl_data->frame = args->frame; - dl_data->subframe = args->subframe; - dl_data->rnti = args->rnti; - dl_data->header = header; - return 0; -error: - - if(header != NULL) - free(header); - - if(*msg != NULL) - free(*msg); - - LOG_E(F1U, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, uint8_t **buf, int *size) { - *size = protocol__flexsplit_message__get_packed_size(msg); - *buf = malloc(*size); - - if (!(*buf)) - goto error; - - protocol__flexsplit_message__pack(msg, *buf); - return 0; -error: - LOG_E(MAC, "an error occured\n"); - return -1; -} - -/* We assume that the buffer size is equal to the message size. - Should be chekced durint Tx/Rx */ -int proto_agent_deserialize_message(void *data, int size, Protocol__FlexsplitMessage **msg) { - *msg = protocol__flexsplit_message__unpack(NULL, size, data); - - if (*msg == NULL) - goto error; - - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int fsp_create_header(xid_t xid, Protocol__FspType type, Protocol__FspHeader **header) { - *header = malloc(sizeof(Protocol__FspHeader)); - - if(*header == NULL) - goto error; - - protocol__fsp_header__init(*header); - LOG_D(PROTO_AGENT, "Initialized the PROTOBUF message header\n"); - (*header)->version = FLEXSPLIT_VERSION; - LOG_D(PROTO_AGENT, "Set the vversion to FLEXSPLIT_VERSION\n"); - (*header)->has_version = 1; - (*header)->type = type; - (*header)->has_type = 1; - (*header)->xid = xid; - (*header)->has_xid = 1; - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int just_print(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - return 1; -} - -int proto_agent_pdcp_data_req(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - Protocol__FspCtxt *ctxt = NULL; - Protocol__FspRlcPdu *pdu = NULL; - Protocol__FspRlcData *rlc_data = NULL; - Protocol__FspRlcDataReq *data_req = NULL; - // Initialize the PDCP params - data_req_args *args = (data_req_args *)params; - // Create the protobuf header - Protocol__FspHeader *header; - xid_t xid = mod_id; - LOG_D(PROTO_AGENT, "creating the data_req message\n"); - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_RLC_DATA_REQ, &header) != 0) - goto error; - - /* Begin constructing the messages. They are defined as follows: - * 1) fspRlcPdu is storing the bytes of the packet - * 2) Message fspRlcData is packing the packet + the context of the PDCP (separate message) - * 3) Messge fspRlcDataReq is packing the header, enb_id and fspRlcData - */ - ctxt = malloc(sizeof(Protocol__FspCtxt)); - pdu = malloc(sizeof(Protocol__FspRlcPdu)); - rlc_data = malloc(sizeof(Protocol__FspRlcData)); - data_req = malloc(sizeof(Protocol__FspRlcDataReq)); - protocol__fsp_ctxt__init(ctxt); - protocol__fsp_rlc_pdu__init(pdu); - protocol__fsp_rlc_data__init(rlc_data); - protocol__fsp_rlc_data_req__init(data_req); - // Copy data to the RlcPdu structure - pdu->fsp_pdu_data.data = malloc(args->sdu_size); - pdu->fsp_pdu_data.len = args->sdu_size; - memcpy(pdu->fsp_pdu_data.data, args->sdu_p->data, args->sdu_size); - pdu->has_fsp_pdu_data = 1; - // Copy data to the ctxt structure - ctxt->fsp_mod_id = args->ctxt->module_id; - ctxt->fsp_enb_flag = args->ctxt->enb_flag; - ctxt->fsp_instance = args->ctxt->instance; - ctxt->fsp_rnti = args->ctxt->rnti; - ctxt->fsp_frame = args->ctxt->frame; - ctxt->fsp_subframe = args->ctxt->subframe; - ctxt->fsp_enb_index = args->ctxt->eNB_index; - ctxt->has_fsp_mod_id = 1; - ctxt->has_fsp_enb_flag = 1; - ctxt->has_fsp_instance = 1; - ctxt->has_fsp_rnti = 1; - ctxt->has_fsp_frame = 1; - ctxt->has_fsp_subframe = 1; - ctxt->has_fsp_enb_index = 1; - rlc_data->fsp_ctxt = ctxt; - rlc_data->fsp_srb_flag = args->srb_flag; - rlc_data->fsp_mbms_flag = args->MBMS_flag; - rlc_data->fsp_rb_id = args->rb_id; - rlc_data->fsp_muip = args->mui; - rlc_data->fsp_confirm = args->confirm; - rlc_data->fsp_sdu_buffer_size = args->sdu_size; - rlc_data->fsp_pdu = pdu; - rlc_data->has_fsp_srb_flag = 1; - rlc_data->has_fsp_mbms_flag = 1; - rlc_data->has_fsp_rb_id = 1; - rlc_data->has_fsp_muip = 1; - rlc_data->has_fsp_confirm = 1; - rlc_data->has_fsp_sdu_buffer_size = 1; - // Up to here, everything is a signle message that is packed inside another. The final data_req - // will be created later, after the setting of all variables - data_req->header = header; - data_req->enb_id = mod_id; - data_req->has_enb_id = 1; - data_req->pdcp_data = rlc_data; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; //we will be waiting for the ACK - (*msg)->has_msg_dir = 1; - (*msg)->data_req_msg = data_req; - return 0; -error: - - if(header != NULL) - free(header); - - if(pdu!=NULL) - free(pdu); - - if(rlc_data!=NULL) - free(rlc_data); - - if(data_req!= NULL) - free(data_req); - - if(*msg != NULL) - free(*msg); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG) - goto error; - - free(msg->data_req_msg->header); - free(msg->data_req_msg->pdcp_data->fsp_pdu->fsp_pdu_data.data); - free(msg->data_req_msg->pdcp_data->fsp_pdu); - free(msg->data_req_msg->pdcp_data->fsp_ctxt); - free(msg->data_req_msg->pdcp_data); - free(msg->data_req_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_get_ack_result(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { -/* code useless in this status: return 0 anyways - rlc_op_status_t result = 0; - printf("PROTO_AGENT: handling the data_req_ack message\n"); - Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params; - Protocol__FspRlcDataReqAck *data_ack = input->data_req_ack; - result = data_ack->result; - printf("PROTO_AGENT: ACK RESULT IS %u\n", result); - ack_result = result; -*/ - return 0; -} - - -int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - rlc_op_status_t result = 0; - Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params; - Protocol__FspRlcDataReq *data_req = input->data_req_msg; - Protocol__FspCtxt *ctxt = NULL; - Protocol__FspRlcData *rlc_data = NULL; - rlc_data = data_req->pdcp_data; - ctxt = rlc_data->fsp_ctxt; - protocol_ctxt_t ctxt_pP; - srb_flag_t srb_flagP = 0; - rb_id_t rb_idP = 0; - mui_t muiP = 0; - confirm_t confirmP = 0; - MBMS_flag_t flag_MBMS = 0; - sdu_size_t pdcp_pdu_size = 0; - mem_block_t *pdcp_pdu_p = NULL; - // Create a new protocol context for handling the packet - ctxt_pP.module_id = ctxt->fsp_mod_id; - ctxt_pP.enb_flag = ctxt->fsp_enb_flag; - ctxt_pP.instance = ctxt->fsp_instance; - ctxt_pP.rnti = ctxt->fsp_rnti; - ctxt_pP.frame = ctxt->fsp_frame; - ctxt_pP.subframe = ctxt->fsp_subframe; - ctxt_pP.eNB_index = ctxt->fsp_enb_index; - srb_flagP = rlc_data->fsp_srb_flag; - flag_MBMS = rlc_data->fsp_mbms_flag; - rb_idP = rlc_data->fsp_rb_id; - muiP = rlc_data->fsp_muip; - confirmP = rlc_data->fsp_confirm; - pdcp_pdu_size = rlc_data->fsp_pdu->fsp_pdu_data.len; - pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__); - - if (!pdcp_pdu_p) { - LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__); - return -1; - } - - memcpy(pdcp_pdu_p->data, rlc_data->fsp_pdu->fsp_pdu_data.data, pdcp_pdu_size); - if (RC.nrrrc) { - LOG_D(PROTO_AGENT, "proto_agent received pdcp_data_req \n"); - // for (int i = 0; i < pdcp_pdu_size; i++) - // printf(" %2.2x", (unsigned char)pdcp_pdu_p->data[i]); - // printf("\n"); - du_rlc_data_req(&ctxt_pP, srb_flagP, flag_MBMS, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p); - result = 1; - } else { - result = rlc_data_req(&ctxt_pP, srb_flagP, flag_MBMS, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p, NULL, NULL); - } - return result; -} - -int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG) - goto error; - - free(msg->data_ind_msg->header); - free(msg->data_ind_msg->rlc_data->fsp_pdu->fsp_pdu_data.data); - free(msg->data_ind_msg->rlc_data->fsp_pdu); - free(msg->data_ind_msg->rlc_data->fsp_ctxt); - free(msg->data_ind_msg->rlc_data); - free(msg->data_ind_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_pdcp_data_ind(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - Protocol__FspCtxt *ctxt = NULL; - Protocol__FspRlcPdu *pdu = NULL; - Protocol__FspRlcData *rlc_data = NULL; - Protocol__FspPdcpDataInd *data_ind = NULL; - // Initialize the PDCP params - data_req_args *args = (data_req_args *)params; - // Create the protobuf header - Protocol__FspHeader *header; - xid_t xid = mod_id; - LOG_D(PROTO_AGENT, "creating the data_ind message\n"); - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_PDCP_DATA_IND, &header) != 0) - goto error; - - /* Begin constructing the messages. They are defined as follows: - * 1) fspRlcPdu is storing the bytes of the packet - * 2) Message fspRlcData is packing the packet + the context of the PDCP (separate message) - * 3) Messge fspRlcDataReq is packing the header, enb_id and fspRlcData - */ - ctxt = malloc(sizeof(Protocol__FspCtxt)); - pdu = malloc(sizeof(Protocol__FspRlcPdu)); - rlc_data = malloc(sizeof(Protocol__FspRlcData)); - data_ind = malloc(sizeof(Protocol__FspPdcpDataInd)); - protocol__fsp_ctxt__init(ctxt); - protocol__fsp_rlc_pdu__init(pdu); - protocol__fsp_rlc_data__init(rlc_data); - protocol__fsp_pdcp_data_ind__init(data_ind); - // Copy data to the RlcPdu structure - pdu->fsp_pdu_data.data = malloc(args->sdu_size); - pdu->fsp_pdu_data.len = args->sdu_size; - memcpy(pdu->fsp_pdu_data.data, args->sdu_p->data, args->sdu_size); - pdu->has_fsp_pdu_data = 1; - // Copy data to the ctxt structure - ctxt->fsp_mod_id = args->ctxt->module_id; - ctxt->fsp_enb_flag = args->ctxt->enb_flag; - ctxt->fsp_instance = args->ctxt->instance; - ctxt->fsp_rnti = args->ctxt->rnti; - ctxt->fsp_frame = args->ctxt->frame; - ctxt->fsp_subframe = args->ctxt->subframe; - ctxt->fsp_enb_index = args->ctxt->eNB_index; - ctxt->has_fsp_mod_id = 1; - ctxt->has_fsp_enb_flag = 1; - ctxt->has_fsp_instance = 1; - ctxt->has_fsp_rnti = 1; - ctxt->has_fsp_frame = 1; - ctxt->has_fsp_subframe = 1; - ctxt->has_fsp_enb_index = 1; - rlc_data->fsp_ctxt = ctxt; - rlc_data->fsp_srb_flag = args->srb_flag; - rlc_data->fsp_mbms_flag = args->MBMS_flag; - rlc_data->fsp_rb_id = args->rb_id; - rlc_data->fsp_sdu_buffer_size = args->sdu_size; - rlc_data->fsp_pdu = pdu; - rlc_data->has_fsp_srb_flag = 1; - rlc_data->has_fsp_mbms_flag = 1; - rlc_data->has_fsp_rb_id = 1; - rlc_data->has_fsp_sdu_buffer_size = 1; - // Up to here, everything is a signle message that is packed inside another. The final data_req - // will be created later, after the setting of all variables - data_ind->header = header; - data_ind->enb_id = mod_id; - data_ind->has_enb_id = 1; - data_ind->rlc_data = rlc_data; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - LOG_D(PROTO_AGENT,"setting the message case to %d\n", PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; //we will be waiting for the ACK - (*msg)->has_msg_dir = 1; - (*msg)->data_ind_msg = data_ind; //data_req; - return 0; -error: - - if(header != NULL) - free(header); - - if(pdu!=NULL) - free(pdu); - - if(rlc_data!=NULL) - free(rlc_data); - - if(data_ind!= NULL) - free(data_ind); - - if(*msg != NULL) - free(*msg); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - boolean_t result = 0; - Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params; - Protocol__FspPdcpDataInd *data_ind = input->data_ind_msg; - Protocol__FspCtxt *ctxt = NULL; - Protocol__FspRlcData *rlc_data = NULL; - rlc_data = data_ind->rlc_data; - ctxt = rlc_data->fsp_ctxt; - protocol_ctxt_t ctxt_pP; - srb_flag_t srb_flagP = 0; - rb_id_t rb_idP = 0; - sdu_size_t pdcp_pdu_size = 0; - MBMS_flag_t flag_MBMS = 0; - mem_block_t *pdcp_pdu_p = NULL; - // Create a new protocol context for handling the packet - ctxt_pP.module_id = ctxt->fsp_mod_id; - ctxt_pP.enb_flag = ctxt->fsp_enb_flag; - ctxt_pP.instance = ctxt->fsp_instance; - ctxt_pP.rnti = ctxt->fsp_rnti; - ctxt_pP.frame = ctxt->fsp_frame; - ctxt_pP.subframe = ctxt->fsp_subframe; - ctxt_pP.brOption = 0; - ctxt_pP.eNB_index = ctxt->fsp_enb_index; - srb_flagP = rlc_data->fsp_srb_flag; - flag_MBMS = rlc_data->fsp_mbms_flag; - rb_idP = rlc_data->fsp_rb_id; - pdcp_pdu_size = rlc_data->fsp_pdu->fsp_pdu_data.len; - pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__); - - if (!pdcp_pdu_p) goto error; - - memcpy(pdcp_pdu_p->data, rlc_data->fsp_pdu->fsp_pdu_data.data, pdcp_pdu_size); - // if (xid == 1) - // pdcp_data_ind_wifi((const protocol_ctxt_t*) ctxt_pP, (const srb_flag_t) srb_flagP, (const MBMS_flag_t) flag_MBMS, (const rb_id_t) rb_idP, pdcp_pdu_size, pdcp_pdu_p); - // else if (xid == 0) // FIXME: USE a preprocessed definition - LOG_D(PROTO_AGENT, "[inst %ld] Received PDCP PDU with size %d for UE RNTI %x RB %ld, Calling pdcp_data_ind\n", ctxt_pP.instance, pdcp_pdu_size,ctxt_pP.rnti,rb_idP); - result = pdcp_data_ind(&ctxt_pP, - srb_flagP, - flag_MBMS, - rb_idP, - pdcp_pdu_size, - pdcp_pdu_p, NULL, NULL); - return result; -error: - - if (pdcp_pdu_p) - free_mem_block(pdcp_pdu_p, __func__); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_hello(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - Protocol__FspHeader *header; - Protocol__FspHello *hello_msg = NULL; - /*TODO: Need to set random xid or xid from received hello message*/ - xid_t xid = mod_id; - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_HELLO, &header) != 0) - goto error; - - LOG_D(PROTO_AGENT, "creating the HELLO message\n"); - hello_msg = malloc(sizeof(Protocol__FspHello)); - - if(hello_msg == NULL) - goto error; - - protocol__fsp_hello__init(hello_msg); - hello_msg->header = header; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_HELLO_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__SUCCESSFUL_OUTCOME; - (*msg)->has_msg_dir = 1; - (*msg)->hello_msg = hello_msg; - return 0; -error: - - if(header != NULL) - free(header); - - if(hello_msg!=NULL) - free(hello_msg); - - if(*msg != NULL) - free(*msg); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - - -int proto_agent_destroy_hello(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_HELLO_MSG) - goto error; - - free(msg->hello_msg->header); - free(msg->hello_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_echo_request(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - Protocol__FspHeader *header; - Protocol__FspEchoRequest *echo_request_msg = NULL; - xid_t xid = mod_id; - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_ECHO_REQUEST, &header) != 0) - goto error; - - LOG_D(PROTO_AGENT, "creating the echo request message\n"); - echo_request_msg = malloc(sizeof(Protocol__FspEchoRequest)); - - if(echo_request_msg == NULL) - goto error; - - protocol__fsp_echo_request__init(echo_request_msg); - echo_request_msg->header = header; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - LOG_D(PROTO_AGENT,"setting the message direction to %d\n", PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; - (*msg)->has_msg_dir = 1; - (*msg)->echo_request_msg = echo_request_msg; - return 0; -error: - - if(header != NULL) - free(header); - - if(echo_request_msg != NULL) - free(echo_request_msg); - - if(*msg != NULL) - free(*msg); - - return -1; -} - -int proto_agent_destroy_echo_request(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG) - goto error; - - free(msg->echo_request_msg->header); - free(msg->echo_request_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_echo_reply(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) { - xid_t xid; - Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params; - Protocol__FspEchoRequest *echo_req = input->echo_request_msg; - Protocol__FspEchoReply *echo_reply_msg = NULL; - xid = (echo_req->header)->xid; - LOG_D(PROTO_AGENT, "creating the echo reply message\n"); - Protocol__FspHeader *header; - - if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_ECHO_REPLY, &header) != 0) - goto error; - - echo_reply_msg = malloc(sizeof(Protocol__FspEchoReply)); - - if(echo_reply_msg == NULL) - goto error; - - protocol__fsp_echo_reply__init(echo_reply_msg); - echo_reply_msg->header = header; - *msg = malloc(sizeof(Protocol__FlexsplitMessage)); - - if(*msg == NULL) - goto error; - - protocol__flexsplit_message__init(*msg); - (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG; - (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__SUCCESSFUL_OUTCOME; - (*msg)->has_msg_dir = 1; - (*msg)->echo_reply_msg = echo_reply_msg; - return 0; -error: - - if(header != NULL) - free(header); - - if(echo_reply_msg != NULL) - free(echo_reply_msg); - - if(*msg != NULL) - free(*msg); - - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} - -int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg) { - if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG) - goto error; - - free(msg->echo_reply_msg->header); - free(msg->echo_reply_msg); - free(msg); - return 0; -error: - LOG_E(MAC, "%s: an error occured\n", __FUNCTION__); - return -1; -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h deleted file mode 100644 index 8f553e05e1..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h +++ /dev/null @@ -1,138 +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 enb_agent_common.h - * \brief common message primitves and utilities - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - - - -#ifndef PROTO_AGENT_COMMON_H_ -#define PROTO_AGENT_COMMON_H_ - -#include - -#include "flexsplit.pb-c.h" - -// Do not need these -//#include "stats_messages.pb-c.h" -//#include "stats_common.pb-c.h" - -#include "proto_agent_defs.h" -//#include "ENB_APP/enb_config.h" -#include "UTIL/MEM/mem_block.h" - -//#include "LAYER2/MAC/extern.h" -//#include "LAYER2/RLC/rlc.h" - -# include "tree.h" -# include "intertask_interface.h" - -#define FLEXSPLIT_VERSION 0 - -typedef int (*proto_agent_message_decoded_callback)( - mod_id_t mod_id, - const void *params, - Protocol__FlexsplitMessage **msg -); - -typedef int (*proto_agent_message_destruction_callback)( - Protocol__FlexsplitMessage *msg -); - - - -/********************************** - * progRAN protocol messages helper - * functions and generic handlers - **********************************/ - -int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, uint8_t **buf, int *size); -int proto_agent_deserialize_message(void *data, int size, Protocol__FlexsplitMessage **msg); - -uint8_t *proto_agent_pack_message(Protocol__FlexsplitMessage *msg, int *size); - -err_code_t proto_agent_destroy_flexsplit_message(Protocol__FlexsplitMessage *msg); - -int fsp_create_header(xid_t xid, Protocol__FspType type, Protocol__FspHeader **header); - -int proto_agent_hello(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_hello(Protocol__FlexsplitMessage *msg); -int proto_agent_echo_request(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_echo_request(Protocol__FlexsplitMessage *msg); -int proto_agent_echo_reply(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg); - -int proto_agent_pdcp_data_req(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg); -int proto_agent_pdcp_data_ind(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); -int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg); -int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); - -int just_print(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); - - -int proto_agent_get_ack_result(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg); - - -Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id, - uint8_t *data, - int size); - -Protocol__FlexsplitMessage *proto_agent_handle_timed_task(void *args); - -typedef struct _data_req_args data_req_args; -typedef struct _dl_data_args dl_data_args; - -struct _data_req_args{ - const protocol_ctxt_t* ctxt; - srb_flag_t srb_flag; - MBMS_flag_t MBMS_flag; - rb_id_t rb_id; - mui_t mui; - confirm_t confirm; - sdu_size_t sdu_size; - mem_block_t *sdu_p; -}; - -struct _dl_data_args{ - uint8_t pdu_type; - uint32_t sn; - frame_t frame; - sub_frame_t subframe; - rnti_t rnti; - sdu_size_t sdu_size; - mem_block_t *sdu_p; -}; - - -#endif - - - - - - - diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h deleted file mode 100644 index cd730a6de8..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h +++ /dev/null @@ -1,118 +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 enb_agent_defs.h - * \brief enb agent common definitions - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ -#ifndef PROTO_AGENT_DEFS_H_ -#define PROTO_AGENT_DEFS_H_ - -#include -#include -#include -#include - -#include "openairinterface5g_limits.h" -#include "UTIL/ASYNC_IF/link_manager.h" - -#define DEFAULT_PROTO_AGENT_IPv4_ADDRESS "127.0.0.1" -#define DEFAULT_PROTO_AGENT_PORT 2210 -#define DEFAULT_PROTO_AGENT_CACHE "/mnt/oai_agent_cache" - -typedef enum { - - PROTO_AGENT_DEFAULT=0, - - ENB_AGENT_PHY=1, - ENB_AGENT_MAC=2, - ENB_AGENT_RLC=3, - ENB_AGENT_PDCP=4, - ENB_AGENT_RRC=5, - ENB_AGENT_S1AP=6, - ENB_AGENT_GTP=7, - ENB_AGENT_X2AP=8, - - ENB_AGENT_MAX=9, - -} proto_agent_id_t; - -/* -typedef enum { - ENB_AGENT_ACTION_NONE = 0x0, - - ENB_AGENT_ACTION_SEND = 0x1, - - ENB_AGENT_ACTION_APPLY = 0x2, - - ENB_AGENT_ACTION_CLEAR = 0x4, - - ENB_AGENT_ACTION_WRITE = 0x8, - - ENB_AGENT_ACTION_FILTER = 0x10, - - ENB_AGENT_ACTION_PREPROCESS = 0x20, - - ENB_AGENT_ACTION_METER = 0x40, - - ENB_AGENT_ACTION_MAX = 0x7f, -} agent_action_t; -*/ -/* -typedef enum { - - RAN_LTE_OAI= 0, - - RAN_NAME_MAX = 0x7f, -} ran_name_t; -*/ -typedef uint8_t xid_t; -typedef uint8_t mod_id_t; // module or enb id -typedef uint8_t lcid_t; -typedef int32_t err_code_t; - -typedef struct { - /* general info */ - - /* stats */ - - uint32_t total_rx_msg; - uint32_t total_tx_msg; - - uint32_t rx_msg[NUMBER_OF_eNB_MAX]; - uint32_t tx_msg[NUMBER_OF_eNB_MAX]; - -} proto_agent_info_t; - -/* forward declaration */ -struct proto_agent_channel_s; - -typedef struct proto_agent_instance_s { - mod_id_t mod_id; - proto_agent_info_t agent_info; - struct proto_agent_channel_s *channel; - pthread_t recv_thread; - uint8_t exit; -} proto_agent_instance_t; - -#endif diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c deleted file mode 100644 index 82f7849717..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c +++ /dev/null @@ -1,138 +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 enb_agent_handler.c - * \brief enb agent tx and rx message handler - * \author Navid Nikaein and Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - - -#include "proto_agent_common.h" -#include "common/utils/LOG/log.h" -#include "assertions.h" - -proto_agent_message_decoded_callback proto_agent_messages_callback[][3] = { - {proto_agent_hello, 0, 0}, /* agent hello */ - {proto_agent_echo_reply, 0, 0}, /* echo */ - {0, just_print, 0}, /* just print */ - {proto_agent_pdcp_data_req_process, proto_agent_pdcp_data_req_process, 0}, /* PDCP data REQ */ - {0, proto_agent_get_ack_result, 0}, /* get ACK result */ - {proto_agent_pdcp_data_ind_process, proto_agent_pdcp_data_ind_process, 0}, /* PDCP data IND */ - {0, just_print, 0}, /* just print */ -}; - -proto_agent_message_destruction_callback proto_message_destruction_callback[] = { - proto_agent_destroy_hello, - proto_agent_destroy_echo_request, - proto_agent_destroy_echo_reply, - proto_agent_destroy_pdcp_data_req, - 0, - proto_agent_destroy_pdcp_data_ind, - 0, -}; - -//static const char *proto_agent_direction2String[] = { -// "", /* not_set */ -// "originating message", /* originating message */ -// "successfull outcome", /* successfull outcome */ -// "unsuccessfull outcome", /* unsuccessfull outcome */ -//}; - - -Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id, - uint8_t *data, - int size){ - - Protocol__FlexsplitMessage *decoded_message = NULL; - Protocol__FlexsplitMessage *reply_message = NULL; - err_code_t err_code; - DevAssert(data != NULL); - - LOG_D(PROTO_AGENT, "Deserializing message with size %u \n", size); - if (proto_agent_deserialize_message(data, (int) size, &decoded_message) < 0) { - err_code= PROTOCOL__FLEXSPLIT_ERR__MSG_DECODING; - goto error; - } - /* after deserialization, we don't need the original data memory anymore */ - free(data); - Protocol__FspHeader *header = (Protocol__FspHeader*) decoded_message; - if (header->has_type) - { - LOG_D(PROTO_AGENT, "Deserialized MSG type is %d and %u\n", decoded_message->msg_case, decoded_message->msg_dir); - } - - if ((decoded_message->msg_case > sizeof(proto_agent_messages_callback) / (3*sizeof(proto_agent_message_decoded_callback))) || - (decoded_message->msg_dir > PROTOCOL__FLEXSPLIT_DIRECTION__UNSUCCESSFUL_OUTCOME)) - { - err_code= PROTOCOL__FLEXSPLIT_ERR__MSG_NOT_HANDLED; - LOG_D(PROTO_AGENT,"Handling message: MSG NOT handled, going to error\n"); - goto error; - } - - - err_code = ((*proto_agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1])(mod_id, (void *) decoded_message, &reply_message)); - - if ( err_code < 0 ) - { - LOG_I(PROTO_AGENT, "decoded_message case : %d, direction : %d \n", decoded_message->msg_case-1, decoded_message->msg_dir-1); - goto error; - } - - protocol__flexsplit_message__free_unpacked(decoded_message, NULL); - LOG_D(PROTO_AGENT,"Returning REPLY message after the callback\n"); - return reply_message; - - error: - LOG_E(PROTO_AGENT,"errno %d occured\n",err_code); - return NULL; -} - - - -uint8_t *proto_agent_pack_message(Protocol__FlexsplitMessage *msg, int *size) -{ - uint8_t *buffer; - err_code_t err_code = PROTOCOL__FLEXSPLIT_ERR__NO_ERR; - - if (proto_agent_serialize_message(msg, &buffer, size) < 0 ) { - err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENCODING; - goto error; - } - - if (proto_message_destruction_callback[msg->msg_case-1]) - err_code = ((*proto_message_destruction_callback[msg->msg_case-1])(msg)); - - DevAssert(buffer !=NULL); - - LOG_D(PROTO_AGENT,"Serialized the enb mac stats reply (size %d)\n", *size); - return buffer; - - error : - LOG_E(PROTO_AGENT,"errno %d occured\n",err_code); - - return NULL; -} - -err_code_t proto_agent_destroy_flexsplit_message(Protocol__FlexsplitMessage *msg) { - return ((*proto_message_destruction_callback[msg->msg_case-1])(msg)); -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c deleted file mode 100644 index 925c11c8f8..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c +++ /dev/null @@ -1,152 +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 enb_agent_net_comm.c - * \brief enb agent network interface abstraction - * \author Xenofon Foukas - * \date 2016 - * \version 0.1 - */ - -#include "proto_agent_net_comm.h" -#include "common/utils/LOG/log.h" - -proto_agent_channel_t *proto_channel[NUMBER_OF_eNB_MAX][ENB_AGENT_MAX]; -static proto_agent_channel_instance_t channel_instance; -int proto_agent_channel_id = 0; - -int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id) { - int i; - - if (channel == NULL) { - return -1; - } - - if (agent_id == ENB_AGENT_MAX) { - for (i = 0; i < ENB_AGENT_MAX; i++) { - proto_channel[mod_id][i] = channel; - } - } else { - proto_channel[mod_id][agent_id] = channel; - } - return 0; -} - -void proto_agent_unregister_channel(mod_id_t mod_id, proto_agent_id_t agent_id) { - int i; - - if (agent_id == ENB_AGENT_MAX) { - for (i = 0; i < ENB_AGENT_MAX; i++) { - proto_channel[mod_id][i] = NULL; - } - } else { - proto_channel[mod_id][agent_id] = NULL; - } -} - -int proto_agent_create_channel(void *channel_info, - int (*msg_send)(void *data, int size, int priority, void *channel_info), - int (*msg_recv)(void **data, int *priority, void *channel_info), - void (*release)(proto_agent_channel_t *channel)) { - - int channel_id = ++proto_agent_channel_id; - proto_agent_channel_t *channel = (proto_agent_channel_t *) malloc(sizeof(proto_agent_channel_t)); - channel->channel_id = channel_id; - channel->channel_info = channel_info; - channel->msg_send = msg_send; - channel->msg_recv = msg_recv; - channel->release = release; - - /*element should be a real pointer*/ - RB_INSERT(proto_agent_channel_map, &channel_instance.proto_agent_head, channel); - - LOG_D(PROTO_AGENT, "Created a new channel with id 0x%x\n", channel->channel_id); - - return channel_id; -} - -int proto_agent_destroy_channel(int channel_id) { - int i, j; - - /*Check to see if channel exists*/ - struct proto_agent_channel_s *e = NULL; - struct proto_agent_channel_s search; - memset(&search, 0, sizeof(struct proto_agent_channel_s)); - - e = RB_FIND(proto_agent_channel_map, &channel_instance.proto_agent_head, &search); - - if (e == NULL) { - return -1; - } - - /*Unregister the channel from all agents*/ - for (i = 0; i < NUMBER_OF_eNB_MAX; i++) { - for (j = 0; j < ENB_AGENT_MAX; j++) { - if (proto_channel[i][j] != NULL) { - if (proto_channel[i][j]->channel_id == e->channel_id) { - proto_channel[i][j] = NULL; - } - } - } - } - - /*Remove the channel from the tree and free memory*/ - RB_REMOVE(proto_agent_channel_map, &channel_instance.proto_agent_head, e); - e->release(e); - free(e); - - return 0; -} - -err_code_t proto_agent_init_channel_container(void) { - int i, j; - LOG_D(PROTO_AGENT, "init RB tree for channel container\n"); - - RB_INIT(&channel_instance.proto_agent_head); - - for (i = 0; i < NUMBER_OF_eNB_MAX; i++) { - for (j = 0; j < ENB_AGENT_MAX; j++) { - proto_channel[i][j] = NULL; - } - } - - return 0; -} - -RB_GENERATE(proto_agent_channel_map,proto_agent_channel_s, entry, proto_agent_compare_channel); - -int proto_agent_compare_channel(struct proto_agent_channel_s *a, struct proto_agent_channel_s *b) { - if (a->channel_id < b->channel_id) return -1; - if (a->channel_id > b->channel_id) return 1; - - // equal timers - return 0; -} - -proto_agent_channel_t * proto_agent_get_channel(int channel_id) { - - struct proto_agent_channel_s search; - memset(&search, 0, sizeof(struct proto_agent_channel_s)); - search.channel_id = channel_id; - - return RB_FIND(proto_agent_channel_map, &channel_instance.proto_agent_head, &search); - -} diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h deleted file mode 100644 index 55fca5a928..0000000000 --- a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h +++ /dev/null @@ -1,82 +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 enb_agent_net_comm.h - * \brief enb agent network interface abstraction - * \autho Xenofon Foukas - * \date 2016 - * \version 0.1 - */ -#ifndef PROTO_AGENT_NET_COMM_H_ -#define PROTO_AGENT_NET_COMM_H_ - -#include "proto_agent_defs.h" - -#include "tree.h" -#define ENB_AGENT_MAX 9 - -/* forward declaration */ -struct proto_agent_async_channel_s; - -/*Channel related information used for Tx/Rx of protocol messages*/ -typedef struct proto_agent_channel_s { - RB_ENTRY(proto_agent_channel_s) entry; - int channel_id; - struct proto_agent_async_channel_s *channel_info; - /*Callbacks for channel message Tx and Rx*/ - int (*msg_send)(void *data, int size, int priority, void *channel_info); - int (*msg_recv)(void **data, int *priority, void *channel_info); - void (*release)(struct proto_agent_channel_s *channel); -} proto_agent_channel_t; - -typedef struct proto_agent_channel_instance_s{ - RB_HEAD(proto_agent_channel_map, proto_agent_channel_s) proto_agent_head; -} proto_agent_channel_instance_t; - - -/*Register a channel to an agent. Use ENB_AGENT_MAX to register the - *same channel to all agents*/ -int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id); - -/*Unregister the current channel of an agent. Use ENB_AGENT_MAX to unregister all channels*/ -void proto_agent_unregister_channel(mod_id_t mod_id, proto_agent_id_t agent_id); - -/*Create a new channel. Returns the id of the new channel or negative number otherwise*/ -int proto_agent_create_channel(void *channel_info, - int (*msg_send)(void *data, int size, int priority, void *channel_info), - int (*msg_recv)(void **data, int *priority, void *channel_info), - void (*release)(proto_agent_channel_t *channel)); - -/*Unregister a channel from all agents and destroy it. Returns 0 in case of success*/ -int proto_agent_destroy_channel(int channel_id); - -/*Return an agent communication channel based on its id*/ -proto_agent_channel_t * proto_agent_get_channel(int channel_id); - -/*Should be called before performing any channel operations*/ -err_code_t proto_agent_init_channel_container(void); - -int proto_agent_compare_channel(struct proto_agent_channel_s *a, struct proto_agent_channel_s *b); - -/* RB_PROTOTYPE is for .h files */ -RB_PROTOTYPE(proto_agent_channel_map, proto_agent_channel_s, entry, proto_agent_compare_channel); - -#endif /*ENB_AGENT_COMM_H_*/ diff --git a/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h b/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h deleted file mode 100644 index 75ccc9fcdd..0000000000 --- a/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h +++ /dev/null @@ -1,16 +0,0 @@ - -#ifndef __PROTO_AGENT_RLC_PRIMITIVES_H__ -#define __PROTO_AGENT_RLC_PRIMITIVES_H__ - -#include "RRC/LTE/rrc_defs.h" -#include "LAYER2/PROTO_AGENT/proto_agent.h" -// PROTO AGENT -pthread_t async_server_thread; -int async_server_thread_finalize (void); -void async_server_thread_init (void); - -pthread_mutex_t async_server_lock; -pthread_cond_t async_server_notify; -int async_server_shutdown; - -#endif diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index dcf2694d1a..baae1fa436 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -40,8 +40,6 @@ #include "openair2/F1AP/f1ap_du_rrc_message_transfer.h" -#include "openair2/LAYER2/PROTO_AGENT/proto_agent.h" - extern RAN_CONTEXT_t RC; #include diff --git a/openair2/MCE_APP/mce_config.c b/openair2/MCE_APP/mce_config.c index 439f2d2061..9d9d9028e5 100644 --- a/openair2/MCE_APP/mce_config.c +++ b/openair2/MCE_APP/mce_config.c @@ -54,8 +54,6 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" -#include "proto_agent.h" - #include "m3ap_MCE.h" diff --git a/openair3/MME_APP/mme_config.c b/openair3/MME_APP/mme_config.c index 3b4074f553..8005b85fd4 100644 --- a/openair3/MME_APP/mme_config.c +++ b/openair3/MME_APP/mme_config.c @@ -54,7 +54,6 @@ #include "common/config/config_userapi.h" #include "RRC_config_tools.h" #include "enb_paramdef.h" -#include "proto_agent.h" int RCconfig_MME(void ) { //int num_enbs = 0; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 85e493f194..91b652e630 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -499,8 +499,6 @@ static void init_pdcp(void) { pdcp_set_rlc_data_req_func(rlc_data_req); pdcp_set_pdcp_data_ind_func(pdcp_data_ind); } - } else { - pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind); } } diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index cf35a13fe9..278054861e 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -30,7 +30,6 @@ #include "flexran_agent.h" #include "s1ap_eNB.h" #include "SIMULATION/ETH_TRANSPORT/proto.h" -#include "proto_agent.h" #include "executables/softmodem-common.h" From 467172f44d141385520c926a24c580c8529f7a31 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 27 Jan 2022 11:59:55 +0100 Subject: [PATCH 318/883] removing pusch 2nd codeword also at gnb --- executables/nr-gnb.c | 13 ++++++------- openair1/PHY/INIT/nr_init.c | 14 ++++---------- openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_transport_proto.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_ulsch.c | 13 ++++++------- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 6 +++--- openair1/PHY/defs_gNB.h | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 12 ++++++------ openair1/SIMULATION/NR_PHY/ulschsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 8 ++++---- 11 files changed, 34 insertions(+), 42 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 9551a71921..ba488d5170 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -177,15 +177,14 @@ void rx_func(void *param) { void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch); int j; for (j = 0; j < NUMBER_OF_NR_ULSCH_MAX; j++) - if (gNB->ulsch[j][0]->rnti == rnti_to_remove[i]) { - gNB->ulsch[j][0]->rnti = 0; - gNB->ulsch[j][0]->harq_mask = 0; - //clean_gNB_ulsch(gNB->ulsch[j][0]); + if (gNB->ulsch[j]->rnti == rnti_to_remove[i]) { + gNB->ulsch[j]->rnti = 0; + gNB->ulsch[j]->harq_mask = 0; int h; for (h = 0; h < NR_MAX_ULSCH_HARQ_PROCESSES; h++) { - gNB->ulsch[j][0]->harq_processes[h]->status = SCH_IDLE; - gNB->ulsch[j][0]->harq_processes[h]->round = 0; - gNB->ulsch[j][0]->harq_processes[h]->handled = 0; + gNB->ulsch[j]->harq_processes[h]->status = SCH_IDLE; + gNB->ulsch[j]->harq_processes[h]->round = 0; + gNB->ulsch[j]->harq_processes[h]->handled = 0; } up_removed++; } diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 9e1e472fd6..aa09f84028 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -550,21 +550,15 @@ void init_nr_transport(PHY_VARS_gNB *gNB) { LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max); - for (int j=0; j<2; j++) { - // ULSCH for data - gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL, 0); - - if (!gNB->ulsch[i][j]) { - LOG_E(PHY,"Can't get gNB ulsch structures\n"); - exit(-1); - } + gNB->ulsch[i] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL, 0); + if (!gNB->ulsch[i]) { + LOG_E(PHY,"Can't get gNB ulsch structures\n"); + exit(-1); } - } gNB->rx_total_gain_dB=130; - //fp->pucch_config_common.deltaPUCCH_Shift = 1; } diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c index cfb5a2e56e..f4761489f5 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c +++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c @@ -184,7 +184,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq PHY_MEASUREMENTS_gNB *meas = &gNB->measurements; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; int ch_offset = fp->ofdm_symbol_size * symbol; - int N_RB_UL = gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu.rb_size; + int N_RB_UL = gNB->ulsch[ulsch_id]->harq_processes[harq_pid]->ulsch_pdu.rb_size; rx_power_tot[ulsch_id] = 0; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 4fed3a468f..d9cc2be07c 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -147,7 +147,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext, NR_DL_FRAME_PARMS *frame_parms, - NR_gNB_ULSCH_t **ulsch_gNB, + NR_gNB_ULSCH_t *ulsch_gNB, uint8_t symbol, uint8_t start_symbol, uint16_t nb_rb, diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c index 4278338dbc..c7c7fdd2d4 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c @@ -43,15 +43,14 @@ int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) { AssertFatal(gNB!=NULL,"gNB is null\n"); for (i=0; inumber_of_nr_ulsch_max; i++) { AssertFatal(gNB->ulsch[i]!=NULL,"gNB->ulsch[%d] is null\n",i); - AssertFatal(gNB->ulsch[i][0]!=NULL,"gNB->ulsch[%d][0] is null\n",i); - LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i][0]->harq_mask,gNB->ulsch[i][0]->rnti,first_free_index); - if ((gNB->ulsch[i][0]->harq_mask >0) && - (gNB->ulsch[i][0]->rnti==rnti)) return i; - else if ((gNB->ulsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i; + LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i]->harq_mask,gNB->ulsch[i]->rnti,first_free_index); + if ((gNB->ulsch[i]->harq_mask >0) && + (gNB->ulsch[i]->rnti==rnti)) return i; + else if ((gNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i; } if (type == SEARCH_EXIST) return -1; if (first_free_index != -1) - gNB->ulsch[first_free_index][0]->rnti = 0; + gNB->ulsch[first_free_index]->rnti = 0; return first_free_index; } @@ -65,7 +64,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, AssertFatal( (ulsch_id>=0) && (ulsch_idnumber_of_nr_ulsch_max), "illegal or no ulsch_id found!!! rnti %04x ulsch_id %d\n",ulsch_pdu->rnti,ulsch_id); - NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id][0]; + NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id]; int harq_pid = ulsch_pdu->pusch_data.harq_process_id; ulsch->rnti = ulsch_pdu->rnti; //ulsch->rnti_type; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 5286fe8780..08592daccc 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -428,7 +428,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, #endif - NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[ULSCH_id][0]; + NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[ULSCH_id]; NR_gNB_PUSCH *pusch = phy_vars_gNB->pusch_vars[ULSCH_id]; NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 681a9eae16..03cee5afa1 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -403,7 +403,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, void nr_ulsch_scale_channel(int **ul_ch_estimates_ext, NR_DL_FRAME_PARMS *frame_parms, - NR_gNB_ULSCH_t **ulsch_gNB, + NR_gNB_ULSCH_t *ulsch_gNB, uint8_t symbol, uint8_t is_dmrs_symbol, unsigned short nb_rb, @@ -418,7 +418,7 @@ void nr_ulsch_scale_channel(int **ul_ch_estimates_ext, // Determine scaling amplitude based the symbol - ch_amp = 1024*8; //((pilots) ? (ulsch_gNB[0]->sqrt_rho_b) : (ulsch_gNB[0]->sqrt_rho_a)); + ch_amp = 1024*8; //((pilots) ? (ulsch_gNB->sqrt_rho_b) : (ulsch_gNB->sqrt_rho_a)); LOG_D(PHY,"Scaling PUSCH Chest in OFDM symbol %d by %d, pilots %d nb_rb %d NCP %d symbol %d\n", symbol, ch_amp, is_dmrs_symbol, nb_rb, frame_parms->Ncp, symbol); // printf("Scaling PUSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp); @@ -1177,7 +1177,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, int avgs = 0; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; - nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu; + nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id]->harq_processes[harq_pid]->ulsch_pdu; int avg[frame_parms->nb_antennas_rx*rel15_ul->nrOfLayers]; gNB->pusch_vars[ulsch_id]->dmrs_symbol = INVALID_VALUE; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index edcac7a91d..68e8bf0fd2 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -761,7 +761,7 @@ typedef struct PHY_VARS_gNB_s { NR_gNB_PDCCH_t pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX]; NR_gNB_UL_PDCCH_t ul_pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX]; NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2]; // Nusers times two spatial streams - NR_gNB_ULSCH_t *ulsch[NUMBER_OF_NR_ULSCH_MAX][2]; // [Nusers times][2 codewords] + NR_gNB_ULSCH_t *ulsch[NUMBER_OF_NR_ULSCH_MAX]; // [Nusers times] NR_gNB_DLSCH_t *dlsch_SI,*dlsch_ra,*dlsch_p; NR_gNB_DLSCH_t *dlsch_PCH; /// statistics for DLSCH measurement collection diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c86f5bd682..581ab626cd 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -225,7 +225,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq; NR_gNB_ULSCH_t *ulsch = rdata->ulsch; int r = rdata->segment_r; - nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[rdata->ulsch_id][0]->harq_processes[rdata->harq_pid]->ulsch_pdu; + nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[rdata->ulsch_id]->harq_processes[rdata->harq_pid]->ulsch_pdu; bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter); ulsch_harq->processedSegments++; @@ -330,7 +330,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH_id, uint8_t harq_pid) { NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; - nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->ulsch_pdu; + nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->ulsch_pdu; uint8_t l, number_dmrs_symbols = 0; uint32_t G; @@ -407,13 +407,13 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, pthread_mutex_lock(&gNB->UL_INFO_mutex); - NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0]; + NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id]; NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch); nfapi_nr_pusch_pdu_t *pusch_pdu = &harq_process->ulsch_pdu; - // pdu->data = gNB->ulsch[ULSCH_id+1][0]->harq_processes[harq_pid]->b; + // pdu->data = gNB->ulsch[ULSCH_id+1]->harq_processes[harq_pid]->b; int sync_pos = nr_est_timing_advance_pusch(gNB, ULSCH_id); // estimate timing advance for MAC // scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size @@ -576,7 +576,7 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } for (int ULSCH_id=0;ULSCH_idnumber_of_nr_ulsch_max;ULSCH_id++) { - NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0]; + NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id]; int harq_pid; NR_UL_gNB_HARQ_t *ulsch_harq; if ((ulsch) && @@ -722,7 +722,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { } for (int ULSCH_id=0;ULSCH_idnumber_of_nr_ulsch_max;ULSCH_id++) { - NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0]; + NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id]; int harq_pid; int no_sig; NR_UL_gNB_HARQ_t *ulsch_harq; diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 007fd18ac6..aaf37c9fd1 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -426,7 +426,7 @@ int main(int argc, char **argv) uint8_t rvidx = 0; uint8_t UE_id = 0; - NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id][0]; + NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id]; NR_UL_gNB_HARQ_t *harq_process_gNB = ulsch_gNB->harq_processes[harq_pid]; nfapi_nr_pusch_pdu_t *rel15_ul = &harq_process_gNB->ulsch_pdu; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 329415a87c..3028db21e4 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -805,7 +805,7 @@ int main(int argc, char **argv) unsigned char harq_pid = 0; - NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id][0]; + NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id]; //nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &ulsch_gNB->harq_processes[harq_pid]->ulsch_pdu; nfapi_nr_ul_tti_request_t *UL_tti_req = malloc(sizeof(*UL_tti_req)); NR_Sched_Rsp_t *Sched_INFO = malloc(sizeof(*Sched_INFO)); @@ -1046,7 +1046,7 @@ int main(int argc, char **argv) while (roundharq_processes[harq_pid]->round = round; - gNB->ulsch[0][0]->harq_processes[harq_pid]->round = round; + gNB->ulsch[0]->harq_processes[harq_pid]->round = round; rv_index = nr_rv_round_map[round]; UE_proc.thread_id = 0; @@ -1362,8 +1362,8 @@ int main(int argc, char **argv) } //////////////////////////////////////////////////////////// - if ((gNB->ulsch[0][0]->last_iteration_cnt >= - gNB->ulsch[0][0]->max_ldpc_iterations+1) || ul_proc_error == 1) { + if ((gNB->ulsch[0]->last_iteration_cnt >= + gNB->ulsch[0]->max_ldpc_iterations+1) || ul_proc_error == 1) { error_flag = 1; n_errors[round][snrRun]++; crc_status = 1; From aec56c9a860c177b37ccdff94fdd593c0897b4ca Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 27 Jan 2022 12:22:03 +0100 Subject: [PATCH 319/883] additional review comments --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c447708125..30e1d2cc3d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -408,7 +408,7 @@ void nr_preprocessor_phytest(module_id_t module_id, /* mark the corresponding RBs as used */ for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - vrb_map[rb + sched_pdsch->rbStart + BWPStart] = ((1<nrOfSymbols)-1)<startSymbolIndex; + vrb_map[rb + sched_pdsch->rbStart + BWPStart] = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); if ((frame&127) == 0) LOG_D(MAC,"phytest: %d.%d DL mcs %d, DL rbStart %d, DL rbSize %d\n", frame, slot, sched_pdsch->mcs, rbStart,rbSize); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 89e8d344ed..8f1bc986fe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -376,14 +376,7 @@ void fill_pdcch_vrb_map(gNB_MAC_INST *mac, for (int j=first_cce; jBWPStart + f*B_rb + rb] |= SL_to_bitmap(pdcch->StartSymbolIndex, N_symb); } From 2cad62ad54260fc7870c76ec4a7a4c53bc967ca5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 27 Jan 2022 14:36:44 +0100 Subject: [PATCH 320/883] fix for 256qam in initialDownlinkBWP --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 21 +++++++++++++++------ openair2/RRC/NR/nr_rrc_config.c | 15 ++++++++------- openair2/RRC/NR/nr_rrc_config.h | 4 +++- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 3fcd4a2d42..116f1e1ba2 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1401,12 +1401,21 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, rrc_gNB_carrier_data_t *carrier, NR_UE_NR_Capability_t *uecap) { - NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig; - struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; - for (int i=0; ilist.count; i++){ - NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i]; - set_dl_mcs_table(bwp, carrier->servingcellconfigcommon, uecap); - } + NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig; + NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon; + + NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP; + set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing, + uecap, bwp_Dedicated, scc); + + struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; + if (DL_BWP_list) { + for (int i=0; ilist.count; i++){ + NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i]; + int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing; + set_dl_mcs_table(scs, uecap, bwp->bwp_Dedicated, carrier->servingcellconfigcommon); + } + } } void fill_initial_cellGroupConfig(rnti_t rnti, diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index e3d7a6430c..06aa32cb44 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -149,15 +149,16 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ } -void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, NR_UE_NR_Capability_t *cap) { +void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap, + NR_BWP_DownlinkDedicated_t *bwp_Dedicated, + NR_ServingCellConfigCommon_t *scc) { if (cap == NULL){ - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; + bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; return; } int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; - int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing; struct NR_FrequencyInfoDL__scs_SpecificCarrierList scs_list = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList; int bw_rb = -1; for(int i=0; ibwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == NULL) - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table)); - *bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; + if(bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == NULL) + bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table)); + *bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; } else - bwp->bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; + bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; } diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index e8a2ab4518..1a0d091e35 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -113,7 +113,9 @@ typedef struct physicalcellgroup_s{ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); -void set_dl_mcs_table(NR_BWP_Downlink_t *bwp, NR_ServingCellConfigCommon_t *scc, NR_UE_NR_Capability_t *cap); +void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap, + NR_BWP_DownlinkDedicated_t *bwp_Dedicated, + NR_ServingCellConfigCommon_t *scc); void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, NR_ServingCellConfigCommon_t *scc, int numerology, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 3b013ac88b..df29995be0 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -594,7 +594,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - set_dl_mcs_table(bwp, servingcellconfigcommon, uecap); + set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, uecap, bwp->bwp_Dedicated, servingcellconfigcommon); bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; From c77a4eb7671e09b73f03e91ec4c49016efb0d120 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 26 Jan 2022 17:23:10 +0100 Subject: [PATCH 321/883] create aws clean function to get rid of closed MR results --- ci-scripts/ran_dashboard/Hdashboard.py | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ci-scripts/ran_dashboard/Hdashboard.py b/ci-scripts/ran_dashboard/Hdashboard.py index 864e31fc1f..1b65c7af4f 100644 --- a/ci-scripts/ran_dashboard/Hdashboard.py +++ b/ci-scripts/ran_dashboard/Hdashboard.py @@ -544,6 +544,30 @@ class Dashboard: }) editable_mr.save() + def AWSCleanup(self,mode): + #first build MR list from aws S3 bucket + if mode != 'report' and mode !='delete': + print("incorrect mode for awsclean") + return + aws_mr_list=[] + s3 = boto3.resource('s3') + my_bucket = s3.Bucket('oaitestdashboard') + for my_bucket_object in my_bucket.objects.all(): + #MR objects are like MR1407/index.html + res=re.search(r'^MR([0-9]+)',my_bucket_object.key) + if res!=None: + aws_mr_list.append(res.group(1))#store MR number as a string + #open MR list from GIt already exists as an attribute of this class self.mr_list + #parse aws MR list and delete those MR that are no longer open + for aws_mr in aws_mr_list: + if aws_mr not in self.mr_list: + if mode=="report": + print(aws_mr+' can be deleted from AWS S3') + else : + awspath="MR"+aws_mr+"/" + print('deleting ' + aws_mr) + my_bucket.objects.filter(Prefix=awspath).delete() + @@ -579,6 +603,10 @@ def main(): htmlDash.PostGitNote(mr,commit, args) else: print("Not a Merge Request => this build is for testing/debug purpose, no report to git") + elif sys.argv[1]=="awsclean": + mode=sys.argv[2]#report or delete + htmlDash=Dashboard() + htmlDash.AWSCleanup(mode) else: print("Wrong argument at position 1") From a3123aae290cb4233eb9f4537b82292a878fe99d Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Sat, 8 Jan 2022 20:39:14 +0530 Subject: [PATCH 322/883] Removed global variables --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 39 +++++++++---------- openair1/PHY/NR_TRANSPORT/nr_dci.h | 4 +- openair1/PHY/NR_TRANSPORT/nr_dci_tools.c | 4 +- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 5 ++- openair1/PHY/NR_TRANSPORT/nr_pss.c | 4 +- openair1/PHY/NR_TRANSPORT/nr_sss.c | 4 +- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 9 ++--- openair1/PHY/defs_gNB.h | 4 -- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 ++--- 9 files changed, 37 insertions(+), 45 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index f26464fd70..523a86b99d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -66,12 +66,11 @@ void nr_pdcch_scrambling(uint32_t *in, } } -void nr_generate_dci(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { +void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1] __attribute__((aligned(16))); // 3 for the max coreset duration uint16_t cset_start_sc; @@ -84,7 +83,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int n_rb; // compute rb_offset and n_prb based on frequency allocation - nr_fill_cce_list(gNB,0,pdcch_pdu_rel15); + nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; + nr_fill_cce_list(cce_list,0,pdcch_pdu_rel15); get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset); cset_start_sc = frame_parms->first_carrier_offset + (pdcch_pdu_rel15->BWPStart + rb_offset) * NR_NB_SC_PER_RB; @@ -175,7 +175,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, int reg_list_order[NR_MAX_PDCCH_AGG_LEVEL] = {}; for (int p = 0; p < NR_MAX_PDCCH_AGG_LEVEL; p++) { for(int p2 = 0; p2 < dci_pdu->AggregationLevel; p2++) { - if(gNB->cce_list[d][p2].reg_list[0].reg_idx == p * NR_NB_REG_PER_CCE) { + if(cce_list[d][p2].reg_list[0].reg_idx == p * NR_NB_REG_PER_CCE) { reg_list_order[reg_list_index] = p2; reg_list_index++; break; @@ -191,7 +191,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) { - k = cset_start_sc + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx; + k = cset_start_sc + cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx; if (k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; @@ -200,9 +200,9 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, // dmrs index depends on reference point for k according to 38.211 7.4.1.3.2 if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG) - dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3; + dmrs_idx = (cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3; else - dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3; + dmrs_idx = (cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3; k_prime = 0; @@ -250,21 +250,20 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, } // for (int d=0;dnumDlDci;d++) } -void nr_generate_dci_top(PHY_VARS_gNB *gNB, - nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, - uint32_t **gold_pdcch_dmrs, - int32_t *txdataF, - int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { +void nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, + nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, + uint32_t **gold_pdcch_dmrs, + int32_t *txdataF, + int16_t amp, + NR_DL_FRAME_PARMS *frame_parms) { AssertFatal(pdcch_pdu!=NULL || ul_dci_pdu!=NULL,"At least one pointer has to be !NULL\n"); if (pdcch_pdu) { - nr_generate_dci(gNB,&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(&pdcch_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); } if (ul_dci_pdu) { - nr_generate_dci(gNB,&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(&ul_dci_pdu->pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index 07baaf2728..d763891f28 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -29,7 +29,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format, nfapi_nr_rnti_type_e rnti_type, uint16_t N_RB); -void nr_generate_dci_top(PHY_VARS_gNB *gNB, +void nr_generate_dci_top( nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, nfapi_nr_dl_tti_pdcch_pdu *ul_pdcch_pdu, uint32_t **gold_pdcch_dmrs, @@ -57,6 +57,6 @@ void nr_fill_ul_dci(PHY_VARS_gNB *gNB, int slot, nfapi_nr_ul_dci_request_pdus_t *pdcch_pdu); -void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *); +void nr_fill_cce_list(nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL], uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15); #endif //__PHY_NR_TRANSPORT_DCI__H diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c index 1675045443..8d5eb4a660 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c @@ -119,7 +119,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint16_t n_shift, uint8_t m) { */ -void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15) { +void nr_fill_cce_list(nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL], uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15) { nr_cce_t* cce; nr_reg_t* reg; @@ -156,7 +156,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r if (pdcch_pdu_rel15->dci_pdu[d].RNTI != 0xFFFF) LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex); for (uint8_t cce_idx=0; cce_idxcce_list[d][cce_idx]; + cce = &cce_list[d][cce_idx]; cce->cce_idx = pdcch_pdu_rel15->dci_pdu[d].CceIndex + cce_idx; LOG_D(PHY, "cce_idx %d\n", cce->cce_idx); diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index a4cec432de..bf5edccb1b 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -219,8 +219,7 @@ void nr_init_pbch_interleaver(uint8_t *interleaver) { *(interleaver+i) = *(nr_pbch_payload_interleaving_pattern+j_ssb++); } -int nr_generate_pbch(NR_gNB_PBCH *pbch, - nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, +int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, uint8_t *interleaver, int32_t *txdataF, int16_t amp, @@ -239,6 +238,8 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch, uint64_t a_reversed=0; LOG_D(PHY, "PBCH generation started\n"); ///Payload generation + NR_gNB_PBCH m_pbch; + NR_gNB_PBCH *pbch = &m_pbch; memset((void *)pbch, 0, sizeof(NR_gNB_PBCH)); pbch->pbch_a=0; uint8_t ssb_index = ssb_pdu->ssb_pdu_rel15.SsbBlockIndex; diff --git a/openair1/PHY/NR_TRANSPORT/nr_pss.c b/openair1/PHY/NR_TRANSPORT/nr_pss.c index 535ce99143..44f74f1230 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pss.c @@ -24,8 +24,7 @@ //#define NR_PSS_DEBUG -int nr_generate_pss( int16_t *d_pss, - int32_t *txdataF, +int nr_generate_pss( int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t* config, @@ -33,6 +32,7 @@ int nr_generate_pss( int16_t *d_pss, { int i,k,l,m; int16_t a; + int16_t d_pss[NR_PSS_LENGTH]; int16_t x[NR_PSS_LENGTH]; const int x_initial[7] = {0, 1, 1 , 0, 1, 1, 1}; diff --git a/openair1/PHY/NR_TRANSPORT/nr_sss.c b/openair1/PHY/NR_TRANSPORT/nr_sss.c index de92237f6c..12f89ba36f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sss.c @@ -23,8 +23,7 @@ //#define NR_SSS_DEBUG -int nr_generate_sss( int16_t *d_sss, - int32_t *txdataF, +int nr_generate_sss( int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t* config, @@ -34,6 +33,7 @@ int nr_generate_sss( int16_t *d_sss, int m0, m1; int Nid, Nid1, Nid2; //int16_t a; + int16_t d_sss[NR_SSS_LENGTH]; int16_t x0[NR_SSS_LENGTH], x1[NR_SSS_LENGTH]; const int x0_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; const int x1_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index 4fed3a468f..5cc246fd29 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -44,8 +44,7 @@ @param @returns 0 on success */ -int nr_generate_pss(int16_t *d_pss, - int32_t *txdataF, +int nr_generate_pss(int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t *config, @@ -57,8 +56,7 @@ int nr_generate_pss(int16_t *d_pss, @param @returns 0 on success */ -int nr_generate_sss(int16_t *d_sss, - int32_t *txdataF, +int nr_generate_sss(int32_t *txdataF, int16_t amp, uint8_t ssb_start_symbol, nfapi_nr_config_request_scf_t *config, @@ -83,8 +81,7 @@ int nr_generate_pbch_dmrs(uint32_t *gold_pbch_dmrs, @param @returns 0 on success */ -int nr_generate_pbch(NR_gNB_PBCH *pbch, - nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, +int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, uint8_t *interleaver, int32_t *txdataF, int16_t amp, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index edcac7a91d..e0a67f29e7 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -753,7 +753,6 @@ typedef struct PHY_VARS_gNB_s { // nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu; uint16_t num_pdsch_rnti[80]; NR_gNB_PBCH pbch; - nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; NR_gNB_COMMON common_vars; NR_gNB_PRACH prach_vars; NR_gNB_PUSCH *pusch_vars[NUMBER_OF_NR_ULSCH_MAX]; @@ -776,9 +775,6 @@ typedef struct PHY_VARS_gNB_s { // PUCCH0 Look-up table for cyclic-shifts NR_gNB_PUCCH0_LUT_t pucch0_lut; - /// NR synchronization sequences - int16_t d_pss[NR_PSS_LENGTH]; - int16_t d_sss[NR_SSS_LENGTH]; /// PBCH DMRS sequence uint32_t nr_gold_pbch_dmrs[2][64][NR_PBCH_DMRS_LENGTH_DWORD]; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c86f5bd682..4086a3227c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -91,8 +91,8 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol); - nr_generate_pss(gNB->d_pss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); - nr_generate_sss(gNB->d_sss, &txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); + nr_generate_sss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); if (cfg->carrier_config.num_tx_ant.value <= 4) nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); @@ -114,8 +114,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ gNB->common_vars.beam_id[0][slot*fp->symbols_per_slot+j] = cfg->ssb_table.ssb_beam_id_list[ssb_index].beam_id.value; } - nr_generate_pbch(&gNB->pbch, - &ssb_pdu, + nr_generate_pbch(&ssb_pdu, gNB->nr_pbch_interleaver, &txdataF[0][txdataF_offset], AMP, @@ -168,7 +167,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); - nr_generate_dci_top(gNB, + nr_generate_dci_top( num_dl_dci > 0 ? &msgTx->pdcch_pdu : NULL, num_ul_dci > 0 ? &msgTx->ul_pdcch_pdu.pdcch_pdu : NULL, gNB->nr_gold_pdcch_dmrs[slot], From f43a69c5dc0b60568d61ce1514a4c82e0b7bef89 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Wed, 12 Jan 2022 14:50:33 +0530 Subject: [PATCH 323/883] Removed reuse of txdataF buffer on 2 slot basis --- openair1/PHY/NR_TRANSPORT/nr_csi_rs.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 54 +++++++++++------------ openair1/SCHED_NR/nr_ru_procedures.c | 6 +-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c b/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c index ac0eac8a79..4f5baacc34 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c +++ b/openair1/PHY/NR_TRANSPORT/nr_csi_rs.c @@ -35,7 +35,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB, NR_DL_FRAME_PARMS frame_parms=gNB->frame_parms; int32_t **txdataF = gNB->common_vars.txdataF; - int txdataF_offset = (slot%2)*frame_parms.samples_per_slot_wCP; + int txdataF_offset = slot*frame_parms.samples_per_slot_wCP; uint32_t **gold_csi_rs = gNB->nr_gold_csi_rs[slot]; int16_t mod_csi[frame_parms.symbols_per_slot][NR_MAX_CSI_RS_LENGTH>>1] __attribute__((aligned(16)));; uint16_t b = csi_params.freq_domain; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 9bbc61d4b6..2e8813cbd2 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -276,7 +276,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if (start_sc >= frame_parms->ofdm_symbol_size) start_sc -= frame_parms->ofdm_symbol_size; - int txdataF_offset = (slot%2)*frame_parms->samples_per_slot_wCP; + int txdataF_offset = slot*frame_parms->samples_per_slot_wCP; #ifdef DEBUG_DLSCH_MAPPING printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", @@ -375,12 +375,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /* Map DMRS Symbol */ if ( (dmrs_symbol_map & (1 << l)) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n", - dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); #endif dmrs_idx++; k_prime++; @@ -388,8 +388,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, n+=(k_prime)?0:1; } else if(is_ptrs_re){ - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], @@ -399,19 +399,19 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } /* Map DATA Symbol */ else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (amp * tx_layers[ap][m<<1]) >> 15; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]); + m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); #endif m++; } /* mute RE */ else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; } if (++k >= frame_parms->ofdm_symbol_size) k -= frame_parms->ofdm_symbol_size; @@ -427,7 +427,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } // fix the alignment issues later, use 64-bit SIMD below instead of 128. if (0/*(frame_parms->N_RB_DL&1)==0*/) { - __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m128i *txl = (__m128i*)&tx_layers[ap][m<<1]; __m128i amp128=_mm_set1_epi16(amp); @@ -436,7 +436,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } //RE loop, first part m+=upper_limit; if (remaining_re > 0) { - txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)]; txl = (__m128i*)&tx_layers[ap][m<<1]; for (int i=0; i<(remaining_re>>2); i++) { txF[i] = _mm_mulhrs_epi16(amp128,txl[i]); @@ -444,7 +444,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } } else { - __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc+txdataF_offset)<<1)]; + __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)]; __m64 *txl = (__m64*)&tx_layers[ap][m<<1]; __m64 amp64=_mm_set1_pi16(amp); @@ -454,31 +454,31 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, #ifdef DEBUG_DLSCH_MAPPING if ((i&1) > 0) printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1 + (2*txdataF_offset)]); + m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1)], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1]); #endif /* handle this, mute RE */ /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; }*/ } //RE loop, first part m+=upper_limit; if (remaining_re > 0) { - txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+txdataF_offset)<<1)]; + txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)]; txl = (__m64*)&tx_layers[ap][m<<1]; for (int i=0; i<(remaining_re>>1); i++) { txF[i] = _mm_mulhrs_pi16(amp64,txl[i]); #ifdef DEBUG_DLSCH_MAPPING if ((i&1) > 0) printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", - m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + (2*txdataF_offset)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1 + (2*txdataF_offset)]); + m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) ], + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1]); #endif /* handle this, mute RE */ /*else { - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = 0; - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0; + txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0; }*/ } //RE loop, second part } // @@ -515,7 +515,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if (pmi == 0) {//unitary Precoding if(apnrOfLayers) memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], - (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + txdataF_offset+ k)], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], NR_NB_SC_PER_RB*sizeof(int32_t)); else memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], @@ -556,7 +556,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } for (int i=0; iofdm_symbol_size + k; - int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset+txdataF_offset); + int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset); ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0]; ((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1]; #ifdef DEBUG_DLSCH_MAPPING diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c index 3f4c2f71fb..4d3174007a 100644 --- a/openair1/SCHED_NR/nr_ru_procedures.c +++ b/openair1/SCHED_NR/nr_ru_procedures.c @@ -155,7 +155,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) { int aa = 0;//physical antenna number int ret = 0; int ofdm_mask_full = (1<<(ru->nb_tx*2))-1; - int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP); + int txdataF_offset = (tti_tx*fp->samples_per_slot_wCP); if (nr_slot_select(cfg,frame_tx,slot) == NR_UPLINK_SLOT) return; for (aa=0; aanb_tx; aa++) memset(ru->common.txdataF[aa],0,fp->samples_per_slot_wCP*sizeof(int32_t)); @@ -300,7 +300,7 @@ static void *nr_feptx_thread(void *param) { ofdm_mask_full = (1<<(ru->nb_tx*2))-1; if(ru->num_gNB != 0){ - txdataF_offset = ((slot%2)*fp->samples_per_slot_wCP); + txdataF_offset = (slot*fp->samples_per_slot_wCP); ////////////precoding//////////// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+feptx->index+1 , 1); @@ -464,7 +464,7 @@ void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx) { int32_t ***bw; int i=0; int slot_tx = tti_tx; - int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP); + int txdataF_offset = (tti_tx*fp->samples_per_slot_wCP); start_meas(&ru->precoding_stats); AssertFatal(ru->nb_log_antennas > 0,"ru->nb_log_antennas is 0!\n"); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 4086a3227c..4a916593c3 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -74,7 +74,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ int **txdataF = gNB->common_vars.txdataF; uint8_t ssb_index, n_hf; uint16_t ssb_start_symbol; - int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + int txdataF_offset = slot*fp->samples_per_slot_wCP; uint16_t slots_per_hf = (fp->slots_per_frame)>>1; if (slotframe_parms; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; int offset = gNB->CC_id; - int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + int txdataF_offset = slot*fp->samples_per_slot_wCP; if ((cfg->cell_config.frame_duplex_type.value == TDD) && (nr_slot_select(cfg,frame,slot) == NR_UPLINK_SLOT)) return; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 6a2aba5944..6dc770f0ed 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1104,7 +1104,7 @@ int main(int argc, char **argv) else phy_procedures_gNB_TX(msgDataTx,frame,slot,1); - int txdataF_offset = (slot%2) * frame_parms->samples_per_slot_wCP; + int txdataF_offset = slot * frame_parms->samples_per_slot_wCP; if (n_trials==1) { LOG_M("txsigF0.m","txsF0=", &gNB->common_vars.txdataF[0][txdataF_offset+2*frame_parms->ofdm_symbol_size],frame_parms->ofdm_symbol_size,1,1); From 52e478d6a3b3ddc7f91d31f935688ef144b10ded Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 15:24:44 +0100 Subject: [PATCH 324/883] Include rotation in phy_proc_tx meas --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c86f5bd682..be0acca1b7 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -195,8 +195,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, } } - if (do_meas==1) stop_meas(&msgTx->phy_proc_tx); - // if ((frame&127) == 0) dump_pdsch_stats(gNB); //apply the OFDM symbol rotation here @@ -207,6 +205,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); //pthread_mutex_unlock(&mutextest); + if (do_meas==1) stop_meas(&msgTx->phy_proc_tx); } From d9eb6ec5d6ae3df28dd16a12c1593b7dddeef269 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 15:35:04 +0100 Subject: [PATCH 325/883] Fix start of dlsch_rx_pdcch_stats measurement --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index b0ad4b4a83..fd65c66963 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -495,6 +495,8 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][gNB_id]; fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &pdcch_vars->pdcch_config[n_ss]; + start_meas(&ue->dlsch_rx_pdcch_stats); + /* // unsigned int dci_cnt=0, i; //removed for nr_ue_pdcch_procedures and added in the loop for nb_coreset_active #ifdef NR_PDCCH_SCHED_DEBUG @@ -649,7 +651,6 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_IN); - start_meas(&ue->dlsch_rx_pdcch_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN); #ifdef NR_PDCCH_SCHED_DEBUG From 92dbbd9f57c243aac9ebc4bb1161fc8687323fbd Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 15:36:08 +0100 Subject: [PATCH 326/883] Delete commented code in nr_ue_pdcch_procedures() --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 224 +------------------- 1 file changed, 4 insertions(+), 220 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index fd65c66963..0041a878a4 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -497,186 +497,6 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, start_meas(&ue->dlsch_rx_pdcch_stats); - /* - // unsigned int dci_cnt=0, i; //removed for nr_ue_pdcch_procedures and added in the loop for nb_coreset_active -#ifdef NR_PDCCH_SCHED_DEBUG - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_ue_pdcch_procedures() \n"); -#endif - - int frame_rx = proc->frame_rx; - int nr_slot_rx = proc->nr_slot_rx; - NR_DCI_ALLOC_t dci_alloc_rx[8]; - - //uint8_t next1_thread_id = proc->thread_id== (RX_NB_TH-1) ? 0:(proc->thread_id+1); - //uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1); - - - // table dci_fields_sizes_cnt contains dci_fields_sizes for each time a dci is decoded in the slot - // each element represents the size in bits for each dci field, for each decoded dci -> [dci_cnt-1] - // each time a dci is decode at dci_cnt, the values of the table dci_fields_sizes[i][j] will be copied at table dci_fields_sizes_cnt[dci_cnt-1][i][j] - // table dci_fields_sizes_cnt[dci_cnt-1][i][j] will then be used in function nr_extract_dci_info - uint8_t dci_fields_sizes_cnt[MAX_NR_DCI_DECODED_SLOT][NBR_NR_DCI_FIELDS][NBR_NR_FORMATS]; - - int nb_searchspace_active=0; - NR_UE_PDCCH **pdcch_vars = ue->pdcch_vars[proc->thread_id]; - NR_UE_PDCCH *pdcch_vars2 = ue->pdcch_vars[proc->thread_id][gNB_id]; - // s in TS 38.212 Subclause 10.1, for each active BWP the UE can deal with 10 different search spaces - // Higher layers have updated the number of searchSpaces with are active in the current slot and this value is stored in variable nb_searchspace_total - int nb_searchspace_total = pdcch_vars2->nb_search_space; - - pdcch_vars[gNB_id]->crnti = 0x1234; //to be check how to set when using loop memory - - uint16_t c_rnti=pdcch_vars[gNB_id]->crnti; - uint16_t cs_rnti=0,new_rnti=0,tc_rnti=0; - uint16_t p_rnti=P_RNTI; - uint16_t si_rnti=SI_RNTI; - uint16_t ra_rnti=99; - uint16_t sp_csi_rnti=0,sfi_rnti=0,int_rnti=0,tpc_pusch_rnti=0,tpc_pucch_rnti=0,tpc_srs_rnti=0; //FIXME - uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES] = - {c_rnti,cs_rnti,new_rnti,tc_rnti,p_rnti,si_rnti,ra_rnti,sp_csi_rnti,sfi_rnti,int_rnti,tpc_pusch_rnti,tpc_pucch_rnti,tpc_srs_rnti}; - #ifdef NR_PDCCH_SCHED_DEBUG - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> there is a bug in FAPI to calculate nb_searchspace_total=%d\n",nb_searchspace_total); - #endif - if (nb_searchspace_total>1) nb_searchspace_total=1; // to be removed when fixing bug in FAPI - #ifdef NR_PDCCH_SCHED_DEBUG - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> there is a bug in FAPI to calculate nb_searchspace_total so we set it to 1...\n"); - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> the number of searchSpaces active in the current slot(%d) is %d) \n", - nr_slot_rx,nb_searchspace_total); - #endif - - //FK: we define dci_ind and dl_indication as local variables, this way the call to the mac should be thread safe - fapi_nr_dci_indication_t dci_ind; - nr_downlink_indication_t dl_indication; - - // p in TS 38.212 Subclause 10.1, for each active BWP the UE can deal with 3 different CORESETs (including coresetId 0 for common search space) - //int nb_coreset_total = NR_NBR_CORESET_ACT_BWP; - unsigned int dci_cnt=0; - // this table contains 56 (NBR_NR_DCI_FIELDS) elements for each dci field and format described in TS 38.212. Each element represents the size in bits for each dci field - //uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = {{0}}; - // this is the UL bandwidth part. FIXME! To be defined where this value comes from - // uint16_t n_RB_ULBWP = 106; - // this is the DL bandwidth part. FIXME! To be defined where this value comes from - - // First we have to identify each searchSpace active at a time and do PDCCH monitoring corresponding to current searchSpace - // Up to 10 searchSpaces can be configured to UE (s<=10) - for (nb_searchspace_active=0; nb_searchspace_activesearchSpace[nb_searchspace_active].monitoringSlotPeriodicityAndOffset; - //if (sl_period_offset_mon == nr_sl1) { - //do_pdcch_monitoring_current_slot=1; // PDCCH monitoring in every slot - //} else if (nr_slot_rx%(uint16_t)sl_period_offset_mon == pdcch_vars2->searchSpace[nb_searchspace_active].monitoringSlotPeriodicityAndOffset_offset) { - //do_pdcch_monitoring_current_slot=1; // PDCCH monitoring in every monitoringSlotPeriodicityAndOffset slot with offset - //} - - // FIXME - // For PDCCH monitoring when overlap with SS/PBCH according to 38.213 v15.1.0 Section 10 - // To be implemented LATER !!! - - //int _offset,_index,_M; - //int searchSpace_id = pdcch_vars2->searchSpace[nb_searchspace_active].searchSpaceId; - - - #ifdef NR_PDCCH_SCHED_DEBUG - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> nb_searchspace_active=%d do_pdcch_monitoring_current_slot=%d (to be removed)\n", - nb_searchspace_active, - do_pdcch_monitoring_current_slot); - #endif - -// if (do_pdcch_monitoring_current_slot) { - // the searchSpace indicates that we need to monitor PDCCH in current nr_slot_rx - // get the parameters describing the current SEARCHSPACE - // the CORESET id applicable to the current SearchSpace - //int searchSpace_coreset_id = pdcch_vars2->searchSpace[nb_searchspace_active].controlResourceSetId; - // FIXME this variable is a bit string (14 bits) identifying every OFDM symbol in a slot. - // at the moment we will not take into consideration this variable and we will consider that the OFDM symbol offset is always the first OFDM in a symbol - uint16_t symbol_within_slot_mon = pdcch_vars2->searchSpace[nb_searchspace_active].monitoringSymbolWithinSlot; - // get the remaining parameters describing the current SEARCHSPACE: // FIXME! To be defined where we get this information from - //NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L1 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel1; - //NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L2 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel2; - //NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L4 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel4; - //NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L8 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel8; - //NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L16 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel16; - // FIXME! A table of five enum elements - // searchSpaceType indicates whether this is a common search space or a UE-specific search space - //int searchSpaceType = pdcch_vars2->searchSpace[nb_searchspace_active].searchSpaceType.type; - NR_SEARCHSPACE_TYPE_t searchSpaceType = ue_specific;//common; - #ifdef NR_PDCCH_SCHED_DEBUG - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> searchSpaceType=%d is hardcoded THIS HAS TO BE FIXED!!!\n", - searchSpaceType); - #endif - - //while ((searchSpace_coreset_id != pdcch_vars2->coreset[nb_coreset_active].controlResourceSetId) && (nb_coreset_active= nb_coreset_total) return 0; // the coreset_id could not be found. There is a problem - } - - - - //we do not need these parameters yet - - // get the parameters describing the current CORESET - //int coreset_duration = pdcch_vars2->coreset[nb_coreset_active].duration; - //uint64_t coreset_freq_dom = pdcch_vars2->coreset[nb_coreset_active].frequencyDomainResources; - //int coreset_shift_index = pdcch_vars2->coreset[nb_coreset_active].cce_reg_mappingType.shiftIndex; - // NR_UE_CORESET_REG_bundlesize_t coreset_bundlesize = pdcch_vars2->coreset[nb_coreset_active].cce_reg_mappingType.reg_bundlesize; - // NR_UE_CORESET_interleaversize_t coreset_interleaversize = pdcch_vars2->coreset[nb_coreset_active].cce_reg_mappingType.interleaversize; - // NR_UE_CORESET_precoder_granularity_t precoder_granularity = pdcch_vars2->coreset[nb_coreset_active].precoderGranularity; - // int tci_statesPDCCH = pdcch_vars2->coreset[nb_coreset_active].tciStatesPDCCH; - // int tci_present = pdcch_vars2->coreset[nb_coreset_active].tciPresentInDCI; - // uint16_t pdcch_DMRS_scrambling_id = pdcch_vars2->coreset[nb_coreset_active].pdcchDMRSScramblingID; - - - // A set of PDCCH candidates for a UE to monitor is defined in terms of PDCCH search spaces. - // Searchspace types: - // Type0-PDCCH common search space for a DCI format with CRC scrambled by a SI-RNTI - // number of consecutive resource blocks and a number of consecutive symbols for - // the control resource set of the Type0-PDCCH common search space from - // the four most significant bits of RMSI-PDCCH-Config as described in Tables 13-1 through 13-10 - // and determines PDCCH monitoring occasions - // from the four least significant bits of RMSI-PDCCH-Config, - // included in MasterInformationBlock, as described in Tables 13-11 through 13-15 - // Type0A-PDCCH common search space for a DCI format with CRC scrambled by a SI-RNTI - // Type1-PDCCH common search space for a DCI format with CRC scrambled by a RA-RNTI, or a TC-RNTI, or a C-RNTI - // Type2-PDCCH common search space for a DCI format with CRC scrambled by a P-RNTI - // Type3-PDCCH common search space for a DCI format with CRC scrambled by INT-RNTI, or SFI-RNTI, - // or TPC-PUSCH-RNTI, or TPC-PUCCH-RNTI, or TPC-SRS-RNTI, or C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI - - - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_IN); - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN); -#ifdef NR_PDCCH_SCHED_DEBUG - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_rx_pdcch with gNB_id=%d (nb_coreset_active=%d, (symbol_within_slot_mon&0x3FFF)=%d, searchSpaceType=%d)\n", - gNB_id,nb_coreset_active,(symbol_within_slot_mon&0x3FFF), - searchSpaceType); -#endif - nr_rx_pdcch(ue, - frame_rx, - nr_slot_rx, - gNB_id, - //(ue->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI, - SISO, - ue->high_speed_flag, - ue->is_secondary_ue, - nb_coreset_active, - (symbol_within_slot_mon&0x3FFF), - searchSpaceType); -#ifdef NR_PDCCH_SCHED_DEBUG - printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_rx_pdcch(nb_coreset_active=%d, (symbol_within_slot_mon&0x3FFF)=%d, searchSpaceType=%d)\n", - nb_coreset_active,(symbol_within_slot_mon&0x3FFF), - searchSpaceType); -#endif - - */ - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN); nr_rx_pdcch(ue, proc, rel15); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_OUT); @@ -709,46 +529,10 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, ue->pdcch_vars[proc->thread_id][gNB_id]->dci_received += dci_cnt; dci_ind->number_of_dcis = dci_cnt; - /* - for (int i=0; iframe_parms.frame_type, - dci_alloc_rx[i].dci_length, - dci_alloc_rx[i].rnti, - dci_alloc_rx[i].dci_pdu, - &dci_ind.dci_list[i].dci, - dci_fields_sizes_cnt[i], - dci_alloc_rx[i].format, - nr_slot_rx, - pdcch_vars2->n_RB_BWP[nb_searchspace_active], - pdcch_vars2->n_RB_BWP[nb_searchspace_active], - crc_scrambled_values); - - if(status == 0) { - LOG_W(PHY,"<-NR_PDCCH_PHY_PROCEDURES_UE (nr_ue_pdcch_procedures)-> bad DCI %d !!! \n",dci_alloc_rx[i].format); - return(-1); - } - - LOG_D(PHY,"<-NR_PDCCH_PHY_PROCEDURES_UE (nr_ue_pdcch_procedures)-> Ending function nr_extract_dci_info()\n"); - - - - } // end for loop dci_cnt - */ - - // fill dl_indication message - nr_fill_dl_indication(&dl_indication, dci_ind, NULL, proc, ue, gNB_id); - // send to mac - ue->if_inst->dl_indication(&dl_indication, NULL); + // fill dl_indication message + nr_fill_dl_indication(&dl_indication, dci_ind, NULL, proc, ue, gNB_id); + // send to mac + ue->if_inst->dl_indication(&dl_indication, NULL); stop_meas(&ue->dlsch_rx_pdcch_stats); From 4b04b463e0e0e963b43b6bd64b2733b5fcc198b2 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 15:41:01 +0100 Subject: [PATCH 327/883] Fix: start phy_proc_rx measurement --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 0041a878a4..dd69a83de2 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1386,6 +1386,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *fp = &ue->frame_parms; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN); + start_meas(&ue->phy_proc_rx[proc->thread_id]); LOG_D(PHY," ****** start RX-Chain for Frame.Slot %d.%d (energy %d dB)****** \n", frame_rx%1024, nr_slot_rx, From 100ba1019ef8966186a7b77905d1a78486f3b9b6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 15:40:04 +0100 Subject: [PATCH 328/883] Delete commented code in phy_procedures_nrUE_RX() and indent --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 97 ++++++--------------- 1 file changed, 29 insertions(+), 68 deletions(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index dd69a83de2..8953285dbd 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1656,91 +1656,52 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, } -start_meas(&ue->generic_stat); + start_meas(&ue->generic_stat); -#if 0 + if (nr_slot_rx==9) { + if (frame_rx % 10 == 0) { + if ((ue->dlsch_received[gNB_id] - ue->dlsch_received_last[gNB_id]) != 0) + ue->dlsch_fer[gNB_id] = (100*(ue->dlsch_errors[gNB_id] - ue->dlsch_errors_last[gNB_id]))/(ue->dlsch_received[gNB_id] - ue->dlsch_received_last[gNB_id]); - if(nr_slot_rx==5 && ue->dlsch[proc->thread_id][gNB_id][0]->harq_processes[ue->dlsch[proc->thread_id][gNB_id][0]->current_harq_pid]->nb_rb > 20){ - //write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0); - //write_output("llr.m","llr", &ue->pdsch_vars[proc->thread_id][gNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0); - - write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0][0],14*fp->ofdm_symbol_size,1,1); - //write_output("rxdataF0_previous.m" , "rxdataF0_prev_sss", &ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF[0][0],14*fp->ofdm_symbol_size,1,1); - - //write_output("rxdataF0_previous.m" , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[next_thread_id].rxdataF[0][0],14*fp->ofdm_symbol_size,1,1); - - write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].dl_ch_estimates[0][0][0],14*fp->ofdm_symbol_size,1,1); - write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[proc->thread_id][gNB_id]->dl_ch_estimates_ext[0][0],14*fp->N_RB_DL*12,1,1); - write_output("rxdataF_comp00.m","rxdataF_comp00", &ue->pdsch_vars[proc->thread_id][gNB_id]->rxdataF_comp0[0][0],14*fp->N_RB_DL*12,1,1); - //write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[proc->thread_id][gNB_id]->dl_ch_mag0[0][0],14*fp->N_RB_DL*12,1,1); - //write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[proc->thread_id][gNB_id]->dl_ch_magb0[0][0],14*fp->N_RB_DL*12,1,1); - - AssertFatal (0,""); - } -#endif - - // duplicate harq structure -/* - uint8_t current_harq_pid = ue->dlsch[proc->thread_id][gNB_id][0]->current_harq_pid; - NR_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[proc->thread_id][gNB_id][0]->harq_processes[current_harq_pid]; - NR_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[next1_thread_id][gNB_id][0]->harq_processes[current_harq_pid]; - NR_DL_UE_HARQ_t *harq_processes_dest1 = ue->dlsch[next2_thread_id][gNB_id][0]->harq_processes[current_harq_pid]; - */ - /*nr_harq_status_t *current_harq_ack = &ue->dlsch[proc->thread_id][gNB_id][0]->harq_ack[nr_slot_rx]; - nr_harq_status_t *harq_ack_dest = &ue->dlsch[next1_thread_id][gNB_id][0]->harq_ack[nr_slot_rx]; - nr_harq_status_t *harq_ack_dest1 = &ue->dlsch[next2_thread_id][gNB_id][0]->harq_ack[nr_slot_rx]; -*/ - - //copy_harq_proc_struct(harq_processes_dest, current_harq_processes); -//copy_ack_struct(harq_ack_dest, current_harq_ack); - -//copy_harq_proc_struct(harq_processes_dest1, current_harq_processes); -//copy_ack_struct(harq_ack_dest1, current_harq_ack); - -if (nr_slot_rx==9) { - if (frame_rx % 10 == 0) { - if ((ue->dlsch_received[gNB_id] - ue->dlsch_received_last[gNB_id]) != 0) - ue->dlsch_fer[gNB_id] = (100*(ue->dlsch_errors[gNB_id] - ue->dlsch_errors_last[gNB_id]))/(ue->dlsch_received[gNB_id] - ue->dlsch_received_last[gNB_id]); - - ue->dlsch_errors_last[gNB_id] = ue->dlsch_errors[gNB_id]; - ue->dlsch_received_last[gNB_id] = ue->dlsch_received[gNB_id]; - } + ue->dlsch_errors_last[gNB_id] = ue->dlsch_errors[gNB_id]; + ue->dlsch_received_last[gNB_id] = ue->dlsch_received[gNB_id]; + } - ue->bitrate[gNB_id] = (ue->total_TBS[gNB_id] - ue->total_TBS_last[gNB_id])*100; - ue->total_TBS_last[gNB_id] = ue->total_TBS[gNB_id]; - LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", - ue->Mod_id,frame_rx,ue->total_TBS[gNB_id], - ue->total_TBS_last[gNB_id],(float) ue->bitrate[gNB_id]/1000.0); + ue->bitrate[gNB_id] = (ue->total_TBS[gNB_id] - ue->total_TBS_last[gNB_id])*100; + ue->total_TBS_last[gNB_id] = ue->total_TBS[gNB_id]; + LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", + ue->Mod_id,frame_rx,ue->total_TBS[gNB_id], + ue->total_TBS_last[gNB_id],(float) ue->bitrate[gNB_id]/1000.0); #if UE_AUTOTEST_TRACE - if ((frame_rx % 100 == 0)) { - LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[gNB_id]/1000.0, frame_rx); - } + if ((frame_rx % 100 == 0)) { + LOG_I(PHY,"[UE %d] AUTOTEST Metric : UE_DLSCH_BITRATE = %5.2f kbps (frame = %d) \n", ue->Mod_id, (float) ue->bitrate[gNB_id]/1000.0, frame_rx); + } #endif - } + } -stop_meas(&ue->generic_stat); -if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY,"after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); + stop_meas(&ue->generic_stat); + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY,"after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0)); #ifdef EMOS -phy_procedures_emos_UE_RX(ue,slot,gNB_id); + phy_procedures_emos_UE_RX(ue,slot,gNB_id); #endif -VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT); -stop_meas(&ue->phy_proc_rx[proc->thread_id]); -if (cpumeas(CPUMEAS_GETSTATE)) + stop_meas(&ue->phy_proc_rx[proc->thread_id]); + if (cpumeas(CPUMEAS_GETSTATE)) + LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); + + stop_meas(&ue->phy_proc_rx[proc->thread_id]); LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0)); - -//#endif //pdsch - -LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); -return (0); + LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_slot_rx); + return (0); } From 71619bb7b4b300277ce2fe74f5c75e362c74d650 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 15:42:09 +0100 Subject: [PATCH 329/883] Add measurement stats for rx_pdsch and ul_indication --- common/utils/telnetsrv/telnetsrv_cpumeasur_def.h | 2 ++ executables/nr-ue.c | 2 ++ openair1/PHY/defs_nr_UE.h | 3 +++ openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 ++ 4 files changed, 9 insertions(+) diff --git a/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h b/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h index a275272e80..7dd643ef08 100644 --- a/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h +++ b/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h @@ -106,6 +106,7 @@ {"phy_proc", &(UE->phy_proc[0]),0,RX_NB_TH},\ {"phy_proc_rx", &(UE-> phy_proc_rx[0]),0,RX_NB_TH},\ {"phy_proc_tx", &(UE->phy_proc_tx),0,1},\ + {"ue_ul_indication_stats", &(UE->ue_ul_indication_stats),0,1},\ {"ofdm_mod_stats", &(UE->ofdm_mod_stats),0,1},\ {"ulsch_encoding_stats", &(UE->ulsch_encoding_stats),0,1},\ {"ulsch_modulation_stats", &(UE->ulsch_modulation_stats),0,1},\ @@ -146,6 +147,7 @@ {"ue_front_end_stat", &(UE->ue_front_end_stat[0]),0,RX_NB_TH},\ {"ue_front_end_per_slot_stat", &(UE->ue_front_end_per_slot_stat[0][0]),0,RX_NB_TH,LTE_SLOTS_PER_SUBFRAME},\ {"pdcch_procedures_stat", &(UE->pdcch_procedures_stat[0]),0,RX_NB_TH},\ + {"rx_pdsch_stats", &(UE->rx_pdsch_stats), 0, 1}, \ {"pdsch_procedures_stat", &(UE->pdsch_procedures_stat[0]),0,RX_NB_TH},\ {"pdsch_procedures_per_slot_stat", &(UE->pdsch_procedures_per_slot_stat[0][0]),0,RX_NB_TH,LTE_SLOTS_PER_SUBFRAME},\ {"dlsch_procedures_stat", &(UE->dlsch_procedures_stat[0]),0,RX_NB_TH},\ diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2e7b2ea0e1..93f12f831c 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -666,6 +666,7 @@ void processSlotTX(void *arg) { // trigger L2 to run ue_scheduler thru IF module // [TODO] mapping right after NR initial sync if(UE->if_inst != NULL && UE->if_inst->ul_indication != NULL) { + start_meas(&UE->ue_ul_indication_stats); nr_uplink_indication_t ul_indication; memset((void*)&ul_indication, 0, sizeof(ul_indication)); @@ -680,6 +681,7 @@ void processSlotTX(void *arg) { ul_indication.ue_sched_mode = rxtxD->ue_sched_mode; UE->if_inst->ul_indication(&ul_indication); + stop_meas(&UE->ue_ul_indication_stats); } if ((UE->mode != loop_through_memory) && (rxtxD->ue_sched_mode != NOT_PUSCH)) { diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 69978f5548..6fd47048fe 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -1004,6 +1004,8 @@ typedef struct { time_stats_t phy_proc_tx; time_stats_t phy_proc_rx[RX_NB_TH]; + time_stats_t ue_ul_indication_stats; + uint32_t use_ia_receiver; time_stats_t ofdm_mod_stats; @@ -1025,6 +1027,7 @@ typedef struct { time_stats_t pdsch_procedures_per_slot_stat[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; time_stats_t dlsch_procedures_stat[RX_NB_TH]; + time_stats_t rx_pdsch_stats; time_stats_t ofdm_demod_stats; time_stats_t dlsch_rx_pdcch_stats; time_stats_t rx_dft_stats; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 8953285dbd..c8cf7a031a 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -607,6 +607,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ first_symbol_with_data++; } + start_meas(&ue->rx_pdsch_stats); for (m = s0; m < (s1 + s0); m++) { dual_stream_UE = 0; @@ -646,6 +647,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ proc->first_symbol_available = 1; } } // CRNTI active + stop_meas(&ue->rx_pdsch_stats); } return 0; } From 4289a21f352176f047d4ec8fb0a6ca13c31ee1d9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 16:04:46 +0100 Subject: [PATCH 330/883] Add thread to periodically print L1 UE stats to file --- executables/nr-ue.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 93f12f831c..00076887a5 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -104,6 +104,46 @@ queue_t nr_rach_ind_queue; static void *NRUE_phy_stub_standalone_pnf_task(void *arg); +static int dump_L1_UE_meas_stats(PHY_VARS_NR_UE *ue, char *output, int max_len) +{ + int stroff = 0; + stroff += print_meas_log(&ue->phy_proc_tx, "L1 TX processing", NULL, NULL, output); + stroff += print_meas_log(&ue->ulsch_encoding_stats, "ULSCH encoding", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->phy_proc_rx[0], "L1 RX processing t0", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->phy_proc_rx[1], "L1 RX processing t1", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->ue_ul_indication_stats, "UL Indication", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->rx_pdsch_stats, "PDSCH receiver", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->dlsch_decoding_stats[0], "PDSCH decoding t0", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->dlsch_decoding_stats[1], "PDSCH decoding t1", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->dlsch_unscrambling_stats, "PDSCH unscrambling", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->dlsch_rx_pdcch_stats, "PDCCH handling", NULL, NULL, output + stroff); + return stroff; +} + +static void *nrL1_UE_stats_thread(void *param) +{ + PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *) param; + const int max_len = 16384; + char output[max_len]; + char filename[30]; + snprintf(filename, 29, "nrL1_UE_stats-%d.log", ue->Mod_id); + filename[29] = 0; + FILE *fd = fopen(filename, "w"); + AssertFatal(fd != NULL, "Cannot open %s\n", filename); + + while (!oai_exit) { + sleep(1); + const int len = dump_L1_UE_meas_stats(ue, output, max_len); + AssertFatal(len < max_len, "exceeded length\n"); + fwrite(output, len + 1, 1, fd); // + 1 for terminating NULL byte + fflush(fd); + fseek(fd, 0, SEEK_SET); + } + fclose(fd); + + return NULL; +} + void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id, uint8_t abstraction_flag) @@ -1166,6 +1206,8 @@ void init_NR_UE_threads(int nb_inst) { LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); threadCreate(&threads[inst], UE_thread, (void *)UE, "UEthread", -1, OAI_PRIORITY_RT_MAX); + pthread_t stat_pthread; + threadCreate(&stat_pthread, nrL1_UE_stats_thread, UE, "L1_UE_stats", -1, OAI_PRIORITY_RT_LOW); } } From b9a216d79a70ea100773cf3ac008d00abb09bbc6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 16 Dec 2021 13:54:00 +0100 Subject: [PATCH 331/883] Take timing measurements for UL DLSCH decoding steps - Measure time of deinterleaving, rate unmatching, and LDPC decoding of DLSCH decoding - Add merge_meas() function to merge measurements into one - Rename time meas variables with "turbo" to "ldpc" --- .../utils/telnetsrv/telnetsrv_cpumeasur_def.h | 6 +-- executables/nr-ue.c | 3 ++ .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 45 +++++++------------ openair1/PHY/TOOLS/time_meas.h | 10 +++++ openair1/PHY/defs_nr_UE.h | 8 ++-- 5 files changed, 37 insertions(+), 35 deletions(-) diff --git a/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h b/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h index 7dd643ef08..ed8b5e2301 100644 --- a/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h +++ b/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h @@ -112,7 +112,7 @@ {"ulsch_modulation_stats", &(UE->ulsch_modulation_stats),0,1},\ {"ulsch_segmentation_stats", &(UE->ulsch_segmentation_stats),0,1},\ {"ulsch_rate_matching_stats", &(UE->ulsch_rate_matching_stats),0,1},\ - {"ulsch_turbo_encoding_stats", &(UE->ulsch_turbo_encoding_stats),0,1},\ + {"ulsch_ldpc_encoding_stats", &(UE->ulsch_ldpc_encoding_stats),0,1},\ {"ulsch_interleaving_stats", &(UE->ulsch_interleaving_stats),0,1},\ {"ulsch_multiplexing_stats", &(UE->ulsch_multiplexing_stats),0,1},\ {"generic_stat", &(UE->generic_stat),0,1},\ @@ -124,12 +124,12 @@ {"dlsch_f...timation_stats", &(UE->dlsch_freq_offset_estimation_stats),0,1},\ {"dlsch_demodulation_stats", &(UE->dlsch_demodulation_stats),0,1},\ {"dlsch_rate_unmatching_stats", &(UE->dlsch_rate_unmatching_stats),0,1},\ - {"dlsch_turbo_decoding_stats", &(UE->dlsch_turbo_decoding_stats),0,1},\ + {"dlsch_ldpc_decoding_stats", &(UE->dlsch_ldpc_decoding_stats),0,1},\ {"dlsch_deinterleaving_stats", &(UE->dlsch_deinterleaving_stats),0,1},\ {"dlsch_llr_stats", &(UE->dlsch_llr_stats),0,1},\ {"dlsch_unscrambling_stats", &(UE->dlsch_unscrambling_stats),0,1},\ {"dlsch_rate_matching_stats", &(UE->dlsch_rate_matching_stats),0,1},\ - {"dlsch_turbo_encoding_stats", &(UE->dlsch_turbo_encoding_stats),0,1},\ + {"dlsch_ldpc_encoding_stats", &(UE->dlsch_ldpc_encoding_stats),0,1},\ {"dlsch_interleaving_stats", &(UE->dlsch_interleaving_stats),0,1},\ {"dlsch_tc_init_stats", &(UE->dlsch_tc_init_stats),0,1},\ {"dlsch_tc_alpha_stats", &(UE->dlsch_tc_alpha_stats),0,1},\ diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 00076887a5..959b00db97 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -115,6 +115,9 @@ static int dump_L1_UE_meas_stats(PHY_VARS_NR_UE *ue, char *output, int max_len) stroff += print_meas_log(&ue->rx_pdsch_stats, "PDSCH receiver", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->dlsch_decoding_stats[0], "PDSCH decoding t0", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->dlsch_decoding_stats[1], "PDSCH decoding t1", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->dlsch_deinterleaving_stats, " -> Deinterleive", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->dlsch_rate_unmatching_stats, " -> Rate Unmatch", NULL, NULL, output + stroff); + stroff += print_meas_log(&ue->dlsch_ldpc_decoding_stats, " -> LDPC Decode", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->dlsch_unscrambling_stats, "PDSCH unscrambling", NULL, NULL, output + stroff); stroff += print_meas_log(&ue->dlsch_rx_pdcch_stats, "PDCCH handling", NULL, NULL, output + stroff); return stroff; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 95c451fa1a..bdac7dab8a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -233,6 +233,10 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool NR_UE_DLSCH_t *dlsch = (NR_UE_DLSCH_t *) rdata->dlsch; int r = rdata->segment_r; + merge_meas(&phy_vars_ue->dlsch_deinterleaving_stats, &rdata->ts_deinterleave); + merge_meas(&phy_vars_ue->dlsch_rate_unmatching_stats, &rdata->ts_rate_unmatch); + merge_meas(&phy_vars_ue->dlsch_ldpc_decoding_stats, &rdata->ts_ldpc_decode); + bool decodeSuccess = (rdata->decodeIterations < (1+dlsch->max_ldpc_iterations)); if (decodeSuccess) { @@ -296,12 +300,6 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool void nr_processDLSegment(void* arg) { ldpcDecode_ue_t *rdata = (ldpcDecode_ue_t*) arg; NR_UE_DLSCH_t *dlsch = rdata->dlsch; -#if UE_TIMING_TRACE //TBD - PHY_VARS_NR_UE *phy_vars_ue = rdata->phy_vars_ue; - time_stats_t *dlsch_rate_unmatching_stats=&phy_vars_ue->dlsch_rate_unmatching_stats; - time_stats_t *dlsch_turbo_decoding_stats=&phy_vars_ue->dlsch_turbo_decoding_stats; - time_stats_t *dlsch_deinterleaving_stats=&phy_vars_ue->dlsch_deinterleaving_stats; -#endif NR_DL_UE_HARQ_t *harq_process= rdata->harq_process; t_nrLDPC_dec_params *p_decoderParms = &rdata->decoderParms; int length_dec; @@ -341,21 +339,16 @@ void nr_processDLSegment(void* arg) { t_nrLDPC_procBuf **p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf; -#if UE_TIMING_TRACE - start_meas(dlsch_deinterleaving_stats); -#endif + start_meas(&rdata->ts_deinterleave); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN); nr_deinterleaving_ldpc(E, Qm, harq_process->w[r], // [hna] w is e dlsch_llr+r_offset); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT); -#if UE_TIMING_TRACE - stop_meas(dlsch_deinterleaving_stats); -#endif -#if UE_TIMING_TRACE - start_meas(dlsch_rate_unmatching_stats); -#endif + stop_meas(&rdata->ts_deinterleave); + + start_meas(&rdata->ts_rate_unmatch); /* LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,E %d, F %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n", harq_pid,r, G,E,harq_process->F, Kr*3, @@ -380,17 +373,12 @@ void nr_processDLSegment(void* arg) { harq_process->F, Kr-harq_process->F-2*(p_decoderParms->Z))==-1) { //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT); -#if UE_TIMING_TRACE - stop_meas(dlsch_rate_unmatching_stats); -#endif + stop_meas(&rdata->ts_rate_unmatch); LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n"); rdata->decodeIterations = dlsch->max_ldpc_iterations + 1; - return; - } else { -#if UE_TIMING_TRACE - stop_meas(dlsch_rate_unmatching_stats); -#endif + return; } + stop_meas(&rdata->ts_rate_unmatch); r_offset += E; @@ -418,9 +406,7 @@ void nr_processDLSegment(void* arg) { } { -#if UE_TIMING_TRACE - start_meas(dlsch_turbo_decoding_stats); -#endif + start_meas(&rdata->ts_ldpc_decode); //set first 2*Z_c bits to zeros memset(&z[0],0,2*harq_process->Z*sizeof(int16_t)); //set Filler bits @@ -470,9 +456,7 @@ void nr_processDLSegment(void* arg) { harq_process->c[r][m]= (uint8_t) llrProcBuf[m]; } -#if UE_TIMING_TRACE - stop_meas(dlsch_turbo_decoding_stats); -#endif + stop_meas(&rdata->ts_ldpc_decode); } } @@ -673,6 +657,9 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, rdata->offset = offset; rdata->dlsch = dlsch; rdata->dlsch_id = 0; + reset_meas(&rdata->ts_deinterleave); + reset_meas(&rdata->ts_rate_unmatch); + reset_meas(&rdata->ts_ldpc_decode); pushTpool(&(pool_dl),req); nbDecode++; LOG_D(PHY,"Added a block to decode, in pipe: %d\n",nbDecode); diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h index 56d8299470..77fbf3dbef 100644 --- a/openair1/PHY/TOOLS/time_meas.h +++ b/openair1/PHY/TOOLS/time_meas.h @@ -178,6 +178,16 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) { } } +static inline void merge_meas(time_stats_t *dst_ts, time_stats_t *src_ts) +{ + if (!opp_enabled) + return; + dst_ts->trials += src_ts->trials; + dst_ts->diff += src_ts->diff; + if (src_ts->max > dst_ts->max) + dst_ts->max = src_ts->max; +} + extern notifiedFIFO_t measur_fifo; #define CPUMEASUR_SECTION "cpumeasur" diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 6fd47048fe..8de7086d51 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -1014,7 +1014,6 @@ typedef struct { time_stats_t ulsch_modulation_stats; time_stats_t ulsch_segmentation_stats; time_stats_t ulsch_rate_matching_stats; - time_stats_t ulsch_turbo_encoding_stats; time_stats_t ulsch_interleaving_stats; time_stats_t ulsch_multiplexing_stats; @@ -1036,13 +1035,13 @@ typedef struct { time_stats_t dlsch_decoding_stats[2]; time_stats_t dlsch_demodulation_stats; time_stats_t dlsch_rate_unmatching_stats; - time_stats_t dlsch_turbo_decoding_stats; + time_stats_t dlsch_ldpc_decoding_stats; time_stats_t dlsch_deinterleaving_stats; time_stats_t dlsch_llr_stats; time_stats_t dlsch_llr_stats_parallelization[RX_NB_TH][LTE_SLOTS_PER_SUBFRAME]; time_stats_t dlsch_unscrambling_stats; time_stats_t dlsch_rate_matching_stats; - time_stats_t dlsch_turbo_encoding_stats; + time_stats_t dlsch_ldpc_encoding_stats; time_stats_t dlsch_interleaving_stats; time_stats_t dlsch_tc_init_stats; time_stats_t dlsch_tc_alpha_stats; @@ -1101,6 +1100,9 @@ typedef struct LDPCDecode_ue_s { int offset; int Tbslbrm; int decodeIterations; + time_stats_t ts_deinterleave; + time_stats_t ts_rate_unmatch; + time_stats_t ts_ldpc_decode; } ldpcDecode_ue_t; #include "SIMULATION/ETH_TRANSPORT/defs.h" From 9a36c36249914d7c0646d57a37398cf80fd10c8f Mon Sep 17 00:00:00 2001 From: mjoang Date: Fri, 17 Dec 2021 15:41:55 -0500 Subject: [PATCH 332/883] No need to pass dlsch_parallel into nr_ue_dlsch_procedures() as it is not needed inside nr_dlsch_decoding() --- executables/nr-ue.c | 2 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 6 ++-- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 3 +- openair1/SCHED_NR_UE/defs.h | 3 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 32 ++++++------------- openair1/SIMULATION/NR_PHY/pbchsim.c | 5 ++- 6 files changed, 16 insertions(+), 35 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 959b00db97..dc162a8753 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -636,7 +636,7 @@ static void UE_synch(void *arg) { uint64_t dl_carrier, ul_carrier; nr_get_carrier_frequencies(UE, &dl_carrier, &ul_carrier); - if (nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa, get_nrUE_params()->nr_dlsch_parallel) == 0) { + if (nr_initial_sync(&syncD->proc, UE, 2, get_softmodem_params()->sa) == 0) { freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync hw_slot_offset = ((UE->rx_offset<<1) / UE->frame_parms.samples_per_subframe * UE->frame_parms.slots_per_subframe) + round((float)((UE->rx_offset<<1) % UE->frame_parms.samples_per_subframe)/UE->frame_parms.samples_per_slot0); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 2963ad5010..8917a8bc1b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -196,8 +196,7 @@ char prefix_string[2][9] = {"NORMAL","EXTENDED"}; int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, - int n_frames, int sa, - int dlsch_parallel) + int n_frames, int sa) { int32_t sync_pos, sync_pos_frame; // k_ssb, N_ssb_crb, sync_pos2, @@ -528,8 +527,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, SI_PDSCH, ue->dlsch_SI[gnb_id], NULL, - &ue->dlsch_SI_errors[gnb_id], - dlsch_parallel); + &ue->dlsch_SI_errors[gnb_id]); // deactivate dlsch once dlsch proc is done ue->dlsch_SI[gnb_id]->active = 0; 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 3cb002f9e1..0ff5000f4a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1423,8 +1423,7 @@ void generate_RIV_tables(void); int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *phy_vars_ue, int n_frames, - int sa, - int dlsch_parallel); + int sa); /*! \brief This function gets the carrier frequencies either from FP or command-line-set global variables, depending on the availability of the latter diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index b3527365a5..e70902cb97 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -425,8 +425,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, PDSCH_t pdsch, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, - int *dlsch_errors, - uint8_t dlsch_parallel); + int *dlsch_errors); int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index c8cf7a031a..e3e46e7e7c 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -658,8 +658,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, PDSCH_t pdsch, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, - int *dlsch_errors, - uint8_t dlsch_parallel) { + int *dlsch_errors) { if (dlsch0==NULL) AssertFatal(0,"dlsch0 should be defined at this level \n"); @@ -788,12 +787,9 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, harq_pid, pdsch==PDSCH?1:0, dlsch0->harq_processes[harq_pid]->TBS>256?1:0); - if( dlsch_parallel) { - LOG_T(PHY,"dlsch decoding is parallelized, ret = %d\n", ret); - } - else { - LOG_T(PHY,"Sequential dlsch decoding , ret = %d\n", ret); - } + + LOG_T(PHY,"dlsch decoding, ret = %d\n", ret); + if(retmax_ldpc_iterations+1) dec = true; @@ -868,13 +864,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, harq_pid, pdsch==PDSCH?1:0,//proc->decoder_switch, dlsch1->harq_processes[harq_pid]->TBS>256?1:0); - if(dlsch_parallel) { - LOG_T(PHY,"CW dlsch decoding is parallelized, ret1 = %d\n", ret1); - } - else { - - LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1); - } + LOG_T(PHY,"CW dlsch decoding, ret1 = %d\n", ret1); stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]); if (cpumeas(CPUMEAS_GETSTATE)) { @@ -1570,8 +1560,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, SI_PDSCH, ue->dlsch_SI[gNB_id], NULL, - &ue->dlsch_SI_errors[gNB_id], - dlsch_parallel); + &ue->dlsch_SI_errors[gNB_id]); // deactivate dlsch once dlsch proc is done ue->dlsch_SI[gNB_id]->active = 0; @@ -1595,8 +1584,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, P_PDSCH, ue->dlsch_p[gNB_id], NULL, - &ue->dlsch_p_errors[gNB_id], - dlsch_parallel); + &ue->dlsch_p_errors[gNB_id]); // deactivate dlsch once dlsch proc is done ue->dlsch_p[gNB_id]->active = 0; @@ -1619,8 +1607,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, RA_PDSCH, ue->dlsch_ra[gNB_id], NULL, - &ue->dlsch_ra_errors[gNB_id], - dlsch_parallel); + &ue->dlsch_ra_errors[gNB_id]); // deactivate dlsch once dlsch proc is done ue->dlsch_ra[gNB_id]->active = 0; @@ -1642,8 +1629,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, PDSCH, ue->dlsch[proc->thread_id][gNB_id][0], ue->dlsch[proc->thread_id][gNB_id][1], - &ue->dlsch_errors[gNB_id], - dlsch_parallel); + &ue->dlsch_errors[gNB_id]); stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]); if (cpumeas(CPUMEAS_GETSTATE)) { diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 2413a86912..7ed5bddb2a 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -91,8 +91,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, PDSCH_t pdsch, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, - int *dlsch_errors, - uint8_t dlsch_parallel) { + int *dlsch_errors) { return false; } @@ -714,7 +713,7 @@ int main(int argc, char **argv) } if (UE->is_synchronized == 0) { UE_nr_rxtx_proc_t proc={0}; - ret = nr_initial_sync(&proc, UE, 1, 0, 0); + ret = nr_initial_sync(&proc, UE, 1, 0); printf("nr_initial_sync1 returns %d\n",ret); if (ret<0) n_errors++; } From b01b20129b2b871bb2f881fe72744a9b5a197eed Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 16 Dec 2021 16:01:56 +0100 Subject: [PATCH 333/883] Harmonize DLSCH/ULSCH unscrambling in gNB/nrUE --- cmake_targets/CMakeLists.txt | 3 +- openair1/PHY/INIT/nr_init_ue.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_scrambling.c | 55 ++++++++++++++++++ .../NR_TRANSPORT/nr_transport_common_proto.h | 2 + openair1/PHY/NR_TRANSPORT/nr_ulsch.c | 57 +------------------ openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 13 +---- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 22 +------ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 9 ++- 8 files changed, 71 insertions(+), 92 deletions(-) create mode 100644 openair1/PHY/NR_TRANSPORT/nr_scrambling.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index f2eda66fc0..fd146a286c 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1710,6 +1710,8 @@ set(PHY_SRC_UE set(PHY_NR_SRC_COMMON ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_prach_common.c + ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_scrambling.c + ${OPENAIR1_DIR}/PHY/NR_REFSIG/scrambling_luts.c ) set(PHY_NR_SRC @@ -1735,7 +1737,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_csi_rs.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c - ${OPENAIR1_DIR}/PHY/NR_REFSIG/scrambling_luts.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gen_mod_table.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/dmrs_nr.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/ptrs_nr.c diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index c193733aef..9a4dc5d437 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -531,6 +531,7 @@ void init_N_TA_offset(PHY_VARS_NR_UE *ue){ void phy_init_nr_top(PHY_VARS_NR_UE *ue) { NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; crcTableInit(); + init_scrambling_luts(); load_dftslib(); init_context_synchro_nr(frame_parms); generate_ul_reference_signal_sequences(SHRT_MAX); @@ -542,6 +543,5 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) { //generate_16qam_table(); //generate_RIV_tables(); //init_unscrambling_lut(); - //init_scrambling_lut(); //set_taus_seed(1328); } diff --git a/openair1/PHY/NR_TRANSPORT/nr_scrambling.c b/openair1/PHY/NR_TRANSPORT/nr_scrambling.c new file mode 100644 index 0000000000..0ee21fbdcd --- /dev/null +++ b/openair1/PHY/NR_TRANSPORT/nr_scrambling.c @@ -0,0 +1,55 @@ +/* + * 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 + */ + +#include "nr_transport_common_proto.h" +#include "PHY/NR_REFSIG/nr_refsig.h" + +void nr_codeword_unscrambling(int16_t* llr, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI) +{ + uint32_t x1; + uint32_t x2 = (n_RNTI << 15) + (q << 14) + Nid; + uint32_t s = 0; + +#if defined(__x86_64__) || defined(__i386__) + uint8_t *s8=(uint8_t *)&s; + __m128i *llr128 = (__m128i*)llr; + s = lte_gold_generic(&x1, &x2, 1); + + for (int i = 0, j = 0; i < ((size >> 5) + ((size & 0x1f) > 0 ? 1 : 0)); i++, j += 4) { + llr128[j] = _mm_mullo_epi16(llr128[j],byte2m128i[s8[0]]); + llr128[j+1] = _mm_mullo_epi16(llr128[j+1],byte2m128i[s8[1]]); + llr128[j+2] = _mm_mullo_epi16(llr128[j+2],byte2m128i[s8[2]]); + llr128[j+3] = _mm_mullo_epi16(llr128[j+3],byte2m128i[s8[3]]); + s = lte_gold_generic(&x1, &x2, 0); + } +#else + uint8_t reset = 1; + + for (uint32_t i=0; i>(i&0x1f))&1)==1) + llr[i] = -llr[i]; + } +#endif +} diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h index 02e594e76a..58b88d93b9 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_common_proto.h @@ -77,6 +77,8 @@ void nr_fill_du(uint16_t N_ZC,uint16_t *prach_root_sequence_map); void init_nr_prach_tables(int N_ZC); +void nr_codeword_unscrambling(int16_t* llr, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI); + /**@}*/ void init_pucch2_luts(void); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c index 4278338dbc..1cb503489b 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c @@ -33,7 +33,6 @@ #include #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include "PHY/NR_TRANSPORT/nr_ulsch.h" -#include "PHY/NR_REFSIG/nr_refsig.h" int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) { @@ -82,59 +81,9 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB, } -void nr_ulsch_unscrambling(int16_t* llr, - uint32_t size, - uint8_t q, - uint32_t Nid, - uint32_t n_RNTI) { - - uint8_t reset; - uint32_t x1, x2, s=0; - - reset = 1; - x2 = (n_RNTI<<15) + Nid; - - for (uint32_t i=0; i>(i&0x1f))&1)==1) - llr[i] = -llr[i]; - } -} - -void nr_ulsch_unscrambling_optim(int16_t* llr, - uint32_t size, - uint8_t q, - uint32_t Nid, - uint32_t n_RNTI) { - -#if defined(__x86_64__) || defined(__i386__) - uint32_t x1, x2, s=0; - - x2 = (n_RNTI<<15) + Nid; - - uint8_t *s8=(uint8_t *)&s; - __m128i *llr128 = (__m128i*)llr; - int j=0; - s = lte_gold_generic(&x1, &x2, 1); - - for (int i=0; i<((size>>5)+((size&0x1f) > 0 ? 1 : 0)); i++,j+=4) { - llr128[j] = _mm_mullo_epi16(llr128[j],byte2m128i[s8[0]]); - llr128[j+1] = _mm_mullo_epi16(llr128[j+1],byte2m128i[s8[1]]); - llr128[j+2] = _mm_mullo_epi16(llr128[j+2],byte2m128i[s8[2]]); - llr128[j+3] = _mm_mullo_epi16(llr128[j+3],byte2m128i[s8[3]]); - s = lte_gold_generic(&x1, &x2, 0); - } -#else - - nr_ulsch_unscrambling(llr, - size, - q, - Nid, - n_RNTI); -#endif +void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n_RNTI) +{ + nr_codeword_unscrambling(llr, size, 0, Nid, n_RNTI); } void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) { diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index 80c10d74b1..f7bb3be577 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -69,18 +69,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, @param n_RNTI, CRNTI */ -void nr_ulsch_unscrambling(int16_t* llr, - uint32_t size, - uint8_t q, - uint32_t Nid, - uint32_t n_RNTI); - - -void nr_ulsch_unscrambling_optim(int16_t* llr, - uint32_t size, - uint8_t q, - uint32_t Nid, - uint32_t n_RNTI); +void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n_RNTI); void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index bdac7dab8a..257baa570d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -206,25 +206,9 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint return(NULL); } -void nr_dlsch_unscrambling(int16_t *llr, - uint32_t size, - uint8_t q, - uint32_t Nid, - uint32_t n_RNTI) { - uint8_t reset; - uint32_t x1, x2, s=0; - reset = 1; - x2 = (n_RNTI<<15) + (q<<14) + Nid; - - for (int i=0; i>(i&0x1f))&1)==1) - llr[i] = -llr[i]; - } +void nr_dlsch_unscrambling(int16_t *llr, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI) +{ + nr_codeword_unscrambling(llr, size, q, Nid, n_RNTI); } bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool last, notifiedFIFO_t *nf_p) { diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index be0acca1b7..db9d5efe08 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -372,11 +372,10 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH //------------------- ULSCH unscrambling ------------------- //---------------------------------------------------------- start_meas(&gNB->ulsch_unscrambling_stats); - nr_ulsch_unscrambling_optim(gNB->pusch_vars[ULSCH_id]->llr, - G, - 0, - pusch_pdu->data_scrambling_id, - pusch_pdu->rnti); + nr_ulsch_unscrambling(gNB->pusch_vars[ULSCH_id]->llr, + G, + pusch_pdu->data_scrambling_id, + pusch_pdu->rnti); stop_meas(&gNB->ulsch_unscrambling_stats); //---------------------------------------------------------- //--------------------- ULSCH decoding --------------------- From c1b73e2d4823c4b56a062a4d02cce6a6bc8e96c1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 21 Dec 2021 14:58:08 +0100 Subject: [PATCH 334/883] Harmonize DLSCH/ULSCH unscrambling in gNB/nrUE Uses optimized scrambling if not UCI on PUSCH, or unoptimized to put placeholder bits otherwise. --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 77 +++---------------- openair1/PHY/NR_TRANSPORT/nr_scrambling.c | 52 +++++++++++++ .../NR_TRANSPORT/nr_transport_common_proto.h | 7 ++ .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 11 +-- .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 25 ++++-- 6 files changed, 94 insertions(+), 80 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 9bbc61d4b6..9cd61998fd 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -47,70 +47,11 @@ void nr_pdsch_codeword_scrambling(uint8_t *in, uint8_t q, uint32_t Nid, uint32_t n_RNTI, - uint32_t* out) { - - uint8_t reset, b_idx; - uint32_t x1, x2, s=0; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_CODEWORD_SCRAMBLING, 1); - reset = 1; - x2 = (n_RNTI<<15) + (q<<14) + Nid; - - for (int i=0; i>b_idx)&1))<>5)+((size&0x1f) > 0 ? 1 : 0)); i++) { - in32=_mm256_movemask_epi8(_mm256_slli_epi16(((__m256i*)in)[i],7)); - out[i]=(in32^s); - //printf("in[%d] %x => %x\n",i,in32,out[i]); - s=lte_gold_generic(&x1, &x2, 0); - } -#elif defined(__SSE4__) - _m128i *in128; - for (int i=0; i<((size>>5)+((size&0x1f) > 0 ? 1 : 0)); i++) { - in128=&((__m128i*)in)[i<<1]; - ((uint16_t*)&in32)[0] = _mm128_movemask_epi8(_mm256_slli_epi16(in128[0],7)); - ((uint16_t*)&in32)[1] = _mm128_movemask_epi8(_mm256_slli_epi16(in128[1],7)); - out[i]=(in32^s); - s=lte_gold_generic(&x1, &x2, 0); - } - //#elsif defined(__arm__) || defined(__aarch64) - -#else - nr_pdsch_codeword_scrambling(in, - size, - q, - Nid, - n_RNTI, - out); -#endif -} - - void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) { @@ -213,12 +154,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, for (int q=0; qNrOfCodewords; q++) memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t)); for (int q=0; qNrOfCodewords; q++) - nr_pdsch_codeword_scrambling_optim(output, - encoded_length, - q, - rel15->dataScramblingId, - rel15->rnti, - scrambled_output[q]); + nr_pdsch_codeword_scrambling(output, + encoded_length, + q, + rel15->dataScramblingId, + rel15->rnti, + scrambled_output[q]); stop_meas(dlsch_scrambling_stats); #ifdef DEBUG_DLSCH diff --git a/openair1/PHY/NR_TRANSPORT/nr_scrambling.c b/openair1/PHY/NR_TRANSPORT/nr_scrambling.c index 0ee21fbdcd..b68ad2d89f 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_scrambling.c +++ b/openair1/PHY/NR_TRANSPORT/nr_scrambling.c @@ -21,6 +21,58 @@ #include "nr_transport_common_proto.h" #include "PHY/NR_REFSIG/nr_refsig.h" +#include "common/utils/LOG/vcd_signal_dumper.h" + +void nr_codeword_scrambling(uint8_t *in, + uint32_t size, + uint8_t q, + uint32_t Nid, + uint32_t n_RNTI, + uint32_t* out) +{ + uint32_t x1; + uint32_t x2 = (n_RNTI<<15) + (q<<14) + Nid; + uint32_t s = 0; + +#if defined(__AVX2__) + s=lte_gold_generic(&x1, &x2, 1); + for (int i=0; i<((size>>5)+((size&0x1f) > 0 ? 1 : 0)); i++) { + __m256i c = ((__m256i*)in)[i]; + uint32_t in32 = _mm256_movemask_epi8(_mm256_slli_epi16(c,7)); + out[i]=(in32^s); + //printf("in[%d] %x => %x\n",i,in32,out[i]); + s=lte_gold_generic(&x1, &x2, 0); + } +#elif defined(__SSE4__) + s=lte_gold_generic(&x1, &x2, 1); + __m128i *in128; + for (int i=0; i<((size>>5)+((size&0x1f) > 0 ? 1 : 0)); i++) { + in128=&((__m128i*)in)[i<<1]; + uint32_t in32; + ((uint16_t*)&in32)[0] = _mm_movemask_epi8(_mm_slli_epi16(in128[0],7)); + ((uint16_t*)&in32)[1] = _mm_movemask_epi8(_mm_slli_epi16(in128[1],7)); + out[i]=(in32^s); + s=lte_gold_generic(&x1, &x2, 0); + } +//#elsif defined(__arm__) || defined(__aarch64) +#else + uint8_t reset = 1; + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_CODEWORD_SCRAMBLING, 1); + for (int i = 0; i < size; i++) { + const uint8_t b_idx = i&0x1f; + if (b_idx==0) { + s = lte_gold_generic(&x1, &x2, reset); + reset = 0; + if (i) + out++; + } + *out ^= (((in[i])&1) ^ ((s>>b_idx)&1))< no optimized scrambling) @param[out] out, the scrambled bits */ - void nr_pusch_codeword_scrambling(uint8_t *in, - uint32_t size, - uint32_t Nid, - uint32_t n_RNTI, - uint32_t* out); + uint32_t size, + uint32_t Nid, + uint32_t n_RNTI, + bool uci_on_pusch, + uint32_t* out); /** \brief Perform the following functionalities: - encoding diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index b4ee4f5b41..9b9f1add6e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -149,7 +149,7 @@ typedef struct { /// ACK/NAK Bundling flag uint8_t bundling; /// Concatenated "g"-sequences (for definition see 36-212 V15.4.0 2018-12, p.31) - uint8_t g[MAX_NUM_NR_CHANNEL_BITS]; + uint8_t g[MAX_NUM_NR_CHANNEL_BITS] __attribute__ ((aligned(32))); /// Interleaved "h"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) uint8_t h[MAX_NUM_NR_CHANNEL_BITS]; /// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 73615ffb6e..0c188e9119 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -53,12 +53,12 @@ //extern int32_t uplink_counter; -void nr_pusch_codeword_scrambling(uint8_t *in, - uint32_t size, - uint32_t Nid, - uint32_t n_RNTI, - uint32_t* out) { - +void nr_pusch_codeword_scrambling_uci(uint8_t *in, + uint32_t size, + uint32_t Nid, + uint32_t n_RNTI, + uint32_t* out) +{ uint8_t reset, b_idx; uint32_t x1, x2, s=0, temp_out; @@ -89,7 +89,19 @@ void nr_pusch_codeword_scrambling(uint8_t *in, *out ^= (((in[i])&1) ^ ((s>>b_idx)&1))<Nid_cell, rnti, + false, scrambled_output[cwd_index]); // assume one codeword for the moment From d7e7954cdea62c4d3d85105ae816f02526e24783 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 28 Jan 2022 16:20:06 +0100 Subject: [PATCH 335/883] Remove commented code --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 1 - openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 1 - 2 files changed, 2 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index db9d5efe08..8047bd0e05 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -203,7 +203,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); - //pthread_mutex_unlock(&mutextest); if (do_meas==1) stop_meas(&msgTx->phy_proc_tx); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 87c1dee1e5..ae52f8cc60 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -272,7 +272,6 @@ bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot) { void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_t slot){ - //pthread_mutex_lock(&mutextest); protocol_ctxt_t ctxt={0}; PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frame, slot,module_idP); From b48bae761f1318de3cc7f5c6bcbdafbaef458ad7 Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 28 Jan 2022 09:04:43 +0100 Subject: [PATCH 336/883] add stats for multiple tests + fix stat files concatenation --- ci-scripts/ran.py | 4 ++-- ci-scripts/stats_monitor.py | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index baf3a00725..da20998297 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -493,9 +493,9 @@ class RANManagement(): conf_file='../ci-scripts/stats_monitor_conf.yaml' if self.eNB_Stats=='yes': if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'): - mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' enb 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) + mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' ' + self.testCase_id + ' enb 2>&1 > enb_stats_monitor_execution.log &', '\$', 5) else: - mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' gnb 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) + mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' ' + self.testCase_id + ' gnb 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index e732325fa1..e4dcc53bc2 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -11,6 +11,7 @@ import pickle import matplotlib.pyplot as plt import numpy as np import yaml +import os class StatMonitor(): @@ -66,11 +67,15 @@ class StatMonitor(): files = ["nrL1_stats.log", "nrMAC_stats.log", "nrPDCP_stats.log", "nrRRC_stats.log"] # append each file's contents to another file (prepended with CI-) for # post-mortem/debugging analysis - for f in files: - cmd = rf'cat {f} >> CI-{f}' - subprocess.Popen(shlex.split(cmd)) + #for f in files: + # cmd = 'cat '+ f + ' >> CI-' + f + # if os.path.isfile(f): + # subprocess.Popen(cmd,shell=True) # join the files for further processing - cmd = rf'cat {shlex.join(files)}' + cmd='cat ' + for f in files: + if os.path.isfile(f): + cmd += f+' ' process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE) output = process.stdout.readlines() if node_type=='enb': @@ -79,7 +84,7 @@ class StatMonitor(): self.process_gnb(node_type,output) - def graph(self,node_type): + def graph(self,testcase_id, node_type): for page in self.d[node_type]['graph']:#work out a set a graphs per page col = 1 figure, axis = plt.subplots(len(self.d[node_type]['graph'][page]), col ,figsize=(10, 10)) @@ -110,13 +115,14 @@ class StatMonitor(): plt.tight_layout() #save as png - plt.savefig(node_type+'_stats_monitor_'+page+'.png') + plt.savefig(node_type+'_stats_monitor_'+testcase_id+'_'+page+'.png') if __name__ == "__main__": cfg_filename = sys.argv[1] #yaml file as metrics config - node = sys.argv[2]#enb or gnb + testcase_id = sys.argv[2] #test case id to name files accordingly, especially if we have several tests in a sequence + node = sys.argv[3]#enb or gnb mon=StatMonitor(cfg_filename) #collecting stats when modem process is stopped @@ -131,4 +137,4 @@ if __name__ == "__main__": print('Process stopped') with open(node+'_stats_monitor.pickle', 'wb') as handle: pickle.dump(mon.d, handle, protocol=pickle.HIGHEST_PROTOCOL) - mon.graph(node) + mon.graph(testcase_id, node) From c95f54456353f3b99c978c99570493fd4c11a68b Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 31 Jan 2022 11:17:45 +0100 Subject: [PATCH 337/883] dynamic dmrs length initialization depending on actual RBs --- openair1/PHY/INIT/nr_init.c | 18 ++++++++++---- openair1/PHY/INIT/nr_init_ue.c | 28 ++++++++++++---------- openair1/PHY/INIT/nr_parms.c | 1 - openair1/PHY/NR_REFSIG/nr_gold.c | 15 +++++++----- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 18 +++++++------- openair1/PHY/NR_TRANSPORT/nr_csi_rs.c | 6 +++-- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 6 ++--- openair1/PHY/defs_nr_UE.h | 2 +- openair1/PHY/defs_nr_common.h | 13 ---------- 9 files changed, 56 insertions(+), 51 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index aa09f84028..9a2e8c91cb 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -118,12 +118,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, gNB->bad_pucch = 0; + // ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK) + int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1; + for (int slot=0; slotslots_per_frame; slot++) { pdcch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); AssertFatal(pdcch_dmrs[slot]!=NULL, "NR init: pdcch_dmrs for slot %d - malloc failed\n", slot); for (int symb=0; symbsymbols_per_slot; symb++) { - pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(pdcch_dmrs_init_length*sizeof(uint32_t)); LOG_D(PHY,"pdcch_dmrs[%d][%d] %p\n",slot,symb,pdcch_dmrs[slot][symb]); AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); } @@ -137,6 +140,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, gNB->nr_gold_pdsch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***)); uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; + // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK) + int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1; for (int slot=0; slotslots_per_frame; slot++) { pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **)); AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot); @@ -146,7 +151,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); for (int q=0; qnr_gold_pusch_dmrs; + // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK) + int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1; for(int nscid=0; nscid<2; nscid++) { pusch_dmrs[nscid] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); AssertFatal(pusch_dmrs[nscid]!=NULL, "NR init: pusch_dmrs for nscid %d - malloc failed\n", nscid); @@ -168,7 +175,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, AssertFatal(pusch_dmrs[nscid][slot]!=NULL, "NR init: pusch_dmrs for slot %d - malloc failed\n", slot); for (int symb=0; symbsymbols_per_slot; symb++) { - pusch_dmrs[nscid][slot][symb] = (uint32_t *)malloc16(NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + pusch_dmrs[nscid][slot][symb] = (uint32_t *)malloc16(pusch_dmrs_init_length*sizeof(uint32_t)); AssertFatal(pusch_dmrs[nscid][slot][symb]!=NULL, "NR init: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); } } @@ -183,12 +190,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, uint32_t ***csi_rs = gNB->nr_gold_csi_rs; AssertFatal(csi_rs!=NULL, "NR init: csi reference signal malloc failed\n"); + // ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32) + int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1; + for (int slot=0; slotslots_per_frame; slot++) { csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); AssertFatal(csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot); for (int symb=0; symbsymbols_per_slot; symb++) { - csi_rs[slot][symb] = (uint32_t *)malloc16(NR_MAX_CSI_RS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length*sizeof(uint32_t)); AssertFatal(csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb); } } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 99f869c9b7..a38cb1d93f 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -137,10 +137,9 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, NR_UE_COMMON *const common_vars = &ue->common_vars; NR_UE_PBCH **const pbch_vars = ue->pbch_vars; NR_UE_PRACH **const prach_vars = ue->prach_vars; - int i,j,k,l,slot,symb,q; + int i,j,k,l,slot,symb; int gNB_id; int th_id; - uint32_t ****pusch_dmrs; uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig int n_scid; abstraction_flag = 0; @@ -197,22 +196,22 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, /////////////////////////PUSCH DMRS init///////////////////////// /////////// - ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***)); - pusch_dmrs = ue->nr_gold_pusch_dmrs; + + // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK) + int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1; + + ue->nr_gold_pusch_dmrs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); + uint32_t ***pusch_dmrs = ue->nr_gold_pusch_dmrs; n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization for (slot=0; slotslots_per_frame; slot++) { - pusch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **)); + pusch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); AssertFatal(pusch_dmrs[slot]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d - malloc failed\n", slot); for (symb=0; symbsymbols_per_slot; symb++) { - pusch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *)); + pusch_dmrs[slot][symb] = (uint32_t *)malloc16(pusch_dmrs_init_length*sizeof(uint32_t)); AssertFatal(pusch_dmrs[slot][symb]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); - for (q=0; qN_RB_DL<<1)*3)>>5)+1; //PDCCH DMRS init (gNB offset = 0) ue->nr_gold_pdcch[0] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); uint32_t ***pdcch_dmrs = ue->nr_gold_pdcch[0]; @@ -274,7 +275,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, AssertFatal(pdcch_dmrs[slot]!=NULL, "NR init: pdcch_dmrs for slot %d - malloc failed\n", slot); for (int symb=0; symbsymbols_per_slot; symb++) { - pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(pdcch_dmrs_init_length*sizeof(uint32_t)); AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); } } @@ -282,6 +283,9 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->scramblingID_pdcch = fp->Nid_cell; nr_gold_pdcch(ue,fp->Nid_cell); + // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK) + int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1; + //PDSCH DMRS init (eNB offset = 0) ue->nr_gold_pdsch[0] = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***)); uint32_t ****pdsch_dmrs = ue->nr_gold_pdsch[0]; @@ -295,7 +299,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); for (int q=0; qN_RB_DL, Ncp); - if (Ncp == NFAPI_CP_EXTENDED) AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu); diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index 7930839832..7f81529964 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -60,6 +60,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid) uint8_t reset; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs; + int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1; for (uint8_t slot=0; slotslots_per_frame; slot++) { for (uint8_t symb=0; symbsymbols_per_slot; symb++) { @@ -67,7 +68,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid) reset = 1; x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1)); LOG_D(PHY,"PDCCH DMRS slot %d, symb %d, Nid %d, x2 %x\n",slot,symb,Nid,x2); - for (uint32_t n=0; nframe_parms; uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; - + int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1; uint16_t N_n_scid[NR_MAX_NB_CODEWORDS]={Nid, Nid}; // Not correct, appropriate scrambling IDs have to be updated to support DCI 1_1 uint8_t n_scid=0; // again works only for 1_0 for (uint8_t slot=0; slotslots_per_frame; slot++) { @@ -93,13 +94,13 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid) reset = 1; x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid)); LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, N_n_scid %d,n_scid %d\n",slot,symb,x2,N_n_scid[n_scid],n_scid); - for (uint32_t n=0; nframe_parms; unsigned short l; + int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1; for (nscid=0; nscid<2; nscid++) { nid = Nid[nscid]; @@ -122,7 +124,7 @@ void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid) { x2 = ((1<<17) * (fp->symbols_per_slot*ns+l+1) * ((nid<<1)+1) +((nid<<1)+nscid)); LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",ns,l,x2); - for (n=0; nnr_gold_pusch_dmrs[nscid][ns][l][n] = lte_gold_generic(&x1, &x2, reset); reset = 0; } @@ -138,6 +140,7 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid) uint32_t ***csi_rs = gNB->nr_gold_csi_rs; uint32_t x1, x2; uint8_t reset; + int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1; for (uint8_t slot=0; slotslots_per_frame; slot++) { for (uint8_t symb=0; symbsymbols_per_slot; symb++) { @@ -145,7 +148,7 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid) reset = 1; x2 = ((1<<10) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid)); - for (uint32_t n=0; nframe_parms.N_RB_DL<<1)*3)>>5)+1; for (ns=0; nsframe_parms.slots_per_frame; ns++) { @@ -66,7 +67,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue, x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17; x2 = (x2tmp0+(nid<<1))%(1<<31); //cinit - for (n=0; nnr_gold_pdcch[0][ns][l][n] = lte_gold_generic(&x1, &x2, reset); reset = 0; } @@ -82,6 +83,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, int nscid; unsigned int nid; uint8_t reset; + int pdsch_dmrs_init_length = ((ue->frame_parms.N_RB_DL*12)>>5)+1; /// to be updated from higher layer //unsigned short lbar = 0; @@ -98,7 +100,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid); - for (n=0; nnr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset); reset = 0; } @@ -112,9 +114,10 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, uint8_t n_scid) { uint32_t x1, x2, n; - uint8_t reset, slot, symb, q; + uint8_t reset, slot, symb; NR_DL_FRAME_PARMS *fp = &ue->frame_parms; - uint32_t ****pusch_dmrs = ue->nr_gold_pusch_dmrs; + uint32_t ***pusch_dmrs = ue->nr_gold_pusch_dmrs; + int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1; for (slot=0; slotslots_per_frame; slot++) { @@ -123,13 +126,10 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, reset = 1; x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid)); - for (n=0; ncommon_vars.txdataF; int txdataF_offset = (slot%2)*frame_parms.samples_per_slot_wCP; uint32_t **gold_csi_rs = gNB->nr_gold_csi_rs[slot]; - int16_t mod_csi[frame_parms.symbols_per_slot][NR_MAX_CSI_RS_LENGTH>>1] __attribute__((aligned(16)));; + //*8(max allocation per RB)*2(QPSK)) + int csi_rs_length = frame_parms.N_RB_DL<<4; + int16_t mod_csi[frame_parms.symbols_per_slot][csi_rs_length>>1] __attribute__((aligned(16)));; uint16_t b = csi_params.freq_domain; uint16_t n, csi_bw, csi_start, p, k, l, mprime, na, kpn, csi_length; uint8_t size, ports, kprime, lprime, i, gs; @@ -59,7 +61,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB, for (uint8_t symb=0; symb>5)+1; n++) { gold_csi_rs[symb][n] = lte_gold_generic(&x1, &x2, reset); reset = 0; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 13ca3bde6b..c1de1648ef 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -207,7 +207,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, /////////////////////////DMRS Modulation///////////////////////// /////////// - uint32_t ***pusch_dmrs = UE->nr_gold_pusch_dmrs[slot]; + uint32_t **pusch_dmrs = UE->nr_gold_pusch_dmrs[slot]; uint16_t n_dmrs = (pusch_pdu->bwp_start + start_rb + nb_rb)*((dmrs_type == pusch_dmrs_type1) ? 6:4); int16_t mod_dmrs[n_dmrs<<1] __attribute((aligned(16))); /////////// @@ -369,7 +369,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, // TODO: performance improvement, we can skip the modulation of DMRS symbols outside the bandwidth part // Perform this on gold sequence, not required when SC FDMA operation is done, LOG_D(PHY,"DMRS in symbol %d\n",l); - nr_modulation(pusch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated + nr_modulation(pusch_dmrs[l], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // Qm = 2 as DMRS is QPSK modulated } else { dmrs_idx = 0; } @@ -379,7 +379,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols)) { is_ptrs_sym = 1; - nr_modulation(pusch_dmrs[l][0], nb_rb, DMRS_MOD_ORDER, mod_ptrs); + nr_modulation(pusch_dmrs[l], nb_rb, DMRS_MOD_ORDER, mod_ptrs); } } diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 7aca95cb1e..65a9fea786 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -862,7 +862,7 @@ typedef struct { uint16_t scramblingID_pdcch; /// PUSCH DMRS sequence - uint32_t ****nr_gold_pusch_dmrs; + uint32_t ***nr_gold_pusch_dmrs; uint32_t X_u[64][839]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 8245da9737..1b99160a23 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -67,22 +67,9 @@ #define NR_PBCH_DMRS_LENGTH 144 // in mod symbols #define NR_PBCH_DMRS_LENGTH_DWORD 10 // ceil(2(QPSK)*NR_PBCH_DMRS_LENGTH/32) -/*These max values are for the gold sequences which are generated at init for the - * full carrier bandwidth*/ -#define NR_MAX_PDCCH_DMRS_INIT_LENGTH ((NR_MAX_NB_RB<<1)*3) // 3 symbols *2(QPSK) -#define NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD 52 // ceil(NR_MAX_PDCCH_DMRS_LENGTH/32) /*used for the resource mapping*/ #define NR_MAX_PDCCH_DMRS_LENGTH 576 // 16(L)*2(QPSK)*3(3 DMRS symbs per REG)*6(REG per CCE) -#define NR_MAX_PDSCH_DMRS_LENGTH 3300 //275*6(k)*2(QPSK real+imag) -#define NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD 104 // ceil(NR_MAX_PDSCH_DMRS_LENGTH/32) - -#define NR_MAX_CSI_RS_LENGTH 4400 //275*8(max allocation per RB)*2(QPSK) -#define NR_MAX_CSI_RS_INIT_LENGTH_DWORD 138 // ceil(NR_MAX_CSI_RS_LENGTH/32) - -#define NR_MAX_PUSCH_DMRS_LENGTH NR_MAX_PDSCH_DMRS_LENGTH -#define NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD - #define NR_MAX_DCI_PAYLOAD_SIZE 64 #define NR_MAX_DCI_SIZE 1728 //16(L)*2(QPSK)*9(12 RE per REG - 3(DMRS))*6(REG per CCE) #define NR_MAX_DCI_SIZE_DWORD 54 // ceil(NR_MAX_DCI_SIZE/32) From 9934aed3cfcd20b8ba7a616ecb31eb26198072c0 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 31 Jan 2022 18:23:23 +0530 Subject: [PATCH 338/883] Fix PUSCH/PDSCH parallel proc bug --- executables/nr-ue.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2e7b2ea0e1..2679f8816d 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -731,15 +731,16 @@ void processSlotRX(void *arg) { PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO, mac->crnti, proc->frame_rx, proc->nr_slot_rx, 0); pdcp_run(&ctxt); } - // calling UL_indication to schedule things other than PUSCH (eg, PUCCH) - rxtxD->ue_sched_mode = NOT_PUSCH; - processSlotTX(rxtxD); // Wait for PUSCH processing to finish notifiedFIFO_elt_t *res; res = pullTpool(&rxtxD->txFifo,&(get_nrUE_params()->Tpool)); delNotifiedFIFO_elt(res); + // calling UL_indication to schedule things other than PUSCH (eg, PUCCH) + rxtxD->ue_sched_mode = NOT_PUSCH; + processSlotTX(rxtxD); + } else { rxtxD->ue_sched_mode = SCHED_ALL; processSlotTX(rxtxD); From 3c1c6e3cb18fcaa2e7191b04a2f023aa2a098eae Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 7 Jan 2022 16:24:15 +0100 Subject: [PATCH 339/883] adding tcp bidir option to CI tests --- ci-scripts/cls_oaicitest.py | 96 +++++++++++++++++++++++- ci-scripts/main.py | 2 +- ci-scripts/xml_files/fr1_nsa_quectel.xml | 10 +++ ci-scripts/xml_files/fr1_sa_quectel.xml | 10 +++ 4 files changed, 114 insertions(+), 4 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index b8b99a053b..a249bc2ee8 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -2009,6 +2009,35 @@ class OaiCiTest(): else: return -2 + + def Iperf_analyzeV2BIDIR(self, lock, UE_IPAddress, device_id, statusQueue,server_filename,client_filename): + #server file is unused for the moment + if (not os.path.isfile(client_filename)): + self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from client log') + return + report=[] + report_msg='Client Report:\n' + with open(client_filename, 'r') as f_client: + for line in f_client.readlines(): + result = re.search(rf'^\[\s+\d+\](?P\[.+\]).*\s+(?P[0-9\.]+ [KMG]bits\/sec).*\s+(?P\bsender|receiver\b)', str(line)) + if result is not None: + report.append(str(line)) + report_msg+=result.group('role') + ' ' + result.group('direction')+ '\t = ' +result.group('bitrate')+'\n' + + if len(report)>0: + lock.acquire() + statusQueue.put(0) + statusQueue.put(device_id) + statusQueue.put(UE_IPAddress) + statusQueue.put(report_msg) + logging.debug('\u001B[1;37;45m TCP Bidir Iperf Result (' + UE_IPAddress + ') \u001B[0m') + logging.debug('\u001B[1;35m ' + report_msg + '\u001B[0m') + lock.release() + else: + self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from client log') + + + def Iperf_analyzeV2Server(self, lock, UE_IPAddress, device_id, statusQueue, iperf_real_options, filename,type): if (not os.path.isfile(filename)): self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Could not analyze from server log') @@ -2297,14 +2326,19 @@ class OaiCiTest(): result = re.search('TRF_IP_ADDR = (?P[0-9\.]+)', SSH.getBefore()) if result is not None: trf_gen_IP = result.group('trf_ip_addr') + #kill iperf processes on EPC side + SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5) + SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf3"', '\$', 5) SSH.close() #kill iperf processes on UE side before (in case there are still some remaining) SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'killall --signal=SIGKILL iperf' SSH.command(cmd,'\$',5) + cmd = 'killall --signal=SIGKILL iperf3' + SSH.command(cmd,'\$',5) SSH.close() - iperf_time = self.Iperf_ComputeTime() + iperf_time = self.Iperf_ComputeTime() if self.iperf_direction=="DL": logging.debug("Iperf for Module in DL mode detected") #server side UE @@ -2318,7 +2352,7 @@ class OaiCiTest(): #client side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' - SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5) + iperf_cmd = 'bin/iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename cmd = 'docker exec -it prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',int(iperf_time)*5.0) @@ -2337,7 +2371,7 @@ class OaiCiTest(): #server side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' - SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5) + iperf_cmd = 'echo $USER; nohup bin/iperf -s -u 2>&1 > ' + server_filename cmd = 'docker exec -d prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',5) @@ -2362,6 +2396,38 @@ class OaiCiTest(): SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.') #send for analysis self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,server_filename,1) + + elif self.iperf_direction=="BIDIR": + logging.debug("Iperf for Module in BIDIR mode detected") + #server side EPC + SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' + + iperf_cmd = 'echo $USER; nohup /usr/local/bin/iperf3 -s 2>&1 > ' + server_filename + cmd = 'docker exec -d prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' + SSH.command(cmd,'\$',5) + SSH.close() + + #client side UE + SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) + client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' + cmd = 'rm '+ client_filename + SSH.command(cmd,'\$',5) + SSH.command('iperf3 -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename, '\$', int(iperf_time)*5.0) + SSH.close() + + #once client is done, retrieve the server file from container to EPC Host + SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + SSH.command('docker cp prod-trf-gen:/iperf-2.0.13/' + server_filename + ' ' + EPC.SourceCodePath, '\$', 5) + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + server_filename, '.') + SSH.close() + + #copy the 2 resulting files locally + SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, client_filename, '.') + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.') + #send for analysis + self.Iperf_analyzeV2BIDIR(lock, UE_IPAddress, device_id, statusQueue, server_filename, client_filename) + else : logging.debug("Incorrect or missing IPERF direction in XML") @@ -2427,6 +2493,30 @@ class OaiCiTest(): #send for analysis filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1) + elif self.iperf_direction=="BIDIR": + logging.debug("Iperf for Module in BIDIR mode detected") + #server side EPC + SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' + cmd = 'rm ' + server_filename + SSH.command(cmd,'\$',5) + cmd = 'echo $USER; nohup iperf3 -s 2>&1 > '+server_filename+' &' + SSH.command(cmd,'\$',5) + SSH.close() + + #client side UE + SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) + client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' + cmd = 'rm ' + client_filename + SSH.command(cmd,'\$',5) + SSH.command('iperf3 -c 192.172.0.1 ' + self.iperf_args + ' 2>&1 > '+client_filename, '\$', int(iperf_time)*5.0) + SSH.close() + + #copy the 2 resulting files locally + SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, client_filename, '.') + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.') + #send for analysis + self.Iperf_analyzeV2BIDIR(lock, UE_IPAddress, device_id, statusQueue, server_filename, client_filename) else : logging.debug("Incorrect or missing IPERF direction in XML") diff --git a/ci-scripts/main.py b/ci-scripts/main.py index ddf9bb531e..e711931078 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -308,7 +308,7 @@ def GetParametersFromXML(action): CiTestObj.ue_id = "" else: CiTestObj.ue_id = ue_id - CiTestObj.iperf_direction = test.findtext('direction')#used for modules only + CiTestObj.iperf_direction = test.findtext('direction')#used for modules only CiTestObj.iperf_packetloss_threshold = test.findtext('iperf_packetloss_threshold') CiTestObj.iperf_profile = test.findtext('iperf_profile') if (CiTestObj.iperf_profile is None): diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 6414f09b6b..e4faff706b 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -38,6 +38,8 @@ 000001 070001 000001 + 070002 + 000001 050000 050001 010002 @@ -132,6 +134,14 @@ single-ue
+ + Iperf + iperf (BIDIR TCP)(10 sec)(single-ue profile) + -t 10 --bidir + BIDIR + idefix + single-ue + Terminate_eNB diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 4db5bb64a5..169564d734 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -34,6 +34,7 @@ 050001 070000 070001 + 070002 000001 010002 080000 @@ -118,6 +119,15 @@ single-ue + + Iperf + iperf (BIDIR TCP)(10 sec)(single-ue profile) + -t 10 --bidir + BIDIR + nrmodule2_quectel + single-ue + + Terminate_eNB From a2b0f455cd92066f327ff07878921f7cbd1536e1 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 24 Jan 2022 12:35:22 -0800 Subject: [PATCH 340/883] Updating config file for min_rxtxtime --- .../episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 01add06e3a..43d3a4d298 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -36,7 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; ul_prbblacklist = "51,52,53,54" - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; pdcch_ConfigSIB1 = ( { controlResourceSetZero = 12; diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index ab0cf5f469..a6e124bf6a 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -36,7 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; ul_prbblacklist = "51,52,53,54" - min_rxtxtime_pdsch = 6; + min_rxtxtime = 6; pdcch_ConfigSIB1 = ( { From f211d26d6f1f436aeec2785ed1edf2d931a67226 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 31 Jan 2022 22:27:27 +0530 Subject: [PATCH 341/883] Code cleanup --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_pss.c | 40 +++++++++++--------------- openair1/PHY/NR_TRANSPORT/nr_sss.c | 45 +++++++++++++----------------- 3 files changed, 36 insertions(+), 51 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 523a86b99d..945d8ca909 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -251,7 +251,7 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, } void nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu, - nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, + nfapi_nr_dl_tti_pdcch_pdu *ul_dci_pdu, uint32_t **gold_pdcch_dmrs, int32_t *txdataF, int16_t amp, diff --git a/openair1/PHY/NR_TRANSPORT/nr_pss.c b/openair1/PHY/NR_TRANSPORT/nr_pss.c index 44f74f1230..8564efe3de 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pss.c @@ -30,49 +30,41 @@ int nr_generate_pss( int32_t *txdataF, nfapi_nr_config_request_scf_t* config, NR_DL_FRAME_PARMS *frame_parms) { - int i,k,l,m; - int16_t a; - int16_t d_pss[NR_PSS_LENGTH]; int16_t x[NR_PSS_LENGTH]; const int x_initial[7] = {0, 1, 1 , 0, 1, 1, 1}; - uint8_t Nid2 = config->cell_config.phy_cell_id.value % 3; - /// Sequence generation - for (i=0; i < 7; i++) + for (int i=0; i < 7; i++) x[i] = x_initial[i]; - for (i=0; i < (NR_PSS_LENGTH - 7); i++) { + for (int i=0; i < (NR_PSS_LENGTH - 7); i++) { x[i+7] = (x[i + 4] + x[i]) %2; } - for (i=0; i < NR_PSS_LENGTH; i++) { - m = (i + 43*Nid2)%(NR_PSS_LENGTH); - d_pss[i] = (1 - 2*x[m]) * 23170; - } - #ifdef NR_PSS_DEBUG write_output("d_pss.m", "d_pss", (void*)d_pss, NR_PSS_LENGTH, 1, 0); printf("PSS: ofdm_symbol_size %d, first_carrier_offset %d\n",frame_parms->ofdm_symbol_size,frame_parms->first_carrier_offset); #endif /// Resource mapping - a = amp; - // PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from - k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and - if (k>= frame_parms->ofdm_symbol_size) k-=frame_parms->ofdm_symbol_size; + // PSS occupies a predefined position (subcarriers 56-182, symbol 0) within the SSB block starting from + int k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and + if (k>= frame_parms->ofdm_symbol_size) k-=frame_parms->ofdm_symbol_size; - l = ssb_start_symbol; + int l = ssb_start_symbol; - for (m = 0; m < NR_PSS_LENGTH; m++) { - // printf("pss: writing position k %d / %d\n",k,frame_parms->ofdm_symbol_size); - ((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (a * d_pss[m]) >> 15; - k++; + uint8_t Nid2 = config->cell_config.phy_cell_id.value % 3; + for (int i = 0; i < NR_PSS_LENGTH; i++) { + int m = (i + 43*Nid2)%(NR_PSS_LENGTH); + int16_t d_pss = (1 - 2*x[m]) * 23170; + // printf("pss: writing position k %d / %d\n",k,frame_parms->ofdm_symbol_size); + ((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (((int16_t)amp) * d_pss) >> 15; + k++; - if (k >= frame_parms->ofdm_symbol_size) - k-=frame_parms->ofdm_symbol_size; - } + if (k >= frame_parms->ofdm_symbol_size) + k-=frame_parms->ofdm_symbol_size; + } #ifdef NR_PSS_DEBUG LOG_M("pss_0.m", "pss_0", diff --git a/openair1/PHY/NR_TRANSPORT/nr_sss.c b/openair1/PHY/NR_TRANSPORT/nr_sss.c index 12f89ba36f..5181f6bac1 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sss.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sss.c @@ -29,36 +29,28 @@ int nr_generate_sss( int32_t *txdataF, nfapi_nr_config_request_scf_t* config, NR_DL_FRAME_PARMS *frame_parms) { - int i,k,l; - int m0, m1; - int Nid, Nid1, Nid2; - //int16_t a; - int16_t d_sss[NR_SSS_LENGTH]; - int16_t x0[NR_SSS_LENGTH], x1[NR_SSS_LENGTH]; + int16_t x0[NR_SSS_LENGTH]; + int16_t x1[NR_SSS_LENGTH]; const int x0_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; const int x1_initial[7] = { 1, 0, 0, 0, 0, 0, 0 }; /// Sequence generation - Nid = config->cell_config.phy_cell_id.value; - Nid2 = Nid % 3; - Nid1 = (Nid - Nid2)/3; + int Nid = config->cell_config.phy_cell_id.value; + int Nid2 = Nid % 3; + int Nid1 = (Nid - Nid2)/3; - for ( i=0 ; i < 7 ; i++) { + for (int i=0; i < 7; i++) { x0[i] = x0_initial[i]; x1[i] = x1_initial[i]; } - for ( i=0 ; i < NR_SSS_LENGTH - 7 ; i++) { + for (int i=0; i < NR_SSS_LENGTH - 7; i++) { x0[i+7] = (x0[i + 4] + x0[i]) % 2; x1[i+7] = (x1[i + 1] + x1[i]) % 2; } - m0 = 15*(Nid1/112) + (5*Nid2); - m1 = Nid1 % 112; - - for (i = 0; i < NR_SSS_LENGTH ; i++) { - d_sss[i] = (1 - 2*x0[(i + m0) % NR_SSS_LENGTH] ) * (1 - 2*x1[(i + m1) % NR_SSS_LENGTH] ) * 23170; - } + int m0 = 15*(Nid1/112) + (5*Nid2); + int m1 = Nid1 % 112; #ifdef NR_SSS_DEBUG write_output("d_sss.m", "d_sss", (void*)d_sss, NR_SSS_LENGTH, 1, 1); @@ -66,17 +58,18 @@ int nr_generate_sss( int32_t *txdataF, /// Resource mapping - // SSS occupies a predefined position (subcarriers 56-182, symbol 2) within the SSB block starting from - k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and - l = ssb_start_symbol + 2; + // SSS occupies a predefined position (subcarriers 56-182, symbol 2) within the SSB block starting from + int k = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier + 56; //and + int l = ssb_start_symbol + 2; - for (int m = 0; m < NR_SSS_LENGTH; m++) { - ((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (amp * d_sss[m]) >> 15; - k++; + for (int i = 0; i < NR_SSS_LENGTH; i++) { + int16_t d_sss = (1 - 2*x0[(i + m0) % NR_SSS_LENGTH] ) * (1 - 2*x1[(i + m1) % NR_SSS_LENGTH] ) * 23170; + ((int16_t*)txdataF)[2*(l*frame_parms->ofdm_symbol_size + k)] = (((int16_t)amp) * d_sss) >> 15; + k++; - if (k >= frame_parms->ofdm_symbol_size) - k-=frame_parms->ofdm_symbol_size; - } + if (k >= frame_parms->ofdm_symbol_size) + k-=frame_parms->ofdm_symbol_size; + } #ifdef NR_SSS_DEBUG // write_output("sss_0.m", "sss_0", (void*)txdataF[0][l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1); #endif From d263f199358cdd6416f39748da4760ca9c5da573 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 31 Jan 2022 22:27:47 +0530 Subject: [PATCH 342/883] Making Tx thread count to 2 --- executables/nr-gnb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 9551a71921..8009bc58dc 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -443,7 +443,7 @@ void init_gNB_Tpool(int inst) { initNotifiedFIFO(gNB->L1_tx_out); // we create 2 threads for L1 tx processing - for (int i=0; i < 1; i++) { + for (int i=0; i < 2; i++) { notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); From 9e2185aa17fb3f8e2d80b0bb4d63c9a9bd12cc74 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 31 Jan 2022 18:52:50 +0100 Subject: [PATCH 343/883] some more cleanup in memory allocation --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 2 +- openair1/PHY/CODING/nrLDPC_defs.h | 2 +- openair1/PHY/CODING/nr_segmentation.c | 5 -- openair1/PHY/INIT/nr_init_ue.c | 7 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 6 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 53 ++++++++----- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 2 +- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 76 +++++++------------ .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 10 +-- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 3 +- openair1/PHY/defs_gNB.h | 10 +-- openair1/PHY/defs_nr_UE.h | 2 +- openair1/PHY/defs_nr_common.h | 10 +-- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 - 17 files changed, 86 insertions(+), 110 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 371deba3f2..3f343c2c4b 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -116,7 +116,7 @@ int test_ldpc(short No_iteration, sigma = 1.0/sqrt(2*SNR); opp_enabled=1; //short test_input[block_length]; - unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};; + unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};; //short *c; //padded codeword unsigned char *estimated_output[MAX_NUM_DLSCH_SEGMENTS]; unsigned char *estimated_output_bit[MAX_NUM_DLSCH_SEGMENTS]; diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h index 0d7ff9ef9f..a6fb44cb0d 100644 --- a/openair1/PHY/CODING/nrLDPC_defs.h +++ b/openair1/PHY/CODING/nrLDPC_defs.h @@ -57,7 +57,7 @@ typedef struct { /// Number of "Filler" bits uint32_t F; /// LDPC-code outputs - uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; + uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS]; } encoder_implemparams_t; #define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL} typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out); diff --git a/openair1/PHY/CODING/nr_segmentation.c b/openair1/PHY/CODING/nr_segmentation.c index 0eede23766..281e61cda5 100644 --- a/openair1/PHY/CODING/nr_segmentation.c +++ b/openair1/PHY/CODING/nr_segmentation.c @@ -63,11 +63,6 @@ int32_t nr_segmentation(unsigned char *input_buffer, #endif } - if ((*C)>MAX_NUM_NR_DLSCH_SEGMENTS) { - LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime); - return(-1); - } - // Find K+ Kprime = Bprime/(*C); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index a38cb1d93f..93339b4cd2 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -123,9 +123,10 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch, void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch, const NR_DL_FRAME_PARMS *const fp) { AssertFatal( pusch, "pusch==0" ); - - for (int i=0; itxdataF_layers[i] = (int32_t *)malloc16_clear(NR_MAX_PUSCH_ENCODED_LENGTH*sizeof(int32_t)); + int max_pusch_length = fp->N_RB_UL*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8*fp->nb_antennas_tx; + pusch->txdataF_layers = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t *)); + for (int i=0; inb_antennas_tx; i++) { + pusch->txdataF_layers[i] = (int32_t *)malloc16_clear(max_pusch_length*sizeof(int32_t)); } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 9bbc61d4b6..1061444f68 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -138,7 +138,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; - uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5]; int16_t **mod_symbs = (int16_t**)dlsch->mod_symbs; int16_t **tx_layers = (int16_t**)dlsch->txdataF; int16_t **txdataF_precoding = (int16_t**)dlsch->txdataF_precoding; @@ -159,6 +158,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers; uint8_t Qm = rel15->qamModOrder[0]; uint32_t encoded_length = nb_re*Qm; + uint32_t scrambled_output[rel15->NrOfCodewords][encoded_length>>5]; int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16))); /* PTRS */ @@ -180,8 +180,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /// CRC, coding, interleaving and rate matching AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * rel15->nrOfLayers] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * rel15->nrOfLayers); start_meas(dlsch_encoding_stats); nr_dlsch_encoding(gNB, harq->pdu, frame, slot, dlsch, frame_parms, output, diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index 77db12672f..b864b36875 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -68,7 +68,7 @@ void nr_fill_dlsch(processingData_L1tx_t *msgTx, void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot); -void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB); +void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB, NR_DL_FRAME_PARMS* frame_parms); void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 819fccc588..cdcd0e0ba1 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -50,10 +50,12 @@ //#define DEBUG_DLSCH_FREE 1 -void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) { - int r; +void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB, NR_DL_FRAME_PARMS* frame_parms) { + NR_gNB_DLSCH_t *dlsch = *dlschptr; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated + + int max_layers = (frame_parms->nb_antennas_txnb_antennas_tx : NR_MAX_NB_LAYERS; + uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*max_layers; if (dlsch) { if (N_RB != 273) { @@ -78,7 +80,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) { LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); #endif - for (r = 0; r < a_segments; r++) { + for (int r = 0; r < a_segments; r++) { #ifdef DEBUG_DLSCH_FREE LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); #endif @@ -99,9 +101,9 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint32_t Nsoft, uint8_t abstraction_flag, uint16_t N_RB) { - unsigned char i,r,aa,layer; - int re; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated + + int max_layers = (frame_parms->nb_antennas_txnb_antennas_tx : NR_MAX_NB_LAYERS; + uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated if (N_RB != 273) { a_segments = a_segments*N_RB; @@ -117,31 +119,35 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, dlsch->Mlimit = 4; dlsch->Nsoft = Nsoft; - for (layer=0; layerN_RB_DL*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8; // max pdsch encoded length for each layer + + dlsch->txdataF = (int32_t **)malloc16(max_layers*sizeof(int32_t *)); + dlsch->txdataF_precoding = (int32_t **)malloc16(max_layers*sizeof(int32_t *)); + dlsch->ue_spec_bf_weights = (int32_t ***)malloc16(max_layers*sizeof(int32_t **)); + for (int layer=0; layerue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *)); - for (aa=0; aa<64; aa++) { + for (int aa=0; aa<64; aa++) { dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); - for (re=0; reue_spec_bf_weights[layer][aa][re] = 0x00007fff; } } - - dlsch->txdataF[layer] = (int32_t *)malloc16((NR_MAX_PDSCH_ENCODED_LENGTH/NR_MAX_NB_LAYERS)*sizeof(int32_t)); // NR_MAX_NB_LAYERS is already included in NR_MAX_PDSCH_ENCODED_LENGTH + dlsch->txdataF[layer] = (int32_t *)malloc16((txdataf_size)*sizeof(int32_t)); dlsch->txdataF_precoding[layer] = (int32_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int32_t)); } for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t)); + dlsch->mod_symbs[q] = (int32_t *)malloc16(txdataf_size*max_layers*sizeof(int32_t)); dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *)); - for (aa=0; aa<64; aa++) { + for (int aa=0; aa<64; aa++) { dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t)); } - for (i=0; i<20; i++) { + for (int i=0; i<20; i++) { dlsch->harq_ids[0][i] = 0; dlsch->harq_ids[1][i] = 0; } @@ -156,7 +162,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, nr_emulate_dlsch_payload(harq->pdu, (dlsch_bytes) >> 3); bzero(harq->b, dlsch_bytes); - for (r = 0; r < a_segments; r++) { + harq->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *)); + for (int r = 0; r < a_segments; r++) { // account for filler in first segment and CRCs for multiple segment case // [hna] 8448 is the maximum CB size in NR // 68*348 = 68*(maximum size of Zc) @@ -319,6 +326,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, stats->current_Qm = rel15->qamModOrder[0]; } + int max_bytes = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*rel15->nrOfLayers*1056; if (A > 3824) { // Add 24-bit crc (polynomial A) to payload crc = crc24a(a,A)>>8; @@ -329,11 +337,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, //printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]); harq->B = A+24; // harq->b = a; - AssertFatal((A / 8) + 4 <= MAX_NR_DLSCH_PAYLOAD_BYTES, + AssertFatal((A / 8) + 4 <= max_bytes, "A %d is too big (A/8+4 = %d > %d)\n", A, (A / 8) + 4, - MAX_NR_DLSCH_PAYLOAD_BYTES); + max_bytes); memcpy(harq->b, a, (A / 8) + 4); // why is this +4 if the CRC is only 3 bytes? } else { // Add 16-bit crc (polynomial A) to payload @@ -344,11 +352,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, //printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]); harq->B = A+16; // harq->b = a; - AssertFatal((A / 8) + 3 <= MAX_NR_DLSCH_PAYLOAD_BYTES, + AssertFatal((A / 8) + 3 <= max_bytes, "A %d is too big (A/8+3 = %d > %d)\n", A, (A / 8) + 3, - MAX_NR_DLSCH_PAYLOAD_BYTES); + max_bytes); memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc } @@ -366,6 +374,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG); stop_meas(dlsch_segmentation_stats); + if (impp.n_segments>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*rel15->nrOfLayers) { + LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",impp.n_segments,harq->B); + return(-1); + } + for (int r=0; rd[r][0]; //channel_input[r] = &harq->d[r][0]; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 08592daccc..01b6be91ab 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -197,7 +197,7 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch) //t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_ULSCH_SEGMENTS]; ulsch->harq_processes[i]->Z=0; /// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1) - //int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448]; + //int16_t e[MAX_NUM_NR_ULSCH_SEGMENTS][3*8448]; ulsch->harq_processes[i]->E=0; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 95c451fa1a..b73441d116 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -80,8 +80,8 @@ void init_dlsch_tpool(uint8_t num_dlsch_threads) { } void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) { - int i,r; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated + + uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; NR_UE_DLSCH_t *dlsch=*dlschptr; if (dlsch) { @@ -90,37 +90,18 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) { a_segments = a_segments/273 +1; } - for (i=0; iMdlharq; i++) { + for (int i=0; iMdlharq; i++) { if (dlsch->harq_processes[i]) { if (dlsch->harq_processes[i]->b) { free16(dlsch->harq_processes[i]->b,a_segments*1056); dlsch->harq_processes[i]->b = NULL; } - for (r=0; rharq_processes[i]->c[r],1056); dlsch->harq_processes[i]->c[r] = NULL; } - for (r=0; rharq_processes[i]->d[r]) { - free16(dlsch->harq_processes[i]->d[r],(5*8448)*sizeof(short)); - dlsch->harq_processes[i]->d[r] = NULL; - } - - for (r=0; rharq_processes[i]->w[r]) { - free16(dlsch->harq_processes[i]->w[r],(5*8448)*sizeof(short)); - dlsch->harq_processes[i]->w[r] = NULL; - } - - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r]) { - nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]); - dlsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL; - } - } - free16(dlsch->harq_processes[i],sizeof(NR_DL_UE_HARQ_t)); dlsch->harq_processes[i] = NULL; } @@ -132,9 +113,11 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) { } NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL, uint8_t abstraction_flag) { + NR_UE_DLSCH_t *dlsch; - uint8_t exit_flag = 0,i,r; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated + uint8_t exit_flag = 0; + + uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated if (N_RB_DL != 273) { a_segments = a_segments*N_RB_DL; @@ -153,7 +136,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint dlsch->Mlimit = 4; dlsch->max_ldpc_iterations = max_ldpc_iterations; - for (i=0; iharq_processes[i] = (NR_DL_UE_HARQ_t *)malloc16(sizeof(NR_DL_UE_HARQ_t)); if (dlsch->harq_processes[i]) { @@ -168,7 +151,9 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint exit_flag=3; if (abstraction_flag == 0) { - for (r=0; rharq_processes[i]->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *)); + dlsch->harq_processes[i]->p_nrLDPC_procBuf = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *)); + for (int r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); @@ -176,20 +161,6 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint memset(dlsch->harq_processes[i]->c[r],0,1056); else exit_flag=2; - - dlsch->harq_processes[i]->d[r] = (short *)malloc16((5*8448)*sizeof(short)); - - if (dlsch->harq_processes[i]->d[r]) - memset(dlsch->harq_processes[i]->d[r],0,(5*8448)*sizeof(short)); - else - exit_flag=2; - - dlsch->harq_processes[i]->w[r] = (short *)malloc16((5*8448)*sizeof(short)); - - if (dlsch->harq_processes[i]->w[r]) - memset(dlsch->harq_processes[i]->w[r],0,(5*8448)*sizeof(short)); - else - exit_flag=2; } } } else { @@ -344,10 +315,12 @@ void nr_processDLSegment(void* arg) { #if UE_TIMING_TRACE start_meas(dlsch_deinterleaving_stats); #endif + int16_t w[5*8448]; + memset(w,0,(5*8448)*sizeof(short)); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN); nr_deinterleaving_ldpc(E, Qm, - harq_process->w[r], // [hna] w is e + w, // [hna] w is e dlsch_llr+r_offset); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT); #if UE_TIMING_TRACE @@ -367,12 +340,14 @@ void nr_processDLSegment(void* arg) { harq_process->round); */ //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN); + int16_t d[5*8448]; + memset(d,0,(5*8448)*sizeof(short)); if (nr_rate_matching_ldpc_rx(Ilbrm, Tbslbrm, p_decoderParms->BG, p_decoderParms->Z, - harq_process->d[r], - harq_process->w[r], + d, + w, harq_process->C, harq_process->rvidx, (harq_process->first_rx==1)?1:0, @@ -398,7 +373,7 @@ void nr_processDLSegment(void* arg) { LOG_I(PHY,"decoder input(segment %u) :",r); for (int i=0; id[r][i]); + LOG_D(PHY,"%d : %d\n",i,d[i]); LOG_D(PHY,"\n"); } @@ -426,9 +401,9 @@ void nr_processDLSegment(void* arg) { //set Filler bits memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t)); //Move coded bits before filler bits - memcpy((&z[0]+2*harq_process->Z),harq_process->d[r],(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); + memcpy((&z[0]+2*harq_process->Z),d,(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); //skip filler bits - memcpy((&z[0]+Kr),harq_process->d[r]+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); + memcpy((&z[0]+Kr),d+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); //Saturate coded bits before decoding into 8 bits values for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) { @@ -612,6 +587,11 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, &harq_process->F, p_decParams->BG); + if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->Nl) { + LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B); + return(-1); + } + if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD) && (!frame%100)) LOG_I(PHY,"K %d C %d Z %d nl %d \n", harq_process->K, harq_process->C, p_decParams->Z, harq_process->Nl); } @@ -627,7 +607,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, p_decParams->numMaxIter = dlsch->max_ldpc_iterations; p_decParams->outMode= 0; r_offset = 0; - uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated + uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->Nl; //number of segments to be allocated if (nb_rb != 273) { a_segments = a_segments*nb_rb; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index 76b68a265f..5871db3d21 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -179,7 +179,7 @@ typedef struct { /// Pointer to the payload uint8_t *b; /// Pointers to transport block segments - uint8_t *c[MAX_NUM_NR_DLSCH_SEGMENTS]; + uint8_t **c; /// Index of current HARQ round for this DLSCH uint8_t round; /// MCS table for this DLSCH @@ -194,14 +194,8 @@ typedef struct { uint8_t rvidx; /// MIMO mode for this DLSCH MIMO_nrmode_t mimo_mode; - /// soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) - int16_t *w[MAX_NUM_NR_DLSCH_SEGMENTS]; - /// for abstraction soft bits for each received segment ("w"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) - //double w_abs[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448]; - /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) - int16_t *d[MAX_NUM_NR_DLSCH_SEGMENTS]; /// LDPC processing buffers - t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_DLSCH_SEGMENTS]; + t_nrLDPC_procBuf **p_nrLDPC_procBuf; /// Number of code segments uint32_t C; /// Number of bits in code segments diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index c1de1648ef..3cdd07dc43 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -102,7 +102,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, LOG_D(PHY,"nr_ue_ulsch_procedures hard_id %d %d.%d\n",harq_pid,frame,slot); uint32_t available_bits; - uint32_t scrambled_output[NR_MAX_PDSCH_ENCODED_LENGTH>>5]; int16_t **tx_layers; int32_t **txdataF; int8_t Wf[2], Wt[2]; @@ -176,7 +175,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, /////////// available_bits = G; - + uint32_t scrambled_output[(available_bits>>5)+1]; memset(scrambled_output, 0, ((available_bits>>5)+1)*sizeof(uint32_t)); nr_pusch_codeword_scrambling(harq_process_ul_ue->f, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 68e8bf0fd2..9217e566ae 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -89,7 +89,7 @@ typedef struct { /// Pointer to the payload uint8_t *b; /// Pointers to transport block segments - uint8_t *c[MAX_NUM_NR_DLSCH_SEGMENTS]; + uint8_t **c; /// Frame where current HARQ round was sent uint32_t frame; /// Subframe where current HARQ round was sent @@ -157,13 +157,13 @@ typedef struct { /// Pointers to variables related to DLSCH harq process NR_DL_gNB_HARQ_t harq_process; /// TX buffers for UE-spec transmission (antenna layers 1,...,4 after to precoding) - int32_t *txdataF[NR_MAX_NB_LAYERS]; + int32_t **txdataF; /// TX buffers for UE-spec transmission (antenna ports 1000 or 1001,...,1007, before precoding) - int32_t *txdataF_precoding[NR_MAX_NB_LAYERS]; + int32_t **txdataF_precoding; /// Modulated symbols buffer int32_t *mod_symbs[NR_MAX_NB_CODEWORDS]; /// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers? - int32_t **ue_spec_bf_weights[NR_MAX_NB_LAYERS]; + int32_t ***ue_spec_bf_weights; /// dl channel estimates (estimated from ul channel estimates) int32_t **calib_dl_ch_estimates; /// Allocated RNTI (0 means DLSCH_t is not currently used) @@ -287,7 +287,7 @@ typedef struct { /// LDPC lifting size (38.212 V15.4.0 table 5.3.2-1) uint32_t Z; /// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1) - int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448]; + int16_t e[MAX_NUM_NR_ULSCH_SEGMENTS][3*8448]; /// Number of bits in each code block after rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1) uint32_t E; /// Number of segments processed so far diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 65a9fea786..c2a83e7362 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -228,7 +228,7 @@ typedef struct { typedef struct { /// TX buffers for multiple layers - int32_t *txdataF_layers[NR_MAX_NB_LAYERS]; + int32_t **txdataF_layers; } NR_UE_PUSCH; typedef struct { diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 1b99160a23..7645bf8e96 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -44,8 +44,6 @@ #define MAX_NUM_SUBCARRIER_SPACING 5 -#define NR_MAX_NB_RB 275 - #define NR_NB_SC_PER_RB 12 #define NR_NB_REG_PER_CCE 6 @@ -80,16 +78,14 @@ #define NR_MAX_CSET_DURATION 3 #define NR_MAX_NB_RBG 18 -#define NR_MAX_NB_LAYERS 2 // 8 // SU-MIMO (3GPP TS 38.211 V15.4.0 section 7.3.1.3) +#define NR_MAX_NB_LAYERS 4 // 8 #define NR_MAX_NB_CODEWORDS 2 #define NR_MAX_NB_HARQ_PROCESSES 16 -#define NR_MAX_PDSCH_ENCODED_LENGTH (NR_MAX_NB_RB*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8*NR_MAX_NB_LAYERS) // 8 is the maximum modulation order (it was 950984 before !!) -#define NR_MAX_PUSCH_ENCODED_LENGTH NR_MAX_PDSCH_ENCODED_LENGTH + #define NR_MAX_PDSCH_TBS 3824 #define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits. -#define MAX_NUM_NR_DLSCH_SEGMENTS (NR_MAX_NB_LAYERS*34) -#define MAX_NR_DLSCH_PAYLOAD_BYTES (MAX_NUM_NR_DLSCH_SEGMENTS*1056) +#define MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER 34 #define MAX_NUM_NR_ULSCH_SEGMENTS 34 #define MAX_NR_ULSCH_PAYLOAD_BYTES (MAX_NUM_NR_ULSCH_SEGMENTS*1056) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index ff07422c6b..060edc77f5 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -644,7 +644,7 @@ int main(int argc, char **argv) for (i = 0; i < 2; i++) { printf("gNB %d\n", i); - free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL); + free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL,frame_parms); printf("UE %d\n", i); free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index df25b085e6..b6e335466d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -629,7 +629,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[ntx_req]; // Data to be transmitted - bzero(tx_req->TLVs[0].value.direct,MAX_NR_DLSCH_PAYLOAD_BYTES); + bzero(tx_req->TLVs[0].value.direct,MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*1056); memcpy(tx_req->TLVs[0].value.direct, sib1_payload, sib1_sdu_length); tx_req->PDU_length = TBS; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c0107c5fc6..26898550f4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -56,8 +56,6 @@ extern RAN_CONTEXT_t RC; const uint8_t nr_rv_round_map[4] = {0, 2, 3, 1}; //#define ENABLE_MAC_PAYLOAD_DEBUG 1 -//uint8_t mac_pdu[MAX_NR_DLSCH_PAYLOAD_BYTES]; - /*Scheduling of DLSCH with associated DCI in common search space * current version has only a DCI for type 1 PDCCH for C_RNTI*/ void nr_schedule_css_dlsch_phytest(module_id_t module_idP, From e4acf7e21df69669cb708909a48004df7fe9cbf5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 31 Jan 2022 19:21:06 +0100 Subject: [PATCH 344/883] bugfix for pdu_index in sib1 sched function --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index eca68d8573..0af340725a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -433,6 +433,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, nfapi_nr_dl_tti_request_body_t *dl_req, + int pdu_index, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config, uint32_t TBS, int StartSymbolIndex, @@ -465,7 +466,7 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, pdsch_pdu_rel15->pduBitmap = 0; pdsch_pdu_rel15->rnti = SI_RNTI; - pdsch_pdu_rel15->pduIndex = gNB_mac->pdu_index[0]++; + pdsch_pdu_rel15->pduIndex = pdu_index; pdsch_pdu_rel15->BWPSize = type0_PDCCH_CSS_config->num_rbs; pdsch_pdu_rel15->BWPStart = type0_PDCCH_CSS_config->cset_start_rb; @@ -632,7 +633,8 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) candidate_idx, sib1_sdu_length); nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body; - nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, type0_PDCCH_CSS_config, TBS, startSymbolIndex, nrOfSymbols, dlDmrsSymbPos); + int pdu_index = gNB_mac->pdu_index[0]++; + nr_fill_nfapi_dl_sib1_pdu(module_idP, dl_req, pdu_index, type0_PDCCH_CSS_config, TBS, startSymbolIndex, nrOfSymbols, dlDmrsSymbPos); const int ntx_req = gNB_mac->TX_req[CC_id].Number_of_PDUs; nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[ntx_req]; @@ -642,7 +644,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) memcpy(tx_req->TLVs[0].value.direct, sib1_payload, sib1_sdu_length); tx_req->PDU_length = TBS; - tx_req->PDU_index = gNB_mac->pdu_index[0]++; + tx_req->PDU_index = pdu_index; tx_req->num_TLV = 1; tx_req->TLVs[0].length = TBS + 2; gNB_mac->TX_req[CC_id].Number_of_PDUs++; From e346608b048eb41ae2788eefbb584e1faf9de770 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 31 Jan 2022 19:28:08 +0100 Subject: [PATCH 345/883] bugfix after nr_set_pdsch_semi_static --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0e98f4d3c9..89fccece07 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -584,10 +584,10 @@ bool allocate_dl_retransmission(module_id_t module_id, temp_ps.nrOfLayers = 1; nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbStart++; while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbSize++; uint32_t new_tbs; uint16_t new_rbSize; From 284734ba86ee3eecdfc93ca3c8e428f337fc59ac Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Feb 2022 08:39:25 +0100 Subject: [PATCH 346/883] Add 5G FDD RFsim test --- .../gnb.sa.band66.fr1.106PRB.usrpn300.conf | 299 ++++++++++++++++++ .../xml_files/container_5g_fdd_rfsim.xml | 116 +++++++ .../xml_files/container_5g_fdd_rfsim_down.xml | 38 +++ .../5g_fdd_rfsimulator/amf-healthcheck.sh | 57 ++++ .../5g_fdd_rfsimulator/docker-compose.yaml | 298 +++++++++++++++++ .../5g_fdd_rfsimulator/mysql-healthcheck.sh | 46 +++ .../5g_fdd_rfsimulator/nrf-healthcheck.sh | 20 ++ .../5g_fdd_rfsimulator/oai-smf.conf | 133 ++++++++ .../yaml_files/5g_fdd_rfsimulator/oai_db.sql | 217 +++++++++++++ .../5g_fdd_rfsimulator/smf-healthcheck.sh | 21 ++ .../5g_fdd_rfsimulator/spgwu-healthcheck.sh | 28 ++ docker/scripts/gnb_entrypoint.sh | 1 + docker/scripts/gnb_parameters.yaml | 30 ++ 13 files changed, 1304 insertions(+) create mode 100644 ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf create mode 100644 ci-scripts/xml_files/container_5g_fdd_rfsim.xml create mode 100644 ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh create mode 100644 ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh create mode 100644 ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh create mode 100755 ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf new file mode 100644 index 0000000000..21bdb4e9d2 --- /dev/null +++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -0,0 +1,299 @@ +Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-Eurecom-5GNRBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 95; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 2; + sd = 2; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + min_rxtxtime = 6; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 433096; + dl_frequencyBand = 66; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 430000; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 66; + ul_absoluteFrequencyPointA = 350000; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 13475; +# 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: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + ulsch_max_slots_inactivity = 100; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + }; + diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml new file mode 100644 index 0000000000..44be29cca4 --- /dev/null +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -0,0 +1,116 @@ + + + rfsim-5gnr + Testing 5G NR RF sim - Monolithic gNB + wrench + 4 + + 100011 + 000010 + 000011 + 000012 + 000013 + 020011 + 020012 + 100011 + + + + + + DeployGenObject + Deploy MySql Database + yaml_files/5g_fdd_rfsimulator + mysql + 1 + + + + DeployGenObject + Deploy OAI 5G CoreNetwork + yaml_files/5g_fdd_rfsimulator + oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn + 6 + + + + DeployGenObject + Deploy OAI 5G gNB RF sim SA + yaml_files/5g_fdd_rfsimulator + oai-gnb + 7 + + + + DeployGenObject + Deploy OAI 5G NR-UE RF sim SA + yaml_files/5g_fdd_rfsimulator + oai-nr-ue + 8 + + + + PingFromContainer + Ping ext-dn from NR-UE + rfsim5g-oai-nr-ue + -I oaitun_ue1 -c 20 192.168.72.135 + 5 + + + + PingFromContainer + Ping NR-UE from ext-dn + rfsim5g-oai-ext-dn + -c 20 12.1.1.2 + 5 + + + + IperfFromContainer + Iperf UDP Downlink + rfsim5g-oai-nr-ue + rfsim5g-oai-ext-dn + -B 12.1.1.2 -u -i 1 -s + -c 12.1.1.2 -u -i 1 -t 30 -b 3M + + + + IperfFromContainer + Iperf UDP Uplink + rfsim5g-oai-ext-dn + rfsim5g-oai-nr-ue + -u -i 1 -s + -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_fdd_rfsimulator + + + diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml new file mode 100644 index 0000000000..c9e9a99d7b --- /dev/null +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml @@ -0,0 +1,38 @@ + + + rfsim-5gnr-down + CleanUp 5G RF - Monolithic gNB + trash + + 100012 + + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_fdd_rfsimulator + + + diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh new file mode 100755 index 0000000000..8bfdee2aac --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh @@ -0,0 +1,57 @@ +#!/bin/bash +set -eo pipefail + +STATUS=0 +AMF_PORT_FOR_NGAP=38412 +AMF_PORT_FOR_N11_HTTP=80 +AMF_IP_NGAP_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_NGAP | grep inet | awk {'print $2'}) +AMF_IP_N11_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_N11 | grep inet | awk {'print $2'}) +N2_PORT_STATUS=$(netstat -Snpl | grep -o "$AMF_IP_NGAP_INTERFACE:$AMF_PORT_FOR_NGAP") +N11_PORT_STATUS=$(netstat -tnpl | grep -o "$AMF_IP_N11_INTERFACE:$AMF_PORT_FOR_N11_HTTP") +#Check if entrypoint properly configured the conf file and no parameter is unset (optional) +NB_UNREPLACED_AT=`cat /openair-amf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true` + +if [ $NB_UNREPLACED_AT -ne 0 ]; then + STATUS=1 + echo "Healthcheck error: configuration file is not configured properly" +fi + +if [[ -z $N2_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: N2 SCTP port $AMF_PORT_FOR_NGAP is not listening" +fi + +if [[ -z $N11_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: N11/SBI TCP/HTTP port $AMF_PORT_FOR_N11_HTTP is not listening" +fi + +#host="${MYSQL_SERVER}" +#user="${MYSQL_USER:-root}" +#export MYSQL_PWD="${MYSQL_PASS}" + +#args=( +# -h"$host" +# -u"$user" +# --silent +#) + +#if ! command -v mysql &> /dev/null; then +# echo "Installing mysql command" +# apt update +# apt-get -y install mysql-client +#else +# if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then +# database_check=$(mysql -h$host -u$user -D oai_db --silent -e "SELECT * FROM users;") +# if [[ -z $database_check ]]; then +# echo "Healthcheck error: oai_db not populated" +# STATUS=1 +# fi +# STATUS=0 +# else +# echo "Healthcheck error: Mysql port inactive" +# STATUS=1 +# fi +#fi + +exit $STATUS diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml new file mode 100644 index 0000000000..bf75828ed1 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml @@ -0,0 +1,298 @@ +version: '3.8' +services: + oai-nrf: + container_name: "rfsim5g-oai-nrf" + image: oai-nrf:latest + environment: + - NRF_INTERFACE_NAME_FOR_SBI=eth0 + - NRF_INTERFACE_PORT_FOR_SBI=80 + - NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - NRF_API_VERSION=v1 + - INSTANCE=0 + - PID_DIRECTORY=/var/run + networks: + public_net: + ipv4_address: 192.168.71.130 + volumes: + - ./nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + mysql: + container_name: "rfsim5g-mysql" + image: mysql:5.7 + volumes: + - ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql + - ./mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh + environment: + - TZ=Europe/Paris + - MYSQL_DATABASE=oai_db + - MYSQL_USER=test + - MYSQL_PASSWORD=test + - MYSQL_ROOT_PASSWORD=linux + healthcheck: + test: /bin/bash -c "/tmp/mysql-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.131 + oai-amf: + container_name: "rfsim5g-oai-amf" + image: oai-amf:latest + environment: + - TZ=Europe/paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - MCC=208 + - MNC=99 + - REGION_ID=128 + - AMF_SET_ID=1 + - SERVED_GUAMI_MCC_0=208 + - SERVED_GUAMI_MNC_0=99 + - SERVED_GUAMI_REGION_ID_0=128 + - SERVED_GUAMI_AMF_SET_ID_0=1 + - SERVED_GUAMI_MCC_1=460 + - SERVED_GUAMI_MNC_1=11 + - SERVED_GUAMI_REGION_ID_1=10 + - SERVED_GUAMI_AMF_SET_ID_1=1 + - PLMN_SUPPORT_MCC=208 + - PLMN_SUPPORT_MNC=99 + - PLMN_SUPPORT_TAC=0x0001 + - SST_0=1 + - SD_0=1 + - SST_1=1 + - SD_1=12 + - AMF_INTERFACE_NAME_FOR_NGAP=eth0 + - AMF_INTERFACE_NAME_FOR_N11=eth0 + - SMF_INSTANCE_ID_0=1 + - SMF_FQDN_0=oai-smf + - SMF_IPV4_ADDR_0=0.0.0.0 + - SMF_HTTP_VERSION_0=v1 + - SELECTED_0=true + - SMF_INSTANCE_ID_1=2 + - SMF_FQDN_1=oai-smf + - SMF_IPV4_ADDR_1=0.0.0.0 + - SMF_HTTP_VERSION_1=v1 + - SELECTED_1=false + - MYSQL_SERVER=192.168.71.131 + - MYSQL_USER=root + - MYSQL_PASS=linux + - MYSQL_DB=oai_db + - OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1 + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NF_REGISTRATION=yes + - SMF_SELECTION=yes + - USE_FQDN_DNS=yes + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - EXTERNAL_AUSF=no + - AUSF_IPV4_ADDRESS=0.0.0.0 + - AUSF_PORT=80 + - AUSF_API_VERSION=v1 + - AUSF_FQDN=localhost + depends_on: + - oai-nrf + - mysql + volumes: + - ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh" + interval: 10s + timeout: 15s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.132 + oai-smf: + container_name: "rfsim5g-oai-smf" + image: oai-smf:latest + entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o" + environment: + - TZ=Europe/Paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - SMF_INTERFACE_NAME_FOR_N4=eth0 + - SMF_INTERFACE_NAME_FOR_SBI=eth0 + - SMF_INTERFACE_PORT_FOR_SBI=80 + - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - SMF_API_VERSION=v1 + - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 + - AMF_IPV4_ADDRESS=0.0.0.0 + - AMF_PORT=80 + - AMF_API_VERSION=v1 + - AMF_FQDN=oai-amf + - UDM_IPV4_ADDRESS=127.0.0.1 + - UDM_PORT=80 + - UDM_API_VERSION=v1 + - UDM_FQDN=localhost + - UPF_IPV4_ADDRESS=192.168.71.134 + - UPF_FQDN_0=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - REGISTER_NRF=yes + - DISCOVER_UPF=yes + - USE_FQDN_DNS=yes + depends_on: + - oai-nrf + - oai-amf + volumes: + - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh + - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf + healthcheck: + test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.133 + oai-spgwu: + container_name: "rfsim5g-oai-spgwu" + image: oai-spgwu-tiny:latest + environment: + - TZ=Europe/Paris + - PID_DIRECTORY=/var/run + - SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0 + - SGW_INTERFACE_NAME_FOR_SX=eth0 + - PGW_INTERFACE_NAME_FOR_SGI=eth0 + - NETWORK_UE_NAT_OPTION=yes + - NETWORK_UE_IP=12.1.1.0/24 + - SPGWC0_IP_ADDRESS=192.168.71.133 + - BYPASS_UL_PFCP_RULES=no + - MCC=208 + - MNC=99 + - MNC03=099 + - TAC=1 + - GTP_EXTENSION_HEADER_PRESENT=yes + - GW_ID=1 + - REALM=openairinterface.org + - ENABLE_5G_FEATURES=yes + - REGISTER_NRF=yes + - USE_FQDN_NRF=yes + - UPF_FQDN_5G=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - NSSAI_SST_0=1 + - NSSAI_SD_0=1 + - DNN_0=oai + depends_on: + - oai-nrf + - oai-smf + cap_add: + - NET_ADMIN + - SYS_ADMIN + cap_drop: + - ALL + privileged: true + volumes: + - ./spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.134 + traffic_net: + ipv4_address: 192.168.72.134 + oai-ext-dn: + image: ubuntu:bionic + privileged: true + container_name: rfsim5g-oai-ext-dn + entrypoint: /bin/bash -c \ + "apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\ + "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\ + "ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity" + depends_on: + - oai-spgwu + networks: + traffic_net: + ipv4_address: 192.168.72.135 + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.72.134" + interval: 10s + timeout: 5s + retries: 5 + oai-gnb: + image: oai-gnb:develop + privileged: true + container_name: rfsim5g-oai-gnb + environment: + RFSIMULATOR: server + USE_SA_FDD_MONO: 'yes' + GNB_NAME: gnb-rfsim + TAC: 1 + MCC: '208' + MNC: '99' + MNC_LENGTH: 2 + NSSAI_SST: 1 + NSSAI_SD0: 1 + NSSAI_SD1: 112233 + AMF_IP_ADDRESS: 192.168.71.132 + GNB_NGA_IF_NAME: eth0 + GNB_NGA_IP_ADDRESS: 192.168.71.136 + GNB_NGU_IF_NAME: eth0 + GNB_NGU_IP_ADDRESS: 192.168.71.136 + USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time + depends_on: + - oai-ext-dn + networks: + public_net: + ipv4_address: 192.168.71.136 + healthcheck: + test: /bin/bash -c "pgrep nr-softmodem" + interval: 10s + timeout: 5s + retries: 5 + oai-nr-ue: + image: oai-nr-ue:develop + privileged: true + container_name: rfsim5g-oai-nr-ue + environment: + RFSIMULATOR: 192.168.71.136 + FULL_IMSI: '208990100001100' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + NSSAI_SD: 1 + USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --band 66 -C 2169080000 --CO -400000000 -s 396 --nokrnmod --log_config.global_log_options level,nocolor,time + depends_on: + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.71.137 + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + public_net: + driver: bridge + name: rfsim5g-oai-public-net + ipam: + config: + - subnet: 192.168.71.128/26 + driver_opts: + com.docker.network.bridge.name: "rfsim5g-public" + traffic_net: + driver: bridge + name: rfsim5g-oai-traffic-net + ipam: + config: + - subnet: 192.168.72.128/26 + driver_opts: + com.docker.network.bridge.name: "rfsim5g-traffic" diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh new file mode 100755 index 0000000000..c92efb9f00 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -eo pipefail + +if [ "$MYSQL_ROOT_PASSWORD" ] && [ -z "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; then + echo >&2 'Healthcheck error: cannot determine root password (and MYSQL_USER and MYSQL_PASSWORD were not set)' + exit 0 +fi + +host="$(hostname --ip-address || echo '127.0.0.1')" +user="${MYSQL_USER:-root}" +export MYSQL_PWD="${MYSQL_PASSWORD:-$MYSQL_ROOT_PASSWORD}" + +args=( + # force mysql to not use the local "mysqld.sock" (test "external" connectivity) + -h"$host" + -u"$user" + --silent +) + +STATUS=0 +if command -v mysqladmin &> /dev/null; then + if mysqladmin "${args[@]}" ping > /dev/null; then + database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;") + if [[ -z $database_check ]]; then + echo "Healthcheck error: oai_db not populated" + STATUS=1 + fi + STATUS=0 + else + echo "Healthcheck error: Mysql port inactive" + STATUS=1 + fi +else + if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then + database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;") + if [[ -z $database_check ]]; then + echo "Healthcheck error: oai_db not populated" + STATUS=1 + fi + STATUS=0 + else + echo "Healthcheck error: Mysql port inactive" + STATUS=1 + fi +fi +exit $STATUS diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh new file mode 100755 index 0000000000..3479c092e8 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -eo pipefail + +STATUS=0 +NRF_IP_SBI_INTERFACE=$(ifconfig $NRF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'}) +NRF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$NRF_IP_SBI_INTERFACE:$NRF_INTERFACE_PORT_FOR_SBI") +#Check if entrypoint properly configured the conf file and no parameter is unset(optional) +NB_UNREPLACED_AT=`cat /openair-nrf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true` + +if [ $NB_UNREPLACED_AT -ne 0 ]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY configuration file is not configured properly" +fi + +if [[ -z $NRF_SBI_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $NRF_INTERFACE_PORT_FOR_SBI is not listening." +fi + +exit $STATUS \ No newline at end of file diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf new file mode 100644 index 0000000000..0c83ab8be9 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf @@ -0,0 +1,133 @@ +################################################################################ +# 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 +################################################################################ + +SMF = +{ + FQDN = "oai-smf-svc"; + INSTANCE = 0; # 0 is the default + PID_DIRECTORY = "/var/run"; # /var/run is the default + + INTERFACES : + { + N4 : + { + # SMF binded interface for N4 communication (UPF) + INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE + IPV4_ADDRESS = "read"; + }; + + SBI : + { + # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) + INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE + IPV4_ADDRESS = "read"; + PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80) + HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE + API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE + }; + + }; + + + # Pool of UE assigned IP addresses + # Do not make IP pools overlap + # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF + IP_ADDRESS_POOL : + { + IPV4_LIST = ( + {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. + {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. + {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. + + ); + IPV6_LIST = ( + {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. + {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. + {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. + ); + }; + + DNN_LIST = ( + # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} + {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1}, + {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1}, + {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1} + ); + + # DNS address communicated to UEs + DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE + DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE + DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE + DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE + + SUPPORT_FEATURES: + { + # STRING, {"yes", "no"}, + REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF + DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection + FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", + # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling + USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM + USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN + } + + AMF : + { + IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE + PORT = 80; # YOUR AMF CONFIG HERE (default: 80) + API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE + FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE + }; + + UDM : + { + IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE + PORT = 80; # YOUR UDM CONFIG HERE (default: 80) + API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE + FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE + }; + + NRF : + { + IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE + PORT = 80; # YOUR NRF CONFIG HERE (default: 80) + API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE + FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE + }; + + UPF_LIST = ( + {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE + ); + + LOCAL_CONFIGURATION : + { + SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( + { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, + QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", + QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}, + { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, + QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", + QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"} + ); + }; + +}; + diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql new file mode 100755 index 0000000000..fbd7907a71 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql @@ -0,0 +1,217 @@ +-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: oai_db +-- ------------------------------------------------------ +-- Server version 5.5.46-0ubuntu0.14.04.2 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `apn` +-- + +DROP TABLE IF EXISTS `apn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `apn` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `apn-name` varchar(60) NOT NULL, + `pdn-type` enum('IPv4','IPv6','IPv4v6','IPv4_or_IPv6') NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `apn-name` (`apn-name`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `apn` +-- + +LOCK TABLES `apn` WRITE; +/*!40000 ALTER TABLE `apn` DISABLE KEYS */; +/*!40000 ALTER TABLE `apn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mmeidentity` +-- + +DROP TABLE IF EXISTS `mmeidentity`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mmeidentity` ( + `idmmeidentity` int(11) NOT NULL AUTO_INCREMENT, + `mmehost` varchar(255) DEFAULT NULL, + `mmerealm` varchar(200) DEFAULT NULL, + `UE-Reachability` tinyint(1) NOT NULL COMMENT 'Indicates whether the MME supports UE Reachability Notifcation', + PRIMARY KEY (`idmmeidentity`) +) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mmeidentity` +-- + +LOCK TABLES `mmeidentity` WRITE; +/*!40000 ALTER TABLE `mmeidentity` DISABLE KEYS */; +INSERT INTO `mmeidentity` VALUES (2,'mme2.openair4G.eur','openair4G.eur',0),(1,'nano.openair4G.eur','openair4G.eur',0),(5,'abeille.openair4G.eur','openair4G.eur',0),(4,'yang.openair4G.eur','openair4G.eur',0),(3,'mme3.openair4G.eur','openair4G.eur',0),(6,'calisson.openair4G.eur','openair4G.eur',0); +/*!40000 ALTER TABLE `mmeidentity` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pdn` +-- + +DROP TABLE IF EXISTS `pdn`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pdn` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `apn` varchar(60) NOT NULL, + `pdn_type` enum('IPv4','IPv6','IPv4v6','IPv4_or_IPv6') NOT NULL DEFAULT 'IPv4', + `pdn_ipv4` varchar(15) DEFAULT '0.0.0.0', + `pdn_ipv6` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT '0:0:0:0:0:0:0:0', + `aggregate_ambr_ul` int(10) unsigned DEFAULT '50000000', + `aggregate_ambr_dl` int(10) unsigned DEFAULT '100000000', + `pgw_id` int(11) NOT NULL, + `users_imsi` varchar(15) NOT NULL, + `qci` tinyint(3) unsigned NOT NULL DEFAULT '9', + `priority_level` tinyint(3) unsigned NOT NULL DEFAULT '15', + `pre_emp_cap` enum('ENABLED','DISABLED') DEFAULT 'DISABLED', + `pre_emp_vul` enum('ENABLED','DISABLED') DEFAULT 'DISABLED', + `LIPA-Permissions` enum('LIPA-prohibited','LIPA-only','LIPA-conditional') NOT NULL DEFAULT 'LIPA-only', + PRIMARY KEY (`id`,`pgw_id`,`users_imsi`), + KEY `fk_pdn_pgw1_idx` (`pgw_id`), + KEY `fk_pdn_users1_idx` (`users_imsi`) +) ENGINE=MyISAM AUTO_INCREMENT=60 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pdn` +-- + +LOCK TABLES `pdn` WRITE; +/*!40000 ALTER TABLE `pdn` DISABLE KEYS */; +INSERT INTO `pdn` VALUES (1,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(41,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'20834123456789',9,15,'DISABLED','ENABLED','LIPA-only'),(40,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'20810000001234',9,15,'DISABLED','ENABLED','LIPA-only'),(42,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'31002890832150',9,15,'DISABLED','ENABLED','LIPA-only'),(16,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(43,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'001010123456789',9,15,'DISABLED','ENABLED','LIPA-only'),(2,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(3,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(4,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(5,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(6,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(7,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(8,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(9,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(10,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(11,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(12,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(13,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(14,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(15,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(17,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(18,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(19,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(20,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(21,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(22,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001100',9,15,'DISABLED','ENABLED','LIPA-only'),(23,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001101',9,15,'DISABLED','ENABLED','LIPA-only'),(24,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001102',9,15,'DISABLED','ENABLED','LIPA-only'),(25,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001103',9,15,'DISABLED','ENABLED','LIPA-only'),(26,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001104',9,15,'DISABLED','ENABLED','LIPA-only'),(27,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001105',9,15,'DISABLED','ENABLED','LIPA-only'),(28,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001106',9,15,'DISABLED','ENABLED','LIPA-only'),(29,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001107',9,15,'DISABLED','ENABLED','LIPA-only'),(30,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001108',9,15,'DISABLED','ENABLED','LIPA-only'),(31,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001109',9,15,'DISABLED','ENABLED','LIPA-only'),(32,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001110',9,15,'DISABLED','ENABLED','LIPA-only'),(33,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001111',9,15,'DISABLED','ENABLED','LIPA-only'),(34,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001112',9,15,'DISABLED','ENABLED','LIPA-only'),(35,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001113',9,15,'DISABLED','ENABLED','LIPA-only'),(44,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001113',9,15,'DISABLED','ENABLED','LIPA-only'),(45,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001112',9,15,'DISABLED','ENABLED','LIPA-only'),(46,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001111',9,15,'DISABLED','ENABLED','LIPA-only'),(47,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(48,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000008',9,15,'DISABLED','ENABLED','LIPA-only'),(49,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000009',9,15,'DISABLED','ENABLED','LIPA-only'),(50,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000010',9,15,'DISABLED','ENABLED','LIPA-only'),(51,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000011',9,15,'DISABLED','ENABLED','LIPA-only'),(52,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000012',9,15,'DISABLED','ENABLED','LIPA-only'),(53,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000013',9,15,'DISABLED','ENABLED','LIPA-only'),(54,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000014',9,15,'DISABLED','ENABLED','LIPA-only'),(55,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000015',9,15,'DISABLED','ENABLED','LIPA-only'),(56,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001118',9,15,'DISABLED','ENABLED','LIPA-only'),(57,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001121',9,15,'DISABLED','ENABLED','LIPA-only'),(58,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001120',9,15,'DISABLED','ENABLED','LIPA-only'),(59,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001119',9,15,'DISABLED','ENABLED','LIPA-only'); +/*!40000 ALTER TABLE `pdn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pgw` +-- + +DROP TABLE IF EXISTS `pgw`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pgw` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ipv4` varchar(15) NOT NULL, + `ipv6` varchar(39) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ipv4` (`ipv4`), + UNIQUE KEY `ipv6` (`ipv6`) +) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pgw` +-- + +LOCK TABLES `pgw` WRITE; +/*!40000 ALTER TABLE `pgw` DISABLE KEYS */; +INSERT INTO `pgw` VALUES (1,'127.0.0.1','0:0:0:0:0:0:0:1'),(2,'192.168.56.101',''),(3,'10.0.0.2','0'); +/*!40000 ALTER TABLE `pgw` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `terminal-info` +-- + +DROP TABLE IF EXISTS `terminal-info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `terminal-info` ( + `imei` varchar(15) NOT NULL, + `sv` varchar(2) NOT NULL, + UNIQUE KEY `imei` (`imei`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `terminal-info` +-- + +LOCK TABLES `terminal-info` WRITE; +/*!40000 ALTER TABLE `terminal-info` DISABLE KEYS */; +/*!40000 ALTER TABLE `terminal-info` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `imsi` varchar(15) NOT NULL COMMENT 'IMSI is the main reference key.', + `msisdn` varchar(46) DEFAULT NULL COMMENT 'The basic MSISDN of the UE (Presence of MSISDN is optional).', + `imei` varchar(15) DEFAULT NULL COMMENT 'International Mobile Equipment Identity', + `imei_sv` varchar(2) DEFAULT NULL COMMENT 'International Mobile Equipment Identity Software Version Number', + `ms_ps_status` enum('PURGED','NOT_PURGED') DEFAULT 'PURGED' COMMENT 'Indicates that ESM and EMM status are purged from MME', + `rau_tau_timer` int(10) unsigned DEFAULT '120', + `ue_ambr_ul` bigint(20) unsigned DEFAULT '50000000' COMMENT 'The Maximum Aggregated uplink MBRs to be shared across all Non-GBR bearers according to the subscription of the user.', + `ue_ambr_dl` bigint(20) unsigned DEFAULT '100000000' COMMENT 'The Maximum Aggregated downlink MBRs to be shared across all Non-GBR bearers according to the subscription of the user.', + `access_restriction` int(10) unsigned DEFAULT '60' COMMENT 'Indicates the access restriction subscription information. 3GPP TS.29272 #7.3.31', + `mme_cap` int(10) unsigned zerofill DEFAULT NULL COMMENT 'Indicates the capabilities of the MME with respect to core functionality e.g. regional access restrictions.', + `mmeidentity_idmmeidentity` int(11) NOT NULL DEFAULT '0', + `key` varbinary(16) NOT NULL DEFAULT '0' COMMENT 'UE security key', + `RFSP-Index` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'An index to specific RRM configuration in the E-UTRAN. Possible values from 1 to 256', + `urrp_mme` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'UE Reachability Request Parameter indicating that UE activity notification from MME has been requested by the HSS.', + `sqn` bigint(20) unsigned zerofill NOT NULL, + `rand` varbinary(16) NOT NULL, + `OPc` varbinary(16) DEFAULT NULL COMMENT 'Can be computed by HSS', + PRIMARY KEY (`imsi`,`mmeidentity_idmmeidentity`), + KEY `fk_users_mmeidentity_idx1` (`mmeidentity_idmmeidentity`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `users` +-- + +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +INSERT INTO `users` VALUES ('20834123456789','380561234567','35609204079300',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,'+�E��ų\0�,IH��H',0,0,00000000000000000096,'Px�X \Z1��x��','^��K�����FeU���'),('20810000001234','33611123456','35609204079299',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000281454575616225,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','�4�s@���z��~�'),('31002890832150','33638060059','35611302209414',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012416,'`�F�݆��D��ϛ���','�4�s@���z��~�'),('001010123456789','33600101789','35609204079298',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'\0 \n \r',1,0,00000000000000000351,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','L�*\\�����^��]� '),('208930000000001','33638030001','35609204079301',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000002','33638050002','35609204079502',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000020471,'\0 \n \r','�4�s@���z��~�'),('208950000000003','33638050003','35609204079503',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012343,'\0 \n \r','�4�s@���z��~�'),('208950000000004','33638050004','35609204079504',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000005','33638050005','35609204079505',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000001','33638050001','35609204079501',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000006','33638050006','35609204079506',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000007','33638050007','35609204079507',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208930000000002','33638030002','35609204079302',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000003','33638030003','35609204079303',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000004','33638030004','35609204079304',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000005','33638030005','35609204079305',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000006','33638030006','35609204079306',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000007','33638030007','35609204079307',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000007','33638040007','35609204079407',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000006','33638040006','35609204079406',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000005','33638040005','35609204079405',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000004','33638040004','35609204079404',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000003','33638040003','35609204079403',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000002','33638040002','35609204079402',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000001','33638040001','35609204079401',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208920100001100','33638020001','35609204079201',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001101','33638020001','35609204079201',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204937234,'\0 \n \r','�$I6;��+f�k�u�|�'),('208920100001102','33638020002','35609204079202',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001103','33638020003','35609204079203',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001104','33638020004','35609204079204',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001105','33638020005','35609204079205',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001106','33638020006','35609204079206',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000000000000006103,'ebd07771ace8677a','�$I6;��+f�k�u�|�'),('208920100001107','33638020007','35609204079207',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001108','33638020008','35609204079208',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001109','33638020009','35609204079209',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001110','33638020010','35609204079210',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001111','33638030011','35609304079211',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001112','33638030012','35609304079212',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001113','33638030013','35609304079213',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006263,'�SNܒ�Iv��e�6','�4�s@���z��~�'),('208950000000008','33638050008','35609204079508',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000009','33638050009','35609204079509',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000010','33638050010','35609204079510',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000011','33638050011','35609204079511',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000012','33638050012','35609204079512',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000013','33638050013','35609204079513',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000014','33638050014','35609204079514',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000015','33638050015','35609204079515',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000000000,'3536663032363164','�4�s@���z��~�'),('208920100001118','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204934762,'~?03�u-%�ey�y�','�$I6;��+f�k�u�|�'),('208920100001121','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'&��@xg�]���\n��Vp','�$I6;��+f�k�u�|�'),('208920100001119','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'269482407867805d','�$I6;��+f�k�u�|�'),('208920100001120','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'3236393438323430','�$I6;��+f�k�u�|�'); +INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); +INSERT INTO `users` VALUES ('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000032','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000033','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000034','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000035','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000036','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000037','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000038','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000039','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +INSERT INTO `users` VALUES ('208950000000040','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2016-06-28 11:41:40 diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh new file mode 100755 index 0000000000..d9ff7608e8 --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -eo pipefail + +STATUS=0 +SMF_IP_SBI_INTERFACE=$(ifconfig $SMF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'}) +SMF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$SMF_IP_SBI_INTERFACE:$SMF_INTERFACE_PORT_FOR_SBI") + +#Check if entrypoint properly configured the conf file and no parameter is unset(optional) +#NB_UNREPLACED_AT=`cat /openair-smf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true` + +#if [ $NB_UNREPLACED_AT -ne 0 ]; then +# STATUS=-1 +# echo "Healthcheck error: UNHEALTHY configuration file is not configured properly" +#fi +# +if [[ -z $SMF_SBI_PORT_STATUS ]]; then + STATUS=-1 + echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $SMF_INTERFACE_PORT_FOR_SBI is not listening." +fi + +exit $STATUS diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh new file mode 100755 index 0000000000..0e3b67ee7e --- /dev/null +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -eo pipefail + +STATUS=0 +SGW_PORT_FOR_S1U_S12_S4_UP=2152 +SGW_PORT_FOR_SX=8805 +SGW_IP_S1U_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP | grep inet | awk {'print $2'}) +SGW_IP_SX_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_SX | grep inet | awk {'print $2'}) +S1U_S12_S4_UP_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_S1U_INTERFACE:$SGW_PORT_FOR_S1U_S12_S4_UP") +SX_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_SX_INTERFACE:$SGW_PORT_FOR_SX") +#Check if entrypoint properly configured the conf file and no parameter is unset (optional) +NB_UNREPLACED_AT=`cat /openair-spgwu/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true` +if [ $NB_UNREPLACED_AT -ne 0 ]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY configuration file is not configured properly" +fi + +if [[ -z $S1U_S12_S4_UP_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY S1U port $SGW_PORT_FOR_S1U_S12_S4_UP is not listening." +fi + +if [[ -z $SX_PORT_STATUS ]]; then + STATUS=1 + echo "Healthcheck error: UNHEALTHY SX port $SGW_PORT_FOR_SX is not listening." +fi + +exit $STATUS \ No newline at end of file diff --git a/docker/scripts/gnb_entrypoint.sh b/docker/scripts/gnb_entrypoint.sh index 79d6c6dc37..aec5c48050 100755 --- a/docker/scripts/gnb_entrypoint.sh +++ b/docker/scripts/gnb_entrypoint.sh @@ -10,6 +10,7 @@ THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD} if [[ -v USE_NSA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fi +if [[ -v USE_SA_FDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.fdd.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_CU ]]; then ln -s $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_TDD_CU ]]; then cp $PREFIX/etc/gnb.sa.du.tdd.conf $PREFIX/etc/gnb.conf; fi # Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself. diff --git a/docker/scripts/gnb_parameters.yaml b/docker/scripts/gnb_parameters.yaml index 2f150d394a..8547d48e67 100644 --- a/docker/scripts/gnb_parameters.yaml +++ b/docker/scripts/gnb_parameters.yaml @@ -94,6 +94,36 @@ - key: parallel_config env: "@THREAD_PARALLEL_CONFIG@" + - filePrefix: gnb.sa.band66.fr1.106PRB.usrpn300.conf + outputfilename: "gnb.sa.fdd.conf" + config: + - key: Active_gNBs + env: "@GNB_NAME@" + - key: gNB_name + env: "@GNB_NAME@" + - key: mcc + env: "@MCC@" + - key: mnc + env: "@MNC@" + - key: mnc_length + env: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: sst + env: "@NSSAI_SST@" + - key: ipv4 + env: "@AMF_IP_ADDRESS@" + - key: GNB_INTERFACE_NAME_FOR_NG_AMF + env: "@GNB_NGA_IF_NAME@" + - key: GNB_IPV4_ADDRESS_FOR_NG_AMF + env: "@GNB_NGA_IP_ADDRESS@" + - key: GNB_INTERFACE_NAME_FOR_NGU + env: "@GNB_NGU_IF_NAME@" + - key: GNB_IPV4_ADDRESS_FOR_NGU + env: "@GNB_NGU_IP_ADDRESS@" + - key: parallel_config + env: "@THREAD_PARALLEL_CONFIG@" + - filePrefix: gNB_SA_CU.conf outputfilename: "gnb.sa.cu.conf" config: From 9cd14735de0aac74d20052ad9ffa1095a2d7882b Mon Sep 17 00:00:00 2001 From: Masayuki Harada Date: Tue, 1 Feb 2022 17:22:58 +0900 Subject: [PATCH 347/883] Fix compile error and remove warning. --- openair2/RRC/NR/rrc_gNB.c | 5 ++--- openair2/RRC/NR/rrc_gNB_NGAP.c | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 85769da82a..84b8193ba8 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1096,7 +1096,6 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( uint8_t buffer[RRC_BUF_SIZE]; uint16_t size; int qos_flow_index = 0; - NR_QFI_t qfi = 0; int i, j; uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id); @@ -1199,8 +1198,8 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( dedicatedNAS_MessageList = NULL; } - memset(buffer, 0, RRC_BUF_SIZE); - size = do_RRCReconfiguration(ctxt_pP, buffer, + memset(buffer, 0, sizeof(buffer)); + size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer), xid, NULL, DRB_configList2, diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index fdaaf0b5d6..47e994f645 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1274,6 +1274,7 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( return (0); } } + return 0; } //------------------------------------------------------------------------------ From 50e7f379d00933234e4068c48b11ccc253605cf2 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 31 Jan 2022 11:16:39 +0100 Subject: [PATCH 348/883] fix results HTML conf file to see OAIUE results --- ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml b/ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml index 144fcd25a5..8b311cf6ac 100644 --- a/ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml +++ b/ci-scripts/ran_dashboard/ran_dashboard_cfg.yaml @@ -2,7 +2,7 @@ LTE-2x2 : #short name used in the dashboard job : 'RAN-LTE-2x2-Module-OAIEPC' #job name from Jenkins, used in the database link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-LTE-2x2-Module-OAIEPC' bench : 'Obelix-N310-OAIEPC-Quectel(nrmodule2)' - test : 'TDD, 40MHz, MCS9, 26Mb DL, 7Mb UL' + test : 'TM1 + TM2, TDD, 40MHz, MCS9, 26Mb DL, 7Mb UL' NSA-B200 : job : 'RAN-NSA-B200-Module-LTEBOX' link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-NSA-B200-Module-LTEBOX' @@ -18,14 +18,9 @@ SA-N310 : link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-Module-CN5G' bench : 'Asterix-N310-OAICN5G-Quectel(nrmodule2)' test : 'TDD, 40MHz, 60Mb DL, 3Mb UL' -SA-OAIUE-B200 : - job : 'RAN-SA-OAIUE-B200-CN5G' - link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-OAIUE-B200-CN5G/' - bench : 'Asterix-N310-OAICN5G-OAIUE-B200' - test : 'TDD, 40MHz, Ping, (to be implemented : iperf)' -SA-OAIUE-N310 : - job : 'RAN-SA-OAIUE-N310-CN5G' - link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-OAIUE-N310-CN5G/' +SA-OAIUE-N310-X300 : + job : 'RAN-SA-OAIUE-N310-X300-CN5G' + link : 'https://jenkins-oai.eurecom.fr/view/RAN/job/RAN-SA-OAIUE-N310-X300-CN5G/' bench : 'Asterix-N310-OAICN5G-OAIUE-N310' test : 'TDD, 40MHz, Ping, (to be implemented : iperf)' From c4a3f569650375f903904210fb9e6b6a954c65d6 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 31 Jan 2022 11:35:44 +0100 Subject: [PATCH 349/883] fix stats logs concatenation --- ci-scripts/stats_monitor.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py index e4dcc53bc2..d7cad7ae55 100755 --- a/ci-scripts/stats_monitor.py +++ b/ci-scripts/stats_monitor.py @@ -60,18 +60,17 @@ class StatMonitor(): self.d[node_type]['mcs'].append(int(result.group(4))) - def collect(self,node_type): + def collect(self,testcase_id,node_type): if node_type=='enb': files = ["L1_stats.log", "MAC_stats.log", "PDCP_stats.log", "RRC_stats.log"] else: #'gnb' files = ["nrL1_stats.log", "nrMAC_stats.log", "nrPDCP_stats.log", "nrRRC_stats.log"] - # append each file's contents to another file (prepended with CI-) for - # post-mortem/debugging analysis - #for f in files: - # cmd = 'cat '+ f + ' >> CI-' + f - # if os.path.isfile(f): - # subprocess.Popen(cmd,shell=True) - # join the files for further processing + #append each file's contents to another file (prepended with CI-) for debug + for f in files: + if os.path.isfile(f): + cmd = 'cat '+ f + ' >> CI-'+testcase_id+'-'+f + subprocess.Popen(cmd,shell=True) + #join the files for further processing cmd='cat ' for f in files: if os.path.isfile(f): @@ -130,7 +129,7 @@ if __name__ == "__main__": process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() while len(output)!=0 : - mon.collect(node) + mon.collect(testcase_id,node) process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE) output = process.stdout.readlines() time.sleep(1) From aa6f6361983c000416bea3540e278e81c42ca9b7 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 1 Feb 2022 10:25:39 +0100 Subject: [PATCH 350/883] adding log_e for ulsch segmentation --- openair1/PHY/INIT/nr_init_ue.c | 1 + openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 6 ++++++ openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 93339b4cd2..853240b3eb 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -66,6 +66,7 @@ extern uint16_t beta_cqi[16]; */ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch, const NR_DL_FRAME_PARMS *const fp) { + AssertFatal( pdsch, "pdsch==0" ); pdsch->pmi_ext = (uint8_t *)malloc16_clear( fp->N_RB_DL ); pdsch->llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) ); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 01b6be91ab..38b4465de8 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -554,6 +554,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, &harq_process->F, p_decParams->BG); + if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*n_layers) { + LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B); + return(-1); + } + + #ifdef DEBUG_ULSCH_DECODING printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z); if (!frame%100) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index 5a9fbd9648..f275304185 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -321,6 +321,11 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue, pz, &harq_process->F, harq_process->BG); + + if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*harq_process->pusch_pdu.nrOfLayers) { + LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B); + return(-1); + } stop_meas(&ue->ulsch_segmentation_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT); From d937e6e2c09c49e25764e1aeb81d5bcf2fd2a89e Mon Sep 17 00:00:00 2001 From: Masayuki Harada Date: Tue, 1 Feb 2022 19:06:51 +0900 Subject: [PATCH 351/883] Fix some problems. --- openair2/RRC/NR/rrc_gNB.c | 4 +--- openair2/RRC/NR/rrc_gNB_NGAP.c | 8 +++----- openair2/RRC/NR/rrc_gNB_NGAP.h | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 84b8193ba8..1520bda2ec 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1081,7 +1081,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( } //----------------------------------------------------------------------------- -int +void rrc_gNB_modify_dedicatedRRCReconfiguration( const protocol_ctxt_t *const ctxt_pP, rrc_gNB_ue_context_t *ue_context_pP) @@ -1258,8 +1258,6 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( buffer, PDCP_TRANSMISSION_MODE_CONTROL); #endif - - return 0; } //----------------------------------------------------------------------------- diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 47e994f645..00ee9de3a0 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1156,7 +1156,7 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( continue; } - //Check same PDU session ID to handle multiple pdu session id + //Check if same PDU session ID to handle multiple pdu sessions for (j = i+1; j < nb_pdusessions_tomodify; j++) { if (is_treated[j] == FALSE && NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id == @@ -1240,9 +1240,7 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( if (ue_context_p->ue_context.nb_of_failed_pdusessions < ue_context_p->ue_context.nb_of_modify_pdusessions) { LOG_D(NR_RRC, "generate RRCReconfiguration \n"); - if (0 == rrc_gNB_modify_dedicatedRRCReconfiguration(&ctxt, ue_context_p)) { - return (0); - } + rrc_gNB_modify_dedicatedRRCReconfiguration(&ctxt, ue_context_p); } else { // all pdu modification failed LOG_I(NR_RRC, "pdu session modify failed, fill NGAP_PDUSESSION_MODIFY_RESP with the pdu session information that failed to modify \n"); uint8_t nb_of_pdu_sessions_failed = 0; @@ -1354,7 +1352,7 @@ rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP( pdu_sessions_failed++; } } else { - LOG_D(NR_RRC,"xid does not corresponds (context pdu session index %d, status %d, xid %d/%d) \n ", + LOG_D(NR_RRC,"xid does not correspond (context pdu session index %d, status %d, xid %d/%d) \n ", i, ue_context_pP->ue_context.modify_pdusession[i].status, xid, ue_context_pP->ue_context.modify_pdusession[i].xid); } } diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.h b/openair2/RRC/NR/rrc_gNB_NGAP.h index 86faedc37e..5833c8aac2 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.h +++ b/openair2/RRC/NR/rrc_gNB_NGAP.h @@ -122,7 +122,7 @@ rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP( uint8_t xid ); -int +void rrc_gNB_modify_dedicatedRRCReconfiguration( const protocol_ctxt_t *const ctxt_pP, rrc_gNB_ue_context_t *ue_context_pP From 57c77a47817c440e8860320a55443d540e192a13 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Feb 2022 11:22:06 +0100 Subject: [PATCH 352/883] Update log level colors after adding analysis level Analysis level is green. --- common/utils/LOG/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index 0679e0b521..e014cfbcf6 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -86,8 +86,8 @@ mapping log_options[] = { mapping log_maskmap[] = LOG_MASKMAP_INIT; -char *log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */ -char *log_level_highlight_end[] = {LOG_RESET,LOG_RESET,LOG_RESET, LOG_RESET,LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */ +char *log_level_highlight_start[] = {LOG_RED, LOG_ORANGE, LOG_GREEN, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */ +char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */ static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args); From 5edcbc91fc31e5586ce9ab4a5c0e9c4452f13319 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Feb 2022 12:06:36 +0100 Subject: [PATCH 353/883] Write first color code, enable function name only --- common/utils/LOG/log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index e014cfbcf6..29e4f718c6 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -529,6 +529,8 @@ static inline int log_header(log_component_t *c, snprintf(l, sizeof l, "(%s:%d) ", func, line); else if (flag & FLAG_FILE_LINE) snprintf(l, sizeof l, "(%d) ", line); + else if (flag & FLAG_FUNCT) + snprintf(l, sizeof l, "(%s) ", func); else l[0] = 0; @@ -551,8 +553,8 @@ static inline int log_header(log_component_t *c, threadIdString[0] = 0; } return snprintf(log_buffer, buffsize, "%s%s%s[%s] %c %s%s", - timeString, flag & FLAG_NOCOLOR ? "" : log_level_highlight_start[level], + timeString, threadIdString, c->name, flag & FLAG_LEVEL ? g_log->level2string[level] : ' ', From 0a8c037735518680abf8e31cb7f35b816b3a10d0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Feb 2022 13:14:48 +0100 Subject: [PATCH 354/883] Set default log level to info --- common/utils/LOG/log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 42e49747a1..46c73427c1 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -392,7 +392,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int /* optname help paramflags XXXptr defXXXval type numelt */ /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define LOG_GLOBALPARAMS_DESC { \ - {LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \ + {LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[3].name, TYPE_STRING, 0}, \ {LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \ {LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST, 0} \ } From 761d154fe7534caa1b192a3166375ba276e8c25f Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 1 Feb 2022 13:33:17 +0000 Subject: [PATCH 355/883] Update addconsoletrace.md --- common/utils/LOG/DOC/addconsoletrace.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/utils/LOG/DOC/addconsoletrace.md b/common/utils/LOG/DOC/addconsoletrace.md index 9ab90cf120..d5ede8c57d 100644 --- a/common/utils/LOG/DOC/addconsoletrace.md +++ b/common/utils/LOG/DOC/addconsoletrace.md @@ -3,6 +3,7 @@ ```C LOG_E(,,,...) LOG_W(,,,...) +LOG_A(,,,...) LOG_I(,,,...) LOG_D(,,,...) LOG_T(,,,...) @@ -14,9 +15,10 @@ these macros are used in place of the printf C function. The additionnal ***comp |:---------|:---------------|:---------------|----------------:| | LOG_E | E | 0 | error | | LOG_W | W | 1 | warning | -| LOG_I | I | 2 | informational | -| LOG_D | D | 3 | debug | -| LOG_T | T | 4 | trace | +| LOG_A | A | 2 | analysis | +| LOG_I | I | 3 | informational | +| LOG_D | D | 4 | debug | +| LOG_T | T | 5 | trace | component list is defined as an `enum` in [log.h](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/LOG/log.h). A new component can be defined by adding an item in this type, it must also be defined in the T tracer [T_messages.txt ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/T/T_messages.txt). From cfa636ce5f745484ffaf46534519fbc6d416e9c5 Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 1 Feb 2022 13:36:30 +0000 Subject: [PATCH 356/883] Update rtusage.md --- common/utils/LOG/DOC/rtusage.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md index d7c748952d..349045b65f 100644 --- a/common/utils/LOG/DOC/rtusage.md +++ b/common/utils/LOG/DOC/rtusage.md @@ -7,9 +7,9 @@ All logging facility parameters are defined in the log_config section. Some para | name | type | default | description | |:---:|:---:|:---:|:----| -| `global_log_level` | `pre-defined string of char` | `info` | Allows printing of messages up to the specified level. Available levels, from lower to higher are `error`,`warn`,`info`,`debug`,`trace` | +| `global_log_level` | `pre-defined string of char` | `info` | Allows printing of messages up to the specified level. Available levels, from lower to higher are `error`,`warn`,`analysis`,`info`,`debug`,`trace` | | `global_log_online` | `boolean` | 1 (=true) | If false, all console messages are discarded, whatever their level | -| `global_log_options` | `list of pre-defined string of char` | | 3 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,W,E for trace, debug, info, warning, error),`thread`, add the thread name in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts| +| `global_log_options` | `list of pre-defined string of char` | | 5 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,A,W,E for trace, debug, info, analysis, warning, error),`thread`, add the thread name in the message header, thread_id, adds the thread ID in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts| ### Component specific parameters | name | type | default | description | From af6d95a3484c4f809e417055e64d6e552c0c4600 Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 1 Feb 2022 13:37:06 +0000 Subject: [PATCH 357/883] Update rtusage.md --- common/utils/LOG/DOC/rtusage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md index 349045b65f..041c29e688 100644 --- a/common/utils/LOG/DOC/rtusage.md +++ b/common/utils/LOG/DOC/rtusage.md @@ -9,7 +9,7 @@ All logging facility parameters are defined in the log_config section. Some para |:---:|:---:|:---:|:----| | `global_log_level` | `pre-defined string of char` | `info` | Allows printing of messages up to the specified level. Available levels, from lower to higher are `error`,`warn`,`analysis`,`info`,`debug`,`trace` | | `global_log_online` | `boolean` | 1 (=true) | If false, all console messages are discarded, whatever their level | -| `global_log_options` | `list of pre-defined string of char` | | 5 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,A,W,E for trace, debug, info, analysis, warning, error),`thread`, add the thread name in the message header, thread_id, adds the thread ID in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts| +| `global_log_options` | `list of pre-defined string of char` | | 5 options can be specified to trigger the information added in the header of the message: `nocolor`, disable color usage in log messages, usefull when redirecting logs to a file, where escape sequences used for color selection can be annoying, `level`, add a one letter level id in the message header (T,D,I,A,W,E for trace, debug, info, analysis, warning, error),`thread`, add the thread name in the message header, `thread_id`, adds the thread ID in the message header, `function`, adds the function name, `line_num`, adds the line number, `time` adds the time since process starts| ### Component specific parameters | name | type | default | description | From 5e182c4e50ccaccda53cecd20f9717528b86a37e Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 1 Feb 2022 05:41:24 -0800 Subject: [PATCH 358/883] Adding a few more LOG_A's for critical milestones --- openair2/RRC/NR/rrc_gNB.c | 4 ++-- openair3/NAS/NR_UE/nr_nas_msg_sim.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2c2020412d..3708e188a8 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -617,7 +617,7 @@ rrc_gNB_process_RRCSetupComplete( ) //----------------------------------------------------------------------------- { - LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing NR_RRCSetupComplete from UE (SRB1 Active)\n", + LOG_A(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing NR_RRCSetupComplete from UE (SRB1 Active)\n", PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)); ue_context_pP->ue_context.Srb1.Active = 1; ue_context_pP->ue_context.Srb1.Srb_info.Srb_id = 1; @@ -1347,7 +1347,7 @@ rrc_gNB_process_RRCReconfigurationComplete( for (int i = 0; i < DRB_configList->list.count; i++) { if (DRB_configList->list.array[i]) { drb_id = (int)DRB_configList->list.array[i]->drb_Identity; - LOG_I(NR_RRC, "[gNB %d] Frame %d : Logical Channel UL-DCCH, Received NR_RRCReconfigurationComplete from UE rnti %x, reconfiguring DRB %d\n", + LOG_A(NR_RRC, "[gNB %d] Frame %d : Logical Channel UL-DCCH, Received NR_RRCReconfigurationComplete from UE rnti %x, reconfiguring DRB %d\n", ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 2628c5b0b2..7cf1378d8b 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -674,7 +674,7 @@ void decodeDownlinkNASTransport(as_nas_info_t *initialNasMsg, uint8_t * pdu_buff sprintf(baseNetAddress, "%d.%d", *(pdu_buffer + 39),*(pdu_buffer + 40)); int third_octet = *(pdu_buffer + 41); int fourth_octet = *(pdu_buffer + 42); - LOG_I(NAS, "Received PDU Session Establishment Accept\n"); + LOG_A(NAS, "Received PDU Session Establishment Accept\n"); nas_config(1,third_octet,fourth_octet,"ue"); } else { LOG_E(NAS, "Received unexpected message in DLinformationTransfer %d\n", msg_type); From 19bb8fd537b1a950d1faa727da0844f756aa4737 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 1 Feb 2022 15:27:20 +0100 Subject: [PATCH 359/883] tentative fix for RRC reconfiguration after UE capabilities --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 1 + openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 ++ openair2/RRC/NR/rrc_gNB.c | 8 +++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7b7b5c771b..300fc66ada 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -336,6 +336,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->mcsTableIdx = 2; } else ps->mcsTableIdx = 0; + LOG_D(NR_MAC,"MCS Table Index: %d\n",ps->mcsTableIdx); if(dci_format == 0) // format 1_0 ps->numDmrsCdmGrpsNoData = (ps->nrOfSymbols == 2 ? 1 : 2); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 116f1e1ba2..b5b5d51b51 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1402,6 +1402,8 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_UE_NR_Capability_t *uecap) { NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig; + if (SpCellConfig == NULL) return; + NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon; NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index d7556b3290..bf2c42bd83 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -748,6 +748,8 @@ rrc_gNB_generate_defaultRRCReconfiguration( dedicatedNAS_MessageList = NULL; } + gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id]; + gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context; memset(buffer, 0, sizeof(buffer)); size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer), xid, @@ -758,10 +760,10 @@ rrc_gNB_generate_defaultRRCReconfiguration( NULL, NULL, dedicatedNAS_MessageList, + ue_context_pP, + &rrc->carrier, NULL, - NULL, - NULL, - NULL); + ue_p->masterCellGroup); free(ue_context_pP->ue_context.nas_pdu.buffer); From 86560439e73d22ca0e3341fda5c5694968104a84 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 1 Feb 2022 21:55:49 +0100 Subject: [PATCH 360/883] nr-softmodem fixed after merge` --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 3 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 91187a88f8..a4ef3e425f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -580,14 +580,14 @@ bool allocate_dl_retransmission(module_id_t module_id, } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ + NR_pdsch_semi_static_t temp_ps = *ps; + nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd,tda, ps->nrOfLayers, sched_ctrl, &temp_ps); while (rbStart < bwpSize && !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbStart++; while (rbStart + rbSize < bwpSize && (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbSize++; - NR_pdsch_semi_static_t temp_ps = *ps; - nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd,tda, ps->nrOfLayers, sched_ctrl, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 633ff0e54c..40890cf258 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -284,7 +284,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ps->nrOfLayers = target_dl_Nl; if (ps->time_domain_allocation != tda) nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps); + scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, target_dl_Nl, sched_ctrl,ps); /* find largest unallocated chunk */ const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); @@ -389,7 +389,6 @@ void nr_preprocessor_phytest(module_id_t module_id, sched_pdsch->pucch_allocation = alloc; sched_pdsch->rbStart = rbStart; sched_pdsch->rbSize = rbSize; - const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; if (ps->time_domain_allocation != tda || ps->nrOfLayers != target_dl_Nl) nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, target_dl_Nl, sched_ctrl, ps); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 21e8419884..24a01fe8ea 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2137,7 +2137,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG UE_info->CellGroup[UE_id] = CellGroup; add_nr_list(&UE_info->list, UE_id); memset(&UE_info->mac_stats[UE_id], 0, sizeof(NR_mac_stats_t)); - set_Y(UE_info->Y[UE_id], rntiP); if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated && From 01f2b5a16c1754ff33e8e59eb791fde3ee1879f6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 2 Feb 2022 10:23:01 +0100 Subject: [PATCH 361/883] Reset B200 device before a new run --- ci-scripts/cls_containerize.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 37e22acc3c..e606513935 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -506,6 +506,7 @@ class Containerize(): # mySSH.command('sed -i -e "s/FLEXRAN_ENABLED:.*$/FLEXRAN_ENABLED: \'no\'/" ci-docker-compose.yml', '\$', 2) # mySSH.command('sed -i -e "s/CI_FLEXRAN_CTL_IP_ADDR/127.0.0.1/" ci-docker-compose.yml', '\$', 2) # Currently support only one + mySSH.command('echo ' + lPassWord + ' | sudo -S b2xx_fx3_utils --reset-device', '\$', 15) mySSH.command('docker-compose --file ci-docker-compose.yml config --services | sed -e "s@^@service=@" 2>&1', '\$', 10) result = re.search('service=(?P[a-zA-Z0-9\_]+)', mySSH.getBefore()) if result is not None: From dc5cdd4e103585b2d43d357d617b1f7f73ed55b6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Feb 2022 15:03:43 +0100 Subject: [PATCH 362/883] fix in xlsch bytes for memory allocation --- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 2 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 819fccc588..6156236953 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -108,7 +108,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, a_segments = a_segments/273 +1; } - uint16_t dlsch_bytes = a_segments*1056; // allocated bytes per segment + uint32_t dlsch_bytes = a_segments*1056; // allocated bytes per segment NR_gNB_DLSCH_t *dlsch = malloc16(sizeof(NR_gNB_DLSCH_t)); AssertFatal(dlsch, "cannot allocate dlsch\n"); bzero(dlsch,sizeof(NR_gNB_DLSCH_t)); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 33071e4070..31d44736d4 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -119,7 +119,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint a_segments = a_segments/273 +1; } - uint16_t ulsch_bytes = a_segments*1056; // allocated bytes per segment + uint32_t ulsch_bytes = a_segments*1056; // allocated bytes per segment ulsch = (NR_gNB_ULSCH_t *)malloc16_clear(sizeof(NR_gNB_ULSCH_t)); ulsch->max_ldpc_iterations = max_ldpc_iterations; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 7360eff494..c4d709c77d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -141,7 +141,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint a_segments = (a_segments/273)+1; } - uint16_t dlsch_bytes = a_segments*1056; // allocated bytes per segment + uint32_t dlsch_bytes = a_segments*1056; // allocated bytes per segment dlsch = (NR_UE_DLSCH_t *)malloc16(sizeof(NR_UE_DLSCH_t)); if (dlsch) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index b2e2476670..553d4fa4f7 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -118,7 +118,7 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, a_segments = a_segments/273 +1; } - uint16_t ulsch_bytes = a_segments*1056; // allocated bytes per segment + uint32_t ulsch_bytes = a_segments*1056; // allocated bytes per segment ulsch = (NR_UE_ULSCH_t *)malloc16(sizeof(NR_UE_ULSCH_t)); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 6dc770f0ed..2065bfffb7 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -280,7 +280,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, UE_info->CellGroup[0], sched_ctrl->active_bwp, NULL, - /* tda = */ 0, + /* tda = */ 2, dci_format, ps); From 8564ed55aba214e5f7e97861f51407d119716e07 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 2 Feb 2022 15:11:20 +0100 Subject: [PATCH 363/883] fix(ci): dummy commit to retrigger CI after ubuntu access issues Signed-off-by: Raphael Defosseux --- ci-scripts/cls_static_code_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_static_code_analysis.py b/ci-scripts/cls_static_code_analysis.py index 1680f3e560..c899a9aabd 100644 --- a/ci-scripts/cls_static_code_analysis.py +++ b/ci-scripts/cls_static_code_analysis.py @@ -121,7 +121,7 @@ class StaticCodeAnalysis(): mySSH.command('docker build --tag oai-cppcheck:xenial --file ci-scripts/docker/Dockerfile.cppcheck.xenial . > cmake_targets/log/cppcheck-xenial.txt 2>&1', '\$', 600) mySSH.command('sed -e "s@xenial@bionic@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.bionic', '\$', 6) mySSH.command('docker build --tag oai-cppcheck:bionic --file ci-scripts/docker/Dockerfile.cppcheck.bionic . > cmake_targets/log/cppcheck-bionic.txt 2>&1', '\$', 600) - mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 60) + mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 30) # Analyzing the logs mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5) From aa9e30691b50d4c831d617ba3c8c2d238ff19375 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 14:53:36 +0000 Subject: [PATCH 364/883] Fix DCI formats --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 16 +++++++--------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 9 +++++++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 13 ++++--------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index ea298494c4..ff2e037e4c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -788,7 +788,9 @@ void pf_dl(module_id_t module_id, AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n"); NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; + const long f = ((sched_ctrl->active_bwp || bwpd) && sched_ctrl->search_space && + sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) ? + sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; if (ps->time_domain_allocation != tda) nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -1161,14 +1163,10 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_payload.tpc, pucch->timing_indicator); - const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; - int dci_format; - if (sched_ctrl->search_space) { - dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; - } - else { - dci_format = NR_DL_DCI_FORMAT_1_0; - } + int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType && + sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific ? + NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0; + const int rnti_type = NR_RNTI_C; fill_dci_pdu_rel15(scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c0107c5fc6..1ded933a62 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -374,7 +374,10 @@ void nr_preprocessor_phytest(module_id_t module_id, sched_pdsch->rbStart = rbStart; sched_pdsch->rbSize = rbSize; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; - const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; + const long f = (sched_ctrl->active_bwp && sched_ctrl->search_space && + sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) ? + sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; + ps->nrOfLayers = target_dl_Nl; if (ps->time_domain_allocation != tda) nr_set_pdsch_semi_static( @@ -444,7 +447,9 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ if (!is_xlsch_in_slot(ulsch_slot_bitmap, sched_slot)) return false; - const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; + const long f = (sched_ctrl->active_bwp && sched_ctrl->search_space && + sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) ? + sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; const int dci_format = f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0; const uint8_t num_dmrs_cdm_grps_no_data = 1; /* we want to avoid a lengthy deduction of DMRS and other parameters in diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bde6c6109d..fcfbc180fd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -39,16 +39,11 @@ int get_dci_format(NR_UE_sched_ctrl_t *sched_ctrl) { - const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; - int dci_format; - if (sched_ctrl->search_space) { - dci_format = f ? NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0; - } - else { - dci_format = NR_UL_DCI_FORMAT_0_0; - } + int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType && + sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific ? + NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0; - return(dci_format); + return(dci_format); } void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp) From 5744749e9a2b8ce609f1002c207b83ac1c5dde29 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 15:03:25 +0000 Subject: [PATCH 365/883] Make NR_BCCH_DL_SCH_Message_t (SIB1) available at MAC gNB --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 +-- openair1/SIMULATION/NR_PHY/ulsim.c | 4 +-- openair2/GNB_APP/gnb_config.c | 1 + openair2/LAYER2/NR_MAC_gNB/config.c | 10 +++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 5 +-- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 1 + openair2/RRC/NR/rrc_gNB.c | 41 +++++++++++++------------ openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ 8 files changed, 39 insertions(+), 29 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 6a2aba5944..e2135b6e21 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -796,9 +796,9 @@ int main(int argc, char **argv) AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface"); gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 0, 0, NULL); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, NULL, 0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); // reset preprocessor to the one of DLSIM after it has been set during // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index ac991ae940..23bc144657 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -732,9 +732,9 @@ int main(int argc, char **argv) gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,0, 0, NULL); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib, rrc.carrier.siblock1, 0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib, rrc.carrier.siblock1, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 9710dd1814..076ba4f7b4 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2035,6 +2035,7 @@ void configure_gnb_du_mac(int inst) { rrc->configuration.sib1_tda, rrc->configuration.scc, NULL, + NULL, 0, 0, // rnti (NR_CellGroupConfig_t *)NULL diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index ae3a3bba24..2be3fc671c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -431,9 +431,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, int sib1_tda, NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, - int add_ue, + NR_BCCH_DL_SCH_Message_t *sib1, + int add_ue, uint32_t rnti, - NR_CellGroupConfig_t *CellGroup) { + NR_CellGroupConfig_t *CellGroup) { if (scc != NULL ) { AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present); @@ -531,8 +532,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, } } - if (mib) RC.nrmac[Mod_idP]->common_channels[0].mib = mib; - + if (mib) RC.nrmac[Mod_idP]->common_channels[0].mib = mib; + if (sib1) RC.nrmac[Mod_idP]->common_channels[0].sib1 = sib1; + if (CellGroup) { const NR_ServingCellConfig_t *servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 91221276b0..e88899f539 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -52,8 +52,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, int sib1_tda, NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, - int add_ue, - uint32_t rnti, + NR_BCCH_DL_SCH_Message_t *sib1, + int add_ue, + uint32_t rnti, NR_CellGroupConfig_t *CellGroup); void clear_nr_nfapi_information(gNB_MAC_INST * gNB, diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 45e0a5b52b..a7f1a2cd90 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -186,6 +186,7 @@ typedef struct { lte_frame_type_t frame_type; uint64_t dl_CarrierFreq; NR_BCCH_BCH_Message_t *mib; + NR_BCCH_DL_SCH_Message_t *sib1; NR_ServingCellConfigCommon_t *ServingCellConfigCommon; NR_ARFCN_ValueEUTRA_t ul_CarrierFreq; long ul_Bandwidth; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 2c2020412d..43ee16e3ea 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -183,16 +183,16 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration if (NODE_IS_MONOLITHIC(rrc->node_type)){ rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, + rrc->carrier.ssb_SubcarrierOffset, + rrc->carrier.pdsch_AntennaPorts, + rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, - (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, - &rrc->carrier.mib, - 0, - 0, // WIP hardcoded rnti - (NR_CellGroupConfig_t *)NULL - ); + (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, + &rrc->carrier.mib, + rrc->carrier.siblock1, + 0, + 0, // WIP hardcoded rnti + (NR_CellGroupConfig_t *)NULL); } /* set flag to indicate that cell information is configured. This is required @@ -294,16 +294,17 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *const ue_context_pP, const protocol_ctxt_t *const ctxt_pP ) { - rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, - rrc->carrier.sib1_tda, - NULL, - NULL, - 0, - ue_context_pP->ue_context.rnti, - get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : (NR_CellGroupConfig_t *)NULL); + rrc_mac_config_req_gNB(rrc->module_id, + rrc->carrier.ssb_SubcarrierOffset, + rrc->carrier.pdsch_AntennaPorts, + rrc->carrier.pusch_AntennaPorts, + rrc->carrier.sib1_tda, + NULL, + NULL, + NULL, + 0, + ue_context_pP->ue_context.rnti, + get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : (NR_CellGroupConfig_t *)NULL); nr_rrc_rlc_config_asn1_req(ctxt_pP, ue_context_pP->ue_context.SRB_configList, @@ -494,6 +495,7 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( rrc_instance_p->carrier.sib1_tda, (NR_ServingCellConfigCommon_t *)rrc_instance_p->carrier.servingcellconfigcommon, &rrc_instance_p->carrier.mib, + rrc_instance_p->carrier.siblock1, 0, ue_context_pP->ue_context.rnti, (NR_CellGroupConfig_t *)NULL @@ -1259,6 +1261,7 @@ rrc_gNB_process_RRCReconfigurationComplete( rrc->carrier.sib1_tda, NULL, NULL, + NULL, 0, ue_context_pP->ue_context.rnti, ue_context_pP->ue_context.masterCellGroup diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 15caff0b4d..9a23102de1 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -384,6 +384,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.sib1_tda, rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, + NULL, 1, // add_ue flag ue_context_p->ue_id_rnti, ue_context_p->ue_context.secondaryCellGroup); @@ -395,6 +396,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ rrc->carrier.sib1_tda, NULL, NULL, + NULL, 1, // add_ue flag ue_context_p->ue_id_rnti, ue_context_p->ue_context.secondaryCellGroup); From 911b40c0c3b4022b3a0eadda830b0c69513b1197 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 15:05:09 +0000 Subject: [PATCH 366/883] Fix DCI format --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index ff2e037e4c..2b46095e65 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -552,7 +552,9 @@ bool allocate_dl_retransmission(module_id_t module_id, int rbStart = 0; // start wrt BWPstart NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - const long f = (sched_ctrl->active_bwp ||bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; + const long f = ((sched_ctrl->active_bwp || bwpd) && sched_ctrl->search_space && + sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) ? + sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; int rbSize = 0; const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n"); From 20e767d7b6aa77934af978e2414001039dfc7607 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 15:08:08 +0000 Subject: [PATCH 367/883] Fix preferred DL TDA computation --- openair2/LAYER2/NR_MAC_gNB/config.c | 35 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 2be3fc671c..abc1a79f68 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -537,25 +537,27 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, if (CellGroup) { - const NR_ServingCellConfig_t *servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated; + calculate_preferred_dl_tda(Mod_idP, NULL); - const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList; - if(bwpList) { - AssertFatal(bwpList->list.count > 0, "downlinkBWP_ToAddModList has no BWPs!\n"); - for (int i = 0; i < bwpList->list.count; ++i) { - const NR_BWP_Downlink_t *bwp = bwpList->list.array[i]; - calculate_preferred_dl_tda(Mod_idP, bwp); + const NR_ServingCellConfig_t *servingCellConfig = NULL; + if(CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) { + servingCellConfig = CellGroup->spCellConfig->spCellConfigDedicated; + const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig->downlinkBWP_ToAddModList; + if(bwpList) { + AssertFatal(bwpList->list.count > 0, "downlinkBWP_ToAddModList has no BWPs!\n"); + for (int i = 0; i < bwpList->list.count; ++i) { + const NR_BWP_Downlink_t *bwp = bwpList->list.array[i]; + calculate_preferred_dl_tda(Mod_idP, bwp); + } } - } else { - calculate_preferred_dl_tda(Mod_idP, NULL); - } - const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList; - if(ubwpList) { - AssertFatal(ubwpList->list.count > 0, "uplinkBWP_ToAddModList no BWPs!\n"); - for (int i = 0; i < ubwpList->list.count; ++i) { - const NR_BWP_Uplink_t *ubwp = ubwpList->list.array[i]; - calculate_preferred_ul_tda(Mod_idP, ubwp); + const struct NR_UplinkConfig__uplinkBWP_ToAddModList *ubwpList = servingCellConfig->uplinkConfig->uplinkBWP_ToAddModList; + if(ubwpList) { + AssertFatal(ubwpList->list.count > 0, "uplinkBWP_ToAddModList no BWPs!\n"); + for (int i = 0; i < ubwpList->list.count; ++i) { + const NR_BWP_Uplink_t *ubwp = ubwpList->list.array[i]; + calculate_preferred_ul_tda(Mod_idP, ubwp); + } } } @@ -614,7 +616,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, UE_info->CellGroup[UE_id] = CellGroup; LOG_I(NR_MAC,"Modified UE_id %d/%x with CellGroup\n",UE_id,rnti); process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]); - const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; if (sched_ctrl->available_dl_harq.len == 0) { From 0166cd05d61c9d03b7a2cb9a317d9b97e332da84 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 15:15:18 +0000 Subject: [PATCH 368/883] To use ServingCellConfigCommonSIB when ServingCellConfigCommon is NULL --- openair1/SIMULATION/NR_PHY/dlsim.c | 5 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 24 +-- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 3 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 96 ++++++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 6 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 151 ++++++++++----- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 34 +++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 182 ++++++++++++++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 23 ++- 10 files changed, 377 insertions(+), 149 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index e2135b6e21..db0bb082ac 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -261,7 +261,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, /* manually set free CCE to 0 */ const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; - sched_ctrl->search_space = get_searchspace(scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); + sched_ctrl->search_space = get_searchspace(module_id, scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); uint8_t nr_of_candidates; find_aggregation_candidates(&sched_ctrl->aggregation_level, &nr_of_candidates, @@ -276,7 +276,8 @@ void nr_dlsim_preprocessor(module_id_t module_id, int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; - nr_set_pdsch_semi_static(scc, + nr_set_pdsch_semi_static(module_id, + scc, UE_info->CellGroup[0], sched_ctrl->active_bwp, NULL, diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 3f4be9dd58..264e86be7d 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2536,8 +2536,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, const NR_CellGroupConfig_t *cg, dci_pdu_rel15_t *dci_pdu, nr_dci_format_t format, - nr_rnti_type_t rnti_type, - uint16_t N_RB, + nr_rnti_type_t rnti_type, + uint16_t N_RB, int bwp_id) { uint16_t size = 0; @@ -2568,15 +2568,17 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, srs_config = (ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup : NULL; } else if (cg){ - bwpd=cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; - bwpc=initialDownlinkBWP; - ubwpd=cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP; - ubwpc=initialUplinkBWP; - pdsch_Config = (bwpd->pdsch_Config) ? bwpd->pdsch_Config->choice.setup : NULL; - pdcch_Config = (bwpd->pdcch_Config) ? bwpd->pdcch_Config->choice.setup : NULL; - pucch_Config = (ubwpd->pucch_Config) ? ubwpd->pucch_Config->choice.setup : NULL; - pusch_Config = (ubwpd->pusch_Config) ? ubwpd->pusch_Config->choice.setup : NULL; - srs_config = (ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup: NULL; + bwpc = initialDownlinkBWP; + ubwpc = initialUplinkBWP; + bwpd = cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated ? + cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; + ubwpd = cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated && cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + pdsch_Config = (bwpd && bwpd->pdsch_Config) ? bwpd->pdsch_Config->choice.setup : NULL; + pdcch_Config = (bwpd && bwpd->pdcch_Config) ? bwpd->pdcch_Config->choice.setup : NULL; + pucch_Config = (ubwpd && ubwpd->pucch_Config) ? ubwpd->pucch_Config->choice.setup : NULL; + pusch_Config = (ubwpd && ubwpd->pusch_Config) ? ubwpd->pusch_Config->choice.setup : NULL; + srs_config = (ubwpd && ubwpd->srs_Config) ? ubwpd->srs_Config->choice.setup: NULL; } int n_ul_bwp=1,n_dl_bwp=1; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index abc1a79f68..3b8b5b72bf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -641,7 +641,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; } - sched_ctrl->search_space = get_searchspace(scc, bwpd, target_ss); + sched_ctrl->search_space = get_searchspace(Mod_idP, scc, bwpd, target_ss); sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss); sched_ctrl->maxL = 2; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 4172374ee8..f3fa6f971c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -827,7 +827,8 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t dci_pdu_rel15_t uldci_payload; memset(&uldci_payload, 0, sizeof(uldci_payload)); - config_uldci(ubwp, + config_uldci(module_idP, + ubwp, ubwpd, scc, pusch_pdu, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 2b46095e65..c8325c487a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -73,15 +73,22 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * else { target_ss = NR_SearchSpace__searchSpaceType_PR_common; } - NR_SearchSpace_t *search_space = get_searchspace(scc, bwp ? bwp->bwp_Dedicated : NULL, target_ss); + NR_SearchSpace_t *search_space = get_searchspace(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, target_ss); NR_ControlResourceSet_t *coreset = get_coreset(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, search_space, target_ss); // get coreset symbol "map" const uint16_t symb_coreset = (1 << coreset->duration) - 1; /* check that TDA index 0 fits into DL and does not overlap CORESET */ - const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? - bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = NULL; + if (bwp) { + tdaList = bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } else if (scc) { + tdaList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } + AssertFatal(tdaList->list.count >= 1, "need to have at least one TDA for DL slots\n"); const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_DL = tdaList->list.array[0]; AssertFatal(!tdaP_DL->k0 || *tdaP_DL->k0 == 0, @@ -541,12 +548,22 @@ bool allocate_dl_retransmission(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; - NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL; + NR_BWP_DownlinkDedicated_t *bwpd = + cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated ? + cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; - NR_BWP_t *genericParameters = sched_ctrl->active_bwp ? - &sched_ctrl->active_bwp->bwp_Common->genericParameters : - &RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + NR_BWP_t *genericParameters = NULL; + if(sched_ctrl->active_bwp) { + genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; + } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) { + genericParameters = &RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + } const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); int rbStart = 0; // start wrt BWPstart @@ -575,7 +592,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ if (ps->time_domain_allocation != tda) - nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps); + nr_set_pdsch_semi_static(module_id, scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps); } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ @@ -585,7 +602,7 @@ bool allocate_dl_retransmission(module_id_t module_id, rbSize++; NR_pdsch_semi_static_t temp_ps; temp_ps.nrOfLayers = 1; - nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); + nr_set_pdsch_semi_static(module_id, scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, @@ -731,14 +748,26 @@ void pf_dl(module_id_t module_id, *max = UE_sched.next[*max]; *p = -1; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; - NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL; + + NR_BWP_DownlinkDedicated_t *bwpd = + cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated ? + cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; int bwp_Id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0; const uint16_t rnti = UE_info->rnti[UE_id]; - NR_BWP_t *genericParameters = sched_ctrl->active_bwp ? - &sched_ctrl->active_bwp->bwp_Common->genericParameters: - &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + + NR_BWP_t *genericParameters = NULL; + if(sched_ctrl->active_bwp) { + genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; + } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) { + genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + } const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); int rbStart = 0; // start wrt BWPstart @@ -794,7 +823,7 @@ void pf_dl(module_id_t module_id, sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; if (ps->time_domain_allocation != tda) - nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); + nr_set_pdsch_semi_static(module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; @@ -833,14 +862,18 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t int UE_id = UE_info->list.head; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_bwp ? - sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth: - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, - MAX_BWP_SIZE); - const uint16_t BWPStart = NRRIV2PRBOFFSET(sched_ctrl->active_bwp ? - sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth: - scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, - MAX_BWP_SIZE); + NR_BWP_t *genericParameters = NULL; + if(sched_ctrl->active_bwp) { + genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; + } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) { + genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + } + + const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + const uint16_t BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map; uint8_t rballoc_mask[bwpSize]; @@ -916,7 +949,12 @@ void nr_schedule_ue_spec(module_id_t module_id, NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; UE_info->mac_stats[UE_id].dlsch_current_bytes = 0; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; - NR_BWP_DownlinkDedicated_t *bwpd= cg ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP:NULL; + + NR_BWP_DownlinkDedicated_t *bwpd = + cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated ? + cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; /* update TA and set ta_apply every 10 frames. * Possible improvement: take the periodicity from input file. @@ -1000,7 +1038,15 @@ void nr_schedule_ue_spec(module_id_t module_id, * exist, create it */ // BWP - NR_BWP_t *genericParameters = bwp ? &bwp->bwp_Common->genericParameters : &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + NR_BWP_t *genericParameters = NULL; + if(bwp) { + genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; + } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) { + genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + } const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 1ded933a62..4c5780e244 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -381,7 +381,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ps->nrOfLayers = target_dl_Nl; if (ps->time_domain_allocation != tda) nr_set_pdsch_semi_static( - scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps); + module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps); sched_pdsch->mcs = target_dl_mcs; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); @@ -438,7 +438,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ "time domain assignment %d >= %d\n", tda, tdaList->list.count); - int K2 = get_K2(scc,sched_ctrl->active_ubwp, tda, mu); + int K2 = get_K2(scc,NULL,sched_ctrl->active_ubwp, tda, mu); const int sched_frame = frame + (slot + K2 >= nr_slots_per_frame[mu]); const int sched_slot = (slot + K2) % nr_slots_per_frame[mu]; /* check if slot is UL, and that slot is 8 (assuming K2=6 because of UE @@ -459,7 +459,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) - nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps); uint16_t rbStart = 0; uint16_t rbSize; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 7b7b5c771b..465a621437 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -188,17 +188,31 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, } } -NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, - NR_BWP_DownlinkDedicated_t *bwp_Dedicated, - NR_SearchSpace__searchSpaceType_PR target_ss) { +NR_SearchSpace_t *get_searchspace(module_id_t module_id, + NR_ServingCellConfigCommon_t *scc, + NR_BWP_DownlinkDedicated_t *bwp_Dedicated, + NR_SearchSpace__searchSpaceType_PR target_ss) { + + int n = 0; + if(bwp_Dedicated) { + n = bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count; + } else if(scc) { + n = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + n = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count; + } - const int n = bwp_Dedicated ? - bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.count: - scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count; for (int i=0;ipdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i]: - scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i]; + NR_SearchSpace_t *ss = NULL; + if(bwp_Dedicated) { + ss = bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list.array[i]; + } else if(scc) { + ss = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i]; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + ss = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i]; + } AssertFatal(ss->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n"); AssertFatal(ss->searchSpaceType != NULL, "ss->searchSpaceType is null\n"); if (ss->searchSpaceType->present == target_ss) { @@ -301,19 +315,27 @@ bool nr_find_nb_rb(uint16_t Qm, return *tbs >= bytes && *nb_rb <= nb_rb_max; } -void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, +void nr_set_pdsch_semi_static(module_id_t module_id, + const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *secondaryCellGroup, const NR_BWP_Downlink_t *bwp, const NR_BWP_DownlinkDedicated_t *bwpd0, int tda, const long dci_format, - NR_pdsch_semi_static_t *ps) -{ + NR_pdsch_semi_static_t *ps) { + ps->time_domain_allocation = tda; - const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ? - bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : - scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = NULL; + if(bwp) { + tdaList = bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } else if(scc) { + tdaList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } + AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); const int mapping_type = tdaList->list.array[tda]->mappingType; const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; @@ -327,7 +349,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, } ps->mcsTableIdx = 0; - if (bwpd->pdsch_Config && + if (bwpd && + bwpd->pdsch_Config && bwpd->pdsch_Config->choice.setup && bwpd->pdsch_Config->choice.setup->mcs_Table) { if (*bwpd->pdsch_Config->choice.setup->mcs_Table == 0) @@ -344,32 +367,39 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0; ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); - ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type); + ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc ? scc->dmrs_TypeA_Position : 0, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type); ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); LOG_D(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT); } -void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, +void nr_set_pusch_semi_static(module_id_t module_id, + const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, const NR_BWP_UplinkDedicated_t *ubwpd, long dci_format, int tda, uint8_t num_dmrs_cdm_grps_no_data, - NR_pusch_semi_static_t *ps) -{ + NR_pusch_semi_static_t *ps) { ps->dci_format = dci_format; ps->time_domain_allocation = tda; - const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList = - ubwp? - ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList: - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList ; + NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList = NULL; + if(ubwp) { + tdaList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + } else if(scc) { + tdaList = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + tdaList = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + } + const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); - ps->pusch_Config = ubwp?ubwp->bwp_Dedicated->pusch_Config->choice.setup:(ubwpd ? ubwpd->pusch_Config->choice.setup : NULL); + ps->pusch_Config = ubwp && ubwp->bwp_Dedicated && ubwp->bwp_Dedicated->pusch_Config ? + ubwp->bwp_Dedicated->pusch_Config->choice.setup : (ubwpd ? ubwpd->pusch_Config->choice.setup : NULL); if (ps->pusch_Config == NULL || !ps->pusch_Config->transformPrecoder) ps->transform_precoding = !scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder; else @@ -643,7 +673,8 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, } -void config_uldci(const NR_BWP_Uplink_t *ubwp, +void config_uldci(module_id_t module_id, + const NR_BWP_Uplink_t *ubwp, const NR_BWP_UplinkDedicated_t *ubwpd, const NR_ServingCellConfigCommon_t *scc, const nfapi_nr_pusch_pdu_t *pusch_pdu, @@ -654,9 +685,17 @@ void config_uldci(const NR_BWP_Uplink_t *ubwp, int n_ubwp, int bwp_id) { - const int bw = NRRIV2BW(ubwp ? - ubwp->bwp_Common->genericParameters.locationAndBandwidth : - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); + NR_BWP_t *genericParameters = NULL; + if(ubwp) { + genericParameters = &ubwp->bwp_Common->genericParameters; + } else if(scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + + const int bw = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); dci_pdu_rel15->frequency_domain_assignment.val = PRBalloc_to_locationandbandwidth0(pusch_pdu->rb_size, pusch_pdu->rb_start, bw); @@ -814,7 +853,8 @@ void nr_configure_pdcch(gNB_MAC_INST *gNB_mac, // This function configures pucch pdu fapi structure -void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, +void nr_configure_pucch(module_id_t module_id, + nfapi_nr_pucch_pdu_t* pucch_pdu, NR_ServingCellConfigCommon_t *scc, NR_CellGroupConfig_t *CellGroup, NR_BWP_Uplink_t *bwp, @@ -842,7 +882,13 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, uint16_t O_uci = O_csi + O_ack; - NR_PUSCH_Config_t *pusch_Config = bwp ? bwp->bwp_Dedicated->pusch_Config->choice.setup : bwpd->pusch_Config->choice.setup; + NR_PUSCH_Config_t *pusch_Config = NULL; + if(bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pusch_Config) { + pusch_Config = bwp->bwp_Dedicated->pusch_Config->choice.setup; + } else if(bwpd && bwpd->pusch_Config) { + pusch_Config = bwpd->pusch_Config->choice.setup; + } + long *pusch_id = pusch_Config ? pusch_Config->dataScramblingIdentityPUSCH : NULL; if (pusch_Config && pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA != NULL) @@ -851,9 +897,16 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, id0 = pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup->transformPrecodingDisabled->scramblingID0; else id0 = scc->physCellId; - NR_PUCCH_ConfigCommon_t *pucch_ConfigCommon = bwp ? - bwp->bwp_Common->pucch_ConfigCommon->choice.setup : - scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup; + NR_PUCCH_ConfigCommon_t *pucch_ConfigCommon = NULL; + if(bwp) { + pucch_ConfigCommon = bwp->bwp_Common->pucch_ConfigCommon->choice.setup; + } else if(scc) { + pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + pucch_ConfigCommon = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup; + } + // hop flags and hopping id are valid for any BWP switch (pucch_ConfigCommon->pucch_GroupHopping){ case 0 : @@ -879,9 +932,17 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, pucch_pdu->hopping_id = *pucch_ConfigCommon->hoppingId; else pucch_pdu->hopping_id = *scc->physCellId; - NR_BWP_t *genericParameters = bwp ? - &bwp->bwp_Common->genericParameters: - &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + + NR_BWP_t *genericParameters = NULL; + if (bwp) { + genericParameters = &bwp->bwp_Common->genericParameters; + } else if (scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + pucch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); pucch_pdu->subcarrier_spacing = genericParameters->subcarrierSpacing; @@ -890,9 +951,8 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, LOG_D(NR_MAC,"pucch_acknak: Filling dedicated configuration for PUCCH\n"); // we have either a dedicated BWP or Dedicated PUCCH configuration on InitialBWP AssertFatal(bwp!=NULL || bwpd!=NULL,"We need one dedicated configuration for a BWP (neither additional or initial BWP has a dedicated configuration)\n"); - pucch_Config = bwp ? - bwp->bwp_Dedicated->pucch_Config->choice.setup: - bwpd->pucch_Config->choice.setup; + pucch_Config = bwp && bwp->bwp_Dedicated && bwp->bwp_Dedicated->pucch_Config ? + bwp->bwp_Dedicated->pucch_Config->choice.setup : bwpd->pucch_Config->choice.setup; AssertFatal(pucch_Config->resourceSetToAddModList!=NULL, "PUCCH resourceSetToAddModList is null\n"); @@ -1964,7 +2024,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG /* set illegal time domain allocation to force recomputation of all fields */ sched_ctrl->pdsch_semi_static.time_domain_allocation = -1; sched_ctrl->pusch_semi_static.time_domain_allocation = -1; - const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; + const NR_ServingCellConfig_t *servingCellConfig = CellGroup && CellGroup->spCellConfig ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; /* Set default BWPs */ const struct NR_ServingCellConfig__downlinkBWP_ToAddModList *bwpList = servingCellConfig ? servingCellConfig->downlinkBWP_ToAddModList : NULL; @@ -1974,7 +2034,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG const int bwp_id = servingCellConfig ? *servingCellConfig->firstActiveDownlinkBWP_Id : 0; sched_ctrl->active_bwp = bwpList && bwp_id > 0 ? bwpList->list.array[bwp_id - 1] : NULL; const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common; - sched_ctrl->search_space = get_searchspace(scc, + sched_ctrl->search_space = get_searchspace(mod_idP, scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); sched_ctrl->coreset = get_coreset(mod_idP, scc, @@ -2145,12 +2205,7 @@ void get_pdsch_to_harq_feedback(int Mod_idP, bwpd = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated; ubwpd = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated; } - else if (CellGroup) { // this is an initialBWP - AssertFatal((bwpd=CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP)!=NULL, - "CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP is null\n"); - AssertFatal((ubwpd=CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)!=NULL, - "CellGroup->spCellConfig->spCellConfigDedicated->uplnikConfig->initialUplinkBWP is null\n"); - } + NR_SearchSpace_t *ss=NULL; // common search type uses DCI format 1_0 diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ca641ed1ba..0c474baf13 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -75,11 +75,13 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon; NR_CellGroupConfig_t *cg=UE_info->CellGroup[UE_id]; - NR_BWP_UplinkDedicated_t *ubwpd; - ubwpd = cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; + NR_BWP_UplinkDedicated_t *ubwpd = cg && cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); - nr_configure_pucch(pucch_pdu, + nr_configure_pucch(mod_id, + pucch_pdu, scc, UE_info->CellGroup[UE_id], UE_info->UE_sched_ctrl[UE_id].active_ubwp, @@ -521,9 +523,16 @@ void nr_csi_meas_reporting(int Mod_idP, curr_pucch->csi_bits += nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id); - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? - &sched_ctrl->active_ubwp->bwp_Common->genericParameters: - &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + NR_BWP_t *genericParameters = NULL; + if(sched_ctrl->active_ubwp) { + genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; + } else if(scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[Mod_idP]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); // going through the list of PUCCH resources to find the one indexed by resource_id @@ -1411,9 +1420,16 @@ int nr_acknack_scheduling(int mod_id, pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; } - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? - &sched_ctrl->active_ubwp->bwp_Common->genericParameters: - &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + NR_BWP_t *genericParameters = NULL; + if(sched_ctrl->active_ubwp) { + genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; + } else if(scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[mod_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); /* verify that at that slot and symbol, resources are free. We only do this diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index fcfbc180fd..d86f03d6d2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -55,9 +55,21 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* there is a mixed slot only when in TDD */ NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon; - const int mu = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; - const NR_TDD_UL_DL_Pattern_t *tdd = - scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + NR_ServingCellConfigCommonSIB_t *scc_sib1 = get_softmodem_params()->sa ? + RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1->servingCellConfigCommon : NULL; + + AssertFatal(scc!=NULL || scc_sib1!=NULL,"We need one serving cell config common\n"); + + const int mu = scc ? scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing : + scc_sib1->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing; + + NR_TDD_UL_DL_Pattern_t *tdd = NULL; + if (scc && scc->tdd_UL_DL_ConfigurationCommon) { + tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1; + } else if (scc_sib1 && scc_sib1->tdd_UL_DL_ConfigurationCommon) { + tdd = &scc_sib1->tdd_UL_DL_ConfigurationCommon->pattern1; + } + /* Uplink symbols are at the end of the slot */ const int symb_ulMixed = tdd ? ((1 << tdd->nrofUplinkSymbols) - 1) << (14 - tdd->nrofUplinkSymbols) : 0; @@ -101,7 +113,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* check that TDA index 1 fits into UL slot and does not overlap with PUCCH */ const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_UL = tdaList->list.array[0]; - const int k2 = get_K2(scc, (NR_BWP_Uplink_t*)ubwp,0, mu); + const int k2 = get_K2(scc, scc_sib1, (NR_BWP_Uplink_t*)ubwp,0, mu); int start, len; SLIV2SL(tdaP_UL->startSymbolAndLength, &start, &len); const uint16_t symb_tda = ((1 << len) - 1) << start; @@ -114,10 +126,10 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub int tdaMi = -1; if(tdaList->list.count > 1) { const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1]; - AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu), + AssertFatal(k2 == get_K2(scc, scc_sib1, (NR_BWP_Uplink_t*)ubwp, 1, mu), "scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n", k2, - get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu)); + get_K2(scc, scc_sib1, (NR_BWP_Uplink_t*)ubwp, 1, mu)); SLIV2SL(tdaP_Mi->startSymbolAndLength, &start, &len); const uint16_t symb_tda_mi = ((1 << len) - 1) << start; // check whether PUCCH and TDA overlap: then, we cannot use it. Also, check @@ -135,7 +147,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub } } const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160}; - const int n = slots_per_frame[*scc->ssbSubcarrierSpacing]; + const int n = slots_per_frame[mu]; nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id])); const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0; @@ -879,11 +891,21 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, } } -long get_K2(NR_ServingCellConfigCommon_t *scc,NR_BWP_Uplink_t *ubwp, int time_domain_assignment, int mu) { - DevAssert(scc); - const NR_PUSCH_TimeDomainResourceAllocation_t *tda_list = ubwp ? - ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[time_domain_assignment]: - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[time_domain_assignment]; +long get_K2(NR_ServingCellConfigCommon_t *scc, + NR_ServingCellConfigCommonSIB_t *scc_sib1, + NR_BWP_Uplink_t *ubwp, + int time_domain_assignment, + int mu) { + + NR_PUSCH_TimeDomainResourceAllocation_t *tda_list = NULL; + if(ubwp) { + tda_list = ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[time_domain_assignment]; + } else if(scc) { + tda_list = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[time_domain_assignment]; + } else if(scc_sib1) { + tda_list = scc_sib1->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[time_domain_assignment]; + } + if (tda_list->k2) return *tda_list->k2; else if (mu < 2) @@ -943,8 +965,21 @@ bool allocate_ul_retransmission(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_sched_pusch_t *retInfo = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; - NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + + NR_BWP_UplinkDedicated_t *ubwpd = cg && cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + + NR_BWP_t *genericParameters = NULL; + if (sched_ctrl->active_ubwp) { + genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; + } else if (scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + int rbStart = 0; // wrt BWP start const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -969,7 +1004,7 @@ bool allocate_ul_retransmission(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) - nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size); } else { /* the retransmission will use a different time domain allocation, check @@ -981,7 +1016,7 @@ bool allocate_ul_retransmission(module_id_t module_id, rbSize++; NR_pusch_semi_static_t temp_ps; int dci_format = get_dci_format(sched_ctrl); - nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps); + nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, @@ -1080,10 +1115,22 @@ void pf_ul(module_id_t module_id, LOG_D(NR_MAC,"pf_ul: preparing UL scheduling for UE %d\n",UE_id); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + + NR_BWP_t *genericParameters = NULL; + if (sched_ctrl->active_ubwp) { + genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; + } else if (scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + int rbStart = 0; // wrt BWP start NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; - NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + NR_BWP_UplinkDedicated_t *ubwpd = cg && cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; @@ -1154,7 +1201,7 @@ void pf_ul(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) - nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = 9; update_ul_ue_R_Qm(sched_pusch, ps); @@ -1223,8 +1270,20 @@ void pf_ul(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; - NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters : &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + NR_BWP_UplinkDedicated_t *ubwpd = cg && cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated + && cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + + NR_BWP_t *genericParameters = NULL; + if (sched_ctrl->active_ubwp) { + genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; + } else if (scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0; const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; @@ -1253,7 +1312,7 @@ void pf_ul(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) - nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); update_ul_ue_R_Qm(sched_pusch, ps); /* Calculate the current scheduling bytes and the necessary RBs */ @@ -1285,7 +1344,14 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t gNB_MAC_INST *nr_mac = RC.nrmac[module_id]; NR_COMMON_channels_t *cc = nr_mac->common_channels; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; - const int mu = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; + NR_ServingCellConfigCommonSIB_t *scc_sib1 = get_softmodem_params()->sa ? + RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1->servingCellConfigCommon : NULL; + + AssertFatal(scc!=NULL || scc_sib1!=NULL,"We need one serving cell config common\n"); + + const int mu = scc ? scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing : + scc_sib1->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing; + NR_UE_info_t *UE_info = &nr_mac->UE_info; if (UE_info->num_UEs == 0) @@ -1302,7 +1368,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t const int tda = sched_ctrl->active_ubwp ? nr_mac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; if (tda < 0) return false; - int K2 = get_K2(scc, sched_ctrl->active_ubwp, tda, mu); + int K2 = get_K2(scc, scc_sib1, sched_ctrl->active_ubwp, tda, mu); const int sched_frame = frame + (slot + K2 >= nr_slots_per_frame[mu]); const int sched_slot = (slot + K2) % nr_slots_per_frame[mu]; @@ -1320,8 +1386,8 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t sched_ctrl->sched_pusch.frame = sched_frame; for (UE_id = UE_info->list.next[UE_id]; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - AssertFatal(K2 == get_K2(scc,sched_ctrl->active_ubwp, tda, mu), - "Different K2, %d(UE%d) != %ld(UE%d)\n", K2, 0, get_K2(scc,sched_ctrl->active_ubwp, tda, mu), UE_id); + AssertFatal(K2 == get_K2(scc,scc_sib1,sched_ctrl->active_ubwp, tda, mu), + "Different K2, %d(UE%d) != %ld(UE%d)\n", K2, 0, get_K2(scc,scc_sib1,sched_ctrl->active_ubwp, tda, mu), UE_id); sched_ctrl->sched_pusch.slot = sched_slot; sched_ctrl->sched_pusch.frame = sched_frame; } @@ -1331,17 +1397,30 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t * Calculate largest contiguous RBs */ uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; - const uint16_t bwpSize = NRRIV2BW(sched_ctrl->active_ubwp ? - sched_ctrl->active_ubwp->bwp_Common->genericParameters.locationAndBandwidth: - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, - MAX_BWP_SIZE); - const uint16_t bwpStart = NRRIV2PRBOFFSET(sched_ctrl->active_ubwp ? - sched_ctrl->active_ubwp->bwp_Common->genericParameters.locationAndBandwidth: - scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, - MAX_BWP_SIZE); - const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList = sched_ctrl->active_ubwp ? - sched_ctrl->active_ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList: - scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + + NR_BWP_t *genericParameters = NULL; + if (sched_ctrl->active_ubwp) { + genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; + } else if (scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + + const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + const uint16_t bwpStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + + NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList = NULL; + if (sched_ctrl->active_ubwp) { + tdaList = sched_ctrl->active_ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + } else if (scc) { + tdaList = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + tdaList = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; + } + const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; int startSymbolIndex, nrOfSymbols; SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); @@ -1443,7 +1522,11 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) if (sched_ctrl->ul_failure == 1 && get_softmodem_params()->phy_test==0) continue; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; - NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; + + NR_BWP_UplinkDedicated_t *ubwpd = cg && cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + UE_info->mac_stats[UE_id].ulsch_current_bytes = 0; /* dynamic PUSCH values (RB alloc, MCS, hence R, Qm, TBS) that change in @@ -1564,7 +1647,16 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) pusch_pdu->handle = 0; //not yet used /* FAPI: BWP */ - NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters:&scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + NR_BWP_t *genericParameters = NULL; + if (sched_ctrl->active_ubwp) { + genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; + } else if (scc) { + genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + pusch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pusch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pusch_pdu->subcarrier_spacing = genericParameters->subcarrierSpacing; @@ -1706,10 +1798,16 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) dci_pdu_rel15_t uldci_payload; memset(&uldci_payload, 0, sizeof(uldci_payload)); int n_ubwp=1; - if (cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList) - n_ubwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count; + if (cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList) { + n_ubwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count; + } - config_uldci(sched_ctrl->active_ubwp, + config_uldci(module_id, + sched_ctrl->active_ubwp, ubwpd, scc, pusch_pdu, diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index e88899f539..83c4d3d950 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -176,7 +176,8 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234); -void config_uldci(const NR_BWP_Uplink_t *ubwp, +void config_uldci(module_id_t module_id, + const NR_BWP_Uplink_t *ubwp, const NR_BWP_UplinkDedicated_t *ubwpd, const NR_ServingCellConfigCommon_t *scc, const nfapi_nr_pusch_pdu_t *pusch_pdu, @@ -233,7 +234,8 @@ int nr_is_dci_opportunity(nfapi_nr_search_space_t search_space, nfapi_nr_config_request_scf_t cfg); */ -void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, +void nr_configure_pucch(module_id_t module_id, + nfapi_nr_pucch_pdu_t* pucch_pdu, NR_ServingCellConfigCommon_t *scc, NR_CellGroupConfig_t *CellGroup, NR_BWP_Uplink_t *bwp, @@ -279,13 +281,19 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_SearchSpace__searchSpaceType_PR ss_type); /* find a search space within a BWP */ -NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc, +NR_SearchSpace_t *get_searchspace(module_id_t module_id, + NR_ServingCellConfigCommon_t *scc, NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_SearchSpace__searchSpaceType_PR target_ss); -long get_K2(NR_ServingCellConfigCommon_t *scc, NR_BWP_Uplink_t *ubwp, int time_domain_assignment, int mu); +long get_K2(NR_ServingCellConfigCommon_t *scc, + NR_ServingCellConfigCommonSIB_t *scc_sib1, + NR_BWP_Uplink_t *ubwp, + int time_domain_assignment, + int mu); -void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, +void nr_set_pdsch_semi_static(module_id_t module_id, + const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *secondaryCellGroup, const NR_BWP_Downlink_t *bwp, const NR_BWP_DownlinkDedicated_t *bwpd0, @@ -293,9 +301,10 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, const long dci_format, NR_pdsch_semi_static_t *ps); -void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, +void nr_set_pusch_semi_static(module_id_t module_id, + const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, - const NR_BWP_UplinkDedicated_t *ubwpd, + const NR_BWP_UplinkDedicated_t *ubwpd, long dci_format, int tda, uint8_t num_dmrs_cdm_grps_no_data, From c30f478df9440a0b28524e774eb46ce65ed4bbda Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 15:18:06 +0000 Subject: [PATCH 369/883] Improve PUCCH configuration procedures --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 8 ++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 16 ++++++++++++++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 8 +++++++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index f3fa6f971c..f396f88284 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1488,12 +1488,8 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra return; } - int n_rb=0; - for (int i=0;i<6;i++) - for (int j=0;j<8;j++) { - n_rb+=((coreset->frequencyDomainResources.buf[i]>>j)&1); - } - n_rb*=6; + int n_rb,rb_offset; + get_coreset_rballoc(coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); const uint16_t N_cce = n_rb * coreset->duration / NR_NB_REG_PER_CCE; const int delta_PRI=0; int r_pucch = ((CCEIndex<<1)/N_cce)+(delta_PRI<<1); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index c8325c487a..efcccaaff0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -635,7 +635,13 @@ bool allocate_dl_retransmission(module_id_t module_id, /* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH * allocation after CCE alloc fail would be more complex) */ - const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1, 0); + int n_rb,rb_offset; + get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); + const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE; + const int delta_PRI=0; + int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1); + + const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, r_pucch, 0); if (alloc<0) { LOG_D(MAC, "%s(): could not find PUCCH for UE %d/%04x@%d.%d\n", @@ -789,7 +795,13 @@ void pf_dl(module_id_t module_id, /* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH * allocation after CCE alloc fail would be more complex) */ - const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1, 0); + int n_rb,rb_offset; + get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); + const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE; + const int delta_PRI=0; + int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1); + + const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, r_pucch, 0); if (alloc<0) { LOG_D(NR_MAC, "%s(): could not find PUCCH for UE %d/%04x@%d.%d\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 4c5780e244..830c672b70 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -348,7 +348,13 @@ void nr_preprocessor_phytest(module_id_t module_id, __func__, UE_id); - const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, -1, 0); + int n_rb,rb_offset; + get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); + const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE; + const int delta_PRI=0; + int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1); + + const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, r_pucch, 0); if (alloc < 0) { LOG_D(MAC, "%s(): could not find PUCCH for UE %d/%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 465a621437..cdf7027137 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -947,7 +947,7 @@ void nr_configure_pucch(module_id_t module_id, pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); pucch_pdu->subcarrier_spacing = genericParameters->subcarrierSpacing; pucch_pdu->cyclic_prefix = (genericParameters->cyclicPrefix==NULL) ? 0 : *genericParameters->cyclicPrefix; - if (r_pucch<0 || bwp ){ + if (bwp || bwpd) { LOG_D(NR_MAC,"pucch_acknak: Filling dedicated configuration for PUCCH\n"); // we have either a dedicated BWP or Dedicated PUCCH configuration on InitialBWP AssertFatal(bwp!=NULL || bwpd!=NULL,"We need one dedicated configuration for a BWP (neither additional or initial BWP has a dedicated configuration)\n"); From 220aeacbd2002b7a5daea1b2d649678c625c5adb Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Feb 2022 17:37:56 +0100 Subject: [PATCH 370/883] bugfix for ilbrm --- openair1/PHY/CODING/nr_rate_matching.c | 4 ++-- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index ae49f9a4a7..29cba0a557 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -405,7 +405,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z; #ifdef RM_DEBUG - printf("nr_rate_matching_ldpc: E %d, F %d, Foffset %d, k0 %d, Ncb %d, rvidx %d\n", E, F, Foffset,ind, Ncb, rvidx); + printf("nr_rate_matching_ldpc: E %d, F %d, Foffset %d, k0 %d, Ncb %d, rvidx %d, Ilbrm %d\n", E, F, Foffset,ind, Ncb, rvidx, Ilbrm); #endif if (Foffset > E) { @@ -502,7 +502,7 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm, } #ifdef RM_DEBUG - printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, k0 %d, Ncb %d, rvidx %d\n", clear, E, ind, Ncb, rvidx); + printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, k0 %d, Ncb %d, rvidx %d, Ilbrm %d\n", clear, E, ind, Ncb, rvidx, Ilbrm); #endif if (clear==1) memset(w,0,Ncb*sizeof(int16_t)); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index c4d709c77d..813a3a1048 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -329,7 +329,7 @@ void nr_processDLSegment(void* arg) { __m128i *pv = (__m128i*)&z; __m128i *pl = (__m128i*)&l; - uint8_t Ilbrm = 0; + uint8_t Ilbrm = 1; Kr = harq_process->K; // [hna] overwrites this line "Kr = p_decParams->Z*kb" Kr_bytes = Kr>>3; @@ -394,7 +394,7 @@ void nr_processDLSegment(void* arg) { r_offset += E; if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD)) { - LOG_I(PHY,"decoder input(segment %u) :",r); + LOG_D(PHY,"decoder input(segment %u) :",r); for (int i=0; id[r][i]); @@ -502,6 +502,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, // HARQ stats phy_vars_ue->dl_stats[harq_process->round]++; + LOG_D(PHY,"Round %d RV idx %d\n",harq_process->round,harq_process->rvidx); uint8_t kc; uint32_t Tbslbrm;// = 950984; uint16_t nb_rb;// = 30; From b069dcd3c88d2095a5e1af18a4143f3af7026e4b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 20:22:57 +0000 Subject: [PATCH 371/883] Bug fixes --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index efcccaaff0..d98b641350 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1225,7 +1225,7 @@ void nr_schedule_ue_spec(module_id_t module_id, int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType && sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific ? - NR_UL_DCI_FORMAT_0_1 : NR_UL_DCI_FORMAT_0_0; + NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; const int rnti_type = NR_RNTI_C; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index cdf7027137..9b2db1f633 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2205,7 +2205,12 @@ void get_pdsch_to_harq_feedback(int Mod_idP, bwpd = CellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated; ubwpd = CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[bwp_id-1]->bwp_Dedicated; } - + else if (CellGroup && CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) { // this is an initialBWP + AssertFatal((bwpd=CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP)!=NULL, + "CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP is null\n"); + AssertFatal((ubwpd=CellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP)!=NULL, + "CellGroup->spCellConfig->spCellConfigDedicated->uplnikConfig->initialUplinkBWP is null\n"); + } NR_SearchSpace_t *ss=NULL; // common search type uses DCI format 1_0 From 66d2a3761f4bda3630c79e42e0fafcbec3ac82cc Mon Sep 17 00:00:00 2001 From: Masayuki Harada Date: Thu, 3 Feb 2022 14:44:50 +0900 Subject: [PATCH 372/883] Add a comment. --- openair2/RRC/NR/rrc_gNB_NGAP.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 00ee9de3a0..1c1f8f315b 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1193,7 +1193,7 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_DONE) { break; } - + // Found established pdu session, prepare to send RRC message ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW; ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id; @@ -1204,7 +1204,7 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.length = NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.length; } - + // Save new pdu session parameters, qos, upf addr, teid for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos; qos_flow_index++) { ue_context_p->ue_context.modify_pdusession[i].param.qos[qos_flow_index] = NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].qos[qos_flow_index]; @@ -1216,6 +1216,7 @@ rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ( ue_context_p->ue_context.pduSession[j].param.upf_addr; ue_context_p->ue_context.modify_pdusession[i].param.gtp_teid = ue_context_p->ue_context.pduSession[j].param.gtp_teid; + is_treated[i] = TRUE; break; } From a37240197c1dd815131598b4c41ed9edd05147ee Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Feb 2022 18:57:22 +0100 Subject: [PATCH 373/883] minor changes, mostly cosmetic --- openair1/PHY/INIT/nr_init.c | 34 +++-- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 8 +- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 4 +- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 126 +++++++++--------- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 10 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 6 files changed, 98 insertions(+), 86 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 3f72075ac9..83ec2cf64c 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -93,7 +93,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { O2 = 1;//Vertical beam oversampling (1 or 4) N1 = gNB->frame_parms.nb_antennas_tx/(N2*x_polarization);// O1=1;//Horizontal beam oversampling (1 or 4) - CSI_RS_antenna_ports=N1*N2*x_polarization; + CSI_RS_antenna_ports=gNB->frame_parms.nb_antennas_tx; LOG_D(PHY, "NR Codebook Config: antenna ports: %d N1 %d N2 %d\n",CSI_RS_antenna_ports,N1,N2); // Generation of codebook Type1 with codebookMode 1 (CSI_RS_antenna_ports < 16) @@ -139,7 +139,9 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { } } - gNB->nr_mimo_precoding_matrix = (int32_t ***)malloc16(gNB->frame_parms.nb_antennas_tx* sizeof(int32_t **)); + int max_mimo_layers =(CSI_RS_antenna_portsnr_mimo_precoding_matrix = (int32_t ***)malloc16(max_mimo_layers* sizeof(int32_t **)); int32_t ***mat = gNB->nr_mimo_precoding_matrix; double complex res_code; @@ -174,7 +176,8 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); + LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n", + pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); } for(int len=N1*N2; len<2*N1*N2; len++) { @@ -187,7 +190,8 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); + LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n", + pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]); } } } @@ -257,7 +261,8 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n", + pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); } for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; @@ -269,7 +274,8 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); + LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n", + pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]); } } } @@ -281,7 +287,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Table 5.2.2.2.1-7: //Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - if(CSI_RS_antenna_ports>=3) { + if(max_mimo_layers>=3) { //pmi_size is computed as follows pmiq_size = 1;//unity matrix @@ -344,7 +350,8 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n", + pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); } for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2]; @@ -356,7 +363,8 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_I(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); + LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n", + pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]); } } } @@ -369,7 +377,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Table 5.2.2.2.1-8: //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - if(CSI_RS_antenna_ports>=4) { + if(max_mimo_layers>=4) { //pmi_size is computed as follows pmiq_size = 1;//unity matrix for(int llb=0; llb Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n", + pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); } for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) { @@ -451,7 +460,8 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15 else ((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15 - LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); + LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n", + pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]); } } } diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 62c8023da2..33071e4070 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -386,15 +386,15 @@ void nr_processULSegment(void* arg) { p_procTime); if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) { -//#ifdef PRINT_CRC_CHECK +#ifdef PRINT_CRC_CHECK LOG_I(PHY, "Segment %d CRC OK, iterations %d/%d\n",r,no_iteration_ldpc,max_ldpc_iterations); -//#endif +#endif rdata->decodeIterations = no_iteration_ldpc; if (rdata->decodeIterations > p_decoderParms->numMaxIter) rdata->decodeIterations--; } else { -//#ifdef PRINT_CRC_CHECK +#ifdef PRINT_CRC_CHECK LOG_I(PHY, "CRC NOK\n"); -//#endif +#endif rdata->decodeIterations = max_ldpc_iterations + 1; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 8edc20daf0..20c5689a09 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -446,7 +446,7 @@ void nr_processDLSegment(void* arg) { // Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) { - LOG_I(PHY,"Segment %u CRC OK\n",r); + LOG_D(PHY,"Segment %u CRC OK\n",r); if (r==0) { for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]); @@ -456,7 +456,7 @@ void nr_processDLSegment(void* arg) { no_iteration_ldpc = dlsch->max_ldpc_iterations; rdata->decodeIterations = no_iteration_ldpc; } else { - LOG_I(PHY,"CRC NOT OK\n"); + LOG_D(PHY,"CRC NOT OK\n"); } nb_total_decod++; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 756278d51d..4d945e96fa 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -99,12 +99,12 @@ uint8_t nr_zero_forcing_rx(int **rxdataF_comp, /* Apply layer demapping */ static void nr_dlsch_layer_demapping(int16_t **llr_cw, - uint8_t Nl, - uint8_t mod_order, - uint32_t length, - int32_t codeword_TB0, - int32_t codeword_TB1, - int16_t **llr_layers); + uint8_t Nl, + uint8_t mod_order, + uint32_t length, + int32_t codeword_TB0, + int32_t codeword_TB1, + int16_t **llr_layers); /* compute LLR */ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars, @@ -127,6 +127,7 @@ static int nr_dlsch_llr(NR_UE_PDSCH **pdsch_vars, uint8_t nr_slot_rx, uint8_t beamforming_mode); + /* Main Function */ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, @@ -173,7 +174,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, //int16_t *pllr_symbol_cw0_deint; //int16_t *pllr_symbol_cw1_deint; //uint16_t bundle_L = 2; - uint16_t n_tx=1, n_rx=1; int32_t median[16]; uint32_t nb_re_pdsch; uint16_t startSymbIdx=0; @@ -337,8 +337,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n", frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); - n_tx = dlsch0_harq->Nl; - n_rx = frame_parms->nb_antennas_rx; + int nl = dlsch0_harq->Nl; + int n_rx = frame_parms->nb_antennas_rx; nb_re_pdsch = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb_pdsch*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb_pdsch*(12-4*dlsch0_harq->n_dmrs_cdm_groups)) : (nb_rb_pdsch*12); //---------------------------------------------------------- //--------------------- Channel Scaling -------------------- @@ -346,7 +346,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); nr_dlsch_scale_channel(pdsch_vars[gNB_id]->dl_ch_estimates_ext, frame_parms, - n_tx, + nl, n_rx, dlsch, symbol, @@ -356,7 +356,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]); if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); + LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n", + frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0)); //---------------------------------------------------------- //--------------------- Channel Level Calc. ---------------- @@ -365,27 +366,27 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, if (first_symbol_flag==1) { nr_dlsch_channel_level(pdsch_vars[gNB_id]->dl_ch_estimates_ext, frame_parms, - n_tx, + nl, avg, symbol, nb_re_pdsch, nb_rb_pdsch); avgs = 0; - for (aatx=0;aatxnb_antennas_rx+aarx]); - avgs = cmax(avgs,avg[(aatx*frame_parms->nb_antennas_rx)+aarx]); + //LOG_I(PHY, "nb_rb %d len %d avg_%d_%d Power per SC is %d\n",nb_rb, len,aarx, aatx,avg[aatx*n_rx+aarx]); + avgs = cmax(avgs,avg[(aatx*n_rx)+aarx]); //LOG_I(PHY, "avgs Power per SC is %d\n", avgs); - median[(aatx*frame_parms->nb_antennas_rx)+aarx] = avg[(aatx*frame_parms->nb_antennas_rx)+aarx]; + median[(aatx*n_rx)+aarx] = avg[(aatx*n_rx)+aarx]; } if (dlsch0_harq->Nl > 1) { nr_dlsch_channel_level_median(pdsch_vars[gNB_id]->dl_ch_estimates_ext, median, - n_tx, + nl, n_rx, nb_re_pdsch, symbol*nb_rb_pdsch*12); - for (aatx = 0; aatx < n_tx; aatx++) { + for (aatx = 0; aatx < nl; aatx++) { for (aarx = 0; aarx < n_rx; aarx++) { avgs = cmax(avgs, median[aatx*n_rx + aarx]); } @@ -428,7 +429,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, pdsch_vars[gNB_id]->rxdataF_comp0, NULL,//NULL:disable meas. pdsch_vars[gNB_id]->rho:enable meas. frame_parms, - n_tx, + nl, symbol, nb_re_pdsch, first_symbol_flag, @@ -442,18 +443,18 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, start_meas(&ue->generic_stat_bis[proc->thread_id][slot]); - if (frame_parms->nb_antennas_rx > 1) { + if (n_rx > 1) { nr_dlsch_detection_mrc(pdsch_vars[gNB_id]->rxdataF_comp0, - (n_tx>1)? pdsch_vars[gNB_id]->rho : NULL, + (nl>1)? pdsch_vars[gNB_id]->rho : NULL, pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->dl_ch_magb0, pdsch_vars[gNB_id]->dl_ch_magr0, - n_tx, + nl, n_rx, symbol, nb_rb_pdsch, nb_re_pdsch); - if (n_tx >= 2)//Apply zero forcing for 2, 3, and 4 Tx layers + if (nl >= 2)//Apply zero forcing for 2, 3, and 4 Tx layers nr_zero_forcing_rx(pdsch_vars[gNB_id]->rxdataF_comp0, pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->dl_ch_magb0, @@ -461,7 +462,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, pdsch_vars[gNB_id]->dl_ch_estimates_ext, nb_rb_pdsch, n_rx, - n_tx, + nl, dlsch0_harq->Qm, pdsch_vars[gNB_id]->log2_maxh, symbol, @@ -1606,17 +1607,17 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext, //============================================================================================== unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, - int **dl_ch_estimates, - int **rxdataF_ext, - int **dl_ch_estimates_ext, - unsigned char symbol, - uint8_t pilots, - uint8_t config_type, - unsigned short start_rb, - unsigned short nb_rb_pdsch, - uint8_t n_dmrs_cdm_groups, - NR_DL_FRAME_PARMS *frame_parms, - uint16_t dlDmrsSymbPos) + int **dl_ch_estimates, + int **rxdataF_ext, + int **dl_ch_estimates_ext, + unsigned char symbol, + uint8_t pilots, + uint8_t config_type, + unsigned short start_rb, + unsigned short nb_rb_pdsch, + uint8_t n_dmrs_cdm_groups, + NR_DL_FRAME_PARMS *frame_parms, + uint16_t dlDmrsSymbPos) { unsigned short k,rb; @@ -1702,18 +1703,18 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, } void nr_dlsch_extract_rbs(int **rxdataF, - int **dl_ch_estimates, - int **rxdataF_ext, - int **dl_ch_estimates_ext, - unsigned char symbol, - uint8_t pilots, - uint8_t config_type, - unsigned short start_rb, - unsigned short nb_rb_pdsch, - uint8_t n_dmrs_cdm_groups, - uint8_t Nl, - NR_DL_FRAME_PARMS *frame_parms, - uint16_t dlDmrsSymbPos) + int **dl_ch_estimates, + int **rxdataF_ext, + int **dl_ch_estimates_ext, + unsigned char symbol, + uint8_t pilots, + uint8_t config_type, + unsigned short start_rb, + unsigned short nb_rb_pdsch, + uint8_t n_dmrs_cdm_groups, + uint8_t Nl, + NR_DL_FRAME_PARMS *frame_parms, + uint16_t dlDmrsSymbPos) { unsigned short k,rb; @@ -1942,9 +1943,9 @@ void nr_a_mult_b(int *a, * * */ void nr_element_sign(int32_t *a,//a - int32_t *b,//b - unsigned short nb_rb, - int32_t sign) + int32_t *b,//b + unsigned short nb_rb, + int32_t sign) { int16_t nr_sign[8]__attribute__((aligned(16))) = {-1,-1,-1,-1,-1,-1,-1,-1} ; unsigned short rb; @@ -2000,7 +2001,7 @@ void nr_determin(int32_t **a44,// ad_bc,//b nb_rb, sign); - }else { + } else { for (int rtx=0;rtxcodebookConfig->codebookType.choice.type1 = calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1)); csirep1->codebookConfig->codebookType.choice.type1->subType.present=NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel; csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel=calloc(1,sizeof(*csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel)); - if (dl_antenna_ports <= 2) { + if (dl_antenna_ports == 2) { csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present= NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two; csirep1->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.two= From f056f0c170f8df1c42c89140e5babf1019abea05 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Feb 2022 19:35:30 +0100 Subject: [PATCH 374/883] txdataF_precoding local --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 7 ++++++- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 3 +-- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 2 +- openair1/PHY/defs_gNB.h | 2 -- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 1061444f68..17c729e5ae 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -140,7 +140,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; int16_t **mod_symbs = (int16_t**)dlsch->mod_symbs; int16_t **tx_layers = (int16_t**)dlsch->txdataF; - int16_t **txdataF_precoding = (int16_t**)dlsch->txdataF_precoding; int8_t Wf[2], Wt[2], l0, l_prime, l_overline, delta; uint8_t dmrs_Type = rel15->dmrsConfigType; int nb_re_dmrs; @@ -277,6 +276,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, start_sc -= frame_parms->ofdm_symbol_size; int txdataF_offset = (slot%2)*frame_parms->samples_per_slot_wCP; + int16_t **txdataF_precoding = (int16_t **)malloc16(rel15->nrOfLayers*sizeof(int16_t *)); + for (int layer = 0; layernrOfLayers; layer++) + txdataF_precoding[layer] = (int16_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int16_t)); #ifdef DEBUG_DLSCH_MAPPING printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", @@ -591,6 +593,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, else { LOG_D(PHY,"beam index for PDSCH allocation already taken\n"); } + for (int layer = 0; layernrOfLayers; layer++) + free16(txdataF_precoding[layer],2*14*frame_parms->ofdm_symbol_size); + free16(txdataF_precoding,rel15->nrOfLayers); }// dlsch loop } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index cdcd0e0ba1..8a1dd57c48 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -122,7 +122,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, int txdataf_size = frame_parms->N_RB_DL*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8; // max pdsch encoded length for each layer dlsch->txdataF = (int32_t **)malloc16(max_layers*sizeof(int32_t *)); - dlsch->txdataF_precoding = (int32_t **)malloc16(max_layers*sizeof(int32_t *)); + dlsch->ue_spec_bf_weights = (int32_t ***)malloc16(max_layers*sizeof(int32_t **)); for (int layer=0; layerue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *)); @@ -135,7 +135,6 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, } } dlsch->txdataF[layer] = (int32_t *)malloc16((txdataf_size)*sizeof(int32_t)); - dlsch->txdataF_precoding[layer] = (int32_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int32_t)); } for (int q=0; qharq_processes[i]->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *)); - dlsch->harq_processes[i]->p_nrLDPC_procBuf = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *)); + dlsch->harq_processes[i]->p_nrLDPC_procBuf = (t_nrLDPC_procBuf **)malloc16(a_segments*sizeof(t_nrLDPC_procBuf *)); for (int r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 9217e566ae..df8340dd8c 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -158,8 +158,6 @@ typedef struct { NR_DL_gNB_HARQ_t harq_process; /// TX buffers for UE-spec transmission (antenna layers 1,...,4 after to precoding) int32_t **txdataF; - /// TX buffers for UE-spec transmission (antenna ports 1000 or 1001,...,1007, before precoding) - int32_t **txdataF_precoding; /// Modulated symbols buffer int32_t *mod_symbs[NR_MAX_NB_CODEWORDS]; /// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers? From 2b4ae3c4cee5de7316d98eba7f381d5ea7a6017a Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 4 Feb 2022 10:47:34 +0100 Subject: [PATCH 375/883] fix in nr_get_csi_payload --- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 39 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 1721205f54..bc0546756b 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -214,6 +214,7 @@ uint8_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac, uint8_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac, PUCCH_sched_t *pucch, + int csi_report_id, NR_CSI_MeasConfig_t *csi_MeasConfig); uint8_t get_rsrp_index(int rsrp); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index a5f6e4a7d1..bb3844085e 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2362,7 +2362,7 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, "CSI resource not found among PUCCH resources\n"); pucch->resource_indicator = found; - csi_bits = nr_get_csi_payload(mac, pucch, csi_measconfig); + csi_bits += nr_get_csi_payload(mac, pucch, csi_report_id, csi_measconfig); } } else @@ -2376,31 +2376,30 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, uint8_t nr_get_csi_payload(NR_UE_MAC_INST_t *mac, PUCCH_sched_t *pucch, + int csi_report_id, NR_CSI_MeasConfig_t *csi_MeasConfig) { int n_csi_bits = 0; AssertFatal(csi_MeasConfig->csi_ReportConfigToAddModList->list.count>0,"No CSI Report configuration available\n"); - for (int csi_report_id=0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++){ - struct NR_CSI_ReportConfig *csi_reportconfig = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; - NR_CSI_ResourceConfigId_t csi_ResourceConfigId = csi_reportconfig->resourcesForChannelMeasurement; - switch(csi_reportconfig->reportQuantity.present) { - case NR_CSI_ReportConfig__reportQuantity_PR_none: - break; - case NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP: - n_csi_bits += get_ssb_rsrp_payload(mac,pucch,csi_reportconfig,csi_ResourceConfigId,csi_MeasConfig); - break; - case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP: - case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI: - case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1: - case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI: - case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI: - case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI: - AssertFatal(1==0,"Measurement report based on CSI-RS not availalble\n"); - default: - AssertFatal(1==0,"Invalid CSI report quantity type %d\n",csi_reportconfig->reportQuantity.present); - } + struct NR_CSI_ReportConfig *csi_reportconfig = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; + NR_CSI_ResourceConfigId_t csi_ResourceConfigId = csi_reportconfig->resourcesForChannelMeasurement; + switch(csi_reportconfig->reportQuantity.present) { + case NR_CSI_ReportConfig__reportQuantity_PR_none: + break; + case NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP: + n_csi_bits = get_ssb_rsrp_payload(mac,pucch,csi_reportconfig,csi_ResourceConfigId,csi_MeasConfig); + break; + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP: + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI: + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1: + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_i1_CQI: + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI: + case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI: + AssertFatal(1==0,"Measurement report based on CSI-RS not availalble\n"); + default: + AssertFatal(1==0,"Invalid CSI report quantity type %d\n",csi_reportconfig->reportQuantity.present); } return (n_csi_bits); } From e39ad834c0b5d5934de9057b173b52d7997f2882 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 4 Feb 2022 15:20:24 +0000 Subject: [PATCH 376/883] Fix dci size for formats 1_0 and 0_0 and improve procedures when using Coreset0 --- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 15 +++++++- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 3 +- .../NR_MAC_UE/nr_ue_dci_configuration.c | 8 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 9 +++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 3 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 37 ++++++++++++++----- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 7 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 +- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 3 +- 9 files changed, 62 insertions(+), 26 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 264e86be7d..1917db6f86 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -2538,7 +2538,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, nr_dci_format_t format, nr_rnti_type_t rnti_type, uint16_t N_RB, - int bwp_id) { + int bwp_id, + uint16_t cset0_bwp_size) { uint16_t size = 0; uint16_t numRBG = 0; @@ -2588,7 +2589,9 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, /// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 Time Domain assgnmt 4 --20 size += 20; size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment -- hopping scenario to be updated - size += nr_dci_size(initialDownlinkBWP,initialUplinkBWP,cg,dci_pdu,NR_DL_DCI_FORMAT_1_0, rnti_type, N_RB, bwp_id) - size; // Padding to match 1_0 size + int dci_10_size = nr_dci_size(initialDownlinkBWP,initialUplinkBWP,cg,dci_pdu,NR_DL_DCI_FORMAT_1_0, rnti_type, N_RB, bwp_id, cset0_bwp_size); + AssertFatal(dci_10_size >= size, "NR_UL_DCI_FORMAT_0_0 size is bigger than NR_DL_DCI_FORMAT_1_0! 3GPP TS 38.212 Section 7.3.1.0: DCI size alignment is not fully implemented"); + size += dci_10_size - size; // Padding to match 1_0 size // UL/SUL indicator assumed to be 0 break; @@ -2805,6 +2808,14 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, case NR_DL_DCI_FORMAT_1_0: /// fixed: Format identifier 1, VRB2PRB 1, MCS 5, NDI 1, RV 2, HARQ PID 4, DAI 2, PUCCH TPC 2, PUCCH RInd 3, PDSCH to HARQ TInd 3 Time Domain assgnmt 4 -- 28 + + // 3GPP TS 38.212 Section 7.3.1.0: DCI size alignment + // Size of DCI format 1_0 is given by the size of CORESET 0 if CORESET 0 is configured for the cell and the size + // of initial DL bandwidth part if CORESET 0 is not configured for the cell + if(cset0_bwp_size>0) { + N_RB = cset0_bwp_size; + } + size = 28; size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 8182e1c930..92f9298d37 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -54,7 +54,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDLBWP, nr_dci_format_t format, nr_rnti_type_t rnti_type, uint16_t N_RB, - int bwp_id); + int bwp_id, + uint16_t cset0_bwp_size); void find_aggregation_candidates(uint8_t *aggregation_level, uint8_t *nr_of_candidates, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index 3453e071b1..0ee6f5501c 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -169,7 +169,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t rel15->SubcarrierSpacing = bwp_Common->genericParameters.subcarrierSpacing; } for (int i = 0; i < rel15->num_dci_options; i++) { - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_C, rel15->BWPSize, bwp_id); + rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_C, rel15->BWPSize, bwp_id, mac->type0_PDCCH_CSS_config.num_rbs); } break; case NR_RNTI_RA: @@ -185,7 +185,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t rel15->BWPStart = NRRIV2PRBOFFSET(bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); } rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing; - rel15->dci_length_options[0] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[0]], rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, bwp_id); + rel15->dci_length_options[0] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[0]], rel15->dci_format_options[0], NR_RNTI_RA, rel15->BWPSize, bwp_id, mac->type0_PDCCH_CSS_config.num_rbs); break; case NR_RNTI_P: break; @@ -200,7 +200,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t rel15->BWPStart = mac->type0_PDCCH_CSS_config.cset_start_rb; rel15->SubcarrierSpacing = initialDownlinkBWP->genericParameters.subcarrierSpacing; for (int i = 0; i < rel15->num_dci_options; i++) { - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_TC, rel15->BWPSize, bwp_id); + rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_TC, rel15->BWPSize, bwp_id, mac->type0_PDCCH_CSS_config.num_rbs); } break; case NR_RNTI_SP_CSI: @@ -223,7 +223,7 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t rel15->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon + 2; for (int i = 0; i < rel15->num_dci_options; i++) { - rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, 0); + rel15->dci_length_options[i] = nr_dci_size(initialDownlinkBWP,initialUplinkBWP, mac->cg, &mac->def_dci_pdu_rel15[rel15->dci_format_options[i]], rel15->dci_format_options[i], NR_RNTI_SI, rel15->BWPSize, 0, mac->type0_PDCCH_CSS_config.num_rbs); } break; case NR_RNTI_SFI: diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index f396f88284..483e4be692 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -846,7 +846,8 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t NR_UL_DCI_FORMAT_0_0, NR_RNTI_TC, pusch_pdu->bwp_size, - ra->bwp_id); + ra->bwp_id, + nr_mac->cset0_bwp_size); // Mark the corresponding RBs as used for (int rb = 0; rb < ra->msg3_nb_rb; rb++) { @@ -1359,7 +1360,8 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra NR_DL_DCI_FORMAT_1_0, NR_RNTI_RA, BWPSize, - bwpid); + bwpid, + nr_mac->cset0_bwp_size); // DL TX request nfapi_nr_pdu_t *tx_req = &nr_mac->TX_req[CC_id].pdu_list[nr_mac->TX_req[CC_id].Number_of_PDUs]; @@ -1732,7 +1734,8 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra NR_DL_DCI_FORMAT_1_0, NR_RNTI_TC, pdsch_pdu_rel15->BWPSize, - bwpid); + bwpid, + nr_mac->cset0_bwp_size); // Add padding header and zero rest out if there is space left if (ra->mac_pdu_length < harq->tb_size) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index df25b085e6..d57aa43483 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -535,7 +535,8 @@ void nr_fill_nfapi_dl_sib1_pdu(int Mod_idP, dci_format, rnti_type, pdsch_pdu_rel15->BWPSize, - 0); + 0, + gNB_mac->cset0_bwp_size); LOG_D(MAC,"BWPSize: %i\n", pdcch_pdu_rel15->BWPSize); LOG_D(MAC,"BWPStart: %i\n", pdcch_pdu_rel15->BWPStart); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index d98b641350..d7d136a06c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -565,7 +565,8 @@ bool allocate_dl_retransmission(module_id_t module_id, genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; } - const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); + const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; + const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); int rbStart = 0; // start wrt BWPstart NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; @@ -775,7 +776,8 @@ void pf_dl(module_id_t module_id, genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; } - const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; + const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); int rbStart = 0; // start wrt BWPstart if (sched_ctrl->available_dl_harq.head < 0) { @@ -884,8 +886,16 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; } - const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); - const uint16_t BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + NR_BWP_DownlinkDedicated_t *bwpd = + UE_info->CellGroup[UE_id] && + UE_info->CellGroup[UE_id]->spCellConfig && + UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated ? + UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; + + const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; + + const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + const uint16_t BWPStart = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_start : NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); uint16_t *vrb_map = RC.nrmac[module_id]->common_channels[CC_id].vrb_map; uint8_t rballoc_mask[bwpSize]; @@ -1060,6 +1070,8 @@ void nr_schedule_ue_spec(module_id_t module_id, genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; } + NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space : gNB_mac->sched_ctrlCommon->search_space; + const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId; nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid]; @@ -1072,7 +1084,6 @@ void nr_schedule_ue_spec(module_id_t module_id, dl_req->nPDUs += 1; pdcch_pdu = &dl_tti_pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15; LOG_D(NR_MAC,"Trying to configure DL pdcch for UE %d, bwp %d, cs %d\n",UE_id,bwpid,coresetid); - NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space:gNB_mac->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (bwp||bwpd)? sched_ctrl->coreset:gNB_mac->sched_ctrlCommon->coreset; nr_configure_pdcch(gNB_mac, pdcch_pdu, ss, coreset, scc, genericParameters, NULL); gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid] = pdcch_pdu; @@ -1093,8 +1104,14 @@ void nr_schedule_ue_spec(module_id_t module_id, const int pduindex = gNB_mac->pdu_index[CC_id]++; pdsch_pdu->pduIndex = pduindex; - pdsch_pdu->BWPSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); - pdsch_pdu->BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + if (coresetid == 0) { + pdsch_pdu->BWPSize = gNB_mac->cset0_bwp_size; + pdsch_pdu->BWPStart = gNB_mac->cset0_bwp_start; + } else { + pdsch_pdu->BWPSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); + pdsch_pdu->BWPStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); + } + pdsch_pdu->SubcarrierSpacing = genericParameters->subcarrierSpacing; pdsch_pdu->CyclicPrefix = genericParameters->cyclicPrefix ? *genericParameters->cyclicPrefix : 0; @@ -1223,8 +1240,7 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_payload.tpc, pucch->timing_indicator); - int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType && - sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific ? + int dci_format = ss && ss->searchSpaceType && ss->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; const int rnti_type = NR_RNTI_C; @@ -1236,7 +1252,8 @@ void nr_schedule_ue_spec(module_id_t module_id, dci_format, rnti_type, pdsch_pdu->BWPSize, - bwp? bwp->bwp_Id : 0); + bwp? bwp->bwp_Id : 0, + gNB_mac->cset0_bwp_size); LOG_D(NR_MAC, "coreset params: FreqDomainResource %llx, start_symbol %d n_symb %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 9b2db1f633..51c2aa5516 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1218,12 +1218,13 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, int dci_format, int rnti_type, int N_RB, - int bwp_id) { + int bwp_id, + uint16_t cset0_bwp_size) { uint8_t fsize = 0, pos = 0; uint64_t *dci_pdu = (uint64_t *)pdcch_dci_pdu->Payload; *dci_pdu=0; - int dci_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP,scc->uplinkConfigCommon->initialUplinkBWP, CellGroup, dci_pdu_rel15, dci_format, rnti_type, N_RB, bwp_id); + int dci_size = nr_dci_size(scc->downlinkConfigCommon->initialDownlinkBWP,scc->uplinkConfigCommon->initialUplinkBWP, CellGroup, dci_pdu_rel15, dci_format, rnti_type, N_RB, bwp_id, cset0_bwp_size); pdcch_dci_pdu->PayloadSizeBits = dci_size; AssertFatal(dci_size <= 64, "DCI sizes above 64 bits not yet supported"); if (dci_format == NR_DL_DCI_FORMAT_1_1 || dci_format == NR_UL_DCI_FORMAT_0_1) @@ -1567,7 +1568,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, pos+=4; *dci_pdu |= ((uint64_t)dci_pdu_rel15->harq_pid & 0xf) << (dci_size - pos); // Padding bits - for (int a = pos; a < 32; a++) + for (int a = pos; a < dci_size; a++) *dci_pdu |= ((uint64_t)dci_pdu_rel15->padding & 1) << (dci_size - pos++); // UL/SUL indicator – 1 bit /* commented for now (RK): need to get this from BWP descriptor diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index d86f03d6d2..15ed27e5c7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1824,7 +1824,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ps->dci_format, rnti_types[0], pusch_pdu->bwp_size, - bwpid); + bwpid, + nr_mac->cset0_bwp_size); memset(sched_pusch, 0, sizeof(*sched_pusch)); } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 83c4d3d950..4af58b3de4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -266,7 +266,8 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc, int dci_formats, int rnti_types, int N_RB, - int bwp_id); + int bwp_id, + uint16_t cset0_bwp_size); void prepare_dci(const NR_CellGroupConfig_t *CellGroup, dci_pdu_rel15_t *dci_pdu_rel15, From 92c5115f13b3b514b0644a686f611f714d0668c5 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 4 Feb 2022 16:23:46 +0100 Subject: [PATCH 377/883] lte: fixes in EpsNetworkFeatureSupport.c We have to eat all the bytes, not only one. We have to get the bit we want from the right buffer position. Note: only one bit is supported from this "EPS network feature support", not sure how to properly deal with it, so let's keep the code as it is. This commit was made because the MAGMA MME sends "EPS network feature support" to the UE in the NAS message "Attach Accept". OAI MME does not send this. So the bug about size was not seen. --- openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c b/openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c index 3a842406f0..2ef36d7595 100644 --- a/openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c +++ b/openair3/NAS/COMMON/IES/EpsNetworkFeatureSupport.c @@ -41,8 +41,11 @@ int decode_eps_network_feature_support(EpsNetworkFeatureSupport *epsnetworkfeatu ielen = *(buffer + decoded); decoded++; CHECK_LENGTH_DECODER(len - decoded, ielen); - *epsnetworkfeaturesupport = *buffer & 0x1; - decoded++; + /* note: only the bit "IMS voice over PS session in S1 mode" is processed + * TODO: deal with other bits? + */ + *epsnetworkfeaturesupport = (*(buffer + decoded)) & 0x1; + decoded += ielen; #if defined (NAS_DEBUG) dump_eps_network_feature_support_xml(epsnetworkfeaturesupport, iei); #endif From f92cfbaf12b929c30f6a3a67b24b15b66ea6b86a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 4 Feb 2022 18:28:07 +0100 Subject: [PATCH 378/883] LTE 2x2 TM2: DL 1Mbps, modulation not optimized --- ci-scripts/xml_files/lte_2x2_tm2_quectel.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml index fcc772b8f4..e6520fc5fc 100644 --- a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml @@ -102,8 +102,8 @@ Iperf - iperf (DL/26Mbps/UDP)(60 sec)(single-ue profile) - -u -b 26M -t 60 + iperf (DL/1Mbps/UDP)(60 sec)(single-ue profile) + -u -b 1M -t 60 DL nrmodule2_quectel 5 From da6b91d83265047e46ec64c3400b659938cbdd0d Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 3 Feb 2022 14:23:08 +0100 Subject: [PATCH 379/883] updating SA testcases (162PRB + testcase id) --- ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 8 +-- ci-scripts/xml_files/fr1_sa_quectel.xml | 6 ++- .../xml_files/fr1_sa_quectel_162prb.xml | 50 +++++++++++-------- .../xml_files/fr1_sa_quectel_stages.xml | 34 ++++++------- 4 files changed, 55 insertions(+), 43 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 11931d1700..f28c3167b6 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -82,11 +82,11 @@ gNBs = # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 dl_subcarrierSpacing = 1; - dl_carrierBandwidth = 106; + dl_carrierBandwidth = 162; #initialDownlinkBWP #genericParameters # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 28875; + initialDLBWPlocationAndBandwidth = 31889; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -104,11 +104,11 @@ gNBs = # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 106; + ul_carrierBandwidth = 162; pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 28875; + initialULBWPlocationAndBandwidth = 31889; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 8b0fc3b541..cd67637ec0 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -31,9 +31,13 @@ 010000 000001 050000 + 000001 050001 + 000001 070000 + 000001 070001 + 000001 070002 000001 010002 @@ -84,7 +88,7 @@ Ping - Ping: 20pings in 20sec + Ping: 40pings in 40sec nrmodule2_quectel -c 40 1 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml index 696ec790ff..23cc6d25b8 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -22,18 +22,21 @@ --> TEST-SA-FR1-Tab3 - SA Ping DL UL with QUECTEL + SA 162PRB tasks 1 - 040000 + 042000 000002 010000 000001 - 050000 - 050001 - 070000 - 070001 + 052000 + 000001 + 072000 + 000001 + 072001 + 000001 + 072002 000001 010002 080000 @@ -55,7 +58,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 --log_config.global_log_options level,nocolor,time @@ -81,39 +84,44 @@ - + Ping - Ping: 20pings in 20sec + Ping: 40pings in 40sec nrmodule2_quectel - -c 20 - 5 + -c 40 + 1 + 20 - - Ping - Ping: 100pings in 20sec - nrmodule2_quectel - -c 100 -i 0,2 - 5 - - + Iperf iperf (DL/140Mbps/UDP)(60 sec)(single-ue profile) -u -b 140M -t 60 DL nrmodule2_quectel - 5 + 50 + 50 single-ue - + Iperf iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) -u -b 3M -t 60 UL nrmodule2_quectel 5 + 95 + single-ue + + + + Iperf + iperf (BIDIR TCP)(10 sec)(single-ue profile) + -t 10 --bidir + BIDIR + nrmodule2_quectel single-ue diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index edc4440612..1e10d02180 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -26,21 +26,21 @@ tasks 1 - 040000 + 041000 000002 010000 000001 - 050000 + 051000 000001 - 070000 + 071000 000001 - 070001 + 071001 000001 - 070002 + 071002 000001 - 070003 + 071003 000001 - 070004 + 071004 000001 010002 080000 @@ -62,7 +62,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 --log_config.global_log_options level,nocolor,time @@ -88,9 +88,9 @@ - + Ping - Ping: 20pings in 20sec + Ping: 40pings in 40sec nrmodule2_quectel -c 40 1 @@ -98,7 +98,7 @@ - + Iperf iperf (DL/10Mbps/UDP)(30 sec)(single-ue profile) -u -b 10M -t 30 @@ -108,7 +108,7 @@ 95 single-ue - + Iperf iperf (DL/20Mbps/UDP)(30 sec)(single-ue profile) -u -b 20M -t 30 @@ -118,7 +118,7 @@ 95 single-ue - + Iperf iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile) -u -b 40M -t 30 @@ -128,7 +128,7 @@ 95 single-ue - + Iperf iperf (DL/60Mbps/UDP)(30 sec)(single-ue profile) -u -b 60M -t 30 @@ -138,14 +138,14 @@ 95 single-ue - + Iperf iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile) -u -b 90M -t 30 DL nrmodule2_quectel - 5 - 95 + 10 + 90 single-ue From 3a902ad0d132f7cf40cd3c33478c742146344990 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 5 Feb 2022 12:53:33 +0100 Subject: [PATCH 380/883] (Partially) revert "minor changes in dlschsim, still doesn't work :-(" This partially reverts commit bac8bc569c6a9ea073a17bff7fa487c8129cc114 and fixes nr_dlschsim, which did not compile without this commit. --- openair1/SIMULATION/NR_PHY/dlschsim.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 4d4195f15e..f566b93d9c 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -67,7 +67,6 @@ uint16_t n_rnti = 0x1234; openair0_config_t openair0_cfg[MAX_CARDS]; void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} -void processSlotTX(void *arg) {} int main(int argc, char **argv) { @@ -437,22 +436,9 @@ int main(int argc, char **argv) UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; - - gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); - initTpool(gNBthreads, gNB->threadPool, true); - gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); - initNotifiedFIFO(gNB->resp_L1_tx); - // we create 2 threads for L1 tx processing - notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX); - processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); - init_DLSCH_struct(gNB, msgDataTx); - msgDataTx->slot = slot; - msgDataTx->frame = frame; - memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); - reset_meas(&msgDataTx->phy_proc_tx); - gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx; - pushTpool(gNB->threadPool,msgL1Tx); - NR_gNB_DLSCH_t *dlsch = msgDataTx->dlsch[0][0]; + processingData_L1tx_t msgDataTx; + init_DLSCH_struct(gNB, &msgDataTx); + NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0]; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15; //time_stats_t *rm_stats, *te_stats, *i_stats; uint8_t is_crnti = 0, llr8_flag = 0; @@ -526,8 +512,8 @@ int main(int argc, char **argv) //printf("crc32: [0]->0x%08x\n",crc24c(test_input, 32)); // generate signal - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } @@ -657,7 +643,7 @@ int main(int argc, char **argv) for (i = 0; i < 2; i++) { printf("gNB %d\n", i); - free_gNB_dlsch(&(msgDataTx->dlsch[0][i]),N_RB_DL); + free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL); printf("UE %d\n", i); free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL); } From e27ce4db1ef4a70af0feb81fcb1c0dfdceee5da7 Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 6 Feb 2022 12:04:36 +0100 Subject: [PATCH 381/883] fix in max mcs for table1 --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index ea298494c4..7d61cd1cf6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -384,12 +384,17 @@ int nr_write_ce_dlsch_pdu(module_id_t module_idP, #define BLER_UPDATE_FRAME 10 #define BLER_FILTER 0.9f -int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t slot, int UE_id) +int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t slot, int UE_id, int mcs_table) { gNB_MAC_INST *nrmac = RC.nrmac[mod_id]; const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; + int max_allowed_mcs = (mcs_table == 1) ? 27 : 28; + int max_mcs = nrmac->dl_max_mcs; + if (nrmac->dl_max_mcs>max_allowed_mcs) + max_mcs = max_allowed_mcs; + NR_DL_bler_stats_t *bler_stats = &nrmac->UE_info.UE_sched_ctrl[UE_id].dl_bler_stats; /* first call: everything is zero. Initialize to sensible default */ if (bler_stats->last_frame_slot == 0 && bler_stats->mcs == 0) { @@ -435,7 +440,7 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t if (bler_stats->rd2_bler > nrmac->dl_rd2_bler_threshold && old_mcs > 6) { new_mcs -= 2; } else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) {*/ - if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs && dtx > 9) + if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < max_mcs && dtx > 9) new_mcs += 1; else if (bler_stats->bler > nrmac->dl_bler_target_upper && old_mcs > 6) new_mcs -= 1; @@ -699,7 +704,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ ps->nrOfLayers = 1; - sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id); + sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id, ps->mcs_Table); uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs]; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", From 9056bfa92627c8aced2d2c5a660c5eab82084102 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 7 Feb 2022 09:19:51 +0100 Subject: [PATCH 382/883] flag to update ps structure --- openair2/LAYER2/NR_MAC_gNB/config.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 10 +++++++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 15 ++++++++++++--- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index ae3a3bba24..b740277f41 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -614,6 +614,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]); const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + sched_ctrl->update_ps = TRUE; const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; if (sched_ctrl->available_dl_harq.len == 0) { // add all available DL HARQ processes for this UE in SA diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 7d61cd1cf6..ca140d4673 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -577,8 +577,10 @@ bool allocate_dl_retransmission(module_id_t module_id, } /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ - if (ps->time_domain_allocation != tda) + if (ps->time_domain_allocation != tda || sched_ctrl->update_ps) { nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps); + sched_ctrl->update_ps = FALSE; + } } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ @@ -704,7 +706,7 @@ void pf_dl(module_id_t module_id, /* Calculate coeff */ ps->nrOfLayers = 1; - sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id, ps->mcs_Table); + sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id, ps->mcsTableIdx); uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs]; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", @@ -794,8 +796,10 @@ void pf_dl(module_id_t module_id, NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; - if (ps->time_domain_allocation != tda) + if (ps->time_domain_allocation != tda || sched_ctrl->update_ps) { nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); + sched_ctrl->update_ps = FALSE; + } sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->pucch_allocation = alloc; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bde6c6109d..f845d17bac 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -973,8 +973,11 @@ bool allocate_ul_retransmission(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format - || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) + || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data + || sched_ctrl->update_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + sched_ctrl->update_ps = FALSE; + } LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size); } else { /* the retransmission will use a different time domain allocation, check @@ -1158,8 +1161,11 @@ void pf_ul(module_id_t module_id, const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; if (ps->time_domain_allocation != tda || ps->dci_format != dci_format - || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) + || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data + || sched_ctrl->update_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + sched_ctrl->update_ps = FALSE; + } NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = 9; update_ul_ue_R_Qm(sched_pusch, ps); @@ -1257,8 +1263,11 @@ void pf_ul(module_id_t module_id, const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; if (ps->time_domain_allocation != tda || ps->dci_format != dci_format - || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) + || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data + || sched_ctrl->update_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + sched_ctrl->update_ps = FALSE; + } update_ul_ue_R_Qm(sched_pusch, ps); /* Calculate the current scheduling bytes and the necessary RBs */ diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 45e0a5b52b..3c1c87d8a3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -594,7 +594,7 @@ typedef struct { int ul_failure; struct CSI_Report CSI_report[MAX_CSI_REPORTS]; bool SR; - + bool update_ps; /// information about every HARQ process NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES]; /// HARQ processes that are free From 00483797b4ce7aa41a992b9df295dde6a047a801 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 7 Feb 2022 10:02:08 +0100 Subject: [PATCH 383/883] code review comment --- openair3/ocp-gtpu/gtp_itf.cpp | 67 +++++++++++++++-------------- openair3/ocp-gtpu/gtp_itf.h | 12 +++--- openair3/ocp-gtpu/gtpv1u_eNB_task.h | 26 +++++------ openair3/ocp-gtpu/gtpv1u_gNB_task.h | 6 +-- 4 files changed, 57 insertions(+), 54 deletions(-) diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 379ec415dc..cc41de3550 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -79,7 +79,7 @@ class gtpEndPoint { // this allow using non standard gtp port number (different from 2152) // and so, for example tu run 4G and 5G cores on one system tcp_udp_port_t get_dstport() { - return (tcp_udp_port_t)atol(addr.destinationService); + return (tcp_udp_port_t)atol(addr.destinationService); } }; @@ -106,10 +106,10 @@ instance_t legacyInstanceMapping=0; #define compatInst(a) ((a)==0 || (a)==INSTANCE_DEFAULT?legacyInstanceMapping:a) #define GTPV1U_HEADER_SIZE (8) - - - static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, int msgType, teid_t teid, uint8_t *Msg,int msgLen, - bool seqNumFlag, bool npduNumFlag, bool extHdrFlag, int seqNum, int npduNum, int extHdrType) { + + +static int gtpv1uCreateAndSendMsg(int h, uint32_t peerIp, uint16_t peerPort, int msgType, teid_t teid, uint8_t *Msg,int msgLen, + bool seqNumFlag, bool npduNumFlag, bool extHdrFlag, int seqNum, int npduNum, int extHdrType) { AssertFatal(extHdrFlag==false,"Not developped"); int headerAdditional=0; @@ -149,6 +149,7 @@ instance_t legacyInstanceMapping=0; to.sin_addr.s_addr = peerIp ; LOG_D(GTPU,"sending packet size: %d to %s\n",fullSize, inet_ntoa(to.sin_addr) ); int ret; + if ((ret=sendto(h, (void *)buffer, (size_t)fullSize, 0,(struct sockaddr *)&to, sizeof(to) )) != fullSize ) { LOG_E(GTPU, "[SD %d] Failed to send data to " IPV4_ADDR " on port %d, buffer size %u, ret: %d, errno: %d\n", h, IPV4_ADDR_FORMAT(peerIp), peerPort, fullSize, ret, errno); @@ -196,7 +197,7 @@ static void gtpv1uSend(instance_t instance, gtpv1u_enb_tunnel_data_req_t *req, b gtpv1uCreateAndSendMsg(compatInst(instance), tmp.outgoing_ip_addr, tmp.outgoing_port, - GTP_GPDU, + GTP_GPDU, tmp.teid_outgoing, buffer, length, seqNumFlag, npduNumFlag, false, tmp.seqNum, tmp.npduNum, 0) ; } @@ -239,7 +240,7 @@ static void gtpv1uSend2(instance_t instance, gtpv1u_gnb_tunnel_data_req_t *req, gtpv1uCreateAndSendMsg(compatInst(instance), tmp.outgoing_ip_addr, tmp.outgoing_port, - GTP_GPDU, + GTP_GPDU, tmp.teid_outgoing, buffer, length, seqNumFlag, npduNumFlag, false, tmp.seqNum, tmp.npduNum, 0) ; } @@ -309,6 +310,7 @@ static int udpServerSocket(openAddr_s addr) { LOG_E(GTPU,"getaddrinfo error: %s\n", gai_strerror(status)); return -1; } + int sockfd=-1; // loop through all the results and bind to the first we can @@ -488,20 +490,20 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer } int gtpv1u_create_s1u_tunnel(instance_t instance, - const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, - gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) { + const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, + gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) { LOG_D(GTPU, "[%ld] Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %x\n", instance, create_tunnel_req->rnti, create_tunnel_req->num_tunnels, create_tunnel_req->sgw_S1u_teid[0]); tcp_udp_port_t dstport=globGtp.instances[compatInst(instance)].get_dstport(); + for (int i = 0; i < create_tunnel_req->num_tunnels; i++) { AssertFatal(create_tunnel_req->eps_bearer_id[i] > 4, "From legacy code not clear, seems impossible (bearer=%d)\n", create_tunnel_req->eps_bearer_id[i]); int incoming_rb_id=create_tunnel_req->eps_bearer_id[i]-4; - teid_t teid=newGtpuCreateTunnel(compatInst(instance), create_tunnel_req->rnti, incoming_rb_id, create_tunnel_req->eps_bearer_id[i], @@ -565,11 +567,12 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance, create_tunnel_req->num_tunnels, create_tunnel_req->outgoing_teid[0]); tcp_udp_port_t dstport=globGtp.instances[compatInst(instance)].get_dstport(); + for (int i = 0; i < create_tunnel_req->num_tunnels; i++) { teid_t teid=newGtpuCreateTunnel(instance, create_tunnel_req->rnti, create_tunnel_req->incoming_rb_id[i], create_tunnel_req->pdusession_id[i], - create_tunnel_req->outgoing_teid[i], + create_tunnel_req->outgoing_teid[i], create_tunnel_req->dst_addr[i], dstport, sdap_gnb_data_req); create_tunnel_resp->status=0; @@ -600,7 +603,7 @@ int gtpv1u_create_x2u_tunnel( AssertFatal( false, "to be developped\n"); } - int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { +int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { LOG_D(GTPU, "[%ld] Start delete tunnels for RNTI %x\n", instance, rnti); pthread_mutex_lock(&globGtp.gtp_lock); @@ -627,15 +630,15 @@ int gtpv1u_create_x2u_tunnel( LOG_I(GTPU, "[%ld] Deleted all tunnels for RNTI %x (%d tunnels deleted)\n", instance, rnti, nb); return !GTPNOK; } - - // Legacy delete tunnel finish by deleting all the rnti - // so the list of bearer provided is only a design bug - int gtpv1u_delete_s1u_tunnel( const instance_t instance, - const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { + +// Legacy delete tunnel finish by deleting all the rnti +// so the list of bearer provided is only a design bug +int gtpv1u_delete_s1u_tunnel( const instance_t instance, + const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { return newGtpuDeleteAllTunnels(instance, req_pP->rnti); } - - int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id) { + +int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id) { LOG_D(GTPU, "[%ld] Start delete tunnels for RNTI %x\n", instance, rnti); pthread_mutex_lock(&globGtp.gtp_lock); @@ -652,6 +655,7 @@ int gtpv1u_create_x2u_tunnel( for (int i=0; isecond.bearers.find(pdusession_id[i]); + if ( ptr2 == ptrRNTI->second.bearers.end() ) { LOG_E(GTPU,"[%ld] GTP-U instance: delete of not existing tunnel RNTI:RAB: %x/%x\n", instance, rnti,pdusession_id[i]); } else { @@ -659,33 +663,34 @@ int gtpv1u_create_x2u_tunnel( nb++; } } - + if (ptrRNTI->second.bearers.size() == 0 ) // no tunnels on this rnti, erase the ue entry inst->ue2te_mapping.erase(ptrRNTI); + pthread_mutex_unlock(&globGtp.gtp_lock); LOG_I(GTPU, "[%ld] Deleted all tunnels for RNTI %x (%d tunnels deleted)\n", instance, rnti, nb); return !GTPNOK; - } - +} + int gtpv1u_delete_x2u_tunnel( const instance_t instanceP, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) { LOG_E(GTPU,"x2 tunnel not implemented\n"); return 0; } - + int gtpv1u_delete_ngu_tunnel( const instance_t instance, - gtpv1u_gnb_delete_tunnel_req_t * req) { + gtpv1u_gnb_delete_tunnel_req_t *req) { return newGtpuDeleteTunnels(instance, req->rnti, req->num_pdusession, req->pdusession_id); } - + static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, uint32_t msgBufLen, uint16_t peerPort, uint32_t peerIp) { Gtpv1uMsgHeaderT *msgHdr = (Gtpv1uMsgHeaderT *) msgBuf; - + if ( msgHdr->version != 1 || msgHdr->PT != 1 ) { LOG_E(GTPU, "[%d] Received a packet that is not GTP header\n", h); return GTPNOK; @@ -696,14 +701,12 @@ static int Gtpv1uHandleEchoReq(int h, return GTPNOK; } - uint16_t seq=ntohs(*(uint16_t*)(msgHdr+1)); + uint16_t seq=ntohs(*(uint16_t *)(msgHdr+1)); LOG_D(GTPU, "[%d] Received a echo request, TEID: %d, seq: %hu\n", h, msgHdr->teid, seq); - uint8_t recovery[2]={14,0}; - + uint8_t recovery[2]= {14,0}; return gtpv1uCreateAndSendMsg(h, peerIp, peerPort, GTP_ECHO_RSP, ntohl(msgHdr->teid), - recovery, sizeof recovery, - 1, 0, 0, seq, 0, 0); - + recovery, sizeof recovery, + 1, 0, 0, seq, 0, 0); } static int Gtpv1uHandleError(int h, diff --git a/openair3/ocp-gtpu/gtp_itf.h b/openair3/ocp-gtpu/gtp_itf.h index 22a86bc887..ba6cf0f8bb 100644 --- a/openair3/ocp-gtpu/gtp_itf.h +++ b/openair3/ocp-gtpu/gtp_itf.h @@ -19,7 +19,7 @@ typedef boolean_t (*gtpCallback)( const pdcp_transmission_mode_t modeP, const uint32_t *sourceL2Id, const uint32_t *destinationL2Id); - + typedef struct openAddr_s { char originHost[HOST_NAME_MAX]; char originService[HOST_NAME_MAX]; @@ -33,11 +33,11 @@ typedef struct openAddr_s { void gtpv1uReceiver(int h); void gtpv1uProcessTimeout(int handle,void *arg); int gtpv1u_create_s1u_tunnel(const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req, - gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp); + gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp); int gtpv1u_update_s1u_tunnel(const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req_pP, - const rnti_t prior_rnti - ); + const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req_pP, + const rnti_t prior_rnti + ); int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); int gtpv1u_delete_s1u_tunnel( const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP); @@ -52,7 +52,7 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer transport_layer_addr_t remoteAddr, int port, gtpCallback callBack); void GtpuUpdateTunnelOutgoingTeid(instance_t instance, rnti_t rnti, ebi_t bearer_id, teid_t newOutgoingTeid); int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti); - int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id); +int newGtpuDeleteTunnels(instance_t instance, rnti_t rnti, int nbTunnels, pdusessionid_t *pdusession_id); instance_t gtpv1Init(openAddr_t context); void *gtpv1uTask(void *args); diff --git a/openair3/ocp-gtpu/gtpv1u_eNB_task.h b/openair3/ocp-gtpu/gtpv1u_eNB_task.h index dbfb6ae917..e764eb143b 100644 --- a/openair3/ocp-gtpu/gtpv1u_eNB_task.h +++ b/openair3/ocp-gtpu/gtpv1u_eNB_task.h @@ -30,8 +30,8 @@ #define GTPV1U_ENB_TASK_H_ typedef struct gtpv1u_data_s { - /* RB tree of UEs */ - hash_table_t *ue_mapping; + /* RB tree of UEs */ + hash_table_t *ue_mapping; } gtpv1u_data_t; #define GTPV1U_BEARER_OFFSET 3 @@ -53,8 +53,8 @@ typedef struct fixMe_gtpv1u_bearer_s { in_addr_t sgw_ip_addr; struct in6_addr sgw_ip6_addr; teid_t teid_teNB; - in_addr_t tenb_ip_addr; ///< target eNB ipv4 - struct in6_addr tenb_ip6_addr; ///< target eNB ipv6 + in_addr_t tenb_ip_addr; ///< target eNB ipv4 + struct in6_addr tenb_ip6_addr; ///< target eNB ipv6 tcp_udp_port_t port; //NwGtpv1uStackSessionHandleT stack_session; bearer_state_t state; @@ -86,28 +86,28 @@ gtpv1u_new_data_req( uint32_t buf_offset);*/ int gtpv1u_eNB_init(void); -void *gtpv1u_eNB_process_itti_msg(void*); +void *gtpv1u_eNB_process_itti_msg(void *); void *gtpv1u_eNB_task(void *args); int gtpv1u_create_x2u_tunnel( const instance_t instanceP, - const gtpv1u_enb_create_x2u_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_enb_create_x2u_tunnel_resp_t * const create_tunnel_resp_pP); + const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP, + gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP); int gtpv1u_create_s1u_tunnel( const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP); + const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP, + gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP); int gtpv1u_update_s1u_tunnel( - const instance_t instanceP, - const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP, - const rnti_t prior_rnti); + const instance_t instanceP, + const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP, + const rnti_t prior_rnti); int gtpv1u_delete_x2u_tunnel( const instance_t instanceP, - const gtpv1u_enb_delete_tunnel_req_t * const req_pP); + const gtpv1u_enb_delete_tunnel_req_t *const req_pP); #endif /* GTPV1U_ENB_TASK_H_ */ diff --git a/openair3/ocp-gtpu/gtpv1u_gNB_task.h b/openair3/ocp-gtpu/gtpv1u_gNB_task.h index cc36ee26fc..817d0109ba 100644 --- a/openair3/ocp-gtpu/gtpv1u_gNB_task.h +++ b/openair3/ocp-gtpu/gtpv1u_gNB_task.h @@ -37,8 +37,8 @@ void *nr_gtpv1u_gNB_task(void *args); int gtpv1u_create_ngu_tunnel( const instance_t instanceP, - const gtpv1u_gnb_create_tunnel_req_t * const create_tunnel_req_pP, - gtpv1u_gnb_create_tunnel_resp_t * const create_tunnel_resp_pP); + const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP, + gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp_pP); int gtpv1u_update_ngu_tunnel( @@ -48,7 +48,7 @@ gtpv1u_update_ngu_tunnel( ); int gtpv1u_delete_ngu_tunnel( const instance_t instance, - gtpv1u_gnb_delete_tunnel_req_t *req); + gtpv1u_gnb_delete_tunnel_req_t *req); #endif /* GTPV1U_GNB_TASK_H_ */ From 8dcf0d011d4d65af34cfa3fce29d400fdc0b8681 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 7 Feb 2022 13:40:15 +0100 Subject: [PATCH 384/883] two bugfixes: local pdcch_pdu in ul and wrong initialization place in find_candidate --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 1 + .../NR_MAC_gNB/gNB_scheduler_primitives.c | 19 +++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 9 +++++++-- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 14 +++++++------- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 89fccece07..499ceb859b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1163,6 +1163,7 @@ void nr_schedule_ue_spec(module_id_t module_id, pdsch_pdu->pduBitmap |= 0x1; // Bit 0: pdschPtrs - Indicates PTRS included (FR2) } + LOG_D(NR_MAC,"Configuring DCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti); /* Fill PDCCH DL DCI PDU */ nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu->dci_pdu[pdcch_pdu->numDlDci]; pdcch_pdu->numDlDci++; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 8f1bc986fe..f42fda5092 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -306,13 +306,13 @@ int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, return f; } -uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, - int cc_id, - int aggregation, - int nr_of_candidates, - NR_sched_pdcch_t *pdcch, - NR_ControlResourceSet_t *coreset, - uint16_t Y){ +int find_pdcch_candidate(gNB_MAC_INST *mac, + int cc_id, + int aggregation, + int nr_of_candidates, + NR_sched_pdcch_t *pdcch, + NR_ControlResourceSet_t *coreset, + uint16_t Y){ uint16_t *vrb_map = mac->common_channels[cc_id].vrb_map; const int next_cand = mac->pdcch_cand[coreset->controlResourceSetId]; @@ -332,12 +332,11 @@ uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, const int C = R>0 ? N_regs/(L*R) : 0; const int B_rb = L/N_symb; // nb of RBs occupied by each REG bundle - int first_cce; - bool taken = false; // flag if the resource for a given candidate are taken // loop over all the available candidates // this implements TS 38.211 Sec. 7.3.2.2 for(int m=next_cand; mShiftIndex, C, L, N_regs); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index e4fcecf059..ccefe94cd6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1512,6 +1512,11 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) nfapi_nr_ul_dci_request_t *ul_dci_req = &RC.nrmac[module_id]->UL_dci_req[CC_id]; ul_dci_req->SFN = frame; ul_dci_req->Slot = slot; + /* a PDCCH PDU groups DCIs per BWP and CORESET. Save a pointer to each + * allocated PDCCH so we can easily allocate UE's DCIs independent of any + * CORESET order */ + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_coreset[MAX_NUM_CORESET] = {0}; + NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; @@ -1750,7 +1755,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) NR_SearchSpace_t *ss = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->search_space: RC.nrmac[module_id]->sched_ctrlCommon->search_space; NR_ControlResourceSet_t *coreset = (sched_ctrl->active_bwp || ubwpd) ? sched_ctrl->coreset: RC.nrmac[module_id]->sched_ctrlCommon->coreset; const int coresetid = coreset->controlResourceSetId; - nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = nr_mac->pdcch_pdu_idx[CC_id][coresetid]; + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = pdcch_pdu_coreset[coresetid]; if (!pdcch_pdu) { nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu = &ul_dci_req->ul_dci_pdu_list[ul_dci_req->numPdus]; memset(ul_dci_request_pdu, 0, sizeof(nfapi_nr_ul_dci_request_pdus_t)); @@ -1759,7 +1764,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) pdcch_pdu = &ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15; ul_dci_req->numPdus += 1; nr_configure_pdcch(pdcch_pdu, coreset, genericParameters, &sched_ctrl->sched_pdcch); - nr_mac->pdcch_pdu_idx[CC_id][coresetid] = pdcch_pdu; + pdcch_pdu_coreset[coresetid] = pdcch_pdu; } LOG_D(NR_MAC,"Configuring ULDCI/PDCCH in %d.%d at CCE %d, rnti %x\n", frame,slot,sched_ctrl->cce_index,rnti); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index ed125fddb0..2dbb924d7b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -260,13 +260,13 @@ NR_sched_pdcch_t set_pdcch_structure(gNB_MAC_INST *gNB_mac, NR_BWP_t *bwp, NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config); -uint8_t find_pdcch_candidate(gNB_MAC_INST *mac, - int cc_id, - int aggregation, - int nr_of_candidates, - NR_sched_pdcch_t *pdcch, - NR_ControlResourceSet_t *coreset, - uint16_t Y); +int find_pdcch_candidate(gNB_MAC_INST *mac, + int cc_id, + int aggregation, + int nr_of_candidates, + NR_sched_pdcch_t *pdcch, + NR_ControlResourceSet_t *coreset, + uint16_t Y); void fill_pdcch_vrb_map(gNB_MAC_INST *mac, int CC_id, From c1dd5da1551312d2e615b5d12744150814b58bca Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 7 Feb 2022 12:45:14 +0000 Subject: [PATCH 385/883] Fix update_ps flag for PDSCH and PUSCH --- openair2/LAYER2/NR_MAC_gNB/config.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 8 ++++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 12 ++++++------ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 3 ++- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index b740277f41..94d9864844 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -614,7 +614,8 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]); const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - sched_ctrl->update_ps = TRUE; + sched_ctrl->update_pdsch_ps = TRUE; + sched_ctrl->update_pusch_ps = TRUE; const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; if (sched_ctrl->available_dl_harq.len == 0) { // add all available DL HARQ processes for this UE in SA diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index ca140d4673..236890e690 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -577,9 +577,9 @@ bool allocate_dl_retransmission(module_id_t module_id, } /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ - if (ps->time_domain_allocation != tda || sched_ctrl->update_ps) { + if (ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) { nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps); - sched_ctrl->update_ps = FALSE; + sched_ctrl->update_pdsch_ps = FALSE; } } else { /* the retransmission will use a different time domain allocation, check @@ -796,9 +796,9 @@ void pf_dl(module_id_t module_id, NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; - if (ps->time_domain_allocation != tda || sched_ctrl->update_ps) { + if (ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) { nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); - sched_ctrl->update_ps = FALSE; + sched_ctrl->update_pdsch_ps = FALSE; } sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index f845d17bac..b3c7711208 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -974,9 +974,9 @@ bool allocate_ul_retransmission(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data - || sched_ctrl->update_ps) { + || sched_ctrl->update_pusch_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_ps = FALSE; + sched_ctrl->update_pusch_ps = FALSE; } LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size); } else { @@ -1162,9 +1162,9 @@ void pf_ul(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data - || sched_ctrl->update_ps) { + || sched_ctrl->update_pusch_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_ps = FALSE; + sched_ctrl->update_pusch_ps = FALSE; } NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = 9; @@ -1264,9 +1264,9 @@ void pf_ul(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data - || sched_ctrl->update_ps) { + || sched_ctrl->update_pusch_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_ps = FALSE; + sched_ctrl->update_pusch_ps = FALSE; } update_ul_ue_R_Qm(sched_pusch, ps); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 3c1c87d8a3..8c7b9f10f1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -594,7 +594,8 @@ typedef struct { int ul_failure; struct CSI_Report CSI_report[MAX_CSI_REPORTS]; bool SR; - bool update_ps; + bool update_pdsch_ps; + bool update_pusch_ps; /// information about every HARQ process NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES]; /// HARQ processes that are free From b13ea677a22e29055d52f47608353c780aadaaf9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 14:22:20 +0100 Subject: [PATCH 386/883] Give warning when UL Failure on NR link --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index ccefe94cd6..843b8678fd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -711,7 +711,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_info->mac_stats[UE_id].ulsch_DTX++; } if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { - LOG_D(NR_MAC,"Detected UL Failure on PUSCH, stopping scheduling\n"); + LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", + UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; nr_mac_gNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } From ce9d1bd7c542d3e5f85f203978d13932cd6e09ad Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 14:23:05 +0100 Subject: [PATCH 387/883] Always schedule PUCCH to prevent stale PUCCH config --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ca641ed1ba..9a1841d088 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -141,7 +141,6 @@ void nr_schedule_pucch(int Mod_idP, for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - if (sched_ctrl->ul_failure==1 && get_softmodem_params()->phy_test==0) continue; const int n = sizeof(sched_ctrl->sched_pucch) / sizeof(*sched_ctrl->sched_pucch); for (int i = 0; i < n; i++) { NR_sched_pucch_t *curr_pucch = &UE_info->UE_sched_ctrl[UE_id].sched_pucch[i]; From f47131639469b91923e5d7966e63e19963a0fda9 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 7 Feb 2022 14:27:33 +0100 Subject: [PATCH 388/883] fix TRUE FALSE --- openair2/LAYER2/NR_MAC_gNB/config.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 94d9864844..b2d8ab774e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -614,8 +614,8 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]); const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - sched_ctrl->update_pdsch_ps = TRUE; - sched_ctrl->update_pusch_ps = TRUE; + sched_ctrl->update_pdsch_ps = true; + sched_ctrl->update_pusch_ps = true; const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; if (sched_ctrl->available_dl_harq.len == 0) { // add all available DL HARQ processes for this UE in SA diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 236890e690..ad3846c578 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -579,7 +579,7 @@ bool allocate_dl_retransmission(module_id_t module_id, * (re-)transmission */ if (ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) { nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps); - sched_ctrl->update_pdsch_ps = FALSE; + sched_ctrl->update_pdsch_ps = false; } } else { /* the retransmission will use a different time domain allocation, check @@ -798,7 +798,7 @@ void pf_dl(module_id_t module_id, const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; if (ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) { nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps); - sched_ctrl->update_pdsch_ps = FALSE; + sched_ctrl->update_pdsch_ps = false; } sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); sched_pdsch->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index b3c7711208..41b49f7b1c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -976,7 +976,7 @@ bool allocate_ul_retransmission(module_id_t module_id, || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data || sched_ctrl->update_pusch_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_pusch_ps = FALSE; + sched_ctrl->update_pusch_ps = false; } LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size); } else { @@ -1164,7 +1164,7 @@ void pf_ul(module_id_t module_id, || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data || sched_ctrl->update_pusch_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_pusch_ps = FALSE; + sched_ctrl->update_pusch_ps = false; } NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = 9; @@ -1266,7 +1266,7 @@ void pf_ul(module_id_t module_id, || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data || sched_ctrl->update_pusch_ps) { nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_pusch_ps = FALSE; + sched_ctrl->update_pusch_ps = false; } update_ul_ue_R_Qm(sched_pusch, ps); From 5e57b66cfcc7fb1a789976550ffea00b38d2133c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 20 Jan 2022 13:41:01 +0100 Subject: [PATCH 389/883] CI: Run T tracer in SA test --- ci-scripts/xml_files/fr1_sa_quectel.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 8b0fc3b541..746bd669cc 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -59,7 +59,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 --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 --T_stdout 2 --log_config.global_log_options level,nocolor,time 0 0 nr From b06b21d1ed6d5126d852797fc62cc37e04824034 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 24 Jan 2022 22:43:26 +0100 Subject: [PATCH 390/883] Perform log analysis from textlog only if T_stdout 0 --- ci-scripts/ran.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index da20998297..ad360d2179 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -671,10 +671,14 @@ class RANManagement(): mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5) mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.') mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.') + mySSH.command('killall --signal SIGKILL record', '\$', 5) mySSH.close() + # if T tracer was run with option 0 (no logs), analyze logs + # from textlog, otherwise do normal analysis (e.g., option 2) + result = re.search('T_stdout 0', str(self.Initialize_eNB_args)) + if (result is not None): logging.debug('\u001B[1m Replaying RAW record file\u001B[0m') mySSH.open(lIpAddr, lUserName, lPassWord) - mySSH.command('killall --signal SIGKILL record', '\$', 5) mySSH.command('cd ' + lSourcePath + '/common/utils/T/tracer/', '\$', 5) enbLogFile = self.eNBLogFiles[int(self.eNB_instance)] raw_record_file = enbLogFile.replace('.log', '_record.raw') From 997f8f9f4836594d950d85c918115f7a6f1298ea Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 25 Jan 2022 12:14:01 +0100 Subject: [PATCH 391/883] SA stage2 test numbers to not overwrite logs in ZIP --- .../xml_files/fr1_sa_quectel_stages.xml | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index edc4440612..318574f2b8 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -26,28 +26,28 @@ tasks 1 - 040000 + 041000 000002 - 010000 + 011000 000001 - 050000 + 051000 000001 - 070000 + 071000 000001 - 070001 + 071001 000001 - 070002 + 071002 000001 - 070003 + 071003 000001 - 070004 + 071004 000001 - 010002 - 080000 + 011002 + 081000 - + Initialize_UE Initialize Quectel nrmodule2_quectel @@ -55,14 +55,14 @@ - + Terminate_UE Terminate Quectel nrmodule2_quectel - + Initialize_eNB Initialize gNB -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time @@ -88,7 +88,7 @@ - + Ping Ping: 20pings in 20sec nrmodule2_quectel @@ -98,7 +98,7 @@ - + Iperf iperf (DL/10Mbps/UDP)(30 sec)(single-ue profile) -u -b 10M -t 30 @@ -108,7 +108,7 @@ 95 single-ue - + Iperf iperf (DL/20Mbps/UDP)(30 sec)(single-ue profile) -u -b 20M -t 30 @@ -118,7 +118,7 @@ 95 single-ue - + Iperf iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile) -u -b 40M -t 30 @@ -128,7 +128,7 @@ 95 single-ue - + Iperf iperf (DL/60Mbps/UDP)(30 sec)(single-ue profile) -u -b 60M -t 30 @@ -138,7 +138,7 @@ 95 single-ue - + Iperf iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile) -u -b 90M -t 30 @@ -151,7 +151,7 @@ - + Terminate_eNB Terminate gNB 0 From ef2fedfc5bf1979b7ee92c5a5e3e02de40fdd7e2 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 7 Feb 2022 23:50:01 +0100 Subject: [PATCH 392/883] fix existing bug in pucchsim.c and in random_channel.c --- openair1/SIMULATION/NR_PHY/pucchsim.c | 4 ++-- openair1/SIMULATION/TOOLS/random_channel.c | 2 +- openair2/RRC/NR/nr_rrc_proto.h | 3 --- openair2/RRC/NR/rrc_gNB.c | 21 --------------------- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 213924e5fd..251f4c6751 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -689,8 +689,8 @@ int main(int argc, char **argv) ack_nack_errors+=((actual_payload^payload_received)&1) + (((actual_payload^payload_received)&2)>>1); } else if (format==2) { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t uci_pdu; - nfapi_nr_pucch_pdu_t pucch_pdu; + nfapi_nr_uci_pucch_pdu_format_2_3_4_t uci_pdu={0}; + nfapi_nr_pucch_pdu_t pucch_pdu={0}; pucch_pdu.rnti = 0x1234; pucch_pdu.subcarrier_spacing = 1; pucch_pdu.group_hop_flag = PUCCH_GroupHopping&1; diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index f09d1a7ce1..b00f6e31d5 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -125,7 +125,7 @@ void fill_channel_desc(channel_desc_t *chan_desc, chan_desc->ch[i] = (struct complexd *) malloc(channel_length * sizeof(struct complexd)); for (i = 0; ichF[i] = (struct complexd *) malloc(1200 * sizeof(struct complexd)); // allocate for up to 100 RBs, 12 samples per RB + chan_desc->chF[i] = (struct complexd *) malloc(12*257 * sizeof(struct complexd)); // allocate for up to 257 RBs, 12 samples per RB LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps); diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 22109c3029..ca8c4991a7 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -110,9 +110,6 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *const ue_context_pP, const protocol_ctxt_t *const ctxt_pP ); -void apply_pdcp_config(rrc_gNB_ue_context_t *const ue_context_pP, - const protocol_ctxt_t *const ctxt_pP ); - void rrc_gNB_generate_RRCSetup( const protocol_ctxt_t *const ctxt_pP, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 5b370d3614..542aecf5aa 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -107,27 +107,6 @@ extern RAN_CONTEXT_t RC; -extern boolean_t nr_rrc_pdcp_config_asn1_req( - const protocol_ctxt_t *const ctxt_pP, - NR_SRB_ToAddModList_t *const srb2add_list, - NR_DRB_ToAddModList_t *const drb2add_list, - NR_DRB_ToReleaseList_t *const drb2release_list, - const uint8_t security_modeP, - uint8_t *const kRRCenc, - uint8_t *const kRRCint, - uint8_t *const kUPenc, - uint8_t *const kUPint - ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 - ,rb_id_t *const defaultDRB, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - static inline uint64_t bitStr_to_uint64(BIT_STRING_t *asn); mui_t rrc_gNB_mui = 0; From 8b4ae5ef2b05c2ea97bdf2614f61dd25128f4a02 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 7 Feb 2022 15:14:22 -0800 Subject: [PATCH 393/883] Remove the new UL_INFO local variable in the VNF. This struct is used to store the uplink 5G nFAPI messages between the proxy and the gNB MAC layer. The original OAI implementation utilizes a similarly named variable (UL_info) to store the uplink 5G nFAPI messages between the PHY and MAC layer. This commit will utilize the original UL_info variable prior to calling the handle functions. These changes allow us to make minimal changes to the nFAPI handle functions and modifies the NR_UL_Indication parent function instead. --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 530 ++++++++++++----------- 1 file changed, 270 insertions(+), 260 deletions(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 57bb411dcc..b94b22282c 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -63,7 +63,7 @@ extern uint16_t sl_ahead; void handle_nr_rach(NR_UL_IND_t *UL_info) { - if(NFAPI_MODE == NFAPI_MODE_PNF) { + if (NFAPI_MODE == NFAPI_MODE_PNF) { if (UL_info->rach_ind.number_of_pdus > 0) { LOG_D(PHY,"UL_info->UL_info->rach_ind.number_of_pdus:%d SFN/Slot:%d.%d \n", UL_info->rach_ind.number_of_pdus, UL_info->rach_ind.sfn,UL_info->rach_ind.slot); oai_nfapi_nr_rach_indication(&UL_info->rach_ind); @@ -71,69 +71,29 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) } return; } - NR_UL_IND_t UL_INFO; - nfapi_nr_rach_indication_t *rach_ind = NULL; - if (get_softmodem_params()->emulate_l1) - { - if (gnb_rach_ind_queue.num_items == 0) - return; - LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); - rach_ind = get_queue(&gnb_rach_ind_queue); - UL_INFO.rach_ind = *rach_ind; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; - } - else - { - UL_INFO.rach_ind = UL_info->rach_ind; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; - } - - int frame_diff = UL_info->frame - UL_INFO.rach_ind.sfn; - if (frame_diff < 0) - { + int frame_diff = UL_info->frame - UL_info->rach_ind.sfn; + if (frame_diff < 0) { frame_diff += 1024; } bool in_timewindow = frame_diff == 0 || (frame_diff == 1 && UL_info->slot < 7); - if (UL_INFO.rach_ind.number_of_pdus>0 && in_timewindow) { + if (UL_info->rach_ind.number_of_pdus > 0 && in_timewindow) { LOG_A(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n", - UL_info->frame, UL_info->slot, UL_INFO.rach_ind.sfn, UL_INFO.rach_ind.slot); - int npdus = UL_INFO.rach_ind.number_of_pdus; - for(int i = 0; i < npdus; i++) { - UL_INFO.rach_ind.number_of_pdus--; + UL_info->frame, UL_info->slot, UL_info->rach_ind.sfn, UL_info->rach_ind.slot); + for (int i = 0; i < UL_info->rach_ind.number_of_pdus; i++) { UL_info->rach_ind.number_of_pdus--; - if (UL_INFO.rach_ind.pdu_list[i].num_preamble>0) - AssertFatal(UL_INFO.rach_ind.pdu_list[i].num_preamble==1, - "More than 1 preamble not supported\n"); - - nr_initiate_ra_proc(UL_INFO.module_id, - UL_INFO.CC_id, - UL_INFO.rach_ind.sfn, - UL_INFO.rach_ind.slot, - UL_INFO.rach_ind.pdu_list[i].preamble_list[0].preamble_index, - UL_INFO.rach_ind.pdu_list[i].freq_index, - UL_INFO.rach_ind.pdu_list[i].symbol_index, - UL_INFO.rach_ind.pdu_list[i].preamble_list[0].timing_advance); + AssertFatal(UL_info->rach_ind.pdu_list[i].num_preamble == 1, "More than 1 preamble not supported\n"); + nr_initiate_ra_proc(UL_info->module_id, + UL_info->CC_id, + UL_info->rach_ind.sfn, + UL_info->rach_ind.slot, + UL_info->rach_ind.pdu_list[i].preamble_list[0].preamble_index, + UL_info->rach_ind.pdu_list[i].freq_index, + UL_info->rach_ind.pdu_list[i].symbol_index, + UL_info->rach_ind.pdu_list[i].preamble_list[0].timing_advance); } } - if (get_softmodem_params()->emulate_l1) - { - if (rach_ind && rach_ind->number_of_pdus > 0) - { - for(int i = 0; i < rach_ind->number_of_pdus; i++) - { - free(rach_ind->pdu_list[i].preamble_list); - rach_ind->pdu_list[i].preamble_list = NULL; - } - free(rach_ind->pdu_list); - rach_ind->pdu_list = NULL; - } - free(rach_ind); - rach_ind = NULL; - } } @@ -148,26 +108,11 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) return; } - NR_UL_IND_t UL_INFO; - nfapi_nr_uci_indication_t *uci_ind = NULL; - if (get_softmodem_params()->emulate_l1) - { - if (gnb_uci_ind_queue.num_items == 0) - return; - LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); - uci_ind = get_queue(&gnb_uci_ind_queue); - UL_INFO.uci_ind = *uci_ind; - } - else - { - UL_INFO.uci_ind = UL_info->uci_ind; - } - const module_id_t mod_id = UL_info->module_id; - const frame_t frame = UL_INFO.uci_ind.sfn; - const sub_frame_t slot = UL_INFO.uci_ind.slot; - int num_ucis = UL_INFO.uci_ind.num_ucis; - nfapi_nr_uci_t *uci_list = UL_INFO.uci_ind.uci_list; + const frame_t frame = UL_info->uci_ind.sfn; + const sub_frame_t slot = UL_info->uci_ind.slot; + int num_ucis = UL_info->uci_ind.num_ucis; + nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list; for (int i = 0; i < num_ucis; i++) { switch (uci_list[i].pdu_type) { @@ -178,7 +123,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1; LOG_D(NR_MAC, "The received uci has sfn slot %d %d, num_ucis %d and pdu_size %d\n", - UL_INFO.uci_ind.sfn, UL_INFO.uci_ind.slot, num_ucis, uci_list[i].pdu_size); + UL_info->uci_ind.sfn, UL_info->uci_ind.slot, num_ucis, uci_list[i].pdu_size); handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu); break; } @@ -192,39 +137,8 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) } } - if (get_softmodem_params()->emulate_l1) - { - for (int i = 0; i < num_ucis; i++) { - switch (uci_list[i].pdu_type) { - case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: - if (uci_list[i].pucch_pdu_format_0_1.harq) { - free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list); - uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; - } - free(uci_list[i].pucch_pdu_format_0_1.harq); - uci_list[i].pucch_pdu_format_0_1.harq = NULL; - free(uci_list[i].pucch_pdu_format_0_1.sr); - uci_list[i].pucch_pdu_format_0_1.sr = NULL; - break; + UL_info->uci_ind.num_ucis = 0; - case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: - free(uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); - free(uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); - free(uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); - break; - } - } - if (uci_ind && num_ucis > 0) { - free(uci_list); - uci_list = NULL; - } - free(uci_ind); - uci_ind = NULL; - } - else - { - UL_info->uci_ind.num_ucis = 0; - } } static bool crc_sfn_slot_matcher(void *wanted, void *candidate) @@ -264,173 +178,226 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) return; } - NR_UL_IND_t UL_INFO; - nfapi_nr_rx_data_indication_t *rx_ind = NULL; - nfapi_nr_crc_indication_t *crc_ind = NULL; - if (get_softmodem_params()->emulate_l1) - { - rx_ind = get_queue(&gnb_rx_ind_queue); - if (!rx_ind) - { - LOG_D(NR_PHY, "No rx data indication (empty gnb_rx_ind_queue)\n"); - return; + if (UL_info->rx_ind.number_of_pdus > 0 && UL_info->crc_ind.number_crcs > 0) { + AssertFatal(UL_info->rx_ind.number_of_pdus == UL_info->crc_ind.number_crcs, + "number_of_pdus %d, number_crcs %d\n", + UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs); + for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) { + const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i]; + const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[i]; + LOG_I(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x " + "UL_info->rx_ind.pdu_list[%d].rnti:%04x\n", + i, crc->rnti, i, rx->rnti); + + AssertFatal(crc->rnti == rx->rnti, "mis-match between CRC RNTI %04x and RX RNTI %04x\n", + crc->rnti, rx->rnti); + + LOG_D(NR_MAC, + "%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n", + UL_info->frame, + UL_info->slot, + crc->tb_crc_status ? "error" : "ok", + crc->tb_crc_status); + + /* if CRC passes, pass PDU, otherwise pass NULL as error indication */ + nr_rx_sdu(UL_info->module_id, + UL_info->CC_id, + UL_info->rx_ind.sfn, + UL_info->rx_ind.slot, + rx->rnti, + crc->tb_crc_status ? NULL : rx->pdu, + rx->pdu_length, + rx->timing_advance, + rx->ul_cqi, + rx->rssi); + handle_nr_ul_harq(UL_info->CC_id, UL_info->module_id, UL_info->frame, UL_info->slot, crc); } - - int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); - - crc_ind = unqueue_matching(&gnb_crc_ind_queue, - MAX_QUEUE_SIZE, - crc_sfn_slot_matcher, - &sfn_slot); - if (!crc_ind) - { - LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); - put_queue(&gnb_rx_ind_queue, rx_ind); - return; - } - - UL_INFO.rx_ind = *rx_ind; - UL_INFO.crc_ind = *crc_ind; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; } - else + UL_info->rx_ind.number_of_pdus = 0; + UL_info->crc_ind.number_crcs = 0; +} + +static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind, + nfapi_nr_uci_indication_t *uci_ind, + nfapi_nr_rx_data_indication_t *rx_ind, + nfapi_nr_crc_indication_t *crc_ind) { + if (rach_ind && rach_ind->number_of_pdus > 0) { - UL_INFO.rx_ind = UL_info->rx_ind; - UL_INFO.crc_ind = UL_info->crc_ind; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; + for(int i = 0; i < rach_ind->number_of_pdus; i++) + { + free(rach_ind->pdu_list[i].preamble_list); + rach_ind->pdu_list[i].preamble_list = NULL; + } + free(rach_ind->pdu_list); + rach_ind->pdu_list = NULL; + free(rach_ind); + rach_ind = NULL; } + if (uci_ind && uci_ind->num_ucis > 0) + { + for (int i = 0; i < uci_ind->num_ucis; i++) { + switch (uci_ind->uci_list[i].pdu_type) { + case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: + if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) { + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); + uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; + } + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); + uci_ind->uci_list[i].pucch_pdu_format_0_1.harq = NULL; + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr); + uci_ind->uci_list[i].pucch_pdu_format_0_1.sr = NULL; + break; - UL_INFO.frame = UL_INFO.rx_ind.sfn; - UL_INFO.slot = UL_INFO.rx_ind.slot; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; - LOG_D(NR_MAC, " UL_info frame slot vs rx_ind frame slot vs crc_ind slot frame slot = %u %u vs %u %u vs %u %u\n", - UL_info->frame, UL_info->slot, - UL_INFO.rx_ind.sfn, UL_INFO.rx_ind.slot, - UL_INFO.crc_ind.sfn, UL_INFO.crc_ind.slot - ); + case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); + break; + } + } + free(uci_ind->uci_list); + uci_ind->uci_list = NULL; + free(uci_ind); + uci_ind = NULL; + } + if (rx_ind && rx_ind->number_of_pdus > 0) + { + free(rx_ind->pdu_list); + rx_ind->pdu_list = NULL; + free(rx_ind); + rx_ind = NULL; + } + if (crc_ind && crc_ind->number_crcs > 0) + { + free(crc_ind->crc_list); + crc_ind->crc_list = NULL; + free(crc_ind); + crc_ind = NULL; + } +} - if (UL_INFO.rx_ind.number_of_pdus > 0 && UL_INFO.crc_ind.number_crcs > 0) { - for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) { - int j; - for (j = 0; j < UL_INFO.crc_ind.number_crcs; j++) { - // find crc_indication j corresponding rx_indication i - const nfapi_nr_rx_data_pdu_t *rx = &UL_INFO.rx_ind.pdu_list[i]; - const nfapi_nr_crc_t *crc = &UL_INFO.crc_ind.crc_list[j]; - LOG_D(NR_PHY, - "UL_INFO.crc_ind.pdu_list[%d].rnti:%04x " - "UL_INFO.rx_ind.pdu_list[%d].rnti:%04x\n", - j, - crc->rnti, - i, - rx->rnti); +static void remove_crc_pdu(nfapi_nr_crc_indication_t *crc_ind, int index) { + AssertFatal(index >= 0, "Invalid index %d\n", index); + AssertFatal(index < crc_ind->number_crcs, "Invalid index %d\n", index); + AssertFatal(crc_ind->number_crcs > 0, "Invalid crc_ind->number_crcs %d\n", crc_ind->number_crcs); - if (crc->rnti != rx->rnti) - { - LOG_D(NR_MAC, "mis-match between CRC rnti %04x and RX rnit %04x\n", crc->rnti, rx->rnti); - continue; - } + memmove(crc_ind->crc_list + index, + crc_ind->crc_list + index + 1, + sizeof(*crc_ind->crc_list) * (crc_ind->number_crcs - index - 1)); + crc_ind->number_crcs--; +} - LOG_D(NR_MAC, - "%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n", - UL_INFO.frame, - UL_INFO.slot, - crc->tb_crc_status ? "error" : "ok", - crc->tb_crc_status); +static void remove_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, int index) { + AssertFatal(index >= 0, "Invalid index %d\n", index); + AssertFatal(index < rx_ind->number_of_pdus, "Invalid index %d\n", index); + AssertFatal(rx_ind->number_of_pdus > 0, "Invalid rx_ind->number_of_pdus %d\n", rx_ind->number_of_pdus); - /* if CRC passes, pass PDU, otherwise pass NULL as error indication */ - nr_rx_sdu(UL_INFO.module_id, - UL_INFO.CC_id, - UL_INFO.rx_ind.sfn, - UL_INFO.rx_ind.slot, - rx->rnti, - crc->tb_crc_status ? NULL : rx->pdu, - rx->pdu_length, - rx->timing_advance, - rx->ul_cqi, - rx->rssi); - handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc); + memmove(rx_ind->pdu_list + index, + rx_ind->pdu_list + index + 1, + sizeof(*rx_ind->pdu_list) * (rx_ind->number_of_pdus - index - 1)); + rx_ind->number_of_pdus--; +} + +static bool crc_ind_has_rnti(nfapi_nr_crc_indication_t *crc_ind, uint16_t rnti) { + for (int i = 0; i < crc_ind->number_crcs; i++) { + if (rnti == crc_ind->crc_list[i].rnti) { + return true; + } + } + return false; +} + +static bool rx_ind_has_rnti(nfapi_nr_rx_data_indication_t *rx_ind, uint16_t rnti) { + for (int i = 0; i < rx_ind->number_of_pdus; i++) { + if (rnti == rx_ind->pdu_list[i].rnti) { + return true; + } + } + return false; +} + +static void match_crc_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, nfapi_nr_crc_indication_t *crc_ind) { + AssertFatal(crc_ind->number_crcs > 0 && rx_ind->number_of_pdus > 0, + "Invalid number of crc_ind->number_crcs %d or rx_ind->number_of_pdus %d\n", + crc_ind->number_crcs, rx_ind->number_of_pdus); + if (crc_ind->number_crcs > rx_ind->number_of_pdus) { + nfapi_nr_crc_indication_t *crc_ind_unmatched = calloc(1, sizeof(*crc_ind_unmatched)); + crc_ind_unmatched->header = crc_ind->header; + crc_ind_unmatched->sfn = crc_ind->sfn; + crc_ind_unmatched->slot = crc_ind->slot; + crc_ind_unmatched->number_crcs = 0; + crc_ind_unmatched->crc_list = NULL; + for (int i = 0; i < crc_ind->number_crcs; i++) { + if (!rx_ind_has_rnti(rx_ind, crc_ind->crc_list[i].rnti)) { + LOG_I(NR_MAC, "crc_ind->crc_list[%d].rnti %x does not match any rx_ind pdu rnti\n", + i, crc_ind->crc_list[i].rnti); + crc_ind_unmatched->number_crcs++; + if (crc_ind_unmatched->crc_list == NULL) { + crc_ind_unmatched->crc_list = malloc(sizeof(nfapi_nr_crc_t)); + } + else { + crc_ind_unmatched->crc_list = realloc(crc_ind_unmatched->crc_list, + sizeof(nfapi_nr_crc_t) * crc_ind_unmatched->number_crcs); + } + crc_ind_unmatched->crc_list[crc_ind_unmatched->number_crcs - 1] = crc_ind->crc_list[i]; + remove_crc_pdu(crc_ind, i); + } + if (crc_ind->number_crcs == rx_ind->number_of_pdus) { break; - } // for (j=0;jemulate_l1) - { - int last = UL_INFO.crc_ind.number_crcs - 1; - if (j < last) - { - crc_ind->crc_list[j] = crc_ind->crc_list[last]; - UL_INFO.crc_ind.number_crcs--; - } - else if (j == last) - { - UL_INFO.crc_ind.number_crcs--; - } - - last = UL_INFO.rx_ind.number_of_pdus - 1; - if (i < last) - { - rx_ind->pdu_list[i] = rx_ind->pdu_list[last]; - UL_INFO.rx_ind.number_of_pdus--; - i--; - } - else if (i == last) - { - UL_INFO.rx_ind.number_of_pdus--; - } - } - } // for (i=0;iemulate_l1) - { - if (UL_INFO.crc_ind.number_crcs > 0) - { - crc_ind->number_crcs = UL_INFO.crc_ind.number_crcs; - requeue(&gnb_crc_ind_queue, crc_ind); - } - - if (UL_INFO.rx_ind.number_of_pdus > 0) - { - rx_ind->number_of_pdus = UL_INFO.rx_ind.number_of_pdus; - requeue(&gnb_rx_ind_queue, rx_ind); - } - - if (UL_INFO.crc_ind.number_crcs == 0) - { - free(crc_ind->crc_list); - crc_ind->crc_list = NULL; - free(crc_ind); - crc_ind = NULL; - } - if (UL_INFO.rx_ind.number_of_pdus == 0) - { - free(rx_ind->pdu_list); - rx_ind->pdu_list = NULL; - free(rx_ind); - rx_ind = NULL; } } - else + AssertFatal(crc_ind_unmatched->number_crcs > 0, "The nubmer of unmatched crc_ind pdus %d <= 0\n", + crc_ind_unmatched->number_crcs); + if (!requeue(&gnb_crc_ind_queue, crc_ind_unmatched)) { - UL_info->crc_ind.number_crcs = 0; - UL_info->rx_ind.number_of_pdus = 0; + LOG_E(NR_PHY, "requeue failed for crc_ind_unmatched.\n"); + free(crc_ind_unmatched); + crc_ind_unmatched = NULL; } - } else if ((UL_INFO.rx_ind.number_of_pdus != 0) - || (UL_INFO.crc_ind.number_crcs != 0)) { - LOG_E(NR_PHY, - "hoping not to have mis-match between CRC ind and RX ind - " - "hopefully the missing message is coming shortly " - "rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n", - UL_INFO.rx_ind.number_of_pdus, - UL_INFO.rx_ind.sfn, - UL_INFO.rx_ind.slot, - UL_INFO.crc_ind.number_crcs, - UL_INFO.crc_ind.sfn, - UL_INFO.crc_ind.slot); + } + else if (crc_ind->number_crcs < rx_ind->number_of_pdus) { + nfapi_nr_rx_data_indication_t *rx_ind_unmatched = calloc(1, sizeof(*rx_ind_unmatched)); + rx_ind_unmatched->header = rx_ind->header; + rx_ind_unmatched->sfn = rx_ind->sfn; + rx_ind_unmatched->slot = rx_ind->slot; + rx_ind_unmatched->number_of_pdus = 0; + rx_ind_unmatched->pdu_list = NULL; + for (int i = 0; i < rx_ind->number_of_pdus; i++) { + if (!crc_ind_has_rnti(crc_ind, rx_ind->pdu_list[i].rnti)) { + LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %d does not match any crc_ind pdu rnti\n", + i, rx_ind->pdu_list[i].rnti); + rx_ind_unmatched->number_of_pdus++; + if (rx_ind_unmatched->pdu_list == NULL) { + rx_ind_unmatched->pdu_list = malloc(sizeof(nfapi_nr_rx_data_pdu_t)); + } + else { + rx_ind_unmatched->pdu_list = realloc(rx_ind_unmatched->pdu_list, + sizeof(nfapi_nr_rx_data_pdu_t) * rx_ind_unmatched->number_of_pdus); + } + rx_ind_unmatched->pdu_list[rx_ind_unmatched->number_of_pdus - 1] = rx_ind->pdu_list[i]; + remove_rx_pdu(rx_ind, i); + } + if (rx_ind->number_of_pdus == crc_ind->number_crcs) { + break; + } + } + AssertFatal(rx_ind_unmatched->number_of_pdus > 0, "The nubmer of unmatched rx_ind pdus %d <= 0\n", + rx_ind_unmatched->number_of_pdus); + if (!requeue(&gnb_rx_ind_queue, rx_ind_unmatched)) + { + LOG_E(NR_PHY, "requeue failed for rx_ind_unmatched.\n"); + free(rx_ind_unmatched); + rx_ind_unmatched = NULL; + } + } + else { + LOG_E(NR_MAC, "The number of crc pdus %d = the number of rx pdus %d\n", + crc_ind->number_crcs, rx_ind->number_of_pdus); } } void NR_UL_indication(NR_UL_IND_t *UL_info) { - AssertFatal(UL_info!=NULL,"UL_INFO is null\n"); + AssertFatal(UL_info!=NULL,"UL_info is null\n"); #ifdef DUMP_FAPI dump_ul(UL_info); #endif @@ -440,17 +407,60 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { NR_IF_Module_t *ifi = nr_if_inst[module_id]; gNB_MAC_INST *mac = RC.nrmac[module_id]; LOG_D(NR_PHY,"SFN/SLOT:%d.%d module_id:%d CC_id:%d UL_info[rach_pdus:%zu rx_ind:%zu crcs:%zu]\n", - UL_info->frame,UL_info->slot, - module_id,CC_id, gnb_rach_ind_queue.num_items, - gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items); + UL_info->frame, UL_info->slot, + module_id, CC_id, + gnb_rach_ind_queue.num_items, + gnb_rx_ind_queue.num_items, + gnb_crc_ind_queue.num_items); + + nfapi_nr_rach_indication_t *rach_ind = NULL; + nfapi_nr_uci_indication_t *uci_ind = NULL; + nfapi_nr_rx_data_indication_t *rx_ind = NULL; + nfapi_nr_crc_indication_t *crc_ind = NULL; + if (get_softmodem_params()->emulate_l1) + { + if (gnb_rach_ind_queue.num_items > 0) { + LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); + rach_ind = get_queue(&gnb_rach_ind_queue); + UL_info->rach_ind = *rach_ind; + } + if (gnb_uci_ind_queue.num_items > 0) { + LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); + uci_ind = get_queue(&gnb_uci_ind_queue); + UL_info->uci_ind = *uci_ind; + } + if (gnb_rx_ind_queue.num_items > 0 && gnb_crc_ind_queue.num_items > 0) { + LOG_I(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n", + gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items); + rx_ind = get_queue(&gnb_rx_ind_queue); + int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); + crc_ind = unqueue_matching(&gnb_crc_ind_queue, + MAX_QUEUE_SIZE, + crc_sfn_slot_matcher, + &sfn_slot); + if (!crc_ind) { + LOG_I(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); + requeue(&gnb_rx_ind_queue, rx_ind); + } + else { + UL_info->rx_ind = *rx_ind; + UL_info->crc_ind = *crc_ind; + if (crc_ind->number_crcs != rx_ind->number_of_pdus) { + match_crc_rx_pdu(&UL_info->rx_ind, &UL_info->crc_ind); + } + } + } + } handle_nr_rach(UL_info); - handle_nr_uci(UL_info); // clear UL DCI prior to handling ULSCH mac->UL_dci_req[CC_id].numPdus = 0; handle_nr_ulsch(UL_info); + if (get_softmodem_params()->emulate_l1) { + free_unqueued_nfapi_indications(rach_ind, uci_ind, rx_ind, crc_ind); + } if (NFAPI_MODE != NFAPI_MODE_PNF) { if (ifi->CC_mask==0) { From ae7e68baea6af63e9e5e5a4b1d3862d39cc2f593 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 8 Feb 2022 11:06:25 +0100 Subject: [PATCH 394/883] fix(ci): fix CN5G deployment with latest images Signed-off-by: Raphael Defosseux --- .../5g_fdd_rfsimulator/docker-compose.yaml | 4 +- .../5g_fdd_rfsimulator/oai-smf.conf | 133 ------------------ 2 files changed, 2 insertions(+), 135 deletions(-) delete mode 100644 ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml index bf75828ed1..587722f2ef 100644 --- a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml @@ -111,7 +111,6 @@ services: oai-smf: container_name: "rfsim5g-oai-smf" image: oai-smf:latest - entrypoint: /bin/bash -c "/openair-smf/bin/oai_smf -c /openair-smf/bin/oai-smf.conf -o" environment: - TZ=Europe/Paris - INSTANCE=0 @@ -140,12 +139,13 @@ services: - REGISTER_NRF=yes - DISCOVER_UPF=yes - USE_FQDN_DNS=yes + - DNN_NI0=oai + - DNN_NI2=oai.ipv4 depends_on: - oai-nrf - oai-amf volumes: - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh - - ./oai-smf.conf:/openair-smf/bin/oai-smf.conf healthcheck: test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" interval: 10s diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf deleted file mode 100644 index 0c83ab8be9..0000000000 --- a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai-smf.conf +++ /dev/null @@ -1,133 +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 -################################################################################ - -SMF = -{ - FQDN = "oai-smf-svc"; - INSTANCE = 0; # 0 is the default - PID_DIRECTORY = "/var/run"; # /var/run is the default - - INTERFACES : - { - N4 : - { - # SMF binded interface for N4 communication (UPF) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - }; - - SBI : - { - # SMF binded interface for SBI interface (e.g., communication with AMF, UDM) - INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE - IPV4_ADDRESS = "read"; - PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80) - HTTP2_PORT = 9090; # YOUR NETWORK CONFIG HERE - API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE - }; - - }; - - - # Pool of UE assigned IP addresses - # Do not make IP pools overlap - # first IPv4 address X.Y.Z.1 is reserved for GTP network device on UPF - IP_ADDRESS_POOL : - { - IPV4_LIST = ( - {RANGE = "12.1.1.2 - 12.1.1.128";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "12.1.1.129 - 12.1.1.224";}, # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - {RANGE = "10.10.10.2 - 10.10.10.253";} # STRING, IPv4 RANGE IP_start - IP_end, YOUR NETWORK CONFIG HERE. - - ); - IPV6_LIST = ( - {PREFIX = "2001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "3001:1:2::/64";}, # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - {PREFIX = "4001:1:2::/64";} # STRING, IPv6 prefix, YOUR NETWORK CONFIG HERE. - ); - }; - - DNN_LIST = ( - # IPV4_POOL, IPV6_POOL are index in IPV4_LIST, IPV6_LIST, PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6} - {DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 2; IPV6_POOL = -1}, - {DNN_NI = "carrier.com"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 1; IPV6_POOL = -1}, - {DNN_NI = "oai"; PDU_SESSION_TYPE = "IPv4"; IPV4_POOL = 0; IPV6_POOL = -1} - ); - - # DNS address communicated to UEs - DEFAULT_DNS_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.18.129"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_IPV6_ADDRESS = "2001:4860:4860::8888"; # YOUR DNS CONFIG HERE - DEFAULT_DNS_SEC_IPV6_ADDRESS = "2001:4860:4860::8844"; # YOUR DNS CONFIG HERE - - SUPPORT_FEATURES: - { - # STRING, {"yes", "no"}, - REGISTER_NRF = "yes"; # Set to yes if SMF resgisters to an NRF - DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection - FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no", - # but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling - USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDM - USE_FQDN_DNS = "yes"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN - } - - AMF : - { - IPV4_ADDRESS = "0.0.0.0"; # YOUR AMF CONFIG HERE - PORT = 80; # YOUR AMF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-amf" # YOUR AMF FQDN CONFIG HERE - }; - - UDM : - { - IPV4_ADDRESS = "127.0.0.1"; # YOUR UDM CONFIG HERE - PORT = 80; # YOUR UDM CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR UDM API VERSION FOR SBI CONFIG HERE - FQDN = "localhost" # YOUR UDM FQDN CONFIG HERE - }; - - NRF : - { - IPV4_ADDRESS = "192.168.71.130"; # YOUR NRF CONFIG HERE - PORT = 80; # YOUR NRF CONFIG HERE (default: 80) - API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE - FQDN = "oai-nrf" # YOUR NRF FQDN CONFIG HERE - }; - - UPF_LIST = ( - {IPV4_ADDRESS = "192.168.71.134" ; FQDN = "oai-spgwu"} # YOUR UPF CONFIG HERE - ); - - LOCAL_CONFIGURATION : - { - SESSION_MANAGEMENT_SUBSCRIPTION_LIST = ( - { NSSAI_SST = 222, NSSAI_SD = "123", DNN = "default", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 7, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"}, - { NSSAI_SST = 1; NSSAI_SD = "1", DNN = "oai", DEFAULT_SESSION_TYPE = "IPV4", DEFAULT_SSC_MODE = 1, - QOS_PROFILE_5QI = 6, QOS_PROFILE_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PRIORITY_LEVEL = 1, QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT", - QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE", SESSION_AMBR_UL = "20Mbps", SESSION_AMBR_DL = "22Mbps"} - ); - }; - -}; - From ebfea5a0c94a532af67cba45b82c663ef6ace5ea Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 8 Feb 2022 13:45:20 +0100 Subject: [PATCH 395/883] fix in txdataF_precoding initialization --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 17c729e5ae..b70b07f215 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -278,7 +278,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int txdataF_offset = (slot%2)*frame_parms->samples_per_slot_wCP; int16_t **txdataF_precoding = (int16_t **)malloc16(rel15->nrOfLayers*sizeof(int16_t *)); for (int layer = 0; layernrOfLayers; layer++) - txdataF_precoding[layer] = (int16_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int16_t)); + txdataF_precoding[layer] = (int16_t *)malloc16(2*2*14*frame_parms->ofdm_symbol_size*sizeof(int16_t)); #ifdef DEBUG_DLSCH_MAPPING printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", From eca14f6ec9562b49771726954897d5418fa5c168 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 3 Feb 2022 15:00:21 +0100 Subject: [PATCH 396/883] Schedule UL 5 RBs at MCS 10 on inactivity --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 827d95dba5..2220f8065f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -2769,13 +2769,12 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP, UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 5; UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10; } else { - // assigne RBS( 3 RBs) -/* - first_rb[CC_id] = first_rb[CC_id] + 3; - UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul = 3; - UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 2; + // assigne RBS( 5 RBs) + first_rb[CC_id] = first_rb[CC_id] + 5; + UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul = 5; + UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 4; UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10; -*/ } + } } } else if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_INACTIVE ) { // assigne RBS( 3 RBs) From 759314a12572799ddecf6f1538fcbf561621e9f7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 16:00:47 +0100 Subject: [PATCH 397/883] Enrich assert in ULSCH decoding --- openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index ae8c666d18..fceff580a3 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -601,7 +601,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB, G = G - Q_RI - Q_CQI; ulsch_harq->G = G; AssertFatal((int)G > 0, - "FATAL: ulsch_decoding.c G < 0 (%u) : Q_RI %u, Q_CQI %u\n",G,Q_RI,Q_CQI); + "FATAL: ulsch_decoding.c G < 0 (%u) : Q_RI %u, Q_CQI %u, nb_rb %u, Q_m %u, ulsch_harq->Nsymb_pusch %u, Qprime %u\n", + G, Q_RI, Q_CQI, nb_rb, Q_m, ulsch_harq->Nsymb_pusch, Qprime); H = G + Q_CQI; Hprime = H/Q_m; // Demultiplexing/Deinterleaving of PUSCH/ACK/RI/CQI From 388cfafea8cd93fd85bcc78ae4fa564e96a16e42 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 16:31:44 +0100 Subject: [PATCH 398/883] Stop scheduling in UL after ul_failure_timer --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index 2220f8065f..bb013906f7 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -2241,7 +2241,8 @@ void ulsch_scheduler_pre_ue_select_fairRR( if (UE_info->UE_template[CC_id][UE_id].configured == FALSE) continue; - if (UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; // UL DCI @@ -2403,7 +2404,8 @@ void ulsch_scheduler_pre_ue_select_fairRR( if (UE_info->UE_template[CC_id][UE_id].configured == FALSE) continue; - if (UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; if ( (ulsch_ue_select[CC_id].ue_num >= ulsch_ue_max_num[CC_id]) || (cc_id_flag[CC_id] == 1) ) { From 5bdaeb571840acbb861adeea6b37a419f023140c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Feb 2022 18:39:06 +0100 Subject: [PATCH 399/883] Stop scheduling DL on UL failure or out of sync --- openair2/LAYER2/MAC/eNB_scheduler_fairRR.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c index bb013906f7..6c9ffabd4f 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c @@ -220,6 +220,11 @@ void dlsch_scheduler_pre_ue_select_fairRR( continue; } + + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; + if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) { continue; } @@ -335,6 +340,10 @@ void dlsch_scheduler_pre_ue_select_fairRR( if (rnti == NOT_A_RNTI) continue; + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; + if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) { continue; } @@ -459,6 +468,10 @@ void dlsch_scheduler_pre_ue_select_fairRR( if (rnti == NOT_A_RNTI) continue; + if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0 + || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) + continue; + if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) { continue; } From 8e6e4d82370cbf2758238e317be8b2a11c30f2e0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 8 Feb 2022 10:58:04 +0100 Subject: [PATCH 400/883] Log inactivity timer --- openair2/LAYER2/MAC/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c index a4e924c68b..4554b247f5 100644 --- a/openair2/LAYER2/MAC/main.c +++ b/openair2/LAYER2/MAC/main.c @@ -68,7 +68,7 @@ void *mac_stats_thread(void *param) { else { total_bler = (double)UE_scheduling_control->pusch_rx_error_num[CC_id] / (double)(UE_scheduling_control->pusch_rx_error_num[CC_id] + UE_scheduling_control->pusch_rx_num[CC_id]) * 100; } - fprintf(fd,"MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d\n", + fprintf(fd,"MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d inactivity timer %d\n", rnti, UE_scheduling_control->ul_out_of_sync == 0 ? "in synch" : "out of sync", UE_info->UE_template[CC_id][UE_id].phr_info, @@ -97,7 +97,8 @@ void *mac_stats_thread(void *param) { #endif UE_scheduling_control->first_cnt[CC_id], UE_scheduling_control->ret_cnt[CC_id], - UE_scheduling_control->aperiodic_ri_received[CC_id] + UE_scheduling_control->aperiodic_ri_received[CC_id], + UE_scheduling_control->ul_inactivity_timer ); fprintf(fd," ULSCH rounds %d/%d/%d/%d, DLSCH rounds %d/%d/%d/%d, ULSCH errors %d, DLSCH errors %d\n", UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0], From b897287d1f65caeba94da4bf6614db7b616bacd0 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 8 Feb 2022 11:51:49 -0800 Subject: [PATCH 401/883] Changes made to gNB cause emulated-L1 mode not to work for multiple UEs. It seems that the RA procedure in the gNB was modified so the RAR is sent in a single tx_data_req. The emualted mode was not previously handling this. We now only process the PDU in the rx_ind that has a matching preamble. If any other PDUs exist, we ignore them and only build Msg3 based on this single matching RAR PDU. Also, two bug fixes applied here in the emulate-l1 mode. --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 12 ++++++++++++ openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 85bb10290a..b5680a9bf8 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3809,6 +3809,18 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t LOG_A(NR_MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d\n", mod_id, frame, slot, rarh->RAPID); rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR)); ra->RA_RAPID_found = 1; + if (get_softmodem_params()->emulate_l1) { + LOG_I(NR_MAC, "If we found the RAR, the other PDUs are for other UEs and we dont need to process. " + "Only save rx_indication_body[%d] as only PDU in RX_indication\n", pdu_id); + dl_info->rx_ind->number_pdus = 1; + if (pdu_id != 0) { + memcpy(&dl_info->rx_ind->rx_indication_body[0], + &dl_info->rx_ind->rx_indication_body[pdu_id], + sizeof(fapi_nr_rx_indication_body_t)); + } + mac->nr_ue_emul_l1.expected_rar = false; + memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar)); + } break; } if (rarh->E == 0) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c7b54950d7..b98a9c8789 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -292,11 +292,11 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ { NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); mac->nr_ue_emul_l1.expected_sib = false; - memset(mac->nr_ue_emul_l1.index_has_sib, 0, sizeof(*mac->nr_ue_emul_l1.index_has_sib)); + memset(mac->nr_ue_emul_l1.index_has_sib, 0, sizeof(mac->nr_ue_emul_l1.index_has_sib)); mac->nr_ue_emul_l1.expected_rar = false; - memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(*mac->nr_ue_emul_l1.index_has_rar)); + memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar)); mac->nr_ue_emul_l1.expected_dci = false; - memset(mac->nr_ue_emul_l1.index_has_dci, 0, sizeof(*mac->nr_ue_emul_l1.index_has_dci)); + memset(mac->nr_ue_emul_l1.index_has_dci, 0, sizeof(mac->nr_ue_emul_l1.index_has_dci)); int pdu_idx = 0; int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs; @@ -420,7 +420,7 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi if (!dl_info->rx_ind) { - dl_info->rx_ind = CALLOC(1, sizeof(fapi_nr_rx_indication_t)); + dl_info->rx_ind = CALLOC(num_pdus, sizeof(fapi_nr_rx_indication_t)); } AssertFatal(dl_info->rx_ind != NULL, "%s: Out of memory in calloc", __FUNCTION__); fapi_nr_rx_indication_t *rx_ind = dl_info->rx_ind; From 62b525c579a756451ff9ae8258fe942f27e70933 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 8 Feb 2022 11:59:54 -0800 Subject: [PATCH 402/883] TODO: Revert this change after discussion with OAI --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 4261020f76..5a71d2b187 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1640,9 +1640,9 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra } } - if (rbStart > (BWPSize - rbSize)) { - LOG_E(NR_MAC, "%s(): cannot find free vrb_map for RNTI %04x!\n", __func__, ra->rnti); - return; + while (rbStart > (BWPSize - rbSize)) { + LOG_E(NR_MAC, "%s(): cannot find free vrb_map for RNTI %04x so decrament rbStart %d!\n", __func__, ra->rnti, rbStart); + rbStart--; } // Checking if the DCI allocation is feasible in current subframe From 9da3cbc9ec4b8e0e9056ad1ae41cfdaec49a23f8 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 14 Dec 2021 16:17:30 -0800 Subject: [PATCH 403/883] Cherry picking UCI multiplexing for CSI reports --- executables/nr-ue.c | 76 ----- nfapi/oai_integration/nfapi_vnf.c | 37 +-- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 22 +- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 87 +++++- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 3 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 299 ++++++++++++++------ openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 2 + 8 files changed, 333 insertions(+), 194 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2e7b2ea0e1..2cbeaf502c 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -194,69 +194,6 @@ static void L1_nsa_prach_procedures(frame_t frame, int slot, fapi_nr_ul_config_p LOG_D(NR_MAC, "We have successfully filled the rach_ind queue with the recently filled rach ind\n"); } -static bool sfn_slot_matcher(void *wanted, void *candidate) -{ - nfapi_p7_message_header_t *msg = candidate; - int sfn_sf = *(int*)wanted; - - switch (msg->message_id) - { - case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: - { - nfapi_nr_rach_indication_t *ind = candidate; - return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; - } - - case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: - { - nfapi_nr_rx_data_indication_t *ind = candidate; - return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; - } - - case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: - { - nfapi_nr_crc_indication_t *ind = candidate; - return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; - } - - case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: - { - nfapi_nr_uci_indication_t *ind = candidate; - return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; - } - - case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: - { - nfapi_nr_dl_tti_request_t *ind = candidate; - return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; - } - - case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: - { - nfapi_nr_tx_data_request_t *ind = candidate; - return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; - } - - case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: - { - nfapi_nr_ul_dci_request_t *ind = candidate; - return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; - } - - case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: - { - nfapi_nr_ul_tti_request_t *ind = candidate; - return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; - } - - default: - LOG_E(NR_MAC, "sfn_slot_match bad ID: %d\n", msg->message_id); - - } - - return false; -} - static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) { nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); @@ -265,15 +202,6 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue); nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); - LOG_D(NR_MAC, "Try to get a ul_tti_req for sfn/slot %d %d from queue with %lu items\n", - NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot),NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot), nr_ul_tti_req_queue.num_items); - nfapi_nr_ul_tti_request_t *ul_tti_request = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_harq_sfn_slot); - if (!ul_tti_request) - { - LOG_D(NR_MAC, "Try to get a ul_tti_req from seprate queue because dl_tti_req was late\n"); - ul_tti_request = unqueue_matching(&nr_wait_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_harq_sfn_slot); - } - if (rach_ind && rach_ind->number_of_pdus > 0) { NR_UL_IND_t UL_INFO = { @@ -335,10 +263,6 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) { check_and_process_dci(NULL, NULL, ul_dci_request, NULL); } - if (ul_tti_request && ul_tti_request->n_pdus > 0) - { - check_and_process_dci(NULL, NULL, NULL, ul_tti_request); - } } static void check_nr_prach(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info, NR_PRACH_RESOURCES_t *prach_resources) diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 44ee05940f..0fed6b33d0 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -792,7 +792,7 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) uci_ind_pdu->harq->harq_list = CALLOC(uci_ind_pdu->harq->num_harq, sizeof(*uci_ind_pdu->harq->harq_list)); AssertFatal(uci_ind_pdu->harq->harq_list != NULL, "Memory not allocated for uci_ind_pdu->harq->harq_list in phy_nr_uci_indication."); for (int j = 0; j < uci_ind_pdu->harq->num_harq; j++) - uci_ind_pdu->harq->harq_list[j].harq_value = ind_pdu->harq->harq_list[j].harq_value; + uci_ind_pdu->harq->harq_list[j].harq_value = ind_pdu->harq->harq_list[j].harq_value; } break; } @@ -800,21 +800,26 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_2_3_4; nfapi_nr_uci_pucch_pdu_format_2_3_4_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_2_3_4; - - uci_ind_pdu->harq.harq_payload = CALLOC(1, sizeof(*uci_ind_pdu->harq.harq_payload)); - AssertFatal(uci_ind_pdu->harq.harq_payload != NULL, "Memory not allocated for uci_ind_pdu->harq.harq_payload in phy_nr_uci_indication."); - *uci_ind_pdu->harq.harq_payload = *ind_pdu->harq.harq_payload; - - - uci_ind_pdu->csi_part1.csi_part1_payload = CALLOC(1, sizeof(*uci_ind_pdu->csi_part1.csi_part1_payload)); - AssertFatal(uci_ind_pdu->csi_part1.csi_part1_payload != NULL, "Memory not allocated for uci_ind_pdu->csi_part1.csi_part1_payload in phy_nr_uci_indication."); - *uci_ind_pdu->csi_part1.csi_part1_payload = *ind_pdu->csi_part1.csi_part1_payload; - - - uci_ind_pdu->csi_part2.csi_part2_payload = CALLOC(1, sizeof(*uci_ind_pdu->csi_part2.csi_part2_payload)); - AssertFatal(uci_ind_pdu->csi_part2.csi_part2_payload != NULL, "Memory not allocated for uci_ind_pdu->csi_part2.csi_part2_payload in phy_nr_uci_indication."); - *uci_ind_pdu->csi_part2.csi_part2_payload = *ind_pdu->csi_part2.csi_part2_payload; - + if (ind_pdu->harq.harq_payload) { + uci_ind_pdu->harq.harq_payload = CALLOC(1, sizeof(*uci_ind_pdu->harq.harq_payload)); + AssertFatal(uci_ind_pdu->harq.harq_payload != NULL, "Memory not allocated for uci_ind_pdu->harq.harq_payload in phy_nr_uci_indication."); + *uci_ind_pdu->harq.harq_payload = *ind_pdu->harq.harq_payload; + } + if (ind_pdu->sr.sr_payload) { + uci_ind_pdu->sr.sr_payload = CALLOC(1, sizeof(*uci_ind_pdu->sr.sr_payload)); + AssertFatal(uci_ind_pdu->sr.sr_payload != NULL, "Memory not allocated for uci_ind_pdu->sr.sr_payload in phy_nr_uci_indication."); + *uci_ind_pdu->sr.sr_payload = *ind_pdu->sr.sr_payload; + } + if (ind_pdu->csi_part1.csi_part1_payload) { + uci_ind_pdu->csi_part1.csi_part1_payload = CALLOC(1, sizeof(*uci_ind_pdu->csi_part1.csi_part1_payload)); + AssertFatal(uci_ind_pdu->csi_part1.csi_part1_payload != NULL, "Memory not allocated for uci_ind_pdu->csi_part1.csi_part1_payload in phy_nr_uci_indication."); + *uci_ind_pdu->csi_part1.csi_part1_payload = *ind_pdu->csi_part1.csi_part1_payload; + } + if (ind_pdu->csi_part2.csi_part2_payload) { + uci_ind_pdu->csi_part2.csi_part2_payload = CALLOC(1, sizeof(*uci_ind_pdu->csi_part2.csi_part2_payload)); + AssertFatal(uci_ind_pdu->csi_part2.csi_part2_payload != NULL, "Memory not allocated for uci_ind_pdu->csi_part2.csi_part2_payload in phy_nr_uci_indication."); + *uci_ind_pdu->csi_part2.csi_part2_payload = *ind_pdu->csi_part2.csi_part2_payload; + } break; } } diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index adc6d6e384..d103200787 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -5906,9 +5906,25 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu return 1; } +static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value, + uint8_t **ppReadPackedMsg, + uint8_t *end, + nfapi_p7_codec_config_t *config) { -static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; + if (!pull8(ppReadPackedMsg, &value->pduBitmap, end)) + return 0; + if (!pull32(ppReadPackedMsg, &value->handle, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->rnti, end)) + return 0; + if (!pull8(ppReadPackedMsg, &value->pucch_format, end)) + return 0; + if (!pull8(ppReadPackedMsg, &value->ul_cqi, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->timing_advance, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->rssi, end)) + return 0; if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && pull32(ppReadPackedMsg, &value->handle, end) && @@ -5988,7 +6004,7 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, } case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4; - if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end)) + if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end, config)) return 0; break; } diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4fd337eb09..7798e789a3 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -36,6 +36,7 @@ #include "fapi_nr_ue_l1.h" #include "harq_nr.h" //#include "PHY/phy_vars_nr_ue.h" +#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" #include "PHY/defs_nr_UE.h" #include "PHY/impl_defs_nr.h" @@ -50,7 +51,7 @@ queue_t nr_crc_ind_queue; queue_t nr_uci_ind_queue; int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response) { - + NR_UE_MAC_INST_t *mac = get_mac_inst(0); if(scheduled_response != NULL) { if (scheduled_response->ul_config != NULL) @@ -92,10 +93,6 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi; - char buffer[1024]; - hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer)); - LOG_D(NR_MAC, "Hexdump of pdu %s before queuing rx_ind\n", - buffer); } crc_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION; @@ -147,6 +144,84 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response break; } + case FAPI_NR_UL_CONFIG_TYPE_PUCCH: + { + nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind)); + uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION; + uci_ind->sfn = scheduled_response->frame; + uci_ind->slot = scheduled_response->slot; + uci_ind->num_ucis = 1; + uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); + for (int j = 0; j < uci_ind->num_ucis; j++) + { + if (ul_config->ul_config_list[i].pucch_config_pdu.format_type == 2) + { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[j].pucch_pdu_format_2_3_4; + uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE; + uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_2_3_4_t); + memset(pdu_2_3_4, 0, sizeof(*pdu_2_3_4)); + pdu_2_3_4->handle = 0; + pdu_2_3_4->rnti = ul_config->ul_config_list[i].pucch_config_pdu.rnti; + pdu_2_3_4->pucch_format = ul_config->ul_config_list[i].pucch_config_pdu.format_type; + pdu_2_3_4->ul_cqi = 255; + pdu_2_3_4->timing_advance = 0; + pdu_2_3_4->rssi = 0; + // TODO: Eventually check 38.212:Sect.631 to know when to use csi_part2, for now only using csi_part1 + pdu_2_3_4->pduBitmap = 4; + pdu_2_3_4->csi_part1.csi_part1_bit_len = ul_config->ul_config_list[i].pucch_config_pdu.nr_of_symbols; + int csi_part1_byte_len = (int)((pdu_2_3_4->csi_part1.csi_part1_bit_len / 8) + 1); + AssertFatal(!pdu_2_3_4->csi_part1.csi_part1_payload, "pdu_2_3_4->csi_part1.csi_part1_payload != NULL\n"); + pdu_2_3_4->csi_part1.csi_part1_payload = CALLOC(csi_part1_byte_len, + sizeof(pdu_2_3_4->csi_part1.csi_part1_payload)); + for (int k = 0; k < csi_part1_byte_len; k++) + { + pdu_2_3_4->csi_part1.csi_part1_payload[k] = (ul_config->ul_config_list[i]. + pucch_config_pdu.payload >> (k * 8)) & 0xff; + } + pdu_2_3_4->csi_part1.csi_part1_crc = 0; + int sfn_slot = NFAPI_SFNSLOT2HEX(uci_ind->sfn, uci_ind->slot); + nfapi_nr_uci_indication_t *queued_uci_ind = unqueue_matching(&nr_uci_ind_queue, + MAX_QUEUE_SIZE, + sfn_slot_matcher, + &sfn_slot); + if (queued_uci_ind) + { + LOG_I(NR_MAC, "There was a matching UCI with sfn %d, slot %d in queue\n", + NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); + if (queued_uci_ind->uci_list[0].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) + pdu_2_3_4->pduBitmap = 6; // harq: pduBitmap >> 1, csi: pduBitmap >> 2 + free(queued_uci_ind); + break; + } + } + else + { + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; + uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE; + uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t); + memset(pdu_0_1, 0, sizeof(*pdu_0_1)); + pdu_0_1->handle = 0; + pdu_0_1->rnti = ul_config->ul_config_list[i].pucch_config_pdu.rnti; + pdu_0_1->pucch_format = 1; + pdu_0_1->ul_cqi = 255; + pdu_0_1->timing_advance = 0; + pdu_0_1->rssi = 0; + } + } + + LOG_I(NR_PHY, "In %s: Filled queue uci_ind_234 which was filled by ulconfig.\n" + "uci_num %d, SFN/SLOT: [%d, %d]\n", + __FUNCTION__, uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); + + if (!put_queue(&nr_uci_ind_queue, uci_ind)) + { + LOG_E(NR_MAC, "Put_queue failed for uci_ind\n"); + free(uci_ind->uci_list); + free(uci_ind); + } + break; + } + default: LOG_I(NR_MAC, "Unknown ul_config->pdu_type %d\n", pdu_type); break; @@ -173,7 +248,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind)); uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION; uci_ind->sfn = scheduled_response->frame; - uci_ind->slot = scheduled_response->slot; + uci_ind->slot = NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot); uci_ind->num_ucis = 1; uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); for (int j = 0; j < uci_ind->num_ucis; j++) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index ba3128923f..2b2181177d 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -272,6 +272,7 @@ typedef struct { bool expected_dci; bool index_has_dci[16]; int active_harq_sfn_slot; + int active_uci_sfn_slot; } nr_emulated_l1_t; typedef struct { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 22a13d223b..4bc074df56 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2183,6 +2183,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in fapi_nr_ul_config_pucch_pdu *pucch_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pucch_config_pdu; fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PUCCH); + mac->nr_ue_emul_l1.active_uci_sfn_slot = NFAPI_SFNSLOT2HEX(frameP, slotP); pthread_mutex_unlock(&ul_config->mutex_ul_config); nr_ue_configure_pucch(mac, @@ -2191,7 +2192,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in pucch, pucch_pdu, O_SR, O_ACK, O_CSI); - LOG_D(NR_MAC,"Configuring pucch, is_common = %d\n",pucch->is_common); + LOG_I(NR_MAC,"Configuring pucch, is_common = %d and format %d\n",pucch->is_common, pucch_pdu->format_type); nr_scheduled_response_t scheduled_response; fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index b98a9c8789..805c2dd2a8 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -217,6 +217,69 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) } } +bool sfn_slot_matcher(void *wanted, void *candidate) +{ + nfapi_p7_message_header_t *msg = candidate; + int sfn_sf = *(int*)wanted; + + switch (msg->message_id) + { + case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: + { + nfapi_nr_rach_indication_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: + { + nfapi_nr_rx_data_indication_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: + { + nfapi_nr_crc_indication_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: + { + nfapi_nr_uci_indication_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: + { + nfapi_nr_dl_tti_request_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: + { + nfapi_nr_tx_data_request_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST: + { + nfapi_nr_ul_dci_request_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; + } + + case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: + { + nfapi_nr_ul_tti_request_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->SFN && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->Slot; + } + + default: + LOG_E(NR_MAC, "sfn_slot_match bad ID: %d\n", msg->message_id); + + } + + return false; +} + static void fill_dl_info_with_pdcch(fapi_nr_dci_indication_t *dci, nfapi_nr_dl_dci_pdu_t *rx_dci, int idx) { int num_bytes = (rx_dci->PayloadSizeBits + 7) / 8; @@ -460,6 +523,38 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi dl_info->rx_ind->number_pdus = pdu_idx; } +static void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind) +{ + for (int k = 0; k < uci_ind->num_ucis; k++) + { + if (uci_ind->uci_list[k].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) + { + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1; + free(pdu_0_1->sr); + pdu_0_1->sr = NULL; + if (pdu_0_1->harq) + { + free(pdu_0_1->harq->harq_list); + pdu_0_1->harq->harq_list = NULL; + } + free(pdu_0_1->harq); + pdu_0_1->harq = NULL; + } + if (uci_ind->uci_list[k].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) + { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[k].pucch_pdu_format_2_3_4; + free(pdu_2_3_4->sr.sr_payload); + pdu_2_3_4->sr.sr_payload = NULL; + free(pdu_2_3_4->harq.harq_payload); + pdu_2_3_4->harq.harq_payload = NULL; + } + } + free(uci_ind->uci_list); + uci_ind->uci_list = NULL; + free(uci_ind); + uci_ind = NULL; +} + static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_ul_dci_request_t *ul_dci_req) { NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); @@ -503,31 +598,28 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n dl_info->slot = ul_dci_req->Slot; } -static nfapi_nr_uci_indication_t *multiplex_uci_ind(NR_UE_MAC_INST_t *mac, int num_active_harqs) +static nfapi_nr_uci_indication_t *multiplex_uci_ind(NR_UE_MAC_INST_t *mac, int sfn_slot) { - AssertFatal(num_active_harqs >= 0, "Invalid value for num_active_harqs %d\n", num_active_harqs); - if (num_active_harqs == 0) - { - return NULL; - } - if (num_active_harqs != nr_uci_ind_queue.num_items) - { - LOG_I(NR_MAC, "The number of active harqs %d doesn't match the number of UCIs in the queue %lu\n", - num_active_harqs, nr_uci_ind_queue.num_items); - return NULL; - } + int num_0_1 = 0; + int num_2_3_4 = 0; + int num_items_in_queue = nr_uci_ind_queue.num_items; nfapi_nr_uci_indication_t *uci_ind = MALLOC(sizeof(*uci_ind)); uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION; - uci_ind->sfn = NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot); - uci_ind->slot = NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot); - uci_ind->num_ucis = num_active_harqs; - uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); - for (int i = 0; i < num_active_harqs; i++) + uci_ind->num_ucis = 0; + uci_ind->uci_list = CALLOC(num_items_in_queue, sizeof(*uci_ind->uci_list)); + for (int i = 0; i < num_items_in_queue; i++) { - nfapi_nr_uci_indication_t *queued_uci_ind = get_queue(&nr_uci_ind_queue); - AssertFatal(queued_uci_ind, "There was not a UCI in the queue!\n"); - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[i].pucch_pdu_format_0_1; + nfapi_nr_uci_indication_t *queued_uci_ind = unqueue_matching(&nr_uci_ind_queue, + MAX_QUEUE_SIZE, + sfn_slot_matcher, + &sfn_slot); + if (!queued_uci_ind) + { + LOG_I(NR_MAC, "There was not a matching UCI with sfn %d, slot %d in queue\n", + NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); + break; + } /* In openair1/SCHED_NR_UE/fapi_nr_ue_l1.c nr_ue_schedule_response_stub(), the number of UCIs is hard coded to 1. This is why we always use index 0 of the @@ -536,19 +628,51 @@ static nfapi_nr_uci_indication_t *multiplex_uci_ind(NR_UE_MAC_INST_t *mac, int n queued_uci_ind->num_ucis); uci_ind->uci_list[i].pdu_type = queued_uci_ind->uci_list[0].pdu_type; uci_ind->uci_list[i].pdu_size = queued_uci_ind->uci_list[0].pdu_size; + if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) + { + num_0_1++; + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[i].pucch_pdu_format_0_1; + nfapi_nr_uci_pucch_pdu_format_0_1_t *queued_pdu_0_1 = &queued_uci_ind->uci_list[0].pucch_pdu_format_0_1; + pdu_0_1->handle = queued_pdu_0_1->handle; + pdu_0_1->rnti = queued_pdu_0_1->rnti; + pdu_0_1->pucch_format = queued_pdu_0_1->pucch_format; + pdu_0_1->ul_cqi = queued_pdu_0_1->ul_cqi; + pdu_0_1->timing_advance = queued_pdu_0_1->timing_advance; + pdu_0_1->rssi = queued_pdu_0_1->rssi; + } + if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) + { + num_2_3_4++; + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[i].pucch_pdu_format_2_3_4; + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *queued_pdu_2_3_4 = &queued_uci_ind->uci_list[0].pucch_pdu_format_2_3_4; + pdu_2_3_4->handle = queued_pdu_2_3_4->handle; + pdu_2_3_4->rnti = queued_pdu_2_3_4->rnti; + pdu_2_3_4->pucch_format = queued_pdu_2_3_4->pucch_format; + pdu_2_3_4->ul_cqi = queued_pdu_2_3_4->ul_cqi; + pdu_2_3_4->timing_advance = queued_pdu_2_3_4->timing_advance; + pdu_2_3_4->rssi = queued_pdu_2_3_4->rssi; + pdu_2_3_4->pduBitmap = queued_pdu_2_3_4->pduBitmap; + pdu_2_3_4->csi_part1.csi_part1_bit_len = queued_pdu_2_3_4->csi_part1.csi_part1_bit_len; + AssertFatal(!pdu_2_3_4->csi_part1.csi_part1_payload, "pdu_2_3_4->csi_part1.csi_part1_payload != NULL\n"); + pdu_2_3_4->csi_part1.csi_part1_payload = CALLOC((int)((pdu_2_3_4->csi_part1.csi_part1_bit_len / 8) + 1), + sizeof(pdu_2_3_4->csi_part1.csi_part1_payload)); + memcpy(pdu_2_3_4->csi_part1.csi_part1_payload, queued_pdu_2_3_4->csi_part1.csi_part1_payload, + sizeof(*queued_pdu_2_3_4->csi_part1.csi_part1_payload)); + } + uci_ind->num_ucis = num_2_3_4 + num_0_1; - nfapi_nr_uci_pucch_pdu_format_0_1_t *queued_pdu_0_1 = &queued_uci_ind->uci_list[0].pucch_pdu_format_0_1; - pdu_0_1->handle = queued_pdu_0_1->handle; - pdu_0_1->rnti = queued_pdu_0_1->rnti; - pdu_0_1->pucch_format = queued_pdu_0_1->pucch_format; - pdu_0_1->ul_cqi = queued_pdu_0_1->ul_cqi; - pdu_0_1->timing_advance = queued_pdu_0_1->timing_advance; - pdu_0_1->rssi = queued_pdu_0_1->rssi; free(queued_uci_ind->uci_list); queued_uci_ind->uci_list = NULL; free(queued_uci_ind); queued_uci_ind = NULL; } + + if (num_2_3_4 > 0 && num_0_1 > 0) + { + LOG_E(NR_MAC, "We have a harq ACK/NACK while CSI reporting as seprate UCIs but we shouldn't. " + "We multiplex before queueing the UCI!!!\n"); + abort(); + } return uci_ind; } @@ -556,6 +680,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n { NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); int num_pdus = ul_tti_req->n_pdus; + int sfn_slot = NFAPI_SFNSLOT2HEX(ul_tti_req->SFN, ul_tti_req->Slot); AssertFatal(num_pdus >= 0, "Invalid ul_tti_request number of PDUS\n"); AssertFatal(num_pdus <= sizeof(ul_tti_req->pdus_list) / sizeof(ul_tti_req->pdus_list[0]), "Too many pdus %d in ul_tti_req\n", num_pdus); @@ -570,38 +695,67 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n { AssertFatal(nr_uci_ind_queue.num_items >= 0, "Invalid num_items in UCI_ind queue %lu\n", nr_uci_ind_queue.num_items); - int num_active_harqs = pdu_list->pucch_pdu.bit_len_harq; - LOG_I(NR_MAC, "The number of active harqs %d from ul_tti_req\n", num_active_harqs); - nfapi_nr_uci_indication_t *uci_ind = multiplex_uci_ind(mac, num_active_harqs); + + nfapi_nr_uci_indication_t *uci_ind = multiplex_uci_ind(mac, sfn_slot); if (uci_ind && uci_ind->num_ucis > 0) { - LOG_D(NR_MAC, "This is the SFN/SF [%d, %d] and RNTI %x of the UCI ind. ul_tti_req.pdu[%d]->rnti = %x \n", - uci_ind->sfn, uci_ind->slot, uci_ind->uci_list[0].pucch_pdu_format_0_1.rnti, i, ul_tti_req->pdus_list[i].pucch_pdu.rnti); uci_ind->sfn = ul_tti_req->SFN; uci_ind->slot = ul_tti_req->Slot; + LOG_D(NR_MAC, "This is the SFN/SF [%d, %d] and RNTI %x of the UCI ind. ul_tti_req.pdu[%d]->rnti = %x \n", + uci_ind->sfn, uci_ind->slot, uci_ind->uci_list[0].pucch_pdu_format_0_1.rnti, i, ul_tti_req->pdus_list[i].pucch_pdu.rnti); for (int j = 0; j < uci_ind->num_ucis; j++) { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; - if (pdu_list->pucch_pdu.sr_flag) + if (uci_ind->uci_list[j].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) { - LOG_D(NR_MAC, "We have the SR flag in pdu i %d\n", i); - pdu_0_1->pduBitmap = 1; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR - pdu_0_1->sr = CALLOC(1, sizeof(*pdu_0_1->sr)); - pdu_0_1->sr->sr_confidence_level = 0; - pdu_0_1->sr->sr_indication = 1; - } - if (pdu_list->pucch_pdu.bit_len_harq > 0) - { - LOG_D(NR_MAC, "We have the Harq len bits %d\n", pdu_list->pucch_pdu.bit_len_harq); - pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR - pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); - pdu_0_1->harq->num_harq = 1; - pdu_0_1->harq->harq_confidence_level = 0; - pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); - for (int k = 0; k < pdu_0_1->harq->num_harq; k++) + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; + if (pdu_list->pucch_pdu.sr_flag) { - pdu_0_1->harq->harq_list[k].harq_value = 0; + pdu_0_1->pduBitmap = 1; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR + pdu_0_1->sr = CALLOC(1, sizeof(*pdu_0_1->sr)); + pdu_0_1->sr->sr_confidence_level = 0; + pdu_0_1->sr->sr_indication = 1; + } + if (pdu_list->pucch_pdu.bit_len_harq > 0) + { + pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR + pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); + pdu_0_1->harq->num_harq = 1; + pdu_0_1->harq->harq_confidence_level = 0; + pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); + for (int k = 0; k < pdu_0_1->harq->num_harq; k++) + { + pdu_0_1->harq->harq_list[k].harq_value = 0; + } + } + } + if (uci_ind->uci_list[j].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) + { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[j].pucch_pdu_format_2_3_4; + if (pdu_list->pucch_pdu.sr_flag) + { + pdu_2_3_4->pduBitmap = 5; + pdu_2_3_4->sr.sr_bit_len = 0; + AssertFatal(!pdu_2_3_4->sr.sr_payload, "pdu_2_3_4->sr.sr_payload != NULL\n"); + pdu_2_3_4->sr.sr_payload = CALLOC((int)((pdu_2_3_4->sr.sr_bit_len / 8) + 1), + sizeof(*pdu_2_3_4->sr.sr_payload)); + } + if (pdu_list->pucch_pdu.bit_len_harq > 0) + { + if (pdu_list->pucch_pdu.sr_flag) + { + pdu_2_3_4->pduBitmap = 7; + } + pdu_2_3_4->harq.harq_bit_len = pdu_list->pucch_pdu.bit_len_harq; + LOG_D(NR_MAC, "This is bit_len_harq %d and pdu_2_3_4->pduBitmap %d\n", + pdu_list->pucch_pdu.bit_len_harq, pdu_2_3_4->pduBitmap); + pdu_2_3_4->harq.harq_crc = 0; + AssertFatal(!pdu_2_3_4->harq.harq_payload, "pdu_2_3_4->harq.harq_payload != NULL\n"); + pdu_2_3_4->harq.harq_payload = CALLOC((int)((pdu_2_3_4->harq.harq_bit_len / 8) + 1), + sizeof(*pdu_2_3_4->harq.harq_payload)); + /* TODO: Later, when abstracting, we can set particular bits in the + payload to 0 to indicate a NACK. For now, we memset all bits to 1. */ + memset(pdu_2_3_4->harq.harq_payload, 0xff, sizeof(*pdu_2_3_4->harq.harq_payload)); } } } @@ -612,27 +766,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n }; send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); sent_uci = true; - - for (int k = 0; k < uci_ind->num_ucis; k++) - { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1; - if (pdu_list->pucch_pdu.sr_flag) - { - free(pdu_0_1->sr); - pdu_0_1->sr = NULL; - } - if (pdu_list->pucch_pdu.bit_len_harq > 1) - { - free(pdu_0_1->harq->harq_list); - pdu_0_1->harq->harq_list = NULL; - free(pdu_0_1->harq); - pdu_0_1->harq = NULL; - } - } - free(uci_ind->uci_list); - uci_ind->uci_list = NULL; - free(uci_ind); - uci_ind = NULL; + free_uci_inds(uci_ind); } } } @@ -890,28 +1024,9 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d.\n", ul_tti_request->SFN, ul_tti_request->Slot); - if (nr_uci_ind_queue.num_items > 0) //TODO: In the future UL_TTIs can be for ULSCH and SRS. + if (ul_tti_request && ul_tti_request->n_pdus > 0) { - LOG_D(NR_MAC, "We added UL_TTI_REQ to queue for sfn slot %d %d\n", - ul_tti_request->SFN, ul_tti_request->Slot); - if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) - { - LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); - free(ul_tti_request); - ul_tti_request = NULL; - } - } - /* TODO: This indicates that dl_tti_req was late or never arrived. If there are - not any prepared uci indications, the NRUE likely never had time to - populate the message is the dl_tti_req came in late and we received a - ul_tti_req immediately after the dl_tti_request. This is an attempt to - mitigate proxy timing issues. */ - else if (nr_uci_ind_queue.num_items == 0) - { - LOG_D(NR_MAC, "We added UL_TTI_REQ to queue for sfn slot %d %d\n", - ul_tti_request->SFN, ul_tti_request->Slot); - nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_wait_ul_tti_req_queue, ul_tti_request); - free(evicted_ul_tti_req); + check_and_process_dci(NULL, NULL, NULL, ul_tti_request); } break; } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 2a8a514769..039b919b12 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -240,6 +240,8 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, nfapi_nr_ul_dci_request_t *ul_dci_request, nfapi_nr_ul_tti_request_t *ul_tti_request); +bool sfn_slot_matcher(void *wanted, void *candidate); + /**\brief done free of memory allocation by module_id and release to pointer pool. \param module_id module id*/ int nr_ue_if_module_kill(uint32_t module_id); From 8c2a067a2268d2b96f7761effb1d4c199904025a Mon Sep 17 00:00:00 2001 From: Melissa Date: Fri, 21 Jan 2022 23:44:28 +0000 Subject: [PATCH 404/883] Merge branch 'episys/david/checking_downlink_siso_model' into 'episys/master-nsa' Downlink SISO modeling See merge request aburger/openairinterface5g!104 --- executables/nr-ue.c | 47 +- executables/nr-uesoftmodem.c | 68 ++- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 157 +++++-- .../AWGN/AWGN_results/mcs0_awgn_5G.csv | 62 +++ .../AWGN/AWGN_results/mcs10_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs11_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs12_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs13_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs14_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs15_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs16_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs17_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs18_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs19_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs1_awgn_5G.csv | 27 ++ .../AWGN/AWGN_results/mcs20_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs21_awgn_5G.csv | 72 +++ .../AWGN/AWGN_results/mcs22_awgn_5G.csv | 52 +++ .../AWGN/AWGN_results/mcs23_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs24_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs25_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs26_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs27_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs28_awgn_5G.csv | 92 ++++ .../AWGN/AWGN_results/mcs2_awgn_5G.csv | 62 +++ .../AWGN/AWGN_results/mcs3_awgn_5G.csv | 62 +++ .../AWGN/AWGN_results/mcs4_awgn_5G.csv | 62 +++ .../AWGN/AWGN_results/mcs5_awgn_5G.csv | 62 +++ .../AWGN/AWGN_results/mcs6_awgn_5G.csv | 62 +++ .../AWGN/AWGN_results/mcs7_awgn_5G.csv | 62 +++ .../AWGN/AWGN_results/mcs8_awgn_5G.csv | 62 +++ .../AWGN/AWGN_results/mcs9_awgn_5G.csv | 64 +++ openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 4 + openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 5 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 434 ++++++++++++++---- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 26 ++ openair2/RRC/NR_UE/rrc_UE.c | 1 - openair2/RRC/NR_UE/rrc_proto.h | 1 - 39 files changed, 2697 insertions(+), 163 deletions(-) create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs0_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs10_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs11_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs12_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs13_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs14_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs15_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs16_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs17_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs18_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs19_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs1_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs20_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs21_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs22_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs23_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs24_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs25_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs26_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs27_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs28_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs2_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs3_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs4_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs5_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs6_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs7_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs8_awgn_5G.csv create mode 100644 openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs9_awgn_5G.csv diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2cbeaf502c..86dc32674b 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -197,10 +197,34 @@ static void L1_nsa_prach_procedures(frame_t frame, int slot, fapi_nr_ul_config_p static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) { nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue); nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); + LOG_D(NR_MAC, "Try to get a ul_tti_req for HARQ sfn/slot %d %d from queue with %lu items\n", + NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot), + NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot), nr_ul_tti_req_queue.num_items); + nfapi_nr_ul_tti_request_t *ul_tti_request_harq = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_harq_sfn_slot); + if (ul_tti_request_harq && ul_tti_request_harq->n_pdus > 0) + { + check_and_process_dci(NULL, NULL, NULL, ul_tti_request_harq); + } + + LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CSI active SFN %d/SLOT %d from queue with %lu items\n", + NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_uci_sfn_slot), + NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_uci_sfn_slot), nr_ul_tti_req_queue.num_items); + nfapi_nr_ul_tti_request_t *ul_tti_request_uci = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_uci_sfn_slot); + if (ul_tti_request_uci && ul_tti_request_uci->n_pdus > 0) + { + check_and_process_dci(NULL, NULL, NULL, ul_tti_request_uci); + } + + LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CRC active SFN %d/SLOT %d from queue with %lu items\n", + NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot), + NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot), nr_ul_tti_req_queue.num_items); + nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot); + if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0) + { + check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc); + } if (rach_ind && rach_ind->number_of_pdus > 0) { @@ -216,24 +240,6 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) free(rach_ind); nr_Msg1_transmitted(0, 0, NFAPI_SFNSLOT2SFN(sfn_slot), 0); } - if (crc_ind && crc_ind->number_crcs > 0) - { - NR_UL_IND_t UL_INFO = { - .crc_ind = *crc_ind, - }; - send_nsa_standalone_msg(&UL_INFO, crc_ind->header.message_id); - free(crc_ind->crc_list); - free(crc_ind); - } - if (rx_ind && rx_ind->number_of_pdus > 0) - { - NR_UL_IND_t UL_INFO = { - .rx_ind = *rx_ind, - }; - send_nsa_standalone_msg(&UL_INFO, rx_ind->header.message_id); - free(rx_ind->pdu_list); - free(rx_ind); - } if (dl_tti_request) { int dl_tti_sfn_slot = NFAPI_SFNSLOT2HEX(dl_tti_request->SFN, dl_tti_request->Slot); @@ -313,7 +319,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) reset_queue(&nr_tx_req_queue); reset_queue(&nr_ul_dci_req_queue); reset_queue(&nr_ul_tti_req_queue); - reset_queue(&nr_wait_ul_tti_req_queue); NR_PRACH_RESOURCES_t prach_resources; memset(&prach_resources, 0, sizeof(prach_resources)); diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index ddbbbdf52c..8fec3b3ad1 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -50,6 +50,7 @@ #include "LAYER2/MAC/mac_vars.h" #include "RRC/LTE/rrc_vars.h" #include "PHY_INTERFACE/phy_interface_vars.h" +#include "NR_IF_Module.h" #include "openair1/SIMULATION/TOOLS/sim.h" #ifdef SMBV @@ -155,8 +156,11 @@ uint32_t N_RB_DL = 106; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution */ -uint8_t abstraction_flag=0; +uint8_t abstraction_flag = 0; +nr_bler_struct nr_bler_data[NUM_MCS]; + +static void init_bler_table(void); /*---------------------BMC: timespec helpers -----------------------------*/ @@ -251,7 +255,6 @@ void init_tpools(uint8_t nun_dlsch_threads) { free(params); init_dlsch_tpool( nun_dlsch_threads); } - static void get_options(void) { nrUE_params.ofdm_offset_divisor = 8; @@ -466,6 +469,7 @@ int main( int argc, char **argv ) { PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE *)*MAX_NUM_CCs); if (get_softmodem_params()->emulate_l1) { RCconfig_nr_ue_L1(); + init_bler_table(); } if (get_softmodem_params()->do_ra) @@ -546,3 +550,63 @@ int main( int argc, char **argv ) { return 0; } + +// Read in each MCS file and build BLER-SINR-TB table +static void init_bler_table(void) +{ + const char *openair_dir = getenv("OPENAIR_DIR"); + if (!openair_dir) + { + LOG_E(MAC, "No $OPENAIR_DIR\n"); + abort(); + } + + for (unsigned int i = 0; i < NUM_MCS; i++) + { + char fName[1024]; + snprintf(fName, sizeof(fName), "%s/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs%d_awgn_5G.csv", openair_dir, i); + FILE *pFile = fopen(fName, "r"); + if (!pFile) + { + LOG_E(MAC, "Bler File ERROR! - fopen(), file: %s\n", fName); + abort(); + } + size_t bufSize = 1024; + char * line = NULL; + char * token; + char * temp = NULL; + int nlines = 0; + while (getline(&line, &bufSize, pFile) > 0) + { + if (!strncmp(line, "SNR", 3)) + { + continue; + } + + if (nlines > NUM_SINR) + { + LOG_E(MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName); + abort(); + } + + token = strtok_r(line, ";", &temp); + int ncols = 0; + while (token != NULL) + { + if (ncols > NUM_BLER_COL) + { + LOG_E(MAC, "BLER FILE ERROR - num of cols greater than expected\n"); + abort(); + } + + nr_bler_data[i].bler_table[nlines][ncols] = strtof(token, NULL); + ncols++; + + token = strtok_r(NULL, ";", &temp); + } + nlines++; + } + nr_bler_data[i].length = nlines; + fclose(pFile); + } +} diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 7798e789a3..799b759292 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -37,7 +37,6 @@ #include "harq_nr.h" //#include "PHY/phy_vars_nr_ue.h" #include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" - #include "PHY/defs_nr_UE.h" #include "PHY/impl_defs_nr.h" #include "utils.h" @@ -50,6 +49,30 @@ queue_t nr_rx_ind_queue; queue_t nr_crc_ind_queue; queue_t nr_uci_ind_queue; +static void fill_uci_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4, + fapi_nr_ul_config_pucch_pdu *pucch_pdu) +{ + memset(pdu_2_3_4, 0, sizeof(*pdu_2_3_4)); + pdu_2_3_4->handle = 0; + pdu_2_3_4->rnti = pucch_pdu->rnti; + pdu_2_3_4->pucch_format = 2; + pdu_2_3_4->ul_cqi = 255; + pdu_2_3_4->timing_advance = 0; + pdu_2_3_4->rssi = 0; + // TODO: Eventually check 38.212:Sect.631 to know when to use csi_part2, for now only using csi_part1 + pdu_2_3_4->pduBitmap = 4; + pdu_2_3_4->csi_part1.csi_part1_bit_len = pucch_pdu->nr_of_symbols; + int csi_part1_byte_len = (int)((pdu_2_3_4->csi_part1.csi_part1_bit_len / 8) + 1); + AssertFatal(!pdu_2_3_4->csi_part1.csi_part1_payload, "pdu_2_3_4->csi_part1.csi_part1_payload != NULL\n"); + pdu_2_3_4->csi_part1.csi_part1_payload = CALLOC(csi_part1_byte_len, + sizeof(pdu_2_3_4->csi_part1.csi_part1_payload)); + for (int k = 0; k < csi_part1_byte_len; k++) + { + pdu_2_3_4->csi_part1.csi_part1_payload[k] = (pucch_pdu->payload >> (k * 8)) & 0xff; + } + pdu_2_3_4->csi_part1.csi_part1_crc = 0; +} + int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response) { NR_UE_MAC_INST_t *mac = get_mac_inst(0); if(scheduled_response != NULL) @@ -61,7 +84,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response "Too many ul_config pdus %d", ul_config->number_pdus); for (int i = 0; i < ul_config->number_pdus; ++i) { - LOG_I(PHY, "In %s: processing type %d PDU of %d total UL PDUs (ul_config %p) \n", + LOG_I(NR_PHY, "In %s: processing type %d PDU of %d total UL PDUs (ul_config %p) \n", __FUNCTION__, ul_config->ul_config_list[i].pdu_type, ul_config->number_pdus, ul_config); uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type; @@ -99,6 +122,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind->number_crcs = scheduled_response->ul_config->number_pdus; crc_ind->sfn = scheduled_response->ul_config->sfn; crc_ind->slot = scheduled_response->ul_config->slot; + mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot = NFAPI_SFNSLOT2HEX(crc_ind->sfn, crc_ind->slot); crc_ind->crc_list = CALLOC(crc_ind->number_crcs, sizeof(*crc_ind->crc_list)); for (int j = 0; j < crc_ind->number_crcs; j++) { @@ -112,6 +136,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind->crc_list[j].tb_crc_status = 0; crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; crc_ind->crc_list[j].ul_cqi = 255; + LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d] with mcs_index in ul_cqi -> %d\n", + scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot,pusch_config_pdu->mcs_index); } if (!put_queue(&nr_rx_ind_queue, rx_ind)) @@ -154,45 +180,13 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); for (int j = 0; j < uci_ind->num_ucis; j++) { - if (ul_config->ul_config_list[i].pucch_config_pdu.format_type == 2) + LOG_I(NR_MAC, "ul_config->ul_config_list[%d].pucch_config_pdu.n_bit = %d", i, ul_config->ul_config_list[i].pucch_config_pdu.n_bit); + if (ul_config->ul_config_list[i].pucch_config_pdu.n_bit > 3 && mac->nr_ue_emul_l1.num_csi_reports > 0) { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[j].pucch_pdu_format_2_3_4; uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE; uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_2_3_4_t); - memset(pdu_2_3_4, 0, sizeof(*pdu_2_3_4)); - pdu_2_3_4->handle = 0; - pdu_2_3_4->rnti = ul_config->ul_config_list[i].pucch_config_pdu.rnti; - pdu_2_3_4->pucch_format = ul_config->ul_config_list[i].pucch_config_pdu.format_type; - pdu_2_3_4->ul_cqi = 255; - pdu_2_3_4->timing_advance = 0; - pdu_2_3_4->rssi = 0; - // TODO: Eventually check 38.212:Sect.631 to know when to use csi_part2, for now only using csi_part1 - pdu_2_3_4->pduBitmap = 4; - pdu_2_3_4->csi_part1.csi_part1_bit_len = ul_config->ul_config_list[i].pucch_config_pdu.nr_of_symbols; - int csi_part1_byte_len = (int)((pdu_2_3_4->csi_part1.csi_part1_bit_len / 8) + 1); - AssertFatal(!pdu_2_3_4->csi_part1.csi_part1_payload, "pdu_2_3_4->csi_part1.csi_part1_payload != NULL\n"); - pdu_2_3_4->csi_part1.csi_part1_payload = CALLOC(csi_part1_byte_len, - sizeof(pdu_2_3_4->csi_part1.csi_part1_payload)); - for (int k = 0; k < csi_part1_byte_len; k++) - { - pdu_2_3_4->csi_part1.csi_part1_payload[k] = (ul_config->ul_config_list[i]. - pucch_config_pdu.payload >> (k * 8)) & 0xff; - } - pdu_2_3_4->csi_part1.csi_part1_crc = 0; - int sfn_slot = NFAPI_SFNSLOT2HEX(uci_ind->sfn, uci_ind->slot); - nfapi_nr_uci_indication_t *queued_uci_ind = unqueue_matching(&nr_uci_ind_queue, - MAX_QUEUE_SIZE, - sfn_slot_matcher, - &sfn_slot); - if (queued_uci_ind) - { - LOG_I(NR_MAC, "There was a matching UCI with sfn %d, slot %d in queue\n", - NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); - if (queued_uci_ind->uci_list[0].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) - pdu_2_3_4->pduBitmap = 6; // harq: pduBitmap >> 1, csi: pduBitmap >> 2 - free(queued_uci_ind); - break; - } + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[j].pucch_pdu_format_2_3_4; + fill_uci_2_3_4(pdu_2_3_4, &ul_config->ul_config_list[i].pucch_config_pdu); } else { @@ -206,12 +200,58 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response pdu_0_1->ul_cqi = 255; pdu_0_1->timing_advance = 0; pdu_0_1->rssi = 0; + + if (mac->nr_ue_emul_l1.num_harqs > 0) { + pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR + pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); + pdu_0_1->harq->num_harq = 1; + pdu_0_1->harq->harq_confidence_level = 0; + int harq_pid = -1; + for (int k = 0; k < 16; k++) + { + LOG_D(NR_MAC, "dl_frame = %d sl_slot = %d feedback_to_ul = %d active_harq_sfn_slot = %d.%d\n", + mac->dl_harq_info[k].dl_frame, + mac->dl_harq_info[k].dl_slot, + mac->dl_harq_info[k].feedback_to_ul, + NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot), + NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot)); + int sfn_slot = NFAPI_SFNSLOT2HEX(mac->dl_harq_info[k].dl_frame, + (mac->dl_harq_info[k].dl_slot + + mac->dl_harq_info[k].feedback_to_ul)); + if (!mac->dl_harq_info[k].active && + (sfn_slot == mac->nr_ue_emul_l1.active_harq_sfn_slot || + sfn_slot == mac->nr_ue_emul_l1.active_uci_sfn_slot)) + { + harq_pid = k; + LOG_D(NR_MAC, "Setting harq_pid = %d\n", k); + } + } + pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); + for (int k = 0; k < pdu_0_1->harq->num_harq; k++) + { + AssertFatal(harq_pid != -1, "No active harq_pid, sfn_slot = %u.%u", uci_ind->sfn, uci_ind->slot); + pdu_0_1->harq->harq_list[k].harq_value = !mac->dl_harq_info[harq_pid].ack; + } + } + } + int sfn_slot = NFAPI_SFNSLOT2HEX(uci_ind->sfn, uci_ind->slot); + nfapi_nr_uci_indication_t *queued_uci_ind = unqueue_matching(&nr_uci_ind_queue, + MAX_QUEUE_SIZE, + sfn_slot_matcher, + &sfn_slot); + if (queued_uci_ind) + { + LOG_I(NR_MAC, "There was a matching UCI with sfn %d, slot %d in queue\n", + NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); + free(queued_uci_ind); + break; } } - LOG_I(NR_PHY, "In %s: Filled queue uci_ind_234 which was filled by ulconfig.\n" + LOG_I(NR_PHY, "In %s: Filled queue uci_ind_%d which was filled by ulconfig.\n" "uci_num %d, SFN/SLOT: [%d, %d]\n", - __FUNCTION__, uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); + __FUNCTION__, uci_ind->uci_list[0].pdu_type, + uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); if (!put_queue(&nr_uci_ind_queue, uci_ind)) { @@ -248,7 +288,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind)); uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION; uci_ind->sfn = scheduled_response->frame; - uci_ind->slot = NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot); + uci_ind->slot = scheduled_response->slot; uci_ind->num_ucis = 1; uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); for (int j = 0; j < uci_ind->num_ucis; j++) @@ -263,6 +303,41 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response pdu_0_1->ul_cqi = 255; pdu_0_1->timing_advance = 0; pdu_0_1->rssi = 0; + pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR + pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); + pdu_0_1->harq->num_harq = 1; + pdu_0_1->harq->harq_confidence_level = 0; + int harq_pid = -1; + for (int k = 0; k < 16; k++) + { + LOG_D(NR_MAC, "dl_frame = %d dl_slot = %d feedback_to_ul = %d active = %d k = %d " + "active_harq_sfn_slot = %d.%d " + "active_uci_sfn_slot = %d.%d\n", + mac->dl_harq_info[k].dl_frame, + mac->dl_harq_info[k].dl_slot, + mac->dl_harq_info[k].feedback_to_ul, + mac->dl_harq_info[k].active, + k, + NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot), + NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot), + NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_uci_sfn_slot), + NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_uci_sfn_slot)); + int sfn_slot = NFAPI_SFNSLOT2HEX(mac->dl_harq_info[k].dl_frame, + (mac->dl_harq_info[k].dl_slot + + mac->dl_harq_info[k].feedback_to_ul)); + if (mac->dl_harq_info[k].active && + sfn_slot == mac->nr_ue_emul_l1.active_harq_sfn_slot) + { + harq_pid = k; + LOG_D(NR_MAC, "Setting harq_pid = %d\n", k); + } + } + pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); + for (int k = 0; k < pdu_0_1->harq->num_harq; k++) + { + AssertFatal(harq_pid != -1, "No active harq_pid, sfn_slot = %u.%u", uci_ind->sfn, uci_ind->slot); + pdu_0_1->harq->harq_list[k].harq_value = !mac->dl_harq_info[harq_pid].ack; + } } LOG_I(NR_PHY, "In %s: Filled queue uci_ind which was filled by dlconfig.\n" diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs0_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs0_awgn_5G.csv new file mode 100644 index 0000000000..ac9dd0b8ae --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs0_awgn_5G.csv @@ -0,0 +1,62 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.9;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.8;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.7;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.6;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.5;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.1;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.9;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.8;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.7;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.6;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.5;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.1;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-1.9;0;1864;0.2344;1499;1500;0;0;0;0;0;0;0 +-1.8;0;1864;0.2344;1499;1500;0;0;0;0;0;0;0 +-1.7;0;1864;0.2344;1498;1500;0;0;0;0;0;0;0 +-1.6;0;1864;0.2344;1498;1500;0;0;0;0;0;0;0 +-1.5;0;1864;0.2344;1497;1500;0;0;0;0;0;0;0 +-1.4;0;1864;0.2344;1445;1500;0;0;0;0;0;0;0 +-1.3;0;1864;0.2344;1394;1500;0;0;0;0;0;0;0 +-1.2;0;1864;0.2344;1346;1500;0;0;0;0;0;0;0 +-1.1;0;1864;0.2344;1299;1500;0;0;0;0;0;0;0 +-1;0;1864;0.2344;1253;1500;0;0;0;0;0;0;0 +-0.9;0;1864;0.2344;980;1500;0;0;0;0;0;0;0 +-0.8;0;1864;0.2344;767;1500;0;0;0;0;0;0;0 +-0.7;0;1864;0.2344;600;1500;0;0;0;0;0;0;0 +-0.6;0;1864;0.2344;469;1500;0;0;0;0;0;0;0 +-0.5;0;1864;0.2344;367;1500;0;0;0;0;0;0;0 +-0.4;0;1864;0.2344;215;1500;0;0;0;0;0;0;0 +-0.3;0;1864;0.2344;126;1500;0;0;0;0;0;0;0 +-0.2;0;1864;0.2344;74;1500;0;0;0;0;0;0;0 +-0.1;0;1864;0.2344;43;1500;0;0;0;0;0;0;0 +0;0;1864;0.2344;26;1500;0;0;0;0;0;0;0 +0.1;0;1864;0.2344;12;1500;0;0;0;0;0;0;0 +0.2;0;1864;0.2344;5;1500;0;0;0;0;0;0;0 +0.3;0;1864;0.2344;2;1500;0;0;0;0;0;0;0 +0.4;0;1864;0.2344;1;1500;0;0;0;0;0;0;0 +0.5;0;1864;0.2344;1;1500;0;0;0;0;0;0;0 +0.6;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +0.7;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +0.8;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +0.9;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.1;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.2;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.3;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.4;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.5;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.6;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.7;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.8;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.9;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +2;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs10_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs10_awgn_5G.csv new file mode 100644 index 0000000000..65de0084ce --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs10_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.1;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.2;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.6;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.7;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.8;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.9;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.1;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.2;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.6;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.7;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.8;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.9;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +5.1;10;10504;1.3281;1454;1500;0;0;0;0;0;0;0 +5.2;10;10504;1.3281;1410;1500;0;0;0;0;0;0;0 +5.3;10;10504;1.3281;1367;1500;0;0;0;0;0;0;0 +5.4;10;10504;1.3281;1325;1500;0;0;0;0;0;0;0 +5.5;10;10504;1.3281;1285;1500;0;0;0;0;0;0;0 +5.6;10;10504;1.3281;1026;1500;0;0;0;0;0;0;0 +5.7;10;10504;1.3281;819;1500;0;0;0;0;0;0;0 +5.8;10;10504;1.3281;654;1500;0;0;0;0;0;0;0 +5.9;10;10504;1.3281;522;1500;0;0;0;0;0;0;0 +6;10;10504;1.3281;417;1500;0;0;0;0;0;0;0 +6.1;10;10504;1.3281;309;1500;0;0;0;0;0;0;0 +6.2;10;10504;1.3281;229;1500;0;0;0;0;0;0;0 +6.3;10;10504;1.3281;169;1500;0;0;0;0;0;0;0 +6.4;10;10504;1.3281;125;1500;0;0;0;0;0;0;0 +6.5;10;10504;1.3281;93;1500;0;0;0;0;0;0;0 +6.6;10;10504;1.3281;64;1500;0;0;0;0;0;0;0 +6.7;10;10504;1.3281;44;1500;0;0;0;0;0;0;0 +6.8;10;10504;1.3281;31;1500;0;0;0;0;0;0;0 +6.9;10;10504;1.3281;21;1500;0;0;0;0;0;0;0 +7;10;10504;1.3281;15;1500;0;0;0;0;0;0;0 +7.1;10;10504;1.3281;7;1500;0;0;0;0;0;0;0 +7.2;10;10504;1.3281;3;1500;0;0;0;0;0;0;0 +7.3;10;10504;1.3281;1;1500;0;0;0;0;0;0;0 +7.4;10;10504;1.3281;1;1500;0;0;0;0;0;0;0 +7.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +7.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +7.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +7.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +7.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +12;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs11_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs11_awgn_5G.csv new file mode 100644 index 0000000000..3d1dbcad12 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs11_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.6;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.7;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.8;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.9;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.6;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.7;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.8;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.9;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.6;11;11784;1.4766;1494;1500;0;0;0;0;0;0;0 +5.7;11;11784;1.4766;1489;1500;0;0;0;0;0;0;0 +5.8;11;11784;1.4766;1483;1500;0;0;0;0;0;0;0 +5.9;11;11784;1.4766;1477;1500;0;0;0;0;0;0;0 +6;11;11784;1.4766;1472;1500;0;0;0;0;0;0;0 +6.1;11;11784;1.4766;1367;1500;0;0;0;0;0;0;0 +6.2;11;11784;1.4766;1269;1500;0;0;0;0;0;0;0 +6.3;11;11784;1.4766;1179;1500;0;0;0;0;0;0;0 +6.4;11;11784;1.4766;1095;1500;0;0;0;0;0;0;0 +6.5;11;11784;1.4766;1016;1500;0;0;0;0;0;0;0 +6.6;11;11784;1.4766;762;1500;0;0;0;0;0;0;0 +6.7;11;11784;1.4766;571;1500;0;0;0;0;0;0;0 +6.8;11;11784;1.4766;428;1500;0;0;0;0;0;0;0 +6.9;11;11784;1.4766;320;1500;0;0;0;0;0;0;0 +7;11;11784;1.4766;240;1500;0;0;0;0;0;0;0 +7.1;11;11784;1.4766;169;1500;0;0;0;0;0;0;0 +7.2;11;11784;1.4766;119;1500;0;0;0;0;0;0;0 +7.3;11;11784;1.4766;83;1500;0;0;0;0;0;0;0 +7.4;11;11784;1.4766;59;1500;0;0;0;0;0;0;0 +7.5;11;11784;1.4766;41;1500;0;0;0;0;0;0;0 +7.6;11;11784;1.4766;24;1500;0;0;0;0;0;0;0 +7.7;11;11784;1.4766;14;1500;0;0;0;0;0;0;0 +7.8;11;11784;1.4766;8;1500;0;0;0;0;0;0;0 +7.9;11;11784;1.4766;5;1500;0;0;0;0;0;0;0 +8;11;11784;1.4766;3;1500;0;0;0;0;0;0;0 +8.1;11;11784;1.4766;1;1500;0;0;0;0;0;0;0 +8.2;11;11784;1.4766;1;1500;0;0;0;0;0;0;0 +8.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +12;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs12_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs12_awgn_5G.csv new file mode 100644 index 0000000000..5ce8b9bb19 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs12_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.6;12;13576;1.6953;1498;1500;0;0;0;0;0;0;0 +6.7;12;13576;1.6953;1495;1500;0;0;0;0;0;0;0 +6.8;12;13576;1.6953;1493;1500;0;0;0;0;0;0;0 +6.9;12;13576;1.6953;1491;1500;0;0;0;0;0;0;0 +7;12;13576;1.6953;1488;1500;0;0;0;0;0;0;0 +7.1;12;13576;1.6953;1357;1500;0;0;0;0;0;0;0 +7.2;12;13576;1.6953;1238;1500;0;0;0;0;0;0;0 +7.3;12;13576;1.6953;1129;1500;0;0;0;0;0;0;0 +7.4;12;13576;1.6953;1029;1500;0;0;0;0;0;0;0 +7.5;12;13576;1.6953;939;1500;0;0;0;0;0;0;0 +7.6;12;13576;1.6953;632;1500;0;0;0;0;0;0;0 +7.7;12;13576;1.6953;425;1500;0;0;0;0;0;0;0 +7.8;12;13576;1.6953;286;1500;0;0;0;0;0;0;0 +7.9;12;13576;1.6953;193;1500;0;0;0;0;0;0;0 +8;12;13576;1.6953;130;1500;0;0;0;0;0;0;0 +8.1;12;13576;1.6953;91;1500;0;0;0;0;0;0;0 +8.2;12;13576;1.6953;64;1500;0;0;0;0;0;0;0 +8.3;12;13576;1.6953;45;1500;0;0;0;0;0;0;0 +8.4;12;13576;1.6953;32;1500;0;0;0;0;0;0;0 +8.5;12;13576;1.6953;23;1500;0;0;0;0;0;0;0 +8.6;12;13576;1.6953;12;1500;0;0;0;0;0;0;0 +8.7;12;13576;1.6953;6;1500;0;0;0;0;0;0;0 +8.8;12;13576;1.6953;3;1500;0;0;0;0;0;0;0 +8.9;12;13576;1.6953;2;1500;0;0;0;0;0;0;0 +9;12;13576;1.6953;1;1500;0;0;0;0;0;0;0 +9.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +12;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs13_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs13_awgn_5G.csv new file mode 100644 index 0000000000..a91d924705 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs13_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +7;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.1;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.2;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.3;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.4;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.5;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.6;13;15112;1.9141;1444;1500;0;0;0;0;0;0;0 +7.7;13;15112;1.9141;1391;1500;0;0;0;0;0;0;0 +7.8;13;15112;1.9141;1340;1500;0;0;0;0;0;0;0 +7.9;13;15112;1.9141;1290;1500;0;0;0;0;0;0;0 +8;13;15112;1.9141;1243;1500;0;0;0;0;0;0;0 +8.1;13;15112;1.9141;878;1500;0;0;0;0;0;0;0 +8.2;13;15112;1.9141;620;1500;0;0;0;0;0;0;0 +8.3;13;15112;1.9141;438;1500;0;0;0;0;0;0;0 +8.4;13;15112;1.9141;309;1500;0;0;0;0;0;0;0 +8.5;13;15112;1.9141;219;1500;0;0;0;0;0;0;0 +8.6;13;15112;1.9141;173;1500;0;0;0;0;0;0;0 +8.7;13;15112;1.9141;137;1500;0;0;0;0;0;0;0 +8.8;13;15112;1.9141;109;1500;0;0;0;0;0;0;0 +8.9;13;15112;1.9141;86;1500;0;0;0;0;0;0;0 +9;13;15112;1.9141;68;1500;0;0;0;0;0;0;0 +9.1;13;15112;1.9141;47;1500;0;0;0;0;0;0;0 +9.2;13;15112;1.9141;33;1500;0;0;0;0;0;0;0 +9.3;13;15112;1.9141;23;1500;0;0;0;0;0;0;0 +9.4;13;15112;1.9141;16;1500;0;0;0;0;0;0;0 +9.5;13;15112;1.9141;11;1500;0;0;0;0;0;0;0 +9.6;13;15112;1.9141;5;1500;0;0;0;0;0;0;0 +9.7;13;15112;1.9141;2;1500;0;0;0;0;0;0;0 +9.8;13;15112;1.9141;1;1500;0;0;0;0;0;0;0 +9.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +14;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs14_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs14_awgn_5G.csv new file mode 100644 index 0000000000..b28d592a5e --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs14_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +7;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.1;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.2;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.3;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.4;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.5;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.6;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.7;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.8;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.9;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.1;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.2;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.3;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.4;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.5;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.6;14;17424;2.1602;1497;1500;0;0;0;0;0;0;0 +8.7;14;17424;2.1602;1493;1500;0;0;0;0;0;0;0 +8.8;14;17424;2.1602;1490;1500;0;0;0;0;0;0;0 +8.9;14;17424;2.1602;1487;1500;0;0;0;0;0;0;0 +9;14;17424;2.1602;1484;1500;0;0;0;0;0;0;0 +9.1;14;17424;2.1602;1291;1500;0;0;0;0;0;0;0 +9.2;14;17424;2.1602;1123;1500;0;0;0;0;0;0;0 +9.3;14;17424;2.1602;977;1500;0;0;0;0;0;0;0 +9.4;14;17424;2.1602;850;1500;0;0;0;0;0;0;0 +9.5;14;17424;2.1602;739;1500;0;0;0;0;0;0;0 +9.6;14;17424;2.1602;508;1500;0;0;0;0;0;0;0 +9.7;14;17424;2.1602;349;1500;0;0;0;0;0;0;0 +9.8;14;17424;2.1602;239;1500;0;0;0;0;0;0;0 +9.9;14;17424;2.1602;164;1500;0;0;0;0;0;0;0 +10;14;17424;2.1602;113;1500;0;0;0;0;0;0;0 +10.1;14;17424;2.1602;85;1500;0;0;0;0;0;0;0 +10.2;14;17424;2.1602;63;1500;0;0;0;0;0;0;0 +10.3;14;17424;2.1602;47;1500;0;0;0;0;0;0;0 +10.4;14;17424;2.1602;35;1500;0;0;0;0;0;0;0 +10.5;14;17424;2.1602;27;1500;0;0;0;0;0;0;0 +10.6;14;17424;2.1602;12;1500;0;0;0;0;0;0;0 +10.7;14;17424;2.1602;6;1500;0;0;0;0;0;0;0 +10.8;14;17424;2.1602;3;1500;0;0;0;0;0;0;0 +10.9;14;17424;2.1602;1;1500;0;0;0;0;0;0;0 +11;14;17424;2.1602;1;1500;0;0;0;0;0;0;0 +11.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +14;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs15_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs15_awgn_5G.csv new file mode 100644 index 0000000000..a48c75a071 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs15_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.2;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.3;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.4;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.5;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.6;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.2;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.3;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.4;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.5;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.6;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +9.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +9.2;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 +9.3;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 +9.4;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 +9.5;15;18960;2.4063;1498;1500;0;0;0;0;0;0;0 +9.6;15;18960;2.4063;1377;1500;0;0;0;0;0;0;0 +9.7;15;18960;2.4063;1265;1500;0;0;0;0;0;0;0 +9.8;15;18960;2.4063;1163;1500;0;0;0;0;0;0;0 +9.9;15;18960;2.4063;1069;1500;0;0;0;0;0;0;0 +10;15;18960;2.4063;982;1500;0;0;0;0;0;0;0 +10.1;15;18960;2.4063;664;1500;0;0;0;0;0;0;0 +10.2;15;18960;2.4063;450;1500;0;0;0;0;0;0;0 +10.3;15;18960;2.4063;304;1500;0;0;0;0;0;0;0 +10.4;15;18960;2.4063;206;1500;0;0;0;0;0;0;0 +10.5;15;18960;2.4063;139;1500;0;0;0;0;0;0;0 +10.6;15;18960;2.4063;113;1500;0;0;0;0;0;0;0 +10.7;15;18960;2.4063;92;1500;0;0;0;0;0;0;0 +10.8;15;18960;2.4063;75;1500;0;0;0;0;0;0;0 +10.9;15;18960;2.4063;61;1500;0;0;0;0;0;0;0 +11;15;18960;2.4063;50;1500;0;0;0;0;0;0;0 +11.1;15;18960;2.4063;29;1500;0;0;0;0;0;0;0 +11.2;15;18960;2.4063;17;1500;0;0;0;0;0;0;0 +11.3;15;18960;2.4063;10;1500;0;0;0;0;0;0;0 +11.4;15;18960;2.4063;6;1500;0;0;0;0;0;0;0 +11.5;15;18960;2.4063;3;1500;0;0;0;0;0;0;0 +11.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +11.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +11.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +11.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.1;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.2;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.3;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.4;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.5;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.1;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.2;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.3;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.4;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.5;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +14;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs16_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs16_awgn_5G.csv new file mode 100644 index 0000000000..cabe546aef --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs16_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +10;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +10.1;16;20496;2.5703;1424;1500;0;0;0;0;0;0;0 +10.2;16;20496;2.5703;1352;1500;0;0;0;0;0;0;0 +10.3;16;20496;2.5703;1283;1500;0;0;0;0;0;0;0 +10.4;16;20496;2.5703;1218;1500;0;0;0;0;0;0;0 +10.5;16;20496;2.5703;1157;1500;0;0;0;0;0;0;0 +10.6;16;20496;2.5703;775;1500;0;0;0;0;0;0;0 +10.7;16;20496;2.5703;519;1500;0;0;0;0;0;0;0 +10.8;16;20496;2.5703;348;1500;0;0;0;0;0;0;0 +10.9;16;20496;2.5703;233;1500;0;0;0;0;0;0;0 +11;16;20496;2.5703;156;1500;0;0;0;0;0;0;0 +11.1;16;20496;2.5703;132;1500;0;0;0;0;0;0;0 +11.2;16;20496;2.5703;111;1500;0;0;0;0;0;0;0 +11.3;16;20496;2.5703;94;1500;0;0;0;0;0;0;0 +11.4;16;20496;2.5703;79;1500;0;0;0;0;0;0;0 +11.5;16;20496;2.5703;67;1500;0;0;0;0;0;0;0 +11.6;16;20496;2.5703;44;1500;0;0;0;0;0;0;0 +11.7;16;20496;2.5703;29;1500;0;0;0;0;0;0;0 +11.8;16;20496;2.5703;19;1500;0;0;0;0;0;0;0 +11.9;16;20496;2.5703;12;1500;0;0;0;0;0;0;0 +12;16;20496;2.5703;8;1500;0;0;0;0;0;0;0 +12.1;16;20496;2.5703;4;1500;0;0;0;0;0;0;0 +12.2;16;20496;2.5703;2;1500;0;0;0;0;0;0;0 +12.3;16;20496;2.5703;1;1500;0;0;0;0;0;0;0 +12.4;16;20496;2.5703;1;1500;0;0;0;0;0;0;0 +12.5;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +12.6;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +12.7;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +12.8;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +12.9;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.1;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.2;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.3;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.4;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.5;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.6;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.7;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.8;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.9;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +14;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs17_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs17_awgn_5G.csv new file mode 100644 index 0000000000..5b26a5a722 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs17_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.1;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.2;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.3;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.4;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.5;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.6;17;20496;2.5664;1498;1500;0;0;0;0;0;0;0 +10.7;17;20496;2.5664;1496;1500;0;0;0;0;0;0;0 +10.8;17;20496;2.5664;1494;1500;0;0;0;0;0;0;0 +10.9;17;20496;2.5664;1493;1500;0;0;0;0;0;0;0 +11;17;20496;2.5664;1491;1500;0;0;0;0;0;0;0 +11.1;17;20496;2.5664;1336;1500;0;0;0;0;0;0;0 +11.2;17;20496;2.5664;1197;1500;0;0;0;0;0;0;0 +11.3;17;20496;2.5664;1072;1500;0;0;0;0;0;0;0 +11.4;17;20496;2.5664;961;1500;0;0;0;0;0;0;0 +11.5;17;20496;2.5664;861;1500;0;0;0;0;0;0;0 +11.6;17;20496;2.5664;603;1500;0;0;0;0;0;0;0 +11.7;17;20496;2.5664;423;1500;0;0;0;0;0;0;0 +11.8;17;20496;2.5664;296;1500;0;0;0;0;0;0;0 +11.9;17;20496;2.5664;208;1500;0;0;0;0;0;0;0 +12;17;20496;2.5664;146;1500;0;0;0;0;0;0;0 +12.1;17;20496;2.5664;125;1500;0;0;0;0;0;0;0 +12.2;17;20496;2.5664;107;1500;0;0;0;0;0;0;0 +12.3;17;20496;2.5664;92;1500;0;0;0;0;0;0;0 +12.4;17;20496;2.5664;79;1500;0;0;0;0;0;0;0 +12.5;17;20496;2.5664;68;1500;0;0;0;0;0;0;0 +12.6;17;20496;2.5664;50;1500;0;0;0;0;0;0;0 +12.7;17;20496;2.5664;37;1500;0;0;0;0;0;0;0 +12.8;17;20496;2.5664;28;1500;0;0;0;0;0;0;0 +12.9;17;20496;2.5664;20;1500;0;0;0;0;0;0;0 +13;17;20496;2.5664;15;1500;0;0;0;0;0;0;0 +13.1;17;20496;2.5664;9;1500;0;0;0;0;0;0;0 +13.2;17;20496;2.5664;5;1500;0;0;0;0;0;0;0 +13.3;17;20496;2.5664;3;1500;0;0;0;0;0;0;0 +13.4;17;20496;2.5664;2;1500;0;0;0;0;0;0;0 +13.5;17;20496;2.5664;1;1500;0;0;0;0;0;0;0 +13.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +13.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +13.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +13.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +17;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs18_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs18_awgn_5G.csv new file mode 100644 index 0000000000..bf4864701f --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs18_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.1;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.2;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.3;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.4;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.5;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.6;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.7;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.8;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.9;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +11;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +11.1;18;21504;2.7305;1499;1500;0;0;0;0;0;0;0 +11.2;18;21504;2.7305;1499;1500;0;0;0;0;0;0;0 +11.3;18;21504;2.7305;1498;1500;0;0;0;0;0;0;0 +11.4;18;21504;2.7305;1498;1500;0;0;0;0;0;0;0 +11.5;18;21504;2.7305;1497;1500;0;0;0;0;0;0;0 +11.6;18;21504;2.7305;1399;1500;0;0;0;0;0;0;0 +11.7;18;21504;2.7305;1307;1500;0;0;0;0;0;0;0 +11.8;18;21504;2.7305;1221;1500;0;0;0;0;0;0;0 +11.9;18;21504;2.7305;1141;1500;0;0;0;0;0;0;0 +12;18;21504;2.7305;1066;1500;0;0;0;0;0;0;0 +12.1;18;21504;2.7305;788;1500;0;0;0;0;0;0;0 +12.2;18;21504;2.7305;582;1500;0;0;0;0;0;0;0 +12.3;18;21504;2.7305;431;1500;0;0;0;0;0;0;0 +12.4;18;21504;2.7305;318;1500;0;0;0;0;0;0;0 +12.5;18;21504;2.7305;235;1500;0;0;0;0;0;0;0 +12.6;18;21504;2.7305;185;1500;0;0;0;0;0;0;0 +12.7;18;21504;2.7305;146;1500;0;0;0;0;0;0;0 +12.8;18;21504;2.7305;115;1500;0;0;0;0;0;0;0 +12.9;18;21504;2.7305;90;1500;0;0;0;0;0;0;0 +13;18;21504;2.7305;71;1500;0;0;0;0;0;0;0 +13.1;18;21504;2.7305;50;1500;0;0;0;0;0;0;0 +13.2;18;21504;2.7305;35;1500;0;0;0;0;0;0;0 +13.3;18;21504;2.7305;25;1500;0;0;0;0;0;0;0 +13.4;18;21504;2.7305;18;1500;0;0;0;0;0;0;0 +13.5;18;21504;2.7305;12;1500;0;0;0;0;0;0;0 +13.6;18;21504;2.7305;7;1500;0;0;0;0;0;0;0 +13.7;18;21504;2.7305;3;1500;0;0;0;0;0;0;0 +13.8;18;21504;2.7305;2;1500;0;0;0;0;0;0;0 +13.9;18;21504;2.7305;1;1500;0;0;0;0;0;0;0 +14;18;21504;2.7305;1;1500;0;0;0;0;0;0;0 +14.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +17;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs19_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs19_awgn_5G.csv new file mode 100644 index 0000000000..85e7f6a712 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs19_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.1;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.2;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.3;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.4;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.5;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.6;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.7;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.8;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.9;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.1;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.2;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.3;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.4;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.5;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.6;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.7;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.8;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.9;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +12;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +12.1;19;24072;3.0293;1499;1500;0;0;0;0;0;0;0 +12.2;19;24072;3.0293;1499;1500;0;0;0;0;0;0;0 +12.3;19;24072;3.0293;1498;1500;0;0;0;0;0;0;0 +12.4;19;24072;3.0293;1497;1500;0;0;0;0;0;0;0 +12.5;19;24072;3.0293;1497;1500;0;0;0;0;0;0;0 +12.6;19;24072;3.0293;1389;1500;0;0;0;0;0;0;0 +12.7;19;24072;3.0293;1290;1500;0;0;0;0;0;0;0 +12.8;19;24072;3.0293;1197;1500;0;0;0;0;0;0;0 +12.9;19;24072;3.0293;1111;1500;0;0;0;0;0;0;0 +13;19;24072;3.0293;1032;1500;0;0;0;0;0;0;0 +13.1;19;24072;3.0293;746;1500;0;0;0;0;0;0;0 +13.2;19;24072;3.0293;539;1500;0;0;0;0;0;0;0 +13.3;19;24072;3.0293;390;1500;0;0;0;0;0;0;0 +13.4;19;24072;3.0293;282;1500;0;0;0;0;0;0;0 +13.5;19;24072;3.0293;204;1500;0;0;0;0;0;0;0 +13.6;19;24072;3.0293;166;1500;0;0;0;0;0;0;0 +13.7;19;24072;3.0293;135;1500;0;0;0;0;0;0;0 +13.8;19;24072;3.0293;110;1500;0;0;0;0;0;0;0 +13.9;19;24072;3.0293;89;1500;0;0;0;0;0;0;0 +14;19;24072;3.0293;73;1500;0;0;0;0;0;0;0 +14.1;19;24072;3.0293;54;1500;0;0;0;0;0;0;0 +14.2;19;24072;3.0293;41;1500;0;0;0;0;0;0;0 +14.3;19;24072;3.0293;30;1500;0;0;0;0;0;0;0 +14.4;19;24072;3.0293;23;1500;0;0;0;0;0;0;0 +14.5;19;24072;3.0293;17;1500;0;0;0;0;0;0;0 +14.6;19;24072;3.0293;9;1500;0;0;0;0;0;0;0 +14.7;19;24072;3.0293;5;1500;0;0;0;0;0;0;0 +14.8;19;24072;3.0293;3;1500;0;0;0;0;0;0;0 +14.9;19;24072;3.0293;2;1500;0;0;0;0;0;0;0 +15;19;24072;3.0293;1;1500;0;0;0;0;0;0;0 +15.1;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.2;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.3;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.4;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.5;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.6;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.7;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.8;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.9;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.1;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.2;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.3;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.4;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.5;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.6;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.7;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.8;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.9;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +17;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs1_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs1_awgn_5G.csv new file mode 100644 index 0000000000..4a22a46882 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs1_awgn_5G.csv @@ -0,0 +1,27 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-4;1;2472;0.3066;1500;1500;0;0;0;0;0;0;0 +-3.9;1;2472;0.3066;1497;1500;0;0;0;0;0;0;0 +-3.8;1;2472;0.3066;1494;1500;0;0;0;0;0;0;0 +-3.7;1;2472;0.3066;1490;1500;0;0;0;0;0;0;0 +-3.6;1;2472;0.3066;1487;1500;0;0;0;0;0;0;0 +-3.5;1;2472;0.3066;1484;1500;0;0;0;0;0;0;0 +-3.4;1;2472;0.3066;1386;1500;0;0;0;0;0;0;0 +-3.3;1;2472;0.3066;1295;1500;0;0;0;0;0;0;0 +-3.2;1;2472;0.3066;1209;1500;0;0;0;0;0;0;0 +-3.1;1;2472;0.3066;1130;1500;0;0;0;0;0;0;0 +-3;1;2472;0.3066;1055;1500;0;0;0;0;0;0;0 +-2.9;1;2472;0.3066;863;1500;0;0;0;0;0;0;0 +-2.8;1;2472;0.3066;706;1500;0;0;0;0;0;0;0 +-2.7;1;2472;0.3066;577;1500;0;0;0;0;0;0;0 +-2.6;1;2472;0.3066;472;1500;0;0;0;0;0;0;0 +-2.5;1;2472;0.3066;386;1500;0;0;0;0;0;0;0 +-2.4;1;2472;0.3066;215;1500;0;0;0;0;0;0;0 +-2.3;1;2472;0.3066;120;1500;0;0;0;0;0;0;0 +-2.2;1;2472;0.3066;67;1500;0;0;0;0;0;0;0 +-2.1;1;2472;0.3066;37;1500;0;0;0;0;0;0;0 +-2;1;2472;0.3066;21;1500;0;0;0;0;0;0;0 +-1.9;1;2472;0.3066;9;1500;0;0;0;0;0;0;0 +-1.8;1;2472;0.3066;4;1500;0;0;0;0;0;0;0 +-1.7;1;2472;0.3066;2;1500;0;0;0;0;0;0;0 +-1.6;1;2472;0.3066;1;1500;0;0;0;0;0;0;0 +-1.5;1;2472;0.3066;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs20_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs20_awgn_5G.csv new file mode 100644 index 0000000000..545c8fc099 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs20_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +13;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +13.1;20;26632;3.3223;1499;1500;0;0;0;0;0;0;0 +13.2;20;26632;3.3223;1499;1500;0;0;0;0;0;0;0 +13.3;20;26632;3.3223;1498;1500;0;0;0;0;0;0;0 +13.4;20;26632;3.3223;1498;1500;0;0;0;0;0;0;0 +13.5;20;26632;3.3223;1497;1500;0;0;0;0;0;0;0 +13.6;20;26632;3.3223;1390;1500;0;0;0;0;0;0;0 +13.7;20;26632;3.3223;1291;1500;0;0;0;0;0;0;0 +13.8;20;26632;3.3223;1199;1500;0;0;0;0;0;0;0 +13.9;20;26632;3.3223;1113;1500;0;0;0;0;0;0;0 +14;20;26632;3.3223;1034;1500;0;0;0;0;0;0;0 +14.1;20;26632;3.3223;745;1500;0;0;0;0;0;0;0 +14.2;20;26632;3.3223;537;1500;0;0;0;0;0;0;0 +14.3;20;26632;3.3223;387;1500;0;0;0;0;0;0;0 +14.4;20;26632;3.3223;279;1500;0;0;0;0;0;0;0 +14.5;20;26632;3.3223;201;1500;0;0;0;0;0;0;0 +14.6;20;26632;3.3223;161;1500;0;0;0;0;0;0;0 +14.7;20;26632;3.3223;129;1500;0;0;0;0;0;0;0 +14.8;20;26632;3.3223;104;1500;0;0;0;0;0;0;0 +14.9;20;26632;3.3223;83;1500;0;0;0;0;0;0;0 +15;20;26632;3.3223;67;1500;0;0;0;0;0;0;0 +15.1;20;26632;3.3223;45;1500;0;0;0;0;0;0;0 +15.2;20;26632;3.3223;30;1500;0;0;0;0;0;0;0 +15.3;20;26632;3.3223;20;1500;0;0;0;0;0;0;0 +15.4;20;26632;3.3223;13;1500;0;0;0;0;0;0;0 +15.5;20;26632;3.3223;9;1500;0;0;0;0;0;0;0 +15.6;20;26632;3.3223;4;1500;0;0;0;0;0;0;0 +15.7;20;26632;3.3223;1;1500;0;0;0;0;0;0;0 +15.8;20;26632;3.3223;1;1500;0;0;0;0;0;0;0 +15.9;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.1;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.2;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.3;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.4;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.5;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.6;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.7;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.8;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.9;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +17;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs21_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs21_awgn_5G.csv new file mode 100644 index 0000000000..a9fe3dd606 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs21_awgn_5G.csv @@ -0,0 +1,72 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +14;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +14.1;21;28680;3.6094;1472;1500;0;0;0;0;0;0;0 +14.2;21;28680;3.6094;1444;1500;0;0;0;0;0;0;0 +14.3;21;28680;3.6094;1417;1500;0;0;0;0;0;0;0 +14.4;21;28680;3.6094;1390;1500;0;0;0;0;0;0;0 +14.5;21;28680;3.6094;1364;1500;0;0;0;0;0;0;0 +14.6;21;28680;3.6094;1040;1500;0;0;0;0;0;0;0 +14.7;21;28680;3.6094;793;1500;0;0;0;0;0;0;0 +14.8;21;28680;3.6094;605;1500;0;0;0;0;0;0;0 +14.9;21;28680;3.6094;461;1500;0;0;0;0;0;0;0 +15;21;28680;3.6094;351;1500;0;0;0;0;0;0;0 +15.1;21;28680;3.6094;265;1500;0;0;0;0;0;0;0 +15.2;21;28680;3.6094;199;1500;0;0;0;0;0;0;0 +15.3;21;28680;3.6094;150;1500;0;0;0;0;0;0;0 +15.4;21;28680;3.6094;113;1500;0;0;0;0;0;0;0 +15.5;21;28680;3.6094;85;1500;0;0;0;0;0;0;0 +15.6;21;28680;3.6094;79;1500;0;0;0;0;0;0;0 +15.7;21;28680;3.6094;73;1500;0;0;0;0;0;0;0 +15.8;21;28680;3.6094;67;1500;0;0;0;0;0;0;0 +15.9;21;28680;3.6094;62;1500;0;0;0;0;0;0;0 +16;21;28680;3.6094;57;1500;0;0;0;0;0;0;0 +16.1;21;28680;3.6094;37;1500;0;0;0;0;0;0;0 +16.2;21;28680;3.6094;23;1500;0;0;0;0;0;0;0 +16.3;21;28680;3.6094;15;1500;0;0;0;0;0;0;0 +16.4;21;28680;3.6094;10;1500;0;0;0;0;0;0;0 +16.5;21;28680;3.6094;6;1500;0;0;0;0;0;0;0 +16.6;21;28680;3.6094;3;1500;0;0;0;0;0;0;0 +16.7;21;28680;3.6094;1;1500;0;0;0;0;0;0;0 +16.8;21;28680;3.6094;1;1500;0;0;0;0;0;0;0 +16.9;21;28680;3.6094;0;1500;0;0;0;0;0;0;0 +17;21;28680;3.6094;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs22_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs22_awgn_5G.csv new file mode 100644 index 0000000000..c4e69590a5 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs22_awgn_5G.csv @@ -0,0 +1,52 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +14;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.1;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.2;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.3;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.4;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.5;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.6;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.7;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.8;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.9;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +15;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +15.1;22;31240;3.9023;1421;1500;0;0;0;0;0;0;0 +15.2;22;31240;3.9023;1347;1500;0;0;0;0;0;0;0 +15.3;22;31240;3.9023;1276;1500;0;0;0;0;0;0;0 +15.4;22;31240;3.9023;1209;1500;0;0;0;0;0;0;0 +15.5;22;31240;3.9023;1146;1500;0;0;0;0;0;0;0 +15.6;22;31240;3.9023;807;1500;0;0;0;0;0;0;0 +15.7;22;31240;3.9023;569;1500;0;0;0;0;0;0;0 +15.8;22;31240;3.9023;400;1500;0;0;0;0;0;0;0 +15.9;22;31240;3.9023;282;1500;0;0;0;0;0;0;0 +16;22;31240;3.9023;199;1500;0;0;0;0;0;0;0 +16.1;22;31240;3.9023;165;1500;0;0;0;0;0;0;0 +16.2;22;31240;3.9023;137;1500;0;0;0;0;0;0;0 +16.3;22;31240;3.9023;114;1500;0;0;0;0;0;0;0 +16.4;22;31240;3.9023;94;1500;0;0;0;0;0;0;0 +16.5;22;31240;3.9023;78;1500;0;0;0;0;0;0;0 +16.6;22;31240;3.9023;74;1500;0;0;0;0;0;0;0 +16.7;22;31240;3.9023;69;1500;0;0;0;0;0;0;0 +16.8;22;31240;3.9023;65;1500;0;0;0;0;0;0;0 +16.9;22;31240;3.9023;61;1500;0;0;0;0;0;0;0 +17;22;31240;3.9023;58;1500;0;0;0;0;0;0;0 +17.1;22;31240;3.9023;36;1500;0;0;0;0;0;0;0 +17.2;22;31240;3.9023;23;1500;0;0;0;0;0;0;0 +17.3;22;31240;3.9023;15;1500;0;0;0;0;0;0;0 +17.4;22;31240;3.9023;9;1500;0;0;0;0;0;0;0 +17.5;22;31240;3.9023;6;1500;0;0;0;0;0;0;0 +17.6;22;31240;3.9023;3;1500;0;0;0;0;0;0;0 +17.7;22;31240;3.9023;1;1500;0;0;0;0;0;0;0 +17.8;22;31240;3.9023;1;1500;0;0;0;0;0;0;0 +17.9;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.1;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.2;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.3;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.4;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.5;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.6;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.7;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.8;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.9;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +19;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs23_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs23_awgn_5G.csv new file mode 100644 index 0000000000..4ac1243d3b --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs23_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +15;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.1;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.2;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.3;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.4;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.5;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.6;23;33816;4.2129;1499;1500;0;0;0;0;0;0;0 +15.7;23;33816;4.2129;1499;1500;0;0;0;0;0;0;0 +15.8;23;33816;4.2129;1498;1500;0;0;0;0;0;0;0 +15.9;23;33816;4.2129;1498;1500;0;0;0;0;0;0;0 +16;23;33816;4.2129;1497;1500;0;0;0;0;0;0;0 +16.1;23;33816;4.2129;1360;1500;0;0;0;0;0;0;0 +16.2;23;33816;4.2129;1236;1500;0;0;0;0;0;0;0 +16.3;23;33816;4.2129;1123;1500;0;0;0;0;0;0;0 +16.4;23;33816;4.2129;1020;1500;0;0;0;0;0;0;0 +16.5;23;33816;4.2129;927;1500;0;0;0;0;0;0;0 +16.6;23;33816;4.2129;630;1500;0;0;0;0;0;0;0 +16.7;23;33816;4.2129;428;1500;0;0;0;0;0;0;0 +16.8;23;33816;4.2129;291;1500;0;0;0;0;0;0;0 +16.9;23;33816;4.2129;198;1500;0;0;0;0;0;0;0 +17;23;33816;4.2129;135;1500;0;0;0;0;0;0;0 +17.1;23;33816;4.2129;120;1500;0;0;0;0;0;0;0 +17.2;23;33816;4.2129;108;1500;0;0;0;0;0;0;0 +17.3;23;33816;4.2129;96;1500;0;0;0;0;0;0;0 +17.4;23;33816;4.2129;86;1500;0;0;0;0;0;0;0 +17.5;23;33816;4.2129;77;1500;0;0;0;0;0;0;0 +17.6;23;33816;4.2129;70;1500;0;0;0;0;0;0;0 +17.7;23;33816;4.2129;63;1500;0;0;0;0;0;0;0 +17.8;23;33816;4.2129;57;1500;0;0;0;0;0;0;0 +17.9;23;33816;4.2129;52;1500;0;0;0;0;0;0;0 +18;23;33816;4.2129;47;1500;0;0;0;0;0;0;0 +18.1;23;33816;4.2129;28;1500;0;0;0;0;0;0;0 +18.2;23;33816;4.2129;16;1500;0;0;0;0;0;0;0 +18.3;23;33816;4.2129;9;1500;0;0;0;0;0;0;0 +18.4;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 +18.5;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +18.6;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +18.7;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +18.8;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +18.9;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +19;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +19.1;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +19.2;23;33816;4.2129;4;1500;0;0;0;0;0;0;0 +19.3;23;33816;4.2129;5;1500;0;0;0;0;0;0;0 +19.4;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 +19.5;23;33816;4.2129;8;1500;0;0;0;0;0;0;0 +19.6;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 +19.7;23;33816;4.2129;4;1500;0;0;0;0;0;0;0 +19.8;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +19.9;23;33816;4.2129;2;1500;0;0;0;0;0;0;0 +20;23;33816;4.2129;2;1500;0;0;0;0;0;0;0 +20.1;23;33816;4.2129;1;1500;0;0;0;0;0;0;0 +20.2;23;33816;4.2129;1;1500;0;0;0;0;0;0;0 +20.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +24;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs24_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs24_awgn_5G.csv new file mode 100644 index 0000000000..5bed20cf58 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs24_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +15;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.1;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.2;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.3;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.4;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.5;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.6;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.7;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.8;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.9;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.1;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.2;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.3;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.4;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.5;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.6;24;35856;4.5234;1474;1500;0;0;0;0;0;0;0 +16.7;24;35856;4.5234;1449;1500;0;0;0;0;0;0;0 +16.8;24;35856;4.5234;1424;1500;0;0;0;0;0;0;0 +16.9;24;35856;4.5234;1400;1500;0;0;0;0;0;0;0 +17;24;35856;4.5234;1376;1500;0;0;0;0;0;0;0 +17.1;24;35856;4.5234;1016;1500;0;0;0;0;0;0;0 +17.2;24;35856;4.5234;751;1500;0;0;0;0;0;0;0 +17.3;24;35856;4.5234;554;1500;0;0;0;0;0;0;0 +17.4;24;35856;4.5234;410;1500;0;0;0;0;0;0;0 +17.5;24;35856;4.5234;303;1500;0;0;0;0;0;0;0 +17.6;24;35856;4.5234;232;1500;0;0;0;0;0;0;0 +17.7;24;35856;4.5234;177;1500;0;0;0;0;0;0;0 +17.8;24;35856;4.5234;136;1500;0;0;0;0;0;0;0 +17.9;24;35856;4.5234;104;1500;0;0;0;0;0;0;0 +18;24;35856;4.5234;80;1500;0;0;0;0;0;0;0 +18.1;24;35856;4.5234;79;1500;0;0;0;0;0;0;0 +18.2;24;35856;4.5234;78;1500;0;0;0;0;0;0;0 +18.3;24;35856;4.5234;77;1500;0;0;0;0;0;0;0 +18.4;24;35856;4.5234;76;1500;0;0;0;0;0;0;0 +18.5;24;35856;4.5234;75;1500;0;0;0;0;0;0;0 +18.6;24;35856;4.5234;59;1500;0;0;0;0;0;0;0 +18.7;24;35856;4.5234;46;1500;0;0;0;0;0;0;0 +18.8;24;35856;4.5234;36;1500;0;0;0;0;0;0;0 +18.9;24;35856;4.5234;28;1500;0;0;0;0;0;0;0 +19;24;35856;4.5234;22;1500;0;0;0;0;0;0;0 +19.1;24;35856;4.5234;21;1500;0;0;0;0;0;0;0 +19.2;24;35856;4.5234;20;1500;0;0;0;0;0;0;0 +19.3;24;35856;4.5234;20;1500;0;0;0;0;0;0;0 +19.4;24;35856;4.5234;19;1500;0;0;0;0;0;0;0 +19.5;24;35856;4.5234;18;1500;0;0;0;0;0;0;0 +19.6;24;35856;4.5234;22;1500;0;0;0;0;0;0;0 +19.7;24;35856;4.5234;26;1500;0;0;0;0;0;0;0 +19.8;24;35856;4.5234;31;1500;0;0;0;0;0;0;0 +19.9;24;35856;4.5234;36;1500;0;0;0;0;0;0;0 +20;24;35856;4.5234;43;1500;0;0;0;0;0;0;0 +20.1;24;35856;4.5234;35;1500;0;0;0;0;0;0;0 +20.2;24;35856;4.5234;29;1500;0;0;0;0;0;0;0 +20.3;24;35856;4.5234;23;1500;0;0;0;0;0;0;0 +20.4;24;35856;4.5234;19;1500;0;0;0;0;0;0;0 +20.5;24;35856;4.5234;15;1500;0;0;0;0;0;0;0 +20.6;24;35856;4.5234;8;1500;0;0;0;0;0;0;0 +20.7;24;35856;4.5234;4;1500;0;0;0;0;0;0;0 +20.8;24;35856;4.5234;2;1500;0;0;0;0;0;0;0 +20.9;24;35856;4.5234;1;1500;0;0;0;0;0;0;0 +21;24;35856;4.5234;1;1500;0;0;0;0;0;0;0 +21.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +24;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs25_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs25_awgn_5G.csv new file mode 100644 index 0000000000..fdb2abcadc --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs25_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +15;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.1;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.2;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.3;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.4;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.5;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.6;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.7;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.8;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.9;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.1;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.2;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.3;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.4;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.5;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.6;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.7;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.8;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.9;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +17;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +17.1;25;37896;4.8164;1493;1500;0;0;0;0;0;0;0 +17.2;25;37896;4.8164;1486;1500;0;0;0;0;0;0;0 +17.3;25;37896;4.8164;1478;1500;0;0;0;0;0;0;0 +17.4;25;37896;4.8164;1471;1500;0;0;0;0;0;0;0 +17.5;25;37896;4.8164;1464;1500;0;0;0;0;0;0;0 +17.6;25;37896;4.8164;1138;1500;0;0;0;0;0;0;0 +17.7;25;37896;4.8164;885;1500;0;0;0;0;0;0;0 +17.8;25;37896;4.8164;688;1500;0;0;0;0;0;0;0 +17.9;25;37896;4.8164;535;1500;0;0;0;0;0;0;0 +18;25;37896;4.8164;416;1500;0;0;0;0;0;0;0 +18.1;25;37896;4.8164;302;1500;0;0;0;0;0;0;0 +18.2;25;37896;4.8164;219;1500;0;0;0;0;0;0;0 +18.3;25;37896;4.8164;159;1500;0;0;0;0;0;0;0 +18.4;25;37896;4.8164;115;1500;0;0;0;0;0;0;0 +18.5;25;37896;4.8164;84;1500;0;0;0;0;0;0;0 +18.6;25;37896;4.8164;89;1500;0;0;0;0;0;0;0 +18.7;25;37896;4.8164;94;1500;0;0;0;0;0;0;0 +18.8;25;37896;4.8164;100;1500;0;0;0;0;0;0;0 +18.9;25;37896;4.8164;106;1500;0;0;0;0;0;0;0 +19;25;37896;4.8164;113;1500;0;0;0;0;0;0;0 +19.1;25;37896;4.8164;110;1500;0;0;0;0;0;0;0 +19.2;25;37896;4.8164;108;1500;0;0;0;0;0;0;0 +19.3;25;37896;4.8164;105;1500;0;0;0;0;0;0;0 +19.4;25;37896;4.8164;103;1500;0;0;0;0;0;0;0 +19.5;25;37896;4.8164;101;1500;0;0;0;0;0;0;0 +19.6;25;37896;4.8164;89;1500;0;0;0;0;0;0;0 +19.7;25;37896;4.8164;79;1500;0;0;0;0;0;0;0 +19.8;25;37896;4.8164;71;1500;0;0;0;0;0;0;0 +19.9;25;37896;4.8164;63;1500;0;0;0;0;0;0;0 +20;25;37896;4.8164;56;1500;0;0;0;0;0;0;0 +20.1;25;37896;4.8164;58;1500;0;0;0;0;0;0;0 +20.2;25;37896;4.8164;61;1500;0;0;0;0;0;0;0 +20.3;25;37896;4.8164;64;1500;0;0;0;0;0;0;0 +20.4;25;37896;4.8164;67;1500;0;0;0;0;0;0;0 +20.5;25;37896;4.8164;71;1500;0;0;0;0;0;0;0 +20.6;25;37896;4.8164;64;1500;0;0;0;0;0;0;0 +20.7;25;37896;4.8164;58;1500;0;0;0;0;0;0;0 +20.8;25;37896;4.8164;52;1500;0;0;0;0;0;0;0 +20.9;25;37896;4.8164;47;1500;0;0;0;0;0;0;0 +21;25;37896;4.8164;43;1500;0;0;0;0;0;0;0 +21.1;25;37896;4.8164;27;1500;0;0;0;0;0;0;0 +21.2;25;37896;4.8164;17;1500;0;0;0;0;0;0;0 +21.3;25;37896;4.8164;10;1500;0;0;0;0;0;0;0 +21.4;25;37896;4.8164;6;1500;0;0;0;0;0;0;0 +21.5;25;37896;4.8164;4;1500;0;0;0;0;0;0;0 +21.6;25;37896;4.8164;2;1500;0;0;0;0;0;0;0 +21.7;25;37896;4.8164;1;1500;0;0;0;0;0;0;0 +21.8;25;37896;4.8164;1;1500;0;0;0;0;0;0;0 +21.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.1;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.2;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.3;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.4;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.5;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.6;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.7;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.8;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.1;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.2;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.3;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.4;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.5;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.6;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.7;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.8;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +24;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs26_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs26_awgn_5G.csv new file mode 100644 index 0000000000..ae2ed007aa --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs26_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +15;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +18;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +18.1;26;40976;5.1152;1496;1500;0;0;0;0;0;0;0 +18.2;26;40976;5.1152;1492;1500;0;0;0;0;0;0;0 +18.3;26;40976;5.1152;1487;1500;0;0;0;0;0;0;0 +18.4;26;40976;5.1152;1483;1500;0;0;0;0;0;0;0 +18.5;26;40976;5.1152;1479;1500;0;0;0;0;0;0;0 +18.6;26;40976;5.1152;1188;1500;0;0;0;0;0;0;0 +18.7;26;40976;5.1152;954;1500;0;0;0;0;0;0;0 +18.8;26;40976;5.1152;766;1500;0;0;0;0;0;0;0 +18.9;26;40976;5.1152;615;1500;0;0;0;0;0;0;0 +19;26;40976;5.1152;494;1500;0;0;0;0;0;0;0 +19.1;26;40976;5.1152;478;1500;0;0;0;0;0;0;0 +19.2;26;40976;5.1152;462;1500;0;0;0;0;0;0;0 +19.3;26;40976;5.1152;447;1500;0;0;0;0;0;0;0 +19.4;26;40976;5.1152;433;1500;0;0;0;0;0;0;0 +19.5;26;40976;5.1152;419;1500;0;0;0;0;0;0;0 +19.6;26;40976;5.1152;491;1500;0;0;0;0;0;0;0 +19.7;26;40976;5.1152;577;1500;0;0;0;0;0;0;0 +19.8;26;40976;5.1152;677;1500;0;0;0;0;0;0;0 +19.9;26;40976;5.1152;795;1500;0;0;0;0;0;0;0 +20;26;40976;5.1152;934;1500;0;0;0;0;0;0;0 +20.1;26;40976;5.1152;799;1500;0;0;0;0;0;0;0 +20.2;26;40976;5.1152;684;1500;0;0;0;0;0;0;0 +20.3;26;40976;5.1152;586;1500;0;0;0;0;0;0;0 +20.4;26;40976;5.1152;502;1500;0;0;0;0;0;0;0 +20.5;26;40976;5.1152;429;1500;0;0;0;0;0;0;0 +20.6;26;40976;5.1152;315;1500;0;0;0;0;0;0;0 +20.7;26;40976;5.1152;231;1500;0;0;0;0;0;0;0 +20.8;26;40976;5.1152;169;1500;0;0;0;0;0;0;0 +20.9;26;40976;5.1152;124;1500;0;0;0;0;0;0;0 +21;26;40976;5.1152;91;1500;0;0;0;0;0;0;0 +21.1;26;40976;5.1152;87;1500;0;0;0;0;0;0;0 +21.2;26;40976;5.1152;84;1500;0;0;0;0;0;0;0 +21.3;26;40976;5.1152;81;1500;0;0;0;0;0;0;0 +21.4;26;40976;5.1152;78;1500;0;0;0;0;0;0;0 +21.5;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +21.6;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +21.7;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +21.8;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +21.9;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +22;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +22.1;26;40976;5.1152;73;1500;0;0;0;0;0;0;0 +22.2;26;40976;5.1152;72;1500;0;0;0;0;0;0;0 +22.3;26;40976;5.1152;70;1500;0;0;0;0;0;0;0 +22.4;26;40976;5.1152;68;1500;0;0;0;0;0;0;0 +22.5;26;40976;5.1152;67;1500;0;0;0;0;0;0;0 +22.6;26;40976;5.1152;53;1500;0;0;0;0;0;0;0 +22.7;26;40976;5.1152;42;1500;0;0;0;0;0;0;0 +22.8;26;40976;5.1152;33;1500;0;0;0;0;0;0;0 +22.9;26;40976;5.1152;26;1500;0;0;0;0;0;0;0 +23;26;40976;5.1152;21;1500;0;0;0;0;0;0;0 +23.1;26;40976;5.1152;11;1500;0;0;0;0;0;0;0 +23.2;26;40976;5.1152;6;1500;0;0;0;0;0;0;0 +23.3;26;40976;5.1152;3;1500;0;0;0;0;0;0;0 +23.4;26;40976;5.1152;2;1500;0;0;0;0;0;0;0 +23.5;26;40976;5.1152;1;1500;0;0;0;0;0;0;0 +23.6;26;40976;5.1152;1;1500;0;0;0;0;0;0;0 +23.7;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 +23.8;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 +23.9;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 +24;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs27_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs27_awgn_5G.csv new file mode 100644 index 0000000000..6b43b3e2aa --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs27_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +18;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.1;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.2;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.3;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.4;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.5;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.6;27;42016;5.332;1465;1500;0;0;0;0;0;0;0 +18.7;27;42016;5.332;1430;1500;0;0;0;0;0;0;0 +18.8;27;42016;5.332;1397;1500;0;0;0;0;0;0;0 +18.9;27;42016;5.332;1364;1500;0;0;0;0;0;0;0 +19;27;42016;5.332;1332;1500;0;0;0;0;0;0;0 +19.1;27;42016;5.332;1092;1500;0;0;0;0;0;0;0 +19.2;27;42016;5.332;896;1500;0;0;0;0;0;0;0 +19.3;27;42016;5.332;735;1500;0;0;0;0;0;0;0 +19.4;27;42016;5.332;603;1500;0;0;0;0;0;0;0 +19.5;27;42016;5.332;494;1500;0;0;0;0;0;0;0 +19.6;27;42016;5.332;572;1500;0;0;0;0;0;0;0 +19.7;27;42016;5.332;662;1500;0;0;0;0;0;0;0 +19.8;27;42016;5.332;766;1500;0;0;0;0;0;0;0 +19.9;27;42016;5.332;886;1500;0;0;0;0;0;0;0 +20;27;42016;5.332;1025;1500;0;0;0;0;0;0;0 +20.1;27;42016;5.332;1041;1500;0;0;0;0;0;0;0 +20.2;27;42016;5.332;1058;1500;0;0;0;0;0;0;0 +20.3;27;42016;5.332;1074;1500;0;0;0;0;0;0;0 +20.4;27;42016;5.332;1091;1500;0;0;0;0;0;0;0 +20.5;27;42016;5.332;1109;1500;0;0;0;0;0;0;0 +20.6;27;42016;5.332;811;1500;0;0;0;0;0;0;0 +20.7;27;42016;5.332;594;1500;0;0;0;0;0;0;0 +20.8;27;42016;5.332;434;1500;0;0;0;0;0;0;0 +20.9;27;42016;5.332;318;1500;0;0;0;0;0;0;0 +21;27;42016;5.332;233;1500;0;0;0;0;0;0;0 +21.1;27;42016;5.332;187;1500;0;0;0;0;0;0;0 +21.2;27;42016;5.332;150;1500;0;0;0;0;0;0;0 +21.3;27;42016;5.332;121;1500;0;0;0;0;0;0;0 +21.4;27;42016;5.332;97;1500;0;0;0;0;0;0;0 +21.5;27;42016;5.332;78;1500;0;0;0;0;0;0;0 +21.6;27;42016;5.332;78;1500;0;0;0;0;0;0;0 +21.7;27;42016;5.332;77;1500;0;0;0;0;0;0;0 +21.8;27;42016;5.332;76;1500;0;0;0;0;0;0;0 +21.9;27;42016;5.332;76;1500;0;0;0;0;0;0;0 +22;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.1;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.2;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.3;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.4;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.5;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.6;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.7;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.8;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.9;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +23;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +23.1;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +23.2;27;42016;5.332;74;1500;0;0;0;0;0;0;0 +23.3;27;42016;5.332;74;1500;0;0;0;0;0;0;0 +23.4;27;42016;5.332;74;1500;0;0;0;0;0;0;0 +23.5;27;42016;5.332;74;1500;0;0;0;0;0;0;0 +23.6;27;42016;5.332;68;1500;0;0;0;0;0;0;0 +23.7;27;42016;5.332;63;1500;0;0;0;0;0;0;0 +23.8;27;42016;5.332;59;1500;0;0;0;0;0;0;0 +23.9;27;42016;5.332;55;1500;0;0;0;0;0;0;0 +24;27;42016;5.332;51;1500;0;0;0;0;0;0;0 +24.1;27;42016;5.332;38;1500;0;0;0;0;0;0;0 +24.2;27;42016;5.332;29;1500;0;0;0;0;0;0;0 +24.3;27;42016;5.332;21;1500;0;0;0;0;0;0;0 +24.4;27;42016;5.332;16;1500;0;0;0;0;0;0;0 +24.5;27;42016;5.332;12;1500;0;0;0;0;0;0;0 +24.6;27;42016;5.332;7;1500;0;0;0;0;0;0;0 +24.7;27;42016;5.332;4;1500;0;0;0;0;0;0;0 +24.8;27;42016;5.332;3;1500;0;0;0;0;0;0;0 +24.9;27;42016;5.332;2;1500;0;0;0;0;0;0;0 +25;27;42016;5.332;1;1500;0;0;0;0;0;0;0 +25.1;27;42016;5.332;1;1500;0;0;0;0;0;0;0 +25.2;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.3;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.4;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.5;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.6;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.7;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.8;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.9;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.1;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.2;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.3;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.4;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.5;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.6;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.7;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.8;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.9;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +27;27;42016;5.332;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs28_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs28_awgn_5G.csv new file mode 100644 index 0000000000..a6066cbd61 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs28_awgn_5G.csv @@ -0,0 +1,92 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +18;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.1;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.2;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.3;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.4;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.5;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.6;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.7;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.8;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.9;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +19;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +19.1;28;44040;5.547;1499;1500;0;0;0;0;0;0;0 +19.2;28;44040;5.547;1498;1500;0;0;0;0;0;0;0 +19.3;28;44040;5.547;1498;1500;0;0;0;0;0;0;0 +19.4;28;44040;5.547;1497;1500;0;0;0;0;0;0;0 +19.5;28;44040;5.547;1496;1500;0;0;0;0;0;0;0 +19.6;28;44040;5.547;1429;1500;0;0;0;0;0;0;0 +19.7;28;44040;5.547;1366;1500;0;0;0;0;0;0;0 +19.8;28;44040;5.547;1305;1500;0;0;0;0;0;0;0 +19.9;28;44040;5.547;1247;1500;0;0;0;0;0;0;0 +20;28;44040;5.547;1191;1500;0;0;0;0;0;0;0 +20.1;28;44040;5.547;1234;1500;0;0;0;0;0;0;0 +20.2;28;44040;5.547;1279;1500;0;0;0;0;0;0;0 +20.3;28;44040;5.547;1325;1500;0;0;0;0;0;0;0 +20.4;28;44040;5.547;1373;1500;0;0;0;0;0;0;0 +20.5;28;44040;5.547;1423;1500;0;0;0;0;0;0;0 +20.6;28;44040;5.547;1426;1500;0;0;0;0;0;0;0 +20.7;28;44040;5.547;1429;1500;0;0;0;0;0;0;0 +20.8;28;44040;5.547;1432;1500;0;0;0;0;0;0;0 +20.9;28;44040;5.547;1435;1500;0;0;0;0;0;0;0 +21;28;44040;5.547;1438;1500;0;0;0;0;0;0;0 +21.1;28;44040;5.547;1207;1500;0;0;0;0;0;0;0 +21.2;28;44040;5.547;1014;1500;0;0;0;0;0;0;0 +21.3;28;44040;5.547;851;1500;0;0;0;0;0;0;0 +21.4;28;44040;5.547;715;1500;0;0;0;0;0;0;0 +21.5;28;44040;5.547;600;1500;0;0;0;0;0;0;0 +21.6;28;44040;5.547;418;1500;0;0;0;0;0;0;0 +21.7;28;44040;5.547;290;1500;0;0;0;0;0;0;0 +21.8;28;44040;5.547;202;1500;0;0;0;0;0;0;0 +21.9;28;44040;5.547;140;1500;0;0;0;0;0;0;0 +22;28;44040;5.547;98;1500;0;0;0;0;0;0;0 +22.1;28;44040;5.547;93;1500;0;0;0;0;0;0;0 +22.2;28;44040;5.547;88;1500;0;0;0;0;0;0;0 +22.3;28;44040;5.547;83;1500;0;0;0;0;0;0;0 +22.4;28;44040;5.547;79;1500;0;0;0;0;0;0;0 +22.5;28;44040;5.547;75;1500;0;0;0;0;0;0;0 +22.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +22.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +22.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +22.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +27;28;44040;5.547;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs2_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs2_awgn_5G.csv new file mode 100644 index 0000000000..d5a802c177 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs2_awgn_5G.csv @@ -0,0 +1,62 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.1;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.1;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.4;2;2976;0.377;1486;1500;0;0;0;0;0;0;0 +-1.3;2;2976;0.377;1473;1500;0;0;0;0;0;0;0 +-1.2;2;2976;0.377;1459;1500;0;0;0;0;0;0;0 +-1.1;2;2976;0.377;1446;1500;0;0;0;0;0;0;0 +-1;2;2976;0.377;1432;1500;0;0;0;0;0;0;0 +-0.9;2;2976;0.377;1149;1500;0;0;0;0;0;0;0 +-0.8;2;2976;0.377;921;1500;0;0;0;0;0;0;0 +-0.7;2;2976;0.377;738;1500;0;0;0;0;0;0;0 +-0.6;2;2976;0.377;592;1500;0;0;0;0;0;0;0 +-0.5;2;2976;0.377;475;1500;0;0;0;0;0;0;0 +-0.4;2;2976;0.377;292;1500;0;0;0;0;0;0;0 +-0.3;2;2976;0.377;179;1500;0;0;0;0;0;0;0 +-0.2;2;2976;0.377;110;1500;0;0;0;0;0;0;0 +-0.1;2;2976;0.377;68;1500;0;0;0;0;0;0;0 +0;2;2976;0.377;42;1500;0;0;0;0;0;0;0 +0.1;2;2976;0.377;22;1500;0;0;0;0;0;0;0 +0.2;2;2976;0.377;11;1500;0;0;0;0;0;0;0 +0.3;2;2976;0.377;6;1500;0;0;0;0;0;0;0 +0.4;2;2976;0.377;3;1500;0;0;0;0;0;0;0 +0.5;2;2976;0.377;2;1500;0;0;0;0;0;0;0 +0.6;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +0.7;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +0.8;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +0.9;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.1;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.2;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.3;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.4;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.5;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.6;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.7;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.8;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.9;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +2;2;2976;0.377;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs3_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs3_awgn_5G.csv new file mode 100644 index 0000000000..9acdfe3e2f --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs3_awgn_5G.csv @@ -0,0 +1,62 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-0.9;3;3912;0.4902;1499;1500;0;0;0;0;0;0;0 +-0.8;3;3912;0.4902;1498;1500;0;0;0;0;0;0;0 +-0.7;3;3912;0.4902;1496;1500;0;0;0;0;0;0;0 +-0.6;3;3912;0.4902;1495;1500;0;0;0;0;0;0;0 +-0.5;3;3912;0.4902;1494;1500;0;0;0;0;0;0;0 +-0.4;3;3912;0.4902;1322;1500;0;0;0;0;0;0;0 +-0.3;3;3912;0.4902;1169;1500;0;0;0;0;0;0;0 +-0.2;3;3912;0.4902;1034;1500;0;0;0;0;0;0;0 +-0.1;3;3912;0.4902;915;1500;0;0;0;0;0;0;0 +0;3;3912;0.4902;809;1500;0;0;0;0;0;0;0 +0.1;3;3912;0.4902;504;1500;0;0;0;0;0;0;0 +0.2;3;3912;0.4902;314;1500;0;0;0;0;0;0;0 +0.3;3;3912;0.4902;196;1500;0;0;0;0;0;0;0 +0.4;3;3912;0.4902;122;1500;0;0;0;0;0;0;0 +0.5;3;3912;0.4902;76;1500;0;0;0;0;0;0;0 +0.6;3;3912;0.4902;37;1500;0;0;0;0;0;0;0 +0.7;3;3912;0.4902;18;1500;0;0;0;0;0;0;0 +0.8;3;3912;0.4902;9;1500;0;0;0;0;0;0;0 +0.9;3;3912;0.4902;4;1500;0;0;0;0;0;0;0 +1;3;3912;0.4902;2;1500;0;0;0;0;0;0;0 +1.1;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.2;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.3;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.4;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.5;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.6;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.7;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.8;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.9;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +2;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs4_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs4_awgn_5G.csv new file mode 100644 index 0000000000..99a1e652e5 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs4_awgn_5G.csv @@ -0,0 +1,62 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;4;4736;0.6016;1500;1500;0;0;0;0;0;0;0 +-0.9;4;4736;0.6016;1499;1500;0;0;0;0;0;0;0 +-0.8;4;4736;0.6016;1498;1500;0;0;0;0;0;0;0 +-0.7;4;4736;0.6016;1496;1500;0;0;0;0;0;0;0 +-0.6;4;4736;0.6016;1495;1500;0;0;0;0;0;0;0 +-0.5;4;4736;0.6016;1494;1500;0;0;0;0;0;0;0 +-0.4;4;4736;0.6016;1322;1500;0;0;0;0;0;0;0 +-0.3;4;4736;0.6016;1169;1500;0;0;0;0;0;0;0 +-0.2;4;4736;0.6016;1034;1500;0;0;0;0;0;0;0 +-0.1;4;4736;0.6016;915;1500;0;0;0;0;0;0;0 +0;4;4736;0.6016;809;1500;0;0;0;0;0;0;0 +0.1;4;4736;0.6016;504;1500;0;0;0;0;0;0;0 +0.2;4;4736;0.6016;314;1500;0;0;0;0;0;0;0 +0.3;4;4736;0.6016;196;1500;0;0;0;0;0;0;0 +0.4;4;4736;0.6016;122;1500;0;0;0;0;0;0;0 +0.5;4;4736;0.6016;76;1500;0;0;0;0;0;0;0 +0.6;4;4736;0.6016;37;1500;0;0;0;0;0;0;0 +0.7;4;4736;0.6016;18;1500;0;0;0;0;0;0;0 +0.8;4;4736;0.6016;9;1500;0;0;0;0;0;0;0 +0.9;4;4736;0.6016;4;1500;0;0;0;0;0;0;0 +1;4;4736;0.6016;2;1500;0;0;0;0;0;0;0 +1.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs5_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs5_awgn_5G.csv new file mode 100644 index 0000000000..1d2c479112 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs5_awgn_5G.csv @@ -0,0 +1,62 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.9;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.8;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.7;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.6;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.5;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.4;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.3;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.2;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.1;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +0;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +0.1;5;5888;0.7402;1499;1500;0;0;0;0;0;0;0 +0.2;5;5888;0.7402;1499;1500;0;0;0;0;0;0;0 +0.3;5;5888;0.7402;1498;1500;0;0;0;0;0;0;0 +0.4;5;5888;0.7402;1498;1500;0;0;0;0;0;0;0 +0.5;5;5888;0.7402;1497;1500;0;0;0;0;0;0;0 +0.6;5;5888;0.7402;1323;1500;0;0;0;0;0;0;0 +0.7;5;5888;0.7402;1170;1500;0;0;0;0;0;0;0 +0.8;5;5888;0.7402;1034;1500;0;0;0;0;0;0;0 +0.9;5;5888;0.7402;914;1500;0;0;0;0;0;0;0 +1;5;5888;0.7402;808;1500;0;0;0;0;0;0;0 +1.1;5;5888;0.7402;513;1500;0;0;0;0;0;0;0 +1.2;5;5888;0.7402;326;1500;0;0;0;0;0;0;0 +1.3;5;5888;0.7402;207;1500;0;0;0;0;0;0;0 +1.4;5;5888;0.7402;131;1500;0;0;0;0;0;0;0 +1.5;5;5888;0.7402;83;1500;0;0;0;0;0;0;0 +1.6;5;5888;0.7402;48;1500;0;0;0;0;0;0;0 +1.7;5;5888;0.7402;28;1500;0;0;0;0;0;0;0 +1.8;5;5888;0.7402;16;1500;0;0;0;0;0;0;0 +1.9;5;5888;0.7402;9;1500;0;0;0;0;0;0;0 +2;5;5888;0.7402;5;1500;0;0;0;0;0;0;0 +2.1;5;5888;0.7402;2;1500;0;0;0;0;0;0;0 +2.2;5;5888;0.7402;1;1500;0;0;0;0;0;0;0 +2.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.1;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.2;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.1;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.2;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs6_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs6_awgn_5G.csv new file mode 100644 index 0000000000..42a0cd6fb1 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs6_awgn_5G.csv @@ -0,0 +1,62 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.9;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.8;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.7;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.6;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.5;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.4;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.3;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.2;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.2;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.3;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.4;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.5;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.6;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.7;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.8;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.9;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +1.1;6;6912;0.877;1493;1500;0;0;0;0;0;0;0 +1.2;6;6912;0.877;1487;1500;0;0;0;0;0;0;0 +1.3;6;6912;0.877;1480;1500;0;0;0;0;0;0;0 +1.4;6;6912;0.877;1473;1500;0;0;0;0;0;0;0 +1.5;6;6912;0.877;1467;1500;0;0;0;0;0;0;0 +1.6;6;6912;0.877;1117;1500;0;0;0;0;0;0;0 +1.7;6;6912;0.877;850;1500;0;0;0;0;0;0;0 +1.8;6;6912;0.877;648;1500;0;0;0;0;0;0;0 +1.9;6;6912;0.877;493;1500;0;0;0;0;0;0;0 +2;6;6912;0.877;376;1500;0;0;0;0;0;0;0 +2.1;6;6912;0.877;254;1500;0;0;0;0;0;0;0 +2.2;6;6912;0.877;172;1500;0;0;0;0;0;0;0 +2.3;6;6912;0.877;116;1500;0;0;0;0;0;0;0 +2.4;6;6912;0.877;79;1500;0;0;0;0;0;0;0 +2.5;6;6912;0.877;53;1500;0;0;0;0;0;0;0 +2.6;6;6912;0.877;32;1500;0;0;0;0;0;0;0 +2.7;6;6912;0.877;19;1500;0;0;0;0;0;0;0 +2.8;6;6912;0.877;11;1500;0;0;0;0;0;0;0 +2.9;6;6912;0.877;7;1500;0;0;0;0;0;0;0 +3;6;6912;0.877;4;1500;0;0;0;0;0;0;0 +3.1;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.2;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.3;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.6;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.7;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.8;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.9;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.1;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.2;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.3;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.6;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.7;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.8;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.9;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs7_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs7_awgn_5G.csv new file mode 100644 index 0000000000..ac98d0ae10 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs7_awgn_5G.csv @@ -0,0 +1,62 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +2.1;7;8912;1.0273;1492;1500;0;0;0;0;0;0;0 +2.2;7;8912;1.0273;1484;1500;0;0;0;0;0;0;0 +2.3;7;8912;1.0273;1477;1500;0;0;0;0;0;0;0 +2.4;7;8912;1.0273;1469;1500;0;0;0;0;0;0;0 +2.5;7;8912;1.0273;1462;1500;0;0;0;0;0;0;0 +2.6;7;8912;1.0273;1159;1500;0;0;0;0;0;0;0 +2.7;7;8912;1.0273;919;1500;0;0;0;0;0;0;0 +2.8;7;8912;1.0273;729;1500;0;0;0;0;0;0;0 +2.9;7;8912;1.0273;578;1500;0;0;0;0;0;0;0 +3;7;8912;1.0273;458;1500;0;0;0;0;0;0;0 +3.1;7;8912;1.0273;319;1500;0;0;0;0;0;0;0 +3.2;7;8912;1.0273;222;1500;0;0;0;0;0;0;0 +3.3;7;8912;1.0273;155;1500;0;0;0;0;0;0;0 +3.4;7;8912;1.0273;108;1500;0;0;0;0;0;0;0 +3.5;7;8912;1.0273;75;1500;0;0;0;0;0;0;0 +3.6;7;8912;1.0273;48;1500;0;0;0;0;0;0;0 +3.7;7;8912;1.0273;30;1500;0;0;0;0;0;0;0 +3.8;7;8912;1.0273;19;1500;0;0;0;0;0;0;0 +3.9;7;8912;1.0273;12;1500;0;0;0;0;0;0;0 +4;7;8912;1.0273;8;1500;0;0;0;0;0;0;0 +4.1;7;8912;1.0273;4;1500;0;0;0;0;0;0;0 +4.2;7;8912;1.0273;2;1500;0;0;0;0;0;0;0 +4.3;7;8912;1.0273;1;1500;0;0;0;0;0;0;0 +4.4;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.5;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.6;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.7;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.8;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.9;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +5;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs8_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs8_awgn_5G.csv new file mode 100644 index 0000000000..4c202068f1 --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs8_awgn_5G.csv @@ -0,0 +1,62 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +3.1;8;9224;1.1758;1464;1500;0;0;0;0;0;0;0 +3.2;8;9224;1.1758;1429;1500;0;0;0;0;0;0;0 +3.3;8;9224;1.1758;1394;1500;0;0;0;0;0;0;0 +3.4;8;9224;1.1758;1361;1500;0;0;0;0;0;0;0 +3.5;8;9224;1.1758;1328;1500;0;0;0;0;0;0;0 +3.6;8;9224;1.1758;973;1500;0;0;0;0;0;0;0 +3.7;8;9224;1.1758;713;1500;0;0;0;0;0;0;0 +3.8;8;9224;1.1758;522;1500;0;0;0;0;0;0;0 +3.9;8;9224;1.1758;382;1500;0;0;0;0;0;0;0 +4;8;9224;1.1758;280;1500;0;0;0;0;0;0;0 +4.1;8;9224;1.1758;190;1500;0;0;0;0;0;0;0 +4.2;8;9224;1.1758;129;1500;0;0;0;0;0;0;0 +4.3;8;9224;1.1758;87;1500;0;0;0;0;0;0;0 +4.4;8;9224;1.1758;59;1500;0;0;0;0;0;0;0 +4.5;8;9224;1.1758;40;1500;0;0;0;0;0;0;0 +4.6;8;9224;1.1758;20;1500;0;0;0;0;0;0;0 +4.7;8;9224;1.1758;10;1500;0;0;0;0;0;0;0 +4.8;8;9224;1.1758;5;1500;0;0;0;0;0;0;0 +4.9;8;9224;1.1758;2;1500;0;0;0;0;0;0;0 +5;8;9224;1.1758;1;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs9_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs9_awgn_5G.csv new file mode 100644 index 0000000000..adfb19b6de --- /dev/null +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs9_awgn_5G.csv @@ -0,0 +1,64 @@ +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.7;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 +3.8;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 +3.9;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 +4;9;10504;1.3262;1498;1500;0;0;0;0;0;0;0 +4.1;9;10504;1.3262;1339;1500;0;0;0;0;0;0;0 +4.2;9;10504;1.3262;1196;1500;0;0;0;0;0;0;0 +4.3;9;10504;1.3262;1068;1500;0;0;0;0;0;0;0 +4.4;9;10504;1.3262;955;1500;0;0;0;0;0;0;0 +4.5;9;10504;1.3262;853;1500;0;0;0;0;0;0;0 +4.6;9;10504;1.3262;552;1500;0;0;0;0;0;0;0 +4.7;9;10504;1.3262;357;1500;0;0;0;0;0;0;0 +4.8;9;10504;1.3262;231;1500;0;0;0;0;0;0;0 +4.9;9;10504;1.3262;149;1500;0;0;0;0;0;0;0 +5;9;10504;1.3262;96;1500;0;0;0;0;0;0;0 +5.1;9;10504;1.3262;0;1500;0;0;0;0;0;0;0 +5.2;9;10504;1.3262;0;1500;0;0;0;0;0;0;0 diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index 2b2181177d..35983582bc 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -273,6 +273,10 @@ typedef struct { bool index_has_dci[16]; int active_harq_sfn_slot; int active_uci_sfn_slot; + int crc_rx_ind_sfn_slot; + int num_srs; + int num_harqs; + int num_csi_reports; } nr_emulated_l1_t; typedef struct { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 4bc074df56..6c44a028ae 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2167,6 +2167,9 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in } N_UCI = O_SR + O_ACK + O_CSI; + mac->nr_ue_emul_l1.num_srs = O_SR; + mac->nr_ue_emul_l1.num_harqs = O_ACK; + mac->nr_ue_emul_l1.num_csi_reports = O_CSI; // do no transmit pucch if only SR scheduled and it is negative if ((O_ACK + O_CSI) == 0 && pucch->sr_payload == 0) @@ -2192,7 +2195,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in pucch, pucch_pdu, O_SR, O_ACK, O_CSI); - LOG_I(NR_MAC,"Configuring pucch, is_common = %d and format %d\n",pucch->is_common, pucch_pdu->format_type); + LOG_D(NR_MAC,"Configuring pucch, is_common = %d\n",pucch->is_common); nr_scheduled_response_t scheduled_response; fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index cb76c22292..9db8644201 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -435,7 +435,7 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t if (bler_stats->rd2_bler > nrmac->dl_rd2_bler_threshold && old_mcs > 6) { new_mcs -= 2; } else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) {*/ - if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs && dtx > 9) + if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs) // TODO: dtx > 9 needs to be updated to merge with OAI develop branch new_mcs += 1; else if (bler_stats->bler > nrmac->dl_bler_target_upper && old_mcs > 6) new_mcs -= 1; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 805c2dd2a8..cfb24d5654 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -38,6 +38,7 @@ #include "SCHED_NR_UE/fapi_nr_ue_l1.h" #include "executables/softmodem-common.h" #include "openair2/RRC/NR_UE/rrc_proto.h" +#include "openair2/RRC/NR_UE/rrc_vars.h" #include "openair2/GNB_APP/L1_nr_paramdef.h" #include "openair2/GNB_APP/gnb_paramdef.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h" @@ -60,7 +61,17 @@ queue_t nr_dl_tti_req_queue; queue_t nr_tx_req_queue; queue_t nr_ul_dci_req_queue; queue_t nr_ul_tti_req_queue; -queue_t nr_wait_ul_tti_req_queue; + +static slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT]; + +static int get_mcs_from_sinr(float sinr); +static int get_cqi_from_mcs(void); +static void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int sf, int index); +static bool did_drop_transport_block(int slot, uint16_t rnti); +static float get_bler_val(uint8_t mcs, int sinr); +static bool should_drop_transport_block(int slot, uint16_t rnti); +static void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request); +static inline bool is_channel_modeling(void); void nrue_init_standalone_socket(int tx_port, int rx_port) { @@ -447,6 +458,7 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ static void fill_rx_ind(nfapi_nr_pdu_t *pdu_list, fapi_nr_rx_indication_t *rx_ind, int pdu_idx, int pdu_type) { + NR_UE_MAC_INST_t *mac = get_mac_inst(0); AssertFatal(pdu_list->num_TLV < sizeof(pdu_list->TLVs) / sizeof(pdu_list->TLVs[0]), "Num TLVs exceeds TLV array size"); int length = 0; for (int j = 0; j < pdu_list->num_TLV; j++) @@ -468,7 +480,12 @@ static void fill_rx_ind(nfapi_nr_pdu_t *pdu_list, fapi_nr_rx_indication_t *rx_in memcpy(pdu, ptr, pdu_list->TLVs[j].length); pdu += pdu_list->TLVs[j].length; } - rx_ind->rx_indication_body[pdu_idx].pdsch_pdu.ack_nack = 1; + bool ack_nack = true; + if (mac->ra.ra_state >= RA_SUCCEEDED && should_drop_transport_block(rx_ind->slot, mac->crnti)) + { + ack_nack = false; + } + rx_ind->rx_indication_body[pdu_idx].pdsch_pdu.ack_nack = ack_nack; rx_ind->rx_indication_body[pdu_idx].pdsch_pdu.pdu_length = length; rx_ind->rx_indication_body[pdu_idx].pdu_type = pdu_type; @@ -598,82 +615,36 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n dl_info->slot = ul_dci_req->Slot; } -static nfapi_nr_uci_indication_t *multiplex_uci_ind(NR_UE_MAC_INST_t *mac, int sfn_slot) +static bool send_crc_ind_and_rx_ind(int sfn_slot) { - int num_0_1 = 0; - int num_2_3_4 = 0; - int num_items_in_queue = nr_uci_ind_queue.num_items; + bool sent_crc_rx = true; - nfapi_nr_uci_indication_t *uci_ind = MALLOC(sizeof(*uci_ind)); - uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION; - uci_ind->num_ucis = 0; - uci_ind->uci_list = CALLOC(num_items_in_queue, sizeof(*uci_ind->uci_list)); - for (int i = 0; i < num_items_in_queue; i++) - { - nfapi_nr_uci_indication_t *queued_uci_ind = unqueue_matching(&nr_uci_ind_queue, - MAX_QUEUE_SIZE, - sfn_slot_matcher, - &sfn_slot); - if (!queued_uci_ind) - { - LOG_I(NR_MAC, "There was not a matching UCI with sfn %d, slot %d in queue\n", - NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); - break; - } + nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); + nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); - /* In openair1/SCHED_NR_UE/fapi_nr_ue_l1.c nr_ue_schedule_response_stub(), the - number of UCIs is hard coded to 1. This is why we always use index 0 of the - queued UCI indication to fill the new multiplexed UCI indication */ - AssertFatal(queued_uci_ind->num_ucis == 1, "The number of UCIs from de-queueud UCI is not 1, its %d\n", - queued_uci_ind->num_ucis); - uci_ind->uci_list[i].pdu_type = queued_uci_ind->uci_list[0].pdu_type; - uci_ind->uci_list[i].pdu_size = queued_uci_ind->uci_list[0].pdu_size; - if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) - { - num_0_1++; - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[i].pucch_pdu_format_0_1; - nfapi_nr_uci_pucch_pdu_format_0_1_t *queued_pdu_0_1 = &queued_uci_ind->uci_list[0].pucch_pdu_format_0_1; - pdu_0_1->handle = queued_pdu_0_1->handle; - pdu_0_1->rnti = queued_pdu_0_1->rnti; - pdu_0_1->pucch_format = queued_pdu_0_1->pucch_format; - pdu_0_1->ul_cqi = queued_pdu_0_1->ul_cqi; - pdu_0_1->timing_advance = queued_pdu_0_1->timing_advance; - pdu_0_1->rssi = queued_pdu_0_1->rssi; - } - if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) - { - num_2_3_4++; - nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[i].pucch_pdu_format_2_3_4; - nfapi_nr_uci_pucch_pdu_format_2_3_4_t *queued_pdu_2_3_4 = &queued_uci_ind->uci_list[0].pucch_pdu_format_2_3_4; - pdu_2_3_4->handle = queued_pdu_2_3_4->handle; - pdu_2_3_4->rnti = queued_pdu_2_3_4->rnti; - pdu_2_3_4->pucch_format = queued_pdu_2_3_4->pucch_format; - pdu_2_3_4->ul_cqi = queued_pdu_2_3_4->ul_cqi; - pdu_2_3_4->timing_advance = queued_pdu_2_3_4->timing_advance; - pdu_2_3_4->rssi = queued_pdu_2_3_4->rssi; - pdu_2_3_4->pduBitmap = queued_pdu_2_3_4->pduBitmap; - pdu_2_3_4->csi_part1.csi_part1_bit_len = queued_pdu_2_3_4->csi_part1.csi_part1_bit_len; - AssertFatal(!pdu_2_3_4->csi_part1.csi_part1_payload, "pdu_2_3_4->csi_part1.csi_part1_payload != NULL\n"); - pdu_2_3_4->csi_part1.csi_part1_payload = CALLOC((int)((pdu_2_3_4->csi_part1.csi_part1_bit_len / 8) + 1), - sizeof(pdu_2_3_4->csi_part1.csi_part1_payload)); - memcpy(pdu_2_3_4->csi_part1.csi_part1_payload, queued_pdu_2_3_4->csi_part1.csi_part1_payload, - sizeof(*queued_pdu_2_3_4->csi_part1.csi_part1_payload)); - } - uci_ind->num_ucis = num_2_3_4 + num_0_1; - - free(queued_uci_ind->uci_list); - queued_uci_ind->uci_list = NULL; - free(queued_uci_ind); - queued_uci_ind = NULL; - } - - if (num_2_3_4 > 0 && num_0_1 > 0) - { - LOG_E(NR_MAC, "We have a harq ACK/NACK while CSI reporting as seprate UCIs but we shouldn't. " - "We multiplex before queueing the UCI!!!\n"); - abort(); - } - return uci_ind; + if (crc_ind && crc_ind->number_crcs > 0) + { + NR_UL_IND_t UL_INFO = { + .crc_ind = *crc_ind, + }; + send_nsa_standalone_msg(&UL_INFO, crc_ind->header.message_id); + free(crc_ind->crc_list); + free(crc_ind); + } + if (rx_ind && rx_ind->number_of_pdus > 0) + { + NR_UL_IND_t UL_INFO = { + .rx_ind = *rx_ind, + }; + send_nsa_standalone_msg(&UL_INFO, rx_ind->header.message_id); + free(rx_ind->pdu_list); + free(rx_ind); + } + else + { + sent_crc_rx = false; + } + return sent_crc_rx; } static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_ul_tti_request_t *ul_tti_req) @@ -685,6 +656,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n AssertFatal(num_pdus <= sizeof(ul_tti_req->pdus_list) / sizeof(ul_tti_req->pdus_list[0]), "Too many pdus %d in ul_tti_req\n", num_pdus); + bool sent_crc_rx = send_crc_ind_and_rx_ind(sfn_slot); bool sent_uci = false; for (int i = 0; i < num_pdus; i++) { @@ -696,8 +668,16 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n AssertFatal(nr_uci_ind_queue.num_items >= 0, "Invalid num_items in UCI_ind queue %lu\n", nr_uci_ind_queue.num_items); - nfapi_nr_uci_indication_t *uci_ind = multiplex_uci_ind(mac, sfn_slot); - + nfapi_nr_uci_indication_t *uci_ind = unqueue_matching(&nr_uci_ind_queue, + MAX_QUEUE_SIZE, + sfn_slot_matcher, + &sfn_slot); + if (!uci_ind) + { + LOG_I(NR_MAC, "There was not a matching UCI with sfn %d, slot %d in queue\n", + NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); + return; + } if (uci_ind && uci_ind->num_ucis > 0) { uci_ind->sfn = ul_tti_req->SFN; @@ -712,22 +692,12 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n if (pdu_list->pucch_pdu.sr_flag) { pdu_0_1->pduBitmap = 1; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR + if (pdu_list->pucch_pdu.bit_len_harq > 0) + pdu_0_1->pduBitmap = 3; pdu_0_1->sr = CALLOC(1, sizeof(*pdu_0_1->sr)); pdu_0_1->sr->sr_confidence_level = 0; pdu_0_1->sr->sr_indication = 1; } - if (pdu_list->pucch_pdu.bit_len_harq > 0) - { - pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR - pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); - pdu_0_1->harq->num_harq = 1; - pdu_0_1->harq->harq_confidence_level = 0; - pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); - for (int k = 0; k < pdu_0_1->harq->num_harq; k++) - { - pdu_0_1->harq->harq_list[k].harq_value = 0; - } - } } if (uci_ind->uci_list[j].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) { @@ -742,6 +712,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n } if (pdu_list->pucch_pdu.bit_len_harq > 0) { + pdu_2_3_4->pduBitmap = 6; if (pdu_list->pucch_pdu.sr_flag) { pdu_2_3_4->pduBitmap = 7; @@ -770,9 +741,9 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n } } } - if (!sent_uci) + if (!sent_uci && !sent_crc_rx) { - LOG_E(NR_MAC, "UCI ind not sent\n"); + LOG_E(NR_MAC, "UCI and CRC_RX ind not sent\n"); if (!put_queue(&nr_ul_tti_req_queue, ul_tti_req)) { LOG_E(NR_PHY, "put_queue failed for ul_tti_req.\n"); @@ -878,7 +849,7 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, else { if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort(); - LOG_E(NR_MAC, "Error! All indications were NULL\n"); + LOG_D(NR_MAC, "All indications were NULL in %s\n", __FUNCTION__); return; } @@ -964,6 +935,10 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message in sfn/slot %d %d. \n", dl_tti_request->SFN, dl_tti_request->Slot); + + if (is_channel_modeling()) + save_pdsch_pdu_for_crnti(dl_tti_request); + if (!put_queue(&nr_dl_tti_req_queue, dl_tti_request)) { LOG_E(NR_PHY, "put_queue failed for dl_tti_request.\n"); @@ -1024,9 +999,11 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d.\n", ul_tti_request->SFN, ul_tti_request->Slot); - if (ul_tti_request && ul_tti_request->n_pdus > 0) + if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) { - check_and_process_dci(NULL, NULL, NULL, ul_tti_request); + LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); + nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_ul_tti_req_queue, ul_tti_request); + free(evicted_ul_tti_req); } break; } @@ -1039,6 +1016,35 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea return; } +static void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request) +{ + int count_sent = 0; + NR_UE_MAC_INST_t *mac = get_mac_inst(0); + int number_of_pdu = dl_tti_request->dl_tti_request_body.nPDUs; + if (number_of_pdu <= 0) + { + LOG_E(NR_MAC, "%s: dl_tti_request pdu size <= 0\n", __FUNCTION__); + abort(); + } + + for (int i = 0; i < number_of_pdu; i++) + { + const nfapi_nr_dl_tti_request_pdu_t *pdu_list = &dl_tti_request->dl_tti_request_body.dl_tti_pdu_list[i]; + + if (pdu_list->PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) + { + const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu = &pdu_list->pdsch_pdu.pdsch_pdu_rel15; + if (pdsch_pdu->rnti == mac->crnti && mac->ra.ra_state == RA_SUCCEEDED) + { + read_channel_param(pdsch_pdu, dl_tti_request->Slot, count_sent); + count_sent++; + LOG_D(NR_MAC, "pdsch_pdu->rnti %x mac->crnti %x mac->ra.ra_state %d count_sent %d\n", + pdsch_pdu->rnti, mac->crnti, mac->ra.ra_state, count_sent); + } + } + } +} + void *nrue_standalone_pnf_task(void *context) { struct sockaddr_in server_address; @@ -1087,6 +1093,7 @@ void *nrue_standalone_pnf_task(void *context) nr_phy_channel_params_t *ch_info = CALLOC(1, sizeof(*ch_info)); memcpy(ch_info, buffer, sizeof(*ch_info)); + slot_rnti_mcs[NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)].sinr = ch_info->sinr; LOG_D(NR_PHY, "Received_SINR = %f, sfn:slot %d:%d\n", ch_info->sinr, NFAPI_SFNSLOT2SFN(ch_info->sfn_slot), NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)); @@ -1176,7 +1183,6 @@ void update_harq_status(module_id_t module_id, uint8_t harq_pid, uint8_t ack_nac } } - int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ NR_UE_L2_STATE_t ret; @@ -1389,3 +1395,241 @@ void RCconfig_nr_ue_L1(void) { } } } + +static int get_mcs_from_sinr(float sinr) +{ + if (sinr < (nr_bler_data[0].bler_table[0][0])) + { + LOG_I(NR_MAC, "The SINR found is smaller than first MCS table\n"); + return 0; + } + + if (sinr > (nr_bler_data[NUM_MCS-1].bler_table[nr_bler_data[NUM_MCS-1].length - 1][0])) + { + LOG_I(NR_MAC, "The SINR found is larger than last MCS table\n"); + return NUM_MCS-1; + } + + for (int n = NUM_MCS-1; n >= 0; n--) + { + CHECK_INDEX(nr_bler_data, n); + float largest_sinr = (nr_bler_data[n].bler_table[nr_bler_data[n].length - 1][0]); + float smallest_sinr = (nr_bler_data[n].bler_table[0][0]); + if (sinr < largest_sinr && sinr > smallest_sinr) + { + LOG_I(NR_MAC, "The SINR found in MCS %d table\n", n); + return n; + } + } + LOG_E(NR_MAC, "Unable to get an MCS value.\n"); + abort(); +} + +static int get_cqi_from_mcs(void) +{ + static const int mcs_to_cqi[] = {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, + 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15}; + assert(NUM_ELEMENTS(mcs_to_cqi) == NUM_MCS); + int slot = 0; + while (slot < NUM_NFAPI_SLOT) + { + if (slot_rnti_mcs[slot].latest) + { + int num_pdus = slot_rnti_mcs[slot].num_pdus; + if (num_pdus <= 0) + { + LOG_E(NR_MAC, "%s: slot_rnti_mcs[%d].num_pdus = 0\n", __FUNCTION__, slot); + abort(); + } + + CHECK_INDEX(slot_rnti_mcs[slot].mcs, num_pdus); + int mcs = get_mcs_from_sinr(slot_rnti_mcs[slot].sinr); + CHECK_INDEX(mcs_to_cqi, mcs); + int cqi = mcs_to_cqi[mcs]; + LOG_I(NR_MAC, "SINR: %f -> MCS: %d -> CQI: %d\n", slot_rnti_mcs[slot].sinr, mcs, cqi); + return cqi; + } + slot++; + } + LOG_E(NR_MAC, "Unable to get CQI value because no MCS found\n"); + abort(); +} + +static void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int slot, int index) +{ + if (pdu == NULL) + { + LOG_E(NR_MAC,"PDU NULL\n"); + abort(); + } + + /* This function is executed for every pdsch pdu type in a dl_tti_request. We save + the assocaited MCS and RNTI value for each. The 'index' passed in is a count of + how many times we have called this function for a particular dl_tti_request. It + allows us to save MCS/RNTI data in correct indicies when multiple pdsch pdu's are received.*/ + for (int i = 0; i < NUM_NFAPI_SLOT; i++) + { + slot_rnti_mcs[i].latest = false; + } + + CHECK_INDEX(slot_rnti_mcs[slot].rnti, index); + CHECK_INDEX(slot_rnti_mcs[slot].mcs, index); + CHECK_INDEX(slot_rnti_mcs[slot].drop_flag, index); + slot_rnti_mcs[slot].rnti[index] = pdu->rnti; + slot_rnti_mcs[slot].mcs[index] = pdu->mcsIndex[0]; + slot_rnti_mcs[slot].rvIndex[index] = pdu->rvIndex[0]; + slot_rnti_mcs[slot].drop_flag[index] = false; + slot_rnti_mcs[slot].num_pdus = index+1; //index starts at 0 so we incrament to get num of pdus + slot_rnti_mcs[slot].latest = true; + LOG_I(NR_MAC, "Adding MCS %d and RNTI %x for slot_rnti_mcs[%d]\n", slot_rnti_mcs[slot].mcs[index], slot_rnti_mcs[slot].rnti[index], slot); + + return; +} + +static bool did_drop_transport_block(int slot, uint16_t rnti) +{ + int num_pdus = slot_rnti_mcs[slot].num_pdus; + if (num_pdus <= 0) + { + LOG_E(MAC, "Problem, the PDU size is <= 0. We dropped this packet\n"); + return true; + } + CHECK_INDEX(slot_rnti_mcs[slot].rnti, num_pdus); + CHECK_INDEX(slot_rnti_mcs[slot].drop_flag, num_pdus); + for (int n = 0; n < num_pdus; n++) + { + if (slot_rnti_mcs[slot].rnti[n] == rnti && slot_rnti_mcs[slot].drop_flag[n]) + { + return true; + } + } + return false; +} + +static float get_bler_val(uint8_t mcs, int sinr) +{ + // 4th col = dropped packets, 5th col = total packets + float bler_val = 0.0; + CHECK_INDEX(nr_bler_data, mcs); + LOG_I(NR_MAC, "sinr %d min %d max %d\n", sinr, + (int)(nr_bler_data[mcs].bler_table[0][0] * 10), + (int)(nr_bler_data[mcs].bler_table[nr_bler_data[mcs].length - 1][0] * 10) + ); + + if (sinr < (int)(nr_bler_data[mcs].bler_table[0][0] * 10)) + { + LOG_I(NR_MAC, "MCS %d table. SINR is smaller than lowest SINR, bler_val is set based on lowest SINR in table\n", mcs); + bler_val = nr_bler_data[mcs].bler_table[0][4] / nr_bler_data[mcs].bler_table[0][5]; + return bler_val; + } + if (sinr > (int)(nr_bler_data[mcs].bler_table[nr_bler_data[mcs].length - 1][0] * 10)) + { + LOG_I(NR_MAC, "MCS %d table. SINR is greater than largest SINR. bler_val is set based on largest SINR in table\n", mcs); + bler_val = nr_bler_data[mcs].bler_table[(nr_bler_data[mcs].length - 1)][4] / nr_bler_data[mcs].bler_table[(nr_bler_data[mcs].length - 1)][5]; + return bler_val; + } + // Loop through bler table to find sinr_index + for (int i = 0; i < nr_bler_data[mcs].length; i++) + { + int temp_sinr = (int)(nr_bler_data[mcs].bler_table[i][0] * 10); + if (temp_sinr == sinr) + { + bler_val = nr_bler_data[mcs].bler_table[i][4] / nr_bler_data[mcs].bler_table[i][5]; + return bler_val; + } + // Linear interpolation when SINR is between indices + if (temp_sinr > sinr) + { + float bler_val1 = nr_bler_data[mcs].bler_table[i - 1][4] / nr_bler_data[mcs].bler_table[i - 1][5]; + float bler_val2 = nr_bler_data[mcs].bler_table[i][4] / nr_bler_data[mcs].bler_table[i][5]; + LOG_I(NR_MAC, "sinr %d min %f max %f\n", sinr, bler_val1, bler_val2); + return ((bler_val1 + bler_val2) / 2); + } + } + LOG_E(NR_MAC, "NO SINR INDEX FOUND!\n"); + abort(); + +} + +static inline bool is_channel_modeling(void) +{ + /* TODO: For now we enable channel modeling based on the node_number. + Replace with a command line option to enable/disable channel modeling. + The LTE UE will crash when channel modeling is conducted for NSA + mode. It does not crash for LTE mode. We have not implemented channel + modeling for NSA mode yet. For now, we ensure only do do chanel modeling + in LTE mode. */ + return get_softmodem_params()->node_number == 0 && !get_softmodem_params()->nsa; +} + +static bool should_drop_transport_block(int slot, uint16_t rnti) +{ + if (!is_channel_modeling()) + { + return false; + } + + /* We want to avoid dropping setup messages because this would be pathological. + This assumes were in standalone_pnf mode where + UE_rrc_inst[0] is module_id = 0 and Info[0] is eNB_index = 0. */ + NR_UE_STATE_t state = NR_UE_rrc_inst[0].Info[0].State; + if (state < NR_RRC_CONNECTED) + { + LOG_I(NR_MAC, "Not dropping because state: %d", state); + return false; + } + + /* Get block error rate (bler_val) from table based on every saved + MCS and SINR to be used as the cutoff rate for dropping packets. + Generate random uniform vairable to compare against bler_val. */ + int num_pdus = slot_rnti_mcs[slot].num_pdus; + assert(slot < 20 && slot >= 0); + LOG_I(NR_MAC, "rnti: %x num_pdus %d state %d slot %u sinr %f\n", + rnti, num_pdus, state, slot, slot_rnti_mcs[slot].sinr); + assert(num_pdus > 0); + CHECK_INDEX(slot_rnti_mcs[slot].rnti, num_pdus); + CHECK_INDEX(slot_rnti_mcs[slot].mcs, num_pdus); + CHECK_INDEX(slot_rnti_mcs[slot].drop_flag, num_pdus); + int n = 0; + uint8_t mcs = 99; + for (n = 0; n < num_pdus; n++) + { + if (slot_rnti_mcs[slot].rnti[n] == rnti) + { + mcs = slot_rnti_mcs[slot].mcs[n]; + } + if (mcs != 99) + { + /* Use MCS to get the bler value. Since there can be multiple MCS + values for a particular slot, we verify that all PDUs are not + flagged for drop before returning. If even one is flagged for drop + we return immediately because we drop the entire packet. */ + + LOG_I(NR_MAC, "rnti: %x mcs %u slot %u sinr %f\n", + slot_rnti_mcs[slot].rnti[n], mcs, slot, slot_rnti_mcs[slot].sinr); + + float bler_val; + if (slot_rnti_mcs[slot].rvIndex[n] != 0) + bler_val = 0; + else + bler_val = get_bler_val(mcs, ((int)(slot_rnti_mcs[slot].sinr * 10))); + double drop_cutoff = ((double) rand() / (RAND_MAX)); + assert(drop_cutoff <= 1); + LOG_I(NR_MAC, "SINR = %f, Bler_val = %f, MCS = %"PRIu8"\n", slot_rnti_mcs[slot].sinr, bler_val, slot_rnti_mcs[slot].mcs[n]); + if (drop_cutoff <= bler_val) + { + slot_rnti_mcs[slot].drop_flag[n] = true; + LOG_D(NR_MAC, "We are dropping this packet. Bler_val = %f, MCS = %"PRIu8", slot = %d\n", bler_val, slot_rnti_mcs[slot].mcs[n], slot); + return slot_rnti_mcs[slot].drop_flag[n]; + } + } + + } + + if (mcs == 99) + { + LOG_E(NR_MAC, "NO MCS Found for rnti %x. slot_rnti_mcs[%d].mcs[%d] \n", rnti, slot, n); + abort(); + } + return false; +} diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 039b919b12..d3b12abc2b 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -41,6 +41,11 @@ #include "nfapi_nr_interface_scf.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" +#define NUM_MCS 29 +#define NUM_SINR 100 +#define NUM_BLER_COL 13 +#define NUM_NFAPI_SLOT 20 + typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t; typedef struct nr_phy_channel_params_t @@ -50,6 +55,27 @@ typedef struct nr_phy_channel_params_t // Incomplete, need all channel parameters } nr_phy_channel_params_t; +typedef struct +{ + uint8_t slot; + uint16_t rnti[256]; + uint8_t mcs[256]; + uint8_t rvIndex[256]; + float sinr; + uint16_t num_pdus; + bool drop_flag[256]; + bool latest; + +} slot_rnti_mcs_s; + +typedef struct +{ + uint16_t length; + float bler_table[NUM_SINR][NUM_BLER_COL]; +} nr_bler_struct; + +extern nr_bler_struct nr_bler_data[NUM_MCS]; + typedef enum { ONLY_PUSCH, NOT_PUSCH, diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index f910ff68d4..3670de2516 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -2826,7 +2826,6 @@ void start_oai_nrue_threads() init_queue(&nr_tx_req_queue); init_queue(&nr_ul_dci_req_queue); init_queue(&nr_ul_tti_req_queue); - init_queue(&nr_wait_ul_tti_req_queue); if (sem_init(&sfn_slot_semaphore, 0, 0) != 0) { diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 62d9167251..510fbff230 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -51,7 +51,6 @@ extern queue_t nr_dl_tti_req_queue; extern queue_t nr_tx_req_queue; extern queue_t nr_ul_dci_req_queue; extern queue_t nr_ul_tti_req_queue; -extern queue_t nr_wait_ul_tti_req_queue; // // main_rrc.c // From cfc2311a96270748411bc8ae0cb6fcd3e30543d7 Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 25 Jan 2022 23:15:06 +0000 Subject: [PATCH 405/883] Merge branch 'episys/david/adding_logs_for_timing_analysis' into 'episys/master-nsa' Added logs for timing analysis. See merge request aburger/openairinterface5g!106 --- nfapi/oai_integration/nfapi_vnf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 0fed6b33d0..56ad438e0e 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -1924,8 +1924,7 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { - //LOG_I(PHY, "sfn:%d,slot:%d\n",dl_config_req->SFN,dl_config_req->Slot); - //printf("\nEntering oai_nfapi_nr_dl_config_req sfn:%d,slot:%d\n",dl_config_req->SFN,dl_config_req->Slot); + LOG_D(NR_PHY, "Entering oai_nfapi_nr_dl_config_req sfn:%d,slot:%d\n", dl_config_req->SFN, dl_config_req->Slot); nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config; dl_config_req->header.message_id= NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST; dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!! @@ -1944,6 +1943,7 @@ int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req) { + LOG_D(NR_PHY, "Entering oai_nfapi_nr_tx_data_req sfn:%d,slot:%d\n", tx_data_req->SFN, tx_data_req->Slot); nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config; tx_data_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!! tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST; From 2ec11592c30ea1581ecb58b519f456fcacb149f5 Mon Sep 17 00:00:00 2001 From: Melissa Date: Mon, 7 Feb 2022 22:14:17 +0000 Subject: [PATCH 406/883] Merge branch 'episys/david/fixing_Bler_tables' into 'episys/master-nsa' Removed strange characters in the first line. See merge request aburger/openairinterface5g!108 --- .../AWGN/AWGN_results/mcs0_awgn_5G.csv | 124 ++++++------ .../AWGN/AWGN_results/mcs10_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs11_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs12_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs13_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs14_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs15_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs16_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs17_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs18_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs19_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs1_awgn_5G.csv | 54 ++--- .../AWGN/AWGN_results/mcs20_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs21_awgn_5G.csv | 144 +++++++------- .../AWGN/AWGN_results/mcs22_awgn_5G.csv | 104 +++++----- .../AWGN/AWGN_results/mcs23_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs24_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs25_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs26_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs27_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs28_awgn_5G.csv | 184 +++++++++--------- .../AWGN/AWGN_results/mcs2_awgn_5G.csv | 124 ++++++------ .../AWGN/AWGN_results/mcs3_awgn_5G.csv | 124 ++++++------ .../AWGN/AWGN_results/mcs4_awgn_5G.csv | 124 ++++++------ .../AWGN/AWGN_results/mcs5_awgn_5G.csv | 124 ++++++------ .../AWGN/AWGN_results/mcs6_awgn_5G.csv | 124 ++++++------ .../AWGN/AWGN_results/mcs7_awgn_5G.csv | 124 ++++++------ .../AWGN/AWGN_results/mcs8_awgn_5G.csv | 124 ++++++------ .../AWGN/AWGN_results/mcs9_awgn_5G.csv | 128 ++++++------ 29 files changed, 2115 insertions(+), 2115 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs0_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs0_awgn_5G.csv index ac9dd0b8ae..ae7824fe1e 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs0_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs0_awgn_5G.csv @@ -1,62 +1,62 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.9;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.8;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.7;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.6;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.5;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3.1;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.9;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.8;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.7;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.6;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.5;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2.1;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 --1.9;0;1864;0.2344;1499;1500;0;0;0;0;0;0;0 --1.8;0;1864;0.2344;1499;1500;0;0;0;0;0;0;0 --1.7;0;1864;0.2344;1498;1500;0;0;0;0;0;0;0 --1.6;0;1864;0.2344;1498;1500;0;0;0;0;0;0;0 --1.5;0;1864;0.2344;1497;1500;0;0;0;0;0;0;0 --1.4;0;1864;0.2344;1445;1500;0;0;0;0;0;0;0 --1.3;0;1864;0.2344;1394;1500;0;0;0;0;0;0;0 --1.2;0;1864;0.2344;1346;1500;0;0;0;0;0;0;0 --1.1;0;1864;0.2344;1299;1500;0;0;0;0;0;0;0 --1;0;1864;0.2344;1253;1500;0;0;0;0;0;0;0 --0.9;0;1864;0.2344;980;1500;0;0;0;0;0;0;0 --0.8;0;1864;0.2344;767;1500;0;0;0;0;0;0;0 --0.7;0;1864;0.2344;600;1500;0;0;0;0;0;0;0 --0.6;0;1864;0.2344;469;1500;0;0;0;0;0;0;0 --0.5;0;1864;0.2344;367;1500;0;0;0;0;0;0;0 --0.4;0;1864;0.2344;215;1500;0;0;0;0;0;0;0 --0.3;0;1864;0.2344;126;1500;0;0;0;0;0;0;0 --0.2;0;1864;0.2344;74;1500;0;0;0;0;0;0;0 --0.1;0;1864;0.2344;43;1500;0;0;0;0;0;0;0 -0;0;1864;0.2344;26;1500;0;0;0;0;0;0;0 -0.1;0;1864;0.2344;12;1500;0;0;0;0;0;0;0 -0.2;0;1864;0.2344;5;1500;0;0;0;0;0;0;0 -0.3;0;1864;0.2344;2;1500;0;0;0;0;0;0;0 -0.4;0;1864;0.2344;1;1500;0;0;0;0;0;0;0 -0.5;0;1864;0.2344;1;1500;0;0;0;0;0;0;0 -0.6;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -0.7;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -0.8;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -0.9;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.1;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.2;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.3;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.4;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.5;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.6;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.7;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.8;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -1.9;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 -2;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.9;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.8;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.7;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.6;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.5;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3.1;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.9;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.8;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.7;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.6;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.5;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.4;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.3;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2.1;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-2;0;1864;0.2344;1500;1500;0;0;0;0;0;0;0 +-1.9;0;1864;0.2344;1499;1500;0;0;0;0;0;0;0 +-1.8;0;1864;0.2344;1499;1500;0;0;0;0;0;0;0 +-1.7;0;1864;0.2344;1498;1500;0;0;0;0;0;0;0 +-1.6;0;1864;0.2344;1498;1500;0;0;0;0;0;0;0 +-1.5;0;1864;0.2344;1497;1500;0;0;0;0;0;0;0 +-1.4;0;1864;0.2344;1445;1500;0;0;0;0;0;0;0 +-1.3;0;1864;0.2344;1394;1500;0;0;0;0;0;0;0 +-1.2;0;1864;0.2344;1346;1500;0;0;0;0;0;0;0 +-1.1;0;1864;0.2344;1299;1500;0;0;0;0;0;0;0 +-1;0;1864;0.2344;1253;1500;0;0;0;0;0;0;0 +-0.9;0;1864;0.2344;980;1500;0;0;0;0;0;0;0 +-0.8;0;1864;0.2344;767;1500;0;0;0;0;0;0;0 +-0.7;0;1864;0.2344;600;1500;0;0;0;0;0;0;0 +-0.6;0;1864;0.2344;469;1500;0;0;0;0;0;0;0 +-0.5;0;1864;0.2344;367;1500;0;0;0;0;0;0;0 +-0.4;0;1864;0.2344;215;1500;0;0;0;0;0;0;0 +-0.3;0;1864;0.2344;126;1500;0;0;0;0;0;0;0 +-0.2;0;1864;0.2344;74;1500;0;0;0;0;0;0;0 +-0.1;0;1864;0.2344;43;1500;0;0;0;0;0;0;0 +0;0;1864;0.2344;26;1500;0;0;0;0;0;0;0 +0.1;0;1864;0.2344;12;1500;0;0;0;0;0;0;0 +0.2;0;1864;0.2344;5;1500;0;0;0;0;0;0;0 +0.3;0;1864;0.2344;2;1500;0;0;0;0;0;0;0 +0.4;0;1864;0.2344;1;1500;0;0;0;0;0;0;0 +0.5;0;1864;0.2344;1;1500;0;0;0;0;0;0;0 +0.6;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +0.7;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +0.8;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +0.9;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.1;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.2;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.3;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.4;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.5;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.6;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.7;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.8;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +1.9;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 +2;0;1864;0.2344;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs10_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs10_awgn_5G.csv index 65de0084ce..8d1ff3ebb6 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs10_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs10_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.1;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.2;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.6;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.7;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.8;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -3.9;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.1;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.2;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.6;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.7;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.8;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -4.9;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 -5.1;10;10504;1.3281;1454;1500;0;0;0;0;0;0;0 -5.2;10;10504;1.3281;1410;1500;0;0;0;0;0;0;0 -5.3;10;10504;1.3281;1367;1500;0;0;0;0;0;0;0 -5.4;10;10504;1.3281;1325;1500;0;0;0;0;0;0;0 -5.5;10;10504;1.3281;1285;1500;0;0;0;0;0;0;0 -5.6;10;10504;1.3281;1026;1500;0;0;0;0;0;0;0 -5.7;10;10504;1.3281;819;1500;0;0;0;0;0;0;0 -5.8;10;10504;1.3281;654;1500;0;0;0;0;0;0;0 -5.9;10;10504;1.3281;522;1500;0;0;0;0;0;0;0 -6;10;10504;1.3281;417;1500;0;0;0;0;0;0;0 -6.1;10;10504;1.3281;309;1500;0;0;0;0;0;0;0 -6.2;10;10504;1.3281;229;1500;0;0;0;0;0;0;0 -6.3;10;10504;1.3281;169;1500;0;0;0;0;0;0;0 -6.4;10;10504;1.3281;125;1500;0;0;0;0;0;0;0 -6.5;10;10504;1.3281;93;1500;0;0;0;0;0;0;0 -6.6;10;10504;1.3281;64;1500;0;0;0;0;0;0;0 -6.7;10;10504;1.3281;44;1500;0;0;0;0;0;0;0 -6.8;10;10504;1.3281;31;1500;0;0;0;0;0;0;0 -6.9;10;10504;1.3281;21;1500;0;0;0;0;0;0;0 -7;10;10504;1.3281;15;1500;0;0;0;0;0;0;0 -7.1;10;10504;1.3281;7;1500;0;0;0;0;0;0;0 -7.2;10;10504;1.3281;3;1500;0;0;0;0;0;0;0 -7.3;10;10504;1.3281;1;1500;0;0;0;0;0;0;0 -7.4;10;10504;1.3281;1;1500;0;0;0;0;0;0;0 -7.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -7.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -7.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -7.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -7.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -8.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -9.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -10.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -11.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 -12;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.1;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.2;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.6;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.7;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.8;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +3.9;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.1;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.2;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.3;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.4;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.6;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.7;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.8;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +4.9;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +5;10;10504;1.3281;1500;1500;0;0;0;0;0;0;0 +5.1;10;10504;1.3281;1454;1500;0;0;0;0;0;0;0 +5.2;10;10504;1.3281;1410;1500;0;0;0;0;0;0;0 +5.3;10;10504;1.3281;1367;1500;0;0;0;0;0;0;0 +5.4;10;10504;1.3281;1325;1500;0;0;0;0;0;0;0 +5.5;10;10504;1.3281;1285;1500;0;0;0;0;0;0;0 +5.6;10;10504;1.3281;1026;1500;0;0;0;0;0;0;0 +5.7;10;10504;1.3281;819;1500;0;0;0;0;0;0;0 +5.8;10;10504;1.3281;654;1500;0;0;0;0;0;0;0 +5.9;10;10504;1.3281;522;1500;0;0;0;0;0;0;0 +6;10;10504;1.3281;417;1500;0;0;0;0;0;0;0 +6.1;10;10504;1.3281;309;1500;0;0;0;0;0;0;0 +6.2;10;10504;1.3281;229;1500;0;0;0;0;0;0;0 +6.3;10;10504;1.3281;169;1500;0;0;0;0;0;0;0 +6.4;10;10504;1.3281;125;1500;0;0;0;0;0;0;0 +6.5;10;10504;1.3281;93;1500;0;0;0;0;0;0;0 +6.6;10;10504;1.3281;64;1500;0;0;0;0;0;0;0 +6.7;10;10504;1.3281;44;1500;0;0;0;0;0;0;0 +6.8;10;10504;1.3281;31;1500;0;0;0;0;0;0;0 +6.9;10;10504;1.3281;21;1500;0;0;0;0;0;0;0 +7;10;10504;1.3281;15;1500;0;0;0;0;0;0;0 +7.1;10;10504;1.3281;7;1500;0;0;0;0;0;0;0 +7.2;10;10504;1.3281;3;1500;0;0;0;0;0;0;0 +7.3;10;10504;1.3281;1;1500;0;0;0;0;0;0;0 +7.4;10;10504;1.3281;1;1500;0;0;0;0;0;0;0 +7.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +7.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +7.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +7.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +7.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +8.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +9.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +10.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.1;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.2;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.3;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.4;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.5;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.6;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.7;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.8;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +11.9;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 +12;10;10504;1.3281;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs11_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs11_awgn_5G.csv index 3d1dbcad12..e581ab2ff1 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs11_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs11_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.6;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.7;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.8;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -3.9;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.6;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.7;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.8;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -4.9;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -5.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -5.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -5.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -5.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -5.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 -5.6;11;11784;1.4766;1494;1500;0;0;0;0;0;0;0 -5.7;11;11784;1.4766;1489;1500;0;0;0;0;0;0;0 -5.8;11;11784;1.4766;1483;1500;0;0;0;0;0;0;0 -5.9;11;11784;1.4766;1477;1500;0;0;0;0;0;0;0 -6;11;11784;1.4766;1472;1500;0;0;0;0;0;0;0 -6.1;11;11784;1.4766;1367;1500;0;0;0;0;0;0;0 -6.2;11;11784;1.4766;1269;1500;0;0;0;0;0;0;0 -6.3;11;11784;1.4766;1179;1500;0;0;0;0;0;0;0 -6.4;11;11784;1.4766;1095;1500;0;0;0;0;0;0;0 -6.5;11;11784;1.4766;1016;1500;0;0;0;0;0;0;0 -6.6;11;11784;1.4766;762;1500;0;0;0;0;0;0;0 -6.7;11;11784;1.4766;571;1500;0;0;0;0;0;0;0 -6.8;11;11784;1.4766;428;1500;0;0;0;0;0;0;0 -6.9;11;11784;1.4766;320;1500;0;0;0;0;0;0;0 -7;11;11784;1.4766;240;1500;0;0;0;0;0;0;0 -7.1;11;11784;1.4766;169;1500;0;0;0;0;0;0;0 -7.2;11;11784;1.4766;119;1500;0;0;0;0;0;0;0 -7.3;11;11784;1.4766;83;1500;0;0;0;0;0;0;0 -7.4;11;11784;1.4766;59;1500;0;0;0;0;0;0;0 -7.5;11;11784;1.4766;41;1500;0;0;0;0;0;0;0 -7.6;11;11784;1.4766;24;1500;0;0;0;0;0;0;0 -7.7;11;11784;1.4766;14;1500;0;0;0;0;0;0;0 -7.8;11;11784;1.4766;8;1500;0;0;0;0;0;0;0 -7.9;11;11784;1.4766;5;1500;0;0;0;0;0;0;0 -8;11;11784;1.4766;3;1500;0;0;0;0;0;0;0 -8.1;11;11784;1.4766;1;1500;0;0;0;0;0;0;0 -8.2;11;11784;1.4766;1;1500;0;0;0;0;0;0;0 -8.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -8.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -8.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -8.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -8.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -8.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -8.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -9.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -10.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -11.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 -12;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.6;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.7;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.8;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +3.9;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.6;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.7;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.8;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +4.9;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.1;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.2;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.3;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.4;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.5;11;11784;1.4766;1500;1500;0;0;0;0;0;0;0 +5.6;11;11784;1.4766;1494;1500;0;0;0;0;0;0;0 +5.7;11;11784;1.4766;1489;1500;0;0;0;0;0;0;0 +5.8;11;11784;1.4766;1483;1500;0;0;0;0;0;0;0 +5.9;11;11784;1.4766;1477;1500;0;0;0;0;0;0;0 +6;11;11784;1.4766;1472;1500;0;0;0;0;0;0;0 +6.1;11;11784;1.4766;1367;1500;0;0;0;0;0;0;0 +6.2;11;11784;1.4766;1269;1500;0;0;0;0;0;0;0 +6.3;11;11784;1.4766;1179;1500;0;0;0;0;0;0;0 +6.4;11;11784;1.4766;1095;1500;0;0;0;0;0;0;0 +6.5;11;11784;1.4766;1016;1500;0;0;0;0;0;0;0 +6.6;11;11784;1.4766;762;1500;0;0;0;0;0;0;0 +6.7;11;11784;1.4766;571;1500;0;0;0;0;0;0;0 +6.8;11;11784;1.4766;428;1500;0;0;0;0;0;0;0 +6.9;11;11784;1.4766;320;1500;0;0;0;0;0;0;0 +7;11;11784;1.4766;240;1500;0;0;0;0;0;0;0 +7.1;11;11784;1.4766;169;1500;0;0;0;0;0;0;0 +7.2;11;11784;1.4766;119;1500;0;0;0;0;0;0;0 +7.3;11;11784;1.4766;83;1500;0;0;0;0;0;0;0 +7.4;11;11784;1.4766;59;1500;0;0;0;0;0;0;0 +7.5;11;11784;1.4766;41;1500;0;0;0;0;0;0;0 +7.6;11;11784;1.4766;24;1500;0;0;0;0;0;0;0 +7.7;11;11784;1.4766;14;1500;0;0;0;0;0;0;0 +7.8;11;11784;1.4766;8;1500;0;0;0;0;0;0;0 +7.9;11;11784;1.4766;5;1500;0;0;0;0;0;0;0 +8;11;11784;1.4766;3;1500;0;0;0;0;0;0;0 +8.1;11;11784;1.4766;1;1500;0;0;0;0;0;0;0 +8.2;11;11784;1.4766;1;1500;0;0;0;0;0;0;0 +8.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +8.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +9.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +10.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.1;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.2;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.3;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.4;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.5;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.6;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.7;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.8;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +11.9;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 +12;11;11784;1.4766;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs12_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs12_awgn_5G.csv index 5ce8b9bb19..08825dec27 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs12_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs12_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -3.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -4.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -5.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -6.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -6.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -6.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -6.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -6.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 -6.6;12;13576;1.6953;1498;1500;0;0;0;0;0;0;0 -6.7;12;13576;1.6953;1495;1500;0;0;0;0;0;0;0 -6.8;12;13576;1.6953;1493;1500;0;0;0;0;0;0;0 -6.9;12;13576;1.6953;1491;1500;0;0;0;0;0;0;0 -7;12;13576;1.6953;1488;1500;0;0;0;0;0;0;0 -7.1;12;13576;1.6953;1357;1500;0;0;0;0;0;0;0 -7.2;12;13576;1.6953;1238;1500;0;0;0;0;0;0;0 -7.3;12;13576;1.6953;1129;1500;0;0;0;0;0;0;0 -7.4;12;13576;1.6953;1029;1500;0;0;0;0;0;0;0 -7.5;12;13576;1.6953;939;1500;0;0;0;0;0;0;0 -7.6;12;13576;1.6953;632;1500;0;0;0;0;0;0;0 -7.7;12;13576;1.6953;425;1500;0;0;0;0;0;0;0 -7.8;12;13576;1.6953;286;1500;0;0;0;0;0;0;0 -7.9;12;13576;1.6953;193;1500;0;0;0;0;0;0;0 -8;12;13576;1.6953;130;1500;0;0;0;0;0;0;0 -8.1;12;13576;1.6953;91;1500;0;0;0;0;0;0;0 -8.2;12;13576;1.6953;64;1500;0;0;0;0;0;0;0 -8.3;12;13576;1.6953;45;1500;0;0;0;0;0;0;0 -8.4;12;13576;1.6953;32;1500;0;0;0;0;0;0;0 -8.5;12;13576;1.6953;23;1500;0;0;0;0;0;0;0 -8.6;12;13576;1.6953;12;1500;0;0;0;0;0;0;0 -8.7;12;13576;1.6953;6;1500;0;0;0;0;0;0;0 -8.8;12;13576;1.6953;3;1500;0;0;0;0;0;0;0 -8.9;12;13576;1.6953;2;1500;0;0;0;0;0;0;0 -9;12;13576;1.6953;1;1500;0;0;0;0;0;0;0 -9.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -9.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -9.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -9.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -9.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -9.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -9.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -9.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -9.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -10.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -11.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 -12;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +3.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +4.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.7;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.8;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +5.9;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.1;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.2;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.3;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.4;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.5;12;13576;1.6953;1500;1500;0;0;0;0;0;0;0 +6.6;12;13576;1.6953;1498;1500;0;0;0;0;0;0;0 +6.7;12;13576;1.6953;1495;1500;0;0;0;0;0;0;0 +6.8;12;13576;1.6953;1493;1500;0;0;0;0;0;0;0 +6.9;12;13576;1.6953;1491;1500;0;0;0;0;0;0;0 +7;12;13576;1.6953;1488;1500;0;0;0;0;0;0;0 +7.1;12;13576;1.6953;1357;1500;0;0;0;0;0;0;0 +7.2;12;13576;1.6953;1238;1500;0;0;0;0;0;0;0 +7.3;12;13576;1.6953;1129;1500;0;0;0;0;0;0;0 +7.4;12;13576;1.6953;1029;1500;0;0;0;0;0;0;0 +7.5;12;13576;1.6953;939;1500;0;0;0;0;0;0;0 +7.6;12;13576;1.6953;632;1500;0;0;0;0;0;0;0 +7.7;12;13576;1.6953;425;1500;0;0;0;0;0;0;0 +7.8;12;13576;1.6953;286;1500;0;0;0;0;0;0;0 +7.9;12;13576;1.6953;193;1500;0;0;0;0;0;0;0 +8;12;13576;1.6953;130;1500;0;0;0;0;0;0;0 +8.1;12;13576;1.6953;91;1500;0;0;0;0;0;0;0 +8.2;12;13576;1.6953;64;1500;0;0;0;0;0;0;0 +8.3;12;13576;1.6953;45;1500;0;0;0;0;0;0;0 +8.4;12;13576;1.6953;32;1500;0;0;0;0;0;0;0 +8.5;12;13576;1.6953;23;1500;0;0;0;0;0;0;0 +8.6;12;13576;1.6953;12;1500;0;0;0;0;0;0;0 +8.7;12;13576;1.6953;6;1500;0;0;0;0;0;0;0 +8.8;12;13576;1.6953;3;1500;0;0;0;0;0;0;0 +8.9;12;13576;1.6953;2;1500;0;0;0;0;0;0;0 +9;12;13576;1.6953;1;1500;0;0;0;0;0;0;0 +9.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +9.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +10.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.1;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.2;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.3;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.4;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.5;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.6;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.7;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.8;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +11.9;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 +12;12;13576;1.6953;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs13_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs13_awgn_5G.csv index a91d924705..ef85933aaf 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs13_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs13_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -7;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 -7.1;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 -7.2;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 -7.3;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 -7.4;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 -7.5;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 -7.6;13;15112;1.9141;1444;1500;0;0;0;0;0;0;0 -7.7;13;15112;1.9141;1391;1500;0;0;0;0;0;0;0 -7.8;13;15112;1.9141;1340;1500;0;0;0;0;0;0;0 -7.9;13;15112;1.9141;1290;1500;0;0;0;0;0;0;0 -8;13;15112;1.9141;1243;1500;0;0;0;0;0;0;0 -8.1;13;15112;1.9141;878;1500;0;0;0;0;0;0;0 -8.2;13;15112;1.9141;620;1500;0;0;0;0;0;0;0 -8.3;13;15112;1.9141;438;1500;0;0;0;0;0;0;0 -8.4;13;15112;1.9141;309;1500;0;0;0;0;0;0;0 -8.5;13;15112;1.9141;219;1500;0;0;0;0;0;0;0 -8.6;13;15112;1.9141;173;1500;0;0;0;0;0;0;0 -8.7;13;15112;1.9141;137;1500;0;0;0;0;0;0;0 -8.8;13;15112;1.9141;109;1500;0;0;0;0;0;0;0 -8.9;13;15112;1.9141;86;1500;0;0;0;0;0;0;0 -9;13;15112;1.9141;68;1500;0;0;0;0;0;0;0 -9.1;13;15112;1.9141;47;1500;0;0;0;0;0;0;0 -9.2;13;15112;1.9141;33;1500;0;0;0;0;0;0;0 -9.3;13;15112;1.9141;23;1500;0;0;0;0;0;0;0 -9.4;13;15112;1.9141;16;1500;0;0;0;0;0;0;0 -9.5;13;15112;1.9141;11;1500;0;0;0;0;0;0;0 -9.6;13;15112;1.9141;5;1500;0;0;0;0;0;0;0 -9.7;13;15112;1.9141;2;1500;0;0;0;0;0;0;0 -9.8;13;15112;1.9141;1;1500;0;0;0;0;0;0;0 -9.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -10.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -11.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -12.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -13.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 -14;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +7;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.1;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.2;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.3;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.4;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.5;13;15112;1.9141;1500;1500;0;0;0;0;0;0;0 +7.6;13;15112;1.9141;1444;1500;0;0;0;0;0;0;0 +7.7;13;15112;1.9141;1391;1500;0;0;0;0;0;0;0 +7.8;13;15112;1.9141;1340;1500;0;0;0;0;0;0;0 +7.9;13;15112;1.9141;1290;1500;0;0;0;0;0;0;0 +8;13;15112;1.9141;1243;1500;0;0;0;0;0;0;0 +8.1;13;15112;1.9141;878;1500;0;0;0;0;0;0;0 +8.2;13;15112;1.9141;620;1500;0;0;0;0;0;0;0 +8.3;13;15112;1.9141;438;1500;0;0;0;0;0;0;0 +8.4;13;15112;1.9141;309;1500;0;0;0;0;0;0;0 +8.5;13;15112;1.9141;219;1500;0;0;0;0;0;0;0 +8.6;13;15112;1.9141;173;1500;0;0;0;0;0;0;0 +8.7;13;15112;1.9141;137;1500;0;0;0;0;0;0;0 +8.8;13;15112;1.9141;109;1500;0;0;0;0;0;0;0 +8.9;13;15112;1.9141;86;1500;0;0;0;0;0;0;0 +9;13;15112;1.9141;68;1500;0;0;0;0;0;0;0 +9.1;13;15112;1.9141;47;1500;0;0;0;0;0;0;0 +9.2;13;15112;1.9141;33;1500;0;0;0;0;0;0;0 +9.3;13;15112;1.9141;23;1500;0;0;0;0;0;0;0 +9.4;13;15112;1.9141;16;1500;0;0;0;0;0;0;0 +9.5;13;15112;1.9141;11;1500;0;0;0;0;0;0;0 +9.6;13;15112;1.9141;5;1500;0;0;0;0;0;0;0 +9.7;13;15112;1.9141;2;1500;0;0;0;0;0;0;0 +9.8;13;15112;1.9141;1;1500;0;0;0;0;0;0;0 +9.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +10.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +11.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +12.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.1;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.2;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.3;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.4;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.5;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.6;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.7;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.8;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +13.9;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 +14;13;15112;1.9141;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs14_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs14_awgn_5G.csv index b28d592a5e..0667105011 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs14_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs14_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -7;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.1;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.2;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.3;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.4;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.5;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.6;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.7;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.8;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -7.9;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -8;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -8.1;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -8.2;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -8.3;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -8.4;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -8.5;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 -8.6;14;17424;2.1602;1497;1500;0;0;0;0;0;0;0 -8.7;14;17424;2.1602;1493;1500;0;0;0;0;0;0;0 -8.8;14;17424;2.1602;1490;1500;0;0;0;0;0;0;0 -8.9;14;17424;2.1602;1487;1500;0;0;0;0;0;0;0 -9;14;17424;2.1602;1484;1500;0;0;0;0;0;0;0 -9.1;14;17424;2.1602;1291;1500;0;0;0;0;0;0;0 -9.2;14;17424;2.1602;1123;1500;0;0;0;0;0;0;0 -9.3;14;17424;2.1602;977;1500;0;0;0;0;0;0;0 -9.4;14;17424;2.1602;850;1500;0;0;0;0;0;0;0 -9.5;14;17424;2.1602;739;1500;0;0;0;0;0;0;0 -9.6;14;17424;2.1602;508;1500;0;0;0;0;0;0;0 -9.7;14;17424;2.1602;349;1500;0;0;0;0;0;0;0 -9.8;14;17424;2.1602;239;1500;0;0;0;0;0;0;0 -9.9;14;17424;2.1602;164;1500;0;0;0;0;0;0;0 -10;14;17424;2.1602;113;1500;0;0;0;0;0;0;0 -10.1;14;17424;2.1602;85;1500;0;0;0;0;0;0;0 -10.2;14;17424;2.1602;63;1500;0;0;0;0;0;0;0 -10.3;14;17424;2.1602;47;1500;0;0;0;0;0;0;0 -10.4;14;17424;2.1602;35;1500;0;0;0;0;0;0;0 -10.5;14;17424;2.1602;27;1500;0;0;0;0;0;0;0 -10.6;14;17424;2.1602;12;1500;0;0;0;0;0;0;0 -10.7;14;17424;2.1602;6;1500;0;0;0;0;0;0;0 -10.8;14;17424;2.1602;3;1500;0;0;0;0;0;0;0 -10.9;14;17424;2.1602;1;1500;0;0;0;0;0;0;0 -11;14;17424;2.1602;1;1500;0;0;0;0;0;0;0 -11.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -11.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -11.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -11.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -11.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -11.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -11.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -11.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -11.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -12.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -13.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 -14;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +7;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.1;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.2;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.3;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.4;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.5;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.6;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.7;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.8;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +7.9;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.1;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.2;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.3;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.4;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.5;14;17424;2.1602;1500;1500;0;0;0;0;0;0;0 +8.6;14;17424;2.1602;1497;1500;0;0;0;0;0;0;0 +8.7;14;17424;2.1602;1493;1500;0;0;0;0;0;0;0 +8.8;14;17424;2.1602;1490;1500;0;0;0;0;0;0;0 +8.9;14;17424;2.1602;1487;1500;0;0;0;0;0;0;0 +9;14;17424;2.1602;1484;1500;0;0;0;0;0;0;0 +9.1;14;17424;2.1602;1291;1500;0;0;0;0;0;0;0 +9.2;14;17424;2.1602;1123;1500;0;0;0;0;0;0;0 +9.3;14;17424;2.1602;977;1500;0;0;0;0;0;0;0 +9.4;14;17424;2.1602;850;1500;0;0;0;0;0;0;0 +9.5;14;17424;2.1602;739;1500;0;0;0;0;0;0;0 +9.6;14;17424;2.1602;508;1500;0;0;0;0;0;0;0 +9.7;14;17424;2.1602;349;1500;0;0;0;0;0;0;0 +9.8;14;17424;2.1602;239;1500;0;0;0;0;0;0;0 +9.9;14;17424;2.1602;164;1500;0;0;0;0;0;0;0 +10;14;17424;2.1602;113;1500;0;0;0;0;0;0;0 +10.1;14;17424;2.1602;85;1500;0;0;0;0;0;0;0 +10.2;14;17424;2.1602;63;1500;0;0;0;0;0;0;0 +10.3;14;17424;2.1602;47;1500;0;0;0;0;0;0;0 +10.4;14;17424;2.1602;35;1500;0;0;0;0;0;0;0 +10.5;14;17424;2.1602;27;1500;0;0;0;0;0;0;0 +10.6;14;17424;2.1602;12;1500;0;0;0;0;0;0;0 +10.7;14;17424;2.1602;6;1500;0;0;0;0;0;0;0 +10.8;14;17424;2.1602;3;1500;0;0;0;0;0;0;0 +10.9;14;17424;2.1602;1;1500;0;0;0;0;0;0;0 +11;14;17424;2.1602;1;1500;0;0;0;0;0;0;0 +11.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +11.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +12.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.1;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.2;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.3;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.4;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.5;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.6;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.7;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.8;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +13.9;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 +14;14;17424;2.1602;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs15_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs15_awgn_5G.csv index a48c75a071..460d156d78 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs15_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs15_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.2;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.3;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.4;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.5;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.6;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -7.9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.2;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.3;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.4;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.5;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.6;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -8.9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -9.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 -9.2;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 -9.3;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 -9.4;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 -9.5;15;18960;2.4063;1498;1500;0;0;0;0;0;0;0 -9.6;15;18960;2.4063;1377;1500;0;0;0;0;0;0;0 -9.7;15;18960;2.4063;1265;1500;0;0;0;0;0;0;0 -9.8;15;18960;2.4063;1163;1500;0;0;0;0;0;0;0 -9.9;15;18960;2.4063;1069;1500;0;0;0;0;0;0;0 -10;15;18960;2.4063;982;1500;0;0;0;0;0;0;0 -10.1;15;18960;2.4063;664;1500;0;0;0;0;0;0;0 -10.2;15;18960;2.4063;450;1500;0;0;0;0;0;0;0 -10.3;15;18960;2.4063;304;1500;0;0;0;0;0;0;0 -10.4;15;18960;2.4063;206;1500;0;0;0;0;0;0;0 -10.5;15;18960;2.4063;139;1500;0;0;0;0;0;0;0 -10.6;15;18960;2.4063;113;1500;0;0;0;0;0;0;0 -10.7;15;18960;2.4063;92;1500;0;0;0;0;0;0;0 -10.8;15;18960;2.4063;75;1500;0;0;0;0;0;0;0 -10.9;15;18960;2.4063;61;1500;0;0;0;0;0;0;0 -11;15;18960;2.4063;50;1500;0;0;0;0;0;0;0 -11.1;15;18960;2.4063;29;1500;0;0;0;0;0;0;0 -11.2;15;18960;2.4063;17;1500;0;0;0;0;0;0;0 -11.3;15;18960;2.4063;10;1500;0;0;0;0;0;0;0 -11.4;15;18960;2.4063;6;1500;0;0;0;0;0;0;0 -11.5;15;18960;2.4063;3;1500;0;0;0;0;0;0;0 -11.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -11.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -11.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -11.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.1;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.2;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.3;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.4;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.5;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -12.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.1;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.2;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.3;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.4;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.5;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -13.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 -14;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.2;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.3;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.4;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.5;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.6;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +7.9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.2;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.3;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.4;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.5;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.6;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.7;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.8;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +8.9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +9;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +9.1;15;18960;2.4063;1500;1500;0;0;0;0;0;0;0 +9.2;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 +9.3;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 +9.4;15;18960;2.4063;1499;1500;0;0;0;0;0;0;0 +9.5;15;18960;2.4063;1498;1500;0;0;0;0;0;0;0 +9.6;15;18960;2.4063;1377;1500;0;0;0;0;0;0;0 +9.7;15;18960;2.4063;1265;1500;0;0;0;0;0;0;0 +9.8;15;18960;2.4063;1163;1500;0;0;0;0;0;0;0 +9.9;15;18960;2.4063;1069;1500;0;0;0;0;0;0;0 +10;15;18960;2.4063;982;1500;0;0;0;0;0;0;0 +10.1;15;18960;2.4063;664;1500;0;0;0;0;0;0;0 +10.2;15;18960;2.4063;450;1500;0;0;0;0;0;0;0 +10.3;15;18960;2.4063;304;1500;0;0;0;0;0;0;0 +10.4;15;18960;2.4063;206;1500;0;0;0;0;0;0;0 +10.5;15;18960;2.4063;139;1500;0;0;0;0;0;0;0 +10.6;15;18960;2.4063;113;1500;0;0;0;0;0;0;0 +10.7;15;18960;2.4063;92;1500;0;0;0;0;0;0;0 +10.8;15;18960;2.4063;75;1500;0;0;0;0;0;0;0 +10.9;15;18960;2.4063;61;1500;0;0;0;0;0;0;0 +11;15;18960;2.4063;50;1500;0;0;0;0;0;0;0 +11.1;15;18960;2.4063;29;1500;0;0;0;0;0;0;0 +11.2;15;18960;2.4063;17;1500;0;0;0;0;0;0;0 +11.3;15;18960;2.4063;10;1500;0;0;0;0;0;0;0 +11.4;15;18960;2.4063;6;1500;0;0;0;0;0;0;0 +11.5;15;18960;2.4063;3;1500;0;0;0;0;0;0;0 +11.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +11.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +11.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +11.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.1;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.2;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.3;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.4;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.5;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +12.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.1;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.2;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.3;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.4;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.5;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.6;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.7;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.8;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +13.9;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 +14;15;18960;2.4063;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs16_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs16_awgn_5G.csv index cabe546aef..4f122de8c1 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs16_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs16_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -7.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -8.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -9.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -10;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 -10.1;16;20496;2.5703;1424;1500;0;0;0;0;0;0;0 -10.2;16;20496;2.5703;1352;1500;0;0;0;0;0;0;0 -10.3;16;20496;2.5703;1283;1500;0;0;0;0;0;0;0 -10.4;16;20496;2.5703;1218;1500;0;0;0;0;0;0;0 -10.5;16;20496;2.5703;1157;1500;0;0;0;0;0;0;0 -10.6;16;20496;2.5703;775;1500;0;0;0;0;0;0;0 -10.7;16;20496;2.5703;519;1500;0;0;0;0;0;0;0 -10.8;16;20496;2.5703;348;1500;0;0;0;0;0;0;0 -10.9;16;20496;2.5703;233;1500;0;0;0;0;0;0;0 -11;16;20496;2.5703;156;1500;0;0;0;0;0;0;0 -11.1;16;20496;2.5703;132;1500;0;0;0;0;0;0;0 -11.2;16;20496;2.5703;111;1500;0;0;0;0;0;0;0 -11.3;16;20496;2.5703;94;1500;0;0;0;0;0;0;0 -11.4;16;20496;2.5703;79;1500;0;0;0;0;0;0;0 -11.5;16;20496;2.5703;67;1500;0;0;0;0;0;0;0 -11.6;16;20496;2.5703;44;1500;0;0;0;0;0;0;0 -11.7;16;20496;2.5703;29;1500;0;0;0;0;0;0;0 -11.8;16;20496;2.5703;19;1500;0;0;0;0;0;0;0 -11.9;16;20496;2.5703;12;1500;0;0;0;0;0;0;0 -12;16;20496;2.5703;8;1500;0;0;0;0;0;0;0 -12.1;16;20496;2.5703;4;1500;0;0;0;0;0;0;0 -12.2;16;20496;2.5703;2;1500;0;0;0;0;0;0;0 -12.3;16;20496;2.5703;1;1500;0;0;0;0;0;0;0 -12.4;16;20496;2.5703;1;1500;0;0;0;0;0;0;0 -12.5;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -12.6;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -12.7;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -12.8;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -12.9;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.1;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.2;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.3;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.4;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.5;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.6;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.7;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.8;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -13.9;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 -14;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +7.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +8.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.1;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.2;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.3;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.4;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.5;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.6;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.7;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.8;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +9.9;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +10;16;20496;2.5703;1500;1500;0;0;0;0;0;0;0 +10.1;16;20496;2.5703;1424;1500;0;0;0;0;0;0;0 +10.2;16;20496;2.5703;1352;1500;0;0;0;0;0;0;0 +10.3;16;20496;2.5703;1283;1500;0;0;0;0;0;0;0 +10.4;16;20496;2.5703;1218;1500;0;0;0;0;0;0;0 +10.5;16;20496;2.5703;1157;1500;0;0;0;0;0;0;0 +10.6;16;20496;2.5703;775;1500;0;0;0;0;0;0;0 +10.7;16;20496;2.5703;519;1500;0;0;0;0;0;0;0 +10.8;16;20496;2.5703;348;1500;0;0;0;0;0;0;0 +10.9;16;20496;2.5703;233;1500;0;0;0;0;0;0;0 +11;16;20496;2.5703;156;1500;0;0;0;0;0;0;0 +11.1;16;20496;2.5703;132;1500;0;0;0;0;0;0;0 +11.2;16;20496;2.5703;111;1500;0;0;0;0;0;0;0 +11.3;16;20496;2.5703;94;1500;0;0;0;0;0;0;0 +11.4;16;20496;2.5703;79;1500;0;0;0;0;0;0;0 +11.5;16;20496;2.5703;67;1500;0;0;0;0;0;0;0 +11.6;16;20496;2.5703;44;1500;0;0;0;0;0;0;0 +11.7;16;20496;2.5703;29;1500;0;0;0;0;0;0;0 +11.8;16;20496;2.5703;19;1500;0;0;0;0;0;0;0 +11.9;16;20496;2.5703;12;1500;0;0;0;0;0;0;0 +12;16;20496;2.5703;8;1500;0;0;0;0;0;0;0 +12.1;16;20496;2.5703;4;1500;0;0;0;0;0;0;0 +12.2;16;20496;2.5703;2;1500;0;0;0;0;0;0;0 +12.3;16;20496;2.5703;1;1500;0;0;0;0;0;0;0 +12.4;16;20496;2.5703;1;1500;0;0;0;0;0;0;0 +12.5;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +12.6;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +12.7;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +12.8;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +12.9;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.1;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.2;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.3;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.4;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.5;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.6;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.7;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.8;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +13.9;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 +14;16;20496;2.5703;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs17_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs17_awgn_5G.csv index 5b26a5a722..3254f76eb9 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs17_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs17_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -10;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 -10.1;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 -10.2;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 -10.3;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 -10.4;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 -10.5;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 -10.6;17;20496;2.5664;1498;1500;0;0;0;0;0;0;0 -10.7;17;20496;2.5664;1496;1500;0;0;0;0;0;0;0 -10.8;17;20496;2.5664;1494;1500;0;0;0;0;0;0;0 -10.9;17;20496;2.5664;1493;1500;0;0;0;0;0;0;0 -11;17;20496;2.5664;1491;1500;0;0;0;0;0;0;0 -11.1;17;20496;2.5664;1336;1500;0;0;0;0;0;0;0 -11.2;17;20496;2.5664;1197;1500;0;0;0;0;0;0;0 -11.3;17;20496;2.5664;1072;1500;0;0;0;0;0;0;0 -11.4;17;20496;2.5664;961;1500;0;0;0;0;0;0;0 -11.5;17;20496;2.5664;861;1500;0;0;0;0;0;0;0 -11.6;17;20496;2.5664;603;1500;0;0;0;0;0;0;0 -11.7;17;20496;2.5664;423;1500;0;0;0;0;0;0;0 -11.8;17;20496;2.5664;296;1500;0;0;0;0;0;0;0 -11.9;17;20496;2.5664;208;1500;0;0;0;0;0;0;0 -12;17;20496;2.5664;146;1500;0;0;0;0;0;0;0 -12.1;17;20496;2.5664;125;1500;0;0;0;0;0;0;0 -12.2;17;20496;2.5664;107;1500;0;0;0;0;0;0;0 -12.3;17;20496;2.5664;92;1500;0;0;0;0;0;0;0 -12.4;17;20496;2.5664;79;1500;0;0;0;0;0;0;0 -12.5;17;20496;2.5664;68;1500;0;0;0;0;0;0;0 -12.6;17;20496;2.5664;50;1500;0;0;0;0;0;0;0 -12.7;17;20496;2.5664;37;1500;0;0;0;0;0;0;0 -12.8;17;20496;2.5664;28;1500;0;0;0;0;0;0;0 -12.9;17;20496;2.5664;20;1500;0;0;0;0;0;0;0 -13;17;20496;2.5664;15;1500;0;0;0;0;0;0;0 -13.1;17;20496;2.5664;9;1500;0;0;0;0;0;0;0 -13.2;17;20496;2.5664;5;1500;0;0;0;0;0;0;0 -13.3;17;20496;2.5664;3;1500;0;0;0;0;0;0;0 -13.4;17;20496;2.5664;2;1500;0;0;0;0;0;0;0 -13.5;17;20496;2.5664;1;1500;0;0;0;0;0;0;0 -13.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -13.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -13.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -13.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -14.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -15.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -16.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 -17;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.1;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.2;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.3;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.4;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.5;17;20496;2.5664;1500;1500;0;0;0;0;0;0;0 +10.6;17;20496;2.5664;1498;1500;0;0;0;0;0;0;0 +10.7;17;20496;2.5664;1496;1500;0;0;0;0;0;0;0 +10.8;17;20496;2.5664;1494;1500;0;0;0;0;0;0;0 +10.9;17;20496;2.5664;1493;1500;0;0;0;0;0;0;0 +11;17;20496;2.5664;1491;1500;0;0;0;0;0;0;0 +11.1;17;20496;2.5664;1336;1500;0;0;0;0;0;0;0 +11.2;17;20496;2.5664;1197;1500;0;0;0;0;0;0;0 +11.3;17;20496;2.5664;1072;1500;0;0;0;0;0;0;0 +11.4;17;20496;2.5664;961;1500;0;0;0;0;0;0;0 +11.5;17;20496;2.5664;861;1500;0;0;0;0;0;0;0 +11.6;17;20496;2.5664;603;1500;0;0;0;0;0;0;0 +11.7;17;20496;2.5664;423;1500;0;0;0;0;0;0;0 +11.8;17;20496;2.5664;296;1500;0;0;0;0;0;0;0 +11.9;17;20496;2.5664;208;1500;0;0;0;0;0;0;0 +12;17;20496;2.5664;146;1500;0;0;0;0;0;0;0 +12.1;17;20496;2.5664;125;1500;0;0;0;0;0;0;0 +12.2;17;20496;2.5664;107;1500;0;0;0;0;0;0;0 +12.3;17;20496;2.5664;92;1500;0;0;0;0;0;0;0 +12.4;17;20496;2.5664;79;1500;0;0;0;0;0;0;0 +12.5;17;20496;2.5664;68;1500;0;0;0;0;0;0;0 +12.6;17;20496;2.5664;50;1500;0;0;0;0;0;0;0 +12.7;17;20496;2.5664;37;1500;0;0;0;0;0;0;0 +12.8;17;20496;2.5664;28;1500;0;0;0;0;0;0;0 +12.9;17;20496;2.5664;20;1500;0;0;0;0;0;0;0 +13;17;20496;2.5664;15;1500;0;0;0;0;0;0;0 +13.1;17;20496;2.5664;9;1500;0;0;0;0;0;0;0 +13.2;17;20496;2.5664;5;1500;0;0;0;0;0;0;0 +13.3;17;20496;2.5664;3;1500;0;0;0;0;0;0;0 +13.4;17;20496;2.5664;2;1500;0;0;0;0;0;0;0 +13.5;17;20496;2.5664;1;1500;0;0;0;0;0;0;0 +13.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +13.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +13.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +13.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +14.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +15.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.1;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.2;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.3;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.4;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.5;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.6;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.7;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.8;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +16.9;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 +17;17;20496;2.5664;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs18_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs18_awgn_5G.csv index bf4864701f..67ede60066 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs18_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs18_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -10;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.1;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.2;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.3;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.4;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.5;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.6;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.7;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.8;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -10.9;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -11;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 -11.1;18;21504;2.7305;1499;1500;0;0;0;0;0;0;0 -11.2;18;21504;2.7305;1499;1500;0;0;0;0;0;0;0 -11.3;18;21504;2.7305;1498;1500;0;0;0;0;0;0;0 -11.4;18;21504;2.7305;1498;1500;0;0;0;0;0;0;0 -11.5;18;21504;2.7305;1497;1500;0;0;0;0;0;0;0 -11.6;18;21504;2.7305;1399;1500;0;0;0;0;0;0;0 -11.7;18;21504;2.7305;1307;1500;0;0;0;0;0;0;0 -11.8;18;21504;2.7305;1221;1500;0;0;0;0;0;0;0 -11.9;18;21504;2.7305;1141;1500;0;0;0;0;0;0;0 -12;18;21504;2.7305;1066;1500;0;0;0;0;0;0;0 -12.1;18;21504;2.7305;788;1500;0;0;0;0;0;0;0 -12.2;18;21504;2.7305;582;1500;0;0;0;0;0;0;0 -12.3;18;21504;2.7305;431;1500;0;0;0;0;0;0;0 -12.4;18;21504;2.7305;318;1500;0;0;0;0;0;0;0 -12.5;18;21504;2.7305;235;1500;0;0;0;0;0;0;0 -12.6;18;21504;2.7305;185;1500;0;0;0;0;0;0;0 -12.7;18;21504;2.7305;146;1500;0;0;0;0;0;0;0 -12.8;18;21504;2.7305;115;1500;0;0;0;0;0;0;0 -12.9;18;21504;2.7305;90;1500;0;0;0;0;0;0;0 -13;18;21504;2.7305;71;1500;0;0;0;0;0;0;0 -13.1;18;21504;2.7305;50;1500;0;0;0;0;0;0;0 -13.2;18;21504;2.7305;35;1500;0;0;0;0;0;0;0 -13.3;18;21504;2.7305;25;1500;0;0;0;0;0;0;0 -13.4;18;21504;2.7305;18;1500;0;0;0;0;0;0;0 -13.5;18;21504;2.7305;12;1500;0;0;0;0;0;0;0 -13.6;18;21504;2.7305;7;1500;0;0;0;0;0;0;0 -13.7;18;21504;2.7305;3;1500;0;0;0;0;0;0;0 -13.8;18;21504;2.7305;2;1500;0;0;0;0;0;0;0 -13.9;18;21504;2.7305;1;1500;0;0;0;0;0;0;0 -14;18;21504;2.7305;1;1500;0;0;0;0;0;0;0 -14.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -14.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -14.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -14.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -14.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -14.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -14.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -14.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -14.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -15.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -16.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 -17;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.1;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.2;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.3;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.4;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.5;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.6;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.7;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.8;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +10.9;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +11;18;21504;2.7305;1500;1500;0;0;0;0;0;0;0 +11.1;18;21504;2.7305;1499;1500;0;0;0;0;0;0;0 +11.2;18;21504;2.7305;1499;1500;0;0;0;0;0;0;0 +11.3;18;21504;2.7305;1498;1500;0;0;0;0;0;0;0 +11.4;18;21504;2.7305;1498;1500;0;0;0;0;0;0;0 +11.5;18;21504;2.7305;1497;1500;0;0;0;0;0;0;0 +11.6;18;21504;2.7305;1399;1500;0;0;0;0;0;0;0 +11.7;18;21504;2.7305;1307;1500;0;0;0;0;0;0;0 +11.8;18;21504;2.7305;1221;1500;0;0;0;0;0;0;0 +11.9;18;21504;2.7305;1141;1500;0;0;0;0;0;0;0 +12;18;21504;2.7305;1066;1500;0;0;0;0;0;0;0 +12.1;18;21504;2.7305;788;1500;0;0;0;0;0;0;0 +12.2;18;21504;2.7305;582;1500;0;0;0;0;0;0;0 +12.3;18;21504;2.7305;431;1500;0;0;0;0;0;0;0 +12.4;18;21504;2.7305;318;1500;0;0;0;0;0;0;0 +12.5;18;21504;2.7305;235;1500;0;0;0;0;0;0;0 +12.6;18;21504;2.7305;185;1500;0;0;0;0;0;0;0 +12.7;18;21504;2.7305;146;1500;0;0;0;0;0;0;0 +12.8;18;21504;2.7305;115;1500;0;0;0;0;0;0;0 +12.9;18;21504;2.7305;90;1500;0;0;0;0;0;0;0 +13;18;21504;2.7305;71;1500;0;0;0;0;0;0;0 +13.1;18;21504;2.7305;50;1500;0;0;0;0;0;0;0 +13.2;18;21504;2.7305;35;1500;0;0;0;0;0;0;0 +13.3;18;21504;2.7305;25;1500;0;0;0;0;0;0;0 +13.4;18;21504;2.7305;18;1500;0;0;0;0;0;0;0 +13.5;18;21504;2.7305;12;1500;0;0;0;0;0;0;0 +13.6;18;21504;2.7305;7;1500;0;0;0;0;0;0;0 +13.7;18;21504;2.7305;3;1500;0;0;0;0;0;0;0 +13.8;18;21504;2.7305;2;1500;0;0;0;0;0;0;0 +13.9;18;21504;2.7305;1;1500;0;0;0;0;0;0;0 +14;18;21504;2.7305;1;1500;0;0;0;0;0;0;0 +14.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +14.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +15.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.1;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.2;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.3;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.4;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.5;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.6;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.7;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.8;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +16.9;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 +17;18;21504;2.7305;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs19_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs19_awgn_5G.csv index 85e7f6a712..3d18bd7987 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs19_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs19_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -10;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.1;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.2;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.3;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.4;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.5;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.6;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.7;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.8;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -10.9;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.1;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.2;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.3;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.4;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.5;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.6;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.7;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.8;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -11.9;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -12;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 -12.1;19;24072;3.0293;1499;1500;0;0;0;0;0;0;0 -12.2;19;24072;3.0293;1499;1500;0;0;0;0;0;0;0 -12.3;19;24072;3.0293;1498;1500;0;0;0;0;0;0;0 -12.4;19;24072;3.0293;1497;1500;0;0;0;0;0;0;0 -12.5;19;24072;3.0293;1497;1500;0;0;0;0;0;0;0 -12.6;19;24072;3.0293;1389;1500;0;0;0;0;0;0;0 -12.7;19;24072;3.0293;1290;1500;0;0;0;0;0;0;0 -12.8;19;24072;3.0293;1197;1500;0;0;0;0;0;0;0 -12.9;19;24072;3.0293;1111;1500;0;0;0;0;0;0;0 -13;19;24072;3.0293;1032;1500;0;0;0;0;0;0;0 -13.1;19;24072;3.0293;746;1500;0;0;0;0;0;0;0 -13.2;19;24072;3.0293;539;1500;0;0;0;0;0;0;0 -13.3;19;24072;3.0293;390;1500;0;0;0;0;0;0;0 -13.4;19;24072;3.0293;282;1500;0;0;0;0;0;0;0 -13.5;19;24072;3.0293;204;1500;0;0;0;0;0;0;0 -13.6;19;24072;3.0293;166;1500;0;0;0;0;0;0;0 -13.7;19;24072;3.0293;135;1500;0;0;0;0;0;0;0 -13.8;19;24072;3.0293;110;1500;0;0;0;0;0;0;0 -13.9;19;24072;3.0293;89;1500;0;0;0;0;0;0;0 -14;19;24072;3.0293;73;1500;0;0;0;0;0;0;0 -14.1;19;24072;3.0293;54;1500;0;0;0;0;0;0;0 -14.2;19;24072;3.0293;41;1500;0;0;0;0;0;0;0 -14.3;19;24072;3.0293;30;1500;0;0;0;0;0;0;0 -14.4;19;24072;3.0293;23;1500;0;0;0;0;0;0;0 -14.5;19;24072;3.0293;17;1500;0;0;0;0;0;0;0 -14.6;19;24072;3.0293;9;1500;0;0;0;0;0;0;0 -14.7;19;24072;3.0293;5;1500;0;0;0;0;0;0;0 -14.8;19;24072;3.0293;3;1500;0;0;0;0;0;0;0 -14.9;19;24072;3.0293;2;1500;0;0;0;0;0;0;0 -15;19;24072;3.0293;1;1500;0;0;0;0;0;0;0 -15.1;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -15.2;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -15.3;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -15.4;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -15.5;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -15.6;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -15.7;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -15.8;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -15.9;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.1;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.2;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.3;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.4;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.5;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.6;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.7;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.8;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -16.9;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 -17;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.1;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.2;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.3;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.4;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.5;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.6;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.7;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.8;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +10.9;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.1;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.2;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.3;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.4;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.5;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.6;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.7;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.8;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +11.9;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +12;19;24072;3.0293;1500;1500;0;0;0;0;0;0;0 +12.1;19;24072;3.0293;1499;1500;0;0;0;0;0;0;0 +12.2;19;24072;3.0293;1499;1500;0;0;0;0;0;0;0 +12.3;19;24072;3.0293;1498;1500;0;0;0;0;0;0;0 +12.4;19;24072;3.0293;1497;1500;0;0;0;0;0;0;0 +12.5;19;24072;3.0293;1497;1500;0;0;0;0;0;0;0 +12.6;19;24072;3.0293;1389;1500;0;0;0;0;0;0;0 +12.7;19;24072;3.0293;1290;1500;0;0;0;0;0;0;0 +12.8;19;24072;3.0293;1197;1500;0;0;0;0;0;0;0 +12.9;19;24072;3.0293;1111;1500;0;0;0;0;0;0;0 +13;19;24072;3.0293;1032;1500;0;0;0;0;0;0;0 +13.1;19;24072;3.0293;746;1500;0;0;0;0;0;0;0 +13.2;19;24072;3.0293;539;1500;0;0;0;0;0;0;0 +13.3;19;24072;3.0293;390;1500;0;0;0;0;0;0;0 +13.4;19;24072;3.0293;282;1500;0;0;0;0;0;0;0 +13.5;19;24072;3.0293;204;1500;0;0;0;0;0;0;0 +13.6;19;24072;3.0293;166;1500;0;0;0;0;0;0;0 +13.7;19;24072;3.0293;135;1500;0;0;0;0;0;0;0 +13.8;19;24072;3.0293;110;1500;0;0;0;0;0;0;0 +13.9;19;24072;3.0293;89;1500;0;0;0;0;0;0;0 +14;19;24072;3.0293;73;1500;0;0;0;0;0;0;0 +14.1;19;24072;3.0293;54;1500;0;0;0;0;0;0;0 +14.2;19;24072;3.0293;41;1500;0;0;0;0;0;0;0 +14.3;19;24072;3.0293;30;1500;0;0;0;0;0;0;0 +14.4;19;24072;3.0293;23;1500;0;0;0;0;0;0;0 +14.5;19;24072;3.0293;17;1500;0;0;0;0;0;0;0 +14.6;19;24072;3.0293;9;1500;0;0;0;0;0;0;0 +14.7;19;24072;3.0293;5;1500;0;0;0;0;0;0;0 +14.8;19;24072;3.0293;3;1500;0;0;0;0;0;0;0 +14.9;19;24072;3.0293;2;1500;0;0;0;0;0;0;0 +15;19;24072;3.0293;1;1500;0;0;0;0;0;0;0 +15.1;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.2;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.3;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.4;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.5;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.6;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.7;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.8;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +15.9;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.1;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.2;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.3;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.4;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.5;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.6;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.7;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.8;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +16.9;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 +17;19;24072;3.0293;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs1_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs1_awgn_5G.csv index 4a22a46882..ccb17b0d1c 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs1_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs1_awgn_5G.csv @@ -1,27 +1,27 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --4;1;2472;0.3066;1500;1500;0;0;0;0;0;0;0 --3.9;1;2472;0.3066;1497;1500;0;0;0;0;0;0;0 --3.8;1;2472;0.3066;1494;1500;0;0;0;0;0;0;0 --3.7;1;2472;0.3066;1490;1500;0;0;0;0;0;0;0 --3.6;1;2472;0.3066;1487;1500;0;0;0;0;0;0;0 --3.5;1;2472;0.3066;1484;1500;0;0;0;0;0;0;0 --3.4;1;2472;0.3066;1386;1500;0;0;0;0;0;0;0 --3.3;1;2472;0.3066;1295;1500;0;0;0;0;0;0;0 --3.2;1;2472;0.3066;1209;1500;0;0;0;0;0;0;0 --3.1;1;2472;0.3066;1130;1500;0;0;0;0;0;0;0 --3;1;2472;0.3066;1055;1500;0;0;0;0;0;0;0 --2.9;1;2472;0.3066;863;1500;0;0;0;0;0;0;0 --2.8;1;2472;0.3066;706;1500;0;0;0;0;0;0;0 --2.7;1;2472;0.3066;577;1500;0;0;0;0;0;0;0 --2.6;1;2472;0.3066;472;1500;0;0;0;0;0;0;0 --2.5;1;2472;0.3066;386;1500;0;0;0;0;0;0;0 --2.4;1;2472;0.3066;215;1500;0;0;0;0;0;0;0 --2.3;1;2472;0.3066;120;1500;0;0;0;0;0;0;0 --2.2;1;2472;0.3066;67;1500;0;0;0;0;0;0;0 --2.1;1;2472;0.3066;37;1500;0;0;0;0;0;0;0 --2;1;2472;0.3066;21;1500;0;0;0;0;0;0;0 --1.9;1;2472;0.3066;9;1500;0;0;0;0;0;0;0 --1.8;1;2472;0.3066;4;1500;0;0;0;0;0;0;0 --1.7;1;2472;0.3066;2;1500;0;0;0;0;0;0;0 --1.6;1;2472;0.3066;1;1500;0;0;0;0;0;0;0 --1.5;1;2472;0.3066;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-4;1;2472;0.3066;1500;1500;0;0;0;0;0;0;0 +-3.9;1;2472;0.3066;1497;1500;0;0;0;0;0;0;0 +-3.8;1;2472;0.3066;1494;1500;0;0;0;0;0;0;0 +-3.7;1;2472;0.3066;1490;1500;0;0;0;0;0;0;0 +-3.6;1;2472;0.3066;1487;1500;0;0;0;0;0;0;0 +-3.5;1;2472;0.3066;1484;1500;0;0;0;0;0;0;0 +-3.4;1;2472;0.3066;1386;1500;0;0;0;0;0;0;0 +-3.3;1;2472;0.3066;1295;1500;0;0;0;0;0;0;0 +-3.2;1;2472;0.3066;1209;1500;0;0;0;0;0;0;0 +-3.1;1;2472;0.3066;1130;1500;0;0;0;0;0;0;0 +-3;1;2472;0.3066;1055;1500;0;0;0;0;0;0;0 +-2.9;1;2472;0.3066;863;1500;0;0;0;0;0;0;0 +-2.8;1;2472;0.3066;706;1500;0;0;0;0;0;0;0 +-2.7;1;2472;0.3066;577;1500;0;0;0;0;0;0;0 +-2.6;1;2472;0.3066;472;1500;0;0;0;0;0;0;0 +-2.5;1;2472;0.3066;386;1500;0;0;0;0;0;0;0 +-2.4;1;2472;0.3066;215;1500;0;0;0;0;0;0;0 +-2.3;1;2472;0.3066;120;1500;0;0;0;0;0;0;0 +-2.2;1;2472;0.3066;67;1500;0;0;0;0;0;0;0 +-2.1;1;2472;0.3066;37;1500;0;0;0;0;0;0;0 +-2;1;2472;0.3066;21;1500;0;0;0;0;0;0;0 +-1.9;1;2472;0.3066;9;1500;0;0;0;0;0;0;0 +-1.8;1;2472;0.3066;4;1500;0;0;0;0;0;0;0 +-1.7;1;2472;0.3066;2;1500;0;0;0;0;0;0;0 +-1.6;1;2472;0.3066;1;1500;0;0;0;0;0;0;0 +-1.5;1;2472;0.3066;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs20_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs20_awgn_5G.csv index 545c8fc099..69d0055395 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs20_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs20_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -10;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -10.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -11.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -12.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -13;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 -13.1;20;26632;3.3223;1499;1500;0;0;0;0;0;0;0 -13.2;20;26632;3.3223;1499;1500;0;0;0;0;0;0;0 -13.3;20;26632;3.3223;1498;1500;0;0;0;0;0;0;0 -13.4;20;26632;3.3223;1498;1500;0;0;0;0;0;0;0 -13.5;20;26632;3.3223;1497;1500;0;0;0;0;0;0;0 -13.6;20;26632;3.3223;1390;1500;0;0;0;0;0;0;0 -13.7;20;26632;3.3223;1291;1500;0;0;0;0;0;0;0 -13.8;20;26632;3.3223;1199;1500;0;0;0;0;0;0;0 -13.9;20;26632;3.3223;1113;1500;0;0;0;0;0;0;0 -14;20;26632;3.3223;1034;1500;0;0;0;0;0;0;0 -14.1;20;26632;3.3223;745;1500;0;0;0;0;0;0;0 -14.2;20;26632;3.3223;537;1500;0;0;0;0;0;0;0 -14.3;20;26632;3.3223;387;1500;0;0;0;0;0;0;0 -14.4;20;26632;3.3223;279;1500;0;0;0;0;0;0;0 -14.5;20;26632;3.3223;201;1500;0;0;0;0;0;0;0 -14.6;20;26632;3.3223;161;1500;0;0;0;0;0;0;0 -14.7;20;26632;3.3223;129;1500;0;0;0;0;0;0;0 -14.8;20;26632;3.3223;104;1500;0;0;0;0;0;0;0 -14.9;20;26632;3.3223;83;1500;0;0;0;0;0;0;0 -15;20;26632;3.3223;67;1500;0;0;0;0;0;0;0 -15.1;20;26632;3.3223;45;1500;0;0;0;0;0;0;0 -15.2;20;26632;3.3223;30;1500;0;0;0;0;0;0;0 -15.3;20;26632;3.3223;20;1500;0;0;0;0;0;0;0 -15.4;20;26632;3.3223;13;1500;0;0;0;0;0;0;0 -15.5;20;26632;3.3223;9;1500;0;0;0;0;0;0;0 -15.6;20;26632;3.3223;4;1500;0;0;0;0;0;0;0 -15.7;20;26632;3.3223;1;1500;0;0;0;0;0;0;0 -15.8;20;26632;3.3223;1;1500;0;0;0;0;0;0;0 -15.9;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.1;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.2;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.3;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.4;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.5;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.6;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.7;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.8;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -16.9;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 -17;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +10.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +11.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.1;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.2;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.3;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.4;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.5;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.6;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.7;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.8;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +12.9;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +13;20;26632;3.3223;1500;1500;0;0;0;0;0;0;0 +13.1;20;26632;3.3223;1499;1500;0;0;0;0;0;0;0 +13.2;20;26632;3.3223;1499;1500;0;0;0;0;0;0;0 +13.3;20;26632;3.3223;1498;1500;0;0;0;0;0;0;0 +13.4;20;26632;3.3223;1498;1500;0;0;0;0;0;0;0 +13.5;20;26632;3.3223;1497;1500;0;0;0;0;0;0;0 +13.6;20;26632;3.3223;1390;1500;0;0;0;0;0;0;0 +13.7;20;26632;3.3223;1291;1500;0;0;0;0;0;0;0 +13.8;20;26632;3.3223;1199;1500;0;0;0;0;0;0;0 +13.9;20;26632;3.3223;1113;1500;0;0;0;0;0;0;0 +14;20;26632;3.3223;1034;1500;0;0;0;0;0;0;0 +14.1;20;26632;3.3223;745;1500;0;0;0;0;0;0;0 +14.2;20;26632;3.3223;537;1500;0;0;0;0;0;0;0 +14.3;20;26632;3.3223;387;1500;0;0;0;0;0;0;0 +14.4;20;26632;3.3223;279;1500;0;0;0;0;0;0;0 +14.5;20;26632;3.3223;201;1500;0;0;0;0;0;0;0 +14.6;20;26632;3.3223;161;1500;0;0;0;0;0;0;0 +14.7;20;26632;3.3223;129;1500;0;0;0;0;0;0;0 +14.8;20;26632;3.3223;104;1500;0;0;0;0;0;0;0 +14.9;20;26632;3.3223;83;1500;0;0;0;0;0;0;0 +15;20;26632;3.3223;67;1500;0;0;0;0;0;0;0 +15.1;20;26632;3.3223;45;1500;0;0;0;0;0;0;0 +15.2;20;26632;3.3223;30;1500;0;0;0;0;0;0;0 +15.3;20;26632;3.3223;20;1500;0;0;0;0;0;0;0 +15.4;20;26632;3.3223;13;1500;0;0;0;0;0;0;0 +15.5;20;26632;3.3223;9;1500;0;0;0;0;0;0;0 +15.6;20;26632;3.3223;4;1500;0;0;0;0;0;0;0 +15.7;20;26632;3.3223;1;1500;0;0;0;0;0;0;0 +15.8;20;26632;3.3223;1;1500;0;0;0;0;0;0;0 +15.9;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.1;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.2;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.3;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.4;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.5;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.6;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.7;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.8;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +16.9;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 +17;20;26632;3.3223;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs21_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs21_awgn_5G.csv index a9fe3dd606..2a5a691afb 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs21_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs21_awgn_5G.csv @@ -1,72 +1,72 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -10;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -10.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -11.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -12.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -13.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -14;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 -14.1;21;28680;3.6094;1472;1500;0;0;0;0;0;0;0 -14.2;21;28680;3.6094;1444;1500;0;0;0;0;0;0;0 -14.3;21;28680;3.6094;1417;1500;0;0;0;0;0;0;0 -14.4;21;28680;3.6094;1390;1500;0;0;0;0;0;0;0 -14.5;21;28680;3.6094;1364;1500;0;0;0;0;0;0;0 -14.6;21;28680;3.6094;1040;1500;0;0;0;0;0;0;0 -14.7;21;28680;3.6094;793;1500;0;0;0;0;0;0;0 -14.8;21;28680;3.6094;605;1500;0;0;0;0;0;0;0 -14.9;21;28680;3.6094;461;1500;0;0;0;0;0;0;0 -15;21;28680;3.6094;351;1500;0;0;0;0;0;0;0 -15.1;21;28680;3.6094;265;1500;0;0;0;0;0;0;0 -15.2;21;28680;3.6094;199;1500;0;0;0;0;0;0;0 -15.3;21;28680;3.6094;150;1500;0;0;0;0;0;0;0 -15.4;21;28680;3.6094;113;1500;0;0;0;0;0;0;0 -15.5;21;28680;3.6094;85;1500;0;0;0;0;0;0;0 -15.6;21;28680;3.6094;79;1500;0;0;0;0;0;0;0 -15.7;21;28680;3.6094;73;1500;0;0;0;0;0;0;0 -15.8;21;28680;3.6094;67;1500;0;0;0;0;0;0;0 -15.9;21;28680;3.6094;62;1500;0;0;0;0;0;0;0 -16;21;28680;3.6094;57;1500;0;0;0;0;0;0;0 -16.1;21;28680;3.6094;37;1500;0;0;0;0;0;0;0 -16.2;21;28680;3.6094;23;1500;0;0;0;0;0;0;0 -16.3;21;28680;3.6094;15;1500;0;0;0;0;0;0;0 -16.4;21;28680;3.6094;10;1500;0;0;0;0;0;0;0 -16.5;21;28680;3.6094;6;1500;0;0;0;0;0;0;0 -16.6;21;28680;3.6094;3;1500;0;0;0;0;0;0;0 -16.7;21;28680;3.6094;1;1500;0;0;0;0;0;0;0 -16.8;21;28680;3.6094;1;1500;0;0;0;0;0;0;0 -16.9;21;28680;3.6094;0;1500;0;0;0;0;0;0;0 -17;21;28680;3.6094;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +10;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +10.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +11.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +12.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.1;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.2;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.3;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.4;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.5;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.6;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.7;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.8;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +13.9;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +14;21;28680;3.6094;1500;1500;0;0;0;0;0;0;0 +14.1;21;28680;3.6094;1472;1500;0;0;0;0;0;0;0 +14.2;21;28680;3.6094;1444;1500;0;0;0;0;0;0;0 +14.3;21;28680;3.6094;1417;1500;0;0;0;0;0;0;0 +14.4;21;28680;3.6094;1390;1500;0;0;0;0;0;0;0 +14.5;21;28680;3.6094;1364;1500;0;0;0;0;0;0;0 +14.6;21;28680;3.6094;1040;1500;0;0;0;0;0;0;0 +14.7;21;28680;3.6094;793;1500;0;0;0;0;0;0;0 +14.8;21;28680;3.6094;605;1500;0;0;0;0;0;0;0 +14.9;21;28680;3.6094;461;1500;0;0;0;0;0;0;0 +15;21;28680;3.6094;351;1500;0;0;0;0;0;0;0 +15.1;21;28680;3.6094;265;1500;0;0;0;0;0;0;0 +15.2;21;28680;3.6094;199;1500;0;0;0;0;0;0;0 +15.3;21;28680;3.6094;150;1500;0;0;0;0;0;0;0 +15.4;21;28680;3.6094;113;1500;0;0;0;0;0;0;0 +15.5;21;28680;3.6094;85;1500;0;0;0;0;0;0;0 +15.6;21;28680;3.6094;79;1500;0;0;0;0;0;0;0 +15.7;21;28680;3.6094;73;1500;0;0;0;0;0;0;0 +15.8;21;28680;3.6094;67;1500;0;0;0;0;0;0;0 +15.9;21;28680;3.6094;62;1500;0;0;0;0;0;0;0 +16;21;28680;3.6094;57;1500;0;0;0;0;0;0;0 +16.1;21;28680;3.6094;37;1500;0;0;0;0;0;0;0 +16.2;21;28680;3.6094;23;1500;0;0;0;0;0;0;0 +16.3;21;28680;3.6094;15;1500;0;0;0;0;0;0;0 +16.4;21;28680;3.6094;10;1500;0;0;0;0;0;0;0 +16.5;21;28680;3.6094;6;1500;0;0;0;0;0;0;0 +16.6;21;28680;3.6094;3;1500;0;0;0;0;0;0;0 +16.7;21;28680;3.6094;1;1500;0;0;0;0;0;0;0 +16.8;21;28680;3.6094;1;1500;0;0;0;0;0;0;0 +16.9;21;28680;3.6094;0;1500;0;0;0;0;0;0;0 +17;21;28680;3.6094;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs22_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs22_awgn_5G.csv index c4e69590a5..10a4241376 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs22_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs22_awgn_5G.csv @@ -1,52 +1,52 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -14;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.1;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.2;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.3;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.4;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.5;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.6;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.7;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.8;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -14.9;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -15;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 -15.1;22;31240;3.9023;1421;1500;0;0;0;0;0;0;0 -15.2;22;31240;3.9023;1347;1500;0;0;0;0;0;0;0 -15.3;22;31240;3.9023;1276;1500;0;0;0;0;0;0;0 -15.4;22;31240;3.9023;1209;1500;0;0;0;0;0;0;0 -15.5;22;31240;3.9023;1146;1500;0;0;0;0;0;0;0 -15.6;22;31240;3.9023;807;1500;0;0;0;0;0;0;0 -15.7;22;31240;3.9023;569;1500;0;0;0;0;0;0;0 -15.8;22;31240;3.9023;400;1500;0;0;0;0;0;0;0 -15.9;22;31240;3.9023;282;1500;0;0;0;0;0;0;0 -16;22;31240;3.9023;199;1500;0;0;0;0;0;0;0 -16.1;22;31240;3.9023;165;1500;0;0;0;0;0;0;0 -16.2;22;31240;3.9023;137;1500;0;0;0;0;0;0;0 -16.3;22;31240;3.9023;114;1500;0;0;0;0;0;0;0 -16.4;22;31240;3.9023;94;1500;0;0;0;0;0;0;0 -16.5;22;31240;3.9023;78;1500;0;0;0;0;0;0;0 -16.6;22;31240;3.9023;74;1500;0;0;0;0;0;0;0 -16.7;22;31240;3.9023;69;1500;0;0;0;0;0;0;0 -16.8;22;31240;3.9023;65;1500;0;0;0;0;0;0;0 -16.9;22;31240;3.9023;61;1500;0;0;0;0;0;0;0 -17;22;31240;3.9023;58;1500;0;0;0;0;0;0;0 -17.1;22;31240;3.9023;36;1500;0;0;0;0;0;0;0 -17.2;22;31240;3.9023;23;1500;0;0;0;0;0;0;0 -17.3;22;31240;3.9023;15;1500;0;0;0;0;0;0;0 -17.4;22;31240;3.9023;9;1500;0;0;0;0;0;0;0 -17.5;22;31240;3.9023;6;1500;0;0;0;0;0;0;0 -17.6;22;31240;3.9023;3;1500;0;0;0;0;0;0;0 -17.7;22;31240;3.9023;1;1500;0;0;0;0;0;0;0 -17.8;22;31240;3.9023;1;1500;0;0;0;0;0;0;0 -17.9;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.1;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.2;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.3;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.4;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.5;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.6;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.7;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.8;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -18.9;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 -19;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +14;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.1;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.2;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.3;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.4;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.5;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.6;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.7;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.8;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +14.9;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +15;22;31240;3.9023;1500;1500;0;0;0;0;0;0;0 +15.1;22;31240;3.9023;1421;1500;0;0;0;0;0;0;0 +15.2;22;31240;3.9023;1347;1500;0;0;0;0;0;0;0 +15.3;22;31240;3.9023;1276;1500;0;0;0;0;0;0;0 +15.4;22;31240;3.9023;1209;1500;0;0;0;0;0;0;0 +15.5;22;31240;3.9023;1146;1500;0;0;0;0;0;0;0 +15.6;22;31240;3.9023;807;1500;0;0;0;0;0;0;0 +15.7;22;31240;3.9023;569;1500;0;0;0;0;0;0;0 +15.8;22;31240;3.9023;400;1500;0;0;0;0;0;0;0 +15.9;22;31240;3.9023;282;1500;0;0;0;0;0;0;0 +16;22;31240;3.9023;199;1500;0;0;0;0;0;0;0 +16.1;22;31240;3.9023;165;1500;0;0;0;0;0;0;0 +16.2;22;31240;3.9023;137;1500;0;0;0;0;0;0;0 +16.3;22;31240;3.9023;114;1500;0;0;0;0;0;0;0 +16.4;22;31240;3.9023;94;1500;0;0;0;0;0;0;0 +16.5;22;31240;3.9023;78;1500;0;0;0;0;0;0;0 +16.6;22;31240;3.9023;74;1500;0;0;0;0;0;0;0 +16.7;22;31240;3.9023;69;1500;0;0;0;0;0;0;0 +16.8;22;31240;3.9023;65;1500;0;0;0;0;0;0;0 +16.9;22;31240;3.9023;61;1500;0;0;0;0;0;0;0 +17;22;31240;3.9023;58;1500;0;0;0;0;0;0;0 +17.1;22;31240;3.9023;36;1500;0;0;0;0;0;0;0 +17.2;22;31240;3.9023;23;1500;0;0;0;0;0;0;0 +17.3;22;31240;3.9023;15;1500;0;0;0;0;0;0;0 +17.4;22;31240;3.9023;9;1500;0;0;0;0;0;0;0 +17.5;22;31240;3.9023;6;1500;0;0;0;0;0;0;0 +17.6;22;31240;3.9023;3;1500;0;0;0;0;0;0;0 +17.7;22;31240;3.9023;1;1500;0;0;0;0;0;0;0 +17.8;22;31240;3.9023;1;1500;0;0;0;0;0;0;0 +17.9;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.1;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.2;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.3;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.4;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.5;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.6;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.7;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.8;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +18.9;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 +19;22;31240;3.9023;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs23_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs23_awgn_5G.csv index 4ac1243d3b..07e9e257ff 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs23_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs23_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -15;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 -15.1;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 -15.2;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 -15.3;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 -15.4;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 -15.5;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 -15.6;23;33816;4.2129;1499;1500;0;0;0;0;0;0;0 -15.7;23;33816;4.2129;1499;1500;0;0;0;0;0;0;0 -15.8;23;33816;4.2129;1498;1500;0;0;0;0;0;0;0 -15.9;23;33816;4.2129;1498;1500;0;0;0;0;0;0;0 -16;23;33816;4.2129;1497;1500;0;0;0;0;0;0;0 -16.1;23;33816;4.2129;1360;1500;0;0;0;0;0;0;0 -16.2;23;33816;4.2129;1236;1500;0;0;0;0;0;0;0 -16.3;23;33816;4.2129;1123;1500;0;0;0;0;0;0;0 -16.4;23;33816;4.2129;1020;1500;0;0;0;0;0;0;0 -16.5;23;33816;4.2129;927;1500;0;0;0;0;0;0;0 -16.6;23;33816;4.2129;630;1500;0;0;0;0;0;0;0 -16.7;23;33816;4.2129;428;1500;0;0;0;0;0;0;0 -16.8;23;33816;4.2129;291;1500;0;0;0;0;0;0;0 -16.9;23;33816;4.2129;198;1500;0;0;0;0;0;0;0 -17;23;33816;4.2129;135;1500;0;0;0;0;0;0;0 -17.1;23;33816;4.2129;120;1500;0;0;0;0;0;0;0 -17.2;23;33816;4.2129;108;1500;0;0;0;0;0;0;0 -17.3;23;33816;4.2129;96;1500;0;0;0;0;0;0;0 -17.4;23;33816;4.2129;86;1500;0;0;0;0;0;0;0 -17.5;23;33816;4.2129;77;1500;0;0;0;0;0;0;0 -17.6;23;33816;4.2129;70;1500;0;0;0;0;0;0;0 -17.7;23;33816;4.2129;63;1500;0;0;0;0;0;0;0 -17.8;23;33816;4.2129;57;1500;0;0;0;0;0;0;0 -17.9;23;33816;4.2129;52;1500;0;0;0;0;0;0;0 -18;23;33816;4.2129;47;1500;0;0;0;0;0;0;0 -18.1;23;33816;4.2129;28;1500;0;0;0;0;0;0;0 -18.2;23;33816;4.2129;16;1500;0;0;0;0;0;0;0 -18.3;23;33816;4.2129;9;1500;0;0;0;0;0;0;0 -18.4;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 -18.5;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 -18.6;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 -18.7;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 -18.8;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 -18.9;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 -19;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 -19.1;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 -19.2;23;33816;4.2129;4;1500;0;0;0;0;0;0;0 -19.3;23;33816;4.2129;5;1500;0;0;0;0;0;0;0 -19.4;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 -19.5;23;33816;4.2129;8;1500;0;0;0;0;0;0;0 -19.6;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 -19.7;23;33816;4.2129;4;1500;0;0;0;0;0;0;0 -19.8;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 -19.9;23;33816;4.2129;2;1500;0;0;0;0;0;0;0 -20;23;33816;4.2129;2;1500;0;0;0;0;0;0;0 -20.1;23;33816;4.2129;1;1500;0;0;0;0;0;0;0 -20.2;23;33816;4.2129;1;1500;0;0;0;0;0;0;0 -20.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -20.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -20.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -20.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -20.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -20.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -20.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -21.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -22.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -23.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 -24;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +15;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.1;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.2;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.3;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.4;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.5;23;33816;4.2129;1500;1500;0;0;0;0;0;0;0 +15.6;23;33816;4.2129;1499;1500;0;0;0;0;0;0;0 +15.7;23;33816;4.2129;1499;1500;0;0;0;0;0;0;0 +15.8;23;33816;4.2129;1498;1500;0;0;0;0;0;0;0 +15.9;23;33816;4.2129;1498;1500;0;0;0;0;0;0;0 +16;23;33816;4.2129;1497;1500;0;0;0;0;0;0;0 +16.1;23;33816;4.2129;1360;1500;0;0;0;0;0;0;0 +16.2;23;33816;4.2129;1236;1500;0;0;0;0;0;0;0 +16.3;23;33816;4.2129;1123;1500;0;0;0;0;0;0;0 +16.4;23;33816;4.2129;1020;1500;0;0;0;0;0;0;0 +16.5;23;33816;4.2129;927;1500;0;0;0;0;0;0;0 +16.6;23;33816;4.2129;630;1500;0;0;0;0;0;0;0 +16.7;23;33816;4.2129;428;1500;0;0;0;0;0;0;0 +16.8;23;33816;4.2129;291;1500;0;0;0;0;0;0;0 +16.9;23;33816;4.2129;198;1500;0;0;0;0;0;0;0 +17;23;33816;4.2129;135;1500;0;0;0;0;0;0;0 +17.1;23;33816;4.2129;120;1500;0;0;0;0;0;0;0 +17.2;23;33816;4.2129;108;1500;0;0;0;0;0;0;0 +17.3;23;33816;4.2129;96;1500;0;0;0;0;0;0;0 +17.4;23;33816;4.2129;86;1500;0;0;0;0;0;0;0 +17.5;23;33816;4.2129;77;1500;0;0;0;0;0;0;0 +17.6;23;33816;4.2129;70;1500;0;0;0;0;0;0;0 +17.7;23;33816;4.2129;63;1500;0;0;0;0;0;0;0 +17.8;23;33816;4.2129;57;1500;0;0;0;0;0;0;0 +17.9;23;33816;4.2129;52;1500;0;0;0;0;0;0;0 +18;23;33816;4.2129;47;1500;0;0;0;0;0;0;0 +18.1;23;33816;4.2129;28;1500;0;0;0;0;0;0;0 +18.2;23;33816;4.2129;16;1500;0;0;0;0;0;0;0 +18.3;23;33816;4.2129;9;1500;0;0;0;0;0;0;0 +18.4;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 +18.5;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +18.6;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +18.7;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +18.8;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +18.9;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +19;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +19.1;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +19.2;23;33816;4.2129;4;1500;0;0;0;0;0;0;0 +19.3;23;33816;4.2129;5;1500;0;0;0;0;0;0;0 +19.4;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 +19.5;23;33816;4.2129;8;1500;0;0;0;0;0;0;0 +19.6;23;33816;4.2129;6;1500;0;0;0;0;0;0;0 +19.7;23;33816;4.2129;4;1500;0;0;0;0;0;0;0 +19.8;23;33816;4.2129;3;1500;0;0;0;0;0;0;0 +19.9;23;33816;4.2129;2;1500;0;0;0;0;0;0;0 +20;23;33816;4.2129;2;1500;0;0;0;0;0;0;0 +20.1;23;33816;4.2129;1;1500;0;0;0;0;0;0;0 +20.2;23;33816;4.2129;1;1500;0;0;0;0;0;0;0 +20.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +20.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +21.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +22.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.1;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.2;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.3;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.4;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.5;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.6;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.7;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.8;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +23.9;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 +24;23;33816;4.2129;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs24_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs24_awgn_5G.csv index 5bed20cf58..6eac0f3f7d 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs24_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs24_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -15;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.1;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.2;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.3;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.4;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.5;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.6;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.7;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.8;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -15.9;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -16;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -16.1;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -16.2;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -16.3;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -16.4;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -16.5;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 -16.6;24;35856;4.5234;1474;1500;0;0;0;0;0;0;0 -16.7;24;35856;4.5234;1449;1500;0;0;0;0;0;0;0 -16.8;24;35856;4.5234;1424;1500;0;0;0;0;0;0;0 -16.9;24;35856;4.5234;1400;1500;0;0;0;0;0;0;0 -17;24;35856;4.5234;1376;1500;0;0;0;0;0;0;0 -17.1;24;35856;4.5234;1016;1500;0;0;0;0;0;0;0 -17.2;24;35856;4.5234;751;1500;0;0;0;0;0;0;0 -17.3;24;35856;4.5234;554;1500;0;0;0;0;0;0;0 -17.4;24;35856;4.5234;410;1500;0;0;0;0;0;0;0 -17.5;24;35856;4.5234;303;1500;0;0;0;0;0;0;0 -17.6;24;35856;4.5234;232;1500;0;0;0;0;0;0;0 -17.7;24;35856;4.5234;177;1500;0;0;0;0;0;0;0 -17.8;24;35856;4.5234;136;1500;0;0;0;0;0;0;0 -17.9;24;35856;4.5234;104;1500;0;0;0;0;0;0;0 -18;24;35856;4.5234;80;1500;0;0;0;0;0;0;0 -18.1;24;35856;4.5234;79;1500;0;0;0;0;0;0;0 -18.2;24;35856;4.5234;78;1500;0;0;0;0;0;0;0 -18.3;24;35856;4.5234;77;1500;0;0;0;0;0;0;0 -18.4;24;35856;4.5234;76;1500;0;0;0;0;0;0;0 -18.5;24;35856;4.5234;75;1500;0;0;0;0;0;0;0 -18.6;24;35856;4.5234;59;1500;0;0;0;0;0;0;0 -18.7;24;35856;4.5234;46;1500;0;0;0;0;0;0;0 -18.8;24;35856;4.5234;36;1500;0;0;0;0;0;0;0 -18.9;24;35856;4.5234;28;1500;0;0;0;0;0;0;0 -19;24;35856;4.5234;22;1500;0;0;0;0;0;0;0 -19.1;24;35856;4.5234;21;1500;0;0;0;0;0;0;0 -19.2;24;35856;4.5234;20;1500;0;0;0;0;0;0;0 -19.3;24;35856;4.5234;20;1500;0;0;0;0;0;0;0 -19.4;24;35856;4.5234;19;1500;0;0;0;0;0;0;0 -19.5;24;35856;4.5234;18;1500;0;0;0;0;0;0;0 -19.6;24;35856;4.5234;22;1500;0;0;0;0;0;0;0 -19.7;24;35856;4.5234;26;1500;0;0;0;0;0;0;0 -19.8;24;35856;4.5234;31;1500;0;0;0;0;0;0;0 -19.9;24;35856;4.5234;36;1500;0;0;0;0;0;0;0 -20;24;35856;4.5234;43;1500;0;0;0;0;0;0;0 -20.1;24;35856;4.5234;35;1500;0;0;0;0;0;0;0 -20.2;24;35856;4.5234;29;1500;0;0;0;0;0;0;0 -20.3;24;35856;4.5234;23;1500;0;0;0;0;0;0;0 -20.4;24;35856;4.5234;19;1500;0;0;0;0;0;0;0 -20.5;24;35856;4.5234;15;1500;0;0;0;0;0;0;0 -20.6;24;35856;4.5234;8;1500;0;0;0;0;0;0;0 -20.7;24;35856;4.5234;4;1500;0;0;0;0;0;0;0 -20.8;24;35856;4.5234;2;1500;0;0;0;0;0;0;0 -20.9;24;35856;4.5234;1;1500;0;0;0;0;0;0;0 -21;24;35856;4.5234;1;1500;0;0;0;0;0;0;0 -21.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -21.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -21.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -21.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -21.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -21.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -21.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -21.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -21.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -22.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -23.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 -24;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +15;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.1;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.2;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.3;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.4;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.5;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.6;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.7;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.8;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +15.9;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.1;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.2;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.3;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.4;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.5;24;35856;4.5234;1500;1500;0;0;0;0;0;0;0 +16.6;24;35856;4.5234;1474;1500;0;0;0;0;0;0;0 +16.7;24;35856;4.5234;1449;1500;0;0;0;0;0;0;0 +16.8;24;35856;4.5234;1424;1500;0;0;0;0;0;0;0 +16.9;24;35856;4.5234;1400;1500;0;0;0;0;0;0;0 +17;24;35856;4.5234;1376;1500;0;0;0;0;0;0;0 +17.1;24;35856;4.5234;1016;1500;0;0;0;0;0;0;0 +17.2;24;35856;4.5234;751;1500;0;0;0;0;0;0;0 +17.3;24;35856;4.5234;554;1500;0;0;0;0;0;0;0 +17.4;24;35856;4.5234;410;1500;0;0;0;0;0;0;0 +17.5;24;35856;4.5234;303;1500;0;0;0;0;0;0;0 +17.6;24;35856;4.5234;232;1500;0;0;0;0;0;0;0 +17.7;24;35856;4.5234;177;1500;0;0;0;0;0;0;0 +17.8;24;35856;4.5234;136;1500;0;0;0;0;0;0;0 +17.9;24;35856;4.5234;104;1500;0;0;0;0;0;0;0 +18;24;35856;4.5234;80;1500;0;0;0;0;0;0;0 +18.1;24;35856;4.5234;79;1500;0;0;0;0;0;0;0 +18.2;24;35856;4.5234;78;1500;0;0;0;0;0;0;0 +18.3;24;35856;4.5234;77;1500;0;0;0;0;0;0;0 +18.4;24;35856;4.5234;76;1500;0;0;0;0;0;0;0 +18.5;24;35856;4.5234;75;1500;0;0;0;0;0;0;0 +18.6;24;35856;4.5234;59;1500;0;0;0;0;0;0;0 +18.7;24;35856;4.5234;46;1500;0;0;0;0;0;0;0 +18.8;24;35856;4.5234;36;1500;0;0;0;0;0;0;0 +18.9;24;35856;4.5234;28;1500;0;0;0;0;0;0;0 +19;24;35856;4.5234;22;1500;0;0;0;0;0;0;0 +19.1;24;35856;4.5234;21;1500;0;0;0;0;0;0;0 +19.2;24;35856;4.5234;20;1500;0;0;0;0;0;0;0 +19.3;24;35856;4.5234;20;1500;0;0;0;0;0;0;0 +19.4;24;35856;4.5234;19;1500;0;0;0;0;0;0;0 +19.5;24;35856;4.5234;18;1500;0;0;0;0;0;0;0 +19.6;24;35856;4.5234;22;1500;0;0;0;0;0;0;0 +19.7;24;35856;4.5234;26;1500;0;0;0;0;0;0;0 +19.8;24;35856;4.5234;31;1500;0;0;0;0;0;0;0 +19.9;24;35856;4.5234;36;1500;0;0;0;0;0;0;0 +20;24;35856;4.5234;43;1500;0;0;0;0;0;0;0 +20.1;24;35856;4.5234;35;1500;0;0;0;0;0;0;0 +20.2;24;35856;4.5234;29;1500;0;0;0;0;0;0;0 +20.3;24;35856;4.5234;23;1500;0;0;0;0;0;0;0 +20.4;24;35856;4.5234;19;1500;0;0;0;0;0;0;0 +20.5;24;35856;4.5234;15;1500;0;0;0;0;0;0;0 +20.6;24;35856;4.5234;8;1500;0;0;0;0;0;0;0 +20.7;24;35856;4.5234;4;1500;0;0;0;0;0;0;0 +20.8;24;35856;4.5234;2;1500;0;0;0;0;0;0;0 +20.9;24;35856;4.5234;1;1500;0;0;0;0;0;0;0 +21;24;35856;4.5234;1;1500;0;0;0;0;0;0;0 +21.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +21.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +22.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.1;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.2;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.3;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.4;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.5;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.6;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.7;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.8;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +23.9;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 +24;24;35856;4.5234;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs25_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs25_awgn_5G.csv index fdb2abcadc..6f158f5bdc 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs25_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs25_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -15;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.1;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.2;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.3;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.4;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.5;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.6;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.7;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.8;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -15.9;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.1;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.2;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.3;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.4;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.5;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.6;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.7;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.8;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -16.9;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -17;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 -17.1;25;37896;4.8164;1493;1500;0;0;0;0;0;0;0 -17.2;25;37896;4.8164;1486;1500;0;0;0;0;0;0;0 -17.3;25;37896;4.8164;1478;1500;0;0;0;0;0;0;0 -17.4;25;37896;4.8164;1471;1500;0;0;0;0;0;0;0 -17.5;25;37896;4.8164;1464;1500;0;0;0;0;0;0;0 -17.6;25;37896;4.8164;1138;1500;0;0;0;0;0;0;0 -17.7;25;37896;4.8164;885;1500;0;0;0;0;0;0;0 -17.8;25;37896;4.8164;688;1500;0;0;0;0;0;0;0 -17.9;25;37896;4.8164;535;1500;0;0;0;0;0;0;0 -18;25;37896;4.8164;416;1500;0;0;0;0;0;0;0 -18.1;25;37896;4.8164;302;1500;0;0;0;0;0;0;0 -18.2;25;37896;4.8164;219;1500;0;0;0;0;0;0;0 -18.3;25;37896;4.8164;159;1500;0;0;0;0;0;0;0 -18.4;25;37896;4.8164;115;1500;0;0;0;0;0;0;0 -18.5;25;37896;4.8164;84;1500;0;0;0;0;0;0;0 -18.6;25;37896;4.8164;89;1500;0;0;0;0;0;0;0 -18.7;25;37896;4.8164;94;1500;0;0;0;0;0;0;0 -18.8;25;37896;4.8164;100;1500;0;0;0;0;0;0;0 -18.9;25;37896;4.8164;106;1500;0;0;0;0;0;0;0 -19;25;37896;4.8164;113;1500;0;0;0;0;0;0;0 -19.1;25;37896;4.8164;110;1500;0;0;0;0;0;0;0 -19.2;25;37896;4.8164;108;1500;0;0;0;0;0;0;0 -19.3;25;37896;4.8164;105;1500;0;0;0;0;0;0;0 -19.4;25;37896;4.8164;103;1500;0;0;0;0;0;0;0 -19.5;25;37896;4.8164;101;1500;0;0;0;0;0;0;0 -19.6;25;37896;4.8164;89;1500;0;0;0;0;0;0;0 -19.7;25;37896;4.8164;79;1500;0;0;0;0;0;0;0 -19.8;25;37896;4.8164;71;1500;0;0;0;0;0;0;0 -19.9;25;37896;4.8164;63;1500;0;0;0;0;0;0;0 -20;25;37896;4.8164;56;1500;0;0;0;0;0;0;0 -20.1;25;37896;4.8164;58;1500;0;0;0;0;0;0;0 -20.2;25;37896;4.8164;61;1500;0;0;0;0;0;0;0 -20.3;25;37896;4.8164;64;1500;0;0;0;0;0;0;0 -20.4;25;37896;4.8164;67;1500;0;0;0;0;0;0;0 -20.5;25;37896;4.8164;71;1500;0;0;0;0;0;0;0 -20.6;25;37896;4.8164;64;1500;0;0;0;0;0;0;0 -20.7;25;37896;4.8164;58;1500;0;0;0;0;0;0;0 -20.8;25;37896;4.8164;52;1500;0;0;0;0;0;0;0 -20.9;25;37896;4.8164;47;1500;0;0;0;0;0;0;0 -21;25;37896;4.8164;43;1500;0;0;0;0;0;0;0 -21.1;25;37896;4.8164;27;1500;0;0;0;0;0;0;0 -21.2;25;37896;4.8164;17;1500;0;0;0;0;0;0;0 -21.3;25;37896;4.8164;10;1500;0;0;0;0;0;0;0 -21.4;25;37896;4.8164;6;1500;0;0;0;0;0;0;0 -21.5;25;37896;4.8164;4;1500;0;0;0;0;0;0;0 -21.6;25;37896;4.8164;2;1500;0;0;0;0;0;0;0 -21.7;25;37896;4.8164;1;1500;0;0;0;0;0;0;0 -21.8;25;37896;4.8164;1;1500;0;0;0;0;0;0;0 -21.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.1;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.2;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.3;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.4;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.5;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.6;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.7;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.8;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -22.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.1;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.2;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.3;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.4;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.5;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.6;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.7;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.8;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -23.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 -24;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +15;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.1;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.2;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.3;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.4;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.5;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.6;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.7;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.8;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +15.9;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.1;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.2;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.3;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.4;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.5;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.6;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.7;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.8;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +16.9;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +17;25;37896;4.8164;1500;1500;0;0;0;0;0;0;0 +17.1;25;37896;4.8164;1493;1500;0;0;0;0;0;0;0 +17.2;25;37896;4.8164;1486;1500;0;0;0;0;0;0;0 +17.3;25;37896;4.8164;1478;1500;0;0;0;0;0;0;0 +17.4;25;37896;4.8164;1471;1500;0;0;0;0;0;0;0 +17.5;25;37896;4.8164;1464;1500;0;0;0;0;0;0;0 +17.6;25;37896;4.8164;1138;1500;0;0;0;0;0;0;0 +17.7;25;37896;4.8164;885;1500;0;0;0;0;0;0;0 +17.8;25;37896;4.8164;688;1500;0;0;0;0;0;0;0 +17.9;25;37896;4.8164;535;1500;0;0;0;0;0;0;0 +18;25;37896;4.8164;416;1500;0;0;0;0;0;0;0 +18.1;25;37896;4.8164;302;1500;0;0;0;0;0;0;0 +18.2;25;37896;4.8164;219;1500;0;0;0;0;0;0;0 +18.3;25;37896;4.8164;159;1500;0;0;0;0;0;0;0 +18.4;25;37896;4.8164;115;1500;0;0;0;0;0;0;0 +18.5;25;37896;4.8164;84;1500;0;0;0;0;0;0;0 +18.6;25;37896;4.8164;89;1500;0;0;0;0;0;0;0 +18.7;25;37896;4.8164;94;1500;0;0;0;0;0;0;0 +18.8;25;37896;4.8164;100;1500;0;0;0;0;0;0;0 +18.9;25;37896;4.8164;106;1500;0;0;0;0;0;0;0 +19;25;37896;4.8164;113;1500;0;0;0;0;0;0;0 +19.1;25;37896;4.8164;110;1500;0;0;0;0;0;0;0 +19.2;25;37896;4.8164;108;1500;0;0;0;0;0;0;0 +19.3;25;37896;4.8164;105;1500;0;0;0;0;0;0;0 +19.4;25;37896;4.8164;103;1500;0;0;0;0;0;0;0 +19.5;25;37896;4.8164;101;1500;0;0;0;0;0;0;0 +19.6;25;37896;4.8164;89;1500;0;0;0;0;0;0;0 +19.7;25;37896;4.8164;79;1500;0;0;0;0;0;0;0 +19.8;25;37896;4.8164;71;1500;0;0;0;0;0;0;0 +19.9;25;37896;4.8164;63;1500;0;0;0;0;0;0;0 +20;25;37896;4.8164;56;1500;0;0;0;0;0;0;0 +20.1;25;37896;4.8164;58;1500;0;0;0;0;0;0;0 +20.2;25;37896;4.8164;61;1500;0;0;0;0;0;0;0 +20.3;25;37896;4.8164;64;1500;0;0;0;0;0;0;0 +20.4;25;37896;4.8164;67;1500;0;0;0;0;0;0;0 +20.5;25;37896;4.8164;71;1500;0;0;0;0;0;0;0 +20.6;25;37896;4.8164;64;1500;0;0;0;0;0;0;0 +20.7;25;37896;4.8164;58;1500;0;0;0;0;0;0;0 +20.8;25;37896;4.8164;52;1500;0;0;0;0;0;0;0 +20.9;25;37896;4.8164;47;1500;0;0;0;0;0;0;0 +21;25;37896;4.8164;43;1500;0;0;0;0;0;0;0 +21.1;25;37896;4.8164;27;1500;0;0;0;0;0;0;0 +21.2;25;37896;4.8164;17;1500;0;0;0;0;0;0;0 +21.3;25;37896;4.8164;10;1500;0;0;0;0;0;0;0 +21.4;25;37896;4.8164;6;1500;0;0;0;0;0;0;0 +21.5;25;37896;4.8164;4;1500;0;0;0;0;0;0;0 +21.6;25;37896;4.8164;2;1500;0;0;0;0;0;0;0 +21.7;25;37896;4.8164;1;1500;0;0;0;0;0;0;0 +21.8;25;37896;4.8164;1;1500;0;0;0;0;0;0;0 +21.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.1;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.2;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.3;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.4;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.5;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.6;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.7;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.8;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +22.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.1;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.2;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.3;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.4;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.5;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.6;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.7;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.8;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +23.9;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 +24;25;37896;4.8164;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs26_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs26_awgn_5G.csv index ae2ed007aa..94d779fb21 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs26_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs26_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -15;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -15.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -16.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -17.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -18;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 -18.1;26;40976;5.1152;1496;1500;0;0;0;0;0;0;0 -18.2;26;40976;5.1152;1492;1500;0;0;0;0;0;0;0 -18.3;26;40976;5.1152;1487;1500;0;0;0;0;0;0;0 -18.4;26;40976;5.1152;1483;1500;0;0;0;0;0;0;0 -18.5;26;40976;5.1152;1479;1500;0;0;0;0;0;0;0 -18.6;26;40976;5.1152;1188;1500;0;0;0;0;0;0;0 -18.7;26;40976;5.1152;954;1500;0;0;0;0;0;0;0 -18.8;26;40976;5.1152;766;1500;0;0;0;0;0;0;0 -18.9;26;40976;5.1152;615;1500;0;0;0;0;0;0;0 -19;26;40976;5.1152;494;1500;0;0;0;0;0;0;0 -19.1;26;40976;5.1152;478;1500;0;0;0;0;0;0;0 -19.2;26;40976;5.1152;462;1500;0;0;0;0;0;0;0 -19.3;26;40976;5.1152;447;1500;0;0;0;0;0;0;0 -19.4;26;40976;5.1152;433;1500;0;0;0;0;0;0;0 -19.5;26;40976;5.1152;419;1500;0;0;0;0;0;0;0 -19.6;26;40976;5.1152;491;1500;0;0;0;0;0;0;0 -19.7;26;40976;5.1152;577;1500;0;0;0;0;0;0;0 -19.8;26;40976;5.1152;677;1500;0;0;0;0;0;0;0 -19.9;26;40976;5.1152;795;1500;0;0;0;0;0;0;0 -20;26;40976;5.1152;934;1500;0;0;0;0;0;0;0 -20.1;26;40976;5.1152;799;1500;0;0;0;0;0;0;0 -20.2;26;40976;5.1152;684;1500;0;0;0;0;0;0;0 -20.3;26;40976;5.1152;586;1500;0;0;0;0;0;0;0 -20.4;26;40976;5.1152;502;1500;0;0;0;0;0;0;0 -20.5;26;40976;5.1152;429;1500;0;0;0;0;0;0;0 -20.6;26;40976;5.1152;315;1500;0;0;0;0;0;0;0 -20.7;26;40976;5.1152;231;1500;0;0;0;0;0;0;0 -20.8;26;40976;5.1152;169;1500;0;0;0;0;0;0;0 -20.9;26;40976;5.1152;124;1500;0;0;0;0;0;0;0 -21;26;40976;5.1152;91;1500;0;0;0;0;0;0;0 -21.1;26;40976;5.1152;87;1500;0;0;0;0;0;0;0 -21.2;26;40976;5.1152;84;1500;0;0;0;0;0;0;0 -21.3;26;40976;5.1152;81;1500;0;0;0;0;0;0;0 -21.4;26;40976;5.1152;78;1500;0;0;0;0;0;0;0 -21.5;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 -21.6;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 -21.7;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 -21.8;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 -21.9;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 -22;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 -22.1;26;40976;5.1152;73;1500;0;0;0;0;0;0;0 -22.2;26;40976;5.1152;72;1500;0;0;0;0;0;0;0 -22.3;26;40976;5.1152;70;1500;0;0;0;0;0;0;0 -22.4;26;40976;5.1152;68;1500;0;0;0;0;0;0;0 -22.5;26;40976;5.1152;67;1500;0;0;0;0;0;0;0 -22.6;26;40976;5.1152;53;1500;0;0;0;0;0;0;0 -22.7;26;40976;5.1152;42;1500;0;0;0;0;0;0;0 -22.8;26;40976;5.1152;33;1500;0;0;0;0;0;0;0 -22.9;26;40976;5.1152;26;1500;0;0;0;0;0;0;0 -23;26;40976;5.1152;21;1500;0;0;0;0;0;0;0 -23.1;26;40976;5.1152;11;1500;0;0;0;0;0;0;0 -23.2;26;40976;5.1152;6;1500;0;0;0;0;0;0;0 -23.3;26;40976;5.1152;3;1500;0;0;0;0;0;0;0 -23.4;26;40976;5.1152;2;1500;0;0;0;0;0;0;0 -23.5;26;40976;5.1152;1;1500;0;0;0;0;0;0;0 -23.6;26;40976;5.1152;1;1500;0;0;0;0;0;0;0 -23.7;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 -23.8;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 -23.9;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 -24;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +15;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +15.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +16.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.1;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.2;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.3;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.4;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.5;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.6;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.7;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.8;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +17.9;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +18;26;40976;5.1152;1500;1500;0;0;0;0;0;0;0 +18.1;26;40976;5.1152;1496;1500;0;0;0;0;0;0;0 +18.2;26;40976;5.1152;1492;1500;0;0;0;0;0;0;0 +18.3;26;40976;5.1152;1487;1500;0;0;0;0;0;0;0 +18.4;26;40976;5.1152;1483;1500;0;0;0;0;0;0;0 +18.5;26;40976;5.1152;1479;1500;0;0;0;0;0;0;0 +18.6;26;40976;5.1152;1188;1500;0;0;0;0;0;0;0 +18.7;26;40976;5.1152;954;1500;0;0;0;0;0;0;0 +18.8;26;40976;5.1152;766;1500;0;0;0;0;0;0;0 +18.9;26;40976;5.1152;615;1500;0;0;0;0;0;0;0 +19;26;40976;5.1152;494;1500;0;0;0;0;0;0;0 +19.1;26;40976;5.1152;478;1500;0;0;0;0;0;0;0 +19.2;26;40976;5.1152;462;1500;0;0;0;0;0;0;0 +19.3;26;40976;5.1152;447;1500;0;0;0;0;0;0;0 +19.4;26;40976;5.1152;433;1500;0;0;0;0;0;0;0 +19.5;26;40976;5.1152;419;1500;0;0;0;0;0;0;0 +19.6;26;40976;5.1152;491;1500;0;0;0;0;0;0;0 +19.7;26;40976;5.1152;577;1500;0;0;0;0;0;0;0 +19.8;26;40976;5.1152;677;1500;0;0;0;0;0;0;0 +19.9;26;40976;5.1152;795;1500;0;0;0;0;0;0;0 +20;26;40976;5.1152;934;1500;0;0;0;0;0;0;0 +20.1;26;40976;5.1152;799;1500;0;0;0;0;0;0;0 +20.2;26;40976;5.1152;684;1500;0;0;0;0;0;0;0 +20.3;26;40976;5.1152;586;1500;0;0;0;0;0;0;0 +20.4;26;40976;5.1152;502;1500;0;0;0;0;0;0;0 +20.5;26;40976;5.1152;429;1500;0;0;0;0;0;0;0 +20.6;26;40976;5.1152;315;1500;0;0;0;0;0;0;0 +20.7;26;40976;5.1152;231;1500;0;0;0;0;0;0;0 +20.8;26;40976;5.1152;169;1500;0;0;0;0;0;0;0 +20.9;26;40976;5.1152;124;1500;0;0;0;0;0;0;0 +21;26;40976;5.1152;91;1500;0;0;0;0;0;0;0 +21.1;26;40976;5.1152;87;1500;0;0;0;0;0;0;0 +21.2;26;40976;5.1152;84;1500;0;0;0;0;0;0;0 +21.3;26;40976;5.1152;81;1500;0;0;0;0;0;0;0 +21.4;26;40976;5.1152;78;1500;0;0;0;0;0;0;0 +21.5;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +21.6;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +21.7;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +21.8;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +21.9;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +22;26;40976;5.1152;75;1500;0;0;0;0;0;0;0 +22.1;26;40976;5.1152;73;1500;0;0;0;0;0;0;0 +22.2;26;40976;5.1152;72;1500;0;0;0;0;0;0;0 +22.3;26;40976;5.1152;70;1500;0;0;0;0;0;0;0 +22.4;26;40976;5.1152;68;1500;0;0;0;0;0;0;0 +22.5;26;40976;5.1152;67;1500;0;0;0;0;0;0;0 +22.6;26;40976;5.1152;53;1500;0;0;0;0;0;0;0 +22.7;26;40976;5.1152;42;1500;0;0;0;0;0;0;0 +22.8;26;40976;5.1152;33;1500;0;0;0;0;0;0;0 +22.9;26;40976;5.1152;26;1500;0;0;0;0;0;0;0 +23;26;40976;5.1152;21;1500;0;0;0;0;0;0;0 +23.1;26;40976;5.1152;11;1500;0;0;0;0;0;0;0 +23.2;26;40976;5.1152;6;1500;0;0;0;0;0;0;0 +23.3;26;40976;5.1152;3;1500;0;0;0;0;0;0;0 +23.4;26;40976;5.1152;2;1500;0;0;0;0;0;0;0 +23.5;26;40976;5.1152;1;1500;0;0;0;0;0;0;0 +23.6;26;40976;5.1152;1;1500;0;0;0;0;0;0;0 +23.7;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 +23.8;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 +23.9;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 +24;26;40976;5.1152;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs27_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs27_awgn_5G.csv index 6b43b3e2aa..5f25579439 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs27_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs27_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -18;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 -18.1;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 -18.2;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 -18.3;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 -18.4;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 -18.5;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 -18.6;27;42016;5.332;1465;1500;0;0;0;0;0;0;0 -18.7;27;42016;5.332;1430;1500;0;0;0;0;0;0;0 -18.8;27;42016;5.332;1397;1500;0;0;0;0;0;0;0 -18.9;27;42016;5.332;1364;1500;0;0;0;0;0;0;0 -19;27;42016;5.332;1332;1500;0;0;0;0;0;0;0 -19.1;27;42016;5.332;1092;1500;0;0;0;0;0;0;0 -19.2;27;42016;5.332;896;1500;0;0;0;0;0;0;0 -19.3;27;42016;5.332;735;1500;0;0;0;0;0;0;0 -19.4;27;42016;5.332;603;1500;0;0;0;0;0;0;0 -19.5;27;42016;5.332;494;1500;0;0;0;0;0;0;0 -19.6;27;42016;5.332;572;1500;0;0;0;0;0;0;0 -19.7;27;42016;5.332;662;1500;0;0;0;0;0;0;0 -19.8;27;42016;5.332;766;1500;0;0;0;0;0;0;0 -19.9;27;42016;5.332;886;1500;0;0;0;0;0;0;0 -20;27;42016;5.332;1025;1500;0;0;0;0;0;0;0 -20.1;27;42016;5.332;1041;1500;0;0;0;0;0;0;0 -20.2;27;42016;5.332;1058;1500;0;0;0;0;0;0;0 -20.3;27;42016;5.332;1074;1500;0;0;0;0;0;0;0 -20.4;27;42016;5.332;1091;1500;0;0;0;0;0;0;0 -20.5;27;42016;5.332;1109;1500;0;0;0;0;0;0;0 -20.6;27;42016;5.332;811;1500;0;0;0;0;0;0;0 -20.7;27;42016;5.332;594;1500;0;0;0;0;0;0;0 -20.8;27;42016;5.332;434;1500;0;0;0;0;0;0;0 -20.9;27;42016;5.332;318;1500;0;0;0;0;0;0;0 -21;27;42016;5.332;233;1500;0;0;0;0;0;0;0 -21.1;27;42016;5.332;187;1500;0;0;0;0;0;0;0 -21.2;27;42016;5.332;150;1500;0;0;0;0;0;0;0 -21.3;27;42016;5.332;121;1500;0;0;0;0;0;0;0 -21.4;27;42016;5.332;97;1500;0;0;0;0;0;0;0 -21.5;27;42016;5.332;78;1500;0;0;0;0;0;0;0 -21.6;27;42016;5.332;78;1500;0;0;0;0;0;0;0 -21.7;27;42016;5.332;77;1500;0;0;0;0;0;0;0 -21.8;27;42016;5.332;76;1500;0;0;0;0;0;0;0 -21.9;27;42016;5.332;76;1500;0;0;0;0;0;0;0 -22;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.1;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.2;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.3;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.4;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.5;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.6;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.7;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.8;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -22.9;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -23;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -23.1;27;42016;5.332;75;1500;0;0;0;0;0;0;0 -23.2;27;42016;5.332;74;1500;0;0;0;0;0;0;0 -23.3;27;42016;5.332;74;1500;0;0;0;0;0;0;0 -23.4;27;42016;5.332;74;1500;0;0;0;0;0;0;0 -23.5;27;42016;5.332;74;1500;0;0;0;0;0;0;0 -23.6;27;42016;5.332;68;1500;0;0;0;0;0;0;0 -23.7;27;42016;5.332;63;1500;0;0;0;0;0;0;0 -23.8;27;42016;5.332;59;1500;0;0;0;0;0;0;0 -23.9;27;42016;5.332;55;1500;0;0;0;0;0;0;0 -24;27;42016;5.332;51;1500;0;0;0;0;0;0;0 -24.1;27;42016;5.332;38;1500;0;0;0;0;0;0;0 -24.2;27;42016;5.332;29;1500;0;0;0;0;0;0;0 -24.3;27;42016;5.332;21;1500;0;0;0;0;0;0;0 -24.4;27;42016;5.332;16;1500;0;0;0;0;0;0;0 -24.5;27;42016;5.332;12;1500;0;0;0;0;0;0;0 -24.6;27;42016;5.332;7;1500;0;0;0;0;0;0;0 -24.7;27;42016;5.332;4;1500;0;0;0;0;0;0;0 -24.8;27;42016;5.332;3;1500;0;0;0;0;0;0;0 -24.9;27;42016;5.332;2;1500;0;0;0;0;0;0;0 -25;27;42016;5.332;1;1500;0;0;0;0;0;0;0 -25.1;27;42016;5.332;1;1500;0;0;0;0;0;0;0 -25.2;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -25.3;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -25.4;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -25.5;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -25.6;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -25.7;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -25.8;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -25.9;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.1;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.2;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.3;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.4;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.5;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.6;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.7;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.8;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -26.9;27;42016;5.332;0;1500;0;0;0;0;0;0;0 -27;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +18;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.1;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.2;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.3;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.4;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.5;27;42016;5.332;1500;1500;0;0;0;0;0;0;0 +18.6;27;42016;5.332;1465;1500;0;0;0;0;0;0;0 +18.7;27;42016;5.332;1430;1500;0;0;0;0;0;0;0 +18.8;27;42016;5.332;1397;1500;0;0;0;0;0;0;0 +18.9;27;42016;5.332;1364;1500;0;0;0;0;0;0;0 +19;27;42016;5.332;1332;1500;0;0;0;0;0;0;0 +19.1;27;42016;5.332;1092;1500;0;0;0;0;0;0;0 +19.2;27;42016;5.332;896;1500;0;0;0;0;0;0;0 +19.3;27;42016;5.332;735;1500;0;0;0;0;0;0;0 +19.4;27;42016;5.332;603;1500;0;0;0;0;0;0;0 +19.5;27;42016;5.332;494;1500;0;0;0;0;0;0;0 +19.6;27;42016;5.332;572;1500;0;0;0;0;0;0;0 +19.7;27;42016;5.332;662;1500;0;0;0;0;0;0;0 +19.8;27;42016;5.332;766;1500;0;0;0;0;0;0;0 +19.9;27;42016;5.332;886;1500;0;0;0;0;0;0;0 +20;27;42016;5.332;1025;1500;0;0;0;0;0;0;0 +20.1;27;42016;5.332;1041;1500;0;0;0;0;0;0;0 +20.2;27;42016;5.332;1058;1500;0;0;0;0;0;0;0 +20.3;27;42016;5.332;1074;1500;0;0;0;0;0;0;0 +20.4;27;42016;5.332;1091;1500;0;0;0;0;0;0;0 +20.5;27;42016;5.332;1109;1500;0;0;0;0;0;0;0 +20.6;27;42016;5.332;811;1500;0;0;0;0;0;0;0 +20.7;27;42016;5.332;594;1500;0;0;0;0;0;0;0 +20.8;27;42016;5.332;434;1500;0;0;0;0;0;0;0 +20.9;27;42016;5.332;318;1500;0;0;0;0;0;0;0 +21;27;42016;5.332;233;1500;0;0;0;0;0;0;0 +21.1;27;42016;5.332;187;1500;0;0;0;0;0;0;0 +21.2;27;42016;5.332;150;1500;0;0;0;0;0;0;0 +21.3;27;42016;5.332;121;1500;0;0;0;0;0;0;0 +21.4;27;42016;5.332;97;1500;0;0;0;0;0;0;0 +21.5;27;42016;5.332;78;1500;0;0;0;0;0;0;0 +21.6;27;42016;5.332;78;1500;0;0;0;0;0;0;0 +21.7;27;42016;5.332;77;1500;0;0;0;0;0;0;0 +21.8;27;42016;5.332;76;1500;0;0;0;0;0;0;0 +21.9;27;42016;5.332;76;1500;0;0;0;0;0;0;0 +22;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.1;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.2;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.3;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.4;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.5;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.6;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.7;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.8;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +22.9;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +23;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +23.1;27;42016;5.332;75;1500;0;0;0;0;0;0;0 +23.2;27;42016;5.332;74;1500;0;0;0;0;0;0;0 +23.3;27;42016;5.332;74;1500;0;0;0;0;0;0;0 +23.4;27;42016;5.332;74;1500;0;0;0;0;0;0;0 +23.5;27;42016;5.332;74;1500;0;0;0;0;0;0;0 +23.6;27;42016;5.332;68;1500;0;0;0;0;0;0;0 +23.7;27;42016;5.332;63;1500;0;0;0;0;0;0;0 +23.8;27;42016;5.332;59;1500;0;0;0;0;0;0;0 +23.9;27;42016;5.332;55;1500;0;0;0;0;0;0;0 +24;27;42016;5.332;51;1500;0;0;0;0;0;0;0 +24.1;27;42016;5.332;38;1500;0;0;0;0;0;0;0 +24.2;27;42016;5.332;29;1500;0;0;0;0;0;0;0 +24.3;27;42016;5.332;21;1500;0;0;0;0;0;0;0 +24.4;27;42016;5.332;16;1500;0;0;0;0;0;0;0 +24.5;27;42016;5.332;12;1500;0;0;0;0;0;0;0 +24.6;27;42016;5.332;7;1500;0;0;0;0;0;0;0 +24.7;27;42016;5.332;4;1500;0;0;0;0;0;0;0 +24.8;27;42016;5.332;3;1500;0;0;0;0;0;0;0 +24.9;27;42016;5.332;2;1500;0;0;0;0;0;0;0 +25;27;42016;5.332;1;1500;0;0;0;0;0;0;0 +25.1;27;42016;5.332;1;1500;0;0;0;0;0;0;0 +25.2;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.3;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.4;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.5;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.6;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.7;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.8;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +25.9;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.1;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.2;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.3;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.4;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.5;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.6;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.7;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.8;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +26.9;27;42016;5.332;0;1500;0;0;0;0;0;0;0 +27;27;42016;5.332;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs28_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs28_awgn_5G.csv index a6066cbd61..edf6ef2e2c 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs28_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs28_awgn_5G.csv @@ -1,92 +1,92 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err -18;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.1;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.2;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.3;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.4;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.5;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.6;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.7;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.8;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -18.9;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -19;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 -19.1;28;44040;5.547;1499;1500;0;0;0;0;0;0;0 -19.2;28;44040;5.547;1498;1500;0;0;0;0;0;0;0 -19.3;28;44040;5.547;1498;1500;0;0;0;0;0;0;0 -19.4;28;44040;5.547;1497;1500;0;0;0;0;0;0;0 -19.5;28;44040;5.547;1496;1500;0;0;0;0;0;0;0 -19.6;28;44040;5.547;1429;1500;0;0;0;0;0;0;0 -19.7;28;44040;5.547;1366;1500;0;0;0;0;0;0;0 -19.8;28;44040;5.547;1305;1500;0;0;0;0;0;0;0 -19.9;28;44040;5.547;1247;1500;0;0;0;0;0;0;0 -20;28;44040;5.547;1191;1500;0;0;0;0;0;0;0 -20.1;28;44040;5.547;1234;1500;0;0;0;0;0;0;0 -20.2;28;44040;5.547;1279;1500;0;0;0;0;0;0;0 -20.3;28;44040;5.547;1325;1500;0;0;0;0;0;0;0 -20.4;28;44040;5.547;1373;1500;0;0;0;0;0;0;0 -20.5;28;44040;5.547;1423;1500;0;0;0;0;0;0;0 -20.6;28;44040;5.547;1426;1500;0;0;0;0;0;0;0 -20.7;28;44040;5.547;1429;1500;0;0;0;0;0;0;0 -20.8;28;44040;5.547;1432;1500;0;0;0;0;0;0;0 -20.9;28;44040;5.547;1435;1500;0;0;0;0;0;0;0 -21;28;44040;5.547;1438;1500;0;0;0;0;0;0;0 -21.1;28;44040;5.547;1207;1500;0;0;0;0;0;0;0 -21.2;28;44040;5.547;1014;1500;0;0;0;0;0;0;0 -21.3;28;44040;5.547;851;1500;0;0;0;0;0;0;0 -21.4;28;44040;5.547;715;1500;0;0;0;0;0;0;0 -21.5;28;44040;5.547;600;1500;0;0;0;0;0;0;0 -21.6;28;44040;5.547;418;1500;0;0;0;0;0;0;0 -21.7;28;44040;5.547;290;1500;0;0;0;0;0;0;0 -21.8;28;44040;5.547;202;1500;0;0;0;0;0;0;0 -21.9;28;44040;5.547;140;1500;0;0;0;0;0;0;0 -22;28;44040;5.547;98;1500;0;0;0;0;0;0;0 -22.1;28;44040;5.547;93;1500;0;0;0;0;0;0;0 -22.2;28;44040;5.547;88;1500;0;0;0;0;0;0;0 -22.3;28;44040;5.547;83;1500;0;0;0;0;0;0;0 -22.4;28;44040;5.547;79;1500;0;0;0;0;0;0;0 -22.5;28;44040;5.547;75;1500;0;0;0;0;0;0;0 -22.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -22.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -22.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -22.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -23.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -24.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -25.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -26.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 -27;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +18;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.1;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.2;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.3;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.4;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.5;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.6;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.7;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.8;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +18.9;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +19;28;44040;5.547;1500;1500;0;0;0;0;0;0;0 +19.1;28;44040;5.547;1499;1500;0;0;0;0;0;0;0 +19.2;28;44040;5.547;1498;1500;0;0;0;0;0;0;0 +19.3;28;44040;5.547;1498;1500;0;0;0;0;0;0;0 +19.4;28;44040;5.547;1497;1500;0;0;0;0;0;0;0 +19.5;28;44040;5.547;1496;1500;0;0;0;0;0;0;0 +19.6;28;44040;5.547;1429;1500;0;0;0;0;0;0;0 +19.7;28;44040;5.547;1366;1500;0;0;0;0;0;0;0 +19.8;28;44040;5.547;1305;1500;0;0;0;0;0;0;0 +19.9;28;44040;5.547;1247;1500;0;0;0;0;0;0;0 +20;28;44040;5.547;1191;1500;0;0;0;0;0;0;0 +20.1;28;44040;5.547;1234;1500;0;0;0;0;0;0;0 +20.2;28;44040;5.547;1279;1500;0;0;0;0;0;0;0 +20.3;28;44040;5.547;1325;1500;0;0;0;0;0;0;0 +20.4;28;44040;5.547;1373;1500;0;0;0;0;0;0;0 +20.5;28;44040;5.547;1423;1500;0;0;0;0;0;0;0 +20.6;28;44040;5.547;1426;1500;0;0;0;0;0;0;0 +20.7;28;44040;5.547;1429;1500;0;0;0;0;0;0;0 +20.8;28;44040;5.547;1432;1500;0;0;0;0;0;0;0 +20.9;28;44040;5.547;1435;1500;0;0;0;0;0;0;0 +21;28;44040;5.547;1438;1500;0;0;0;0;0;0;0 +21.1;28;44040;5.547;1207;1500;0;0;0;0;0;0;0 +21.2;28;44040;5.547;1014;1500;0;0;0;0;0;0;0 +21.3;28;44040;5.547;851;1500;0;0;0;0;0;0;0 +21.4;28;44040;5.547;715;1500;0;0;0;0;0;0;0 +21.5;28;44040;5.547;600;1500;0;0;0;0;0;0;0 +21.6;28;44040;5.547;418;1500;0;0;0;0;0;0;0 +21.7;28;44040;5.547;290;1500;0;0;0;0;0;0;0 +21.8;28;44040;5.547;202;1500;0;0;0;0;0;0;0 +21.9;28;44040;5.547;140;1500;0;0;0;0;0;0;0 +22;28;44040;5.547;98;1500;0;0;0;0;0;0;0 +22.1;28;44040;5.547;93;1500;0;0;0;0;0;0;0 +22.2;28;44040;5.547;88;1500;0;0;0;0;0;0;0 +22.3;28;44040;5.547;83;1500;0;0;0;0;0;0;0 +22.4;28;44040;5.547;79;1500;0;0;0;0;0;0;0 +22.5;28;44040;5.547;75;1500;0;0;0;0;0;0;0 +22.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +22.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +22.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +22.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +23.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +24.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +25.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.1;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.2;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.3;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.4;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.5;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.6;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.7;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.8;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +26.9;28;44040;5.547;0;1500;0;0;0;0;0;0;0 +27;28;44040;5.547;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs2_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs2_awgn_5G.csv index d5a802c177..2fbb6a20b9 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs2_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs2_awgn_5G.csv @@ -1,62 +1,62 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3.1;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2.1;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --1.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --1.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --1.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --1.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --1.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 --1.4;2;2976;0.377;1486;1500;0;0;0;0;0;0;0 --1.3;2;2976;0.377;1473;1500;0;0;0;0;0;0;0 --1.2;2;2976;0.377;1459;1500;0;0;0;0;0;0;0 --1.1;2;2976;0.377;1446;1500;0;0;0;0;0;0;0 --1;2;2976;0.377;1432;1500;0;0;0;0;0;0;0 --0.9;2;2976;0.377;1149;1500;0;0;0;0;0;0;0 --0.8;2;2976;0.377;921;1500;0;0;0;0;0;0;0 --0.7;2;2976;0.377;738;1500;0;0;0;0;0;0;0 --0.6;2;2976;0.377;592;1500;0;0;0;0;0;0;0 --0.5;2;2976;0.377;475;1500;0;0;0;0;0;0;0 --0.4;2;2976;0.377;292;1500;0;0;0;0;0;0;0 --0.3;2;2976;0.377;179;1500;0;0;0;0;0;0;0 --0.2;2;2976;0.377;110;1500;0;0;0;0;0;0;0 --0.1;2;2976;0.377;68;1500;0;0;0;0;0;0;0 -0;2;2976;0.377;42;1500;0;0;0;0;0;0;0 -0.1;2;2976;0.377;22;1500;0;0;0;0;0;0;0 -0.2;2;2976;0.377;11;1500;0;0;0;0;0;0;0 -0.3;2;2976;0.377;6;1500;0;0;0;0;0;0;0 -0.4;2;2976;0.377;3;1500;0;0;0;0;0;0;0 -0.5;2;2976;0.377;2;1500;0;0;0;0;0;0;0 -0.6;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -0.7;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -0.8;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -0.9;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.1;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.2;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.3;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.4;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.5;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.6;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.7;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.8;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -1.9;2;2976;0.377;0;1500;0;0;0;0;0;0;0 -2;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3.1;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.4;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.3;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2.1;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-2;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.9;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.8;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.7;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.6;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.5;2;2976;0.377;1500;1500;0;0;0;0;0;0;0 +-1.4;2;2976;0.377;1486;1500;0;0;0;0;0;0;0 +-1.3;2;2976;0.377;1473;1500;0;0;0;0;0;0;0 +-1.2;2;2976;0.377;1459;1500;0;0;0;0;0;0;0 +-1.1;2;2976;0.377;1446;1500;0;0;0;0;0;0;0 +-1;2;2976;0.377;1432;1500;0;0;0;0;0;0;0 +-0.9;2;2976;0.377;1149;1500;0;0;0;0;0;0;0 +-0.8;2;2976;0.377;921;1500;0;0;0;0;0;0;0 +-0.7;2;2976;0.377;738;1500;0;0;0;0;0;0;0 +-0.6;2;2976;0.377;592;1500;0;0;0;0;0;0;0 +-0.5;2;2976;0.377;475;1500;0;0;0;0;0;0;0 +-0.4;2;2976;0.377;292;1500;0;0;0;0;0;0;0 +-0.3;2;2976;0.377;179;1500;0;0;0;0;0;0;0 +-0.2;2;2976;0.377;110;1500;0;0;0;0;0;0;0 +-0.1;2;2976;0.377;68;1500;0;0;0;0;0;0;0 +0;2;2976;0.377;42;1500;0;0;0;0;0;0;0 +0.1;2;2976;0.377;22;1500;0;0;0;0;0;0;0 +0.2;2;2976;0.377;11;1500;0;0;0;0;0;0;0 +0.3;2;2976;0.377;6;1500;0;0;0;0;0;0;0 +0.4;2;2976;0.377;3;1500;0;0;0;0;0;0;0 +0.5;2;2976;0.377;2;1500;0;0;0;0;0;0;0 +0.6;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +0.7;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +0.8;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +0.9;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.1;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.2;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.3;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.4;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.5;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.6;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.7;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.8;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +1.9;2;2976;0.377;0;1500;0;0;0;0;0;0;0 +2;2;2976;0.377;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs3_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs3_awgn_5G.csv index 9acdfe3e2f..531c1548b0 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs3_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs3_awgn_5G.csv @@ -1,62 +1,62 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 --0.9;3;3912;0.4902;1499;1500;0;0;0;0;0;0;0 --0.8;3;3912;0.4902;1498;1500;0;0;0;0;0;0;0 --0.7;3;3912;0.4902;1496;1500;0;0;0;0;0;0;0 --0.6;3;3912;0.4902;1495;1500;0;0;0;0;0;0;0 --0.5;3;3912;0.4902;1494;1500;0;0;0;0;0;0;0 --0.4;3;3912;0.4902;1322;1500;0;0;0;0;0;0;0 --0.3;3;3912;0.4902;1169;1500;0;0;0;0;0;0;0 --0.2;3;3912;0.4902;1034;1500;0;0;0;0;0;0;0 --0.1;3;3912;0.4902;915;1500;0;0;0;0;0;0;0 -0;3;3912;0.4902;809;1500;0;0;0;0;0;0;0 -0.1;3;3912;0.4902;504;1500;0;0;0;0;0;0;0 -0.2;3;3912;0.4902;314;1500;0;0;0;0;0;0;0 -0.3;3;3912;0.4902;196;1500;0;0;0;0;0;0;0 -0.4;3;3912;0.4902;122;1500;0;0;0;0;0;0;0 -0.5;3;3912;0.4902;76;1500;0;0;0;0;0;0;0 -0.6;3;3912;0.4902;37;1500;0;0;0;0;0;0;0 -0.7;3;3912;0.4902;18;1500;0;0;0;0;0;0;0 -0.8;3;3912;0.4902;9;1500;0;0;0;0;0;0;0 -0.9;3;3912;0.4902;4;1500;0;0;0;0;0;0;0 -1;3;3912;0.4902;2;1500;0;0;0;0;0;0;0 -1.1;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -1.2;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -1.3;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -1.4;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -1.5;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -1.6;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -1.7;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -1.8;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -1.9;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 -2;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.9;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.8;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.7;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.6;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.5;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.4;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.3;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.2;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1.1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-1;3;3912;0.4902;1500;1500;0;0;0;0;0;0;0 +-0.9;3;3912;0.4902;1499;1500;0;0;0;0;0;0;0 +-0.8;3;3912;0.4902;1498;1500;0;0;0;0;0;0;0 +-0.7;3;3912;0.4902;1496;1500;0;0;0;0;0;0;0 +-0.6;3;3912;0.4902;1495;1500;0;0;0;0;0;0;0 +-0.5;3;3912;0.4902;1494;1500;0;0;0;0;0;0;0 +-0.4;3;3912;0.4902;1322;1500;0;0;0;0;0;0;0 +-0.3;3;3912;0.4902;1169;1500;0;0;0;0;0;0;0 +-0.2;3;3912;0.4902;1034;1500;0;0;0;0;0;0;0 +-0.1;3;3912;0.4902;915;1500;0;0;0;0;0;0;0 +0;3;3912;0.4902;809;1500;0;0;0;0;0;0;0 +0.1;3;3912;0.4902;504;1500;0;0;0;0;0;0;0 +0.2;3;3912;0.4902;314;1500;0;0;0;0;0;0;0 +0.3;3;3912;0.4902;196;1500;0;0;0;0;0;0;0 +0.4;3;3912;0.4902;122;1500;0;0;0;0;0;0;0 +0.5;3;3912;0.4902;76;1500;0;0;0;0;0;0;0 +0.6;3;3912;0.4902;37;1500;0;0;0;0;0;0;0 +0.7;3;3912;0.4902;18;1500;0;0;0;0;0;0;0 +0.8;3;3912;0.4902;9;1500;0;0;0;0;0;0;0 +0.9;3;3912;0.4902;4;1500;0;0;0;0;0;0;0 +1;3;3912;0.4902;2;1500;0;0;0;0;0;0;0 +1.1;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.2;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.3;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.4;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.5;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.6;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.7;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.8;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +1.9;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 +2;3;3912;0.4902;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs4_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs4_awgn_5G.csv index 99a1e652e5..033c81afaf 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs4_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs4_awgn_5G.csv @@ -1,62 +1,62 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --1;4;4736;0.6016;1500;1500;0;0;0;0;0;0;0 --0.9;4;4736;0.6016;1499;1500;0;0;0;0;0;0;0 --0.8;4;4736;0.6016;1498;1500;0;0;0;0;0;0;0 --0.7;4;4736;0.6016;1496;1500;0;0;0;0;0;0;0 --0.6;4;4736;0.6016;1495;1500;0;0;0;0;0;0;0 --0.5;4;4736;0.6016;1494;1500;0;0;0;0;0;0;0 --0.4;4;4736;0.6016;1322;1500;0;0;0;0;0;0;0 --0.3;4;4736;0.6016;1169;1500;0;0;0;0;0;0;0 --0.2;4;4736;0.6016;1034;1500;0;0;0;0;0;0;0 --0.1;4;4736;0.6016;915;1500;0;0;0;0;0;0;0 -0;4;4736;0.6016;809;1500;0;0;0;0;0;0;0 -0.1;4;4736;0.6016;504;1500;0;0;0;0;0;0;0 -0.2;4;4736;0.6016;314;1500;0;0;0;0;0;0;0 -0.3;4;4736;0.6016;196;1500;0;0;0;0;0;0;0 -0.4;4;4736;0.6016;122;1500;0;0;0;0;0;0;0 -0.5;4;4736;0.6016;76;1500;0;0;0;0;0;0;0 -0.6;4;4736;0.6016;37;1500;0;0;0;0;0;0;0 -0.7;4;4736;0.6016;18;1500;0;0;0;0;0;0;0 -0.8;4;4736;0.6016;9;1500;0;0;0;0;0;0;0 -0.9;4;4736;0.6016;4;1500;0;0;0;0;0;0;0 -1;4;4736;0.6016;2;1500;0;0;0;0;0;0;0 -1.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -1.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -1.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -1.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -1.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -1.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -1.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -1.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -1.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -2.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -3.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -4.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 -5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;4;4736;0.6016;1500;1500;0;0;0;0;0;0;0 +-0.9;4;4736;0.6016;1499;1500;0;0;0;0;0;0;0 +-0.8;4;4736;0.6016;1498;1500;0;0;0;0;0;0;0 +-0.7;4;4736;0.6016;1496;1500;0;0;0;0;0;0;0 +-0.6;4;4736;0.6016;1495;1500;0;0;0;0;0;0;0 +-0.5;4;4736;0.6016;1494;1500;0;0;0;0;0;0;0 +-0.4;4;4736;0.6016;1322;1500;0;0;0;0;0;0;0 +-0.3;4;4736;0.6016;1169;1500;0;0;0;0;0;0;0 +-0.2;4;4736;0.6016;1034;1500;0;0;0;0;0;0;0 +-0.1;4;4736;0.6016;915;1500;0;0;0;0;0;0;0 +0;4;4736;0.6016;809;1500;0;0;0;0;0;0;0 +0.1;4;4736;0.6016;504;1500;0;0;0;0;0;0;0 +0.2;4;4736;0.6016;314;1500;0;0;0;0;0;0;0 +0.3;4;4736;0.6016;196;1500;0;0;0;0;0;0;0 +0.4;4;4736;0.6016;122;1500;0;0;0;0;0;0;0 +0.5;4;4736;0.6016;76;1500;0;0;0;0;0;0;0 +0.6;4;4736;0.6016;37;1500;0;0;0;0;0;0;0 +0.7;4;4736;0.6016;18;1500;0;0;0;0;0;0;0 +0.8;4;4736;0.6016;9;1500;0;0;0;0;0;0;0 +0.9;4;4736;0.6016;4;1500;0;0;0;0;0;0;0 +1;4;4736;0.6016;2;1500;0;0;0;0;0;0;0 +1.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +1.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +2.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +3.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.1;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.2;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.3;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.4;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.6;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.7;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.8;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +4.9;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 +5;4;4736;0.6016;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs5_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs5_awgn_5G.csv index 1d2c479112..f741966016 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs5_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs5_awgn_5G.csv @@ -1,62 +1,62 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --1;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.9;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.8;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.7;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.6;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.5;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.4;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.3;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.2;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 --0.1;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 -0;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 -0.1;5;5888;0.7402;1499;1500;0;0;0;0;0;0;0 -0.2;5;5888;0.7402;1499;1500;0;0;0;0;0;0;0 -0.3;5;5888;0.7402;1498;1500;0;0;0;0;0;0;0 -0.4;5;5888;0.7402;1498;1500;0;0;0;0;0;0;0 -0.5;5;5888;0.7402;1497;1500;0;0;0;0;0;0;0 -0.6;5;5888;0.7402;1323;1500;0;0;0;0;0;0;0 -0.7;5;5888;0.7402;1170;1500;0;0;0;0;0;0;0 -0.8;5;5888;0.7402;1034;1500;0;0;0;0;0;0;0 -0.9;5;5888;0.7402;914;1500;0;0;0;0;0;0;0 -1;5;5888;0.7402;808;1500;0;0;0;0;0;0;0 -1.1;5;5888;0.7402;513;1500;0;0;0;0;0;0;0 -1.2;5;5888;0.7402;326;1500;0;0;0;0;0;0;0 -1.3;5;5888;0.7402;207;1500;0;0;0;0;0;0;0 -1.4;5;5888;0.7402;131;1500;0;0;0;0;0;0;0 -1.5;5;5888;0.7402;83;1500;0;0;0;0;0;0;0 -1.6;5;5888;0.7402;48;1500;0;0;0;0;0;0;0 -1.7;5;5888;0.7402;28;1500;0;0;0;0;0;0;0 -1.8;5;5888;0.7402;16;1500;0;0;0;0;0;0;0 -1.9;5;5888;0.7402;9;1500;0;0;0;0;0;0;0 -2;5;5888;0.7402;5;1500;0;0;0;0;0;0;0 -2.1;5;5888;0.7402;2;1500;0;0;0;0;0;0;0 -2.2;5;5888;0.7402;1;1500;0;0;0;0;0;0;0 -2.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -2.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -2.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -2.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -2.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -2.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -2.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.1;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.2;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -3.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.1;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.2;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -4.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 -5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.9;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.8;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.7;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.6;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.5;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.4;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.3;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.2;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +-0.1;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +0;5;5888;0.7402;1500;1500;0;0;0;0;0;0;0 +0.1;5;5888;0.7402;1499;1500;0;0;0;0;0;0;0 +0.2;5;5888;0.7402;1499;1500;0;0;0;0;0;0;0 +0.3;5;5888;0.7402;1498;1500;0;0;0;0;0;0;0 +0.4;5;5888;0.7402;1498;1500;0;0;0;0;0;0;0 +0.5;5;5888;0.7402;1497;1500;0;0;0;0;0;0;0 +0.6;5;5888;0.7402;1323;1500;0;0;0;0;0;0;0 +0.7;5;5888;0.7402;1170;1500;0;0;0;0;0;0;0 +0.8;5;5888;0.7402;1034;1500;0;0;0;0;0;0;0 +0.9;5;5888;0.7402;914;1500;0;0;0;0;0;0;0 +1;5;5888;0.7402;808;1500;0;0;0;0;0;0;0 +1.1;5;5888;0.7402;513;1500;0;0;0;0;0;0;0 +1.2;5;5888;0.7402;326;1500;0;0;0;0;0;0;0 +1.3;5;5888;0.7402;207;1500;0;0;0;0;0;0;0 +1.4;5;5888;0.7402;131;1500;0;0;0;0;0;0;0 +1.5;5;5888;0.7402;83;1500;0;0;0;0;0;0;0 +1.6;5;5888;0.7402;48;1500;0;0;0;0;0;0;0 +1.7;5;5888;0.7402;28;1500;0;0;0;0;0;0;0 +1.8;5;5888;0.7402;16;1500;0;0;0;0;0;0;0 +1.9;5;5888;0.7402;9;1500;0;0;0;0;0;0;0 +2;5;5888;0.7402;5;1500;0;0;0;0;0;0;0 +2.1;5;5888;0.7402;2;1500;0;0;0;0;0;0;0 +2.2;5;5888;0.7402;1;1500;0;0;0;0;0;0;0 +2.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +2.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.1;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.2;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +3.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.1;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.2;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.3;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.4;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.6;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.7;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.8;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +4.9;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 +5;5;5888;0.7402;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs6_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs6_awgn_5G.csv index 42a0cd6fb1..350c53d695 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs6_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs6_awgn_5G.csv @@ -1,62 +1,62 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.9;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.8;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.7;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.6;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.5;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.4;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.3;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.2;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 --0.1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.2;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.3;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.4;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.5;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.6;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.7;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.8;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -0.9;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 -1.1;6;6912;0.877;1493;1500;0;0;0;0;0;0;0 -1.2;6;6912;0.877;1487;1500;0;0;0;0;0;0;0 -1.3;6;6912;0.877;1480;1500;0;0;0;0;0;0;0 -1.4;6;6912;0.877;1473;1500;0;0;0;0;0;0;0 -1.5;6;6912;0.877;1467;1500;0;0;0;0;0;0;0 -1.6;6;6912;0.877;1117;1500;0;0;0;0;0;0;0 -1.7;6;6912;0.877;850;1500;0;0;0;0;0;0;0 -1.8;6;6912;0.877;648;1500;0;0;0;0;0;0;0 -1.9;6;6912;0.877;493;1500;0;0;0;0;0;0;0 -2;6;6912;0.877;376;1500;0;0;0;0;0;0;0 -2.1;6;6912;0.877;254;1500;0;0;0;0;0;0;0 -2.2;6;6912;0.877;172;1500;0;0;0;0;0;0;0 -2.3;6;6912;0.877;116;1500;0;0;0;0;0;0;0 -2.4;6;6912;0.877;79;1500;0;0;0;0;0;0;0 -2.5;6;6912;0.877;53;1500;0;0;0;0;0;0;0 -2.6;6;6912;0.877;32;1500;0;0;0;0;0;0;0 -2.7;6;6912;0.877;19;1500;0;0;0;0;0;0;0 -2.8;6;6912;0.877;11;1500;0;0;0;0;0;0;0 -2.9;6;6912;0.877;7;1500;0;0;0;0;0;0;0 -3;6;6912;0.877;4;1500;0;0;0;0;0;0;0 -3.1;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -3.2;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -3.3;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -3.4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -3.5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -3.6;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -3.7;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -3.8;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -3.9;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.1;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.2;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.3;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.6;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.7;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.8;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -4.9;6;6912;0.877;0;1500;0;0;0;0;0;0;0 -5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.9;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.8;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.7;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.6;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.5;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.4;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.3;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.2;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +-0.1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.2;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.3;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.4;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.5;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.6;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.7;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.8;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +0.9;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +1;6;6912;0.877;1500;1500;0;0;0;0;0;0;0 +1.1;6;6912;0.877;1493;1500;0;0;0;0;0;0;0 +1.2;6;6912;0.877;1487;1500;0;0;0;0;0;0;0 +1.3;6;6912;0.877;1480;1500;0;0;0;0;0;0;0 +1.4;6;6912;0.877;1473;1500;0;0;0;0;0;0;0 +1.5;6;6912;0.877;1467;1500;0;0;0;0;0;0;0 +1.6;6;6912;0.877;1117;1500;0;0;0;0;0;0;0 +1.7;6;6912;0.877;850;1500;0;0;0;0;0;0;0 +1.8;6;6912;0.877;648;1500;0;0;0;0;0;0;0 +1.9;6;6912;0.877;493;1500;0;0;0;0;0;0;0 +2;6;6912;0.877;376;1500;0;0;0;0;0;0;0 +2.1;6;6912;0.877;254;1500;0;0;0;0;0;0;0 +2.2;6;6912;0.877;172;1500;0;0;0;0;0;0;0 +2.3;6;6912;0.877;116;1500;0;0;0;0;0;0;0 +2.4;6;6912;0.877;79;1500;0;0;0;0;0;0;0 +2.5;6;6912;0.877;53;1500;0;0;0;0;0;0;0 +2.6;6;6912;0.877;32;1500;0;0;0;0;0;0;0 +2.7;6;6912;0.877;19;1500;0;0;0;0;0;0;0 +2.8;6;6912;0.877;11;1500;0;0;0;0;0;0;0 +2.9;6;6912;0.877;7;1500;0;0;0;0;0;0;0 +3;6;6912;0.877;4;1500;0;0;0;0;0;0;0 +3.1;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.2;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.3;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.6;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.7;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.8;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +3.9;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.1;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.2;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.3;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.4;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.6;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.7;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.8;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +4.9;6;6912;0.877;0;1500;0;0;0;0;0;0;0 +5;6;6912;0.877;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs7_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs7_awgn_5G.csv index ac98d0ae10..9bd689cf0e 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs7_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs7_awgn_5G.csv @@ -1,62 +1,62 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 --0.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -0.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -1.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 -2.1;7;8912;1.0273;1492;1500;0;0;0;0;0;0;0 -2.2;7;8912;1.0273;1484;1500;0;0;0;0;0;0;0 -2.3;7;8912;1.0273;1477;1500;0;0;0;0;0;0;0 -2.4;7;8912;1.0273;1469;1500;0;0;0;0;0;0;0 -2.5;7;8912;1.0273;1462;1500;0;0;0;0;0;0;0 -2.6;7;8912;1.0273;1159;1500;0;0;0;0;0;0;0 -2.7;7;8912;1.0273;919;1500;0;0;0;0;0;0;0 -2.8;7;8912;1.0273;729;1500;0;0;0;0;0;0;0 -2.9;7;8912;1.0273;578;1500;0;0;0;0;0;0;0 -3;7;8912;1.0273;458;1500;0;0;0;0;0;0;0 -3.1;7;8912;1.0273;319;1500;0;0;0;0;0;0;0 -3.2;7;8912;1.0273;222;1500;0;0;0;0;0;0;0 -3.3;7;8912;1.0273;155;1500;0;0;0;0;0;0;0 -3.4;7;8912;1.0273;108;1500;0;0;0;0;0;0;0 -3.5;7;8912;1.0273;75;1500;0;0;0;0;0;0;0 -3.6;7;8912;1.0273;48;1500;0;0;0;0;0;0;0 -3.7;7;8912;1.0273;30;1500;0;0;0;0;0;0;0 -3.8;7;8912;1.0273;19;1500;0;0;0;0;0;0;0 -3.9;7;8912;1.0273;12;1500;0;0;0;0;0;0;0 -4;7;8912;1.0273;8;1500;0;0;0;0;0;0;0 -4.1;7;8912;1.0273;4;1500;0;0;0;0;0;0;0 -4.2;7;8912;1.0273;2;1500;0;0;0;0;0;0;0 -4.3;7;8912;1.0273;1;1500;0;0;0;0;0;0;0 -4.4;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 -4.5;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 -4.6;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 -4.7;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 -4.8;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 -4.9;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 -5;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +-0.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +0.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.1;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.3;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.4;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.5;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.6;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.7;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.8;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +1.9;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +2;7;8912;1.0273;1500;1500;0;0;0;0;0;0;0 +2.1;7;8912;1.0273;1492;1500;0;0;0;0;0;0;0 +2.2;7;8912;1.0273;1484;1500;0;0;0;0;0;0;0 +2.3;7;8912;1.0273;1477;1500;0;0;0;0;0;0;0 +2.4;7;8912;1.0273;1469;1500;0;0;0;0;0;0;0 +2.5;7;8912;1.0273;1462;1500;0;0;0;0;0;0;0 +2.6;7;8912;1.0273;1159;1500;0;0;0;0;0;0;0 +2.7;7;8912;1.0273;919;1500;0;0;0;0;0;0;0 +2.8;7;8912;1.0273;729;1500;0;0;0;0;0;0;0 +2.9;7;8912;1.0273;578;1500;0;0;0;0;0;0;0 +3;7;8912;1.0273;458;1500;0;0;0;0;0;0;0 +3.1;7;8912;1.0273;319;1500;0;0;0;0;0;0;0 +3.2;7;8912;1.0273;222;1500;0;0;0;0;0;0;0 +3.3;7;8912;1.0273;155;1500;0;0;0;0;0;0;0 +3.4;7;8912;1.0273;108;1500;0;0;0;0;0;0;0 +3.5;7;8912;1.0273;75;1500;0;0;0;0;0;0;0 +3.6;7;8912;1.0273;48;1500;0;0;0;0;0;0;0 +3.7;7;8912;1.0273;30;1500;0;0;0;0;0;0;0 +3.8;7;8912;1.0273;19;1500;0;0;0;0;0;0;0 +3.9;7;8912;1.0273;12;1500;0;0;0;0;0;0;0 +4;7;8912;1.0273;8;1500;0;0;0;0;0;0;0 +4.1;7;8912;1.0273;4;1500;0;0;0;0;0;0;0 +4.2;7;8912;1.0273;2;1500;0;0;0;0;0;0;0 +4.3;7;8912;1.0273;1;1500;0;0;0;0;0;0;0 +4.4;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.5;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.6;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.7;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.8;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +4.9;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 +5;7;8912;1.0273;0;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs8_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs8_awgn_5G.csv index 4c202068f1..470cce69ae 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs8_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs8_awgn_5G.csv @@ -1,62 +1,62 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 --0.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -0.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -1.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -2.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 -3.1;8;9224;1.1758;1464;1500;0;0;0;0;0;0;0 -3.2;8;9224;1.1758;1429;1500;0;0;0;0;0;0;0 -3.3;8;9224;1.1758;1394;1500;0;0;0;0;0;0;0 -3.4;8;9224;1.1758;1361;1500;0;0;0;0;0;0;0 -3.5;8;9224;1.1758;1328;1500;0;0;0;0;0;0;0 -3.6;8;9224;1.1758;973;1500;0;0;0;0;0;0;0 -3.7;8;9224;1.1758;713;1500;0;0;0;0;0;0;0 -3.8;8;9224;1.1758;522;1500;0;0;0;0;0;0;0 -3.9;8;9224;1.1758;382;1500;0;0;0;0;0;0;0 -4;8;9224;1.1758;280;1500;0;0;0;0;0;0;0 -4.1;8;9224;1.1758;190;1500;0;0;0;0;0;0;0 -4.2;8;9224;1.1758;129;1500;0;0;0;0;0;0;0 -4.3;8;9224;1.1758;87;1500;0;0;0;0;0;0;0 -4.4;8;9224;1.1758;59;1500;0;0;0;0;0;0;0 -4.5;8;9224;1.1758;40;1500;0;0;0;0;0;0;0 -4.6;8;9224;1.1758;20;1500;0;0;0;0;0;0;0 -4.7;8;9224;1.1758;10;1500;0;0;0;0;0;0;0 -4.8;8;9224;1.1758;5;1500;0;0;0;0;0;0;0 -4.9;8;9224;1.1758;2;1500;0;0;0;0;0;0;0 -5;8;9224;1.1758;1;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +-0.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +0.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +1.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.1;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.2;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.4;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.5;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.6;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.7;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.8;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +2.9;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +3;8;9224;1.1758;1500;1500;0;0;0;0;0;0;0 +3.1;8;9224;1.1758;1464;1500;0;0;0;0;0;0;0 +3.2;8;9224;1.1758;1429;1500;0;0;0;0;0;0;0 +3.3;8;9224;1.1758;1394;1500;0;0;0;0;0;0;0 +3.4;8;9224;1.1758;1361;1500;0;0;0;0;0;0;0 +3.5;8;9224;1.1758;1328;1500;0;0;0;0;0;0;0 +3.6;8;9224;1.1758;973;1500;0;0;0;0;0;0;0 +3.7;8;9224;1.1758;713;1500;0;0;0;0;0;0;0 +3.8;8;9224;1.1758;522;1500;0;0;0;0;0;0;0 +3.9;8;9224;1.1758;382;1500;0;0;0;0;0;0;0 +4;8;9224;1.1758;280;1500;0;0;0;0;0;0;0 +4.1;8;9224;1.1758;190;1500;0;0;0;0;0;0;0 +4.2;8;9224;1.1758;129;1500;0;0;0;0;0;0;0 +4.3;8;9224;1.1758;87;1500;0;0;0;0;0;0;0 +4.4;8;9224;1.1758;59;1500;0;0;0;0;0;0;0 +4.5;8;9224;1.1758;40;1500;0;0;0;0;0;0;0 +4.6;8;9224;1.1758;20;1500;0;0;0;0;0;0;0 +4.7;8;9224;1.1758;10;1500;0;0;0;0;0;0;0 +4.8;8;9224;1.1758;5;1500;0;0;0;0;0;0;0 +4.9;8;9224;1.1758;2;1500;0;0;0;0;0;0;0 +5;8;9224;1.1758;1;1500;0;0;0;0;0;0;0 diff --git a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs9_awgn_5G.csv b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs9_awgn_5G.csv index adfb19b6de..2ba438ea49 100644 --- a/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs9_awgn_5G.csv +++ b/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs9_awgn_5G.csv @@ -1,64 +1,64 @@ -SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err --1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 --0.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -0.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -1.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -2.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -3.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -3.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -3.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -3.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -3.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -3.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 -3.7;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 -3.8;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 -3.9;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 -4;9;10504;1.3262;1498;1500;0;0;0;0;0;0;0 -4.1;9;10504;1.3262;1339;1500;0;0;0;0;0;0;0 -4.2;9;10504;1.3262;1196;1500;0;0;0;0;0;0;0 -4.3;9;10504;1.3262;1068;1500;0;0;0;0;0;0;0 -4.4;9;10504;1.3262;955;1500;0;0;0;0;0;0;0 -4.5;9;10504;1.3262;853;1500;0;0;0;0;0;0;0 -4.6;9;10504;1.3262;552;1500;0;0;0;0;0;0;0 -4.7;9;10504;1.3262;357;1500;0;0;0;0;0;0;0 -4.8;9;10504;1.3262;231;1500;0;0;0;0;0;0;0 -4.9;9;10504;1.3262;149;1500;0;0;0;0;0;0;0 -5;9;10504;1.3262;96;1500;0;0;0;0;0;0;0 -5.1;9;10504;1.3262;0;1500;0;0;0;0;0;0;0 -5.2;9;10504;1.3262;0;1500;0;0;0;0;0;0;0 +SNR;MCS;TBS;rate;err0;trials0;err1;trials1;err2;trials2;err3;trials3;dci_err +-1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +-0.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +0.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +1.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.7;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.8;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +2.9;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.1;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.2;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.3;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.4;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.5;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.6;9;10504;1.3262;1500;1500;0;0;0;0;0;0;0 +3.7;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 +3.8;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 +3.9;9;10504;1.3262;1499;1500;0;0;0;0;0;0;0 +4;9;10504;1.3262;1498;1500;0;0;0;0;0;0;0 +4.1;9;10504;1.3262;1339;1500;0;0;0;0;0;0;0 +4.2;9;10504;1.3262;1196;1500;0;0;0;0;0;0;0 +4.3;9;10504;1.3262;1068;1500;0;0;0;0;0;0;0 +4.4;9;10504;1.3262;955;1500;0;0;0;0;0;0;0 +4.5;9;10504;1.3262;853;1500;0;0;0;0;0;0;0 +4.6;9;10504;1.3262;552;1500;0;0;0;0;0;0;0 +4.7;9;10504;1.3262;357;1500;0;0;0;0;0;0;0 +4.8;9;10504;1.3262;231;1500;0;0;0;0;0;0;0 +4.9;9;10504;1.3262;149;1500;0;0;0;0;0;0;0 +5;9;10504;1.3262;96;1500;0;0;0;0;0;0;0 +5.1;9;10504;1.3262;0;1500;0;0;0;0;0;0;0 +5.2;9;10504;1.3262;0;1500;0;0;0;0;0;0;0 From fb3e3ea6e533b43592638b396de543a532df78d5 Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 8 Feb 2022 23:43:02 +0000 Subject: [PATCH 407/883] Merge branch 'episys/david/adding_NR_to_NUM_MCS' into 'episys/master-nsa' Added NR to NUM_MCS for nr channel modeling. See merge request aburger/openairinterface5g!109 --- executables/nr-uesoftmodem.c | 4 ++-- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 8 ++++---- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 8fec3b3ad1..7b10f4fade 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -158,7 +158,7 @@ uint32_t N_RB_DL = 106; */ uint8_t abstraction_flag = 0; -nr_bler_struct nr_bler_data[NUM_MCS]; +nr_bler_struct nr_bler_data[NR_NUM_MCS]; static void init_bler_table(void); @@ -561,7 +561,7 @@ static void init_bler_table(void) abort(); } - for (unsigned int i = 0; i < NUM_MCS; i++) + for (unsigned int i = 0; i < NR_NUM_MCS; i++) { char fName[1024]; snprintf(fName, sizeof(fName), "%s/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs%d_awgn_5G.csv", openair_dir, i); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index cfb24d5654..71345c6d9f 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1404,13 +1404,13 @@ static int get_mcs_from_sinr(float sinr) return 0; } - if (sinr > (nr_bler_data[NUM_MCS-1].bler_table[nr_bler_data[NUM_MCS-1].length - 1][0])) + if (sinr > (nr_bler_data[NR_NUM_MCS-1].bler_table[nr_bler_data[NR_NUM_MCS-1].length - 1][0])) { LOG_I(NR_MAC, "The SINR found is larger than last MCS table\n"); - return NUM_MCS-1; + return NR_NUM_MCS-1; } - for (int n = NUM_MCS-1; n >= 0; n--) + for (int n = NR_NUM_MCS-1; n >= 0; n--) { CHECK_INDEX(nr_bler_data, n); float largest_sinr = (nr_bler_data[n].bler_table[nr_bler_data[n].length - 1][0]); @@ -1429,7 +1429,7 @@ static int get_cqi_from_mcs(void) { static const int mcs_to_cqi[] = {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15}; - assert(NUM_ELEMENTS(mcs_to_cqi) == NUM_MCS); + assert(NUM_ELEMENTS(mcs_to_cqi) == NR_NUM_MCS); int slot = 0; while (slot < NUM_NFAPI_SLOT) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index d3b12abc2b..499346f394 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -41,7 +41,7 @@ #include "nfapi_nr_interface_scf.h" #include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h" -#define NUM_MCS 29 +#define NR_NUM_MCS 29 #define NUM_SINR 100 #define NUM_BLER_COL 13 #define NUM_NFAPI_SLOT 20 @@ -74,7 +74,7 @@ typedef struct float bler_table[NUM_SINR][NUM_BLER_COL]; } nr_bler_struct; -extern nr_bler_struct nr_bler_data[NUM_MCS]; +extern nr_bler_struct nr_bler_data[NR_NUM_MCS]; typedef enum { ONLY_PUSCH, From a8a04c729352b58d53e0d80c55398d8041f2cc02 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 8 Feb 2022 16:55:25 -0800 Subject: [PATCH 408/883] Accidentally ommited SISO channel modeling change We should be setting the queued UCI indication slot based on the SCHEDULED slot, not the current slot. --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 799b759292..2eb1da9101 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -288,7 +288,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind)); uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION; uci_ind->sfn = scheduled_response->frame; - uci_ind->slot = scheduled_response->slot; + uci_ind->slot = NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot); uci_ind->num_ucis = 1; uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); for (int j = 0; j < uci_ind->num_ucis; j++) From a1dee602fef316d841b9703da19e467d8dd1d5a4 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 8 Feb 2022 17:11:59 -0800 Subject: [PATCH 409/883] Duplicated packing and unpacking fixed in this commit This now matches the develop branch as well. --- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index d103200787..adc6d6e384 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -5906,25 +5906,9 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu return 1; } -static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value, - uint8_t **ppReadPackedMsg, - uint8_t *end, - nfapi_p7_codec_config_t *config) { - if (!pull8(ppReadPackedMsg, &value->pduBitmap, end)) - return 0; - if (!pull32(ppReadPackedMsg, &value->handle, end)) - return 0; - if (!pull16(ppReadPackedMsg, &value->rnti, end)) - return 0; - if (!pull8(ppReadPackedMsg, &value->pucch_format, end)) - return 0; - if (!pull8(ppReadPackedMsg, &value->ul_cqi, end)) - return 0; - if (!pull16(ppReadPackedMsg, &value->timing_advance, end)) - return 0; - if (!pull16(ppReadPackedMsg, &value->rssi, end)) - return 0; +static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && pull32(ppReadPackedMsg, &value->handle, end) && @@ -6004,7 +5988,7 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, } case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4; - if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end, config)) + if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end)) return 0; break; } From 76885758aaf1f8acaff1f4fc13841fb287f4e7ba Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 7 Feb 2022 16:24:37 +0100 Subject: [PATCH 410/883] add support for continuous transmission In case of TDD we usually disable TX during RX. Unfortunately some USRPs create self-interference after disabling TX. To be able to work-around this issue, we add the flag "--continuous-tx". --- executables/nr-gnb.c | 21 +++++++++--- executables/nr-ru.c | 61 +++++++++++++++++++--------------- executables/nr-ue.c | 6 ++-- executables/softmodem-common.h | 4 +++ 4 files changed, 58 insertions(+), 34 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 2b1c36407b..e4170210e0 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -210,7 +210,6 @@ void rx_func(void *param) { if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1); // RX processing - int tx_slot_type = nr_slot_select(cfg,frame_tx,slot_tx); int rx_slot_type = nr_slot_select(cfg,frame_rx,slot_rx); if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) { // UE-specific RX processing for subframe n @@ -244,7 +243,8 @@ void rx_func(void *param) { gNB->if_inst->NR_UL_indication(&gNB->UL_INFO); pthread_mutex_unlock(&gNB->UL_INFO_mutex); stop_meas(&gNB->ul_indication_stats); - + + int tx_slot_type = nr_slot_select(cfg,frame_rx,slot_tx); if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) { notifiedFIFO_elt_t *res; processingData_L1tx_t *syncMsg; @@ -256,8 +256,17 @@ void rx_func(void *param) { syncMsg->timestamp_tx = info->timestamp_tx; res->key = slot_tx; pushTpool(gNB->threadPool, res); + } else if (get_softmodem_params()->continuous_tx) { + notifiedFIFO_elt_t *res = pullTpool(gNB->L1_tx_free, gNB->threadPool); + processingData_L1tx_t *syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res); + syncMsg->gNB = gNB; + syncMsg->timestamp_tx = info->timestamp_tx; + syncMsg->frame = frame_tx; + syncMsg->slot = slot_tx; + res->key = slot_tx; + pushNotifiedFIFO(gNB->L1_tx_out, res); } - + #if 0 LOG_D(PHY, "rxtx:%lld nfapi:%lld phy:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ", softmodem_stats_rxtx_sf.diff_now, nfapi_meas.diff_now, @@ -397,7 +406,11 @@ void *tx_reorder_thread(void* param) { syncMsgRU.slot_tx = syncMsgL1->slot; syncMsgRU.timestamp_tx = syncMsgL1->timestamp_tx; syncMsgRU.ru = gNB->RU_list[0]; - next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU.frame_tx, syncMsgRU.slot_tx); + if (get_softmodem_params()->continuous_tx) { + int slots_per_frame = gNB->frame_parms.slots_per_frame; + next_tx_slot = (syncMsgRU.slot_tx + 1) % slots_per_frame; + } else + next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU.frame_tx, syncMsgRU.slot_tx); pushNotifiedFIFO(gNB->L1_tx_free, resL1); if (resL1==resL1Reserve) resL1Reserve=NULL; diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 08decf0f67..45ef0f9baf 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -703,46 +703,53 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { nfapi_nr_config_request_scf_t *cfg = &ru->config; void *txp[ru->nb_tx]; unsigned int txs; - int i,txsymb=fp->symbols_per_slot; + int i; T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot), T_INT(0), T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot,fp,0)], fp->samples_per_subframe * 4)); - int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame); - int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame); - int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame); int sf_extension = 0; int siglen=fp->get_samples_per_slot(slot,fp); - int flags=1; + int flags = 0; - //nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame); - if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT || IS_SOFTMODEM_RFSIM) { - if (cfg->cell_config.frame_duplex_type.value == TDD) { - if(slot_type == NR_MIXED_SLOT) { - txsymb = 0; + if (cfg->cell_config.frame_duplex_type.value == TDD && !get_softmodem_params()->continuous_tx) { + int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame); + if(slot_type == NR_MIXED_SLOT) { + int txsymb = 0; - for(int symbol_count = 0; symbol_counttdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0) - txsymb++; - } - - AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb); - - if(slot%(fp->slots_per_subframe/2)) - siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples); - else - siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples); - - //+ ru->end_of_burst_delay; - flags = 3; // end of burst + for(int symbol_count = 0; symbol_counttdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0) + txsymb++; } - if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT) { + AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb); + + if(slot%(fp->slots_per_subframe/2)) + siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples); + else + siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples); + + //+ ru->end_of_burst_delay; + flags = 3; // end of burst + } else if (slot_type == NR_DOWNLINK_SLOT) { + int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame); + int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame); + if (prevslot_type == NR_UPLINK_SLOT) { flags = 2; // start of burst sf_extension = ru->sf_extension; - } - if (slot_type == NR_DOWNLINK_SLOT && nextslot_type == NR_UPLINK_SLOT) + } else if (nextslot_type == NR_UPLINK_SLOT) { flags = 3; // end of burst + } else { + flags = 1; // middle of burst + } } + } else { // FDD + if (proc->first_tx == 1) { + flags = 2; // start of burst + } else { + flags = 1; // middle of burst + } + } + if (flags) { if (fp->freq_range==nr_FR2) { // the beam index is written in bits 8-10 of the flags // bit 11 enables the gpio programming diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 2e7b2ea0e1..0270486686 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -1091,9 +1091,8 @@ void *UE_thread(void *arg) { } int flags = 0; - int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH; - if (openair0_cfg[0].duplex_mode == duplex_mode_TDD) { + if (openair0_cfg[0].duplex_mode == duplex_mode_TDD && !get_softmodem_params()->continuous_tx) { uint8_t tdd_period = mac->phy_config.config_req.tdd_table.tdd_period_in_slots; int nrofUplinkSlots, nrofUplinkSymbols; @@ -1105,8 +1104,9 @@ void *UE_thread(void *arg) { nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots; nrofUplinkSymbols = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; } - uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSymbols != 0); + int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH; + uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSymbols != 0); uint8_t first_tx_slot = tdd_period - num_UL_slots; if (slot_tx_usrp % tdd_period == first_tx_slot) diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 9aca677473..9512199cd3 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -99,6 +99,7 @@ extern "C" #define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n" #define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR\n" #define CONFIG_L1_EMULATOR "Run in L1 emulated mode (disable PHY layer)\n" +#define CONFIG_HLP_CONTINUOUS_TX "perform continuous transmission, even in TDD mode (to work around USRP issues)\n" /*-----------------------------------------------------------------------------------------------------------------------------------------------------*/ /* command line parameters common to eNodeB and UE */ @@ -127,6 +128,7 @@ extern "C" #define NODE_NUMBER softmodem_params.node_number #define NON_STOP softmodem_params.non_stop #define EMULATE_L1 softmodem_params.emulate_l1 +#define CONTINUOUS_TX softmodem_params.continuous_tx #define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat"; @@ -166,6 +168,7 @@ extern int usrp_tx_thread; {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \ {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \ {"emulate-l1", CONFIG_L1_EMULATOR, PARAMFLAG_BOOL, iptr:&EMULATE_L1, defintval:0, TYPE_INT, 0}, \ + {"continuous-tx", CONFIG_HLP_CONTINUOUS_TX,PARAMFLAG_BOOL, iptr:&CONTINUOUS_TX, defintval:0, TYPE_INT, 0}, \ } #define CONFIG_HLP_NSA "Enable NSA mode \n" @@ -262,6 +265,7 @@ typedef struct { uint16_t node_number; int non_stop; int emulate_l1; + int continuous_tx; } softmodem_params_t; extern uint64_t get_softmodem_optmask(void); From 1409e3bcb4e997ec54360c05146f53fe93a9ee32 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Tue, 8 Feb 2022 12:47:22 +0100 Subject: [PATCH 411/883] nr-ue: fix T tracer T tracer was not functional anymore. because init_tpools() was called before T_Config_Init(). The problem was that init_tpools() creates some threads and T_Config_Init() does call fork() and the child process (which is the one running the softmodem, the parent process is used to monitor it, this is the design of the T tracer, maybe to change at some point, it's too complicated) has no thread after the fork(). The threads created by init_tpools() are gone. Game over. In conclusion: T_Config_Init() has to be called very early in the life of the softmodem, at least before init_tpools(). --- executables/nr-uesoftmodem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index ddbbbdf52c..7663e9ebd8 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -422,11 +422,11 @@ int main( int argc, char **argv ) { get_options (); //Command-line options specific for NRUE get_common_options(SOFTMODEM_5GUE_BIT); - init_tpools(nrUE_params.nr_dlsch_parallel); CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP); #if T_TRACER T_Config_Init(); #endif + init_tpools(nrUE_params.nr_dlsch_parallel); //randominit (0); set_taus_seed (0); From d87d22567a3732dce9c3e9c6f5cb8a59f8f7d701 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 9 Feb 2022 08:59:02 +0100 Subject: [PATCH 412/883] review and fix SA 162PRBconf file --- ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index f28c3167b6..75f2b2ff91 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -39,11 +39,8 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" - min_rxtxtime = 6; + pusch_AntennaPorts = 2; + ul_prbblacklist = "79,80,81,82" pdcch_ConfigSIB1 = ( { @@ -86,7 +83,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 31889; + initialDLBWPlocationAndBandwidth = 31899; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -94,8 +91,6 @@ gNBs = initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - - #uplinkConfigCommon #frequencyInfoUL ul_frequencyBand = 78; @@ -108,7 +103,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 31889; + initialULBWPlocationAndBandwidth = 31899; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -229,9 +224,9 @@ MACRLCs = ( num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; +# pusch_TargetSNRx10 = 200; +# pucch_TargetSNRx10 = 150; + ulsch_max_frame_inactivity = 0; } ); @@ -247,8 +242,8 @@ L1s = ( RUs = ( { local_rf = "yes" - nb_tx = 1 - nb_rx = 1 + nb_tx = 2 + nb_rx = 2 att_tx = 0 att_rx = 0; bands = [78]; From 3dce1171d56a1df74697bf429170072d55dcb18d Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 8 Feb 2022 19:04:43 +0000 Subject: [PATCH 413/883] Fixes after merge --- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index e7fdb980b3..aaf40afbee 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -652,7 +652,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, sched_ctrl->coreset, scc, genericParameters, - NULL); + RC.nrmac[Mod_idP]->type0_PDCCH_CSS_config); sched_ctrl->maxL = 2; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index d33946a122..74414a00b2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -614,7 +614,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ra->coreset, scc, genericParameters, - NULL); + &nr_mac->type0_PDCCH_CSS_config[ra->beam_id]); // retrieving ra pdcch monitoring period and offset find_monitoring_periodicity_offset_common(ra->ra_ss, &monitoring_slot_period, &monitoring_offset); From f336cbc645b49d72be8eec5a05890f4624a3c532 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 9 Feb 2022 07:30:04 -0800 Subject: [PATCH 414/883] Fixing pull/push array 32 and cleaning nFAPI code Several of these changes were made previously and lost in the merge. --- nfapi/open-nFAPI/nfapi/inc/nfapi.h | 12 +- nfapi/open-nFAPI/nfapi/src/nfapi.c | 46 ++-- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 314 +++++++++++++++++--------- 3 files changed, 242 insertions(+), 130 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/inc/nfapi.h b/nfapi/open-nFAPI/nfapi/inc/nfapi.h index 0f09efa78a..c1f423a8db 100644 --- a/nfapi/open-nFAPI/nfapi/inc/nfapi.h +++ b/nfapi/open-nFAPI/nfapi/inc/nfapi.h @@ -44,13 +44,21 @@ uint8_t pulls32(uint8_t **in, int32_t *out, uint8_t *end); uint32_t pullarray8(uint8_t **in, uint8_t out[], uint32_t max_len, uint32_t len, uint8_t *end); uint32_t pullarray16(uint8_t **in, uint16_t out[], uint32_t max_len, uint32_t len, uint8_t *end); uint32_t pullarrays16(uint8_t **in, int16_t out[], uint32_t max_len, uint32_t len, uint8_t *end); -uint32_t pullarray32(uint8_t **in, uint32_t out[], uint32_t max_len, uint32_t len, uint8_t *end); +uint32_t pullarray32(uint8_t **values_to_pull, + uint32_t out[], + uint32_t max_num_values_to_pull, + uint32_t num_values_to_pull, + uint8_t *out_end); uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t len, uint8_t *end); uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); -uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); +uint32_t pusharray32(const uint32_t *values_to_push, + uint32_t max_num_values_to_push, + uint32_t num_values_to_push, + uint8_t **out, + uint8_t *out_end); uint32_t pusharrays32(int32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end); typedef uint8_t (*pack_array_elem_fn)(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end); diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi.c b/nfapi/open-nFAPI/nfapi/src/nfapi.c index 2783781e2c..5b43cb1246 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi.c @@ -307,7 +307,8 @@ uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **ou uint32_t idx; for(idx = 0; idx < len; ++idx) { - pushs16(in[idx], out, end); + if (!pushs16(in[idx], out, end)) + return 0; } return sizeof(uint16_t) * len; @@ -316,24 +317,28 @@ uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **ou return 0; } } -uint32_t pullarray32(uint8_t **in, uint32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { - if(len == 0) +uint32_t pullarray32(uint8_t **values_to_pull, + uint32_t out[], + uint32_t max_num_values_to_pull, + uint32_t num_values_to_pull, + uint8_t *out_end) { + if(num_values_to_pull == 0) return 1; - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + if(num_values_to_pull > max_num_values_to_pull) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, num_values_to_pull, max_num_values_to_pull); return 0; } - if((end - (*in)) >= sizeof(uint32_t) * len) { + if((out_end - (*values_to_pull)) >= sizeof(uint32_t) * num_values_to_pull) { uint32_t idx; - for(idx = 0; idx < len; ++idx) { - if(!pull32(in, &out[idx], end)) + for(idx = 0; idx < num_values_to_pull; ++idx) { + if(!pull32(values_to_pull, &out[idx], out_end)) return 0; } - return sizeof(uint32_t) * len; + return sizeof(uint32_t) * num_values_to_pull; } else { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); return 0; @@ -363,24 +368,28 @@ uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t le return 0; } } -uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { - if(len == 0) +uint32_t pusharray32(const uint32_t *values_to_push, + uint32_t max_num_values_to_push, + uint32_t num_values_to_push, + uint8_t **out, + uint8_t *out_end) { + if(num_values_to_push == 0) return 1; - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + if(num_values_to_push > max_num_values_to_push) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, num_values_to_push, max_num_values_to_push); return 0; } - if((end - (*out)) >= sizeof(uint32_t) * len) { + if((out_end - (*out)) >= sizeof(uint32_t) * num_values_to_push) { uint32_t idx; - for(idx = 0; idx < len; ++idx) { - if(!push32(in[idx], out, end)) + for(idx = 0; idx < num_values_to_push; ++idx) { + if(!push32(values_to_push[idx], out, out_end)) return 0; } - return sizeof(uint32_t) * len; + return sizeof(uint32_t) * num_values_to_push; } else { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); return 0; @@ -399,7 +408,8 @@ uint32_t pusharrays32(int32_t in[], uint32_t max_len, uint32_t len, uint8_t **ou uint32_t idx; for(idx = 0; idx < len; ++idx) { - pushs32(in[idx], out, end); + if (!pushs32(in[idx], out, end)) + return 0; } return sizeof(uint32_t) * len; diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index adc6d6e384..1cc062b68f 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -1893,15 +1893,23 @@ static uint8_t pack_tx_data_pdu_list_value(void *tlv, uint8_t **ppWritePackedMsg switch(value->TLVs[i].tag) { case 0: { - if(!pusharray32(value->TLVs[i].value.direct, 16384, value->TLVs[i].length, ppWritePackedMsg, end)) + if (!pusharray32(value->TLVs[i].value.direct, sizeof(value->TLVs[i].value.direct) / sizeof(uint32_t), + value->TLVs[i].length / sizeof(uint32_t), ppWritePackedMsg, end)) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s():%d. value->TLVs[i].length %d \n", + __FUNCTION__, __LINE__, value->TLVs[i].length); return 0; + } break; } case 1: { - if(!pusharray32(value->TLVs[i].value.ptr, value->TLVs[i].length, value->TLVs[i].length, ppWritePackedMsg, end)) + if (!pusharray32(value->TLVs[i].value.ptr, value->TLVs[i].length / sizeof(uint32_t), + value->TLVs[i].length / sizeof(uint32_t), ppWritePackedMsg, end)) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s():%d. value->TLVs[i].length %d \n", + __FUNCTION__, __LINE__, value->TLVs[i].length); return 0; + } break; } @@ -3181,32 +3189,36 @@ return 1; static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_uci_pucch_pdu_format_0_1_t* value = (nfapi_nr_uci_pucch_pdu_format_0_1_t*)tlv; - if(!(push8(value->pduBitmap, ppWritePackedMsg, end) && - push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->pucch_format, ppWritePackedMsg, end) && - push8(value->ul_cqi, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end) && - push16(value->rssi, ppWritePackedMsg, end) - )) - return 0; + if (!push8(value->pduBitmap, ppWritePackedMsg, end)) + return 0; + if (!push32(value->handle, ppWritePackedMsg, end)) + return 0; + if (!push16(value->rnti, ppWritePackedMsg, end)) + return 0; + if (!push8(value->pucch_format, ppWritePackedMsg, end)) + return 0; + if (!push8(value->ul_cqi, ppWritePackedMsg, end)) + return 0; + if (!push16(value->timing_advance, ppWritePackedMsg, end)) + return 0; + if (!push16(value->rssi, ppWritePackedMsg, end)) + return 0; if (value->pduBitmap & 0x01) { //SR - if (!(push8(value->sr->sr_indication, ppWritePackedMsg, end) && - push8(value->sr->sr_confidence_level, ppWritePackedMsg, end) - )) - return 0; + if (!push8(value->sr->sr_indication, ppWritePackedMsg, end)) + return 0; + if (!push8(value->sr->sr_confidence_level, ppWritePackedMsg, end)) + return 0; } if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - if (!(push8(value->harq->num_harq, ppWritePackedMsg, end) && - push8(value->harq->harq_confidence_level, ppWritePackedMsg, end) - )) + if (!push8(value->harq->num_harq, ppWritePackedMsg, end)) + return 0; + if (!push8(value->harq->harq_confidence_level, ppWritePackedMsg, end)) return 0; for (int i = 0; i < value->harq->num_harq; i++) { - if (!(push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end) - )) - return 0; + if (!push8(value->harq->harq_list[i].harq_value, ppWritePackedMsg, end)) + return 0; } } @@ -3216,60 +3228,83 @@ static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint static uint8_t pack_nr_uci_pucch_2_3_4(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; - if(!(push8(value->pduBitmap, ppWritePackedMsg, end) && - push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->pucch_format, ppWritePackedMsg, end) && - push8(value->ul_cqi, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end) && - push16(value->rssi, ppWritePackedMsg, end) - )) - return 0; + if (!push8(value->pduBitmap, ppWritePackedMsg, end)) + return 0; + if (!push32(value->handle, ppWritePackedMsg, end)) + return 0; + if (!push16(value->rnti, ppWritePackedMsg, end)) + return 0; + if (!push8(value->pucch_format, ppWritePackedMsg, end)) + return 0; + if (!push8(value->ul_cqi, ppWritePackedMsg, end)) + return 0; + if (!push16(value->timing_advance, ppWritePackedMsg, end)) + return 0; + if (!push16(value->rssi, ppWritePackedMsg, end)) + return 0; if (value->pduBitmap & 0x01) { //SR - if(!(push8(value->sr.sr_bit_len, ppWritePackedMsg, end) && - pusharray8(value->sr.sr_payload, (int)(value->sr.sr_bit_len / 8) + 1, (int)(value->sr.sr_bit_len / 8) + 1, ppWritePackedMsg, end) - )) - return 0; - } - - if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - if(!(push8(value->harq.harq_crc, ppWritePackedMsg, end) && - push8(value->harq.harq_bit_len, ppWritePackedMsg, end) && - pusharray8(value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8) + 1, (int)(value->harq.harq_bit_len / 8) + 1, ppWritePackedMsg, end) - )) + if (!push16(value->sr.sr_bit_len, ppWritePackedMsg, end)) + return 0; + if (!pusharray8(value->sr.sr_payload, + (int)((value->sr.sr_bit_len / 8) + 1), + (int)((value->sr.sr_bit_len / 8) + 1), + ppWritePackedMsg, + end)) return 0; } - if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1 - if(!(push8(value->csi_part1.csi_part1_crc, ppWritePackedMsg, end) && - push8(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end) && - pusharray8(value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, ppWritePackedMsg, end) - )) + if ((value->pduBitmap >> 1) & 0x01) { //HARQ + if (!push8(value->harq.harq_crc, ppWritePackedMsg, end)) + return 0; + if (!push16(value->harq.harq_bit_len, ppWritePackedMsg, end)) + return 0; + if (!pusharray8(value->harq.harq_payload, + (int)((value->harq.harq_bit_len / 8) + 1), + (int)((value->harq.harq_bit_len / 8) + 1), + ppWritePackedMsg, + end)) return 0; } - if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2 - if(!(push8(value->csi_part2.csi_part2_crc, ppWritePackedMsg, end) && - push8(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end) && - pusharray8(value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, ppWritePackedMsg, end) - )) + if ((value->pduBitmap >> 2) & 0x01) { //CSI-1 + if (!push8(value->csi_part1.csi_part1_crc, ppWritePackedMsg, end)) + return 0; + if (!push16(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end)) + return 0; + if (!pusharray8(value->csi_part1.csi_part1_payload, + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + ppWritePackedMsg, + end)) + return 0; + } + + if ((value->pduBitmap >> 3) & 0x01) { //CSI-2 + if (!push8(value->csi_part2.csi_part2_crc, ppWritePackedMsg, end)) + return 0; + if (!push16(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end)) + return 0; + if (!pusharray8(value->csi_part2.csi_part2_payload, + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + ppWritePackedMsg, + end)) return 0; } return 1; } -static uint8_t pack_nr_uci_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +static uint8_t pack_nr_uci_indication_body(nfapi_nr_uci_t* value, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_uci_t* value = (nfapi_nr_uci_t*)tlv; - - if(!(push16(value->pdu_type, ppWritePackedMsg, end) && - push16(value->pdu_size, ppWritePackedMsg, end) - )) + if (!push16(value->pdu_type, ppWritePackedMsg, end)) + return 0; + if (!push16(value->pdu_size, ppWritePackedMsg, end)) return 0; switch (value->pdu_type) { + NFAPI_TRACE(NFAPI_TRACE_INFO, " NFAPI_NR_UCI_PUSCH_PDU_TYPE = %d \n", value->pdu_type); case NFAPI_NR_UCI_PUSCH_PDU_TYPE: NFAPI_TRACE(NFAPI_TRACE_WARN, "Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n"); break; @@ -3290,13 +3325,14 @@ static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uin { nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg; - if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && - push16(pNfapiMsg->slot , ppWritePackedMsg, end) && - push16(pNfapiMsg->num_ucis, ppWritePackedMsg, end) - )) + if (!push16(pNfapiMsg->sfn , ppWritePackedMsg, end)) + return 0; + if (!push16(pNfapiMsg->slot , ppWritePackedMsg, end)) + return 0; + if (!push16(pNfapiMsg->num_ucis, ppWritePackedMsg, end)) return 0; - for(int i=0; inum_ucis;i++) + for (int i = 0; i < pNfapiMsg->num_ucis; i++) { if (!pack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppWritePackedMsg, end)) return 0; @@ -5510,14 +5546,18 @@ static uint8_t unpack_tx_data_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t switch(pNfapiMsg->TLVs[i].tag) { case 0: { - if(!pullarray32(ppReadPackedMsg, pNfapiMsg->TLVs[i].value.direct, 16384, pNfapiMsg->TLVs[i].length, end)) + if (!pullarray32(ppReadPackedMsg, pNfapiMsg->TLVs[i].value.direct, + sizeof(pNfapiMsg->TLVs[i].value.direct) / sizeof(uint32_t), + pNfapiMsg->TLVs[i].length / sizeof(uint32_t), end)) return 0; break; } case 1: { - if(!pullarray32(ppReadPackedMsg, pNfapiMsg->TLVs[i].value.ptr, pNfapiMsg->TLVs[i].length, pNfapiMsg->TLVs[i].length, end)) + if (!pullarray32(ppReadPackedMsg,pNfapiMsg->TLVs[i].value.ptr, + pNfapiMsg->TLVs[i].length / sizeof(uint32_t), + pNfapiMsg->TLVs[i].length / sizeof(uint32_t), end)) return 0; break; @@ -5907,58 +5947,111 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu } -static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; +static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value, + uint8_t **ppReadPackedMsg, + uint8_t *end, + nfapi_p7_codec_config_t *config) { + + if (!pull8(ppReadPackedMsg, &value->pduBitmap, end)) + return 0; + if (!pull32(ppReadPackedMsg, &value->handle, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->rnti, end)) + return 0; + if (!pull8(ppReadPackedMsg, &value->pucch_format, end)) + return 0; + if (!pull8(ppReadPackedMsg, &value->ul_cqi, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->timing_advance, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->rssi, end)) + return 0; - if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && - pull32(ppReadPackedMsg, &value->handle, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->pucch_format, end) && - pull8(ppReadPackedMsg, &value->ul_cqi, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end) && - pull16(ppReadPackedMsg, &value->rssi, end) - )) - return 0; if (value->pduBitmap & 0x01) { //SR - if(!(pull16(ppReadPackedMsg, &value->sr.sr_bit_len, end))) + if (!pull16(ppReadPackedMsg, &value->sr.sr_bit_len, end)) return 0; - value->sr.sr_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->sr.sr_bit_len/8))); - - if(!(pullarray8(ppReadPackedMsg, &value->sr.sr_payload[0], (int)(value->sr.sr_bit_len / 8), (int)(value->sr.sr_bit_len / 8), end))) - return 0; - } - - if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - if(!(pull8(ppReadPackedMsg, &value->harq.harq_crc, end)) && - (pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end))) + value->sr.sr_payload = nfapi_p7_allocate(sizeof(*value->sr.sr_payload) * + (int)((value->sr.sr_bit_len / 8) + 1), + config); + if (value->sr.sr_payload == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate value->sr.sr_payload\n", __FUNCTION__); return 0; + } - value->harq.harq_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->harq.harq_bit_len/8 ))); - - if(!(pullarray8(ppReadPackedMsg, value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8), (int)(value->harq.harq_bit_len / 8), end))) + if (!pullarray8(ppReadPackedMsg, value->sr.sr_payload, + (int)((value->sr.sr_bit_len / 8) + 1), + (int)((value->sr.sr_bit_len / 8) + 1), + end)) return 0; } - if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1 - if(!(pull8(ppReadPackedMsg, &value->csi_part1.csi_part1_crc, end)) && - (pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end))) + if ((value->pduBitmap >> 1) & 0x01) { //HARQ + if (!pull8(ppReadPackedMsg, &value->harq.harq_crc, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end)) return 0; - value->csi_part1.csi_part1_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->csi_part1.csi_part1_bit_len/8))); + value->harq.harq_payload = nfapi_p7_allocate(sizeof(*value->harq.harq_payload) * + (int)((value->harq.harq_bit_len / 8) + 1), + config); + if (value->harq.harq_payload == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate value->harq.harq_payload\n", __FUNCTION__); + return 0; + } -// if(!(pullarray8(ppReadPackedMsg, value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8), (int)(value->csi_part1.csi_part1_bit_len / 8), end))) -// return 0; + if (!pullarray8(ppReadPackedMsg, value->harq.harq_payload, + (int)((value->harq.harq_bit_len / 8) + 1), + (int)((value->harq.harq_bit_len / 8) + 1), + end)) + return 0; } - if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2 - if(!(pull8(ppReadPackedMsg, &value->csi_part2.csi_part2_crc, end)) && - (pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end))) + if ((value->pduBitmap >> 2) & 0x01) { //CSI-1 + if (!pull8(ppReadPackedMsg, &value->csi_part1.csi_part1_crc, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end)) return 0; - value->csi_part2.csi_part2_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->csi_part2.csi_part2_bit_len/8 ))); + value->csi_part1.csi_part1_payload = nfapi_p7_allocate(sizeof(*value->csi_part1.csi_part1_payload) * + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + config); + if (value->csi_part1.csi_part1_payload == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate value->csi_part1.csi_part1_payload\n", + __FUNCTION__); + return 0; + } - if(!(pullarray8(ppReadPackedMsg, value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) , (int)(value->csi_part2.csi_part2_bit_len / 8) , end))) + if (!pullarray8(ppReadPackedMsg, value->csi_part1.csi_part1_payload, + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + end)) + return 0; + } + + if ((value->pduBitmap >> 3) & 0x01) { //CSI-2 + if (!pull8(ppReadPackedMsg, &value->csi_part2.csi_part2_crc, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end)) + return 0; + + value->csi_part2.csi_part2_payload = nfapi_p7_allocate(sizeof(*value->csi_part2.csi_part2_payload) * + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + config); + if (value->csi_part2.csi_part2_payload == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate value->csi_part2.csi_part2_payload\n", + __FUNCTION__); + return 0; + } + + if (!pullarray8(ppReadPackedMsg, value->csi_part2.csi_part2_payload, + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + end)) return 0; } @@ -5970,9 +6063,9 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, uint8_t *end, nfapi_p7_codec_config_t *config) { - if(!(pull16(ppReadPackedMsg, &value->pdu_type, end) && - pull16(ppReadPackedMsg, &value->pdu_size, end) - )) + if (!pull16(ppReadPackedMsg, &value->pdu_type, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->pdu_size, end)) return 0; switch (value->pdu_type) { @@ -5988,7 +6081,7 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, } case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4; - if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end)) + if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end, config)) return 0; break; } @@ -6004,17 +6097,18 @@ static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, { nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg; - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->num_ucis, end) - )) - return 0; + if (!pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end)) + return 0; + if (!pull16(ppReadPackedMsg, &pNfapiMsg->slot , end)) + return 0; + if (!pull16(ppReadPackedMsg, &pNfapiMsg->num_ucis, end)) + return 0; pNfapiMsg->uci_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->uci_list) * pNfapiMsg->num_ucis, config); for (int i = 0; i < pNfapiMsg->num_ucis; i++) { - if(!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end, config)) - return 0; + if (!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end, config)) + return 0; } return 1; From 60a9d41bc6b2b0c4c8717b8660d67dabacbd3487 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 9 Feb 2022 07:59:10 -0800 Subject: [PATCH 415/883] UCI ACK/NACK most of the way working We have gotten rid of filling the ACK/NACK with the DLSCH and now only fill with the PUCCH. This assumes that the MAC layer is properly decoding the dl_tti_req and tx_data_req and allows us to simply use the MAC layers scheduled SNF/Slot to return the ACK NACK. There are some hacks added in this commit which ensure that the PDCP packet has the correct header (1st byte = 80) and now with 15Mbps we are seeing about 20% packet loss and a gNB bug on the edge case (current frame is 1023 and the gNB schduler wants an ACK in frame 0 but the scheduled UL_TTI_REQ has a frame of 1023). --- executables/nr-ue.c | 39 ++-- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 180 +++++------------- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 14 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 95 +++++++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 + openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 167 ++++++---------- 6 files changed, 209 insertions(+), 289 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 86dc32674b..3370aa2fc2 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -32,6 +32,7 @@ #include "LAYER2/nr_pdcp/nr_pdcp_entity.h" #include "SCHED_NR_UE/pucch_uci_ue_nr.h" #include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" +#include /* * NR SLOT PROCESSING SEQUENCE @@ -199,31 +200,16 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) nfapi_nr_rach_indication_t *rach_ind = unqueue_matching(&nr_rach_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue); nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); - LOG_D(NR_MAC, "Try to get a ul_tti_req for HARQ sfn/slot %d %d from queue with %lu items\n", - NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot), - NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot), nr_ul_tti_req_queue.num_items); - nfapi_nr_ul_tti_request_t *ul_tti_request_harq = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_harq_sfn_slot); - if (ul_tti_request_harq && ul_tti_request_harq->n_pdus > 0) - { - check_and_process_dci(NULL, NULL, NULL, ul_tti_request_harq); - } - LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CSI active SFN %d/SLOT %d from queue with %lu items\n", - NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_uci_sfn_slot), - NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_uci_sfn_slot), nr_ul_tti_req_queue.num_items); - nfapi_nr_ul_tti_request_t *ul_tti_request_uci = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.active_uci_sfn_slot); - if (ul_tti_request_uci && ul_tti_request_uci->n_pdus > 0) - { - check_and_process_dci(NULL, NULL, NULL, ul_tti_request_uci); - } - - LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CRC active SFN %d/SLOT %d from queue with %lu items\n", - NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot), - NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot), nr_ul_tti_req_queue.num_items); - nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot); - if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0) - { - check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc); + for (int i = 0; i < 16; i++) { + LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CRC active SFN %d/SLOT %d from queue with %lu items\n", + NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot), + NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot), nr_ul_tti_req_queue.num_items); + nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot); + if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0) + { + check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc); + } } if (rach_ind && rach_ind->number_of_pdus > 0) @@ -389,6 +375,8 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ul_info.slot_tx = (slot + slot_ahead) % slots_per_frame; ul_info.frame_tx = (ul_info.slot_rx + slot_ahead >= slots_per_frame) ? ul_info.frame_rx + 1 : ul_info.frame_rx; ul_info.ue_sched_mode = SCHED_ALL; + LOG_I(NR_MAC, "frame_rx %d, slot rx %d, frame tx %d, slot tx %d, slot_ahead %d\n", + ul_info.frame_rx, ul_info.slot_rx, ul_info.frame_tx, ul_info.slot_tx, slot_ahead); if (pthread_mutex_lock(&mac->mutex_dl_info)) abort(); @@ -417,8 +405,9 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, ul_info.slot_tx, mac->frame_type)) { - LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", ul_info.slot_tx, __FUNCTION__); + LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() and nr_ue_pucch_scheduler from %s\n", ul_info.slot_tx, __FUNCTION__); nr_ue_ul_indication(&ul_info); + nr_ue_pucch_scheduler(0, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id); check_nr_prach(mac, &ul_info, &prach_resources); } if (!IS_SOFTMODEM_NOS1 && get_softmodem_params()->sa) { diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 2eb1da9101..4583e4f193 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -36,10 +36,11 @@ #include "fapi_nr_ue_l1.h" #include "harq_nr.h" //#include "PHY/phy_vars_nr_ue.h" -#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" + #include "PHY/defs_nr_UE.h" #include "PHY/impl_defs_nr.h" #include "utils.h" +#include "openair2/PHY_INTERFACE/queue_t.h" extern PHY_VARS_NR_UE ***PHY_vars_UE_g; @@ -103,6 +104,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION; rx_ind->sfn = scheduled_response->ul_config->sfn; rx_ind->slot = scheduled_response->ul_config->slot; + LOG_I(NR_MAC, "This is sched sfn/sl [%d %d] and rx sfn/sl [%d %d]\n", + scheduled_response->frame, scheduled_response->slot, rx_ind->sfn, rx_ind->slot); rx_ind->number_of_pdus = scheduled_response->tx_request->number_of_pdus; rx_ind->pdu_list = CALLOC(rx_ind->number_of_pdus, sizeof(*rx_ind->pdu_list)); for (int j = 0; j < rx_ind->number_of_pdus; j++) @@ -122,20 +125,20 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind->number_crcs = scheduled_response->ul_config->number_pdus; crc_ind->sfn = scheduled_response->ul_config->sfn; crc_ind->slot = scheduled_response->ul_config->slot; - mac->nr_ue_emul_l1.crc_rx_ind_sfn_slot = NFAPI_SFNSLOT2HEX(crc_ind->sfn, crc_ind->slot); crc_ind->crc_list = CALLOC(crc_ind->number_crcs, sizeof(*crc_ind->crc_list)); for (int j = 0; j < crc_ind->number_crcs; j++) { crc_ind->crc_list[j].handle = pusch_config_pdu->handle; crc_ind->crc_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id; - LOG_D(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j); - LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n", + LOG_I(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j); + LOG_I(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n", scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot); crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb; crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti; crc_ind->crc_list[j].tb_crc_status = 0; crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; crc_ind->crc_list[j].ul_cqi = 255; + mac->nr_ue_emul_l1.harq[crc_ind->crc_list[j].harq_id].crc_rx_ind_sfn_slot = NFAPI_SFNSLOT2HEX(crc_ind->sfn, crc_ind->slot); LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d] with mcs_index in ul_cqi -> %d\n", scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot,pusch_config_pdu->mcs_index); } @@ -163,7 +166,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind = NULL; } - LOG_D(PHY, "In %s: Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__); + LOG_I(PHY, "In %s: [%d, %d] Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__, + scheduled_response->frame, scheduled_response->slot); scheduled_response->tx_request->number_of_pdus = 0; } @@ -200,65 +204,58 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response pdu_0_1->ul_cqi = 255; pdu_0_1->timing_advance = 0; pdu_0_1->rssi = 0; - + LOG_I(NR_PHY, "In %s: UCI SFN/SLOT: [%d, %d] and mac->nr_ue_emul_l1.num_harq %d\n", + __FUNCTION__, uci_ind->sfn, uci_ind->slot, mac->nr_ue_emul_l1.num_harqs); if (mac->nr_ue_emul_l1.num_harqs > 0) { + int harq_index = 0; pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); - pdu_0_1->harq->num_harq = 1; + pdu_0_1->harq->num_harq = mac->nr_ue_emul_l1.num_harqs; pdu_0_1->harq->harq_confidence_level = 0; + pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); int harq_pid = -1; for (int k = 0; k < 16; k++) { - LOG_D(NR_MAC, "dl_frame = %d sl_slot = %d feedback_to_ul = %d active_harq_sfn_slot = %d.%d\n", - mac->dl_harq_info[k].dl_frame, - mac->dl_harq_info[k].dl_slot, - mac->dl_harq_info[k].feedback_to_ul, - NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot), - NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot)); - int sfn_slot = NFAPI_SFNSLOT2HEX(mac->dl_harq_info[k].dl_frame, - (mac->dl_harq_info[k].dl_slot + - mac->dl_harq_info[k].feedback_to_ul)); - if (!mac->dl_harq_info[k].active && - (sfn_slot == mac->nr_ue_emul_l1.active_harq_sfn_slot || - sfn_slot == mac->nr_ue_emul_l1.active_uci_sfn_slot)) + LOG_I(NR_MAC, "HARQ PID %d active = %d saved sfn_slot = %d.%d vs current sfn.slot %d.%d\n", + k, mac->nr_ue_emul_l1.harq[k].active, + mac->nr_ue_emul_l1.harq[k].active_harq_sfn, + mac->nr_ue_emul_l1.harq[k].active_harq_slot, + uci_ind->sfn, + uci_ind->slot); + if (mac->nr_ue_emul_l1.harq[k].active && + mac->nr_ue_emul_l1.harq[k].active_harq_sfn == uci_ind->sfn && + mac->nr_ue_emul_l1.harq[k].active_harq_slot == uci_ind->slot) { + mac->nr_ue_emul_l1.harq[k].active = false; harq_pid = k; - LOG_D(NR_MAC, "Setting harq_pid = %d\n", k); + LOG_I(NR_MAC, "Setting harq_pid = %d and num_harqs %d for %d.%d\n", k, pdu_0_1->harq->num_harq, + uci_ind->sfn, uci_ind->slot); + pdu_0_1->harq->harq_list[harq_index].harq_value = !mac->dl_harq_info[k].ack; + harq_index++; + LOG_I(NR_PHY, "In %s: Building uci_ind_%d with num_harqs %d and pdu_bitmap %d\n" + "uci_num %d, SFN/SLOT: [%d, %d]\n", + __FUNCTION__, uci_ind->uci_list[0].pdu_type, + pdu_0_1->harq->num_harq, pdu_0_1->pduBitmap, + uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); } } - pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); - for (int k = 0; k < pdu_0_1->harq->num_harq; k++) - { - AssertFatal(harq_pid != -1, "No active harq_pid, sfn_slot = %u.%u", uci_ind->sfn, uci_ind->slot); - pdu_0_1->harq->harq_list[k].harq_value = !mac->dl_harq_info[harq_pid].ack; - } + AssertFatal(harq_pid != -1, "No active harq_pid, sfn_slot = %u.%u", uci_ind->sfn, uci_ind->slot); } } - int sfn_slot = NFAPI_SFNSLOT2HEX(uci_ind->sfn, uci_ind->slot); - nfapi_nr_uci_indication_t *queued_uci_ind = unqueue_matching(&nr_uci_ind_queue, - MAX_QUEUE_SIZE, - sfn_slot_matcher, - &sfn_slot); - if (queued_uci_ind) - { - LOG_I(NR_MAC, "There was a matching UCI with sfn %d, slot %d in queue\n", - NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); - free(queued_uci_ind); - break; - } } - LOG_I(NR_PHY, "In %s: Filled queue uci_ind_%d which was filled by ulconfig.\n" - "uci_num %d, SFN/SLOT: [%d, %d]\n", + LOG_I(NR_PHY, "In %s: Sending uci_ind_%d which was filled by ulconfig.\n" + "uci_num %d, SFN/SLOT: [%d, %d] and pdu_bitmap %d\n", __FUNCTION__, uci_ind->uci_list[0].pdu_type, - uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); - - if (!put_queue(&nr_uci_ind_queue, uci_ind)) - { - LOG_E(NR_MAC, "Put_queue failed for uci_ind\n"); - free(uci_ind->uci_list); - free(uci_ind); - } + uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot, + uci_ind->uci_list[0].pucch_pdu_format_0_1.pduBitmap); + LOG_I(NR_MAC, "Sending UCI with %d PDUs in sfn.slot %d/%d\n", + uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); + NR_UL_IND_t UL_INFO = { + .uci_ind = *uci_ind, + }; + send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); + free_uci_inds(uci_ind); break; } @@ -269,93 +266,6 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response } scheduled_response->ul_config->number_pdus = 0; } - - if (scheduled_response->dl_config != NULL) - { - fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config; - AssertFatal(dl_config->number_pdus < sizeof(dl_config->dl_config_list) / sizeof(dl_config->dl_config_list[0]), - "Too many dl_config pdus %d", dl_config->number_pdus); - for (int i = 0; i < dl_config->number_pdus; ++i) - { - LOG_D(PHY, "In %s: processing %s PDU of %d total DL PDUs (dl_config %p) \n", - __FUNCTION__, dl_pdu_type[dl_config->dl_config_list[i].pdu_type - 1], dl_config->number_pdus, dl_config); - - uint8_t pdu_type = dl_config->dl_config_list[i].pdu_type; - switch (pdu_type) - { - case (FAPI_NR_DL_CONFIG_TYPE_DLSCH): - { - nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind)); - uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION; - uci_ind->sfn = scheduled_response->frame; - uci_ind->slot = NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot); - uci_ind->num_ucis = 1; - uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); - for (int j = 0; j < uci_ind->num_ucis; j++) - { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; - uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE; - uci_ind->uci_list[j].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t); - memset(pdu_0_1, 0, sizeof(*pdu_0_1)); - pdu_0_1->handle = 0; - pdu_0_1->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti; - pdu_0_1->pucch_format = 1; - pdu_0_1->ul_cqi = 255; - pdu_0_1->timing_advance = 0; - pdu_0_1->rssi = 0; - pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR - pdu_0_1->harq = CALLOC(1, sizeof(*pdu_0_1->harq)); - pdu_0_1->harq->num_harq = 1; - pdu_0_1->harq->harq_confidence_level = 0; - int harq_pid = -1; - for (int k = 0; k < 16; k++) - { - LOG_D(NR_MAC, "dl_frame = %d dl_slot = %d feedback_to_ul = %d active = %d k = %d " - "active_harq_sfn_slot = %d.%d " - "active_uci_sfn_slot = %d.%d\n", - mac->dl_harq_info[k].dl_frame, - mac->dl_harq_info[k].dl_slot, - mac->dl_harq_info[k].feedback_to_ul, - mac->dl_harq_info[k].active, - k, - NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot), - NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot), - NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_uci_sfn_slot), - NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_uci_sfn_slot)); - int sfn_slot = NFAPI_SFNSLOT2HEX(mac->dl_harq_info[k].dl_frame, - (mac->dl_harq_info[k].dl_slot + - mac->dl_harq_info[k].feedback_to_ul)); - if (mac->dl_harq_info[k].active && - sfn_slot == mac->nr_ue_emul_l1.active_harq_sfn_slot) - { - harq_pid = k; - LOG_D(NR_MAC, "Setting harq_pid = %d\n", k); - } - } - pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); - for (int k = 0; k < pdu_0_1->harq->num_harq; k++) - { - AssertFatal(harq_pid != -1, "No active harq_pid, sfn_slot = %u.%u", uci_ind->sfn, uci_ind->slot); - pdu_0_1->harq->harq_list[k].harq_value = !mac->dl_harq_info[harq_pid].ack; - } - } - - LOG_I(NR_PHY, "In %s: Filled queue uci_ind which was filled by dlconfig.\n" - "uci_num %d, SFN/SLOT: [%d, %d]\n", - __FUNCTION__, uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); - - if (!put_queue(&nr_uci_ind_queue, uci_ind)) - { - LOG_E(NR_MAC, "Put_queue failed for uci_ind\n"); - free(uci_ind->uci_list); - free(uci_ind); - } - break; - } - } - } - } - } return 0; } diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index 35983582bc..4f1ed162e2 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -264,6 +264,17 @@ typedef struct { uint8_t nbits; } dci_field_t; +typedef struct { + /* The active harq sfn/slot field was created to save the + scheduled SFN/Slot transmission for the ACK/NAK. If we + do not save it, then we have to calculate it again as the + NRUE MAC layer already does in get_downlink_ack(). */ + int active_harq_sfn; + int active_harq_slot; + int crc_rx_ind_sfn_slot; + bool active; +} emul_l1_harq_t; + typedef struct { bool expected_sib; bool index_has_sib[16]; @@ -271,9 +282,8 @@ typedef struct { bool index_has_rar[16]; bool expected_dci; bool index_has_dci[16]; - int active_harq_sfn_slot; + emul_l1_harq_t harq[16]; int active_uci_sfn_slot; - int crc_rx_ind_sfn_slot; int num_srs; int num_harqs; int num_csi_reports; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index b5680a9bf8..1c1b69ad65 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -599,14 +599,19 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format]; - LOG_D(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n", - dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits); + LOG_I(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx, pid %d)\n", + dci->rnti, dci->dci_format, + dci->n_CCE, dci->payloadSize, + *(unsigned long long*)dci->payloadBits, + def_dci_pdu_rel15->harq_pid); int8_t ret = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15); if ((ret&1) == 1) return -1; else if (ret == 2) { dci->dci_format = NR_UL_DCI_FORMAT_0_0; def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format]; } + LOG_I(MAC,"After extracting dci info. dci format %d, pid %d\n", + dci->dci_format, def_dci_pdu_rel15->harq_pid); int8_t ret_proc = nr_ue_process_dci(module_id, cc_id, gNB_index, frame, slot, def_dci_pdu_rel15, dci); return ret_proc; } @@ -631,7 +636,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr else if (mac->scc_SIB) n_RB_DLBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE); else n_RB_DLBWP = mac->type0_PDCCH_CSS_config.num_rbs; - LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP); + LOG_I(MAC, "In %s: Processing received DCI format %s (DL BWP %d) harq_pid %d\n", + __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP, dci->harq_pid); switch(dci_format){ case NR_UL_DCI_FORMAT_0_0: { @@ -947,6 +953,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr if(rnti != ra->ra_rnti && rnti != SI_RNTI) AssertFatal(1+dci->pdsch_to_harq_feedback_timing_indicator.val>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d).\n", 1+dci->pdsch_to_harq_feedback_timing_indicator.val,DURATION_RX_TO_TX); + LOG_I(MAC,"(nr_ue_procedures.c) dci->pdsch_to_harq_feedback_timing_indicator.val=%d \n", + dci->pdsch_to_harq_feedback_timing_indicator.val); // set the harq status at MAC for feedback set_harq_status(mac,dci->pucch_resource_indicator, @@ -1118,6 +1126,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr valid = 0; pucch_res_set_cnt = ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.count; for (int id = 0; id < pucch_res_set_cnt; id++) { + LOG_I(NR_MAC, "pucch_resource_indicator %d, ubwpd[%d].resource.list.count %d\n", + dci->pucch_resource_indicator, id, + ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.array[id]->resourceList.list.count); if (dci->pucch_resource_indicator < ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.array[id]->resourceList.list.count) { valid = 1; break; @@ -1235,7 +1246,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr // according to TS 38.213 Table 9.2.3-1 uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; - + LOG_I(MAC,"(nr_ue_procedures.c) 1237 feedback_ti=%d and dci->pdsch_to_harq_feedback_timing_indicator.val %d, pdsch_to_harq_feedback_time_ind %d\n", + feedback_ti, dci->pdsch_to_harq_feedback_timing_indicator.val, + dlsch_config_pdu_1_1->pdsch_to_harq_feedback_time_ind); AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d). Min feedback time set in config file (min_rxtxtime).\n", feedback_ti,DURATION_RX_TO_TX); @@ -1334,10 +1347,21 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, // FIXME k0 != 0 currently not taken into consideration current_harq->dl_frame = frame; current_harq->dl_slot = slot; - mac->nr_ue_emul_l1.active_harq_sfn_slot = NFAPI_SFNSLOT2HEX(frame, (slot + data_toul_fb)); + // TODO: if (get_softmodem_params()->emaulte_l1) + // in downlink: 0-7, 10-17 + if (data_toul_fb + slot > 19) { + if (frame + 1 < 1024) + frame++; + else + frame = 0; + slot = (data_toul_fb + slot) - 20; + } + else { + slot = data_toul_fb + slot; + } - LOG_D(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n", - harq_id, frame, slot, frame, (slot + data_toul_fb)); + LOG_I(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n", + harq_id, current_harq->dl_frame, current_harq->dl_slot, frame, slot); } @@ -1819,18 +1843,24 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size) { mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup && mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->resourceSetToAddModList && mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set_id] != NULL)) { - if (uci_size <= 2) { + if (uci_size <= 3) { pucch_resource_set_id = 0; + LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d", + __FUNCTION__, __LINE__, pucch_resource_set_id); return (pucch_resource_set_id); break; } else { pucch_resource_set_id = 1; + LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d", + __FUNCTION__, __LINE__, pucch_resource_set_id); return (pucch_resource_set_id); break; } } pucch_resource_set_id++; + LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d", + __FUNCTION__, __LINE__, pucch_resource_set_id); } pucch_resource_set_id = MAX_NB_OF_PUCCH_RESOURCE_SETS; @@ -1915,6 +1945,13 @@ void select_pucch_resource(NR_UE_MAC_INST_t *mac, pucch->pucch_resource = NULL; return; } + LOG_I(MAC,"Melissa resourceSetToAddModList %p\n", resourceSetToAddModList); + LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[0] %p\n", resourceSetToAddModList->list.array[0]); + LOG_I(MAC,"Melissa pucch->resource_set_id %d\n", pucch->resource_set_id); + LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id] %p\n", resourceSetToAddModList->list.array[pucch->resource_set_id]); + LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList %p\n", resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList); + LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count %d\n", resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count); + n_list = resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count; if (pucch->resource_indicator > n_list) { LOG_E(MAC,"Invalid PUCCH resource id %d\n",pucch->resource_indicator); @@ -2015,16 +2052,33 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, current_harq = &mac->dl_harq_info[dl_harq_pid]; if (current_harq->active) { - - sched_slot = current_harq->dl_slot + current_harq->feedback_to_ul; sched_frame = current_harq->dl_frame; - if (sched_slot>=slots_per_frame){ - sched_slot %= slots_per_frame; - sched_frame++; + if (current_harq->feedback_to_ul + current_harq->dl_slot > 19) { + if (sched_frame + 1 < 1024) + sched_frame++; + else + sched_frame = 0; + sched_slot = (current_harq->feedback_to_ul + current_harq->dl_slot) - slots_per_frame; } - LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common); + else { + sched_slot = current_harq->feedback_to_ul + current_harq->dl_slot; + } + + LOG_I(PHY,"HARQ pid %d is active for %d.%d and inputted %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d active %d\n", + dl_harq_pid, + sched_frame, + sched_slot, frame, slot, + current_harq->dl_slot, + current_harq->feedback_to_ul, + current_harq->is_common, + current_harq->active); /* check if current tx slot should transmit downlink acknowlegment */ if (sched_frame == frame && sched_slot == slot) { + if (get_softmodem_params()->emulate_l1) { + mac->nr_ue_emul_l1.harq[dl_harq_pid].active = true; + mac->nr_ue_emul_l1.harq[dl_harq_pid].active_harq_sfn = frame; + mac->nr_ue_emul_l1.harq[dl_harq_pid].active_harq_slot = slot; + } if (current_harq->dai > NR_DL_MAX_DAI) { LOG_E(MAC,"PUCCH Downlink DAI has an invalid value : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); @@ -2045,6 +2099,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, } number_harq_feedback++; + LOG_I(NR_MAC, "number_harq_feedback = %d\n", number_harq_feedback); if (current_harq->ack_received) ack_data[code_word][dai_current - 1] = current_harq->ack; else @@ -2132,6 +2187,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, V_temp2 = dai[1][m]; /* second code word has been received */ O_bit_number_cw1 = (8 * j) + 2*(V_temp - 1) + 1; o_ACK = o_ACK | (ack_data[1][m] << O_bit_number_cw1); + LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK); } if (two_transport_blocks == TRUE) { @@ -2141,6 +2197,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, O_bit_number_cw0 = (4 * j) + (V_temp - 1); } + LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK); o_ACK = o_ACK | (ack_data[0][m] << O_bit_number_cw0); LOG_D(MAC,"m %d bit number %d o_ACK %d\n",m,O_bit_number_cw0,o_ACK); } @@ -2154,14 +2211,16 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, } else { O_ACK = 4 * j + V_temp2; /* only one transport block */ + LOG_I(NR_MAC, "%s():%d O_ACK = %d\n", __FUNCTION__, __LINE__, O_ACK); } if (number_harq_feedback != O_ACK) { - LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); - return (0); + LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment. number_harq_feedback %d, O_ACK %d \n", + number_harq_feedback, O_ACK); + number_harq_feedback = O_ACK; //return (0); } - reverse_n_bits(&o_ACK,number_harq_feedback); + LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK); pucch->ack_payload = o_ACK; LOG_D(MAC,"frame %d slot %d pucch acknack payload %d\n",frame,slot,o_ACK); @@ -3837,6 +3896,8 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t #endif if (ra->RA_RAPID_found) { + // if (rarh->RAPID != preamble_index) + // return 0; RAR_grant_t rar_grant; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 6d7dbf5506..40a9900284 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -220,6 +220,9 @@ int nr_process_mac_pdu(module_id_t module_idP, LOG_D(NR_MAC, "In %s: received UL-SCH sub-PDU with LCID 0x%x in %d.%d (remaining PDU length %d)\n", __func__, rx_lcid, frameP, slot, pdu_len); + if (pdu_len < 7) { + break; + } unsigned char *ce_ptr; int n_Lcg = 0; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 71345c6d9f..1a68778df7 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -465,7 +465,7 @@ static void fill_rx_ind(nfapi_nr_pdu_t *pdu_list, fapi_nr_rx_indication_t *rx_in { length += pdu_list->TLVs[j].length; } - LOG_I(NR_PHY, "%s: num_tlv %d and length %d, pdu index %d\n", + LOG_I(NR_PHY, "Elkadi %s: num_tlv %d and length %d, pdu index %d\n", __FUNCTION__, pdu_list->num_TLV, length, pdu_idx); uint8_t *pdu = malloc(length); AssertFatal(pdu != NULL, "%s: Out of memory in malloc", __FUNCTION__); @@ -540,7 +540,7 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi dl_info->rx_ind->number_pdus = pdu_idx; } -static void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind) +void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind) { for (int k = 0; k < uci_ind->num_ucis; k++) { @@ -618,6 +618,7 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n static bool send_crc_ind_and_rx_ind(int sfn_slot) { bool sent_crc_rx = true; + LOG_I(NR_MAC, "Melissa, This is the num items in crc %d and rx %d\n", nr_crc_ind_queue.num_items, nr_rx_ind_queue.num_items); nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); @@ -655,102 +656,18 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n AssertFatal(num_pdus >= 0, "Invalid ul_tti_request number of PDUS\n"); AssertFatal(num_pdus <= sizeof(ul_tti_req->pdus_list) / sizeof(ul_tti_req->pdus_list[0]), "Too many pdus %d in ul_tti_req\n", num_pdus); - - bool sent_crc_rx = send_crc_ind_and_rx_ind(sfn_slot); - bool sent_uci = false; - for (int i = 0; i < num_pdus; i++) + if (!send_crc_ind_and_rx_ind(sfn_slot)) { - nfapi_nr_ul_tti_request_number_of_pdus_t *pdu_list = &ul_tti_req->pdus_list[i]; - LOG_D(NR_PHY, "This is the pdu type %d and rnti %x and SR flag %d and harq_pdu_len %d in in ul_tti_req\n", - pdu_list->pdu_type, ul_tti_req->pdus_list[i].pucch_pdu.rnti, pdu_list->pucch_pdu.sr_flag, pdu_list->pucch_pdu.bit_len_harq); - if (pdu_list->pdu_type == NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE && pdu_list->pucch_pdu.rnti == mac->crnti) - { - AssertFatal(nr_uci_ind_queue.num_items >= 0, "Invalid num_items in UCI_ind queue %lu\n", - nr_uci_ind_queue.num_items); - - nfapi_nr_uci_indication_t *uci_ind = unqueue_matching(&nr_uci_ind_queue, - MAX_QUEUE_SIZE, - sfn_slot_matcher, - &sfn_slot); - if (!uci_ind) - { - LOG_I(NR_MAC, "There was not a matching UCI with sfn %d, slot %d in queue\n", - NFAPI_SFNSLOT2SFN(sfn_slot), NFAPI_SFNSLOT2SLOT(sfn_slot)); - return; - } - if (uci_ind && uci_ind->num_ucis > 0) - { - uci_ind->sfn = ul_tti_req->SFN; - uci_ind->slot = ul_tti_req->Slot; - LOG_D(NR_MAC, "This is the SFN/SF [%d, %d] and RNTI %x of the UCI ind. ul_tti_req.pdu[%d]->rnti = %x \n", - uci_ind->sfn, uci_ind->slot, uci_ind->uci_list[0].pucch_pdu_format_0_1.rnti, i, ul_tti_req->pdus_list[i].pucch_pdu.rnti); - for (int j = 0; j < uci_ind->num_ucis; j++) - { - if (uci_ind->uci_list[j].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) - { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[j].pucch_pdu_format_0_1; - if (pdu_list->pucch_pdu.sr_flag) - { - pdu_0_1->pduBitmap = 1; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR - if (pdu_list->pucch_pdu.bit_len_harq > 0) - pdu_0_1->pduBitmap = 3; - pdu_0_1->sr = CALLOC(1, sizeof(*pdu_0_1->sr)); - pdu_0_1->sr->sr_confidence_level = 0; - pdu_0_1->sr->sr_indication = 1; - } - } - if (uci_ind->uci_list[j].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) - { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[j].pucch_pdu_format_2_3_4; - if (pdu_list->pucch_pdu.sr_flag) - { - pdu_2_3_4->pduBitmap = 5; - pdu_2_3_4->sr.sr_bit_len = 0; - AssertFatal(!pdu_2_3_4->sr.sr_payload, "pdu_2_3_4->sr.sr_payload != NULL\n"); - pdu_2_3_4->sr.sr_payload = CALLOC((int)((pdu_2_3_4->sr.sr_bit_len / 8) + 1), - sizeof(*pdu_2_3_4->sr.sr_payload)); - } - if (pdu_list->pucch_pdu.bit_len_harq > 0) - { - pdu_2_3_4->pduBitmap = 6; - if (pdu_list->pucch_pdu.sr_flag) - { - pdu_2_3_4->pduBitmap = 7; - } - pdu_2_3_4->harq.harq_bit_len = pdu_list->pucch_pdu.bit_len_harq; - LOG_D(NR_MAC, "This is bit_len_harq %d and pdu_2_3_4->pduBitmap %d\n", - pdu_list->pucch_pdu.bit_len_harq, pdu_2_3_4->pduBitmap); - pdu_2_3_4->harq.harq_crc = 0; - AssertFatal(!pdu_2_3_4->harq.harq_payload, "pdu_2_3_4->harq.harq_payload != NULL\n"); - pdu_2_3_4->harq.harq_payload = CALLOC((int)((pdu_2_3_4->harq.harq_bit_len / 8) + 1), - sizeof(*pdu_2_3_4->harq.harq_payload)); - /* TODO: Later, when abstracting, we can set particular bits in the - payload to 0 to indicate a NACK. For now, we memset all bits to 1. */ - memset(pdu_2_3_4->harq.harq_payload, 0xff, sizeof(*pdu_2_3_4->harq.harq_payload)); - } - } - } - LOG_I(NR_MAC, "We have dequeued the previously filled uci_ind and updated the snf/slot to %d/%d.\n", - uci_ind->sfn, uci_ind->slot); - NR_UL_IND_t UL_INFO = { - .uci_ind = *uci_ind, - }; - send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); - sent_uci = true; - free_uci_inds(uci_ind); - } - } - } - if (!sent_uci && !sent_crc_rx) - { - LOG_E(NR_MAC, "UCI and CRC_RX ind not sent\n"); + LOG_E(NR_MAC, "CRC_RX ind not sent\n"); if (!put_queue(&nr_ul_tti_req_queue, ul_tti_req)) { LOG_E(NR_PHY, "put_queue failed for ul_tti_req.\n"); free(ul_tti_req); ul_tti_req = NULL; } + return; } + free(ul_tti_req); } static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_config_request_t *dl_config) @@ -784,17 +701,19 @@ static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_ "dl_config->number_pdus %d > dci_ind->dci_list array\n", num_dcis); for (int k = 0; k < num_dcis; k++) { - LOG_I(NR_PHY, "Received len %d, length options[%d] %d, format assigned %d, format options[%d] %d\n", + LOG_D(NR_PHY, "Received len %d, length options[%d] %d, format assigned %d, format options[%d] %d\n", dl_ind->dci_ind->dci_list[k].payloadSize, j, rel15_dci->dci_length_options[j], dl_ind->dci_ind->dci_list[k].dci_format, j, rel15_dci->dci_format_options[j]); if (rel15_dci->dci_length_options[j] == dl_ind->dci_ind->dci_list[k].payloadSize) { dl_ind->dci_ind->dci_list[k].dci_format = rel15_dci->dci_format_options[j]; + LOG_I(NR_PHY, "format assigned dl_ind->dci_ind->dci_list[k].dci_format %d\n", + dl_ind->dci_ind->dci_list[k].dci_format); + int CCEind = rel15_dci->CCE[j]; + int L = rel15_dci->L[j]; + dl_ind->dci_ind->dci_list[k].n_CCE = CCEind; + dl_ind->dci_ind->dci_list[k].N_CCE = L; } - int CCEind = rel15_dci->CCE[j]; - int L = rel15_dci->L[j]; - dl_ind->dci_ind->dci_list[k].n_CCE = CCEind; - dl_ind->dci_ind->dci_list[k].N_CCE = L; } } } @@ -877,8 +796,10 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, ul_info.slot_tx, - mac->frame_type)) + mac->frame_type)) { + LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", ul_info.slot_tx, __FUNCTION__); nr_ue_ul_indication(&ul_info); + } } } @@ -921,7 +842,7 @@ void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_header_t header) { - + NR_UE_MAC_INST_t *mac = get_mac_inst(0); switch (header.message_id) { case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST: @@ -999,11 +920,32 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea } LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d.\n", ul_tti_request->SFN, ul_tti_request->Slot); - if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) - { - LOG_E(NR_PHY, "put_queue failed for ul_tti_request.\n"); - nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_ul_tti_req_queue, ul_tti_request); - free(evicted_ul_tti_req); + for (int i = 0; i < ul_tti_request->n_pdus; i++) { + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST pdu_type %d, ra_state %d.\n", + ul_tti_request->pdus_list[i].pdu_type, mac->ra.ra_state); + if (ul_tti_request->pdus_list[i].pdu_type == 1 && + mac->ra.ra_state >= RA_SUCCEEDED) { + + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST that were queueing with rnti %x!\n", + ul_tti_request->pdus_list[i].pucch_pdu.rnti); + if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) + { + LOG_I(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n"); + nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_ul_tti_req_queue, ul_tti_request); + free(evicted_ul_tti_req); + } + break; + } + else if (mac->ra.ra_state < RA_SUCCEEDED) { + LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST before RA_SUCEEDED that were queueing with rnti %x!\n", + ul_tti_request->pdus_list[i].pucch_pdu.rnti); + if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) + { + LOG_I(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n"); + nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_ul_tti_req_queue, ul_tti_request); + free(evicted_ul_tti_req); + } + } } break; } @@ -1204,8 +1146,10 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test) nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); - - if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type)) + LOG_I(NR_MAC, "In %s():%d calling nr_ue_pucch_scheduler in %d.%d\n", + __FUNCTION__, __LINE__, ul_info->frame_tx, ul_info->slot_tx); + if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && + !get_softmodem_params()->emulate_l1) nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); switch(ret){ @@ -1239,20 +1183,23 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ if (dl_info && dl_info->dci_ind && dl_info->dci_ind->number_of_dcis) { LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n"); for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) { - LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); + fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; + LOG_I(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d, format %d, harq_pid %d\n", + i, + dl_info->dci_ind->number_of_dcis, + dci_index->dci_format, + mac->def_dci_pdu_rel15[dci_index->dci_format].harq_pid); nr_scheduled_response_t scheduled_response; int8_t ret = handle_dci(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, dl_info->frame, dl_info->slot, - dl_info->dci_ind->dci_list+i); - - fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; + dci_index); /* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */ if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) { - LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); + LOG_I(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); break; } dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format]; @@ -1266,7 +1213,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot, dl_info->thread_id); nr_ue_if_module_inst[module_id]->scheduled_response(&scheduled_response); } - memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); + //memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); } free(dl_info->dci_ind); dl_info->dci_ind = NULL; From 9322701ce42f462a3fa42f0bf82b92875ff04ead Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 9 Feb 2022 13:32:09 -0800 Subject: [PATCH 416/883] Need a break if we queue a ul_tti_req based on PDU state If we dont have this break we are trying to queue the UL_TTI_REQ we just queued --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 1a68778df7..f5076dc180 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -945,6 +945,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_ul_tti_req_queue, ul_tti_request); free(evicted_ul_tti_req); } + break; } } break; From 65dadfb3e2eca0095cc76beb80d2ef7c8d420ce8 Mon Sep 17 00:00:00 2001 From: Melissa Date: Tue, 4 Jan 2022 16:52:25 +0000 Subject: [PATCH 417/883] Merge branch 'episys/master-nsa-nfapi-errors' into 'episys/master-nsa' nfapi.c: Add on_error() See merge request aburger/openairinterface5g!96 --- nfapi/open-nFAPI/nfapi/src/nfapi.c | 1627 +++++++++++++++------------- 1 file changed, 844 insertions(+), 783 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi.c b/nfapi/open-nFAPI/nfapi/src/nfapi.c index 2783781e2c..44ac0c3720 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi.c @@ -1,783 +1,844 @@ -/* - * Copyright (c) 2001-2016, Cisco Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * Neither the name of the Cisco Systems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -// Fundamental routines - -uint8_t push8(uint8_t in, uint8_t **out, uint8_t *end) { - uint8_t *pOut = *out; - - if((end - pOut) >= 1) { - pOut[0] = in; - (*out)+=1; - return 1; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pushs8(int8_t in, uint8_t **out, uint8_t *end) { - uint8_t *pOut = *out; - - if((end - pOut) >= 1) { - pOut[0] = in; - (*out)+=1; - return 1; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t push16(uint16_t in, uint8_t **out, uint8_t *end) { - uint8_t *pOut = *out; - - if((end - pOut) >= 2) { - pOut[0] = (in & 0xFF00) >> 8; - pOut[1] = (in & 0xFF); - (*out)+=2; - return 2; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pushs16(int16_t in, uint8_t **out, uint8_t *end) { - uint8_t *pOut = *out; - - if((end - pOut) >= 2) { - pOut[0] = (in & 0xFF00) >> 8; - pOut[1] = (in & 0xFF); - (*out)+=2; - return 2; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t push32(uint32_t in, uint8_t **out, uint8_t *end) { - uint8_t *pOut = *out; - - if((end - pOut) >= 4) { - pOut[0] = (in & 0xFF000000) >> 24; - pOut[1] = (in & 0xFF0000) >> 16; - pOut[2] = (in & 0xFF00) >> 8; - pOut[3] = (in & 0xFF); - (*out)+=4; - return 4; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pushs32(int32_t in, uint8_t **out, uint8_t *end) { - uint8_t *pOut = *out; - - if((end - pOut) >= 4) { - pOut[0] = (in & 0xFF000000) >> 24; - pOut[1] = (in & 0xFF0000) >> 16; - pOut[2] = (in & 0xFF00) >> 8; - pOut[3] = (in & 0xFF); - (*out)+=4; - return 4; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pull8(uint8_t **in, uint8_t *out, uint8_t *end) { - uint8_t *pIn = *in; - - if((end - pIn) >= 1 ) { - *out = *pIn; - (*in)+=1; - return 1; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pulls8(uint8_t **in, int8_t *out, uint8_t *end) { - uint8_t *pIn = *in; - - if((end - pIn) >= 1 ) { - *out = *pIn; - (*in)+=1; - return 1; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pull16(uint8_t **in, uint16_t *out, uint8_t *end) { - uint8_t *pIn = *in; - - if((end - pIn) >=2 ) { - *out = ((pIn[0]) << 8) | pIn[1]; - (*in)+=2; - return 2; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pulls16(uint8_t **in, int16_t *out, uint8_t *end) { - uint8_t *pIn = *in; - - if((end - pIn) >=2 ) { - *out = ((pIn[0]) << 8) | pIn[1]; - (*in)+=2; - return 2; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pull32(uint8_t **in, uint32_t *out, uint8_t *end) { - uint8_t *pIn = *in; - - if((end - pIn) >=4 ) { - *out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3]; - (*in)+=4; - return 4; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t pulls32(uint8_t **in, int32_t *out, uint8_t *end) { - uint8_t *pIn = *in; - - if((end - pIn) >=4 ) { - *out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3]; - (*in)+=4; - return 4; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -/* -inline void pusharray16(uint8_t **, uint16_t, uint32_t len) -{ -} -*/ - -uint32_t pullarray16(uint8_t **in, uint16_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*in)) >= sizeof(uint16_t) * len) { - uint32_t idx; - - for(idx = 0; idx < len; ++idx) { - if(!pull16(in, &out[idx], end)) - return 0; - } - - return sizeof(uint16_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint32_t pullarrays16(uint8_t **in, int16_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*in)) >= sizeof(uint16_t) * len) { - uint32_t idx; - - for(idx = 0; idx < len; ++idx) { - if(!pulls16(in, &out[idx], end)) - return 0; - } - - return sizeof(uint16_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} -uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*out)) >= sizeof(uint16_t) * len) { - uint32_t idx; - - for(idx = 0; idx < len; ++idx) { - if(!push16(in[idx], out, end)) - return 0; - } - - return sizeof(uint16_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} -uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*out)) >= sizeof(uint16_t) * len) { - uint32_t idx; - - for(idx = 0; idx < len; ++idx) { - pushs16(in[idx], out, end); - } - - return sizeof(uint16_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} -uint32_t pullarray32(uint8_t **in, uint32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*in)) >= sizeof(uint32_t) * len) { - uint32_t idx; - - for(idx = 0; idx < len; ++idx) { - if(!pull32(in, &out[idx], end)) - return 0; - } - - return sizeof(uint32_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*in)) >= sizeof(uint32_t) * len) { - uint32_t idx; - - for(idx = 0; idx < len; ++idx) { - if(!pulls32(in, &out[idx], end)) - return 0; - } - - return sizeof(uint32_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} -uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*out)) >= sizeof(uint32_t) * len) { - uint32_t idx; - - for(idx = 0; idx < len; ++idx) { - if(!push32(in[idx], out, end)) - return 0; - } - - return sizeof(uint32_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} -uint32_t pusharrays32(int32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*out)) >= sizeof(uint32_t) * len) { - uint32_t idx; - - for(idx = 0; idx < len; ++idx) { - pushs32(in[idx], out, end); - } - - return sizeof(uint32_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} -uint32_t pullarray8(uint8_t **in, uint8_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*in)) >= sizeof(uint8_t) * len) { - memcpy(out, (*in), len); - (*in)+=len; - return sizeof(uint8_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { - if(len == 0) - return 1; - - if(len > max_len) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); - return 0; - } - - if((end - (*out)) >= sizeof(uint8_t) * len) { - memcpy((*out), in, len); - (*out)+=len; - return sizeof(uint8_t) * len; - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); - return 0; - } -} - -uint8_t packarray(void *array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t **ppwritepackedmsg, uint8_t *end, pack_array_elem_fn fn) { - if(count > max_count) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count); - return 0; - } - - uint16_t i = 0; - - for(i = 0; i < count; ++i) { - if((fn)(array, ppwritepackedmsg, end) == 0) - return 0; - - array += array_element_size; - } - - return 1; -} - -uint8_t unpackarray(uint8_t **ppReadPackedMsg, void *array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t *end, unpack_array_elem_fn fn) { - if(count > max_count) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count); - return 0; - } - - uint16_t i = 0; - - for(i = 0; i < count; ++i) { - if((fn)(array, ppReadPackedMsg, end) == 0) - return 0; - - array += array_element_size; - } - - return 1; -} - - -uint32_t pack_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { - if(ve != 0 && config != 0) { - if(config->pack_vendor_extension_tlv) { - uint8_t *pStartOfTlv = *ppWritePackedMsg; - - if(pack_tl(ve, ppWritePackedMsg, end) == 0) - return 0; - - uint8_t *pStartOfValue = *ppWritePackedMsg; - - if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0) - return 0; - - ve->length = (*ppWritePackedMsg) - pStartOfValue; - pack_tl(ve, &pStartOfTlv, end); - return 1; - } - } - - return 1; -} - -uint32_t unpack_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config, nfapi_tl_t **ve_tlv) { - if(ve_tlv != 0 && config != 0) { - if(config->unpack_vendor_extension_tlv) { - return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void **)ve_tlv, config); - } - } - - return 1; -} - -uint32_t pack_p7_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end,nfapi_p7_codec_config_t *config) { - if(ve != 0 && config != 0) { - if(config->pack_vendor_extension_tlv) { - uint8_t *pStartOfTlv = *ppWritePackedMsg; - - if(pack_tl(ve, ppWritePackedMsg, end) == 0) - return 0; - - uint8_t *pStartOfValue = *ppWritePackedMsg; - - if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0) - return 0; - - ve->length = (*ppWritePackedMsg) - pStartOfValue; - pack_tl(ve, &pStartOfTlv, end); - return 1; - } - } - - return 1; -} - -int unpack_p7_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config, nfapi_tl_t **ve_tlv) { - if(ve_tlv != 0 && config != 0) { - if(config->unpack_vendor_extension_tlv) { - return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void **)ve_tlv, config); - } - } - - return 1; -} - - -uint8_t pack_tl(nfapi_tl_t *tl, uint8_t **ppWritePackedMsg, uint8_t *end) { - return (push16(tl->tag, ppWritePackedMsg, end) && - push16(tl->length, ppWritePackedMsg, end)); -} - -uint8_t unpack_tl(uint8_t **ppReadPackedMsg, nfapi_tl_t *tl, uint8_t *end) { - return (pull16(ppReadPackedMsg, &tl->tag, end) && - pull16(ppReadPackedMsg, &tl->length, end)); -} - -int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config, nfapi_tl_t **ve) { - nfapi_tl_t generic_tl; - uint8_t numBadTags = 0; - uint16_t idx = 0; - - while ((uint8_t *)(*ppReadPackedMsg) < end) { - // unpack the tl and process the values accordingly - if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) - return 0; - - uint8_t tagMatch = 0; - uint8_t *pStartOfValue = *ppReadPackedMsg; - - for(idx = 0; idx < size; ++idx) { - if(unpack_fns[idx].tag == generic_tl.tag) { // match the extracted tag value with all the tags in unpack_fn list - tagMatch = 1; - nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv); - tl->tag = generic_tl.tag; - tl->length = generic_tl.length; - int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end); - - if(result == 0) { - return 0; - } - - // check if the length was right; - if(tl->length != (*ppReadPackedMsg - pStartOfValue)) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %ld\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue)); - } - } - } - - if(tagMatch == 0) { - if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE && - generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE) { - int result = unpack_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve); - - if(result == 0) { - // got tot the end. - return 0; - } else if(result < 0) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown VE TAG value: 0x%04x\n", generic_tl.tag); - - if (++numBadTags > MAX_BAD_TAG) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n"); - return 0; - } - - if((end - *ppReadPackedMsg) >= generic_tl.length) { - // Advance past the unknown TLV - (*ppReadPackedMsg) += generic_tl.length; - } else { - // go to the end - return 0; - } - } - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag); - - if (++numBadTags > MAX_BAD_TAG) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n"); - return 0; - } - - if((end - *ppReadPackedMsg) >= generic_tl.length) { - // Advance past the unknown TLV - (*ppReadPackedMsg) += generic_tl.length; - } else { - // go to the end - return 0; - } - } - } - } - - return 1; -} -int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config, nfapi_tl_t **ve) { - nfapi_tl_t generic_tl; - uint8_t numBadTags = 0; - uint16_t idx = 0; - - while ((uint8_t *)(*ppReadPackedMsg) < end) { - // unpack the tl and process the values accordingly - if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) - return 0; - - uint8_t tagMatch = 0; - uint8_t *pStartOfValue = *ppReadPackedMsg; - - for(idx = 0; idx < size; ++idx) { - if(unpack_fns[idx].tag == generic_tl.tag) { - tagMatch = 1; - nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv); - tl->tag = generic_tl.tag; - tl->length = generic_tl.length; - int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end, config); - - if(result == 0) { - return 0; - } - - // check if the length was right; - if(tl->length != (*ppReadPackedMsg - pStartOfValue)) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %ld\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue)); - } - } - } - - if(tagMatch == 0) { - if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE && - generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE) { - int result = unpack_p7_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve); - - if(result == 0) { - // got to end - return 0; - } else if(result < 0) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag); - - if (++numBadTags > MAX_BAD_TAG) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n"); - return -1; - } - - if((end - *ppReadPackedMsg) >= generic_tl.length) { - // Advance past the unknown TLV - (*ppReadPackedMsg) += generic_tl.length; - } else { - // got ot the dn - return 0; - } - } - } else { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag); - - if (++numBadTags > MAX_BAD_TAG) { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n"); - return -1; - } - - if((end - *ppReadPackedMsg) >= generic_tl.length) { - // Advance past the unknown TLV - (*ppReadPackedMsg) += generic_tl.length; - } else { - // got ot the dn - return 0; - } - } - } - } - - return 1; -} - -// This intermediate function deals with calculating the length of the value -// and writing into the tlv header. -uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end, pack_tlv_fn fn) { - nfapi_tl_t *tl = (nfapi_tl_t *)tlv; - - // If the tag is defined - if(tl->tag == tag) { - uint8_t *pStartOfTlv = *ppWritePackedMsg; - - // write a dumy tlv header - if(pack_tl(tl, ppWritePackedMsg, end) == 0) - return 0; - - // Record the start of the value - uint8_t *pStartOfValue = *ppWritePackedMsg; - - // pack the tlv value - if(fn(tlv, ppWritePackedMsg, end) == 0) - return 0; - - // calculate the length of the value and rewrite the tl header - tl->length = (*ppWritePackedMsg) - pStartOfValue; - // rewrite the header with the correct length - pack_tl(tl, &pStartOfTlv, end); - } else { - if(tl->tag != 0) { - NFAPI_TRACE(NFAPI_TRACE_WARN, "Warning pack_tlv tag 0x%x does not match expected 0x%x\n", tl->tag, tag); - } else { - //NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning pack_tlv tag 0x%x ZERO does not match expected 0x%x\n", tl->tag, tag); - } - } - - return 1; -} - -const char *nfapi_error_code_to_str(nfapi_error_code_e value) { - switch(value) { - case NFAPI_MSG_OK: - return "NFAPI_MSG_OK"; - - case NFAPI_MSG_INVALID_STATE: - return "NFAPI_MSG_INVALID_STATE"; - - case NFAPI_MSG_INVALID_CONFIG: - return "NFAPI_MSG_INVALID_CONFIG"; - - case NFAPI_SFN_OUT_OF_SYNC: - return "NFAPI_SFN_OUT_OF_SYNC"; - - case NFAPI_MSG_SUBFRAME_ERR: - return "NFAPI_MSG_SUBFRAME_ERR"; - - case NFAPI_MSG_BCH_MISSING: - return "NFAPI_MSG_BCH_MISSING"; - - case NFAPI_MSG_INVALID_SFN: - return "NFAPI_MSG_INVALID_SFN"; - - case NFAPI_MSG_HI_ERR: - return "NFAPI_MSG_HI_ERR"; - - case NFAPI_MSG_TX_ERR: - return "NFAPI_MSG_TX_ERR"; - - default: - return "UNKNOWN"; - } -} +/* + * Copyright (c) 2001-2016, Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +// What to do when an error happens (e.g., a push or pull fails) +static inline void on_error() +{ + // show the call stack + int fd = STDERR_FILENO; + static const char msg[] = "---stack trace---\n"; + __attribute__((unused)) int r = + write(fd, msg, sizeof(msg) - 1); + void *buffer[100]; + int nptrs = backtrace(buffer, sizeof(buffer) / sizeof(buffer[0])); + backtrace_symbols_fd(buffer, nptrs, fd); + + //abort(); +} + +// Fundamental routines + +uint8_t push8(uint8_t in, uint8_t **out, uint8_t *end) { + uint8_t *pOut = *out; + + if((end - pOut) >= 1) { + pOut[0] = in; + (*out)+=1; + return 1; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pushs8(int8_t in, uint8_t **out, uint8_t *end) { + uint8_t *pOut = *out; + + if((end - pOut) >= 1) { + pOut[0] = in; + (*out)+=1; + return 1; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t push16(uint16_t in, uint8_t **out, uint8_t *end) { + uint8_t *pOut = *out; + + if((end - pOut) >= 2) { + pOut[0] = (in & 0xFF00) >> 8; + pOut[1] = (in & 0xFF); + (*out)+=2; + return 2; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pushs16(int16_t in, uint8_t **out, uint8_t *end) { + uint8_t *pOut = *out; + + if((end - pOut) >= 2) { + pOut[0] = (in & 0xFF00) >> 8; + pOut[1] = (in & 0xFF); + (*out)+=2; + return 2; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t push32(uint32_t in, uint8_t **out, uint8_t *end) { + uint8_t *pOut = *out; + + if((end - pOut) >= 4) { + pOut[0] = (in & 0xFF000000) >> 24; + pOut[1] = (in & 0xFF0000) >> 16; + pOut[2] = (in & 0xFF00) >> 8; + pOut[3] = (in & 0xFF); + (*out)+=4; + return 4; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pushs32(int32_t in, uint8_t **out, uint8_t *end) { + uint8_t *pOut = *out; + + if((end - pOut) >= 4) { + pOut[0] = (in & 0xFF000000) >> 24; + pOut[1] = (in & 0xFF0000) >> 16; + pOut[2] = (in & 0xFF00) >> 8; + pOut[3] = (in & 0xFF); + (*out)+=4; + return 4; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pull8(uint8_t **in, uint8_t *out, uint8_t *end) { + uint8_t *pIn = *in; + + if((end - pIn) >= 1 ) { + *out = *pIn; + (*in)+=1; + return 1; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pulls8(uint8_t **in, int8_t *out, uint8_t *end) { + uint8_t *pIn = *in; + + if((end - pIn) >= 1 ) { + *out = *pIn; + (*in)+=1; + return 1; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pull16(uint8_t **in, uint16_t *out, uint8_t *end) { + uint8_t *pIn = *in; + + if((end - pIn) >=2 ) { + *out = ((pIn[0]) << 8) | pIn[1]; + (*in)+=2; + return 2; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pulls16(uint8_t **in, int16_t *out, uint8_t *end) { + uint8_t *pIn = *in; + + if((end - pIn) >=2 ) { + *out = ((pIn[0]) << 8) | pIn[1]; + (*in)+=2; + return 2; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pull32(uint8_t **in, uint32_t *out, uint8_t *end) { + uint8_t *pIn = *in; + + if((end - pIn) >=4 ) { + *out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3]; + (*in)+=4; + return 4; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t pulls32(uint8_t **in, int32_t *out, uint8_t *end) { + uint8_t *pIn = *in; + + if((end - pIn) >=4 ) { + *out = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3]; + (*in)+=4; + return 4; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +/* +inline void pusharray16(uint8_t **, uint16_t, uint32_t len) +{ +} +*/ + +uint32_t pullarray16(uint8_t **in, uint16_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*in)) >= sizeof(uint16_t) * len) { + uint32_t idx; + + for(idx = 0; idx < len; ++idx) { + if(!pull16(in, &out[idx], end)) + return 0; + } + + return sizeof(uint16_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint32_t pullarrays16(uint8_t **in, int16_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*in)) >= sizeof(uint16_t) * len) { + uint32_t idx; + + for(idx = 0; idx < len; ++idx) { + if(!pulls16(in, &out[idx], end)) + return 0; + } + + return sizeof(uint16_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} +uint32_t pusharray16(uint16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*out)) >= sizeof(uint16_t) * len) { + uint32_t idx; + + for(idx = 0; idx < len; ++idx) { + if(!push16(in[idx], out, end)) + return 0; + } + + return sizeof(uint16_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} +uint32_t pusharrays16(int16_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*out)) >= sizeof(uint16_t) * len) { + uint32_t idx; + + for(idx = 0; idx < len; ++idx) { + if (!pushs16(in[idx], out, end)) + return 0; + } + + return sizeof(uint16_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} +uint32_t pullarray32(uint8_t **in, uint32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*in)) >= sizeof(uint32_t) * len) { + uint32_t idx; + + for(idx = 0; idx < len; ++idx) { + if(!pull32(in, &out[idx], end)) + return 0; + } + + return sizeof(uint32_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint32_t pullarrays32(uint8_t **in, int32_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*in)) >= sizeof(uint32_t) * len) { + uint32_t idx; + + for(idx = 0; idx < len; ++idx) { + if(!pulls32(in, &out[idx], end)) + return 0; + } + + return sizeof(uint32_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} +uint32_t pusharray32(uint32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*out)) >= sizeof(uint32_t) * len) { + uint32_t idx; + + for(idx = 0; idx < len; ++idx) { + if(!push32(in[idx], out, end)) + return 0; + } + + return sizeof(uint32_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} +uint32_t pusharrays32(int32_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*out)) >= sizeof(uint32_t) * len) { + uint32_t idx; + + for(idx = 0; idx < len; ++idx) { + if (!pushs32(in[idx], out, end)) + return 0; + } + + return sizeof(uint32_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} +uint32_t pullarray8(uint8_t **in, uint8_t out[], uint32_t max_len, uint32_t len, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*in)) >= sizeof(uint8_t) * len) { + memcpy(out, (*in), len); + (*in)+=len; + return sizeof(uint8_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint32_t pusharray8(uint8_t in[], uint32_t max_len, uint32_t len, uint8_t **out, uint8_t *end) { + if(len == 0) + return 1; + + if(len > max_len) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, len, max_len); + on_error(); + return 0; + } + + if((end - (*out)) >= sizeof(uint8_t) * len) { + memcpy((*out), in, len); + (*out)+=len; + return sizeof(uint8_t) * len; + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s no space in buffer\n", __FUNCTION__); + on_error(); + return 0; + } +} + +uint8_t packarray(void *array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t **ppwritepackedmsg, uint8_t *end, pack_array_elem_fn fn) { + if(count > max_count) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count); + on_error(); + return 0; + } + + uint16_t i = 0; + + for(i = 0; i < count; ++i) { + if((fn)(array, ppwritepackedmsg, end) == 0) + return 0; + + array += array_element_size; + } + + return 1; +} + +uint8_t unpackarray(uint8_t **ppReadPackedMsg, void *array, uint16_t array_element_size, uint16_t max_count, uint16_t count, uint8_t *end, unpack_array_elem_fn fn) { + if(count > max_count) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, count, max_count); + on_error(); + return 0; + } + + uint16_t i = 0; + + for(i = 0; i < count; ++i) { + if((fn)(array, ppReadPackedMsg, end) == 0) + return 0; + + array += array_element_size; + } + + return 1; +} + + +uint32_t pack_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config) { + if(ve != 0 && config != 0) { + if(config->pack_vendor_extension_tlv) { + uint8_t *pStartOfTlv = *ppWritePackedMsg; + + if(pack_tl(ve, ppWritePackedMsg, end) == 0) + return 0; + + uint8_t *pStartOfValue = *ppWritePackedMsg; + + if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0) + return 0; + + ve->length = (*ppWritePackedMsg) - pStartOfValue; + pack_tl(ve, &pStartOfTlv, end); + return 1; + } + } + + return 1; +} + +uint32_t unpack_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config, nfapi_tl_t **ve_tlv) { + if(ve_tlv != 0 && config != 0) { + if(config->unpack_vendor_extension_tlv) { + return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void **)ve_tlv, config); + } + } + + return 1; +} + +uint32_t pack_p7_vendor_extension_tlv(nfapi_tl_t *ve, uint8_t **ppWritePackedMsg, uint8_t *end,nfapi_p7_codec_config_t *config) { + if(ve != 0 && config != 0) { + if(config->pack_vendor_extension_tlv) { + uint8_t *pStartOfTlv = *ppWritePackedMsg; + + if(pack_tl(ve, ppWritePackedMsg, end) == 0) + return 0; + + uint8_t *pStartOfValue = *ppWritePackedMsg; + + if((config->pack_vendor_extension_tlv)(ve, ppWritePackedMsg, end, config) == 0) + return 0; + + ve->length = (*ppWritePackedMsg) - pStartOfValue; + pack_tl(ve, &pStartOfTlv, end); + return 1; + } + } + + return 1; +} + +int unpack_p7_vendor_extension_tlv(nfapi_tl_t *tl, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config, nfapi_tl_t **ve_tlv) { + if(ve_tlv != 0 && config != 0) { + if(config->unpack_vendor_extension_tlv) { + return (config->unpack_vendor_extension_tlv)(tl, ppReadPackedMsg, end, (void **)ve_tlv, config); + } + } + + return 1; +} + + +uint8_t pack_tl(nfapi_tl_t *tl, uint8_t **ppWritePackedMsg, uint8_t *end) { + return (push16(tl->tag, ppWritePackedMsg, end) && + push16(tl->length, ppWritePackedMsg, end)); +} + +uint8_t unpack_tl(uint8_t **ppReadPackedMsg, nfapi_tl_t *tl, uint8_t *end) { + return (pull16(ppReadPackedMsg, &tl->tag, end) && + pull16(ppReadPackedMsg, &tl->length, end)); +} + +int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *config, nfapi_tl_t **ve) { + nfapi_tl_t generic_tl; + uint8_t numBadTags = 0; + uint16_t idx = 0; + + while ((uint8_t *)(*ppReadPackedMsg) < end) { + // unpack the tl and process the values accordingly + if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) + return 0; + + uint8_t tagMatch = 0; + uint8_t *pStartOfValue = *ppReadPackedMsg; + + for(idx = 0; idx < size; ++idx) { + if(unpack_fns[idx].tag == generic_tl.tag) { // match the extracted tag value with all the tags in unpack_fn list + tagMatch = 1; + nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv); + tl->tag = generic_tl.tag; + tl->length = generic_tl.length; + int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end); + + if(result == 0) { + return 0; + } + + // check if the length was right; + if(tl->length != (*ppReadPackedMsg - pStartOfValue)) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %ld\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue)); + on_error(); + } + } + } + + if(tagMatch == 0) { + if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE && + generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE) { + int result = unpack_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve); + + if(result == 0) { + // got tot the end. + return 0; + } else if(result < 0) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown VE TAG value: 0x%04x\n", generic_tl.tag); + on_error(); + + if (++numBadTags > MAX_BAD_TAG) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n"); + on_error(); + return 0; + } + + if((end - *ppReadPackedMsg) >= generic_tl.length) { + // Advance past the unknown TLV + (*ppReadPackedMsg) += generic_tl.length; + } else { + // go to the end + return 0; + } + } + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag); + on_error(); + + if (++numBadTags > MAX_BAD_TAG) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n"); + on_error(); + return 0; + } + + if((end - *ppReadPackedMsg) >= generic_tl.length) { + // Advance past the unknown TLV + (*ppReadPackedMsg) += generic_tl.length; + } else { + // go to the end + return 0; + } + } + } + } + + return 1; +} +int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config, nfapi_tl_t **ve) { + nfapi_tl_t generic_tl; + uint8_t numBadTags = 0; + uint16_t idx = 0; + + while ((uint8_t *)(*ppReadPackedMsg) < end) { + // unpack the tl and process the values accordingly + if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) + return 0; + + uint8_t tagMatch = 0; + uint8_t *pStartOfValue = *ppReadPackedMsg; + + for(idx = 0; idx < size; ++idx) { + if(unpack_fns[idx].tag == generic_tl.tag) { + tagMatch = 1; + nfapi_tl_t *tl = (nfapi_tl_t *)(unpack_fns[idx].tlv); + tl->tag = generic_tl.tag; + tl->length = generic_tl.length; + int result = (*unpack_fns[idx].unpack_func)(tl, ppReadPackedMsg, end, config); + + if(result == 0) { + return 0; + } + + // check if the length was right; + if(tl->length != (*ppReadPackedMsg - pStartOfValue)) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning tlv tag 0x%x length %d not equal to unpack %ld\n", tl->tag, tl->length, (*ppReadPackedMsg - pStartOfValue)); + on_error(); + } + } + } + + if(tagMatch == 0) { + if(generic_tl.tag >= NFAPI_VENDOR_EXTENSION_MIN_TAG_VALUE && + generic_tl.tag <= NFAPI_VENDOR_EXTENSION_MAX_TAG_VALUE) { + int result = unpack_p7_vendor_extension_tlv(&generic_tl, ppReadPackedMsg, end, config, ve); + + if(result == 0) { + // got to end + return 0; + } else if(result < 0) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag); + on_error(); + + if (++numBadTags > MAX_BAD_TAG) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n"); + on_error(); + return -1; + } + + if((end - *ppReadPackedMsg) >= generic_tl.length) { + // Advance past the unknown TLV + (*ppReadPackedMsg) += generic_tl.length; + } else { + // got ot the dn + return 0; + } + } + } else { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown TAG value: 0x%04x\n", generic_tl.tag); + on_error(); + + if (++numBadTags > MAX_BAD_TAG) { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "Supplied message has had too many bad tags\n"); + on_error(); + return -1; + } + + if((end - *ppReadPackedMsg) >= generic_tl.length) { + // Advance past the unknown TLV + (*ppReadPackedMsg) += generic_tl.length; + } else { + // got ot the dn + return 0; + } + } + } + } + + return 1; +} + +// This intermediate function deals with calculating the length of the value +// and writing into the tlv header. +uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end, pack_tlv_fn fn) { + nfapi_tl_t *tl = (nfapi_tl_t *)tlv; + + // If the tag is defined + if(tl->tag == tag) { + uint8_t *pStartOfTlv = *ppWritePackedMsg; + + // write a dumy tlv header + if(pack_tl(tl, ppWritePackedMsg, end) == 0) + return 0; + + // Record the start of the value + uint8_t *pStartOfValue = *ppWritePackedMsg; + + // pack the tlv value + if(fn(tlv, ppWritePackedMsg, end) == 0) + return 0; + + // calculate the length of the value and rewrite the tl header + tl->length = (*ppWritePackedMsg) - pStartOfValue; + // rewrite the header with the correct length + pack_tl(tl, &pStartOfTlv, end); + } else { + if(tl->tag != 0) { + NFAPI_TRACE(NFAPI_TRACE_WARN, "Warning pack_tlv tag 0x%x does not match expected 0x%x\n", tl->tag, tag); + } else { + //NFAPI_TRACE(NFAPI_TRACE_ERROR, "Warning pack_tlv tag 0x%x ZERO does not match expected 0x%x\n", tl->tag, tag); + } + } + + return 1; +} + +const char *nfapi_error_code_to_str(nfapi_error_code_e value) { + switch(value) { + case NFAPI_MSG_OK: + return "NFAPI_MSG_OK"; + + case NFAPI_MSG_INVALID_STATE: + return "NFAPI_MSG_INVALID_STATE"; + + case NFAPI_MSG_INVALID_CONFIG: + return "NFAPI_MSG_INVALID_CONFIG"; + + case NFAPI_SFN_OUT_OF_SYNC: + return "NFAPI_SFN_OUT_OF_SYNC"; + + case NFAPI_MSG_SUBFRAME_ERR: + return "NFAPI_MSG_SUBFRAME_ERR"; + + case NFAPI_MSG_BCH_MISSING: + return "NFAPI_MSG_BCH_MISSING"; + + case NFAPI_MSG_INVALID_SFN: + return "NFAPI_MSG_INVALID_SFN"; + + case NFAPI_MSG_HI_ERR: + return "NFAPI_MSG_HI_ERR"; + + case NFAPI_MSG_TX_ERR: + return "NFAPI_MSG_TX_ERR"; + + default: + return "UNKNOWN"; + } +} From e81b901355fdb5e97792e94f53f7b9bf36b36df8 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 9 Feb 2022 14:05:05 -0800 Subject: [PATCH 418/883] nFAPI bug fix. Not properly packing/unpacking PUCCH PDU Attempting to manually cherry-pick this commit: 30c14c2f5ac7de6885941d73fc492072b8d48759 --- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 251 +++++++++++++++++--------- 1 file changed, 164 insertions(+), 87 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index adc6d6e384..3817aa0895 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -3216,57 +3216,79 @@ static uint8_t pack_nr_uci_pucch_0_1(void* tlv, uint8_t **ppWritePackedMsg, uint static uint8_t pack_nr_uci_pucch_2_3_4(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; - if(!(push8(value->pduBitmap, ppWritePackedMsg, end) && - push32(value->handle, ppWritePackedMsg, end) && - push16(value->rnti, ppWritePackedMsg, end) && - push8(value->pucch_format, ppWritePackedMsg, end) && - push8(value->ul_cqi, ppWritePackedMsg, end) && - push16(value->timing_advance, ppWritePackedMsg, end) && - push16(value->rssi, ppWritePackedMsg, end) - )) - return 0; + if (!push8(value->pduBitmap, ppWritePackedMsg, end)) + return 0; + if (!push32(value->handle, ppWritePackedMsg, end)) + return 0; + if (!push16(value->rnti, ppWritePackedMsg, end)) + return 0; + if (!push8(value->pucch_format, ppWritePackedMsg, end)) + return 0; + if (!push8(value->ul_cqi, ppWritePackedMsg, end)) + return 0; + if (!push16(value->timing_advance, ppWritePackedMsg, end)) + return 0; + if (!push16(value->rssi, ppWritePackedMsg, end)) + return 0; if (value->pduBitmap & 0x01) { //SR - if(!(push8(value->sr.sr_bit_len, ppWritePackedMsg, end) && - pusharray8(value->sr.sr_payload, (int)(value->sr.sr_bit_len / 8) + 1, (int)(value->sr.sr_bit_len / 8) + 1, ppWritePackedMsg, end) - )) - return 0; - } - - if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - if(!(push8(value->harq.harq_crc, ppWritePackedMsg, end) && - push8(value->harq.harq_bit_len, ppWritePackedMsg, end) && - pusharray8(value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8) + 1, (int)(value->harq.harq_bit_len / 8) + 1, ppWritePackedMsg, end) - )) + if (!push16(value->sr.sr_bit_len, ppWritePackedMsg, end)) + return 0; + if (!pusharray8(value->sr.sr_payload, + (int)((value->sr.sr_bit_len / 8) + 1), + (int)((value->sr.sr_bit_len / 8) + 1), + ppWritePackedMsg, + end)) return 0; } - if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1 - if(!(push8(value->csi_part1.csi_part1_crc, ppWritePackedMsg, end) && - push8(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end) && - pusharray8(value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, (int)(value->csi_part1.csi_part1_bit_len / 8) + 1, ppWritePackedMsg, end) - )) + if ((value->pduBitmap >> 1) & 0x01) { //HARQ + if (!push8(value->harq.harq_crc, ppWritePackedMsg, end)) + return 0; + if (!push16(value->harq.harq_bit_len, ppWritePackedMsg, end)) + return 0; + if (!pusharray8(value->harq.harq_payload, + (int)((value->harq.harq_bit_len / 8) + 1), + (int)((value->harq.harq_bit_len / 8) + 1), + ppWritePackedMsg, + end)) return 0; } - if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2 - if(!(push8(value->csi_part2.csi_part2_crc, ppWritePackedMsg, end) && - push8(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end) && - pusharray8(value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, (int)(value->csi_part2.csi_part2_bit_len / 8) + 1, ppWritePackedMsg, end) - )) + if ((value->pduBitmap >> 2) & 0x01) { //CSI-1 + if (!push8(value->csi_part1.csi_part1_crc, ppWritePackedMsg, end)) + return 0; + if (!push16(value->csi_part1.csi_part1_bit_len, ppWritePackedMsg, end)) + return 0; + if (!pusharray8(value->csi_part1.csi_part1_payload, + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + ppWritePackedMsg, + end)) + return 0; + } + + if ((value->pduBitmap >> 3) & 0x01) { //CSI-2 + if (!push8(value->csi_part2.csi_part2_crc, ppWritePackedMsg, end)) + return 0; + if (!push16(value->csi_part2.csi_part2_bit_len, ppWritePackedMsg, end)) + return 0; + if (!pusharray8(value->csi_part2.csi_part2_payload, + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + ppWritePackedMsg, + end)) return 0; } return 1; } -static uint8_t pack_nr_uci_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +static uint8_t pack_nr_uci_indication_body(nfapi_nr_uci_t* value, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_uci_t* value = (nfapi_nr_uci_t*)tlv; - - if(!(push16(value->pdu_type, ppWritePackedMsg, end) && - push16(value->pdu_size, ppWritePackedMsg, end) - )) + if (!push16(value->pdu_type, ppWritePackedMsg, end)) + return 0; + if (!push16(value->pdu_size, ppWritePackedMsg, end)) return 0; switch (value->pdu_type) { @@ -3290,13 +3312,14 @@ static uint8_t pack_nr_uci_indication(void *msg, uint8_t **ppWritePackedMsg, uin { nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg; - if (!(push16(pNfapiMsg->sfn , ppWritePackedMsg, end) && - push16(pNfapiMsg->slot , ppWritePackedMsg, end) && - push16(pNfapiMsg->num_ucis, ppWritePackedMsg, end) - )) + if (!push16(pNfapiMsg->sfn , ppWritePackedMsg, end)) + return 0; + if (!push16(pNfapiMsg->slot , ppWritePackedMsg, end)) + return 0; + if (!push16(pNfapiMsg->num_ucis, ppWritePackedMsg, end)) return 0; - for(int i=0; inum_ucis;i++) + for (int i = 0; i < pNfapiMsg->num_ucis; i++) { if (!pack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppWritePackedMsg, end)) return 0; @@ -5907,58 +5930,111 @@ static uint8_t unpack_nr_uci_pucch_0_1(nfapi_nr_uci_pucch_pdu_format_0_1_t *valu } -static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value = (nfapi_nr_uci_pucch_pdu_format_2_3_4_t*) tlv; +static uint8_t unpack_nr_uci_pucch_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t* value, + uint8_t **ppReadPackedMsg, + uint8_t *end, + nfapi_p7_codec_config_t *config) { + + if (!pull8(ppReadPackedMsg, &value->pduBitmap, end)) + return 0; + if (!pull32(ppReadPackedMsg, &value->handle, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->rnti, end)) + return 0; + if (!pull8(ppReadPackedMsg, &value->pucch_format, end)) + return 0; + if (!pull8(ppReadPackedMsg, &value->ul_cqi, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->timing_advance, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->rssi, end)) + return 0; - if(!(pull8(ppReadPackedMsg, &value->pduBitmap, end) && - pull32(ppReadPackedMsg, &value->handle, end) && - pull16(ppReadPackedMsg, &value->rnti, end) && - pull8(ppReadPackedMsg, &value->pucch_format, end) && - pull8(ppReadPackedMsg, &value->ul_cqi, end) && - pull16(ppReadPackedMsg, &value->timing_advance, end) && - pull16(ppReadPackedMsg, &value->rssi, end) - )) - return 0; if (value->pduBitmap & 0x01) { //SR - if(!(pull16(ppReadPackedMsg, &value->sr.sr_bit_len, end))) + if (!pull16(ppReadPackedMsg, &value->sr.sr_bit_len, end)) return 0; - value->sr.sr_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->sr.sr_bit_len/8))); - - if(!(pullarray8(ppReadPackedMsg, &value->sr.sr_payload[0], (int)(value->sr.sr_bit_len / 8), (int)(value->sr.sr_bit_len / 8), end))) - return 0; - } - - if (((value->pduBitmap >> 1) & 0x01)) { //HARQ - if(!(pull8(ppReadPackedMsg, &value->harq.harq_crc, end)) && - (pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end))) + value->sr.sr_payload = nfapi_p7_allocate(sizeof(*value->sr.sr_payload) * + (int)((value->sr.sr_bit_len / 8) + 1), + config); + if (value->sr.sr_payload == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate value->sr.sr_payload\n", __FUNCTION__); return 0; + } - value->harq.harq_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->harq.harq_bit_len/8 ))); - - if(!(pullarray8(ppReadPackedMsg, value->harq.harq_payload, (int)(value->harq.harq_bit_len / 8), (int)(value->harq.harq_bit_len / 8), end))) + if (!pullarray8(ppReadPackedMsg, value->sr.sr_payload, + (int)((value->sr.sr_bit_len / 8) + 1), + (int)((value->sr.sr_bit_len / 8) + 1), + end)) return 0; } - if (((value->pduBitmap >> 2) & 0x01)) { //CSI-1 - if(!(pull8(ppReadPackedMsg, &value->csi_part1.csi_part1_crc, end)) && - (pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end))) + if ((value->pduBitmap >> 1) & 0x01) { //HARQ + if (!pull8(ppReadPackedMsg, &value->harq.harq_crc, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->harq.harq_bit_len, end)) return 0; - value->csi_part1.csi_part1_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->csi_part1.csi_part1_bit_len/8))); + value->harq.harq_payload = nfapi_p7_allocate(sizeof(*value->harq.harq_payload) * + (int)((value->harq.harq_bit_len / 8) + 1), + config); + if (value->harq.harq_payload == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate value->harq.harq_payload\n", __FUNCTION__); + return 0; + } -// if(!(pullarray8(ppReadPackedMsg, value->csi_part1.csi_part1_payload, (int)(value->csi_part1.csi_part1_bit_len / 8), (int)(value->csi_part1.csi_part1_bit_len / 8), end))) -// return 0; + if (!pullarray8(ppReadPackedMsg, value->harq.harq_payload, + (int)((value->harq.harq_bit_len / 8) + 1), + (int)((value->harq.harq_bit_len / 8) + 1), + end)) + return 0; } - if (((value->pduBitmap >> 3) & 0x01)) { //CSI-2 - if(!(pull8(ppReadPackedMsg, &value->csi_part2.csi_part2_crc, end)) && - (pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end))) + if ((value->pduBitmap >> 2) & 0x01) { //CSI-1 + if (!pull8(ppReadPackedMsg, &value->csi_part1.csi_part1_crc, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->csi_part1.csi_part1_bit_len, end)) return 0; - value->csi_part2.csi_part2_payload = (uint8_t*) malloc(sizeof(uint8_t) * ((value->csi_part2.csi_part2_bit_len/8 ))); + value->csi_part1.csi_part1_payload = nfapi_p7_allocate(sizeof(*value->csi_part1.csi_part1_payload) * + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + config); + if (value->csi_part1.csi_part1_payload == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate value->csi_part1.csi_part1_payload\n", + __FUNCTION__); + return 0; + } - if(!(pullarray8(ppReadPackedMsg, value->csi_part2.csi_part2_payload, (int)(value->csi_part2.csi_part2_bit_len / 8) , (int)(value->csi_part2.csi_part2_bit_len / 8) , end))) + if (!pullarray8(ppReadPackedMsg, value->csi_part1.csi_part1_payload, + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + (int)((value->csi_part1.csi_part1_bit_len / 8) + 1), + end)) + return 0; + } + + if ((value->pduBitmap >> 3) & 0x01) { //CSI-2 + if (!pull8(ppReadPackedMsg, &value->csi_part2.csi_part2_crc, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->csi_part2.csi_part2_bit_len, end)) + return 0; + + value->csi_part2.csi_part2_payload = nfapi_p7_allocate(sizeof(*value->csi_part2.csi_part2_payload) * + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + config); + if (value->csi_part2.csi_part2_payload == NULL) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s failed to allocate value->csi_part2.csi_part2_payload\n", + __FUNCTION__); + return 0; + } + + if (!pullarray8(ppReadPackedMsg, value->csi_part2.csi_part2_payload, + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + (int)((value->csi_part2.csi_part2_bit_len / 8) + 1), + end)) return 0; } @@ -5970,9 +6046,9 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, uint8_t *end, nfapi_p7_codec_config_t *config) { - if(!(pull16(ppReadPackedMsg, &value->pdu_type, end) && - pull16(ppReadPackedMsg, &value->pdu_size, end) - )) + if (!pull16(ppReadPackedMsg, &value->pdu_type, end)) + return 0; + if (!pull16(ppReadPackedMsg, &value->pdu_size, end)) return 0; switch (value->pdu_type) { @@ -5988,7 +6064,7 @@ static uint8_t unpack_nr_uci_indication_body(nfapi_nr_uci_t *value, } case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu = &value->pucch_pdu_format_2_3_4; - if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end)) + if (!unpack_nr_uci_pucch_2_3_4(uci_pdu, ppReadPackedMsg, end, config)) return 0; break; } @@ -6004,17 +6080,18 @@ static uint8_t unpack_nr_uci_indication(uint8_t **ppReadPackedMsg, uint8_t *end, { nfapi_nr_uci_indication_t *pNfapiMsg = (nfapi_nr_uci_indication_t*)msg; - if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->slot , end) && - pull16(ppReadPackedMsg, &pNfapiMsg->num_ucis, end) - )) - return 0; + if (!pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end)) + return 0; + if (!pull16(ppReadPackedMsg, &pNfapiMsg->slot , end)) + return 0; + if (!pull16(ppReadPackedMsg, &pNfapiMsg->num_ucis, end)) + return 0; pNfapiMsg->uci_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->uci_list) * pNfapiMsg->num_ucis, config); for (int i = 0; i < pNfapiMsg->num_ucis; i++) { - if(!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end, config)) - return 0; + if (!unpack_nr_uci_indication_body(&pNfapiMsg->uci_list[i], ppReadPackedMsg, end, config)) + return 0; } return 1; From 4c950bb0067ed58ab130fb79aca09074fcab3a8e Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 9 Feb 2022 14:06:55 -0800 Subject: [PATCH 419/883] Resetting dl_config->number_pdus in NRUE scheduler --- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 6c44a028ae..f82383c1c0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -944,6 +944,10 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) mac->if_module->scheduled_response(&scheduled_response); } + else + { + dl_config->number_pdus = 0; + } } } else if (ul_info) { From 9f30ff6cc82f9546073adb632094473cafb6c7be Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 9 Feb 2022 15:12:56 +0100 Subject: [PATCH 420/883] improve iperf client file retrieval --- ci-scripts/cls_oaicitest.py | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 05bac18900..90a23fe932 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -2386,7 +2386,7 @@ class OaiCiTest(): iperf_time = self.Iperf_ComputeTime() if self.iperf_direction=="DL": logging.debug("Iperf for Module in DL mode detected") - #server side UE + ##server side UE server_filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'rm ' + server_filename @@ -2394,20 +2394,21 @@ class OaiCiTest(): cmd = 'echo $USER; nohup iperf -s -B ' + UE_IPAddress + ' -u 2>&1 > ' + server_filename + ' &' SSH.command(cmd,'\$',5) SSH.close() - #client side EPC + ##client side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' - + #remove old client file in EPC.SourceCodePath + cmd = 'rm ' + EPC.SourceCodePath + '/' + client_filename + SSH.command(cmd,'\$',5) iperf_cmd = 'bin/iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename - cmd = 'docker exec -it prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' + cmd = 'docker exec -w /iperf-2.0.13 -it prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',int(iperf_time)*5.0) SSH.command('docker cp prod-trf-gen:/iperf-2.0.13/'+ client_filename + ' ' + EPC.SourceCodePath, '\$', 5) - SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + client_filename, '.') SSH.close() - #copy the 2 resulting files locally + #copy the 2 resulting files locally (python executor) SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, server_filename, '.') - SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, client_filename, '.') + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + client_filename, '.') #send for analysis self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,server_filename,1) @@ -2418,7 +2419,7 @@ class OaiCiTest(): server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' iperf_cmd = 'echo $USER; nohup bin/iperf -s -u 2>&1 > ' + server_filename - cmd = 'docker exec -d prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' + cmd = 'docker exec -d -w /iperf-2.0.13 prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',5) SSH.close() @@ -2433,29 +2434,28 @@ class OaiCiTest(): #once client is done, retrieve the server file from container to EPC Host SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) SSH.command('docker cp prod-trf-gen:/iperf-2.0.13/' + server_filename + ' ' + EPC.SourceCodePath, '\$', 5) - SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + server_filename, '.') SSH.close() #copy the 2 resulting files locally SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, client_filename, '.') - SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.') + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + server_filename, '.') #send for analysis self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,server_filename,1) elif self.iperf_direction=="BIDIR": logging.debug("Iperf for Module in BIDIR mode detected") + server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' + client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' + #server side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) - server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' - iperf_cmd = 'echo $USER; nohup /usr/local/bin/iperf3 -s 2>&1 > ' + server_filename - cmd = 'docker exec -d prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' + cmd = 'docker exec -d -w /iperf-2.0.13 prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',5) SSH.close() #client side UE SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) - client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' cmd = 'rm '+ client_filename SSH.command(cmd,'\$',5) SSH.command('iperf3 -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename, '\$', int(iperf_time)*5.0) @@ -2463,13 +2463,17 @@ class OaiCiTest(): #once client is done, retrieve the server file from container to EPC Host SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + #remove old server file in EPC.SourceCodePath + cmd = 'rm ' + EPC.SourceCodePath + '/' + server_filename + SSH.command(cmd,'\$',5) + #copy from docker container to EPC.SourceCodePath SSH.command('docker cp prod-trf-gen:/iperf-2.0.13/' + server_filename + ' ' + EPC.SourceCodePath, '\$', 5) - SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + server_filename, '.') SSH.close() #copy the 2 resulting files locally SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, client_filename, '.') - SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.') + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + server_filename, '.') + #send for analysis self.Iperf_analyzeV2BIDIR(lock, UE_IPAddress, device_id, statusQueue, server_filename, client_filename) From 92a021a15992d75865dd3b43dc4836e5daf173a5 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 10 Feb 2022 15:45:44 +0100 Subject: [PATCH 421/883] fix(docker): SA FDD template file not generated; cosmetics changes on the CI side Signed-off-by: Raphael Defosseux --- ci-scripts/xml_files/container_5g_fdd_rfsim.xml | 4 ++-- ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml | 4 ++-- ci-scripts/xml_files/container_5g_rfsim.xml | 4 ++-- ci-scripts/xml_files/container_5g_rfsim_down.xml | 2 +- .../yaml_files/5g_fdd_rfsimulator/docker-compose.yaml | 10 +++++----- docker/scripts/generateTemplate.py | 1 + 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index 44be29cca4..28269b2d03 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -21,8 +21,8 @@ --> - rfsim-5gnr - Testing 5G NR RF sim - Monolithic gNB + rfsim-5gnr-fdd + Testing 5G NR RF sim - Monolithic FDD gNB wrench 4 diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml index c9e9a99d7b..d960949f7d 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml @@ -21,8 +21,8 @@ --> - rfsim-5gnr-down - CleanUp 5G RF - Monolithic gNB + rfsim-5gnr-fdd-down + CleanUp 5G RF - Monolithic FDD gNB trash 100012 diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index d1114616a8..7485b1f8ba 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -21,8 +21,8 @@ --> - rfsim-5gnr - Testing 5G NR RF sim - Monolithic gNB + rfsim-5gnr-tdd + Testing 5G NR RF sim - Monolithic TDD gNB wrench 4 diff --git a/ci-scripts/xml_files/container_5g_rfsim_down.xml b/ci-scripts/xml_files/container_5g_rfsim_down.xml index 9acc3f85a1..b369b1fad8 100644 --- a/ci-scripts/xml_files/container_5g_rfsim_down.xml +++ b/ci-scripts/xml_files/container_5g_rfsim_down.xml @@ -22,7 +22,7 @@ --> rfsim-5gnr-down - CleanUp 5G RF - Monolithic gNB + CleanUp 5G RF - Monolithic TDD gNB trash 100002 diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml index 587722f2ef..3e46adb9e7 100644 --- a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml @@ -241,15 +241,15 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eth0 - GNB_NGA_IP_ADDRESS: 192.168.71.136 + GNB_NGA_IP_ADDRESS: 192.168.71.140 GNB_NGU_IF_NAME: eth0 - GNB_NGU_IP_ADDRESS: 192.168.71.136 + GNB_NGU_IP_ADDRESS: 192.168.71.140 USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time depends_on: - oai-ext-dn networks: public_net: - ipv4_address: 192.168.71.136 + ipv4_address: 192.168.71.140 healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -260,7 +260,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - RFSIMULATOR: 192.168.71.136 + RFSIMULATOR: 192.168.71.140 FULL_IMSI: '208990100001100' FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' OPC: 'C42449363BBAD02B66D16BC975D77CC1' @@ -272,7 +272,7 @@ services: - oai-gnb networks: public_net: - ipv4_address: 192.168.71.137 + ipv4_address: 192.168.71.150 healthcheck: test: /bin/bash -c "pgrep nr-uesoftmodem" interval: 10s diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py index 3d037294e6..297c202a03 100644 --- a/docker/scripts/generateTemplate.py +++ b/docker/scripts/generateTemplate.py @@ -55,6 +55,7 @@ def main(): "rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gnb.band78.tm1.fr1.106PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "gnb.sa.band66.fr1.106PRB.usrpn300.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gNB_SA_CU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gNB_SA_DU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', From 11d80b93a9bde17e27637f5bc6903f520a249ea0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 10 Feb 2022 15:55:26 +0100 Subject: [PATCH 422/883] Increase LTE 2x2 ping test threshold to 40ms --- ci-scripts/xml_files/lte_2x2_tm1_quectel.xml | 2 +- ci-scripts/xml_files/lte_2x2_tm2_quectel.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml index 6cb7b2883b..11c4abce1b 100644 --- a/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml @@ -96,7 +96,7 @@ nrmodule2_quectel -c 100 -s 1024 -i 0,2 1 - 30 + 40 diff --git a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml index fcc772b8f4..6b5698698a 100644 --- a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml @@ -96,7 +96,7 @@ nrmodule2_quectel -c 100 -s 1024 -i 0,2 1 - 30 + 40 From 2b96909960979eff578ba3756a63d612126073e2 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 11 Feb 2022 08:11:45 +0100 Subject: [PATCH 423/883] update to ori.h (with NR extensions) --- targets/ARCH/AW2SORI/ori.h | 113 ++++++++++++++++++++++++++++++++++--- 1 file changed, 104 insertions(+), 9 deletions(-) diff --git a/targets/ARCH/AW2SORI/ori.h b/targets/ARCH/AW2SORI/ori.h index d4a4f2cbbf..3650d15ec6 100644 --- a/targets/ARCH/AW2SORI/ori.h +++ b/targets/ARCH/AW2SORI/ori.h @@ -2,8 +2,8 @@ * @file ori.h * @brief Open Radio Interface (ORI) C library header file. * @author AW2S (http://www.aw2s.com) -* @version 1.6 -* @date July 29, 2019 +* @version 1.8 +* @date January 18, 2022 * * This file is the AW2S REC ORI C library header, and contains all necessary * functions prototypes, enumerations, data structures and type definitions @@ -14,7 +14,7 @@ #define ORI_H_ #define ORILIB_VERSION_MAJOR 1 -#define ORILIB_VERSION_MINOR 6 +#define ORILIB_VERSION_MINOR 8 #include @@ -144,10 +144,14 @@ typedef enum ORI_ObjectType_TxEUtraFDD, /**< */ ORI_ObjectType_TxEUtraTDD, /**< */ ORI_ObjectType_TxGSM, /**< */ + ORI_ObjectType_TxNRFDD, /**< */ + ORI_ObjectType_TxNRTDD, /**< */ ORI_ObjectType_RxUtra, /**< */ ORI_ObjectType_RxEUtraFDD, /**< */ ORI_ObjectType_RxEUtraTDD, /**< */ ORI_ObjectType_RxGSM, /**< */ + ORI_ObjectType_RxNRFDD, /**< */ + ORI_ObjectType_RxNRTDD, /**< */ ORI_ObjectType_ORILink, /**< */ ORI_ObjectType_ExternalEventPort, /**< */ ORI_ObjectType_AISGPort, /**< */ @@ -223,6 +227,7 @@ typedef enum ORI_ObjectParam_SigPath_AWS_enableCompBitChange, /**< */ ORI_ObjectParam_SigPath_AWS_measuredPwr, /**< */ ORI_ObjectParam_SigPath_AWS_axcIncr, /**< */ + ORI_ObjectParam_SigPath_AWS_arfcn, /**< */ ORI_ObjectParam_TxSigPath_t2a, /**< */ ORI_ObjectParam_TxSigPath_maxTxPwr, /**< */ ORI_ObjectParam_TxSigPath_dlCalRE, /**< */ @@ -252,12 +257,12 @@ typedef enum ORI_ObjectParam_ORILink_AWS_localMAC, /**< */ ORI_ObjectParam_ORILink_AWS_remoteMAC, /**< */ ORI_ObjectParam_ORILink_AWS_t14, /**< */ + ORI_ObjectParam_ORILink_AWS_sfpTxPow, /**< */ + ORI_ObjectParam_ORILink_AWS_sfpRxPow, /**< */ ORI_ObjectParam_ORILink_AWS_remoteIP, /**< */ ORI_ObjectParam_ORILink_AWS_localIP, /**< */ ORI_ObjectParam_ORILink_AWS_remoteUdpPort, /**< */ ORI_ObjectParam_ORILink_AWS_localUdpPort, /**< */ - ORI_ObjectParam_ORILink_AWS_sfpTxPow, /**< */ - ORI_ObjectParam_ORILink_AWS_sfpRxPow, /**< */ ORI_ObjectParam_AISGPort_busPowerEnable, /**< */ ORI_ObjectParam_AISGALD_deviceType, /**< */ ORI_ObjectParam_AISGALD_UID, /**< */ @@ -1146,6 +1151,50 @@ typedef struct ORI_Boolean_e AWS_enPeakCancel; /**< RW-Locked. AW2S Vendor specific: Peak-Cancellation CFR enablement. */ } ORI_ObjectParams_TxSigPathGSM_s; +/** + * @struct ORI_ObjectParams_TxSigPathNRFDD_s + * @brief Structure containing the parameters of a TxSigPath NRFDD object. + */ +typedef struct +{ + uint16_t chanBW; /**< RW-Locked. Channel bandwith in MHz/10. */ + uint16_t dlCalREMax; /**< RO. Max possible buffer in RE for DL timing calibration in Tc/16.*/ + uint32_t t2a; /**< RO. RE time delay. */ + uint16_t dlCalRE; /**< RW-Locked. Time delay to enable DL timing calibration in Tc/16. */ + int16_t maxTxPwr; /**< RW. Max tx power for this path, unit is dBm/10 (e.g. 400 for 40 dBm). */ + uint8_t axcW; /**< RW-Locked. AxC W parameter. */ + uint8_t axcB; /**< RW-Locked. AxC B parameter. */ + ORI_Object_s * oriLink; /**< RW-Locked. ORI Link on which the AxC is mapped. */ + ORI_Object_s * antPort; /**< RW-Locked. Reference Antenna port for this signal. */ + ORI_Boolean_e AWS_enableCompRateChange; /**< RW-Locked. AW2S Vendor specific: Enable IQ data compression sample rate change. */ + int16_t AWS_measuredPwr; /**< RO. AW2S Vendor specific: Measured Tx power for this path, unit is dBm/10 (e.g. 400 for 40 dBm). */ + uint16_t AWS_axcIncr; /**< RW-Locked. AW2S Vendor specific: AxC increment for each sample, 0 means auto (= packed, no interleaving). */ + ORI_Boolean_e AWS_enPeakCancel; /**< RW-Locked. AW2S Vendor specific: Peak-Cancellation CFR enablement. */ + uint32_t AWS_arfcn; /**< RW-Locked. ARFCN of the NR carrier. */ +} ORI_ObjectParams_TxSigPathNRFDD_s; + +/** + * @struct ORI_ObjectParams_TxSigPathNRTDD_s + * @brief Structure containing the parameters of a TxSigPath NRTDD object. + */ +typedef struct +{ + uint16_t chanBW; /**< RW-Locked. Channel bandwith in MHz/10. */ + uint16_t dlCalREMax; /**< RO. Max possible buffer in RE for DL timing calibration in Tc/16.*/ + uint32_t t2a; /**< RO. RE time delay. */ + uint16_t dlCalRE; /**< RW-Locked. Time delay to enable DL timing calibration in Tc/16. */ + int16_t maxTxPwr; /**< RW. Max tx power for this path, unit is dBm/10 (e.g. 400 for 40 dBm). */ + uint8_t axcW; /**< RW-Locked. AxC W parameter. */ + uint8_t axcB; /**< RW-Locked. AxC B parameter. */ + ORI_Object_s * oriLink; /**< RW-Locked. ORI Link on which the AxC is mapped. */ + ORI_Object_s * antPort; /**< RW-Locked. Reference Antenna port for this signal. */ + ORI_Boolean_e AWS_enableCompRateChange; /**< RW-Locked. AW2S Vendor specific: Enable IQ data compression sample rate change. */ + int16_t AWS_measuredPwr; /**< RO. AW2S Vendor specific: Measured Tx power for this path, unit is dBm/10 (e.g. 400 for 40 dBm). */ + uint16_t AWS_axcIncr; /**< RW-Locked. AW2S Vendor specific: AxC increment for each sample, 0 means auto (= packed, no interleaving). */ + ORI_Boolean_e AWS_enPeakCancel; /**< RW-Locked. AW2S Vendor specific: Peak-Cancellation CFR enablement. */ + uint32_t AWS_arfcn; /**< RW-Locked. ARFCN of the NR carrier. */ +} ORI_ObjectParams_TxSigPathNRTDD_s; + /** * @struct ORI_ObjectParams_RxSigPathUtra_s * @brief Structure containing the parameters of a RxSigPath UTRAFDD object. @@ -1239,6 +1288,48 @@ typedef struct uint16_t AWS_axcIncr; /**< RW-Locked. AW2S Vendor specific: AxC increment for each sample, 0 means auto (= packed, no interleaving). */ } ORI_ObjectParams_RxSigPathGSM_s; +/** + * @struct ORI_ObjectParams_RxSigPathNRFDD_s + * @brief Structure containing the parameters of a RxSigPath NRFDD object. + * + */ +typedef struct +{ + uint16_t chanBW; /**< RW-Locked. Channel bandwith in MHz/10. */ + uint16_t ulCalREMax; /**< RO. Max possible buffer in RE for UL timing calibration in Tc/2.*/ + uint32_t ta3; /**< RO. RE time delay. */ + uint16_t ulCalRE; /**< RW-Locked. Time delay to enable UL timing calibration in Tc/2. */ + uint8_t axcW; /**< RW-Locked. AxC W parameter. */ + uint8_t axcB; /**< RW-Locked. AxC B parameter. */ + ORI_Object_s * oriLink; /**< RW-Locked. ORI Link on which the AxC is mapped. */ + ORI_Object_s * antPort; /**< RW-Locked. Reference Antenna port for this signal. */ + ORI_Boolean_e AWS_enableCompRateChange; /**< RW-Locked. AW2S Vendor specific: Enable IQ data compression sample rate change. */ + int16_t AWS_measuredPwr; /**< RO. AW2S Vendor specific: Measured Rx power for this path, unit is dBm/10 (e.g. -650 for -65 dBm). */ + uint16_t AWS_axcIncr; /**< RW-Locked. AW2S Vendor specific: AxC increment for each sample, 0 means auto (= packed, no interleaving). */ + uint32_t AWS_arfcn; /**< RW-Locked. ARFCN of the NR carrier. */ +} ORI_ObjectParams_RxSigPathNRFDD_s; + +/** + * @struct ORI_ObjectParams_RxSigPathNRTDD_s + * @brief Structure containing the parameters of a RxSigPath NRTDD object. + * + */ +typedef struct +{ + uint16_t chanBW; /**< RW-Locked. Channel bandwith in MHz/10. */ + uint16_t ulCalREMax; /**< RO. Max possible buffer in RE for UL timing calibration in Tc/2.*/ + uint32_t ta3; /**< RO. RE time delay. */ + uint16_t ulCalRE; /**< RW-Locked. Time delay to enable UL timing calibration in Tc/2. */ + uint8_t axcW; /**< RW-Locked. AxC W parameter. */ + uint8_t axcB; /**< RW-Locked. AxC B parameter. */ + ORI_Object_s * oriLink; /**< RW-Locked. ORI Link on which the AxC is mapped. */ + ORI_Object_s * antPort; /**< RW-Locked. Reference Antenna port for this signal. */ + ORI_Boolean_e AWS_enableCompRateChange; /**< RW-Locked. AW2S Vendor specific: Enable IQ data compression sample rate change. */ + int16_t AWS_measuredPwr; /**< RO. AW2S Vendor specific: Measured Rx power for this path, unit is dBm/10 (e.g. -650 for -65 dBm). */ + uint16_t AWS_axcIncr; /**< RW-Locked. AW2S Vendor specific: AxC increment for each sample, 0 means auto (= packed, no interleaving). */ + uint32_t AWS_arfcn; /**< RW-Locked. ARFCN of the NR carrier. */ +} ORI_ObjectParams_RxSigPathNRTDD_s; + /** * @struct ORI_ObjectParams_ORILink_s * @brief Structure containing the parameters of an ORI Link object. @@ -1258,12 +1349,12 @@ typedef struct uint8_t AWS_localMAC[6]; /**< R0. AW2S Vendor specific: Local MAC address of the ORI link. */ uint8_t AWS_remoteMAC[6]; /**< RW. AW2S Vendor specific: Remote MAC address of the ORI link. */ uint32_t AWS_t14; /**< RO. AW2S Vendor specific: CPRI time delay component. */ - uint8_t AWS_remoteIP[4]; /**< RW. AW2S Vendor specific: REC IP for ECPRI Ethernet frame */ - uint8_t AWS_localIP[4]; /**< R0. AW2S Vendor specific: RE IP for ECPRI Ethernet frame */ - uint16_t AWS_remoteUdpPort; /**< RW. AW2S Vendor specific: REC Udp Port for ECPRI Ethernet frame */ - uint16_t AWS_localUdpPort; /**< R0. AW2S Vendor specific: RE Udp Port for ECPRI Ethernet frame */ uint32_t AWS_sfpTxPow; /**< RO. AW2S Vendor specific: SFP Tx power. */ uint32_t AWS_sfpRxPow; /**< RO. AW2S Vendor specific: SFP Rx power. */ + uint8_t AWS_remoteIP[4]; /**< RW. AW2S Vendor specific: IP of REC for ECPRI Ethernet frame */ + uint8_t AWS_localIP[4]; /**< RW. AW2S Vendor specific: IP of RE for ECPRI Ethernet frame */ + uint16_t AWS_remoteUdpPort; /**< RW. AW2S Vendor specific: UDP port of REC for ECPRI Ethernet frame */ + uint16_t AWS_localUdpPort; /**< RO. AW2S Vendor specific: UDP port of RE for ECPRI Ethernet frame */ } ORI_ObjectParams_ORILink_s; /** @@ -1393,10 +1484,14 @@ typedef union ORI_ObjectParams_TxSigPathEUtraFDD_s TxEUtraFDD; /**< Parameters for ::ORI_ObjectType_TxEUtraFDD. */ ORI_ObjectParams_TxSigPathEUtraTDD_s TxEUtraTDD; /**< Parameters for ::ORI_ObjectType_TxEUtraTDD. */ ORI_ObjectParams_TxSigPathGSM_s TxGSM; /**< Parameters for ::ORI_ObjectType_TxGSM. */ + ORI_ObjectParams_TxSigPathNRFDD_s TxNRFDD; /**< Parameters for ::ORI_ObjectType_TxNRFDD. */ + ORI_ObjectParams_TxSigPathNRTDD_s TxNRTDD; /**< Parameters for ::ORI_ObjectType_TxNRTDD. */ ORI_ObjectParams_RxSigPathUtra_s RxUtra; /**< Parameters for ::ORI_ObjectType_RxUtra. */ ORI_ObjectParams_RxSigPathEUtraFDD_s RxEUtraFDD; /**< Parameters for ::ORI_ObjectType_RxEUtraFDD. */ ORI_ObjectParams_RxSigPathEUtraTDD_s RxEUtraTDD; /**< Parameters for ::ORI_ObjectType_RxEUtraTDD. */ ORI_ObjectParams_RxSigPathGSM_s RxGSM; /**< Parameters for ::ORI_ObjectType_RxGSM. */ + ORI_ObjectParams_RxSigPathNRFDD_s RxNRFDD; /**< Parameters for ::ORI_ObjectType_RxNRFDD. */ + ORI_ObjectParams_RxSigPathNRTDD_s RxNRTDD; /**< Parameters for ::ORI_ObjectType_RxNRTDD. */ ORI_ObjectParams_ORILink_s ORILink; /**< Parameters for ::ORI_ObjectType_ORILink. */ ORI_ObjectParams_ExternalEventPort_s ExternalEventPort; /**< Parameters for ::ORI_ObjectType_ExternalEventPort. */ ORI_ObjectParams_AISGPort_s AISGPort; /**< Parameters for ::ORI_ObjectType_AISGPort. */ From 52d75940bef9999dcd2f3c1f0d864b45ce946cff Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 11 Feb 2022 10:36:00 +0100 Subject: [PATCH 424/883] fix macpdu2wireshark Somehow this file was in a bad state... --- common/utils/T/tracer/macpdu2wireshark.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c index a024f18145..195bf33335 100644 --- a/common/utils/T/tracer/macpdu2wireshark.c +++ b/common/utils/T/tracer/macpdu2wireshark.c @@ -362,16 +362,6 @@ void nr_dl_retx(void *_d, event e) e.e[d->nr_dl_retx_data].bsize, NO_PREAMBLE); } -void nr_dl_retx(void *_d, event e) -{ - ev_data *d = _d; - - trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i, - e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i, - e.e[d->nr_dl_retx_data].b, e.e[d->nr_dl_retx_data].bsize, - NO_PREAMBLE); -} - void nr_mib(void *_d, event e) { ev_data *d = _d; @@ -579,20 +569,6 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id, d->nr_dl_retx_data == -1) goto error; - /* NR dl retx: rnti, frame, slot, data */ - f = get_format(database, nr_dl_retx_id); - - for (i = 0; i < f.count; i++) { - G("rnti", "int", d->nr_dl_retx_rnti); - G("frame", "int", d->nr_dl_retx_frame); - G("slot", "int", d->nr_dl_retx_slot); - G("data", "buffer", d->nr_dl_retx_data); - } - - if (d->nr_dl_retx_rnti == -1 || d->nr_dl_retx_frame == -1 || - d->nr_dl_retx_slot == -1 || d->nr_dl_retx_data == -1) - goto error; - /* NR MIB: frame, slot, data */ f = get_format(database, nr_mib_id); From a296a4ebbe7cc204cac7aea14d599f773122125a Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 11 Feb 2022 08:22:06 +0100 Subject: [PATCH 425/883] improve BIDIR if client log is present yet empty --- ci-scripts/cls_oaicitest.py | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 90a23fe932..5d2c462ca7 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -2047,13 +2047,30 @@ class OaiCiTest(): def Iperf_analyzeV2BIDIR(self, lock, UE_IPAddress, device_id, statusQueue,server_filename,client_filename): - #server file is unused for the moment - if (not os.path.isfile(client_filename)): - self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from client log') + + #check the 2 files are here + if (not os.path.isfile(client_filename)) or (not os.path.isfile(server_filename)): + self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Client or Server Log File not present') return - report=[] - report_msg='Client Report:\n' - with open(client_filename, 'r') as f_client: + #check the 2 files size + if (os.path.getsize(client_filename)==0) and (os.path.getsize(server_filename)==0): + self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Client and Server Log File are empty') + return + + report_msg='TCP BIDIR Report:\n' + #if client is not empty, all the info is in, otherwise we ll use the server file to get some partial info + client_filesize = os.path.getsize(client_filename) + if client_filesize == 0: + report_msg+="Client file (UE) present but !!! EMPTY !!!\n" + report_msg+="Partial report from server file\n" + filename = server_filename + else : + report_msg+="Report from client file (UE)\n" + filename = client_filename + + report=[] #used to check if relevant lines were found + + with open(filename, 'r') as f_client: for line in f_client.readlines(): result = re.search(rf'^\[\s+\d+\](?P\[.+\]).*\s+(?P[0-9\.]+ [KMG]bits\/sec).*\s+(?P\bsender|receiver\b)', str(line)) if result is not None: @@ -2070,7 +2087,7 @@ class OaiCiTest(): logging.debug('\u001B[1;35m ' + report_msg + '\u001B[0m') lock.release() else: - self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from client log') + self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from Log file') From 9fa3760c09565fd30b27a2428de78f7f69ea994e Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 11 Feb 2022 14:26:47 +0100 Subject: [PATCH 426/883] update nrmodule2 logrotation threshold --- ci-scripts/cls_log_mgt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_log_mgt.py b/ci-scripts/cls_log_mgt.py index 7fb45ed3ea..cf7b91d3c0 100644 --- a/ci-scripts/cls_log_mgt.py +++ b/ci-scripts/cls_log_mgt.py @@ -93,7 +93,7 @@ class Log_Mgt: avail_space =int(self.__CheckAvailSpace())*1000 #avail space in target folder, initially displayed in Gb avg_size=self.__AvgSize() #average size of artifacts in the target folder logging.debug("Avail Space : " + str(avail_space) + " / Artifact Avg Size : " + str(avg_size)) - if avail_space < 2*avg_size: #reserved space is 2x artifact file ; oldest file will be deleted + if avail_space < 50*avg_size: #reserved space is 50x artifact file ; oldest file will be deleted oldestfile=self.__GetOldestFile() HOST=self.Username+'@'+self.IPAddress COMMAND="echo " + self.Password + " | sudo -S rm "+ self.path + "/" + oldestfile From c159ca13de14266695a36e223947a65af5998986 Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 11 Feb 2022 15:08:47 +0100 Subject: [PATCH 427/883] update thread_pool_size for NSA 2x2 and SA 2x2 --- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 1 + ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index f5d2da91b7..6bdf1ab987 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -234,6 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 8; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 75f2b2ff91..3579d1e3c2 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -234,6 +234,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; + thread_pool_size = 8; prach_dtx_threshold = 120; # pucch0_dtx_threshold = 150; } From d2a559f91ec12d35a4301f7297c3b1d2500a4bda Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 11 Feb 2022 18:35:26 +0100 Subject: [PATCH 428/883] improvements in config_csirs --- openair2/RRC/NR/nr_rrc_config.c | 136 +++++++++++++++++++++++++++++ openair2/RRC/NR/nr_rrc_config.h | 6 ++ openair2/RRC/NR/nr_rrc_proto.h | 2 - openair2/RRC/NR/rrc_gNB_reconfig.c | 72 +-------------- 4 files changed, 145 insertions(+), 71 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 6b7f9a21b9..cd8f2530ae 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -31,6 +31,142 @@ #include "nr_rrc_config.h" #include "common/utils/nr/nr_common.h" +const uint8_t slotsperframe[5] = {10, 20, 40, 80, 160}; + + +void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0, int uid, int nb_slots_per_period) { + + nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); + int ideal_period = nb_slots_per_period*MAX_MOBILES_PER_GNB; + if (ideal_period<5) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots4; + nzpcsi0->periodicityAndOffset->choice.slots4 = nb_slots_per_period*uid; + } + else if (ideal_period<6) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots5; + nzpcsi0->periodicityAndOffset->choice.slots5 = nb_slots_per_period*uid; + } + else if (ideal_period<9) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots8; + nzpcsi0->periodicityAndOffset->choice.slots8 = nb_slots_per_period*uid; + } + else if (ideal_period<11) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots10; + nzpcsi0->periodicityAndOffset->choice.slots10 = nb_slots_per_period*uid; + } + else if (ideal_period<17) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots16; + nzpcsi0->periodicityAndOffset->choice.slots16 = nb_slots_per_period*uid; + } + else if (ideal_period<21) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots20; + nzpcsi0->periodicityAndOffset->choice.slots20 = nb_slots_per_period*uid; + } + else if (ideal_period<41) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots40; + nzpcsi0->periodicityAndOffset->choice.slots40 = nb_slots_per_period*uid; + } + else if (ideal_period<81) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots80; + nzpcsi0->periodicityAndOffset->choice.slots80 = nb_slots_per_period*uid; + } + else if (ideal_period<161) { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots160; + nzpcsi0->periodicityAndOffset->choice.slots160 = nb_slots_per_period*uid; + } + else { + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; + nzpcsi0->periodicityAndOffset->choice.slots320 = (nb_slots_per_period*uid)%320 + (nb_slots_per_period*uid)/320; + } +} + + +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, + NR_CSI_MeasConfig_t *csi_MeasConfig, + int num_dl_antenna_ports, + int uid, + int curr_bwp, + int do_csirs) { + + if (do_csirs) { + + csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); + NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0)); + nzpcsirs0->nzp_CSI_ResourceSetId = 0; + NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0)); + *nzpid0 = 0; + ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0); + nzpcsirs0->repetition = NULL; + nzpcsirs0->aperiodicTriggeringOffset = NULL; + nzpcsirs0->trs_Info = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0); + + const NR_TDD_UL_DL_Pattern_t *tdd = servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon ? + &servingcellconfigcommon->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + + const int n_slots_frame = slotsperframe[*servingcellconfigcommon->ssbSubcarrierSpacing]; + + int nb_slots_per_period = n_slots_frame; + if (tdd) + nb_slots_per_period = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); + + csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); + NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); + nzpcsi0->nzp_CSI_RS_ResourceId = 0; + NR_CSI_RS_ResourceMapping_t resourceMapping; + switch (num_dl_antenna_ports) { + case 1: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2; + resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; + resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; + break; + case 2: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; + resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.other.size = 1; + resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2; + resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; + break; + case 4: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4; + resourceMapping.frequencyDomainAllocation.choice.row4.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.row4.size = 1; + resourceMapping.frequencyDomainAllocation.choice.row4.bits_unused = 5; + resourceMapping.frequencyDomainAllocation.choice.row4.buf[0] = 32; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p4; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; + break; + default: + AssertFatal(1==0,"Number of ports not yet supported\n"); + } + resourceMapping.firstOFDMSymbolInTimeDomain = 13; // last symbol of slot + resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; + resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; + resourceMapping.density.choice.one = (NULL_t)0; + resourceMapping.freqBand.startingRB = 0; + resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2; + nzpcsi0->resourceMapping = resourceMapping; + nzpcsi0->powerControlOffset = 0; + nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); + *nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0; + nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; + set_csirs_periodicity(nzpcsi0, uid, nb_slots_per_period); + nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL; + ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); + } + else { + csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL; + csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL; + } +} + void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index 192fee754e..99e6de52a1 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -113,6 +113,12 @@ typedef struct physicalcellgroup_s{ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, + NR_CSI_MeasConfig_t *csi_MeasConfig, + int num_dl_antenna_ports, + int uid, + int curr_bwp, + int do_csirs); #endif diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 22109c3029..450b155a35 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -84,8 +84,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int initial_csi_index, int uid); -void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs); - void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 30604cd015..dd0b1bcc92 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -45,6 +45,7 @@ #include "SIMULATION/TOOLS/sim.h" #include "executables/softmodem-common.h" #include "LAYER2/nr_rlc/nr_rlc_oai_api.h" +#include "nr_rrc_config.h" #define false 0 #define true 1 @@ -1076,24 +1077,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL; csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL; - if (do_csirs) { - csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList)); - NR_NZP_CSI_RS_ResourceSet_t *nzpcsirs0 = calloc(1,sizeof(*nzpcsirs0)); - nzpcsirs0->nzp_CSI_ResourceSetId = 0; - NR_NZP_CSI_RS_ResourceId_t *nzpid0 = calloc(1,sizeof(*nzpid0)); - *nzpid0 = 0; - ASN_SEQUENCE_ADD(&nzpcsirs0->nzp_CSI_RS_Resources,nzpid0); - nzpcsirs0->repetition = NULL; - nzpcsirs0->aperiodicTriggeringOffset = NULL; - nzpcsirs0->trs_Info = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list,nzpcsirs0); - } - else - csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL; - csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL; - config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,do_csirs); + config_csirs(servingcellconfigcommon, csi_MeasConfig, uid, dl_antenna_ports, curr_bwp, do_csirs); csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList)); csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL; @@ -1112,9 +1098,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0); csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList)); + csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL; if (do_csirs) { - csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL; NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0)); csires0->csi_ResourceConfigId=0; csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB; @@ -1292,58 +1278,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco } -void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs) { - - if (do_csirs) { - csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); - NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); - nzpcsi0->nzp_CSI_RS_ResourceId = 0; - NR_CSI_RS_ResourceMapping_t resourceMapping; - switch (dl_antenna_ports) { - case 1: - resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2; - resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; - resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=0; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]=16; - resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; - resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; - break; - case 2: - resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; - resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.row2.size = 1; - resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 2; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]=4; - resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; - resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; - break; - default: - AssertFatal(1==0,"Number of ports not yet supported\n"); - } - resourceMapping.firstOFDMSymbolInTimeDomain = 6; - resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; - resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; - resourceMapping.density.choice.one = (NULL_t)0; - resourceMapping.freqBand.startingRB = 0; - resourceMapping.freqBand.nrofRBs = 108; - nzpcsi0->resourceMapping = resourceMapping; - nzpcsi0->powerControlOffset = 0; - nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); - *nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0; - nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; - nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); - nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; - nzpcsi0->periodicityAndOffset->choice.slots320 = 0; - nzpcsi0->qcl_InfoPeriodicCSI_RS = NULL; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); - } - else - csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL; -} - - void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, From 9237cb545cd9b86a37d700bb2588cc58952dee98 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 22 Dec 2021 10:43:08 +0100 Subject: [PATCH 429/883] passing UECAP structure to RRC reconfiguration functions --- openair1/SIMULATION/NR_PHY/dlsim.c | 3 ++- openair1/SIMULATION/NR_PHY/ulsim.c | 3 ++- openair2/RRC/NR/MESSAGES/asn1_msg.c | 21 ++++++++++++--------- openair2/RRC/NR/MESSAGES/asn1_msg.h | 6 ++++++ openair2/RRC/NR/nr_rrc_proto.h | 2 ++ openair2/RRC/NR/rrc_gNB.c | 8 ++++++++ openair2/RRC/NR/rrc_gNB_nsa.c | 2 ++ openair2/RRC/NR/rrc_gNB_reconfig.c | 3 +++ 8 files changed, 37 insertions(+), 11 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 891951460c..9ad0643b3f 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -777,7 +777,8 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0); + // TODO do a UECAP for phy-sim + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 6, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index fe994dafe3..94f08eae06 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -720,7 +720,8 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0); + // TODO do a UECAP for phy-sim + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 0, 0, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 84a0cf75d1..75193ba5b1 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1396,6 +1396,13 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb); } + +void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, + rrc_gNB_carrier_data_t *carrier, + NR_UE_NR_Capability_t *uecap) { + +} + void fill_initial_cellGroupConfig(rnti_t rnti, NR_CellGroupConfig_t *cellGroupConfig, NR_ServingCellConfigCommon_t *scc, @@ -1815,6 +1822,8 @@ int16_t do_RRCReconfiguration( NR_SDAP_Config_t *sdap_config, NR_MeasConfig_t *meas_config, struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, + rrc_gNB_ue_context_t *const ue_context_pP, + rrc_gNB_carrier_data_t *carrier, NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig) //------------------------------------------------------------------------------ @@ -1851,15 +1860,6 @@ int16_t do_RRCReconfiguration( ie->radioBearerConfig->srb3_ToRelease = NULL; ie->radioBearerConfig->drb_ToReleaseList = DRB_releaseList; } - /******************** Secondary Cell Group ********************/ - // rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier); - // fill_default_secondaryCellGroup( carrier->servingcellconfigcommon, - // ue_context_pP->ue_context.secondaryCellGroup, - // 1, - // 1, - // carrier->pdsch_AntennaPorts, - // carrier->initial_csi_index[ue_context_p->local_uid + 1], - // ue_context_pP->local_uid); /******************** Meas Config ********************/ // measConfig @@ -1875,6 +1875,9 @@ int16_t do_RRCReconfiguration( } if(cellGroupConfig!=NULL){ + update_cellGroupConfig(cellGroupConfig, + carrier, + ue_context_pP->ue_context.UE_Capability_nr); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)cellGroupConfig, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 6803cf21d7..9c6e6db567 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -110,6 +110,10 @@ void fill_initial_cellGroupConfig(rnti_t rnti, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); +void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, + rrc_gNB_carrier_data_t *carrier, + NR_UE_NR_Capability_t *uecap); + void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, @@ -145,6 +149,8 @@ int16_t do_RRCReconfiguration( NR_SDAP_Config_t *sdap_config, NR_MeasConfig_t *meas_config, struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, + rrc_gNB_ue_context_t *const ue_context_pP, + rrc_gNB_carrier_data_t *carrier, NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig); diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 450b155a35..a5ed540cd3 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -76,6 +76,7 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti); void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_CellGroupConfig_t *secondaryCellGroup, + NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, int dl_antenna_ports, @@ -88,6 +89,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, + NR_UE_NR_Capability_t *uecap, int dl_antenna_ports, int minRXTXTIMEpdsch, int do_csirs, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 049e1a6827..4ab1804b2f 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -759,6 +759,8 @@ rrc_gNB_generate_defaultRRCReconfiguration( NULL, dedicatedNAS_MessageList, NULL, + NULL, + NULL, NULL); free(ue_context_pP->ue_context.nas_pdu.buffer); @@ -1028,6 +1030,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( NULL, NULL, dedicatedNAS_MessageList, + ue_context_pP, + &rrc->carrier, NULL, cellGroupConfig); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n"); @@ -1137,6 +1141,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL, dedicatedNAS_MessageList, NULL, + NULL, + NULL, NULL); ue_context_pP->ue_context.pdu_session_release_command_flag = 1; @@ -1706,6 +1712,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, // MeasObj_list, NULL, NULL, + NULL, + NULL, NULL); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 15caff0b4d..42a39a4fa8 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -266,6 +266,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.spCellConfig->spCellConfigDedicated, reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, + ue_context_p->ue_context.UE_Capability_nr, carrier->pdsch_AntennaPorts, carrier->minRXTXTIME, carrier->do_CSIRS, @@ -276,6 +277,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ NULL, reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, + ue_context_p->ue_context.UE_Capability_nr, carrier->pdsch_AntennaPorts, carrier->minRXTXTIME, carrier->do_CSIRS, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index dd0b1bcc92..adf57cacb9 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -53,6 +53,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_ServingCellConfig_t *servingcellconfigdedicated, NR_CellGroupConfig_t *secondaryCellGroup, + NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, int dl_antenna_ports, @@ -1282,6 +1283,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, + NR_UE_NR_Capability_t *uecap, int dl_antenna_ports, int minRXTXTIME, int do_csirs, @@ -1296,6 +1298,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon fill_default_secondaryCellGroup(servingcellconfigcommon, servingcellconfigdedicated, secondaryCellGroup, + uecap, 1, 1, dl_antenna_ports, From 67efa202e2f2d83f3379654a887197fa4a0b6ff5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 11 Feb 2022 19:32:40 +0100 Subject: [PATCH 430/883] call to config_csirs also in sa --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 12 ++++++++++++ openair2/RRC/NR/MESSAGES/asn1_msg.h | 1 + openair2/RRC/NR/nr_rrc_config.c | 2 ++ openair2/RRC/NR/rrc_gNB_reconfig.c | 2 -- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 75193ba5b1..940f38a672 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1399,8 +1399,19 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, rrc_gNB_carrier_data_t *carrier, + int uid, NR_UE_NR_Capability_t *uecap) { + NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig; + if (SpCellConfig == NULL) return; + + NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon; + + NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig)); + SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig; + + int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE); + config_csirs(scc, csi_MeasConfig, uid, carrier->pdsch_AntennaPorts, curr_bwp, carrier->do_CSIRS); } void fill_initial_cellGroupConfig(rnti_t rnti, @@ -1877,6 +1888,7 @@ int16_t do_RRCReconfiguration( if(cellGroupConfig!=NULL){ update_cellGroupConfig(cellGroupConfig, carrier, + ue_context_pP->local_uid, ue_context_pP->ue_context.UE_Capability_nr); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 9c6e6db567..c7f7d29b41 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -112,6 +112,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti, void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, rrc_gNB_carrier_data_t *carrier, + int uid, NR_UE_NR_Capability_t *uecap); void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index cd8f2530ae..85b421aa9e 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -165,6 +165,8 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL; csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList = NULL; } + csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL; + csi_MeasConfig->nzp_CSI_RS_ResourceToReleaseList = NULL; } void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index adf57cacb9..1f0b123a5c 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1078,8 +1078,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL; csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL; - csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL; - config_csirs(servingcellconfigcommon, csi_MeasConfig, uid, dl_antenna_ports, curr_bwp, do_csirs); csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList)); From 665d1caa0b1553d1b517355645d043048179a373 Mon Sep 17 00:00:00 2001 From: englab Date: Fri, 11 Feb 2022 17:17:07 -0500 Subject: [PATCH 431/883] First examples of global structure elements move to function stack --- openair1/PHY/INIT/nr_init_ue.c | 8 +++---- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 31 ++++++++++++++++++--------- openair1/PHY/defs_nr_UE.h | 4 ++-- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index c193733aef..4a1ce1c3eb 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -378,10 +378,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 ); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + //ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + // ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); // Channel estimates ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); @@ -396,9 +396,9 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); // size_t num = 7*2*fp->N_RB_DL*12; size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB - ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); + //ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); + // ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 84c9627c8a..74b229c451 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -206,7 +206,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, } } -int32_t nr_pdcch_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t **rxdataF_comp, +int32_t nr_pdcch_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t col, int32_t rxdataF_comp[][col], int16_t *pdcch_llr, uint8_t symbol,uint32_t coreset_nbr_rb) { int16_t *rxF = (int16_t *) &rxdataF_comp[0][(symbol * coreset_nbr_rb * 12)]; int32_t i; @@ -343,7 +343,8 @@ void nr_pdcch_channel_level(int32_t **dl_ch_estimates_ext, // This function will extract the mapped DM-RS PDCCH REs as per 38.211 Section 7.4.1.3.2 (Mapping to physical resources) void nr_pdcch_extract_rbs_single(int32_t **rxdataF, int32_t **dl_ch_estimates, - int32_t **rxdataF_ext, + int32_t col, + int32_t rxdataF_ext[][col], int32_t **dl_ch_estimates_ext, uint8_t symbol, NR_DL_FRAME_PARMS *frame_parms, @@ -537,9 +538,9 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, #define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) -void nr_pdcch_channel_compensation(int32_t **rxdataF_ext, +void nr_pdcch_channel_compensation(int32_t col, int32_t rxdataF_ext[][col], int32_t **dl_ch_estimates_ext, - int32_t **rxdataF_comp, + int32_t rxdataF_comp[][col], int32_t **rho, NR_DL_FRAME_PARMS *frame_parms, uint8_t symbol, @@ -650,7 +651,8 @@ void nr_pdcch_channel_compensation(int32_t **rxdataF_ext, void nr_pdcch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, + int32_t col, + int32_t rxdataF_comp[][col], uint8_t symbol) { #if defined(__x86_64__) || defined(__i386__) __m128i *rxdataF_comp128_0,*rxdataF_comp128_1; @@ -698,6 +700,13 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, int32_t avgs; int32_t avgP[4]; int n_rb,rb_offset; + + /// \brief Pointers to extracted PDCCH symbols in frequency-domain. + /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx + /// - second index: ? [0..168*N_RB_DL[ + int32_t rxdataF_ext[4*frame_parms->nb_antennas_rx][4*273*12]; // 4 symbols, 100 PRBs, 12 REs per PRB] + int32_t rxdataF_comp[4*frame_parms->nb_antennas_rx][4*273*12]; // 4 symbols, 100 PRBs, 12 REs per PRB] + get_coreset_rballoc(rel15->coreset.frequency_domain_resource,&n_rb,&rb_offset); LOG_D(PHY,"pdcch coreset: freq %x, n_rb %d, rb_offset %d\n", rel15->coreset.frequency_domain_resource[0],n_rb,rb_offset); @@ -706,7 +715,8 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, nr_pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, pdcch_vars->dl_ch_estimates, - pdcch_vars->rxdataF_ext, + 4*273*12, + rxdataF_ext, pdcch_vars->dl_ch_estimates_ext, s, frame_parms, @@ -739,9 +749,9 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, LOG_D(PHY,"we enter nr_pdcch_channel_compensation(log2_maxh=%d)\n",log2_maxh); LOG_D(PHY,"in nr_pdcch_channel_compensation(rxdataF_ext x dl_ch_estimates_ext -> rxdataF_comp)\n"); // compute LLRs for ofdm symbol 0 only - nr_pdcch_channel_compensation(pdcch_vars->rxdataF_ext, + nr_pdcch_channel_compensation(4*273*12, rxdataF_ext, pdcch_vars->dl_ch_estimates_ext, - pdcch_vars->rxdataF_comp, + rxdataF_comp, NULL, frame_parms, s, @@ -749,13 +759,14 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, n_rb); // log2_maxh+I0_shift if (frame_parms->nb_antennas_rx > 1) { LOG_D(PHY,"we enter nr_pdcch_detection_mrc(frame_parms->nb_antennas_rx=%d)\n", frame_parms->nb_antennas_rx); - nr_pdcch_detection_mrc(frame_parms, pdcch_vars->rxdataF_comp,s); + nr_pdcch_detection_mrc(frame_parms, 4*273*12, rxdataF_comp,s); } LOG_D(PHY,"we enter nr_pdcch_llr(for symbol %d), pdcch_vars[eNB_id]->rxdataF_comp ---> pdcch_vars[eNB_id]->llr \n",s); LOG_D(PHY,"in nr_pdcch_llr(rxdataF_comp -> llr)\n"); nr_pdcch_llr(frame_parms, - pdcch_vars->rxdataF_comp, + 4*273*12, + rxdataF_comp, pdcch_vars->llr, s, n_rb); diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 69978f5548..b411398d34 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -583,11 +583,11 @@ typedef struct { /// \brief Pointers to extracted PDCCH symbols in frequency-domain. /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: ? [0..168*N_RB_DL[ - int32_t **rxdataF_ext; + // int32_t **rxdataF_ext; /// \brief Pointers to extracted and compensated PDCCH symbols in frequency-domain. /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: ? [0..168*N_RB_DL[ - int32_t **rxdataF_comp; + // int32_t **rxdataF_comp; /// \brief Hold the channel estimates in frequency domain. /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[ From 74fd3f029adf496422d6cefe5c590ad2209176d1 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 13 Feb 2022 09:44:15 +0100 Subject: [PATCH 432/883] changes for AW2S NR support in ORI library --- executables/nr-ru.c | 11 +- openair2/ENB_APP/enb_paramdef.h | 6 + openair2/GNB_APP/gnb_config.c | 12 +- targets/ARCH/AW2SORI/oaiori.c | 351 +++++++++++++++++++++++++------ targets/ARCH/COMMON/common_lib.h | 6 + 5 files changed, 305 insertions(+), 81 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index c3788ef480..e4fc3bc27c 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -2084,9 +2084,7 @@ static void NRRCconfig_RU(void) { RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); - RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr); - for (i=0; inum_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; } //strcmp(local_rf, "yes") == 0 else { printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr)); @@ -2106,8 +2104,6 @@ static void NRRCconfig_RU(void) { RC.ru[j]->if_south = REMOTE_IF5; RC.ru[j]->function = NGFI_RAU_IF5; RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF5_ECPRI_MODE; - } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) { - RC.ru[j]->if_south = REMOTE_IF5; } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) { RC.ru[j]->if_south = REMOTE_IF5; RC.ru[j]->function = NGFI_RAU_IF5; @@ -2130,7 +2126,12 @@ static void NRRCconfig_RU(void) { RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr); RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr); RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr); - + RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; + for (i=0; inum_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; + RC.ru[j]->openair0_cfg.nr_flag = *(RUParamList.paramarray[j][RU_NR_FLAG].iptr); + RC.ru[j]->openair0_cfg.nr_band = RC.ru[j]->band[0]; + RC.ru[j]->openair0_cfg.nr_scs_for_raster = *(RUParamList.paramarray[j][RU_NR_SCS_FOR_RASTER].iptr); + printf("[RU %d] Setting nr_flag %d, nr_band %d, nr_scs_for_raster %d\n",j,RC.ru[j]->openair0_cfg.nr_flag,RC.ru[j]->openair0_cfg.nr_band,RC.ru[j]->openair0_cfg.nr_scs_for_raster); if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) { RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt; diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 22af2a6de0..2757e408d9 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -99,6 +99,8 @@ typedef enum { #define CONFIG_STRING_RU_IF_FREQUENCY "if_freq" #define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset" #define CONFIG_STRING_RU_DO_PRECODING "do_precoding" +#define CONFIG_STRING_RU_NR_FLAG "nr_flag" +#define CONFIG_STRING_RU_NR_SCS_FOR_RASTER "nr_scs_for_raster" #define RU_LOCAL_IF_NAME_IDX 0 #define RU_LOCAL_ADDRESS_IDX 1 @@ -129,6 +131,8 @@ typedef enum { #define RU_IF_FREQUENCY 26 #define RU_IF_FREQ_OFFSET 27 #define RU_DO_PRECODING 28 +#define RU_NR_FLAG 29 +#define RU_NR_SCS_FOR_RASTER 30 /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -163,6 +167,8 @@ typedef enum { {CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \ {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_NR_FLAG, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_NR_SCS_FOR_RASTER, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 9a0c972c09..deeb1b505d 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -451,7 +451,7 @@ void fix_scd(NR_ServingCellConfig_t *scd) { for (int i = scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list.count-1; i >= 0; i--) { if ((*scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list.array[i] < 1) || (*scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS->choice.setup->frequencyDensity->list.array[i] > 276)) { - LOG_I(RRC, "DL PTRS frequencyDensity %d not set. Assuming PTRS not present! \n", i); + LOG_I(NR_RRC, "DL PTRS frequencyDensity %d not set. Assuming PTRS not present! \n", i); free(scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS); scd->downlinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS = NULL; break; @@ -1149,16 +1149,16 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { (NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d", NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l]); } - printf("SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); + LOG_I(GNB_APP,"SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr; - printf("pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); + LOG_I(GNB_APP,"pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; - printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); + LOG_I(GNB_APP,"pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; - printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); + LOG_I(GNB_APP,"minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); + LOG_I(GNB_APP,"Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; diff --git a/targets/ARCH/AW2SORI/oaiori.c b/targets/ARCH/AW2SORI/oaiori.c index ea39d9c90d..4b0c83ab4c 100644 --- a/targets/ARCH/AW2SORI/oaiori.c +++ b/targets/ARCH/AW2SORI/oaiori.c @@ -228,14 +228,38 @@ int aw2s_startstreaming(openair0_device *device) { ORI_Result_e RE_result; openair0_config_t *openair0_cfg = device->openair0_cfg; + ORI_Object_s *tx0,*tx1,*tx2,*tx3,*rx0,*rx1,*rx2,*rx3; + if (openair0_cfg->nr_flag == 0 ) { + tx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ? ORI_ObjectType_TxEUtraFDD :ORI_ObjectType_TxEUtraTDD, 0, NULL); + tx1= (openair0_cfg->tx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxEUtraFDD : ORI_ObjectType_TxEUtraTDD, 1, NULL) : NULL; + tx2= (openair0_cfg->tx_num_channels > 2) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxEUtraFDD : ORI_ObjectType_TxEUtraTDD, 2, NULL) : NULL; + tx3= (openair0_cfg->tx_num_channels > 3) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxEUtraFDD : ORI_ObjectType_TxEUtraTDD, 3, NULL) : NULL; + rx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 0, NULL); + rx1= (openair0_cfg->rx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 1, NULL) : NULL; + rx2= (openair0_cfg->rx_num_channels > 2) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 2, NULL) : NULL; + rx3= (openair0_cfg->rx_num_channels > 3) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 3, NULL) : NULL; + } else { + tx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ? ORI_ObjectType_TxNRFDD :ORI_ObjectType_TxNRTDD, 0, NULL); + tx1= (openair0_cfg->tx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 1, NULL) : NULL; + tx2= (openair0_cfg->tx_num_channels > 2) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 2, NULL) : NULL; + tx3= (openair0_cfg->tx_num_channels > 3) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 3, NULL) : NULL; + rx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 0, NULL); + rx1= (openair0_cfg->rx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 1, NULL) : NULL; + rx2= (openair0_cfg->rx_num_channels > 2) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 2, NULL) : NULL; + rx3= (openair0_cfg->rx_num_channels > 3) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 3, NULL) : NULL; - ORI_Object_s *tx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ? ORI_ObjectType_TxEUtraFDD :ORI_ObjectType_TxEUtraTDD, 0, NULL); - ORI_Object_s *tx1= (openair0_cfg->tx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxEUtraFDD : ORI_ObjectType_TxEUtraTDD, 1, NULL) : NULL; - ORI_Object_s *rx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 0, NULL); - ORI_Object_s *rx1= (openair0_cfg->rx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 1, NULL) : NULL; + } ORI_Object_s *link= ORI_FindObject(ori, ORI_ObjectType_ORILink, 0, NULL); - if (tx0 == NULL || (tx1 == NULL && openair0_cfg->tx_num_channels > 1) || rx0 == NULL || (rx1 == NULL && openair0_cfg->rx_num_channels > 1) || link == NULL) return (-1); + if (tx0 == NULL || + (tx1 == NULL && openair0_cfg->tx_num_channels > 1) || + (tx2 == NULL && openair0_cfg->tx_num_channels > 2) || + (tx3 == NULL && openair0_cfg->tx_num_channels > 3) || + rx0 == NULL || + (rx1 == NULL && openair0_cfg->rx_num_channels > 1) || + (rx2 == NULL && openair0_cfg->rx_num_channels > 2) || + (rx3 == NULL && openair0_cfg->rx_num_channels > 3) || + link == NULL) return (-1); /******************************************************************* * UNLOCK Link @@ -284,6 +308,40 @@ int aw2s_startstreaming(openair0_device *device) { } printf("ORI_ObjectStateModify: %s\n", ORI_Result_Print(RE_result)); } + /******************************************************************* + * UNLOCK TX2 + *******************************************************************/ + + if (tx2) { + printf("\n\n\n========================================================\n"); + + /* Put Tx1 into service */ + result = ORI_ObjectStateModification(ori, tx2, ORI_AST_Unlocked, &RE_result); + if(result != ORI_Result_SUCCESS) + { + printf("ORI_ObjectStateModify failed with error: %s\n", ORI_Result_Print(result)); + aw2s_oricleanup(device); + return -1; + } + printf("ORI_ObjectStateModify: %s\n", ORI_Result_Print(RE_result)); + } + /******************************************************************* + * UNLOCK TX3 + *******************************************************************/ + + if (tx3) { + printf("\n\n\n========================================================\n"); + + /* Put Tx3 into service */ + result = ORI_ObjectStateModification(ori, tx1, ORI_AST_Unlocked, &RE_result); + if(result != ORI_Result_SUCCESS) + { + printf("ORI_ObjectStateModify failed with error: %s\n", ORI_Result_Print(result)); + aw2s_oricleanup(device); + return -1; + } + printf("ORI_ObjectStateModify: %s\n", ORI_Result_Print(RE_result)); + } /******************************************************************* * UNLOCK RX0 *******************************************************************/ @@ -320,6 +378,38 @@ int aw2s_startstreaming(openair0_device *device) { printf("ORI_ObjectStateModify: %s\n", ORI_Result_Print(RE_result)); } + /******************************************************************* + * UNLOCK RX2 + *******************************************************************/ + if (rx2) { + printf("\n\n\n========================================================\n"); + + /* Put Rx1 into service */ + result = ORI_ObjectStateModification(ori, rx2, ORI_AST_Unlocked, &RE_result); + if(result != ORI_Result_SUCCESS) + { + printf("ORI_ObjectStateModify failed with error: %s\n", ORI_Result_Print(result)); + aw2s_oricleanup(device); + return -1; + } + printf("ORI_ObjectStateModify: %s\n", ORI_Result_Print(RE_result)); + } + /******************************************************************* + * UNLOCK RX3 + *******************************************************************/ + if (rx3) { + printf("\n\n\n========================================================\n"); + + /* Put Rx1 into service */ + result = ORI_ObjectStateModification(ori, rx3, ORI_AST_Unlocked, &RE_result); + if(result != ORI_Result_SUCCESS) + { + printf("ORI_ObjectStateModify failed with error: %s\n", ORI_Result_Print(result)); + aw2s_oricleanup(device); + return -1; + } + printf("ORI_ObjectStateModify: %s\n", ORI_Result_Print(RE_result)); + } /* while (rx0->fst != ORI_FST_Operational || (openair0_cfg->rx_num_channels > 1 && rx1->fst != ORI_FST_Operational) || @@ -331,6 +421,9 @@ int aw2s_startstreaming(openair0_device *device) { uint64_t TS; char temp_rx[1024] __attribute__((aligned(32))); int aid,r0=0,r1=(openair0_cfg->rx_num_channels > 1) ? 0 : 1; + int r2=(openair0_cfg->rx_num_channels > 2) ? 0 : 1; + int r3=(openair0_cfg->rx_num_channels > 3) ? 0 : 1; + int i; int Npackets=1024000; for (i=0;iduplex_mode == duplex_mode_FDD ? ORI_ObjectType_TxEUtraFDD : ORI_ObjectType_TxEUtraTDD}; + ORI_ObjectTypeRef_s txTypeRef = { NULL, openair0_cfg->duplex_mode == duplex_mode_FDD ? + (openair0_cfg->nr_flag == 0 ? ORI_ObjectType_TxEUtraFDD : ORI_ObjectType_TxNRFDD): + (openair0_cfg->nr_flag == 0 ? ORI_ObjectType_TxEUtraTDD : ORI_ObjectType_TxNRTDD)}; ORI_ObjectParams_u txParams; ORI_ObjectParam_e txParamList[9]; ORI_Result_e txParamResult[9]; int num_txparams; - if (openair0_cfg->duplex_mode == duplex_mode_FDD) { - txParamList[0] = ORI_ObjectParam_SigPath_antPort; - txParamList[1] = ORI_ObjectParam_SigPath_axcW; - txParamList[2] = ORI_ObjectParam_SigPath_axcB; - txParamList[3] = ORI_ObjectParam_SigPath_chanBW; - txParamList[4] = ORI_ObjectParam_SigPath_earfcn; - txParamList[5] = ORI_ObjectParam_TxSigPath_maxTxPwr; - num_txparams = 6; - } - else { - txParamList[0] = ORI_ObjectParam_SigPath_antPort; - txParamList[1] = ORI_ObjectParam_SigPath_axcW; - txParamList[2] = ORI_ObjectParam_SigPath_axcB; - txParamList[3] = ORI_ObjectParam_SigPath_chanBW; - txParamList[4] = ORI_ObjectParam_SigPath_earfcn; - txParamList[5] = ORI_ObjectParam_TxSigPath_maxTxPwr; - txParamList[6] = ORI_ObjectParam_SigPath_tddULDLConfig; - txParamList[7] = ORI_ObjectParam_SigPath_tddSpecialSFConfig; - txParamList[8] = ORI_ObjectParam_TxSigPath_tddCPLengthDL; - num_txparams = 9; - } + txParamList[0] = ORI_ObjectParam_SigPath_antPort; + txParamList[1] = ORI_ObjectParam_SigPath_axcW; + txParamList[2] = ORI_ObjectParam_SigPath_axcB; + txParamList[3] = ORI_ObjectParam_SigPath_chanBW; + txParamList[4] = (openair0_cfg->nr_flag ==0) ? ORI_ObjectParam_SigPath_earfcn : ORI_ObjectParam_SigPath_AWS_arfcn; + txParamList[5] = ORI_ObjectParam_TxSigPath_maxTxPwr; + num_txparams = 6; /* Create tx0 */ ORI_Object_s * tx0; printf("AW2S: duplex_mode %d, tx_bw %f, rx_bw %f\n",openair0_cfg->duplex_mode,openair0_cfg->tx_bw,openair0_cfg->rx_bw); - if (openair0_cfg->duplex_mode == duplex_mode_FDD) { + if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 0) { txParams.TxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 0, NULL); txParams.TxEUtraFDD.axcW = 1; txParams.TxEUtraFDD.axcB = 0; txParams.TxEUtraFDD.chanBW = openair0_cfg->tx_bw/100e3; - txParams.TxEUtraFDD.earfcn = 3350; - txParams.TxEUtraFDD.maxTxPwr = -100; + txParams.TxEUtraTDD.earfcn = to_earfcn_DL_aw2s(-1,(long long int)openair0_cfg->tx_freq[0],txParams.TxEUtraTDD.chanBW); + txParams.TxEUtraFDD.maxTxPwr = 430-((int)openair0_cfg->tx_gain[0]*10); } - else if (openair0_cfg->duplex_mode == duplex_mode_TDD) { + else if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 1) { + txParams.TxNRFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 0, NULL); + txParams.TxNRFDD.axcW = 1; + txParams.TxNRFDD.axcB = 0; + txParams.TxNRFDD.chanBW = openair0_cfg->tx_bw/100e3; + + txParams.TxNRFDD.AWS_arfcn = to_nrarfcn(openair0_cfg->nr_band,(long long int)openair0_cfg->tx_freq[0],openair0_cfg->nr_scs_for_raster,(uint32_t)openair0_cfg->tx_bw); + txParams.TxNRFDD.maxTxPwr = 430-((int)openair0_cfg->tx_gain[0]*10); + } + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) { txParams.TxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 0, NULL); txParams.TxEUtraTDD.axcW = 1; txParams.TxEUtraTDD.axcB = 0; txParams.TxEUtraTDD.chanBW = openair0_cfg->tx_bw/100e3; txParams.TxEUtraTDD.earfcn = to_earfcn_DL_aw2s(-1,(long long int)openair0_cfg->tx_freq[0],txParams.TxEUtraTDD.chanBW); txParams.TxEUtraTDD.maxTxPwr = 430-((int)openair0_cfg->tx_gain[0]*10); - txParams.TxEUtraTDD.tddULDLConfig = 1; - txParams.TxEUtraTDD.tddSpecialSFConfig = 0; - txParams.TxEUtraTDD.tddCPLengthDL = ORI_tddCPLength_Normal; - printf("AW2S: Configuring for TDD, EARFCN %u, Power %d, BW %d\n", + printf("AW2S: Configuring for LTE TDD, EARFCN %u, Power %d, BW %d\n", txParams.TxEUtraTDD.earfcn,txParams.TxEUtraTDD.maxTxPwr,txParams.TxEUtraTDD.chanBW); } + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 1) { + txParams.TxNRTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 0, NULL); + txParams.TxNRTDD.axcW = 1; + txParams.TxNRTDD.axcB = 0; + txParams.TxNRTDD.chanBW = openair0_cfg->tx_bw/100e3; + txParams.TxNRTDD.AWS_arfcn = to_nrarfcn(openair0_cfg->nr_band,(long long int)openair0_cfg->tx_freq[0],openair0_cfg->nr_scs_for_raster,(uint32_t)openair0_cfg->tx_bw); + txParams.TxNRTDD.maxTxPwr = 430-((int)openair0_cfg->tx_gain[0]*10); + + printf("AW2S: Configuring for NR TDD, NRARFCN %u, Power %d, BW %d\n", + txParams.TxNRTDD.AWS_arfcn,txParams.TxNRTDD.maxTxPwr,txParams.TxNRTDD.chanBW); + } else { aw2s_oricleanup(device); return -1; @@ -499,28 +605,51 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx0, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams0.TxEUtraFDD/TDD) failed with error: %s (%s,%s,%s,%s,%s,%s,%s,%s,%s\n", ORI_Result_Print(result), + printf("ORI_ObjectCreation (txParams0.TxEUtra/NRFDD/TDD) failed with error: %s (%s,%s,%s,%s,%s,%s\n", ORI_Result_Print(RE_result), ORI_Result_Print(txParamResult[0]), ORI_Result_Print(txParamResult[1]), ORI_Result_Print(txParamResult[2]), ORI_Result_Print(txParamResult[3]), ORI_Result_Print(txParamResult[4]), - ORI_Result_Print(txParamResult[5]), - ORI_Result_Print(txParamResult[6]), - ORI_Result_Print(txParamResult[7]), - ORI_Result_Print(txParamResult[8])); + ORI_Result_Print(txParamResult[5])); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (txParams0.TxEUtraFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (txParams0.TxEUtra/NRFDD/TDD): %s\n", ORI_Result_Print(RE_result)); /* Create tx1 */ if (openair0_cfg->tx_num_channels > 1) { ORI_Object_s * tx1; - if (openair0_cfg->duplex_mode ==duplex_mode_FDD) txParams.TxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); - else txParams.TxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); + if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 0) + txParams.TxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 1) + txParams.TxNRFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) + txParams.TxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 1) + txParams.TxNRTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx1, &RE_result); + if(RE_result != ORI_Result_SUCCESS) + { + printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + aw2s_oricleanup(device); + return -1; + } + printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + } + + if (openair0_cfg->tx_num_channels > 2) { + ORI_Object_s * tx2; + if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 0) + txParams.TxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 2, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 1) + txParams.TxNRFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 2, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) + txParams.TxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 2, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 1) + txParams.TxNRTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 2, NULL); + result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx2, &RE_result); if(RE_result != ORI_Result_SUCCESS) { printf("ORI_ObjectCreation (txParams1.TxEUtraFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); @@ -529,7 +658,25 @@ int aw2s_oriinit(openair0_device *device) { } printf("ORI_ObjectCreation (txParams1.TxEUtraFDD/TDD): %s\n", ORI_Result_Print(RE_result)); } - + if (openair0_cfg->tx_num_channels == 4) { + ORI_Object_s * tx3; + if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 0) + txParams.TxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 3, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 1) + txParams.TxNRFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 3, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) + txParams.TxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 3, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 1) + txParams.TxNRTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 3, NULL); + result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx3, &RE_result); + if(RE_result != ORI_Result_SUCCESS) + { + printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + aw2s_oricleanup(device); + return -1; + } + printf("ORI_ObjectCreation (txParams3.TxEUtra/NRFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + } /******************************************************************* @@ -537,42 +684,55 @@ int aw2s_oriinit(openair0_device *device) { *******************************************************************/ /* Prepare parameters */ - ORI_ObjectTypeRef_s rxTypeRef = { NULL, openair0_cfg->duplex_mode == duplex_mode_FDD ? ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD}; - ORI_ObjectParams_u rxParams,rxParams1; - ORI_ObjectParam_e rxParamList[8] = { ORI_ObjectParam_SigPath_antPort, ORI_ObjectParam_SigPath_axcW, ORI_ObjectParam_SigPath_axcB, + ORI_ObjectTypeRef_s rxTypeRef = { NULL, openair0_cfg->duplex_mode == duplex_mode_FDD ? + (openair0_cfg->nr_flag == 0 ? ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxNRFDD ) : + (openair0_cfg->nr_flag == 0 ? ORI_ObjectType_RxEUtraTDD : ORI_ObjectType_RxNRTDD)}; + ORI_ObjectParams_u rxParams; + ORI_ObjectParam_e rxParamList[5] = { ORI_ObjectParam_SigPath_antPort, ORI_ObjectParam_SigPath_axcW, ORI_ObjectParam_SigPath_axcB, ORI_ObjectParam_SigPath_chanBW, ORI_ObjectParam_SigPath_earfcn }; - ORI_Result_e rxParamResult[8]; + ORI_Result_e rxParamResult[5]; int num_rxparams = 5; - if (openair0_cfg->duplex_mode == duplex_mode_TDD) { - rxParamList[5] = ORI_ObjectParam_SigPath_tddULDLConfig; - rxParamList[6] = ORI_ObjectParam_SigPath_tddSpecialSFConfig; - rxParamList[7] = ORI_ObjectParam_RxSigPath_tddCPLengthUL; - num_rxparams = 8; - } /* Create rx0 */ ORI_Object_s * rx0; - if (openair0_cfg->duplex_mode == duplex_mode_FDD) { + if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 0) { rxParams.RxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 0, NULL); rxParams.RxEUtraFDD.axcW = 1; rxParams.RxEUtraFDD.axcB = 0; - rxParams.RxEUtraFDD.chanBW = 200; - rxParams.RxEUtraFDD.earfcn = 21350; + rxParams.RxEUtraFDD.chanBW = txParams.TxEUtraFDD.chanBW; + rxParams.RxEUtraFDD.earfcn = to_earfcn_UL_aw2s(-1,(long long int)openair0_cfg->rx_freq[0],txParams.TxEUtraFDD.chanBW); result = ORI_ObjectCreation(ori, rxTypeRef, rxParams, rxParamList, num_rxparams, rxParamResult, &rx0, &RE_result); } - else { + else if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 1) { + rxParams.RxNRFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 0, NULL); + rxParams.RxNRFDD.axcW = 1; + rxParams.RxNRFDD.axcB = 0; + rxParams.RxNRFDD.chanBW = txParams.TxNRFDD.chanBW; + rxParams.RxNRFDD.AWS_arfcn = to_nrarfcn(openair0_cfg->nr_band,(long long int)openair0_cfg->rx_freq[0],openair0_cfg->nr_scs_for_raster,openair0_cfg->rx_bw); + result = ORI_ObjectCreation(ori, rxTypeRef, rxParams, rxParamList, num_rxparams, rxParamResult, &rx0, &RE_result); + } + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) { rxParams.RxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 0, NULL); rxParams.RxEUtraTDD.axcW = 1; rxParams.RxEUtraTDD.axcB = 0; rxParams.RxEUtraTDD.chanBW = txParams.TxEUtraTDD.chanBW; rxParams.RxEUtraTDD.earfcn = txParams.TxEUtraTDD.earfcn; - rxParams.RxEUtraTDD.tddULDLConfig = 1; - rxParams.RxEUtraTDD.tddSpecialSFConfig = 1; - rxParams.RxEUtraTDD.tddCPLengthUL = ORI_tddCPLength_Normal; printf("AW2S: Creating RX0 for EARFCN %d\n",rxParams.RxEUtraTDD.earfcn); result = ORI_ObjectCreation(ori, rxTypeRef, rxParams, rxParamList, num_rxparams, rxParamResult, &rx0, &RE_result); + } + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 1) { + rxParams.RxNRTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 0, NULL); + rxParams.RxNRTDD.axcW = 1; + rxParams.RxNRTDD.axcB = 0; + rxParams.RxNRTDD.chanBW = txParams.TxNRTDD.chanBW; + rxParams.RxNRTDD.AWS_arfcn = txParams.TxNRTDD.AWS_arfcn; + + printf("AW2S: Creating RX0 for NRARFCN %d\n",rxParams.RxNRTDD.AWS_arfcn); + + result = ORI_ObjectCreation(ori, rxTypeRef, rxParams, rxParamList, num_rxparams, rxParamResult, &rx0, &RE_result); + } if(result != ORI_Result_SUCCESS) @@ -581,27 +741,78 @@ int aw2s_oriinit(openair0_device *device) { aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (rxParams0.RxEUtraFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (rxParams0.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); if (openair0_cfg->rx_num_channels > 1) { /* Create rx1 */ ORI_Object_s * rx1; - memcpy((void*)&rxParams1,(void*)&rxParams,sizeof(rxParams)); - if (openair0_cfg->duplex_mode == duplex_mode_FDD) rxParams1.RxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); - else rxParams1.RxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); + if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 0) + rxParams.RxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 1) + rxParams.RxNRFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) + rxParams.RxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 1) + rxParams.RxNRTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 1, NULL); - result = ORI_ObjectCreation(ori, rxTypeRef, rxParams1, rxParamList, num_rxparams, rxParamResult, &rx1, &RE_result); + result = ORI_ObjectCreation(ori, rxTypeRef, rxParams, rxParamList, num_rxparams, rxParamResult, &rx1, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (rxParams1.RxEUtraFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (rxParams1.RxEUtraFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } + if (openair0_cfg->rx_num_channels > 2) { + /* Create rx2 */ + ORI_Object_s * rx2; + if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 0) + rxParams.RxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 2, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 1) + rxParams.RxNRFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 2, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) + rxParams.RxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 2, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 1) + rxParams.RxNRTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 2, NULL); + + result = ORI_ObjectCreation(ori, rxTypeRef, rxParams, rxParamList, num_rxparams, rxParamResult, &rx2, &RE_result); + + + if(result != ORI_Result_SUCCESS) + { + printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + aw2s_oricleanup(device); + return -1; + } + printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); + } + if (openair0_cfg->rx_num_channels > 3) { + /* Create rx3 */ + ORI_Object_s * rx3; + if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 0) + rxParams.RxEUtraFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 3, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_FDD && openair0_cfg->nr_flag == 1) + rxParams.RxNRFDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 3, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 0) + rxParams.RxEUtraTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 3, NULL); + else if (openair0_cfg->duplex_mode == duplex_mode_TDD && openair0_cfg->nr_flag == 1) + rxParams.RxNRTDD.antPort = ORI_FindObject(ori, ORI_ObjectType_AntennaPort, 3, NULL); + + result = ORI_ObjectCreation(ori, rxTypeRef, rxParams, rxParamList, num_rxparams, rxParamResult, &rx3, &RE_result); + + + if(result != ORI_Result_SUCCESS) + { + printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + aw2s_oricleanup(device); + return -1; + } + printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); + } /* Create link */ ORI_ObjectParams_u linkParams; diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 0c71a9999a..5c6ff2c669 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -237,6 +237,12 @@ typedef struct { double tx_sample_rate; //! check for threequarter sampling rate int8_t threequarter_fs; + //! Flag to indicate this configuration is for NR + int nr_flag; + //! NR band number + int nr_band; + //! NR scs for raster + int nr_scs_for_raster; } openair0_config_t; /*! \brief RF mapping */ From 4756c5a167391b019341b97b5dff7484de250eaa Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 13 Feb 2022 22:15:48 +0100 Subject: [PATCH 433/883] added configurable "sf_ahead" for NR/LTE in RU section. Tested in NR with sf_ahead=2 (normally 3) --- executables/nr-gnb.c | 1 - executables/nr-ru.c | 17 +++++++---------- executables/nr-softmodem.c | 6 +++++- nfapi/oai_integration/nfapi_vnf.c | 8 ++++---- nfapi/open-nFAPI/pnf/src/pnf_p7.c | 3 +-- openair1/PHY/defs_RU.h | 2 ++ openair2/ENB_APP/enb_paramdef.h | 7 +++++-- openair2/LAYER2/NR_MAC_gNB/config.c | 3 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 5 +++-- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 10 ++++------ openair2/NR_PHY_INTERFACE/NR_IF_Module.h | 1 + openair2/PHY_INTERFACE/IF_Module.c | 2 +- targets/RT/USER/lte-enb.c | 14 ++++++-------- targets/RT/USER/lte-ru.c | 18 +++++++++--------- targets/RT/USER/lte-softmodem.c | 1 - 15 files changed, 49 insertions(+), 49 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 2b1c36407b..da76e07741 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -129,7 +129,6 @@ void rx_func(void *param) { int slot_rx = info->slot_rx; int frame_tx = info->frame_tx; int slot_tx = info->slot_tx; - sl_ahead = sf_ahead*gNB->frame_parms.slots_per_subframe; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; start_meas(&softmodem_stats_rxtx_sf); diff --git a/executables/nr-ru.c b/executables/nr-ru.c index e4fc3bc27c..5de1f71efd 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -99,9 +99,6 @@ int attach_rru(RU_t *ru); int connect_rau(RU_t *ru); static void NRRCconfig_RU(void); -uint16_t sf_ahead; -uint16_t slot_ahead; -uint16_t sl_ahead; extern int emulate_rf; extern int numerology; @@ -372,8 +369,8 @@ void fh_if4p5_south_in(RU_t *ru, proc->frame_rx = f; proc->timestamp_rx = (proc->frame_rx * fp->samples_per_subframe * 10) + fp->get_samples_slot_timestamp(proc->tti_rx, fp, 0); // proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_subframe); - proc->tti_tx = (sl+(fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame; - proc->frame_tx = (sl>(fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (f+1)&1023 : f; + proc->tti_tx = (sl+(fp->slots_per_subframe*ru->sf_ahead))%fp->slots_per_frame; + proc->frame_tx = (sl>(fp->slots_per_frame-1-(fp->slots_per_subframe*ru->sf_ahead))) ? (f+1)&1023 : f; if (proc->first_rx == 0) { if (proc->tti_rx != *slot) { @@ -1293,8 +1290,7 @@ void *ru_thread( void *param ) { } } - sf_ahead = (uint16_t) ceil((float)6/(0x01<numerology_index)); - LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,sf_ahead); + LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,ru->sf_ahead); pthread_mutex_lock(&RC.ru_mutex); RC.ru_mask &= ~(1<idx); pthread_cond_signal(&RC.ru_cond); @@ -1380,9 +1376,9 @@ void *ru_thread( void *param ) { opp_enabled = opp_enabled0; } if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul); - proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); - proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; - proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame; + proc->timestamp_tx = proc->timestamp_rx + (ru->sf_ahead*fp->samples_per_subframe); + proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*ru->sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; + proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*ru->sf_ahead))%fp->slots_per_frame; LOG_D(PHY,"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0]:[RX:%d%d TX(SFN):%d]\n", frame,slot, proc->frame_rx,proc->tti_rx, @@ -2126,6 +2122,7 @@ static void NRRCconfig_RU(void) { RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr); RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr); RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr); + RC.ru[j]->sf_ahead = *(RUParamList.paramarray[j][RU_SF_AHEAD].iptr); RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; for (i=0; inum_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; RC.ru[j]->openair0_cfg.nr_flag = *(RUParamList.paramarray[j][RU_NR_FLAG].iptr); diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 5f57919645..6d59137f80 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -764,7 +764,7 @@ int main( int argc, char **argv ) { printf("wait_gNBs()\n"); wait_gNBs(); printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU); - + int sl_ahead=6; if (RC.nb_RU >0) { printf("Initializing RU threads\n"); init_NR_RU(get_softmodem_params()->rf_config_file); @@ -772,7 +772,10 @@ int main( int argc, char **argv ) { for (ru_id=0; ru_idrf_map.card=0; RC.ru[ru_id]->rf_map.chain=CC_id+chain_offset; + if (ru_id==0) sl_ahead = RC.ru[ru_id]->sf_ahead * RC.gNB[0]->frame_parms.slots_per_subframe; + else AssertFatal(RC.ru[ru_id]->sf_ahead != RC.ru[0]->sf_ahead,"RU %d has different sf_ahead %d than RU 0 %d\n",RC.ru[ru_id]->sf_ahead,RC.ru[0]->sf_ahead); } + } config_sync_var=0; @@ -789,6 +792,7 @@ int main( int argc, char **argv ) { // once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration) printf("ALL RUs ready - init gNBs\n"); + for (int idx=0;idxif_inst->sl_ahead = sl_ahead; if(IS_SOFTMODEM_DOSCOPE) { sleep(1); scopeParms_t p; diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 44ee05940f..87fd3c8e19 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -200,7 +200,6 @@ void install_nr_schedule_handlers(NR_IF_Module_t *if_inst); void install_schedule_handlers(IF_Module_t *if_inst); extern int single_thread_flag; extern uint16_t sf_ahead; -extern uint16_t slot_ahead; void oai_create_enb(void) { int bodge_counter=0; @@ -459,6 +458,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) { //wait.tv_nsec = 0; // wake up TX for subframe n+sf_ahead // lock the TX mutex and make sure the thread is ready + AssertFatal(gNB->if_inst->sl_ahead==6,"gNB->if_inst->sl_ahead %d : This is hard-coded to 6 in nfapi P7!!!\n",gNB->if_inst->sl_ahead); if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) { LOG_E( PHY, "[gNB] ERROR pthread_mutex_lock for gNB RXTX thread %d (IC %d)\n", L1_proc->slot_rx&1,L1_proc->instance_cnt ); exit_fun( "error locking mutex_rxtx" ); @@ -485,11 +485,11 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) { // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - L1_proc->timestamp_tx = proc->timestamp_rx + (slot_ahead *fp->samples_per_subframe); + L1_proc->timestamp_tx = proc->timestamp_rx + (gNB->if_inst->sl_ahead *fp->samples_per_subframe); L1_proc->frame_rx = proc->frame_rx; L1_proc->slot_rx = proc->slot_rx; - L1_proc->frame_tx = (L1_proc->slot_rx > (19-slot_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; - L1_proc->slot_tx = (L1_proc->slot_rx + slot_ahead)%20; + L1_proc->frame_tx = (L1_proc->slot_rx > (19-gNB->if_inst->sl_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->slot_tx = (L1_proc->slot_rx + gNB->if_inst->sl_ahead)%20; //LOG_I(PHY, "sfn/sf:%d%d proc[rx:%d%d] rx:%d%d] About to wake rxtx thread\n\n", sfn, slot, proc->frame_rx, proc->slot_rx, L1_proc->frame_rx, L1_proc->slot_rx); //NFAPI_TRACE(NFAPI_TRACE_INFO, "\nEntering wake_gNB_rxtx sfn %d slot %d\n",L1_proc->frame_rx,L1_proc->slot_rx); diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index fb1a713e56..0ce847a735 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -32,7 +32,6 @@ #define FAPI2_IP_DSCP 0 extern uint16_t sf_ahead; -extern uint16_t slot_ahead; //uint16_t sf_ahead=4; @@ -933,7 +932,7 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl // save the curren time, sfn and slot pnf_p7->slot_start_time_hr = pnf_get_current_time_hr(); - slot_ahead = 6; + int slot_ahead = 6; uint32_t sfn_slot_tx = sfnslot_add_slot(sfn, slot, slot_ahead); uint16_t sfn_tx = NFAPI_SFNSLOT2SFN(sfn_slot_tx); uint8_t slot_tx = NFAPI_SFNSLOT2SLOT(sfn_slot_tx); diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 76dd92ef5d..5dfb0722db 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -506,6 +506,8 @@ typedef struct RU_t_s { int att_tx; /// flag to indicate precoding operation in RU int do_precoding; + /// TX processing advance in subframes + int sf_ahead; /// FAPI confiuration nfapi_nr_config_request_scf_t config; /// Frame parameters diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 2757e408d9..840e1a8ab2 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -99,6 +99,7 @@ typedef enum { #define CONFIG_STRING_RU_IF_FREQUENCY "if_freq" #define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset" #define CONFIG_STRING_RU_DO_PRECODING "do_precoding" +#define CONFIG_STRING_RU_SF_AHEAD "sf_ahead" #define CONFIG_STRING_RU_NR_FLAG "nr_flag" #define CONFIG_STRING_RU_NR_SCS_FOR_RASTER "nr_scs_for_raster" @@ -131,8 +132,9 @@ typedef enum { #define RU_IF_FREQUENCY 26 #define RU_IF_FREQ_OFFSET 27 #define RU_DO_PRECODING 28 -#define RU_NR_FLAG 29 -#define RU_NR_SCS_FOR_RASTER 30 +#define RU_SF_AHEAD 29 +#define RU_NR_FLAG 30 +#define RU_NR_SCS_FOR_RASTER 31 /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -167,6 +169,7 @@ typedef enum { {CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \ {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_SF_AHEAD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_FLAG, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_SCS_FOR_RASTER, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index bbec4817bd..92db25178a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -423,7 +423,6 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts } -extern uint16_t sl_ahead; int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, @@ -453,7 +452,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, * variable sl_ahead seems to not be correctly initialized, but I leave * it for information purposes here (the fix would always put 0, what * happens now, too) */ - req->SFN = i < sl_ahead; + req->SFN = i < RC.nrmac[Mod_idP]->if_inst->sl_ahead; req->Slot = i; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 0c935eea09..4ddffc5184 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -400,7 +400,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, uint16_t monitoring_slot_period, uint16_t monitoring_offset,uint8_t beam_index, uint8_t num_active_ssb, - int16_t *tdd_beam_association){ + int16_t *tdd_beam_association, int sl_ahead){ // preferentially we schedule the msg2 in the mixed slot or in the last dl slot // if they are allowed by search space configuration @@ -628,7 +628,8 @@ void nr_initiate_ra_proc(module_id_t module_idP, monitoring_offset, beam_index, cc->num_active_ssb, - nr_mac->tdd_beam_association); + nr_mac->tdd_beam_association, + nr_mac->if_inst->sl_ahead); ra->Msg2_frame = msg2_frame; ra->Msg2_slot = msg2_slot; diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 57bb411dcc..46394e7c7a 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -57,8 +57,6 @@ extern int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind); extern int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind); extern int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind); extern uint8_t nfapi_mode; -extern uint16_t sf_ahead; -extern uint16_t sl_ahead; void handle_nr_rach(NR_UL_IND_t *UL_info) @@ -472,14 +470,14 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { nfapi_nr_config_request_scf_t *cfg = &mac->config[CC_id]; int spf = get_spf(cfg); gNB_dlsch_ulsch_scheduler(module_id, - (UL_info->frame+((UL_info->slot>(spf-1-sl_ahead))?1:0)) % 1024, - (UL_info->slot+sl_ahead)%spf); + (UL_info->frame+((UL_info->slot>(spf-1-ifi->sl_ahead))?1:0)) % 1024, + (UL_info->slot+ifi->sl_ahead)%spf); ifi->CC_mask = 0; sched_info->module_id = module_id; sched_info->CC_id = CC_id; - sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-sl_ahead)) ? 1 : 0)) % 1024; - sched_info->slot = (UL_info->slot+sl_ahead)%spf; + sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-ifi->sl_ahead)) ? 1 : 0)) % 1024; + sched_info->slot = (UL_info->slot+ifi->sl_ahead)%spf; sched_info->DL_req = &mac->DL_req[CC_id]; sched_info->UL_dci_req = &mac->UL_dci_req[CC_id]; diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h index f857151763..9d543b0918 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.h @@ -115,6 +115,7 @@ typedef struct NR_IF_Module_s { uint16_t current_frame; uint8_t current_slot; pthread_mutex_t if_mutex; + int sl_ahead; } NR_IF_Module_t; /*Initial */ diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index fba9e1d8b6..68d390f097 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -16,7 +16,7 @@ extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind); extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind); extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); -extern uint16_t sf_ahead; +int sf_ahead=4; extern UL_RCC_IND_t UL_RCC_INFO; extern RAN_CONTEXT_t RC; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 0b6b0b3a75..49f7db2867 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -112,8 +112,6 @@ extern int transmission_mode; extern int oaisim_flag; -//uint16_t sf_ahead=4; -extern uint16_t sf_ahead; #include "executables/thread-common.h" //extern PARALLEL_CONF_t get_thread_parallel_conf(void); //extern WORKER_CONF_t get_thread_worker_conf(void); @@ -466,11 +464,11 @@ void eNB_top(PHY_VARS_eNB *eNB, if (!oai_exit) { T(T_ENB_MASTER_TICK, T_INT(0), T_INT(ru_proc->frame_rx), T_INT(ru_proc->tti_rx)); - L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); + L1_proc->timestamp_tx = ru_proc->timestamp_rx + (ru->sf_ahead*fp->samples_per_tti); L1_proc->frame_rx = ru_proc->frame_rx; L1_proc->subframe_rx = ru_proc->tti_rx; - L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; - L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-ru->sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + ru->sf_ahead)%10; if (rxtx(eNB,L1_proc,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id); @@ -614,11 +612,11 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB, // The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti, // and proc->subframe_tx = proc->subframe_rx+sf_ahead - L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti); + L1_proc->timestamp_tx = ru_proc->timestamp_rx + (ru->sf_ahead*fp->samples_per_tti); L1_proc->frame_rx = ru_proc->frame_rx; L1_proc->subframe_rx = ru_proc->tti_rx; - L1_proc->frame_tx = (L1_proc->subframe_rx > (9-sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; - L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10; + L1_proc->frame_tx = (L1_proc->subframe_rx > (9-ru->sf_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; + L1_proc->subframe_tx = (L1_proc->subframe_rx + ru->sf_ahead)%10; LOG_D(PHY,"wakeup_rxtx: L1_proc->subframe_rx %d, L1_proc->subframe_tx %d, RU %d\n",L1_proc->subframe_rx,L1_proc->subframe_tx,ru->idx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_WAKEUP_RXTX_RX_RU+ru->idx, L1_proc->frame_rx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_WAKEUP_RXTX_RX_RU+ru->idx, L1_proc->subframe_rx); diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 8ad610f1af..014e8854e2 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -109,7 +109,6 @@ const char ru_states[6][9] = {"RU_IDLE","RU_CONFIG","RU_READY","RU_RUN","RU_ERRO extern const char NB_functions[7][20]; extern const char NB_timing[2][20]; -extern uint16_t sf_ahead; extern const char ru_if_types[MAX_RU_IF_TYPES][20]; @@ -254,8 +253,8 @@ void fh_if4p5_south_in(RU_t *ru, // proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti); if (get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) { - proc->tti_tx = (sf+sf_ahead)%10; - proc->frame_tx = (sf>(9-sf_ahead)) ? (f+1)&1023 : f; + proc->tti_tx = (sf+ru->sf_ahead)%10; + proc->frame_tx = (sf>(9-ru->sf_ahead)) ? (f+1)&1023 : f; } LOG_D(PHY,"Setting proc for (%d,%d)\n",sf,f); @@ -654,13 +653,13 @@ void rx_rf(RU_t *ru, if (get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD && ru->fh_north_asynch_in == NULL) { #ifdef PHY_TX_THREAD - proc->timestamp_phy_tx = proc->timestamp_rx+((sf_ahead-1)*fp->samples_per_tti); - proc->subframe_phy_tx = (proc->tti_rx+(sf_ahead-1))%10; - proc->frame_phy_tx = (proc->tti_rx>(9-(sf_ahead-1))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; + proc->timestamp_phy_tx = proc->timestamp_rx+((ru->sf_ahead-1)*fp->samples_per_tti); + proc->subframe_phy_tx = (proc->tti_rx+(ru->sf_ahead-1))%10; + proc->frame_phy_tx = (proc->tti_rx>(9-(ru->sf_ahead-1))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; #else - proc->timestamp_tx = proc->timestamp_rx+(sf_ahead*fp->samples_per_tti); - proc->tti_tx = (proc->tti_rx+sf_ahead)%10; - proc->frame_tx = (proc->tti_rx>(9-sf_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx; + proc->timestamp_tx = proc->timestamp_rx+(ru->sf_ahead*fp->samples_per_tti); + proc->tti_tx = (proc->tti_rx+ru->sf_ahead)%10; + proc->frame_tx = (proc->tti_rx>(9-ru->sf_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx; #endif //proc->timestamp_tx = proc->timestamp_rx+(sf_ahead*fp->samples_per_tti); //proc->subframe_tx = (proc->tti_rx+sf_ahead)%10; @@ -3072,6 +3071,7 @@ RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mas ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr); ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); + ru[j]->sf_ahead = *(RUParamList.paramarray[j][RU_SF_AHEAD_IDX].uptr); *ru_mask= (*ru_mask)|(1< Date: Mon, 14 Feb 2022 09:47:34 +0530 Subject: [PATCH 434/883] fixed stacksmashing error --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 875cdf6cdc..d899eab63c 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -79,12 +79,12 @@ char quantize8bit(double D,double x) } typedef struct { - double n_iter_mean[100]; - double n_iter_std[100]; - int n_iter_max[100]; - double snr[100]; - double ber[100]; - double bler[100]; + double n_iter_mean[400]; + double n_iter_std[400]; + int n_iter_max[400]; + double snr[400]; + double ber[400]; + double bler[400]; } n_iter_stats_t; nrLDPC_encoderfunc_t encoder_orig; From 5c9c2783a58791b8f147b7f4cb789eab5ded6853 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 14 Feb 2022 09:49:54 +0530 Subject: [PATCH 435/883] removed crc from ldpctest --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index d899eab63c..081aa39019 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -285,15 +285,6 @@ int test_ldpc(short No_iteration, removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate)); encoder_implemparams_t impp=INIT0_LDPCIMPLEMPARAMS; - // CRC attachement - for (j=0; j>8; - test_input[j][(block_length-24)>>3] = ((uint8_t*)&crc)[2]; - test_input[j][1+((block_length-24)>>3)] = ((uint8_t*)&crc)[1]; - test_input[j][2+((block_length-24)>>3)] = ((uint8_t*)&crc)[0]; - } - impp.gen_code=1; if (ntrials==0) encoder_orig(test_input,channel_input, Zc, BG, block_length, BG, &impp); @@ -415,7 +406,7 @@ int test_ldpc(short No_iteration, //count errors for(j=0;j>3; i++) + for (i=0; i<(block_length)>>3; i++) { //printf("block_length>>3: %d \n",block_length>>3); /// printf("i: %d \n",i); @@ -429,7 +420,7 @@ int test_ldpc(short No_iteration, } } - for (i=0; i>(i&7); test_input_bit[i] = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments From fdc2cb87166d8b7b9aed46cc66d2f7716de095f9 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 14 Feb 2022 13:11:03 +0000 Subject: [PATCH 436/883] Fix pucch resource calculation --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 8 ++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 28 +++++++++++-------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 7 +---- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 16 ++++++++++- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 5 ++++ 5 files changed, 40 insertions(+), 24 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 74414a00b2..97463a406f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1535,13 +1535,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra return; } - int n_rb,rb_offset; - get_coreset_rballoc(coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); - const uint16_t N_cce = n_rb * coreset->duration / NR_NB_REG_PER_CCE; const int delta_PRI=0; - int r_pucch = ((CCEIndex<<1)/N_cce)+(delta_PRI<<1); + int r_pucch = nr_get_pucch_resource(coreset, sched_ctrl->active_ubwp, NULL, CCEIndex); + + 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); - LOG_D(NR_MAC,"[RAPROC] Msg4 r_pucch %d (CCEIndex %d, N_cce %d, nb_of_candidates %d,delta_PRI %d)\n",r_pucch,CCEIndex,N_cce,nr_of_candidates,delta_PRI); int alloc = nr_acknack_scheduling(module_idP, UE_id, frameP, slotP, r_pucch, 1); AssertFatal(alloc>=0,"Couldn't find a pucch allocation for ack nack (msg4)\n"); NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[alloc]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 17277576ac..f3c366ceeb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -557,6 +557,13 @@ bool allocate_dl_retransmission(module_id_t module_id, cg->spCellConfig->spCellConfigDedicated ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; + NR_BWP_UplinkDedicated_t *ubwpd = + cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + NR_BWP_t *genericParameters = NULL; if(sched_ctrl->active_bwp) { genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; @@ -662,12 +669,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH * allocation after CCE alloc fail would be more complex) */ - int n_rb,rb_offset; - get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); - const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE; - const int delta_PRI=0; - int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1); - + int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, sched_ctrl->active_ubwp, ubwpd, CCEIndex); const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, r_pucch, 0); if (alloc<0) { LOG_D(MAC, @@ -792,6 +794,13 @@ void pf_dl(module_id_t module_id, cg->spCellConfig->spCellConfigDedicated ? cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; + NR_BWP_UplinkDedicated_t *ubwpd = + cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const uint16_t rnti = UE_info->rnti[UE_id]; @@ -845,12 +854,7 @@ void pf_dl(module_id_t module_id, /* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH * allocation after CCE alloc fail would be more complex) */ - int n_rb,rb_offset; - get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); - const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE; - const int delta_PRI=0; - int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1); - + int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, sched_ctrl->active_ubwp, ubwpd, CCEIndex); const int alloc = nr_acknack_scheduling(module_id, UE_id, 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 ce97a483e8..21248c9b9e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -361,12 +361,7 @@ void nr_preprocessor_phytest(module_id_t module_id, __func__, UE_id); - int n_rb,rb_offset; - get_coreset_rballoc(sched_ctrl->coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); - const uint16_t N_cce = n_rb * sched_ctrl->coreset->duration / NR_NB_REG_PER_CCE; - const int delta_PRI=0; - int r_pucch = ((sched_ctrl->cce_index<<1)/N_cce)+(delta_PRI<<1); - + int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, sched_ctrl->active_ubwp, NULL, CCEIndex); const int alloc = nr_acknack_scheduling(module_id, UE_id, frame, slot, r_pucch, 0); if (alloc < 0) { LOG_D(MAC, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index e8171ead15..111fc1197a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -930,6 +930,20 @@ void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu, pdcch_pdu->precoderGranularity = coreset->precoderGranularity; } +int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset, + NR_BWP_Uplink_t *bwp, + NR_BWP_UplinkDedicated_t *bwpd, + int CCEIndex) { + int r_pucch = -1; + if(bwp == NULL && bwpd == NULL) { + int n_rb,rb_offset; + get_coreset_rballoc(coreset->frequencyDomainResources.buf,&n_rb,&rb_offset); + const uint16_t N_cce = n_rb * coreset->duration / NR_NB_REG_PER_CCE; + const int delta_PRI=0; + r_pucch = ((CCEIndex<<1)/N_cce)+(delta_PRI<<1); + } + return r_pucch; +} // This function configures pucch pdu fapi structure void nr_configure_pucch(module_id_t module_id, @@ -1026,7 +1040,7 @@ void nr_configure_pucch(module_id_t module_id, pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); pucch_pdu->subcarrier_spacing = genericParameters->subcarrierSpacing; pucch_pdu->cyclic_prefix = (genericParameters->cyclicPrefix==NULL) ? 0 : *genericParameters->cyclicPrefix; - if (bwp || bwpd) { + if (r_pucch<0 || bwp ){ LOG_D(NR_MAC,"pucch_acknak: Filling dedicated configuration for PUCCH\n"); // we have either a dedicated BWP or Dedicated PUCCH configuration on InitialBWP AssertFatal(bwp!=NULL || bwpd!=NULL,"We need one dedicated configuration for a BWP (neither additional or initial BWP has a dedicated configuration)\n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index b7a463f24f..6c6e4a7242 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -236,6 +236,11 @@ int nr_is_dci_opportunity(nfapi_nr_search_space_t search_space, nfapi_nr_config_request_scf_t cfg); */ +int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset, + NR_BWP_Uplink_t *bwp, + NR_BWP_UplinkDedicated_t *bwpd, + int CCEIndex); + void nr_configure_pucch(module_id_t module_id, nfapi_nr_pucch_pdu_t* pucch_pdu, NR_ServingCellConfigCommon_t *scc, From 7e1b38db13145da2b91db5ae69dae7bec962be0b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 14 Feb 2022 14:03:05 +0000 Subject: [PATCH 437/883] Fix segmentation fault in phy-test --- openair2/LAYER2/NR_MAC_gNB/config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index aaf40afbee..91f50ee59d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -537,7 +537,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, if (CellGroup) { - calculate_preferred_dl_tda(Mod_idP, NULL); + if (!get_softmodem_params()->phy_test) { + calculate_preferred_dl_tda(Mod_idP, NULL); + } const NR_ServingCellConfig_t *servingCellConfig = NULL; if(CellGroup->spCellConfig && CellGroup->spCellConfig->spCellConfigDedicated) { From ca1afb4aae67a6ea83e52bc794e3ee140f8c2be2 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 14 Feb 2022 15:01:36 +0100 Subject: [PATCH 438/883] fix bidir test for ltebox --- ci-scripts/cls_oaicitest.py | 15 +++++++++++++-- ci-scripts/xml_files/fr1_nsa_quectel.xml | 10 ---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 5d2c462ca7..5d89a7b2e0 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -2505,10 +2505,15 @@ class OaiCiTest(): SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'killall --signal=SIGKILL iperf' SSH.command(cmd,'\$',5) + cmd = 'killall --signal=SIGKILL iperf3' + SSH.command(cmd,'\$',5) SSH.close() SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) cmd = 'killall --signal=SIGKILL iperf' SSH.command(cmd,'\$',5) + SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) + cmd = 'killall --signal=SIGKILL iperf3' + SSH.command(cmd,'\$',5) SSH.close() @@ -2561,9 +2566,12 @@ class OaiCiTest(): self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1) elif self.iperf_direction=="BIDIR": logging.debug("Iperf for Module in BIDIR mode detected") + server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' + client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' + + #server side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) - server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' cmd = 'rm ' + server_filename SSH.command(cmd,'\$',5) cmd = 'echo $USER; nohup iperf3 -s 2>&1 > '+server_filename+' &' @@ -2572,7 +2580,6 @@ class OaiCiTest(): #client side UE SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) - client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' cmd = 'rm ' + client_filename SSH.command(cmd,'\$',5) SSH.command('iperf3 -c 192.172.0.1 ' + self.iperf_args + ' 2>&1 > '+client_filename, '\$', int(iperf_time)*5.0) @@ -2590,10 +2597,14 @@ class OaiCiTest(): SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'killall --signal=SIGKILL iperf' SSH.command(cmd,'\$',5) + cmd = 'killall --signal=SIGKILL iperf3' + SSH.command(cmd,'\$',5) SSH.close() SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) cmd = 'killall --signal=SIGKILL iperf' SSH.command(cmd,'\$',5) + cmd = 'killall --signal=SIGKILL iperf3' + SSH.command(cmd,'\$',5) SSH.close() return diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 574286fbc2..55f6f4376e 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -37,8 +37,6 @@ 070003 070002 000001 - 070002 - 000001 050000 050001 010002 @@ -157,14 +155,6 @@ single-ue - - Iperf - iperf (BIDIR TCP)(10 sec)(single-ue profile) - -t 10 --bidir - BIDIR - idefix - single-ue - Terminate_eNB From a427a201863b43b539dbe46c51f5fab02d9f3c07 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 14 Feb 2022 16:25:54 +0100 Subject: [PATCH 439/883] add tcp bidir to nsa 2x2 --- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 5c53bf5eed..2476a75427 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -36,6 +36,7 @@ 000002 070000 070001 + 070002 000001 010002 080001 @@ -132,6 +133,16 @@ single-ue + + Iperf + iperf (BIDIR TCP)(10 sec)(single-ue profile) + -t 10 --bidir + BIDIR + nrmodule2_quectel + single-ue + + + Terminate_eNB From f1260a09e6365d52f325228c03d55f78c51dcdb5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 14 Feb 2022 17:40:57 +0100 Subject: [PATCH 440/883] some fixes for phy-test mode --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 +++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 4 +++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index e9672144c2..fddf084a38 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -519,12 +519,14 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ sched_ctrl->coreset, Y); - if (sched_ctrl->cce_index < 0) { + if (CCEIndex < 0) { LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PUSCH\n", __func__); nr_mac->pdcch_cand[cid]--; return false; } + sched_ctrl->cce_index = CCEIndex; + const int mcs = target_ul_mcs; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = mcs; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index d3b6d1c24a..90c6e04a5d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -579,7 +579,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ps->nrOfLayers = 1; } else { - if (ps->nrOfLayers != layers) { + if (ps->nrOfLayers != layers || + ps->numDmrsCdmGrpsNoData == 0) { reset_dmrs = true; ps->nrOfLayers = layers; set_dl_dmrs_ports(ps); @@ -587,6 +588,7 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, } ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); + if (reset_dmrs) { ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type, ps->frontloaded_symb); ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 1374e584de..c757479a41 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -711,8 +711,9 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_info->mac_stats[UE_id].ulsch_DTX++; } if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { - LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", - UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); + if (get_softmodem_params()->phy_test==0) + LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", + UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; nr_mac_gNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } From ec4ae32af0c8aad9a7101d6a74a647125a32d4a5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 10 Feb 2022 16:59:09 +0100 Subject: [PATCH 441/883] N1 N2 and XP for DL antenna ports in config file --- ci-scripts/conf_files/benetel-5g.conf | 4 +-- ci-scripts/conf_files/gNB_SA_DU.conf | 2 -- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 2 +- .../gnb.band261.tm1.32PRB.usrpn300.conf | 2 -- .../gnb.band66.tm1.106PRB.usrpn300.conf | 2 -- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 2 +- ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 -- ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 8 +++--- .../gnb.band78.tm1.106PRB.usrpn300.conf | 2 -- .../gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 2 -- .../gnb.band78.tm1.fr1.106PRB.usrpn310.conf | 2 -- openair1/PHY/defs_gNB.h | 3 +++ openair1/SIMULATION/NR_PHY/dlsim.c | 14 +++++++--- openair1/SIMULATION/NR_PHY/ulsim.c | 11 +++++--- openair2/COMMON/rrc_messages_types.h | 4 ++- openair2/GNB_APP/gnb_config.c | 24 +++++++++++++---- openair2/GNB_APP/gnb_paramdef.h | 26 ++++++++++++------- openair2/LAYER2/NR_MAC_gNB/config.c | 18 +++++++------ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 8 +++--- openair2/RRC/NR/MESSAGES/asn1_msg.c | 9 ------- openair2/RRC/NR/nr_rrc_defs.h | 7 ++++- openair2/RRC/NR/nr_rrc_proto.h | 4 +-- openair2/RRC/NR/rrc_gNB.c | 4 ++- openair2/RRC/NR/rrc_gNB_nsa.c | 4 +-- openair2/RRC/NR/rrc_gNB_reconfig.c | 6 +++-- .../GENERIC-LTE-EPC/CONF/benetel-5g.conf | 2 -- .../CONF/gnb.band257.tm1.32PRB.usrpn300.conf | 2 -- .../CONF/gnb.band257.tm1.32PRB.usrpx300.conf | 2 -- .../CONF/gnb.band257.tm1.66PRB.usrpn300.conf | 4 +-- .../CONF/gnb.band261.tm1.32PRB.usrpn300.conf | 2 -- .../CONF/gnb.band66.tm1.106PRB.usrpn300.conf | 2 -- .../CONF/gnb.band66.tm1.106PRB.usrpx300.conf | 2 -- .../gnb.band78.106PRB.30kHz,usrpb2x0.conf | 2 -- .../CONF/gnb.band78.106PRB.slave.conf | 4 +-- .../CONF/gnb.band78.slave.conf | 2 -- .../gnb.band78.tm1.106PRB.PTRS.usrpx300.conf | 2 -- .../CONF/gnb.band78.tm1.106PRB.usrpb210.conf | 4 +-- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 2 -- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 2 -- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 2 -- .../CONF/gnb.band78.tm1.217PRB.usrpx300.conf | 4 +-- .../CONF/gnb.band78.tm1.24PRB.usrpb210.conf | 4 +-- .../CONF/gnb.band78.tm1.24PRB.usrpn300.conf | 4 +-- .../CONF/gnb.band78.tm1.24PRB.usrpx300.conf | 2 -- .../CONF/gnb.band78.tm1.273PRB.usrpn300.conf | 2 -- .../CONF/rcc.band78.tm1.106PRB.nfapi.conf | 2 -- .../GENERIC-LTE-EPC/CONF/testing_gnb.conf | 2 -- .../CONF/testing_gnb_24PRB.conf | 2 -- .../CONF/testing_gnb_n310.conf | 2 -- .../CONF/testing_gnb_nsa_n310.conf | 2 -- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 2 -- ...b.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 2 -- .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 -- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 2 -- ...b.sa.band78.fr1.106PRB.usrpb210.sabox.conf | 2 -- ...gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 4 +-- 59 files changed, 107 insertions(+), 147 deletions(-) diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf index dc86567c1f..68985e46f8 100644 --- a/ci-scripts/conf_files/benetel-5g.conf +++ b/ci-scripts/conf_files/benetel-5g.conf @@ -22,9 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - + servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index adcbcd45d0..d9abb5b395 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -37,8 +37,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; sib1_tda = 0; diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index e3bdde8469..b40403894d 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -38,7 +38,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; + pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; pdcch_ConfigSIB1 = ( diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 3955b1542e..5f6a5c55cd 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -39,7 +39,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; + pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; pdcch_ConfigSIB1 = ( diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index dd9c210c0d..e11e153b02 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; servingCellConfigCommon = ( diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf index 2400136f9f..dbdbfe97f5 100644 --- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; servingCellConfigCommon = ( diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index adb79ceb8d..f9cf916755 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -20,7 +20,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; + pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; pusch_TargetSNRx10 = 200; pucch_TargetSNRx10 = 200; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index b71bd3acd9..bf388e23f7 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -38,7 +38,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; + pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; ul_prbblacklist = "51,52,53,54" do_SRS = 1; diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 32a40fe951..1599f33c50 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -38,8 +38,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; #pusch_TargetSNRx10 = 200; #pucch_TargetSNRx10 = 200; ul_prbblacklist = "51,52,53,54" diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index f28c3167b6..fa1ad38526 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -38,8 +38,8 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; + pdsch_AntennaPorts_N1 = 2; + pusch_AntennaPorts = 2; #pusch_TargetSNRx10 = 200; #pucch_TargetSNRx10 = 200; ul_prbblacklist = "51,52,53,54" @@ -247,8 +247,8 @@ L1s = ( RUs = ( { local_rf = "yes" - nb_tx = 1 - nb_rx = 1 + nb_tx = 2 + nb_rx = 2 att_tx = 0 att_rx = 0; bands = [78]; diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 9cc8f554e8..ef0af5f215 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; servingCellConfigCommon = ( diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index 249b7e4527..8de74fdf33 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -20,8 +20,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf index f232106d56..71c6de48e9 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf @@ -21,8 +21,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; servingCellConfigCommon = ( diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index d39cdf95b5..f1030c6cb5 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -853,6 +853,9 @@ typedef struct PHY_VARS_gNB_s { /// counter to average prach energh over first 100 prach opportunities int prach_energy_counter; + int ap_N1; + int ap_N2; + int ap_XP; int pucch0_thres; int pusch_thres; int prach_thres; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index c12bb8d085..18f2d30fac 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -196,7 +196,7 @@ int nr_derive_key(int alg_type, uint8_t alg_id, void config_common(int Mod_idP, int ssb_SubcarrierOffset, - int pdsch_AntennaPorts, + rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc ); @@ -777,7 +777,12 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0, 0); + rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts; + pdsch_AntennaPorts.N1 = n_tx; + pdsch_AntennaPorts.N2 = 1; + pdsch_AntennaPorts.XP = 1; + + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, pdsch_AntennaPorts, 6, 0, 0, 0, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); @@ -795,10 +800,11 @@ int main(int argc, char **argv) AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface"); gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; + // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 0, 0, NULL); + rrc_mac_config_req_gNB(0,0, pdsch_AntennaPorts, n_rx, 0, scc, NULL, 0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, pdsch_AntennaPorts, n_rx, 0, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); // reset preprocessor to the one of DLSIM after it has been set during // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index c71f52c41a..6c5329de42 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -720,7 +720,12 @@ int main(int argc, char **argv) prepare_scd(scd); - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0, 0); + rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts; + pdsch_AntennaPorts.N1 = n_tx; + pdsch_AntennaPorts.N2 = 1; + pdsch_AntennaPorts.XP = 1; + + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, pdsch_AntennaPorts, 0, 0, 0, 0, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); @@ -731,9 +736,9 @@ int main(int argc, char **argv) gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; // common configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,0, 0, NULL); + rrc_mac_config_req_gNB(0,0, pdsch_AntennaPorts, n_rx, 0, scc, &rrc.carrier.mib,0, 0, NULL); // UE dedicated configuration - rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); + rrc_mac_config_req_gNB(0,0, pdsch_AntennaPorts, n_rx, 0, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup); frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 769bc7d01d..57b2267195 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -413,7 +413,9 @@ typedef struct NRRrcConfigurationReq_s { NR_ServingCellConfig_t *scd; int ssb_SubcarrierOffset; int sib1_tda; - int pdsch_AntennaPorts; + int pdsch_AntennaPorts_N1; + int pdsch_AntennaPorts_N2; + int pdsch_AntennaPorts_XP; int pusch_AntennaPorts; int minRXTXTIME; int do_CSIRS; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index db9614b13f..d3f1499164 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -614,8 +614,11 @@ void RCconfig_NR_L1(void) { int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; AssertFatal (num_gnbs > 0,"Failed to parse config file no gnbs %s \n",GNB_CONFIG_STRING_ACTIVE_GNBS); - config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); - char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr; + config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); + int N1 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr; + int N2 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr; + int XP = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr; + char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr; if (ulprbbl) LOG_I(NR_PHY,"PRB blacklist %s\n",ulprbbl); char *pt = strtok(ulprbbl,","); int prbbl[275]; @@ -659,6 +662,9 @@ void RCconfig_NR_L1(void) { RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr); RC.gNB[j]->pusch_thres = *(L1_ParamList.paramarray[j][L1_PUSCH_DTX_THRESHOLD].uptr); RC.gNB[j]->num_ulprbbl = num_prbbl; + RC.gNB[j]->ap_N1 = N1; + RC.gNB[j]->ap_N2 = N2; + RC.gNB[j]->ap_XP = XP; LOG_I(NR_PHY,"Copying %d blacklisted PRB to L1 context\n",num_prbbl); memcpy(RC.gNB[j]->ulprbbl,prbbl,275*sizeof(int)); if(strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) { @@ -1157,8 +1163,12 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { } printf("SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr; - printf("pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr); - NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr; + printf("pdsch_AntennaPorts N1 %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts_N1 = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr; + printf("pdsch_AntennaPorts N2 %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts_N2 = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr; + printf("pdsch_AntennaPorts XP %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr); + NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts_XP = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr; printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); @@ -2030,9 +2040,13 @@ void configure_gnb_du_mac(int inst) { gNB_RRC_INST *rrc = RC.nrrrc[inst]; // LOG_I(GNB_APP,"Configuring MAC/L1 %d, carrier->sib2 %p\n", inst, &carrier->sib2->radioResourceConfigCommon); LOG_I(GNB_APP,"Configuring gNB DU MAC/L1 %d \n", inst); + rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts; + pdsch_AntennaPorts.N1 = rrc->configuration.pdsch_AntennaPorts_N1; + pdsch_AntennaPorts.N2 = rrc->configuration.pdsch_AntennaPorts_N2; + pdsch_AntennaPorts.XP = rrc->configuration.pdsch_AntennaPorts_XP; rrc_mac_config_req_gNB(rrc->module_id, rrc->configuration.ssb_SubcarrierOffset, - rrc->configuration.pdsch_AntennaPorts, + pdsch_AntennaPorts, rrc->configuration.pusch_AntennaPorts, rrc->configuration.sib1_tda, rrc->configuration.scc, diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index cde7819e25..dc319fbccf 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -114,7 +114,9 @@ typedef enum { #define GNB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd" #define GNB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd" #define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset" -#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts" +#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N1 "pdsch_AntennaPorts_N1" +#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N2 "pdsch_AntennaPorts_N2" +#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_XP "pdsch_AntennaPorts_XP" #define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts" #define GNB_CONFIG_STRING_SIB1TDA "sib1_tda" #define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS" @@ -144,7 +146,9 @@ typedef enum { {GNB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {GNB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N1, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N2, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_XP, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ @@ -169,14 +173,16 @@ typedef enum { #define GNB_LOCAL_S_PORTD_IDX 12 #define GNB_REMOTE_S_PORTD_IDX 13 #define GNB_SSB_SUBCARRIEROFFSET_IDX 14 -#define GNB_PDSCH_ANTENNAPORTS_IDX 15 -#define GNB_PUSCH_ANTENNAPORTS_IDX 16 -#define GNB_SIB1_TDA_IDX 17 -#define GNB_DO_CSIRS_IDX 18 -#define GNB_DO_SRS_IDX 19 -#define GNB_NRCELLID_IDX 20 -#define GNB_MINRXTXTIME_IDX 21 -#define GNB_ULPRBBLACKLIST_IDX 22 +#define GNB_PDSCH_ANTENNAPORTS_N1_IDX 15 +#define GNB_PDSCH_ANTENNAPORTS_N2_IDX 16 +#define GNB_PDSCH_ANTENNAPORTS_XP_IDX 17 +#define GNB_PUSCH_ANTENNAPORTS_IDX 18 +#define GNB_SIB1_TDA_IDX 19 +#define GNB_DO_CSIRS_IDX 20 +#define GNB_DO_SRS_IDX 21 +#define GNB_NRCELLID_IDX 22 +#define GNB_MINRXTXTIME_IDX 23 +#define GNB_ULPRBBLACKLIST_IDX 24 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 7b89e4e993..9443a11981 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -135,11 +135,12 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sche process_rlcBearerConfig(CellGroup->rlc_BearerToAddModList,CellGroup->rlc_BearerToReleaseList,sched_ctrl); } -void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) { + +void config_common(int Mod_idP, int ssb_SubcarrierOffset, rrc_pdsch_AntennaPorts_t dl_antenna_ports_struct, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) { nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0]; RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon = scc; - int i; + int pdsch_AntennaPorts = dl_antenna_ports_struct.N1 * dl_antenna_ports_struct.N2 * dl_antenna_ports_struct.XP; // Carrier configuration @@ -156,7 +157,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts cfg->carrier_config.dl_frequency.tl.tag = NFAPI_NR_CONFIG_DL_FREQUENCY_TAG; cfg->num_tlv++; - for (i=0; i<5; i++) { + for (int i=0; i<5; i++) { if (i==scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) { cfg->carrier_config.dl_grid_size[i].value = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; cfg->carrier_config.dl_k0[i].value = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier; @@ -190,7 +191,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts cfg->carrier_config.uplink_frequency.tl.tag = NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG; cfg->num_tlv++; - for (i=0; i<5; i++) { + for (int i=0; i<5; i++) { if (i==scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) { cfg->carrier_config.ul_grid_size[i].value = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; cfg->carrier_config.ul_k0[i].value = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier; @@ -281,7 +282,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts cfg->num_tlv++; cfg->prach_config.num_prach_fd_occasions_list = (nfapi_nr_num_prach_fd_occasions_t *) malloc(cfg->prach_config.num_prach_fd_occasions.value*sizeof(nfapi_nr_num_prach_fd_occasions_t)); - for (i=0; iprach_config.num_prach_fd_occasions.value; i++) { + for (int i=0; iprach_config.num_prach_fd_occasions.value; i++) { // cfg->prach_config.num_prach_fd_occasions_list[i].num_prach_fd_occasions = i; if (cfg->prach_config.prach_sequence_length.value) cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139; @@ -350,7 +351,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts case 3 : cfg->ssb_table.ssb_mask_list[0].ssb_mask.value = 0; cfg->ssb_table.ssb_mask_list[1].ssb_mask.value = 0; - for (i=0; i<4; i++) { + for (int i=0; i<4; i++) { cfg->ssb_table.ssb_mask_list[0].ssb_mask.value += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[3-i]<ssb_table.ssb_mask_list[1].ssb_mask.value += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[7-i]<carrier_config.num_rx_ant.value = pusch_AntennaPorts; AssertFatal(pusch_AntennaPorts > 0 && pusch_AntennaPorts < 13, "pusch_AntennaPorts in 1...12\n"); cfg->carrier_config.num_rx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_RX_ANT_TAG; - LOG_I(NR_MAC,"Set TX/RX antenna number to %d (num ssb %d: %x,%x)\n",cfg->carrier_config.num_tx_ant.value,num_ssb,cfg->ssb_table.ssb_mask_list[0].ssb_mask.value,cfg->ssb_table.ssb_mask_list[1].ssb_mask.value); + LOG_I(NR_MAC,"Set TX/RX antenna number to %d (num ssb %d: %x,%x)\n", + cfg->carrier_config.num_tx_ant.value,num_ssb,cfg->ssb_table.ssb_mask_list[0].ssb_mask.value,cfg->ssb_table.ssb_mask_list[1].ssb_mask.value); AssertFatal(cfg->carrier_config.num_tx_ant.value > 0,"carrier_config.num_tx_ant.value %d !\n",cfg->carrier_config.num_tx_ant.value ); cfg->num_tlv++; cfg->num_tlv++; @@ -426,7 +428,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts extern uint16_t sl_ahead; int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, - int pdsch_AntennaPorts, + rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, int pusch_AntennaPorts, int sib1_tda, NR_ServingCellConfigCommon_t *scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 9afd2a4083..e05865b9ed 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -40,20 +40,20 @@ void mac_top_init_gNB(void); void config_common(int Mod_idP, int ssb_SubcarrierOffset, - int pdsch_AntennaPorts, + rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc ); int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, - int pdsch_AntennaPorts, + rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, int pusch_AntennaPorts, int sib1_tda, NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, - int add_ue, - uint32_t rnti, + int add_ue, + uint32_t rnti, NR_CellGroupConfig_t *CellGroup); void clear_nr_nfapi_information(gNB_MAC_INST * gNB, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index bbc05da506..d05da68d8c 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1904,15 +1904,6 @@ int16_t do_RRCReconfiguration( ie->radioBearerConfig->srb3_ToRelease = NULL; ie->radioBearerConfig->drb_ToReleaseList = DRB_releaseList; } - /******************** Secondary Cell Group ********************/ - // rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier); - // fill_default_secondaryCellGroup( carrier->servingcellconfigcommon, - // ue_context_pP->ue_context.secondaryCellGroup, - // 1, - // 1, - // carrier->pdsch_AntennaPorts, - // carrier->initial_csi_index[ue_context_p->local_uid + 1], - // ue_context_pP->local_uid); /******************** Meas Config ********************/ // measConfig diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 667b5ed24a..755c00e160 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -420,6 +420,11 @@ typedef struct rrc_gNB_ue_context_s { struct gNB_RRC_UE_s ue_context; } rrc_gNB_ue_context_t; +typedef struct { + int N1; + int N2; + int XP; +} rrc_pdsch_AntennaPorts_t; typedef struct { @@ -447,7 +452,7 @@ typedef struct { NR_BCCH_DL_SCH_Message_t systemInformation; // SIB23 int ssb_SubcarrierOffset; int sib1_tda; - int pdsch_AntennaPorts; + rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts; int pusch_AntennaPorts; int minRXTXTIME; int do_CSIRS; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 40de13dfb0..18385e6123 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -78,7 +78,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CellGroupConfig_t *secondaryCellGroup, int scg_id, int servCellIndex, - int dl_antenna_ports, + rrc_pdsch_AntennaPorts_t dl_antenna_ports, int minRXTXTIMEpdsch, int do_csirs, int do_srs, @@ -91,7 +91,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, - int dl_antenna_ports, + rrc_pdsch_AntennaPorts_t dl_antenna_ports, int minRXTXTIMEpdsch, int do_csirs, int do_srs, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index dda128f52f..c76d0e2296 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -234,7 +234,9 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->ngap_id2_ngap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL); rrc->carrier.servingcellconfigcommon = configuration->scc; rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset; - rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; + rrc->carrier.pdsch_AntennaPorts.N1 = configuration->pdsch_AntennaPorts_N1; + rrc->carrier.pdsch_AntennaPorts.N2 = configuration->pdsch_AntennaPorts_N2; + rrc->carrier.pdsch_AntennaPorts.XP = configuration->pdsch_AntennaPorts_XP; rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts; rrc->carrier.minRXTXTIME = configuration->minRXTXTIME; rrc->carrier.sib1_tda = configuration->sib1_tda; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 536010bbc6..57bf6c1f7e 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -381,7 +381,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ if (NODE_IS_DU(rrc->node_type)) { rrc_mac_config_req_gNB(rrc->module_id, rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, + rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, rrc->carrier.servingcellconfigcommon, @@ -392,7 +392,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ } else { rrc_mac_config_req_gNB(rrc->module_id, rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, + rrc->carrier.pdsch_AntennaPorts, rrc->carrier.pusch_AntennaPorts, rrc->carrier.sib1_tda, NULL, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 4589988bbb..cb0cb24ced 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -54,7 +54,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_CellGroupConfig_t *secondaryCellGroup, int scg_id, int servCellIndex, - int dl_antenna_ports, + rrc_pdsch_AntennaPorts_t dl_antenna_ports_struct, int minRXTXTIME, int do_csirs, int do_srs, @@ -68,6 +68,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco // where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations. AssertFatal(uid>=0 && uid<30, "gNB cannot allocate the SRS resources\n"); + int dl_antenna_ports = dl_antenna_ports_struct.N1 * dl_antenna_ports_struct.N2 * dl_antenna_ports_struct.XP; + uint64_t bitmap=0; switch (servingcellconfigcommon->ssb_PositionsInBurst->present) { case 1 : @@ -1404,7 +1406,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_ServingCellConfig_t *servingcellconfigdedicated, NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, - int dl_antenna_ports, + rrc_pdsch_AntennaPorts_t dl_antenna_ports, int minRXTXTIME, int do_csirs, int do_srs, diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf index 575fddda2b..9ed1acc0dd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/benetel-5g.conf @@ -23,8 +23,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf index c3faa198dd..946815618f 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf index 8fa8fcf992..4bbe90158c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.32PRB.usrpx300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf index c2e364b75e..6bef146f4c 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band257.tm1.66PRB.usrpn300.conf @@ -22,9 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - + servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf index 813a0e58e3..227c822e14 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band261.tm1.32PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf index d81655e5d5..e17699baec 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf index b063989fd2..aaf9734ec7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf index a171f2aae0..8aaf677958 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.30kHz,usrpb2x0.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf index 856eed4fc2..7a4bdec7a4 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.106PRB.slave.conf @@ -22,9 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - + servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf index 012f46401e..d93f8291c2 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.slave.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf index 2e4dc540f3..eda6a5927a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.PTRS.usrpx300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf index a454af7b21..56273a3b7d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.conf @@ -22,9 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - + servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index e72aaf95ff..c14c366159 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 4; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index 928c70113f..b1053812c6 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index 76bc5bf992..cb9c903654 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf index 7ff9d0ea77..3a3bd757b1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpx300.conf @@ -22,9 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - + servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf index 5c0434b57e..ac59a72fdd 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpb210.conf @@ -22,9 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - + servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf index 4b1476a76d..699b58b5e1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpn300.conf @@ -22,9 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - + servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf index 50169f4bce..79ba52a8d8 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.24PRB.usrpx300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf index e217f39b94..4d7b9b3a85 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.273PRB.usrpn300.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf index 1583e07ca1..2915657ca7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band78.tm1.106PRB.nfapi.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf index 5591ed082d..17dff911a1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf index dd8113e059..b23565b961 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_24PRB.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf index 198ad8471c..b252675cb1 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_n310.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf index 96335f23ca..2d775bd1e6 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/testing_gnb_nsa_n310.conf @@ -22,8 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; pusch_TargetSNRx10 = 200; pucch_TargetSNRx10 = 200; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 215a57b95c..076c88aa8d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -40,8 +40,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; sib1_tda = 0; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index ab4713f8b5..2310f4c65c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -37,8 +37,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; sib1_tda = 0; servingCellConfigCommon = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index b77ad0b264..68217e209d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -33,8 +33,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; sib1_tda = 0; do_SRS = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 27a1b6ad62..798338530e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -33,7 +33,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; + pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; sib1_tda = 0; do_SRS = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index e96c545a4e..fa5a4be52d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -33,8 +33,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; sib1_tda = 0; do_SRS = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf index c8a0bace37..0340f0f418 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.sabox.conf @@ -31,8 +31,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index befceae695..6ad826e666 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -33,10 +33,8 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; + pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; -# do_CSIRS = 1; - min_rxtxtime_pdsch = 2; ul_prbblacklist = "79,80,81,82" pdcch_ConfigSIB1 = ( { From 987363b8a83f8ee2301d6247d2b676068b76942a Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 10:34:23 -0800 Subject: [PATCH 442/883] Clean up for MR --- executables/nr-ue.c | 8 +- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 46 +++-------- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 14 ++-- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 81 +++++--------------- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 44 ++++------- 6 files changed, 57 insertions(+), 138 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 3370aa2fc2..9aac2c7f90 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -201,11 +201,11 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot) nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue); nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue); - for (int i = 0; i < 16; i++) { + for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) { LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CRC active SFN %d/SLOT %d from queue with %lu items\n", - NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot), - NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot), nr_ul_tti_req_queue.num_items); - nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot); + NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot), + NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot), nr_ul_tti_req_queue.num_items); + nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot); if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0) { check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc); diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4583e4f193..c34877bd23 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -104,8 +104,6 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION; rx_ind->sfn = scheduled_response->ul_config->sfn; rx_ind->slot = scheduled_response->ul_config->slot; - LOG_I(NR_MAC, "This is sched sfn/sl [%d %d] and rx sfn/sl [%d %d]\n", - scheduled_response->frame, scheduled_response->slot, rx_ind->sfn, rx_ind->slot); rx_ind->number_of_pdus = scheduled_response->tx_request->number_of_pdus; rx_ind->pdu_list = CALLOC(rx_ind->number_of_pdus, sizeof(*rx_ind->pdu_list)); for (int j = 0; j < rx_ind->number_of_pdus; j++) @@ -117,7 +115,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu)); memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu)); rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; - rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; + rx_ind->pdu_list[j].timing_advance = 31; rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi; } @@ -130,15 +128,15 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response { crc_ind->crc_list[j].handle = pusch_config_pdu->handle; crc_ind->crc_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id; - LOG_I(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j); - LOG_I(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n", + LOG_D(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j); + LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n", scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot); crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb; crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti; crc_ind->crc_list[j].tb_crc_status = 0; - crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; + crc_ind->crc_list[j].timing_advance = 31; crc_ind->crc_list[j].ul_cqi = 255; - mac->nr_ue_emul_l1.harq[crc_ind->crc_list[j].harq_id].crc_rx_ind_sfn_slot = NFAPI_SFNSLOT2HEX(crc_ind->sfn, crc_ind->slot); + mac->nr_ue_emul_l1.harq[crc_ind->crc_list[j].harq_id].active_ul_harq_sfn_slot = NFAPI_SFNSLOT2HEX(crc_ind->sfn, crc_ind->slot); LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d] with mcs_index in ul_cqi -> %d\n", scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot,pusch_config_pdu->mcs_index); } @@ -166,8 +164,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind = NULL; } - LOG_I(PHY, "In %s: [%d, %d] Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__, - scheduled_response->frame, scheduled_response->slot); + LOG_D(PHY, "In %s: Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__); scheduled_response->tx_request->number_of_pdus = 0; } @@ -204,8 +201,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response pdu_0_1->ul_cqi = 255; pdu_0_1->timing_advance = 0; pdu_0_1->rssi = 0; - LOG_I(NR_PHY, "In %s: UCI SFN/SLOT: [%d, %d] and mac->nr_ue_emul_l1.num_harq %d\n", - __FUNCTION__, uci_ind->sfn, uci_ind->slot, mac->nr_ue_emul_l1.num_harqs); + if (mac->nr_ue_emul_l1.num_harqs > 0) { int harq_index = 0; pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR @@ -214,29 +210,16 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response pdu_0_1->harq->harq_confidence_level = 0; pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); int harq_pid = -1; - for (int k = 0; k < 16; k++) + for (int k = 0; k < NR_MAX_HARQ_PROCESSES; k++) { - LOG_I(NR_MAC, "HARQ PID %d active = %d saved sfn_slot = %d.%d vs current sfn.slot %d.%d\n", - k, mac->nr_ue_emul_l1.harq[k].active, - mac->nr_ue_emul_l1.harq[k].active_harq_sfn, - mac->nr_ue_emul_l1.harq[k].active_harq_slot, - uci_ind->sfn, - uci_ind->slot); if (mac->nr_ue_emul_l1.harq[k].active && - mac->nr_ue_emul_l1.harq[k].active_harq_sfn == uci_ind->sfn && - mac->nr_ue_emul_l1.harq[k].active_harq_slot == uci_ind->slot) + mac->nr_ue_emul_l1.harq[k].active_dl_harq_sfn == uci_ind->sfn && + mac->nr_ue_emul_l1.harq[k].active_dl_harq_slot == uci_ind->slot) { mac->nr_ue_emul_l1.harq[k].active = false; harq_pid = k; - LOG_I(NR_MAC, "Setting harq_pid = %d and num_harqs %d for %d.%d\n", k, pdu_0_1->harq->num_harq, - uci_ind->sfn, uci_ind->slot); pdu_0_1->harq->harq_list[harq_index].harq_value = !mac->dl_harq_info[k].ack; harq_index++; - LOG_I(NR_PHY, "In %s: Building uci_ind_%d with num_harqs %d and pdu_bitmap %d\n" - "uci_num %d, SFN/SLOT: [%d, %d]\n", - __FUNCTION__, uci_ind->uci_list[0].pdu_type, - pdu_0_1->harq->num_harq, pdu_0_1->pduBitmap, - uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); } } AssertFatal(harq_pid != -1, "No active harq_pid, sfn_slot = %u.%u", uci_ind->sfn, uci_ind->slot); @@ -244,13 +227,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response } } - LOG_I(NR_PHY, "In %s: Sending uci_ind_%d which was filled by ulconfig.\n" - "uci_num %d, SFN/SLOT: [%d, %d] and pdu_bitmap %d\n", - __FUNCTION__, uci_ind->uci_list[0].pdu_type, - uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot, - uci_ind->uci_list[0].pucch_pdu_format_0_1.pduBitmap); - LOG_I(NR_MAC, "Sending UCI with %d PDUs in sfn.slot %d/%d\n", - uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); + LOG_I(NR_PHY, "Sending UCI with %d PDUs in sfn.slot %d/%d\n", + uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); NR_UL_IND_t UL_INFO = { .uci_ind = *uci_ind, }; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index 4f1ed162e2..c3fc3206e4 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -269,20 +269,20 @@ typedef struct { scheduled SFN/Slot transmission for the ACK/NAK. If we do not save it, then we have to calculate it again as the NRUE MAC layer already does in get_downlink_ack(). */ - int active_harq_sfn; - int active_harq_slot; - int crc_rx_ind_sfn_slot; + int active_dl_harq_sfn; + int active_dl_harq_slot; + int active_ul_harq_sfn_slot; bool active; } emul_l1_harq_t; typedef struct { bool expected_sib; - bool index_has_sib[16]; + bool index_has_sib[NR_MAX_HARQ_PROCESSES]; bool expected_rar; - bool index_has_rar[16]; + bool index_has_rar[NR_MAX_HARQ_PROCESSES]; bool expected_dci; - bool index_has_dci[16]; - emul_l1_harq_t harq[16]; + bool index_has_dci[NR_MAX_HARQ_PROCESSES]; + emul_l1_harq_t harq[NR_MAX_HARQ_PROCESSES]; int active_uci_sfn_slot; int num_srs; int num_harqs; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index ad86b1385d..fc2c2d2c8b 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -432,7 +432,7 @@ typedef struct { // Defined for abstracted mode nr_downlink_indication_t dl_info; - NR_UE_HARQ_STATUS_t dl_harq_info[16]; + NR_UE_HARQ_STATUS_t dl_harq_info[NR_MAX_HARQ_PROCESSES]; nr_emulated_l1_t nr_ue_emul_l1; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 1c1b69ad65..ed334758b6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -599,19 +599,14 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format]; - LOG_I(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx, pid %d)\n", - dci->rnti, dci->dci_format, - dci->n_CCE, dci->payloadSize, - *(unsigned long long*)dci->payloadBits, - def_dci_pdu_rel15->harq_pid); + LOG_D(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n", + dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits); int8_t ret = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15); if ((ret&1) == 1) return -1; else if (ret == 2) { dci->dci_format = NR_UL_DCI_FORMAT_0_0; def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format]; } - LOG_I(MAC,"After extracting dci info. dci format %d, pid %d\n", - dci->dci_format, def_dci_pdu_rel15->harq_pid); int8_t ret_proc = nr_ue_process_dci(module_id, cc_id, gNB_index, frame, slot, def_dci_pdu_rel15, dci); return ret_proc; } @@ -636,8 +631,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr else if (mac->scc_SIB) n_RB_DLBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE); else n_RB_DLBWP = mac->type0_PDCCH_CSS_config.num_rbs; - LOG_I(MAC, "In %s: Processing received DCI format %s (DL BWP %d) harq_pid %d\n", - __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP, dci->harq_pid); + + LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP); switch(dci_format){ case NR_UL_DCI_FORMAT_0_0: { @@ -953,8 +948,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr if(rnti != ra->ra_rnti && rnti != SI_RNTI) AssertFatal(1+dci->pdsch_to_harq_feedback_timing_indicator.val>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d).\n", 1+dci->pdsch_to_harq_feedback_timing_indicator.val,DURATION_RX_TO_TX); - LOG_I(MAC,"(nr_ue_procedures.c) dci->pdsch_to_harq_feedback_timing_indicator.val=%d \n", - dci->pdsch_to_harq_feedback_timing_indicator.val); // set the harq status at MAC for feedback set_harq_status(mac,dci->pucch_resource_indicator, @@ -1126,9 +1119,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr valid = 0; pucch_res_set_cnt = ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.count; for (int id = 0; id < pucch_res_set_cnt; id++) { - LOG_I(NR_MAC, "pucch_resource_indicator %d, ubwpd[%d].resource.list.count %d\n", - dci->pucch_resource_indicator, id, - ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.array[id]->resourceList.list.count); if (dci->pucch_resource_indicator < ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.array[id]->resourceList.list.count) { valid = 1; break; @@ -1246,9 +1236,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr // according to TS 38.213 Table 9.2.3-1 uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; - LOG_I(MAC,"(nr_ue_procedures.c) 1237 feedback_ti=%d and dci->pdsch_to_harq_feedback_timing_indicator.val %d, pdsch_to_harq_feedback_time_ind %d\n", - feedback_ti, dci->pdsch_to_harq_feedback_timing_indicator.val, - dlsch_config_pdu_1_1->pdsch_to_harq_feedback_time_ind); AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d). Min feedback time set in config file (min_rxtxtime).\n", feedback_ti,DURATION_RX_TO_TX); @@ -1347,20 +1334,20 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, // FIXME k0 != 0 currently not taken into consideration current_harq->dl_frame = frame; current_harq->dl_slot = slot; - // TODO: if (get_softmodem_params()->emaulte_l1) - // in downlink: 0-7, 10-17 - if (data_toul_fb + slot > 19) { - if (frame + 1 < 1024) - frame++; - else - frame = 0; - slot = (data_toul_fb + slot) - 20; - } - else { - slot = data_toul_fb + slot; + if (get_softmodem_params()->emaulte_l1) { + if (data_toul_fb + slot > 19) { + if (frame + 1 < 1024) + frame++; + else + frame = 0; + slot = (data_toul_fb + slot) - 20; + } + else { + slot = data_toul_fb + slot; + } } - LOG_I(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n", + LOG_D(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n", harq_id, current_harq->dl_frame, current_harq->dl_slot, frame, slot); } @@ -1845,22 +1832,16 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size) { mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set_id] != NULL)) { if (uci_size <= 3) { pucch_resource_set_id = 0; - LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d", - __FUNCTION__, __LINE__, pucch_resource_set_id); return (pucch_resource_set_id); break; } else { pucch_resource_set_id = 1; - LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d", - __FUNCTION__, __LINE__, pucch_resource_set_id); return (pucch_resource_set_id); break; } } pucch_resource_set_id++; - LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d", - __FUNCTION__, __LINE__, pucch_resource_set_id); } pucch_resource_set_id = MAX_NB_OF_PUCCH_RESOURCE_SETS; @@ -1945,13 +1926,6 @@ void select_pucch_resource(NR_UE_MAC_INST_t *mac, pucch->pucch_resource = NULL; return; } - LOG_I(MAC,"Melissa resourceSetToAddModList %p\n", resourceSetToAddModList); - LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[0] %p\n", resourceSetToAddModList->list.array[0]); - LOG_I(MAC,"Melissa pucch->resource_set_id %d\n", pucch->resource_set_id); - LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id] %p\n", resourceSetToAddModList->list.array[pucch->resource_set_id]); - LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList %p\n", resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList); - LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count %d\n", resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count); - n_list = resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count; if (pucch->resource_indicator > n_list) { LOG_E(MAC,"Invalid PUCCH resource id %d\n",pucch->resource_indicator); @@ -2063,21 +2037,13 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, else { sched_slot = current_harq->feedback_to_ul + current_harq->dl_slot; } - - LOG_I(PHY,"HARQ pid %d is active for %d.%d and inputted %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d active %d\n", - dl_harq_pid, - sched_frame, - sched_slot, frame, slot, - current_harq->dl_slot, - current_harq->feedback_to_ul, - current_harq->is_common, - current_harq->active); + LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common); /* check if current tx slot should transmit downlink acknowlegment */ if (sched_frame == frame && sched_slot == slot) { if (get_softmodem_params()->emulate_l1) { mac->nr_ue_emul_l1.harq[dl_harq_pid].active = true; - mac->nr_ue_emul_l1.harq[dl_harq_pid].active_harq_sfn = frame; - mac->nr_ue_emul_l1.harq[dl_harq_pid].active_harq_slot = slot; + mac->nr_ue_emul_l1.harq[dl_harq_pid].active_dl_harq_sfn = frame; + mac->nr_ue_emul_l1.harq[dl_harq_pid].active_dl_harq_slot = slot; } if (current_harq->dai > NR_DL_MAX_DAI) { @@ -2099,7 +2065,6 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, } number_harq_feedback++; - LOG_I(NR_MAC, "number_harq_feedback = %d\n", number_harq_feedback); if (current_harq->ack_received) ack_data[code_word][dai_current - 1] = current_harq->ack; else @@ -2187,7 +2152,6 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, V_temp2 = dai[1][m]; /* second code word has been received */ O_bit_number_cw1 = (8 * j) + 2*(V_temp - 1) + 1; o_ACK = o_ACK | (ack_data[1][m] << O_bit_number_cw1); - LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK); } if (two_transport_blocks == TRUE) { @@ -2197,7 +2161,6 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, O_bit_number_cw0 = (4 * j) + (V_temp - 1); } - LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK); o_ACK = o_ACK | (ack_data[0][m] << O_bit_number_cw0); LOG_D(MAC,"m %d bit number %d o_ACK %d\n",m,O_bit_number_cw0,o_ACK); } @@ -2211,16 +2174,14 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, } else { O_ACK = 4 * j + V_temp2; /* only one transport block */ - LOG_I(NR_MAC, "%s():%d O_ACK = %d\n", __FUNCTION__, __LINE__, O_ACK); } if (number_harq_feedback != O_ACK) { LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment. number_harq_feedback %d, O_ACK %d \n", number_harq_feedback, O_ACK); - number_harq_feedback = O_ACK; //return (0); + return (0); } - LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK); pucch->ack_payload = o_ACK; LOG_D(MAC,"frame %d slot %d pucch acknack payload %d\n",frame,slot,o_ACK); @@ -3896,8 +3857,6 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t #endif if (ra->RA_RAPID_found) { - // if (rarh->RAPID != preamble_index) - // return 0; RAR_grant_t rar_grant; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index f5076dc180..3d32acffcf 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -465,7 +465,7 @@ static void fill_rx_ind(nfapi_nr_pdu_t *pdu_list, fapi_nr_rx_indication_t *rx_in { length += pdu_list->TLVs[j].length; } - LOG_I(NR_PHY, "Elkadi %s: num_tlv %d and length %d, pdu index %d\n", + LOG_I(NR_PHY, "%s: num_tlv %d and length %d, pdu index %d\n", __FUNCTION__, pdu_list->num_TLV, length, pdu_idx); uint8_t *pdu = malloc(length); AssertFatal(pdu != NULL, "%s: Out of memory in malloc", __FUNCTION__); @@ -618,7 +618,6 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n static bool send_crc_ind_and_rx_ind(int sfn_slot) { bool sent_crc_rx = true; - LOG_I(NR_MAC, "Melissa, This is the num items in crc %d and rx %d\n", nr_crc_ind_queue.num_items, nr_rx_ind_queue.num_items); nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot); @@ -709,10 +708,8 @@ static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_ dl_ind->dci_ind->dci_list[k].dci_format = rel15_dci->dci_format_options[j]; LOG_I(NR_PHY, "format assigned dl_ind->dci_ind->dci_list[k].dci_format %d\n", dl_ind->dci_ind->dci_list[k].dci_format); - int CCEind = rel15_dci->CCE[j]; - int L = rel15_dci->L[j]; - dl_ind->dci_ind->dci_list[k].n_CCE = CCEind; - dl_ind->dci_ind->dci_list[k].N_CCE = L; + dl_ind->dci_ind->dci_list[k].n_CCE = rel15_dci->CCE[j]; + dl_ind->dci_ind->dci_list[k].N_CCE = rel15_dci->L[j]; } } } @@ -796,10 +793,8 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, ul_info.slot_tx, - mac->frame_type)) { - LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", ul_info.slot_tx, __FUNCTION__); + mac->frame_type)) nr_ue_ul_indication(&ul_info); - } } } @@ -918,16 +913,10 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea LOG_E(NR_PHY, "Message ul_tti_request failed to unpack\n"); break; } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d.\n", - ul_tti_request->SFN, ul_tti_request->Slot); - for (int i = 0; i < ul_tti_request->n_pdus; i++) { - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST pdu_type %d, ra_state %d.\n", - ul_tti_request->pdus_list[i].pdu_type, mac->ra.ra_state); - if (ul_tti_request->pdus_list[i].pdu_type == 1 && - mac->ra.ra_state >= RA_SUCCEEDED) { - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST that were queueing with rnti %x!\n", - ul_tti_request->pdus_list[i].pucch_pdu.rnti); + for (int i = 0; i < ul_tti_request->n_pdus; i++) { + if (ul_tti_request->pdus_list[i].pdu_type == NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE && + mac->ra.ra_state >= RA_SUCCEEDED) { if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) { LOG_I(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n"); @@ -937,8 +926,6 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea break; } else if (mac->ra.ra_state < RA_SUCCEEDED) { - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST before RA_SUCEEDED that were queueing with rnti %x!\n", - ul_tti_request->pdus_list[i].pucch_pdu.rnti); if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) { LOG_I(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n"); @@ -1098,8 +1085,8 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t // L2 Abstraction Layer // Note: sdu should always be processed because data and timing advance updates are transmitted by the UE int8_t handle_dlsch(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){ - - dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; + if (get_softmodem_params()->emulate_l1) + dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; update_harq_status(dl_info->module_id, dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid, @@ -1147,8 +1134,6 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test) nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); - LOG_I(NR_MAC, "In %s():%d calling nr_ue_pucch_scheduler in %d.%d\n", - __FUNCTION__, __LINE__, ul_info->frame_tx, ul_info->slot_tx); if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->emulate_l1) nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); @@ -1184,12 +1169,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ if (dl_info && dl_info->dci_ind && dl_info->dci_ind->number_of_dcis) { LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n"); for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) { + LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; - LOG_I(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d, format %d, harq_pid %d\n", - i, - dl_info->dci_ind->number_of_dcis, - dci_index->dci_format, - mac->def_dci_pdu_rel15[dci_index->dci_format].harq_pid); nr_scheduled_response_t scheduled_response; int8_t ret = handle_dci(dl_info->module_id, dl_info->cc_id, @@ -1200,7 +1181,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ /* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */ if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) { - LOG_I(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); + LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); break; } dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format]; @@ -1214,7 +1195,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot, dl_info->thread_id); nr_ue_if_module_inst[module_id]->scheduled_response(&scheduled_response); } - //memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); + if (!get_softmodem_params()->emulate_l1) + memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); } free(dl_info->dci_ind); dl_info->dci_ind = NULL; From 26349dbe20f43050e34dc7aea47c66853b80f351 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 11:07:14 -0800 Subject: [PATCH 443/883] More clean up for merge request --- executables/nr-ue.c | 4 +--- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 7 ++++--- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 5 +++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 9aac2c7f90..b812026602 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -375,8 +375,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ul_info.slot_tx = (slot + slot_ahead) % slots_per_frame; ul_info.frame_tx = (ul_info.slot_rx + slot_ahead >= slots_per_frame) ? ul_info.frame_rx + 1 : ul_info.frame_rx; ul_info.ue_sched_mode = SCHED_ALL; - LOG_I(NR_MAC, "frame_rx %d, slot rx %d, frame tx %d, slot tx %d, slot_ahead %d\n", - ul_info.frame_rx, ul_info.slot_rx, ul_info.frame_tx, ul_info.slot_tx, slot_ahead); if (pthread_mutex_lock(&mac->mutex_dl_info)) abort(); @@ -405,7 +403,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, ul_info.slot_tx, mac->frame_type)) { - LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() and nr_ue_pucch_scheduler from %s\n", ul_info.slot_tx, __FUNCTION__); + LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() and nr_ue_pucch_scheduler() from %s\n", ul_info.slot_tx, __FUNCTION__); nr_ue_ul_indication(&ul_info); nr_ue_pucch_scheduler(0, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id); check_nr_prach(mac, &ul_info, &prach_resources); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index ed334758b6..e1096e484c 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -631,7 +631,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr else if (mac->scc_SIB) n_RB_DLBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE); else n_RB_DLBWP = mac->type0_PDCCH_CSS_config.num_rbs; - LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP); switch(dci_format){ @@ -1236,6 +1235,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr // according to TS 38.213 Table 9.2.3-1 uint8_t feedback_ti = ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0]; + AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d). Min feedback time set in config file (min_rxtxtime).\n", feedback_ti,DURATION_RX_TO_TX); @@ -2177,11 +2177,12 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, } if (number_harq_feedback != O_ACK) { - LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment. number_harq_feedback %d, O_ACK %d \n", - number_harq_feedback, O_ACK); + + LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); return (0); } + reverse_n_bits(&o_ACK,number_harq_feedback); pucch->ack_payload = o_ACK; LOG_D(MAC,"frame %d slot %d pucch acknack payload %d\n",frame,slot,o_ACK); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 3d32acffcf..70c0f8a386 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1170,14 +1170,15 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n"); for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) { LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); - fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; nr_scheduled_response_t scheduled_response; int8_t ret = handle_dci(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, dl_info->frame, dl_info->slot, - dci_index); + dl_info->dci_ind->dci_list+i); + + fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; /* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */ if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) { From af18fc7e70c192f88a13df884c129d2244725531 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 11:14:13 -0800 Subject: [PATCH 444/883] Log demotion and white space clean up --- executables/nr-ue.c | 2 +- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index b812026602..0bb282c943 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -403,7 +403,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, ul_info.slot_tx, mac->frame_type)) { - LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() and nr_ue_pucch_scheduler() from %s\n", ul_info.slot_tx, __FUNCTION__); + LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind() and nr_ue_pucch_scheduler() from %s\n", ul_info.slot_tx, __FUNCTION__); nr_ue_ul_indication(&ul_info); nr_ue_pucch_scheduler(0, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id); check_nr_prach(mac, &ul_info, &prach_resources); diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index c34877bd23..b80ddbf22c 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -36,7 +36,7 @@ #include "fapi_nr_ue_l1.h" #include "harq_nr.h" //#include "PHY/phy_vars_nr_ue.h" - +#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" #include "PHY/defs_nr_UE.h" #include "PHY/impl_defs_nr.h" #include "utils.h" diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index e1096e484c..c9f9337fe6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2177,7 +2177,6 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, } if (number_harq_feedback != O_ACK) { - LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); return (0); } From c645c12db4fcf8144a52f1f7b608d7f6c3b0d369 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 20 Jan 2022 18:56:44 +0100 Subject: [PATCH 445/883] using uid also in SA --- openair2/RRC/NR/L2_nr_interface.c | 18 +++++++++--------- openair2/RRC/NR/MESSAGES/asn1_msg.c | 15 ++++++--------- openair2/RRC/NR/MESSAGES/asn1_msg.h | 14 ++++++-------- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 -- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index cf7dcf1b64..4f54b9978d 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -325,7 +325,15 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, NR_ServingCellConfigCommon_t *scc=RC.nrrrc[module_idP]->carrier.servingcellconfigcommon; memset(&cellGroupConfig,0,sizeof(cellGroupConfig)); - fill_initial_cellGroupConfig(rntiP,-1,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier); + struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[module_idP]); + ue_context_p->ue_id_rnti = rntiP; + ue_context_p->ue_context.rnti = rntiP; + ue_context_p->ue_context.random_ue_identity = rntiP; + ue_context_p->ue_context.Srb0.Active = 1; + RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[module_idP]->rrc_ue_head, ue_context_p); + + fill_initial_cellGroupConfig(ue_context_p->local_uid,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier); + MessageDef* tmp=itti_alloc_new_message_sized(TASK_RRC_GNB, 0, F1AP_INITIAL_UL_RRC_MESSAGE, sizeof(f1ap_initial_ul_rrc_message_t) + sdu_lenP); f1ap_initial_ul_rrc_message_t *msg = &F1AP_INITIAL_UL_RRC_MESSAGE(tmp); @@ -346,14 +354,6 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, memcpy(msg->rrc_container, sduP, sdu_lenP); msg->rrc_container_length=sdu_lenP; itti_send_msg_to_task(TASK_DU_F1, 0, tmp); - - struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[module_idP]); - ue_context_p->ue_id_rnti = rntiP; - ue_context_p->ue_context.rnti = rntiP; - ue_context_p->ue_context.random_ue_identity = rntiP; - ue_context_p->ue_context.Srb0.Active = 1; - RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[module_idP]->rrc_ue_head, ue_context_p); - return(0); } diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index bbc05da506..fcf156a76e 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1002,8 +1002,7 @@ long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS) { return c_srs; } -void fill_initial_SpCellConfig(rnti_t rnti, - int uid, +void fill_initial_SpCellConfig(int uid, NR_SpCellConfig_t *SpCellConfig, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier) { @@ -1042,9 +1041,8 @@ void fill_initial_SpCellConfig(rnti_t rnti, // one symbol (13) NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); pucchres0->pucch_ResourceId=0; - //pucchres0->startingPRB=0; - pucchres0->startingPRB=(8+rnti) % curr_bwp; - LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp); + pucchres0->startingPRB=(8+uid) % curr_bwp; + LOG_D(NR_RRC, "pucchres0->startPRB %ld uid %d curr_bwp %d\n", pucchres0->startingPRB, uid, curr_bwp); pucchres0->intraSlotFrequencyHopping=NULL; pucchres0->secondHopPRB=NULL; pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0; @@ -1448,8 +1446,7 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr ASN_SEQUENCE_ADD(&ue_context_mastercellGroup->rlc_BearerToAddModList->list, rlc_BearerConfig_drb); } -void fill_initial_cellGroupConfig(rnti_t rnti, - int uid, +void fill_initial_cellGroupConfig(int uid, NR_CellGroupConfig_t *cellGroupConfig, NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier) { @@ -1543,7 +1540,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti, cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig)); - fill_initial_SpCellConfig(rnti,uid,cellGroupConfig->spCellConfig,scc,carrier); + fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,carrier); cellGroupConfig->sCellToAddModList = NULL; cellGroupConfig->sCellToReleaseList = NULL; @@ -1622,7 +1619,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, } else { cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); - fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,ue_context_pP->local_uid,cellGroupConfig,scc,carrier); + fill_initial_cellGroupConfig(ue_context_pP->local_uid,cellGroupConfig,scc,carrier); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index ca92652c6c..cb971acd60 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -100,16 +100,14 @@ void do_SpCellConfig(gNB_RRC_INST *rrc, uint8_t do_RRCReject(uint8_t Mod_id, uint8_t *const buffer); -void fill_initial_SpCellConfig(rnti_t rnti, - int uid, - NR_SpCellConfig_t *SpCellConfig, - NR_ServingCellConfigCommon_t *scc, +void fill_initial_SpCellConfig(int uid, + NR_SpCellConfig_t *SpCellConfig, + NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); -void fill_initial_cellGroupConfig(rnti_t rnti, - int uid, - NR_CellGroupConfig_t *cellGroupConfig, - NR_ServingCellConfigCommon_t *scc, +void fill_initial_cellGroupConfig(int uid, + NR_CellGroupConfig_t *cellGroupConfig, + NR_ServingCellConfigCommon_t *scc, rrc_gNB_carrier_data_t *carrier); void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index db4dc2d579..3a28409aea 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -914,9 +914,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList)); pucch_Config->resourceToReleaseList = NULL; NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); - NR_PUCCH_Resource_t *pucchres1=calloc(1,sizeof(*pucchres1)); NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2)); - NR_PUCCH_Resource_t *pucchres3=calloc(1,sizeof(*pucchres3)); pucchres0->pucch_ResourceId=1; pucchres0->startingPRB= (8 + uid) % curr_bwp; From 5e7de1cdfc36c8826c70ca8a12f85de7e2caacc2 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 11:41:22 -0800 Subject: [PATCH 446/883] Fixing typo and adding .h files for linking --- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 1 - openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 2 ++ 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index c3fc3206e4..9dd03ddcf6 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -39,6 +39,7 @@ #include #include "NR_SubcarrierSpacing.h" +#include "openair1/SCHED_NR_UE/harq_nr.h" #define NR_SHORT_BSR_TABLE_SIZE 32 #define NR_LONG_BSR_TABLE_SIZE 256 diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index c9f9337fe6..92fc813e6a 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1334,7 +1334,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, // FIXME k0 != 0 currently not taken into consideration current_harq->dl_frame = frame; current_harq->dl_slot = slot; - if (get_softmodem_params()->emaulte_l1) { + if (get_softmodem_params()->emulate_l1) { if (data_toul_fb + slot > 19) { if (frame + 1 < 1024) frame++; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 70c0f8a386..87f262dbe9 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -649,7 +649,6 @@ static bool send_crc_ind_and_rx_ind(int sfn_slot) static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_ul_tti_request_t *ul_tti_req) { - NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); int num_pdus = ul_tti_req->n_pdus; int sfn_slot = NFAPI_SFNSLOT2HEX(ul_tti_req->SFN, ul_tti_req->Slot); AssertFatal(num_pdus >= 0, "Invalid ul_tti_request number of PDUS\n"); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 499346f394..3984ed3380 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -268,6 +268,8 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, bool sfn_slot_matcher(void *wanted, void *candidate); +void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind); + /**\brief done free of memory allocation by module_id and release to pointer pool. \param module_id module id*/ int nr_ue_if_module_kill(uint32_t module_id); From d8d616a1fa4aa4fddcc30a6c97f44d3ee78bffdd Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 12:24:34 -0800 Subject: [PATCH 447/883] Setting timing advance in stub function. The timing advance field could be abstracted in the proxy gNB. Currently we are not abstracting this value. --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 2eb1da9101..9e4a0f2d3d 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -114,7 +114,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu)); memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu)); rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; - rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; + rx_ind->pdu_list[j].timing_advance = 31; rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi; } @@ -134,7 +134,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb; crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti; crc_ind->crc_list[j].tb_crc_status = 0; - crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; + crc_ind->crc_list[j].timing_advance = 31; crc_ind->crc_list[j].ul_cqi = 255; LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d] with mcs_index in ul_cqi -> %d\n", scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot,pusch_config_pdu->mcs_index); From abddc13a130b955459e9b01056225d8730a85cd1 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 13:51:57 -0800 Subject: [PATCH 448/883] Adding \n to several logs and demoting two logs --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index b80ddbf22c..76521a5f3c 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -181,7 +181,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); for (int j = 0; j < uci_ind->num_ucis; j++) { - LOG_I(NR_MAC, "ul_config->ul_config_list[%d].pucch_config_pdu.n_bit = %d", i, ul_config->ul_config_list[i].pucch_config_pdu.n_bit); + LOG_I(NR_MAC, "ul_config->ul_config_list[%d].pucch_config_pdu.n_bit = %d\n", i, ul_config->ul_config_list[i].pucch_config_pdu.n_bit); if (ul_config->ul_config_list[i].pucch_config_pdu.n_bit > 3 && mac->nr_ue_emul_l1.num_csi_reports > 0) { uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 87f262dbe9..99d94e1a76 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -144,7 +144,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: { char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - LOG_D(NR_MAC, "RACH header id :%d", UL_INFO->rach_ind.header.message_id); + LOG_D(NR_MAC, "RACH header id :%d\n", UL_INFO->rach_ind.header.message_id); int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->rach_ind, buffer, sizeof(buffer), NULL); if (encoded_size <= 0) { @@ -164,7 +164,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: { char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - LOG_D(NR_MAC, "RX header id :%d", UL_INFO->rx_ind.header.message_id); + LOG_D(NR_MAC, "RX header id :%d\n", UL_INFO->rx_ind.header.message_id); int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->rx_ind, buffer, sizeof(buffer), NULL); if (encoded_size <= 0) { @@ -184,7 +184,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: { char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - LOG_D(NR_MAC, "CRC header id :%d", UL_INFO->crc_ind.header.message_id); + LOG_D(NR_MAC, "CRC header id :%d\n", UL_INFO->crc_ind.header.message_id); int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->crc_ind, buffer, sizeof(buffer), NULL); if (encoded_size <= 0) { @@ -204,7 +204,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: { char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - LOG_I(NR_MAC, "UCI header id :%d", UL_INFO->uci_ind.header.message_id); + LOG_I(NR_MAC, "UCI header id :%d\n", UL_INFO->uci_ind.header.message_id); int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->uci_ind, buffer, sizeof(buffer), NULL); if (encoded_size <= 0) { @@ -656,7 +656,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n "Too many pdus %d in ul_tti_req\n", num_pdus); if (!send_crc_ind_and_rx_ind(sfn_slot)) { - LOG_E(NR_MAC, "CRC_RX ind not sent\n"); + LOG_D(NR_MAC, "CRC_RX ind not sent\n"); if (!put_queue(&nr_ul_tti_req_queue, ul_tti_req)) { LOG_E(NR_PHY, "put_queue failed for ul_tti_req.\n"); @@ -758,7 +758,7 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, { frame = ul_tti_request->SFN; slot = ul_tti_request->Slot; - LOG_I(NR_PHY, "[%d, %d] ul_tti_request\n", frame, slot); + LOG_D(NR_PHY, "[%d, %d] ul_tti_request\n", frame, slot); copy_ul_tti_data_req_to_dl_info(&mac->dl_info, ul_tti_request); } else From 6de93fbb59208a5f0ba795675ffbac13cc652719 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 16:15:39 -0800 Subject: [PATCH 449/883] Only assigning harq_pid in emulated L1 mode. --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index b98a9c8789..146e2aa348 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1034,7 +1034,8 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t // Note: sdu should always be processed because data and timing advance updates are transmitted by the UE int8_t handle_dlsch(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){ - dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; + if (get_softmodem_params()->emulate_l1) + dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; update_harq_status(dl_info->module_id, dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid, From 9cd1a06115c0ae452f1956bef431f99487e3861a Mon Sep 17 00:00:00 2001 From: hardy Date: Sun, 13 Feb 2022 10:50:56 +0100 Subject: [PATCH 450/883] relaxing ping test acceptance threshold --- ci-scripts/xml_files/lte_2x2_tm1_quectel.xml | 2 +- ci-scripts/xml_files/lte_2x2_tm2_quectel.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml index 6cb7b2883b..11c4abce1b 100644 --- a/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml @@ -96,7 +96,7 @@ nrmodule2_quectel -c 100 -s 1024 -i 0,2 1 - 30 + 40 diff --git a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml index e6520fc5fc..714cf51a9b 100644 --- a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml @@ -96,7 +96,7 @@ nrmodule2_quectel -c 100 -s 1024 -i 0,2 1 - 30 + 40 From 6af9ac6c9c80e104a0ace8ce06ec14648b2a8ea3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 12 Feb 2022 21:12:30 +0100 Subject: [PATCH 451/883] Fix SA OAIUE N310 test's USRP IP address --- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index 55852ad79b..bfa2208d3d 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -42,7 +42,7 @@ Initialize_OAI_UE Initialize OAI UE (N310) nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,second_addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation --log_config.global_log_options level,nocolor,time + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation --log_config.global_log_options level,nocolor,time From 84eb7763bda9cae3dc4dc64ab017261e34a88116 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 15 Feb 2022 09:46:13 +0100 Subject: [PATCH 452/883] using config file parameters in init_codebook_gNB --- openair1/PHY/INIT/nr_init.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index a924a00fcb..e9bcc8fc98 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -75,25 +75,23 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { if(gNB->frame_parms.nb_antennas_tx>1){ //NR Codebook Generation for codebook type1 SinglePanel - //csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.present - int N1; - int N2; - int O1; - int O2; - int CSI_RS_antenna_ports; + int N1 = gNB->ap_N1; + int N2 = gNB->ap_N2; //Uniform Planner Array: UPA // X X X X ... X // X X X X ... X // N2 . . . . ... . // X X X X ... X // |<-----N1---->| - int x_polarization=2;//1 or 2 + int x_polarization = gNB->ap_XP; //Get the uniform planar array parameters - N2 = 1;//one-dimenstional array (1, 2, 3, 4 are supported in 5G) - O2 = 1;//Vertical beam oversampling (1 or 4) - N1 = gNB->frame_parms.nb_antennas_tx/(N2*x_polarization);// - O1=1;//Horizontal beam oversampling (1 or 4) - CSI_RS_antenna_ports=gNB->frame_parms.nb_antennas_tx; + // To be confirmed + int O2 = N2 > 1? 4 : 1; //Vertical beam oversampling (1 or 4) + int O1 = 4; //Horizontal beam oversampling (1 or 4) + int CSI_RS_antenna_ports = gNB->frame_parms.nb_antennas_tx; + AssertFatal(CSI_RS_antenna_ports == N1*N2*x_polarization, + "Nb of antenna ports at PHY %d does not correspond to what passed down with fapi %d\n", + N1*N2*x_polarization, CSI_RS_antenna_ports); LOG_D(PHY, "NR Codebook Config: antenna ports: %d N1 %d N2 %d\n",CSI_RS_antenna_ports,N1,N2); // Generation of codebook Type1 with codebookMode 1 (CSI_RS_antenna_ports < 16) From 67ca2759b2d16af25ecea9d6c17c40ea47791101 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 15 Feb 2022 13:13:15 +0100 Subject: [PATCH 453/883] remove-NR_UE_PBCH scope to finish --- openair1/PHY/INIT/nr_init_ue.c | 19 -- .../PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c | 5 +- .../nr_dl_channel_estimation.c | 120 ++++++------ openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 7 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 13 +- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 185 +++++++++--------- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 5 +- openair1/PHY/TOOLS/nr_phy_scope.c | 82 +++++--- openair1/PHY/TOOLS/phy_scope_interface.h | 12 +- openair1/PHY/defs_UE.h | 1 + openair1/PHY/defs_nr_UE.h | 38 +--- openair1/SCHED_NR_UE/defs.h | 8 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 36 ++-- .../SIMULATION/NR_PHY/nr_dummy_functions.c | 4 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 18 +- 15 files changed, 288 insertions(+), 265 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b571afe416..9266a1fecd 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -416,29 +416,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } // PBCH - pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); // prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); - for (i=0; inb_antennas_rx; i++) { - pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); - - for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) { - int idx = (j*fp->nb_antennas_rx)+i; - pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); - pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); - } - } } - - pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64); } // initialization for the last instance of pdsch_vars (used for MU-MIMO) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index 19d4bf5079..89d67408e1 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -36,6 +36,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, PHY_VARS_NR_UE *ue, module_id_t gNB_id, + const int estimateSz, struct complex16 dl_ch_estimates_time[][estimateSz], uint8_t frame, uint8_t subframe, unsigned char clear, @@ -60,8 +61,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, int j = (i < 0) ? (i + frame_parms->ofdm_symbol_size) : i; for (int aa = 0; aa < frame_parms->nb_antennas_rx; aa++) { - int Re = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[(j<<1)]; - int Im = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[1+(j<<1)]; + int Re = dl_ch_estimates_time[aa][j].r; + int Im = dl_ch_estimates_time[aa][j].i; temp += (Re*Re/2) + (Im*Im/2); } diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 30eae2d30f..8efe85b222 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -29,6 +29,7 @@ #include "PHY/NR_REFSIG/ptrs_nr.h" #include "PHY/NR_TRANSPORT/nr_sch_dmrs.h" #include "filt16a_32.h" +#include //#define DEBUG_PDSCH //#define DEBUG_PDCCH @@ -43,7 +44,6 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, NR_UE_SSB *current_ssb) { int pilot[200] __attribute__((aligned(16))); - unsigned char aarx; unsigned short k; unsigned int pilot_cnt; int16_t ch[2],*pil,*rxF; @@ -77,7 +77,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, // generate pilot nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]); - for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { + for (int aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { int re_offset = ssb_offset; pil = (int16_t *)&pilot[0]; @@ -197,6 +197,9 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, + int estimateSz, + struct complex16 dl_ch_estimates [][estimateSz], + struct complex16 dl_ch_estimates_time [][estimateSz], UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, unsigned char Ns, @@ -206,16 +209,14 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, uint8_t n_hf) { int pilot[200] __attribute__((aligned(16))); - unsigned char aarx,p; unsigned short k; unsigned int pilot_cnt; - int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr; + int16_t *pil,*rxF,*dl_ch,*fl,*fm,*fr; int ch_offset,symbol_offset; //int slot_pbch; uint8_t nushift; - int **dl_ch_estimates =ue->pbch_vars[gNB_id]->dl_ch_estimates; - int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; + int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; nushift = ue->frame_parms.Nid_cell%4; ue->frame_parms.nushift = nushift; @@ -269,17 +270,57 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, break; } + idft_size_idx_t idftsizeidx; + + switch (ue->frame_parms.ofdm_symbol_size) { + case 128: + idftsizeidx = IDFT_128; + break; + + case 256: + idftsizeidx = IDFT_256; + break; + + case 512: + idftsizeidx = IDFT_512; + break; + + case 1024: + idftsizeidx = IDFT_1024; + break; + + case 1536: + idftsizeidx = IDFT_1536; + break; + + case 2048: + idftsizeidx = IDFT_2048; + break; + + case 3072: + idftsizeidx = IDFT_3072; + break; + + case 4096: + idftsizeidx = IDFT_4096; + break; + + default: + printf("unsupported ofdm symbol size \n"); + assert(0); + } + // generate pilot nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]); - for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { + for (int aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { int re_offset = ssb_offset; pil = (int16_t *)&pilot[0]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset]; - memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size)); + memset(dl_ch,0,sizeof(*dl_ch)*(ue->frame_parms.ofdm_symbol_size)); #ifdef DEBUG_CH printf("pbch ch est pilot addr %p RB_DL %d\n",&pilot[0], ue->frame_parms.N_RB_DL); @@ -289,6 +330,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, #endif // Treat first 2 pilots specially (left edge) + int16_t ch[2]; ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -402,62 +444,18 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, } - idft_size_idx_t idftsizeidx; - - switch (ue->frame_parms.ofdm_symbol_size) { - case 128: - idftsizeidx = IDFT_128; - break; - - case 256: - idftsizeidx = IDFT_256; - break; - - case 512: - idftsizeidx = IDFT_512; - break; - - case 1024: - idftsizeidx = IDFT_1024; - break; - - case 1536: - idftsizeidx = IDFT_1536; - break; - - case 2048: - idftsizeidx = IDFT_2048; - break; - - case 3072: - idftsizeidx = IDFT_3072; - break; - - case 4096: - idftsizeidx = IDFT_4096; - break; - - default: - printf("unsupported ofdm symbol size \n"); - assert(0); - } - if( dmrss == 2) // update time statistics for last PBCH symbol { // do ifft of channel estimate - for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) - for (p=0; pframe_parms.nb_antenna_ports_gNB; p++) { - if (ue->pbch_vars[gNB_id]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx]) - { - LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d\n", Ns, proc->thread_id, symbol, ch_offset); - idft(idftsizeidx, - (int16_t*) &ue->pbch_vars[gNB_id]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx][ch_offset], - (int16_t*) ue->pbch_vars[gNB_id]->dl_ch_estimates_time[(p*ue->frame_parms.nb_antennas_rx)+aarx],1); - } - } - } - - } + LOG_D(PHY,"Channel Impulse Computation Slot %d Symbol %d ch_offset %d\n", Ns, symbol, ch_offset); + idft(idftsizeidx, + (int16_t*) &dl_ch_estimates[aarx][ch_offset], + (int16_t*) dl_ch_estimates_time[aarx], + 1); +} +} + if (dmrss == 2) + scopeCopy(ue, pbchDlChEstimateTime, dl_ch_estimates_time, sizeof(struct complex16), idftsizeidx, ue->frame_parms.nb_antennas_rx); return(0); } diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index c5330ce2f2..450631774e 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -56,7 +56,10 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, NR_UE_SSB *current_ssb); int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, + int estimateSz, + struct complex16 dl_ch_estimates [][estimateSz], + struct complex16 dl_ch_estimates_time [][estimateSz], + UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, unsigned char Ns, unsigned char symbol, @@ -78,6 +81,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, PHY_VARS_NR_UE *ue, module_id_t gNB_id, + int estimateSz, + struct complex16 dl_ch_estimates_time [][estimateSz], uint8_t frame, uint8_t subframe, unsigned char clear, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 8917a8bc1b..39dc183bc3 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -149,17 +149,22 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini start_meas(&ue->dlsch_channel_estimation_stats); // computing channel estimation for selected best ssb + const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size; + struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; + struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf); + nr_pbch_channel_estimation(ue,estimateSz, dl_ch_estimates, dl_ch_estimates_time, proc,0,0,i,i-pbch_initial_symbol,temp_ptr->i_ssb,temp_ptr->n_hf); stop_meas(&ue->dlsch_channel_estimation_stats); - + fapiPbch_t result; ret = nr_rx_pbch(ue, proc, - ue->pbch_vars[0], + estimateSz, dl_ch_estimates, + ue->pbch_vars[0], frame_parms, 0, temp_ptr->i_ssb, - SISO); + SISO, + &result); temp_ptr=temp_ptr->next_ssb; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index dff347f7c0..2b5cc6c3d6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -36,6 +36,7 @@ #include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/INIT/phy_init.h" #include "openair1/SCHED_NR_UE/defs.h" +#include //#define DEBUG_PBCH //#define DEBUG_PBCH_ENCODING @@ -46,16 +47,16 @@ #define print_shorts(s,x) printf("%s : %d,%d,%d,%d,%d,%d,%d,%d\n",s,((int16_t*)x)[0],((int16_t*)x)[1],((int16_t*)x)[2],((int16_t*)x)[3],((int16_t*)x)[4],((int16_t*)x)[5],((int16_t*)x)[6],((int16_t*)x)[7]) -uint16_t nr_pbch_extract(int **rxdataF, - int **dl_ch_estimates, - int **rxdataF_ext, - int **dl_ch_estimates_ext, +static uint16_t nr_pbch_extract(int **rxdataF, + const int estimateSz, + struct complex16 dl_ch_estimates[][estimateSz], + struct complex16 rxdataF_ext[][20*12*4], + struct complex16 dl_ch_estimates_ext[][20*12*4], uint32_t symbol, uint32_t s_offset, NR_DL_FRAME_PARMS *frame_parms) { uint16_t rb; uint8_t i,j,aarx; - int32_t *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext; int nushiftmod4 = frame_parms->nushift; AssertFatal(symbol>=1 && symbol<5, @@ -66,8 +67,8 @@ uint16_t nr_pbch_extract(int **rxdataF, unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier; rx_offset = (rx_offset)%(frame_parms->ofdm_symbol_size); - rxF = &rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size]; - rxF_ext = &rxdataF_ext[aarx][symbol*20*12]; + struct complex16 *rxF = (struct complex16 *)&rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size]; + struct complex16 *rxF_ext = rxdataF_ext[aarx]; #ifdef DEBUG_PBCH printf("extract_rbs (nushift %d): rx_offset=%d, symbol %u\n",frame_parms->nushift, (rx_offset + ((symbol+s_offset)*(frame_parms->ofdm_symbol_size))),symbol); @@ -76,7 +77,6 @@ uint16_t nr_pbch_extract(int **rxdataF, for (int i =0; i<8; i++) { printf("rxF [%d]= %d\n",i,rxF[i]); printf("pbch extract rxF %d %d addr %p\n", p[2*i], p[2*i+1], &p[2*i]); - printf("rxF ext addr %p\n", &rxF_ext[i]); } #endif @@ -134,11 +134,10 @@ uint16_t nr_pbch_extract(int **rxdataF, } } } - - dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))]; + struct complex16 *dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))]; //printf("dl_ch0 addr %p\n",dl_ch0); - dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*20*12]; + struct complex16 *dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*20*12]; for (rb=0; rb<20; rb++) { j=0; @@ -199,7 +198,7 @@ uint16_t nr_pbch_extract(int **rxdataF, //__m128i avg128; //compute average channel_level on each (TX,RX) antenna pair -int nr_pbch_channel_level(int **dl_ch_estimates_ext, +int nr_pbch_channel_level(struct complex16 dl_ch_estimates_ext[][20*12*4], NR_DL_FRAME_PARMS *frame_parms, uint32_t symbol) { int16_t rb, nb_rb=20; @@ -258,13 +257,13 @@ int nr_pbch_channel_level(int **dl_ch_estimates_ext, return(avg2); } -void nr_pbch_channel_compensation(int **rxdataF_ext, - int **dl_ch_estimates_ext, - int **rxdataF_comp, - NR_DL_FRAME_PARMS *frame_parms, - uint32_t symbol, - uint8_t output_shift) { - const uint16_t nb_re=symbol == 2 ? 72 : 180; +static void nr_pbch_channel_compensation(struct complex16 rxdataF_ext[][20*12*4], + struct complex16 dl_ch_estimates_ext[][20*12*4], + int cols, + struct complex16 rxdataF_comp[][cols], + NR_DL_FRAME_PARMS *frame_parms, + uint32_t symbol, + uint8_t output_shift) { AssertFatal((symbol > 0 && symbol < 4), "symbol %d is illegal for PBCH DM-RS\n", symbol); @@ -273,15 +272,15 @@ void nr_pbch_channel_compensation(int **rxdataF_ext, for (int aarx=0; aarxnb_antennas_rx; aarx++) { vect128 *dl_ch128 = (vect128 *)&dl_ch_estimates_ext[aarx][symbol*20*12]; - vect128 *rxdataF128 = (vect128 *)&rxdataF_ext[aarx][symbol*20*12]; - vect128 *rxdataF_comp128 = (vect128 *)&rxdataF_comp[aarx][symbol*20*12]; + vect128 *rxdataF128 = (vect128 *)rxdataF_ext[aarx]; + vect128 *rxdataF_comp128 = (vect128 *)rxdataF_comp[aarx]; /* printf("ch compensation dl_ch ext addr %p \n", &dl_ch_estimates_ext[aarx][symbol*20*12]); - printf("rxdataf ext addr %p symbol %d\n", &rxdataF_ext[aarx][symbol*20*12], symbol); + printf("rxdataf ext addr %p symbol %d\n", rxdataF_ext[aarx], symbol); printf("rxdataf_comp addr %p\n",&rxdataF_comp[aarx][symbol*20*12]); */ - for (int re=0; rellr; reset = 1; // x1 is set in first call to lte_gold_generic x2 = Nid; //this is c_init @@ -361,10 +362,10 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, reset = 0; } - (pbch->pbch_a_interleaved) ^= ((unscrambling_mask>>i)&1)? ((pbch->pbch_a_prime>>i)&1)<pbch_a_prime>>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)); + *pbch_a_interleaved ^= ((unscrambling_mask>>i)&1)? ((pbch_a_prime>>i)&1)<>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)); #ifdef DEBUG_PBCH_ENCODING - printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, pbch->pbch_a_interleaved, + printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, *pbch_a_interleaved, (!((unscrambling_mask>>i)&1))); #endif } else { @@ -386,7 +387,7 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, } } -void nr_pbch_quantize(int16_t *pbch_llr8, +static void nr_pbch_quantize(int16_t *pbch_llr8, int16_t *pbch_llr, uint16_t len) { uint16_t i; @@ -410,11 +411,13 @@ uint8_t pbch_deinterleaving_pattern[32] = {28,0,31,30,7,29,25,27,5,8,24,9,10,11, int nr_rx_pbch( PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, + int estimateSz, struct complex16 dl_ch_estimates [][estimateSz], NR_UE_PBCH *nr_ue_pbch_vars, NR_DL_FRAME_PARMS *frame_parms, uint8_t gNB_id, uint8_t i_ssb, - MIMO_mode_t mimo_mode) { + MIMO_mode_t mimo_mode, + fapiPbch_t* result) { NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars; int max_h=0; @@ -422,9 +425,6 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, //uint8_t pbch_a[64]; //FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for.. //uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); - //uint32_t pbch_a_prime; - int16_t *pbch_e_rx; - uint8_t *decoded_output = nr_ue_pbch_vars->decoded_output; uint8_t nushift; uint16_t M; uint8_t Lmax=frame_parms->Lmax; @@ -437,9 +437,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, // FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); //printf("nr_pbch_ue nid_cell %d\n",frame_parms->Nid_cell); - pbch_e_rx = &nr_ue_pbch_vars->llr[0]; - // clear LLR buffer - memset(nr_ue_pbch_vars->llr,0,NR_POLAR_PBCH_E); + int16_t pbch_e_rx[960]={0}; //Fixme: previous version erase only NR_POLAR_PBCH_E bytes + int pbch_e_rx_idx=0; int symbol_offset=1; if (ue->is_synchronized > 0) @@ -455,12 +454,19 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif // symbol refers to symbol within SSB. symbol_offset is the offset of the SSB wrt start of slot + double log2_maxh; for (symbol=1; symbol<4; symbol++) { - + const uint16_t nb_re=symbol == 2 ? 72 : 180; + struct complex16 rxdataF_ext[frame_parms->nb_antennas_rx][20*12*4]; + struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][nb_re]; + //was dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); + struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][20*12*4]; + nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, - nr_ue_pbch_vars->dl_ch_estimates, - nr_ue_pbch_vars->rxdataF_ext, - nr_ue_pbch_vars->dl_ch_estimates_ext, + estimateSz, + dl_ch_estimates, + rxdataF_ext, + dl_ch_estimates_ext, symbol, symbol_offset, frame_parms); @@ -470,115 +476,113 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif if (symbol == 1) { - max_h = nr_pbch_channel_level(nr_ue_pbch_vars->dl_ch_estimates_ext, + max_h = nr_pbch_channel_level(dl_ch_estimates_ext, frame_parms, symbol); - nr_ue_pbch_vars->log2_maxh = 3+(log2_approx(max_h)/2); + log2_maxh = 3+(log2_approx(max_h)/2); } #ifdef DEBUG_PBCH LOG_I(PHY,"[PHY] PBCH log2_maxh = %d (%d)\n",nr_ue_pbch_vars->log2_maxh,max_h); #endif - nr_pbch_channel_compensation(nr_ue_pbch_vars->rxdataF_ext, - nr_ue_pbch_vars->dl_ch_estimates_ext, - nr_ue_pbch_vars->rxdataF_comp, + nr_pbch_channel_compensation(rxdataF_ext, + dl_ch_estimates_ext, + nb_re, + rxdataF_comp, frame_parms, symbol, - nr_ue_pbch_vars->log2_maxh); // log2_maxh+I0_shift + log2_maxh); // log2_maxh+I0_shift /*if (frame_parms->nb_antennas_rx > 1) pbch_detection_mrc(frame_parms, - nr_ue_pbch_vars->rxdataF_comp, + rxdataF_comp, symbol);*/ /* if (mimo_mode == ALAMOUTI) { - nr_pbch_alamouti(frame_parms,nr_ue_pbch_vars->rxdataF_comp,symbol); + nr_pbch_alamouti(frame_parms,rxdataF_comp,symbol); } else if (mimo_mode != SISO) { LOG_I(PHY,"[PBCH][RX] Unsupported MIMO mode\n"); return(-1); } */ if (symbol==2) { - nr_pbch_quantize(pbch_e_rx, - (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][symbol*240]), + nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, + (short *)rxdataF_comp[0], 144); - pbch_e_rx+=144; + pbch_e_rx_idx+=144; } else { - nr_pbch_quantize(pbch_e_rx, - (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][symbol*240]), + nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, + (short *)rxdataF_comp[0], 360); - pbch_e_rx+=360; + pbch_e_rx_idx+=360; } } #ifdef DEBUG_PBCH - write_output("rxdataF_comp.m","rxFcomp",&nr_ue_pbch_vars->rxdataF_comp[0][240],240*3,1,1); + write_output("rxdataF_comp.m","rxFcomp",rxdataF_comp[0],240*3,1,1); #endif - pbch_e_rx = nr_ue_pbch_vars->llr; //demod_pbch_e = nr_ue_pbch_vars->demod_pbch_e; // FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a; #ifdef DEBUG_PBCH - //pbch_e_rx = &nr_ue_pbch_vars->llr[0]; - short *p = (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][20*12]); + short *p = (short *)rxdataF_comp[0]); - for (int cnt = 0; cnt < 864 ; cnt++) +for (int cnt = 0; cnt < 864 ; cnt++) printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); #endif //un-scrambling - M = NR_POLAR_PBCH_E; - nushift = (Lmax==4)? i_ssb&3 : i_ssb&7; +M = NR_POLAR_PBCH_E; +nushift = (Lmax==4)? i_ssb&3 : i_ssb&7; uint32_t unscrambling_mask = (Lmax==64)?0x100006D:0x1000041; - - nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0); + uint32_t pbch_a_interleaved=0; +uint32_t pbch_a_prime=0; +nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); //polar decoding de-rate matching const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); - decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,currentPtr); + decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&pbch_a_prime,0,currentPtr); if(decoderState) return(decoderState); - // printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime); + // printf("polar decoder output 0x%08x\n",pbch_a_prime); // Decoder reversal uint32_t a_reversed=0; for (int i=0; ipbch_a_prime>>i)&1)<<(31-i); + a_reversed |= (((uint64_t)pbch_a_prime>>i)&1)<<(31-i); - nr_ue_pbch_vars->pbch_a_prime = a_reversed; + pbch_a_prime = a_reversed; //payload un-scrambling - nr_ue_pbch_vars->pbch_a_interleaved=0; M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3); - nushift = ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) ^ (((nr_ue_pbch_vars->pbch_a_prime>>6)&1)<<1); - nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask); - //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((nr_ue_pbch_vars->pbch_a_prime>>6)&1), ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) ); + nushift = ((pbch_a_prime>>24)&1) ^ (((pbch_a_prime>>6)&1)<<1); +nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask,pbch_a_prime, &pbch_a_interleaved); + //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((pbch_a_prime>>6)&1), ((pbch_a_prime>>24)&1) ); //payload deinterleaving //uint32_t in=0; uint32_t out=0; for (int i=0; i<32; i++) { - out |= ((nr_ue_pbch_vars->pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); + out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); #ifdef DEBUG_PBCH - printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, nr_ue_pbch_vars->pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (nr_ue_pbch_vars->pbch_a_interleaved>>i)&1); + printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (pbch_a_interleaved>>i)&1); #endif } uint32_t payload = 0; - //uint8_t xtra_byte = 0; - nr_ue_pbch_vars->xtra_byte = (out>>24)&0xff; + result->xtra_byte = (out>>24)&0xff; for (int i=0; i>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1); for (int i=0; i<3; i++) - decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); + result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); - frame_parms->half_frame_bit = ((nr_ue_pbch_vars->xtra_byte>>4)&0x01); // computing the half frame index from the extra byte +frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half frame index from the extra byte frame_parms->ssb_index = i_ssb; // ssb index corresponds to i_ssb for Lmax = 4,8 if (Lmax == 64) { // for Lmax = 64 ssb index 4th,5th and 6th bits are in extra byte for (int i=0; i<3; i++) - frame_parms->ssb_index += (((nr_ue_pbch_vars->xtra_byte>>(7-i))&0x01)<<(3+i)); + frame_parms->ssb_index += (((result->xtra_byte>>(7-i))&0x01)<<(3+i)); } ue->symbol_offset = nr_get_ssb_start_symbol(frame_parms,frame_parms->ssb_index); @@ -587,25 +591,26 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, uint8_t frame_number_4lsb = 0; for (int i=0; i<4; i++) - frame_number_4lsb |= ((nr_ue_pbch_vars->xtra_byte>>i)&1)<<(3-i); + frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i); proc->decoded_frame_rx = frame_number_4lsb; #ifdef DEBUG_PBCH - printf("xtra_byte %x payload %x\n", nr_ue_pbch_vars->xtra_byte, payload); + printf("xtra_byte %x payload %x\n", xtra_byte, payload); for (int i=0; i<(NR_POLAR_PBCH_PAYLOAD_BITS>>3); i++) { // printf("unscrambling pbch_a[%d] = %x \n", i,pbch_a[i]); - printf("[PBCH] decoder payload[%d] = %x\n",i,decoded_output[i]); + printf("[PBCH] decoder payload[%d] = %x\n",i,result->decoded_output[i]); } #endif nr_downlink_indication_t dl_indication; - fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); - uint16_t number_pdus = 1; +fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); +uint16_t number_pdus = 1; - nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); +nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + +nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void*)result); if (ue->if_inst && ue->if_inst->dl_indication) ue->if_inst->dl_indication(&dl_indication, NULL); 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 239731208e..e53cfde51b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1153,11 +1153,14 @@ int rx_sss(PHY_VARS_NR_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uin */ 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); + MIMO_mode_t mimo_mode, + fapiPbch_t* result); int nr_pbch_detection(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index 5594d56693..a31414946f 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -40,6 +40,9 @@ const FL_COLOR water_colors[4] = {FL_BLUE,FL_GREEN,FL_YELLOW,FL_RED}; typedef struct complex16 scopeSample_t; #define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i) +typedef struct { +} scopeGraphData_t; + typedef struct OAIgraph { FL_OBJECT *graph; FL_OBJECT *text; @@ -56,7 +59,7 @@ typedef struct OAIgraph { boolean_t initDone; int iteration; void (*gNBfunct) (struct OAIgraph *graph, scopeData_t *p, int UE_id); - void (*nrUEfunct)(struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); + void (*nrUEfunct)(scopeGraphData_t** data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); } OAIgraph_t; /* Forms and Objects */ @@ -140,7 +143,7 @@ static OAIgraph_t gNBcommonGraph( void (*funct) (OAIgraph_t *graph, scopeData_t return graph; } -static OAIgraph_t nrUEcommonGraph( void (*funct) (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id), +static OAIgraph_t nrUEcommonGraph( void (*funct) (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id), int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_COLOR pointColor) { OAIgraph_t graph; commonGraph(&graph, type, x, y, w, h, label, pointColor); @@ -341,7 +344,7 @@ static void timeResponse (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { static void gNBfreqWaterFall (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { NR_DL_FRAME_PARMS *frame_parms=&p->gNB->frame_parms; //use 1st antenna - genericWaterFall(graph, (scopeSample_t *)p->rxdataF, frame_parms->samples_per_frame_wCP, + genericWaterFall(graph, (scopeSample_t *)p->liveData, frame_parms->samples_per_frame_wCP, frame_parms->slots_per_frame, "X axis: Frequency domain, one subframe"); } @@ -515,6 +518,7 @@ void phy_scope_gNB(OAI_phy_scope_t *form, //fl_check_forms(); } + static void *scope_thread_gNB(void *arg) { scopeData_t *p=(scopeData_t *) arg; size_t stksize=0; @@ -539,11 +543,12 @@ static void *scope_thread_gNB(void *arg) { return NULL; } + static void copyRxdataF(int32_t *data, int slot, void *scopeData) { scopeData_t *scope=(scopeData_t *)scopeData; - memcpy(scope->rxdataF + slot*scope->gNB->frame_parms.samples_per_slot_wCP, + memcpy(((int32_t*)scope->liveData) + slot*scope->gNB->frame_parms.samples_per_slot_wCP, data, - scope->gNB->frame_parms.samples_per_slot_wCP); + scope->gNB->frame_parms.samples_per_slot_wCP*sizeof(int32_t)); } void gNBinitScope(scopeParms_t *p) { @@ -554,11 +559,11 @@ void gNBinitScope(scopeParms_t *p) { scope->ru=p->ru; scope->gNB=p->gNB; scope->slotFunc=copyRxdataF; - AssertFatal(scope->rxdataF=(int32_t *) calloc(p->gNB->frame_parms.samples_per_frame_wCP*sizeof(int32_t),1),""); + AssertFatal(scope->liveData= calloc(p->gNB->frame_parms.samples_per_frame_wCP*sizeof(int32_t),1),""); pthread_t forms_thread; threadCreate(&forms_thread, scope_thread_gNB, p->gNB->scopeData, "scope", -1, OAI_PRIORITY_RT_LOW); } -static void ueWaterFall (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void ueWaterFall (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // Received signal in time domain of receive antenna 0 genericWaterFall(graph, (scopeSample_t *) phy_vars_ue->common_vars.rxdata[0], @@ -574,13 +579,18 @@ static void ueTimeResponse (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int phy_vars_ue->frame_parms.samples_per_frame); } */ -static void ueChannelResponse (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { + +static void ueChannelResponse (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // Channel Impulse Response + if (!data[pbchDlChEstimateTime]) + return; + genericPowerPerAntena(graph, phy_vars_ue->frame_parms.nb_antennas_rx, - (const scopeSample_t **) phy_vars_ue->pbch_vars[eNB_id]->dl_ch_estimates_time, + (const scopeSample_t **) &data[pbchDlChEstimateTime], phy_vars_ue->frame_parms.ofdm_symbol_size>>3); } -static void ueFreqWaterFall (OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) { + +static void ueFreqWaterFall (scopeGraphData_t **data, OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) { NR_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->frame_parms; //use 1st antenna genericWaterFall(graph, @@ -624,12 +634,12 @@ static void uePbchFrequencyResp (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue oai_xygraph(graph,freq,chest_f_abs,frame_parms->ofdm_symbol_size,0,10); } */ -static void uePbchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PBCH LLRs - if ( !phy_vars_ue->pbch_vars[eNB_id]->llr) + if ( !data[pbchLlr]) return; - int16_t *pbch_llr = (int16_t *) phy_vars_ue->pbch_vars[eNB_id]->llr; + int16_t *pbch_llr = (int16_t *)data[pbchLlr]; float *llr_pbch, *bit_pbch; oai_xygraph_getbuff(graph, &bit_pbch, &llr_pbch, 864, 0); @@ -639,12 +649,13 @@ static void uePbchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_ oai_xygraph(graph,bit_pbch,llr_pbch,864,0,10); } -static void uePbchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePbchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PBCH I/Q of MF Output - if (!phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]) - return; - scopeSample_t *pbch_comp = (scopeSample_t *) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]; + if (!data[pbchRxdataF_comp]) + return; + + scopeSample_t *pbch_comp = (scopeSample_t *) data[pbchRxdataF_comp]; float *I, *Q; oai_xygraph_getbuff(graph, &I, &Q, 180*3, 0); memset(I,0,180*3*sizeof(*I)); @@ -673,7 +684,7 @@ static void uePbchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_i AssertFatal(base <= 180*3,""); oai_xygraph(graph,I,Q,base,0, 10); } -static void uePcchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePcchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDCCH LLRs if (!phy_vars_ue->pdcch_vars[0][eNB_id]->llr) return; @@ -698,7 +709,7 @@ static void uePcchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_ AssertFatal(base <= coded_bits_per_codeword*RX_NB_TH_MAX, ""); oai_xygraph(graph,bit,llr,base,0,10); } -static void uePcchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePcchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDCCH I/Q of MF Output if (!phy_vars_ue->pdcch_vars[0][eNB_id]->rxdataF_comp[0]) return; @@ -722,7 +733,7 @@ static void uePcchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_i AssertFatal(base <= nb*RX_NB_TH_MAX, ""); oai_xygraph(graph,I,Q,base,0,10); } -static void uePdschLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePdschLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDSCH LLRs if (!phy_vars_ue->pdsch_vars[0][eNB_id]->llr[0]) return; @@ -749,7 +760,7 @@ static void uePdschLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB //fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword); oai_xygraph(graph,bit,llr,base,0,10); } -static void uePdschIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePdschIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDSCH I/Q of MF Output if (!phy_vars_ue->pdsch_vars[0][eNB_id]->rxdataF_comp0[0]) return; @@ -776,7 +787,7 @@ static void uePdschIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_ AssertFatal(base <= sz*RX_NB_TH_MAX, ""); oai_xygraph(graph,I,Q,sz*RX_NB_TH_MAX,0,10); } -static void uePdschThroughput (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePdschThroughput (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { /* float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; @@ -869,7 +880,9 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) { fl_show_form (fdui->phy_scope, FL_PLACE_HOTSPOT, FL_FULLBORDER, buf); return fdui; } -void phy_scope_nrUE(OAI_phy_scope_t *form, + +void phy_scope_nrUE(scopeGraphData_t **UEliveData, + OAI_phy_scope_t *form, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { @@ -886,12 +899,13 @@ void phy_scope_nrUE(OAI_phy_scope_t *form, int i=0; while (form->graph[i].graph) { - form->graph[i].nrUEfunct(form->graph+i, phy_vars_ue, eNB_id, UE_id); + form->graph[i].nrUEfunct(UEliveData, form->graph+i, phy_vars_ue, eNB_id, UE_id); i++; } //fl_check_forms(); } + static void *nrUEscopeThread(void *arg) { PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg; size_t stksize; @@ -903,9 +917,12 @@ static void *nrUEscopeThread(void *arg) { fl_initialize (&fl_argc, &name, NULL, 0, 0); OAI_phy_scope_t *form_nrue=create_phy_scope_nrue(0); + scopeGraphData_t *UEliveData[UEdataTypeNumberOfItems]; + while (!oai_exit) { fl_freeze_form(form_nrue->phy_scope); - phy_scope_nrUE(form_nrue, + phy_scope_nrUE(UEliveData, + form_nrue, ue, 0,0); fl_unfreeze_form(form_nrue->phy_scope); @@ -915,10 +932,19 @@ static void *nrUEscopeThread(void *arg) { pthread_exit((void *)arg); } -void nrUEinitScope(PHY_VARS_NR_UE *ue) { - pthread_t forms_thread; - threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); + +void UEcopyData(enum UEdataType type, void * data, int elementSz, int colSz, int lineSz) { + } + +void nrUEinitScope(PHY_VARS_NR_UE *ue) { + AssertFatal(ue->scopeData=malloc(sizeof(scopeData_t)),""); + scopeData_t *scope=(scopeData_t *) ue->scopeData; + scope->copyData=UEcopyData; + pthread_t forms_thread; + threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); +} + void nrscope_autoinit(void *dataptr) { AssertFatal( (IS_SOFTMODEM_GNB_BIT||IS_SOFTMODEM_5GUE_BIT),"Scope cannot find NRUE or GNB context"); diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h index 8b747d575d..1ba6bb558d 100644 --- a/openair1/PHY/TOOLS/phy_scope_interface.h +++ b/openair1/PHY/TOOLS/phy_scope_interface.h @@ -32,6 +32,7 @@ #ifndef __PHY_SCOPE_INTERFACE_H__ #define __PHY_SCOPE_INTERFACE_H__ #include + typedef struct { int *argc; char **argv; @@ -39,16 +40,25 @@ typedef struct { PHY_VARS_gNB *gNB; } scopeParms_t; +enum UEdataType { + pbchDlChEstimateTime, + pbchLlr, + pbchRxdataF_comp, + UEdataTypeNumberOfItems +}; typedef struct scopeData_s { int *argc; char **argv; RU_t *ru; PHY_VARS_gNB *gNB; - int32_t * rxdataF; + void * liveData; void (*slotFunc)(int32_t* data, int slot, void * scopeData); + void (*copyData)(enum UEdataType, void * data, int elementSz, int colSz, int lineSz); } scopeData_t; int load_softscope(char *exectype, void *initarg); int end_forms(void) ; + +#define scopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(type, ##__VA_ARGS__); #endif diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 2d2697a4b7..6a855d3af6 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -839,6 +839,7 @@ typedef struct { /// RF and Interface devices per CC openair0_device rfdevice; + void *scopeData; } PHY_VARS_UE; /* this structure is used to pass both UE phy vars and diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index bca956bf75..d8c274de45 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -655,40 +655,6 @@ typedef struct { #define PBCH_A 24 typedef struct { - /// \brief Pointers to extracted PBCH symbols in frequency-domain. - /// - first index: rx antenna [0..nb_antennas_rx[ - /// - second index: ? [0..287] (hard coded) - int32_t **rxdataF_ext; - /// \brief Pointers to extracted and compensated PBCH symbols in frequency-domain. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..287] (hard coded) - int32_t **rxdataF_comp; - /// \brief Hold the channel estimates in frequency domain. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[ - int32_t **dl_ch_estimates; - /// \brief Pointers to downlink channel estimates in frequency-domain extracted in PRBS. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..287] (hard coded) - int32_t **dl_ch_estimates_ext; - /// \brief Hold the channel estimates in time domain (used for tracking). - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: samples? [0..2*ofdm_symbol_size[ - int32_t **dl_ch_estimates_time; - int log2_maxh; - uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; - uint32_t pbch_a_interleaved; - uint32_t pbch_a_prime; - uint8_t pbch_e[NR_POLAR_PBCH_E]; - int16_t demod_pbch_e[NR_POLAR_PBCH_E]; - /// \brief Pointer to PBCH llrs. - /// - first index: ? [0..1919] (hard coded) - int16_t *llr; - /// \brief Pointer to PBCH decoded output. - /// - first index: ? [0..63] (hard coded) - uint8_t *decoded_output; - /// \brief PBCH additional bits - uint8_t xtra_byte; /// \brief Total number of PDU errors. uint32_t pdu_errors; /// \brief Total number of PDU errors 128 frames ago. @@ -696,7 +662,7 @@ typedef struct { /// \brief Total number of consecutive PDU errors. uint32_t pdu_errors_conseq; /// \brief FER (in percent) . - uint32_t pdu_fer; + //uint32_t pdu_fer; } NR_UE_PBCH; typedef struct { @@ -1075,7 +1041,7 @@ typedef struct { #endif int dl_stats[5]; - + void* scopeData; } PHY_VARS_NR_UE; /* this structure is used to pass both UE phy vars and diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index b85d4c1b50..acdf88018a 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -82,6 +82,11 @@ #define DAQ_AGC_OFF 0 +typedef struct { + uint8_t decoded_output[64]; + uint8_t xtra_byte; +} fapiPbch_t; + /** @addtogroup _PHY_PROCEDURES_ * @{ */ @@ -398,7 +403,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, uint16_t n_pdus, - UE_nr_rxtx_proc_t *proc); + UE_nr_rxtx_proc_t *proc, + void * typeSpecific); bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 97a7e2e489..12a8ce0d08 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -118,7 +118,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, uint16_t n_pdus, - UE_nr_rxtx_proc_t *proc ){ + UE_nr_rxtx_proc_t *proc, + void * typeSpecific){ NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; @@ -162,8 +163,11 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu_length = dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8; break; case FAPI_NR_RX_PDU_TYPE_SSB: - rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu = ue->pbch_vars[gNB_id]->decoded_output; - rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.additional_bits = ue->pbch_vars[gNB_id]->xtra_byte; + rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu=malloc(sizeof(((fapiPbch_t*)typeSpecific)->decoded_output)); + memcpy(rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu, + ((fapiPbch_t*)typeSpecific)->decoded_output, + sizeof(((fapiPbch_t*)typeSpecific)->decoded_output)); + rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.additional_bits = ((fapiPbch_t*)typeSpecific)->xtra_byte; rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_index = (frame_parms->ssb_index)&0x7; rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_length = frame_parms->Lmax; rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.cell_id = frame_parms->Nid_cell; @@ -353,10 +357,9 @@ void nr_ue_measurement_procedures(uint16_t l, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_MEASUREMENT_PROCEDURES, VCD_FUNCTION_OUT); } -void nr_ue_pbch_procedures(uint8_t gNB_id, +static void nr_ue_pbch_procedures(uint8_t gNB_id, PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, - uint8_t abstraction_flag) + UE_nr_rxtx_proc_t *proc,int estimateSz, struct complex16 dl_ch_estimates[][estimateSz]) { int ret = 0; @@ -368,13 +371,15 @@ void nr_ue_pbch_procedures(uint8_t gNB_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PBCH_PROCEDURES, VCD_FUNCTION_IN); LOG_D(PHY,"[UE %d] Frame %d Slot %d, Trying PBCH (NidCell %d, gNB_id %d)\n",ue->Mod_id,frame_rx,nr_slot_rx,ue->frame_parms.Nid_cell,gNB_id); - + fapiPbch_t result; ret = nr_rx_pbch(ue, proc, + estimateSz, dl_ch_estimates, ue->pbch_vars[gNB_id], &ue->frame_parms, gNB_id, (ue->frame_parms.ssb_index)&7, - SISO); + SISO, + &result); if (ret==0) { @@ -444,7 +449,6 @@ void nr_ue_pbch_procedures(uint8_t gNB_id, } if (frame_rx % 100 == 0) { - ue->pbch_vars[gNB_id]->pdu_fer = ue->pbch_vars[gNB_id]->pdu_errors - ue->pbch_vars[gNB_id]->pdu_errors_last; ue->pbch_vars[gNB_id]->pdu_errors_last = ue->pbch_vars[gNB_id]->pdu_errors; } @@ -794,16 +798,16 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, switch (pdsch) { case RA_PDSCH: nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL); ue->UE_mode[gNB_id] = RA_RESPONSE; break; case PDSCH: nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL); break; case SI_PDSCH: nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL); break; default: break; @@ -1399,6 +1403,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if (slot_ssb) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN); LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); + const int estimateSz=7*2*sizeof(int)*fp->ofdm_symbol_size; + struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz]; + struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][estimateSz]; for (int i=1; i<4; i++) { nr_slot_fep(ue, @@ -1408,7 +1415,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, start_meas(&ue->dlsch_channel_estimation_stats); - nr_pbch_channel_estimation(ue,proc,gNB_id,nr_slot_rx,(ue->symbol_offset+i)%(fp->symbols_per_slot),i-1,(fp->ssb_index)&7,fp->half_frame_bit); + nr_pbch_channel_estimation(ue, estimateSz, dl_ch_estimates, dl_ch_estimates_time,proc,gNB_id,nr_slot_rx,(ue->symbol_offset+i)%(fp->symbols_per_slot),i-1,(fp->ssb_index)&7,fp->half_frame_bit); stop_meas(&ue->dlsch_channel_estimation_stats); } @@ -1417,13 +1424,14 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); - nr_ue_pbch_procedures(gNB_id, ue, proc, 0); + nr_ue_pbch_procedures(gNB_id, ue, proc, estimateSz, dl_ch_estimates); if (ue->no_timing_correction==0) { LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction); nr_adjust_synch_ue(fp, ue, gNB_id, + estimateSz, dl_ch_estimates_time, frame_rx, nr_slot_rx, 0, diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c index 7a47410129..351c2f33c4 100644 --- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c +++ b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c @@ -1,5 +1,6 @@ #include "nfapi/oai_integration/vendor_ext.h" + int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); } int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); } int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); } @@ -35,4 +36,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, uint16_t n_pdus, - UE_nr_rxtx_proc_t *proc) {} + UE_nr_rxtx_proc_t *proc, + void * typeSpecific ) {} diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index c6b547cd79..692d1bac20 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -720,6 +720,9 @@ int main(int argc, char **argv) UE_nr_rxtx_proc_t proc={0}; UE->rx_offset=0; uint8_t ssb_index = 0; + const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size; + struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; + struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb UE->symbol_offset = nr_get_ssb_start_symbol(frame_parms,ssb_index); @@ -730,17 +733,20 @@ int main(int argc, char **argv) i%frame_parms->symbols_per_slot, ssb_slot); - nr_pbch_channel_estimation(UE,&proc,0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf); + nr_pbch_channel_estimation(UE,estimateSz, dl_ch_estimates, dl_ch_estimates_time, &proc, + 0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf); } - + fapiPbch_t result; ret = nr_rx_pbch(UE, &proc, - UE->pbch_vars[0], + estimateSz, dl_ch_estimates, + UE->pbch_vars[0], frame_parms, 0, ssb_index%8, - SISO); + SISO, + &result); if (ret==0) { //UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically @@ -749,9 +755,9 @@ int main(int argc, char **argv) for (int i=0; i<8; i++) gNB_xtra_byte |= ((gNB->pbch.pbch_a>>(31-i))&1)<<(7-i); - payload_ret = (UE->pbch_vars[0]->xtra_byte == gNB_xtra_byte); + payload_ret = (result.xtra_byte == gNB_xtra_byte); for (i=0;i<3;i++){ - payload_ret += (UE->pbch_vars[0]->decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff)); + payload_ret += (result.decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff)); } //printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->pbch_vars[0]->xtra_byte); //printf("ret %d\n", payload_ret); From 50b0abc18d4ea0fbf6b905878a618a2e309ee478 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 15 Feb 2022 15:29:48 +0100 Subject: [PATCH 454/883] testing highest mcs for 256qam --- cmake_targets/autotests/test_case_list.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 19421a97ab..380f80f46d 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1121,7 +1121,7 @@ -n100 -R217 -a110 -s5 -b100 -n100 -e27 -s30 -n100 -e16 -s10 - -n100 -q1 -e26 -s30 + -n100 -q1 -e27 -s30 -n100 -s1 -t25 -n100 -s1 -t33 -n100 -s1 -t50 From 39d9febc0c376bcf800afbbdf2715c80c25a8eb6 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 15 Feb 2022 08:39:55 -0800 Subject: [PATCH 455/883] Hardcoding TI and UL_CQI in stub function. Also, the allocation of the eNB measurement report keeps getting commented out becasue the compiler throws an error. I have un-commented the allocation of memory (becasue it breaks NSA mode) and added a memset to ensure we are using the allocated memory. This gets rid of the warning and ensures NSA mode still works. --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 6 +++--- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4f4757ec5a..5b13b2e9d0 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -90,8 +90,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu)); memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu)); rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; - rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; - rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi; + rx_ind->pdu_list[j].timing_advance = 31; + rx_ind->pdu_list[j].ul_cqi = 255; char buffer[1024]; hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer)); LOG_D(NR_MAC, "Hexdump of pdu %s before queuing rx_ind\n", @@ -113,7 +113,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb; crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti; crc_ind->crc_list[j].tb_crc_status = 0; - crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance; + crc_ind->crc_list[j].timing_advance = 31; crc_ind->crc_list[j].ul_cqi = 255; } diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index b069591316..349441544d 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,9 +4293,8 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; - //asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); - //measresult_cgi2->cellGlobalId= {0}; - //measresult_cgi2->trackingAreaCode= {0}; + asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + memset(measresult_cgi2, 0, sizeof(LTE_CellGlobalIdEUTRA_t)); struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; asn1cCallocOne(measResult->rsrpResult, rsrp_tar); asn1cCallocOne(measResult->rsrqResult, rsrq_tar); From 6054d3aecc19c366a21ca45b33e8ade18ac09e7d Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 15 Feb 2022 17:44:24 +0100 Subject: [PATCH 456/883] finish remove global vars for UE PBCH --- .../nr_dl_channel_estimation.c | 2 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 3 +- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 147 +++++++++--------- openair1/PHY/TOOLS/nr_phy_scope.c | 105 +++++++------ openair1/PHY/TOOLS/phy_scope_interface.h | 9 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 2 +- 6 files changed, 141 insertions(+), 127 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 8efe85b222..12c78a08fb 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -455,7 +455,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, } } if (dmrss == 2) - scopeCopy(ue, pbchDlChEstimateTime, dl_ch_estimates_time, sizeof(struct complex16), idftsizeidx, ue->frame_parms.nb_antennas_rx); + UEscopeCopy(ue, pbchDlChEstimateTime, (void*)dl_ch_estimates_time, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx, idftsizeidx); return(0); } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 39dc183bc3..3dc0d79e35 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -153,7 +153,8 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf); + nr_pbch_channel_estimation(ue,estimateSz, dl_ch_estimates, dl_ch_estimates_time, + proc,0,0,i,i-pbch_initial_symbol,temp_ptr->i_ssb,temp_ptr->n_hf); stop_meas(&ue->dlsch_channel_estimation_stats); fapiPbch_t result; ret = nr_rx_pbch(ue, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 2b5cc6c3d6..0073e8344d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -37,28 +37,28 @@ #include "PHY/INIT/phy_init.h" #include "openair1/SCHED_NR_UE/defs.h" #include +#include -//#define DEBUG_PBCH +//#define DEBUG_PBCH //#define DEBUG_PBCH_ENCODING - //#include "PHY_INTERFACE/defs.h" +//#include "PHY_INTERFACE/defs.h" #define PBCH_A 24 #define print_shorts(s,x) printf("%s : %d,%d,%d,%d,%d,%d,%d,%d\n",s,((int16_t*)x)[0],((int16_t*)x)[1],((int16_t*)x)[2],((int16_t*)x)[3],((int16_t*)x)[4],((int16_t*)x)[5],((int16_t*)x)[6],((int16_t*)x)[7]) static uint16_t nr_pbch_extract(int **rxdataF, - const int estimateSz, - struct complex16 dl_ch_estimates[][estimateSz], - struct complex16 rxdataF_ext[][20*12*4], - struct complex16 dl_ch_estimates_ext[][20*12*4], - uint32_t symbol, - uint32_t s_offset, - NR_DL_FRAME_PARMS *frame_parms) { + const int estimateSz, + struct complex16 dl_ch_estimates[][estimateSz], + struct complex16 rxdataF_ext[][20*12*4], + struct complex16 dl_ch_estimates_ext[][20*12*4], + uint32_t symbol, + uint32_t s_offset, + NR_DL_FRAME_PARMS *frame_parms) { uint16_t rb; uint8_t i,j,aarx; int nushiftmod4 = frame_parms->nushift; - AssertFatal(symbol>=1 && symbol<5, "symbol %d illegal for PBCH extraction\n", symbol); @@ -66,7 +66,6 @@ static uint16_t nr_pbch_extract(int **rxdataF, for (aarx=0; aarxnb_antennas_rx; aarx++) { unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier; rx_offset = (rx_offset)%(frame_parms->ofdm_symbol_size); - struct complex16 *rxF = (struct complex16 *)&rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size]; struct complex16 *rxF_ext = rxdataF_ext[aarx]; #ifdef DEBUG_PBCH @@ -103,7 +102,7 @@ static uint16_t nr_pbch_extract(int **rxdataF, rx_offset=(rx_offset+1)%(frame_parms->ofdm_symbol_size); //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1); - } + } rxF_ext+=9; } else { //symbol 2 @@ -129,11 +128,12 @@ static uint16_t nr_pbch_extract(int **rxdataF, } rxF_ext+=9; - } else{ //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12); - rx_offset = (rx_offset+12)%(frame_parms->ofdm_symbol_size); - } + } else { //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12); + rx_offset = (rx_offset+12)%(frame_parms->ofdm_symbol_size); + } } } + struct complex16 *dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))]; //printf("dl_ch0 addr %p\n",dl_ch0); @@ -258,12 +258,12 @@ int nr_pbch_channel_level(struct complex16 dl_ch_estimates_ext[][20*12*4], } static void nr_pbch_channel_compensation(struct complex16 rxdataF_ext[][20*12*4], - struct complex16 dl_ch_estimates_ext[][20*12*4], - int cols, - struct complex16 rxdataF_comp[][cols], - NR_DL_FRAME_PARMS *frame_parms, - uint32_t symbol, - uint8_t output_shift) { + struct complex16 dl_ch_estimates_ext[][20*12*4], + int cols, + struct complex16 rxdataF_comp[][cols], + NR_DL_FRAME_PARMS *frame_parms, + uint32_t symbol, + uint8_t output_shift) { AssertFatal((symbol > 0 && symbol < 4), "symbol %d is illegal for PBCH DM-RS\n", symbol); @@ -326,15 +326,15 @@ void nr_pbch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, } static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, - int16_t *demod_pbch_e, + int16_t *demod_pbch_e, uint16_t Nid, uint8_t nushift, uint16_t M, uint16_t length, uint8_t bitwise, - uint32_t unscrambling_mask, - uint32_t pbch_a_prime, - uint32_t *pbch_a_interleaved) { + uint32_t unscrambling_mask, + uint32_t pbch_a_prime, + uint32_t *pbch_a_interleaved) { uint8_t reset, offset; uint32_t x1, x2, s=0; uint8_t k=0; @@ -362,10 +362,10 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, reset = 0; } - *pbch_a_interleaved ^= ((unscrambling_mask>>i)&1)? ((pbch_a_prime>>i)&1)<>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)); + *pbch_a_interleaved ^= ((unscrambling_mask>>i)&1)? ((pbch_a_prime>>i)&1)<>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)); #ifdef DEBUG_PBCH_ENCODING - printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, *pbch_a_interleaved, + printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, *pbch_a_interleaved, (!((unscrambling_mask>>i)&1))); #endif } else { @@ -388,17 +388,15 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, } static void nr_pbch_quantize(int16_t *pbch_llr8, - int16_t *pbch_llr, - uint16_t len) { - uint16_t i; - - for (i=0; i31) pbch_llr8[i]=32; else if (pbch_llr[i]<-31) pbch_llr8[i]=-32; else - pbch_llr8[i] = (char)(pbch_llr[i]); + pbch_llr8[i]=pbch_llr[i]; } } /* @@ -411,33 +409,32 @@ uint8_t pbch_deinterleaving_pattern[32] = {28,0,31,30,7,29,25,27,5,8,24,9,10,11, int nr_rx_pbch( PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, - int estimateSz, struct complex16 dl_ch_estimates [][estimateSz], + int estimateSz, struct complex16 dl_ch_estimates [][estimateSz], NR_UE_PBCH *nr_ue_pbch_vars, NR_DL_FRAME_PARMS *frame_parms, uint8_t gNB_id, uint8_t i_ssb, MIMO_mode_t mimo_mode, - fapiPbch_t* result) { - + fapiPbch_t *result) { NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars; int max_h=0; int symbol; //uint8_t pbch_a[64]; -//FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for.. -//uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); + //FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for.. + //uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); uint8_t nushift; uint16_t M; - uint8_t Lmax=frame_parms->Lmax; + uint8_t Lmax=frame_parms->Lmax; //uint16_t crc; //unsigned short idx_demod =0; uint32_t decoderState=0; //uint8_t decoderListSize = 8, pathMetricAppr = 0; //time_stats_t polar_decoder_init,polar_rate_matching,decoding,bit_extraction,deinterleaving; //time_stats_t path_metric,sorting,update_LLR; -// FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); + // FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); //printf("nr_pbch_ue nid_cell %d\n",frame_parms->Nid_cell); - - int16_t pbch_e_rx[960]={0}; //Fixme: previous version erase only NR_POLAR_PBCH_E bytes + int16_t pbch_e_rx[960]= {0}; //Fixme: previous version erase only NR_POLAR_PBCH_E bytes + int16_t pbch_unClipped[960]= {0}; int pbch_e_rx_idx=0; int symbol_offset=1; @@ -446,24 +443,22 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, else symbol_offset=0; - #ifdef DEBUG_PBCH //printf("address dataf %p",nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF); write_output("rxdataF0_pbch.m","rxF0pbch", &nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0][(symbol_offset+1)*frame_parms->ofdm_symbol_size],frame_parms->ofdm_symbol_size*3,1,1); #endif - // symbol refers to symbol within SSB. symbol_offset is the offset of the SSB wrt start of slot double log2_maxh; + for (symbol=1; symbol<4; symbol++) { const uint16_t nb_re=symbol == 2 ? 72 : 180; struct complex16 rxdataF_ext[frame_parms->nb_antennas_rx][20*12*4]; struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][nb_re]; //was dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][20*12*4]; - nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, - estimateSz, + estimateSz, dl_ch_estimates, rxdataF_ext, dl_ch_estimates_ext, @@ -487,7 +482,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif nr_pbch_channel_compensation(rxdataF_ext, dl_ch_estimates_ext, - nb_re, + nb_re, rxdataF_comp, frame_parms, symbol, @@ -510,34 +505,39 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, (short *)rxdataF_comp[0], 144); + memcpy(pbch_unClipped+pbch_e_rx_idx, rxdataF_comp[0], 144*sizeof(int16_t)); pbch_e_rx_idx+=144; } else { nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, (short *)rxdataF_comp[0], 360); + memcpy(pbch_unClipped+pbch_e_rx_idx, rxdataF_comp[0], 144*sizeof(int16_t)); pbch_e_rx_idx+=360; } } + // legacy code use int16, but it is complex16 + UEscopeCopy(ue, pbchRxdataF_comp, pbch_unClipped, sizeof(struct complex16), frame_parms->nb_antennas_rx, pbch_e_rx_idx/2); + UEscopeCopy(ue, pbchLlr, pbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, pbch_e_rx_idx); #ifdef DEBUG_PBCH write_output("rxdataF_comp.m","rxFcomp",rxdataF_comp[0],240*3,1,1); #endif //demod_pbch_e = nr_ue_pbch_vars->demod_pbch_e; -// FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a; + // FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a; #ifdef DEBUG_PBCH short *p = (short *)rxdataF_comp[0]); -for (int cnt = 0; cnt < 864 ; cnt++) - printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); + for (int cnt = 0; cnt < 864 ; cnt++) +printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); #endif //un-scrambling -M = NR_POLAR_PBCH_E; -nushift = (Lmax==4)? i_ssb&3 : i_ssb&7; + M = NR_POLAR_PBCH_E; + nushift = (Lmax==4)? i_ssb&3 : i_ssb&7; uint32_t unscrambling_mask = (Lmax==64)?0x100006D:0x1000041; uint32_t pbch_a_interleaved=0; -uint32_t pbch_a_prime=0; -nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); + uint32_t pbch_a_prime=0; + nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); //polar decoding de-rate matching const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&pbch_a_prime,0,currentPtr); @@ -549,20 +549,20 @@ nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,N uint32_t a_reversed=0; for (int i=0; i>i)&1)<<(31-i); +a_reversed |= (((uint64_t)pbch_a_prime>>i)&1)<<(31-i); pbch_a_prime = a_reversed; //payload un-scrambling M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3); nushift = ((pbch_a_prime>>24)&1) ^ (((pbch_a_prime>>6)&1)<<1); -nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask,pbch_a_prime, &pbch_a_interleaved); + nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask,pbch_a_prime, &pbch_a_interleaved); //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((pbch_a_prime>>6)&1), ((pbch_a_prime>>24)&1) ); //payload deinterleaving //uint32_t in=0; uint32_t out=0; for (int i=0; i<32; i++) { - out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); + out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); #ifdef DEBUG_PBCH printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (pbch_a_interleaved>>i)&1); #endif @@ -572,29 +572,30 @@ nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,N result->xtra_byte = (out>>24)&0xff; for (int i=0; i>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1); +payload |= ((out>>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1); for (int i=0; i<3; i++) - result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); - -frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half frame index from the extra byte +result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); + frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half frame index from the extra byte frame_parms->ssb_index = i_ssb; // ssb index corresponds to i_ssb for Lmax = 4,8 + if (Lmax == 64) { // for Lmax = 64 ssb index 4th,5th and 6th bits are in extra byte - for (int i=0; i<3; i++) + for (int i=0; i<3; i++) frame_parms->ssb_index += (((result->xtra_byte>>(7-i))&0x01)<<(3+i)); } ue->symbol_offset = nr_get_ssb_start_symbol(frame_parms,frame_parms->ssb_index); + if (frame_parms->half_frame_bit) - ue->symbol_offset += (frame_parms->slots_per_frame>>1)*frame_parms->symbols_per_slot; + ue->symbol_offset += (frame_parms->slots_per_frame>>1)*frame_parms->symbols_per_slot; uint8_t frame_number_4lsb = 0; + for (int i=0; i<4; i++) - frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i); +frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i); proc->decoded_frame_rx = frame_number_4lsb; - #ifdef DEBUG_PBCH printf("xtra_byte %x payload %x\n", xtra_byte, payload); @@ -602,18 +603,16 @@ frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half // printf("unscrambling pbch_a[%d] = %x \n", i,pbch_a[i]); printf("[PBCH] decoder payload[%d] = %x\n",i,result->decoded_output[i]); } + #endif - nr_downlink_indication_t dl_indication; -fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); -uint16_t number_pdus = 1; - -nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - -nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void*)result); + fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); + uint16_t number_pdus = 1; + nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void *)result); if (ue->if_inst && ue->if_inst->dl_indication) - ue->if_inst->dl_indication(&dl_indication, NULL); + ue->if_inst->dl_indication(&dl_indication, NULL); return 0; } diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index a31414946f..fe0f785ef4 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -41,6 +41,10 @@ typedef struct complex16 scopeSample_t; #define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i) typedef struct { + int dataSize; + int elementSz; + int colSz; + int lineSz; } scopeGraphData_t; typedef struct OAIgraph { @@ -59,7 +63,7 @@ typedef struct OAIgraph { boolean_t initDone; int iteration; void (*gNBfunct) (struct OAIgraph *graph, scopeData_t *p, int UE_id); - void (*nrUEfunct)(scopeGraphData_t** data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); + void (*nrUEfunct)(scopeGraphData_t **data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); } OAIgraph_t; /* Forms and Objects */ @@ -546,7 +550,7 @@ static void *scope_thread_gNB(void *arg) { static void copyRxdataF(int32_t *data, int slot, void *scopeData) { scopeData_t *scope=(scopeData_t *)scopeData; - memcpy(((int32_t*)scope->liveData) + slot*scope->gNB->frame_parms.samples_per_slot_wCP, + memcpy(((int32_t *)scope->liveData) + slot*scope->gNB->frame_parms.samples_per_slot_wCP, data, scope->gNB->frame_parms.samples_per_slot_wCP*sizeof(int32_t)); } @@ -584,10 +588,11 @@ static void ueChannelResponse (scopeGraphData_t **data, OAIgraph_t *graph, PHY_ // Channel Impulse Response if (!data[pbchDlChEstimateTime]) return; - - genericPowerPerAntena(graph, phy_vars_ue->frame_parms.nb_antennas_rx, - (const scopeSample_t **) &data[pbchDlChEstimateTime], - phy_vars_ue->frame_parms.ofdm_symbol_size>>3); + + const scopeSample_t *tmp=(scopeSample_t *)(data[pbchDlChEstimateTime]+1); + genericPowerPerAntena(graph, data[pbchDlChEstimateTime]->colSz, + &tmp, + data[pbchDlChEstimateTime]->lineSz); } static void ueFreqWaterFall (scopeGraphData_t **data, OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) { @@ -639,51 +644,38 @@ static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_ if ( !data[pbchLlr]) return; - int16_t *pbch_llr = (int16_t *)data[pbchLlr]; + const int sz=data[pbchLlr]->lineSz; + //const int antennas=data[pbchLlr]->colSz; + // We take the first antenna only for now + int16_t *llrs = (int16_t *) (data[pbchLlr]+1); float *llr_pbch, *bit_pbch; - oai_xygraph_getbuff(graph, &bit_pbch, &llr_pbch, 864, 0); + oai_xygraph_getbuff(graph, &bit_pbch, &llr_pbch, sz, 0); - for (int i=0; i<864; i++) { - llr_pbch[i] = (float) pbch_llr[i]; + for (int i=0; ilineSz; float *I, *Q; - oai_xygraph_getbuff(graph, &I, &Q, 180*3, 0); - memset(I,0,180*3*sizeof(*I)); - memset(Q,0,180*3*sizeof(*Q)); - int first_symbol=1; - int base=0; + oai_xygraph_getbuff(graph, &I, &Q, sz, 0); - for (int symbol=first_symbol; symbol<(first_symbol+3); symbol++) { - int nb_re; - - if (symbol == 2 || symbol == 6) - nb_re = 72; - else - nb_re = 180; - - AssertFatal(base+nb_re<180*3,""); - - for (int i=0; ipdcch_vars[0][eNB_id]->llr) @@ -882,7 +874,7 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) { } void phy_scope_nrUE(scopeGraphData_t **UEliveData, - OAI_phy_scope_t *form, + OAI_phy_scope_t *form, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { @@ -909,20 +901,19 @@ void phy_scope_nrUE(scopeGraphData_t **UEliveData, static void *nrUEscopeThread(void *arg) { PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg; size_t stksize; - pthread_attr_t atr={0}; + pthread_attr_t atr= {0}; pthread_attr_getstacksize(&atr, &stksize); pthread_attr_setstacksize(&atr,32*1024*1024 ); int fl_argc=1; char *name="5G-UE-scope"; fl_initialize (&fl_argc, &name, NULL, 0, 0); OAI_phy_scope_t *form_nrue=create_phy_scope_nrue(0); + (( scopeData_t *)ue->scopeData)->liveData=calloc(sizeof(scopeGraphData_t *), UEdataTypeNumberOfItems); - scopeGraphData_t *UEliveData[UEdataTypeNumberOfItems]; - while (!oai_exit) { fl_freeze_form(form_nrue->phy_scope); - phy_scope_nrUE(UEliveData, - form_nrue, + phy_scope_nrUE((( scopeData_t *)ue->scopeData)->liveData, + form_nrue, ue, 0,0); fl_unfreeze_form(form_nrue->phy_scope); @@ -933,8 +924,30 @@ static void *nrUEscopeThread(void *arg) { pthread_exit((void *)arg); } -void UEcopyData(enum UEdataType type, void * data, int elementSz, int colSz, int lineSz) { - +void UEcopyData(PHY_VARS_NR_UE *ue, enum UEdataType type, void *dataIn, int elementSz, int colSz, int lineSz) { + scopeData_t *tmp=(scopeData_t *)ue->scopeData; + + if (tmp) { + scopeGraphData_t *live= ((scopeGraphData_t **)tmp->liveData)[type]; + + if (live == NULL || live->dataSize < elementSz*colSz*lineSz) { + scopeGraphData_t *ptr=realloc(live, sizeof(scopeGraphData_t) + elementSz*colSz*lineSz); + + if (!ptr) { + LOG_E(PHY,"can't realloc\n"); + return; + } else { + live=ptr; + } + } + + live->dataSize=elementSz*colSz*lineSz; + live->elementSz=elementSz; + live->colSz=colSz; + live->lineSz=lineSz; + memcpy(live+1, dataIn, elementSz*colSz*lineSz); + ((scopeGraphData_t **)tmp->liveData)[type]=live; + } } void nrUEinitScope(PHY_VARS_NR_UE *ue) { @@ -942,7 +955,7 @@ void nrUEinitScope(PHY_VARS_NR_UE *ue) { scopeData_t *scope=(scopeData_t *) ue->scopeData; scope->copyData=UEcopyData; pthread_t forms_thread; - threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); + threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); } void nrscope_autoinit(void *dataptr) { diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h index 1ba6bb558d..9cd8e1dc40 100644 --- a/openair1/PHY/TOOLS/phy_scope_interface.h +++ b/openair1/PHY/TOOLS/phy_scope_interface.h @@ -32,6 +32,7 @@ #ifndef __PHY_SCOPE_INTERFACE_H__ #define __PHY_SCOPE_INTERFACE_H__ #include +#include typedef struct { int *argc; @@ -52,13 +53,13 @@ typedef struct scopeData_s { char **argv; RU_t *ru; PHY_VARS_gNB *gNB; - void * liveData; - void (*slotFunc)(int32_t* data, int slot, void * scopeData); - void (*copyData)(enum UEdataType, void * data, int elementSz, int colSz, int lineSz); + void *liveData; + void (*slotFunc)(int32_t *data, int slot, void *scopeData); + void (*copyData)(PHY_VARS_NR_UE *,enum UEdataType, void *data, int elementSz, int colSz, int lineSz); } scopeData_t; int load_softscope(char *exectype, void *initarg); int end_forms(void) ; -#define scopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(type, ##__VA_ARGS__); +#define UEscopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(ue, type, ##__VA_ARGS__); #endif diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c7b54950d7..3f263c08fe 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1170,7 +1170,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_length, (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_start_subcarrier, (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.cell_id)) << FAPI_NR_RX_PDU_TYPE_SSB; - + free((dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.pdu); break; case FAPI_NR_RX_PDU_TYPE_SIB: ret_mask |= (handle_bcch_dlsch(dl_info->module_id, From ff8c47d3aa38efa6966c9703eb497669c43119e4 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 15 Feb 2022 17:04:50 +0000 Subject: [PATCH 457/883] Fix scramblingID and gold sequence for PDCCH and PDSCH --- openair1/PHY/INIT/nr_init_ue.c | 9 --------- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b571afe416..5e6c148325 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -272,9 +272,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } } - ue->scramblingID_pdcch = fp->Nid_cell; - nr_gold_pdcch(ue,fp->Nid_cell); - //PDSCH DMRS init (eNB offset = 0) ue->nr_gold_pdsch[0] = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***)); uint32_t ****pdsch_dmrs = ue->nr_gold_pdsch[0]; @@ -294,12 +291,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } } - // initializing the scrambling IDs for PDSCH DMRS - for (int i=0; i<2; i++) - ue->scramblingID[i]=fp->Nid_cell; - - nr_gold_pdsch(ue,ue->scramblingID); - // DLSCH for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { for (th_id=0; th_idofdm_symbol_size + fp->nb_prefix_samples0)+(ue->symbol_offset-n_symb_prefix0)*(fp->ofdm_symbol_size + fp->nb_prefix_samples); // for a correct computation of frame number to sync with the one decoded at MIB we need to take into account in which of the n_frames we got sync ue->init_sync_frame = n_frames - 1 - is; + + // compute the scramblingID_pdcch and the gold pdcch + ue->scramblingID_pdcch = fp->Nid_cell; + nr_gold_pdcch(ue,fp->Nid_cell); + + // compute the scrambling IDs for PDSCH DMRS + for (int i=0; i<2; i++) + ue->scramblingID[i]=fp->Nid_cell; + + nr_gold_pdsch(ue,ue->scramblingID); + // we also need to take into account the shift by samples_per_frame in case the if is true if (ue->ssb_offset < sync_pos_frame){ ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset; From 679816c3c1b1fb24903677327c37960b63b5b5f5 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 15 Feb 2022 15:05:04 -0800 Subject: [PATCH 458/883] Added comment around asn1cCalloc memory leak --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index 349441544d..d271eecd5c 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4293,8 +4293,9 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA; asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; + /* TODO: This asn1cCalloc leaks memory but also masks a bug. + If we delete this asn1cCalloc statement, eNB will crash in NSA mode. */ asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); - memset(measresult_cgi2, 0, sizeof(LTE_CellGlobalIdEUTRA_t)); struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; asn1cCallocOne(measResult->rsrpResult, rsrp_tar); asn1cCallocOne(measResult->rsrqResult, rsrq_tar); From 9691946845ac9d70aa2e82b802f1691201361c5d Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 16 Feb 2022 00:52:57 +0000 Subject: [PATCH 459/883] Fix Nid_cell in PUSCH dmrs and scrambling --- openair1/PHY/INIT/nr_init_ue.c | 4 ---- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 5 +++++ openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 5e6c148325..3ca4ac0c18 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -134,8 +134,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int gNB_id; int th_id; uint32_t ****pusch_dmrs; - uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig - int n_scid; abstraction_flag = 0; LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx); //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST); @@ -192,7 +190,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, /////////// ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***)); pusch_dmrs = ue->nr_gold_pusch_dmrs; - n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization for (slot=0; slotslots_per_frame; slot++) { pusch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **)); @@ -209,7 +206,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } } - nr_init_pusch_dmrs(ue, N_n_scid, n_scid); /////////// //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 19e4abdf9e..203be1bd24 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -315,6 +315,11 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, nr_gold_pdsch(ue,ue->scramblingID); + // initialize the pusch dmrs + uint16_t N_n_scid[2] = {fp->Nid_cell,fp->Nid_cell}; + int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization + nr_init_pusch_dmrs(ue, N_n_scid, n_scid); + // we also need to take into account the shift by samples_per_frame in case the if is true if (ue->ssb_offset < sync_pos_frame){ ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 0c188e9119..41cf9c2ffa 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -128,7 +128,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id]; uint8_t num_of_codewords = 1; // tmp assumption - int Nid_cell = 0; int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig uint16_t number_dmrs_symbols = 0; @@ -153,7 +152,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if (start_sc >= frame_parms->ofdm_symbol_size) start_sc -= frame_parms->ofdm_symbol_size; - ulsch_ue->Nid_cell = Nid_cell; + ulsch_ue->Nid_cell = frame_parms->Nid_cell; for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) { if((ul_dmrs_symb_pos >> i) & 0x01) @@ -391,7 +390,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, // Perform this on gold sequence, not required when SC FDMA operation is done, LOG_D(PHY,"DMRS in symbol %d\n",l); nr_modulation(pusch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated - + } else { dmrs_idx = 0; } From a9844b773ca3dbea7809ba5c57b56fcd4281b157 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 15 Feb 2022 12:00:26 +0100 Subject: [PATCH 460/883] add rfsim sa test 24PRB --- .../gnb.band78.sa.fr1.24PRB.usrpn310.conf | 316 ++++++++++++++++++ ci-scripts/runTestOnVM.sh | 92 ++++- 2 files changed, 406 insertions(+), 2 deletions(-) create mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.24PRB.usrpn310.conf diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.24PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.24PRB.usrpn310.conf new file mode 100644 index 0000000000..b0647aefee --- /dev/null +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.24PRB.usrpn310.conf @@ -0,0 +1,316 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + #pusch_TargetSNRx10 = 200; + #pucch_TargetSNRx10 = 200; + ul_prbblacklist = "51,52,53,54" + min_rxtxtime = 6; + do_SRS = 1; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 2; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 24; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 6325; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 2; + 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 = 24; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 6325; +# 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 = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 200; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; + } +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + f1ap_log_level ="debug"; + f1ap_log_verbosity ="medium"; + }; diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 8be4a47bfa..09a44d41a2 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -1401,8 +1401,12 @@ function start_rf_sim_nr_ue { elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option then echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor,time --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1 - else #SA test => use --sa option + elif [ $LOC_RA_SA_TEST -eq 2 ] #SA test 106PRB => use --sa option + then echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 + else # -eq 3 SA test 24PRB + then + echo "echo \"./nr-uesoftmodem -r 24 -s 24 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 fi fi echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1 @@ -2270,7 +2274,7 @@ function run_test_on_vm { mkdir --parents $ARCHIVES_LOC echo "############################################################" - echo "SA TEST" + echo "SA TEST 106PRB" echo "############################################################" #SA test, attention : has a different config file from the rest of the test CN_CONFIG="noS1" @@ -2350,6 +2354,90 @@ function run_test_on_vm { sleep 30 + echo "############################################################" + echo "SA TEST 24PRB" + echo "############################################################" + #SA test, attention : has a different config file from the rest of the test + CN_CONFIG="noS1" + CONF_FILE=gnb.band78.sa.fr1.24PRB.usrpn310.conf + S1_NOS1_CFG=0 + PRB=24 + FREQUENCY=3510 + + if [ ! -d $ARCHIVES_LOC ] + then + mkdir --parents $ARCHIVES_LOC + fi + + local try_cnt=0 + + ######### start of SA TEST loop + while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI + do + + SYNC_STATUS=0 + SA_STATUS=0 + rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*sa_test.log + + echo "############################################################" + echo "${CN_CONFIG} : Starting the gNB" + echo "############################################################" + CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_sa_test.log + #last argument = 3 is to enable --sa for SA test 24PRB + start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 3 + + echo "############################################################" + echo "${CN_CONFIG} : Starting the NR-UE" + echo "############################################################" + CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log + #last argument = 2 is to enable --sa for SA test + start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 2 + if [ $NR_UE_SYNC -eq 0 ] + then + echo "Problem w/ gNB and NR-UE not syncing" + terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 + terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 + scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC + SYNC_STATUS=-1 + try_cnt=$((try_cnt+1)) + continue + fi + + echo "############################################################" + echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators" + echo "############################################################" + sleep 20 + terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 + terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1 + scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC + scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC + + #check SA markers in gNB and NR UE log files + echo "############################################################" + echo "${CN_CONFIG} : Checking SA on gNB / NR-UE" + echo "############################################################" + + # Proper check to be done when SA test is working! + check_sa_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE + if [ $SA_STATUS -ne 0 ] + then + echo "SA test NOT OK" + echo "try_cnt = " $try_cnt + try_cnt=$((try_cnt+1)) + else + echo "SA test OK" + try_cnt=$((try_cnt+10)) + fi + done + ########### end SA test + + sleep 30 + + + + + echo "############################################################" echo "RA TEST FR2" From b7408c842a6e18c4699bf2ca78a5350232a45253 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 16 Feb 2022 08:27:54 +0100 Subject: [PATCH 461/883] modifying the 24PRB CI test case --- ... => gnb.sa.band78.fr1.24PRB.usrpb210.conf} | 245 ++++++++---------- ci-scripts/runTestOnVM.sh | 6 +- 2 files changed, 118 insertions(+), 133 deletions(-) rename ci-scripts/conf_files/{gnb.band78.sa.fr1.24PRB.usrpn310.conf => gnb.sa.band78.fr1.24PRB.usrpb210.conf} (55%) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.24PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.sa.band78.fr1.24PRB.usrpb210.conf similarity index 55% rename from ci-scripts/conf_files/gnb.band78.sa.fr1.24PRB.usrpn310.conf rename to ci-scripts/conf_files/gnb.sa.band78.fr1.24PRB.usrpb210.conf index b0647aefee..bd3076a014 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.24PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.sa.band78.fr1.24PRB.usrpb210.conf @@ -6,52 +6,44 @@ gNBs = ( { ////////// Identification parameters: - gNB_CU_ID = 0xe00; - -# cell_type = "CELL_MACRO_GNB"; - + gNB_ID = 0xe00; gNB_name = "gNB-OAI"; // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; - plmn_list = ({ mcc = 208; - mnc = 97; + mnc = 99; mnc_length = 2; snssaiList = ( - { - sst = 1; - sd = 0x010203; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true - } - ); - }); + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); - nr_cellid = 12345678L + }); -# tr_s_preference = "local_mac" + nr_cellid = 12345678L; ////////// Physical parameters: ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - #pusch_TargetSNRx10 = 200; - #pucch_TargetSNRx10 = 200; - ul_prbblacklist = "51,52,53,54" + sib1_tda = 15; min_rxtxtime = 6; - do_SRS = 1; - pdcch_ConfigSIB1 = ( + pdcch_ConfigSIB1 = ( { controlResourceSetZero = 2; searchSpaceZero = 0; } - ); + ); servingCellConfigCommon = ( { @@ -61,23 +53,11 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL - # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 - #absoluteFrequencySSB = 620640; - # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 - absoluteFrequencySSB = 621312; - # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 - #absoluteFrequencySSB = 634080; - # this is 3600.48 MHz - #absoluteFrequencySSB = 640032; - #dl_frequencyBand = 78; - # this is 3301.68 MHz - #dl_absoluteFrequencyPointA = 620112; - # this is 3300.60 MHz - dl_absoluteFrequencyPointA = 620040; - # this is 3502.56 MHz - #dl_absoluteFrequencyPointA = 633552; - # this is 3600.48 MHz - #dl_absoluteFrequencyPointA = 640032; + # this is 3600 MHz + 12 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 640288; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 640000; #scs-SpecificCarrierList dl_offstToCarrier = 0; # subcarrierSpacing @@ -86,33 +66,31 @@ gNBs = dl_carrierBandwidth = 24; #initialDownlinkBWP #genericParameters - # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 6325; + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 6325; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialDLBWPsubcarrierSpacing = 1; + initialDLBWPsubcarrierSpacing = 1; #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 2; - initialDLBWPsearchSpaceZero = 0; - - + initialDLBWPcontrolResourceSetZero = 2; + initialDLBWPsearchSpaceZero = 0; #uplinkConfigCommon #frequencyInfoUL - ul_frequencyBand = 78; + ul_frequencyBand = 78; #scs-SpecificCarrierList - ul_offstToCarrier = 0; + ul_offstToCarrier = 0; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - ul_subcarrierSpacing = 1; - ul_carrierBandwidth = 24; + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 24; pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 6325; + initialULBWPlocationAndBandwidth = 6325; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 - initialULBWPsubcarrierSpacing = 1; + initialULBWPsubcarrierSpacing = 1; #rach-ConfigCommon #rach-ConfigGeneric prach_ConfigurationIndex = 98; @@ -120,8 +98,8 @@ gNBs = #0 = one, 1=two, 2=four, 3=eight prach_msg1_FDM = 0; prach_msg1_FrequencyStart = 0; - zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; #preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) preambleTransMax = 6; #powerRampingStep @@ -132,9 +110,9 @@ gNBs = 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 = 3; + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; #oneHalf (0..15) 4,8,12,16,...60,64 - ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; #ra_ContentionResolutionTimer #(0..7) 8,16,24,32,40,48,56,64 ra_ContentionResolutionTimer = 7; @@ -190,7 +168,7 @@ gNBs = nrofUplinkSlots = 2; nrofUplinkSymbols = 4; - ssPBCH_BlockPower = -25; + ssPBCH_BlockPower = -25; } ); @@ -204,80 +182,86 @@ gNBs = SCTP_OUTSTREAMS = 2; }; + ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); - NETWORK_INTERFACES : - { - GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; - GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; - GNB_PORT_FOR_S1U = 2152; # Spec 2152 - }; + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; } ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; - } +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} ); L1s = ( { num_cc = 1; - tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; -# pucch0_dtx_threshold = 150; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 0 - att_rx = 0; - bands = [78]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 75; - eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" - } +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} ); THREAD_STRUCT = ( - { - #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" - parallel_config = "PARALLEL_SINGLE_THREAD"; - #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" - worker_config = "WORKER_ENABLE"; - } +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} ); +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + security = { # preferred ciphering algorithms # the first one of the list that an UE supports in chosen @@ -295,22 +279,23 @@ security = { drb_integrity = "no"; }; - log_config : - { - global_log_level ="info"; - global_log_verbosity ="medium"; - hw_log_level ="info"; - hw_log_verbosity ="medium"; - phy_log_level ="info"; - phy_log_verbosity ="medium"; - mac_log_level ="info"; - mac_log_verbosity ="high"; - rlc_log_level ="info"; - rlc_log_verbosity ="medium"; - pdcp_log_level ="info"; - pdcp_log_verbosity ="medium"; - rrc_log_level ="info"; - rrc_log_verbosity ="medium"; - f1ap_log_level ="debug"; - f1ap_log_verbosity ="medium"; - }; +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 09a44d41a2..f6a32742b2 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -1406,7 +1406,7 @@ function start_rf_sim_nr_ue { echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 else # -eq 3 SA test 24PRB then - echo "echo \"./nr-uesoftmodem -r 24 -s 24 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 + echo "echo \"./nr-uesoftmodem -r 24 -s 24 --numerology 1 --band 78 -C 3604320000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 fi fi echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1 @@ -2359,10 +2359,10 @@ function run_test_on_vm { echo "############################################################" #SA test, attention : has a different config file from the rest of the test CN_CONFIG="noS1" - CONF_FILE=gnb.band78.sa.fr1.24PRB.usrpn310.conf + CONF_FILE=gnb.sa.band78.fr1.24PRB.usrpb210.conf S1_NOS1_CFG=0 PRB=24 - FREQUENCY=3510 + FREQUENCY=3600 if [ ! -d $ARCHIVES_LOC ] then From 87a840c5b59b4027a9567282836c019218f399c4 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 16 Feb 2022 09:48:29 +0100 Subject: [PATCH 462/883] fix bash script syntax error, preventing test from running --- ci-scripts/runTestOnVM.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index f6a32742b2..69dbac48e5 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -1405,7 +1405,6 @@ function start_rf_sim_nr_ue { then echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 else # -eq 3 SA test 24PRB - then echo "echo \"./nr-uesoftmodem -r 24 -s 24 --numerology 1 --band 78 -C 3604320000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 fi fi From 83cd94cf6a4c1b3eb8f002df241c2237343bdaa8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 16 Feb 2022 11:18:15 +0100 Subject: [PATCH 463/883] dynamic selection of codewords for DL init --- openair1/PHY/INIT/nr_init.c | 5 +++-- openair1/PHY/INIT/nr_init_ue.c | 9 ++++++--- openair1/PHY/NR_REFSIG/nr_gold.c | 9 +++++---- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 15 +++++++-------- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 4 +++- .../PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 3 ++- openair1/PHY/defs_gNB.h | 2 +- openair1/PHY/defs_nr_UE.h | 2 +- openair1/PHY/defs_nr_common.h | 1 - openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 +++++- 10 files changed, 33 insertions(+), 23 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 9a2e8c91cb..fb7e89c9ce 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -146,11 +146,12 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **)); AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot); + int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; for (int symb=0; symbsymbols_per_slot; symb++) { - pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *)); + pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(nb_codewords*sizeof(uint32_t *)); AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); - for (int q=0; qsymbols_per_slot*sizeof(uint32_t **)); AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot); + int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; for (int symb=0; symbsymbols_per_slot; symb++) { - pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *)); + pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(nb_codewords*sizeof(uint32_t *)); AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); - for (int q=0; q 4? 2:1; for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { - for (int j=0; j<2; j++) { + for (int j=0; jdlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n"); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]); diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index 7f81529964..b593dcbb47 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -82,11 +82,12 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid) { uint32_t x1, x2; - uint8_t reset, q; + uint8_t reset; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1; - uint16_t N_n_scid[NR_MAX_NB_CODEWORDS]={Nid, Nid}; // Not correct, appropriate scrambling IDs have to be updated to support DCI 1_1 + int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; + uint16_t N_n_scid[2]={Nid, Nid}; uint8_t n_scid=0; // again works only for 1_0 for (uint8_t slot=0; slotslots_per_frame; slot++) { @@ -99,8 +100,8 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid) reset = 0; } - for (q = 1; q < NR_MAX_NB_CODEWORDS; q++) - memcpy(pdsch_dmrs[slot][symb][q],pdsch_dmrs[slot][symb][0],sizeof(uint32_t)*pdsch_dmrs_init_length); + if(nb_codewords>1) + memcpy(pdsch_dmrs[slot][symb][1],pdsch_dmrs[slot][symb][0],sizeof(uint32_t)*pdsch_dmrs_init_length); } } } diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index 558e41ba44..e3c2af5fb3 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -78,29 +78,28 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue, void nr_gold_pdsch(PHY_VARS_NR_UE* ue, unsigned short *n_idDMRS) { - unsigned char l; - unsigned int n,x1,x2,x2tmp0,ns; - int nscid; + + unsigned int x1,x2,x2tmp0; unsigned int nid; uint8_t reset; int pdsch_dmrs_init_length = ((ue->frame_parms.N_RB_DL*12)>>5)+1; - + int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; /// to be updated from higher layer //unsigned short lbar = 0; - for (nscid=0; nscid<2; nscid++) { - for (ns=0; nsframe_parms.slots_per_frame; ns++) { + for (int nscid=0; nscidframe_parms.slots_per_frame; ns++) { nid = n_idDMRS[nscid]; - for (l=0; lframe_parms.symbols_per_slot; l++) { + for (int l=0; lframe_parms.symbols_per_slot; l++) { reset = 1; x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17; x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid); - for (n=0; nnr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset); reset = 0; } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 8a1dd57c48..b47deec646 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -137,7 +137,9 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, dlsch->txdataF[layer] = (int32_t *)malloc16((txdataf_size)*sizeof(int32_t)); } - for (int q=0; q 4 ? 2 : 1; + dlsch->mod_symbs = (int32_t **)malloc16(nb_codewords*sizeof(int32_t *)); + for (int q=0; qmod_symbs[q] = (int32_t *)malloc16(txdataf_size*max_layers*sizeof(int32_t)); dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *)); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index b4edae972a..c6fa85e726 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -205,7 +205,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, pdsch_vars = ue->pdsch_vars[proc->thread_id]; dlsch = ue->dlsch[proc->thread_id][gNB_id]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; - dlsch1_harq = dlsch[1]->harq_processes[harq_pid]; + if (NR_MAX_NB_LAYERS>4) + dlsch1_harq = dlsch[1]->harq_processes[harq_pid]; beamforming_mode = ue->transmission_mode[gNB_id] < 7 ? 0 :ue->transmission_mode[gNB_id]; break; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index df8340dd8c..6959052f74 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -159,7 +159,7 @@ typedef struct { /// TX buffers for UE-spec transmission (antenna layers 1,...,4 after to precoding) int32_t **txdataF; /// Modulated symbols buffer - int32_t *mod_symbs[NR_MAX_NB_CODEWORDS]; + int32_t **mod_symbs; /// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers? int32_t ***ue_spec_bf_weights; /// dl channel estimates (estimated from ul channel estimates) diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index c2a83e7362..06d066fb51 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -817,7 +817,7 @@ typedef struct { NR_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PUSCH *pusch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PUCCH *pucch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; - NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_CODEWORDS]; // two RxTx Threads + NR_UE_DLSCH_t *dlsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX][NR_MAX_NB_LAYERS>4 ? 2:1]; // two RxTx Threads NR_UE_ULSCH_t *ulsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_gNB_MAX]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 7645bf8e96..a3f143c733 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -79,7 +79,6 @@ #define NR_MAX_NB_RBG 18 #define NR_MAX_NB_LAYERS 4 // 8 -#define NR_MAX_NB_CODEWORDS 2 #define NR_MAX_NB_HARQ_PROCESSES 16 #define NR_MAX_PDSCH_TBS 3824 diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 81b747e950..b9fd217b27 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1847,13 +1847,17 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, start_meas(&ue->dlsch_procedures_stat[proc->thread_id]); + NR_UE_DLSCH_t *dlsch1 = NULL; + if (NR_MAX_NB_LAYERS>4) + dlsch1 = ue->dlsch[proc->thread_id][gNB_id][1]; + if (ret_pdsch >= 0) nr_ue_dlsch_procedures(ue, proc, gNB_id, PDSCH, ue->dlsch[proc->thread_id][gNB_id][0], - ue->dlsch[proc->thread_id][gNB_id][1], + dlsch1, &ue->dlsch_errors[gNB_id], dlsch_parallel); From 298008677c74d7cbe4ac368907b1c5d35af38586 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 16 Feb 2022 12:27:03 +0100 Subject: [PATCH 464/883] fix rfsim test + update html reporting --- ci-scripts/reportTestLocally.sh | 2 +- ci-scripts/runTestOnVM.sh | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index 6ef6b2e254..d22bfe177a 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -756,7 +756,7 @@ function report_test { EPC_CONFIGS=("noS1") TRANS_MODES=("tdd") FR_MODE=("SA") - BW_CASES=(106) + BW_CASES=(106 24) for CN_CONFIG in ${EPC_CONFIGS[@]} do for TMODE in ${TRANS_MODES[@]} diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 69dbac48e5..b5abb5ff45 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -2308,7 +2308,7 @@ function run_test_on_vm { echo "${CN_CONFIG} : Starting the NR-UE" echo "############################################################" CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log - #last argument = 2 is to enable --sa for SA test + #last argument = 2 is to enable --sa for SA test for 106PRB start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 2 if [ $NR_UE_SYNC -eq 0 ] then @@ -2343,9 +2343,11 @@ function run_test_on_vm { echo "SA test NOT OK" echo "try_cnt = " $try_cnt try_cnt=$((try_cnt+1)) + SA_106PRB_STATUS = -1 else echo "SA test OK" try_cnt=$((try_cnt+10)) + SA_106PRB_STATUS = 0 fi done ########### end SA test @@ -2382,15 +2384,15 @@ function run_test_on_vm { echo "${CN_CONFIG} : Starting the gNB" echo "############################################################" CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_sa_test.log - #last argument = 3 is to enable --sa for SA test 24PRB - start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 3 + #last argument = 2 is to enable --sa for SA test + start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 2 echo "############################################################" echo "${CN_CONFIG} : Starting the NR-UE" echo "############################################################" CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log - #last argument = 2 is to enable --sa for SA test - start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 2 + #last argument = 3 is to enable --sa for SA test for 24PRB + start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 3 if [ $NR_UE_SYNC -eq 0 ] then echo "Problem w/ gNB and NR-UE not syncing" @@ -2424,9 +2426,11 @@ function run_test_on_vm { echo "SA test NOT OK" echo "try_cnt = " $try_cnt try_cnt=$((try_cnt+1)) + SA_24PRB_STATUS = -1 else echo "SA test OK" try_cnt=$((try_cnt+10)) + SA_24PRB_STATUS = 0 fi done ########### end SA test @@ -2748,7 +2752,8 @@ function run_test_on_vm { echo "Checking run status" echo "############################################################" - if [ $SA_STATUS -ne 0 ]; then NR_STATUS=-1; fi + if [ $SA_106PRB_STATUS -ne 0 ]; then NR_STATUS=-1; fi + if [ $SA_24PRB_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $RA_FR2_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $RA_FR1_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi From 96f2b4e2f36105e923030b80e66ebfb91ac6fe68 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 16 Feb 2022 14:49:19 +0100 Subject: [PATCH 465/883] fix unaligned mem for SIMD --- common/utils/LOG/log.h | 2 +- openair1/PHY/CODING/crc_byte.c | 4 +-- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 4 +-- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 6 ++-- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 5 +++- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 2 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 +-- openair1/SIMULATION/NR_PHY/pbchsim.c | 29 ++++++++----------- openair2/UTIL/LISTS/list.c | 2 +- openair2/UTIL/LISTS/list2.c | 2 +- 10 files changed, 29 insertions(+), 31 deletions(-) diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 46c73427c1..9a2c92bb10 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -346,7 +346,7 @@ typedef struct { @param format data format (0 = real 16-bit, 1 = complex 16-bit,2 real 32-bit, 3 complex 32-bit,4 = real 8-bit, 5 = complex 8-bit) @param multiVec create new file or append to existing (useful for writing multiple vectors to same file. Just call the function multiple times with same file name and with this parameter set to 1) */ -#define MATLAB_RAW (1<<31) +#define MATLAB_RAW (1U<<31) #define MATLAB_SHORT 0 #define MATLAB_CSHORT 1 #define MATLAB_INT 2 diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 7e37abcf81..9ad18cc1a6 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -72,10 +72,10 @@ unsigned int crcbit (unsigned char * inputptr, unsigned int i, crc = 0, c; while (octetlen-- > 0) { - c = (*inputptr++) << 24; + c = ((unsigned int)(*inputptr++)) << 24; for (i = 8; i != 0; i--) { - if ((1 << 31) & (c ^ crc)) + if ((1U << 31) & (c ^ crc)) crc = (crc << 1) ^ poly; else crc <<= 1; diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index 623b86edfb..e949faeaf0 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -64,7 +64,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue, reset = 1; x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17; - x2 = (x2tmp0+(nid<<1))%(1<<31); //cinit + x2 = (x2tmp0+(nid<<1))%(1U<<31); //cinit for (n=0; nnr_gold_pdcch[0][ns][l][n] = lte_gold_generic(&x1, &x2, reset); @@ -95,7 +95,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, reset = 1; x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17; - x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit + x2 = (x2tmp0+(nid<<1)+nscid)%(1U<<31); //cinit LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid); for (n=0; ndlsch_channel_estimation_stats); // computing channel estimation for selected best ssb - const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size; - struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; - struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; + const int estimateSz=7*2*frame_parms->ofdm_symbol_size; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 0073e8344d..c06dec7fcb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -457,6 +457,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][nb_re]; //was dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][20*12*4]; + memset(dl_ch_estimates_ext,0, sizeof dl_ch_estimates_ext); nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, estimateSz, dl_ch_estimates, @@ -540,7 +541,9 @@ printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); //polar decoding de-rate matching const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); - decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&pbch_a_prime,0,currentPtr); +uint64_t tmp=pbch_a_prime; +decoderState = polar_decoder_int16(pbch_e_rx,&tmp,0,currentPtr); +pbch_a_prime=tmp; if(decoderState) return(decoderState); diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 28b6677b2c..0b1f374a52 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -883,7 +883,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain /* perform correlation of rx data and pss sequence ie it is a dot product */ result = dot_product64((short*)primary_synchro_time_nr[pss_index], - (short*) &(rxdata[ar][n+is*frame_parms->samples_per_frame]), + (short*)&(rxdata[ar][n+is*frame_parms->samples_per_frame]), frame_parms->ofdm_symbol_size, shift); pss_corr_ue[pss_index][n] += abs64(result); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 12a8ce0d08..bbf4617207 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1404,8 +1404,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN); LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); const int estimateSz=7*2*sizeof(int)*fp->ofdm_symbol_size; - struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz]; - struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][estimateSz]; for (int i=1; i<4; i++) { nr_slot_fep(ue, diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 692d1bac20..a314f7b397 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -430,13 +430,14 @@ int main(int argc, char **argv) printf("Initializing gNodeB for mu %d, N_RB_DL %d\n",mu,N_RB_DL); - RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *)); + RC.gNB = (PHY_VARS_gNB**) calloc(sizeof(PHY_VARS_gNB *),1); RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; gNB->ofdm_offset_divisor = UINT_MAX; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; + frame_parms->nb_antenna_ports_gNB=n_rx; frame_parms->N_RB_DL = N_RB_DL; frame_parms->Nid_cell = Nid_cell; frame_parms->nushift = Nid_cell%4; @@ -522,23 +523,17 @@ int main(int argc, char **argv) s_im = malloc(2*sizeof(double*)); r_re = malloc(2*sizeof(double*)); r_im = malloc(2*sizeof(double*)); - txdata = malloc(2*sizeof(int*)); + txdata = calloc(2,sizeof(int*)); for (i=0; i<2; i++) { - s_re[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(s_re[i],frame_length_complex_samples*sizeof(double)); - s_im[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(s_im[i],frame_length_complex_samples*sizeof(double)); - - r_re[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(r_re[i],frame_length_complex_samples*sizeof(double)); - r_im[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(r_im[i],frame_length_complex_samples*sizeof(double)); + s_re[i] = calloc(frame_length_complex_samples, sizeof(double)); + s_im[i] = calloc(frame_length_complex_samples, sizeof(double)); + r_re[i] = calloc(frame_length_complex_samples, sizeof(double)); + r_im[i] = calloc(frame_length_complex_samples, sizeof(double)); printf("Allocating %d samples for txdata\n",frame_length_complex_samples); - txdata[i] = malloc(frame_length_complex_samples*sizeof(int)); - bzero(r_re[i],frame_length_complex_samples*sizeof(int)); + txdata[i] = calloc(frame_length_complex_samples, sizeof(int)); } if (pbch_file_fd!=NULL) { @@ -547,8 +542,8 @@ int main(int argc, char **argv) //configure UE - UE = malloc(sizeof(PHY_VARS_NR_UE)); - memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS)); + UE = calloc(1,sizeof(*UE)); + memcpy(&UE->frame_parms,frame_parms,sizeof(*frame_parms)); //phy_init_nr_top(UE); //called from init_nr_ue_signal if (run_initial_sync==1) UE->is_synchronized = 0; else UE->is_synchronized = 1; @@ -721,8 +716,8 @@ int main(int argc, char **argv) UE->rx_offset=0; uint8_t ssb_index = 0; const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size; - struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; - struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb UE->symbol_offset = nr_get_ssb_start_symbol(frame_parms,ssb_index); diff --git a/openair2/UTIL/LISTS/list.c b/openair2/UTIL/LISTS/list.c index 65f70c0786..578833edba 100644 --- a/openair2/UTIL/LISTS/list.c +++ b/openair2/UTIL/LISTS/list.c @@ -43,7 +43,7 @@ list_init (list_t * listP, char *nameP) { //----------------------------------------------------------------------------- if (nameP) { - strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR ); + strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR-1 ); listP->name[LIST_NAME_MAX_CHAR-1] = 0; // terminate string } diff --git a/openair2/UTIL/LISTS/list2.c b/openair2/UTIL/LISTS/list2.c index 3f0a59df53..d9aa1b6a90 100644 --- a/openair2/UTIL/LISTS/list2.c +++ b/openair2/UTIL/LISTS/list2.c @@ -53,7 +53,7 @@ list2_init (list2_t * listP, char *nameP) { //----------------------------------------------------------------------------- if (nameP) { - strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR ); + strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR-1 ); listP->name[LIST_NAME_MAX_CHAR-1] = 0; // terminate string } From 2ea133ffa47b699153bf6092a3a53106ea3842df Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 24 Jan 2022 14:19:31 +0100 Subject: [PATCH 466/883] ue sync, assert in wrong PUCCH decoded values --- openair1/SCHED/phy_procedures_lte_eNb.c | 130 ++++++++++++++---------- targets/RT/USER/lte-ue.c | 12 ++- 2 files changed, 88 insertions(+), 54 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 569d2a464a..3d655bc464 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1939,6 +1939,8 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har pthread_mutex_unlock(&eNB->UL_INFO_mutex); } +#define packetError(ConD, fmt, args...) if (!(ConD)) { LOG_E(PHY, fmt, args); discard=true; } + void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) { if ( split73 == SPLIT73_DU ) { sendFs6Ulharq(fs6ULindicationHarq, UEid, eNB, uci, frame, subframe, harq_ack, tdd_mapping_mode, tdd_multiplexing_mask, 0, 0); @@ -1954,6 +1956,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in } pthread_mutex_lock(&eNB->UL_INFO_mutex); + bool discard=false; nfapi_harq_indication_t *ind = &eNB->UL_INFO.harq_ind; nfapi_harq_indication_body_t *body = &ind->harq_indication_body; assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU); @@ -1986,73 +1989,87 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG; pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1; - AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]); - pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; - // release DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]); + if (!discard) { + pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; + // release DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->pucch_fmt == pucch_format1b) { pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG; pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2; - AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]); - AssertFatal (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]); - pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; - pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1]; - // release DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); - } else AssertFatal(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt); + packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]); + packetError (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]); + if (!discard) { + pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; + pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1]; + // release DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } + } else + packetError(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt); } else { // TDD - AssertFatal (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode); - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; - LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, - tdd_mapping_mode,harq_ack[0],harq_ack[1]); + packetError (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode); + if (!discard) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; + LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, + tdd_mapping_mode,harq_ack[0],harq_ack[1]); - switch (tdd_mapping_mode) { + switch (tdd_mapping_mode) { case 0: // bundling if (uci->pucch_fmt == pucch_format1a) { pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; LOG_D(PHY,"bundling, pucch1a, number of ack nack %d\n",pdu->harq_indication_tdd_rel13.number_of_ack_nack); - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; - // release all bundled DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; + // release all bundled DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->pucch_fmt == pucch_format1b) { pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); - AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; - pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + if (!discard) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } } break; case 1: // multiplexing - AssertFatal (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt); - - if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) { - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); - pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt); + if (!discard) { + if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1b) { - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); - AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); - pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; - pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } } else { // num_pucch_resources (M) > 1 pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.number_of_ack_nack = uci->num_pucch_resources; @@ -2068,7 +2085,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in release_harq(eNB,DLSCH_id,1,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */); } - break; + break; case 2: // special bundling (SR collision) pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; @@ -2118,16 +2135,23 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in } else { pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0; } - + break; } break; + } + } } } //TDD - - eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++; - LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs); + + if (!discard) { + eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++; + LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs); + } else { + LOG_W(PHY,"discarded a PUCCH because the decoded values are impossible\n"); + } + pthread_mutex_unlock(&eNB->UL_INFO_mutex); } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 1643ca36ca..a48bef64b6 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -2023,8 +2023,18 @@ void *UE_thread(void *arg) if (is_synchronized == 0) { if (instance_cnt_synch < 0) { // we can invoke the synch - // grab 10 ms of signal and wakeup synch thread + // we shift in time flow because the UE doesn't detect sync when frame alignment is not easy + for (int i=0; iframe_parms.nb_antennas_rx; i++) + rxp[i] = (void *)&dummy_rx[i][0]; + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + rxp, + UE->frame_parms.samples_per_tti/2, + UE->frame_parms.nb_antennas_rx); + + // grab 10 ms of signal and wakeup synch thread + if (UE->mode != loop_through_memory) { if (IS_SOFTMODEM_RFSIM ) { for(int sf=0; sf<10; sf++) { From d8dccbad598c42863f605a86648358a45522364f Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 16 Feb 2022 17:14:01 +0100 Subject: [PATCH 467/883] update of sa tests requirements aligned with 256qam --- ci-scripts/xml_files/fr1_sa_quectel_162prb.xml | 4 ++-- ci-scripts/xml_files/fr1_sa_quectel_stages.xml | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml index 23cc6d25b8..f756083ea6 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -96,8 +96,8 @@ Iperf - iperf (DL/140Mbps/UDP)(60 sec)(single-ue profile) - -u -b 140M -t 60 + iperf (DL/200Mbps/UDP)(60 sec)(single-ue profile) + -u -b 200M -t 60 DL nrmodule2_quectel 50 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index 3e497ede13..0ab8bf6b08 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -42,6 +42,8 @@ 000001 071004 000001 + 071005 + 000001 011002 081000
@@ -148,7 +150,16 @@ 90 single-ue
- + + Iperf + iperf (DL/130Mbps/UDP)(30 sec)(single-ue profile) + -u -b 130M -t 30 + DL + nrmodule2_quectel + 50 + 50 + single-ue + From 9a78b58927e0e8f68e6ebc8296ab747e89bf46e4 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 16 Feb 2022 13:12:12 -0800 Subject: [PATCH 468/883] Getting rid of pthread warning and fixing nfapi The nfapi code releases dl_ttis and tx_data_reqs if the buffer has data in it. In the proxy code we overwrite this instead of dropping the packet. --- executables/nr-ue.c | 3 +-- nfapi/open-nFAPI/pnf/src/pnf_p7.c | 43 ++++++------------------------- 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 0bb282c943..d448fa3ba4 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -18,7 +18,7 @@ * For more information about the OpenAirInterface (OAI) Software Alliance: * contact@openairinterface.org */ - +#define _GNU_SOURCE #include #include "executables/nr-uesoftmodem.h" #include "PHY/phy_extern_nr_ue.h" @@ -32,7 +32,6 @@ #include "LAYER2/nr_pdcp/nr_pdcp_entity.h" #include "SCHED_NR_UE/pucch_uci_ue_nr.h" #include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" -#include /* * NR SLOT PROCESSING SEQUENCE diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index fb1a713e56..c44ad2f40d 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -1530,7 +1530,7 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name, else { - + in_window = 1; NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (delta:%d) [max:%d]\n", current_sfn_slot_dec, name, recv_sfn_slot_dec, (current_sfn_slot_dec - recv_sfn_slot_dec), timing_window); }//Need to add more cases @@ -1615,25 +1615,15 @@ void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7) return; } - if(is_nr_p7_request_in_window(req->SFN,req->Slot, "dl_tti_request", pnf_p7)) - { - uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot); - uint8_t buffer_index = sfn_slot_dec % 20; + if (is_nr_p7_request_in_window(req->SFN,req->Slot, "dl_tti_request", pnf_p7)) + { + uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot); + uint8_t buffer_index = sfn_slot_dec % 20; - struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); - NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, pnf_p7->sfn,pnf_p7->slot, req->SFN, req->Slot, buffer_index); - - // if there is already an dl_tti_req make sure we free it. - if(pnf_p7->slot_buffer[buffer_index].dl_tti_req != 0) - { - NFAPI_TRACE(NFAPI_TRACE_NOTE, "%s() is_nr_p7_request_in_window()=TRUE buffer_index occupied - free it first sfn_slot:%d buffer_index:%d\n", __FUNCTION__, NFAPI_SFNSLOT2DEC(req->SFN,req->Slot), buffer_index); - //NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing dl_config_req at index %d (%d/%d)", - // pMyPhyInfo->sfnSf, bufferIdx, - // SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf)); - deallocate_nfapi_dl_tti_request(pnf_p7->slot_buffer[buffer_index].dl_tti_req, pnf_p7); - } + NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, pnf_p7->sfn,pnf_p7->slot, req->SFN, req->Slot, buffer_index); // filling dl_tti_request in slot buffer pnf_p7->slot_buffer[buffer_index].sfn = req->SFN; @@ -2076,23 +2066,6 @@ void pnf_handle_tx_data_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7 struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); - //NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE TX_DATA_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index); -#if 0 - if (0 && NFAPI_SFNSF2DEC(req->sfn_sf)%100==0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX_REQ.req sfn_sf:%d pdus:%d - TX_REQ is within window\n", - __FUNCTION__, - NFAPI_SFNSF2DEC(req->sfn_sf), - req->tx_request_body.number_of_pdus); -#endif - - if(pnf_p7->slot_buffer[buffer_index].tx_data_req != 0) - { - //NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing tx_req at index %d (%d/%d)", - // pMyPhyInfo->sfnSf, bufferIdx, - // SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf)); - - deallocate_nfapi_tx_data_request(pnf_p7->slot_buffer[buffer_index].tx_data_req, pnf_p7); - } - pnf_p7->slot_buffer[buffer_index].sfn = req->SFN; pnf_p7->slot_buffer[buffer_index].slot = req->Slot; pnf_p7->slot_buffer[buffer_index].tx_data_req = req; From 10d0f13ceb9b128bc4a7fd779e500f1cef35df5f Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 16 Feb 2022 13:15:15 -0800 Subject: [PATCH 469/883] Revert "Getting rid of pthread warning and fixing nfapi" This reverts commit 9a78b58927e0e8f68e6ebc8296ab747e89bf46e4. --- executables/nr-ue.c | 3 ++- nfapi/open-nFAPI/pnf/src/pnf_p7.c | 43 +++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index d448fa3ba4..0bb282c943 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -18,7 +18,7 @@ * For more information about the OpenAirInterface (OAI) Software Alliance: * contact@openairinterface.org */ -#define _GNU_SOURCE + #include #include "executables/nr-uesoftmodem.h" #include "PHY/phy_extern_nr_ue.h" @@ -32,6 +32,7 @@ #include "LAYER2/nr_pdcp/nr_pdcp_entity.h" #include "SCHED_NR_UE/pucch_uci_ue_nr.h" #include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" +#include /* * NR SLOT PROCESSING SEQUENCE diff --git a/nfapi/open-nFAPI/pnf/src/pnf_p7.c b/nfapi/open-nFAPI/pnf/src/pnf_p7.c index c44ad2f40d..fb1a713e56 100644 --- a/nfapi/open-nFAPI/pnf/src/pnf_p7.c +++ b/nfapi/open-nFAPI/pnf/src/pnf_p7.c @@ -1530,7 +1530,7 @@ uint8_t is_nr_p7_request_in_window(uint16_t sfn,uint16_t slot, const char* name, else { - in_window = 1; + NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] %s is out of window %d (delta:%d) [max:%d]\n", current_sfn_slot_dec, name, recv_sfn_slot_dec, (current_sfn_slot_dec - recv_sfn_slot_dec), timing_window); }//Need to add more cases @@ -1615,15 +1615,25 @@ void pnf_handle_dl_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7) return; } - if (is_nr_p7_request_in_window(req->SFN,req->Slot, "dl_tti_request", pnf_p7)) - { - uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot); - uint8_t buffer_index = sfn_slot_dec % 20; + if(is_nr_p7_request_in_window(req->SFN,req->Slot, "dl_tti_request", pnf_p7)) + { + uint32_t sfn_slot_dec = NFAPI_SFNSLOT2DEC(req->SFN,req->Slot); + uint8_t buffer_index = sfn_slot_dec % 20; - struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); - NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, pnf_p7->sfn,pnf_p7->slot, req->SFN, req->Slot, buffer_index); + NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE DL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, pnf_p7->sfn,pnf_p7->slot, req->SFN, req->Slot, buffer_index); + + // if there is already an dl_tti_req make sure we free it. + if(pnf_p7->slot_buffer[buffer_index].dl_tti_req != 0) + { + NFAPI_TRACE(NFAPI_TRACE_NOTE, "%s() is_nr_p7_request_in_window()=TRUE buffer_index occupied - free it first sfn_slot:%d buffer_index:%d\n", __FUNCTION__, NFAPI_SFNSLOT2DEC(req->SFN,req->Slot), buffer_index); + //NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing dl_config_req at index %d (%d/%d)", + // pMyPhyInfo->sfnSf, bufferIdx, + // SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf)); + deallocate_nfapi_dl_tti_request(pnf_p7->slot_buffer[buffer_index].dl_tti_req, pnf_p7); + } // filling dl_tti_request in slot buffer pnf_p7->slot_buffer[buffer_index].sfn = req->SFN; @@ -2066,6 +2076,23 @@ void pnf_handle_tx_data_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7 struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); + //NFAPI_TRACE(NFAPI_TRACE_INFO,"%s() %ld.%09ld POPULATE TX_DATA_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, t.tv_sec, t.tv_nsec, sfn_slot_dec, buffer_index); +#if 0 + if (0 && NFAPI_SFNSF2DEC(req->sfn_sf)%100==0) NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX_REQ.req sfn_sf:%d pdus:%d - TX_REQ is within window\n", + __FUNCTION__, + NFAPI_SFNSF2DEC(req->sfn_sf), + req->tx_request_body.number_of_pdus); +#endif + + if(pnf_p7->slot_buffer[buffer_index].tx_data_req != 0) + { + //NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing tx_req at index %d (%d/%d)", + // pMyPhyInfo->sfnSf, bufferIdx, + // SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf)); + + deallocate_nfapi_tx_data_request(pnf_p7->slot_buffer[buffer_index].tx_data_req, pnf_p7); + } + pnf_p7->slot_buffer[buffer_index].sfn = req->SFN; pnf_p7->slot_buffer[buffer_index].slot = req->Slot; pnf_p7->slot_buffer[buffer_index].tx_data_req = req; From 3c925942a9471816c5538769adab6fd54ade78c7 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 16 Feb 2022 13:18:32 -0800 Subject: [PATCH 470/883] Getting rid of pthread warning with GNU_SOURCE --- executables/nr-ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 0bb282c943..c5408d2e16 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -19,6 +19,7 @@ * contact@openairinterface.org */ +#define _GNU_SOURCE #include #include "executables/nr-uesoftmodem.h" #include "PHY/phy_extern_nr_ue.h" @@ -32,7 +33,6 @@ #include "LAYER2/nr_pdcp/nr_pdcp_entity.h" #include "SCHED_NR_UE/pucch_uci_ue_nr.h" #include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" -#include /* * NR SLOT PROCESSING SEQUENCE From e5ddd558adf089f23826ec6442edd98795fe24d6 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 16 Feb 2022 15:13:26 -0800 Subject: [PATCH 471/883] Fixing spacing in nfapi code --- nfapi/open-nFAPI/nfapi/src/nfapi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi.c b/nfapi/open-nFAPI/nfapi/src/nfapi.c index 6d4d61c927..09c0229db0 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi.c @@ -357,22 +357,22 @@ uint32_t pullarray32(uint8_t **values_to_pull, uint32_t max_num_values_to_pull, uint32_t num_values_to_pull, uint8_t *out_end) { - if(num_values_to_pull == 0) + if (num_values_to_pull == 0) return 1; - if(num_values_to_pull > max_num_values_to_pull) { + if (num_values_to_pull > max_num_values_to_pull) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, num_values_to_pull, max_num_values_to_pull); on_error(); return 0; } - if((out_end - (*values_to_pull)) >= sizeof(uint32_t) * num_values_to_pull) { + if ((out_end - (*values_to_pull)) >= sizeof(uint32_t) * num_values_to_pull) { uint32_t idx; - for(idx = 0; idx < num_values_to_pull; ++idx) { - if(!pull32(values_to_pull, &out[idx], out_end)) + for (idx = 0; idx < num_values_to_pull; ++idx) { + if (!pull32(values_to_pull, &out[idx], out_end)) return 0; } @@ -414,21 +414,21 @@ uint32_t pusharray32(const uint32_t *values_to_push, uint32_t num_values_to_push, uint8_t **out, uint8_t *out_end) { - if(num_values_to_push == 0) + if (num_values_to_push == 0) return 1; - if(num_values_to_push > max_num_values_to_push) { + if (num_values_to_push > max_num_values_to_push) { NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s exceed array size (%d > %d)\n", __FUNCTION__, num_values_to_push, max_num_values_to_push); on_error(); return 0; } - if((out_end - (*out)) >= sizeof(uint32_t) * num_values_to_push) { + if ((out_end - (*out)) >= sizeof(uint32_t) * num_values_to_push) { uint32_t idx; - for(idx = 0; idx < num_values_to_push; ++idx) { - if(!push32(values_to_push[idx], out, out_end)) + for (idx = 0; idx < num_values_to_push; ++idx) { + if (!push32(values_to_push[idx], out, out_end)) return 0; } From c917352dd2c0e6c8c1fedf38d879e551271b4a1e Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 16 Feb 2022 16:11:19 -0800 Subject: [PATCH 472/883] Resolving issues in MR: Adding error checking before indexing in mac layer harq array Adding error checking before writing ul_harq_sfn_slot Added comments Made a "static" free_uci_inds() actually static --- executables/nr-ue.c | 9 +++- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 35 ++++++++++++++++ openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 11 ++--- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 43 +++++--------------- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 2 - 5 files changed, 55 insertions(+), 45 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index c5408d2e16..84288de469 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -313,6 +313,13 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) int last_sfn_slot = -1; uint16_t sfn_slot = 0; + module_id_t mod_id = 0; + NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); + for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) { + mac->nr_ue_emul_l1.harq[i].active = false; + mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot = -1; + } + while (!oai_exit) { if (sem_wait(&sfn_slot_semaphore) != 0) @@ -347,8 +354,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) LOG_D(NR_MAC, "The received sfn/slot [%d %d] from proxy\n", frame, slot); - module_id_t mod_id = 0; - NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); if (get_softmodem_params()->sa && mac->mib == NULL) { LOG_D(NR_MAC, "We haven't gotten MIB. Lets see if we received it\n"); diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 76521a5f3c..702bf6d1a1 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -74,6 +74,38 @@ static void fill_uci_2_3_4(nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4, pdu_2_3_4->csi_part1.csi_part1_crc = 0; } +static void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind) +{ + for (int k = 0; k < uci_ind->num_ucis; k++) + { + if (uci_ind->uci_list[k].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) + { + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1; + free(pdu_0_1->sr); + pdu_0_1->sr = NULL; + if (pdu_0_1->harq) + { + free(pdu_0_1->harq->harq_list); + pdu_0_1->harq->harq_list = NULL; + } + free(pdu_0_1->harq); + pdu_0_1->harq = NULL; + } + if (uci_ind->uci_list[k].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) + { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[k].pucch_pdu_format_2_3_4; + free(pdu_2_3_4->sr.sr_payload); + pdu_2_3_4->sr.sr_payload = NULL; + free(pdu_2_3_4->harq.harq_payload); + pdu_2_3_4->harq.harq_payload = NULL; + } + } + free(uci_ind->uci_list); + uci_ind->uci_list = NULL; + free(uci_ind); + uci_ind = NULL; +} + int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response) { NR_UE_MAC_INST_t *mac = get_mac_inst(0); if(scheduled_response != NULL) @@ -136,6 +168,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind->crc_list[j].tb_crc_status = 0; crc_ind->crc_list[j].timing_advance = 31; crc_ind->crc_list[j].ul_cqi = 255; + AssertFatal(mac->nr_ue_emul_l1.harq[crc_ind->crc_list[j].harq_id].active_ul_harq_sfn_slot == -1, + "We did not send an active CRC when we should have!\n"); mac->nr_ue_emul_l1.harq[crc_ind->crc_list[j].harq_id].active_ul_harq_sfn_slot = NFAPI_SFNSLOT2HEX(crc_ind->sfn, crc_ind->slot); LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d] with mcs_index in ul_cqi -> %d\n", scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot,pusch_config_pdu->mcs_index); @@ -218,6 +252,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response { mac->nr_ue_emul_l1.harq[k].active = false; harq_pid = k; + AssertFatal(harq_index < pdu_0_1->harq->num_harq, "Invalid harq_index %d\n", harq_index); pdu_0_1->harq->harq_list[harq_index].harq_value = !mac->dl_harq_info[k].ack; harq_index++; } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 92fc813e6a..14c6824c45 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1336,10 +1336,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, current_harq->dl_slot = slot; if (get_softmodem_params()->emulate_l1) { if (data_toul_fb + slot > 19) { - if (frame + 1 < 1024) - frame++; - else - frame = 0; + frame = (frame + 1) % 1024; slot = (data_toul_fb + slot) - 20; } else { @@ -2028,15 +2025,13 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, if (current_harq->active) { sched_frame = current_harq->dl_frame; if (current_harq->feedback_to_ul + current_harq->dl_slot > 19) { - if (sched_frame + 1 < 1024) - sched_frame++; - else - sched_frame = 0; + sched_frame = (sched_frame + 1) % 1024; sched_slot = (current_harq->feedback_to_ul + current_harq->dl_slot) - slots_per_frame; } else { sched_slot = current_harq->feedback_to_ul + current_harq->dl_slot; } + AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot); LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common); /* check if current tx slot should transmit downlink acknowlegment */ if (sched_frame == frame && sched_slot == slot) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 99d94e1a76..d0d133dbfd 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -540,38 +540,6 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi dl_info->rx_ind->number_pdus = pdu_idx; } -void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind) -{ - for (int k = 0; k < uci_ind->num_ucis; k++) - { - if (uci_ind->uci_list[k].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) - { - nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[k].pucch_pdu_format_0_1; - free(pdu_0_1->sr); - pdu_0_1->sr = NULL; - if (pdu_0_1->harq) - { - free(pdu_0_1->harq->harq_list); - pdu_0_1->harq->harq_list = NULL; - } - free(pdu_0_1->harq); - pdu_0_1->harq = NULL; - } - if (uci_ind->uci_list[k].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) - { - nfapi_nr_uci_pucch_pdu_format_2_3_4_t *pdu_2_3_4 = &uci_ind->uci_list[k].pucch_pdu_format_2_3_4; - free(pdu_2_3_4->sr.sr_payload); - pdu_2_3_4->sr.sr_payload = NULL; - free(pdu_2_3_4->harq.harq_payload); - pdu_2_3_4->harq.harq_payload = NULL; - } - } - free(uci_ind->uci_list); - uci_ind->uci_list = NULL; - free(uci_ind); - uci_ind = NULL; -} - static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_ul_dci_request_t *ul_dci_req) { NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); @@ -624,6 +592,12 @@ static bool send_crc_ind_and_rx_ind(int sfn_slot) if (crc_ind && crc_ind->number_crcs > 0) { + NR_UE_MAC_INST_t *mac = get_mac_inst(0); + for (int i = 0; i < crc_ind->number_crcs; i++) { + int harq_pid = crc_ind->crc_list[i].harq_id; + LOG_D(NR_MAC, "Resetting harq_pid %d active_ul_harq_sfn_slot\n", harq_pid); + mac->nr_ue_emul_l1.harq[harq_pid].active_ul_harq_sfn_slot = -1; + } NR_UL_IND_t UL_INFO = { .crc_ind = *crc_ind, }; @@ -912,7 +886,10 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea LOG_E(NR_PHY, "Message ul_tti_request failed to unpack\n"); break; } - + /* We are filtering UL_TTI_REQs below. We only care about UL_TTI_REQs that + will trigger sending a ul_harq (CRC/RX pair). This UL_TTI_REQ will have + NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE. If we have not yet completed the CBRA/ + CFRA procedure, we need to queue all UL_TTI_REQs. */ for (int i = 0; i < ul_tti_request->n_pdus; i++) { if (ul_tti_request->pdus_list[i].pdu_type == NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE && mac->ra.ra_state >= RA_SUCCEEDED) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 3984ed3380..499346f394 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -268,8 +268,6 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, bool sfn_slot_matcher(void *wanted, void *candidate); -void free_uci_inds(nfapi_nr_uci_indication_t *uci_ind); - /**\brief done free of memory allocation by module_id and release to pointer pool. \param module_id module id*/ int nr_ue_if_module_kill(uint32_t module_id); From 5637b62ed86204a8cf9297b8b91f659e5729a7d2 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 16 Feb 2022 16:26:41 -0800 Subject: [PATCH 473/883] Return in gNB if pdu_len is less than cast length This is what we did in the NRUE for NSA mode --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 40a9900284..57c74af314 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -220,9 +220,6 @@ int nr_process_mac_pdu(module_id_t module_idP, LOG_D(NR_MAC, "In %s: received UL-SCH sub-PDU with LCID 0x%x in %d.%d (remaining PDU length %d)\n", __func__, rx_lcid, frameP, slot, pdu_len); - if (pdu_len < 7) { - break; - } unsigned char *ce_ptr; int n_Lcg = 0; @@ -264,9 +261,13 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_L_TRUNCATED_BSR: //38.321 section 6.1.3.1 //variable length + if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) + return 0; mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; mac_subheader_len = 2; if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ + if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) + return 0; mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; mac_subheader_len = 3; } @@ -343,9 +344,13 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_MULTI_ENTRY_PHR_1_OCT: //38.321 section 6.1.3.9 // varialbe length + if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) + return 0; mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; mac_subheader_len = 2; if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ + if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) + return 0; mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; mac_subheader_len = 3; } @@ -355,9 +360,13 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT: //38.321 section 6.1.3.9 // varialbe length + if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) + return 0; mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; mac_subheader_len = 2; if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ + if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) + return 0; mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; mac_subheader_len = 3; } @@ -371,8 +380,12 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_SRB1: case UL_SCH_LCID_SRB2: + if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) + return 0; if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ //mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; + if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) + return 0; mac_subheader_len = 3; mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) | ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff); @@ -456,8 +469,12 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_DTCH: // check if LCID is valid at current time. + if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) + return 0; if (((NR_MAC_SUBHEADER_SHORT *)pduP)->F) { // mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; + if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) + return 0; mac_subheader_len = 3; mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L1 & 0x7f) << 8) | ((uint16_t)((NR_MAC_SUBHEADER_LONG *)pduP)->L2 & 0xff); From bcbafdf094e5140740c45a9c80288018ec88569d Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Feb 2022 10:31:16 +0100 Subject: [PATCH 474/883] fix for ulprbbl memcpy --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 544f62a599..e9490c9fb2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -319,7 +319,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, const int num_slots = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const int last_slot = (slot + num_slots - 1) % num_slots; uint16_t *vrb_map_UL = cc[CC_id].vrb_map_UL; - memcpy(&vrb_map_UL[last_slot * MAX_BWP_SIZE], &RC.nrmac[module_idP]->ulprbbl, MAX_BWP_SIZE); + memcpy(&vrb_map_UL[last_slot * MAX_BWP_SIZE], &RC.nrmac[module_idP]->ulprbbl, sizeof(uint16_t) * MAX_BWP_SIZE); clear_nr_nfapi_information(RC.nrmac[module_idP], CC_id, frame, slot); From ba27a018279cbed58bf53d169b94ad929038c687 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Feb 2022 10:43:37 +0100 Subject: [PATCH 475/883] fix dlschsim --- openair1/SIMULATION/NR_PHY/dlschsim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 0c26989c29..b6769f6152 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -419,8 +419,9 @@ int main(int argc, char **argv) //nr_init_frame_parms_ue(&UE->frame_parms); //init_nr_ue_transport(UE, 0); + int num_codeword = NR_MAX_NB_LAYERS > 4? 2:1; for (int sf = 0; sf < 2; sf++) { - for (i = 0; i < 2; i++) { + for (i = 0; i < num_codeword; i++) { UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL, 0); From fd40aa2666db8a58ad7403bfe718933b37a18ee6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 9 Feb 2022 20:09:51 +0000 Subject: [PATCH 476/883] Make nr_find_nb_rb() take minimum RBsize Fixes a bug when scheduling multiple UEs --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 ++++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 5 +++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 ++++- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index cb76c22292..0a21391162 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -598,6 +598,7 @@ bool allocate_dl_retransmission(module_id_t module_id, temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT, retInfo->tb_size, + 1, /* minimum of 1RB: need to find exact TBS, don't preclude any number */ rbSize, &new_tbs, &new_rbSize); @@ -739,8 +740,9 @@ void pf_dl(module_id_t module_id, } } + const int min_rbSize = 5; /* Loop UE_sched to find max coeff and allocate transmission */ - while (max_num_ue > 0 && n_rb_sched > 0 && UE_sched.head >= 0) { + while (max_num_ue > 0 && n_rb_sched >= min_rbSize && UE_sched.head >= 0) { /* Find max coeff from UE_sched*/ int *max = &UE_sched.head; /* assume head is max */ @@ -859,6 +861,7 @@ void pf_dl(module_id_t module_id, ps->nrOfSymbols, ps->N_PRB_DMRS * ps->N_DMRS_SLOT, sched_ctrl->num_total_bytes + oh, + min_rbSize, max_rbSize, &TBS, &rbSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index a1dfc7c833..4028f85b2a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -388,6 +388,7 @@ bool nr_find_nb_rb(uint16_t Qm, uint16_t nb_symb_sch, uint16_t nb_dmrs_prb, uint32_t bytes, + uint16_t nb_rb_min, uint16_t nb_rb_max, uint32_t *tbs, uint16_t *nb_rb) @@ -403,7 +404,7 @@ bool nr_find_nb_rb(uint16_t Qm, return true; /* is the minimum enough? */ - *nb_rb = 5; + *nb_rb = nb_rb_min; *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; if (bytes <= *tbs) return true; @@ -411,7 +412,7 @@ bool nr_find_nb_rb(uint16_t Qm, /* perform binary search to allocate all bytes within a TBS up to nb_rb_max * RBs */ int hi = nb_rb_max; - int lo = 1; + int lo = nb_rb_min; for (int p = (hi + lo) / 2; lo + 1 < hi; p = (hi + lo) / 2) { const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3; if (bytes == TBS) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 0a18731c0a..96ffb7e2a3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1004,6 +1004,7 @@ bool allocate_ul_retransmission(module_id_t module_id, temp_ps.nrOfSymbols, temp_ps.N_PRB_DMRS * temp_ps.num_dmrs_symb, retInfo->tb_size, + 1, /* minimum of 1RB: need to find exact TBS, don't preclude any number */ rbSize, &new_tbs, &new_rbSize); @@ -1256,8 +1257,9 @@ void pf_ul(module_id_t module_id, } + const int min_rbSize = 5; /* Loop UE_sched to find max coeff and allocate transmission */ - while (UE_sched.head >= 0 && max_num_ue> 0 && n_rb_sched > 0) { + while (UE_sched.head >= 0 && max_num_ue> 0 && n_rb_sched >= min_rbSize) { /* Find max coeff */ int *max = &UE_sched.head; /* Find max coeff: assume head is max */ int *p = &UE_sched.next[*max]; @@ -1349,6 +1351,7 @@ void pf_ul(module_id_t module_id, ps->nrOfSymbols, ps->N_PRB_DMRS * ps->num_dmrs_symb, B, + min_rbSize, max_rbSize, &TBS, &rbSize); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 9afd2a4083..d9767367dc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -463,6 +463,7 @@ bool nr_find_nb_rb(uint16_t Qm, uint16_t nb_symb_sch, uint16_t nb_dmrs_prb, uint32_t bytes, + uint16_t nb_rb_min, uint16_t nb_rb_max, uint32_t *tbs, uint16_t *nb_rb); From e890cee31cd508eb605c11b6b6a949ddaebc4d6f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 10 Feb 2022 12:04:07 +0100 Subject: [PATCH 477/883] Reduce max_num_ue after successful PUCCH alloc --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 10 ++++++---- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0a21391162..bf29fd0e01 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -802,9 +802,6 @@ void pf_dl(module_id_t module_id, LOG_D(NR_MAC, "%4d.%2d could not find CCE for DL DCI UE %d/RNTI %04x\n", frame, slot, UE_id, rnti); continue; } - /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */ - max_num_ue--; - if (max_num_ue < 0) return; /* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH * allocation after CCE alloc fail would be more complex) */ @@ -818,9 +815,14 @@ void pf_dl(module_id_t module_id, frame, slot); mac->pdcch_cand[cid]--; - return; + continue; } + /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE + * and PUCCH */ + max_num_ue--; + AssertFatal(max_num_ue >= 0, "Illegal max_num_ue %d\n", max_num_ue); + sched_ctrl->cce_index = CCEIndex; fill_pdcch_vrb_map(mac, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 96ffb7e2a3..b0b49565be 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1305,8 +1305,7 @@ void pf_ul(module_id_t module_id, /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */ max_num_ue--; - if (max_num_ue < 0) - return; + AssertFatal(max_num_ue >= 0, "Illegal max_num_ue %d\n", max_num_ue); NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; From 9f02206b8a1357ceef7292b131e168a0041af2f6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Feb 2022 17:43:24 +0100 Subject: [PATCH 478/883] error message if no uecap in fill_default_secondaryCellGroup --- openair2/RRC/NR/rrc_gNB_reconfig.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 9b051933a1..b8d2f036bd 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -65,6 +65,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n"); + if(uecap == NULL) + LOG_E(RRC,"No UE Capabilities available when programming default CellGroup in NSA\n"); + // This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4. // However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources, // where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations. From 2208abfedd776adbc90f07a27b10c71693bc0555 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 17 Feb 2022 08:48:26 -0800 Subject: [PATCH 479/883] Modifying change to MAC layer Instead of conditionally calling the pucch_scheduler we now only call the functions we need from the stub function directly. This is better because we are not modifying the OAI MAC layer code and ensuring that we are not calling the pucch_scheduler twice for the same sfn/slot --- executables/nr-ue.c | 5 +++-- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 84288de469..b957cb3bd4 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -409,8 +409,9 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ul_info.slot_tx, mac->frame_type)) { LOG_D(NR_MAC, "Slot %d. calling nr_ue_ul_ind() and nr_ue_pucch_scheduler() from %s\n", ul_info.slot_tx, __FUNCTION__); - nr_ue_ul_indication(&ul_info); - nr_ue_pucch_scheduler(0, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id); + nr_ue_scheduler(NULL, &ul_info); + nr_ue_prach_scheduler(mod_id, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id); + nr_ue_pucch_scheduler(mod_id, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id); check_nr_prach(mac, &ul_info, &prach_resources); } if (!IS_SOFTMODEM_NOS1 && get_softmodem_params()->sa) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index d0d133dbfd..354de5fd5f 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -767,7 +767,10 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, ul_info.slot_tx, mac->frame_type)) - nr_ue_ul_indication(&ul_info); + { + nr_ue_scheduler(NULL, &ul_info); + nr_ue_prach_scheduler(ul_info.module_id, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id); + } } } @@ -1110,8 +1113,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test) nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); - if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && - !get_softmodem_params()->emulate_l1) + if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type)) nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); switch(ret){ From a21fb77dd17c104266b848f3ee2a49dd78c382c9 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 17 Feb 2022 10:25:28 -0800 Subject: [PATCH 480/883] Added comment to justify uci_size condition Also, properly filling the CCE index and Agg level in the stub function when we get the DCI from nfapi --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 1 + openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 14c6824c45..855b86d24c 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1827,6 +1827,7 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size) { mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup && mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->resourceSetToAddModList && mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set_id] != NULL)) { + // PUCCH with format0 can be up to 3 bits (2 ack/nacks + 1 sr is 3 max bits) if (uci_size <= 3) { pucch_resource_set_id = 0; return (pucch_resource_set_id); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 354de5fd5f..1f7eb83c60 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -303,6 +303,8 @@ static void fill_dl_info_with_pdcch(fapi_nr_dci_indication_t *dci, nfapi_nr_dl_d } dci->dci_list[idx].payloadSize = rx_dci->PayloadSizeBits; dci->dci_list[idx].rnti = rx_dci->RNTI; + dci->dci_list[idx].n_CCE = rx_dci->CceIndex; + dci->dci_list[idx].N_CCE = rx_dci->AggregationLevel; dci->number_of_dcis = idx + 1; } From 53001d0d100a40c9f2f60f3d39c681492aa44923 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 15 Feb 2022 13:13:15 +0100 Subject: [PATCH 481/883] remove-NR_UE_PBCH scope to finish --- openair1/PHY/INIT/nr_init_ue.c | 19 -- .../PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c | 5 +- .../nr_dl_channel_estimation.c | 120 ++++++------ openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 7 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 13 +- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 185 +++++++++--------- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 5 +- openair1/PHY/TOOLS/nr_phy_scope.c | 82 +++++--- openair1/PHY/TOOLS/phy_scope_interface.h | 12 +- openair1/PHY/defs_UE.h | 1 + openair1/PHY/defs_nr_UE.h | 38 +--- openair1/SCHED_NR_UE/defs.h | 8 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 36 ++-- .../SIMULATION/NR_PHY/nr_dummy_functions.c | 4 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 18 +- 15 files changed, 288 insertions(+), 265 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b571afe416..9266a1fecd 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -416,29 +416,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } // PBCH - pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); // prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); - for (i=0; inb_antennas_rx; i++) { - pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); - - for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) { - int idx = (j*fp->nb_antennas_rx)+i; - pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); - pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); - } - } } - - pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64); } // initialization for the last instance of pdsch_vars (used for MU-MIMO) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index 19d4bf5079..89d67408e1 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -36,6 +36,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, PHY_VARS_NR_UE *ue, module_id_t gNB_id, + const int estimateSz, struct complex16 dl_ch_estimates_time[][estimateSz], uint8_t frame, uint8_t subframe, unsigned char clear, @@ -60,8 +61,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, int j = (i < 0) ? (i + frame_parms->ofdm_symbol_size) : i; for (int aa = 0; aa < frame_parms->nb_antennas_rx; aa++) { - int Re = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[(j<<1)]; - int Im = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[1+(j<<1)]; + int Re = dl_ch_estimates_time[aa][j].r; + int Im = dl_ch_estimates_time[aa][j].i; temp += (Re*Re/2) + (Im*Im/2); } diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 30eae2d30f..8efe85b222 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -29,6 +29,7 @@ #include "PHY/NR_REFSIG/ptrs_nr.h" #include "PHY/NR_TRANSPORT/nr_sch_dmrs.h" #include "filt16a_32.h" +#include //#define DEBUG_PDSCH //#define DEBUG_PDCCH @@ -43,7 +44,6 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, NR_UE_SSB *current_ssb) { int pilot[200] __attribute__((aligned(16))); - unsigned char aarx; unsigned short k; unsigned int pilot_cnt; int16_t ch[2],*pil,*rxF; @@ -77,7 +77,7 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, // generate pilot nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]); - for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { + for (int aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { int re_offset = ssb_offset; pil = (int16_t *)&pilot[0]; @@ -197,6 +197,9 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, + int estimateSz, + struct complex16 dl_ch_estimates [][estimateSz], + struct complex16 dl_ch_estimates_time [][estimateSz], UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, unsigned char Ns, @@ -206,16 +209,14 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, uint8_t n_hf) { int pilot[200] __attribute__((aligned(16))); - unsigned char aarx,p; unsigned short k; unsigned int pilot_cnt; - int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr; + int16_t *pil,*rxF,*dl_ch,*fl,*fm,*fr; int ch_offset,symbol_offset; //int slot_pbch; uint8_t nushift; - int **dl_ch_estimates =ue->pbch_vars[gNB_id]->dl_ch_estimates; - int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; + int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; nushift = ue->frame_parms.Nid_cell%4; ue->frame_parms.nushift = nushift; @@ -269,17 +270,57 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, break; } + idft_size_idx_t idftsizeidx; + + switch (ue->frame_parms.ofdm_symbol_size) { + case 128: + idftsizeidx = IDFT_128; + break; + + case 256: + idftsizeidx = IDFT_256; + break; + + case 512: + idftsizeidx = IDFT_512; + break; + + case 1024: + idftsizeidx = IDFT_1024; + break; + + case 1536: + idftsizeidx = IDFT_1536; + break; + + case 2048: + idftsizeidx = IDFT_2048; + break; + + case 3072: + idftsizeidx = IDFT_3072; + break; + + case 4096: + idftsizeidx = IDFT_4096; + break; + + default: + printf("unsupported ofdm symbol size \n"); + assert(0); + } + // generate pilot nr_pbch_dmrs_rx(dmrss,ue->nr_gold_pbch[n_hf][ssb_index], &pilot[0]); - for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { + for (int aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { int re_offset = ssb_offset; pil = (int16_t *)&pilot[0]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset]; - memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size)); + memset(dl_ch,0,sizeof(*dl_ch)*(ue->frame_parms.ofdm_symbol_size)); #ifdef DEBUG_CH printf("pbch ch est pilot addr %p RB_DL %d\n",&pilot[0], ue->frame_parms.N_RB_DL); @@ -289,6 +330,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, #endif // Treat first 2 pilots specially (left edge) + int16_t ch[2]; ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -402,62 +444,18 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, } - idft_size_idx_t idftsizeidx; - - switch (ue->frame_parms.ofdm_symbol_size) { - case 128: - idftsizeidx = IDFT_128; - break; - - case 256: - idftsizeidx = IDFT_256; - break; - - case 512: - idftsizeidx = IDFT_512; - break; - - case 1024: - idftsizeidx = IDFT_1024; - break; - - case 1536: - idftsizeidx = IDFT_1536; - break; - - case 2048: - idftsizeidx = IDFT_2048; - break; - - case 3072: - idftsizeidx = IDFT_3072; - break; - - case 4096: - idftsizeidx = IDFT_4096; - break; - - default: - printf("unsupported ofdm symbol size \n"); - assert(0); - } - if( dmrss == 2) // update time statistics for last PBCH symbol { // do ifft of channel estimate - for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) - for (p=0; pframe_parms.nb_antenna_ports_gNB; p++) { - if (ue->pbch_vars[gNB_id]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx]) - { - LOG_D(PHY,"Channel Impulse Computation Slot %d ThreadId %d Symbol %d ch_offset %d\n", Ns, proc->thread_id, symbol, ch_offset); - idft(idftsizeidx, - (int16_t*) &ue->pbch_vars[gNB_id]->dl_ch_estimates[(p*ue->frame_parms.nb_antennas_rx)+aarx][ch_offset], - (int16_t*) ue->pbch_vars[gNB_id]->dl_ch_estimates_time[(p*ue->frame_parms.nb_antennas_rx)+aarx],1); - } - } - } - - } + LOG_D(PHY,"Channel Impulse Computation Slot %d Symbol %d ch_offset %d\n", Ns, symbol, ch_offset); + idft(idftsizeidx, + (int16_t*) &dl_ch_estimates[aarx][ch_offset], + (int16_t*) dl_ch_estimates_time[aarx], + 1); +} +} + if (dmrss == 2) + scopeCopy(ue, pbchDlChEstimateTime, dl_ch_estimates_time, sizeof(struct complex16), idftsizeidx, ue->frame_parms.nb_antennas_rx); return(0); } diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index c5330ce2f2..450631774e 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -56,7 +56,10 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, NR_UE_SSB *current_ssb); int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, + int estimateSz, + struct complex16 dl_ch_estimates [][estimateSz], + struct complex16 dl_ch_estimates_time [][estimateSz], + UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, unsigned char Ns, unsigned char symbol, @@ -78,6 +81,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, PHY_VARS_NR_UE *ue, module_id_t gNB_id, + int estimateSz, + struct complex16 dl_ch_estimates_time [][estimateSz], uint8_t frame, uint8_t subframe, unsigned char clear, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 8917a8bc1b..39dc183bc3 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -149,17 +149,22 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini start_meas(&ue->dlsch_channel_estimation_stats); // computing channel estimation for selected best ssb + const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size; + struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; + struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf); + nr_pbch_channel_estimation(ue,estimateSz, dl_ch_estimates, dl_ch_estimates_time, proc,0,0,i,i-pbch_initial_symbol,temp_ptr->i_ssb,temp_ptr->n_hf); stop_meas(&ue->dlsch_channel_estimation_stats); - + fapiPbch_t result; ret = nr_rx_pbch(ue, proc, - ue->pbch_vars[0], + estimateSz, dl_ch_estimates, + ue->pbch_vars[0], frame_parms, 0, temp_ptr->i_ssb, - SISO); + SISO, + &result); temp_ptr=temp_ptr->next_ssb; } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index dff347f7c0..2b5cc6c3d6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -36,6 +36,7 @@ #include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/INIT/phy_init.h" #include "openair1/SCHED_NR_UE/defs.h" +#include //#define DEBUG_PBCH //#define DEBUG_PBCH_ENCODING @@ -46,16 +47,16 @@ #define print_shorts(s,x) printf("%s : %d,%d,%d,%d,%d,%d,%d,%d\n",s,((int16_t*)x)[0],((int16_t*)x)[1],((int16_t*)x)[2],((int16_t*)x)[3],((int16_t*)x)[4],((int16_t*)x)[5],((int16_t*)x)[6],((int16_t*)x)[7]) -uint16_t nr_pbch_extract(int **rxdataF, - int **dl_ch_estimates, - int **rxdataF_ext, - int **dl_ch_estimates_ext, +static uint16_t nr_pbch_extract(int **rxdataF, + const int estimateSz, + struct complex16 dl_ch_estimates[][estimateSz], + struct complex16 rxdataF_ext[][20*12*4], + struct complex16 dl_ch_estimates_ext[][20*12*4], uint32_t symbol, uint32_t s_offset, NR_DL_FRAME_PARMS *frame_parms) { uint16_t rb; uint8_t i,j,aarx; - int32_t *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext; int nushiftmod4 = frame_parms->nushift; AssertFatal(symbol>=1 && symbol<5, @@ -66,8 +67,8 @@ uint16_t nr_pbch_extract(int **rxdataF, unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier; rx_offset = (rx_offset)%(frame_parms->ofdm_symbol_size); - rxF = &rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size]; - rxF_ext = &rxdataF_ext[aarx][symbol*20*12]; + struct complex16 *rxF = (struct complex16 *)&rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size]; + struct complex16 *rxF_ext = rxdataF_ext[aarx]; #ifdef DEBUG_PBCH printf("extract_rbs (nushift %d): rx_offset=%d, symbol %u\n",frame_parms->nushift, (rx_offset + ((symbol+s_offset)*(frame_parms->ofdm_symbol_size))),symbol); @@ -76,7 +77,6 @@ uint16_t nr_pbch_extract(int **rxdataF, for (int i =0; i<8; i++) { printf("rxF [%d]= %d\n",i,rxF[i]); printf("pbch extract rxF %d %d addr %p\n", p[2*i], p[2*i+1], &p[2*i]); - printf("rxF ext addr %p\n", &rxF_ext[i]); } #endif @@ -134,11 +134,10 @@ uint16_t nr_pbch_extract(int **rxdataF, } } } - - dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))]; + struct complex16 *dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))]; //printf("dl_ch0 addr %p\n",dl_ch0); - dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*20*12]; + struct complex16 *dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*20*12]; for (rb=0; rb<20; rb++) { j=0; @@ -199,7 +198,7 @@ uint16_t nr_pbch_extract(int **rxdataF, //__m128i avg128; //compute average channel_level on each (TX,RX) antenna pair -int nr_pbch_channel_level(int **dl_ch_estimates_ext, +int nr_pbch_channel_level(struct complex16 dl_ch_estimates_ext[][20*12*4], NR_DL_FRAME_PARMS *frame_parms, uint32_t symbol) { int16_t rb, nb_rb=20; @@ -258,13 +257,13 @@ int nr_pbch_channel_level(int **dl_ch_estimates_ext, return(avg2); } -void nr_pbch_channel_compensation(int **rxdataF_ext, - int **dl_ch_estimates_ext, - int **rxdataF_comp, - NR_DL_FRAME_PARMS *frame_parms, - uint32_t symbol, - uint8_t output_shift) { - const uint16_t nb_re=symbol == 2 ? 72 : 180; +static void nr_pbch_channel_compensation(struct complex16 rxdataF_ext[][20*12*4], + struct complex16 dl_ch_estimates_ext[][20*12*4], + int cols, + struct complex16 rxdataF_comp[][cols], + NR_DL_FRAME_PARMS *frame_parms, + uint32_t symbol, + uint8_t output_shift) { AssertFatal((symbol > 0 && symbol < 4), "symbol %d is illegal for PBCH DM-RS\n", symbol); @@ -273,15 +272,15 @@ void nr_pbch_channel_compensation(int **rxdataF_ext, for (int aarx=0; aarxnb_antennas_rx; aarx++) { vect128 *dl_ch128 = (vect128 *)&dl_ch_estimates_ext[aarx][symbol*20*12]; - vect128 *rxdataF128 = (vect128 *)&rxdataF_ext[aarx][symbol*20*12]; - vect128 *rxdataF_comp128 = (vect128 *)&rxdataF_comp[aarx][symbol*20*12]; + vect128 *rxdataF128 = (vect128 *)rxdataF_ext[aarx]; + vect128 *rxdataF_comp128 = (vect128 *)rxdataF_comp[aarx]; /* printf("ch compensation dl_ch ext addr %p \n", &dl_ch_estimates_ext[aarx][symbol*20*12]); - printf("rxdataf ext addr %p symbol %d\n", &rxdataF_ext[aarx][symbol*20*12], symbol); + printf("rxdataf ext addr %p symbol %d\n", rxdataF_ext[aarx], symbol); printf("rxdataf_comp addr %p\n",&rxdataF_comp[aarx][symbol*20*12]); */ - for (int re=0; rellr; reset = 1; // x1 is set in first call to lte_gold_generic x2 = Nid; //this is c_init @@ -361,10 +362,10 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, reset = 0; } - (pbch->pbch_a_interleaved) ^= ((unscrambling_mask>>i)&1)? ((pbch->pbch_a_prime>>i)&1)<pbch_a_prime>>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)); + *pbch_a_interleaved ^= ((unscrambling_mask>>i)&1)? ((pbch_a_prime>>i)&1)<>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)); #ifdef DEBUG_PBCH_ENCODING - printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, pbch->pbch_a_interleaved, + printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, *pbch_a_interleaved, (!((unscrambling_mask>>i)&1))); #endif } else { @@ -386,7 +387,7 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, } } -void nr_pbch_quantize(int16_t *pbch_llr8, +static void nr_pbch_quantize(int16_t *pbch_llr8, int16_t *pbch_llr, uint16_t len) { uint16_t i; @@ -410,11 +411,13 @@ uint8_t pbch_deinterleaving_pattern[32] = {28,0,31,30,7,29,25,27,5,8,24,9,10,11, int nr_rx_pbch( PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, + int estimateSz, struct complex16 dl_ch_estimates [][estimateSz], NR_UE_PBCH *nr_ue_pbch_vars, NR_DL_FRAME_PARMS *frame_parms, uint8_t gNB_id, uint8_t i_ssb, - MIMO_mode_t mimo_mode) { + MIMO_mode_t mimo_mode, + fapiPbch_t* result) { NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars; int max_h=0; @@ -422,9 +425,6 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, //uint8_t pbch_a[64]; //FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for.. //uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); - //uint32_t pbch_a_prime; - int16_t *pbch_e_rx; - uint8_t *decoded_output = nr_ue_pbch_vars->decoded_output; uint8_t nushift; uint16_t M; uint8_t Lmax=frame_parms->Lmax; @@ -437,9 +437,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, // FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); //printf("nr_pbch_ue nid_cell %d\n",frame_parms->Nid_cell); - pbch_e_rx = &nr_ue_pbch_vars->llr[0]; - // clear LLR buffer - memset(nr_ue_pbch_vars->llr,0,NR_POLAR_PBCH_E); + int16_t pbch_e_rx[960]={0}; //Fixme: previous version erase only NR_POLAR_PBCH_E bytes + int pbch_e_rx_idx=0; int symbol_offset=1; if (ue->is_synchronized > 0) @@ -455,12 +454,19 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif // symbol refers to symbol within SSB. symbol_offset is the offset of the SSB wrt start of slot + double log2_maxh; for (symbol=1; symbol<4; symbol++) { - + const uint16_t nb_re=symbol == 2 ? 72 : 180; + struct complex16 rxdataF_ext[frame_parms->nb_antennas_rx][20*12*4]; + struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][nb_re]; + //was dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); + struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][20*12*4]; + nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, - nr_ue_pbch_vars->dl_ch_estimates, - nr_ue_pbch_vars->rxdataF_ext, - nr_ue_pbch_vars->dl_ch_estimates_ext, + estimateSz, + dl_ch_estimates, + rxdataF_ext, + dl_ch_estimates_ext, symbol, symbol_offset, frame_parms); @@ -470,115 +476,113 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif if (symbol == 1) { - max_h = nr_pbch_channel_level(nr_ue_pbch_vars->dl_ch_estimates_ext, + max_h = nr_pbch_channel_level(dl_ch_estimates_ext, frame_parms, symbol); - nr_ue_pbch_vars->log2_maxh = 3+(log2_approx(max_h)/2); + log2_maxh = 3+(log2_approx(max_h)/2); } #ifdef DEBUG_PBCH LOG_I(PHY,"[PHY] PBCH log2_maxh = %d (%d)\n",nr_ue_pbch_vars->log2_maxh,max_h); #endif - nr_pbch_channel_compensation(nr_ue_pbch_vars->rxdataF_ext, - nr_ue_pbch_vars->dl_ch_estimates_ext, - nr_ue_pbch_vars->rxdataF_comp, + nr_pbch_channel_compensation(rxdataF_ext, + dl_ch_estimates_ext, + nb_re, + rxdataF_comp, frame_parms, symbol, - nr_ue_pbch_vars->log2_maxh); // log2_maxh+I0_shift + log2_maxh); // log2_maxh+I0_shift /*if (frame_parms->nb_antennas_rx > 1) pbch_detection_mrc(frame_parms, - nr_ue_pbch_vars->rxdataF_comp, + rxdataF_comp, symbol);*/ /* if (mimo_mode == ALAMOUTI) { - nr_pbch_alamouti(frame_parms,nr_ue_pbch_vars->rxdataF_comp,symbol); + nr_pbch_alamouti(frame_parms,rxdataF_comp,symbol); } else if (mimo_mode != SISO) { LOG_I(PHY,"[PBCH][RX] Unsupported MIMO mode\n"); return(-1); } */ if (symbol==2) { - nr_pbch_quantize(pbch_e_rx, - (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][symbol*240]), + nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, + (short *)rxdataF_comp[0], 144); - pbch_e_rx+=144; + pbch_e_rx_idx+=144; } else { - nr_pbch_quantize(pbch_e_rx, - (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][symbol*240]), + nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, + (short *)rxdataF_comp[0], 360); - pbch_e_rx+=360; + pbch_e_rx_idx+=360; } } #ifdef DEBUG_PBCH - write_output("rxdataF_comp.m","rxFcomp",&nr_ue_pbch_vars->rxdataF_comp[0][240],240*3,1,1); + write_output("rxdataF_comp.m","rxFcomp",rxdataF_comp[0],240*3,1,1); #endif - pbch_e_rx = nr_ue_pbch_vars->llr; //demod_pbch_e = nr_ue_pbch_vars->demod_pbch_e; // FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a; #ifdef DEBUG_PBCH - //pbch_e_rx = &nr_ue_pbch_vars->llr[0]; - short *p = (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][20*12]); + short *p = (short *)rxdataF_comp[0]); - for (int cnt = 0; cnt < 864 ; cnt++) +for (int cnt = 0; cnt < 864 ; cnt++) printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); #endif //un-scrambling - M = NR_POLAR_PBCH_E; - nushift = (Lmax==4)? i_ssb&3 : i_ssb&7; +M = NR_POLAR_PBCH_E; +nushift = (Lmax==4)? i_ssb&3 : i_ssb&7; uint32_t unscrambling_mask = (Lmax==64)?0x100006D:0x1000041; - - nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0); + uint32_t pbch_a_interleaved=0; +uint32_t pbch_a_prime=0; +nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); //polar decoding de-rate matching const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); - decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,currentPtr); + decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&pbch_a_prime,0,currentPtr); if(decoderState) return(decoderState); - // printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime); + // printf("polar decoder output 0x%08x\n",pbch_a_prime); // Decoder reversal uint32_t a_reversed=0; for (int i=0; ipbch_a_prime>>i)&1)<<(31-i); + a_reversed |= (((uint64_t)pbch_a_prime>>i)&1)<<(31-i); - nr_ue_pbch_vars->pbch_a_prime = a_reversed; + pbch_a_prime = a_reversed; //payload un-scrambling - nr_ue_pbch_vars->pbch_a_interleaved=0; M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3); - nushift = ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) ^ (((nr_ue_pbch_vars->pbch_a_prime>>6)&1)<<1); - nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask); - //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((nr_ue_pbch_vars->pbch_a_prime>>6)&1), ((nr_ue_pbch_vars->pbch_a_prime>>24)&1) ); + nushift = ((pbch_a_prime>>24)&1) ^ (((pbch_a_prime>>6)&1)<<1); +nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask,pbch_a_prime, &pbch_a_interleaved); + //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((pbch_a_prime>>6)&1), ((pbch_a_prime>>24)&1) ); //payload deinterleaving //uint32_t in=0; uint32_t out=0; for (int i=0; i<32; i++) { - out |= ((nr_ue_pbch_vars->pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); + out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); #ifdef DEBUG_PBCH - printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, nr_ue_pbch_vars->pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (nr_ue_pbch_vars->pbch_a_interleaved>>i)&1); + printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (pbch_a_interleaved>>i)&1); #endif } uint32_t payload = 0; - //uint8_t xtra_byte = 0; - nr_ue_pbch_vars->xtra_byte = (out>>24)&0xff; + result->xtra_byte = (out>>24)&0xff; for (int i=0; i>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1); for (int i=0; i<3; i++) - decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); + result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); - frame_parms->half_frame_bit = ((nr_ue_pbch_vars->xtra_byte>>4)&0x01); // computing the half frame index from the extra byte +frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half frame index from the extra byte frame_parms->ssb_index = i_ssb; // ssb index corresponds to i_ssb for Lmax = 4,8 if (Lmax == 64) { // for Lmax = 64 ssb index 4th,5th and 6th bits are in extra byte for (int i=0; i<3; i++) - frame_parms->ssb_index += (((nr_ue_pbch_vars->xtra_byte>>(7-i))&0x01)<<(3+i)); + frame_parms->ssb_index += (((result->xtra_byte>>(7-i))&0x01)<<(3+i)); } ue->symbol_offset = nr_get_ssb_start_symbol(frame_parms,frame_parms->ssb_index); @@ -587,25 +591,26 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, uint8_t frame_number_4lsb = 0; for (int i=0; i<4; i++) - frame_number_4lsb |= ((nr_ue_pbch_vars->xtra_byte>>i)&1)<<(3-i); + frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i); proc->decoded_frame_rx = frame_number_4lsb; #ifdef DEBUG_PBCH - printf("xtra_byte %x payload %x\n", nr_ue_pbch_vars->xtra_byte, payload); + printf("xtra_byte %x payload %x\n", xtra_byte, payload); for (int i=0; i<(NR_POLAR_PBCH_PAYLOAD_BITS>>3); i++) { // printf("unscrambling pbch_a[%d] = %x \n", i,pbch_a[i]); - printf("[PBCH] decoder payload[%d] = %x\n",i,decoded_output[i]); + printf("[PBCH] decoder payload[%d] = %x\n",i,result->decoded_output[i]); } #endif nr_downlink_indication_t dl_indication; - fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); - uint16_t number_pdus = 1; +fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); +uint16_t number_pdus = 1; - nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); +nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + +nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void*)result); if (ue->if_inst && ue->if_inst->dl_indication) ue->if_inst->dl_indication(&dl_indication, NULL); 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 239731208e..e53cfde51b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1153,11 +1153,14 @@ int rx_sss(PHY_VARS_NR_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uin */ 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); + MIMO_mode_t mimo_mode, + fapiPbch_t* result); int nr_pbch_detection(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index 5594d56693..a31414946f 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -40,6 +40,9 @@ const FL_COLOR water_colors[4] = {FL_BLUE,FL_GREEN,FL_YELLOW,FL_RED}; typedef struct complex16 scopeSample_t; #define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i) +typedef struct { +} scopeGraphData_t; + typedef struct OAIgraph { FL_OBJECT *graph; FL_OBJECT *text; @@ -56,7 +59,7 @@ typedef struct OAIgraph { boolean_t initDone; int iteration; void (*gNBfunct) (struct OAIgraph *graph, scopeData_t *p, int UE_id); - void (*nrUEfunct)(struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); + void (*nrUEfunct)(scopeGraphData_t** data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); } OAIgraph_t; /* Forms and Objects */ @@ -140,7 +143,7 @@ static OAIgraph_t gNBcommonGraph( void (*funct) (OAIgraph_t *graph, scopeData_t return graph; } -static OAIgraph_t nrUEcommonGraph( void (*funct) (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id), +static OAIgraph_t nrUEcommonGraph( void (*funct) (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id), int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_COLOR pointColor) { OAIgraph_t graph; commonGraph(&graph, type, x, y, w, h, label, pointColor); @@ -341,7 +344,7 @@ static void timeResponse (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { static void gNBfreqWaterFall (OAIgraph_t *graph, scopeData_t *p, int nb_UEs) { NR_DL_FRAME_PARMS *frame_parms=&p->gNB->frame_parms; //use 1st antenna - genericWaterFall(graph, (scopeSample_t *)p->rxdataF, frame_parms->samples_per_frame_wCP, + genericWaterFall(graph, (scopeSample_t *)p->liveData, frame_parms->samples_per_frame_wCP, frame_parms->slots_per_frame, "X axis: Frequency domain, one subframe"); } @@ -515,6 +518,7 @@ void phy_scope_gNB(OAI_phy_scope_t *form, //fl_check_forms(); } + static void *scope_thread_gNB(void *arg) { scopeData_t *p=(scopeData_t *) arg; size_t stksize=0; @@ -539,11 +543,12 @@ static void *scope_thread_gNB(void *arg) { return NULL; } + static void copyRxdataF(int32_t *data, int slot, void *scopeData) { scopeData_t *scope=(scopeData_t *)scopeData; - memcpy(scope->rxdataF + slot*scope->gNB->frame_parms.samples_per_slot_wCP, + memcpy(((int32_t*)scope->liveData) + slot*scope->gNB->frame_parms.samples_per_slot_wCP, data, - scope->gNB->frame_parms.samples_per_slot_wCP); + scope->gNB->frame_parms.samples_per_slot_wCP*sizeof(int32_t)); } void gNBinitScope(scopeParms_t *p) { @@ -554,11 +559,11 @@ void gNBinitScope(scopeParms_t *p) { scope->ru=p->ru; scope->gNB=p->gNB; scope->slotFunc=copyRxdataF; - AssertFatal(scope->rxdataF=(int32_t *) calloc(p->gNB->frame_parms.samples_per_frame_wCP*sizeof(int32_t),1),""); + AssertFatal(scope->liveData= calloc(p->gNB->frame_parms.samples_per_frame_wCP*sizeof(int32_t),1),""); pthread_t forms_thread; threadCreate(&forms_thread, scope_thread_gNB, p->gNB->scopeData, "scope", -1, OAI_PRIORITY_RT_LOW); } -static void ueWaterFall (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void ueWaterFall (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // Received signal in time domain of receive antenna 0 genericWaterFall(graph, (scopeSample_t *) phy_vars_ue->common_vars.rxdata[0], @@ -574,13 +579,18 @@ static void ueTimeResponse (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int phy_vars_ue->frame_parms.samples_per_frame); } */ -static void ueChannelResponse (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { + +static void ueChannelResponse (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // Channel Impulse Response + if (!data[pbchDlChEstimateTime]) + return; + genericPowerPerAntena(graph, phy_vars_ue->frame_parms.nb_antennas_rx, - (const scopeSample_t **) phy_vars_ue->pbch_vars[eNB_id]->dl_ch_estimates_time, + (const scopeSample_t **) &data[pbchDlChEstimateTime], phy_vars_ue->frame_parms.ofdm_symbol_size>>3); } -static void ueFreqWaterFall (OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) { + +static void ueFreqWaterFall (scopeGraphData_t **data, OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) { NR_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->frame_parms; //use 1st antenna genericWaterFall(graph, @@ -624,12 +634,12 @@ static void uePbchFrequencyResp (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue oai_xygraph(graph,freq,chest_f_abs,frame_parms->ofdm_symbol_size,0,10); } */ -static void uePbchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PBCH LLRs - if ( !phy_vars_ue->pbch_vars[eNB_id]->llr) + if ( !data[pbchLlr]) return; - int16_t *pbch_llr = (int16_t *) phy_vars_ue->pbch_vars[eNB_id]->llr; + int16_t *pbch_llr = (int16_t *)data[pbchLlr]; float *llr_pbch, *bit_pbch; oai_xygraph_getbuff(graph, &bit_pbch, &llr_pbch, 864, 0); @@ -639,12 +649,13 @@ static void uePbchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_ oai_xygraph(graph,bit_pbch,llr_pbch,864,0,10); } -static void uePbchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePbchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PBCH I/Q of MF Output - if (!phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]) - return; - scopeSample_t *pbch_comp = (scopeSample_t *) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0]; + if (!data[pbchRxdataF_comp]) + return; + + scopeSample_t *pbch_comp = (scopeSample_t *) data[pbchRxdataF_comp]; float *I, *Q; oai_xygraph_getbuff(graph, &I, &Q, 180*3, 0); memset(I,0,180*3*sizeof(*I)); @@ -673,7 +684,7 @@ static void uePbchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_i AssertFatal(base <= 180*3,""); oai_xygraph(graph,I,Q,base,0, 10); } -static void uePcchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePcchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDCCH LLRs if (!phy_vars_ue->pdcch_vars[0][eNB_id]->llr) return; @@ -698,7 +709,7 @@ static void uePcchLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_ AssertFatal(base <= coded_bits_per_codeword*RX_NB_TH_MAX, ""); oai_xygraph(graph,bit,llr,base,0,10); } -static void uePcchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePcchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDCCH I/Q of MF Output if (!phy_vars_ue->pdcch_vars[0][eNB_id]->rxdataF_comp[0]) return; @@ -722,7 +733,7 @@ static void uePcchIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_i AssertFatal(base <= nb*RX_NB_TH_MAX, ""); oai_xygraph(graph,I,Q,base,0,10); } -static void uePdschLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePdschLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDSCH LLRs if (!phy_vars_ue->pdsch_vars[0][eNB_id]->llr[0]) return; @@ -749,7 +760,7 @@ static void uePdschLLR (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB //fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword); oai_xygraph(graph,bit,llr,base,0,10); } -static void uePdschIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePdschIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDSCH I/Q of MF Output if (!phy_vars_ue->pdsch_vars[0][eNB_id]->rxdataF_comp0[0]) return; @@ -776,7 +787,7 @@ static void uePdschIQ (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_ AssertFatal(base <= sz*RX_NB_TH_MAX, ""); oai_xygraph(graph,I,Q,sz*RX_NB_TH_MAX,0,10); } -static void uePdschThroughput (OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { +static void uePdschThroughput (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { /* float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}}; @@ -869,7 +880,9 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) { fl_show_form (fdui->phy_scope, FL_PLACE_HOTSPOT, FL_FULLBORDER, buf); return fdui; } -void phy_scope_nrUE(OAI_phy_scope_t *form, + +void phy_scope_nrUE(scopeGraphData_t **UEliveData, + OAI_phy_scope_t *form, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { @@ -886,12 +899,13 @@ void phy_scope_nrUE(OAI_phy_scope_t *form, int i=0; while (form->graph[i].graph) { - form->graph[i].nrUEfunct(form->graph+i, phy_vars_ue, eNB_id, UE_id); + form->graph[i].nrUEfunct(UEliveData, form->graph+i, phy_vars_ue, eNB_id, UE_id); i++; } //fl_check_forms(); } + static void *nrUEscopeThread(void *arg) { PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg; size_t stksize; @@ -903,9 +917,12 @@ static void *nrUEscopeThread(void *arg) { fl_initialize (&fl_argc, &name, NULL, 0, 0); OAI_phy_scope_t *form_nrue=create_phy_scope_nrue(0); + scopeGraphData_t *UEliveData[UEdataTypeNumberOfItems]; + while (!oai_exit) { fl_freeze_form(form_nrue->phy_scope); - phy_scope_nrUE(form_nrue, + phy_scope_nrUE(UEliveData, + form_nrue, ue, 0,0); fl_unfreeze_form(form_nrue->phy_scope); @@ -915,10 +932,19 @@ static void *nrUEscopeThread(void *arg) { pthread_exit((void *)arg); } -void nrUEinitScope(PHY_VARS_NR_UE *ue) { - pthread_t forms_thread; - threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); + +void UEcopyData(enum UEdataType type, void * data, int elementSz, int colSz, int lineSz) { + } + +void nrUEinitScope(PHY_VARS_NR_UE *ue) { + AssertFatal(ue->scopeData=malloc(sizeof(scopeData_t)),""); + scopeData_t *scope=(scopeData_t *) ue->scopeData; + scope->copyData=UEcopyData; + pthread_t forms_thread; + threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); +} + void nrscope_autoinit(void *dataptr) { AssertFatal( (IS_SOFTMODEM_GNB_BIT||IS_SOFTMODEM_5GUE_BIT),"Scope cannot find NRUE or GNB context"); diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h index 8b747d575d..1ba6bb558d 100644 --- a/openair1/PHY/TOOLS/phy_scope_interface.h +++ b/openair1/PHY/TOOLS/phy_scope_interface.h @@ -32,6 +32,7 @@ #ifndef __PHY_SCOPE_INTERFACE_H__ #define __PHY_SCOPE_INTERFACE_H__ #include + typedef struct { int *argc; char **argv; @@ -39,16 +40,25 @@ typedef struct { PHY_VARS_gNB *gNB; } scopeParms_t; +enum UEdataType { + pbchDlChEstimateTime, + pbchLlr, + pbchRxdataF_comp, + UEdataTypeNumberOfItems +}; typedef struct scopeData_s { int *argc; char **argv; RU_t *ru; PHY_VARS_gNB *gNB; - int32_t * rxdataF; + void * liveData; void (*slotFunc)(int32_t* data, int slot, void * scopeData); + void (*copyData)(enum UEdataType, void * data, int elementSz, int colSz, int lineSz); } scopeData_t; int load_softscope(char *exectype, void *initarg); int end_forms(void) ; + +#define scopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(type, ##__VA_ARGS__); #endif diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 2d2697a4b7..6a855d3af6 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -839,6 +839,7 @@ typedef struct { /// RF and Interface devices per CC openair0_device rfdevice; + void *scopeData; } PHY_VARS_UE; /* this structure is used to pass both UE phy vars and diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index bca956bf75..d8c274de45 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -655,40 +655,6 @@ typedef struct { #define PBCH_A 24 typedef struct { - /// \brief Pointers to extracted PBCH symbols in frequency-domain. - /// - first index: rx antenna [0..nb_antennas_rx[ - /// - second index: ? [0..287] (hard coded) - int32_t **rxdataF_ext; - /// \brief Pointers to extracted and compensated PBCH symbols in frequency-domain. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..287] (hard coded) - int32_t **rxdataF_comp; - /// \brief Hold the channel estimates in frequency domain. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[ - int32_t **dl_ch_estimates; - /// \brief Pointers to downlink channel estimates in frequency-domain extracted in PRBS. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..287] (hard coded) - int32_t **dl_ch_estimates_ext; - /// \brief Hold the channel estimates in time domain (used for tracking). - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: samples? [0..2*ofdm_symbol_size[ - int32_t **dl_ch_estimates_time; - int log2_maxh; - uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3]; - uint32_t pbch_a_interleaved; - uint32_t pbch_a_prime; - uint8_t pbch_e[NR_POLAR_PBCH_E]; - int16_t demod_pbch_e[NR_POLAR_PBCH_E]; - /// \brief Pointer to PBCH llrs. - /// - first index: ? [0..1919] (hard coded) - int16_t *llr; - /// \brief Pointer to PBCH decoded output. - /// - first index: ? [0..63] (hard coded) - uint8_t *decoded_output; - /// \brief PBCH additional bits - uint8_t xtra_byte; /// \brief Total number of PDU errors. uint32_t pdu_errors; /// \brief Total number of PDU errors 128 frames ago. @@ -696,7 +662,7 @@ typedef struct { /// \brief Total number of consecutive PDU errors. uint32_t pdu_errors_conseq; /// \brief FER (in percent) . - uint32_t pdu_fer; + //uint32_t pdu_fer; } NR_UE_PBCH; typedef struct { @@ -1075,7 +1041,7 @@ typedef struct { #endif int dl_stats[5]; - + void* scopeData; } PHY_VARS_NR_UE; /* this structure is used to pass both UE phy vars and diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index b85d4c1b50..acdf88018a 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -82,6 +82,11 @@ #define DAQ_AGC_OFF 0 +typedef struct { + uint8_t decoded_output[64]; + uint8_t xtra_byte; +} fapiPbch_t; + /** @addtogroup _PHY_PROCEDURES_ * @{ */ @@ -398,7 +403,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, uint16_t n_pdus, - UE_nr_rxtx_proc_t *proc); + UE_nr_rxtx_proc_t *proc, + void * typeSpecific); bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 97a7e2e489..12a8ce0d08 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -118,7 +118,8 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, uint16_t n_pdus, - UE_nr_rxtx_proc_t *proc ){ + UE_nr_rxtx_proc_t *proc, + void * typeSpecific){ NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; @@ -162,8 +163,11 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, rx_ind->rx_indication_body[n_pdus - 1].pdsch_pdu.pdu_length = dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS / 8; break; case FAPI_NR_RX_PDU_TYPE_SSB: - rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu = ue->pbch_vars[gNB_id]->decoded_output; - rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.additional_bits = ue->pbch_vars[gNB_id]->xtra_byte; + rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu=malloc(sizeof(((fapiPbch_t*)typeSpecific)->decoded_output)); + memcpy(rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.pdu, + ((fapiPbch_t*)typeSpecific)->decoded_output, + sizeof(((fapiPbch_t*)typeSpecific)->decoded_output)); + rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.additional_bits = ((fapiPbch_t*)typeSpecific)->xtra_byte; rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_index = (frame_parms->ssb_index)&0x7; rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.ssb_length = frame_parms->Lmax; rx_ind->rx_indication_body[n_pdus - 1].ssb_pdu.cell_id = frame_parms->Nid_cell; @@ -353,10 +357,9 @@ void nr_ue_measurement_procedures(uint16_t l, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_MEASUREMENT_PROCEDURES, VCD_FUNCTION_OUT); } -void nr_ue_pbch_procedures(uint8_t gNB_id, +static void nr_ue_pbch_procedures(uint8_t gNB_id, PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, - uint8_t abstraction_flag) + UE_nr_rxtx_proc_t *proc,int estimateSz, struct complex16 dl_ch_estimates[][estimateSz]) { int ret = 0; @@ -368,13 +371,15 @@ void nr_ue_pbch_procedures(uint8_t gNB_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PBCH_PROCEDURES, VCD_FUNCTION_IN); LOG_D(PHY,"[UE %d] Frame %d Slot %d, Trying PBCH (NidCell %d, gNB_id %d)\n",ue->Mod_id,frame_rx,nr_slot_rx,ue->frame_parms.Nid_cell,gNB_id); - + fapiPbch_t result; ret = nr_rx_pbch(ue, proc, + estimateSz, dl_ch_estimates, ue->pbch_vars[gNB_id], &ue->frame_parms, gNB_id, (ue->frame_parms.ssb_index)&7, - SISO); + SISO, + &result); if (ret==0) { @@ -444,7 +449,6 @@ void nr_ue_pbch_procedures(uint8_t gNB_id, } if (frame_rx % 100 == 0) { - ue->pbch_vars[gNB_id]->pdu_fer = ue->pbch_vars[gNB_id]->pdu_errors - ue->pbch_vars[gNB_id]->pdu_errors_last; ue->pbch_vars[gNB_id]->pdu_errors_last = ue->pbch_vars[gNB_id]->pdu_errors; } @@ -794,16 +798,16 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, switch (pdsch) { case RA_PDSCH: nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL); ue->UE_mode[gNB_id] = RA_RESPONSE; break; case PDSCH: nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL); break; case SI_PDSCH: nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc, NULL); break; default: break; @@ -1399,6 +1403,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if (slot_ssb) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN); LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); + const int estimateSz=7*2*sizeof(int)*fp->ofdm_symbol_size; + struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz]; + struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][estimateSz]; for (int i=1; i<4; i++) { nr_slot_fep(ue, @@ -1408,7 +1415,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, start_meas(&ue->dlsch_channel_estimation_stats); - nr_pbch_channel_estimation(ue,proc,gNB_id,nr_slot_rx,(ue->symbol_offset+i)%(fp->symbols_per_slot),i-1,(fp->ssb_index)&7,fp->half_frame_bit); + nr_pbch_channel_estimation(ue, estimateSz, dl_ch_estimates, dl_ch_estimates_time,proc,gNB_id,nr_slot_rx,(ue->symbol_offset+i)%(fp->symbols_per_slot),i-1,(fp->ssb_index)&7,fp->half_frame_bit); stop_meas(&ue->dlsch_channel_estimation_stats); } @@ -1417,13 +1424,14 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); - nr_ue_pbch_procedures(gNB_id, ue, proc, 0); + nr_ue_pbch_procedures(gNB_id, ue, proc, estimateSz, dl_ch_estimates); if (ue->no_timing_correction==0) { LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction); nr_adjust_synch_ue(fp, ue, gNB_id, + estimateSz, dl_ch_estimates_time, frame_rx, nr_slot_rx, 0, diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c index 7a47410129..351c2f33c4 100644 --- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c +++ b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c @@ -1,5 +1,6 @@ #include "nfapi/oai_integration/vendor_ext.h" + int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); } int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); } int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); } @@ -35,4 +36,5 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, uint16_t n_pdus, - UE_nr_rxtx_proc_t *proc) {} + UE_nr_rxtx_proc_t *proc, + void * typeSpecific ) {} diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index c6b547cd79..692d1bac20 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -720,6 +720,9 @@ int main(int argc, char **argv) UE_nr_rxtx_proc_t proc={0}; UE->rx_offset=0; uint8_t ssb_index = 0; + const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size; + struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; + struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb UE->symbol_offset = nr_get_ssb_start_symbol(frame_parms,ssb_index); @@ -730,17 +733,20 @@ int main(int argc, char **argv) i%frame_parms->symbols_per_slot, ssb_slot); - nr_pbch_channel_estimation(UE,&proc,0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf); + nr_pbch_channel_estimation(UE,estimateSz, dl_ch_estimates, dl_ch_estimates_time, &proc, + 0,ssb_slot,i%frame_parms->symbols_per_slot,i-(UE->symbol_offset+1),ssb_index%8,n_hf); } - + fapiPbch_t result; ret = nr_rx_pbch(UE, &proc, - UE->pbch_vars[0], + estimateSz, dl_ch_estimates, + UE->pbch_vars[0], frame_parms, 0, ssb_index%8, - SISO); + SISO, + &result); if (ret==0) { //UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically @@ -749,9 +755,9 @@ int main(int argc, char **argv) for (int i=0; i<8; i++) gNB_xtra_byte |= ((gNB->pbch.pbch_a>>(31-i))&1)<<(7-i); - payload_ret = (UE->pbch_vars[0]->xtra_byte == gNB_xtra_byte); + payload_ret = (result.xtra_byte == gNB_xtra_byte); for (i=0;i<3;i++){ - payload_ret += (UE->pbch_vars[0]->decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff)); + payload_ret += (result.decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff)); } //printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->pbch_vars[0]->xtra_byte); //printf("ret %d\n", payload_ret); From 18a421578f8905fbd1da7d17e3d60a3837ba65e9 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 15 Feb 2022 17:44:24 +0100 Subject: [PATCH 482/883] finish remove global vars for UE PBCH --- .../nr_dl_channel_estimation.c | 2 +- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 3 +- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 147 +++++++++--------- openair1/PHY/TOOLS/nr_phy_scope.c | 105 +++++++------ openair1/PHY/TOOLS/phy_scope_interface.h | 9 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 2 +- 6 files changed, 141 insertions(+), 127 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 8efe85b222..12c78a08fb 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -455,7 +455,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, } } if (dmrss == 2) - scopeCopy(ue, pbchDlChEstimateTime, dl_ch_estimates_time, sizeof(struct complex16), idftsizeidx, ue->frame_parms.nb_antennas_rx); + UEscopeCopy(ue, pbchDlChEstimateTime, (void*)dl_ch_estimates_time, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx, idftsizeidx); return(0); } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 39dc183bc3..3dc0d79e35 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -153,7 +153,8 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf); + nr_pbch_channel_estimation(ue,estimateSz, dl_ch_estimates, dl_ch_estimates_time, + proc,0,0,i,i-pbch_initial_symbol,temp_ptr->i_ssb,temp_ptr->n_hf); stop_meas(&ue->dlsch_channel_estimation_stats); fapiPbch_t result; ret = nr_rx_pbch(ue, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 2b5cc6c3d6..0073e8344d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -37,28 +37,28 @@ #include "PHY/INIT/phy_init.h" #include "openair1/SCHED_NR_UE/defs.h" #include +#include -//#define DEBUG_PBCH +//#define DEBUG_PBCH //#define DEBUG_PBCH_ENCODING - //#include "PHY_INTERFACE/defs.h" +//#include "PHY_INTERFACE/defs.h" #define PBCH_A 24 #define print_shorts(s,x) printf("%s : %d,%d,%d,%d,%d,%d,%d,%d\n",s,((int16_t*)x)[0],((int16_t*)x)[1],((int16_t*)x)[2],((int16_t*)x)[3],((int16_t*)x)[4],((int16_t*)x)[5],((int16_t*)x)[6],((int16_t*)x)[7]) static uint16_t nr_pbch_extract(int **rxdataF, - const int estimateSz, - struct complex16 dl_ch_estimates[][estimateSz], - struct complex16 rxdataF_ext[][20*12*4], - struct complex16 dl_ch_estimates_ext[][20*12*4], - uint32_t symbol, - uint32_t s_offset, - NR_DL_FRAME_PARMS *frame_parms) { + const int estimateSz, + struct complex16 dl_ch_estimates[][estimateSz], + struct complex16 rxdataF_ext[][20*12*4], + struct complex16 dl_ch_estimates_ext[][20*12*4], + uint32_t symbol, + uint32_t s_offset, + NR_DL_FRAME_PARMS *frame_parms) { uint16_t rb; uint8_t i,j,aarx; int nushiftmod4 = frame_parms->nushift; - AssertFatal(symbol>=1 && symbol<5, "symbol %d illegal for PBCH extraction\n", symbol); @@ -66,7 +66,6 @@ static uint16_t nr_pbch_extract(int **rxdataF, for (aarx=0; aarxnb_antennas_rx; aarx++) { unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier; rx_offset = (rx_offset)%(frame_parms->ofdm_symbol_size); - struct complex16 *rxF = (struct complex16 *)&rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size]; struct complex16 *rxF_ext = rxdataF_ext[aarx]; #ifdef DEBUG_PBCH @@ -103,7 +102,7 @@ static uint16_t nr_pbch_extract(int **rxdataF, rx_offset=(rx_offset+1)%(frame_parms->ofdm_symbol_size); //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1); - } + } rxF_ext+=9; } else { //symbol 2 @@ -129,11 +128,12 @@ static uint16_t nr_pbch_extract(int **rxdataF, } rxF_ext+=9; - } else{ //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12); - rx_offset = (rx_offset+12)%(frame_parms->ofdm_symbol_size); - } + } else { //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12); + rx_offset = (rx_offset+12)%(frame_parms->ofdm_symbol_size); + } } } + struct complex16 *dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))]; //printf("dl_ch0 addr %p\n",dl_ch0); @@ -258,12 +258,12 @@ int nr_pbch_channel_level(struct complex16 dl_ch_estimates_ext[][20*12*4], } static void nr_pbch_channel_compensation(struct complex16 rxdataF_ext[][20*12*4], - struct complex16 dl_ch_estimates_ext[][20*12*4], - int cols, - struct complex16 rxdataF_comp[][cols], - NR_DL_FRAME_PARMS *frame_parms, - uint32_t symbol, - uint8_t output_shift) { + struct complex16 dl_ch_estimates_ext[][20*12*4], + int cols, + struct complex16 rxdataF_comp[][cols], + NR_DL_FRAME_PARMS *frame_parms, + uint32_t symbol, + uint8_t output_shift) { AssertFatal((symbol > 0 && symbol < 4), "symbol %d is illegal for PBCH DM-RS\n", symbol); @@ -326,15 +326,15 @@ void nr_pbch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, } static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, - int16_t *demod_pbch_e, + int16_t *demod_pbch_e, uint16_t Nid, uint8_t nushift, uint16_t M, uint16_t length, uint8_t bitwise, - uint32_t unscrambling_mask, - uint32_t pbch_a_prime, - uint32_t *pbch_a_interleaved) { + uint32_t unscrambling_mask, + uint32_t pbch_a_prime, + uint32_t *pbch_a_interleaved) { uint8_t reset, offset; uint32_t x1, x2, s=0; uint8_t k=0; @@ -362,10 +362,10 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, reset = 0; } - *pbch_a_interleaved ^= ((unscrambling_mask>>i)&1)? ((pbch_a_prime>>i)&1)<>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)); + *pbch_a_interleaved ^= ((unscrambling_mask>>i)&1)? ((pbch_a_prime>>i)&1)<>i)&1) ^ ((s>>((k+offset)&0x1f))&1))<>i)&1)); #ifdef DEBUG_PBCH_ENCODING - printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, *pbch_a_interleaved, + printf("i %d k %d offset %d (unscrambling_mask>>i)&1) %d s: %08x\t pbch_a_interleaved 0x%08x (!((unscrambling_mask>>i)&1)) %d\n", i, k, offset, (unscrambling_mask>>i)&1, s, *pbch_a_interleaved, (!((unscrambling_mask>>i)&1))); #endif } else { @@ -388,17 +388,15 @@ static void nr_pbch_unscrambling(NR_UE_PBCH *pbch, } static void nr_pbch_quantize(int16_t *pbch_llr8, - int16_t *pbch_llr, - uint16_t len) { - uint16_t i; - - for (i=0; i31) pbch_llr8[i]=32; else if (pbch_llr[i]<-31) pbch_llr8[i]=-32; else - pbch_llr8[i] = (char)(pbch_llr[i]); + pbch_llr8[i]=pbch_llr[i]; } } /* @@ -411,33 +409,32 @@ uint8_t pbch_deinterleaving_pattern[32] = {28,0,31,30,7,29,25,27,5,8,24,9,10,11, int nr_rx_pbch( PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, - int estimateSz, struct complex16 dl_ch_estimates [][estimateSz], + int estimateSz, struct complex16 dl_ch_estimates [][estimateSz], NR_UE_PBCH *nr_ue_pbch_vars, NR_DL_FRAME_PARMS *frame_parms, uint8_t gNB_id, uint8_t i_ssb, MIMO_mode_t mimo_mode, - fapiPbch_t* result) { - + fapiPbch_t *result) { NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars; int max_h=0; int symbol; //uint8_t pbch_a[64]; -//FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for.. -//uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); + //FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for.. + //uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); uint8_t nushift; uint16_t M; - uint8_t Lmax=frame_parms->Lmax; + uint8_t Lmax=frame_parms->Lmax; //uint16_t crc; //unsigned short idx_demod =0; uint32_t decoderState=0; //uint8_t decoderListSize = 8, pathMetricAppr = 0; //time_stats_t polar_decoder_init,polar_rate_matching,decoding,bit_extraction,deinterleaving; //time_stats_t path_metric,sorting,update_LLR; -// FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); + // FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS); //printf("nr_pbch_ue nid_cell %d\n",frame_parms->Nid_cell); - - int16_t pbch_e_rx[960]={0}; //Fixme: previous version erase only NR_POLAR_PBCH_E bytes + int16_t pbch_e_rx[960]= {0}; //Fixme: previous version erase only NR_POLAR_PBCH_E bytes + int16_t pbch_unClipped[960]= {0}; int pbch_e_rx_idx=0; int symbol_offset=1; @@ -446,24 +443,22 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, else symbol_offset=0; - #ifdef DEBUG_PBCH //printf("address dataf %p",nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF); write_output("rxdataF0_pbch.m","rxF0pbch", &nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0][(symbol_offset+1)*frame_parms->ofdm_symbol_size],frame_parms->ofdm_symbol_size*3,1,1); #endif - // symbol refers to symbol within SSB. symbol_offset is the offset of the SSB wrt start of slot double log2_maxh; + for (symbol=1; symbol<4; symbol++) { const uint16_t nb_re=symbol == 2 ? 72 : 180; struct complex16 rxdataF_ext[frame_parms->nb_antennas_rx][20*12*4]; struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][nb_re]; //was dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][20*12*4]; - nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, - estimateSz, + estimateSz, dl_ch_estimates, rxdataF_ext, dl_ch_estimates_ext, @@ -487,7 +482,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif nr_pbch_channel_compensation(rxdataF_ext, dl_ch_estimates_ext, - nb_re, + nb_re, rxdataF_comp, frame_parms, symbol, @@ -510,34 +505,39 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, (short *)rxdataF_comp[0], 144); + memcpy(pbch_unClipped+pbch_e_rx_idx, rxdataF_comp[0], 144*sizeof(int16_t)); pbch_e_rx_idx+=144; } else { nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, (short *)rxdataF_comp[0], 360); + memcpy(pbch_unClipped+pbch_e_rx_idx, rxdataF_comp[0], 144*sizeof(int16_t)); pbch_e_rx_idx+=360; } } + // legacy code use int16, but it is complex16 + UEscopeCopy(ue, pbchRxdataF_comp, pbch_unClipped, sizeof(struct complex16), frame_parms->nb_antennas_rx, pbch_e_rx_idx/2); + UEscopeCopy(ue, pbchLlr, pbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, pbch_e_rx_idx); #ifdef DEBUG_PBCH write_output("rxdataF_comp.m","rxFcomp",rxdataF_comp[0],240*3,1,1); #endif //demod_pbch_e = nr_ue_pbch_vars->demod_pbch_e; -// FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a; + // FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a; #ifdef DEBUG_PBCH short *p = (short *)rxdataF_comp[0]); -for (int cnt = 0; cnt < 864 ; cnt++) - printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); + for (int cnt = 0; cnt < 864 ; cnt++) +printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); #endif //un-scrambling -M = NR_POLAR_PBCH_E; -nushift = (Lmax==4)? i_ssb&3 : i_ssb&7; + M = NR_POLAR_PBCH_E; + nushift = (Lmax==4)? i_ssb&3 : i_ssb&7; uint32_t unscrambling_mask = (Lmax==64)?0x100006D:0x1000041; uint32_t pbch_a_interleaved=0; -uint32_t pbch_a_prime=0; -nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); + uint32_t pbch_a_prime=0; + nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); //polar decoding de-rate matching const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&pbch_a_prime,0,currentPtr); @@ -549,20 +549,20 @@ nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,N uint32_t a_reversed=0; for (int i=0; i>i)&1)<<(31-i); +a_reversed |= (((uint64_t)pbch_a_prime>>i)&1)<<(31-i); pbch_a_prime = a_reversed; //payload un-scrambling M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3); nushift = ((pbch_a_prime>>24)&1) ^ (((pbch_a_prime>>6)&1)<<1); -nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask,pbch_a_prime, &pbch_a_interleaved); + nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask,pbch_a_prime, &pbch_a_interleaved); //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((pbch_a_prime>>6)&1), ((pbch_a_prime>>24)&1) ); //payload deinterleaving //uint32_t in=0; uint32_t out=0; for (int i=0; i<32; i++) { - out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); + out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); #ifdef DEBUG_PBCH printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (pbch_a_interleaved>>i)&1); #endif @@ -572,29 +572,30 @@ nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,N result->xtra_byte = (out>>24)&0xff; for (int i=0; i>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1); +payload |= ((out>>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1); for (int i=0; i<3; i++) - result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); - -frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half frame index from the extra byte +result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); + frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half frame index from the extra byte frame_parms->ssb_index = i_ssb; // ssb index corresponds to i_ssb for Lmax = 4,8 + if (Lmax == 64) { // for Lmax = 64 ssb index 4th,5th and 6th bits are in extra byte - for (int i=0; i<3; i++) + for (int i=0; i<3; i++) frame_parms->ssb_index += (((result->xtra_byte>>(7-i))&0x01)<<(3+i)); } ue->symbol_offset = nr_get_ssb_start_symbol(frame_parms,frame_parms->ssb_index); + if (frame_parms->half_frame_bit) - ue->symbol_offset += (frame_parms->slots_per_frame>>1)*frame_parms->symbols_per_slot; + ue->symbol_offset += (frame_parms->slots_per_frame>>1)*frame_parms->symbols_per_slot; uint8_t frame_number_4lsb = 0; + for (int i=0; i<4; i++) - frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i); +frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i); proc->decoded_frame_rx = frame_number_4lsb; - #ifdef DEBUG_PBCH printf("xtra_byte %x payload %x\n", xtra_byte, payload); @@ -602,18 +603,16 @@ frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half // printf("unscrambling pbch_a[%d] = %x \n", i,pbch_a[i]); printf("[PBCH] decoder payload[%d] = %x\n",i,result->decoded_output[i]); } + #endif - nr_downlink_indication_t dl_indication; -fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); -uint16_t number_pdus = 1; - -nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - -nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void*)result); + fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); + uint16_t number_pdus = 1; + nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc,(void *)result); if (ue->if_inst && ue->if_inst->dl_indication) - ue->if_inst->dl_indication(&dl_indication, NULL); + ue->if_inst->dl_indication(&dl_indication, NULL); return 0; } diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index a31414946f..fe0f785ef4 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -41,6 +41,10 @@ typedef struct complex16 scopeSample_t; #define SquaredNorm(VaR) ((VaR).r*(VaR).r+(VaR).i*(VaR).i) typedef struct { + int dataSize; + int elementSz; + int colSz; + int lineSz; } scopeGraphData_t; typedef struct OAIgraph { @@ -59,7 +63,7 @@ typedef struct OAIgraph { boolean_t initDone; int iteration; void (*gNBfunct) (struct OAIgraph *graph, scopeData_t *p, int UE_id); - void (*nrUEfunct)(scopeGraphData_t** data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); + void (*nrUEfunct)(scopeGraphData_t **data, struct OAIgraph *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id); } OAIgraph_t; /* Forms and Objects */ @@ -546,7 +550,7 @@ static void *scope_thread_gNB(void *arg) { static void copyRxdataF(int32_t *data, int slot, void *scopeData) { scopeData_t *scope=(scopeData_t *)scopeData; - memcpy(((int32_t*)scope->liveData) + slot*scope->gNB->frame_parms.samples_per_slot_wCP, + memcpy(((int32_t *)scope->liveData) + slot*scope->gNB->frame_parms.samples_per_slot_wCP, data, scope->gNB->frame_parms.samples_per_slot_wCP*sizeof(int32_t)); } @@ -584,10 +588,11 @@ static void ueChannelResponse (scopeGraphData_t **data, OAIgraph_t *graph, PHY_ // Channel Impulse Response if (!data[pbchDlChEstimateTime]) return; - - genericPowerPerAntena(graph, phy_vars_ue->frame_parms.nb_antennas_rx, - (const scopeSample_t **) &data[pbchDlChEstimateTime], - phy_vars_ue->frame_parms.ofdm_symbol_size>>3); + + const scopeSample_t *tmp=(scopeSample_t *)(data[pbchDlChEstimateTime]+1); + genericPowerPerAntena(graph, data[pbchDlChEstimateTime]->colSz, + &tmp, + data[pbchDlChEstimateTime]->lineSz); } static void ueFreqWaterFall (scopeGraphData_t **data, OAIgraph_t *graph,PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id ) { @@ -639,51 +644,38 @@ static void uePbchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_ if ( !data[pbchLlr]) return; - int16_t *pbch_llr = (int16_t *)data[pbchLlr]; + const int sz=data[pbchLlr]->lineSz; + //const int antennas=data[pbchLlr]->colSz; + // We take the first antenna only for now + int16_t *llrs = (int16_t *) (data[pbchLlr]+1); float *llr_pbch, *bit_pbch; - oai_xygraph_getbuff(graph, &bit_pbch, &llr_pbch, 864, 0); + oai_xygraph_getbuff(graph, &bit_pbch, &llr_pbch, sz, 0); - for (int i=0; i<864; i++) { - llr_pbch[i] = (float) pbch_llr[i]; + for (int i=0; ilineSz; float *I, *Q; - oai_xygraph_getbuff(graph, &I, &Q, 180*3, 0); - memset(I,0,180*3*sizeof(*I)); - memset(Q,0,180*3*sizeof(*Q)); - int first_symbol=1; - int base=0; + oai_xygraph_getbuff(graph, &I, &Q, sz, 0); - for (int symbol=first_symbol; symbol<(first_symbol+3); symbol++) { - int nb_re; - - if (symbol == 2 || symbol == 6) - nb_re = 72; - else - nb_re = 180; - - AssertFatal(base+nb_re<180*3,""); - - for (int i=0; ipdcch_vars[0][eNB_id]->llr) @@ -882,7 +874,7 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) { } void phy_scope_nrUE(scopeGraphData_t **UEliveData, - OAI_phy_scope_t *form, + OAI_phy_scope_t *form, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { @@ -909,20 +901,19 @@ void phy_scope_nrUE(scopeGraphData_t **UEliveData, static void *nrUEscopeThread(void *arg) { PHY_VARS_NR_UE *ue=(PHY_VARS_NR_UE *)arg; size_t stksize; - pthread_attr_t atr={0}; + pthread_attr_t atr= {0}; pthread_attr_getstacksize(&atr, &stksize); pthread_attr_setstacksize(&atr,32*1024*1024 ); int fl_argc=1; char *name="5G-UE-scope"; fl_initialize (&fl_argc, &name, NULL, 0, 0); OAI_phy_scope_t *form_nrue=create_phy_scope_nrue(0); + (( scopeData_t *)ue->scopeData)->liveData=calloc(sizeof(scopeGraphData_t *), UEdataTypeNumberOfItems); - scopeGraphData_t *UEliveData[UEdataTypeNumberOfItems]; - while (!oai_exit) { fl_freeze_form(form_nrue->phy_scope); - phy_scope_nrUE(UEliveData, - form_nrue, + phy_scope_nrUE((( scopeData_t *)ue->scopeData)->liveData, + form_nrue, ue, 0,0); fl_unfreeze_form(form_nrue->phy_scope); @@ -933,8 +924,30 @@ static void *nrUEscopeThread(void *arg) { pthread_exit((void *)arg); } -void UEcopyData(enum UEdataType type, void * data, int elementSz, int colSz, int lineSz) { - +void UEcopyData(PHY_VARS_NR_UE *ue, enum UEdataType type, void *dataIn, int elementSz, int colSz, int lineSz) { + scopeData_t *tmp=(scopeData_t *)ue->scopeData; + + if (tmp) { + scopeGraphData_t *live= ((scopeGraphData_t **)tmp->liveData)[type]; + + if (live == NULL || live->dataSize < elementSz*colSz*lineSz) { + scopeGraphData_t *ptr=realloc(live, sizeof(scopeGraphData_t) + elementSz*colSz*lineSz); + + if (!ptr) { + LOG_E(PHY,"can't realloc\n"); + return; + } else { + live=ptr; + } + } + + live->dataSize=elementSz*colSz*lineSz; + live->elementSz=elementSz; + live->colSz=colSz; + live->lineSz=lineSz; + memcpy(live+1, dataIn, elementSz*colSz*lineSz); + ((scopeGraphData_t **)tmp->liveData)[type]=live; + } } void nrUEinitScope(PHY_VARS_NR_UE *ue) { @@ -942,7 +955,7 @@ void nrUEinitScope(PHY_VARS_NR_UE *ue) { scopeData_t *scope=(scopeData_t *) ue->scopeData; scope->copyData=UEcopyData; pthread_t forms_thread; - threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); + threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); } void nrscope_autoinit(void *dataptr) { diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h index 1ba6bb558d..9cd8e1dc40 100644 --- a/openair1/PHY/TOOLS/phy_scope_interface.h +++ b/openair1/PHY/TOOLS/phy_scope_interface.h @@ -32,6 +32,7 @@ #ifndef __PHY_SCOPE_INTERFACE_H__ #define __PHY_SCOPE_INTERFACE_H__ #include +#include typedef struct { int *argc; @@ -52,13 +53,13 @@ typedef struct scopeData_s { char **argv; RU_t *ru; PHY_VARS_gNB *gNB; - void * liveData; - void (*slotFunc)(int32_t* data, int slot, void * scopeData); - void (*copyData)(enum UEdataType, void * data, int elementSz, int colSz, int lineSz); + void *liveData; + void (*slotFunc)(int32_t *data, int slot, void *scopeData); + void (*copyData)(PHY_VARS_NR_UE *,enum UEdataType, void *data, int elementSz, int colSz, int lineSz); } scopeData_t; int load_softscope(char *exectype, void *initarg); int end_forms(void) ; -#define scopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(type, ##__VA_ARGS__); +#define UEscopeCopy(ue, type, ...) if(ue->scopeData) ((scopeData_t*)ue->scopeData)->copyData(ue, type, ##__VA_ARGS__); #endif diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c7b54950d7..3f263c08fe 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1170,7 +1170,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_length, (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_start_subcarrier, (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.cell_id)) << FAPI_NR_RX_PDU_TYPE_SSB; - + free((dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.pdu); break; case FAPI_NR_RX_PDU_TYPE_SIB: ret_mask |= (handle_bcch_dlsch(dl_info->module_id, From 8e3f720b7db6786c8358560f93884f86a3d2181e Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 16 Feb 2022 14:49:19 +0100 Subject: [PATCH 483/883] fix unaligned mem for SIMD --- common/utils/LOG/log.h | 2 +- openair1/PHY/CODING/crc_byte.c | 4 +-- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 4 +-- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 6 ++-- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 5 +++- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 2 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 +-- openair1/SIMULATION/NR_PHY/pbchsim.c | 29 ++++++++----------- openair2/UTIL/LISTS/list.c | 2 +- openair2/UTIL/LISTS/list2.c | 2 +- 10 files changed, 29 insertions(+), 31 deletions(-) diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 46c73427c1..9a2c92bb10 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -346,7 +346,7 @@ typedef struct { @param format data format (0 = real 16-bit, 1 = complex 16-bit,2 real 32-bit, 3 complex 32-bit,4 = real 8-bit, 5 = complex 8-bit) @param multiVec create new file or append to existing (useful for writing multiple vectors to same file. Just call the function multiple times with same file name and with this parameter set to 1) */ -#define MATLAB_RAW (1<<31) +#define MATLAB_RAW (1U<<31) #define MATLAB_SHORT 0 #define MATLAB_CSHORT 1 #define MATLAB_INT 2 diff --git a/openair1/PHY/CODING/crc_byte.c b/openair1/PHY/CODING/crc_byte.c index 7e37abcf81..9ad18cc1a6 100644 --- a/openair1/PHY/CODING/crc_byte.c +++ b/openair1/PHY/CODING/crc_byte.c @@ -72,10 +72,10 @@ unsigned int crcbit (unsigned char * inputptr, unsigned int i, crc = 0, c; while (octetlen-- > 0) { - c = (*inputptr++) << 24; + c = ((unsigned int)(*inputptr++)) << 24; for (i = 8; i != 0; i--) { - if ((1 << 31) & (c ^ crc)) + if ((1U << 31) & (c ^ crc)) crc = (crc << 1) ^ poly; else crc <<= 1; diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index 623b86edfb..e949faeaf0 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -64,7 +64,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue, reset = 1; x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17; - x2 = (x2tmp0+(nid<<1))%(1<<31); //cinit + x2 = (x2tmp0+(nid<<1))%(1U<<31); //cinit for (n=0; nnr_gold_pdcch[0][ns][l][n] = lte_gold_generic(&x1, &x2, reset); @@ -95,7 +95,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, reset = 1; x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17; - x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit + x2 = (x2tmp0+(nid<<1)+nscid)%(1U<<31); //cinit LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid); for (n=0; ndlsch_channel_estimation_stats); // computing channel estimation for selected best ssb - const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size; - struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; - struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; + const int estimateSz=7*2*frame_parms->ofdm_symbol_size; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 0073e8344d..c06dec7fcb 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -457,6 +457,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][nb_re]; //was dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][20*12*4]; + memset(dl_ch_estimates_ext,0, sizeof dl_ch_estimates_ext); nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, estimateSz, dl_ch_estimates, @@ -540,7 +541,9 @@ printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); //polar decoding de-rate matching const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); - decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&pbch_a_prime,0,currentPtr); +uint64_t tmp=pbch_a_prime; +decoderState = polar_decoder_int16(pbch_e_rx,&tmp,0,currentPtr); +pbch_a_prime=tmp; if(decoderState) return(decoderState); diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 28b6677b2c..0b1f374a52 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -883,7 +883,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain /* perform correlation of rx data and pss sequence ie it is a dot product */ result = dot_product64((short*)primary_synchro_time_nr[pss_index], - (short*) &(rxdata[ar][n+is*frame_parms->samples_per_frame]), + (short*)&(rxdata[ar][n+is*frame_parms->samples_per_frame]), frame_parms->ofdm_symbol_size, shift); pss_corr_ue[pss_index][n] += abs64(result); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 12a8ce0d08..bbf4617207 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1404,8 +1404,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN); LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); const int estimateSz=7*2*sizeof(int)*fp->ofdm_symbol_size; - struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz]; - struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][estimateSz]; for (int i=1; i<4; i++) { nr_slot_fep(ue, diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 692d1bac20..a314f7b397 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -430,13 +430,14 @@ int main(int argc, char **argv) printf("Initializing gNodeB for mu %d, N_RB_DL %d\n",mu,N_RB_DL); - RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *)); + RC.gNB = (PHY_VARS_gNB**) calloc(sizeof(PHY_VARS_gNB *),1); RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; gNB->ofdm_offset_divisor = UINT_MAX; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; + frame_parms->nb_antenna_ports_gNB=n_rx; frame_parms->N_RB_DL = N_RB_DL; frame_parms->Nid_cell = Nid_cell; frame_parms->nushift = Nid_cell%4; @@ -522,23 +523,17 @@ int main(int argc, char **argv) s_im = malloc(2*sizeof(double*)); r_re = malloc(2*sizeof(double*)); r_im = malloc(2*sizeof(double*)); - txdata = malloc(2*sizeof(int*)); + txdata = calloc(2,sizeof(int*)); for (i=0; i<2; i++) { - s_re[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(s_re[i],frame_length_complex_samples*sizeof(double)); - s_im[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(s_im[i],frame_length_complex_samples*sizeof(double)); - - r_re[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(r_re[i],frame_length_complex_samples*sizeof(double)); - r_im[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(r_im[i],frame_length_complex_samples*sizeof(double)); + s_re[i] = calloc(frame_length_complex_samples, sizeof(double)); + s_im[i] = calloc(frame_length_complex_samples, sizeof(double)); + r_re[i] = calloc(frame_length_complex_samples, sizeof(double)); + r_im[i] = calloc(frame_length_complex_samples, sizeof(double)); printf("Allocating %d samples for txdata\n",frame_length_complex_samples); - txdata[i] = malloc(frame_length_complex_samples*sizeof(int)); - bzero(r_re[i],frame_length_complex_samples*sizeof(int)); + txdata[i] = calloc(frame_length_complex_samples, sizeof(int)); } if (pbch_file_fd!=NULL) { @@ -547,8 +542,8 @@ int main(int argc, char **argv) //configure UE - UE = malloc(sizeof(PHY_VARS_NR_UE)); - memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS)); + UE = calloc(1,sizeof(*UE)); + memcpy(&UE->frame_parms,frame_parms,sizeof(*frame_parms)); //phy_init_nr_top(UE); //called from init_nr_ue_signal if (run_initial_sync==1) UE->is_synchronized = 0; else UE->is_synchronized = 1; @@ -721,8 +716,8 @@ int main(int argc, char **argv) UE->rx_offset=0; uint8_t ssb_index = 0; const int estimateSz=7*2*sizeof(int)*frame_parms->ofdm_symbol_size; - struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; - struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb UE->symbol_offset = nr_get_ssb_start_symbol(frame_parms,ssb_index); diff --git a/openair2/UTIL/LISTS/list.c b/openair2/UTIL/LISTS/list.c index 65f70c0786..578833edba 100644 --- a/openair2/UTIL/LISTS/list.c +++ b/openair2/UTIL/LISTS/list.c @@ -43,7 +43,7 @@ list_init (list_t * listP, char *nameP) { //----------------------------------------------------------------------------- if (nameP) { - strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR ); + strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR-1 ); listP->name[LIST_NAME_MAX_CHAR-1] = 0; // terminate string } diff --git a/openair2/UTIL/LISTS/list2.c b/openair2/UTIL/LISTS/list2.c index 3f0a59df53..d9aa1b6a90 100644 --- a/openair2/UTIL/LISTS/list2.c +++ b/openair2/UTIL/LISTS/list2.c @@ -53,7 +53,7 @@ list2_init (list2_t * listP, char *nameP) { //----------------------------------------------------------------------------- if (nameP) { - strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR ); + strncpy( listP->name, nameP, LIST_NAME_MAX_CHAR-1 ); listP->name[LIST_NAME_MAX_CHAR-1] = 0; // terminate string } From 58e0e33327293f9223c976c144030b732fd3afe3 Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 18 Feb 2022 11:06:08 +0100 Subject: [PATCH 484/883] test T_stdout 2 for NSA --- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 2476a75427..5dbd36f00d 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -75,7 +75,7 @@ Initialize_eNB Initialize gNB - -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time,line_num,function + -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --T_stdout 2 --log_config.global_log_options level,nocolor,time,line_num,function 1 1 nr From 2cc96f5025fa49981f73abc11b4aab481712d932 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 18 Feb 2022 11:11:48 +0100 Subject: [PATCH 485/883] log level fix for ptrs in dlsim --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 2 +- openair1/SIMULATION/NR_PHY/dlsim.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 104aee94f0..e6e53c20b3 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -295,7 +295,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, ptrs_symbol = is_ptrs_symbol(l,dlPtrsSymPos); if(ptrs_symbol) { /* PTRS QPSK Modulation for each OFDM symbol in a slot */ - printf("Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs); + LOG_D(PHY,"Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs); nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs); } } diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index b8f51f8e95..a152760ac2 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1091,7 +1091,7 @@ int main(int argc, char **argv) pdsch_pdu_rel15->dlDmrsSymbPos); ptrsSymbPerSlot = get_ptrs_symbols_in_slot(dlPtrsSymPos, pdsch_pdu_rel15->StartSymbolIndex, pdsch_pdu_rel15->NrOfSymbols); ptrsRePerSymb = ((rel15->rbSize + rel15->PTRSFreqDensity - 1)/rel15->PTRSFreqDensity); - printf("[DLSIM] PTRS Symbols in a slot: %2u, RE per Symbol: %3u, RE in a slot %4d\n", ptrsSymbPerSlot,ptrsRePerSymb, ptrsSymbPerSlot*ptrsRePerSymb ); + LOG_D(PHY,"[DLSIM] PTRS Symbols in a slot: %2u, RE per Symbol: %3u, RE in a slot %4d\n", ptrsSymbPerSlot,ptrsRePerSymb, ptrsSymbPerSlot*ptrsRePerSymb ); } msgDataTx->ssb[0].ssb_pdu.ssb_pdu_rel15.bchPayload=0x001234; @@ -1248,7 +1248,7 @@ int main(int argc, char **argv) available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, rel15->nrOfLayers); if(pdu_bit_map & 0x1) { available_bits-= (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2); - printf("[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) ); + LOG_D(PHY,"[DLSIM][PTRS] Available bits are: %5u, removed PTRS bits are: %5u \n",available_bits, (ptrsSymbPerSlot * ptrsRePerSymb *rel15->nrOfLayers* 2) ); } /* From 63989e8a694485b3e1ccb0d0763d754a57c13103 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 17 Feb 2022 19:53:33 +0100 Subject: [PATCH 486/883] Fix for F1 RFsim fail We compute the preferred DL TDAs when receiving the cellGroup from the RRC. However, in F1 and the RFsim, it seems that the scheduler tries to access the preferred DL TDAs before they have been set after receiving the cellGroup. In this commit, add a simple check to verify the preferred TDA has been set up. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0d857a0ba9..cd34a543c7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -895,7 +895,10 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t /* This is temporary and it assumes all UEs have the same BWP and TDA*/ int UE_id = UE_info->list.head; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; + const int bwp_id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0; + if (!RC.nrmac[module_id]->preferred_dl_tda[bwp_id]) + return; + const int tda = RC.nrmac[module_id]->preferred_dl_tda[bwp_id][slot]; int startSymbolIndex, nrOfSymbols; const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList : From 9b302d04322d18233e9ff7874846803ca2589609 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 12:20:06 +0100 Subject: [PATCH 487/883] Fix DU default config, increase 5G F1 RFsim throughput requirements --- ci-scripts/conf_files/gNB_SA_DU.conf | 2 +- ci-scripts/xml_files/container_5g_f1_rfsim.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index adcbcd45d0..64f2dd5d0e 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -280,7 +280,7 @@ serveraddr = "server"; phy_log_verbosity ="medium"; mac_log_level ="info"; mac_log_verbosity ="high"; - rlc_log_level ="debug"; + rlc_log_level ="info"; rlc_log_verbosity ="medium"; pdcp_log_level ="info"; pdcp_log_verbosity ="medium"; diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml index 501f2fe46f..fc24a3d67c 100644 --- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml @@ -100,7 +100,7 @@ rfsim5g-oai-nr-ue rfsim5g-oai-ext-dn -B 12.1.1.2 -u -i 1 -s - -c 12.1.1.2 -u -i 1 -t 30 -b 200K + -c 12.1.1.2 -u -i 1 -t 30 -b 3M @@ -109,7 +109,7 @@ rfsim5g-oai-ext-dn rfsim5g-oai-nr-ue -u -i 1 -s - -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 5K + -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M From 6569fd76148051ff92bb8ef370d277526d38dff5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 12:52:45 +0100 Subject: [PATCH 488/883] Do not prematurely overwrite scheduler information Overwriting sched_pusch information at that stage would in particular lose information on the current frame/slot. Overwriting sched_pusch with the retInfo structure is already done at the end of allocate_ul_retransmission(), and is therefore not necessary at this stage. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index c757479a41..397630bae6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1020,9 +1020,6 @@ bool allocate_ul_retransmission(module_id_t module_id, retInfo->rbSize = new_rbSize; retInfo->time_domain_allocation = tda; sched_ctrl->pusch_semi_static = temp_ps; - - // Get previous PUSCH filed info - sched_ctrl->sched_pusch = *retInfo; } /* Find a free CCE */ From 0a59bffbb129f459a646005b97c86ed367447adc Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 18 Feb 2022 13:38:45 +0100 Subject: [PATCH 489/883] fix phy-test check --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index c757479a41..1257d80f10 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -710,10 +710,9 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt++; UE_info->mac_stats[UE_id].ulsch_DTX++; } - if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { - if (get_softmodem_params()->phy_test==0) - LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", - UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); + if (!get_softmodem_params()->phy_test && UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { + LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", + UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; nr_mac_gNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } From dca9be3c33fb7853056a10192fb677c915b7472c Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Fri, 18 Feb 2022 16:10:10 +0100 Subject: [PATCH 490/883] code review comments (incl. actual bugs) --- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 166 ++++++++++--------------- 1 file changed, 67 insertions(+), 99 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index c06dec7fcb..5072741981 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -45,14 +45,15 @@ //#include "PHY_INTERFACE/defs.h" #define PBCH_A 24 - +#define PBCH_MAX_RE_PER_SYMBOL (20*12) +#define PBCH_MAX_RE (PBCH_MAX_RE_PER_SYMBOL*4) #define print_shorts(s,x) printf("%s : %d,%d,%d,%d,%d,%d,%d,%d\n",s,((int16_t*)x)[0],((int16_t*)x)[1],((int16_t*)x)[2],((int16_t*)x)[3],((int16_t*)x)[4],((int16_t*)x)[5],((int16_t*)x)[6],((int16_t*)x)[7]) static uint16_t nr_pbch_extract(int **rxdataF, const int estimateSz, struct complex16 dl_ch_estimates[][estimateSz], - struct complex16 rxdataF_ext[][20*12*4], - struct complex16 dl_ch_estimates_ext[][20*12*4], + struct complex16 rxdataF_ext[][PBCH_MAX_RE_PER_SYMBOL], + struct complex16 dl_ch_estimates_ext[][PBCH_MAX_RE_PER_SYMBOL], uint32_t symbol, uint32_t s_offset, NR_DL_FRAME_PARMS *frame_parms) { @@ -90,12 +91,11 @@ static uint16_t nr_pbch_extract(int **rxdataF, (i!=(nushiftmod4+8))) { rxF_ext[j]=rxF[rx_offset]; #ifdef DEBUG_PBCH - printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",(9*rb) + j, - ((int16_t *)&rxF_ext[j])[0], - ((int16_t *)&rxF_ext[j])[1], + printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n", + (9*rb) + j, + rxF_ext[j].r, rxF_ext[j].i, rx_offset, - ((int16_t *)&rxF[rx_offset])[0], - ((int16_t *)&rxF[rx_offset])[1]); + rxF[rx_offset].r,rxF[rx_offset].j; #endif j++; } @@ -114,11 +114,9 @@ static uint16_t nr_pbch_extract(int **rxdataF, rxF_ext[j]=rxF[rx_offset]; #ifdef DEBUG_PBCH printf("rxF ext[%d] = (%d,%d) rxF [%u]= (%d,%d)\n",(rb<4) ? (9*rb) + j : (9*(rb-12))+j, - ((int16_t *)&rxF_ext[j])[0], - ((int16_t *)&rxF_ext[j])[1], + rxF_ext[j].r, rxF_ext[j].i, rx_offset, - ((int16_t *)&rxF[rx_offset])[0], - ((int16_t *)&rxF[rx_offset])[1]); + rxF[rx_offset].r,rxF[rx_offset].j; #endif j++; } @@ -137,7 +135,7 @@ static uint16_t nr_pbch_extract(int **rxdataF, struct complex16 *dl_ch0 = &dl_ch_estimates[aarx][((symbol+s_offset)*(frame_parms->ofdm_symbol_size))]; //printf("dl_ch0 addr %p\n",dl_ch0); - struct complex16 *dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*20*12]; + struct complex16 *dl_ch0_ext = dl_ch_estimates_ext[aarx]; for (rb=0; rb<20; rb++) { j=0; @@ -149,15 +147,11 @@ static uint16_t nr_pbch_extract(int **rxdataF, (i!=(nushiftmod4+8))) { dl_ch0_ext[j]=dl_ch0[i]; #ifdef DEBUG_PBCH - if ((rb==0) && (i<2)) printf("dl ch0 ext[%d] = (%d,%d) dl_ch0 [%d]= (%d,%d)\n",j, - ((int16_t *)&dl_ch0_ext[j])[0], - ((int16_t *)&dl_ch0_ext[j])[1], + dl_ch0_ext[j].r, dl_ch0_ext[j].i, i, - ((int16_t *)&dl_ch0[i])[0], - ((int16_t *)&dl_ch0[i])[1]); - + dl_ch0[j].r, dl_ch0[j].i, #endif j++; } @@ -174,11 +168,9 @@ static uint16_t nr_pbch_extract(int **rxdataF, dl_ch0_ext[j]=dl_ch0[i]; #ifdef DEBUG_PBCH printf("dl ch0 ext[%d] = (%d,%d) dl_ch0 [%d]= (%d,%d)\n",j, - ((int16_t *)&dl_ch0_ext[j])[0], - ((int16_t *)&dl_ch0_ext[j])[1], + dl_ch0_ext[j].r, dl_ch0_ext[j].i, i, - ((int16_t *)&dl_ch0[i])[0], - ((int16_t *)&dl_ch0[i])[1]); + dl_ch0[j].r, dl_ch0[j].i, #endif j++; } @@ -198,11 +190,10 @@ static uint16_t nr_pbch_extract(int **rxdataF, //__m128i avg128; //compute average channel_level on each (TX,RX) antenna pair -int nr_pbch_channel_level(struct complex16 dl_ch_estimates_ext[][20*12*4], +int nr_pbch_channel_level(struct complex16 dl_ch_estimates_ext[][PBCH_MAX_RE_PER_SYMBOL], NR_DL_FRAME_PARMS *frame_parms, - uint32_t symbol) { - int16_t rb, nb_rb=20; - uint8_t aarx; + int nb_re) { + int16_t nb_rb=nb_re/12; #if defined(__x86_64__) || defined(__i386__) __m128i avg128; __m128i *dl_ch128; @@ -212,22 +203,23 @@ int nr_pbch_channel_level(struct complex16 dl_ch_estimates_ext[][20*12*4], #endif int avg1=0,avg2=0; - for (aarx=0; aarxnb_antennas_rx; aarx++) { + for (int aarx=0; aarxnb_antennas_rx; aarx++) { //clear average level #if defined(__x86_64__) || defined(__i386__) avg128 = _mm_setzero_si128(); - dl_ch128=(__m128i *)&dl_ch_estimates_ext[aarx][symbol*20*12]; + dl_ch128=(__m128i *)dl_ch_estimates_ext[aarx]; #elif defined(__arm__) avg128 = vdupq_n_s32(0); - dl_ch128=(int16x8_t *)&dl_ch_estimates_ext[aarx][symbol*20*12]; + dl_ch128=(int16x8_t *)dl_ch_estimates_ext[aarx]; #endif - for (rb=0; rb 0 && symbol < 4), - "symbol %d is illegal for PBCH DM-RS\n", - symbol); - - // printf("comp: symbol %d : nb_re %d\n",symbol,nb_re); - +static void nr_pbch_channel_compensation(struct complex16 rxdataF_ext[][PBCH_MAX_RE_PER_SYMBOL], + struct complex16 dl_ch_estimates_ext[][PBCH_MAX_RE_PER_SYMBOL], + int nb_re, + struct complex16 rxdataF_comp[][PBCH_MAX_RE_PER_SYMBOL], + NR_DL_FRAME_PARMS *frame_parms, + uint8_t output_shift) { for (int aarx=0; aarxnb_antennas_rx; aarx++) { - vect128 *dl_ch128 = (vect128 *)&dl_ch_estimates_ext[aarx][symbol*20*12]; + vect128 *dl_ch128 = (vect128 *)dl_ch_estimates_ext[aarx]; vect128 *rxdataF128 = (vect128 *)rxdataF_ext[aarx]; vect128 *rxdataF_comp128 = (vect128 *)rxdataF_comp[aarx]; - /* - printf("ch compensation dl_ch ext addr %p \n", &dl_ch_estimates_ext[aarx][symbol*20*12]); - printf("rxdataf ext addr %p symbol %d\n", rxdataF_ext[aarx], symbol); - printf("rxdataf_comp addr %p\n",&rxdataF_comp[aarx][symbol*20*12]); - */ - for (int re=0; renb_antennas_rx][20*12*4]; - struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][nb_re]; - //was dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][20*12*4]; + struct complex16 rxdataF_ext[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; + struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; memset(dl_ch_estimates_ext,0, sizeof dl_ch_estimates_ext); nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, estimateSz, @@ -474,20 +448,20 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, if (symbol == 1) { max_h = nr_pbch_channel_level(dl_ch_estimates_ext, frame_parms, - symbol); + nb_re); log2_maxh = 3+(log2_approx(max_h)/2); } #ifdef DEBUG_PBCH LOG_I(PHY,"[PHY] PBCH log2_maxh = %d (%d)\n",nr_ue_pbch_vars->log2_maxh,max_h); #endif + struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; nr_pbch_channel_compensation(rxdataF_ext, dl_ch_estimates_ext, nb_re, rxdataF_comp, frame_parms, - symbol, - log2_maxh); // log2_maxh+I0_shift + log2_maxh); // log2_maxh+I0_shift /*if (frame_parms->nb_antennas_rx > 1) pbch_detection_mrc(frame_parms, @@ -502,19 +476,12 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, return(-1); } */ - if (symbol==2) { - nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, - (short *)rxdataF_comp[0], - 144); - memcpy(pbch_unClipped+pbch_e_rx_idx, rxdataF_comp[0], 144*sizeof(int16_t)); - pbch_e_rx_idx+=144; - } else { - nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, - (short *)rxdataF_comp[0], - 360); - memcpy(pbch_unClipped+pbch_e_rx_idx, rxdataF_comp[0], 144*sizeof(int16_t)); - pbch_e_rx_idx+=360; - } + int nb=symbol==2 ? 144 : 360; + nr_pbch_quantize(pbch_e_rx+pbch_e_rx_idx, + (short *)rxdataF_comp[0], + nb); + memcpy(pbch_unClipped+pbch_e_rx_idx, rxdataF_comp[0], nb*sizeof(int16_t)); + pbch_e_rx_idx+=nb; } // legacy code use int16, but it is complex16 @@ -522,15 +489,11 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, UEscopeCopy(ue, pbchLlr, pbch_e_rx, sizeof(int16_t), frame_parms->nb_antennas_rx, pbch_e_rx_idx); #ifdef DEBUG_PBCH write_output("rxdataF_comp.m","rxFcomp",rxdataF_comp[0],240*3,1,1); -#endif - //demod_pbch_e = nr_ue_pbch_vars->demod_pbch_e; - // FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a; -#ifdef DEBUG_PBCH short *p = (short *)rxdataF_comp[0]); - + for (int cnt = 0; cnt < 864 ; cnt++) -printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); - + printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); + #endif //un-scrambling M = NR_POLAR_PBCH_E; @@ -538,34 +501,39 @@ printf("pbch rx llr %d\n",*(pbch_e_rx+cnt)); uint32_t unscrambling_mask = (Lmax==64)?0x100006D:0x1000041; uint32_t pbch_a_interleaved=0; uint32_t pbch_a_prime=0; - nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0, pbch_a_prime, &pbch_a_interleaved); + nr_pbch_unscrambling(nr_ue_pbch_vars, pbch_e_rx, frame_parms->Nid_cell, nushift, M, NR_POLAR_PBCH_E, + 0, 0, pbch_a_prime, &pbch_a_interleaved); //polar decoding de-rate matching - const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); -uint64_t tmp=pbch_a_prime; -decoderState = polar_decoder_int16(pbch_e_rx,&tmp,0,currentPtr); -pbch_a_prime=tmp; + const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, + NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); + uint64_t tmp=pbch_a_prime; + decoderState = polar_decoder_int16(pbch_e_rx,&tmp,0,currentPtr); + pbch_a_prime=tmp; - if(decoderState) return(decoderState); + if(decoderState) + return(decoderState); // printf("polar decoder output 0x%08x\n",pbch_a_prime); // Decoder reversal uint32_t a_reversed=0; for (int i=0; i>i)&1)<<(31-i); + a_reversed |= (((uint64_t)pbch_a_prime>>i)&1)<<(31-i); pbch_a_prime = a_reversed; //payload un-scrambling M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3); nushift = ((pbch_a_prime>>24)&1) ^ (((pbch_a_prime>>6)&1)<<1); - nr_pbch_unscrambling(nr_ue_pbch_vars,pbch_e_rx,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1,unscrambling_mask,pbch_a_prime, &pbch_a_interleaved); + pbch_a_interleaved=0; + nr_pbch_unscrambling(nr_ue_pbch_vars, pbch_e_rx, frame_parms->Nid_cell, nushift, M, NR_POLAR_PBCH_PAYLOAD_BITS, + 1, unscrambling_mask, pbch_a_prime, &pbch_a_interleaved); //printf("nushift %d sfn 3rd %d 2nd %d", nushift,((pbch_a_prime>>6)&1), ((pbch_a_prime>>24)&1) ); //payload deinterleaving //uint32_t in=0; uint32_t out=0; for (int i=0; i<32; i++) { - out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); + out |= ((pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]); #ifdef DEBUG_PBCH printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (pbch_a_interleaved>>i)&1); #endif @@ -575,16 +543,16 @@ a_reversed |= (((uint64_t)pbch_a_prime>>i)&1)<<(31-i); result->xtra_byte = (out>>24)&0xff; for (int i=0; i>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1); - + payload |= ((out>>i)&1)<<(NR_POLAR_PBCH_PAYLOAD_BITS-i-1); + for (int i=0; i<3; i++) -result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); - + result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); + frame_parms->half_frame_bit = (result->xtra_byte>>4)&0x01; // computing the half frame index from the extra byte frame_parms->ssb_index = i_ssb; // ssb index corresponds to i_ssb for Lmax = 4,8 - + if (Lmax == 64) { // for Lmax = 64 ssb index 4th,5th and 6th bits are in extra byte - for (int i=0; i<3; i++) + for (int i=0; i<3; i++) frame_parms->ssb_index += (((result->xtra_byte>>(7-i))&0x01)<<(3+i)); } @@ -596,8 +564,8 @@ result->decoded_output[i] = (uint8_t)((payload>>((3-i)<<3))&0xff); uint8_t frame_number_4lsb = 0; for (int i=0; i<4; i++) -frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i); - + frame_number_4lsb |= ((result->xtra_byte>>i)&1)<<(3-i); + proc->decoded_frame_rx = frame_number_4lsb; #ifdef DEBUG_PBCH printf("xtra_byte %x payload %x\n", xtra_byte, payload); From a1aae8292513672f3637bcc06db2baa279a489e8 Mon Sep 17 00:00:00 2001 From: alblf Date: Fri, 18 Feb 2022 18:22:14 +0100 Subject: [PATCH 491/883] Fix duplicated memory allocation when replaying using mmap, add use_mmap parameter for the record player device fix assertion when replaying without using mmap --- targets/ARCH/COMMON/record_player.c | 7 +++--- targets/ARCH/COMMON/record_player.h | 13 ++++++----- targets/ARCH/iqplayer/iqplayer_lib.c | 33 ++++++++++++++-------------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/targets/ARCH/COMMON/record_player.c b/targets/ARCH/COMMON/record_player.c index 522f6b6d16..37f985b6b2 100644 --- a/targets/ARCH/COMMON/record_player.c +++ b/targets/ARCH/COMMON/record_player.c @@ -58,10 +58,9 @@ int read_recplayconfig(recplay_conf_t **recplay_conf, recplay_state_t **recplay_ // Use mmap for IQ files for systems with less than 6GB total RAM sysinfo(&systeminfo); - if (systeminfo.totalram < 6144000000) { - (*recplay_state)->use_mmap = 0; - } else { - (*recplay_state)->use_mmap = 1; + if (systeminfo.totalram < 6144000000 && ((*recplay_conf)->use_mmap == 1)) { + LOG_W(HW,"System with %f GB of mem (<6GB), mmap usage disabled\n",systeminfo.totalram/10E9); + (*recplay_conf)->use_mmap = 0; } } else { /* record player enabled */ free(*recplay_conf); diff --git a/targets/ARCH/COMMON/record_player.h b/targets/ARCH/COMMON/record_player.h index d91da68323..9310355e5b 100644 --- a/targets/ARCH/COMMON/record_player.h +++ b/targets/ARCH/COMMON/record_player.h @@ -78,7 +78,7 @@ typedef struct { #define CONFIG_HLP_SF_LOOPS "Number of loops to replay of the entire subframes file" #define CONFIG_HLP_SF_RDELAY "Delay in microseconds to read a subframe in replay mode" #define CONFIG_HLP_SF_WDELAY "Delay in microseconds to write a subframe in replay mode" - +#define CONFIG_HLP_USE_MMAP "In replay mode, map iq file in memory before replaying" /* keyword strings for config options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ #define CONFIG_OPT_SF_FILE "subframes-file" #define CONFIG_OPT_SF_REC "subframes-record" @@ -87,7 +87,7 @@ typedef struct { #define CONFIG_OPT_SF_LOOPS "subframes-loops" #define CONFIG_OPT_SF_RDELAY "subframes-read-delay" #define CONFIG_OPT_SF_WDELAY "subframes-write-delay" - +#define CONFIG_OPT_USE_MMAP "use-mmap" #define DEVICE_RECPLAY_SECTION "device.recplay" /* For information only - the macro is not usable in C++ */ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -95,13 +95,14 @@ typedef struct { /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define DEVICE_RECPLAY_PARAMS_DESC { \ - {CONFIG_OPT_SF_FILE, CONFIG_HLP_SF_FILE, 0, strptr:(char **)((*recplay_conf)->u_sf_filename), defstrval:DEF_SF_FILE, TYPE_STRING, 1024}, \ - {CONFIG_OPT_SF_REC, CONFIG_HLP_SF_REC, PARAMFLAG_BOOL, uptr:&(u_sf_record), defuintval:0, TYPE_UINT, 0}, \ - {CONFIG_OPT_SF_REP, CONFIG_HLP_SF_REP, PARAMFLAG_BOOL, uptr:&(u_sf_replay), defuintval:0, TYPE_UINT, 0}, \ + {CONFIG_OPT_SF_FILE, CONFIG_HLP_SF_FILE, 0, strptr:(char **)((*recplay_conf)->u_sf_filename), defstrval:DEF_SF_FILE, TYPE_STRING, 1024}, \ + {CONFIG_OPT_SF_REC, CONFIG_HLP_SF_REC, PARAMFLAG_BOOL, uptr:&(u_sf_record), defuintval:0, TYPE_UINT, 0}, \ + {CONFIG_OPT_SF_REP, CONFIG_HLP_SF_REP, PARAMFLAG_BOOL, uptr:&(u_sf_replay), defuintval:0, TYPE_UINT, 0}, \ {CONFIG_OPT_SF_MAX, CONFIG_HLP_SF_MAX, 0, uptr:&((*recplay_conf)->u_sf_max), defintval:DEF_NB_SF, TYPE_UINT, 0}, \ {CONFIG_OPT_SF_LOOPS, CONFIG_HLP_SF_LOOPS, 0, uptr:&((*recplay_conf)->u_sf_loops), defintval:DEF_SF_NB_LOOP, TYPE_UINT, 0}, \ {CONFIG_OPT_SF_RDELAY, CONFIG_HLP_SF_RDELAY, 0, uptr:&((*recplay_conf)->u_sf_read_delay), defintval:DEF_SF_DELAY_READ, TYPE_UINT, 0}, \ {CONFIG_OPT_SF_WDELAY, CONFIG_HLP_SF_WDELAY, 0, uptr:&((*recplay_conf)->u_sf_write_delay), defintval:DEF_SF_DELAY_WRITE, TYPE_UINT, 0}, \ + {CONFIG_OPT_USE_MMAP, CONFIG_HLP_USE_MMAP, PARAMFLAG_BOOL, uptr:&((*recplay_conf)->use_mmap), defuintval:1, TYPE_UINT, 0}, \ }/*! \brief Record Player Configuration and state */ typedef struct { char u_sf_filename[1024]; // subframes file path @@ -109,10 +110,10 @@ typedef struct { unsigned int u_sf_loops ; // number of loops in replay mode unsigned int u_sf_read_delay; // read delay in replay mode unsigned int u_sf_write_delay ; // write delay in replay mode + unsigned int use_mmap; // default is to use mmap } recplay_conf_t; typedef struct { - int use_mmap; // default is to use mmap size_t mapsize; FILE *pFile; int fd; diff --git a/targets/ARCH/iqplayer/iqplayer_lib.c b/targets/ARCH/iqplayer/iqplayer_lib.c index 8b6844f9d3..b62c1935d3 100644 --- a/targets/ARCH/iqplayer/iqplayer_lib.c +++ b/targets/ARCH/iqplayer/iqplayer_lib.c @@ -68,19 +68,18 @@ static int iqplayer_loadfile(openair0_device *device, openair0_config_t *openair exit(-1); } - if (s->use_mmap) { + if (c->use_mmap) { // use mmap s->mapsize=sb.st_size; LOG_I(HW,"Loading subframes using mmap() from %s size=%lu bytes ...\n",c->u_sf_filename, (uint64_t)sb.st_size ); void *mptr = mmap(NULL, sb.st_size, PROT_WRITE, MAP_PRIVATE, s->fd, 0) ; - s->ms_sample = (iqrec_t *) ( mmap(NULL, sb.st_size, PROT_WRITE, MAP_PRIVATE, s->fd, 0) + sizeof(iqfile_header_t)); - if (mptr != MAP_FAILED) { + s->ms_sample = (iqrec_t *) ( mptr + sizeof(iqfile_header_t)); parse_iqfile_header(device, (iqfile_header_t *)mptr); s->ms_sample = (iqrec_t *)((char *)mptr + sizeof(iqfile_header_t)); LOG_I(HW,"Loaded %u subframes.\n",s->nbSamplesBlocks ); } else { - LOG_E(HW,"Cannot mmap file, exiting.\n"); + LOG_E(HW,"Cannot mmap file, exiting, errnor %s\n",strerror(errno)); close(s->fd); exit(-1); } @@ -108,7 +107,7 @@ static int iqplayer_loadfile(openair0_device *device, openair0_config_t *openair if (lseek(s->fd,sizeof(iqfile_header_t), SEEK_SET) == 0) { LOG_I(HW,"Initial seek at beginning of the file\n" ); } else { - LOG_I(HW,"Problem initial seek at beginning of the file\n"); + LOG_I(HW,"Problem initial seek at beginning of the file, %s\n",strerror(errno)); } } else { LOG_E(HW,"Cannot read header in %s exiting.\n",c->u_sf_filename ); @@ -134,11 +133,10 @@ static int trx_iqplayer_start(openair0_device *device) { static void trx_iqplayer_end(openair0_device *device) { if (device == NULL) return; - if (device->recplay_state == NULL) return; - if (device->recplay_state->use_mmap) { + if (device->openair0_cfg->recplay_conf->use_mmap) { if (device->recplay_state->ms_sample != MAP_FAILED) { munmap(device->recplay_state->ms_sample, device->recplay_state->mapsize); } @@ -201,21 +199,22 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes LOG_I(HW,"go back at the beginning of IQ file"); device->recplay_state->currentPtr=(uint8_t *)device->recplay_state->ms_sample; - if (!s->use_mmap) { - if (lseek(device->recplay_state->fd, 0, SEEK_SET) != 0) { - LOG_E(HW, "Problem seeking at the beginning of IQ file"); - } + if (!(device->openair0_cfg->recplay_conf->use_mmap) ) { + close(device->recplay_state->fd); + iqplayer_loadfile(device, device->openair0_cfg); + // LOG_E(HW, "Problem seeking at the beginning of IQ file %s\n",strerror(errno)); + } } - if (!s->use_mmap) { + if (!(device->openair0_cfg->recplay_conf->use_mmap)) { // read sample from file if (read(s->fd, s->ms_sample, sizeof(iqrec_t)) != sizeof(iqrec_t)) { - LOG_E(HW,"pb reading iqfile at index %lu\n",sizeof(iqrec_t)*s->curSamplesBlock ); + LOG_E(HW,"pb reading iqfile at index %lu %s\n",sizeof(iqrec_t)*s->curSamplesBlock, strerror(errno) ); exit(-1); } else { if (read(s->fd, s->ms_sample+1, s->ms_sample->nbBytes) != s->ms_sample->nbBytes) { - LOG_E(HW,"pb reading iqfile at index %lu\n",sizeof(iqrec_t)*s->curSamplesBlock ); + LOG_E(HW,"pb reading iqfile at index %lu %s\n",sizeof(iqrec_t)*s->curSamplesBlock, strerror(errno) ); exit(-1); } } @@ -225,7 +224,9 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes AssertFatal(curHeader->header==BELL_LABS_IQ_HEADER,"" ); // the current timestamp is the stored timestamp until we wrap on input // USRP shifts 1 sample time to time - AssertFatal(s->wrap_count !=0 || abs(curHeader->ts-s->currentTs) < 5 ,""); + if (s->wrap_count !=0 && device->openair0_cfg->recplay_conf->use_mmap) + AssertFatal( abs(curHeader->ts-s->currentTs) < 5 , + "wrap_count=%li, ts %lu %lu",s->wrap_count,curHeader->ts,s->currentTs); AssertFatal(nsamps*4==curHeader->nbBytes,""); *ptimestamp = s->currentTs; memcpy(buff[0], curHeader+1, nsamps*4); @@ -233,7 +234,7 @@ static int trx_iqplayer_read(openair0_device *device, openair0_timestamp *ptimes // Prepare for next read s->currentTs+=nsamps; - if (s->use_mmap) + if (device->openair0_cfg->recplay_conf->use_mmap) s->currentPtr+=sizeof(iqrec_t)+s->ms_sample->nbBytes; struct timespec req; From cc22ec9978f484355fd4ab23e5e674865c4be38b Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 09:29:00 -0800 Subject: [PATCH 492/883] Calling scheduler before handling DCI to ensure nbits are set Previously, we thought the memset in the nr_ue_dl_indication() was causing issues / exposing a race. This is not the case. The memset is not problematic, the issue is that in the emulate_l1 mode we were not always configuring the DCI nbits before handling the DCI when we are pushing high (15 Mbps) throughput traffic. --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 1f7eb83c60..dc3bc52e9e 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -748,6 +748,7 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, NR_UL_TIME_ALIGNMENT_t ul_time_alignment; memset(&ul_time_alignment, 0, sizeof(ul_time_alignment)); fill_dci_from_dl_config(&mac->dl_info, &mac->dl_config_request); + nr_ue_scheduler(&mac->dl_info, NULL); nr_ue_dl_indication(&mac->dl_info, &ul_time_alignment); if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort(); @@ -1176,8 +1177,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot, dl_info->thread_id); nr_ue_if_module_inst[module_id]->scheduled_response(&scheduled_response); } - if (!get_softmodem_params()->emulate_l1) - memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); + memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); } free(dl_info->dci_ind); dl_info->dci_ind = NULL; From c4547c7afd79c37216301b1f1a7982c95e1f910a Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 18 Feb 2022 18:38:51 +0100 Subject: [PATCH 493/883] fixing wrong interpretation of support for 256qam table --- openair2/RRC/NR/nr_rrc_config.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 06aa32cb44..97d91702d6 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -184,31 +184,7 @@ void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap, else if (cap->phy_Parameters.phy_ParametersFR1 && cap->phy_Parameters.phy_ParametersFR1->pdsch_256QAM_FR1) supported = true; - // check featureSet - NR_FeatureSets_t *fs=cap->featureSets; - NR_ModulationOrder_t supported_mo = 0; - if (fs && supported) { - // go through DL feature sets and look for one with current SCS - for (int i=0;ifeatureSetsDownlinkPerCC->list.count;i++) { - int supported_bw; - NR_FeatureSetDownlinkPerCC_t *fs_cc = fs->featureSetsDownlinkPerCC->list.array[i]; - switch (fs_cc->supportedBandwidthDL.present) { - case NR_SupportedBandwidth_PR_fr1: - supported_bw = fs_cc->supportedBandwidthDL.choice.fr1; - break; - case NR_SupportedBandwidth_PR_fr2: - supported_bw = fs_cc->supportedBandwidthDL.choice.fr2; - break; - default: - AssertFatal(1==0,"Invalid parameter for supported bandwith choice\n"); - } - if (fs_cc->supportedSubcarrierSpacingDL == scs && - supported_bw == bw && - fs_cc->supportedModulationOrderDL) - supported_mo = *fs_cc->supportedModulationOrderDL ; - } - } - if (supported && (supported_mo == NR_ModulationOrder_qam256)) { + if (supported) { if(bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == NULL) bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table)); *bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; From bf3d7959bd6db261f5d58795058a4db828e568ff Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 09:39:06 -0800 Subject: [PATCH 494/883] Comment for #define _GNU_SOURCE --- executables/nr-ue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index b957cb3bd4..245e22ae60 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -19,7 +19,8 @@ * contact@openairinterface.org */ -#define _GNU_SOURCE +#define _GNU_SOURCE // For pthread_setname_np +#include #include #include "executables/nr-uesoftmodem.h" #include "PHY/phy_extern_nr_ue.h" From 3d577aa0fcb8f60adcba36ee4a08cd59848aa4bc Mon Sep 17 00:00:00 2001 From: alblf Date: Fri, 18 Feb 2022 18:40:56 +0100 Subject: [PATCH 495/883] doc update --- targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md b/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md index a6e4138e8e..f68f800047 100644 --- a/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md +++ b/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md @@ -75,7 +75,7 @@ U[HW]I ru thread Writing file header to /tmp/iqfile ``` ### Playback/replay mode -The option works only for 5MHz bandwidth because the information stored in the iq's file header regarding bandwidth is not yet properly processed. +When replaying iq's received by eNB or gNB The option works only for 5MHz bandwidth because the information stored in the iq's file header regarding bandwidth is not yet properly processed. In this version, mismatch between file content and run time parameters might lead to unpredictable results. In addition a file recorded on a AVX2-capable processor cannot be replayed on a non-AVX2-capable processor (this is to be further investigated). options for replay mode are: * `subframes-replay` Activate replay mode @@ -83,6 +83,7 @@ options for replay mode are: * `subframes-loops` Number of iterations to replay the entire subframes file (default is 5) * `subframes-read-delay` Delay in microseconds to read a subframe in replay mode (default 200) * `subframes-write-delay` Delay in milliseconds to write a subframe in replay mode (default 15) +* `use-mmap` Boolean, set to 1 (true) by default, iq file is map to memory if true, otherwise iq's are read from file. >iq player session example: ```bash From cffb27b086756589bac22783b0ae877243cce7d6 Mon Sep 17 00:00:00 2001 From: Francois TABURET Date: Fri, 18 Feb 2022 17:46:08 +0000 Subject: [PATCH 496/883] Update iqrecordplayer_usage.md --- targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md b/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md index f68f800047..6ccdca3bfa 100644 --- a/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md +++ b/targets/ARCH/iqplayer/DOC/iqrecordplayer_usage.md @@ -1,7 +1,7 @@ # I/Q record-playback ## using the iq recorder or iq player -This feature provides I/Q record-playback as presented in the 4th OAI workshop. Tests have only been performed with a eNB, but the implementation should allow any softmodem executable to use the iq's record/player. +This feature provides I/Q record-playback as presented in the 4th OAI workshop. The implementation allows any softmodem executable to use the iq's record/player. The I/Q record/playback feature is briefly described hereafter, it allows you to: * record subframes received by the USRP board in a file while the system is operating (for example you can record a full UE connection/traffic/ disconnection sequence). Today the oai USRP device is the only one supporting the recording feature. * replay subframes from a file to operate the system (possibly in multiple loops if the recorded sequence is convenient from the logical point of view). From b7c767147e3ffb5d035927a64de6bedaf41bb9c0 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 09:48:38 -0800 Subject: [PATCH 497/883] Hacks with comments are added in this commit. These allow the NRUE to reach roughtly 15-25 Mbps with ~20%-34% packetloss without crashing. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 6 +++++- openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 15c0c23feb..88d7342b5d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1309,9 +1309,13 @@ int nr_acknack_scheduling(int mod_id, /* we need to find a new PUCCH occasion */ /*(Re)Inizialization of timing information*/ + /* TODO: This is something of a hack. The last condition in the + if statement below was added. OAI is looking into this and is + expected to provide a solution. Without the hack, the gNB will + incorrectly schedule more than 2 ACK/nACKs in a single SFN/Slot. */ if ((pucch->frame == 0 && pucch->ul_slot == 0) || ((pucch->frame*n_slots_frame + pucch->ul_slot) < - (frame*n_slots_frame + slot))) { + (frame*n_slots_frame + slot)) && (frame!=1023)) { AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c index 62aa101a50..d241e43a0f 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c @@ -51,7 +51,12 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity, if (entity->type != NR_PDCP_SRB && !(buffer[0] & 0x80)) { LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); - exit(1); + /* TODO: This is something of a hack. The most significant bit + in buffer[0] should be 1 if the packet is a data packet. We are + processing malformed data packets if the most significant bit + is 0. Rather than exit(1), this hack allows us to continue for now. + We need to investigate why this hack is neccessary. */ + buffer[0] |= 128; } if (entity->sn_size == 12) { From 0db8f80f737647ce7424f20ff3d1a65fad4e6b7a Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 09:58:26 -0800 Subject: [PATCH 498/883] Removing invalid log --- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 1 - 1 file changed, 1 deletion(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 1cc062b68f..ab3f2983e3 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -3304,7 +3304,6 @@ static uint8_t pack_nr_uci_indication_body(nfapi_nr_uci_t* value, uint8_t **ppWr return 0; switch (value->pdu_type) { - NFAPI_TRACE(NFAPI_TRACE_INFO, " NFAPI_NR_UCI_PUSCH_PDU_TYPE = %d \n", value->pdu_type); case NFAPI_NR_UCI_PUSCH_PDU_TYPE: NFAPI_TRACE(NFAPI_TRACE_WARN, "Unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE \n"); break; From b2e2a6bc2ed69c7f0bfdaf8dacf63c1468458f64 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 10:08:44 -0800 Subject: [PATCH 499/883] Changing UL_INFO naming convention to be normal --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 702bf6d1a1..81d0509f76 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -264,10 +264,10 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response LOG_I(NR_PHY, "Sending UCI with %d PDUs in sfn.slot %d/%d\n", uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); - NR_UL_IND_t UL_INFO = { + NR_UL_IND_t ul_info = { .uci_ind = *uci_ind, }; - send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); + send_nsa_standalone_msg(&ul_info, uci_ind->header.message_id); free_uci_inds(uci_ind); break; } From 221e8402cce3886867e10957d1a0661b36c3e033 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 10:14:16 -0800 Subject: [PATCH 500/883] Fixing spacing in lines were already changing --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 88d7342b5d..114250434c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1315,7 +1315,7 @@ int nr_acknack_scheduling(int mod_id, incorrectly schedule more than 2 ACK/nACKs in a single SFN/Slot. */ if ((pucch->frame == 0 && pucch->ul_slot == 0) || ((pucch->frame*n_slots_frame + pucch->ul_slot) < - (frame*n_slots_frame + slot)) && (frame!=1023)) { + (frame * n_slots_frame + slot)) && (frame != 1023)) { AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); From ca336ea9176271554f4a5f0297bf6df22089e52f Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 10:27:34 -0800 Subject: [PATCH 501/883] Fixing comments from MR review. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 57c74af314..47550597bc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -384,7 +384,7 @@ int nr_process_mac_pdu(module_id_t module_idP, return 0; if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ //mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) + if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) return 0; mac_subheader_len = 3; mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index dc3bc52e9e..6ea67fc8f1 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -683,8 +683,6 @@ static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_ dl_ind->dci_ind->dci_list[k].dci_format = rel15_dci->dci_format_options[j]; LOG_I(NR_PHY, "format assigned dl_ind->dci_ind->dci_list[k].dci_format %d\n", dl_ind->dci_ind->dci_list[k].dci_format); - dl_ind->dci_ind->dci_list[k].n_CCE = rel15_dci->CCE[j]; - dl_ind->dci_ind->dci_list[k].N_CCE = rel15_dci->L[j]; } } } @@ -1067,6 +1065,10 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t // L2 Abstraction Layer // Note: sdu should always be processed because data and timing advance updates are transmitted by the UE int8_t handle_dlsch(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){ + /* L1 assigns harq_pid, but in emulated L1 mode we need to assign + the harq_pid based on the saved global g_harq_pid. Because we are + emulating L1, no antenna measurements are conducted to calculate + a harq_pid, therefore we must set it here. */ if (get_softmodem_params()->emulate_l1) dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; @@ -1116,6 +1118,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test) nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); + if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type)) nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); From 6d9d1f0b9484afb378161249691f143312b46aac Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 19 Feb 2022 13:07:20 +0100 Subject: [PATCH 502/883] changes for 2.5ms TDD period --- executables/nr-ru.c | 17 ++++++---- executables/nr-softmodem.c | 4 +-- openair1/PHY/defs_RU.h | 4 ++- openair2/ENB_APP/enb_paramdef.h | 7 ++-- openair2/GNB_APP/MACRLC_nr_paramdef.h | 8 ++++- openair2/GNB_APP/gnb_config.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/config.c | 4 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 20 +++++++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 16 ++++++++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 33 +++++++++++-------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 ++ openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 17 +++++++--- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 9 +++-- openair2/RRC/NR/MESSAGES/asn1_msg.c | 8 +---- openair2/RRC/NR/nr_rrc_config.c | 23 +++++++++++-- 15 files changed, 122 insertions(+), 52 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 5de1f71efd..2f74c3524b 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -369,8 +369,8 @@ void fh_if4p5_south_in(RU_t *ru, proc->frame_rx = f; proc->timestamp_rx = (proc->frame_rx * fp->samples_per_subframe * 10) + fp->get_samples_slot_timestamp(proc->tti_rx, fp, 0); // proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_subframe); - proc->tti_tx = (sl+(fp->slots_per_subframe*ru->sf_ahead))%fp->slots_per_frame; - proc->frame_tx = (sl>(fp->slots_per_frame-1-(fp->slots_per_subframe*ru->sf_ahead))) ? (f+1)&1023 : f; + proc->tti_tx = (sl+ru->sl_ahead)%fp->slots_per_frame; + proc->frame_tx = (sl>(fp->slots_per_frame-1-(ru->sl_ahead))) ? (f+1)&1023 : f; if (proc->first_rx == 0) { if (proc->tti_rx != *slot) { @@ -1290,7 +1290,7 @@ void *ru_thread( void *param ) { } } - LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,ru->sf_ahead); + LOG_I(PHY, "Signaling main thread that RU %d is ready, sl_ahead %d\n",ru->idx,ru->sl_ahead); pthread_mutex_lock(&RC.ru_mutex); RC.ru_mask &= ~(1<idx); pthread_cond_signal(&RC.ru_cond); @@ -1376,9 +1376,12 @@ void *ru_thread( void *param ) { opp_enabled = opp_enabled0; } if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul); - proc->timestamp_tx = proc->timestamp_rx + (ru->sf_ahead*fp->samples_per_subframe); - proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*ru->sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; - proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*ru->sf_ahead))%fp->slots_per_frame; + proc->timestamp_tx = proc->timestamp_rx; + int sl=proc->tti_tx; + for (int slidx=0;slidxsl_ahead;slidx++) + proc->timestamp_tx += fp->get_samples_per_slot((sl+slidx)%fp->slots_per_frame,fp); + proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(ru->sl_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; + proc->tti_tx = (proc->tti_rx + ru->sl_ahead)%fp->slots_per_frame; LOG_D(PHY,"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0]:[RX:%d%d TX(SFN):%d]\n", frame,slot, proc->frame_rx,proc->tti_rx, @@ -2122,7 +2125,7 @@ static void NRRCconfig_RU(void) { RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr); RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr); RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr); - RC.ru[j]->sf_ahead = *(RUParamList.paramarray[j][RU_SF_AHEAD].iptr); + RC.ru[j]->sl_ahead = *(RUParamList.paramarray[j][RU_SL_AHEAD].iptr); RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; for (i=0; inum_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; RC.ru[j]->openair0_cfg.nr_flag = *(RUParamList.paramarray[j][RU_NR_FLAG].iptr); diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 6d59137f80..dc7b8bf8e3 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -772,8 +772,8 @@ int main( int argc, char **argv ) { for (ru_id=0; ru_idrf_map.card=0; RC.ru[ru_id]->rf_map.chain=CC_id+chain_offset; - if (ru_id==0) sl_ahead = RC.ru[ru_id]->sf_ahead * RC.gNB[0]->frame_parms.slots_per_subframe; - else AssertFatal(RC.ru[ru_id]->sf_ahead != RC.ru[0]->sf_ahead,"RU %d has different sf_ahead %d than RU 0 %d\n",RC.ru[ru_id]->sf_ahead,RC.ru[0]->sf_ahead); + if (ru_id==0) sl_ahead = RC.ru[ru_id]->sl_ahead; + else AssertFatal(RC.ru[ru_id]->sl_ahead != RC.ru[0]->sl_ahead,"RU %d has different sl_ahead %d than RU 0 %d\n",RC.ru[ru_id]->sl_ahead,RC.ru[0]->sl_ahead); } } diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 5dfb0722db..e70bb811b7 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -506,8 +506,10 @@ typedef struct RU_t_s { int att_tx; /// flag to indicate precoding operation in RU int do_precoding; - /// TX processing advance in subframes + /// TX processing advance in subframes (for LTE) int sf_ahead; + /// TX processing advance in slots (for NR) + int sl_ahead; /// FAPI confiuration nfapi_nr_config_request_scf_t config; /// Frame parameters diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 840e1a8ab2..a533b8cb23 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -100,6 +100,7 @@ typedef enum { #define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset" #define CONFIG_STRING_RU_DO_PRECODING "do_precoding" #define CONFIG_STRING_RU_SF_AHEAD "sf_ahead" +#define CONFIG_STRING_RU_SL_AHEAD "sl_ahead" #define CONFIG_STRING_RU_NR_FLAG "nr_flag" #define CONFIG_STRING_RU_NR_SCS_FOR_RASTER "nr_scs_for_raster" @@ -133,8 +134,9 @@ typedef enum { #define RU_IF_FREQ_OFFSET 27 #define RU_DO_PRECODING 28 #define RU_SF_AHEAD 29 -#define RU_NR_FLAG 30 -#define RU_NR_SCS_FOR_RASTER 31 +#define RU_SL_AHEAD 30 +#define RU_NR_FLAG 31 +#define RU_NR_SCS_FOR_RASTER 32 /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -170,6 +172,7 @@ typedef enum { {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_SF_AHEAD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_SL_AHEAD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_FLAG, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_SCS_FOR_RASTER, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ } diff --git a/openair2/GNB_APP/MACRLC_nr_paramdef.h b/openair2/GNB_APP/MACRLC_nr_paramdef.h index 436271fc0b..e634f077e2 100644 --- a/openair2/GNB_APP/MACRLC_nr_paramdef.h +++ b/openair2/GNB_APP/MACRLC_nr_paramdef.h @@ -65,6 +65,8 @@ #define CONFIG_STRING_MACRLC_DL_RD2_BLER_THRESHOLD "dl_rd2_bler_threshold" #define CONFIG_STRING_MACRLC_DL_MAX_MCS "dl_max_mcs" #define CONFIG_STRING_MACRLC_HARQ_ROUND_MAX "harq_round_max" +#define CONFIG_STRING_MACRLC_MIN_GRANT_PRB "min_grant_prb" +#define CONFIG_STRING_MACRLC_MIN_GRANT_MCS "min_grant_mcs" /*-------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* MacRLC configuration parameters */ @@ -97,7 +99,9 @@ {CONFIG_STRING_MACRLC_DL_BLER_TARGET_LOWER, "Lower threshold of BLER to increase DL MCS", 0, dblptr:NULL, defdblval:0.05, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_RD2_BLER_THRESHOLD, "Threshold of RD2/RETX2 BLER to decrease DL MCS", 0, dblptr:NULL, defdblval:0.01, TYPE_DOUBLE, 0}, \ {CONFIG_STRING_MACRLC_DL_MAX_MCS, "Maximum DL MCS that should be used", 0, u8ptr:NULL, defintval:28, TYPE_UINT8, 0}, \ -{CONFIG_STRING_MACRLC_HARQ_ROUND_MAX, "Maximum number of HARQ rounds", 0, u8ptr:NULL, defintval:4, TYPE_UINT8, 0} \ +{CONFIG_STRING_MACRLC_HARQ_ROUND_MAX, "Maximum number of HARQ rounds", 0, u8ptr:NULL, defintval:4, TYPE_UINT8, 0}, \ +{CONFIG_STRING_MACRLC_MIN_GRANT_PRB, "Minimal Periodic ULSCH Grant PRBs", 0, u8ptr:NULL, defintval:5, TYPE_UINT8, 0}, \ +{CONFIG_STRING_MACRLC_MIN_GRANT_MCS, "Minimal Periodic ULSCH Grant MCS", 0, u8ptr:NULL, defintval:9, TYPE_UINT8, 0} \ } #define MACRLC_CC_IDX 0 #define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1 @@ -126,5 +130,7 @@ #define MACRLC_DL_RD2_BLER_THRESHOLD_IDX 24 #define MACRLC_DL_MAX_MCS_IDX 25 #define MACRLC_HARQ_ROUND_MAX_IDX 26 +#define MACRLC_MIN_GRANT_PRB_IDX 27 +#define MACRLC_MIN_GRANT_MCS_IDX 28 /*---------------------------------------------------------------------------------------------------------------------------------------------------------*/ #endif diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 72237bf6c9..b088cf7ed1 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -811,6 +811,8 @@ void RCconfig_nr_macrlc() { RC.nrmac[j]->dl_rd2_bler_threshold = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_RD2_BLER_THRESHOLD_IDX].dblptr); RC.nrmac[j]->dl_max_mcs = *(MacRLC_ParamList.paramarray[j][MACRLC_DL_MAX_MCS_IDX].u8ptr); RC.nrmac[j]->harq_round_max = *(MacRLC_ParamList.paramarray[j][MACRLC_HARQ_ROUND_MAX_IDX].u8ptr); + RC.nrmac[j]->min_grant_prb = *(MacRLC_ParamList.paramarray[j][MACRLC_MIN_GRANT_PRB_IDX].u8ptr); + RC.nrmac[j]->min_grant_mcs = *(MacRLC_ParamList.paramarray[j][MACRLC_MIN_GRANT_MCS_IDX].u8ptr); RC.nrmac[j]->num_ulprbbl = num_prbbl; memcpy(RC.nrmac[j]->ulprbbl,prbbl,275*sizeof(prbbl[0])); }// for (j=0;jnrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0); for (int slot = 0; slot < n; ++slot) { - /* FIXME: it seems there is a problem with slot 0/10/slots right after UL: - * we just get retransmissions. Thus, do not schedule such slots in DL */ - if (slot % nr_slots_period != 0) + if (slot != 0) RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dlmix_slots) << (slot % 64); RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64); LOG_D(NR_MAC, "slot %d DL %d UL %d\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 4ddffc5184..c5ec5e04e8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -916,16 +916,23 @@ void nr_get_Msg3alloc(module_id_t module_id, int nb_slots_per_period = ((1<list.count; i++) { k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2; - // we want to transmit in the uplink symbols of mixed slot + int start_symbol_index,nr_of_symbols; + SLIV2SL(pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength, &start_symbol_index, &nr_of_symbols); + LOG_I(NR_MAC,"Checking Msg3 TDA %d : k2 %d, sliv %d,S %d L %d\n",i,(int)k2,(int)pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength,start_symbol_index,nr_of_symbols); + // we want to transmit in the uplink symbols of mixed slot AND assuming Msg2 was in the mixed slot if ((k2 + DELTA[mu])%nb_slots_per_period == 0) { temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 ra->Msg3_slot = temp_slot%nr_slots_per_frame[mu]; - if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot)) { + + if (is_xlsch_in_slot(RC.nrmac[module_id]->ulsch_slot_bitmap[ra->Msg3_slot / 64], ra->Msg3_slot) && + nr_of_symbols<=scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols&& + start_symbol_index>=(14-scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols)) { ra->Msg3_tda_id = i; break; } } } + AssertFatal(ra->Msg3_tda_id < 16, "Couldn't find an appropriate TD allocation for Msg3\n"); } else { ra->Msg3_tda_id = 0; @@ -953,7 +960,7 @@ void nr_get_Msg3alloc(module_id_t module_id, tdd_beam_association[num_tdd_period] = ra->beam_id; } - LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id); + LOG_I(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id); uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[ra->Msg3_slot * MAX_BWP_SIZE]; @@ -1021,7 +1028,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, pusch_pdu->data_scrambling_id = *scc->physCellId; pusch_pdu->nrOfLayers = 1; pusch_pdu->ul_dmrs_symb_pos = get_l_prime(nr_of_symbols,mappingtype,pusch_dmrs_pos2,pusch_len1,start_symbol_index, scc->dmrs_TypeA_Position); - LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , ul_dmrs_symb_pos:%x\n", start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos); + LOG_I(MAC, "MSG3 mcs %d, nb_rb %d, first_rb %d, start_sym:%d NR Symb:%d mappingtype:%d , ul_dmrs_symb_pos:%x\n", pusch_pdu->mcs_index,msg3_nb_rb,msg3_first_rb, start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos); pusch_pdu->dmrs_config_type = 0; pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId; //If provided and the PUSCH is not a msg3 PUSCH, otherwise, L2 should set this to physical cell id. pusch_pdu->scid = 0; //DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]. Should match what is sent in DCI 0_1, otherwise set to 0. @@ -1115,7 +1122,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t fh = ubwp->bwp_Dedicated->pusch_Config->choice.setup->frequencyHopping ? 1 : 0; } - LOG_D(NR_MAC, "Frame %d, Slot %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", + LOG_I(NR_MAC, "Frame %d, Slot %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", frameP, slotP, ra->Msg3_frame, @@ -1404,8 +1411,9 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_add_msg3(module_idP, CC_id, frameP, slotP, ra, (uint8_t *) &tx_req->TLVs[0].value.direct[0]); if(ra->cfra) { - LOG_I(NR_MAC, "Frame %d, Subframe %d: Setting RA-Msg3 reception for Frame %d Subframe %d\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot); + LOG_I(NR_MAC, "Frame %d, Subframe %d: Setting RA-Msg3 reception (CFRA) for SFN.Slot %d.%d\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot); } + else LOG_I(NR_MAC, "Frame %d, Subframe %d: Setting RA-Msg3 reception (CBRA) for SFN.Slot %d.%d\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot); T(T_GNB_MAC_DL_RAR_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(ra->RA_rnti), T_INT(frameP), T_INT(slotP), T_INT(0), T_BUFFER(&tx_req->TLVs[0].value.direct[0], tx_req->TLVs[0].length)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 689f621b86..a48a59b67b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -979,7 +979,6 @@ void nr_schedule_ue_spec(module_id_t module_id, gNB_MAC_INST *gNB_mac = RC.nrmac[module_id]; if (!is_xlsch_in_slot(gNB_mac->dlsch_slot_bitmap[slot / 64], slot)) return; - /* PREPROCESSOR */ gNB_mac->pre_processor_dl(module_id, frame, slot); @@ -1351,6 +1350,21 @@ void nr_schedule_ue_spec(module_id_t module_id, size); if (len == 0) break; + struct timespec time_request; + clock_gettime(CLOCK_REALTIME, &time_request); + if (lcid>=4) + LOG_D(NR_MAC, + "%4d.%2d [UE %04x]: Time %lu.%lu: %d bytes %s %d -> DLSCH (ndata %lu, remaining size %lu)\n", + frame, + slot, + rnti, + time_request.tv_sec, + time_request.tv_nsec, + len, + lcid < 4 ? "DCCH" : "DTCH", + lcid, + (unsigned long)ndata, + (unsigned long)size); header->R = 0; header->F = 1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index e54e1f203a..eb51f1ca26 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -463,12 +463,14 @@ int nr_process_mac_pdu(module_id_t module_idP, mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; mac_subheader_len = 2; } - - LOG_D(NR_MAC, "In %s: [UE %d] %d.%d : ULSCH -> UL-%s %d (gNB %d, %d bytes)\n", - __func__, - module_idP, + struct timespec time_request; + clock_gettime(CLOCK_REALTIME, &time_request); + LOG_D(NR_MAC, "[UE %x] %d.%d : Time %lu.%lu ULSCH -> UL-%s %d (gNB %d, %d bytes)\n", + UE_info->rnti[UE_id], frameP, slot, + time_request.tv_sec, + time_request.tv_nsec, rx_lcid<4?"DCCH":"DTCH", rx_lcid, module_idP, @@ -711,8 +713,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_info->mac_stats[UE_id].ulsch_DTX++; } if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) { - LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", - UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); + LOG_W(NR_MAC,"%d.%d Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n", + frameP,slotP,UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt); UE_info->UE_sched_ctrl[UE_id].ul_failure = 1; nr_mac_gNB_rrc_ul_failure(gnb_mod_idP,CC_idP,frameP,slotP,rntiP); } @@ -909,17 +911,22 @@ bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t const struct gNB_MAC_INST_s *nrmac = RC.nrmac[mod_id]; const NR_UE_sched_ctrl_t *sched_ctrl = &nrmac->UE_info.UE_sched_ctrl[UE_id]; - const int last_ul_sched = sched_ctrl->last_ul_frame * n + sched_ctrl->last_ul_slot; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; int num_slots_per_period; + int last_ul_slot,last_ul_sched; int tdd_period_len[8] = {500,625,1000,1250,2000,2500,5000,10000}; - if (tdd) + if (tdd) { // Force the default transmission in a full slot as early as possible in the UL portion of TDD period (last_ul_slot) num_slots_per_period = n*tdd_period_len[tdd->dl_UL_TransmissionPeriodicity]/10000; - else + last_ul_slot=1+tdd->nrofDownlinkSlots; + } + else { num_slots_per_period = n; + last_ul_slot = sched_ctrl->last_ul_slot; + } + last_ul_sched = sched_ctrl->last_ul_frame * n + last_ul_slot; const int diff = (now - last_ul_sched + 1024 * n) % (1024 * n); /* UE is to be scheduled if * (1) we think the UE has more bytes awaiting than what we scheduled @@ -1111,7 +1118,7 @@ void pf_ul(module_id_t module_id, gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; NR_UE_info_t *UE_info = &nrmac->UE_info; - const int min_rb = 5; + const int min_rb = nrmac->min_grant_prb; float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled int ue_array[MAX_MOBILES_PER_GNB]; @@ -1226,7 +1233,7 @@ void pf_ul(module_id_t module_id, || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) nr_set_pusch_semi_static(scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; - sched_pusch->mcs = 9; + sched_pusch->mcs = nrmac->min_grant_mcs; update_ul_ue_R_Qm(sched_pusch, ps); sched_pusch->rbStart = rbStart; sched_pusch->rbSize = min_rb; @@ -1252,7 +1259,7 @@ void pf_ul(module_id_t module_id, add_tail_nr_list(&UE_sched, UE_id); /* Calculate coefficient*/ - sched_pusch->mcs = 9; + sched_pusch->mcs = nrmac->min_grant_mcs; const uint32_t tbs = ul_pf_tbs[ps->mcs_table][sched_pusch->mcs]; coeff_ue[UE_id] = (float) tbs / ul_thr_ue[UE_id]; LOG_D(NR_MAC,"b %d, ul_thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", @@ -1401,7 +1408,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t if (tda < 0) return false; int K2 = get_K2(scc, sched_ctrl->active_ubwp, tda, mu); - const int sched_frame = frame + (slot + K2 >= nr_slots_per_frame[mu]); + const int sched_frame = (frame + (slot + K2 >= nr_slots_per_frame[mu]))&1023; const int sched_slot = (slot + K2) % nr_slots_per_frame[mu]; if (!is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot)) diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 417318f8a3..d78fe4e154 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -806,6 +806,8 @@ typedef struct gNB_MAC_INST_s { double dl_rd2_bler_threshold; uint8_t dl_max_mcs; uint8_t harq_round_max; + uint8_t min_grant_prb; + uint8_t min_grant_mcs; } gNB_MAC_INST; #endif /*__LAYER2_NR_MAC_GNB_H__ */ diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 5129d46ddc..1442a9af72 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -655,6 +655,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, if (entity->has_sdap == 1 && entity->has_sdapULheader == 1) offset = 1; // this is the offset of the SDAP header in bytes + message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, GTPV1U_GNB_TUNNEL_DATA_REQ, sizeof(gtpv1u_gnb_tunnel_data_req_t) + size @@ -673,7 +674,10 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, LOG_I(PDCP, "%s() (drb %d) SDAP header %2x\n",__func__, rb_id, buf[0]); sdap_gnb_ul_header_handler(buf[0]); // Handler for the UL gNB SDAP Header } - LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset); + struct timespec time_request; + clock_gettime(CLOCK_REALTIME, &time_request); + LOG_D(PDCP, "%s() (drb %d) Time %lu.%lu sending message to gtp size %d\n", __func__, rb_id, time_request.tv_sec,time_request.tv_nsec, + size-offset); itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p); } } @@ -725,7 +729,7 @@ rb_found: req->offset = GTPU_HEADER_OVERHEAD_MAX; req->rnti = ue->rnti; req->pdusession_id = rb_id; - LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", + LOG_I(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size); extern instance_t CUuniqInstance; itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p); @@ -733,8 +737,9 @@ rb_found: memblock = get_free_mem_block(size, __FUNCTION__); memcpy(memblock->data, buf, size); - - LOG_D(PDCP, "%s(): (srb %d) calling rlc_data_req size %d\n", __func__, rb_id, size); + struct timespec time_request; + clock_gettime(CLOCK_REALTIME, &time_request); + LOG_D(PDCP, "%s(): (rb %d) calling enqueue_rlc_data_req size %d at time %lu.%lu\n", __func__, rb_id, size,time_request.tv_sec,time_request.tv_nsec); //for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]); //printf("\n"); enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock); @@ -1342,7 +1347,9 @@ static boolean_t pdcp_data_req_drb( const sdu_size_t sdu_buffer_size, unsigned char *const sdu_buffer) { - LOG_D(PDCP, "%s() called, size %d\n", __func__, sdu_buffer_size); + struct timespec time_request; + clock_gettime(CLOCK_REALTIME, &time_request); + LOG_D(PDCP, "%s() called at time %lu.%lu, size %d\n", __func__, time_request.tv_sec,time_request.tv_nsec,sdu_buffer_size); nr_pdcp_ue_t *ue; nr_pdcp_entity_t *rb; int rnti = ctxt_pP->rnti; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 78e06d37e2..b9d617d2eb 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -462,9 +462,14 @@ static void deliver_sdu(void *_ue, nr_rlc_entity_t *entity, char *buf, int size) exit(1); rb_found: - LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n", - __FILE__, __LINE__, __FUNCTION__, ue->rnti, is_srb, rb_id, size); + if (is_srb==0) { + struct timespec time_request; + clock_gettime(CLOCK_REALTIME, &time_request); + LOG_D(RLC, "%s:%d:%s: delivering SDU Time %lu.%lu (rnti %d is_srb %d rb_id %d) size %d\n", + __FILE__, __LINE__, __FUNCTION__, time_request.tv_sec,time_request.tv_nsec, + ue->rnti, is_srb, rb_id, size); + } /* unused fields? */ ctx.instance = 0; ctx.frame = 0; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 65f835d3fd..4eb5b06585 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1051,7 +1051,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); pucchres0->pucch_ResourceId=0; //pucchres0->startingPRB=0; - pucchres0->startingPRB=(8+rnti) % curr_bwp; + pucchres0->startingPRB=(8+rnti) % (curr_bwp/2); LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp); pucchres0->intraSlotFrequencyHopping=NULL; pucchres0->secondHopPRB=NULL; @@ -1260,14 +1260,8 @@ void fill_initial_SpCellConfig(rnti_t rnti, schedulingRequestResourceConfig->schedulingRequestID= 0; schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset)); schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40; - // note: make sure that there is no issue here. Later choose the RNTI accordingly. - // Here we would be limited to 3 UEs on this resource (1 1/2 Frames 30 kHz SCS, 5 ms TDD periodicity => slots 7,8,9). - // This should be a temporary resource until the first RRCReconfiguration gives new pucch resources. - // Check for above configuration and exit for now if it is not the case AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30, "SCS != 30kHz\n"); - AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity==NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5, - "TDD period != 5ms : %ld\n",scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity); schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8; schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource)); diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 6b7f9a21b9..af1fb92247 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -62,12 +62,30 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ //TODO change to accomodate for SRS - int temp_min_delay = 6; // k2 = 2 or 3 won'r work as well as higher values + lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + int temp_min_delay; + if(frame_type==TDD && scc->tdd_UL_DL_ConfigurationCommon) { + + switch (scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity) { + default: + temp_min_delay = 6; + break; + case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms2p5: // 30kHz SCS + case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms2: // 60kHz SCS + case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms1p25: // 60kHz SCS + case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms1: // 120kHz SCS + case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms0p625: // 120kHz SCS + case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms0p5: // 120kHz SCS + temp_min_delay = 2; + break; + } + } + + int k2 = (min_fb_delayuplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); @@ -77,6 +95,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ ASN_SEQUENCE_ADD(&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list,pusch_timedomainresourceallocation); if(frame_type==TDD) { + // TDD if(scc->tdd_UL_DL_ConfigurationCommon) { int ul_symb = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols; From 7c652df820ad6cc646da1303699d8403054ae09e Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 20 Feb 2022 15:56:56 +0100 Subject: [PATCH 503/883] nr rlc: bugfix - so_end was used instead of sn_end --- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index d7923e5490..aaa4faf58c 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -1044,7 +1044,7 @@ next_pdu: set_end_different_sdu: /* don't go more than rx_highest_status - 1 */ if (sn_compare_rx(entity, entity->rx_highest_status, cur->sn) <= 0) { - ret.so_end = (entity->rx_highest_status - 1 + entity->sn_modulus) % + ret.sn_end = (entity->rx_highest_status - 1 + entity->sn_modulus) % entity->sn_modulus; ret.so_end = 0xffff; return ret; From 78f0c8ff29796ee67cb53f88f4e8ae25c321011d Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 20 Feb 2022 16:00:54 +0100 Subject: [PATCH 504/883] nr rlc: harmonize computation of sn_count Functions generate_missing() and missing_size() had different computations of sn_count. Not sure if it is a problem or not, but let's do the same in both functions. Hopefully the computation is correct. --- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index aaa4faf58c..af8cb5715a 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -1305,9 +1305,8 @@ static int missing_size(nr_rlc_entity_am_t *entity, missing_data_t *m, missing_data_t m_nack; /* be careful to limit a range to 255 SNs, that is: cut if needed */ - sn_count = m->sn_end - m->sn_start + 1; - if (sn_count < 0) - sn_count += entity->sn_modulus; + sn_count = (m->sn_end - m->sn_start + entity->sn_modulus) + % entity->sn_modulus + 1; sn_start = m->sn_start; From 67b299e3410acb59924e182e4aa1ff705161efc2 Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Mon, 21 Feb 2022 10:29:06 +0100 Subject: [PATCH 505/883] fix a warning in assertions.h, appear only with some gcc versions --- common/utils/assertions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index 57c50a65e0..c80a306645 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -35,7 +35,7 @@ char tmp [1000]; \ sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d > /tmp/full_stacks.%d < /dev/null", \ getpid(), getpid()); \ - system(tmp); \ + __attribute__((unused)) int dummy=system(tmp); \ } \ fprintf(stderr, "\nExiting execution\n"); \ fflush(stdout); \ From 9b4a7526ad457623eff1e0924665b8f7442ebd59 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 21 Feb 2022 15:26:00 +0530 Subject: [PATCH 506/883] Fix incorrect merge --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 6 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 65 +----- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 206 +++++++++--------- 3 files changed, 117 insertions(+), 160 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 081aa39019..7d9f123050 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -718,9 +718,9 @@ int main(int argc, char *argv[]) (double)time_decoder->diff/time_decoder->trials/1000.0/get_cpu_freq_GHz(), sqrt((double)time_decoder->diff_square/time_decoder->trials/pow(1000,2)/pow(get_cpu_freq_GHz(),2)-pow((double)time_decoder->diff/time_decoder->trials/1000.0/get_cpu_freq_GHz(),2)), (double)time_decoder->max/1000.0/get_cpu_freq_GHz(), - dec_iter.n_iter_mean[i], - dec_iter.n_iter_std[i], - dec_iter.n_iter_max[i] + dec_iter.n_iter_mean[i], + dec_iter.n_iter_std[i], + dec_iter.n_iter_max[i] ); i=i+1; diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index 9cd5d8a96e..d79f2821b3 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -105,7 +105,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint { NR_gNB_ULSCH_t *ulsch; - uint8_t exit_flag = 0,i,r; + uint8_t i,r; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated if (N_RB_UL != 273) { @@ -116,63 +116,22 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint uint16_t ulsch_bytes = a_segments*1056; // allocated bytes per segment ulsch = (NR_gNB_ULSCH_t *)malloc16(sizeof(NR_gNB_ULSCH_t)); - if (ulsch) { + ulsch->max_ldpc_iterations = max_ldpc_iterations; + ulsch->Mlimit = 4; - memset(ulsch,0,sizeof(NR_gNB_ULSCH_t)); + for (i=0; imax_ldpc_iterations = max_ldpc_iterations; - ulsch->Mlimit = 4; - - for (i=0; iharq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16(sizeof(NR_UL_gNB_HARQ_t)); - - if (ulsch->harq_processes[i]) { - - memset(ulsch->harq_processes[i],0,sizeof(NR_UL_gNB_HARQ_t)); - - ulsch->harq_processes[i]->b = (uint8_t*)malloc16(ulsch_bytes); - - if (ulsch->harq_processes[i]->b) - memset(ulsch->harq_processes[i]->b,0,ulsch_bytes); - else - exit_flag=3; - - if (abstraction_flag == 0) { - for (r=0; rharq_processes[i]->c[r] = (uint8_t*)malloc16(8448*sizeof(uint8_t)); - - if (ulsch->harq_processes[i]->c[r]) - memset(ulsch->harq_processes[i]->c[r],0,8448*sizeof(uint8_t)); - else - exit_flag=2; - - ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16((68*384)*sizeof(int16_t)); - - if (ulsch->harq_processes[i]->d[r]) - memset(ulsch->harq_processes[i]->d[r],0,(68*384)*sizeof(int16_t)); - else - exit_flag=2; - - ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16((3*(6144+64))*sizeof(int16_t)); - - if (ulsch->harq_processes[i]->w[r]) - memset(ulsch->harq_processes[i]->w[r],0,(3*(6144+64))*sizeof(int16_t)); - else - exit_flag=2; - } - } - } else { - exit_flag=1; + ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t)); + ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes); + if (abstraction_flag == 0) { + for (r=0; rharq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t)); + ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t)); + ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t)); } } - - if (exit_flag==0) - return(ulsch); } - printf("new_gNB_ulsch with size %zu: exit_flag = %hhu\n",sizeof(NR_UL_gNB_HARQ_t), exit_flag); - free_gNB_ulsch(&ulsch,N_RB_UL); + return(NULL); } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index bd1e2b03e1..83a208018e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -312,126 +312,124 @@ void nr_processDLSegment(void* arg) { t_nrLDPC_time_stats procTime = {0}; t_nrLDPC_time_stats* p_procTime = &procTime ; - t_nrLDPC_procBuf **p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf; + start_meas(&rdata->ts_deinterleave); + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN); + nr_deinterleaving_ldpc(E, + Qm, + harq_process->w[r], // [hna] w is e + dlsch_llr+r_offset); + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT); + stop_meas(&rdata->ts_deinterleave); - start_meas(&rdata->ts_deinterleave); - //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN); - nr_deinterleaving_ldpc(E, - Qm, - harq_process->w[r], // [hna] w is e - dlsch_llr+r_offset); - //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT); - stop_meas(&rdata->ts_deinterleave); + start_meas(&rdata->ts_rate_unmatch); + /* LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,E %d, F %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n", + harq_pid,r, G,E,harq_process->F, + Kr*3, + harq_process->TBS, + Qm, + harq_process->nb_rb, + harq_process->Nl, + harq_process->rvidx, + harq_process->round); */ + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN); - start_meas(&rdata->ts_rate_unmatch); - /* LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,E %d, F %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n", - harq_pid,r, G,E,harq_process->F, - Kr*3, - harq_process->TBS, - Qm, - harq_process->nb_rb, - harq_process->Nl, - harq_process->rvidx, - harq_process->round); */ - //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN); - - if (nr_rate_matching_ldpc_rx(Ilbrm, - Tbslbrm, - p_decoderParms->BG, - p_decoderParms->Z, - harq_process->d[r], - harq_process->w[r], - harq_process->C, - harq_process->rvidx, - (harq_process->first_rx==1)?1:0, - E, - harq_process->F, - Kr-harq_process->F-2*(p_decoderParms->Z))==-1) { - //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT); - stop_meas(&rdata->ts_rate_unmatch); - LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n"); - rdata->decodeIterations = dlsch->max_ldpc_iterations + 1; - return; - } + if (nr_rate_matching_ldpc_rx(Ilbrm, + Tbslbrm, + p_decoderParms->BG, + p_decoderParms->Z, + harq_process->d[r], + harq_process->w[r], + harq_process->C, + harq_process->rvidx, + (harq_process->first_rx==1)?1:0, + E, + harq_process->F, + Kr-harq_process->F-2*(p_decoderParms->Z))==-1) { + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT); stop_meas(&rdata->ts_rate_unmatch); + LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n"); + rdata->decodeIterations = dlsch->max_ldpc_iterations + 1; + return; + } + stop_meas(&rdata->ts_rate_unmatch); - r_offset += E; + r_offset += E; - if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD)) { - LOG_D(PHY,"decoder input(segment %u) :",r); + if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD)) { + LOG_D(PHY,"decoder input(segment %u) :",r); - for (int i=0; id[r][i]); + for (int i=0; id[r][i]); - LOG_D(PHY,"\n"); + LOG_D(PHY,"\n"); + } + + memset(harq_process->c[r],0,Kr_bytes); + + if (harq_process->C == 1) { + if (A > NR_MAX_PDSCH_TBS) + crc_type = CRC24_A; + else + crc_type = CRC16; + + length_dec = harq_process->B; + } else { + crc_type = CRC24_B; + length_dec = (harq_process->B+24*harq_process->C)/harq_process->C; + } + + { + start_meas(&rdata->ts_ldpc_decode); + //set first 2*Z_c bits to zeros + memset(&z[0],0,2*harq_process->Z*sizeof(int16_t)); + //set Filler bits + memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t)); + //Move coded bits before filler bits + memcpy((&z[0]+2*harq_process->Z),harq_process->d[r],(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); + //skip filler bits + memcpy((&z[0]+Kr),harq_process->d[r]+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); + + //Saturate coded bits before decoding into 8 bits values + for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) { + pl[j] = _mm_packs_epi16(pv[i],pv[i+1]); } - memset(harq_process->c[r],0,Kr_bytes); + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_IN); + p_decoderParms->block_length=length_dec; + nrLDPC_initcall(p_decoderParms, (int8_t*)&pl[0], llrProcBuf); + no_iteration_ldpc = nrLDPC_decoder(p_decoderParms, + (int8_t *)&pl[0], + llrProcBuf, + p_procTime); + //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT); - if (harq_process->C == 1) { - if (A > NR_MAX_PDSCH_TBS) - crc_type = CRC24_A; - else - crc_type = CRC16; + // Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int + if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) { + LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r); - length_dec = harq_process->B; + if (r==0) { + for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]); + } + + //Temporary hack + no_iteration_ldpc = dlsch->max_ldpc_iterations; + rdata->decodeIterations = no_iteration_ldpc; } else { - crc_type = CRC24_B; - length_dec = (harq_process->B+24*harq_process->C)/harq_process->C; + LOG_D(PHY,"CRC NOT OK\n\033[0m"); } - { - start_meas(&rdata->ts_ldpc_decode); - //set first 2*Z_c bits to zeros - memset(&z[0],0,2*harq_process->Z*sizeof(int16_t)); - //set Filler bits - memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t)); - //Move coded bits before filler bits - memcpy((&z[0]+2*harq_process->Z),harq_process->d[r],(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); - //skip filler bits - memcpy((&z[0]+Kr),harq_process->d[r]+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); + nb_total_decod++; - //Saturate coded bits before decoding into 8 bits values - for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) { - pl[j] = _mm_packs_epi16(pv[i],pv[i+1]); - } - - //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_IN); - p_decoderParms->block_length=length_dec; - nrLDPC_initcall(p_decoderParms, (int8_t*)&pl[0], llrProcBuf); - no_iteration_ldpc = nrLDPC_decoder(p_decoderParms, - (int8_t *)&pl[0], - llrProcBuf, - p_procTime); - //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT); - - // Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int - if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) { - LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r); - - if (r==0) { - for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]); - } - - //Temporary hack - no_iteration_ldpc = dlsch->max_ldpc_iterations; - rdata->decodeIterations = no_iteration_ldpc; - } else { - LOG_D(PHY,"CRC NOT OK\n\033[0m"); - } - - nb_total_decod++; - - if (no_iteration_ldpc > dlsch->max_ldpc_iterations) { - nb_error_decod++; - } - - for (int m=0; m < Kr>>3; m ++) { - harq_process->c[r][m]= (uint8_t) llrProcBuf[m]; - } - - stop_meas(&rdata->ts_ldpc_decode); + if (no_iteration_ldpc > dlsch->max_ldpc_iterations) { + nb_error_decod++; } + + for (int m=0; m < Kr>>3; m ++) { + harq_process->c[r][m]= (uint8_t) llrProcBuf[m]; + } + + stop_meas(&rdata->ts_ldpc_decode); + } } uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, From f448f8021f5b17720464056239543a191078317a Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 21 Feb 2022 15:28:38 +0530 Subject: [PATCH 507/883] removed init function --- .../CODING/nrLDPC_decoder/nrLDPC_init_mem.h | 83 ------------------- openair1/PHY/CODING/nrLDPC_extern.h | 1 - 2 files changed, 84 deletions(-) delete mode 100644 openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h deleted file mode 100644 index f08549130e..0000000000 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h +++ /dev/null @@ -1,83 +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 nrLDPC_init_mem.h - * \brief Defines the function to initialize the LDPC decoder and sets correct LUTs. - * \author Sebastian Wagner (TCL Communications) Email: - * \date 07-12-2018 - * \version 1.0 - * \note - * \warning - */ - -#ifndef __NR_LDPC_INIT_MEM__H__ -#define __NR_LDPC_INIT_MEM__H__ - -#include -#include "nrLDPC_types.h" - -/** - \brief Allocates 32 byte aligned memory and initializes to zero - \param size Input size in bytes - \return Pointer to memory -*/ -static inline void* malloc32_clear(size_t size) -{ - void* ptr = (void*) memalign(32, size+32); - memset(ptr, 0, size); - return ptr; -} - -/** - \brief Allocates and initializes the internal decoder processing buffers - \param p_decParams Pointer to decoder parameters - \param p_lut Pointer to decoder LUTs - \return Number of LLR values -*/ -static inline t_nrLDPC_procBuf* nrLDPC_init_mem(void) -{ - t_nrLDPC_procBuf* p_procBuf = (t_nrLDPC_procBuf*) malloc32_clear(sizeof(t_nrLDPC_procBuf)); - - if (p_procBuf) - { - p_procBuf->cnProcBuf = (int8_t*) malloc32_clear(NR_LDPC_SIZE_CN_PROC_BUF*sizeof(int8_t)); - p_procBuf->cnProcBufRes = (int8_t*) malloc32_clear(NR_LDPC_SIZE_CN_PROC_BUF*sizeof(int8_t)); - p_procBuf->bnProcBuf = (int8_t*) malloc32_clear(NR_LDPC_SIZE_BN_PROC_BUF*sizeof(int8_t)); - p_procBuf->bnProcBufRes = (int8_t*) malloc32_clear(NR_LDPC_SIZE_BN_PROC_BUF*sizeof(int8_t)); - p_procBuf->llrRes = (int8_t*) malloc32_clear(NR_LDPC_MAX_NUM_LLR *sizeof(int8_t)); - p_procBuf->llrProcBuf = (int8_t*) malloc32_clear(NR_LDPC_MAX_NUM_LLR *sizeof(int8_t)); - } - - return(p_procBuf); -} - -static inline void nrLDPC_free_mem(t_nrLDPC_procBuf* p_procBuf) -{ - free(p_procBuf->cnProcBuf); - free(p_procBuf->cnProcBufRes); - free(p_procBuf->bnProcBuf); - free(p_procBuf->bnProcBufRes); - free(p_procBuf->llrRes); - free(p_procBuf->llrProcBuf); - - free(p_procBuf); -} -#endif diff --git a/openair1/PHY/CODING/nrLDPC_extern.h b/openair1/PHY/CODING/nrLDPC_extern.h index b75b38fc76..b358119408 100644 --- a/openair1/PHY/CODING/nrLDPC_extern.h +++ b/openair1/PHY/CODING/nrLDPC_extern.h @@ -34,5 +34,4 @@ extern nrLDPC_initcallfunc_t nrLDPC_initcall; extern nrLDPC_decoderfunc_t nrLDPC_decoder; extern nrLDPC_encoderfunc_t nrLDPC_encoder; // inline functions: -#include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h" #endif From f6e25c0e151c76ed471c41901de1f39d4c872c0c Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 21 Feb 2022 16:41:18 +0530 Subject: [PATCH 508/883] code cleanup ldpctest.c --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 221 +++++++++-------------- 1 file changed, 87 insertions(+), 134 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 7d9f123050..70eb795c5a 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -91,7 +91,7 @@ nrLDPC_encoderfunc_t encoder_orig; short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384}; -int test_ldpc(short No_iteration, +int test_ldpc(short max_iterations, int nom_rate, int denom_rate, double SNR, @@ -131,7 +131,6 @@ int test_ldpc(short No_iteration, double *channel_output; double *modulated_input[MAX_NUM_DLSCH_SEGMENTS]; char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS]; - unsigned int i,j,trial=0; short BG=0,nrows=0;//,ncols; int no_punctured_columns,removed_bit; int i1,Zc,Kb=0; @@ -142,10 +141,9 @@ int test_ldpc(short No_iteration, int code_rate_vec[8] = {15, 13, 25, 12, 23, 34, 56, 89}; //double code_rate_actual_vec[8] = {0.2, 0.33333, 0.4, 0.5, 0.66667, 0.73333, 0.81481, 0.88}; - t_nrLDPC_dec_params decParams; - + t_nrLDPC_dec_params decParams[MAX_NUM_DLSCH_SEGMENTS]={0}; + t_nrLDPC_time_stats decoder_profiler = {0}; - t_nrLDPC_time_stats* p_decoder_profiler =&decoder_profiler ; int32_t n_iter = 0; @@ -155,26 +153,26 @@ int test_ldpc(short No_iteration, *crc_misses=0; // generate input block - for(j=0;j>3; i++) - { - //printf("block_length>>3: %d \n",block_length>>3); - /// printf("i: %d \n",i); - ///printf("estimated_output[%d]: %d \n",i,estimated_output[i]); - ///printf("test_input[0][%d]: %d \n",i,test_input[0][i]); - if (estimated_output[j][i] != test_input[j][i]) - { - //////printf("error pos %d (%d, %d)\n\n",i,estimated_output[i],test_input[0][i]); - segment_bler = segment_bler + 1; - break; } - } + +#ifdef DEBUG_CODER + printf("\n"); + exit(-1); +#endif - for (i=0; i>(i&7); test_input_bit[i] = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments @@ -430,23 +398,18 @@ int test_ldpc(short No_iteration, } } - //if (*errors == 1000) - //break; + n_iter_mean += n_iter; + n_iter_std += pow(n_iter-1,2); - n_iter_mean = n_iter_mean + n_iter; - n_iter_std = n_iter_std + pow(n_iter-1,2); + if ( n_iter > n_iter_max ) + n_iter_max = n_iter; - if ( n_iter > n_iter_max ) - n_iter_max = n_iter; - - } // end segments + } // end segments if (segment_bler != 0) - *errors = (*errors) + 1; + *errors = (*errors) + 1; } - /*else if (trial==0) - printf("decoder is not supported\n");*/ } @@ -456,7 +419,7 @@ int test_ldpc(short No_iteration, *errors_bit_uncoded = *errors_bit_uncoded / (double)((Kb+nrows-no_punctured_columns-2) * Zc-removed_bit); - for(j=0;j 1280, 2401 -> 2560 char *ldpc_version=NULL; /* version of the ldpc decoder library to use (XXX suffix to use when loading libldpc_XXX.so */ - short No_iteration=5; + short max_iterations=5; int n_segments=1; //double rate=0.333; @@ -511,7 +474,7 @@ int main(int argc, char *argv[]) unsigned char qbits=8; unsigned int decoded_errors[10000]; // initiate the size of matrix equivalent to size of SNR int c,i=0, i1 = 0; - int loglvl=OAILOG_WARNING; + int n_trials = 1; double SNR_step = 0.1; @@ -522,11 +485,8 @@ int main(int argc, char *argv[]) n_iter_stats_t dec_iter; short BG=0,Zc,Kb=0; - if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) { - exit_fun(" Error, configuration module init failed\n"); - } // must be done before specific options parsing to prevent errasing them - - while ((c = getopt (argc, argv, "q:r:s:S:l:L:G:n:d:i:t:u:hv:")) != -1) + + while ((c = getopt (argc, argv, "q:r:s:S:l:G:n:d:i:t:u:hv:")) != -1) switch (c) { case 'q': @@ -544,10 +504,6 @@ int main(int argc, char *argv[]) case 'l': block_length = atoi(optarg); break; - - case 'L': - loglvl = atoi(optarg); - break; case 'G': ldpc_version="_cuda"; @@ -570,7 +526,7 @@ int main(int argc, char *argv[]) break; case 'i': - No_iteration = atoi(optarg); + max_iterations = atoi(optarg); break; case 'u': @@ -585,11 +541,10 @@ int main(int argc, char *argv[]) printf("BG1 (blocklength > 3840): 1/3, 2/3, 22/25 (8/9) \n"); printf("BG2 (blocklength <= 3840): 1/5, 1/3, 2/3 \n\n"); printf("-h This message\n"); - printf("-L \n"); printf("-q Quantization bits, Default: 8\n"); printf("-r Nominator rate, (1, 2, 22), Default: 1\n"); printf("-d Denominator rate, (3, 5, 25), Default: 1\n"); - printf("-l Block length (l > 3840 -> BG1, rest BG2 ), Default: 8448\n"); + printf("-l Block length (l > 3840 -> BG1, rest BG2 ), Default: 8448\n"); printf("-G give 1 to run cuda for LDPC, Default: 0\n"); printf("-n Number of simulation trials, Default: 1\n"); //printf("-M MCS2 for TB 2\n"); @@ -608,8 +563,6 @@ int main(int argc, char *argv[]) printf("n_trials %d: \n", n_trials); printf("SNR0 %f: \n", SNR0); - logInit(); - set_glog(loglvl); if (ldpc_version != NULL) load_nrLDPClib(ldpc_version); @@ -657,7 +610,7 @@ int main(int argc, char *argv[]) } char fname[200]; - sprintf(fname,"ldpctest_BG_%d_Zc_%d_rate_%d-%d_block_length_%d_maxit_%d.txt",BG,Zc,nom_rate,denom_rate,block_length, No_iteration); + sprintf(fname,"ldpctest_BG_%d_Zc_%d_rate_%d-%d_block_length_%d_maxit_%d.txt",BG,Zc,nom_rate,denom_rate,block_length, max_iterations); FILE *fd=fopen(fname,"w"); AssertFatal(fd!=NULL,"cannot open %s\n",fname); @@ -672,7 +625,7 @@ int main(int argc, char *argv[]) else SNR_lin = pow(10,SNR/10.0)*nom_rate/denom_rate; printf("Linear SNR: %f\n", SNR_lin); - decoded_errors[i]=test_ldpc(No_iteration, + decoded_errors[i]=test_ldpc(max_iterations, nom_rate, denom_rate, SNR_lin, // noise standard deviation @@ -718,9 +671,9 @@ int main(int argc, char *argv[]) (double)time_decoder->diff/time_decoder->trials/1000.0/get_cpu_freq_GHz(), sqrt((double)time_decoder->diff_square/time_decoder->trials/pow(1000,2)/pow(get_cpu_freq_GHz(),2)-pow((double)time_decoder->diff/time_decoder->trials/1000.0/get_cpu_freq_GHz(),2)), (double)time_decoder->max/1000.0/get_cpu_freq_GHz(), - dec_iter.n_iter_mean[i], - dec_iter.n_iter_std[i], - dec_iter.n_iter_max[i] + dec_iter.n_iter_mean[i], + dec_iter.n_iter_std[i], + dec_iter.n_iter_max[i] ); i=i+1; From 923edebd3cc6f823441ceaf7c8a6183b6d21751c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 14 Dec 2021 17:00:35 +0100 Subject: [PATCH 509/883] Enable Address Sanitizer on physical simulators - install libasan in physim containers - run physim containers with SYS_CAP_PTRACE capability - remove static-libasan: not available in RHEL8: The physims are tested in a container environment on top of RHEL8. To my knowledge, no package provides the static ASan library there. Therefore, remove it here to be able to run these tests. --- charts/physims/charts/dlsim/values.yaml | 4 +++- charts/physims/charts/ldpctest/values.yaml | 4 +++- charts/physims/charts/nr-dlschsim/values.yaml | 4 +++- charts/physims/charts/nr-dlsim/values.yaml | 4 +++- charts/physims/charts/nr-pbchsim/values.yaml | 4 +++- charts/physims/charts/nr-prachsim/values.yaml | 4 +++- charts/physims/charts/nr-pucchsim/values.yaml | 4 +++- charts/physims/charts/nr-ulschsim/values.yaml | 4 +++- charts/physims/charts/nr-ulsim/values.yaml | 4 +++- charts/physims/charts/polartest/values.yaml | 4 +++- charts/physims/charts/smallblocktest/values.yaml | 4 +++- charts/physims/charts/ulsim/values.yaml | 4 +++- cmake_targets/CMakeLists.txt | 4 ++-- docker/Dockerfile.phySim.rhel8.2 | 6 +++++- 14 files changed, 43 insertions(+), 15 deletions(-) diff --git a/charts/physims/charts/dlsim/values.yaml b/charts/physims/charts/dlsim/values.yaml index c0142b50ae..d78fbb7409 100644 --- a/charts/physims/charts/dlsim/values.yaml +++ b/charts/physims/charts/dlsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/ldpctest/values.yaml b/charts/physims/charts/ldpctest/values.yaml index 91eab91af5..e2e6467923 100644 --- a/charts/physims/charts/ldpctest/values.yaml +++ b/charts/physims/charts/ldpctest/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-dlschsim/values.yaml b/charts/physims/charts/nr-dlschsim/values.yaml index e96541102c..8944e7e724 100644 --- a/charts/physims/charts/nr-dlschsim/values.yaml +++ b/charts/physims/charts/nr-dlschsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-dlsim/values.yaml b/charts/physims/charts/nr-dlsim/values.yaml index c86fc96cff..573e8630de 100644 --- a/charts/physims/charts/nr-dlsim/values.yaml +++ b/charts/physims/charts/nr-dlsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-pbchsim/values.yaml b/charts/physims/charts/nr-pbchsim/values.yaml index 62d89f9632..28c4678334 100644 --- a/charts/physims/charts/nr-pbchsim/values.yaml +++ b/charts/physims/charts/nr-pbchsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-prachsim/values.yaml b/charts/physims/charts/nr-prachsim/values.yaml index 3ea9787f7a..9e3c68b54d 100644 --- a/charts/physims/charts/nr-prachsim/values.yaml +++ b/charts/physims/charts/nr-prachsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-pucchsim/values.yaml b/charts/physims/charts/nr-pucchsim/values.yaml index cf50c0bd3c..449670f713 100644 --- a/charts/physims/charts/nr-pucchsim/values.yaml +++ b/charts/physims/charts/nr-pucchsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-ulschsim/values.yaml b/charts/physims/charts/nr-ulschsim/values.yaml index 420b154596..a3afc090e8 100644 --- a/charts/physims/charts/nr-ulschsim/values.yaml +++ b/charts/physims/charts/nr-ulschsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/nr-ulsim/values.yaml b/charts/physims/charts/nr-ulsim/values.yaml index 7eb8e33fcb..2bf96498e8 100644 --- a/charts/physims/charts/nr-ulsim/values.yaml +++ b/charts/physims/charts/nr-ulsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/polartest/values.yaml b/charts/physims/charts/polartest/values.yaml index 496dc8afba..e0a532fdd8 100644 --- a/charts/physims/charts/polartest/values.yaml +++ b/charts/physims/charts/polartest/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/smallblocktest/values.yaml b/charts/physims/charts/smallblocktest/values.yaml index 9dd791265f..f2f113d9b6 100644 --- a/charts/physims/charts/smallblocktest/values.yaml +++ b/charts/physims/charts/smallblocktest/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/charts/physims/charts/ulsim/values.yaml b/charts/physims/charts/ulsim/values.yaml index f5110989d8..35dc14d596 100644 --- a/charts/physims/charts/ulsim/values.yaml +++ b/charts/physims/charts/ulsim/values.yaml @@ -33,7 +33,9 @@ podSecurityContext: securityContext: privileged: true - # capabilities: + capabilities: + add: + - SYS_CAP_PTRACE # drop: # - ALL # readOnlyRootFilesystem: true diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 82022da78f..a4624066ae 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -343,8 +343,8 @@ set(CMAKE_CXX_FLAGS if (SANITIZE_ADDRESS) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common") endif () add_definitions("-DASN_DISABLE_OER_SUPPORT") diff --git a/docker/Dockerfile.phySim.rhel8.2 b/docker/Dockerfile.phySim.rhel8.2 index 9f4b27ec0e..15a363b05b 100644 --- a/docker/Dockerfile.phySim.rhel8.2 +++ b/docker/Dockerfile.phySim.rhel8.2 @@ -31,11 +31,14 @@ RUN rm -Rf /oai-ran WORKDIR /oai-ran COPY . . +#only install address sanitizer for this container, the others don't need it +RUN yum install -y libasan + #run build_oai to build the target image RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - ./build_oai --phy_simulators --ninja --verbose-ci + ./build_oai --phy_simulators -g --ninja --verbose-ci --sanitize-address #start from scratch for target executable FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim @@ -85,6 +88,7 @@ COPY --from=phy-sim-build \ /lib64/liblapack.so.3 \ /lib64/libexslt.so.0 \ /lib64/libxslt.so.1 \ + /usr/lib64/libasan.so.5 \ /oai-ran/cmake_targets/ran_build/build/libdfts.so \ /oai-ran/cmake_targets/ran_build/build/libSIMU.so \ /oai-ran/cmake_targets/ran_build/build/libldpc.so \ From ac0af5a84ed9950547720ae79f0cee216c179849 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 13 Feb 2022 15:48:36 +0100 Subject: [PATCH 510/883] Fix shlib loaded: free memory, handle lib reload - introduce loader_reset() that frees all memory - resolve memory leak in loader_format_shlibpath() - correctly handle library reload: check if a function has been retrieved already. Don't leak memory (strdup()), and handle multiple reloads of different functions from the same SO --- common/utils/load_module_shlib.c | 71 ++++++++++++++++++++------- common/utils/load_module_shlib.h | 2 + openair1/SIMULATION/NR_PHY/dlschsim.c | 3 ++ 3 files changed, 58 insertions(+), 18 deletions(-) diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c index 2b0d339358..f5a52d0626 100644 --- a/common/utils/load_module_shlib.c +++ b/common/utils/load_module_shlib.c @@ -69,7 +69,6 @@ char *loader_format_shlibpath(char *modname, char *version) char *tmpstr; char *shlibpath =NULL; char *shlibversion=NULL; -char *cfgprefix; paramdef_t LoaderParams[] ={{"shlibpath", NULL, 0, strptr:&shlibpath, defstrval:NULL, TYPE_STRING, 0, NULL}, {"shlibversion", NULL, 0, strptr:&shlibversion, defstrval:"", TYPE_STRING, 0, NULL}}; @@ -81,16 +80,11 @@ int ret; /* looks for specific path for this module in the config file */ /* specific value for a module path and version is located in a modname subsection of the loader section */ /* shared lib name is formatted as lib.so */ - cfgprefix = malloc(sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16); - if (cfgprefix == NULL) { - fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno)); - exit_fun("[LOADER] unrecoverable error"); - } else { - sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname); - int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),cfgprefix); - if (ret <0) { - fprintf(stderr,"[LOADER] %s %d couldn't retrieve config from section %s\n",__FILE__, __LINE__,cfgprefix); - } + char cfgprefix[sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16]; + sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname); + ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),cfgprefix); + if (ret <0) { + fprintf(stderr,"[LOADER] %s %d couldn't retrieve config from section %s\n",__FILE__, __LINE__,cfgprefix); } /* no specific path, use loader default shared lib path */ if (shlibpath == NULL) { @@ -142,6 +136,7 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t * } shlib_path = loader_format_shlibpath(modname, version); + printf("shlib_path %s\n", shlib_path); for (int i = 0; i < loader_data.numshlibs; i++) { if (strcmp(loader_data.shlibs[i].name, modname) == 0) { @@ -198,15 +193,17 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t * } if (farray) { - if (!loader_data.shlibs[lib_idx].funcarray) { - loader_data.shlibs[lib_idx].funcarray = malloc(numf*sizeof(loader_shlibfunc_t)); - if (!loader_data.shlibs[lib_idx].funcarray) { + loader_shlibdesc_t *shlib = &loader_data.shlibs[lib_idx]; + if (!shlib->funcarray) { + shlib->funcarray = calloc(numf, sizeof(loader_shlibfunc_t)); + if (!shlib->funcarray) { fprintf(stderr, "[LOADER] load_module_shlib(): unable to allocate memory\n"); ret = -1; goto load_module_shlib_exit; } + shlib->len_funcarray = numf; + shlib->numfunc = 0; } - loader_data.shlibs[lib_idx].numfunc = 0; for (int i = 0; i < numf; i++) { farray[i].fptr = dlsym(lib_handle,farray[i].fname); if (!farray[i].fptr) { @@ -215,9 +212,32 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t * ret = -1; goto load_module_shlib_exit; } - loader_data.shlibs[lib_idx].funcarray[i].fname=strdup(farray[i].fname); - loader_data.shlibs[lib_idx].funcarray[i].fptr = farray[i].fptr; - loader_data.shlibs[lib_idx].numfunc++; + /* check whether this function has been loaded before */ + int j = 0; + for (; j < shlib->numfunc; ++j) { + if (shlib->funcarray[j].fptr == farray[i].fptr) { + int rc = strcmp(shlib->funcarray[i].fname, farray[i].fname); + AssertFatal(rc == 0, + "reloading the same fptr with different fnames (%s, %s)\n", + shlib->funcarray[i].fname, farray[i].fname); + break; + } + } + if (j == shlib->numfunc) { + if (shlib->numfunc == shlib->len_funcarray) { + loader_shlibfunc_t *n = reallocarray(shlib->funcarray, shlib->numfunc * 2, sizeof(loader_shlibfunc_t)); + if (!n) { + fprintf(stderr, "[LOADER] %s(): unable to allocate memory\n", __func__); + ret = -1; + goto load_module_shlib_exit; + } + shlib->funcarray = n; + shlib->len_funcarray = shlib->numfunc * 2; + } + shlib->funcarray[j].fname = strdup(farray[i].fname); + shlib->funcarray[j].fptr = farray[i].fptr; + shlib->numfunc++; + } } /* for int i... */ } else { /* farray ! NULL */ sprintf(afname,"%s_getfarray",modname); @@ -248,3 +268,18 @@ void * get_shlibmodule_fptr(char *modname, char *fname) } /* for i loop on modules */ return NULL; } + +void loader_reset() +{ + for (int i = 0; i < loader_data.numshlibs && loader_data.shlibs[i].name != NULL; i++) { + loader_shlibdesc_t *shlib = &loader_data.shlibs[i]; + free(shlib->name); + free(shlib->thisshlib_path); + for (int j = 0; j < shlib->numfunc; ++j) + free(shlib->funcarray[j].fname); + free(shlib->funcarray); + shlib->numfunc = 0; + shlib->len_funcarray = 0; + } + free(loader_data.shlibs); +} diff --git a/common/utils/load_module_shlib.h b/common/utils/load_module_shlib.h index 0e80a5353c..8139c21909 100644 --- a/common/utils/load_module_shlib.h +++ b/common/utils/load_module_shlib.h @@ -47,6 +47,7 @@ typedef struct { char *thisshlib_path; uint32_t numfunc; loader_shlibfunc_t *funcarray; + uint32_t len_funcarray; }loader_shlibdesc_t; typedef struct { @@ -90,5 +91,6 @@ extern void * get_shlibmodule_fptr(char *modname, char *fname); extern loader_data_t loader_data; #endif /* LOAD_MODULE_SHLIB_MAIN */ #define load_module_shlib(M, F, N, I) load_module_version_shlib(M, NULL, F, N, I) +void loader_reset(); #endif diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index f566b93d9c..ed91fed9fa 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -29,6 +29,7 @@ #include "common/config/config_userapi.h" #include "common/utils/LOG/log.h" #include "common/utils/LOG/vcd_signal_dumper.h" +#include "common/utils/load_module_shlib.h" #include "T.h" #include "PHY/defs_gNB.h" #include "PHY/defs_nr_common.h" @@ -671,6 +672,8 @@ int main(int argc, char **argv) if (ouput_vcd) vcd_signal_dumper_close(); + loader_reset(); + return (n_errors); } From 136cc93aa9dbf67eee46b10f8123c152af8f8b3e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 13 Feb 2022 15:50:12 +0100 Subject: [PATCH 511/883] Fix memory leaks in nr_dlschsim --- openair1/PHY/INIT/nr_init.c | 10 +++ openair1/PHY/INIT/phy_init.h | 1 + openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 67 +++++++++---------- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 2 + openair1/SIMULATION/NR_PHY/dlschsim.c | 31 +++------ 5 files changed, 56 insertions(+), 55 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index e6b6c82834..a69b283dfb 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -553,6 +553,16 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) { } } +void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) +{ + const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; + const nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; + const uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value; + for (int i=0; inumber_of_nr_dlsch_max; i++) + for (int j=0; j<2; j++) + free_gNB_dlsch(&msg->dlsch[i][j], grid_size); +} + void init_nr_transport(PHY_VARS_gNB *gNB) { NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; LOG_I(PHY, "Initialise nr transport\n"); diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index dd9232de83..f66901f09a 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -410,6 +410,7 @@ void init_dfts(void); void fill_subframe_mask(PHY_VARS_eNB *eNB); void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); +void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg); /** @} */ #endif diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 6d16fa531c..cdf0e6c152 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -55,42 +55,39 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) { NR_gNB_DLSCH_t *dlsch = *dlschptr; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated - if (dlsch) { - if (N_RB != 273) { - a_segments = a_segments*N_RB; - a_segments = a_segments/273 +1; - } - -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY,"Freeing dlsch %p\n",dlsch); -#endif - NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; - - if (harq->b) { - free16(harq->b, a_segments * 1056); - harq->b = NULL; -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing harq->b (%p)\n", harq->b); -#endif - } - -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c); -#endif - - for (r = 0; r < a_segments; r++) { -#ifdef DEBUG_DLSCH_FREE - LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]); -#endif - - if (harq->c[r]) { - free16(harq->c[r], 1056); - harq->c[r] = NULL; - } - } - free16(dlsch, sizeof(NR_gNB_DLSCH_t)); - *dlschptr = NULL; + if (N_RB != 273) { + a_segments = a_segments*N_RB; + a_segments = a_segments/273 +1; } + + NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; + if (harq->b) { + free16(harq->b, a_segments * 1056); + harq->b = NULL; + } + for (r = 0; r < a_segments; r++) { + free(harq->c[r]); + harq->c[r] = NULL; + } + free(harq->pdu); + + for (int aa = 0; aa < 64; aa++) + free(dlsch->calib_dl_ch_estimates[aa]); + free(dlsch->calib_dl_ch_estimates); + + for (int q=0; qmod_symbs[q]); + + for (int layer = 0; layer < NR_MAX_NB_LAYERS; layer++) { + free(dlsch->txdataF_precoding[layer]); + free(dlsch->txdataF[layer]); + for (int aa = 0; aa < 64; aa++) + free(dlsch->ue_spec_bf_weights[layer][aa]); + free(dlsch->ue_spec_bf_weights[layer]); + } + + free(dlsch); + *dlschptr = NULL; } NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index d45858bca0..e757e835b9 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -106,6 +106,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint8_t abstraction_flag, uint16_t N_RB); +void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB); + /** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs - RB extraction (signal and channel estimates) - channel compensation (matched filtering) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index ed91fed9fa..62672cf36f 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -473,16 +473,13 @@ int main(int argc, char **argv) rel15->dlDmrsSymbPos = 4; rel15->mcsIndex[0] = Imcs; rel15->numDmrsCdmGrpsNoData = 1; - double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc - short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); - short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); + double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc + short channel_output_fixed[16 * 68 * 384]; //unsigned char *estimated_output; - unsigned char *estimated_output_bit; - unsigned char *test_input_bit; unsigned int errors_bit = 0; - test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); + unsigned char test_input_bit[16 * 68 * 384]; //estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); - estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); + unsigned char estimated_output_bit[16 * 68 * 384]; NR_UE_DLSCH_t *dlsch0_ue = UE->dlsch[0][0][0]; NR_DL_UE_HARQ_t *harq_process = dlsch0_ue->harq_processes[harq_pid]; harq_process->mcs = Imcs; @@ -496,9 +493,10 @@ int main(int argc, char **argv) harq_process->dlDmrsSymbPos = 4; harq_process->n_dmrs_cdm_groups = 1; printf("harq process ue mcs = %d Qm = %d, symb %d\n", harq_process->mcs, harq_process->Qm, nb_symb_sch); + unsigned char *test_input; test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8); - + //unsigned char test_input[TBS / 8] __attribute__ ((aligned(16))); for (i = 0; i < TBS / 8; i++) test_input[i] = (unsigned char) rand(); @@ -555,12 +553,6 @@ int main(int argc, char **argv) i,modulated_input[i], i,channel_output_fixed[i]); */ - - //Uncoded BER - if (channel_output_fixed[i] < 0) - channel_output_uncoded[i] = 1; //QPSK demod - else - channel_output_uncoded[i] = 0; } #ifdef DEBUG_CODER @@ -642,12 +634,11 @@ int main(int argc, char **argv) } }*/ - for (i = 0; i < 2; i++) { - printf("gNB %d\n", i); - free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL); - printf("UE %d\n", i); - free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL); - } + free(test_input); + + free_channel_desc_scm(gNB2UE); + + reset_DLSCH_struct(gNB, &msgDataTx); for (i = 0; i < 2; i++) { free(s_re[i]); From 331575ebabac870e526f2981f59802b74a0e1363 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 13 Feb 2022 17:27:58 +0100 Subject: [PATCH 512/883] Fix memory leaks in nr_ulschsim --- openair1/SIMULATION/NR_PHY/ulschsim.c | 48 +++++++++++++-------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 931a63a77e..3528ee4316 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -454,46 +454,39 @@ int main(int argc, char **argv) rel15_ul->pusch_data.tb_size = TBS/8; /////////////////////////////////////////////////// - double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc - short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); - short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); + double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc + short channel_output_fixed[16 * 68 * 384]; + short channel_output_uncoded[16 * 68 * 384]; unsigned int errors_bit_uncoded = 0; - unsigned char *estimated_output_bit; - unsigned char *test_input_bit; unsigned int errors_bit = 0; - test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); - estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384); - - unsigned char *test_input; - test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8); - - for (i = 0; i < TBS / 8; i++) - test_input[i] = (unsigned char) rand(); + unsigned char test_input_bit[16 * 68 * 384]; + unsigned char estimated_output_bit[16 * 68 * 384]; /////////////////////////[adk] preparing UL harq_process parameters///////////////////////// /////////// NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid]; + DevAssert(harq_process_ul_ue); N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig N_RE_prime = NR_NB_SC_PER_RB*nb_symb_sch - nb_re_dmrs - N_PRB_oh; - if (harq_process_ul_ue) { + harq_process_ul_ue->pusch_pdu.rnti = n_rnti; + harq_process_ul_ue->pusch_pdu.mcs_index = Imcs; + harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl; + harq_process_ul_ue->pusch_pdu.rb_size = nb_rb; + harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch; + harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords; + harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx; + harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS/8; + unsigned char *test_input = harq_process_ul_ue->a; - harq_process_ul_ue->pusch_pdu.rnti = n_rnti; - harq_process_ul_ue->pusch_pdu.mcs_index = Imcs; - harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl; - harq_process_ul_ue->pusch_pdu.rb_size = nb_rb; - harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch; - harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords; - harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx; - harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS/8; - harq_process_ul_ue->a = &test_input[0]; - - } /////////// //////////////////////////////////////////////////////////////////////////////////////////// + for (i = 0; i < TBS / 8; i++) + test_input[i] = (unsigned char) rand(); + #ifdef DEBUG_NR_ULSCHSIM for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]); #endif @@ -620,6 +613,11 @@ int main(int argc, char **argv) printf("\n"); } + for (sf = 0; sf < 2; sf++) + for (i = 0; i < 2; i++) + free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL); + + free_channel_desc_scm(gNB2UE); if (output_fd) fclose(output_fd); From 06dd706df7578c85077b78c34b67db7557d3b8be Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 14 Feb 2022 10:23:09 +0100 Subject: [PATCH 513/883] fix undefined vars in pbchsim.c --- openair1/SIMULATION/NR_PHY/pbchsim.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 0f5752c227..46e51029b3 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -438,12 +438,13 @@ int main(int argc, char **argv) printf("Initializing gNodeB for mu %d, N_RB_DL %d\n",mu,N_RB_DL); RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *)); - RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); + RC.gNB[0] = malloc16_clear(sizeof(*(RC.gNB[0]))); gNB = RC.gNB[0]; gNB->ofdm_offset_divisor = UINT_MAX; frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH) frame_parms->nb_antennas_tx = n_tx; frame_parms->nb_antennas_rx = n_rx; + frame_parms->nb_antenna_ports_gNB = n_tx; frame_parms->N_RB_DL = N_RB_DL; frame_parms->Nid_cell = Nid_cell; frame_parms->nushift = Nid_cell%4; @@ -533,19 +534,13 @@ int main(int argc, char **argv) for (i=0; i<2; i++) { - s_re[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(s_re[i],frame_length_complex_samples*sizeof(double)); - s_im[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(s_im[i],frame_length_complex_samples*sizeof(double)); - - r_re[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(r_re[i],frame_length_complex_samples*sizeof(double)); - r_im[i] = malloc(frame_length_complex_samples*sizeof(double)); - bzero(r_im[i],frame_length_complex_samples*sizeof(double)); + s_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); + s_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); + r_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); + r_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double)); printf("Allocating %d samples for txdata\n",frame_length_complex_samples); - txdata[i] = malloc(frame_length_complex_samples*sizeof(int)); - bzero(r_re[i],frame_length_complex_samples*sizeof(int)); + txdata[i] = malloc16_clear(frame_length_complex_samples*sizeof(int)); } if (pbch_file_fd!=NULL) { @@ -554,8 +549,8 @@ int main(int argc, char **argv) //configure UE - UE = malloc(sizeof(PHY_VARS_NR_UE)); - memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS)); + UE = malloc16_clear(sizeof(*UE)); + memcpy(&UE->frame_parms,frame_parms,sizeof(UE->frame_parms)); //phy_init_nr_top(UE); //called from init_nr_ue_signal if (run_initial_sync==1) UE->is_synchronized = 0; else UE->is_synchronized = 1; From 5794c07c9454a0291cd1114d127e970ead9a6b16 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Feb 2022 18:33:56 +0100 Subject: [PATCH 514/883] Correctly implement phy_free_nr_gNB() Frees all allocated memory, except for library loading related, and ul reference signal sequences, which are allocated in static variables --- openair1/PHY/INIT/nr_init.c | 166 +++++++++++------- openair1/PHY/INIT/phy_init.h | 1 + .../PHY/NR_TRANSPORT/nr_transport_proto.h | 2 + openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 78 +++----- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 5 + openair1/PHY/NR_TRANSPORT/srs_rx.c | 5 + openair1/SIMULATION/NR_PHY/dlschsim.c | 2 + 8 files changed, 142 insertions(+), 119 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index a69b283dfb..bf360d347a 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -242,37 +242,9 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, common_vars->debugBuff = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)*100); common_vars->debugBuff_sample_offset = 0; - - // Channel estimates for SRS -/* - for (UE_id=0; UE_idofdm_symbol_size ); - srs_vars[UE_id].srs_ch_estimates_time[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); - } - } //UE_id -*/ - /*generate_ul_ref_sigs_rx(); - - init_ulsch_power_LUT();*/ - -/* - // SRS - for (UE_id=0; UE_idofdm_symbol_size*sizeof(int32_t)); - } -*/ // PRACH prach_vars->prachF = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) ); prach_vars->rxsigF = (int16_t **)malloc16_clear(Prx*sizeof(int16_t*)); - /* - for (i=0;irxsigF[i] = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) ); - } - */ prach_vars->prach_ifft = (int32_t *)malloc16_clear(1024*2*sizeof(int32_t)); init_prach_list(gNB); @@ -328,51 +300,102 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, void phy_free_nr_gNB(PHY_VARS_gNB *gNB) { NR_DL_FRAME_PARMS* const fp = &gNB->frame_parms; - NR_gNB_COMMON *const common_vars = &gNB->common_vars; - NR_gNB_PUSCH **const pusch_vars = gNB->pusch_vars; - /*LTE_eNB_SRS *const srs_vars = gNB->srs_vars; - LTE_eNB_PRACH *const prach_vars = &gNB->prach_vars;*/ - uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs; - int Ptx=gNB->gNB_config.carrier_config.num_tx_ant.value; + const int Ptx = gNB->gNB_config.carrier_config.num_tx_ant.value; + const int Prx = gNB->gNB_config.carrier_config.num_rx_ant.value; + const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB() + const int n_buf = Prx * max_ul_mimo_layers; + uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs; + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) + free_and_zero(pdcch_dmrs[slot][symb]); + free_and_zero(pdcch_dmrs[slot]); + } + free_and_zero(pdcch_dmrs); + + uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) { + for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++) + free_and_zero(pdsch_dmrs[slot][symb][q]); + free_and_zero(pdsch_dmrs[slot][symb]); + } + free_and_zero(pdsch_dmrs[slot]); + } + free_and_zero(gNB->nr_gold_pdsch_dmrs); + + uint32_t ****pusch_dmrs = gNB->nr_gold_pusch_dmrs; + for(int nscid = 0; nscid < 2; nscid++) { + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) + free_and_zero(pusch_dmrs[nscid][slot][symb]); + free_and_zero(pusch_dmrs[nscid][slot]); + } + free_and_zero(pusch_dmrs[nscid]); + } + free_and_zero(pusch_dmrs); + + uint32_t ***csi_rs = gNB->nr_gold_csi_rs; + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) + free_and_zero(csi_rs[slot][symb]); + free_and_zero(csi_rs[slot]); + } + free_and_zero(csi_rs); + + for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) { + for (int i = 0; i < Prx; i++){ + free_and_zero(gNB->nr_srs_info[id]->srs_received_signal[i]); + free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel[i]); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq[i]); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i]); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i]); + } + free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal); + free_and_zero(gNB->nr_srs_info[id]->noise_power); + free_and_zero(gNB->nr_srs_info[id]->srs_received_signal); + free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time); + free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted); + free_and_zero(gNB->nr_srs_info[id]); + } + + free_ul_reference_signal_sequences(); + free_gnb_lowpapr_sequences(); + + reset_nr_transport(gNB); + + NR_gNB_COMMON * common_vars = &gNB->common_vars; for (int i = 0; i < Ptx; i++) { free_and_zero(common_vars->txdataF[i]); - /* rxdataF[i] is not allocated -> don't free */ + free_and_zero(common_vars->beam_id[i]); + } + + for (int i = 0; i < Prx; ++i) { + free_and_zero(common_vars->rxdataF[i]); + free_and_zero(common_vars->rxdata[i]); } free_and_zero(common_vars->txdataF); + free_and_zero(common_vars->rxdata); free_and_zero(common_vars->rxdataF); - // PDCCH DMRS sequences - free_and_zero(pdcch_dmrs); -/* - // Channel estimates for SRS - for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { - for (i=0; i<64; i++) { - free_and_zero(srs_vars[UE_id].srs_ch_estimates[i]); - free_and_zero(srs_vars[UE_id].srs_ch_estimates_time[i]); - } + free_and_zero(common_vars->beam_id); - free_and_zero(srs_vars[UE_id].srs_ch_estimates); - free_and_zero(srs_vars[UE_id].srs_ch_estimates_time); - } //UE_id - - //free_ul_ref_sigs(); - - for (UE_id=0; UE_iddebugBuff); + NR_gNB_PRACH* prach_vars = &gNB->prach_vars; free_and_zero(prach_vars->prachF); + free_and_zero(prach_vars->rxsigF); + free_and_zero(prach_vars->prach_ifft); - for (i = 0; i < 64; i++) free_and_zero(prach_vars->prach_ifft[0][i]); - - free_and_zero(prach_vars->prach_ifft[0]); - free_and_zero(prach_vars->rxsigF[0]); -*/ + NR_gNB_PUSCH** pusch_vars = gNB->pusch_vars; for (int ULSCH_id=0; ULSCH_idnumber_of_nr_ulsch_max; ULSCH_id++) { - for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int i = 0; i < Prx; i++) { free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]); free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]); } - for (int i = 0; i < 4*fp->nb_antennas_rx; i++) { + for (int i = 0; i < n_buf; i++) { free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates[i]); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext[i]); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time[i]); @@ -392,8 +415,8 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates_ext); - free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time); free_and_zero(pusch_vars[ULSCH_id]->ptrs_phase_per_slot); + free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time); free_and_zero(pusch_vars[ULSCH_id]->ul_valid_re_per_slot); free_and_zero(pusch_vars[ULSCH_id]->rxdataF_comp); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag0); @@ -405,14 +428,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) free_and_zero(pusch_vars[ULSCH_id]->llr); free_and_zero(pusch_vars[ULSCH_id]); } //ULSCH_id -/* - for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) gNB->UE_stats_ptr[UE_id] = NULL; -*/ - - - free_gnb_lowpapr_sequences(); - - } //Adding nr_schedule_handler @@ -587,7 +602,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB) { for (int j=0; j<2; j++) { // ULSCH for data - gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL, 0); + gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL); if (!gNB->ulsch[i][j]) { LOG_E(PHY,"Can't get gNB ulsch structures\n"); @@ -603,3 +618,18 @@ void init_nr_transport(PHY_VARS_gNB *gNB) { //fp->pucch_config_common.deltaPUCCH_Shift = 1; } + +void reset_nr_transport(PHY_VARS_gNB *gNB) +{ + const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; + + for (int i = 0; i < NUMBER_OF_NR_PUCCH_MAX; i++) + free_gNB_pucch(gNB->pucch[i]); + + for (int i = 0; i < NUMBER_OF_NR_SRS_MAX; i++) + free_gNB_srs(gNB->srs[i]); + + for (int i=0; inumber_of_nr_ulsch_max; i++) + for (int j=0; j<2; j++) + free_gNB_ulsch(&gNB->ulsch[i][j], fp->N_RB_UL); +} diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index f66901f09a..9ad5a88364 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -405,6 +405,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu, void phy_free_nr_gNB(PHY_VARS_gNB *gNB); int l1_north_init_gNB(void); void init_nr_transport(PHY_VARS_gNB *gNB); +void reset_nr_transport(PHY_VARS_gNB *gNB); void init_dfts(void); diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index e757e835b9..b62698c748 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -298,6 +298,7 @@ int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame,int slot, find_type_t type); int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type); NR_gNB_PUCCH_t *new_gNB_pucch(void); +void free_gNB_pucch(NR_gNB_PUCCH_t *pucch); void nr_fill_pucch(PHY_VARS_gNB *gNB, int frame, @@ -310,6 +311,7 @@ int nr_find_pucch(uint16_t rnti, PHY_VARS_gNB *gNB); NR_gNB_SRS_t *new_gNB_srs(void); +void free_gNB_srs(NR_gNB_SRS_t *srs); int nr_find_srs(uint16_t rnti, int frame, diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index f7bb3be577..9929ee0602 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -35,7 +35,7 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch,uint8_t N_RB_UL); -NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint8_t abstraction_flag); +NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL); /*! \brief Perform PUSCH decoding. TS 38.212 V15.4.0 subclause 6.2 diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index a398df877e..af67c03481 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -61,53 +61,33 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr,uint8_t N_RB_UL) uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated NR_gNB_ULSCH_t *ulsch = *ulschptr; - if (ulsch) { - if (N_RB_UL != 273) { - a_segments = a_segments*N_RB_UL; - a_segments = a_segments/273 +1; - } - - - for (i=0; iharq_processes[i]) { - if (ulsch->harq_processes[i]->b) { - free16(ulsch->harq_processes[i]->b,a_segments*1056); - ulsch->harq_processes[i]->b = NULL; - } - for (r=0; rharq_processes[i]->c[r],(8448)*sizeof(uint8_t)); - ulsch->harq_processes[i]->c[r] = NULL; - } - for (r=0; rharq_processes[i]->d[r]) { - free16(ulsch->harq_processes[i]->d[r],(68*384)*sizeof(int16_t)); - ulsch->harq_processes[i]->d[r] = NULL; - } - } - for (r=0; rharq_processes[i]->w[r]) { - free16(ulsch->harq_processes[i]->w[r],(3*(6144+64))*sizeof(int16_t)); - ulsch->harq_processes[i]->w[r] = NULL; - } - } - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r]){ - nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]); - ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL; - } - } - free16(ulsch->harq_processes[i],sizeof(NR_UL_gNB_HARQ_t)); - ulsch->harq_processes[i] = NULL; - } - } - free16(ulsch,sizeof(NR_gNB_ULSCH_t)); - *ulschptr = NULL; + if (N_RB_UL != 273) { + a_segments = a_segments*N_RB_UL; + a_segments = a_segments/273 +1; } + + for (i=0; iharq_processes[i]) { + if (ulsch->harq_processes[i]->b) { + free_and_zero(ulsch->harq_processes[i]->b); + ulsch->harq_processes[i]->b = NULL; + } + for (r=0; rharq_processes[i]->c[r]); + free_and_zero(ulsch->harq_processes[i]->d[r]); + free_and_zero(ulsch->harq_processes[i]->w[r]); + nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]); + ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL; + } + free_and_zero(ulsch->harq_processes[i]); + ulsch->harq_processes[i] = NULL; + } + } + free_and_zero(*ulschptr); } -NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint8_t abstraction_flag) +NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL) { NR_gNB_ULSCH_t *ulsch; @@ -129,13 +109,11 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t)); ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes); - if (abstraction_flag == 0) { - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); - ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t)); - ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t)); - ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t)); - } + for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); + ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t)); + ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t)); + ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t)); } } diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 56d87866ed..4256159812 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -62,6 +62,11 @@ NR_gNB_PUCCH_t *new_gNB_pucch(void){ return (pucch); } +void free_gNB_pucch(NR_gNB_PUCCH_t *pucch) +{ + free_and_zero(pucch); +} + int nr_find_pucch(uint16_t rnti, int frame, int slot, diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c index c16becdb20..2d7aefdee0 100644 --- a/openair1/PHY/NR_TRANSPORT/srs_rx.c +++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c @@ -49,6 +49,11 @@ NR_gNB_SRS_t *new_gNB_srs(void){ return (srs); } +void free_gNB_srs(NR_gNB_SRS_t *srs) +{ + free_and_zero(srs); +} + int nr_find_srs(uint16_t rnti, int frame, int slot, diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 62672cf36f..4867832e6a 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -640,6 +640,8 @@ int main(int argc, char **argv) reset_DLSCH_struct(gNB, &msgDataTx); + phy_free_nr_gNB(gNB); + for (i = 0; i < 2; i++) { free(s_re[i]); free(s_im[i]); From efd62d14a7bd0c7ca8581678f5556476acc43ebb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Feb 2022 21:07:20 +0100 Subject: [PATCH 515/883] Implement term_nr_ue_signal(), remove abstraction_flag from init_nr_ue_signal() term_nr_ue_signal() frees all memory, except for dfts lib load --- executables/nr-ue.c | 2 +- openair1/PHY/INIT/nr_init_ue.c | 468 +++++++++++++----- openair1/PHY/INIT/phy_init.h | 4 +- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 31 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 4 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 2 +- openair1/SIMULATION/NR_PHY/prachsim.c | 2 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- .../NR_UE_PHY/unit_tests/src/pss_util_test.c | 4 +- 11 files changed, 361 insertions(+), 162 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index d1b26601b4..70b3d3a199 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -167,7 +167,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, } // initialize all signal buffers - init_nr_ue_signal(ue, nb_connected_gNB, abstraction_flag); + init_nr_ue_signal(ue, nb_connected_gNB); // intialize transport init_nr_ue_transport(ue, abstraction_flag); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b09e8690f3..7c9f15d8f1 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -111,6 +111,49 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch, } } +void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp) +{ + for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int j = 0; j < NR_MAX_NB_LAYERS; j++) { + const int idx = j * fp->nb_antennas_rx + i; + for (int k = 0; k < NR_MAX_NB_LAYERS; k++) + free_and_zero(pdsch->rho[i][j*NR_MAX_NB_LAYERS+k]); + free_and_zero(pdsch->rxdataF_comp0[idx]); + free_and_zero(pdsch->dl_ch_estimates[idx]); + free_and_zero(pdsch->dl_ch_estimates_ext[idx]); + free_and_zero(pdsch->dl_bf_ch_estimates[idx]); + free_and_zero(pdsch->dl_bf_ch_estimates_ext[idx]); + free_and_zero(pdsch->dl_ch_mag0[idx]); + free_and_zero(pdsch->dl_ch_magb0[idx]); + free_and_zero(pdsch->dl_ch_magr0[idx]); + } + free_and_zero(pdsch->rxdataF_ext[i]); + free_and_zero(pdsch->rxdataF_uespec_pilots[i]); + free_and_zero(pdsch->ptrs_phase_per_slot[i]); + free_and_zero(pdsch->ptrs_re_per_slot[i]); + free_and_zero(pdsch->dl_ch_ptrs_estimates_ext[i]); + free_and_zero(pdsch->rho[i]); + } + free_and_zero(pdsch->pmi_ext); + free_and_zero(pdsch->llr[0]); + free_and_zero(pdsch->layer_llr[0]); + free_and_zero(pdsch->llr128); + free_and_zero(pdsch->rxdataF_ext); + free_and_zero(pdsch->rxdataF_uespec_pilots); + free_and_zero(pdsch->rxdataF_comp0); + free_and_zero(pdsch->rho); + free_and_zero(pdsch->dl_ch_estimates); + free_and_zero(pdsch->dl_ch_estimates_ext); + free_and_zero(pdsch->dl_bf_ch_estimates); + free_and_zero(pdsch->dl_bf_ch_estimates_ext); + free_and_zero(pdsch->dl_ch_mag0); + free_and_zero(pdsch->dl_ch_magb0); + free_and_zero(pdsch->dl_ch_magr0); + free_and_zero(pdsch->ptrs_phase_per_slot); + free_and_zero(pdsch->ptrs_re_per_slot); + free_and_zero(pdsch->dl_ch_ptrs_estimates_ext); +} + void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch, const NR_DL_FRAME_PARMS *const fp) { AssertFatal( pusch, "pusch==0" ); @@ -120,9 +163,14 @@ void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch, } } -int init_nr_ue_signal(PHY_VARS_NR_UE *ue, - int nb_connected_gNB, - uint8_t abstraction_flag) { +void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch) +{ + for (int i = 0; i < NR_MAX_NB_LAYERS; i++) + free_and_zero(pusch->txdataF_layers[i]); +} + +int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) +{ // create shortcuts NR_DL_FRAME_PARMS *const fp = &ue->frame_parms; NR_UE_COMMON *const common_vars = &ue->common_vars; @@ -136,8 +184,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, uint32_t ****pusch_dmrs; uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig int n_scid; - abstraction_flag = 0; - LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx); + LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx); + //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST); phy_init_nr_top(ue); // many memory allocation sizes are hard coded AssertFatal( fp->nb_antennas_rx <= 4, "hard coded allocation for ue_common_vars->dl_ch_estimates[gNB_id]" ); @@ -230,29 +278,27 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, for (i=0; i<10; i++) ue->tx_power_dBm[i]=-127; - if (abstraction_flag == 0) { - // init TX buffers - common_vars->txdata = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) ); - common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) ); + // init TX buffers + common_vars->txdata = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) ); + common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) ); - for (i=0; inb_antennas_tx; i++) { - common_vars->txdata[i] = (int32_t *)malloc16_clear( fp->samples_per_subframe*10*sizeof(int32_t) ); - common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->samples_per_slot_wCP*sizeof(int32_t) ); - } + for (i=0; inb_antennas_tx; i++) { + common_vars->txdata[i] = (int32_t *)malloc16_clear( fp->samples_per_subframe*10*sizeof(int32_t) ); + common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->samples_per_slot_wCP*sizeof(int32_t) ); + } - // init RX buffers - common_vars->rxdata = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + // init RX buffers + common_vars->rxdata = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + + for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + } + + for (i=0; inb_antennas_rx; i++) { + common_vars->rxdata[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - } - - for (i=0; inb_antennas_rx; i++) { - common_vars->rxdata[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); - - for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->samples_per_slot_wCP) ); - } + common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->samples_per_slot_wCP) ); } } @@ -330,129 +376,121 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); } - if (abstraction_flag == 0) { - for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); + for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); + } + + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12); + ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts; + ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); + ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); + ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) ); + } + + + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + } + + for (i=0; inb_antennas_rx; i++) + for (j=0; j<4; j++) { + const int idx = (j*fp->nb_antennas_rx)+i; + const size_t num = 7*2*fp->N_RB_DL*12+4; + + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); + } } - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12); - ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts; - ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); - ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) ); - ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) ); - } - - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - } - - for (i=0; inb_antennas_rx; i++) - for (j=0; j<4; j++) { - const int idx = (j*fp->nb_antennas_rx)+i; - const size_t num = 7*2*fp->N_RB_DL*12+4; - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num ); - } + //const size_t num = 7*2*fp->N_RB_DL*12+4; + for (k=0; k<8; k++) { //harq_pid + for (l=0; l<8; l++) { //round + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); } - //const size_t num = 7*2*fp->N_RB_DL*12+4; - for (k=0; k<8; k++) { //harq_pid - for (l=0; l<8; l++) { //round - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - } + for (int i=0; inb_antennas_rx; i++) + for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) + const int idx = (j*fp->nb_antennas_rx)+i; - for (int i=0; inb_antennas_rx; i++) - for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) - const int idx = (j*fp->nb_antennas_rx)+i; - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); - } + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); + ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); + ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); } - } - } - - // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE - for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 ); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - // Channel estimates - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); - - for (i=0; inb_antennas_rx; i++) { - ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4)); - - for (j=0; j<4; j++) { - int idx = (j*fp->nb_antennas_rx)+i; - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); - // size_t num = 7*2*fp->N_RB_DL*12; - size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB - ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); } - } } + } - // PBCH - pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); // - prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); - prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE + for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); + ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 ); + ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + // Channel estimates + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); for (i=0; inb_antennas_rx; i++) { - pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4)); - for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) { + for (j=0; j<4; j++) { int idx = (j*fp->nb_antennas_rx)+i; - pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); - pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); - pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); + // size_t num = 7*2*fp->N_RB_DL*12; + size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB + ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); + ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); + ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); } } } + // PBCH + pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); + pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); // + prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + + for (i=0; inb_antennas_rx; i++) { + pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + + for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) { + int idx = (j*fp->nb_antennas_rx)+i; + pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); + pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) ); + pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 ); + } + } + pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64); } // initialization for the last instance of pdsch_vars (used for MU-MIMO) - for (th_id=0; th_idpdsch_vars[th_id][gNB_id] = (NR_UE_PDSCH *)malloc16_clear(sizeof(NR_UE_PDSCH)); - } + for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) + ue->pdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH)); - if (abstraction_flag == 0) { - for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); - ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); - ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); - } - } else { //abstraction == 1 - ue->sinr_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) ); + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); + ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); } ue->sinr_CQI_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) ); @@ -473,6 +511,180 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, return 0; } +void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) +{ + const NR_DL_FRAME_PARMS* fp = &ue->frame_parms; + phy_term_nr_top(); + + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { + phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id]); + free_and_zero(ue->pusch_vars[th_id][gNB_id]); + free_and_zero(ue->pucch_vars[th_id][gNB_id]); + } + } + + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) { + for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++) + free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb][q]); + free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb]); + } + free_and_zero(ue->nr_gold_pusch_dmrs[slot]); + } + free_and_zero(ue->nr_gold_pusch_dmrs); + + NR_UE_COMMON* common_vars = &ue->common_vars; + + for (int i = 0; i < fp->nb_antennas_tx; i++) { + free_and_zero(common_vars->txdata[i]); + free_and_zero(common_vars->txdataF[i]); + } + + free_and_zero(common_vars->txdata); + free_and_zero(common_vars->txdataF); + + for (int i = 0; i < fp->nb_antennas_rx; i++) { + free_and_zero(common_vars->rxdata[i]); + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) + free_and_zero(common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i]); + } + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + free_and_zero(common_vars->common_vars_rx_data_per_thread[th_id].rxdataF); + } + free_and_zero(common_vars->rxdata); + + for (int slot = 0; slot < fp->slots_per_frame; slot++) { + for (int symb = 0; symb < fp->symbols_per_slot; symb++) + free_and_zero(ue->nr_gold_pdcch[0][slot][symb]); + free_and_zero(ue->nr_gold_pdcch[0][slot]); + } + free_and_zero(ue->nr_gold_pdcch[0]); + + for (int slot=0; slotslots_per_frame; slot++) { + for (int symb=0; symbsymbols_per_slot; symb++) { + for (int q=0; qnr_gold_pdsch[0][slot][symb][q]); + free_and_zero(ue->nr_gold_pdsch[0][slot][symb]); + } + free_and_zero(ue->nr_gold_pdsch[0][slot]); + } + free_and_zero(ue->nr_gold_pdsch[0]); + + for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { + + // PDSCH + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + for (int k = 0; k < 8; k++) { //harq_pid + for (int l = 0; l < 8; l++) { //round + for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int j = 0; j < 4; j++) { //frame_parms->nb_antennas_tx; j++) + const int idx = j * fp->nb_antennas_rx + i; + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx]); + } + } + + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l]); + } + } + + for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int j = 0; j < 4; j++) { + const int idx = (j*fp->nb_antennas_rx)+i; + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx]); + } + } + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext); + + phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]); + } + + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + for (int i = 0; i < fp->nb_antennas_rx; i++) { + for (int j = 0; j < 4; j++) { + int idx = j * fp->nb_antennas_rx + i; + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx]); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx]); + } + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho[i]); + } + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr16); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->e_rx); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates); + free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time); + + free_and_zero(ue->pdcch_vars[th_id][gNB_id]); + } + + for (int i = 0; i < fp->nb_antennas_rx; i++) { + free_and_zero(ue->nr_srs_info->srs_received_signal[i]); + free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq[i]); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_time[i]); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted[i]); + } + free_and_zero(ue->nr_srs_info->srs_generated_signal); + free_and_zero(ue->nr_srs_info->noise_power); + free_and_zero(ue->nr_srs_info->srs_received_signal); + free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_time); + free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted); + free_and_zero(ue->nr_srs_info); + + free_and_zero(ue->srs_vars[gNB_id]); + + for (int i = 0; i < fp->nb_antennas_rx; i++) { + free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext[i]); + + for (int j = 0; j < 4; j++) { + int idx = (j*fp->nb_antennas_rx)+i; + free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp[idx]); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates[idx]); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time[idx]); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext[idx]); + } + } + + free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext); + free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext); + free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time); + free_and_zero(ue->pbch_vars[gNB_id]->llr); + free_and_zero(ue->pbch_vars[gNB_id]->decoded_output); + free_and_zero(ue->pbch_vars[gNB_id]); + + free_and_zero(ue->prach_vars[gNB_id]->prachF); + free_and_zero(ue->prach_vars[gNB_id]->prach); + free_and_zero(ue->prach_vars[gNB_id]); + } + + free_and_zero(ue->sinr_CQI_dB); +} + void init_nr_ue_transport(PHY_VARS_NR_UE *ue, int abstraction_flag) { for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { @@ -555,3 +767,9 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) { //init_unscrambling_lut(); //set_taus_seed(1328); } + +void phy_term_nr_top(void) +{ + free_ul_reference_signal_sequences(); + free_context_synchro_nr(); +} diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 9ad5a88364..7cd6896e4f 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -57,6 +57,7 @@ int l1_north_init_eNB(void); int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms); void phy_init_nr_top(PHY_VARS_NR_UE *ue); +void phy_term_nr_top(void); /*! @@ -395,7 +396,8 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb); int nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms); int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band); void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band); -int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag); +int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); +void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB); void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); void init_N_TA_offset(PHY_VARS_NR_UE *ue); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 4fc11d5fc6..88bdc3a9cd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -440,33 +440,10 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue) void free_context_pss_nr(void) { for (int i = 0; i < NUMBER_PSS_SEQUENCE; i++) { - - if (primary_synchro_time_nr[i] != NULL) { - free(primary_synchro_time_nr[i]); - primary_synchro_time_nr[i] = NULL; - } - else { - LOG_E(PHY,"Fatal memory deallocation problem \n"); - assert(0); - } - - if (primary_synchro_nr[i] != NULL) { - free(primary_synchro_nr[i]); - primary_synchro_nr[i] = NULL; - } - else { - LOG_E(PHY,"Fatal memory deallocation problem \n"); - assert(0); - } - - if (pss_corr_ue[i] != NULL) { - free(pss_corr_ue[i]); - pss_corr_ue[i] = NULL; - } - else { - LOG_E(PHY,"Fatal memory deallocation problem \n"); - assert(0); - } + free_and_zero(primary_synchro_nr[i]); + free_and_zero(primary_synchro_nr2[i]); + free_and_zero(primary_synchro_time_nr[i]); + free_and_zero(pss_corr_ue[i]); } } diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 4867832e6a..a3c03ad149 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -413,7 +413,7 @@ int main(int argc, char **argv) memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); //phy_init_nr_top(frame_parms); - if (init_nr_ue_signal(UE, 1, 0) != 0) { + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } @@ -642,6 +642,8 @@ int main(int argc, char **argv) phy_free_nr_gNB(gNB); + term_nr_ue_signal(UE, 1); + for (i = 0; i < 2; i++) { free(s_re[i]); free(s_im[i]); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 046f410bd4..1f8f55db01 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -917,7 +917,7 @@ int main(int argc, char **argv) UE->perfect_ce = 0; - if (init_nr_ue_signal(UE, 1, 0) != 0) + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 46e51029b3..a141dfbe9e 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -560,7 +560,7 @@ int main(int argc, char **argv) if(eps!=0.0) UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation - if (init_nr_ue_signal(UE, 1, 0) != 0) { + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 2d1ca3d25a..537612ac30 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -674,7 +674,7 @@ int main(int argc, char **argv){ memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS)); UE->nrUE_config.prach_config.num_prach_fd_occasions_list = (fapi_nr_num_prach_fd_occasions_t *) malloc(num_prach_fd_occasions*sizeof(fapi_nr_num_prach_fd_occasions_t)); - if (init_nr_ue_signal(UE, 1, 0) != 0){ + if (init_nr_ue_signal(UE, 1) != 0){ printf("Error at UE NR initialisation\n"); exit(-1); } diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 465fe71f60..34fe0ef543 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -490,7 +490,7 @@ int main(int argc, char **argv) if(eps!=0.0) UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation - if (init_nr_ue_signal(UE, 1, 0) != 0) + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 6e9b88593c..8fa584a45f 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -761,7 +761,7 @@ int main(int argc, char **argv) memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); //phy_init_nr_top(frame_parms); - if (init_nr_ue_signal(UE, 1, 0) != 0) { + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c index f3dbc78a73..4334bd12f9 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c @@ -71,7 +71,7 @@ static nfapi_config_request_t *config =&config_t; /*************** FUNCTIONS ****************************************/ //void phy_init_nr_top(NR_DL_FRAME_PARMS *frame_parms); -int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB, uint8_t abstraction_flag); +int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB); /******************************************************************* * @@ -248,7 +248,7 @@ int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission //phy_init_nr_top(frame_parms); - if (init_nr_ue_signal(PHY_vars_UE, 1, 0) != 0) { + if (init_nr_ue_signal(PHY_vars_UE, 1) != 0) { LOG_E(PHY,"Error at UE NR initialisation : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME); return (0); } From d2523bfa442550c018ba5ac55d5b716dd9b2372c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Feb 2022 21:11:48 +0100 Subject: [PATCH 516/883] Remove unused SI and RA DLSCH from nr_dlschsim --- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index a3c03ad149..e47e1e440d 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -434,8 +434,6 @@ int main(int argc, char **argv) } } - UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); - UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0); unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; processingData_L1tx_t msgDataTx; init_DLSCH_struct(gNB, &msgDataTx); From 20e13db86b41aef57c41c09b2e0eba9588331463 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 14 Feb 2022 21:23:01 +0100 Subject: [PATCH 517/883] Implement logTerm() to close logging subsystem --- common/utils/LOG/log.c | 16 ++++++++++++++++ common/utils/LOG/log.h | 1 + openair1/SIMULATION/NR_PHY/dlschsim.c | 1 + 3 files changed, 18 insertions(+) diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index a65a9732e7..5b047c082d 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -411,6 +411,16 @@ int register_log_component(char *name, return computed_compidx; } +static void unregister_all_log_components(void) +{ + log_component_t* lc = &g_log->log_component[0]; + while (lc->name) { + free((char *)lc->name); // defined as const, but assigned through strdup() + free(lc->filelog_name); + lc++; + } +} + int isLogInitDone (void) { if (g_log == NULL) @@ -502,6 +512,12 @@ int logInit (void) return 0; } +void logTerm(void) +{ + unregister_all_log_components(); + free_and_zero(g_log); +} + #include static inline int log_header(log_component_t *c, char *log_buffer, diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 8299c48fbb..d73fc03ed9 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -302,6 +302,7 @@ extern "C" { # include "log_if.h" /*----------------------------------------------------------------------------*/ int logInit (void); +void logTerm (void); int isLogInitDone (void); void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args ); diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index e47e1e440d..69e98242d9 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -666,6 +666,7 @@ int main(int argc, char **argv) vcd_signal_dumper_close(); loader_reset(); + logTerm(); return (n_errors); } From 338019601c536f0778cf0627682f152b8ca775bf Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 10:33:42 +0100 Subject: [PATCH 518/883] new_nr_ue_dlsch(): remove abstraction_flag --- openair1/PHY/INIT/nr_init_ue.c | 8 ++-- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 38 +++++++++---------- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 5 +-- openair1/SIMULATION/NR_PHY/dlschsim.c | 3 +- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 7c9f15d8f1..8a87a3f96d 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -690,20 +690,20 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue, for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { for (int j=0; j<2; j++) { for (int k=0; kdlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n"); + AssertFatal((ue->dlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n"); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]); AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES, abstraction_flag))!=NULL,"Can't get ue ulsch structures\n"); LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]); } } - ue->dlsch_SI[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag); - ue->dlsch_ra[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag); + ue->dlsch_SI[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL); + ue->dlsch_ra[i] = new_nr_ue_dlsch(1,1,NSOFT,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; - ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL,0); + ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL); for(int i=0; i<5; i++) ue->dl_stats[i] = 0; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 8064093eed..f02e0ebd8a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -131,7 +131,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) { } } -NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL, uint8_t abstraction_flag) { +NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL) { NR_UE_DLSCH_t *dlsch; uint8_t exit_flag = 0,i,r; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated @@ -167,30 +167,28 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint else exit_flag=3; - if (abstraction_flag == 0) { - for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); - dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); + for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); + dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); - if (dlsch->harq_processes[i]->c[r]) - memset(dlsch->harq_processes[i]->c[r],0,1056); - else - exit_flag=2; + if (dlsch->harq_processes[i]->c[r]) + memset(dlsch->harq_processes[i]->c[r],0,1056); + else + exit_flag=2; - dlsch->harq_processes[i]->d[r] = (short *)malloc16((5*8448)*sizeof(short)); + dlsch->harq_processes[i]->d[r] = (short *)malloc16((5*8448)*sizeof(short)); - if (dlsch->harq_processes[i]->d[r]) - memset(dlsch->harq_processes[i]->d[r],0,(5*8448)*sizeof(short)); - else - exit_flag=2; + if (dlsch->harq_processes[i]->d[r]) + memset(dlsch->harq_processes[i]->d[r],0,(5*8448)*sizeof(short)); + else + exit_flag=2; - dlsch->harq_processes[i]->w[r] = (short *)malloc16((5*8448)*sizeof(short)); + dlsch->harq_processes[i]->w[r] = (short *)malloc16((5*8448)*sizeof(short)); - if (dlsch->harq_processes[i]->w[r]) - memset(dlsch->harq_processes[i]->w[r],0,(5*8448)*sizeof(short)); - else - exit_flag=2; - } + if (dlsch->harq_processes[i]->w[r]) + memset(dlsch->harq_processes[i]->w[r],0,(5*8448)*sizeof(short)); + else + exit_flag=2; } } else { exit_flag=1; 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 239731208e..e55d0bc890 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -53,16 +53,15 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch,uint8_t N_RB_DL); -/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag) +/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft) \brief This function allocates structures for a particular DLSCH at UE @returns Pointer to DLSCH to be removed @param Kmimo Kmimo factor from 36-212/36-213 @param Mdlharq Maximum number of HARQ rounds (36-212/36-213) @param Nsoft Soft-LLR buffer size from UE-Category @params N_RB_DL total number of resource blocks (determine the operating BW) - @param abstraction_flag Flag to indicate abstracted interface */ -NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL, uint8_t abstraction_flag); +NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL); void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch,unsigned char N_RB_UL); diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 69e98242d9..d1a53ca42f 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -422,8 +422,7 @@ int main(int argc, char **argv) //init_nr_ue_transport(UE, 0); for (int sf = 0; sf < 2; sf++) { for (i = 0; i < 2; i++) { - UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL, - 0); + UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL); if (!UE->dlsch[sf][0][i]) { printf("Can't get ue dlsch structures\n"); From 7638e653797d9558590a32a0320584a395f4f47c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 10:34:12 +0100 Subject: [PATCH 519/883] Free memory in nr_dlschsim --- openair1/SIMULATION/NR_PHY/dlschsim.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index d1a53ca42f..37d5582b1e 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -638,8 +638,15 @@ int main(int argc, char **argv) reset_DLSCH_struct(gNB, &msgDataTx); phy_free_nr_gNB(gNB); + free(gNB->threadPool); + free(RC.gNB[0]); + free(RC.gNB); + for (int sf = 0; sf < 2; sf++) + for (int i = 0; i < 2; i++) + free_nr_ue_dlsch(&UE->dlsch[sf][0][i], N_RB_DL); term_nr_ue_signal(UE, 1); + free(UE); for (i = 0; i < 2; i++) { free(s_re[i]); From e66e9eef7de06600d5231e6206e8a8a021fcf350 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 11:31:46 +0100 Subject: [PATCH 520/883] UL Ref Sig Seq: initialize only once, free and reset to NULL --- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c index 4a419ae926..69a9722664 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c @@ -204,6 +204,11 @@ int16_t *base_sequence_36_or_larger(unsigned int Msc_RS, void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling) { + /* prevent multiple calls, relevant when both UE & gNB initialize this */ + static bool already_called = false; + if (already_called) return; + already_called = true; + unsigned int u,Msc_RS; unsigned int v = 0; // sequence hopping and group hopping are not supported yet @@ -223,6 +228,11 @@ void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling) void generate_ul_reference_signal_sequences(unsigned int scaling) { + /* prevent multiple calls, relevant when both UE & gNB initialize this */ + static bool already_called = false; + if (already_called) return; + already_called = true; + unsigned int u,v,Msc_RS; #if 0 @@ -295,10 +305,10 @@ void free_ul_reference_signal_sequences(void) for (u=0; u < U_GROUP_NUMBER; u++) { for (v=0; v < V_BASE_SEQUENCE_NUMBER; v++) { if (rv_ul_ref_sig[u][v][Msc_RS]) - free16(rv_ul_ref_sig[u][v][Msc_RS],2*sizeof(int16_t)*ul_allocated_re[Msc_RS]); + free_and_zero(rv_ul_ref_sig[u][v][Msc_RS]); if ((v==0) && (Msc_RS < MAX_INDEX_DMRS_UL_ALLOCATED_REs)) if (dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS]) - free16(dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS],2*sizeof(int16_t)*dmrs_ul_allocated_res[Msc_RS]); + free_and_zero(dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS]); } } } @@ -321,7 +331,7 @@ void free_gnb_lowpapr_sequences(void) v=0; for (u=0; u < U_GROUP_NUMBER; u++) { if (gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS]) - free16(gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS],2*sizeof(int16_t)*dmrs_ul_allocated_res[Msc_RS]); + free_and_zero(gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS]); } } } From 20a8704c980415c383bfda8875b9f26579c859ec Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 11:37:48 +0100 Subject: [PATCH 521/883] unitialized jump dlschsim --- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 37d5582b1e..f3aae9a3f7 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -356,7 +356,7 @@ int main(int argc, char **argv) } RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *)); - RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); + RC.gNB[0] = calloc(1, sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t)); initTpool(gNBthreads, gNB->threadPool, true); From 399e6d78f7551072041f88bcd5c76795ed0753f8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 12:09:09 +0100 Subject: [PATCH 522/883] new_nr_ue_ulsch(): no abstraction_flag, add term_nr_ue_transport() --- executables/nr-ue.c | 2 +- openair1/PHY/INIT/nr_init_ue.c | 24 +++- openair1/PHY/INIT/phy_init.h | 2 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- .../PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 120 ++++++------------ openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 4 +- openair1/SIMULATION/NR_PHY/ulsim.c | 4 +- 8 files changed, 66 insertions(+), 94 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 70b3d3a199..9c9ca4db4c 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -170,7 +170,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue, init_nr_ue_signal(ue, nb_connected_gNB); // intialize transport - init_nr_ue_transport(ue, abstraction_flag); + init_nr_ue_transport(ue); // init N_TA offset init_N_TA_offset(ue); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 8a87a3f96d..8067c77e71 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -685,14 +685,32 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->sinr_CQI_dB); } -void init_nr_ue_transport(PHY_VARS_NR_UE *ue, - int abstraction_flag) { +void term_nr_ue_transport(PHY_VARS_NR_UE *ue) +{ + const int N_RB_DL = ue->frame_parms.N_RB_DL; + for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { + for (int j = 0; j < 2; j++) { + for (int k = 0; k < RX_NB_TH_MAX; k++) { + free_nr_ue_dlsch(&ue->dlsch[k][i][j], N_RB_DL); + free_nr_ue_ulsch(&ue->ulsch[k][i][j], N_RB_DL); + } + } + + free_nr_ue_dlsch(&ue->dlsch_SI[i], N_RB_DL); + free_nr_ue_dlsch(&ue->dlsch_ra[i], N_RB_DL); + } + + free_nr_ue_dlsch(&ue->dlsch_MCH[0], N_RB_DL); +} + +void init_nr_ue_transport(PHY_VARS_NR_UE *ue) +{ for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) { for (int j=0; j<2; j++) { for (int k=0; kdlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n"); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]); - AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES, abstraction_flag))!=NULL,"Can't get ue ulsch structures\n"); + AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES))!=NULL,"Can't get ue ulsch structures\n"); LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]); } } diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 7cd6896e4f..8648dd7d82 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -398,7 +398,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_reques void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band); int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB); void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB); -void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); +void init_nr_ue_transport(PHY_VARS_NR_UE *ue); void init_N_TA_offset(PHY_VARS_NR_UE *ue); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag); 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 e55d0bc890..504ab93889 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -66,7 +66,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch,unsigned char N_RB_UL); -NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, uint8_t abstraction_flag); +NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids); /** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/QPSK reception. @param stream0_in Input from channel compensated (MR combined) stream 0 diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index aa4c858574..a3e0b668d0 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -105,11 +105,8 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL) } -NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, - int number_of_harq_pids, - uint8_t abstraction_flag) +NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) { - NR_UE_ULSCH_t *ulsch; unsigned char exit_flag = 0,i,r; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated @@ -120,97 +117,54 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, uint32_t ulsch_bytes = a_segments*1056; // allocated bytes per segment - ulsch = (NR_UE_ULSCH_t *)malloc16(sizeof(NR_UE_ULSCH_t)); + NR_UE_ULSCH_t *ulsch = malloc16(sizeof(NR_UE_ULSCH_t)); + DevAssert(ulsch); + memset(ulsch, 0, sizeof(*ulsch)); - if (ulsch) { - memset(ulsch,0,sizeof(NR_UE_ULSCH_t)); + ulsch->number_harq_processes_for_pusch = NR_MAX_ULSCH_HARQ_PROCESSES; + ulsch->Mlimit = 4; // maximum harq retransmissions - ulsch->number_harq_processes_for_pusch = NR_MAX_ULSCH_HARQ_PROCESSES; - ulsch->Mlimit = 4; // maximum harq retransmissions + //for (i=0; i<10; i++) + //ulsch->harq_ids[i] = 0; - //for (i=0; i<10; i++) - //ulsch->harq_ids[i] = 0; + for (i=0; iharq_processes[i] = malloc16(sizeof(NR_UL_UE_HARQ_t)); + DevAssert(ulsch->harq_processes[i]); + memset(ulsch->harq_processes[i], 0, sizeof(NR_UL_UE_HARQ_t)); - ulsch->harq_processes[i] = (NR_UL_UE_HARQ_t *)malloc16(sizeof(NR_UL_UE_HARQ_t)); + ulsch->harq_processes[i]->a = malloc16(ulsch_bytes); + DevAssert(ulsch->harq_processes[i]->a); + bzero(ulsch->harq_processes[i]->a,ulsch_bytes); - // printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]); - if (ulsch->harq_processes[i]) { - memset(ulsch->harq_processes[i], 0, sizeof(NR_UL_UE_HARQ_t)); - ulsch->harq_processes[i]->b = (uint8_t*)malloc16(ulsch_bytes); - ulsch->harq_processes[i]->a = (unsigned char*)malloc16(ulsch_bytes); + ulsch->harq_processes[i]->b = malloc16(ulsch_bytes); + DevAssert(ulsch->harq_processes[i]->b); + bzero(ulsch->harq_processes[i]->b,ulsch_bytes); - if (ulsch->harq_processes[i]->a) { - bzero(ulsch->harq_processes[i]->a,ulsch_bytes); - } else { - printf("Can't allocate PDU\n"); - exit_flag=1; - } + for (r=0; rharq_processes[i]->c[r] = malloc16(8448); + DevAssert(ulsch->harq_processes[i]->c[r]); + bzero(ulsch->harq_processes[i]->c[r],8448); - if (ulsch->harq_processes[i]->b) - bzero(ulsch->harq_processes[i]->b,ulsch_bytes); - else { - LOG_E(PHY,"Can't get b\n"); - exit_flag=1; - } - - if (abstraction_flag==0) { - for (r=0; rharq_processes[i]->c[r] = (uint8_t*)malloc16(8448); - ulsch->harq_processes[i]->d[r] = (uint8_t*)malloc16(68*384); //max size for coded output - - if (ulsch->harq_processes[i]->c[r]) { - bzero(ulsch->harq_processes[i]->c[r],8448); - } else { - printf("Can't get c\n"); - exit_flag=2; - } - if (ulsch->harq_processes[i]->d[r]) { - bzero(ulsch->harq_processes[i]->d[r],(68*384)); - } else { - printf("Can't get d\n"); - exit_flag=2; - } - } - ulsch->harq_processes[i]->e = (uint8_t*)malloc16(14*N_RB_UL*12*8); - if (ulsch->harq_processes[i]->e) { - bzero(ulsch->harq_processes[i]->e,14*N_RB_UL*12*8); - } else { - printf("Can't get e\n"); - exit_flag=1; - } - ulsch->harq_processes[i]->f = (uint8_t*)malloc16(14*N_RB_UL*12*8); - if (ulsch->harq_processes[i]->f) { - bzero(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8); - } else { - printf("Can't get f\n"); - exit_flag=1; - } - } - - ulsch->harq_processes[i]->subframe_scheduling_flag = 0; - ulsch->harq_processes[i]->first_tx = 1; - } else { - LOG_E(PHY,"Can't get harq_p %d\n",i); - exit_flag=3; - } + ulsch->harq_processes[i]->d[r] = malloc16(68*384); //max size for coded output + DevAssert(ulsch->harq_processes[i]->d[r]); + bzero(ulsch->harq_processes[i]->d[r],(68*384)); } - if (exit_flag==0) { - for (i=0; iharq_processes[i]->round=0; - } - return(ulsch); - } + ulsch->harq_processes[i]->e = malloc16(14*N_RB_UL*12*8); + DevAssert(ulsch->harq_processes[i]->e); + bzero(ulsch->harq_processes[i]->e,14*N_RB_UL*12*8); + + ulsch->harq_processes[i]->f = malloc16(14*N_RB_UL*12*8); + DevAssert(ulsch->harq_processes[i]->f); + bzero(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8); + + ulsch->harq_processes[i]->subframe_scheduling_flag = 0; + ulsch->harq_processes[i]->first_tx = 1; } - LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %zu\n",exit_flag, sizeof(LTE_UE_ULSCH_t)); - free_nr_ue_ulsch(&ulsch,N_RB_UL); - return(NULL); - - + return(ulsch); } diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 1f8f55db01..8e20a84f81 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -923,7 +923,7 @@ int main(int argc, char **argv) exit(-1); } - init_nr_ue_transport(UE,0); + init_nr_ue_transport(UE); nr_gold_pbch(UE); nr_gold_pdcch(UE,0); diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 3528ee4316..bc4b4709e8 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -400,7 +400,7 @@ int main(int argc, char **argv) memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); //phy_init_nr_top(frame_parms); - if (init_nr_ue_signal(UE, 1, 0) != 0) { + if (init_nr_ue_signal(UE, 1) != 0) { printf("Error at UE NR initialisation.\n"); exit(-1); } @@ -408,7 +408,7 @@ int main(int argc, char **argv) for (sf = 0; sf < 2; sf++) { for (i = 0; i < 2; i++) { - UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); + UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8); if (!UE->ulsch[sf][0][i]) { printf("Can't get ue ulsch structures.\n"); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 8fa584a45f..3a7381062f 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -767,13 +767,13 @@ int main(int argc, char **argv) } //nr_init_frame_parms_ue(&UE->frame_parms); - init_nr_ue_transport(UE, 0); + init_nr_ue_transport(UE); /* for (int sf = 0; sf < 2; sf++) { for (i = 0; i < 2; i++) { - UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); + UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8); if (!UE->ulsch[sf][0][i]) { printf("Can't get ue ulsch structures\n"); From 0827b2f5b8cc52f051209b7f103d70dba9e584cb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 12:27:50 +0100 Subject: [PATCH 523/883] Fix leaks & unitialized memory in nr_ulschsim --- openair1/SIMULATION/NR_PHY/ulschsim.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index bc4b4709e8..6cdf0b90cd 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -26,6 +26,7 @@ #include #include #include "common/config/config_userapi.h" +#include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" #include "common/ran_context.h" #include "PHY/types.h" @@ -372,7 +373,7 @@ int main(int argc, char **argv) RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *)); - RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB)); + RC.gNB[0] = calloc(1, sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; //gNB_config = &gNB->gNB_config; @@ -616,6 +617,14 @@ int main(int argc, char **argv) for (sf = 0; sf < 2; sf++) for (i = 0; i < 2; i++) free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL); + term_nr_ue_signal(UE, 1); + free(UE); + + phy_free_nr_gNB(gNB); + free(gNB->threadPool); + free(gNB->respDecode); + free(RC.gNB[0]); + free(RC.gNB); free_channel_desc_scm(gNB2UE); @@ -625,6 +634,9 @@ int main(int argc, char **argv) if (input_fd) fclose(input_fd); + loader_reset(); + logTerm(); + return (n_errors); } From 32c7795aad2038a6ad13fc72c2461fab567451a8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 20:30:42 +0100 Subject: [PATCH 524/883] Fixes for 0bdb1b9f402c5315a591b1fbc4310dbc62fc820d --- openair1/PHY/INIT/nr_init_ue.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 8067c77e71..ad6ed0eaa4 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -485,10 +485,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } // initialization for the last instance of pdsch_vars (used for MU-MIMO) - for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) - ue->pdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH)); - for (th_id=0; th_idpdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH)); ue->pdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); } @@ -682,6 +680,13 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->prach_vars[gNB_id]); } + const int gNB_id = ue->n_connected_gNB; + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]); + free_and_zero(ue->pdsch_vars[th_id][gNB_id]); + } + free_and_zero(ue->sinr_CQI_dB); } From b4dbf46ddebd924cc3fa5eea3cce546aa28359aa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 20:46:20 +0100 Subject: [PATCH 525/883] Provide term_freq_channel() to free memory in abstraction.c --- openair1/SIMULATION/TOOLS/abstraction.c | 19 ++++++++++++++++--- openair1/SIMULATION/TOOLS/sim.h | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/openair1/SIMULATION/TOOLS/abstraction.c b/openair1/SIMULATION/TOOLS/abstraction.c index a6b0586882..b1cd691ec4 100644 --- a/openair1/SIMULATION/TOOLS/abstraction.c +++ b/openair1/SIMULATION/TOOLS/abstraction.c @@ -33,11 +33,26 @@ // NEW code with lookup table for sin/cos based on delay profile (TO BE TESTED) double **cos_lut=NULL,* *sin_lut=NULL; +static int freq_channel_init = 0; +static int n_samples_max = 0; //#if 1 - +void term_freq_channel(void) +{ + for (int f = -(n_samples_max >> 1); f <= n_samples_max >> 1; f++) { + const int idx = f + (n_samples_max >> 1); + if (cos_lut[idx]) + free_and_zero(cos_lut[idx]); + if (sin_lut[idx]) + free_and_zero(sin_lut[idx]); + } + free_and_zero(cos_lut); + free_and_zero(sin_lut); + freq_channel_init = 0; + n_samples_max = 0; +} int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs) { double delta_f,freq; // 90 kHz spacing @@ -78,8 +93,6 @@ int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs) int16_t f,f2,d; uint8_t aarx,aatx,l; double *clut,*slut; - static int freq_channel_init=0; - static int n_samples_max=0; // do some error checking // n_samples has to be a odd number because we assume the spectrum is symmetric around the DC and includes the DC diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index ce470fe0b0..f12483d70a 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -479,6 +479,7 @@ void randominit(unsigned int seed_init); double uniformrandom(void); int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples,int scs); int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs); +void term_freq_channel(void); uint8_t multipath_channel_nosigconv(channel_desc_t *desc); void multipath_tv_channel(channel_desc_t *desc, double **tx_sig_re, From 81537701b21245e4b0d80793ed05ffb6b04c4b84 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 20:46:42 +0100 Subject: [PATCH 526/883] Fix: channel chF large enough for 5G --- openair1/SIMULATION/TOOLS/random_channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index b00f6e31d5..0f6b8fb1bc 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -125,7 +125,7 @@ void fill_channel_desc(channel_desc_t *chan_desc, chan_desc->ch[i] = (struct complexd *) malloc(channel_length * sizeof(struct complexd)); for (i = 0; ichF[i] = (struct complexd *) malloc(12*257 * sizeof(struct complexd)); // allocate for up to 257 RBs, 12 samples per RB + chan_desc->chF[i] = (struct complexd *) malloc(275 * 12 * sizeof(struct complexd)); // allocate for up to 275 RBs, 12 symbols per RB LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps); From dcae857463d55d19c579738fc3e0febc94b8b163 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 15 Feb 2022 20:48:09 +0100 Subject: [PATCH 527/883] Fix memory problems in nr_pucchsim except: - from dlopen() - from configuration module - uninitialized value --- openair1/SIMULATION/NR_PHY/pucchsim.c | 44 ++++++++++++++------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 34fe0ef543..2339e988f1 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -26,6 +26,7 @@ #include #include #include "common/config/config_userapi.h" +#include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" #include "common/ran_context.h" #include "PHY/types.h" @@ -70,7 +71,6 @@ int main(int argc, char **argv) double sigma2, sigma2_dB=10,SNR,snr0=-2.0,snr1=2.0; double cfo=0; uint8_t snr1set=0; - int **txdataF,**rxdataF; double **s_re,**s_im,**r_re,**r_im; //int sync_pos, sync_pos_slot; //FILE *rx_frame_file; @@ -372,7 +372,7 @@ int main(int argc, char **argv) printf("Transmitted payload is %ld, do_DTX = %d\n",actual_payload,do_DTX); - RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *)); + RC.gNB = calloc(1, sizeof(PHY_VARS_gNB *)); RC.gNB[0] = calloc(1,sizeof(PHY_VARS_gNB)); gNB = RC.gNB[0]; gNB->pucch0_thres = pucch_DTX_thres; @@ -441,24 +441,15 @@ int main(int argc, char **argv) s_im = malloc(n_tx*sizeof(double*)); r_re = malloc(n_rx*sizeof(double*)); r_im = malloc(n_rx*sizeof(double*)); - txdataF = malloc(n_tx*sizeof(int*)); - rxdataF = malloc(n_rx*sizeof(int*)); - gNB->common_vars.rxdataF=rxdataF; memcpy((void*)&gNB->frame_parms,(void*)frame_parms,sizeof(frame_parms)); for (int aatx=0; aatxsymbols_per_slot*frame_parms->ofdm_symbol_size); - txdataF[aatx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int)); - bzero(txdataF[aatx],14*frame_parms->ofdm_symbol_size*sizeof(int)); } for (int aarx=0; aarxsymbols_per_slot*frame_parms->ofdm_symbol_size); - rxdataF[aarx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int)); - bzero(rxdataF[aarx],14*frame_parms->ofdm_symbol_size*sizeof(int)); } uint8_t mcs=0; @@ -536,6 +527,7 @@ int main(int argc, char **argv) ack_nack_errors=0; sr_errors=0; n_errors = 0; + int **txdataF = gNB->common_vars.txdataF; for (trial=0; trialofdm_symbol_size*sizeof(int)); @@ -562,6 +554,7 @@ int main(int argc, char **argv) int i0; double txr,txi,rxr,rxi,nr,ni; + int **rxdataF = gNB->common_vars.rxdataF; for (int symb=0; symbframe_parms.symbols_per_slot;symb++) { if (symb= startingSymbolIndex+nrofSymbols) { i0 = symb*gNB->frame_parms.ofdm_symbol_size; @@ -662,20 +655,20 @@ int main(int argc, char **argv) sr_errors+=1; } // harq value 0 -> pass + nfapi_nr_harq_t *harq_list = uci_pdu.harq->harq_list; // confidence value 0 -> good confidence - const int harq_value0 = uci_pdu.harq->harq_list[0].harq_value; - const int harq_value1 = uci_pdu.harq->harq_list[1].harq_value; const int confidence_lvl = uci_pdu.harq->harq_confidence_level; if(nr_bit>0){ if (nr_bit==1 && do_DTX == 0) - ack_nack_errors+=(actual_payload^(!harq_value0)); + ack_nack_errors+=(actual_payload^(!harq_list[0].harq_value)); else if (do_DTX == 0) - ack_nack_errors+=(((actual_payload&1)^(!harq_value0))+((actual_payload>>1)^(!harq_value1))); - else if ((!confidence_lvl && !harq_value0) || - (!confidence_lvl && nr_bit == 2 && !harq_value1)) + ack_nack_errors+=(((actual_payload&1)^(!harq_list[0].harq_value))+((actual_payload>>1)^(!harq_list[1].harq_value))); + else if ((!confidence_lvl && !harq_list[0].harq_value) || + (!confidence_lvl && nr_bit == 2 && !harq_list[1].harq_value)) ack_nack_errors++; free(uci_pdu.harq->harq_list); } + free(uci_pdu.harq); } else if (format==1) { nr_decode_pucch1(rxdataF,PUCCH_GroupHopping,hopping_id, @@ -735,25 +728,34 @@ int main(int argc, char **argv) } } + free_channel_desc_scm(UE2gNB); + term_freq_channel(); + + phy_free_nr_gNB(gNB); + free(RC.gNB[0]); + free(RC.gNB); + + term_nr_ue_signal(UE, 1); + free(UE); + for (int aatx=0; aatx Date: Thu, 17 Feb 2022 14:58:52 +0100 Subject: [PATCH 528/883] Resolve memory issues in nr_prachsim Except for config module and dlopen() --- openair1/PHY/INIT/nr_init_ru.c | 34 ++++++++++++++------------- openair1/SCHED_NR/sched_nr.h | 1 + openair1/SIMULATION/NR_PHY/prachsim.c | 34 +++++++++++++++++++++++---- 3 files changed, 49 insertions(+), 20 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index d032746718..07f1d3b9e3 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -174,17 +174,13 @@ void nr_phy_free_RU(RU_t *ru) LOG_I(PHY, "Feeing RU signal buffers (if_south %s) nb_tx %d\n", ru_if_types[ru->if_south], ru->nb_tx); - free_and_zero(ru->nr_frame_parms); - free_and_zero(ru->frame_parms); - if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals - int32_t *ptr; - for (i = 0; i < ru->nb_tx; i++) { - ptr=&ru->common.txdata[i][-ru->sf_extension]; - free_and_zero(ptr); - } - for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata[i]); + for (i = 0; i < ru->nb_tx; i++) + free_and_zero(ru->common.txdata[i]); free_and_zero(ru->common.txdata); + + for (i = 0; i < ru->nb_rx; i++) + free_and_zero(ru->common.rxdata[i]); free_and_zero(ru->common.rxdata); } // else: IF5 or local RF -> nothing to free() @@ -193,7 +189,7 @@ void nr_phy_free_RU(RU_t *ru) free_and_zero(ru->common.rxdata_7_5kHz); // free beamforming input buffers (TX) - for (i = 0; i < 15; i++) free_and_zero(ru->common.txdataF[i]); + for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdataF[i]); free_and_zero(ru->common.txdataF); // free IFFT input buffers (TX) @@ -205,15 +201,21 @@ void nr_phy_free_RU(RU_t *ru) free_and_zero(ru->common.rxdataF); for (j=0;jnb_rx; i++) { + for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->prach_rxsigF[j][i]); - } + free_and_zero(ru->prach_rxsigF[j]); } - for (i = 0; i < ru->num_gNB; i++) { - for (p = 0; p < 15; p++) { - for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]); - free_and_zero(ru->beam_weights[i][p]); + + if (ru->do_precoding == 1) { + for (i = 0; i < ru->num_gNB; i++) { + for (p = 0; p < ru->nb_log_antennas; p++) { + for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]); + free_and_zero(ru->beam_weights[i][p]); + } } + for(i=0; i< ru->nb_tx; ++i) + free_and_zero(ru->common.beam_id[i]); + free_and_zero(ru->common.beam_id); } } free_and_zero(ru->common.sync_corr); diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index d7e0332b85..2124397c47 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -54,5 +54,6 @@ void nr_fep_full(RU_t *ru, int slot); void nr_fep_full_2thread(RU_t *ru, int slot); void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); int nr_phy_init_RU(RU_t *ru); +void nr_phy_free_RU(RU_t *ru); #endif diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 537612ac30..bc4f4a0b60 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -25,6 +25,7 @@ #include #include "common/config/config_userapi.h" +#include "common/utils/load_module_shlib.h" #include "common/utils/LOG/log.h" #include "common/ran_context.h" @@ -662,7 +663,6 @@ int main(int argc, char **argv){ RC.nb_nr_L1_inst=1; phy_init_nr_gNB(gNB,0,1); //lowmem nr_phy_init_RU(ru); - gNB->common_vars.rxdata = ru->common.rxdata; set_tdd_config_nr(&gNB->gNB_config, mu, 7, 6, 2, 4); // Configure UE @@ -781,7 +781,7 @@ int main(int argc, char **argv){ // multipath channel // dump_nr_prach_config(&gNB->frame_parms,subframe); - for (i = 0; i < frame_parms->samples_per_subframe<<1; i++) { + for (i = 0; i < frame_parms->samples_per_subframe; i++) { for (aa=0; aa<1; aa++) { if (awgn_flag == 0) { s_re[aa][i] = ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)]); @@ -879,7 +879,8 @@ int main(int argc, char **argv){ rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, prachOccasion, frame, slot); - gNB->prach_vars.rxsigF = ru->prach_rxsigF[prachOccasion]; + for (int i = 0; i < ru->nb_rx; ++i) + gNB->prach_vars.rxsigF[i] = ru->prach_rxsigF[prachOccasion][i]; if (n_frames == 1) printf("ncs %d,num_seq %d\n",prach_pdu->num_cs, prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value); rx_nr_prach(gNB, prach_pdu, prachOccasion, frame, subframe, &preamble_rx, &preamble_energy, &preamble_delay); @@ -897,7 +898,7 @@ int main(int argc, char **argv){ #ifdef NR_PRACH_DEBUG LOG_M("prach0.m","prach0", &txdata[0][prach_start], frame_parms->samples_per_subframe, 1, 1); LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1); - LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); + LOG_M("rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); LOG_M("ru_rxsigF0.m","rxsF0", ru->common.rxdataF[0], frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot, 1, 1); LOG_M("ru_prach_rxsigF0.m","rxsF0", ru->prach_rxsigF[0][0], N_ZC, 1, 1); @@ -922,6 +923,28 @@ int main(int argc, char **argv){ break; } //SNR loop + free_channel_desc_scm(UE2gNB); + + nr_phy_free_RU(ru); + free(RC.ru[0]); + free(RC.ru); + + phy_free_nr_gNB(gNB); + // allocated in set_tdd_config_nr() + int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<gNB_config.prach_config.num_prach_fd_occasions_list); + for (int i = 0; i < nb_slots_to_set; ++i) + free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list); + free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list); + free(RC.gNB[0]); + free(RC.gNB); + + term_nr_ue_signal(UE, 1); + free(UE->nrUE_config.prach_config.num_prach_fd_occasions_list); + free(UE); + free(PHY_vars_UE_g[0]); + free(PHY_vars_UE_g); + for (i=0; i<2; i++) { free(s_re[i]); free(s_im[i]); @@ -936,5 +959,8 @@ int main(int argc, char **argv){ if (input_fd) fclose(input_fd); + loader_reset(); + logTerm(); + return(0); } From be314a9770670a53d3a3de0dc12afd479eb334ec Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 16 Feb 2022 00:54:20 +0100 Subject: [PATCH 529/883] remove usage of undefined var in polar and memory leaks --- openair1/PHY/CODING/TESTBENCH/polartest.c | 2 +- .../CODING/nrPolar_tools/nr_polar_decoder.c | 144 ++++++++-------- .../nrPolar_tools/nr_polar_decoding_tools.c | 156 ++++++++--------- .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 97 +++-------- .../nrPolar_tools/nr_polar_matrix_and_array.c | 157 ------------------ 5 files changed, 172 insertions(+), 384 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index 8e7e377542..ddda974e10 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -160,7 +160,7 @@ if (logFlag){ uint8_t testArrayLength = ceil(testLength / 32.0); uint8_t coderArrayLength = ceil(coderLength / 32.0); - uint32_t testInput[testArrayLength]; //generate randomly + uint32_t testInput[min(2,testArrayLength)]; //generate randomly uint32_t encoderOutput[coderArrayLength]; uint32_t estimatedOutput[testArrayLength]; //decoder output memset(testInput,0,sizeof(uint32_t) * testArrayLength); diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index 8fe115b23a..a59307a875 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -39,19 +39,40 @@ #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "assertions.h" +static inline void updateCrcChecksum2(int xlen, + int ylen, + uint8_t crcChecksum[xlen][ylen], + int gxlen, + int gylen, + uint8_t crcGen[gxlen][gylen], + uint8_t listSize, + uint32_t i2, + uint8_t len) +{ + for (uint8_t i = 0; i < listSize; i++) { + for (uint8_t j = 0; j < len; j++) { + crcChecksum[j][i+listSize] = ( (crcChecksum[j][i] + crcGen[i2][j]) % 2 ); + } + } +} + int8_t polar_decoder(double *input, uint32_t *out, const t_nrPolar_params *polarParams, uint8_t listSize) { //Assumes no a priori knowledge. - uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize); - uint8_t **bitUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True - uint8_t **llrUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True - double ***llr = nr_alloc_double_3D_array(polarParams->N, (polarParams->n+1), 2*listSize); - uint8_t **crcChecksum = nr_alloc_uint8_2D_array(polarParams->crcParityBits, 2*listSize); - double *pathMetric = malloc(sizeof(double)*(2*listSize)); - uint8_t *crcState = malloc(sizeof(uint8_t)*(2*listSize)); //0=False, 1=True + uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; + memset(bit,0,sizeof bit); + uint8_t bitUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True + memset(bitUpdated,0,sizeof bitUpdated); + uint8_t llrUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True + memset(llrUpdated,0,sizeof llrUpdated); + double llr[polarParams->N][polarParams->n+1][2*listSize]; + uint8_t crcChecksum[polarParams->crcParityBits][2*listSize]; + memset(crcChecksum,0,sizeof crcChecksum); + double pathMetric[2*listSize]; + uint8_t crcState[2*listSize]; //0=False, 1=True for (int i=0; i<(2*listSize); i++) { pathMetric[i] = 0; @@ -63,13 +84,8 @@ int8_t polar_decoder(double *input, bitUpdated[i][0]=((polarParams->information_bit_pattern[i]+1) % 2); } - uint8_t **extended_crc_generator_matrix = malloc(polarParams->K * sizeof(uint8_t *)); //G_P3 - uint8_t **tempECGM = malloc(polarParams->K * sizeof(uint8_t *)); //G_P2 - - for (int i = 0; i < polarParams->K; i++) { - extended_crc_generator_matrix[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t)); - tempECGM[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t)); - } + uint8_t extended_crc_generator_matrix[polarParams->K][polarParams->crcParityBits]; //G_P3 + uint8_t tempECGM[polarParams->K][polarParams->crcParityBits]; //G_P2 for (int i=0; ipayloadBits; i++) { for (int j=0; jcrcParityBits; j++) { @@ -102,7 +118,7 @@ int8_t polar_decoder(double *input, } } - double *d_tilde = malloc(sizeof(double) * polarParams->N); + double d_tilde[polarParams->N]; nr_polar_rate_matching(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength); for (int j = 0; j < polarParams->N; j++) llr[j][polarParams->n][0]=d_tilde[j]; @@ -117,12 +133,12 @@ int8_t polar_decoder(double *input, uint8_t listIndex[2*listSize], copyIndex; for (uint16_t currentBit=0; currentBitN; currentBit++) { - updateLLR(llr, llrUpdated, bit, bitUpdated, currentListSize, currentBit, 0, polarParams->N, (polarParams->n+1)); + updateLLR(currentListSize, currentBit, 0, polarParams->N, polarParams->n+1, 2*listSize, llr, llrUpdated, bit, bitUpdated); if (polarParams->information_bit_pattern[currentBit]==0) { //Frozen bit. - updatePathMetric(pathMetric, llr, currentListSize, 0, currentBit); + updatePathMetric(pathMetric, currentListSize, 0, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr); } else { //Information or CRC bit. - updatePathMetric2(pathMetric, llr, currentListSize, currentBit); + updatePathMetric2(pathMetric, currentListSize, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr); for (int i = 0; i < currentListSize; i++) { for (int j = 0; j < polarParams->N; j++) { @@ -141,7 +157,9 @@ int8_t polar_decoder(double *input, for (int i = currentListSize; i < 2*currentListSize; i++) bit[currentBit][0][i]=1; bitUpdated[currentBit][0]=1; - updateCrcChecksum2(crcChecksum, extended_crc_generator_matrix, currentListSize, nonFrozenBit, polarParams->crcParityBits); + updateCrcChecksum2(polarParams->crcParityBits, 2*listSize, crcChecksum, + polarParams->K, polarParams->crcParityBits, extended_crc_generator_matrix, + currentListSize, nonFrozenBit, polarParams->crcParityBits); currentListSize*=2; //Keep only the best "listSize" number of entries. @@ -246,12 +264,12 @@ int8_t polar_decoder(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - free(d_tilde); - free(pathMetric); - free(crcState); - nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); + //free(d_tilde); + //free(pathMetric); + //free(crcState); + //nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); + //nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); + //nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); free(tempECGM); return(-1); } @@ -282,14 +300,6 @@ int8_t polar_decoder(double *input, } } - free(d_tilde); - free(pathMetric); - free(crcState); - nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); - nr_free_uint8_2D_array(extended_crc_generator_matrix, polarParams->K); - nr_free_uint8_2D_array(tempECGM, polarParams->K); /* * Return bits. */ @@ -302,13 +312,17 @@ int8_t polar_decoder_dci(double *input, const t_nrPolar_params *polarParams, uint8_t listSize, uint16_t n_RNTI) { - uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize); - uint8_t **bitUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True - uint8_t **llrUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True - double ***llr = nr_alloc_double_3D_array(polarParams->N, (polarParams->n+1), 2*listSize); - uint8_t **crcChecksum = nr_alloc_uint8_2D_array(polarParams->crcParityBits, 2*listSize); - double *pathMetric = malloc(sizeof(double)*(2*listSize)); - uint8_t *crcState = malloc(sizeof(uint8_t)*(2*listSize)); //0=False, 1=True + uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; + memset(bit,0,sizeof bit); + uint8_t bitUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True + memset(bitUpdated,0,sizeof bitUpdated); + uint8_t llrUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True + memset(llrUpdated,0,sizeof llrUpdated); + double llr[polarParams->N][polarParams->n+1][2*listSize]; + uint8_t crcChecksum[polarParams->crcParityBits][2*listSize]; + memset(crcChecksum,0,sizeof crcChecksum); + double pathMetric[2*listSize]; + uint8_t crcState[2*listSize]; //0=False, 1=True uint8_t extended_crc_scrambling_pattern[polarParams->crcParityBits]; for (int i=0; i<(2*listSize); i++) { @@ -321,13 +335,8 @@ int8_t polar_decoder_dci(double *input, bitUpdated[i][0]=((polarParams->information_bit_pattern[i]+1) % 2); } - uint8_t **extended_crc_generator_matrix = malloc(polarParams->K * sizeof(uint8_t *)); //G_P3: K-by-P - uint8_t **tempECGM = malloc(polarParams->K * sizeof(uint8_t *)); //G_P2: K-by-P - - for (int i = 0; i < polarParams->K; i++) { - extended_crc_generator_matrix[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t)); - tempECGM[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t)); - } + uint8_t extended_crc_generator_matrix[polarParams->K][polarParams->crcParityBits]; //G_P3: K-by-P + uint8_t tempECGM[polarParams->K][polarParams->crcParityBits]; //G_P2: K-by-P for (int i=0; ipayloadBits; i++) { for (int j=0; jcrcParityBits; j++) { @@ -366,17 +375,19 @@ int8_t polar_decoder_dci(double *input, extended_crc_scrambling_pattern[i]=(n_RNTI>>(23-i))&1; } - double *d_tilde = malloc(sizeof(double) * polarParams->N); + double d_tilde[polarParams->N]; nr_polar_rate_matching(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength); - for (int j = 0; j < polarParams->N; j++) llr[j][polarParams->n][0]=d_tilde[j]; + for (int j = 0; j < polarParams->N; j++) + llr[j][polarParams->n][0]=d_tilde[j]; /* * SCL polar decoder. */ for (int i=0; icrcParityBits; i++) { - for (int j=0; jcrcParityBits; j++) crcChecksum[i][0]=crcChecksum[i][0]+polarParams->crc_generator_matrix[j][i]; + for (int j=0; jcrcParityBits; j++) + crcChecksum[i][0]=crcChecksum[i][0]+polarParams->crc_generator_matrix[j][i]; crcChecksum[i][0]=(crcChecksum[i][0]%2); } @@ -388,12 +399,12 @@ int8_t polar_decoder_dci(double *input, uint8_t listIndex[2*listSize], copyIndex; for (uint16_t currentBit=0; currentBitN; currentBit++) { - updateLLR(llr, llrUpdated, bit, bitUpdated, currentListSize, currentBit, 0, polarParams->N, (polarParams->n+1)); + updateLLR(currentListSize, currentBit, 0, polarParams->N, polarParams->n+1, 2*listSize, llr, llrUpdated, bit, bitUpdated); if (polarParams->information_bit_pattern[currentBit]==0) { //Frozen bit. - updatePathMetric(pathMetric, llr, currentListSize, 0, currentBit); + updatePathMetric(pathMetric, currentListSize, 0, currentBit,polarParams->N, polarParams->n+1, 2*listSize, llr); } else { //Information or CRC bit. - updatePathMetric2(pathMetric, llr, currentListSize, currentBit); + updatePathMetric2(pathMetric, currentListSize, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr); for (int i = 0; i < currentListSize; i++) { for (int j = 0; j < polarParams->N; j++) { @@ -412,7 +423,9 @@ int8_t polar_decoder_dci(double *input, for (int i = currentListSize; i < 2*currentListSize; i++) bit[currentBit][0][i]=1; bitUpdated[currentBit][0]=1; - updateCrcChecksum2(crcChecksum, extended_crc_generator_matrix, currentListSize, nonFrozenBit, polarParams->crcParityBits); + updateCrcChecksum2(polarParams->crcParityBits, 2*listSize, crcChecksum, + polarParams->K, polarParams->crcParityBits, extended_crc_generator_matrix, + currentListSize, nonFrozenBit, polarParams->crcParityBits); currentListSize*=2; //Keep only the best "listSize" number of entries. @@ -513,16 +526,17 @@ int8_t polar_decoder_dci(double *input, } } - for (uint8_t i = 0; i < currentListSize; i++) decoderIterationCheck+=crcState[i]; + for (uint8_t i = 0; i < currentListSize; i++) + decoderIterationCheck+=crcState[i]; if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - free(d_tilde); - free(pathMetric); - free(crcState); - nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); + //free(d_tilde); + //free(pathMetric); + //free(crcState); + //nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); + //nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); + //nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); free(tempECGM); return(-1); } @@ -553,14 +567,6 @@ int8_t polar_decoder_dci(double *input, } } - free(d_tilde); - free(pathMetric); - free(crcState); - nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); - nr_free_uint8_2D_array(extended_crc_generator_matrix, polarParams->K); - nr_free_uint8_2D_array(tempECGM, polarParams->K); /* * Return bits. */ diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c index 42d500ae86..e8046ff622 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c @@ -36,51 +36,25 @@ //#define DEBUG_NEW_IMPL 1 -void updateLLR(double ***llr, - uint8_t **llrU, - uint8_t ***bit, - uint8_t **bitU, - uint8_t listSize, - uint16_t row, - uint16_t col, - uint16_t xlen, - uint8_t ylen) -{ - uint16_t offset = (xlen/(pow(2,(ylen-col-1)))); - for (uint8_t i=0; i= offset ) { - if(bitU[row-offset][col]==0) updateBit(bit, bitU, listSize, (row-offset), col, xlen, ylen); - if(llrU[row-offset][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, (row-offset), (col+1), xlen, ylen); - if(llrU[row][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, row, (col+1), xlen, ylen); - llr[row][col][i] = (pow((-1),bit[row-offset][col][i])*llr[row-offset][col+1][i]) + llr[row][col+1][i]; - } else { - if(llrU[row][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, row, (col+1), xlen, ylen); - if(llrU[row+offset][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, (row+offset), (col+1), xlen, ylen); - computeLLR(llr, row, col, i, offset); - } - } - llrU[row][col]=1; - // printf("LLR (a %f, b %f): llr[%d][%d] %f\n",32*a,32*b,col,row,32*llr[col][row]); -} - -void updateBit(uint8_t ***bit, - uint8_t **bitU, - uint8_t listSize, - uint16_t row, - uint16_t col, - uint16_t xlen, - uint8_t ylen) +static inline void updateBit(uint8_t listSize, + uint16_t row, + uint16_t col, + uint16_t xlen, + uint8_t ylen, + int zlen, + uint8_t bit[xlen][ylen][zlen], + uint8_t bitU[xlen][ylen]) { uint16_t offset = ( xlen/(pow(2,(ylen-col))) ); for (uint8_t i=0; i= offset ) { - if (bitU[row][col-1]==0) updateBit(bit, bitU, listSize, row, (col-1), xlen, ylen); + if (bitU[row][col-1]==0) updateBit(listSize, row, (col-1), xlen, ylen, zlen, bit, bitU); bit[row][col][i] = bit[row][col-1][i]; } else { - if (bitU[row][col-1]==0) updateBit(bit, bitU, listSize, row, (col-1), xlen, ylen); - if (bitU[row+offset][col-1]==0) updateBit(bit, bitU, listSize, (row+offset), (col-1), xlen, ylen); + if (bitU[row][col-1]==0) updateBit(listSize, row, (col-1), xlen, ylen, zlen, bit, bitU); + if (bitU[row+offset][col-1]==0) updateBit(listSize, (row+offset), (col-1), xlen, ylen, zlen, bit, bitU); bit[row][col][i] = ( (bit[row][col-1][i]+bit[row+offset][col-1][i]) % 2); } } @@ -88,11 +62,60 @@ void updateBit(uint8_t ***bit, bitU[row][col]=1; } +static inline void computeLLR(uint16_t row, + uint16_t col, + uint8_t i, + uint16_t offset, + int xlen, + int ylen, + int zlen, + double llr[xlen][ylen][zlen]) +{ + double a = llr[row][col + 1][i]; + double b = llr[row + offset][col + 1][i]; + llr[row][col][i] = log((exp(a + b) + 1) / (exp(a) + exp(b))); //eq. (8a) +} + + +void updateLLR(uint8_t listSize, + uint16_t row, + uint16_t col, + uint16_t xlen, + uint8_t ylen, + int zlen, + double llr[xlen][ylen][zlen], + uint8_t llrU[xlen][ylen], + uint8_t bit[xlen][ylen][zlen], + uint8_t bitU[xlen][ylen] + ) +{ + uint16_t offset = (xlen/(pow(2,(ylen-col-1)))); + for (uint8_t i=0; i= offset ) { + if(bitU[row-offset][col]==0) updateBit(listSize, (row-offset), col, xlen, ylen, zlen, bit, bitU); + if(llrU[row-offset][col+1]==0) updateLLR(listSize, (row-offset), (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU ); + if(llrU[row][col+1]==0) updateLLR(listSize, row, (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU); + llr[row][col][i] = (pow((-1),bit[row-offset][col][i])*llr[row-offset][col+1][i]) + llr[row][col+1][i]; + } else { + if(llrU[row][col+1]==0) updateLLR(listSize, row, (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU ); + if(llrU[row+offset][col+1]==0) updateLLR(listSize, (row+offset), (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU ); + computeLLR(row, col, i, offset, xlen, ylen, zlen, llr); + } + } + llrU[row][col]=1; + + // printf("LLR (a %f, b %f): llr[%d][%d] %f\n",32*a,32*b,col,row,32*llr[col][row]); +} + void updatePathMetric(double *pathMetric, - double ***llr, - uint8_t listSize, - uint8_t bitValue, - uint16_t row) + uint8_t listSize, + uint8_t bitValue, + uint16_t row, + int xlen, + int ylen, + int zlen, + double llr[xlen][ylen][zlen] + ) { int8_t multiplier = (2*bitValue) - 1; for (uint8_t i=0; i Date: Thu, 17 Feb 2022 15:03:44 +0100 Subject: [PATCH 530/883] with polar structures delete and better cpu performance --- openair1/PHY/CODING/TESTBENCH/polartest.c | 5 +-- .../PHY/CODING/nrPolar_tools/nr_crc_byte.c | 7 ++-- .../CODING/nrPolar_tools/nr_polar_decoder.c | 28 ++++----------- .../nrPolar_tools/nr_polar_decoding_tools.c | 17 ++++++++++ .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 3 +- .../CODING/nrPolar_tools/nr_polar_encoder.c | 2 +- openair1/PHY/CODING/nr_polar_init.c | 34 +++++++++++++++++-- 7 files changed, 66 insertions(+), 30 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index ddda974e10..af1228be07 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) { - //Default simulation values (Aim for iterations = 1000000.) + //Default simulation values (Aim for iterations = 1000000.) int decoder_int16=0; int itr, iterations = 1000, arguments, polarMessageType = 0; //0=PBCH, 1=DCI, 2=UCI double SNRstart = -20.0, SNRstop = 0.0, SNRinc= 0.5; //dB @@ -160,7 +160,7 @@ if (logFlag){ uint8_t testArrayLength = ceil(testLength / 32.0); uint8_t coderArrayLength = ceil(coderLength / 32.0); - uint32_t testInput[min(2,testArrayLength)]; //generate randomly + uint32_t testInput[max(2,testArrayLength)]; //generate randomly uint32_t encoderOutput[coderArrayLength]; uint32_t estimatedOutput[testArrayLength]; //decoder output memset(testInput,0,sizeof(uint32_t) * testArrayLength); @@ -357,5 +357,6 @@ if (logFlag){ print_meas(&timeEncoder,"polar_encoder",NULL,NULL); print_meas(&timeDecoder,"polar_decoder",NULL,NULL); if (logFlag) fclose(logFile); + nr_polar_delete(currentPtr); return (0); } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c b/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c index 461eb7d6f6..3a484ff991 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c @@ -29,12 +29,13 @@ uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits){ uint8_t crcPolynomialSize = 24; uint8_t temp1[crcPolynomialSize], temp2[crcPolynomialSize]; - uint8_t **crc_generator_matrix = malloc(payloadSizeBits * sizeof(uint8_t *)); + uint8_t **crc_generator_matrix = malloc(payloadSizeBits*sizeof(uint8_t *) + payloadSizeBits*crcPolynomialSize*sizeof(uint8_t)); if (crc_generator_matrix) for (int i = 0; i < payloadSizeBits; i++) - crc_generator_matrix[i] = malloc(crcPolynomialSize * sizeof(uint8_t)); + crc_generator_matrix[i] = ((uint8_t*)&crc_generator_matrix[payloadSizeBits])+i*crcPolynomialSize; - for (int i = 0; i < crcPolynomialSize; i++) crc_generator_matrix[payloadSizeBits-1][i]=crcPolynomialPattern[i+1]; + for (int i = 0; i < crcPolynomialSize; i++) + crc_generator_matrix[payloadSizeBits-1][i]=crcPolynomialPattern[i+1]; for (int i = payloadSizeBits-2; i >= 0; i--){ for (int j = 0; j < crcPolynomialSize-1; j++) temp1[j]=crc_generator_matrix[i+1][j+1]; diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index a59307a875..bdafb15d9c 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -141,18 +141,18 @@ int8_t polar_decoder(double *input, updatePathMetric2(pathMetric, currentListSize, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr); for (int i = 0; i < currentListSize; i++) { - for (int j = 0; j < polarParams->N; j++) { - for (int k = 0; k < (polarParams->n+1); k++) { + for (int j = 0; j < polarParams->N; j++) { + for (int k = 0; k < (polarParams->n+1); k++) { bit[j][k][i+currentListSize]=bit[j][k][i]; llr[j][k][i+currentListSize]=llr[j][k][i]; } - } + } } - for (int i = 0; i < currentListSize; i++) { - bit[currentBit][0][i]=0; - crcState[i+currentListSize]=crcState[i]; - } + for (int i = 0; i < currentListSize; i++) { + bit[currentBit][0][i]=0; + crcState[i+currentListSize]=crcState[i]; + } for (int i = currentListSize; i < 2*currentListSize; i++) bit[currentBit][0][i]=1; @@ -264,13 +264,6 @@ int8_t polar_decoder(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - //free(d_tilde); - //free(pathMetric); - //free(crcState); - //nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - //nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - //nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); - free(tempECGM); return(-1); } @@ -531,13 +524,6 @@ int8_t polar_decoder_dci(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - //free(d_tilde); - //free(pathMetric); - //free(crcState); - //nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1)); - //nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1)); - //nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits); - free(tempECGM); return(-1); } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c index e8046ff622..b201db2ba6 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c @@ -208,6 +208,23 @@ decoder_node_t *add_nodes(int level, int first_leaf_index, t_nrPolar_params *pol return(new_node); } +void delete_nodes(decoder_node_t * n) { + if (n) { + if(n->left) + delete_nodes(n->left); + if(n->right) + delete_nodes(n->right); + free(n->alpha); + free(n->beta); + free(n); + } +} + +void delete_decoder_tree(t_nrPolar_params *polarParams) { + if (polarParams->tree.root) + delete_nodes(polarParams->tree.root); +} + void build_decoder_tree(t_nrPolar_params *polarParams) { polarParams->tree.num_nodes=0; diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index 4e32c66127..de6e2c3222 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -332,5 +332,6 @@ static inline void nr_polar_deinterleaver(uint8_t *input, { for (int i=0; iN==512 || polarParams->N==256 || polarParams->N==128,"N = %d, not done yet\n",polarParams->N); // build G bit vectors for information bit positions and convert the bit as bytes tables in nr_polar_kronecker_power_matrices.c to 64 bit packed vectors. // keep only rows of G which correspond to information/crc bits - polarParams->G_N_tab = (uint64_t **)malloc((polarParams->K + polarParams->n_pc) * sizeof(int64_t *)); + polarParams->G_N_tab = (uint64_t **)calloc((polarParams->K + polarParams->n_pc),sizeof(int64_t *)); int k=0; for (int i=0; iN; i++) { diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index f6a700117d..5fd5ff404b 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -36,6 +36,37 @@ static int intcmp(const void *p1,const void *p2) { return(*(int16_t *)p1 > *(int16_t *)p2); } +void nr_polar_delete(t_nrPolar_params * polarParams) { + delete_decoder_tree(polarParams); + //From build_polar_tables() + for (int k=0; k < polarParams->K + polarParams->n_pc; k++) + if (polarParams->G_N_tab[k]) + free(polarParams->G_N_tab[k]); + free(polarParams->G_N_tab); + free(polarParams->rm_tab); + if (polarParams->crc_generator_matrix) + free(polarParams->crc_generator_matrix); + //polar_encoder vectors: + free(polarParams->nr_polar_crc); + free(polarParams->nr_polar_aPrime); + free(polarParams->nr_polar_APrime); + free(polarParams->nr_polar_D); + free(polarParams->nr_polar_E); + //Polar Coding vectors + free(polarParams->nr_polar_U); + free(polarParams->nr_polar_CPrime); + free(polarParams->nr_polar_B); + free(polarParams->nr_polar_A); + free(polarParams->interleaving_pattern); + free(polarParams->deinterleaving_pattern); + free(polarParams->rate_matching_pattern); + free(polarParams->information_bit_pattern); + free(polarParams->Q_I_N); + free(polarParams->Q_F_N); + free(polarParams->Q_PC_N); + free(polarParams->channel_interleaver_pattern); + free(polarParams); +} static void nr_polar_init(t_nrPolar_params * *polarParams, int8_t messageType, @@ -151,7 +182,7 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, newPolarInitNode->deinterleaving_pattern[newPolarInitNode->interleaving_pattern[i]] = i; newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); - uint16_t *J = malloc(sizeof(uint16_t) * newPolarInitNode->N); + uint16_t J[newPolarInitNode->N]; nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern, J, nr_polar_subblock_interleaver_pattern, @@ -181,7 +212,6 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern, newPolarInitNode->i_bil, newPolarInitNode->encoderLength); - free(J); if (decoder_flag == 1) build_decoder_tree(newPolarInitNode); build_polar_tables(newPolarInitNode); init_polar_deinterleaver_table(newPolarInitNode); From 65c6456472d2045e41f150ce5ba52a04594f1f55 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 17 Feb 2022 17:48:37 +0100 Subject: [PATCH 531/883] Resolve buffer overflows polartest --- openair1/PHY/CODING/TESTBENCH/polartest.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index af1228be07..409b91a8f6 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -158,14 +158,19 @@ if (logFlag){ #endif } - uint8_t testArrayLength = ceil(testLength / 32.0); - uint8_t coderArrayLength = ceil(coderLength / 32.0); - uint32_t testInput[max(2,testArrayLength)]; //generate randomly + const uint8_t testArrayLength = ceil(testLength / 32.0); + const uint8_t coderArrayLength = ceil(coderLength / 32.0); + // in the polar code, often uint64_t arrays are used, but we work with + // uint32_t arrays below, so realArrayLength is the length that always + // satisfies uint64_t array length + const uint8_t realArrayLength = ((testArrayLength + 1) / 2) * 2; + printf("testArrayLength %d realArrayLength %d\n", testArrayLength, realArrayLength); + uint32_t testInput[realArrayLength]; //generate randomly uint32_t encoderOutput[coderArrayLength]; - uint32_t estimatedOutput[testArrayLength]; //decoder output - memset(testInput,0,sizeof(uint32_t) * testArrayLength); + uint32_t estimatedOutput[realArrayLength]; //decoder output + memset(testInput,0,sizeof(uint32_t) * realArrayLength); // does not reset all memset(encoderOutput,0,sizeof(uint32_t) * coderArrayLength); - memset(estimatedOutput,0,sizeof(uint32_t) * testArrayLength); + memset(estimatedOutput,0,sizeof(uint32_t) * realArrayLength); uint8_t encoderOutputByte[coderLength]; double modulatedInput[coderLength]; //channel input double channelOutput[coderLength]; //add noise @@ -334,9 +339,9 @@ if (logFlag){ decoderState=0; nBitError=0; blockErrorState=0; - memset(testInput,0,sizeof(uint32_t) * testArrayLength); + memset(testInput,0,sizeof(uint32_t) * realArrayLength); memset(encoderOutput,0,sizeof(uint32_t) * coderArrayLength); - memset(estimatedOutput,0,sizeof(uint32_t) * testArrayLength); + memset(estimatedOutput,0,sizeof(uint32_t) * realArrayLength); } //Calculate error statistics for the SNR. From 2251453cbdbc649f5df9c84f0f9857e16a651a19 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 14:42:05 +0100 Subject: [PATCH 532/883] Fix nr_dlschsim: correct size for N_RB_DL Fix warning, drop undefined function --- openair1/PHY/NR_TRANSPORT/nr_ulsch.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 5 ++--- openair1/SCHED_NR_UE/defs.h | 3 --- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h index 9929ee0602..0791fd2bbc 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h @@ -33,7 +33,7 @@ #include "PHY/defs_gNB.h" #include "common/utils/threadPool/thread-pool.h" -void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch,uint8_t N_RB_UL); +void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch, uint16_t N_RB_UL); NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index af67c03481..e9ed278bb1 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -54,7 +54,7 @@ //extern double cpuf; -void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr,uint8_t N_RB_UL) +void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL) { int i,r; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index f02e0ebd8a..a9b8ce2e55 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -79,7 +79,7 @@ void init_dlsch_tpool(uint8_t num_dlsch_threads) { free(params); } -void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) { +void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) { int i,r; uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated NR_UE_DLSCH_t *dlsch=*dlschptr; 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 504ab93889..e956d9ea51 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -50,7 +50,7 @@ \brief This function frees memory allocated for a particular DLSCH at UE @param dlsch Pointer to DLSCH to be removed */ -void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch,uint8_t N_RB_DL); +void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch, uint16_t N_RB_DL); /** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index a3e0b668d0..d77fe35047 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -107,7 +107,6 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL) NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) { - unsigned char exit_flag = 0,i,r; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated if (N_RB_UL != 273) { @@ -127,7 +126,7 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) //for (i=0; i<10; i++) //ulsch->harq_ids[i] = 0; - for (i=0; iharq_processes[i] = malloc16(sizeof(NR_UL_UE_HARQ_t)); DevAssert(ulsch->harq_processes[i]); @@ -141,7 +140,7 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids) DevAssert(ulsch->harq_processes[i]->b); bzero(ulsch->harq_processes[i]->b,ulsch_bytes); - for (r=0; rharq_processes[i]->c[r] = malloc16(8448); DevAssert(ulsch->harq_processes[i]->c[r]); diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index b85d4c1b50..c362bb470f 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -295,9 +295,6 @@ uint8_t nr_pdcch_alloc2ul_subframe(NR_DL_FRAME_PARMS *frame_parms,uint8_t n); uint32_t nr_pdcch_alloc2ul_frame(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n); -uint16_t nr_get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1); - - int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); /*! \brief UL time alignment procedures for TA application From d6012090363dd7b3662a70dd89a175b96c5dc26a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 14:54:30 +0100 Subject: [PATCH 533/883] Fix nr_ulschsim: correct size for N_RB_UL --- openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 e956d9ea51..9bc3643557 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -64,7 +64,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch, uint16_t N_RB_DL); NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL); -void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch,unsigned char N_RB_UL); +void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch, uint16_t N_RB_UL); NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c index d77fe35047..0ab4c94b96 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c @@ -43,7 +43,7 @@ //#define DEBUG_ULSCH_CODING -void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL) +void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL) { int i, r; From 3f4fa05c7498ceac60af2dc964a732a5c43f6b52 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 15:07:05 +0100 Subject: [PATCH 534/883] nr_pucchsim: correctly free SR PDU --- openair1/SIMULATION/NR_PHY/pucchsim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 2339e988f1..084a735204 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -653,6 +653,7 @@ int main(int argc, char **argv) if(sr_flag==1){ if (uci_pdu.sr->sr_indication == 0 || uci_pdu.sr->sr_confidence_level == 1) sr_errors+=1; + free(uci_pdu.sr); } // harq value 0 -> pass nfapi_nr_harq_t *harq_list = uci_pdu.harq->harq_list; From fe61216a66b93a82fcb8bc32c5f31da8e964afe0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 15:48:05 +0100 Subject: [PATCH 535/883] Correctly free memory in nr_pbchsim Except for: - polar code --- openair1/SIMULATION/NR_PHY/pbchsim.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index a141dfbe9e..f3a8d21fdd 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -27,6 +27,7 @@ #include #include "common/config/config_userapi.h" #include "common/utils/LOG/log.h" +#include "common/utils/load_module_shlib.h" #include "common/ran_context.h" #include "common/utils/nr/nr_common.h" #include "PHY/types.h" @@ -775,6 +776,15 @@ int main(int argc, char **argv) } // NSR + free_channel_desc_scm(gNB2UE); + + phy_free_nr_gNB(gNB); + free(RC.gNB[0]); + free(RC.gNB); + + term_nr_ue_signal(UE, 1); + free(UE); + for (i=0; i<2; i++) { free(s_re[i]); free(s_im[i]); @@ -795,6 +805,9 @@ int main(int argc, char **argv) if (input_fd) fclose(input_fd); + loader_reset(); + logTerm(); + return(n_errors); } From cdea2899bc531e4dce0f4c51e2c7300de836283c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 16:24:51 +0100 Subject: [PATCH 536/883] Remove memory leaks from ldpctest except for: - config module --- openair1/PHY/CODING/TESTBENCH/ldpctest.c | 59 +++++++----------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c index 371deba3f2..58d649d011 100644 --- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c +++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c @@ -25,6 +25,7 @@ #include #include "assertions.h" #include "SIMULATION/TOOLS/sim.h" +#include "common/utils/load_module_shlib.h" #include "PHY/CODING/nrLDPC_extern.h" //#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h" #include "openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.h" @@ -118,15 +119,13 @@ int test_ldpc(short No_iteration, //short test_input[block_length]; unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};; //short *c; //padded codeword - unsigned char *estimated_output[MAX_NUM_DLSCH_SEGMENTS]; - unsigned char *estimated_output_bit[MAX_NUM_DLSCH_SEGMENTS]; - unsigned char *test_input_bit; + unsigned char estimated_output[MAX_NUM_DLSCH_SEGMENTS][block_length]; + memset(estimated_output, 0, sizeof(estimated_output)); unsigned char *channel_input[MAX_NUM_DLSCH_SEGMENTS]; - unsigned char *channel_output_uncoded[MAX_NUM_DLSCH_SEGMENTS]; unsigned char *channel_input_optim[MAX_NUM_DLSCH_SEGMENTS]; - double *channel_output; - double *modulated_input[MAX_NUM_DLSCH_SEGMENTS]; - char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS]; + //double channel_output[68 * 384]; + double modulated_input[MAX_NUM_DLSCH_SEGMENTS][68 * 384] = { 0 }; + char channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS][68 * 384] = { 0 }; unsigned int i,j,trial=0; short BG=0,nrows=0;//,ncols; int no_punctured_columns,removed_bit; @@ -155,24 +154,12 @@ int test_ldpc(short No_iteration, // generate input block for(j=0;j>(i&7); - test_input_bit[i] = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments - if (estimated_output_bit[j][i] != test_input_bit[i]) - { + unsigned char estoutputbit = (estimated_output[j][i/8]&(1<<(i&7)))>>(i&7); + unsigned char inputbit = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments + if (estoutputbit != inputbit) *errors_bit = (*errors_bit) + 1; - } } //if (*errors == 1000) @@ -460,17 +441,8 @@ int test_ldpc(short No_iteration, for(j=0;j Date: Fri, 18 Feb 2022 19:42:21 +0100 Subject: [PATCH 537/883] Do not create CMakeLists.txt; new build_oai option -d --- cmake_targets/CMakeLists.txt | 6 +- cmake_targets/build_oai | 165 ++++++++++++++--------------------- 2 files changed, 67 insertions(+), 104 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index a4624066ae..68f53132d2 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -21,7 +21,8 @@ # Author: laurent THOMAS, Lionel GAUTHIER -cmake_minimum_required (VERSION 3.0) +cmake_minimum_required (VERSION 2.8) +project (OpenAirInterface LANGUAGES C CXX) # System packages that are required @@ -341,7 +342,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11") - +add_boolean_option(SANITIZE_ADDRESS False "enable the address sanitizer (ASan)") if (SANITIZE_ADDRESS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common") @@ -788,7 +789,6 @@ add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU") -add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET") #NOKIA config enhancement set (CONFIG_ROOTDIR ${OPENAIR_DIR}/common/config diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index c2b6305831..6b19047cdc 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -39,34 +39,24 @@ conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf XFORMS="True" SKIP_SHARED_LIB_FLAG="False" -UE_EXPANSION="False" PRINT_STATS="False" -VCD_TIMING="False" DEADLINE_SCHEDULER_FLAG_USER="" -CPU_AFFINITY_FLAG_USER="False" #Only valid when low-latency flag is set to False REL="Rel15" HW="None" TP="Ethernet" EPC=0 VERBOSE_CI=0 VERBOSE_COMPILE=0 -CFLAGS_PROCESSOR_USER="" RUN_GROUP=0 TEST_CASE_GROUP="" +BUILD_DIR=ran_build BUILD_DOXYGEN=0 BUILD_COVERITY_SCAN=0 -T_TRACER="True" DISABLE_HARDWARE_DEPENDENCY="False" CMAKE_BUILD_TYPE="RelWithDebInfo" CMAKE_CMD="$CMAKE" -UE_AUTOTEST_TRACE="False" -UE_DEBUG_TRACE="False" -UE_TIMING_TRACE="False" -USRP_REC_PLAY="False" BUILD_ECLIPSE=0 NR="False" -ITTI_SIM="False" -SANITIZE_ADDRESS="False" OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope" RU=0 trap handle_ctrl_c INT @@ -82,6 +72,8 @@ Options Erase all files made by previous compilations, installations --clean-kernel Erase previously installed features in kernel: iptables, drivers, ... +-d | --build-dir + Sets build directory (will be /cmake_targets//build) -I | --install-external-packages Installs required packages such as LibXML, asn1.1 compiler, freediameter, ... This option will require root password @@ -201,6 +193,9 @@ function main() { clean_kernel echo_info "Erased iptables config and removed modules from kernel" shift;; + -d | --build-dir) + BUILD_DIR=$2 + shift;; -I | --install-external-packages) INSTALL_EXTERNAL=1 echo_info "Will install external packages" @@ -275,7 +270,7 @@ function main() { echo_info "Will compile NR UE" shift;; --mu) - UE_EXPANSION="True" + CMAKE_CMD="$CMAKE_CMD -DUE_EXPANSION=True -DPRE_SCD_THREAD=True" echo_info "Will compile with UE_EXPANSION" shift;; --UE-conf-nvram) @@ -299,7 +294,9 @@ function main() { *) echo_fatal "Unknown HW type $HW: exit..." esac - echo_info "Setting hardware to: $HW" + echo_info "Setting hardware to: $HW" + #CMAKE_CMD="$CMAKE_CMD -DRF_BOARD=\"${HW}\"" + CMAKE_CMD="$CMAKE_CMD -DRF_BOARD=${HW}" shift 2;; -t | --transport) TP=$2 @@ -323,7 +320,7 @@ function main() { shift 2;; -V | --vcd) echo_info "Setting gtk-wave output" - VCD_TIMING=1 + CMAKE_CMD="$CMAKE_CMD -DENABLE_VCD_FIFO=True" EXE_ARGUMENTS="$EXE_ARGUMENTS -V" shift;; -x | --xforms) @@ -348,8 +345,8 @@ function main() { echo_info "Will compile with verbose instructions" shift;; --cflags_processor) - CFLAGS_PROCESSOR_USER=$2 - echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER" + CMAKE_CMD="$CMAKE_CMD -DCFLAGS_PROCESSOR_USER=\"$2\"" + echo_info "Setting CPU FLAGS from USER to: $2" shift 2;; --build-doxygen) BUILD_DOXYGEN=1 @@ -361,22 +358,26 @@ function main() { shift;; --disable-deadline) DEADLINE_SCHEDULER_FLAG_USER="False" + CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=False" echo_info "Disabling the usage of deadline scheduler" shift 1;; --enable-deadline) DEADLINE_SCHEDULER_FLAG_USER="True" + CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=True" echo_info "Enabling the usage of deadline scheduler" shift 1;; --enable-cpu-affinity) CPU_AFFINITY_FLAG_USER="True" + CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=True" echo_info "Enabling CPU Affinity (only valid when not using deadline scheduler)" shift 1;; --disable-cpu-affinity) CPU_AFFINITY_FLAG_USER="False" + CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False" echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)" shift 1;; --disable-T-Tracer) - T_TRACER="False" + CMAKE_CMD="$CMAKE_CMD -DT_TRACER=False" echo_info "Disabling the T tracer" shift 1;; --disable-hardware-dependency) @@ -384,15 +385,15 @@ function main() { DISABLE_HARDWARE_DEPENDENCY="True" shift 1;; --ue-autotest-trace) - UE_AUTOTEST_TRACE="True" + CMAKE_CMD="$CMAKE_CMD -DUE_AUTOTEST_TRACE=True" echo_info "Enabling autotest specific trace for UE" shift 1;; --ue-trace) - UE_DEBUG_TRACE="True" + CMAKE_CMD="$CMAKE_CMD -DUE_DEBUG_TRACE=False" echo_info "Enabling UE trace for debug" shift 1;; --ue-timing) - UE_TIMING_TRACE="True" + CMAKE_CMD="$CMAKE_CMD -DUE_TIMING_TRACE=True" echo_info "Enabling UE timing trace" shift 1;; --uhd-images-dir) @@ -423,24 +424,20 @@ function main() { fi fi shift 2;; - --usrp-recplay) - USRP_REC_PLAY="True" - echo_info "Enabling USRP record playback mode" - shift 1;; -k | --skip-shared-libraries) SKIP_SHARED_LIB_FLAG="True" echo_info "Skipping build of shared libraries, rfsimulator and transport protocol libraries" shift;; - --ninja) - CMAKE_CMD="$CMAKE_CMD -GNinja" - MAKE_CMD=ninja - shift;; - --sanitize-address | -fsanitize=address) - SANITIZE_ADDRESS=True - shift;; - --ittiSIM) + --ninja) + CMAKE_CMD="$CMAKE_CMD -GNinja" + MAKE_CMD=ninja + shift;; + --sanitize-address | -fsanitize=address) + CMAKE_CMD="$CMAKE_CMD -DSANITIZE_ADDRESS=True" + shift;; + --ittiSIM) ittiSIM=1 - ITTI_SIM="True" + CMAKE_CMD="$CMAKE_CMD -DITTI_SIM=True" echo_info "Will compile itti simulator" shift;; -h | --help) @@ -466,9 +463,6 @@ function main() { fi fi - CMAKE_CMD="$CMAKE_CMD .." - echo_info "CMAKE_CMD=$CMAKE_CMD" - ######################################################## # Check validity of HW and TP parameters for eNB / gNB # ######################################################## @@ -508,6 +502,7 @@ function main() { #Disable CPU Affinity for deadline scheduler if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then CPU_AFFINITY_FLAG_USER="False" + CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False" fi echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER" @@ -585,45 +580,13 @@ function main() { echo_info "3. building the compilation directives ..." DIR=$OPENAIR_DIR/cmake_targets - if [ "$T_TRACER" = "False" ] ; then - build_dir=ran_build_noLOG - else - build_dir=ran_build - fi - [ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build - mkdir -p $DIR/$build_dir/build + [ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build + mkdir -p $DIR/$BUILD_DIR/build -# configuration module libraries, one currently available, using libconfig - config_libconfig_shlib=params_libconfig - - # first generate the CMakefile in the right directory - # softmodem compilation - - cmake_file=$DIR/$build_dir/CMakeLists.txt - echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file - echo "project (OpenAirInterface)" >> $cmake_file - echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file - echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file - echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file - # echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file - echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file - echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file - echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file - echo "set ( PACKAGE_NAME \"${exec}\")" >> $cmake_file - echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >> $cmake_file - echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >> $cmake_file - echo "set ( T_TRACER $T_TRACER )" >> $cmake_file - echo "set ( UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE )" >> $cmake_file - echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )" >> $cmake_file - echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file - echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file - echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file - echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file - echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file - echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file - cd $DIR/$build_dir/build + cd $DIR/$BUILD_DIR/build + CMAKE_CMD="$CMAKE_CMD ../.." + echo_info "running $CMAKE_CMD" eval $CMAKE_CMD execlist="" @@ -653,7 +616,7 @@ function main() { for f in $execlist ; do echo_info "Compiling $f..." compilations \ - $build_dir $f \ + $BUILD_DIR $f \ $f $dbin/$f.$REL done @@ -662,13 +625,16 @@ function main() { if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then echo_info "Building shared libraries common to UE and gNB" + + # configuration module libraries, one currently available, using libconfig + config_libconfig_shlib=params_libconfig compilations \ - $build_dir $config_libconfig_shlib \ + $BUILD_DIR $config_libconfig_shlib \ lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so compilations \ - $build_dir coding \ + $BUILD_DIR coding \ libcoding.so $dbin/libcoding.so fi @@ -681,7 +647,7 @@ function main() { then echo_info "Building ue_ip module" compilations \ - $build_dir ue_ip \ + $BUILD_DIR ue_ip \ CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko else echo_info "Bypassing ue_ip build" @@ -712,16 +678,16 @@ function main() { # generate USIM data if [ -f $dbin/conf2uedata ]; then install_nas_tools $conf_nvram_path $gen_nvram_path "$dlog/conf2uedata.txt" - echo_info "Copying UE specific part to $DIR/$build_dir/build" - cp -Rvf $dbin/.ue_emm.nvram0 $DIR/$build_dir/build - cp -Rvf $dbin/.ue.nvram0 $DIR/$build_dir/build - cp -Rvf $dbin/.usim.nvram0 $DIR/$build_dir/build + echo_info "Copying UE specific part to $DIR/$BUILD_DIR/build" + cp -Rvf $dbin/.ue_emm.nvram0 $DIR/$BUILD_DIR/build + cp -Rvf $dbin/.ue.nvram0 $DIR/$BUILD_DIR/build + cp -Rvf $dbin/.usim.nvram0 $DIR/$BUILD_DIR/build else echo_warning "not generated UE NAS files: binaries not found" fi fi - cd $DIR/$build_dir/build + cd $DIR/$BUILD_DIR/build ################## # PHY simulators # @@ -739,9 +705,6 @@ function main() { compilations \ ran_build coding \ libcoding.so $dbin/libcoding.so -# compilations \ -# lte-simulators $config_libconfig_shlib \ -# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so fi ################### @@ -763,14 +726,14 @@ function main() { if [ "$HW" = "EXMIMO" ] ; then echo_info "Compiling Express MIMO 2 board drivers" compilations \ - $build_dir openair_rf \ + $BUILD_DIR openair_rf \ CMakeFiles/openair_rf/openair_rf.ko $dbin/openair_rf.ko compilations \ - $build_dir updatefw \ + $BUILD_DIR updatefw \ updatefw $dbin/updatefw echo_info "Compiling oarf tools. The logfile for compilation is here: $dlog/oarf.txt" - make -C $OPENAIR_DIR/cmake_targets/$build_dir/build oarf > $dlog/oarf.txt 2>&1 - cp $OPENAIR_DIR/cmake_targets/$build_dir/build/*.oct $dbin + make -C $OPENAIR_DIR/cmake_targets/$BUILD_DIR/build oarf > $dlog/oarf.txt 2>&1 + cp $OPENAIR_DIR/cmake_targets/$BUILD_DIR/build/*.oct $dbin if [ -s $dbin/oarf_config_exmimo.oct ] ; then echo_success "oarf tools compiled" else @@ -785,7 +748,7 @@ function main() { if [ ! -z "$BUILD_OPTLIB" ] ; then for oklib in $BUILD_OPTLIB ; do compilations \ - $build_dir $oklib \ + $BUILD_DIR $oklib \ lib${oklib}.so $dbin/lib${oklib}.so done fi @@ -859,7 +822,7 @@ function main() { # link liboai_device.so with the selected RF device library if [ "$HW" == "EXMIMO" ] ; then compilations \ - $build_dir oai_exmimodevif \ + $BUILD_DIR oai_exmimodevif \ liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL ln -sf liboai_exmimodevif.so liboai_device.so @@ -867,7 +830,7 @@ function main() { echo_info "liboai_device.so is linked to EXMIMO device library" elif [ "$HW" == "OAI_USRP" ] ; then compilations \ - $build_dir oai_usrpdevif \ + $BUILD_DIR oai_usrpdevif \ liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL ln -sf liboai_usrpdevif.so liboai_device.so @@ -876,7 +839,7 @@ function main() { elif [ "$HW" == "OAI_BLADERF" ] ; then if [ -f "/usr/include/libbladeRF.h" ] ; then compilations \ - $build_dir oai_bladerfdevif \ + $BUILD_DIR oai_bladerfdevif \ liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL fi @@ -886,7 +849,7 @@ function main() { elif [ "$HW" == "OAI_LMSSDR" ] ; then # if [ -f "/usr/include/libbladeRF.h" ] ; then compilations \ - $build_dir oai_lmssdrdevif \ + $BUILD_DIR oai_lmssdrdevif \ liboai_lmssdrdevif.so $dbin/liboai_lmssdrdevif.so.$REL # fi @@ -895,7 +858,7 @@ function main() { echo_info "liboai_device.so is linked to LMSSDR device library" elif [ "$HW" == "OAI_IRIS" ] ; then compilations \ - $build_dir oai_irisdevif \ + $BUILD_DIR oai_irisdevif \ liboai_irisdevif.so $dbin/liboai_irisdevif.so.$REL ln -s liboai_irisdevif.so liboai_device.so @@ -915,7 +878,7 @@ function main() { echo_info "liboai_device.so is linked to ADRV9371_ZC706 device library for Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN" elif [ "$HW" == "OAI_AW2SORI" ] ; then compilations \ - $build_dir aw2sori_transpro \ + $BUILD_DIR aw2sori_transpro \ libaw2sori_transpro.so $dbin/libaw2sori_transpro.so.$REL ln -sf libaw2sori_transpro.so libthirdparty_transpro.so @@ -930,12 +893,12 @@ function main() { if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then echo_info "Compiling rfsimulator" compilations \ - $build_dir rfsimulator \ + $BUILD_DIR rfsimulator \ librfsimulator.so $dbin/librfsimulator.so.$REL echo_info "Compiling tcp_bridge_oai" compilations \ - $build_dir tcp_bridge_oai \ + $BUILD_DIR tcp_bridge_oai \ libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL fi @@ -946,7 +909,7 @@ function main() { rm -f $dbin/liboai_transpro.so if [ "$TP" == "Ethernet" ]; then compilations \ - $build_dir oai_eth_transpro \ + $BUILD_DIR oai_eth_transpro \ liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL ln -sf liboai_eth_transpro.so liboai_transpro.so ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so @@ -954,7 +917,7 @@ function main() { fi if [ "$TP" == "benetel4g" ]; then compilations \ - $build_dir benetel_4g \ + $BUILD_DIR benetel_4g \ libbenetel_4g.so $dbin/libbenetel_4g.$REL ln -sf libbenetel_4g.so liboai_transpro.so ln -sf $dbin/libbenetel_4g.so.$REL $dbin/liboai_transpro.so @@ -962,7 +925,7 @@ function main() { fi if [ "$TP" == "benetel5g" ]; then compilations \ - $build_dir benetel_5g \ + $BUILD_DIR benetel_5g \ libbenetel_5g.so $dbin/libbenetel_5g.$REL ln -sf libbenetel_5g.so liboai_transpro.so ln -sf $dbin/libbenetel_5g.so.$REL $dbin/liboai_transpro.so From 990385eea0f371987edada279c6d30c8fd279203 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 15 Nov 2020 23:47:17 +0100 Subject: [PATCH 538/883] Move CMake macro definitions to separate file --- cmake_targets/CMakeLists.txt | 101 +---------------------------------- cmake_targets/macros.cmake | 98 +++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 100 deletions(-) create mode 100644 cmake_targets/macros.cmake diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 68f53132d2..5d5306fe93 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -24,6 +24,7 @@ cmake_minimum_required (VERSION 2.8) project (OpenAirInterface LANGUAGES C CXX) +include("macros.cmake") # System packages that are required # We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/ @@ -185,106 +186,6 @@ else (CUDA_FOUND) message ("No CUDA tool installed") endif () - -########################################### -# macros to define options as there is numerous options in oai -################################################ -macro(add_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - add_definitions("-D${name}=${value}") -endmacro(add_option) - -macro(add_boolean_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - set_property(CACHE ${name} PROPERTY TYPE BOOL) - if (${value}) - add_definitions("-D${name}") - endif (${value}) -endmacro(add_boolean_option) - -macro(add_integer_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - add_definitions("-D${name}=${value}") -endmacro(add_integer_option) - -macro(add_list1_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) - if(NOT "${value}" STREQUAL "False") - add_definitions("-D${name}=${value}") - endif() -endmacro(add_list1_option) - -macro(add_list2_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) - if(NOT "${value}" STREQUAL "False") - add_definitions("-D${value}=1") - endif() -endmacro(add_list2_option) - -macro(add_list_string_option name val helpstr) - if(DEFINED ${name}) - set(value ${${name}}) - else(DEFINED ${name}) - set(value ${val}) - endif() - set(${name} ${value} CACHE STRING "${helpstr}") - set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) - if(NOT "${value}" STREQUAL "False") - add_definitions("-D${name}=\"${value}\"") - endif() -endmacro(add_list_string_option) - -# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h) -function(make_version VERSION_VALUE) - math(EXPR RESULT "0") - foreach (ARG ${ARGN}) - math(EXPR RESULT "${RESULT} * 16 + ${ARG}") - endforeach() - set(${VERSION_VALUE} "${RESULT}" PARENT_SCOPE) -endfunction() - -macro(compile_asn1 asn1Source asn1cCmd ResultFlag) - # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make - execute_process(COMMAND ${asn1cCmd} ${asn1Source} RESULT_VARIABLE ret) - - if (NOT ${ret} STREQUAL 0) - message(FATAL_ERROR "${ret}: error") - endif (NOT ${ret} STREQUAL 0) - - add_custom_target ( - ${ResultFlag} ALL - ${asn1cCmd} ${asn1Source} - DEPENDS ${asn1Source} - ) -endmacro(compile_asn1) - #################################################### # compilation flags ############################################# diff --git a/cmake_targets/macros.cmake b/cmake_targets/macros.cmake new file mode 100644 index 0000000000..0417420af4 --- /dev/null +++ b/cmake_targets/macros.cmake @@ -0,0 +1,98 @@ +########################################### +# macros to define options as there is numerous options in oai +################################################ +macro(add_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + add_definitions("-D${name}=${value}") +endmacro(add_option) + +macro(add_boolean_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + set_property(CACHE ${name} PROPERTY TYPE BOOL) + if (${value}) + add_definitions("-D${name}") + endif (${value}) +endmacro(add_boolean_option) + +macro(add_integer_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + add_definitions("-D${name}=${value}") +endmacro(add_integer_option) + +macro(add_list1_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) + if(NOT "${value}" STREQUAL "False") + add_definitions("-D${name}=${value}") + endif() +endmacro(add_list1_option) + +macro(add_list2_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) + if(NOT "${value}" STREQUAL "False") + add_definitions("-D${value}=1") + endif() +endmacro(add_list2_option) + +macro(add_list_string_option name val helpstr) + if(DEFINED ${name}) + set(value ${${name}}) + else(DEFINED ${name}) + set(value ${val}) + endif() + set(${name} ${value} CACHE STRING "${helpstr}") + set_property(CACHE ${name} PROPERTY STRINGS ${ARGN}) + if(NOT "${value}" STREQUAL "False") + add_definitions("-D${name}=\"${value}\"") + endif() +endmacro(add_list_string_option) + +# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h) +function(make_version VERSION_VALUE) + math(EXPR RESULT "0") + foreach (ARG ${ARGN}) + math(EXPR RESULT "${RESULT} * 16 + ${ARG}") + endforeach() + set(${VERSION_VALUE} "${RESULT}" PARENT_SCOPE) +endfunction() + +macro(compile_asn1 asn1Source asn1cCmd ResultFlag) + # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make + execute_process(COMMAND ${asn1cCmd} ${asn1Source} RESULT_VARIABLE ret) + + if (NOT ${ret} STREQUAL 0) + message(FATAL_ERROR "${ret}: error") + endif (NOT ${ret} STREQUAL 0) + + add_custom_target ( + ${ResultFlag} ALL + ${asn1cCmd} ${asn1Source} + DEPENDS ${asn1Source} + ) +endmacro(compile_asn1) From f51590b54684511e655d3947e26f880b7de0a8ed Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Feb 2022 20:22:07 +0100 Subject: [PATCH 539/883] Don't leak check in {nr_,}{d,u}lsim, fix buffer overflows in dlsim --- cmake_targets/CMakeLists.txt | 3 +-- openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c | 2 +- openair1/SIMULATION/LTE_PHY/dlsim.c | 11 +++++++++-- openair1/SIMULATION/NR_PHY/dlsim.c | 6 ++++++ openair1/SIMULATION/NR_PHY/ulsim.c | 6 ++++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 5d5306fe93..7c60d316e1 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -50,6 +50,7 @@ include_directories(${CRYPTO_INCLUDE_DIRS}) #uhd 4.0 and iris installs by default in /usr/local include_directories("/usr/local/include/") #use native cmake method as this package is not in pkg-config +add_list2_option(RF_BOARD "None" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU" "EXMIMO") if (${RF_BOARD} STREQUAL "OAI_USRP") find_package(Boost REQUIRED) include_directories(${LIBBOOST_INCLUDE_DIR}) @@ -688,8 +689,6 @@ add_library(F1AP ${F1AP_C_FILES} ) add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4") add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4") -add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU") - #NOKIA config enhancement set (CONFIG_ROOTDIR ${OPENAIR_DIR}/common/config diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c index a7054a44d2..0b665737a7 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c @@ -6481,7 +6481,7 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round); sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round); LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_uespec_pilots[0], - 12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1); + 12*(ue->frame_parms.N_RB_DL),1,1); /* LOG_M("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*NSYMB,1,1); LOG_M("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*NSYMB,1,1); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index c1443700f3..8f9fcae563 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -64,6 +64,13 @@ void feptx_ofdm(RU_t *ru, int frame, int subframe); void feptx_prec(RU_t *ru, int frame, int subframe); +const char *__asan_default_options() +{ + /* don't do leak checking in nr_ulsim, not finished yet */ + return "detect_leaks=0"; +} + + double cpuf; #define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0)) //#define MCS_COUNT 23//added for PHY abstraction @@ -1538,9 +1545,9 @@ int main(int argc, char **argv) { LOG_M("txsig0.m","txs0", &ru->common.txdata[0][subframe* eNB->frame_parms.samples_per_tti], eNB->frame_parms.samples_per_tti,1,1); if (transmission_mode<7) { - LOG_M("txsigF0.m","txsF0x", &ru->common.txdataF_BF[0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); + LOG_M("txsigF0.m","txsF0x", &ru->common.txdataF_BF[0][0],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); } else if (transmission_mode == 7) { - LOG_M("txsigF0.m","txsF0", &ru->common.txdataF_BF[5][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); + LOG_M("txsigF0.m","txsF0", &ru->common.txdataF_BF[5][0],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1); LOG_M("txsigF0_BF.m","txsF0_BF", &ru->common.txdataF_BF[0][0],eNB->frame_parms.ofdm_symbol_size,1,1); } } diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 8e20a84f81..acbb6e323d 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -73,6 +73,12 @@ #include #include +const char *__asan_default_options() +{ + /* don't do leak checking in nr_ulsim, not finished yet */ + return "detect_leaks=0"; +} + LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC; rlc_info_t Rlc_info_um,Rlc_info_am_config; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 3a7381062f..99434413c8 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -68,6 +68,12 @@ #include //#define DEBUG_ULSIM +const char *__asan_default_options() +{ + /* don't do leak checking in nr_ulsim, not finished yet */ + return "detect_leaks=0"; +} + LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC; rlc_info_t Rlc_info_um,Rlc_info_am_config; From 32824030f418e50479366c1c27d0c9c4a4b9ad10 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 19 Feb 2022 10:12:07 +0100 Subject: [PATCH 540/883] Fix cmake command target CMakeLists.txt --- cmake_targets/build_oai | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 6b19047cdc..930f2a7f77 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -585,9 +585,8 @@ function main() { mkdir -p $DIR/$BUILD_DIR/build cd $DIR/$BUILD_DIR/build - CMAKE_CMD="$CMAKE_CMD ../.." echo_info "running $CMAKE_CMD" - eval $CMAKE_CMD + eval $CMAKE_CMD ../.. execlist="" if [ "$eNB" = "1" ] ; then @@ -664,7 +663,7 @@ function main() { mkdir -p $DIR/nas_sim_tools/build cd $DIR/nas_sim_tools/build - eval $CMAKE_CMD + eval $CMAKE_CMD .. compilations \ nas_sim_tools usim \ usim $dbin/usim @@ -946,7 +945,7 @@ function main() { [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build cd $OPENAIR_DIR/cmake_targets/doxygen/build - eval $CMAKE_CMD + eval $CMAKE_CMD .. make doc ) >& $doxygen_log fi From 0ad3faaf2a07d53742e12bd30bf3a80918c52fe3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 19 Feb 2022 13:50:11 +0100 Subject: [PATCH 541/883] Disable ASAN on ulsim --- openair1/SIMULATION/LTE_PHY/ulsim.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 1b1058535e..8f275bbd91 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -58,6 +58,12 @@ #include "common/ran_context.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h" +const char *__asan_default_options() +{ + /* don't do leak checking in ulsim, not finished yet */ + return "detect_leaks=0"; +} + double cpuf; #define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0)) //#define MCS_COUNT 23//added for PHY abstraction From e8278de15ce7be1d393e382cd6636fb8c34b3b7b Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 21 Feb 2022 12:09:25 +0100 Subject: [PATCH 542/883] fix for 5G NR UL transform precoding get_index_for_dmrs_lowpapr_seq() was accessing the array dmrs_ul_allocated_res[] out of bounds. --- openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c index 69a9722664..c3c4c7a2ee 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c @@ -122,23 +122,20 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC, *********************************************************************/ int16_t get_index_for_dmrs_lowpapr_seq(int16_t num_dmrs_res) { - - int16_t index = -1; - - if (num_dmrs_res >= dmrs_ul_allocated_res[(MAX_INDEX_DMRS_UL_ALLOCATED_REs-1)]) + + int16_t index = num_dmrs_res/6 - 1; + + if (index >= MAX_INDEX_DMRS_UL_ALLOCATED_REs) index = MAX_INDEX_DMRS_UL_ALLOCATED_REs-1; - else - index = (num_dmrs_res/6) -1; for (;index >= 0; index--) { if (dmrs_ul_allocated_res[index] == num_dmrs_res) break; - } - LOG_D(PHY, "num_dmrs_res: %d INDEX RETURNED: %d", num_dmrs_res, index); - return index; + LOG_D(PHY, "num_dmrs_res: %d INDEX RETURNED: %d", num_dmrs_res, index); + return index; } /******************************************************************* From 9aba6d722b23c69e8ce87caf0682d3a8e5fb337e Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 21 Feb 2022 13:05:23 +0100 Subject: [PATCH 543/883] fix bugs in polar encode, when len+crc_len>64 --- .../CODING/nrPolar_tools/nr_polar_encoder.c | 49 +++++++++-------- openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 2 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 53 ++++++++++--------- 3 files changed, 54 insertions(+), 50 deletions(-) diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c index 3bbae7ece0..01ea511afe 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c @@ -422,7 +422,6 @@ void polar_encoder_fast(uint64_t *A, // AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K); AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K); AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits); - uint64_t B[4]= {0,0,0,0},Cprime[4]= {0,0,0,0}; int bitlen = polarParams->payloadBits; // append crc AssertFatal(bitlen<129,"support for payloads <= 128 bits\n"); @@ -451,9 +450,12 @@ void polar_encoder_fast(uint64_t *A, A32_flip[1+offset]=((uint8_t *)&Aprime)[2]; A32_flip[2+offset]=((uint8_t *)&Aprime)[1]; A32_flip[3+offset]=((uint8_t *)&Aprime)[0]; - if (polarParams->crcParityBits == 24) tcrc = (uint64_t)(((crcmask^(crc24c(A32_flip,8*offset+bitlen)>>8)))&0xffffff); - else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)(((crcmask^(crc11(A32_flip,bitlen)>>21)))&0x7ff); - else if (polarParams->crcParityBits == 6) tcrc = (uint64_t)(((crcmask^(crc6(A32_flip,bitlen)>>26)))&0x3f); + if (polarParams->crcParityBits == 24) + tcrc = (uint64_t)(((crcmask^(crc24c(A32_flip,8*offset+bitlen)>>8)))&0xffffff); + else if (polarParams->crcParityBits == 11) + tcrc = (uint64_t)(((crcmask^(crc11(A32_flip,bitlen)>>21)))&0x7ff); + else if (polarParams->crcParityBits == 6) + tcrc = (uint64_t)(((crcmask^(crc6(A32_flip,bitlen)>>26)))&0x3f); } else if (bitlen<=64) { uint8_t A64_flip[8+offset]; if (ones_flag) { @@ -470,8 +472,10 @@ void polar_encoder_fast(uint64_t *A, A64_flip[5+offset]=((uint8_t *)&Aprime)[2]; A64_flip[6+offset]=((uint8_t *)&Aprime)[1]; A64_flip[7+offset]=((uint8_t *)&Aprime)[0]; - if (polarParams->crcParityBits == 24) tcrc = (uint64_t)((crcmask^(crc24c(A64_flip,8*offset+bitlen)>>8)))&0xffffff; - else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)((crcmask^(crc11(A64_flip,bitlen)>>21)))&0x7ff; + if (polarParams->crcParityBits == 24) + tcrc = (uint64_t)((crcmask^(crc24c(A64_flip,8*offset+bitlen)>>8)))&0xffffff; + else if (polarParams->crcParityBits == 11) + tcrc = (uint64_t)((crcmask^(crc11(A64_flip,bitlen)>>21)))&0x7ff; } else if (bitlen<=128) { uint8_t A128_flip[16+offset]; @@ -481,38 +485,37 @@ void polar_encoder_fast(uint64_t *A, A128_flip[2] = 0xff; } uint128_t Aprime= (uint128_t)(((uint128_t)*A)<<(128-bitlen)); - A128_flip[0+offset]=((uint8_t*)&Aprime)[15]; A128_flip[1+offset]=((uint8_t*)&Aprime)[14]; - A128_flip[2+offset]=((uint8_t*)&Aprime)[13]; A128_flip[3+offset]=((uint8_t*)&Aprime)[12]; - A128_flip[4+offset]=((uint8_t*)&Aprime)[11]; A128_flip[5+offset]=((uint8_t*)&Aprime)[10]; - A128_flip[6+offset] =((uint8_t*)&Aprime)[9]; A128_flip[7+offset] =((uint8_t*)&Aprime)[8]; - A128_flip[8+offset] =((uint8_t*)&Aprime)[7]; A128_flip[9+offset] =((uint8_t*)&Aprime)[6]; - A128_flip[10+offset]=((uint8_t*)&Aprime)[5]; A128_flip[11+offset]=((uint8_t*)&Aprime)[4]; - A128_flip[12+offset]=((uint8_t*)&Aprime)[3]; A128_flip[13+offset]=((uint8_t*)&Aprime)[2]; - A128_flip[14+offset]=((uint8_t*)&Aprime)[1]; A128_flip[15+offset]=((uint8_t*)&Aprime)[0]; - if (polarParams->crcParityBits == 24) tcrc = (uint64_t)((crcmask^(crc24c(A128_flip,8*offset+bitlen)>>8)))&0xffffff; - else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)((crcmask^(crc11(A128_flip,bitlen)>>21)))&0x7ff; + for (int i=0; i<16 ; i++) + A128_flip[i+offset]=((uint8_t*)&Aprime)[15-i]; + if (polarParams->crcParityBits == 24) + tcrc = (uint64_t)((crcmask^(crc24c(A128_flip,8*offset+bitlen)>>8)))&0xffffff; + else if (polarParams->crcParityBits == 11) + tcrc = (uint64_t)((crcmask^(crc11(A128_flip,bitlen)>>21)))&0x7ff; } int n; // this is number of quadwords in the bit string - int quadwlen = (polarParams->K>>6); - - if ((polarParams->K&63) > 0) quadwlen++; + int quadwlen = (polarParams->K+63)/64; // Create the B bit string as // 0, 0, ..., 0, a'_0, a'_1, ..., a'_A-1, p_0, p_1, ..., p_{N_parity-1} //??? b_{N'-1} b_{N'-2} ... b_{N'-A} b_{N'-A-1} ... b_{N'-A-Nparity} = a_{N-1} a_{N-2} ... a_{N-A} p_{N_parity-1} ... p_0 - - for (n=0; ncrcParityBits) | tcrc; - else B[n] = (A[n] << polarParams->crcParityBits) | (A[n-1]>>(64-polarParams->crcParityBits)); + uint64_t B[4]= {0}; + B[0] = (A[0] << polarParams->crcParityBits) | tcrc; + for (n=1; n n) + B[n] = (A[n] << polarParams->crcParityBits) | (A[n-1]>>(64-polarParams->crcParityBits)); + else + B[n] = (A[n-1]>>(64-polarParams->crcParityBits)); uint8_t *Bbyte = (uint8_t *)B; // for each byte of B, lookup in corresponding table for 64-bit word corresponding to that byte and its position + uint64_t Cprime[4]= {0}; if (polarParams->K<65) Cprime[0] = polarParams->cprime_tab0[0][Bbyte[0]] | - polarParams->cprime_tab0[1][Bbyte[1]] | + polarParams->cprime_tab0[1][Bbyte[1]] | polarParams->cprime_tab0[2][Bbyte[2]] | polarParams->cprime_tab0[3][Bbyte[3]] | polarParams->cprime_tab0[4][Bbyte[4]] | diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index ddec605253..85651f498a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -850,7 +850,7 @@ static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_ printf("\t\t [nr_pucch2_3_4_scrambling] scrambling M_bit=%d bits\n", M_bit); #endif } -void nr_uci_encoding(uint64_t payload, +static void nr_uci_encoding(uint64_t payload, uint8_t nr_bit, int fmt, uint8_t is_pi_over_2_bpsk_enabled, diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 084a735204..16b3589a95 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -552,19 +552,17 @@ int main(int argc, char **argv) if (n_trials==1) printf("txlev %d (%f dB), offset %d, sigma2 %f ( %f dB)\n",txlev,10*log10(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size,sigma2,sigma2_dB); - int i0; - double txr,txi,rxr,rxi,nr,ni; - int **rxdataF = gNB->common_vars.rxdataF; + struct complex16 **rxdataF = (struct complex16 **)gNB->common_vars.rxdataF; for (int symb=0; symbframe_parms.symbols_per_slot;symb++) { if (symb= startingSymbolIndex+nrofSymbols) { - i0 = symb*gNB->frame_parms.ofdm_symbol_size; + int i0 = symb*gNB->frame_parms.ofdm_symbol_size; for (int re=0;reframe_parms.first_carrier_offset + re)%gNB->frame_parms.ofdm_symbol_size); for (int aarx=0;aarxframe_parms.ofdm_symbol_size; + int i0 = (startingSymbolIndex + symb)*gNB->frame_parms.ofdm_symbol_size; for (int re=0;reframe_parms.first_carrier_offset + re)%gNB->frame_parms.ofdm_symbol_size); - phasor.r = cos(2*M_PI*phase*re); + struct complexd phasor; + phasor.r = cos(2*M_PI*phase*re); phasor.i = sin(2*M_PI*phase*re); for (int aarx=0;aarxchF[aarx][re].r - txi*UE2gNB->chF[aarx][re].i; - rxi = txr*UE2gNB->chF[aarx][re].i + txi*UE2gNB->chF[aarx][re].r; - rxr_tmp = rxr*phasor.r - rxi*phasor.i; + double txr = (double)(((int16_t *)txdataF[0])[(i<<1)]); + double txi = (double)(((int16_t *)txdataF[0])[1+(i<<1)]); + double rxr={0},rxi={0}; + for (int l = 0; lchannel_length; l++) { + rxr = txr*UE2gNB->chF[aarx][l].r - txi*UE2gNB->chF[aarx][l].i; + rxi = txr*UE2gNB->chF[aarx][l].i + txi*UE2gNB->chF[aarx][l].r; + } + double rxr_tmp = rxr*phasor.r - rxi*phasor.i; rxi = rxr*phasor.i + rxi*phasor.r; rxr = rxr_tmp; - nr = sqrt(sigma2/2)*gaussdouble(0.0,1.0); - ni = sqrt(sigma2/2)*gaussdouble(0.0,1.0); - ((int16_t*)rxdataF[aarx])[i<<1] = (int16_t)(100.0*(rxr + nr)/sqrt((double)txlev)); - ((int16_t*)rxdataF[aarx])[1+(i<<1)]=(int16_t)(100.0*(rxi + ni)/sqrt((double)txlev)); + double nr = sqrt(sigma2/2)*gaussdouble(0.0,1.0); + double ni = sqrt(sigma2/2)*gaussdouble(0.0,1.0); + rxdataF[aarx][i].r = (int16_t)(100.0*(rxr + nr)/sqrt((double)txlev)); + rxdataF[aarx][i].i=(int16_t)(100.0*(rxi + ni)/sqrt((double)txlev)); if (n_trials==1 && abs(txr) > 0) printf("symb %d, re %d , aarx %d : txr %f, txi %f, chr %f, chi %f, nr %f, ni %f, rxr %f, rxi %f => %d,%d\n", symb, re, aarx, txr,txi, UE2gNB->chF[aarx][re].r,UE2gNB->chF[aarx][re].i, nr,ni, rxr,rxi, - ((int16_t*)rxdataF[aarx])[i<<1],((int16_t*)rxdataF[aarx])[1+(i<<1)]); + rxdataF[aarx][i].r,rxdataF[aarx][i].i); } } } int rxlev=0; - for (int aarx=0;aarxofdm_symbol_size], + for (int aarx=0;aarxofdm_symbol_size], frame_parms->ofdm_symbol_size); int rxlev_pucch=0; - for (int aarx=0;aarxofdm_symbol_size], + for (int aarx=0;aarxofdm_symbol_size], 12); // set UL mask for pucch allocation @@ -672,7 +672,7 @@ int main(int argc, char **argv) free(uci_pdu.harq); } else if (format==1) { - nr_decode_pucch1(rxdataF,PUCCH_GroupHopping,hopping_id, + nr_decode_pucch1((int32_t **)rxdataF,PUCCH_GroupHopping,hopping_id, &(payload_received),frame_parms,amp,nr_slot_tx, m0,nrofSymbols,startingSymbolIndex,startingPRB, startingPRB_intraSlotHopping,timeDomainOCC,nr_bit); @@ -728,7 +728,8 @@ int main(int argc, char **argv) break; } } - + if (gNB->uci_polarParams) + nr_polar_delete(gNB->uci_polarParams); free_channel_desc_scm(UE2gNB); term_freq_channel(); From 77c8439ba337b6f338eecea96e97a6fbf14bf000 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 21 Feb 2022 15:24:17 +0100 Subject: [PATCH 544/883] remoing unused parameter --- openair1/PHY/INIT/nr_parms.c | 9 --------- openair1/PHY/defs_nr_common.h | 4 ---- 2 files changed, 13 deletions(-) diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 20dfd20508..35bc28d9c1 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -266,15 +266,6 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg, fp->nb_antennas_rx = cfg->carrier_config.num_rx_ant.value; // It denotes the number of rx antennas at gNB fp->nb_antennas_tx = cfg->carrier_config.num_tx_ant.value; // It corresponds to pdsch_AntennaPorts (logical antenna ports) - //RRC Parameters: depends on the physical structure of the gNB Uniform planner array - if (fp->nb_antennas_tx == 4) - fp->antennas_tx_n1_n2 = 1;//NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction; - else if (fp->nb_antennas_tx == 8) - fp->antennas_tx_n1_n2 = 3;//NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction; - else if (fp->nb_antennas_tx == 12) - fp->antennas_tx_n1_n2 = 5;//NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction; - else//We currently support codebook 1 for nrOfAntennaPorts < 16 - fp->antennas_tx_n1_n2 = 0;//NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_NOTHING; fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index b309e663ed..c7b59f70c2 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -344,10 +344,6 @@ struct NR_DL_FRAME_PARMS { uint8_t numerology_index; /// Number of Physical transmit antennas in node (corresponds to nrOfAntennaPorts) uint8_t nb_antennas_tx; - /// UPA Panel Antenna configuration: two_one, two_two, four_one, three_two, six_one, etc - uint8_t antennas_tx_n1_n2; - /// UPA Panel Antenna Type: non, Single panel, or multiple - uint8_t antennas_tx_panel_type; /// Number of Receive antennas in node uint8_t nb_antennas_rx; /// Number of common transmit antenna ports in eNodeB (1 or 2) From 0b7be7466e01816a2f79cfb21f5e99faa08b61ff Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 10 Feb 2022 15:33:08 +0100 Subject: [PATCH 545/883] fix(ci): display state of container when failure, better tshark filtering, auto-undeploy if deploy went wrong Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 27 ++++++++++++++----- ci-scripts/main.py | 2 +- .../container_4g_rfsim_fdd_05MHz.xml | 2 +- .../container_4g_rfsim_fdd_05MHz_noS1.xml | 2 +- .../container_4g_rfsim_fdd_10MHz.xml | 2 +- .../container_4g_rfsim_fdd_20MHz.xml | 2 +- .../container_4g_rfsim_tdd_05MHz.xml | 2 +- .../5g_f1_rfsimulator/docker-compose.yaml | 24 ++++++++--------- .../5g_rfsimulator/docker-compose.yaml | 10 +++---- 9 files changed, 44 insertions(+), 29 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index e606513935..eca75617a6 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -636,7 +636,7 @@ class Containerize(): mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + self.eNB_logFile[self.eNB_instance], self.eNBSourceCodePath + '/cmake_targets/') logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') - def DeployGenObject(self, HTML): + def DeployGenObject(self, HTML, RAN, UE): self.exitStatus = 0 logging.info('\u001B[1m Checking Services to deploy\u001B[0m') cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose config --services' @@ -677,14 +677,17 @@ class Containerize(): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps -a' count = 0 healthy = 0 + containerStatus = [] while (count < 10): count += 1 + containerStatus = [] deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) healthy = 0 for state in deployStatus.split('\n'): res = re.search('Up \(healthy\)', state) if res is not None: healthy += 1 + containerStatus.append(state) if healthy == self.nb_healthy[0]: count = 100 else: @@ -694,27 +697,39 @@ class Containerize(): if self.tsharkStarted == False: logging.debug('Starting tshark on public network') self.CaptureOnDockerNetworks() - self.tsharkStarted = True HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m') else: - self.exitStatus = 1 HTML.CreateHtmlTestRow('Could not deploy in time', 'KO', CONST.ALL_PROCESSES_OK) + for cState in containerStatus: + logging.debug(cState) logging.error('\u001B[1m Deploying OAI Object(s) FAILED\u001B[0m') + HTML.testCase_id = 'AUTO-UNDEPLOY' + UE.testCase_id = 'AUTO-UNDEPLOY' + HTML.desc = 'Automatic Undeployment' + UE.desc = 'Automatic Undeployment' + UE.ShowTestID() + self.UndeployGenObject(HTML, RAN, UE) + self.exitStatus = 1 def CaptureOnDockerNetworks(self): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"' networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com and not port 2152"' + if re.search('4g.*rfsimulator', self.yamlPath[0]) is not None: + cmd = 'sudo nohup tshark -f "(host 192.168.61.11 and icmp) or (not host 192.168.61.11 and not host 192.168.61.30 and not arp and not port 53 and not port 2152)"' + elif re.search('5g.*rfsimulator', self.yamlPath[0]) is not None: + cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not arp and not port 53 and not port 2152 and not port 2153)"' + else: + return for name in networkNames.split('\n'): - res = re.search('rfsim', name) - if res is not None: + if re.search('rfsim', name) is not None: cmd += ' -i ' + name cmd += ' -w /tmp/capture_' ymlPath = self.yamlPath[0].split('/') cmd += ymlPath[1] + '.pcap > /tmp/tshark.log 2>&1 &' logging.debug(cmd) networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) + self.tsharkStarted = True def UndeployGenObject(self, HTML, RAN, UE): self.exitStatus = 0 diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 43772fb655..5357a90a3d 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -910,7 +910,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re elif action == 'Deploy_Run_PhySim': PHYSIM.Deploy_PhySim(HTML, RAN) elif action == 'DeployGenObject': - CONTAINERS.DeployGenObject(HTML) + CONTAINERS.DeployGenObject(HTML, RAN, CiTestObj) if CONTAINERS.exitStatus==1: RAN.prematureExit = True elif action == 'UndeployGenObject': diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index fd254f1856..55f60b8307 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -80,7 +80,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (FDD 05MHz) + Deploy OAI 4G LTE-UE RF sim (FDD 05MHz) yaml_files/4g_rfsimulator_fdd_05MHz oai_ue0 8 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml index 2ff9461b93..07ea358ad5 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml @@ -60,7 +60,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (FDD 05MHz) + Deploy OAI 4G LTE-UE RF sim (FDD 05MHz) yaml_files/4g_rfsimulator_fdd_05MHz_noS1 oai_ue0 2 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml index f00e277c36..d5152c7779 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -80,7 +80,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (FDD 10MHz) + Deploy OAI 4G LTE-UE RF sim (FDD 10MHz) yaml_files/4g_rfsimulator_fdd_10MHz oai_ue0 8 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml index 52e1ac7de1..0c5b9d43bd 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -80,7 +80,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (FDD 20MHz) + Deploy OAI 4G LTE-UE RF sim (FDD 20MHz) yaml_files/4g_rfsimulator_fdd_20MHz oai_ue0 8 diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml index cdaee430ef..aa70db1fed 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml @@ -81,7 +81,7 @@ DeployGenObject - Deploy OAI 4G NR-UE RF sim (TDD 05MHz) + Deploy OAI 4G LTE-UE RF sim (TDD 05MHz) yaml_files/4g_rfsimulator_tdd_05MHz oai_ue0 8 diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml index 6a39f2147e..74a23905f0 100644 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml @@ -241,12 +241,12 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eth0 - GNB_NGA_IP_ADDRESS: 192.168.71.136 + GNB_NGA_IP_ADDRESS: 192.168.71.140 GNB_NGU_IF_NAME: eth0 - GNB_NGU_IP_ADDRESS: 192.168.71.136 + GNB_NGU_IP_ADDRESS: 192.168.71.140 F1_IF_NAME: eth0 - F1_CU_IP_ADDRESS: 192.168.71.136 - F1_DU_IP_ADDRESS: 192.168.71.138 + F1_CU_IP_ADDRESS: 192.168.71.140 + F1_DU_IP_ADDRESS: 192.168.71.142 F1_CU_D_PORT: 2153 F1_DU_D_PORT: 2153 USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time @@ -254,7 +254,7 @@ services: - oai-ext-dn networks: public_net: - ipv4_address: 192.168.71.136 + ipv4_address: 192.168.71.140 healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -277,12 +277,12 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eth0 - GNB_NGA_IP_ADDRESS: 192.168.71.138 + GNB_NGA_IP_ADDRESS: 192.168.71.142 GNB_NGU_IF_NAME: eth0 - GNB_NGU_IP_ADDRESS: 192.168.71.138 + GNB_NGU_IP_ADDRESS: 192.168.71.142 F1_IF_NAME: eth0 - F1_CU_IP_ADDRESS: 192.168.71.136 - F1_DU_IP_ADDRESS: 192.168.71.138 + F1_CU_IP_ADDRESS: 192.168.71.140 + F1_DU_IP_ADDRESS: 192.168.71.142 F1_CU_D_PORT: 2153 F1_DU_D_PORT: 2153 USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time @@ -290,7 +290,7 @@ services: - oai-cu networks: public_net: - ipv4_address: 192.168.71.138 + ipv4_address: 192.168.71.142 healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -301,7 +301,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - RFSIMULATOR: 192.168.71.138 + RFSIMULATOR: 192.168.71.142 FULL_IMSI: '208990100001100' FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' OPC: 'C42449363BBAD02B66D16BC975D77CC1' @@ -313,7 +313,7 @@ services: - oai-du networks: public_net: - ipv4_address: 192.168.71.137 + ipv4_address: 192.168.71.150 healthcheck: test: /bin/bash -c "pgrep nr-uesoftmodem" interval: 10s diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml index f0476b0a1e..808be7d83d 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml @@ -241,15 +241,15 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eth0 - GNB_NGA_IP_ADDRESS: 192.168.71.136 + GNB_NGA_IP_ADDRESS: 192.168.71.140 GNB_NGU_IF_NAME: eth0 - GNB_NGU_IP_ADDRESS: 192.168.71.136 + GNB_NGU_IP_ADDRESS: 192.168.71.140 USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time depends_on: - oai-ext-dn networks: public_net: - ipv4_address: 192.168.71.136 + ipv4_address: 192.168.71.140 healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -260,7 +260,7 @@ services: privileged: true container_name: rfsim5g-oai-nr-ue environment: - RFSIMULATOR: 192.168.71.136 + RFSIMULATOR: 192.168.71.140 FULL_IMSI: '208990100001100' FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' OPC: 'C42449363BBAD02B66D16BC975D77CC1' @@ -272,7 +272,7 @@ services: - oai-gnb networks: public_net: - ipv4_address: 192.168.71.137 + ipv4_address: 192.168.71.150 healthcheck: test: /bin/bash -c "pgrep nr-uesoftmodem" interval: 10s From 2728ce02c8906d2c82f7469c9a99d1763cdc5791 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 10 Feb 2022 16:51:35 +0100 Subject: [PATCH 546/883] feat(ci): switching from OAI-MME to MAGMA-MME for RF sim testing Signed-off-by: Raphael Defosseux --- .../docker-compose.yml | 70 +++----- .../4g_rfsimulator_fdd_05MHz/entrypoint.sh | 36 ++++ .../4g_rfsimulator_fdd_05MHz/mme.conf | 134 ++++++++++++++ .../mme_fd.sprint.conf | 169 ++++++++++++++++++ .../redis_extern.conf | 33 ++++ .../docker-compose.yml | 70 +++----- .../docker-compose.yml | 70 +++----- .../docker-compose.yml | 70 +++----- 8 files changed, 488 insertions(+), 164 deletions(-) create mode 100755 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf create mode 100644 ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml index e852643ab9..b15e794c10 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml @@ -58,57 +58,45 @@ services: timeout: 5s retries: 5 - oai_mme: - image: oai-mme:latest - container_name: rfsim4g-oai-mme + redis: + image: redis:6.0.5 + container_name: rfsim4g-redis privileged: true - depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.6 + volumes: + - ./redis_extern.conf:/usr/local/etc/redis/redis.conf + entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf" + healthcheck: + test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping" + interval: 10s + timeout: 5s + retries: 5 + + magma_mme: + image: magma-mme:latest + container_name: rfsim4g-magma-mme + hostname: mme + privileged: true + depends_on: [oai_hss, redis] networks: public_net: ipv4_address: 192.168.61.3 environment: + TZ: Europe/Paris REALM: openairinterface.org PREFIX: /openair-mme/etc - INSTANCE: 1 - PID_DIRECTORY: /var/run - HSS_IP_ADDR: 192.168.61.2 HSS_HOSTNAME: hss HSS_FQDN: hss.openairinterface.org HSS_REALM: openairinterface.org - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 MME_FQDN: mme.openairinterface.org - MME_S6A_IP_ADDR: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S1_MME: eth0 - MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S11: eth0 - MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S10: lo - MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 - OUTPUT: CONSOLE - SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 - PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 - PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 - MCC_SGW_0: '208' - MNC3_SGW_0: '096' - TAC_LB_SGW_0: '01' - TAC_HB_SGW_0: '00' - MCC_MME_0: '208' - MNC3_MME_0: '096' - TAC_LB_MME_0: '02' - TAC_HB_MME_0: '00' - MCC_MME_1: '208' - MNC3_MME_1: '096' - TAC_LB_MME_1: '03' - TAC_HB_MME_1: '00' - TAC_LB_SGW_TEST_0: '03' - TAC_HB_SGW_TEST_0: '00' - SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + FEATURES: mme_oai + volumes: + - ./mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt + - ./mme.conf:/magma-mme/etc/mme.conf + - ./entrypoint.sh:/magma-mme/bin/entrypoint.sh + entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh" healthcheck: test: /bin/bash -c "pgrep oai_mme" interval: 10s @@ -118,7 +106,7 @@ services: oai_spgwc: image: oai-spgwc:latest privileged: true - depends_on: [oai_mme] + depends_on: [magma_mme] container_name: rfsim4g-oai-spgwc networks: public_net: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh new file mode 100755 index 0000000000..07e578907d --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +INSTANCE=1 +PREFIX='/magma-mme/etc' +MY_REALM='openairinterface.org' + +declare -A MME_CONF + +pushd $PREFIX +MME_CONF[@MME_S6A_IP_ADDR@]="192.168.61.3" +MME_CONF[@INSTANCE@]=$INSTANCE +MME_CONF[@PREFIX@]=$PREFIX +MME_CONF[@REALM@]=$MY_REALM +MME_CONF[@MME_FQDN@]="mme.${MME_CONF[@REALM@]}" +MME_CONF[@HSS_HOSTNAME@]='hss' +MME_CONF[@HSS_FQDN@]="${MME_CONF[@HSS_HOSTNAME@]}.${MME_CONF[@REALM@]}" +MME_CONF[@HSS_IP_ADDR@]="192.168.61.2" + +cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf + +for K in "${!MME_CONF[@]}"; do + egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" + ret=$?;[[ ret -ne 0 ]] && echo "Tried to replace $K with ${MME_CONF[$K]}" +done + +sed -i -e "s@etc/freeDiameter@etc@" /magma-mme/etc/mme_fd.conf +sed -i -e "s@bind: 127.0.0.1@bind: 192.168.61.6@" /etc/magma/redis.yml +# Generate freeDiameter certificate +popd +cd /magma-mme/scripts +./check_mme_s6a_certificate $PREFIX mme.${MME_CONF[@REALM@]} + +cd /magma-mme +nohup /magma-mme/bin/sctpd > /var/log/sctpd.log 2>&1 & +sleep 5 +/magma-mme/bin/oai_mme -c /magma-mme/etc/mme.conf diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf new file mode 100644 index 0000000000..4f491cc63d --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf @@ -0,0 +1,134 @@ +# generated by generate_mme_config_script.py +MME : +{ + REALM = "openairinterface.org" + PID_DIRECTORY = "/var/run"; + MAXENB = 8; # power of 2 + MAXUE = 16; # power of 2 + RELATIVE_CAPACITY = 10; + + EMERGENCY_ATTACH_SUPPORTED = "no"; + UNAUTHENTICATED_IMSI_SUPPORTED = "no"; + + # EPS network feature support + EPS_NETWORK_FEATURE_SUPPORT_IMS_VOICE_OVER_PS_SESSION_IN_S1 = "no"; # DO NOT CHANGE + EPS_NETWORK_FEATURE_SUPPORT_EMERGENCY_BEARER_SERVICES_IN_S1_MODE = "no"; # DO NOT CHANGE + EPS_NETWORK_FEATURE_SUPPORT_LOCATION_SERVICES_VIA_EPC = "no"; # DO NOT CHANGE + EPS_NETWORK_FEATURE_SUPPORT_EXTENDED_SERVICE_REQUEST = "no"; # DO NOT CHANGE + + # Display statistics about whole system (expressed in seconds) + MME_STATISTIC_TIMER = 10; + IP_CAPABILITY = "IPV4"; # UE PDN_TYPE + USE_STATELESS = ""; + + INTERTASK_INTERFACE : + { + # max queue size per task + ITTI_QUEUE_SIZE = 2000000; + }; + + S6A : + { + S6A_CONF = "/magma-mme/etc/mme_fd.conf"; # YOUR MME freeDiameter config file path + HSS_HOSTNAME = "hss.openairinterface.org"; + HSS_REALM = "openairinterface.org"; + }; + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 8; + SCTP_OUTSTREAMS = 8; + }; + + # ------- S1AP definitions + S1AP : + { + # outcome drop timer value (seconds) + S1AP_OUTCOME_TIMER = 10; + }; + + # ------- MME served GUMMEIs + GUMMEI_LIST = ( + { MCC="208" ; MNC="96"; MME_GID="32768" ; MME_CODE="3"; } + ); + + # ------- MME served TAIs + TAI_LIST = ( + {MCC="208" ; MNC="96"; TAC = "1"; } + ); + + TAC_LIST = ( + {MCC="208" ; MNC="96"; TAC = "1"; } + ); + + CSFB : + { + NON_EPS_SERVICE_CONTROL = "OFF"; + CSFB_MCC = "208"; + CSFB_MNC = "96"; + LAC = "1"; + }; + NAS : + { + ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "EIA2" , "EIA1" , "EIA0" ]; + ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "EEA0" , "EEA1" , "EEA2" ]; + T3402 = 1 # in minutes (default is 12 minutes) + T3412 = 54 # in minutes (default is 54 minutes, network dependent) + T3422 = 6 # in seconds (default is 6s) + T3450 = 6 # in seconds (default is 6s) + T3460 = 6 # in seconds (default is 6s) + T3470 = 6 # in seconds (default is 6s) + T3485 = 8 # UNUSED in seconds (default is 8s) + T3486 = 8 # UNUSED in seconds (default is 8s) + T3489 = 4 # UNUSED in seconds (default is 4s) + T3495 = 8 # UNUSED in seconds (default is 8s) + }; + + SGS : + { + TS6_1 = 10 # in seconds (default is 10s) + TS8 = 4 # in seconds (default is 4s) + TS9 = 2 # in seconds (default is 4s) + TS10 = 4 # in seconds (default is 4s) + TS13 = 4 # in seconds (default is 4s) + }; + + NETWORK_INTERFACES : + { + MME_INTERFACE_NAME_FOR_S1_MME = "eth0"; + MME_IPV4_ADDRESS_FOR_S1_MME = "192.168.61.3/24"; + MME_INTERFACE_NAME_FOR_S11_MME = "eth0"; + MME_IPV4_ADDRESS_FOR_S11_MME = "192.168.61.3/24"; + MME_PORT_FOR_S11_MME = 2123; + }; + + LOGGING : + { + OUTPUT = "CONSOLE"; + THREAD_SAFE = "no"; + COLOR = "no"; + + SCTP_LOG_LEVEL = "ERROR"; + GTPV1U_LOG_LEVEL = "INFO"; + SPGW_APP_LOG_LEVEL = "INFO"; + UDP_LOG_LEVEL = "INFO"; + S1AP_LOG_LEVEL = "DEBUG"; + NAS_LOG_LEVEL = "INFO"; + MME_APP_LOG_LEVEL = "DEBUG"; + GTPV2C_LOG_LEVEL = "INFO"; + S11_LOG_LEVEL = "DEBUG"; + S6A_LOG_LEVEL = "DEBUG"; + UTIL_LOG_LEVEL = "INFO"; + MSC_LOG_LEVEL = "ERROR"; + ITTI_LOG_LEVEL = "ERROR"; + MME_SCENARIO_PLAYER_LOG_LEVEL = "ERROR"; + ASN1_VERBOSITY = "INFO"; + }; + + S-GW : + { + SGW_IPV4_ADDRESS_FOR_S11 = "192.168.61.4"; + }; +}; diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf new file mode 100644 index 0000000000..6f87ed8c2b --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf @@ -0,0 +1,169 @@ +# -------- Local --------- + +# Uncomment if the framework cannot resolv it. +Identity = "@MME_FQDN@"; +Realm = "@REALM@"; + +# TLS configuration (see previous section) +TLS_Cred = "@PREFIX@/freeDiameter/mme.cert.pem", + "@PREFIX@/freeDiameter/mme.key.pem"; +TLS_CA = "@PREFIX@/freeDiameter/mme.cacert.pem"; + +# Disable use of TCP protocol (only listen and connect in SCTP) +# Default : TCP enabled +No_SCTP; + +# This option is ignored if freeDiameter is compiled with DISABLE_SCTP option. +# Prefer TCP instead of SCTP for establishing new connections. +# This setting may be overwritten per peer in peer configuration blocs. +# Default : SCTP is attempted first. +Prefer_TCP; + + +No_IPv6; + +# Overwrite the number of SCTP streams. This value should be kept low, +# especially if you are using TLS over SCTP, because it consumes a lot of +# resources in that case. See tickets 19 and 27 for some additional details on +# this. +# Limit the number of SCTP streams +SCTP_streams = 3; + + +# By default, freeDiameter acts as a Diameter Relay Agent by forwarding all +# messages it cannot handle locally. This parameter disables this behavior. +NoRelay; + +# Use RFC3588 method for TLS protection, where TLS is negociated after CER/CEA exchange is completed +# on the unsecure connection. The alternative is RFC6733 mechanism, where TLS protects also the +# CER/CEA exchange on a dedicated secure port. +# This parameter only affects outgoing connections. +# The setting can be also defined per-peer (see Peers configuration section). +# Default: use RFC6733 method with separate port for TLS. + +#TLS_old_method; + +AppServThreads = 4; + +# Specify the addresses on which to bind the listening server. This must be +# specified if the framework is unable to auto-detect these addresses, or if the +# auto-detected values are incorrect. Note that the list of addresses is sent +# in CER or CEA message, so one should pay attention to this parameter if some +# adresses should be kept hidden. +ListenOn = "@MME_S6A_IP_ADDR@"; + +Port = 3870; +SecPort = 5870; + +# -------- Extensions --------- + +# Uncomment (and create rtd.conf) to specify routing table for this peer. +#LoadExtension = "/usr/local/lib/freeDiameter/rt_default.fdx" : "rtd.conf"; + +#LoadExtension = "/usr/local/lib/freeDiameter/_sample.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_acct.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_diameap.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_radgw.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_redirect.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/app_sip.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_interactive.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_monitor.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_msg_dumps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_msg_timings.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dbg_rt.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_CreditControl.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_CxDx.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Gx.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_NAS.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Ro.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Rx.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_S6mS6n.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_SGd.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_SLh.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Sd.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Sh.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_T4.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_T6aT6bT7.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Tsp.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca_3gpp.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca_starent.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_eap.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_legacy_xml.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_mip6a.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_mip6i.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_nas_mipv6.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_nasreq.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_sip.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_busypeers.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_default.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_ereg.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_ignore_dh.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_load_balance.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_randomize.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/rt_redirect.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_acct.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_app.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_hss.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_netemul.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_rt_any.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/test_sip.fdx"; +#LoadExtension = "/usr/local/lib/freeDiameter/dict_Rf.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx"; +LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx"; + + +# -------- Peers --------- + +# The framework will actively attempt to establish and maintain a connection +# with the peers listed here. +# For only accepting incoming connections, see the acl_wl.fx extension. + +# ConnectPeer +# Declare a remote peer to which this peer must maintain a connection. +# In addition, this allows specifying non-default parameters for this peer only +# (for example disable SCTP with this peer, or use RFC3588-flavour TLS). +# Note that by default, if a peer is not listed as a ConnectPeer entry, an +# incoming connection from this peer will be rejected. If you want to accept +# incoming connections from other peers, see the acl_wl.fdx? extension which +# allows exactly this. + +ConnectPeer= "@HSS_FQDN@" { ConnectTo = "@HSS_IP_ADDR@"; No_SCTP ; No_IPv6; Prefer_TCP; No_TLS; port = 3868;}; diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf new file mode 100644 index 0000000000..1ee9dd9a78 --- /dev/null +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf @@ -0,0 +1,33 @@ +# +# Copyright (c) 2016-present, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +# Jinja template for Redis configuration +# See the default config file for options and explanations: +# https://github.com/antirez/redis/blob/unstable/redis.conf + +# TODO: make sensible, production-aware config decisions + +bind 192.168.61.6 +port 6380 + +daemonize no +loglevel notice + +timeout 0 +databases 1 + +dbfilename redis_dump.rdb +dir /data + +# Save the DB on disk + +save 900 1 + +save 300 10 + +save 60 1000 diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml index 4c1ceb424a..e1e992c94c 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml @@ -58,57 +58,45 @@ services: timeout: 5s retries: 5 - oai_mme: - image: oai-mme:latest - container_name: rfsim4g-oai-mme + redis: + image: redis:6.0.5 + container_name: rfsim4g-redis privileged: true - depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.6 + volumes: + - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf + entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf" + healthcheck: + test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping" + interval: 10s + timeout: 5s + retries: 5 + + magma_mme: + image: magma-mme:latest + container_name: rfsim4g-magma-mme + hostname: mme + privileged: true + depends_on: [oai_hss, redis] networks: public_net: ipv4_address: 192.168.61.3 environment: + TZ: Europe/Paris REALM: openairinterface.org PREFIX: /openair-mme/etc - INSTANCE: 1 - PID_DIRECTORY: /var/run - HSS_IP_ADDR: 192.168.61.2 HSS_HOSTNAME: hss HSS_FQDN: hss.openairinterface.org HSS_REALM: openairinterface.org - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 MME_FQDN: mme.openairinterface.org - MME_S6A_IP_ADDR: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S1_MME: eth0 - MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S11: eth0 - MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S10: lo - MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 - OUTPUT: CONSOLE - SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 - PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 - PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 - MCC_SGW_0: '208' - MNC3_SGW_0: '096' - TAC_LB_SGW_0: '01' - TAC_HB_SGW_0: '00' - MCC_MME_0: '208' - MNC3_MME_0: '096' - TAC_LB_MME_0: '02' - TAC_HB_MME_0: '00' - MCC_MME_1: '208' - MNC3_MME_1: '096' - TAC_LB_MME_1: '03' - TAC_HB_MME_1: '00' - TAC_LB_SGW_TEST_0: '03' - TAC_HB_SGW_TEST_0: '00' - SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + FEATURES: mme_oai + volumes: + - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt + - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf + - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh + entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh" healthcheck: test: /bin/bash -c "pgrep oai_mme" interval: 10s @@ -118,7 +106,7 @@ services: oai_spgwc: image: oai-spgwc:latest privileged: true - depends_on: [oai_mme] + depends_on: [magma_mme] container_name: rfsim4g-oai-spgwc networks: public_net: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml index 4a61181afb..ad665813f2 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml @@ -58,57 +58,45 @@ services: timeout: 5s retries: 5 - oai_mme: - image: oai-mme:latest - container_name: rfsim4g-oai-mme + redis: + image: redis:6.0.5 + container_name: rfsim4g-redis privileged: true - depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.6 + volumes: + - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf + entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf" + healthcheck: + test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping" + interval: 10s + timeout: 5s + retries: 5 + + magma_mme: + image: magma-mme:latest + container_name: rfsim4g-magma-mme + hostname: mme + privileged: true + depends_on: [oai_hss, redis] networks: public_net: ipv4_address: 192.168.61.3 environment: + TZ: Europe/Paris REALM: openairinterface.org PREFIX: /openair-mme/etc - INSTANCE: 1 - PID_DIRECTORY: /var/run - HSS_IP_ADDR: 192.168.61.2 HSS_HOSTNAME: hss HSS_FQDN: hss.openairinterface.org HSS_REALM: openairinterface.org - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 MME_FQDN: mme.openairinterface.org - MME_S6A_IP_ADDR: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S1_MME: eth0 - MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S11: eth0 - MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S10: lo - MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 - OUTPUT: CONSOLE - SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 - PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 - PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 - MCC_SGW_0: '208' - MNC3_SGW_0: '096' - TAC_LB_SGW_0: '01' - TAC_HB_SGW_0: '00' - MCC_MME_0: '208' - MNC3_MME_0: '096' - TAC_LB_MME_0: '02' - TAC_HB_MME_0: '00' - MCC_MME_1: '208' - MNC3_MME_1: '096' - TAC_LB_MME_1: '03' - TAC_HB_MME_1: '00' - TAC_LB_SGW_TEST_0: '03' - TAC_HB_SGW_TEST_0: '00' - SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + FEATURES: mme_oai + volumes: + - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt + - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf + - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh + entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh" healthcheck: test: /bin/bash -c "pgrep oai_mme" interval: 10s @@ -118,7 +106,7 @@ services: oai_spgwc: image: oai-spgwc:latest privileged: true - depends_on: [oai_mme] + depends_on: [magma_mme] container_name: rfsim4g-oai-spgwc networks: public_net: diff --git a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml index 3424780791..ffa92bac49 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml @@ -58,57 +58,45 @@ services: timeout: 5s retries: 5 - oai_mme: - image: oai-mme:latest - container_name: rfsim4g-oai-mme + redis: + image: redis:6.0.5 + container_name: rfsim4g-redis privileged: true - depends_on: [oai_hss] + networks: + public_net: + ipv4_address: 192.168.61.6 + volumes: + - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf + entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf" + healthcheck: + test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping" + interval: 10s + timeout: 5s + retries: 5 + + magma_mme: + image: magma-mme:latest + container_name: rfsim4g-magma-mme + hostname: mme + privileged: true + depends_on: [oai_hss, redis] networks: public_net: ipv4_address: 192.168.61.3 environment: + TZ: Europe/Paris REALM: openairinterface.org PREFIX: /openair-mme/etc - INSTANCE: 1 - PID_DIRECTORY: /var/run - HSS_IP_ADDR: 192.168.61.2 HSS_HOSTNAME: hss HSS_FQDN: hss.openairinterface.org HSS_REALM: openairinterface.org - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 MME_FQDN: mme.openairinterface.org - MME_S6A_IP_ADDR: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S1_MME: eth0 - MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S11: eth0 - MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3 - MME_INTERFACE_NAME_FOR_S10: lo - MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10 - OUTPUT: CONSOLE - SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4 - PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0 - PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0 - MCC_SGW_0: '208' - MNC3_SGW_0: '096' - TAC_LB_SGW_0: '01' - TAC_HB_SGW_0: '00' - MCC_MME_0: '208' - MNC3_MME_0: '096' - TAC_LB_MME_0: '02' - TAC_HB_MME_0: '00' - MCC_MME_1: '208' - MNC3_MME_1: '096' - TAC_LB_MME_1: '03' - TAC_HB_MME_1: '00' - TAC_LB_SGW_TEST_0: '03' - TAC_HB_SGW_TEST_0: '00' - SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0 + FEATURES: mme_oai + volumes: + - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt + - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf + - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh + entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh" healthcheck: test: /bin/bash -c "pgrep oai_mme" interval: 10s @@ -118,7 +106,7 @@ services: oai_spgwc: image: oai-spgwc:latest privileged: true - depends_on: [oai_mme] + depends_on: [magma_mme] container_name: rfsim4g-oai-spgwc networks: public_net: From 519dea7780820e6e48f59a070aba0881c72f612d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 11 Feb 2022 10:05:29 +0100 Subject: [PATCH 547/883] fix(ci): correct services in scenario files fix(doc): updated the Tutorial with only MAGMA-MME references and logs Signed-off-by: Raphael Defosseux --- .../container_4g_rfsim_fdd_05MHz.xml | 8 +- .../container_4g_rfsim_fdd_10MHz.xml | 8 +- .../container_4g_rfsim_fdd_20MHz.xml | 8 +- .../4g_rfsimulator_fdd_05MHz/README.md | 256 ++++++++++-------- 4 files changed, 149 insertions(+), 131 deletions(-) diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml index 55f60b8307..a598b2bdc1 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml @@ -66,8 +66,8 @@ DeployGenObject Deploy OAI 4G CoreNetwork yaml_files/4g_rfsimulator_fdd_05MHz - oai_hss oai_mme oai_spgwc oai_spgwu trf_gen - 6 + oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen + 7 @@ -75,7 +75,7 @@ Deploy OAI 4G eNB RF sim (FDD 05MHz) yaml_files/4g_rfsimulator_fdd_05MHz enb - 7 + 8 @@ -83,7 +83,7 @@ Deploy OAI 4G LTE-UE RF sim (FDD 05MHz) yaml_files/4g_rfsimulator_fdd_05MHz oai_ue0 - 8 + 9 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml index d5152c7779..29acfa3b09 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml @@ -66,8 +66,8 @@ DeployGenObject Deploy OAI 4G CoreNetwork yaml_files/4g_rfsimulator_fdd_10MHz - oai_hss oai_mme oai_spgwc oai_spgwu trf_gen - 6 + oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen + 7 @@ -75,7 +75,7 @@ Deploy OAI 4G eNB RF sim (FDD 10MHz) yaml_files/4g_rfsimulator_fdd_10MHz enb - 7 + 8 @@ -83,7 +83,7 @@ Deploy OAI 4G LTE-UE RF sim (FDD 10MHz) yaml_files/4g_rfsimulator_fdd_10MHz oai_ue0 - 8 + 9 diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml index 0c5b9d43bd..74f712ebda 100644 --- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml +++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml @@ -66,8 +66,8 @@ DeployGenObject Deploy OAI 4G CoreNetwork yaml_files/4g_rfsimulator_fdd_20MHz - oai_hss oai_mme oai_spgwc oai_spgwu trf_gen - 6 + oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen + 7 @@ -75,7 +75,7 @@ Deploy OAI 4G eNB RF sim (FDD 20MHz) yaml_files/4g_rfsimulator_fdd_20MHz enb - 7 + 8 @@ -83,7 +83,7 @@ Deploy OAI 4G LTE-UE RF sim (FDD 20MHz) yaml_files/4g_rfsimulator_fdd_20MHz oai_ue0 - 8 + 9 diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md index b2a7f8e30c..400559d269 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md @@ -48,8 +48,9 @@ Now pull images. ```bash $ docker pull cassandra:2.1 +$ docker pull redis:6.0.5 $ docker pull rdefosseoai/oai-hss:latest -$ docker pull rdefosseoai/oai-mme:latest +$ docker pull rdefosseoai/magma-mme:latest $ docker pull rdefosseoai/oai-spgwc:latest $ docker pull rdefosseoai/oai-spgwu-tiny:latest @@ -57,13 +58,15 @@ $ docker pull rdefosseoai/oai-enb:develop $ docker pull rdefosseoai/oai-lte-ue:develop ``` +If the `redis` tag is not available, pick the newest available `6.0.x` tag at [Docker Hub Redis Tags](https://hub.docker.com/_/redis?tab=tags). + And **re-tag** them for tutorials' docker-compose file to work. ```bash $ docker image tag rdefosseoai/oai-spgwc:latest oai-spgwc:latest $ docker image tag rdefosseoai/oai-hss:latest oai-hss:latest $ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest -$ docker image tag rdefosseoai/oai-mme:latest oai-mme:latest +$ docker image tag rdefosseoai/magma-mme:latest magma-mme:latest $ docker image tag rdefosseoai/oai-enb:develop oai-enb:develop $ docker image tag rdefosseoai/oai-lte-ue:develop oai-lte-ue:develop @@ -81,14 +84,14 @@ How to build the Traffic-Generator image is explained [here](https://github.com/ **Just `docker-compose up -d` WILL NOT WORK!** -All the following commands **SHALL** be run from the `ci-scripts/yaml_files/4g_rfsimulator` folder. +All the following commands **SHALL** be run from the `ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz` folder. ## 2.1. Deploy and Configure Cassandra Database ## It is very crutial that the Cassandra DB is fully configured before you do anything else! ```bash -$ cd ci-scripts/yaml_files/4g_rfsimulator +$ cd ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz $ docker-compose up -d db_init Creating network "rfsim4g-oai-private-net" with the default driver Creating network "rfsim4g-oai-public-net" with the default driver @@ -128,11 +131,12 @@ $ sudo tshark -i rfsim4g-public -f 'port 3868 or port 2123 or port 36412 or port ## 2.2. Deploy OAI CN4G containers ## ```bash -$ docker-compose up -d oai_mme oai_spgwu trf_gen +$ docker-compose up -d magma_mme oai_spgwu trf_gen rfsim4g-cassandra is up-to-date -Creating rfsim4g-trf-gen ... done +Creating rfsim4g-trf-gen ... done +Creating rfsim4g-redis ... done Creating rfsim4g-oai-hss ... done -Creating rfsim4g-oai-mme ... done +Creating rfsim4g-magma-mme ... done Creating rfsim4g-oai-spgwc ... done Creating rfsim4g-oai-spgwu-tiny ... done ``` @@ -144,11 +148,12 @@ $ docker-compose ps -a Name Command State Ports ------------------------------------------------------------------------------------------------------------------------- rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp -rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp -rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp -rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp -rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp -rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) +rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp +rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp +rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp +rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp +rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) ``` ## 2.3. Deploy OAI eNB in RF simulator mode ## @@ -165,77 +170,55 @@ $ docker-compose ps -a Name Command State Ports ------------------------------------------------------------------------------------------------------------------------- rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp -rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp -rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp -rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp -rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp -rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp -rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) +rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp +rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp +rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp +rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp +rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp +rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) ``` -Check if the eNB connected to MME: +Check if the eNB connected to MME: with MAGMA-MME, the logs are not pushed to `stdout` but to a file at `/var/log/mme.log` ```bash -$ docker logs rfsim4g-oai-mme +$ docker exec rfsim4g-magma-mme /bin/bash -c "cat /var/log/mme.log" ... -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================ +000141 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0095 Diameter identity of MME: mme.openairinterface.org with length: 24 +000142 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0130 S6a peer connection attempt 1 / 8 +000143 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0141 Peer hss.openairinterface.org is now connected... +000144 Fri Feb 11 09:49:29 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000146 Fri Feb 11 09:49:29 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0083 MME APP ZMQ latency: 214. +000145 Fri Feb 11 09:49:29 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 146. +000147 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 144. +000148 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :3775 Create eNB context for assoc_id: 4121 +000149 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 48. +000150 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :0536 New s1 setup request incoming from eNB-rf-sim macro eNB id: 00e01 +000151 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :0639 Adding eNB with enb_id :3585 to the list of served eNBs +000152 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================ -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 | +000153 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status| +000154 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 | +000155 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 | +000156 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 0 | +000157 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 | +000158 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================ +000159 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================ -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0469 Client association changed: 0 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0101 ---------------------- -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0102 SCTP Status: -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0103 assoc id .....: 675 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0104 state ........: 4 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0105 instrms ......: 2 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0106 outstrms .....: 2 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0108 fragmentation : 1452 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0109 pending data .: 0 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0110 unack data ...: 0 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0111 rwnd .........: 106496 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0112 peer info : -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0114 state ....: 2 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0116 cwnd .....: 4380 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0118 srtt .....: 0 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0120 rto ......: 3000 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0122 mtu ......: 1500 -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0123 ---------------------- -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0479 New connection -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0205 ---------------------- -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0206 Local addresses: -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0217 - [192.168.61.3] -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0234 ---------------------- -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0151 ---------------------- -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0152 Peer addresses: -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0163 - [192.168.61.20] -DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0178 ---------------------- -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0554 SCTP RETURNING!! -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0547 [675][44] Msg of length 51 received from port 36412, on stream 0, PPID 18 -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0554 SCTP RETURNING!! -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:2826 Create eNB context for assoc_id: 675 -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0361 S1-Setup-Request macroENB_ID.size 3 (should be 20) -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0321 New s1 setup request incoming from macro eNB id: 00e01 -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0423 Adding eNB to the list of served eNBs -DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0438 Adding eNB id 3585 to the list of served eNBs -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0283 [44][675] Sending buffer 0x7f9394009f90 of 27 bytes on stream 0 with ppid 18 -DEBUG SCTP rc/sctp/sctp_primitives_server.c:0296 Successfully sent 27 bytes on stream 0 -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================ +000160 Fri Feb 11 09:50:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000161 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================ -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 1 | 1 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 | +000162 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status| +000163 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 | +000164 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 | +000165 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 | +000166 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 | +000167 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================ +000168 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================ + +000169 Fri Feb 11 09:51:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 ... ``` @@ -253,14 +236,14 @@ $ docker-compose ps -a Name Command State Ports ------------------------------------------------------------------------------------------------------------------------- rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp -rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp -rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp -rfsim4g-oai-lte-ue0 /opt/oai-lte-ue/bin/entryp ... Up (healthy) 10000/tcp -rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp -rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp -rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp -rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) -Creating rfsim4g-oai-enb ... done +rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp +rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp +rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp +rfsim4g-oai-lte-ue0 /opt/oai-lte-ue/bin/entryp ... Up (healthy) 10000/tcp +rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp +rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp +rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy) ``` Making sure the OAI UE is connected: @@ -268,40 +251,69 @@ Making sure the OAI UE is connected: ```bash $ docker logs rfsim4g-oai-enb ... -[RRC] RRCConnectionReconfiguration Encoded 1098 bits (138 bytes) -[RRC] [eNB 0] Frame 0, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes 138, UE id 617b) -[RRC] sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB -[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][SRB 02] Action ADD LCID 2 (SRB id 2) configured with SN size 5 bits and RLC AM -[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][DRB 01] Action ADD LCID 3 (DRB id 1) configured with SN size 12 bits and RLC AM -[SCTP] Successfully sent 46 bytes on stream 1 for assoc_id 676 -[RRC] [FRAME 00000][eNB][MOD 00][RNTI 617b] UE State = RRC_RECONFIGURED (default DRB, xid 0) -[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][SRB 02] Action MODIFY LCID 2 RB id 2 reconfigured with SN size 5 and RLC AM -[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][DRB 01] Action MODIFY LCID 3 RB id 1 reconfigured with SN size 1 and RLC AM -[RRC] [eNB 0] Frame 0 CC 0 : SRB2 is now active -[RRC] [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti 617b, reconfiguring DRB 1/LCID 3 -[RRC] [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete, reconfiguring DRB 1/LCID 3 -[MAC] UE 0 RNTI 617b adding LC 3 idx 2 to scheduling control (total 3) -[MAC] Added physicalConfigDedicated 0x7f98e0004950 for 0.0 -[S1AP] initial_ctxt_resp_p: e_rab ID 5, enb_addr 192.168.61.20, SIZE 4 -[SCTP] Successfully sent 40 bytes on stream 1 for assoc_id 676 -[SCTP] Successfully sent 61 bytes on stream 1 for assoc_id 676 +7320446.555734 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] Logical Channel DL-DCCH, Generate UECapabilityEnquiry (bytes 10) +7320446.555739 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB +7320446.570284 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] received ueCapabilityInformation on UL-DCCH 1 from UE +7320446.570293 [RRC] A got UE capabilities for UE bd8c +7320446.570346 [RRC] W drx_Configuration parameter is NULL, cannot configure local UE parameters or CDRX is deactivated +7320446.570370 [RRC] I [eNB 0] frame 0: requesting A2, A3, A4, and A5 event reporting +7320446.570435 [RRC] I RRCConnectionReconfiguration Encoded 1146 bits (144 bytes) +7320446.570440 [RRC] I [eNB 0] Frame 0, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes 144, UE id bd8c) +7320446.570445 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB +7320446.570446 [SCTP] I Successfully sent 46 bytes on stream 1 for assoc_id 4120 +7320446.570449 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][SRB 02] Action ADD LCID 2 (SRB id 2) configured with SN size 5 bits and RLC AM +7320446.570455 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][DRB 01] Action ADD LCID 3 (DRB id 1) configured with SN size 12 bits and RLC AM +7320446.583036 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] UE State = RRC_RECONFIGURED (default DRB, xid 0) +7320446.583056 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][SRB 02] Action MODIFY LCID 2 RB id 2 reconfigured with SN size 5 and RLC AM +7320446.583060 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][DRB 01] Action MODIFY LCID 3 RB id 1 reconfigured with SN size 1 and RLC AM +7320446.583065 [RRC] I [eNB 0] Frame 0 CC 0 : SRB2 is now active +7320446.583067 [RRC] I [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti bd8c, reconfiguring DRB 1/LCID 3 +7320446.583070 [RRC] I [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete, reconfiguring DRB 1/LCID 3 +7320446.583074 [MAC] I UE 0 RNTI bd8c adding LC 3 idx 2 to scheduling control (total 3) +7320446.583077 [MAC] I Added physicalConfigDedicated 0x7fd18c46be50 for 0.0 +7320446.583095 [S1AP] I initial_ctxt_resp_p: e_rab ID 5, enb_addr 192.168.61.20, SIZE 4 +7320446.583150 [SCTP] I Successfully sent 40 bytes on stream 1 for assoc_id 4120 +7320446.595495 [SCTP] I Successfully sent 61 bytes on stream 1 for assoc_id 4120 +7320446.774197 [SCTP] I Found data for descriptor 103 +7320446.774227 [SCTP] I [4120][103] Msg of length 53 received, on stream 1, PPID 18 +7320446.774295 [RRC] I [eNB 0] Received S1AP_DOWNLINK_NAS: ue_initial_id 0, eNB_ue_s1ap_id 4527568 +7320446.774316 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB ... ``` -On the MME: +On the MME: be patient, the statistics display update is slow! ```bash -$ docker logs rfsim4g-oai-mme -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================ +$ docker exec rfsim4g-magma-mme /bin/bash -c "cat /var/log/mme.log" +000413 Fri Feb 11 09:52:52 2022 7EFFE8BE6700 INFO GTPv2- lib/gtpv2-c/nwgtpv2c-0.11/src/Nw:2376 Stopped active timer 0x2 for info 0x0x60700001a9b0! +000414 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000415 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0083 MME APP ZMQ latency: 172. +000416 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 INFO MME-AP tasks/mme_app/mme_app_main.c :0137 Received S11 MODIFY BEARER RESPONSE from SPGW +000417 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0150 S11 MODIFY BEARER RESPONSE local S11 teid = 1 +000418 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000419 Fri Feb 11 09:53:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000420 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================ -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 1 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 1 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 1 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 | +000421 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status| +000422 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 | +000423 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 | +000424 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 | +000425 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 | +000426 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 | -DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================ +000427 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================ + +000428 Fri Feb 11 09:54:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0 +000429 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================ + +000430 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status| +000431 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 1 | +000432 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 1 | +000433 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 | +000434 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 1 | +000435 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 1 | + +000436 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================ ``` On the LTE UE: @@ -377,16 +389,18 @@ Stopping rfsim4g-oai-lte-ue0 ... done Stopping rfsim4g-oai-enb ... done Stopping rfsim4g-oai-spgwu-tiny ... done Stopping rfsim4g-oai-spgwc ... done -Stopping rfsim4g-oai-mme ... done +Stopping rfsim4g-magma-mme ... done Stopping rfsim4g-oai-hss ... done +Stopping rfsim4g-redis ... done Stopping rfsim4g-trf-gen ... done Stopping rfsim4g-cassandra ... done Removing rfsim4g-oai-lte-ue0 ... done Removing rfsim4g-oai-enb ... done Removing rfsim4g-oai-spgwu-tiny ... done Removing rfsim4g-oai-spgwc ... done -Removing rfsim4g-oai-mme ... done +Removing rfsim4g-magma-mme ... done Removing rfsim4g-oai-hss ... done +Removing rfsim4g-redis ... done Removing rfsim4g-trf-gen ... done Removing rfsim4g-cassandra ... done Removing network rfsim4g-oai-private-net @@ -443,19 +457,23 @@ My 1st UE IMSI is an aggregation of `MCC`, `MNC`, `SHORT_IMSI`. ## 5.2. PLMN and TAI ## -in MME config: +in MME config, in the docker-compose there is not much besides REALM fields: ```yaml + TZ: Europe/Paris REALM: openairinterface.org -.. - MCC: '208' - MNC: '96' - MME_GID: 32768 - MME_CODE: 3 - TAC_0: 1 - TAC_1: 2 - TAC_2: 3 + PREFIX: /openair-mme/etc + HSS_HOSTNAME: hss + HSS_FQDN: hss.openairinterface.org + HSS_REALM: openairinterface.org MME_FQDN: mme.openairinterface.org + FEATURES: mme_oai +``` + +Everything is hard-coded in the `mme.conf` that is mounted as a volume: look for instances of + +``` +MCC="208" ; MNC="96"; TAC = "1"; ``` in SPGW-C/-U configs: From 4c76eb6c00ef589b7ab5fb6b93ef463114118285 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 11 Feb 2022 15:27:54 +0100 Subject: [PATCH 548/883] fix(ci): display state of container even when successful recover the full MAGMA-MME log Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index eca75617a6..2eb7808a37 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -684,9 +684,10 @@ class Containerize(): deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) healthy = 0 for state in deployStatus.split('\n'): - res = re.search('Up \(healthy\)', state) - if res is not None: + if re.search('Up \(healthy\)', state) is not None: healthy += 1 + if re.search('rfsim4g-db-init.*Exit 0', state) is not None: + subprocess.check_output('docker rm -f rfsim4g-db-init || true', shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) containerStatus.append(state) if healthy == self.nb_healthy[0]: count = 100 @@ -698,6 +699,8 @@ class Containerize(): logging.debug('Starting tshark on public network') self.CaptureOnDockerNetworks() HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) + for cState in containerStatus: + logging.debug(cState) logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m') else: HTML.CreateHtmlTestRow('Could not deploy in time', 'KO', CONST.ALL_PROCESSES_OK) @@ -760,7 +763,11 @@ class Containerize(): cName = res.group('container_name') cmd = 'cd ' + self.yamlPath[0] + ' && docker logs ' + cName + ' > ' + cName + '.log 2>&1' logging.debug(cmd) - deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + if re.search('magma-mme', cName) is not None: + cmd = 'cd ' + self.yamlPath[0] + ' && docker cp -L ' + cName + ':/var/log/mme.log ' + cName + '-full.log' + logging.debug(cmd) + subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) fullStatus = True if anyLogs: cmd = 'mkdir -p '+ logPath + ' && cp ' + self.yamlPath[0] + '/*.log ' + logPath From 8981b53f837458aaf7792f5b4092b3c22b1c785d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 21 Feb 2022 16:39:38 +0100 Subject: [PATCH 549/883] fix(ci): changes after code review. Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 1 - ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 2eb7808a37..2b19a80984 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -677,7 +677,6 @@ class Containerize(): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps -a' count = 0 healthy = 0 - containerStatus = [] while (count < 10): count += 1 containerStatus = [] diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh index 07e578907d..24960e215d 100755 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh @@ -20,7 +20,7 @@ cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf for K in "${!MME_CONF[@]}"; do egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g" - ret=$?;[[ ret -ne 0 ]] && echo "Tried to replace $K with ${MME_CONF[$K]}" + ret=$?;[[ ret -ne 0 ]] && echo "Could not replace $K with ${MME_CONF[$K]}" done sed -i -e "s@etc/freeDiameter@etc@" /magma-mme/etc/mme_fd.conf From 4fbf9ea10e4d105f15d8998e44c6913055e2dace Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 21 Feb 2022 18:35:08 +0100 Subject: [PATCH 550/883] fix for 2 antenna ports --- openair1/PHY/INIT/nr_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index e9bcc8fc98..bf8088143c 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -74,6 +74,7 @@ int l1_north_init_gNB() { int init_codebook_gNB(PHY_VARS_gNB *gNB) { if(gNB->frame_parms.nb_antennas_tx>1){ + int CSI_RS_antenna_ports = gNB->frame_parms.nb_antennas_tx; //NR Codebook Generation for codebook type1 SinglePanel int N1 = gNB->ap_N1; int N2 = gNB->ap_N2; @@ -87,8 +88,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Get the uniform planar array parameters // To be confirmed int O2 = N2 > 1? 4 : 1; //Vertical beam oversampling (1 or 4) - int O1 = 4; //Horizontal beam oversampling (1 or 4) - int CSI_RS_antenna_ports = gNB->frame_parms.nb_antennas_tx; + int O1 = CSI_RS_antenna_ports > 2? 4 : 1; //Horizontal beam oversampling (1 or 4) AssertFatal(CSI_RS_antenna_ports == N1*N2*x_polarization, "Nb of antenna ports at PHY %d does not correspond to what passed down with fapi %d\n", N1*N2*x_polarization, CSI_RS_antenna_ports); From b112282e2b0d4280138023ea0b0f9017dafabcd8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 19:42:45 +0100 Subject: [PATCH 551/883] Suppress warning, print stacktrace to stdout --- common/utils/assertions.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index c80a306645..3a2dd817f3 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -33,9 +33,9 @@ #define _Assert_Exit_ \ if (getenv("gdbStacks")) { \ char tmp [1000]; \ - sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d > /tmp/full_stacks.%d < /dev/null", \ + sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", \ getpid(), getpid()); \ - __attribute__((unused)) int dummy=system(tmp); \ + (void) system(tmp); \ } \ fprintf(stderr, "\nExiting execution\n"); \ fflush(stdout); \ From 719f82870d2a97b137f1a362bf6f3d6d322c2a56 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 19:47:14 +0100 Subject: [PATCH 552/883] Don't redirect stack trace to file --- common/utils/assertions.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index 3a2dd817f3..573036b1d9 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -33,9 +33,8 @@ #define _Assert_Exit_ \ if (getenv("gdbStacks")) { \ char tmp [1000]; \ - sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", \ - getpid(), getpid()); \ - (void) system(tmp); \ + sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", getpid()); \ + __attribute__((unused)) int dummy=system(tmp); \ } \ fprintf(stderr, "\nExiting execution\n"); \ fflush(stdout); \ From 9656d646dbf36300db7588ee0fda01050d0a594a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 20:08:42 +0100 Subject: [PATCH 553/883] reallocarray -> realloc since CI env has no reallocarray --- common/utils/load_module_shlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c index f5a52d0626..1c9aa8cab9 100644 --- a/common/utils/load_module_shlib.c +++ b/common/utils/load_module_shlib.c @@ -225,7 +225,7 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t * } if (j == shlib->numfunc) { if (shlib->numfunc == shlib->len_funcarray) { - loader_shlibfunc_t *n = reallocarray(shlib->funcarray, shlib->numfunc * 2, sizeof(loader_shlibfunc_t)); + loader_shlibfunc_t *n = realloc(shlib->funcarray, shlib->numfunc * 2 * sizeof(loader_shlibfunc_t)); if (!n) { fprintf(stderr, "[LOADER] %s(): unable to allocate memory\n", __func__); ret = -1; From ec00d84299ae2c4b7fd651eebdc5ddf1f266ad86 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 22:35:22 +0100 Subject: [PATCH 554/883] Prevent memory leak of rx_ind message --- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index dff347f7c0..04e32cd3c1 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -601,11 +601,12 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif nr_downlink_indication_t dl_indication; - fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); + fapi_nr_rx_indication_t rx_ind; + memset(&rx_ind, 0, sizeof(rx_ind)); uint16_t number_pdus = 1; - nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); + nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id); + nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); if (ue->if_inst && ue->if_inst->dl_indication) ue->if_inst->dl_indication(&dl_indication, NULL); From 04e2d4f6f83601740b4a269fba4eed733965d14d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Feb 2022 22:38:22 +0100 Subject: [PATCH 555/883] Fix polar encoder memory leaks --- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 7 ++++--- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index bf5edccb1b..0481338a9a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -298,9 +298,10 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, a_reversed |= (((uint64_t)pbch->pbch_a_prime>>i)&1)<<(31-i); /// CRC, coding and rate matching - polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0, - nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,0,NULL) - ); + t_nrPolar_params* polar = nr_polar_params(NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL, 0, NULL); + polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0, polar); + nr_polar_delete(polar); + #ifdef DEBUG_PBCH_ENCODING printf("Channel coding:\n"); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 04e32cd3c1..7b2cff0a40 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -533,8 +533,9 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0); //polar decoding de-rate matching - const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); + t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,currentPtr); + nr_polar_delete(currentPtr); if(decoderState) return(decoderState); From 4a060892d218d8bbc691aa06100efaee632a6e72 Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 21 Feb 2022 08:01:38 +0100 Subject: [PATCH 556/883] fix NSA T tracer file copy --- ci-scripts/ran.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index ad360d2179..66f1ebc1e7 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -676,13 +676,13 @@ class RANManagement(): # if T tracer was run with option 0 (no logs), analyze logs # from textlog, otherwise do normal analysis (e.g., option 2) result = re.search('T_stdout 0', str(self.Initialize_eNB_args)) + enbLogFile = self.eNBLogFiles[int(self.eNB_instance)] + raw_record_file = enbLogFile.replace('.log', '_record.raw') + replay_log_file = enbLogFile.replace('.log', '_replay.log') if (result is not None): logging.debug('\u001B[1m Replaying RAW record file\u001B[0m') mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.command('cd ' + lSourcePath + '/common/utils/T/tracer/', '\$', 5) - enbLogFile = self.eNBLogFiles[int(self.eNB_instance)] - raw_record_file = enbLogFile.replace('.log', '_record.raw') - replay_log_file = enbLogFile.replace('.log', '_replay.log') extracted_txt_file = enbLogFile.replace('.log', '_extracted_messages.txt') extracted_log_file = enbLogFile.replace('.log', '_extracted_messages.log') mySSH.command('./extract_config -i ' + lSourcePath + '/cmake_targets/' + raw_record_file + ' > ' + lSourcePath + '/cmake_targets/' + extracted_txt_file, '\$', 5) @@ -705,6 +705,8 @@ class RANManagement(): mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*stats.log', '.') mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.pickle', '.') mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.png', '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/'+raw_record_file, '.') + mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/'+replay_log_file, '.') # copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.') if (copyin_res == -1): @@ -720,7 +722,9 @@ class RANManagement(): mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrL1_stats.log', self.eNBSourceCodePath + '/cmake_targets/') mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrMAC_stats.log', self.eNBSourceCodePath + '/cmake_targets/') mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.pickle', self.eNBSourceCodePath + '/cmake_targets/') - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/')#RH 21/02/2002 this does not work, there are more than 1 png file + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword,'./'+raw_record_file, self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword,'./'+replay_log_file, self.eNBSourceCodePath + '/cmake_targets/') # mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) From edb32cad99253467ce984a4f9cb329fc631c4a6e Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 22 Feb 2022 13:37:39 +0100 Subject: [PATCH 557/883] fix in config_csirs --- openair2/RRC/NR/nr_rrc_config.c | 2 +- openair2/RRC/NR/nr_rrc_config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 85b421aa9e..bea9afb739 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -83,8 +83,8 @@ void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0, int uid, int nb_sl void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, - int num_dl_antenna_ports, int uid, + int num_dl_antenna_ports, int curr_bwp, int do_csirs) { diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index 99e6de52a1..9841b8d215 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -115,8 +115,8 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, - int num_dl_antenna_ports, int uid, + int num_dl_antenna_ports, int curr_bwp, int do_csirs); From c3d0d6d82a8d3c3c523a11cc91502a44a1e7deda Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 22 Feb 2022 14:39:04 +0100 Subject: [PATCH 558/883] addressing review comments --- openair2/GNB_APP/gnb_config.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 24 ++++++++++--------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 14 +++++------ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index f4433ba1ca..ccd26a62ea 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -740,7 +740,7 @@ void RCconfig_nr_macrlc() { uint16_t prbbl[275]; int num_prbbl=0; int prb; - memset(prbbl,0,275*sizeof(uint16_t)); + memset(prbbl,0,prbbl); while (pt) { prb=atoi(pt); prbbl[prb] = 0x3FFF; // all symbols taken diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index fcab2ab968..61cfb986dc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -557,7 +557,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, "%s(): VRB MAP not free. Can't schedule CSI reporting on PUCCH.\n", __func__); + 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); memset(curr_pucch, 0, sizeof(*curr_pucch)); } else @@ -1273,17 +1273,18 @@ int nr_acknack_scheduling(int mod_id, * later) * * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */ NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[mod_id]->UE_info.UE_sched_ctrl[UE_id]; + NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]; NR_PUCCH_Config_t *pucch_Config = NULL; if (sched_ctrl->active_ubwp) { pucch_Config = sched_ctrl->active_ubwp->bwp_Dedicated->pucch_Config->choice.setup; - } else if (RC.nrmac[mod_id]->UE_info.CellGroup[UE_id] && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP && - RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) { - pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; + } else if (cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) { + pucch_Config = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; } NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? &sched_ctrl->active_ubwp->bwp_Common->genericParameters: @@ -1336,7 +1337,6 @@ int nr_acknack_scheduling(int mod_id, LOG_D(NR_MAC, "In %s: pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame, slot, pucch->frame, pucch->ul_slot, pucch->dai_c); // this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP - NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]; NR_BWP_UplinkDedicated_t *ubwpd=NULL; if (cg && @@ -1410,11 +1410,13 @@ int nr_acknack_scheduling(int mod_id, // 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, - &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE], + vrb_map_UL, scc, pucch_Config, r_pucch, @@ -1499,7 +1501,7 @@ int nr_acknack_scheduling(int mod_id, pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources pucch->r_pucch=r_pucch; - uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE]; + 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; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index c57218cc33..5f34c10b3b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1209,13 +1209,6 @@ void pf_ul(module_id_t module_id, if (max_num_ue < 0) return; - sched_ctrl->cce_index = CCEIndex; - fill_pdcch_vrb_map(RC.nrmac[module_id], - CC_id, - &sched_ctrl->sched_pdcch, - CCEIndex, - sched_ctrl->aggregation_level); - /* Save PUSCH field */ /* we want to avoid a lengthy deduction of DMRS and other parameters in * every TTI if we can save it, so check whether dci_format, TDA, or @@ -1238,6 +1231,13 @@ void pf_ul(module_id_t module_id, return; } + sched_ctrl->cce_index = CCEIndex; + fill_pdcch_vrb_map(RC.nrmac[module_id], + CC_id, + &sched_ctrl->sched_pdcch, + CCEIndex, + sched_ctrl->aggregation_level); + NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = 9; update_ul_ue_R_Qm(sched_pusch, ps); From 1976f433dcebbe7f7b2e9bfc6abd4bfab24f043b Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 22 Feb 2022 16:15:29 +0100 Subject: [PATCH 559/883] changes for Panther --- openair1/PHY/LTE_TRANSPORT/if5_tools.c | 32 ++++++++++++++---- targets/ARCH/AW2SORI/oaiori.c | 45 ++++++++++++++------------ 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c index 9d53cafe71..e71b1e31f6 100644 --- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c @@ -1106,9 +1106,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms; - int offset,siglen; + int offset,siglen,factor=1; if (nrfp) { - offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0); + offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0); siglen = nrfp->get_samples_per_slot(tti,nrfp); } else { @@ -1116,6 +1116,13 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq siglen = spsf; } + if (ru->openair0_cfg.nr_flag==1) { + if (nrfp->N_RB_DL <= 162 && nrfp->N_RB_DL >= 106) factor = 2; + else if (nrfp->N_RB_DL < 106) factor=4; + } + else { + factor = 30720/spsf; + } for (i=0; i < ru->nb_tx; i++) txp[i] = (int32_t*)&ru->common.txdata[i][offset]; @@ -1125,7 +1132,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 ); clock_gettime( CLOCK_MONOTONIC, &start_comp); ru->ifdevice.trx_write_func2(&ru->ifdevice, - (proc_timestamp + packet_id*spp_eth-600)*(30720/spsf), + (proc_timestamp + packet_id*spp_eth-600)*factor, (void*)txp[aid], spp_eth, aid, @@ -1326,6 +1333,8 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms; int offset,siglen; + int factor=1; + int ts_offset; if (nrfp) { offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0); siglen = nrfp->get_samples_per_slot(tti,nrfp); @@ -1334,6 +1343,15 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa offset = tti*fp->samples_per_subframe; siglen = spsf; } + if (ru->openair0_cfg.nr_flag==1) { // This check if RRU knows about NR numerologies + if (nrfp->N_RB_DL <= 162 && nrfp->N_RB_DL >= 106) factor = 2; + else if (nrfp->N_RB_DL < 106) factor=4; + ts_offset = 64; + } + else { + factor = 30720/spsf; + ts_offset = 256; + } for (i=0; i < ru->nb_rx; i++) rxp[i] = &ru->common.rxdata[i][offset]; int aid; @@ -1352,12 +1370,12 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa &aid); clock_gettime( CLOCK_MONOTONIC, &if_time); timeout[packet_id] = if_time.tv_nsec; - timestamp[packet_id] /= (30720/spsf); - LOG_D(PHY,"TTI %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0])); + timestamp[packet_id] /= factor; // for LTE this is the sample rate reduction w.r.t 30.72, for NR 122.88 + LOG_D(PHY,"TTI %d: factor = %d Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,factor,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0])); if (aid==0) { if (firstTS==1) firstTS=0; - else if (oldTS + 256 != timestamp[packet_id]) { + else if (oldTS + ts_offset != timestamp[packet_id]) { LOG_I(PHY,"oldTS %llu, newTS %llu, diff %llu, timein %lu, timeout %lu\n",(long long unsigned int)oldTS,(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[packet_id]-oldTS,timein[packet_id],timeout[packet_id]); for (int i=0;i<=packet_id;i++) LOG_I(PHY,"packet %d TS %llu, timein %lu, timeout %lu\n",i,(long long unsigned int)timestamp[i],timein[i],timeout[i]); AssertFatal(1==0,"fronthaul problem\n"); @@ -1369,7 +1387,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa // HYPOTHESIS: first packet per subframe has lowest timestamp of subframe // should detect out of order and act accordingly .... - AssertFatal(aid==0 || aid==1,"aid %d != 0 or 1\n",aid); + AssertFatal(aid==0 || aid==1 || aid==2 || aid==3,"aid %d != 0,1,2 or 3\n",aid); LOG_D(PHY,"rxp[%d] %p, dest %p, offset %d (%llu,%llu)\n",aid,rxp[aid],rxp[aid]+(timestamp[packet_id]-timestamp[0]),(int)(timestamp[packet_id]-timestamp[0]),(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[0]); memcpy((void*)(rxp[aid]+(timestamp[packet_id]-timestamp[0])), (void*)temp_rx, diff --git a/targets/ARCH/AW2SORI/oaiori.c b/targets/ARCH/AW2SORI/oaiori.c index 3872b05b3b..9cf15237cf 100644 --- a/targets/ARCH/AW2SORI/oaiori.c +++ b/targets/ARCH/AW2SORI/oaiori.c @@ -243,7 +243,7 @@ int aw2s_startstreaming(openair0_device *device) { tx1= (openair0_cfg->tx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 1, NULL) : NULL; tx2= (openair0_cfg->tx_num_channels > 2) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 2, NULL) : NULL; tx3= (openair0_cfg->tx_num_channels > 3) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_TxNRFDD : ORI_ObjectType_TxNRTDD, 3, NULL) : NULL; - rx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxEUtraFDD : ORI_ObjectType_RxEUtraTDD, 0, NULL); + rx0= ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 0, NULL); rx1= (openair0_cfg->rx_num_channels > 1) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 1, NULL) : NULL; rx2= (openair0_cfg->rx_num_channels > 2) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 2, NULL) : NULL; rx3= (openair0_cfg->rx_num_channels > 3) ? ORI_FindObject(ori, openair0_cfg->duplex_mode == duplex_mode_FDD ?ORI_ObjectType_RxNRFDD : ORI_ObjectType_RxNRTDD, 3, NULL) : NULL; @@ -259,8 +259,10 @@ int aw2s_startstreaming(openair0_device *device) { (rx1 == NULL && openair0_cfg->rx_num_channels > 1) || (rx2 == NULL && openair0_cfg->rx_num_channels > 2) || (rx3 == NULL && openair0_cfg->rx_num_channels > 3) || - link == NULL) return (-1); - + link == NULL) { + printf("tx0 %p, tx1 %p, tx2 %p, tx3 %p, rx0 %p, rx1 %p, rx2 %p, rx3 %p\n",tx0,tx1,tx2,tx3,rx0,rx1,rx2,rx3); + return (-1); + } /******************************************************************* * UNLOCK Link *******************************************************************/ @@ -415,7 +417,7 @@ int aw2s_startstreaming(openair0_device *device) { (openair0_cfg->rx_num_channels > 1 && rx1->fst != ORI_FST_Operational) || tx0->fst != ORI_FST_Operational || (openair0_cfg->tx_num_channels > 1 && tx1->fst != ORI_FST_Operational)) - {} + {}*/ // test RX interface uint64_t TS; char temp_rx[1024] __attribute__((aligned(32))); @@ -604,7 +606,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx0, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams0.TxEUtra/NRFDD/TDD) failed with error: %s (%s,%s,%s,%s,%s,%s\n", ORI_Result_Print(RE_result), + printf("ORI_ObjectCreation (txParams0.TxEUtra/NR/FDD/TDD) failed with error: %s (%s,%s,%s,%s,%s,%s\n", ORI_Result_Print(RE_result), ORI_Result_Print(txParamResult[0]), ORI_Result_Print(txParamResult[1]), ORI_Result_Print(txParamResult[2]), @@ -614,7 +616,7 @@ int aw2s_oriinit(openair0_device *device) { aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (txParams0.TxEUtra/NRFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (txParams0.TxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); /* Create tx1 */ @@ -631,11 +633,11 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx1, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (txParams1.TxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (txParams1.TxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } if (openair0_cfg->tx_num_channels > 2) { @@ -651,11 +653,11 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx2, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams1.TxEUtraFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (txParams2.TxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (txParams1.TxEUtraFDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (txParams2.TxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } if (openair0_cfg->tx_num_channels == 4) { ORI_Object_s * tx3; @@ -670,7 +672,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectCreation(ori, txTypeRef, txParams, txParamList, num_txparams, txParamResult, &tx3, &RE_result); if(RE_result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (txParams1.TxEUtra/NRFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (txParams3.TxEUtra/NRFDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } @@ -688,7 +690,8 @@ int aw2s_oriinit(openair0_device *device) { (openair0_cfg->nr_flag == 0 ? ORI_ObjectType_RxEUtraTDD : ORI_ObjectType_RxNRTDD)}; ORI_ObjectParams_u rxParams; ORI_ObjectParam_e rxParamList[5] = { ORI_ObjectParam_SigPath_antPort, ORI_ObjectParam_SigPath_axcW, ORI_ObjectParam_SigPath_axcB, - ORI_ObjectParam_SigPath_chanBW, ORI_ObjectParam_SigPath_earfcn }; + ORI_ObjectParam_SigPath_chanBW, + openair0_cfg->nr_flag == 0 ? ORI_ObjectParam_SigPath_earfcn : ORI_ObjectParam_SigPath_AWS_arfcn}; ORI_Result_e rxParamResult[5]; int num_rxparams = 5; /* Create rx0 */ @@ -783,11 +786,11 @@ int aw2s_oriinit(openair0_device *device) { if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (rxParams2.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (rxParams2.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } if (openair0_cfg->rx_num_channels > 3) { /* Create rx3 */ @@ -806,11 +809,11 @@ int aw2s_oriinit(openair0_device *device) { if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectCreation (rxParams3.RxEUtra/NR/FDD/TDD) failed with error: %s\n", ORI_Result_Print(result)); aw2s_oricleanup(device); return -1; } - printf("ORI_ObjectCreation (rxParams1.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); + printf("ORI_ObjectCreation (rxParams3.RxEUtra/NR/FDD/TDD): %s\n", ORI_Result_Print(RE_result)); } /* Create link */ @@ -827,14 +830,14 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectParamModify(ori,link,linkParams,linkParamList,3,linkParamResult,&RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectParamModify (linkParams) failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectParamModify (linkParams) failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } result = ORI_ObjectStateModification(ori, link, ORI_AST_Locked, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectStateModify failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectStateModify failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } @@ -850,7 +853,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectParamReport(ori, NULL, 0, ORI_ObjectParam_All, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectParamReport failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectParamReport failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } @@ -869,7 +872,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectStateReport(ori, NULL, 0, ORI_StateType_All, ORI_EventDrivenReport_True, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectStateReport failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectStateReport failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } @@ -893,7 +896,7 @@ int aw2s_oriinit(openair0_device *device) { result = ORI_ObjectFaultReport(ori, NULL, 0, ORI_EventDrivenReport_True, &RE_result); if(result != ORI_Result_SUCCESS) { - printf("ORI_ObjectFaultReport failed with error: %s\n", ORI_Result_Print(result)); + printf("ORI_ObjectFaultReport failed with error: %s\n", ORI_Result_Print(RE_result)); aw2s_oricleanup(device); return -1; } From 774b750cb10f2759f2010c8f087972c6ed7e1bae Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 22 Feb 2022 17:27:42 +0100 Subject: [PATCH 560/883] fix for mimo dlsim --- openair1/PHY/INIT/nr_init.c | 3 +-- openair1/SIMULATION/NR_PHY/dlsim.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index bf8088143c..e7f0771556 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -88,11 +88,10 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Get the uniform planar array parameters // To be confirmed int O2 = N2 > 1? 4 : 1; //Vertical beam oversampling (1 or 4) - int O1 = CSI_RS_antenna_ports > 2? 4 : 1; //Horizontal beam oversampling (1 or 4) + int O1 = CSI_RS_antenna_ports > 2 ? 4 : 1; //Horizontal beam oversampling (1 or 4) AssertFatal(CSI_RS_antenna_ports == N1*N2*x_polarization, "Nb of antenna ports at PHY %d does not correspond to what passed down with fapi %d\n", N1*N2*x_polarization, CSI_RS_antenna_ports); - LOG_D(PHY, "NR Codebook Config: antenna ports: %d N1 %d N2 %d\n",CSI_RS_antenna_ports,N1,N2); // Generation of codebook Type1 with codebookMode 1 (CSI_RS_antenna_ports < 16) if (CSI_RS_antenna_ports < 16) { diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 7753d807d1..5a5667506f 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -781,6 +781,9 @@ int main(int argc, char **argv) pdsch_AntennaPorts.N1 = n_tx; pdsch_AntennaPorts.N2 = 1; pdsch_AntennaPorts.XP = 1; + gNB->ap_N1 = pdsch_AntennaPorts.N1; + gNB->ap_N2 = pdsch_AntennaPorts.N2; + gNB->ap_XP = pdsch_AntennaPorts.XP; fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, pdsch_AntennaPorts, 6, 0, 0, 0, 0); From abbcbe6aa55af6e608a251b544954f5f8344d642 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 22 Feb 2022 09:16:35 -0800 Subject: [PATCH 561/883] Adding fixes for MR from review These include: - Simplifying VNF code. - Adding comments to several areas of the code. - Using free_and_zero macros - Fixing spelling errors --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 4 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 7 +- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 105 ++++++++----------- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 3 +- 4 files changed, 53 insertions(+), 66 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 5b13b2e9d0..b6fbf7452b 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -90,6 +90,9 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu)); memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu)); rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti; + /* TODO: Implement channel modeling to abstract TA and CQI. For now, + we hard code the values below since they are set in L1 and we are + abstracting L1. */ rx_ind->pdu_list[j].timing_advance = 31; rx_ind->pdu_list[j].ul_cqi = 255; char buffer[1024]; @@ -204,6 +207,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response } } } + dl_config->number_pdus = 0; } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index c7d9d525a6..0cb3c4f7a6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3810,8 +3810,11 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR)); ra->RA_RAPID_found = 1; if (get_softmodem_params()->emulate_l1) { - LOG_I(NR_MAC, "If we found the RAR, the other PDUs are for other UEs and we dont need to process. " - "Only save rx_indication_body[%d] as only PDU in RX_indication\n", pdu_id); + /* When we are emulating L1 with multiple UEs, the rx_indication will have + multiple RAR PDUs. The code would previously handle each of these PDUs, + but it should only be handling the single RAR that matches the current + UE. */ + LOG_I(NR_MAC, "RAR PDU found for our UE with PDU index %d\n", pdu_id); dl_info->rx_ind->number_pdus = 1; if (pdu_id != 0) { memcpy(&dl_info->rx_ind->rx_indication_body[0], diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index b94b22282c..4f50e0481c 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -225,13 +225,10 @@ static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind { for(int i = 0; i < rach_ind->number_of_pdus; i++) { - free(rach_ind->pdu_list[i].preamble_list); - rach_ind->pdu_list[i].preamble_list = NULL; + free_and_zero(rach_ind->pdu_list[i].preamble_list); } - free(rach_ind->pdu_list); - rach_ind->pdu_list = NULL; - free(rach_ind); - rach_ind = NULL; + free_and_zero(rach_ind->pdu_list); + free_and_zero(rach_ind); } if (uci_ind && uci_ind->num_ucis > 0) { @@ -239,40 +236,31 @@ static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind switch (uci_ind->uci_list[i].pdu_type) { case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) { - free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); - uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL; + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); } - free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); - uci_ind->uci_list[i].pucch_pdu_format_0_1.harq = NULL; - free(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr); - uci_ind->uci_list[i].pucch_pdu_format_0_1.sr = NULL; + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr); break; case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: - free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); - free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); - free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); + free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); break; } } - free(uci_ind->uci_list); - uci_ind->uci_list = NULL; - free(uci_ind); - uci_ind = NULL; + free_and_zero(uci_ind->uci_list); + free_and_zero(uci_ind); } if (rx_ind && rx_ind->number_of_pdus > 0) { - free(rx_ind->pdu_list); - rx_ind->pdu_list = NULL; - free(rx_ind); - rx_ind = NULL; + free_and_zero(rx_ind->pdu_list); + free_and_zero(rx_ind); } if (crc_ind && crc_ind->number_crcs > 0) { - free(crc_ind->crc_list); - crc_ind->crc_list = NULL; - free(crc_ind); - crc_ind = NULL; + free_and_zero(crc_ind->crc_list); + free_and_zero(crc_ind); } } @@ -321,73 +309,61 @@ static void match_crc_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, nfapi_nr_crc "Invalid number of crc_ind->number_crcs %d or rx_ind->number_of_pdus %d\n", crc_ind->number_crcs, rx_ind->number_of_pdus); if (crc_ind->number_crcs > rx_ind->number_of_pdus) { + int num_unmatched_crcs = 0; nfapi_nr_crc_indication_t *crc_ind_unmatched = calloc(1, sizeof(*crc_ind_unmatched)); crc_ind_unmatched->header = crc_ind->header; crc_ind_unmatched->sfn = crc_ind->sfn; crc_ind_unmatched->slot = crc_ind->slot; - crc_ind_unmatched->number_crcs = 0; - crc_ind_unmatched->crc_list = NULL; + crc_ind_unmatched->number_crcs = crc_ind->number_crcs - rx_ind->number_of_pdus; + crc_ind_unmatched->crc_list = calloc(crc_ind_unmatched->number_crcs, sizeof(nfapi_nr_crc_t)); for (int i = 0; i < crc_ind->number_crcs; i++) { if (!rx_ind_has_rnti(rx_ind, crc_ind->crc_list[i].rnti)) { LOG_I(NR_MAC, "crc_ind->crc_list[%d].rnti %x does not match any rx_ind pdu rnti\n", i, crc_ind->crc_list[i].rnti); - crc_ind_unmatched->number_crcs++; - if (crc_ind_unmatched->crc_list == NULL) { - crc_ind_unmatched->crc_list = malloc(sizeof(nfapi_nr_crc_t)); - } - else { - crc_ind_unmatched->crc_list = realloc(crc_ind_unmatched->crc_list, - sizeof(nfapi_nr_crc_t) * crc_ind_unmatched->number_crcs); - } - crc_ind_unmatched->crc_list[crc_ind_unmatched->number_crcs - 1] = crc_ind->crc_list[i]; + crc_ind_unmatched->crc_list[num_unmatched_crcs] = crc_ind->crc_list[i]; + num_unmatched_crcs++; remove_crc_pdu(crc_ind, i); } if (crc_ind->number_crcs == rx_ind->number_of_pdus) { break; } } - AssertFatal(crc_ind_unmatched->number_crcs > 0, "The nubmer of unmatched crc_ind pdus %d <= 0\n", - crc_ind_unmatched->number_crcs); + AssertFatal(crc_ind_unmatched->number_crcs == num_unmatched_crcs, "crc_ind num_pdus %d doesnt match %d\n", + crc_ind_unmatched->number_crcs, num_unmatched_crcs); if (!requeue(&gnb_crc_ind_queue, crc_ind_unmatched)) { LOG_E(NR_PHY, "requeue failed for crc_ind_unmatched.\n"); - free(crc_ind_unmatched); - crc_ind_unmatched = NULL; + free_and_zero(crc_ind_unmatched->crc_list); + free_and_zero(crc_ind_unmatched); } } else if (crc_ind->number_crcs < rx_ind->number_of_pdus) { + int num_unmatched_rxs = 0; nfapi_nr_rx_data_indication_t *rx_ind_unmatched = calloc(1, sizeof(*rx_ind_unmatched)); rx_ind_unmatched->header = rx_ind->header; rx_ind_unmatched->sfn = rx_ind->sfn; rx_ind_unmatched->slot = rx_ind->slot; - rx_ind_unmatched->number_of_pdus = 0; - rx_ind_unmatched->pdu_list = NULL; + rx_ind_unmatched->number_of_pdus = rx_ind->number_of_pdus - crc_ind->number_crcs; + rx_ind_unmatched->pdu_list = calloc(rx_ind_unmatched->number_of_pdus, sizeof(nfapi_nr_pdu_t)); for (int i = 0; i < rx_ind->number_of_pdus; i++) { if (!crc_ind_has_rnti(crc_ind, rx_ind->pdu_list[i].rnti)) { LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %d does not match any crc_ind pdu rnti\n", i, rx_ind->pdu_list[i].rnti); - rx_ind_unmatched->number_of_pdus++; - if (rx_ind_unmatched->pdu_list == NULL) { - rx_ind_unmatched->pdu_list = malloc(sizeof(nfapi_nr_rx_data_pdu_t)); - } - else { - rx_ind_unmatched->pdu_list = realloc(rx_ind_unmatched->pdu_list, - sizeof(nfapi_nr_rx_data_pdu_t) * rx_ind_unmatched->number_of_pdus); - } - rx_ind_unmatched->pdu_list[rx_ind_unmatched->number_of_pdus - 1] = rx_ind->pdu_list[i]; + rx_ind_unmatched->pdu_list[num_unmatched_rxs] = rx_ind->pdu_list[i]; + num_unmatched_rxs++; remove_rx_pdu(rx_ind, i); } if (rx_ind->number_of_pdus == crc_ind->number_crcs) { break; } } - AssertFatal(rx_ind_unmatched->number_of_pdus > 0, "The nubmer of unmatched rx_ind pdus %d <= 0\n", - rx_ind_unmatched->number_of_pdus); + AssertFatal(rx_ind_unmatched->number_of_pdus == num_unmatched_rxs, "rx_ind num_pdus %d doesnt match %d\n", + rx_ind_unmatched->number_of_pdus, num_unmatched_rxs); if (!requeue(&gnb_rx_ind_queue, rx_ind_unmatched)) { LOG_E(NR_PHY, "requeue failed for rx_ind_unmatched.\n"); - free(rx_ind_unmatched); - rx_ind_unmatched = NULL; + free_and_zero(rx_ind_unmatched->pdu_list); + free_and_zero(rx_ind_unmatched); } } else { @@ -420,17 +396,19 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { if (get_softmodem_params()->emulate_l1) { if (gnb_rach_ind_queue.num_items > 0) { - LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); + LOG_D(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); rach_ind = get_queue(&gnb_rach_ind_queue); + AssertFatal(rach_ind->number_of_pdus > 0, "Invalid number of PDUs\n"); UL_info->rach_ind = *rach_ind; } if (gnb_uci_ind_queue.num_items > 0) { - LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); + LOG_D(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); uci_ind = get_queue(&gnb_uci_ind_queue); + AssertFatal(uci_ind->num_ucis > 0, "Invalid number of PDUs\n"); UL_info->uci_ind = *uci_ind; } if (gnb_rx_ind_queue.num_items > 0 && gnb_crc_ind_queue.num_items > 0) { - LOG_I(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n", + LOG_D(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n", gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items); rx_ind = get_queue(&gnb_rx_ind_queue); int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); @@ -443,11 +421,12 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { requeue(&gnb_rx_ind_queue, rx_ind); } else { + AssertFatal(rx_ind->number_of_pdus > 0, "Invalid number of PDUs\n"); + AssertFatal(crc_ind->number_crcs > 0, "Invalid number of PDUs\n"); + if (crc_ind->number_crcs != rx_ind->number_of_pdus) + match_crc_rx_pdu(rx_ind, crc_ind); UL_info->rx_ind = *rx_ind; UL_info->crc_ind = *crc_ind; - if (crc_ind->number_crcs != rx_ind->number_of_pdus) { - match_crc_rx_pdu(&UL_info->rx_ind, &UL_info->crc_ind); - } } } } diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index d271eecd5c..c3e41978e5 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4294,7 +4294,8 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list); measresulteutra_list->physCellId = phy_id; /* TODO: This asn1cCalloc leaks memory but also masks a bug. - If we delete this asn1cCalloc statement, eNB will crash in NSA mode. */ + If we delete this asn1cCalloc statement, eNB will crash in NSA mode. + Please don't delete the following line unless the bug has been found. */ asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; asn1cCallocOne(measResult->rsrpResult, rsrp_tar); From efcac39c7682990403a68ef6baef62efec8d8e53 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 22 Feb 2022 18:30:44 +0100 Subject: [PATCH 562/883] simplify polar codec interface --- openair1/PHY/CODING/TESTBENCH/polartest.c | 33 +++---- .../CODING/nrPolar_tools/nr_polar_decoder.c | 21 +++-- .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 40 +++++---- .../CODING/nrPolar_tools/nr_polar_encoder.c | 19 +++- openair1/PHY/CODING/nr_polar_init.c | 89 ++++++++++--------- openair1/PHY/NR_TRANSPORT/nr_dci.c | 7 +- openair1/PHY/NR_TRANSPORT/nr_pbch.c | 5 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 3 +- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 22 ++--- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 13 ++- openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 10 +-- openair1/PHY/defs_gNB.h | 2 +- openair1/PHY/defs_nr_UE.h | 1 - openair1/PHY/defs_nr_common.h | 2 - openair1/SIMULATION/NR_PHY/pucchsim.c | 3 - 15 files changed, 147 insertions(+), 123 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index 409b91a8f6..18946dac90 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -176,7 +176,7 @@ if (logFlag){ double channelOutput[coderLength]; //add noise int16_t channelOutput_int16[coderLength]; - t_nrPolar_params *currentPtr = nr_polar_params(polarMessageType, testLength, aggregation_level, 1, NULL); + t_nrPolar_params *currentPtr = nr_polar_params(polarMessageType, testLength, aggregation_level, true); #ifdef DEBUG_DCI_POLAR_PARAMS uint32_t dci_pdu[4]; @@ -211,7 +211,8 @@ if (logFlag){ modulated_input[i]=(-1)/sqrt(2); channel_output[i] = modulated_input[i] + (gaussdouble(0.0,1.0) * (1/sqrt(2*SNR_lin))); } - decoderState = polar_decoder_dci(channel_output, dci_est, currentPtrDCI, NR_POLAR_DECODER_LISTSIZE, rnti); + decoderState = polar_decoder_dci(channel_output, dci_est, NR_POLAR_DECODER_LISTSIZE, rnti, + 1, size, aggregation_level); printf("dci_est: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", dci_est[0], dci_est[1], dci_est[2], dci_est[3]); free(encoder_outputByte); free(channel_output); @@ -244,13 +245,13 @@ if (logFlag){ start_meas(&timeEncoder); if (decoder_int16==1) { - polar_encoder_fast((uint64_t *)testInput, encoderOutput, 0, 0, currentPtr); + polar_encoder_fast((uint64_t *)testInput, encoderOutput, 0, 0, polarMessageType, testLength, aggregation_level); //polar_encoder_fast((uint64_t*)testInput, (uint64_t*)encoderOutput,0,0,currentPtr); } else { //0 --> PBCH, 1 --> DCI, -1 --> UCI if (polarMessageType == 0) - polar_encoder(testInput, encoderOutput, currentPtr); + polar_encoder(testInput, encoderOutput, polarMessageType, testLength, aggregation_level); else if (polarMessageType == 1) - polar_encoder_dci(testInput, encoderOutput, currentPtr, rnti); + polar_encoder_dci(testInput, encoderOutput, rnti, polarMessageType, testLength, aggregation_level); } stop_meas(&timeEncoder); @@ -281,19 +282,20 @@ if (logFlag){ start_meas(&timeDecoder); if (decoder_int16==1) { - decoderState = polar_decoder_int16(channelOutput_int16, (uint64_t *)estimatedOutput, 0, currentPtr); + decoderState = polar_decoder_int16(channelOutput_int16, (uint64_t *)estimatedOutput, 0, + polarMessageType, testLength, aggregation_level); } else { //0 --> PBCH, 1 --> DCI, -1 --> UCI if (polarMessageType == 0) { - decoderState = polar_decoder(channelOutput, - estimatedOutput, - currentPtr, - decoderListSize); + decoderState = polar_decoder(channelOutput, + estimatedOutput, + decoderListSize, + polarMessageType, testLength, aggregation_level); } else if (polarMessageType == 1) { - decoderState = polar_decoder_dci(channelOutput, - estimatedOutput, - currentPtr, - decoderListSize, - rnti); + decoderState = polar_decoder_dci(channelOutput, + estimatedOutput, + decoderListSize, + rnti, + polarMessageType, testLength, aggregation_level); } } stop_meas(&timeDecoder); @@ -362,6 +364,5 @@ if (logFlag){ print_meas(&timeEncoder,"polar_encoder",NULL,NULL); print_meas(&timeDecoder,"polar_decoder",NULL,NULL); if (logFlag) fclose(logFile); - nr_polar_delete(currentPtr); return (0); } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index bdafb15d9c..5b21f49381 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -58,9 +58,13 @@ static inline void updateCrcChecksum2(int xlen, int8_t polar_decoder(double *input, uint32_t *out, - const t_nrPolar_params *polarParams, - uint8_t listSize) + uint8_t listSize, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level + ) { + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); //Assumes no a priori knowledge. uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; memset(bit,0,sizeof bit); @@ -302,9 +306,13 @@ int8_t polar_decoder(double *input, int8_t polar_decoder_dci(double *input, uint32_t *out, - const t_nrPolar_params *polarParams, uint8_t listSize, - uint16_t n_RNTI) { + uint16_t n_RNTI, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level ) { + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); + uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; memset(bit,0,sizeof bit); uint8_t bitUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True @@ -596,8 +604,11 @@ void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) { uint32_t polar_decoder_int16(int16_t *input, uint64_t *out, uint8_t ones_flag, - const t_nrPolar_params *polarParams) + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level ) { + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); int16_t d_tilde[polarParams->N];// = malloc(sizeof(double) * polarParams->N); nr_polar_rate_matching_int16(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength); diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index de6e2c3222..5d5d55b23e 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -79,9 +79,9 @@ typedef struct decoder_tree_t_s { struct nrPolar_params { //messageType: 0=PBCH, 1=DCI, -1=UCI - int idx; //idx = (messageType * messageLength * aggregation_prime); - struct nrPolar_params *nextPtr; + struct nrPolar_params *nextPtr __attribute__((aligned(16))); + uint32_t idx; uint8_t n_max; uint8_t i_il; uint8_t i_seg; @@ -138,34 +138,46 @@ typedef struct nrPolar_params t_nrPolar_params; void polar_encoder(uint32_t *input, uint32_t *output, - const t_nrPolar_params *polarParams); + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); void polar_encoder_dci(uint32_t *in, uint32_t *out, - const t_nrPolar_params *polarParams, - uint16_t n_RNTI); + uint16_t n_RNTI, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); void polar_encoder_fast(uint64_t *A, void *out, int32_t crcmask, uint8_t ones_flag, - const t_nrPolar_params *polarParams); + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); int8_t polar_decoder(double *input, uint32_t *output, - const t_nrPolar_params *polarParams, - uint8_t listSize); + uint8_t listSize, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); uint32_t polar_decoder_int16(int16_t *input, uint64_t *out, uint8_t ones_flag, - const t_nrPolar_params *polarParams); + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); int8_t polar_decoder_dci(double *input, uint32_t *out, - const t_nrPolar_params *polarParams, uint8_t listSize, - uint16_t n_RNTI); + uint16_t n_RNTI, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level); void generic_polar_decoder(const t_nrPolar_params *pp, decoder_node_t *node); @@ -183,13 +195,12 @@ void build_decoder_tree(t_nrPolar_params *pp); void build_polar_tables(t_nrPolar_params *polarParams); void init_polar_deinterleaver_table(t_nrPolar_params *polarParams); -void nr_polar_print_polarParams(t_nrPolar_params *polarParams); +void nr_polar_print_polarParams(void); t_nrPolar_params *nr_polar_params (int8_t messageType, uint16_t messageLength, uint8_t aggregation_level, - int decoder_flag, - t_nrPolar_params **polarList_ext); + int decoder_flag); uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level); @@ -333,5 +344,4 @@ static inline void nr_polar_deinterleaver(uint8_t *input, for (int i=0; iidx == 0 || polarParams->idx == 1) { //PBCH or PDCCH /* uint64_t B = (((uint64_t)*in)&((((uint64_t)1)<<32)-1)) | (((uint64_t)crc24c((uint8_t*)in,polarParams->payloadBits)>>8)<payloadBits); @@ -154,8 +157,12 @@ void polar_encoder(uint32_t *in, void polar_encoder_dci(uint32_t *in, uint32_t *out, - const t_nrPolar_params *polarParams, - uint16_t n_RNTI) { + uint16_t n_RNTI, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level) { + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); + #ifdef DEBUG_POLAR_ENCODER_DCI printf("[polar_encoder_dci] in: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", in[0], in[1], in[2], in[3]); #endif @@ -418,7 +425,11 @@ void polar_encoder_fast(uint64_t *A, void *out, int32_t crcmask, uint8_t ones_flag, - const t_nrPolar_params *polarParams) { + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level) { + + const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); // AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K); AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K); AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits); diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index 5fd5ff404b..50bc90636d 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -33,10 +33,20 @@ #include "PHY/CODING/nrPolar_tools/nr_polar_defs.h" #include "PHY/NR_TRANSPORT/nr_dci.h" +#define PolarKey ((messageType<<24)|(messageLength<<8)|aggregation_level) +static t_nrPolar_params * PolarList=NULL; +static pthread_mutex_t PolarListMutex=PTHREAD_MUTEX_INITIALIZER; + static int intcmp(const void *p1,const void *p2) { return(*(int16_t *)p1 > *(int16_t *)p2); } -void nr_polar_delete(t_nrPolar_params * polarParams) { + +static void nr_polar_delete_list(t_nrPolar_params * polarParams) { + if (!polarParams) + return; + if (polarParams->nextPtr) + nr_polar_delete_list(polarParams->nextPtr); + delete_decoder_tree(polarParams); //From build_polar_tables() for (int k=0; k < polarParams->K + polarParams->n_pc; k++) @@ -68,20 +78,36 @@ void nr_polar_delete(t_nrPolar_params * polarParams) { free(polarParams); } -static void nr_polar_init(t_nrPolar_params * *polarParams, - int8_t messageType, +static void nr_polar_delete(void) { + pthread_mutex_lock(&PolarListMutex); + nr_polar_delete_list(PolarList); + PolarList=NULL; + pthread_mutex_unlock(&PolarListMutex); +} + +t_nrPolar_params * nr_polar_params(int8_t messageType, uint16_t messageLength, uint8_t aggregation_level, int decoder_flag) { - t_nrPolar_params *currentPtr = *polarParams; - uint16_t aggregation_prime = (messageType >= 2) ? aggregation_level : nr_polar_aggregation_prime(aggregation_level); - + // The lock is weak, because we never delete in the list, only at exit time + // therefore, returning t_nrPolar_params * from the list is safe for future usage + pthread_mutex_lock(&PolarListMutex); + if(!PolarList) + atexit(nr_polar_delete); + + t_nrPolar_params *currentPtr = PolarList; //Parse the list. If the node is already created, return without initialization. while (currentPtr != NULL) { //printf("currentPtr->idx %d, (%d,%d)\n",currentPtr->idx,currentPtr->payloadBits,currentPtr->encoderLength); //LOG_D(PHY,"Looking for index %d\n",(messageType * messageLength * aggregation_prime)); - if (currentPtr->idx == (messageType * messageLength * aggregation_prime)) return; - else currentPtr = currentPtr->nextPtr; + if (currentPtr->idx == PolarKey ) { + if (decoder_flag && !currentPtr->tree.root) + build_decoder_tree(currentPtr); + pthread_mutex_unlock(&PolarListMutex); + return currentPtr ; + } + else + currentPtr = currentPtr->nextPtr; } // printf("currentPtr %p (polarParams %p)\n",currentPtr,polarParams); @@ -90,7 +116,7 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, if (newPolarInitNode != NULL) { // LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime); - newPolarInitNode->idx = (messageType * messageLength * aggregation_prime); + newPolarInitNode->idx = PolarKey; newPolarInitNode->nextPtr = NULL; //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level); @@ -212,7 +238,8 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern, newPolarInitNode->i_bil, newPolarInitNode->encoderLength); - if (decoder_flag == 1) build_decoder_tree(newPolarInitNode); + if (decoder_flag == 1) + build_decoder_tree(newPolarInitNode); build_polar_tables(newPolarInitNode); init_polar_deinterleaver_table(newPolarInitNode); //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes); @@ -220,21 +247,22 @@ static void nr_polar_init(t_nrPolar_params * *polarParams, AssertFatal(1 == 0, "[nr_polar_init] New t_nrPolar_params * could not be created"); } - //Fixme: the list is not thread safe - //The defect is not critical: we always append (never delete items) and adding two times the same is fine - newPolarInitNode->nextPtr=*polarParams; - *polarParams=newPolarInitNode; - return; + newPolarInitNode->nextPtr=PolarList; + PolarList=newPolarInitNode; + pthread_mutex_unlock(&PolarListMutex); + return newPolarInitNode; } -void nr_polar_print_polarParams(t_nrPolar_params *polarParams) { +void nr_polar_print_polarParams() { uint8_t i = 0; - if (polarParams == NULL) { + if (PolarList == NULL) { printf("polarParams is empty.\n"); } else { + t_nrPolar_params * polarParams=PolarList; while (polarParams != NULL) { - printf("polarParams[%d] = %d\n", i, polarParams->idx); + printf("polarParams[%d] = %d, %d, %d\n", i, + polarParams->idx>>24, (polarParams->idx>>8)&0xFFFF, polarParams->idx&0xFF); polarParams = polarParams->nextPtr; i++; } @@ -243,31 +271,6 @@ void nr_polar_print_polarParams(t_nrPolar_params *polarParams) { return; } -t_nrPolar_params *nr_polar_params (int8_t messageType, - uint16_t messageLength, - uint8_t aggregation_level, - int decoding_flag, - t_nrPolar_params **polarList_ext) { - static t_nrPolar_params *polarList = NULL; - nr_polar_init(polarList_ext != NULL ? polarList_ext : &polarList, - messageType,messageLength,aggregation_level,decoding_flag); - t_nrPolar_params *polarParams=polarList_ext != NULL ? *polarList_ext : polarList; - const int tag=messageType * messageLength * (messageType>=2 ? aggregation_level : nr_polar_aggregation_prime(aggregation_level)); - - - - while (polarParams != NULL) { - // LOG_D(PHY,"nr_polar_params : tag %d (from nr_polar_init %d)\n",tag,polarParams->idx); - if (polarParams->idx == tag) - return polarParams; - - polarParams = polarParams->nextPtr; - } - - AssertFatal(false,"Polar Init tables internal failure, no polarParams found\n"); - return NULL; -} - uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level) { if (aggregation_level == 0) return 0; else if (aggregation_level == 1) return NR_POLAR_AGGREGATION_LEVEL_1_PRIME; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index d233eb9ba6..0af56ba706 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -130,11 +130,8 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, uint16_t Nid = dci_pdu->ScramblingId; uint16_t scrambling_RNTI = dci_pdu->ScramblingRNTI; - t_nrPolar_params *currentPtr = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, - dci_pdu->PayloadSizeBits, - dci_pdu->AggregationLevel, - 0,NULL); - polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI,1,currentPtr); + polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI, 1, + NR_POLAR_DCI_MESSAGE_TYPE, dci_pdu->PayloadSizeBits, dci_pdu->AggregationLevel); #ifdef DEBUG_CHANNEL_CODING printf("polar rnti %x,length %d, L %d\n",n_RNTI, dci_pdu->PayloadSizeBits,pdcch_pdu_rel15->dci_pdu->AggregationLevel); printf("DCI PDU: [0]->0x%lx \t [1]->0x%lx\n", diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c index 0481338a9a..fc7df46496 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c @@ -298,9 +298,8 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu, a_reversed |= (((uint64_t)pbch->pbch_a_prime>>i)&1)<<(31-i); /// CRC, coding and rate matching - t_nrPolar_params* polar = nr_polar_params(NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL, 0, NULL); - polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0, polar); - nr_polar_delete(polar); + polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0, + NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL); #ifdef DEBUG_PBCH_ENCODING printf("Channel coding:\n"); diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 4256159812..b85dbd1454 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -1538,7 +1538,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, } else { // polar coded case - t_nrPolar_params *currentPtr = nr_polar_params(2,nb_bit,pucch_pdu->prb_size,1,&gNB->uci_polarParams); __m64 *rp_re[Prx2][2]; __m64 *rp2_re[Prx2][2]; __m64 *rp_im[Prx2][2]; @@ -1665,7 +1664,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, } // half_prb } // symb // run polar decoder on llrs - decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, currentPtr); + decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, 2,nb_bit,pucch_pdu->prb_size); LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]); if (decoderState>0) decoderState=1; corr_dB = dB_fixed64(corr); diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 84c9627c8a..1b247805a6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -832,14 +832,18 @@ void nr_pdcch_unscrambling(int16_t *z, /* This function compares the received DCI bits with * re-encoded DCI bits and returns the number of mismatched bits */ -uint16_t nr_dci_false_detection(uint64_t *dci, - int16_t *soft_in, - const t_nrPolar_params *polar_param, - int encoded_length, - int rnti) { +static uint16_t nr_dci_false_detection(uint64_t *dci, + int16_t *soft_in, + int encoded_length, + int rnti, + int8_t messageType, + uint16_t messageLength, + uint8_t aggregation_level + ) { uint32_t encoder_output[NR_MAX_DCI_SIZE_DWORD]; - polar_encoder_fast(dci, (void*)encoder_output, rnti, 1, (t_nrPolar_params *)polar_param); + polar_encoder_fast(dci, (void*)encoder_output, rnti, 1, + messageType, messageLength, aggregation_level); uint8_t *enout_p = (uint8_t*)encoder_output; uint16_t x = 0; @@ -886,7 +890,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, if (dci_found==1) continue; int dci_length = rel15->dci_length_options[k]; uint64_t dci_estimation[2]= {0}; - const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList); LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); @@ -901,11 +904,10 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, } } #endif - uint16_t crc = polar_decoder_int16(tmp_e, dci_estimation, 1, - currentPtrDCI); + NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L); n_rnti = rel15->rnti; LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n", @@ -913,7 +915,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, if (crc == n_rnti) { LOG_D(PHY, "(%i.%i) Received dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx)\n", proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length,*(unsigned long long*)dci_estimation); - uint16_t mb = nr_dci_false_detection(dci_estimation,tmp_e,currentPtrDCI,L*108,n_rnti); + uint16_t mb = nr_dci_false_detection(dci_estimation,tmp_e,L*108,n_rnti, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L); ue->dci_thres = (ue->dci_thres + mb) / 2; if (mb > (ue->dci_thres+20)) { LOG_W(PHY,"DCI false positive. Dropping DCI index %d. Mismatched bits: %d/%d. Current DCI threshold: %d\n",j,mb,L*108,ue->dci_thres); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 7b2cff0a40..20d63f985a 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -533,9 +533,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0); //polar decoding de-rate matching - t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); - decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,currentPtr); - nr_polar_delete(currentPtr); + decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0, + NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL); if(decoderState) return(decoderState); @@ -602,12 +601,12 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif nr_downlink_indication_t dl_indication; - fapi_nr_rx_indication_t rx_ind; - memset(&rx_ind, 0, sizeof(rx_ind)); + //Fixme: on the heap to please the mandatory free in nr_ue_ul_indication() + fapi_nr_rx_indication_t *rx_ind=calloc(sizeof(*rx_ind),1); uint16_t number_pdus = 1; - nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, gNB_id); - nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); + nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); if (ue->if_inst && ue->if_inst->dl_indication) ue->if_inst->dl_indication(&dl_indication, NULL); diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index 85651f498a..4dcce9f60f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -946,12 +946,10 @@ static void nr_uci_encoding(uint64_t payload, AssertFatal(nrofPRB<=16,"Number of PRB >16\n"); } else if (A>=12) { AssertFatal(A<65,"Polar encoding not supported yet for UCI with more than 64 bits\n"); - t_nrPolar_params *currentPtr = nr_polar_params(NR_POLAR_UCI_PUCCH_MESSAGE_TYPE, - A, - nrofPRB, - 1, - NULL); - polar_encoder_fast(&payload, b, 0,0,currentPtr); + polar_encoder_fast(&payload, b, 0,0, + NR_POLAR_UCI_PUCCH_MESSAGE_TYPE, + A, + nrofPRB); } } diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7c7d30a6e2..34dadf5bfd 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -779,7 +779,7 @@ typedef struct PHY_VARS_gNB_s { /// statistics for ULSCH measurement collection NR_gNB_SCH_STATS_t ulsch_stats[NUMBER_OF_NR_SCH_STATS_MAX]; NR_gNB_UCI_STATS_t uci_stats[NUMBER_OF_NR_UCI_STATS_MAX]; - t_nrPolar_params *uci_polarParams; + t_nrPolar_params **polarParams; /// SRS variables nr_srs_info_t *nr_srs_info[NUMBER_OF_NR_SRS_MAX]; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 0fa839f104..653b435e12 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -814,7 +814,6 @@ typedef struct { fapi_nr_config_request_t nrUE_config; - t_nrPolar_params *polarList; NR_UE_PDSCH *pdsch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX+1]; // two RxTx Threads NR_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 78599dcbb6..d3352fb520 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -387,8 +387,6 @@ struct NR_DL_FRAME_PARMS { uint8_t N_ssb; /// SSB index uint8_t ssb_index; - /// PBCH polar encoder params - t_nrPolar_params pbch_polar_params; /// OFDM symbol offset divisor for UL uint32_t ofdm_offset_divisor; }; diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 16b3589a95..151d51d726 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -465,7 +465,6 @@ int main(int argc, char **argv) mcs=table2_mcs[actual_payload+shift]; else AssertFatal(1==0,"Either nr_bit %d or sr_flag %d must be non-zero\n", nr_bit, sr_flag); } - else if (format == 2 && nr_bit > 11) gNB->uci_polarParams = nr_polar_params(2, nr_bit, nrofPRB, 1, NULL); startingPRB_intraSlotHopping = N_RB_DL-1; uint32_t hopping_id = Nid_cell; @@ -728,8 +727,6 @@ int main(int argc, char **argv) break; } } - if (gNB->uci_polarParams) - nr_polar_delete(gNB->uci_polarParams); free_channel_desc_scm(UE2gNB); term_freq_channel(); From 7b73a9e14eba780f3464115070fedeef6f8d8bc0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 22 Feb 2022 19:33:47 +0100 Subject: [PATCH 563/883] Build phy sims with optimizations As of this commit, the CI would take too much time to process dl_sim. This commit activate optimizations to be within the CI time limits. --- docker/Dockerfile.phySim.rhel8.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile.phySim.rhel8.2 b/docker/Dockerfile.phySim.rhel8.2 index 15a363b05b..2627a9eafd 100644 --- a/docker/Dockerfile.phySim.rhel8.2 +++ b/docker/Dockerfile.phySim.rhel8.2 @@ -38,7 +38,7 @@ RUN yum install -y libasan RUN /bin/sh oaienv && \ cd cmake_targets && \ mkdir -p log && \ - ./build_oai --phy_simulators -g --ninja --verbose-ci --sanitize-address + ./build_oai --phy_simulators --ninja --verbose-ci --sanitize-address #start from scratch for target executable FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim From 70ba0cda0ed91295b03a05a3042d1c9572d1ab59 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 22 Feb 2022 19:42:50 +0100 Subject: [PATCH 564/883] Free rx_ind if dl_indication not called --- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 20d63f985a..6b5185dc2c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -601,7 +601,6 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #endif nr_downlink_indication_t dl_indication; - //Fixme: on the heap to please the mandatory free in nr_ue_ul_indication() fapi_nr_rx_indication_t *rx_ind=calloc(sizeof(*rx_ind),1); uint16_t number_pdus = 1; @@ -610,6 +609,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, if (ue->if_inst && ue->if_inst->dl_indication) ue->if_inst->dl_indication(&dl_indication, NULL); + else + free(rx_ind); // dl_indication would free(), so free() here if not called return 0; } From 68471d0525cff47a7b4cdf68750a302b7ca81168 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 23 Sep 2021 16:03:14 +0200 Subject: [PATCH 565/883] Extending DL scheduling to multiple LCIDs --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 199 ++++++++---------- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 9 +- 2 files changed, 94 insertions(+), 114 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 92391ed1d5..55771c0e3f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -466,76 +466,49 @@ void nr_store_dlsch_buffer(module_id_t module_id, NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - sched_ctrl->num_total_bytes = 0; + sched_ctrl->dl_pdus_total = 0; - int lcid; - const uint16_t rnti = UE_info->rnti[UE_id]; - LOG_D(NR_MAC,"UE %d/%x : lcid_mask %x\n",UE_id,rnti,sched_ctrl->lcid_mask); - if ((sched_ctrl->lcid_mask&(1<<2)) > 0) - sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1] = mac_rlc_status_ind(module_id, + /* loop over all activated logical channels */ + // Note: DL_SCH_LCID_DCCH, DL_SCH_LCID_DCCH1, DL_SCH_LCID_DTCH + for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) { + + const int lcid = sched_ctrl->dl_lc_ids[i]; + const uint16_t rnti = UE_info->rnti[UE_id]; + LOG_D(NR_MAC, "In %s: UE %d/%x: LCID %d\n", __FUNCTION__, UE_id, rnti, lcid); + start_meas(&RC.nrmac[module_id]->rlc_status_ind); + sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id, rnti, module_id, frame, slot, ENB_FLAG_YES, MBMS_FLAG_NO, - DL_SCH_LCID_DCCH1, + lcid, 0, 0); - if ((sched_ctrl->lcid_mask&(1<<1)) > 0) - sched_ctrl->rlc_status[DL_SCH_LCID_DCCH] = mac_rlc_status_ind(module_id, - rnti, - module_id, - frame, - slot, - ENB_FLAG_YES, - MBMS_FLAG_NO, - DL_SCH_LCID_DCCH, - 0, - 0); - if ((sched_ctrl->lcid_mask&(1<<4)) > 0) { - start_meas(&RC.nrmac[module_id]->rlc_status_ind); - sched_ctrl->rlc_status[DL_SCH_LCID_DTCH] = mac_rlc_status_ind(module_id, - rnti, - module_id, - frame, - slot, - ENB_FLAG_YES, - MBMS_FLAG_NO, - DL_SCH_LCID_DTCH, - 0, - 0); - stop_meas(&RC.nrmac[module_id]->rlc_status_ind); - } - if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){ - lcid = DL_SCH_LCID_DCCH; - } - else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) - { - lcid = DL_SCH_LCID_DCCH1; - }else{ - lcid = DL_SCH_LCID_DTCH; - } - - sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; - //later multiplex here. Just select DCCH/SRB before DTCH/DRB - sched_ctrl->lcid_to_schedule = lcid; + stop_meas(&RC.nrmac[module_id]->rlc_status_ind); - if (sched_ctrl->num_total_bytes == 0 - && !sched_ctrl->ta_apply) /* If TA should be applied, give at least one RB */ - continue; + if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0) + continue; - LOG_D(NR_MAC, - "[%s][%d.%d], %s%d->DLSCH, RLC status %d bytes TA %d\n", - __func__, - frame, - slot, - lcid<4?"DCCH":"DTCH", - lcid, - sched_ctrl->rlc_status[lcid].bytes_in_buffer, - sched_ctrl->ta_apply); + sched_ctrl->dl_pdus_total += sched_ctrl->rlc_status[lcid].pdus_in_buffer; + sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; + LOG_D(MAC, + "[gNB %d][%4d.%2d] %s%d->DLSCH, RLC status for UE %d: %d bytes in buffer, total DL buffer size = %d bytes, %d total PDU bytes, %s TA command\n", + module_id, + frame, + slot, + lcid < 4 ? "DCCH":"DTCH", + lcid, + UE_id, + sched_ctrl->rlc_status[lcid].bytes_in_buffer, + sched_ctrl->num_total_bytes, + sched_ctrl->dl_pdus_total, + sched_ctrl->ta_apply ? "send":"do not send"); + } } } @@ -882,7 +855,7 @@ void pf_dl(module_id_t module_id, sched_pdsch->pucch_allocation = alloc; uint32_t TBS = 0; uint16_t rbSize; - const int oh = 3 + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); + const int oh = 3*sched_ctrl->dl_pdus_total + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); nr_find_nb_rb(sched_pdsch->Qm, sched_pdsch->R, ps->nrOfLayers, @@ -1326,68 +1299,70 @@ void nr_schedule_ue_spec(module_id_t module_id, buf += written; int size = TBS - written; DevAssert(size >= 0); - /* next, get RLC data */ - // const int lcid = DL_SCH_LCID_DTCH; - const int lcid = sched_ctrl->lcid_to_schedule; - int dlsch_total_bytes = 0; start_meas(&gNB_mac->rlc_data_req); if (sched_ctrl->num_total_bytes > 0) { - tbs_size_t len = 0; - while (size > 3) { - // we do not know how much data we will get from RLC, i.e., whether it - // will be longer than 256B or not. Therefore, reserve space for long header, then - // fetch data, then fill real length - NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; - buf += 3; - size -= 3; - /* limit requested number of bytes to what preprocessor specified, or - * such that TBS is full */ - const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size); + /* loop over all activated logical channels */ + for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) { - len = mac_rlc_data_req(module_id, - rnti, - module_id, - frame, - ENB_FLAG_YES, - MBMS_FLAG_NO, - lcid, - ndata, - (char *)buf, - 0, - 0); + const int lcid = sched_ctrl->dl_lc_ids[i]; + int dlsch_total_bytes = 0; - LOG_D(NR_MAC, - "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n", - frame, - slot, - rnti, - len, - lcid < 4 ? "DCCH" : "DTCH", - lcid, - ndata, - size); - if (len == 0) - break; + while (size > 3) { + // we do not know how much data we will get from RLC, i.e., whether it + // will be longer than 256B or not. Therefore, reserve space for long header, then + // fetch data, then fill real length + NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; + buf += 3; + size -= 3; - header->R = 0; - header->F = 1; - header->LCID = lcid; - header->L1 = (len >> 8) & 0xff; - header->L2 = len & 0xff; - size -= len; - buf += len; - dlsch_total_bytes += len; + /* limit requested number of bytes to what preprocessor specified, or + * such that TBS is full */ + const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size); + tbs_size_t len = mac_rlc_data_req(module_id, + rnti, + module_id, + frame, + ENB_FLAG_YES, + MBMS_FLAG_NO, + lcid, + ndata, + (char *)buf, + 0, + 0); + + LOG_D(NR_MAC, + "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n", + frame, + slot, + rnti, + len, + lcid < 4 ? "DCCH" : "DTCH", + lcid, + ndata, + size); + if (len == 0) { + /* RLC did not have data anymore, mark buffer as unused */ + buf -= 3; + size += 3; + break; + } + + header->R = 0; + header->F = 1; + header->LCID = lcid; + header->L1 = (len >> 8) & 0xff; + header->L2 = len & 0xff; + size -= len; + buf += len; + dlsch_total_bytes += len; + } + + UE_info->mac_stats[UE_id].lc_bytes_tx[lcid] += dlsch_total_bytes; } - if (len == 0) { - /* RLC did not have data anymore, mark buffer as unused */ - buf -= 3; - size += 3; - } - } - else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra || get_softmodem_params()->sa) { + } else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra) { /* we will need the large header, phy-test typically allocates all * resources and fills to the last byte below */ NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; @@ -1405,7 +1380,6 @@ void nr_schedule_ue_spec(module_id_t module_id, header->L2 = size & 0xff; size -= size; buf += size; - dlsch_total_bytes += size; } stop_meas(&gNB_mac->rlc_data_req); @@ -1425,7 +1399,6 @@ void nr_schedule_ue_spec(module_id_t module_id, UE_info->mac_stats[UE_id].dlsch_total_bytes += TBS; UE_info->mac_stats[UE_id].dlsch_current_bytes = TBS; - UE_info->mac_stats[UE_id].lc_bytes_tx[lcid] += dlsch_total_bytes; /* save retransmission information */ harq->sched_pdsch = *sched_pdsch; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 22a0932c3f..2745a4c46a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -597,8 +597,9 @@ typedef struct { /// total amount of data awaiting for this UE uint32_t num_total_bytes; + uint16_t dl_pdus_total; /// per-LC status data - mac_rlc_status_resp_t rlc_status[MAX_NUM_LCID]; + mac_rlc_status_resp_t rlc_status[NR_MAX_NUM_LCID]; /// Estimation of HARQ from BLER NR_DL_bler_stats_t dl_bler_stats; @@ -638,6 +639,12 @@ typedef struct { /// UL HARQ processes that await retransmission NR_list_t retrans_ul_harq; NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl;// MAC CE related information + + /// number of active DL LCs + uint8_t dl_lc_num; + /// order in which DLSCH scheduler should allocate LCs + uint8_t dl_lc_ids[NR_MAX_NUM_LCID]; + } NR_UE_sched_ctrl_t; typedef struct { From 0df80e648a53b8e00f6ee59126df97f889c2173e Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Wed, 29 Sep 2021 09:04:25 +0200 Subject: [PATCH 566/883] Replaced lcid_mask with arrays logic - this will be later used to prioritise the LCs --- openair2/LAYER2/NR_MAC_gNB/config.c | 47 ++++++++++++++----- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 1 - .../NR_MAC_gNB/gNB_scheduler_primitives.c | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 - 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 19c82c71df..27dc7df94f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -58,19 +58,42 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList * struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list, NR_UE_sched_ctrl_t *sched_ctrl) { - - if (rlc_bearer2add_list) - // keep lcids - for (int i=0;ilist.count;i++) { - sched_ctrl->lcid_mask |= (1<list.array[i]->logicalChannelIdentity); - LOG_I(NR_MAC,"Adding LCID %d (%s %d)\n", - (int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity, - rlc_bearer2add_list->list.array[i]->logicalChannelIdentity<4 ? "SRB" : "DRB", - (int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity); + if (rlc_bearer2release_list) { + for (int i = 0; i < rlc_bearer2release_list->list.count; i++) { + for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) { + if (sched_ctrl->dl_lc_ids[idx] == *rlc_bearer2release_list->list.array[i]) { + const int remaining_lcs = sched_ctrl->dl_lc_num - idx - 1; + memmove(&sched_ctrl->dl_lc_ids[idx], &sched_ctrl->dl_lc_ids[idx + 1], sizeof(sched_ctrl->dl_lc_ids[idx]) * remaining_lcs); + sched_ctrl->dl_lc_num--; + break; + } + } } - if (rlc_bearer2release_list) - for (int i=0;ilist.count;i++) - sched_ctrl->lcid_mask |= (1<<*rlc_bearer2release_list->list.array[i]); + } + + if (rlc_bearer2add_list) { + // keep lcids + for (int i = 0; i < rlc_bearer2add_list->list.count; i++) { + const int lcid = rlc_bearer2add_list->list.array[i]->logicalChannelIdentity; + bool found = false; + for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) { + if (sched_ctrl->dl_lc_ids[idx] == lcid) { + found = true; + break; + } + } + + if (!found) { + sched_ctrl->dl_lc_num++; + sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid; + LOG_D(NR_MAC, "Adding LCID %d (%s %d)\n", lcid, lcid < 4 ? "SRB" : "DRB", lcid); + } + } + } + + LOG_D(NR_MAC, "In %s: total num of active bearers %d) \n", + __FUNCTION__, + sched_ctrl->dl_lc_num); } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index fddf084a38..61cc2c505f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -329,7 +329,6 @@ void nr_preprocessor_phytest(module_id_t module_id, 0, 0); sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer; - sched_ctrl->lcid_to_schedule = lcid; uint8_t nr_of_candidates; for (int i=0; i<5; i++) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 721f67295b..b76a781491 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2152,6 +2152,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) { sched_ctrl->lcid_mask = 1<dl_lc_num = 0; sched_ctrl->ta_frame = 0; sched_ctrl->ta_update = 31; sched_ctrl->ta_apply = false; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 2745a4c46a..b6364c6d15 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -604,8 +604,6 @@ typedef struct { /// Estimation of HARQ from BLER NR_DL_bler_stats_t dl_bler_stats; - int lcid_mask; - int lcid_to_schedule; uint16_t ta_frame; int16_t ta_update; bool ta_apply; From f8d6677d4d4ffeda5d29b34cf26f4186fc39d8c0 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Fri, 5 Nov 2021 14:01:06 +0100 Subject: [PATCH 567/883] Adapted phytest scheduler to multiple LCs scheduling logic --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 61cc2c505f..416c049473 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -314,7 +314,9 @@ void nr_preprocessor_phytest(module_id_t module_id, } sched_ctrl->num_total_bytes = 0; + sched_ctrl->dl_lc_num = 1; const int lcid = DL_SCH_LCID_DTCH; + sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid; const uint16_t rnti = UE_info->rnti[UE_id]; /* update sched_ctrl->num_total_bytes so that postprocessor schedules data, * if available */ From 79591741e1b627a4d5e11832adec260a691d476f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Dec 2021 18:05:48 +0100 Subject: [PATCH 568/883] Fixup: do not abort scheduling when UE has no CCE --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 55771c0e3f..a5cfaefca2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -828,6 +828,10 @@ void pf_dl(module_id_t module_id, CCEIndex, sched_ctrl->aggregation_level); + /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */ + max_num_ue--; + if (max_num_ue < 0) return; + /* MCS has been set above */ const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; From 06236ff7964b319b907764ebc76d675674c99411 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Dec 2021 18:09:08 +0100 Subject: [PATCH 569/883] Consider fixed MAC overhead while no RLC PDU number --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index a5cfaefca2..94baf2adbd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -859,7 +859,12 @@ void pf_dl(module_id_t module_id, sched_pdsch->pucch_allocation = alloc; uint32_t TBS = 0; uint16_t rbSize; - const int oh = 3*sched_ctrl->dl_pdus_total + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); + // Fix me: currently, the RLC does not give us the total number of PDUs + // awaiting. Therefore, for the time being, we put a fixed overhead of 12 + // (for 4 PDUs) and optionally + 2 for TA. Once RLC gives the number of + // PDUs, we replace with 3 * numPDUs + const int oh = 3 * 4 + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); + //const int oh = 3 * sched_ctrl->dl_pdus_total + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); nr_find_nb_rb(sched_pdsch->Qm, sched_pdsch->R, ps->nrOfLayers, From f9079f1d2b03438861491845a1feb67f9db3e390 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 1 Dec 2021 18:17:14 +0100 Subject: [PATCH 570/883] Do not do RLC Ind if no data for LC --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 94baf2adbd..c9dd7fdd59 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1317,8 +1317,10 @@ void nr_schedule_ue_spec(module_id_t module_id, for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) { const int lcid = sched_ctrl->dl_lc_ids[i]; - int dlsch_total_bytes = 0; + if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0) + continue; // no data for this LC + int dlsch_total_bytes = 0; while (size > 3) { // we do not know how much data we will get from RLC, i.e., whether it // will be longer than 256B or not. Therefore, reserve space for long header, then From 34edc9c04c1fb72596a208744b2f2ecdb35b251b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 12:32:40 +0100 Subject: [PATCH 571/883] Increase CI physim time limit --- ci-scripts/cls_physim1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index b7a730e91c..83fb74b7cb 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -246,7 +246,7 @@ class PhySim: isFinished = False # doing a deep copy! tmpPodNames = podNames.copy() - while(count < 32 and isFinished == False): + while(count < 50 and isFinished == False): time.sleep(60) for podName in tmpPodNames: mySSH.command2(f'oc logs --tail=1 {podName} 2>&1', 6, silent=True) From dc4a82934dead240379968cc1148060c6152a5a2 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 23 Feb 2022 11:53:57 +0000 Subject: [PATCH 572/883] Fixes after merge --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 6 +++++- openair2/RRC/NR/rrc_gNB.c | 21 +++++++++++++++++++ .../gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- ...gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 4 ++-- ...gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 2 +- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 99cc76c913..594f322b88 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -584,7 +584,11 @@ void nr_set_pdsch_semi_static(module_id_t module_id, SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols); } - const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; + const long f = ((bwp || bwpd) && + sched_ctrl->search_space && + sched_ctrl->search_space->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific) ? + sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0; + int dci_format; if (sched_ctrl->search_space) { dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index a8f9df737f..1aef575f99 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -106,6 +106,27 @@ extern RAN_CONTEXT_t RC; +extern boolean_t nr_rrc_pdcp_config_asn1_req( + const protocol_ctxt_t *const ctxt_pP, + NR_SRB_ToAddModList_t *const srb2add_list, + NR_DRB_ToAddModList_t *const drb2add_list, + NR_DRB_ToReleaseList_t *const drb2release_list, + const uint8_t security_modeP, + uint8_t *const kRRCenc, + uint8_t *const kRRCint, + uint8_t *const kUPenc, + uint8_t *const kUPint + ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 + ,rb_id_t *const defaultDRB, + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); + +extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, + const NR_SRB_ToAddModList_t * const srb2add_listP, + const NR_DRB_ToAddModList_t * const drb2add_listP, + const NR_DRB_ToReleaseList_t * const drb2release_listP, + const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); + static inline uint64_t bitStr_to_uint64(BIT_STRING_t *asn); mui_t rrc_gNB_mui = 0; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 9bf20b54ab..b8248b02dd 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -37,7 +37,7 @@ gNBs = pusch_AntennaPorts = 1; min_rxtxtime = 6; sib1_tda = 0; - do_SRS = 1; + do_SRS = 0; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 9452f00eed..54016c6b0e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -36,7 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; sib1_tda = 0; - do_SRS = 1; + do_SRS = 0; ul_prbblacklist = "51,52,53,54" pdcch_ConfigSIB1 = ( @@ -100,7 +100,7 @@ gNBs = prach_msg1_FDM = 0; prach_msg1_FrequencyStart = 0; zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; + preambleReceivedTargetPower = -96; #preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) preambleTransMax = 6; #powerRampingStep diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index fac54a298b..546065d9b4 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -112,7 +112,7 @@ gNBs = prach_msg1_FDM = 0; prach_msg1_FrequencyStart = 0; zeroCorrelationZoneConfig = 12; - preambleReceivedTargetPower = -104; + preambleReceivedTargetPower = -96; #preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) preambleTransMax = 6; #powerRampingStep From 41976e765307b6d2191a47b8266eb10639d92de0 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Tue, 22 Feb 2022 13:33:36 +0000 Subject: [PATCH 573/883] Fix build after merge --- cmake_targets/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 82022da78f..1bd7591e58 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2012,6 +2012,7 @@ set(NR_L2_SRC_UE ${NR_UE_RRC_DIR}/main_ue.c ${NR_UE_RRC_DIR}/rrc_UE.c ${NR_UE_RRC_DIR}/rrc_nsa.c + ${NR_RRC_DIR}/nr_rrc_config.c ) set (MAC_SRC From d4ce30c54d7801fb52eec7f3721bc0043eed54fa Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 23 Feb 2022 16:52:13 +0100 Subject: [PATCH 574/883] additional review fixes --- openair2/GNB_APP/gnb_config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 ++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 3 +-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 +++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index ccd26a62ea..ec666f9415 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -740,7 +740,7 @@ void RCconfig_nr_macrlc() { uint16_t prbbl[275]; int num_prbbl=0; int prb; - memset(prbbl,0,prbbl); + memset(prbbl,0,sizeof(prbbl)); while (pt) { prb=atoi(pt); prbbl[prb] = 0x3FFF; // all symbols taken diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index cd34a543c7..3c441b7c6c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -681,7 +681,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* retransmissions: directly allocate */ *n_rb_sched -= sched_ctrl->sched_pdsch.rbSize; for (int rb = 0; rb < sched_ctrl->sched_pdsch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pdsch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); return true; } @@ -878,7 +878,7 @@ void pf_dl(module_id_t module_id, /* transmissions: directly allocate */ n_rb_sched -= sched_pdsch->rbSize; for (int rb = 0; rb < sched_pdsch->rbSize; rb++) - rballoc_mask[rb + sched_pdsch->rbStart] -= slbitmap; + rballoc_mask[rb + sched_pdsch->rbStart] ^= slbitmap; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 8480e22a60..5c1ef2128f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1149,6 +1149,8 @@ void set_r_pucch_parms(int rsetindex, int *nr_of_symbols, int *start_symbol_index) { + // procedure described in 38.213 section 9.2.1 + int prboffset = r_pucch/default_pucch_csset[rsetindex]; int prboffsetm8 = (r_pucch-8)/default_pucch_csset[rsetindex]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 61cfb986dc..5880f59655 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1282,8 +1282,7 @@ int nr_acknack_scheduling(int mod_id, cg->spCellConfig && cg->spCellConfig->spCellConfigDedicated && cg->spCellConfig->spCellConfigDedicated->uplinkConfig && - cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP && - cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup) { + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP) { pucch_Config = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; } NR_BWP_t *genericParameters = sched_ctrl->active_ubwp ? diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 5f34c10b3b..e77fa0ef29 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1091,7 +1091,7 @@ bool allocate_ul_retransmission(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(sched_ctrl->pusch_semi_static.startSymbolIndex, sched_ctrl->pusch_semi_static.nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(sched_ctrl->pusch_semi_static.startSymbolIndex, sched_ctrl->pusch_semi_static.nrOfSymbols); return true; } @@ -1256,7 +1256,7 @@ void pf_ul(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); continue; } @@ -1389,7 +1389,7 @@ void pf_ul(module_id_t module_id, n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] -= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); } } From ae803b5370f1bdb83bbbb0edec282e5599b36519 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 16:57:49 +0100 Subject: [PATCH 575/883] Prevent heap buffer overflow in nr_dlsch_channel_compensation() The TX correlation calculation incremented the pointer over the outer TX antenna inside the inner TX antenna loop. Incrementing the pointer in the outer loop instead prevents overflowing. --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 075aaecc08..7101cadac8 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -1027,7 +1027,6 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, ((int16_t*)&rho128[2])[5] + ((int16_t*)&rho128[2])[7])/16; - dl_ch128+=3; dl_ch128_2+=3; rho128+=3; } @@ -1037,6 +1036,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, avg_rho_im[aarx][aatx*nb_aatx+atx] = 16*avg_rho_im[aarx][aatx*nb_aatx+atx]/(nb_rb*12); //printf("rho[rx]%d tx%d tx%d = Re: %d Im: %d\n",aarx, aatx,atx, avg_rho_re[aarx][aatx*nb_aatx+atx], avg_rho_im[aarx][aatx*nb_aatx+atx]); } + dl_ch128+=3; } } } From 11441023db2b958349f4192acbb1c1b34c320f48 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 23 Feb 2022 17:19:00 +0100 Subject: [PATCH 576/883] fix polar race condition --- .../install_external_packages.ubuntu20 | 1 + .../CODING/nrPolar_tools/nr_polar_decoder.c | 13 +- .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 8 + .../CODING/nrPolar_tools/nr_polar_encoder.c | 15 +- openair1/PHY/CODING/nr_polar_init.c | 248 +++++++++--------- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- openair1/SIMULATION/LTE_PHY/ulsim.c | 8 +- openair3/NAS/COMMON/API/NETWORK/nas_message.c | 3 +- 8 files changed, 159 insertions(+), 139 deletions(-) diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 index 1f10ca53c7..a2f6a9709c 100755 --- a/cmake_targets/install_external_packages.ubuntu20 +++ b/cmake_targets/install_external_packages.ubuntu20 @@ -86,6 +86,7 @@ check_supported_distribution() { "ubuntu20.04") return 0 ;; "ubuntu20.10") return 0 ;; "ubuntu21.04") return 0 ;; + "ubuntu21.10") return 0 ;; esac return 1 } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index 5b21f49381..03ffa30025 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -268,7 +268,7 @@ int8_t polar_decoder(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - return(-1); + polarReturn(-1); } nonFrozenBit++; @@ -301,7 +301,8 @@ int8_t polar_decoder(double *input, * Return bits. */ nr_byte2bit_uint8_32(polarParams->nr_polar_A, polarParams->payloadBits, out); - return(0); + + polarReturn 0; } int8_t polar_decoder_dci(double *input, @@ -532,7 +533,7 @@ int8_t polar_decoder_dci(double *input, if (decoderIterationCheck==0) { //perror("[SCL polar decoder] All list entries have failed the CRC checks."); - return(-1); + polarReturn -1; } nonFrozenBit++; @@ -565,7 +566,8 @@ int8_t polar_decoder_dci(double *input, * Return bits. */ nr_byte2bit_uint8_32(polarParams->nr_polar_A, polarParams->payloadBits, out); - return(0); + + polarReturn 0; } void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) { @@ -705,5 +707,6 @@ uint32_t polar_decoder_int16(int16_t *input, rxcrc,polarParams->payloadBits); #endif out[0]=Ar; - return(crc^rxcrc); + + polarReturn crc^rxcrc; } diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index 5d5d55b23e..edb5ebbcc2 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -81,6 +81,7 @@ struct nrPolar_params { //messageType: 0=PBCH, 1=DCI, -1=UCI struct nrPolar_params *nextPtr __attribute__((aligned(16))); + bool busy; uint32_t idx; uint8_t n_max; uint8_t i_il; @@ -344,4 +345,11 @@ static inline void nr_polar_deinterleaver(uint8_t *input, for (int i=0; ibusy=false; \ +pthread_mutex_unlock(&PolarListMutex); \ +return + #endif diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c index 8cea7c8986..f654d33dfd 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c @@ -60,10 +60,10 @@ void polar_encoder(uint32_t *in, */ //Calculate CRC. nr_matrix_multiplication_uint8_1D_uint8_2D(polarParams->nr_polar_A, - polarParams->crc_generator_matrix, - polarParams->nr_polar_crc, - polarParams->payloadBits, - polarParams->crcParityBits); + polarParams->crc_generator_matrix, + polarParams->nr_polar_crc, + polarParams->payloadBits, + polarParams->crcParityBits); for (uint8_t i = 0; i < polarParams->crcParityBits; i++) polarParams->nr_polar_crc[i] = (polarParams->nr_polar_crc[i] % 2); @@ -153,6 +153,9 @@ void polar_encoder(uint32_t *in, #endif nr_byte2bit_uint8_32(polarParams->nr_polar_E, polarParams->encoderLength, out); + + polarReturn; + } void polar_encoder_dci(uint32_t *in, @@ -256,6 +259,7 @@ void polar_encoder_dci(uint32_t *in, printf("\n[polar_encoder_dci] out: "); for (int i = 0; i < outputInd; i++) printf("[%d]->0x%08x\t", i, out[i]); #endif + polarReturn; } static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void *in,void *out) __attribute__((always_inline)); @@ -698,4 +702,7 @@ void polar_encoder_fast(uint64_t *A, } memset((void*)out,0,polarParams->encoderLength>>3); polar_rate_matching(polarParams,(void *)D, out); + + polarReturn; + } diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index 50bc90636d..32e2d7f364 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -100,10 +100,11 @@ t_nrPolar_params * nr_polar_params(int8_t messageType, while (currentPtr != NULL) { //printf("currentPtr->idx %d, (%d,%d)\n",currentPtr->idx,currentPtr->payloadBits,currentPtr->encoderLength); //LOG_D(PHY,"Looking for index %d\n",(messageType * messageLength * aggregation_prime)); - if (currentPtr->idx == PolarKey ) { + if (currentPtr->busy == false && currentPtr->idx == PolarKey ) { + currentPtr->busy=true; + pthread_mutex_unlock(&PolarListMutex); if (decoder_flag && !currentPtr->tree.root) build_decoder_tree(currentPtr); - pthread_mutex_unlock(&PolarListMutex); return currentPtr ; } else @@ -113,143 +114,142 @@ t_nrPolar_params * nr_polar_params(int8_t messageType, // printf("currentPtr %p (polarParams %p)\n",currentPtr,polarParams); //Else, initialize and add node to the end of the linked list. t_nrPolar_params *newPolarInitNode = calloc(sizeof(t_nrPolar_params),1); - - if (newPolarInitNode != NULL) { - // LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime); - newPolarInitNode->idx = PolarKey; - newPolarInitNode->nextPtr = NULL; - //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level); + newPolarInitNode->busy=true; + pthread_mutex_unlock(&PolarListMutex); - if (messageType == 0) { //PBCH - newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX; - newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL; - newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG; - newPolarInitNode->n_pc = NR_POLAR_PBCH_N_PC; - newPolarInitNode->n_pc_wm = NR_POLAR_PBCH_N_PC_WM; - newPolarInitNode->i_bil = NR_POLAR_PBCH_I_BIL; - newPolarInitNode->crcParityBits = NR_POLAR_PBCH_CRC_PARITY_BITS; - newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS; - newPolarInitNode->encoderLength = NR_POLAR_PBCH_E; - newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS; - newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits);//G_P - //printf("Initializing polar parameters for PBCH (K %d, E %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength); - } else if (messageType == 1) { //DCI - newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX; - newPolarInitNode->i_il = NR_POLAR_DCI_I_IL; - newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG; - newPolarInitNode->n_pc = NR_POLAR_DCI_N_PC; - newPolarInitNode->n_pc_wm = NR_POLAR_DCI_N_PC_WM; - newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL; - newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS; - newPolarInitNode->payloadBits = messageLength; - newPolarInitNode->encoderLength = aggregation_level*108; - newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS; - newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P - //printf("Initializing polar parameters for DCI (K %d, E %d, L %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength,aggregation_level); - } else if (messageType == 2) { //UCI PUCCH2 - AssertFatal(aggregation_level>2,"Aggregation level (%d) for PUCCH 2 encoding is NPRB and should be > 2\n",aggregation_level); - AssertFatal(messageLength>11,"Message length %d is too short for polar encoding of UCI\n",messageLength); - newPolarInitNode->n_max = NR_POLAR_PUCCH_N_MAX; - newPolarInitNode->i_il = NR_POLAR_PUCCH_I_IL; - newPolarInitNode->encoderLength = aggregation_level * 16; + AssertFatal(newPolarInitNode != NULL, "[nr_polar_init] New t_nrPolar_params * could not be created"); + + // LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime); + newPolarInitNode->idx = PolarKey; + newPolarInitNode->nextPtr = NULL; + //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level); + + if (messageType == 0) { //PBCH + newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX; + newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL; + newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG; + newPolarInitNode->n_pc = NR_POLAR_PBCH_N_PC; + newPolarInitNode->n_pc_wm = NR_POLAR_PBCH_N_PC_WM; + newPolarInitNode->i_bil = NR_POLAR_PBCH_I_BIL; + newPolarInitNode->crcParityBits = NR_POLAR_PBCH_CRC_PARITY_BITS; + newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS; + newPolarInitNode->encoderLength = NR_POLAR_PBCH_E; + newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS; + newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits);//G_P + //printf("Initializing polar parameters for PBCH (K %d, E %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength); + } else if (messageType == 1) { //DCI + newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX; + newPolarInitNode->i_il = NR_POLAR_DCI_I_IL; + newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG; + newPolarInitNode->n_pc = NR_POLAR_DCI_N_PC; + newPolarInitNode->n_pc_wm = NR_POLAR_DCI_N_PC_WM; + newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL; + newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS; + newPolarInitNode->payloadBits = messageLength; + newPolarInitNode->encoderLength = aggregation_level*108; + newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS; + newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P + //printf("Initializing polar parameters for DCI (K %d, E %d, L %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength,aggregation_level); + } else if (messageType == 2) { //UCI PUCCH2 + AssertFatal(aggregation_level>2,"Aggregation level (%d) for PUCCH 2 encoding is NPRB and should be > 2\n",aggregation_level); + AssertFatal(messageLength>11,"Message length %d is too short for polar encoding of UCI\n",messageLength); + newPolarInitNode->n_max = NR_POLAR_PUCCH_N_MAX; + newPolarInitNode->i_il = NR_POLAR_PUCCH_I_IL; + newPolarInitNode->encoderLength = aggregation_level * 16; - newPolarInitNode->i_seg = 0; + newPolarInitNode->i_seg = 0; - if ((messageLength >= 360 && newPolarInitNode->encoderLength >= 1088)|| - (messageLength >= 1013)) newPolarInitNode->i_seg = 1; + if ((messageLength >= 360 && newPolarInitNode->encoderLength >= 1088)|| + (messageLength >= 1013)) newPolarInitNode->i_seg = 1; - newPolarInitNode->crcParityBits = 11; - newPolarInitNode->n_pc = 0; - newPolarInitNode->n_pc_wm = 0; + newPolarInitNode->crcParityBits = 11; + newPolarInitNode->n_pc = 0; + newPolarInitNode->n_pc_wm = 0; - if (messageLength < 20) { - newPolarInitNode->crcParityBits = 6; - newPolarInitNode->n_pc = 3; - if ((newPolarInitNode->encoderLength - messageLength - 6 + 3) < 193) newPolarInitNode->n_pc_wm = 1; - } - - - - newPolarInitNode->i_bil = NR_POLAR_PUCCH_I_BIL; - - newPolarInitNode->payloadBits = messageLength; - newPolarInitNode->crcCorrectionBits = NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS; - //newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P - //LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level); - } else { - AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType); + if (messageLength < 20) { + newPolarInitNode->crcParityBits = 6; + newPolarInitNode->n_pc = 3; + if ((newPolarInitNode->encoderLength - messageLength - 6 + 3) < 193) newPolarInitNode->n_pc_wm = 1; } - newPolarInitNode->K = newPolarInitNode->payloadBits + newPolarInitNode->crcParityBits; // Number of bits to encode. - newPolarInitNode->N = nr_polar_output_length(newPolarInitNode->K, - newPolarInitNode->encoderLength, - newPolarInitNode->n_max); - newPolarInitNode->n = log2(newPolarInitNode->N); - newPolarInitNode->G_N = nr_polar_kronecker_power_matrices(newPolarInitNode->n); - //polar_encoder vectors: - newPolarInitNode->nr_polar_crc = malloc(sizeof(uint8_t) * newPolarInitNode->crcParityBits); - newPolarInitNode->nr_polar_aPrime = malloc(sizeof(uint8_t) * ((ceil((newPolarInitNode->payloadBits)/32.0)*4)+3)); - newPolarInitNode->nr_polar_APrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); - newPolarInitNode->nr_polar_D = malloc(sizeof(uint8_t) * newPolarInitNode->N); - newPolarInitNode->nr_polar_E = malloc(sizeof(uint8_t) * newPolarInitNode->encoderLength); - //Polar Coding vectors - newPolarInitNode->nr_polar_U = malloc(sizeof(uint8_t) * newPolarInitNode->N); //Decoder: nr_polar_uHat - newPolarInitNode->nr_polar_CPrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_cHat - newPolarInitNode->nr_polar_B = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_bHat - newPolarInitNode->nr_polar_A = malloc(sizeof(uint8_t) * newPolarInitNode->payloadBits); //Decoder: nr_polar_aHat - newPolarInitNode->Q_0_Nminus1 = nr_polar_sequence_pattern(newPolarInitNode->n); - newPolarInitNode->interleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K); - nr_polar_interleaving_pattern(newPolarInitNode->K, - newPolarInitNode->i_il, - newPolarInitNode->interleaving_pattern); - newPolarInitNode->deinterleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K); - for (int i=0; iK; i++) - newPolarInitNode->deinterleaving_pattern[newPolarInitNode->interleaving_pattern[i]] = i; - newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); - uint16_t J[newPolarInitNode->N]; - nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern, - J, - nr_polar_subblock_interleaver_pattern, - newPolarInitNode->K, - newPolarInitNode->N, - newPolarInitNode->encoderLength); - newPolarInitNode->information_bit_pattern = malloc(sizeof(uint8_t) * newPolarInitNode->N); - newPolarInitNode->Q_I_N = malloc(sizeof(int16_t) * (newPolarInitNode->K + newPolarInitNode->n_pc)); - newPolarInitNode->Q_F_N = malloc( sizeof(int16_t) * (newPolarInitNode->N + 1)); // Last element shows the final array index assigned a value. - newPolarInitNode->Q_PC_N = malloc( sizeof(int16_t) * (newPolarInitNode->n_pc)); + newPolarInitNode->i_bil = NR_POLAR_PUCCH_I_BIL; - for (int i = 0; i <= newPolarInitNode->N; i++) - newPolarInitNode->Q_F_N[i] = -1; // Empty array. - - nr_polar_info_bit_pattern(newPolarInitNode->information_bit_pattern, - newPolarInitNode->Q_I_N, - newPolarInitNode->Q_F_N, - J, - newPolarInitNode->Q_0_Nminus1, - newPolarInitNode->K, - newPolarInitNode->N, - newPolarInitNode->encoderLength, - newPolarInitNode->n_pc); - // sort the Q_I_N array in ascending order (first K positions) - qsort((void *)newPolarInitNode->Q_I_N,newPolarInitNode->K,sizeof(int16_t),intcmp); - newPolarInitNode->channel_interleaver_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); - nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern, - newPolarInitNode->i_bil, - newPolarInitNode->encoderLength); - if (decoder_flag == 1) - build_decoder_tree(newPolarInitNode); - build_polar_tables(newPolarInitNode); - init_polar_deinterleaver_table(newPolarInitNode); - //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes); + newPolarInitNode->payloadBits = messageLength; + newPolarInitNode->crcCorrectionBits = NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS; + //newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P + //LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level); } else { - AssertFatal(1 == 0, "[nr_polar_init] New t_nrPolar_params * could not be created"); + AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType); } + newPolarInitNode->K = newPolarInitNode->payloadBits + newPolarInitNode->crcParityBits; // Number of bits to encode. + newPolarInitNode->N = nr_polar_output_length(newPolarInitNode->K, + newPolarInitNode->encoderLength, + newPolarInitNode->n_max); + newPolarInitNode->n = log2(newPolarInitNode->N); + newPolarInitNode->G_N = nr_polar_kronecker_power_matrices(newPolarInitNode->n); + //polar_encoder vectors: + newPolarInitNode->nr_polar_crc = malloc(sizeof(uint8_t) * newPolarInitNode->crcParityBits); + newPolarInitNode->nr_polar_aPrime = malloc(sizeof(uint8_t) * ((ceil((newPolarInitNode->payloadBits)/32.0)*4)+3)); + newPolarInitNode->nr_polar_APrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); + newPolarInitNode->nr_polar_D = malloc(sizeof(uint8_t) * newPolarInitNode->N); + newPolarInitNode->nr_polar_E = malloc(sizeof(uint8_t) * newPolarInitNode->encoderLength); + //Polar Coding vectors + newPolarInitNode->nr_polar_U = malloc(sizeof(uint8_t) * newPolarInitNode->N); //Decoder: nr_polar_uHat + newPolarInitNode->nr_polar_CPrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_cHat + newPolarInitNode->nr_polar_B = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_bHat + newPolarInitNode->nr_polar_A = malloc(sizeof(uint8_t) * newPolarInitNode->payloadBits); //Decoder: nr_polar_aHat + newPolarInitNode->Q_0_Nminus1 = nr_polar_sequence_pattern(newPolarInitNode->n); + newPolarInitNode->interleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K); + nr_polar_interleaving_pattern(newPolarInitNode->K, + newPolarInitNode->i_il, + newPolarInitNode->interleaving_pattern); + newPolarInitNode->deinterleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K); + + for (int i=0; iK; i++) + newPolarInitNode->deinterleaving_pattern[newPolarInitNode->interleaving_pattern[i]] = i; + + newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); + uint16_t J[newPolarInitNode->N]; + nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern, + J, + nr_polar_subblock_interleaver_pattern, + newPolarInitNode->K, + newPolarInitNode->N, + newPolarInitNode->encoderLength); + newPolarInitNode->information_bit_pattern = malloc(sizeof(uint8_t) * newPolarInitNode->N); + newPolarInitNode->Q_I_N = malloc(sizeof(int16_t) * (newPolarInitNode->K + newPolarInitNode->n_pc)); + newPolarInitNode->Q_F_N = malloc( sizeof(int16_t) * (newPolarInitNode->N + 1)); // Last element shows the final array index assigned a value. + newPolarInitNode->Q_PC_N = malloc( sizeof(int16_t) * (newPolarInitNode->n_pc)); + + for (int i = 0; i <= newPolarInitNode->N; i++) + newPolarInitNode->Q_F_N[i] = -1; // Empty array. + + nr_polar_info_bit_pattern(newPolarInitNode->information_bit_pattern, + newPolarInitNode->Q_I_N, + newPolarInitNode->Q_F_N, + J, + newPolarInitNode->Q_0_Nminus1, + newPolarInitNode->K, + newPolarInitNode->N, + newPolarInitNode->encoderLength, + newPolarInitNode->n_pc); + // sort the Q_I_N array in ascending order (first K positions) + qsort((void *)newPolarInitNode->Q_I_N,newPolarInitNode->K,sizeof(int16_t),intcmp); + newPolarInitNode->channel_interleaver_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength); + nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern, + newPolarInitNode->i_bil, + newPolarInitNode->encoderLength); + if (decoder_flag == 1) + build_decoder_tree(newPolarInitNode); + build_polar_tables(newPolarInitNode); + init_polar_deinterleaver_table(newPolarInitNode); + //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes); + newPolarInitNode->nextPtr=PolarList; PolarList=newPolarInitNode; - pthread_mutex_unlock(&PolarListMutex); return newPolarInitNode; } diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 8f9fcae563..25f2f37321 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -147,7 +147,7 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_ } void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4], - double *s_re[2],double *s_im[2],double *r_re[2],double *r_im[2],FILE *csv_fd) { + double *s_re[NB_ANTENNAS_TX],double *s_im[[NB_ANTENNAS_TX],double *r_re[NB_ANTENNAS_RX],double *r_im[NB_ANTENNAS_RX],FILE *csv_fd) { int i,u; int aa,aarx,aatx; double channelx,channely; diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index 8f275bbd91..a1894d03d7 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -340,10 +340,10 @@ int main(int argc, char **argv) { double s_re1[30720],s_im1[30720],r_re1[30720],r_im1[30720]; double r_re2[30720],r_im2[30720]; double r_re3[30720],r_im3[30720]; - double *s_re[2]= {s_re0,s_re1}; - double *s_im[2]= {s_im0,s_im1}; - double *r_re[4]= {r_re0,r_re1,r_re2,r_re3}; - double *r_im[4]= {r_im0,r_im1,r_im2,r_im3}; + double *s_re[NB_ANTENNAS_TX]= {s_re0,s_re1, NULL, NULL}; + double *s_im[NB_ANTENNAS_TX]= {s_im0,s_im1, NULL, NULL}; + double *r_re[NB_ANTENNAS_RX]= {r_re0,r_re1,r_re2,r_re3}; + double *r_im[NB_ANTENNAS_RX]= {r_im0,r_im1,r_im2,r_im3}; double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel double iqim=0.0; int cqi_error,cqi_errors,ack_errors,cqi_crc_falsepositives,cqi_crc_falsenegatives; diff --git a/openair3/NAS/COMMON/API/NETWORK/nas_message.c b/openair3/NAS/COMMON/API/NETWORK/nas_message.c index 769eab5260..d1a9e97025 100644 --- a/openair3/NAS/COMMON/API/NETWORK/nas_message.c +++ b/openair3/NAS/COMMON/API/NETWORK/nas_message.c @@ -1096,7 +1096,8 @@ static int _nas_message_decrypt( "Unknown security header type %u", security_header_type); LOG_FUNC_RETURN (0); }; - + LOG_FUNC_RETURN (0); + } /**************************************************************************** From 22d2e9a38f38f6d96231e2a356b68ad34ecf5885 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 23 Feb 2022 18:02:55 +0100 Subject: [PATCH 577/883] fix warnings and race cond in polar codec --- .../CODING/nrPolar_tools/nr_polar_decoder.c | 6 ++--- .../PHY/CODING/nrPolar_tools/nr_polar_defs.h | 3 ++- .../CODING/nrPolar_tools/nr_polar_encoder.c | 6 ++--- openair1/PHY/CODING/nr_polar_init.c | 2 +- openair1/SIMULATION/LTE_PHY/dlsim.c | 2 +- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 7 ------ openair2/RRC/NR/nr_rrc_proto.h | 21 ++++++++++++++++++ openair2/RRC/NR/rrc_gNB.c | 1 + openair2/RRC/NR/rrc_gNB_nsa.c | 22 +------------------ openair2/RRC/NR_UE/rrc_UE.c | 22 +------------------ 10 files changed, 34 insertions(+), 58 deletions(-) diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c index 03ffa30025..62ce034f59 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c @@ -64,7 +64,7 @@ int8_t polar_decoder(double *input, uint8_t aggregation_level ) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); //Assumes no a priori knowledge. uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; memset(bit,0,sizeof bit); @@ -312,7 +312,7 @@ int8_t polar_decoder_dci(double *input, int8_t messageType, uint16_t messageLength, uint8_t aggregation_level ) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); uint8_t bit[polarParams->N][polarParams->n+1][2*listSize]; memset(bit,0,sizeof bit); @@ -610,7 +610,7 @@ uint32_t polar_decoder_int16(int16_t *input, uint16_t messageLength, uint8_t aggregation_level ) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true); int16_t d_tilde[polarParams->N];// = malloc(sizeof(double) * polarParams->N); nr_polar_rate_matching_int16(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength); diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h index edb5ebbcc2..79af311e45 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h @@ -346,9 +346,10 @@ static inline void nr_polar_deinterleaver(uint8_t *input, } void delete_decoder_tree(t_nrPolar_params *); +extern pthread_mutex_t PolarListMutex; #define polarReturn \ pthread_mutex_lock(&PolarListMutex); \ -currentPtr->busy=false; \ +polarParams->busy=false; \ pthread_mutex_unlock(&PolarListMutex); \ return diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c index f654d33dfd..4cba3fe078 100644 --- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c +++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c @@ -46,7 +46,7 @@ void polar_encoder(uint32_t *in, int8_t messageType, uint16_t messageLength, uint8_t aggregation_level) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); if (1) {//polarParams->idx == 0 || polarParams->idx == 1) { //PBCH or PDCCH /* uint64_t B = (((uint64_t)*in)&((((uint64_t)1)<<32)-1)) | (((uint64_t)crc24c((uint8_t*)in,polarParams->payloadBits)>>8)<payloadBits); @@ -164,7 +164,7 @@ void polar_encoder_dci(uint32_t *in, int8_t messageType, uint16_t messageLength, uint8_t aggregation_level) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); #ifdef DEBUG_POLAR_ENCODER_DCI printf("[polar_encoder_dci] in: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", in[0], in[1], in[2], in[3]); @@ -433,7 +433,7 @@ void polar_encoder_fast(uint64_t *A, uint16_t messageLength, uint8_t aggregation_level) { - const t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); + t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false); // AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K); AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K); AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits); diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index 32e2d7f364..38a1ae86ae 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -35,7 +35,7 @@ #define PolarKey ((messageType<<24)|(messageLength<<8)|aggregation_level) static t_nrPolar_params * PolarList=NULL; -static pthread_mutex_t PolarListMutex=PTHREAD_MUTEX_INITIALIZER; +pthread_mutex_t PolarListMutex=PTHREAD_MUTEX_INITIALIZER; static int intcmp(const void *p1,const void *p2) { return(*(int16_t *)p1 > *(int16_t *)p2); diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index 25f2f37321..495b6803a6 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -147,7 +147,7 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_ } void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4], - double *s_re[NB_ANTENNAS_TX],double *s_im[[NB_ANTENNAS_TX],double *r_re[NB_ANTENNAS_RX],double *r_im[NB_ANTENNAS_RX],FILE *csv_fd) { + double *s_re[NB_ANTENNAS_TX],double *s_im[NB_ANTENNAS_TX],double *r_re[NB_ANTENNAS_RX],double *r_im[NB_ANTENNAS_RX],FILE *csv_fd) { int i,u; int aa,aarx,aatx; double channelx,channely; diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index a08c9d2c78..1f66400af1 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -101,13 +101,6 @@ typedef struct { static rlc_data_req_queue q; -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - static void *rlc_data_req_thread(void *_) { int i; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 30211b6a0b..5008af6fa8 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -208,3 +208,24 @@ void rrc_gNB_generate_dedicatedRRCReconfiguration( const protocol_ctxt_t *const ctxt_pP, rrc_gNB_ue_context_t *ue_context_pP); + +rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, + const NR_SRB_ToAddModList_t * const srb2add_listP, + const NR_DRB_ToAddModList_t * const drb2add_listP, + const NR_DRB_ToReleaseList_t * const drb2release_listP, + const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); + +boolean_t nr_rrc_pdcp_config_asn1_req( + const protocol_ctxt_t *const ctxt_pP, + NR_SRB_ToAddModList_t *const srb2add_list, + NR_DRB_ToAddModList_t *const drb2add_list, + NR_DRB_ToReleaseList_t *const drb2release_list, + const uint8_t security_modeP, + uint8_t *const kRRCenc, + uint8_t *const kRRCint, + uint8_t *const kUPenc, + uint8_t *const kUPint + ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 + ,rb_id_t *const defaultDRB, + struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index f49a0e24bc..2f588157ce 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -98,6 +98,7 @@ #include #include #include +#include #include "BIT_STRING.h" #include "assertions.h" diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 939b35f3f2..e55c9d4ed2 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -42,27 +42,7 @@ #include #include #include "UTIL/OSA/osa_defs.h" - -extern boolean_t nr_rrc_pdcp_config_asn1_req( - const protocol_ctxt_t *const ctxt_pP, - NR_SRB_ToAddModList_t *const srb2add_list, - NR_DRB_ToAddModList_t *const drb2add_list, - NR_DRB_ToReleaseList_t *const drb2release_list, - const uint8_t security_modeP, - uint8_t *const kRRCenc, - uint8_t *const kRRCint, - uint8_t *const kUPenc, - uint8_t *const kUPint - ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 - ,rb_id_t *const defaultDRB, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); +#include void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info) { struct rrc_gNB_ue_context_s *ue_context_p = NULL; diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 2fa0583074..47f4466f85 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -72,6 +72,7 @@ #include #include "nr_nas_msg_sim.h" +#include NR_UE_RRC_INST_t *NR_UE_rrc_inst; /* NAS Attach request with IMSI */ @@ -178,27 +179,6 @@ static int nr_rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_NR_t subS return (0); } -extern boolean_t nr_rrc_pdcp_config_asn1_req( - const protocol_ctxt_t *const ctxt_pP, - NR_SRB_ToAddModList_t *const srb2add_list, - NR_DRB_ToAddModList_t *const drb2add_list, - NR_DRB_ToReleaseList_t *const drb2release_list, - const uint8_t security_modeP, - uint8_t *const kRRCenc, - uint8_t *const kRRCint, - uint8_t *const kUPenc, - uint8_t *const kUPint - ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 - ,rb_id_t *const defaultDRB, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - // from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded) int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const module_id_t module_id, const uint8_t *buffer, From a4216b44ef4eee2398270b726d36de894f3a297e Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 24 Jan 2022 14:19:31 +0100 Subject: [PATCH 578/883] ue sync, assert in wrong PUCCH decoded values --- openair1/SCHED/phy_procedures_lte_eNb.c | 130 ++++++++++++++---------- targets/RT/USER/lte-ue.c | 12 ++- 2 files changed, 88 insertions(+), 54 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index ee1e0be49a..1c13ef4f11 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1938,6 +1938,8 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har pthread_mutex_unlock(&eNB->UL_INFO_mutex); } +#define packetError(ConD, fmt, args...) if (!(ConD)) { LOG_E(PHY, fmt, args); discard=true; } + void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) { if ( split73 == SPLIT73_DU ) { sendFs6Ulharq(fs6ULindicationHarq, UEid, eNB, uci, frame, subframe, harq_ack, tdd_mapping_mode, tdd_multiplexing_mask, 0, 0); @@ -1953,6 +1955,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in } pthread_mutex_lock(&eNB->UL_INFO_mutex); + bool discard=false; nfapi_harq_indication_t *ind = &eNB->UL_INFO.harq_ind; nfapi_harq_indication_body_t *body = &ind->harq_indication_body; assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU); @@ -1985,73 +1988,87 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG; pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1; - AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]); - pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; - // release DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]); + if (!discard) { + pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; + // release DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->pucch_fmt == pucch_format1b) { pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG; pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2; - AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]); - AssertFatal (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]); - pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; - pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1]; - // release DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); - } else AssertFatal(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt); + packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]); + packetError (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]); + if (!discard) { + pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; + pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1]; + // release DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } + } else + packetError(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt); } else { // TDD - AssertFatal (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode); - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; - LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, - tdd_mapping_mode,harq_ack[0],harq_ack[1]); + packetError (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode); + if (!discard) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; + LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, + tdd_mapping_mode,harq_ack[0],harq_ack[1]); - switch (tdd_mapping_mode) { + switch (tdd_mapping_mode) { case 0: // bundling if (uci->pucch_fmt == pucch_format1a) { pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; LOG_D(PHY,"bundling, pucch1a, number of ack nack %d\n",pdu->harq_indication_tdd_rel13.number_of_ack_nack); - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; - // release all bundled DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; + // release all bundled DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->pucch_fmt == pucch_format1b) { pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); - AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; - pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + if (!discard) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } } break; case 1: // multiplexing - AssertFatal (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt); - - if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) { - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); - pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + packetError (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt); + if (!discard) { + if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) { + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + } } else if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1b) { - pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; - pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; - AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); - AssertFatal(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); - pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; - pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; - // release all DLSCH if needed - release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); - release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; + pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; + packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); + packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); + if (!discard) { + pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; + pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; + // release all DLSCH if needed + release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); + release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1); + } } else { // num_pucch_resources (M) > 1 pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.number_of_ack_nack = uci->num_pucch_resources; @@ -2067,7 +2084,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in release_harq(eNB,DLSCH_id,1,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */); } - break; + break; case 2: // special bundling (SR collision) pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; @@ -2117,16 +2134,23 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in } else { pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0; } - + break; } break; + } + } } } //TDD - - eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++; - LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs); + + if (!discard) { + eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++; + LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs); + } else { + LOG_W(PHY,"discarded a PUCCH because the decoded values are impossible\n"); + } + pthread_mutex_unlock(&eNB->UL_INFO_mutex); } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 1643ca36ca..a48bef64b6 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -2023,8 +2023,18 @@ void *UE_thread(void *arg) if (is_synchronized == 0) { if (instance_cnt_synch < 0) { // we can invoke the synch - // grab 10 ms of signal and wakeup synch thread + // we shift in time flow because the UE doesn't detect sync when frame alignment is not easy + for (int i=0; iframe_parms.nb_antennas_rx; i++) + rxp[i] = (void *)&dummy_rx[i][0]; + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + rxp, + UE->frame_parms.samples_per_tti/2, + UE->frame_parms.nb_antennas_rx); + + // grab 10 ms of signal and wakeup synch thread + if (UE->mode != loop_through_memory) { if (IS_SOFTMODEM_RFSIM ) { for(int sf=0; sf<10; sf++) { From db1cc4cf5f0a5e635f5f6b00f387603c1b3e7400 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 23 Feb 2022 20:37:30 +0100 Subject: [PATCH 579/883] better variable name --- openair1/SCHED/phy_procedures_lte_eNb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 1c13ef4f11..1a35f6ee68 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -1938,7 +1938,7 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har pthread_mutex_unlock(&eNB->UL_INFO_mutex); } -#define packetError(ConD, fmt, args...) if (!(ConD)) { LOG_E(PHY, fmt, args); discard=true; } +#define packetError(ConD, fmt, args...) if (!(ConD)) { LOG_E(PHY, fmt, args); goodPacket=false; } void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) { if ( split73 == SPLIT73_DU ) { @@ -1955,7 +1955,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in } pthread_mutex_lock(&eNB->UL_INFO_mutex); - bool discard=false; + bool goodPacket=true; nfapi_harq_indication_t *ind = &eNB->UL_INFO.harq_ind; nfapi_harq_indication_body_t *body = &ind->harq_indication_body; assert(eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs <= NFAPI_HARQ_IND_MAX_PDU); @@ -1989,7 +1989,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1; packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]); - if (!discard) { + if (goodPacket) { pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; // release DLSCH if needed release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); @@ -2000,7 +2000,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2; packetError (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n", harq_ack[0]); packetError (harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n", harq_ack[1]); - if (!discard) { + if (goodPacket) { pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0]; pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1]; // release DLSCH if needed @@ -2011,7 +2011,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in packetError(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt); } else { // TDD packetError (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode); - if (!discard) { + if (goodPacket) { pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode; LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, @@ -2024,7 +2024,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; LOG_D(PHY,"bundling, pucch1a, number of ack nack %d\n",pdu->harq_indication_tdd_rel13.number_of_ack_nack); packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); - if (!discard) { + if (goodPacket) { pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; // release all bundled DLSCH if needed release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); @@ -2033,7 +2033,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); - if (!discard) { + if (goodPacket) { pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0]; pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1]; @@ -2047,12 +2047,12 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in case 1: // multiplexing packetError (uci->pucch_fmt == pucch_format1b, "uci->pucch_format %d is not format1b\n", uci->pucch_fmt); - if (!discard) { + if (goodPacket) { if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1a) { pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG; pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1; packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]); - if (!discard) { + if (goodPacket) { pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; // release all DLSCH if needed release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1); @@ -2062,7 +2062,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2; packetError(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]); packetError(harq_ack[1] == 1 || harq_ack[1] == 2 || harq_ack[1] == 4, "harq_ack[1] is %d, should be 0,1 or 4\n",harq_ack[1]); - if (!discard) { + if (goodPacket) { pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0]; pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1]; // release all DLSCH if needed @@ -2144,7 +2144,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in } } //TDD - if (!discard) { + if (goodPacket) { eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs++; LOG_D(PHY,"Incremented eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs:%d\n", eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs); } else { From 048b539050b2f1aee6ff10e3f9ad4673e3a401f8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 21:21:54 +0100 Subject: [PATCH 580/883] Correctly initialize PDCP in F1 mode --- executables/nr-softmodem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 7410e303b1..6452036912 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -593,6 +593,7 @@ void init_pdcp(void) { if (!get_softmodem_params()->nsa) { if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) { + pdcp_layer_init(); nr_pdcp_module_init(pdcp_initmask, 0); } } else { From 61e608adb5594a5804a235fbef78cd850b9b49ff Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 21:54:01 +0100 Subject: [PATCH 581/883] Support reconfiguration of number of HARQ processes In F1, the time until the serving cell config comes from CU can be longer than when we want to schedule a particular UE. Then, if we don't configure the default number of HARQ processes, we can have a segfault. In this commit, we initially configure 8 HARQ processes. When we get the right number from RRC, we reconfigure. --- openair2/LAYER2/NR_MAC_gNB/config.c | 8 +-- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 64 +++++++++++++++---- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + 3 files changed, 55 insertions(+), 18 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 19c82c71df..e703d5aa65 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -628,16 +628,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; - if (sched_ctrl->available_dl_harq.len == 0) { + if (get_softmodem_params()->sa) { // add all available DL HARQ processes for this UE in SA create_dl_harq_list(sched_ctrl, pdsch); } - else { - const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ? - get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8; - AssertFatal(sched_ctrl->available_dl_harq.len==nrofHARQ, - "Reconfiguration of available harq processes not yet supported\n"); - } // update coreset/searchspace void *bwpd = NULL; NR_BWP_t *genericParameters = NULL; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 721f67295b..b9f5147457 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1942,14 +1942,46 @@ void dump_nr_list(NR_list_t *listP) void create_nr_list(NR_list_t *list, int len) { list->head = -1; - list->next = calloc(len, sizeof(*list->next)); - AssertFatal(list, "cannot calloc() memory for NR_list_t->next\n"); + list->next = malloc(len * sizeof(*list->next)); + LOG_W(NR_MAC, "NR list->next %p\n", list->next); + AssertFatal(list->next, "cannot calloc() memory for NR_list_t->next\n"); for (int i = 0; i < len; ++i) list->next[i] = -1; list->tail = -1; list->len = len; } +/* + * Resize an NR_list + */ +void resize_nr_list(NR_list_t *list, int new_len) +{ + if (new_len == list->len) + return; + if (new_len > list->len) { + /* list->head remains */ + const int old_len = list->len; + int* n = realloc(list->next, new_len * sizeof(*list->next)); + AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n"); + list->next = n; + for (int i = old_len; i < new_len; ++i) + list->next[i] = -1; + /* list->tail remains */ + list->len = new_len; + } else { /* new_len < len */ + AssertFatal(list->head < new_len, "shortened list head out of index %d (new len %d)\n", list->head, new_len); + AssertFatal(list->tail < new_len, "shortened list tail out of index %d (new len %d)\n", list->head, new_len); + for (int i = 0; i < list->len; ++i) + AssertFatal(list->next[i] < new_len, "shortened list entry out of index %d (new len %d)\n", list->next[i], new_len); + /* list->head remains */ + int *n = realloc(list->next, new_len * sizeof(*list->next)); + AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n"); + list->next = n; + /* list->tail remains */ + list->len = new_len; + } +} + /* * Destroy an NR_list */ @@ -2205,10 +2237,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG "no pdsch-ServingCellConfig found for UE %d\n", UE_id); const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; - // add DL HARQ processes for this UE only in NSA - // (SA still doesn't have information on nrofHARQ_ProcessesForPDSCH at this stage) - if (!get_softmodem_params()->sa) - create_dl_harq_list(sched_ctrl,pdsch); + // pdsch == NULL in SA -> will create default (8) number of HARQ processes + create_dl_harq_list(sched_ctrl, pdsch); // add all available UL HARQ processes for this UE // nb of ul harq processes not configurable create_nr_list(&sched_ctrl->available_ul_harq, 16); @@ -2236,11 +2266,23 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ? get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8; // add all available DL HARQ processes for this UE - create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); - for (int harq = 0; harq < nrofHARQ; harq++) - add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); - create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); - create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); + AssertFatal(sched_ctrl->available_dl_harq.len == sched_ctrl->feedback_dl_harq.len + && sched_ctrl->available_dl_harq.len == sched_ctrl->retrans_dl_harq.len, + "HARQ lists have different lengths (%d/%d/%d)\n", + sched_ctrl->available_dl_harq.len, + sched_ctrl->feedback_dl_harq.len, + sched_ctrl->retrans_dl_harq.len); + if (sched_ctrl->available_dl_harq.len == 0) { + create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); + for (int harq = 0; harq < nrofHARQ; harq++) + add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); + create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); + create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); + } else { + resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); + resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); + resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); + } } /* hack data to remove UE in the phy */ diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 55136b0015..28e9d689fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -351,6 +351,7 @@ int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB); /* Functions to manage an NR_list_t */ void dump_nr_list(NR_list_t *listP); void create_nr_list(NR_list_t *listP, int len); +void resize_nr_list(NR_list_t *list, int new_len); void destroy_nr_list(NR_list_t *list); void add_nr_list(NR_list_t *listP, int id); void remove_nr_list(NR_list_t *listP, int id); From bfebc0cb1828326a820305b3d8f5c5ed0928765e Mon Sep 17 00:00:00 2001 From: "Deokseong \"David\" Kim" Date: Wed, 23 Feb 2022 22:59:45 +0000 Subject: [PATCH 582/883] Using message_id to identify channel info. --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 27 ++++++++++++++++++--- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 5 +++- openair2/PHY_INTERFACE/phy_stub_UE.c | 24 +++++++++++++++--- openair2/PHY_INTERFACE/phy_stub_UE.h | 5 +++- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 71345c6d9f..396aa54a47 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1045,6 +1045,17 @@ static void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request) } } +static uint16_t get_message_id(const uint8_t *buffer, ssize_t len) +{ + if (len < 4) + return 0; + + // Unpack 2 bytes message_id from buffer. + uint16_t v; + memcpy(&v, buffer + 2, sizeof(v)); + return ntohs(v); +} + void *nrue_standalone_pnf_task(void *context) { struct sockaddr_in server_address; @@ -1088,14 +1099,22 @@ void *nrue_standalone_pnf_task(void *context) abort(); } } - else if (len == sizeof(nr_phy_channel_params_t)) + else if (get_message_id((const uint8_t *)buffer, len) == 0x0FFF) // 0x0FFF : channel info identifier. { nr_phy_channel_params_t *ch_info = CALLOC(1, sizeof(*ch_info)); memcpy(ch_info, buffer, sizeof(*ch_info)); - slot_rnti_mcs[NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)].sinr = ch_info->sinr; - LOG_D(NR_PHY, "Received_SINR = %f, sfn:slot %d:%d\n", - ch_info->sinr, NFAPI_SFNSLOT2SFN(ch_info->sfn_slot), NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)); + if (ch_info->nb_of_sinrs > 1) + LOG_W(NR_PHY, "Expecting at most one SINR.\n"); + + // TODO: Update sinr field of slot_rnti_mcs to be array. + for (int i = 0; i < ch_info->nb_of_sinrs; ++i) + { + slot_rnti_mcs[NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)].sinr = ch_info->sinr[i]; + + LOG_D(NR_PHY, "Received_SINR[%d] = %f, sfn:slot %d:%d\n", + i, ch_info->sinr[i], NFAPI_SFNSLOT2SFN(ch_info->sfn_slot), NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)); + } if (!put_queue(&nr_chan_param_queue, ch_info)) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 499346f394..034c1c6b48 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -45,13 +45,16 @@ #define NUM_SINR 100 #define NUM_BLER_COL 13 #define NUM_NFAPI_SLOT 20 +#define NR_NUM_LAYER 1 typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t; typedef struct nr_phy_channel_params_t { uint16_t sfn_slot; - float sinr; + uint16_t message_id; + uint16_t nb_of_sinrs; + float sinr[NR_NUM_LAYER]; // Incomplete, need all channel parameters } nr_phy_channel_params_t; diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 1598e3d620..c4650f18f3 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -1259,6 +1259,17 @@ void ue_init_standalone_socket(int tx_port, int rx_port) } } +static uint16_t get_message_id(const uint8_t *buffer, ssize_t len) +{ + if (len < 4) + return 0; + + // Unpack 2 bytes message_id from buffer. + uint16_t v; + memcpy(&v, buffer + 2, sizeof(v)); + return ntohs(v); +} + void *ue_standalone_pnf_task(void *context) { struct sockaddr_in server_address; @@ -1301,7 +1312,7 @@ void *ue_standalone_pnf_task(void *context) abort(); } } - else if (len == sizeof(phy_channel_params_t)) + else if (get_message_id((const uint8_t *)buffer, len) == 0x0FFF) // 0x0FFF : channel info identifier. { phy_channel_params_t ch_info; memcpy(&ch_info, buffer, sizeof(phy_channel_params_t)); @@ -1314,8 +1325,15 @@ void *ue_standalone_pnf_task(void *context) uint16_t sf = ch_info.sfn_sf & 15; assert(sf < 10); - sf_rnti_mcs[sf].sinr = ch_info.sinr; - LOG_D(MAC, "Received_SINR = %f\n",ch_info.sinr); + if (ch_info.nb_of_sinrs > 1) + LOG_W(MAC, "Expecting at most one SINR.\n"); + + // TODO: Update sinr field of slot_rnti_mcs to be array. + for (int i = 0; i < ch_info.nb_of_sinrs; ++i) + { + sf_rnti_mcs[sf].sinr = ch_info.sinr[i]; + LOG_D(MAC, "Received_SINR[%d] = %f\n", i, ch_info.sinr[i]); + } } else { diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.h b/openair2/PHY_INTERFACE/phy_stub_UE.h index ebaae6e667..d68d1dffdd 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.h +++ b/openair2/PHY_INTERFACE/phy_stub_UE.h @@ -24,6 +24,7 @@ #define NUM_MCS 28 #define NUM_SINR 100 #define NUM_BLER_COL 13 +#define LTE_NUM_LAYER 1 // this mutex is used to set multiple UE's UL value in L2 FAPI simulator. extern FILL_UL_INFO_MUTEX_t fill_ul_mutex; @@ -126,7 +127,9 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, typedef struct phy_channel_params_t { uint16_t sfn_sf; - float sinr; + uint16_t message_id; + uint16_t nb_of_sinrs; + float sinr[LTE_NUM_LAYER]; // Incomplete, need all channel parameters } phy_channel_params_t; From f19ea82f8e4cb36ff97e20d1638e6f384ad52f35 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Feb 2022 12:54:04 +0100 Subject: [PATCH 583/883] Drop an sgNB release request if no SCTP endpoint available --- openair2/X2AP/x2ap_eNB.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openair2/X2AP/x2ap_eNB.c b/openair2/X2AP/x2ap_eNB.c index 38e6149ccd..2b1d19001a 100644 --- a/openair2/X2AP/x2ap_eNB.c +++ b/openair2/X2AP/x2ap_eNB.c @@ -621,7 +621,12 @@ void x2ap_eNB_handle_sgNB_release_request(instance_t instance, } target = x2ap_get_eNB(NULL, x2ap_release_req->assoc_id, 0); - DevAssert(target != NULL); + if (target == NULL) { + X2AP_ERROR("no X2AP target eNB on assoc_id %d, dropping sgNB release request\n", x2ap_release_req->assoc_id); + /* x2ap_gNB_handle_ENDC_sGNB_release_request_acknowledge() would handle the + * ack, but does not do anything */ + return; + } /* id_source is not used by oai's gNB so it's not big deal. For * interoperability with other gNBs things may need to be refined. From 1858418fb892a2de96b8c6cb8045b0e383763078 Mon Sep 17 00:00:00 2001 From: Panos Matzakos Date: Thu, 24 Feb 2022 14:57:11 +0000 Subject: [PATCH 584/883] Update TESTING_5GSA_setup.md for CU/DU instructions --- doc/TESTING_5GSA_setup.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md index 048d8c86ff..f8c85bf2ca 100644 --- a/doc/TESTING_5GSA_setup.md +++ b/doc/TESTING_5GSA_setup.md @@ -169,8 +169,7 @@ MACRLCs = ( At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface, as well as some IP traffic tests over *F1-U* have been validated using the OAI gNB/nrUE in RFSIMULATOR mode. - -*These extensions are not yet fully integrated into develop branch, as they are under merge request. Until they get fully integrated, the CU/DU functionalities can be tested in [NR_F1C_F1U_extensions](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/NR_F1C_F1U_extensions) branch.* + ## 1.2 OAI 5G Core Network installation and configuration The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using `docker-compose` can be found [here](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md). @@ -264,12 +263,12 @@ the gNB can be launched in 2 modes: 1. Launch the CU component: ```bash sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \ - -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf + -O ../../../ci-scripts/conf_files/gNB_SA_CU.conf ``` 2. Launch the DU component: ```bash sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \ - -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf + -O ../../../ci-scripts/conf_files/gNB_SA_DU.conf ``` - To launch the OAI UE (valid in `monolithic` gNB and `CU/DU split` gNB): From ba92e37407d38d2b8c2ae9ed54873b90cecb774c Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 24 Feb 2022 16:25:12 +0100 Subject: [PATCH 585/883] re-initialization of gold sequences at gnb if needed according to fapi messages --- openair1/PHY/INIT/nr_init.c | 14 +++++--- openair1/PHY/NR_REFSIG/nr_gold.c | 23 +++++------- openair1/PHY/NR_REFSIG/nr_refsig.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_csi_rs.c | 19 +++------- openair1/PHY/NR_TRANSPORT/nr_dci.c | 35 ++++++++++++------- openair1/PHY/NR_TRANSPORT/nr_dci.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 11 ++++-- .../PHY/NR_TRANSPORT/nr_transport_proto.h | 1 - openair1/PHY/defs_gNB.h | 4 +++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 5 ++- 10 files changed, 61 insertions(+), 55 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 3bf450703c..95e7c011fb 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -130,6 +130,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, } nr_generate_modulation_table(); + gNB->pdcch_gold_init = cfg->cell_config.phy_cell_id.value; nr_init_pdcch_dmrs(gNB, cfg->cell_config.phy_cell_id.value); nr_init_pbch_interleaver(gNB->nr_pbch_interleaver); @@ -142,17 +143,21 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot); for (int symb=0; symbsymbols_per_slot; symb++) { - pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *)); + pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(2*sizeof(uint32_t *)); AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); - for (int q=0; qcell_config.phy_cell_id.value); + + for (int nscid = 0; nscid < 2; nscid++) { + gNB->pdsch_gold_init[nscid] = cfg->cell_config.phy_cell_id.value; + nr_init_pdsch_dmrs(gNB, nscid, cfg->cell_config.phy_cell_id.value); + } //PUSCH DMRS init gNB->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(2*sizeof(uint32_t ***)); @@ -193,6 +198,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, } } + gNB->csi_gold_init = cfg->cell_config.phy_cell_id.value; nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value); for (int id=0; idframe_parms; uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; - uint16_t N_n_scid[NR_MAX_NB_CODEWORDS]={Nid, Nid}; // Not correct, appropriate scrambling IDs have to be updated to support DCI 1_1 - uint8_t n_scid=0; // again works only for 1_0 for (uint8_t slot=0; slotslots_per_frame; slot++) { for (uint8_t symb=0; symbsymbols_per_slot; symb++) { - reset = 1; - x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid)); - LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, N_n_scid %d,n_scid %d\n",slot,symb,x2,N_n_scid[n_scid],n_scid); - for (uint32_t n=0; nsymbols_per_slot*slot+symb+1) * ((Nid<<1)+1) +((Nid<<1)+nscid)); + LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, Nid %d,nscid %d\n",slot,symb,x2,Nid,nscid); + for (uint32_t n=0; nframe_parms; @@ -50,20 +49,10 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB, AssertFatal(b!=0, "Invalid CSI frequency domain mapping: no bit selected in bitmap\n"); - // pre-computed for scrambling id equel to cell id - // if the scrambling id is not the cell id we need to re-initialize the rs - if (csi_params.scramb_id != cell_id) { - uint8_t reset; - uint32_t x1, x2; - uint32_t Nid = csi_params.scramb_id; - for (uint8_t symb=0; symbcsi_gold_init) { + gNB->csi_gold_init = csi_params.scramb_id; + nr_init_csi_rs(gNB, csi_params.scramb_id); } switch (csi_params.row) { diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index d233eb9ba6..dc0db4898a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -66,11 +66,12 @@ void nr_pdcch_scrambling(uint32_t *in, } } -void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, - uint32_t **gold_pdcch_dmrs, +void nr_generate_dci(PHY_VARS_gNB *gNB, + nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, int32_t *txdataF, int16_t amp, - NR_DL_FRAME_PARMS *frame_parms) { + NR_DL_FRAME_PARMS *frame_parms, + int slot) { int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1] __attribute__((aligned(16))); // 3 for the max coreset duration uint16_t cset_start_sc; @@ -81,7 +82,7 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, int rb_offset; int n_rb; - + // compute rb_offset and n_prb based on frequency allocation nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; nr_fill_cce_list(cce_list,0,pdcch_pdu_rel15); @@ -95,6 +96,13 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, * in time: by its first slot and its first symbol*/ const nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[d]; + if(dci_pdu->ScramblingId != gNB->pdcch_gold_init) { + gNB->pdcch_gold_init = dci_pdu->ScramblingId; + nr_init_pdcch_dmrs(gNB, dci_pdu->ScramblingId); + } + + uint32_t **gold_pdcch_dmrs = gNB->nr_gold_pdcch_dmrs[slot]; + cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_nsymb = pdcch_pdu_rel15->DurationSymbols; dci_idx = 0; @@ -104,8 +112,8 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE) uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE) LOG_D(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d),Scrambling_Id %d,ScramblingRNTI %x,PayloadSizeBits %d\n", - rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType, - dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits); + rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType, + dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits); dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset /// DMRS QPSK modulation @@ -115,10 +123,10 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, #ifdef DEBUG_PDCCH_DMRS if(dci_pdu->RNTI!=0xFFFF) { - for (int i=0; i>1; i++) - printf("symb %d i %d %p gold seq 0x%08x mod_dmrs %d %d\n", symb, i, - &gold_pdcch_dmrs[symb][i>>5],gold_pdcch_dmrs[symb][i>>5], mod_dmrs[symb][i<<1], mod_dmrs[symb][(i<<1)+1] ); - } + for (int i=0; i>1; i++) + printf("symb %d i %d %p gold seq 0x%08x mod_dmrs %d %d\n", symb, i, + &gold_pdcch_dmrs[symb][i>>5],gold_pdcch_dmrs[symb][i>>5], mod_dmrs[symb][i<<1], mod_dmrs[symb][(i<<1)+1] ); + } #endif } @@ -251,15 +259,16 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, } void nr_generate_dci_top(processingData_L1tx_t *msgTx, - uint32_t **gold_pdcch_dmrs, + int slot, int32_t *txdataF, int16_t amp, NR_DL_FRAME_PARMS *frame_parms) { + for (int i=0; inum_ul_pdcch; i++) - nr_generate_dci(&msgTx->ul_pdcch_pdu[i].pdcch_pdu.pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(msgTx->gNB,&msgTx->ul_pdcch_pdu[i].pdcch_pdu.pdcch_pdu_rel15,txdataF,amp,frame_parms,slot); for (int i=0; inum_dl_pdcch; i++) - nr_generate_dci(&msgTx->pdcch_pdu[i].pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms); + nr_generate_dci(msgTx->gNB,&msgTx->pdcch_pdu[i].pdcch_pdu_rel15,txdataF,amp,frame_parms,slot); } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h index bdc8509d12..490a8b5286 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h @@ -30,7 +30,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format, uint16_t N_RB); void nr_generate_dci_top(processingData_L1tx_t *msgTx, - uint32_t **gold_pdcch_dmrs, + int slot, int32_t *txdataF, int16_t amp, NR_DL_FRAME_PARMS *frame_parms); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index c6c89c80be..b5e4cbd651 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -58,7 +58,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, PHY_VARS_gNB *gNB = msgTx->gNB; NR_gNB_DLSCH_t *dlsch; - uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot]; int32_t** txdataF = gNB->common_vars.txdataF; int16_t amp = AMP; int xOverhead = 0; @@ -95,6 +94,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } n_dmrs = (rel15->BWPStart+rel15->rbStart+rel15->rbSize)*nb_re_dmrs; + if(rel15->dlDmrsScramblingId != gNB->pdsch_gold_init[rel15->SCID]) { + gNB->pdsch_gold_init[rel15->SCID] = rel15->dlDmrsScramblingId; + nr_init_pdsch_dmrs(gNB, rel15->SCID, rel15->dlDmrsScramblingId); + } + + uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot]; uint16_t dmrs_symbol_map = rel15->dlDmrsSymbPos;//single DMRS: 010000100 Double DMRS 110001100 uint8_t dmrs_len = get_num_dmrs(rel15->dlDmrsSymbPos); uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers; @@ -273,7 +278,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, l_prime = 0; } /// DMRS QPSK modulation - nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated + nr_modulation(pdsch_dmrs[l][rel15->SCID], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // Qm = 2 as DMRS is QPSK modulated #ifdef DEBUG_DLSCH printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l, n_dmrs, dmrs_Type); @@ -294,7 +299,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, if(ptrs_symbol) { /* PTRS QPSK Modulation for each OFDM symbol in a slot */ printf("Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs); - nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs); + nr_modulation(pdsch_dmrs[l][rel15->SCID], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs); } } uint16_t k = start_sc; diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h index d45858bca0..a3a88f6c27 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h +++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h @@ -334,7 +334,6 @@ uint8_t get_nr_prach_duration(uint8_t prach_format); void nr_generate_csi_rs(PHY_VARS_gNB *gNB, int16_t amp, nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params, - uint16_t cell_id, int slot); void free_nr_prach_entry(PHY_VARS_gNB *gNB, int prach_id); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7c7d30a6e2..f549e9591b 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -847,6 +847,10 @@ typedef struct PHY_VARS_gNB_s { /// counter to average prach energh over first 100 prach opportunities int prach_energy_counter; + int csi_gold_init; + int pdcch_gold_init; + int pdsch_gold_init[2]; + int pucch0_thres; int pusch_thres; int prach_thres; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 7e9f4d091a..f28d9af325 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -161,8 +161,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1); - nr_generate_dci_top(msgTx, - gNB->nr_gold_pdcch_dmrs[slot], + nr_generate_dci_top(msgTx, slot, &gNB->common_vars.txdataF[0][txdataF_offset], AMP, fp); @@ -181,7 +180,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, if (csirs->active == 1) { LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot); nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params = csirs->csirs_pdu.csi_rs_pdu_rel15; - nr_generate_csi_rs(gNB, AMP, csi_params, gNB->gNB_config.cell_config.phy_cell_id.value, slot); + nr_generate_csi_rs(gNB, AMP, csi_params, slot); csirs->active = 0; } } From 50d4d3e8aab0bcefb739601e615a124a66756ede Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 24 Feb 2022 17:05:59 +0100 Subject: [PATCH 586/883] addressing review comments --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 72 ++--- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 328 ++++++++++---------- 2 files changed, 199 insertions(+), 201 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 1f41b66ea8..53fb1fdc79 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -224,43 +224,43 @@ void configure_dlsch(NR_UE_DLSCH_t *dlsch0, LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid); NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid]; - if (dlsch0_harq){ - dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart; - dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize; - dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs; - dlsch0_harq->start_rb = dlsch_config_pdu->start_rb; - dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols; - dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol; - dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos; - dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType; - dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups; - dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports; - dlsch0_harq->mcs = dlsch_config_pdu->mcs; - dlsch0_harq->rvidx = dlsch_config_pdu->rv; - dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; - //get nrOfLayers from DCI info - uint8_t Nl = 0; - for (int i = 0; i < 12; i++) { // max 12 ports - if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1; - } - dlsch0_harq->Nl = Nl; - dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table; - downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type); - if (dlsch0_harq->status != ACTIVE) { - // dlsch0_harq->status not ACTIVE due to false retransmission - // Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status - dlsch0->active = 0; - update_harq_status(module_id,dlsch0->current_harq_pid,dlsch0_harq->ack); - } - /* PTRS */ - dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity; - dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity; - dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex; - dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS; - dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset; - dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap; - LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs); + AssertFatal(dlsch0_harq, "no harq_process for HARQ PID %d\n", current_harq_pid); + + dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart; + dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize; + dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs; + dlsch0_harq->start_rb = dlsch_config_pdu->start_rb; + dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols; + dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol; + dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos; + dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType; + dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups; + dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports; + dlsch0_harq->mcs = dlsch_config_pdu->mcs; + dlsch0_harq->rvidx = dlsch_config_pdu->rv; + dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; + //get nrOfLayers from DCI info + uint8_t Nl = 0; + for (int i = 0; i < 12; i++) { // max 12 ports + if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1; } + dlsch0_harq->Nl = Nl; + dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table; + downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type); + if (dlsch0_harq->status != ACTIVE) { + // dlsch0_harq->status not ACTIVE due to false retransmission + // Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status + dlsch0->active = 0; + update_harq_status(module_id,dlsch0->current_harq_pid,dlsch0_harq->ack); + } + /* PTRS */ + dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity; + dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity; + dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex; + dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS; + dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset; + dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap; + LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs); } int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index a51dde9e75..1efb5d91c0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2339,199 +2339,197 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) { - if (mac->ra.ra_state == RA_SUCCEEDED || - get_softmodem_params()->phy_test == 1) { + if (mac->ra.ra_state != RA_SUCCEEDED && get_softmodem_params()->phy_test == 0) + return; - NR_CellGroupConfig_t *CellGroup = mac->cg; + NR_CellGroupConfig_t *CellGroup = mac->cg; - if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || - !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) - return; + if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || + !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) + return; - NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; + NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; - if (csi_measconfig->csi_IM_ResourceToAddModList == NULL) - return; + if (csi_measconfig->csi_IM_ResourceToAddModList == NULL) + return; - fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; - NR_CSI_IM_Resource_t *imcsi; - int period, offset; - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; - int mu = mac->DLbwp[dl_bwp_id-1] ? - mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing : - mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing; + fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; + NR_CSI_IM_Resource_t *imcsi; + int period, offset; + NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; + int mu = mac->DLbwp[dl_bwp_id-1] ? + mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing : + mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing; - for (int id = 0; id < csi_measconfig->csi_IM_ResourceToAddModList->list.count; id++){ - imcsi = csi_measconfig->csi_IM_ResourceToAddModList->list.array[id]; - csi_period_offset(NULL,imcsi->periodicityAndOffset,&period,&offset); - if((frame*nr_slots_per_frame[mu]+slot-offset)%period == 0) { - fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csiim_config_pdu.csiim_config_rel15; - const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1]; - const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth: - mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth; - csiim_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE); - csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE); - csiim_config_pdu->subcarrier_spacing = mu; - csiim_config_pdu->start_rb = imcsi->freqBand->startingRB; - csiim_config_pdu->nr_of_rbs = imcsi->freqBand->nrofRBs; - // As specified in 5.2.2.4 of 38.214 - switch (imcsi->csi_IM_ResourceElementPattern->present) { - case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0: - for (int i = 0; i<4; i++) { - csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern0->subcarrierLocation_p0<<1) + (i>>1); - csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern0->symbolLocation_p0 + (i%2); - } - break; - case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1: - for (int i = 0; i<4; i++) { - csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1<<2) + i; - csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1; - } - break; - default: - AssertFatal(1==0, "Invalid CSI-IM pattern\n"); + for (int id = 0; id < csi_measconfig->csi_IM_ResourceToAddModList->list.count; id++){ + imcsi = csi_measconfig->csi_IM_ResourceToAddModList->list.array[id]; + csi_period_offset(NULL,imcsi->periodicityAndOffset,&period,&offset); + if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0) + continue; + fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csiim_config_pdu.csiim_config_rel15; + const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1]; + const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth: + mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth; + csiim_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE); + csiim_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE); + csiim_config_pdu->subcarrier_spacing = mu; + csiim_config_pdu->start_rb = imcsi->freqBand->startingRB; + csiim_config_pdu->nr_of_rbs = imcsi->freqBand->nrofRBs; + // As specified in 5.2.2.4 of 38.214 + switch (imcsi->csi_IM_ResourceElementPattern->present) { + case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0: + for (int i = 0; i<4; i++) { + csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern0->subcarrierLocation_p0<<1) + (i>>1); + csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern0->symbolLocation_p0 + (i%2); } - dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_IM; - dl_config->number_pdus = dl_config->number_pdus + 1; - } + break; + case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1: + for (int i = 0; i<4; i++) { + csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1<<2) + i; + csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1; + } + break; + default: + AssertFatal(1==0, "Invalid CSI-IM pattern\n"); } + dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_IM; + dl_config->number_pdus = dl_config->number_pdus + 1; } } void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { - if (mac->ra.ra_state == RA_SUCCEEDED || - get_softmodem_params()->phy_test == 1) { + if (mac->ra.ra_state != RA_SUCCEEDED && get_softmodem_params()->phy_test == 0) + return; - NR_CellGroupConfig_t *CellGroup = mac->cg; + NR_CellGroupConfig_t *CellGroup = mac->cg; - if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || - !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) - return; + if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || + !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) + return; - NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; + NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; - if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList == NULL) - return; + if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList == NULL) + return; - fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; - NR_NZP_CSI_RS_Resource_t *nzpcsi; - int period, offset; - NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; - int mu = mac->DLbwp[dl_bwp_id-1] ? - mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing : - mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing; + fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; + NR_NZP_CSI_RS_Resource_t *nzpcsi; + int period, offset; + NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; + int mu = mac->DLbwp[dl_bwp_id-1] ? + mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters.subcarrierSpacing : + mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.subcarrierSpacing; - for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ - nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; - csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset); - if((frame*nr_slots_per_frame[mu]+slot-offset)%period == 0) { - LOG_D(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot); - fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15; + for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ + nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; + csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset); + if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0) + continue; + LOG_D(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot); + fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15; - NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; + NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; - const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1]; - const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth: - mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth; - csirs_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE); - csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE); - csirs_config_pdu->subcarrier_spacing = mu; - csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB; - csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs; - csirs_config_pdu->csi_type = 1; // NZP-CSI-RS - csirs_config_pdu->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain; - if (resourceMapping.firstOFDMSymbolInTimeDomain2) - csirs_config_pdu->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2; - csirs_config_pdu->cdm_type = resourceMapping.cdm_Type; - csirs_config_pdu->freq_density = resourceMapping.density.present; - if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5) - && (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs)) - csirs_config_pdu->freq_density--; - csirs_config_pdu->scramb_id = nzpcsi->scramblingID; - switch(resourceMapping.frequencyDomainAllocation.present){ - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1: - csirs_config_pdu->row = 1; - csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; + const NR_BWP_Downlink_t *dlbwp = mac->DLbwp[dl_bwp_id-1]; + const int locationAndBandwidth = dlbwp != NULL ? dlbwp->bwp_Common->genericParameters.locationAndBandwidth: + mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters.locationAndBandwidth; + csirs_config_pdu->bwp_size = NRRIV2BW(locationAndBandwidth, MAX_BWP_SIZE); + csirs_config_pdu->bwp_start = NRRIV2PRBOFFSET(locationAndBandwidth, MAX_BWP_SIZE); + csirs_config_pdu->subcarrier_spacing = mu; + csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB; + csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs; + csirs_config_pdu->csi_type = 1; // NZP-CSI-RS + csirs_config_pdu->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain; + if (resourceMapping.firstOFDMSymbolInTimeDomain2) + csirs_config_pdu->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2; + csirs_config_pdu->cdm_type = resourceMapping.cdm_Type; + csirs_config_pdu->freq_density = resourceMapping.density.present; + if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5) + && (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs)) + csirs_config_pdu->freq_density--; + csirs_config_pdu->scramb_id = nzpcsi->scramblingID; + switch(resourceMapping.frequencyDomainAllocation.present){ + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1: + csirs_config_pdu->row = 1; + csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: + csirs_config_pdu->row = 2; + csirs_config_pdu->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | + ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0)); + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: + csirs_config_pdu->row = 4; + csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; + break; + case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: + csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; + // determining the row of table 7.4.1.5.3-1 in 38.211 + switch(resourceMapping.nrofPorts){ + case NR_CSI_RS_ResourceMapping__nrofPorts_p1: + AssertFatal(1==0,"Resource with 1 CSI port shouldn't be within other rows\n"); break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: - csirs_config_pdu->row = 2; - csirs_config_pdu->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) | - ((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0)); + case NR_CSI_RS_ResourceMapping__nrofPorts_p2: + csirs_config_pdu->row = 3; break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: - csirs_config_pdu->row = 4; - csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07; + case NR_CSI_RS_ResourceMapping__nrofPorts_p4: + csirs_config_pdu->row = 5; break; - case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: - csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; - // determining the row of table 7.4.1.5.3-1 in 38.211 - switch(resourceMapping.nrofPorts){ - case NR_CSI_RS_ResourceMapping__nrofPorts_p1: - AssertFatal(1==0,"Resource with 1 CSI port shouldn't be within other rows\n"); - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p2: - csirs_config_pdu->row = 3; - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p4: - csirs_config_pdu->row = 5; - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p8: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) - csirs_config_pdu->row = 8; - else{ - int num_k = 0; - for (int k=0; k<6; k++) - num_k+=(((csirs_config_pdu->freq_domain)>>k)&0x01); - if(num_k==4) - csirs_config_pdu->row = 6; - else - csirs_config_pdu->row = 7; - } - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p12: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) - csirs_config_pdu->row = 10; - else - csirs_config_pdu->row = 9; - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p16: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) - csirs_config_pdu->row = 12; - else - csirs_config_pdu->row = 11; - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p24: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) - csirs_config_pdu->row = 14; - else{ - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) - csirs_config_pdu->row = 15; - else - csirs_config_pdu->row = 13; - } - break; - case NR_CSI_RS_ResourceMapping__nrofPorts_p32: - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) - csirs_config_pdu->row = 17; - else{ - if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) - csirs_config_pdu->row = 18; - else - csirs_config_pdu->row = 16; - } - break; - default: - AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n"); + case NR_CSI_RS_ResourceMapping__nrofPorts_p8: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 8; + else{ + int num_k = 0; + for (int k=0; k<6; k++) + num_k+=(((csirs_config_pdu->freq_domain)>>k)&0x01); + if(num_k==4) + csirs_config_pdu->row = 6; + else + csirs_config_pdu->row = 7; } break; - default: - AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); + case NR_CSI_RS_ResourceMapping__nrofPorts_p12: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 10; + else + csirs_config_pdu->row = 9; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p16: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 12; + else + csirs_config_pdu->row = 11; + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p24: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 14; + else{ + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) + csirs_config_pdu->row = 15; + else + csirs_config_pdu->row = 13; + } + break; + case NR_CSI_RS_ResourceMapping__nrofPorts_p32: + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2) + csirs_config_pdu->row = 17; + else{ + if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4) + csirs_config_pdu->row = 18; + else + csirs_config_pdu->row = 16; + } + break; + default: + AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n"); } - dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_RS; - dl_config->number_pdus = dl_config->number_pdus + 1; - } + break; + default: + AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); } + dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_RS; + dl_config->number_pdus = dl_config->number_pdus + 1; } } From 5f7f56f056e928909d189562a4d6b01642d06142 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 24 Feb 2022 09:03:00 -0800 Subject: [PATCH 587/883] Added a comment to justify pdu_len checks in gNB --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 47550597bc..699e0e1d71 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -261,6 +261,10 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_L_TRUNCATED_BSR: //38.321 section 6.1.3.1 //variable length + /* Several checks have been added to this function to + ensure that the casting of the pduP is possible. There + is an actual bug here, but it has not been resolved. This + means that the scheduled transport block size is invalid. */ if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) return 0; mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; From 13401a5f8cdff36ab20227bb2731303433e5f240 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 24 Feb 2022 09:49:47 -0800 Subject: [PATCH 588/883] Comments from OAI: This commit include dynamically setting the slots_per_frame value based on configuration. It also includes some comments. Lastly, simplified bug fix in MAC layer related to sched_frame calculation. --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 17 +++++++++-------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 7 ++++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 855b86d24c..f8b6033277 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1335,9 +1335,11 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, current_harq->dl_frame = frame; current_harq->dl_slot = slot; if (get_softmodem_params()->emulate_l1) { - if (data_toul_fb + slot > 19) { + uint8_t scs = get_softmodem_params()->numerology; + int slots_per_frame = nr_slots_per_frame[scs]; + if (data_toul_fb + slot >= slots_per_frame) { frame = (frame + 1) % 1024; - slot = (data_toul_fb + slot) - 20; + slot = (data_toul_fb + slot) - slots_per_frame; } else { slot = data_toul_fb + slot; @@ -2024,13 +2026,12 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, current_harq = &mac->dl_harq_info[dl_harq_pid]; if (current_harq->active) { + + sched_slot = current_harq->dl_slot + current_harq->feedback_to_ul; sched_frame = current_harq->dl_frame; - if (current_harq->feedback_to_ul + current_harq->dl_slot > 19) { - sched_frame = (sched_frame + 1) % 1024; - sched_slot = (current_harq->feedback_to_ul + current_harq->dl_slot) - slots_per_frame; - } - else { - sched_slot = current_harq->feedback_to_ul + current_harq->dl_slot; + if (sched_slot>=slots_per_frame){ + sched_slot %= slots_per_frame; + sched_frame = (sched_frame + 1) % 1024; } AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot); LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 699e0e1d71..e9394888f4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -262,9 +262,10 @@ int nr_process_mac_pdu(module_id_t module_idP, //38.321 section 6.1.3.1 //variable length /* Several checks have been added to this function to - ensure that the casting of the pduP is possible. There - is an actual bug here, but it has not been resolved. This - means that the scheduled transport block size is invalid. */ + ensure that the casting of the pduP is possible. There seems + to be a partial PDU at the end of this buffer, so here + we gracefully ignore that by returning 0. See: + https://gitlab.eurecom.fr/oai/openairinterface5g/-/issues/534 */ if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) return 0; mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; From 5846a9b832a1fd8724ef612ac34fcbede4de398f Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 24 Feb 2022 18:51:07 +0100 Subject: [PATCH 589/883] checking if csi_MeasConfig was already allocated --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 28aee71d86..04b5b6c92e 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1462,8 +1462,13 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon; - NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig)); - SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig; + NR_CSI_MeasConfig_t *csi_MeasConfig; + if(!SpCellConfig->spCellConfigDedicated->csi_MeasConfig) { + csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig)); + SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig; + } + else + csi_MeasConfig = SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE); config_csirs(scc, csi_MeasConfig, uid, carrier->pdsch_AntennaPorts, curr_bwp, carrier->do_CSIRS); From 8b526c3cb785dad0ad5f3ea90dc1b69e9c81f4a0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Feb 2022 20:52:05 +0100 Subject: [PATCH 590/883] Address review comment --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index b9f5147457..938b9f2584 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1944,7 +1944,7 @@ void create_nr_list(NR_list_t *list, int len) list->head = -1; list->next = malloc(len * sizeof(*list->next)); LOG_W(NR_MAC, "NR list->next %p\n", list->next); - AssertFatal(list->next, "cannot calloc() memory for NR_list_t->next\n"); + AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n"); for (int i = 0; i < len; ++i) list->next[i] = -1; list->tail = -1; From c918e76f7423053552fc0a8d3f9e3b4791588413 Mon Sep 17 00:00:00 2001 From: Mario Hudon Date: Thu, 24 Feb 2022 15:28:50 -0500 Subject: [PATCH 591/883] Complete NR_UE_PDCCH global variable/structure cleanup --- executables/nr-ue.c | 5 +- openair1/PHY/INIT/nr_init_ue.c | 32 -------- .../nr_dl_channel_estimation.c | 7 +- openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 4 +- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 76 +++++++++++-------- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 41 ++++++---- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 5 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 15 +++- openair1/PHY/defs_nr_UE.h | 60 ++------------- openair1/SCHED_NR_UE/defs.h | 22 ++++-- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 19 ++--- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 61 +++++++++------ openair1/SIMULATION/NR_PHY/dlsim.c | 6 +- .../SIMULATION/NR_PHY/nr_dummy_functions.c | 3 +- openair1/SIMULATION/NR_PHY/pbchsim.c | 10 ++- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 12 ++- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 4 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 19 +++-- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 7 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 8 ++ 20 files changed, 211 insertions(+), 205 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 05f9efae3c..d556636e98 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -697,6 +697,7 @@ void processSlotRX(void *arg) { int rx_slot_type = nr_ue_slot_select(cfg, proc->frame_rx, proc->nr_slot_rx); int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx); uint8_t gNB_id = 0; + NR_UE_PDCCH_CONFIG phy_pdcch_config={0}; if (IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) { /* send tick to RLC and PDCP every ms */ @@ -712,7 +713,7 @@ void processSlotRX(void *arg) { if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL) { nr_downlink_indication_t dl_indication; - nr_fill_dl_indication(&dl_indication, NULL, NULL, proc, UE, gNB_id); + nr_fill_dl_indication(&dl_indication, NULL, NULL, proc, UE, gNB_id, &phy_pdcch_config); UE->if_inst->dl_indication(&dl_indication, NULL); } @@ -721,7 +722,7 @@ void processSlotRX(void *arg) { phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL ); #else uint64_t a=rdtsc(); - phy_procedures_nrUE_RX(UE, proc, gNB_id, get_nrUE_params()->nr_dlsch_parallel, &rxtxD->txFifo); + phy_procedures_nrUE_RX(UE, proc, gNB_id, get_nrUE_params()->nr_dlsch_parallel, &phy_pdcch_config, &rxtxD->txFifo); LOG_D(PHY, "In %s: slot %d, time %lu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc()-a)/3500); #endif diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 4a1ce1c3eb..7d0b0c59ed 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -372,38 +372,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, } } - // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE - for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 ); - //ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); - // ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - // Channel estimates - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *)); - - for (i=0; inb_antennas_rx; i++) { - ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4)); - - for (j=0; j<4; j++) { - int idx = (j*fp->nb_antennas_rx)+i; - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 ); - // size_t num = 7*2*fp->N_RB_DL*12; - size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB - //ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - // ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - } - } - } - // PBCH pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 30eae2d30f..3cec2bd171 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -467,7 +467,9 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, unsigned char Ns, unsigned char symbol, unsigned short coreset_start_subcarrier, - unsigned short nb_rb_coreset) + unsigned short nb_rb_coreset, + int32_t pdcch_est_size, + int32_t pdcch_dl_ch_estimates[][pdcch_est_size]) { unsigned char aarx; @@ -476,7 +478,6 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*fr; int ch_offset,symbol_offset; - int **dl_ch_estimates =ue->pdcch_vars[proc->thread_id][gNB_id]->dl_ch_estimates; int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; ch_offset = ue->frame_parms.ofdm_symbol_size*symbol; @@ -511,7 +512,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, k = coreset_start_subcarrier; pil = (int16_t *)&pilot[0]; rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; - dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset]; + dl_ch = (int16_t *)&pdcch_dl_ch_estimates[aarx][ch_offset]; memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size)); diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index c5330ce2f2..d2d5f08c2c 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -45,7 +45,9 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, unsigned char Ns, unsigned char symbol, unsigned short coreset_start_subcarrier, - unsigned short nb_rb_coreset); + unsigned short nb_rb_coreset, + int32_t pdcch_est_size, + int32_t pdcch_dl_ch_estimates[][pdcch_est_size]); int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 74b229c451..4bb474f40d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -206,7 +206,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, } } -int32_t nr_pdcch_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t col, int32_t rxdataF_comp[][col], +int32_t nr_pdcch_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t rx_size, int32_t rxdataF_comp[][rx_size], int16_t *pdcch_llr, uint8_t symbol,uint32_t coreset_nbr_rb) { int16_t *rxF = (int16_t *) &rxdataF_comp[0][(symbol * coreset_nbr_rb * 12)]; int32_t i; @@ -275,7 +275,8 @@ int32_t pdcch_llr(NR_DL_FRAME_PARMS *frame_parms, //__m128i avg128P; //compute average channel_level on each (TX,RX) antenna pair -void nr_pdcch_channel_level(int32_t **dl_ch_estimates_ext, +void nr_pdcch_channel_level(int32_t rx_size, + int32_t dl_ch_estimates_ext[][rx_size], NR_DL_FRAME_PARMS *frame_parms, int32_t *avg, int symbol, @@ -342,10 +343,11 @@ void nr_pdcch_channel_level(int32_t **dl_ch_estimates_ext, // This function will extract the mapped DM-RS PDCCH REs as per 38.211 Section 7.4.1.3.2 (Mapping to physical resources) void nr_pdcch_extract_rbs_single(int32_t **rxdataF, - int32_t **dl_ch_estimates, - int32_t col, - int32_t rxdataF_ext[][col], - int32_t **dl_ch_estimates_ext, + int32_t est_size, + int32_t dl_ch_estimates[][est_size], + int32_t rx_size, + int32_t rxdataF_ext[][rx_size], + int32_t dl_ch_estimates_ext[][rx_size], uint8_t symbol, NR_DL_FRAME_PARMS *frame_parms, uint8_t *coreset_freq_dom, @@ -538,9 +540,9 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, #define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) -void nr_pdcch_channel_compensation(int32_t col, int32_t rxdataF_ext[][col], - int32_t **dl_ch_estimates_ext, - int32_t rxdataF_comp[][col], +void nr_pdcch_channel_compensation(int32_t rx_size, int32_t rxdataF_ext[][rx_size], + int32_t dl_ch_estimates_ext[][rx_size], + int32_t rxdataF_comp[][rx_size], int32_t **rho, NR_DL_FRAME_PARMS *frame_parms, uint8_t symbol, @@ -651,8 +653,8 @@ void nr_pdcch_channel_compensation(int32_t col, int32_t rxdataF_ext[][col], void nr_pdcch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, - int32_t col, - int32_t rxdataF_comp[][col], + int32_t rx_size, + int32_t rxdataF_comp[][rx_size], uint8_t symbol) { #if defined(__x86_64__) || defined(__i386__) __m128i *rxdataF_comp128_0,*rxdataF_comp128_1; @@ -688,24 +690,30 @@ void nr_pdcch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, + int32_t pdcch_est_size, + int32_t pdcch_dl_ch_estimates[][pdcch_est_size], + int16_t *pdcch_e_rx, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) { uint32_t frame = proc->frame_rx; uint32_t slot = proc->nr_slot_rx; NR_UE_COMMON *common_vars = &ue->common_vars; NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; - NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][0]; uint8_t log2_maxh, aarx; int32_t avgs; int32_t avgP[4]; int n_rb,rb_offset; - /// \brief Pointers to extracted PDCCH symbols in frequency-domain. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - int32_t rxdataF_ext[4*frame_parms->nb_antennas_rx][4*273*12]; // 4 symbols, 100 PRBs, 12 REs per PRB] - int32_t rxdataF_comp[4*frame_parms->nb_antennas_rx][4*273*12]; // 4 symbols, 100 PRBs, 12 REs per PRB] + // Pointers to extracted PDCCH symbols in frequency-domain. + int32_t rx_size = 4*273*12; + int32_t rxdataF_ext[4*frame_parms->nb_antennas_rx][rx_size]; + int32_t rxdataF_comp[4*frame_parms->nb_antennas_rx][rx_size]; + int32_t pdcch_dl_ch_estimates_ext[4*frame_parms->nb_antennas_rx][rx_size]; + + // Pointer to llrs, 4-bit resolution. + int32_t llr_size = 2*4*100*12; + int16_t llr[llr_size]; get_coreset_rballoc(rel15->coreset.frequency_domain_resource,&n_rb,&rb_offset); LOG_D(PHY,"pdcch coreset: freq %x, n_rb %d, rb_offset %d\n", @@ -714,10 +722,11 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, LOG_D(PHY,"in nr_pdcch_extract_rbs_single(rxdataF -> rxdataF_ext || dl_ch_estimates -> dl_ch_estimates_ext)\n"); nr_pdcch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, - pdcch_vars->dl_ch_estimates, - 4*273*12, + pdcch_est_size, + pdcch_dl_ch_estimates, + rx_size, rxdataF_ext, - pdcch_vars->dl_ch_estimates_ext, + pdcch_dl_ch_estimates_ext, s, frame_parms, rel15->coreset.frequency_domain_resource, @@ -727,7 +736,8 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, LOG_D(PHY,"we enter nr_pdcch_channel_level(avgP=%d) => compute channel level based on ofdm symbol 0, pdcch_vars[eNB_id]->dl_ch_estimates_ext\n",*avgP); LOG_D(PHY,"in nr_pdcch_channel_level(dl_ch_estimates_ext -> dl_ch_estimates_ext)\n"); // compute channel level based on ofdm symbol 0 - nr_pdcch_channel_level(pdcch_vars->dl_ch_estimates_ext, + nr_pdcch_channel_level(rx_size, + pdcch_dl_ch_estimates_ext, frame_parms, avgP, s, @@ -749,8 +759,8 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, LOG_D(PHY,"we enter nr_pdcch_channel_compensation(log2_maxh=%d)\n",log2_maxh); LOG_D(PHY,"in nr_pdcch_channel_compensation(rxdataF_ext x dl_ch_estimates_ext -> rxdataF_comp)\n"); // compute LLRs for ofdm symbol 0 only - nr_pdcch_channel_compensation(4*273*12, rxdataF_ext, - pdcch_vars->dl_ch_estimates_ext, + nr_pdcch_channel_compensation(rx_size, rxdataF_ext, + pdcch_dl_ch_estimates_ext, rxdataF_comp, NULL, frame_parms, @@ -759,15 +769,15 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, n_rb); // log2_maxh+I0_shift if (frame_parms->nb_antennas_rx > 1) { LOG_D(PHY,"we enter nr_pdcch_detection_mrc(frame_parms->nb_antennas_rx=%d)\n", frame_parms->nb_antennas_rx); - nr_pdcch_detection_mrc(frame_parms, 4*273*12, rxdataF_comp,s); + nr_pdcch_detection_mrc(frame_parms, rx_size, rxdataF_comp,s); } LOG_D(PHY,"we enter nr_pdcch_llr(for symbol %d), pdcch_vars[eNB_id]->rxdataF_comp ---> pdcch_vars[eNB_id]->llr \n",s); LOG_D(PHY,"in nr_pdcch_llr(rxdataF_comp -> llr)\n"); nr_pdcch_llr(frame_parms, - 4*273*12, + rx_size, rxdataF_comp, - pdcch_vars->llr, + llr, s, n_rb); #if T_TRACER @@ -783,8 +793,8 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, } LOG_D(PHY,"we enter nr_pdcch_demapping_deinterleaving(), number of candidates %d\n",rel15->number_of_candidates); - nr_pdcch_demapping_deinterleaving((uint32_t *) pdcch_vars->llr, - (uint32_t *) pdcch_vars->e_rx, + nr_pdcch_demapping_deinterleaving((uint32_t *) llr, + (uint32_t *) pdcch_e_rx, rel15->coreset.duration, rel15->coreset.StartSymbolIndex, n_rb, @@ -869,10 +879,10 @@ uint16_t nr_dci_false_detection(uint64_t *dci, uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, + int16_t *pdcch_e_rx, fapi_nr_dci_indication_t *dci_ind, - fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) { - - NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][0]; + fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, + NR_UE_PDCCH_CONFIG *phy_pdcch_config) { //int gNB_id = 0; int16_t tmp_e[16*108]; @@ -902,7 +912,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); - nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); + nr_pdcch_unscrambling(&pdcch_e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); #ifdef DEBUG_DCI_DECODING uint32_t * z = (uint32_t *) &pdcch_vars->e_rx[CCEind*108]; @@ -947,7 +957,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, } } } - pdcch_vars->nb_search_space = 0; + phy_pdcch_config->nb_search_space = 0; return(dci_ind->number_of_dcis); } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 2963ad5010..0ea277c2a9 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -104,7 +104,7 @@ void free_list(NR_UE_SSB *node) { } -int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_initial_symbol) +int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_initial_symbol, NR_UE_PDCCH_CONFIG *phy_pdcch_config) { NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; int ret =-1; @@ -159,7 +159,8 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini frame_parms, 0, temp_ptr->i_ssb, - SISO); + SISO, + phy_pdcch_config); temp_ptr=temp_ptr->next_ssb; } @@ -209,6 +210,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, NR_DL_FRAME_PARMS *fp = &ue->frame_parms; int ret=-1; int rx_power=0; //aarx, + + NR_UE_PDCCH_CONFIG phy_pdcch_config={0}; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_IN); @@ -293,7 +296,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp); nr_gold_pbch(ue); - ret = nr_pbch_detection(proc, ue, 1); // start pbch detection at first symbol after pss + ret = nr_pbch_detection(proc, ue, 1, &phy_pdcch_config); // start pbch detection at first symbol after pss if (ret == 0) { // sync at symbol ue->symbol_offset @@ -472,33 +475,39 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, // if stand alone and sync on ssb do sib1 detection as part of initial sync if (sa==1 && ret==0) { bool dec = false; - NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][0]; int gnb_id = 0; //FIXME int coreset_nb_rb=0; int coreset_start_rb=0; - for(int n_ss = 0; n_ssnb_search_space; n_ss++) { - uint8_t nb_symb_pdcch = pdcch_vars->pdcch_config[n_ss].coreset.duration; - int start_symb = pdcch_vars->pdcch_config[n_ss].coreset.StartSymbolIndex; - get_coreset_rballoc(pdcch_vars->pdcch_config[n_ss].coreset.frequency_domain_resource,&coreset_nb_rb,&coreset_start_rb); + // Hold the channel estimates in frequency domain. + int32_t pdcch_est_size = fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH); + int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size]; + + + for(int n_ss = 0; n_ssslot, - is*fp->samples_per_frame+pdcch_vars->sfn*fp->samples_per_frame+ue->rx_offset); + phy_pdcch_config.slot, + is*fp->samples_per_frame+phy_pdcch_config.sfn*fp->samples_per_frame+ue->rx_offset); if (coreset_nb_rb > 0) nr_pdcch_channel_estimation(ue, proc, 0, - pdcch_vars->slot, + phy_pdcch_config.slot, l, - fp->first_carrier_offset+(pdcch_vars->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12, - coreset_nb_rb); + fp->first_carrier_offset+(phy_pdcch_config.pdcch_config[n_ss].BWPStart + coreset_start_rb)*12, + coreset_nb_rb, + pdcch_est_size, + pdcch_dl_ch_estimates); } - int dci_cnt = nr_ue_pdcch_procedures(gnb_id, ue, proc, n_ss); + int dci_cnt = nr_ue_pdcch_procedures(gnb_id, ue, proc, pdcch_est_size, pdcch_dl_ch_estimates, &phy_pdcch_config, n_ss); if (dci_cnt>0){ NR_UE_DLSCH_t *dlsch = ue->dlsch_SI[gnb_id]; if (dlsch && (dlsch->active == 1)) { @@ -511,8 +520,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, nr_slot_fep_init_sync(ue, proc, m, - pdcch_vars->slot, // same slot and offset as pdcch - is*fp->samples_per_frame+pdcch_vars->sfn*fp->samples_per_frame+ue->rx_offset); + phy_pdcch_config.slot, // same slot and offset as pdcch + is*fp->samples_per_frame+phy_pdcch_config.sfn*fp->samples_per_frame+ue->rx_offset); } int ret = nr_ue_pdsch_procedures(ue, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index dff347f7c0..ef791034ad 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -414,7 +414,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *frame_parms, uint8_t gNB_id, uint8_t i_ssb, - MIMO_mode_t mimo_mode) { + MIMO_mode_t mimo_mode, + NR_UE_PDCCH_CONFIG *phy_pdcch_config) { NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars; int max_h=0; @@ -604,7 +605,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind)); uint16_t number_pdus = 1; - nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id, phy_pdcch_config); nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, gNB_id, ue, NULL, NULL, number_pdus, proc); if (ue->if_inst && ue->if_inst->dl_indication) 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 3cb002f9e1..6b160b5b34 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1105,6 +1105,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_NR_UE *phy_vars_ue, int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, + int32_t pdcch_est_size, + int32_t pdcch_dl_ch_estimates[][pdcch_est_size], + int16_t *pdcch_e_rx, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15); @@ -1156,11 +1159,13 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *frame_parms, uint8_t eNB_id, uint8_t i_ssb, - MIMO_mode_t mimo_mode); + MIMO_mode_t mimo_mode, + NR_UE_PDCCH_CONFIG *phy_pdcch_config); int nr_pbch_detection(UE_nr_rxtx_proc_t *proc, - PHY_VARS_NR_UE *ue, - int pbch_initial_symbol); + 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, @@ -1667,8 +1672,10 @@ uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms, uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, + int16_t *pdcch_e_rx, fapi_nr_dci_indication_t *dci_ind, - fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15); + fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, + NR_UE_PDCCH_CONFIG *phy_pdcch_config); /** \brief This function is the top-level entry point to PDSCH demodulation, after frequency-domain transformation and channel estimation. It performs diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index b411398d34..1064f23d01 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -580,64 +580,20 @@ typedef struct { } NR_UE_PDCCH_SEARCHSPACE; #endif typedef struct { - /// \brief Pointers to extracted PDCCH symbols in frequency-domain. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - // int32_t **rxdataF_ext; - /// \brief Pointers to extracted and compensated PDCCH symbols in frequency-domain. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - // int32_t **rxdataF_comp; - /// \brief Hold the channel estimates in frequency domain. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[ - int32_t **dl_ch_estimates; - /// \brief Hold the channel estimates in time domain (used for tracking). - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: samples? [0..2*ofdm_symbol_size[ - int32_t **dl_ch_estimates_time; - /// \brief Pointers to extracted channel estimates of PDCCH symbols. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - int32_t **dl_ch_estimates_ext; - /// \brief Pointers to channel cross-correlation vectors for multi-gNB detection. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - int32_t **dl_ch_rho_ext; - /// \brief Pointers to channel cross-correlation vectors for multi-gNB detection. - /// - first index: rx antenna [0..nb_antennas_rx[ - /// - second index: ? [0..] - int32_t **rho; - /// \brief Pointer to llrs, 4-bit resolution. - /// - first index: ? [0..48*N_RB_DL[ - int16_t *llr; - /// \brief Pointer to llrs, 16-bit resolution. - /// - first index: ? [0..96*N_RB_DL[ - int16_t *llr16; - /// \brief \f$\overline{w}\f$ from 36-211. - /// - first index: ? [0..48*N_RB_DL[ - int16_t *wbar; - /// \brief PDCCH/DCI e-sequence (input to rate matching). - /// - first index: ? [0..96*N_RB_DL[ - int16_t *e_rx; - /// Total number of PDU errors (diagnostic mode) - uint32_t dci_errors; + int nb_search_space; + uint16_t sfn; + uint16_t slot; + 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; - /// nCCE for PDCCH per subframe - uint8_t nCCE[10]; - //Check for specific DCIFormat and AgregationLevel - uint8_t dciFormat; - uint8_t agregationLevel; - int nb_search_space; - fapi_nr_dl_config_dci_dl_pdu_rel15_t pdcch_config[FAPI_NR_MAX_SS]; - // frame and slot for sib1 in initial sync - uint16_t sfn; - uint16_t slot; + /* #ifdef NR_PDCCH_DEFS_NR_UE int nb_searchSpaces; diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index b3527365a5..48b5e446d3 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -111,16 +111,18 @@ int phy_procedures_RN_UE_RX(unsigned char last_slot, unsigned char next_slot, re void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id); /*! \brief Scheduling for UE RX procedures in normal subframes. - @param ue Pointer to UE variables on which to act - @param proc Pointer to proc information - @param gNB_id Local id of eNB on which to act - @param dlsch_parallel use multithreaded dlsch processing - @param txFifo Result fifo if PDSCH is run in parallel + @param ue Pointer to UE variables on which to act + @param proc Pointer to proc information + @param gNB_id Local id of eNB on which to act + @param dlsch_parallel use multithreaded dlsch processing + @param phy_pdcch_config PDCCH Config for this slot + @param txFifo Result fifo if PDSCH is run in parallel */ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, uint8_t dlsch_parallel, + NR_UE_PDCCH_CONFIG *phy_pdcch_config, notifiedFIFO_t *txFifo); int phy_procedures_slot_parallelization_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t eNB_id, uint8_t abstraction_flag, uint8_t do_pdcch_flag, relaying_type_t r_type); @@ -400,7 +402,8 @@ void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind, fapi_nr_rx_indication_t *rx_ind, UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, - uint8_t gNB_id); + uint8_t gNB_id, + void *phy_data); /*@}*/ @@ -434,8 +437,11 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1); int nr_ue_pdcch_procedures(uint8_t gNB_id, - PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, + PHY_VARS_NR_UE *ue, + UE_nr_rxtx_proc_t *proc, + int32_t pdcch_est_size, + int32_t pdcch_dl_ch_estimates[][pdcch_est_size], + NR_UE_PDCCH_CONFIG *phy_pdcch_config, int n_ss); diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index f67c84a07c..c1fbc9f4bd 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -223,15 +223,13 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ // Note: we have to handle the thread IDs for this. To be revisited completely. thread_id = scheduled_response->thread_id; NR_UE_DLSCH_t *dlsch0 = NULL; - NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0]; NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0]; NR_UE_PUCCH *pucch_vars = PHY_vars_UE_g[module_id][cc_id]->pucch_vars[thread_id][0]; + NR_UE_PDCCH_CONFIG *phy_pdcch_config = NULL; if(scheduled_response->dl_config != NULL){ fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config; - pdcch_vars->nb_search_space = 0; - for (i = 0; i < dl_config->number_pdus; ++i){ AssertFatal(dl_config->number_pdus < FAPI_NR_DL_CONFIG_LIST_NUM,"dl_config->number_pdus %d out of bounds\n",dl_config->number_pdus); AssertFatal(dl_config->dl_config_list[i].pdu_type<=FAPI_NR_DL_CONFIG_TYPES,"pdu_type %d > 2\n",dl_config->dl_config_list[i].pdu_type); @@ -239,13 +237,16 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ __FUNCTION__, scheduled_response->frame, slot, dl_pdu_type[dl_config->dl_config_list[i].pdu_type - 1], dl_config->number_pdus); if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_DCI) { - + if (NULL == phy_pdcch_config) { + phy_pdcch_config = (NR_UE_PDCCH_CONFIG *)scheduled_response->phy_data; + phy_pdcch_config->nb_search_space = 0; + } fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; - memcpy((void*)&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config)); - pdcch_vars->nb_search_space = pdcch_vars->nb_search_space + 1; - pdcch_vars->sfn = scheduled_response->frame; - pdcch_vars->slot = slot; - LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space); + memcpy((void*)&phy_pdcch_config->pdcch_config[phy_pdcch_config->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config)); + phy_pdcch_config->nb_search_space = phy_pdcch_config->nb_search_space + 1; + phy_pdcch_config->sfn = scheduled_response->frame; + phy_pdcch_config->slot = slot; + LOG_D(PHY,"Number of DCI SearchSpaces %d\n",phy_pdcch_config->nb_search_space); } else { diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index b0ad4b4a83..3d3ab001b0 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -91,7 +91,8 @@ void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind, fapi_nr_rx_indication_t *rx_ind, UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, - uint8_t gNB_id){ + uint8_t gNB_id, + void *phy_data){ memset((void*)dl_ind, 0, sizeof(nr_downlink_indication_t)); @@ -101,6 +102,7 @@ void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind, dl_ind->frame = proc->frame_rx; dl_ind->slot = proc->nr_slot_rx; dl_ind->thread_id = proc->thread_id; + dl_ind->phy_data = phy_data; if (dci_ind) { @@ -359,7 +361,8 @@ void nr_ue_measurement_procedures(uint16_t l, void nr_ue_pbch_procedures(uint8_t gNB_id, PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, - uint8_t abstraction_flag) + uint8_t abstraction_flag, + NR_UE_PDCCH_CONFIG *phy_pdcch_config) { int ret = 0; @@ -377,7 +380,8 @@ void nr_ue_pbch_procedures(uint8_t gNB_id, &ue->frame_parms, gNB_id, (ue->frame_parms.ssb_index)&7, - SISO); + SISO, + phy_pdcch_config); if (ret==0) { @@ -484,6 +488,9 @@ unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb int nr_ue_pdcch_procedures(uint8_t gNB_id, PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, + int32_t pdcch_est_size, + int32_t pdcch_dl_ch_estimates[][pdcch_est_size], + NR_UE_PDCCH_CONFIG *phy_pdcch_config, int n_ss) { int frame_rx = proc->frame_rx; @@ -492,8 +499,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, fapi_nr_dci_indication_t *dci_ind = calloc(1, sizeof(*dci_ind)); nr_downlink_indication_t dl_indication; - NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][gNB_id]; - fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &pdcch_vars->pdcch_config[n_ss]; + fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &phy_pdcch_config->pdcch_config[n_ss]; /* // unsigned int dci_cnt=0, i; //removed for nr_ue_pdcch_procedures and added in the loop for nb_coreset_active @@ -675,9 +681,14 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, #endif */ - + + /// \brief PDCCH/DCI e-sequence (input to rate matching). + /// - first index: ? [0..96*N_RB_DL[ + int32_t pdcch_e_rx_size = 2*4*100*12; + int16_t pdcch_e_rx[pdcch_e_rx_size]; + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN); - nr_rx_pdcch(ue, proc, rel15); + nr_rx_pdcch(ue, proc, pdcch_est_size, pdcch_dl_ch_estimates, pdcch_e_rx, rel15); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_OUT); @@ -688,7 +699,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, n_ss); #endif - dci_cnt = nr_dci_decoding_procedure(ue, proc, dci_ind, rel15); + dci_cnt = nr_dci_decoding_procedure(ue, proc, pdcch_e_rx, dci_ind, rel15, phy_pdcch_config); #ifdef NR_PDCCH_SCHED_DEBUG LOG_I(PHY,"<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt); @@ -745,7 +756,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, */ // fill dl_indication message - nr_fill_dl_indication(&dl_indication, dci_ind, NULL, proc, ue, gNB_id); + nr_fill_dl_indication(&dl_indication, dci_ind, NULL, proc, ue, gNB_id, phy_pdcch_config); // send to mac ue->if_inst->dl_indication(&dl_indication, NULL); @@ -1013,16 +1024,16 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, switch (pdsch) { case RA_PDSCH: - nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id, NULL); nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_RAR, gNB_id, ue, dlsch0, NULL, number_pdus, proc); ue->UE_mode[gNB_id] = RA_RESPONSE; break; case PDSCH: - nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id, NULL); nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_DLSCH, gNB_id, ue, dlsch0, NULL, number_pdus, proc); break; case SI_PDSCH: - nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id); + nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id, NULL); nr_fill_rx_indication(rx_ind, FAPI_NR_RX_PDU_TYPE_SIB, gNB_id, ue, dlsch0, NULL, number_pdus, proc); break; default: @@ -1586,6 +1597,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, uint8_t dlsch_parallel, + NR_UE_PDCCH_CONFIG *phy_pdcch_config, notifiedFIFO_t *txFifo ) { @@ -1593,10 +1605,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int nr_slot_rx = proc->nr_slot_rx; int slot_pbch; int slot_ssb; - NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][0]; fapi_nr_config_request_t *cfg = &ue->nrUE_config; - uint8_t nb_symb_pdcch = pdcch_vars->nb_search_space > 0 ? pdcch_vars->pdcch_config[0].coreset.duration : 0; + uint8_t nb_symb_pdcch = phy_pdcch_config->nb_search_space > 0 ? phy_pdcch_config->pdcch_config[0].coreset.duration : 0; uint8_t dci_cnt = 0; NR_DL_FRAME_PARMS *fp = &ue->frame_parms; @@ -1614,8 +1625,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int coreset_nb_rb=0; int coreset_start_rb=0; - if (pdcch_vars->nb_search_space > 0) - get_coreset_rballoc(pdcch_vars->pdcch_config[0].coreset.frequency_domain_resource,&coreset_nb_rb,&coreset_start_rb); + if (phy_pdcch_config->nb_search_space > 0) + get_coreset_rballoc(phy_pdcch_config->pdcch_config[0].coreset.frequency_domain_resource,&coreset_nb_rb,&coreset_start_rb); slot_pbch = is_pbch_in_slot(cfg, frame_rx, nr_slot_rx, fp); slot_ssb = is_ssb_in_slot(cfg, frame_rx, nr_slot_rx, fp); @@ -1642,7 +1653,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if ((ue->decode_MIB == 1) && slot_pbch) { LOG_D(PHY," ------ Decode MIB: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); - nr_ue_pbch_procedures(gNB_id, ue, proc, 0); + nr_ue_pbch_procedures(gNB_id, ue, proc, 0, phy_pdcch_config); if (ue->no_timing_correction==0) { LOG_D(PHY,"start adjust sync slot = %d no timing %d\n", nr_slot_rx, ue->no_timing_correction); @@ -1681,13 +1692,17 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, nr_slot_rx); } + // Hold the channel estimates in frequency domain. + int32_t pdcch_est_size = fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH); + int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size]; + dci_cnt = 0; - for(int n_ss = 0; n_ssnb_search_space; n_ss++) { + for(int n_ss = 0; n_ssnb_search_space; n_ss++) { for (uint16_t l=0; lfirst_carrier_offset, pdcch_vars->pdcch_config[n_ss].BWPStart, coreset_start_rb, coreset_nb_rb); + fp->first_carrier_offset, phy_pdcch_config->pdcch_config[n_ss].BWPStart, coreset_start_rb, coreset_nb_rb); if (coreset_nb_rb > 0) nr_pdcch_channel_estimation(ue, @@ -1695,13 +1710,15 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, gNB_id, nr_slot_rx, l, - fp->first_carrier_offset+(pdcch_vars->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12, - coreset_nb_rb); + fp->first_carrier_offset+(phy_pdcch_config->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12, + coreset_nb_rb, + pdcch_est_size, + pdcch_dl_ch_estimates); stop_meas(&ue->ofdm_demod_stats); } - dci_cnt = dci_cnt + nr_ue_pdcch_procedures(gNB_id, ue, proc, n_ss); + dci_cnt = dci_cnt + nr_ue_pdcch_procedures(gNB_id, ue, proc, pdcch_est_size, pdcch_dl_ch_estimates, phy_pdcch_config, n_ss); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDCCH, VCD_FUNCTION_OUT); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 4a0da8eade..637df5ccb0 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -962,6 +962,8 @@ int main(int argc, char **argv) nr_dcireq_t dcireq; nr_scheduled_response_t scheduled_response; + NR_UE_PDCCH_CONFIG phy_pdcch_config={0}; + memset((void*)&dcireq,0,sizeof(dcireq)); memset((void*)&scheduled_response,0,sizeof(scheduled_response)); dcireq.module_id = 0; @@ -976,6 +978,7 @@ int main(int argc, char **argv) scheduled_response.frame = frame; scheduled_response.slot = slot; scheduled_response.thread_id = 0; + scheduled_response.phy_data = &phy_pdcch_config; nr_ue_phy_config_request(&UE_mac->phy_config); //NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels; @@ -1218,6 +1221,7 @@ int main(int argc, char **argv) &UE_proc, 0, dlsch_threads, + &phy_pdcch_config, NULL); //printf("dlsim round %d ends\n",round); @@ -1365,8 +1369,6 @@ int main(int argc, char **argv) LOG_M("chestF0.m","chF0",&UE->pdsch_vars[0][0]->dl_ch_estimates_ext[0][0],g_rbSize*12*14,1,1); write_output("rxF_comp.m","rxFc",&UE->pdsch_vars[0][0]->rxdataF_comp0[0][0],N_RB_DL*12*14,1,1); LOG_M("rxF_llr.m","rxFllr",UE->pdsch_vars[UE_proc.thread_id][0]->llr[0],available_bits,1,0); - LOG_M("pdcch_rxFcomp.m","pdcch_rxFcomp",&UE->pdcch_vars[0][0]->rxdataF_comp[0][0],96*12,1,1); - LOG_M("pdcch_rxFllr.m","pdcch_rxFllr",UE->pdcch_vars[0][0]->llr,96*12,1,1); break; } diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c index 7a47410129..a37b8473e8 100644 --- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c +++ b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c @@ -27,7 +27,8 @@ void nr_fill_dl_indication(nr_downlink_indication_t *dl_ind, fapi_nr_rx_indication_t *rx_ind, UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, - uint8_t gNB_id) {} + uint8_t gNB_id, + void *phy_data) {} void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, uint8_t pdu_type, uint8_t gNB_id, diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 2413a86912..f9bafd2032 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -74,7 +74,10 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {} int nr_ue_pdcch_procedures(uint8_t gNB_id, PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, - int n_ss) { + int32_t pdcch_est_size, + int32_t pdcch_dl_ch_estimates[][pdcch_est_size], + NR_UE_PDCCH_CONFIG *phy_pdcch_config, + int n_ss) { return 0; } @@ -720,6 +723,8 @@ int main(int argc, char **argv) } else { UE_nr_rxtx_proc_t proc={0}; + NR_UE_PDCCH_CONFIG phy_pdcch_config={0}; + UE->rx_offset=0; uint8_t ssb_index = 0; while (!((SSB_positions >> ssb_index) & 0x01)) ssb_index++; // to select the first transmitted ssb @@ -742,7 +747,8 @@ int main(int argc, char **argv) frame_parms, 0, ssb_index%8, - SISO); + SISO, + &phy_pdcch_config); if (ret==0) { //UE->rx_ind.rx_indication_body->mib_pdu.ssb_index; //not yet detected automatically diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 288716ed85..8aa601f301 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -48,6 +48,7 @@ void nr_ue_init_mac(module_id_t module_idP); \param module_id module id \param cc_id component carrier id \param gNB_index gNB index + \param phy_data PHY structure to be filled in by the callee in the FAPI call (L1 caller -> indication to L2 -> FAPI call to L1 callee) \param extra_bits extra bits for frame calculation \param l_ssb_equal_64 check if ssb number of candicate is equal 64, 1=equal; 0=non equal. Reference 38.212 7.1.1 \param pduP pointer to pdu @@ -56,7 +57,8 @@ void nr_ue_init_mac(module_id_t module_idP); int8_t nr_ue_decode_mib( module_id_t module_id, int cc_id, - uint8_t gNB_index, + uint8_t gNB_index, + void *phy_data, uint8_t extra_bits, uint32_t ssb_length, uint32_t ssb_index, @@ -132,7 +134,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in @param int cc_id CC ID @param frame_t frame frame number @param int slot reference number - @param UE_nr_rxtx_proc_t *proc pointer to process context */ + @param void *phy_pata pointer to a PHY specific structure to be filled in the scheduler response (can be null) */ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response, fapi_nr_dl_config_request_t *dl_config, fapi_nr_ul_config_request_t *ul_config, @@ -141,7 +143,8 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response, int cc_id, frame_t frame, int slot, - int thread_id); + int thread_id, + void *phy_data); /*! \fn int8_t nr_ue_get_SR(module_id_t module_idP, frame_t frameP, slot_t slotP); \brief Called by PHY to get sdu for PUSCH transmission. It performs the following operations: Checks BSR for DCCH, DCCH1 and DTCH corresponding to previous values computed either in SR or BSR procedures. It gets rlc status indications on DCCH,DCCH1 and DTCH and forms BSR elements and PHR in MAC header. CRNTI element is not supported yet. It computes transport block for up to 3 SDUs and generates header and forms the complete MAC SDU. @@ -369,7 +372,8 @@ void nr_ue_sib1_scheduler(module_id_t module_idP, uint8_t ssb_subcarrier_offset, uint32_t ssb_index, uint16_t ssb_start_subcarrier, - frequency_range_t frequency_range); + frequency_range_t frequency_range, + void *phy_data); /* \brief Function called by PHY to process the received RAR and check that the preamble matches what was sent by the gNB. It provides the timing advance and t-CRNTI. @param Mod_id Index of UE instance diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 85bb10290a..e0a0aa9ce4 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -288,6 +288,7 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){ int8_t nr_ue_decode_mib(module_id_t module_id, int cc_id, uint8_t gNB_index, + void *phy_data, uint8_t extra_bits, // 8bits 38.212 c7.1.1 uint32_t ssb_length, uint32_t ssb_index, @@ -363,7 +364,8 @@ int8_t nr_ue_decode_mib(module_id_t module_id, ssb_subcarrier_offset, ssb_index, ssb_start_subcarrier, - mac->frequency_range); + mac->frequency_range, + phy_data); } else { NR_ServingCellConfigCommon_t *scc = mac->scc; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 5284f7fc53..7f393cce6b 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -89,7 +89,8 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response, int cc_id, frame_t frame, int slot, - int thread_id){ + int thread_id, + void *phy_data){ scheduled_response->dl_config = dl_config; scheduled_response->ul_config = ul_config; @@ -99,6 +100,7 @@ void fill_scheduled_response(nr_scheduled_response_t *scheduled_response, scheduled_response->frame = frame; scheduled_response->slot = slot; scheduled_response->thread_id = thread_id; + scheduled_response->phy_data = phy_data; } @@ -922,7 +924,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in nr_ue_dcireq(&dcireq); //to be replaced with function pointer later mac->dl_config_request = dcireq.dl_config_req; - fill_scheduled_response(&scheduled_response, &dcireq.dl_config_req, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id); + fill_scheduled_response(&scheduled_response, &dcireq.dl_config_req, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id, dl_info->phy_data); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) mac->if_module->scheduled_response(&scheduled_response); } @@ -938,7 +940,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in fill_dci_search_candidates(mac->ra.ss, rel15); dl_config->number_pdus = 1; LOG_D(MAC,"mac->cg %p: Calling fill_scheduled_response rnti %x, type0_pdcch, num_pdus %d\n",mac->cg,rel15->rnti,dl_config->number_pdus); - fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id); + fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id, dl_info->phy_data); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) mac->if_module->scheduled_response(&scheduled_response); } @@ -1037,7 +1039,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in } pthread_mutex_unlock(&ul_config->mutex_ul_config); // avoid double lock - fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, mod_id, cc_id, frame_tx, slot_tx, ul_info->thread_id); + fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, mod_id, cc_id, frame_tx, slot_tx, ul_info->thread_id, NULL); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){ mac->if_module->scheduled_response(&scheduled_response); } @@ -2189,7 +2191,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in O_SR, O_ACK, O_CSI); LOG_D(NR_MAC,"Configuring pucch, is_common = %d\n",pucch->is_common); nr_scheduled_response_t scheduled_response; - fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id); + fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id, NULL); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) mac->if_module->scheduled_response(&scheduled_response); } @@ -2339,7 +2341,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s } } // if format1 - fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id); + fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id, NULL); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) mac->if_module->scheduled_response(&scheduled_response); } // is_nr_prach_slot @@ -2354,7 +2356,8 @@ void nr_ue_sib1_scheduler(module_id_t module_idP, uint8_t ssb_subcarrier_offset, uint32_t ssb_index, uint16_t ssb_start_subcarrier, - frequency_range_t frequency_range) { + frequency_range_t frequency_range, + void *phy_data) { NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP); nr_scheduled_response_t scheduled_response; @@ -2402,7 +2405,7 @@ void nr_ue_sib1_scheduler(module_id_t module_idP, slot_s = mac->type0_PDCCH_CSS_config.n_c; } LOG_D(MAC,"Calling fill_scheduled_response, type0_pdcch, num_pdus %d\n",dl_config->number_pdus); - fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, module_idP, cc_id, frame_s, slot_s, 0); // TODO fix thread_id, for now assumed 0 + fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, module_idP, cc_id, frame_s, slot_s, 0, phy_data); // TODO fix thread_id, for now assumed 0 if (dl_config->number_pdus) { if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index c7b54950d7..d2a8032ace 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1001,7 +1001,7 @@ void *nrue_standalone_pnf_task(void *context) // L2 Abstraction Layer int handle_bcch_bch(module_id_t module_id, int cc_id, - unsigned int gNB_index, uint8_t *pduP, + unsigned int gNB_index, void *phy_data, uint8_t *pduP, unsigned int additional_bits, uint32_t ssb_index, uint32_t ssb_length, uint16_t ssb_start_subcarrier, uint16_t cell_id){ @@ -1009,6 +1009,7 @@ int handle_bcch_bch(module_id_t module_id, int cc_id, return nr_ue_decode_mib(module_id, cc_id, gNB_index, + phy_data, additional_bits, ssb_length, // Lssb = 64 is not support ssb_index, @@ -1142,7 +1143,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ if (ret >= 0) { AssertFatal( nr_ue_if_module_inst[module_id] != NULL, "IF module is NULL!\n" ); AssertFatal( nr_ue_if_module_inst[module_id]->scheduled_response != NULL, "scheduled_response is NULL!\n" ); - fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot, dl_info->thread_id); + fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot, dl_info->thread_id, dl_info->phy_data); nr_ue_if_module_inst[module_id]->scheduled_response(&scheduled_response); } memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); @@ -1163,7 +1164,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ switch(dl_info->rx_ind->rx_indication_body[i].pdu_type){ case FAPI_NR_RX_PDU_TYPE_SSB: mac->ssb_rsrp_dBm = (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.rsrp_dBm; - ret_mask |= (handle_bcch_bch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, + ret_mask |= (handle_bcch_bch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, dl_info->phy_data, (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.pdu, (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.additional_bits, (dl_info->rx_ind->rx_indication_body+i)->ssb_pdu.ssb_index, diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 2a8a514769..fbc862eb8d 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -94,6 +94,9 @@ typedef struct { /// dci reception indication structure fapi_nr_dci_indication_t *dci_ind; + /// PHY specific data structure that can be passed on to L2 via nr_downlink_indication_t and + /// back to L1 via the nr_scheduled_response_t + void *phy_data; } nr_downlink_indication_t; @@ -147,6 +150,9 @@ typedef struct { /// data transmission request structure fapi_nr_tx_request_t *tx_request; + /// PHY data structure initially passed on to L2 via the nr_downlink_indication_t and + /// returned to L1 via nr_scheduled_response_t + void *phy_data; } nr_scheduled_response_t; typedef struct { @@ -255,6 +261,7 @@ int nr_ue_dcireq(nr_dcireq_t *dcireq); // TODO check /**\brief handle BCCH-BCH message from dl_indication + \param phy_data PHY structure to be filled in by the callee in the FAPI call (L1 caller -> indication to L2 -> FAPI call to L1 callee) \param pduP pointer to bch pdu \param additional_bits corresponding to 38.212 ch.7 \param ssb_index SSB index within 0 - (L_ssb-1) corresponding to 38.331 ch.13 parameter i @@ -263,6 +270,7 @@ int nr_ue_dcireq(nr_dcireq_t *dcireq); int handle_bcch_bch(module_id_t module_id, int cc_id, unsigned int gNB_index, + void *phy_data, uint8_t *pduP, unsigned int additional_bits, uint32_t ssb_index, From ce12e8270bb66d1419bc0d0d2ebe631814e39c56 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 24 Feb 2022 14:58:50 -0800 Subject: [PATCH 592/883] Code clean up --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index f8b6033277..6ff4420639 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1335,14 +1335,12 @@ void set_harq_status(NR_UE_MAC_INST_t *mac, current_harq->dl_frame = frame; current_harq->dl_slot = slot; if (get_softmodem_params()->emulate_l1) { - uint8_t scs = get_softmodem_params()->numerology; + int scs = get_softmodem_params()->numerology; int slots_per_frame = nr_slots_per_frame[scs]; - if (data_toul_fb + slot >= slots_per_frame) { + slot += data_toul_fb; + if (slot >= slots_per_frame) { frame = (frame + 1) % 1024; - slot = (data_toul_fb + slot) - slots_per_frame; - } - else { - slot = data_toul_fb + slot; + slot %= slots_per_frame; } } @@ -2031,7 +2029,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, sched_frame = current_harq->dl_frame; if (sched_slot>=slots_per_frame){ sched_slot %= slots_per_frame; - sched_frame = (sched_frame + 1) % 1024; + sched_frame = (sched_frame + 1) % 1024; } AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot); LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common); From 7aed0b6e76155e7a7aad19c04bc4e6fcb8a31e76 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 24 Feb 2022 16:01:51 -0800 Subject: [PATCH 593/883] These changes should not be checked in or merged to develop --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index e9f0a56b2c..a26bea0c92 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1668,9 +1668,9 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra } } - while (rbStart > (BWPSize - rbSize)) { - LOG_E(NR_MAC, "%s(): cannot find free vrb_map for RNTI %04x so decrament rbStart %d!\n", __func__, ra->rnti, rbStart); - rbStart--; + if (rbStart > (BWPSize - rbSize)) { + LOG_E(NR_MAC, "%s(): cannot find free vrb_map for RNTI %04x!\n", __func__, ra->rnti); + return; } // Checking if the DCI allocation is feasible in current subframe diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0304116253..92391ed1d5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -444,7 +444,7 @@ int get_mcs_from_bler(module_id_t mod_id, int CC_id, frame_t frame, sub_frame_t if (bler_stats->rd2_bler > nrmac->dl_rd2_bler_threshold && old_mcs > 6) { new_mcs -= 2; } else if (bler_stats->rd2_bler < nrmac->dl_rd2_bler_threshold) {*/ - if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs) // TODO: dtx > 9 needs to be updated to merge with OAI develop branch + if (bler_stats->bler < nrmac->dl_bler_target_lower && old_mcs < nrmac->dl_max_mcs && dtx > 9) new_mcs += 1; else if (bler_stats->bler > nrmac->dl_bler_target_upper && old_mcs > 6) new_mcs -= 1; From 4d90aad48f825c9145501004619418456164789a Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 16 Nov 2021 14:49:11 +0100 Subject: [PATCH 594/883] NR_UE: fix nr_dlsch_extract_rbs_single() for odd number of PDSCH RBs --- .../NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 164 +++++++++--------- 1 file changed, 85 insertions(+), 79 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 075aaecc08..ef7d398edf 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -647,28 +647,29 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, // Please keep it: useful for debugging #ifdef DEBUG_PDSCH_RX - char filename[40]; + char filename[50]; uint8_t aa = 0; - snprintf(filename, 40, "rxdataF0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx); + snprintf(filename, 50, "rxdataF0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx); write_output(filename, "rxdataF0", &common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1); - snprintf(filename, 40, "dl_ch_estimates0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); + snprintf(filename, 50, "dl_ch_estimates0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); write_output(filename, "dl_ch_estimates", &pdsch_vars[gNB_id]->dl_ch_estimates[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1); - snprintf(filename, 40, "rxdataF_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); + snprintf(filename, 50, "rxdataF_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); write_output(filename, "rxdataF_ext", &pdsch_vars[gNB_id]->rxdataF_ext[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1); - snprintf(filename, 40, "dl_ch_estimates_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); + snprintf(filename, 50, "dl_ch_estimates_ext0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); write_output(filename, "dl_ch_estimates_ext00", &pdsch_vars[gNB_id]->dl_ch_estimates_ext[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1); - snprintf(filename, 40, "rxdataF_comp0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); + snprintf(filename, 50, "rxdataF_comp0%d_symb_%d_nr_slot_rx_%d.m", aa, symbol, nr_slot_rx); write_output(filename, "rxdataF_comp00", &pdsch_vars[gNB_id]->rxdataF_comp0[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1); - +/* for (int i=0; i < 2; i++){ - snprintf(filename, 40, "llr%d_symb_%d_nr_slot_rx_%d.m", i, symbol, nr_slot_rx); + snprintf(filename, 50, "llr%d_symb_%d_nr_slot_rx_%d.m", i, symbol, nr_slot_rx); write_output(filename,"llr", &pdsch_vars[gNB_id]->llr[i][0], (NR_SYMBOLS_PER_SLOT*nb_rb*NR_NB_SC_PER_RB*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm), 1, 0); } +*/ #endif #if T_TRACER @@ -888,9 +889,11 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1); rxdataF_comp128[1] = _mm_packs_epi32(mmtmpD2,mmtmpD3); - //print_shorts("rx:",(int16_t*)&rxdataF128[1]); - //print_shorts("ch:",(int16_t*)&dl_ch128[1]); - //print_shorts("pack:",(int16_t*)&rxdataF_comp128[1]); +#ifdef DEBUG_DLSCH_DEMOD + print_shorts("rx:",(int16_t*)&rxdataF128[1]); + print_shorts("ch:",(int16_t*)&dl_ch128[1]); + print_shorts("pack:",(int16_t*)&rxdataF_comp128[1]); +#endif // multiply by conjugated channel mmtmpD0 = _mm_madd_epi16(dl_ch128[2],rxdataF128[2]); @@ -906,9 +909,11 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1); rxdataF_comp128[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3); - //print_shorts("rx:",(int16_t*)&rxdataF128[2]); - //print_shorts("ch:",(int16_t*)&dl_ch128[2]); - //print_shorts("pack:",(int16_t*)&rxdataF_comp128[2]); +#ifdef DEBUG_DLSCH_DEMOD + print_shorts("rx:",(int16_t*)&rxdataF128[2]); + print_shorts("ch:",(int16_t*)&dl_ch128[2]); + print_shorts("pack:",(int16_t*)&rxdataF_comp128[2]); +#endif dl_ch128+=3; dl_ch_mag128+=3; @@ -1993,87 +1998,88 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, NR_DL_FRAME_PARMS *frame_parms, uint16_t dlDmrsSymbPos) { - - unsigned short k,rb; - unsigned char nushift,i,aarx; - int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext; - - int8_t validDmrsEst = 0; //store last DMRS Symbol index - - unsigned char j=0; - - if (config_type==NFAPI_NR_DMRS_TYPE1) { + if (config_type == NFAPI_NR_DMRS_TYPE1) { AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2, "n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups); - nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1 - } else { AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2 || n_dmrs_cdm_groups == 3, "n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups); - nushift = (n_dmrs_cdm_groups -1)<<1;//delta in Table 7.4.1.1.2-2 - } + } - for (aarx=0; aarxnb_antennas_rx; aarx++) { + const unsigned short start_re = frame_parms->first_carrier_offset + start_rb * NR_NB_SC_PER_RB; + const int8_t validDmrsEst = get_valid_dmrs_idx_for_channel_est(dlDmrsSymbPos, symbol); - k = frame_parms->first_carrier_offset + NR_NB_SC_PER_RB*start_rb; + for (unsigned char aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { - validDmrsEst = get_valid_dmrs_idx_for_channel_est(dlDmrsSymbPos,symbol); + int32_t *dl_ch0 = &dl_ch_estimates[aarx][validDmrsEst * frame_parms->ofdm_symbol_size]; + int32_t *dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol * nb_rb_pdsch * NR_NB_SC_PER_RB]; + int32_t *rxF_ext = &rxdataF_ext[aarx][symbol * nb_rb_pdsch * NR_NB_SC_PER_RB]; + int32_t *rxF = &rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size]; - dl_ch0 = &dl_ch_estimates[aarx][(validDmrsEst*(frame_parms->ofdm_symbol_size))]; + if (pilots == 0) { //data symbol only + if (start_re + nb_rb_pdsch * NR_NB_SC_PER_RB < frame_parms->ofdm_symbol_size) { + memcpy((void*)rxF_ext, (void*)&rxF[start_re], nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t)); + } else { + int neg_length = frame_parms->ofdm_symbol_size - start_re; + int pos_length = nb_rb_pdsch * NR_NB_SC_PER_RB - neg_length; - dl_ch0_ext = &dl_ch_estimates_ext[aarx][symbol*(nb_rb_pdsch*12)]; - - rxF_ext = &rxdataF_ext[aarx][symbol*(nb_rb_pdsch*12)]; - rxF = &rxdataF[aarx][(k+(symbol*(frame_parms->ofdm_symbol_size)))]; - - for (rb = 0; rb < nb_rb_pdsch; rb++) { - if (k>=frame_parms->ofdm_symbol_size) { - k = k-frame_parms->ofdm_symbol_size; - rxF = &rxdataF[aarx][(k+(symbol*(frame_parms->ofdm_symbol_size)))]; + memcpy((void*)rxF_ext, (void*)&rxF[start_re], neg_length * sizeof(int32_t)); + memcpy((void*)&rxF_ext[neg_length], (void*)rxF, pos_length * sizeof(int32_t)); } - if (pilots==0) { - memcpy((void*)rxF_ext,(void*)rxF,12*sizeof(*rxF_ext)); - memcpy((void*)dl_ch0_ext,(void*)dl_ch0,12*sizeof(*dl_ch0_ext)); - dl_ch0_ext+=12; - rxF_ext+=12; - } else {//the symbol contains DMRS - j=0; - if (config_type==NFAPI_NR_DMRS_TYPE1){ - if (nushift == 0) {//data is multiplexed - for (i = (1-nushift); i<12; i+=2) { - rxF_ext[j]=rxF[i]; - dl_ch0_ext[j]=dl_ch0[i]; - j++; - } - dl_ch0_ext+=6; - rxF_ext+=6; - } - } else {//NFAPI_NR_DMRS_TYPE2 - for (i = (2+nushift); i<6; i++) { - rxF_ext[j]=rxF[i]; - dl_ch0_ext[j]=dl_ch0[i]; - j++; - } - for (i = (8+nushift); i<12; i++) { - rxF_ext[j]=rxF[i]; - dl_ch0_ext[j]=dl_ch0[i]; - j++; - } - dl_ch0_ext+= j; - rxF_ext+= j; + memcpy((void*)dl_ch0_ext, (void*)dl_ch0, nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t)); + } + else if (config_type == NFAPI_NR_DMRS_TYPE1){ + if (n_dmrs_cdm_groups == 1) { //data is multiplexed + unsigned short k = start_re; + for (unsigned short j = 0; j < 6*nb_rb_pdsch; j += 3) { + rxF_ext[j] = rxF[k+1]; + rxF_ext[j+1] = rxF[k+3]; + rxF_ext[j+2] = rxF[k+5]; + dl_ch0_ext[j] = dl_ch0[1]; + dl_ch0_ext[j+1] = dl_ch0[3]; + dl_ch0_ext[j+2] = dl_ch0[5]; + dl_ch0 += 6; + k += 6; + if (k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; } } - - dl_ch0+=12; - rxF+=12; - k+=12; - if (k>=frame_parms->ofdm_symbol_size) { - k = k-(frame_parms->ofdm_symbol_size); - rxF = &rxdataF[aarx][k+(symbol*(frame_parms->ofdm_symbol_size))]; + } + else {//NFAPI_NR_DMRS_TYPE2 + if (n_dmrs_cdm_groups == 1) { //data is multiplexed + unsigned short k = start_re; + for (unsigned short j = 0; j < 8*nb_rb_pdsch; j += 4) { + rxF_ext[j] = rxF[k+2]; + rxF_ext[j+1] = rxF[k+3]; + rxF_ext[j+2] = rxF[k+4]; + rxF_ext[j+3] = rxF[k+5]; + dl_ch0_ext[j] = dl_ch0[2]; + dl_ch0_ext[j+1] = dl_ch0[3]; + dl_ch0_ext[j+2] = dl_ch0[4]; + dl_ch0_ext[j+3] = dl_ch0[5]; + dl_ch0 += 6; + k += 6; + if (k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; + } + } + else if (n_dmrs_cdm_groups == 2) { //data is multiplexed + unsigned short k = start_re; + for (unsigned short j = 0; j < 4*nb_rb_pdsch; j += 2) { + rxF_ext[j] = rxF[k+4]; + rxF_ext[j+1] = rxF[k+5]; + dl_ch0_ext[j] = dl_ch0[4]; + dl_ch0_ext[j+1] = dl_ch0[5]; + dl_ch0 += 6; + k += 6; + if (k >= frame_parms->ofdm_symbol_size) + k -= frame_parms->ofdm_symbol_size; + } } } } - return(nb_rb_pdsch); + + return nb_rb_pdsch; } unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF, From c7ca405199f751969188c93bae69de1db89d5b7a Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 16 Nov 2021 14:52:23 +0100 Subject: [PATCH 595/883] gNB: fix nr_generate_pdsch() for odd number of PDSCH RBs --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 37ef5fb207..c5ff2c9f2d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -457,14 +457,34 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, pmi = 0;//no precoding if (pmi == 0) {//unitary Precoding - if(apnrOfLayers) - memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], - (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], - NR_NB_SC_PER_RB*sizeof(int32_t)); - else - memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], - 0, - NR_NB_SC_PER_RB*sizeof(int32_t)); + if (k + NR_NB_SC_PER_RB <= frame_parms->ofdm_symbol_size) { // RB does not cross DC + if(apnrOfLayers) + memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], + NR_NB_SC_PER_RB*sizeof(int32_t)); + else + memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + 0, + NR_NB_SC_PER_RB*sizeof(int32_t)); + } else { // RB does cross DC + int neg_length = frame_parms->ofdm_symbol_size - k; + int pos_length = NR_NB_SC_PER_RB - neg_length; + if (apnrOfLayers) { + memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)], + neg_length*sizeof(int32_t)); + memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset], + (void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size)], + pos_length*sizeof(int32_t)); + } else { + memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k], + 0, + neg_length*sizeof(int32_t)); + memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset], + 0, + pos_length*sizeof(int32_t)); + } + } k += NR_NB_SC_PER_RB; if (k >= frame_parms->ofdm_symbol_size) { k -= frame_parms->ofdm_symbol_size; From d0beb9796c1f0742b299b981de40df9bd90f3919 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 17 Nov 2021 17:26:13 +0100 Subject: [PATCH 596/883] NR_UE: fix nr_pdcch_channel_estimation() for odd number of PDCCH RBs --- .../nr_dl_channel_estimation.c | 55 ++++++++++++++----- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 30eae2d30f..d8b84e95da 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -536,8 +536,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, 16); pil += 2; rxF += 8; - //for (int i= 0; i<8; i++) - //printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i)); + k += 4; + + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -550,6 +554,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, 16); pil += 2; rxF += 8; + k += 4; + + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -562,23 +572,22 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ch, dl_ch, 16); - -#ifdef DEBUG_PDCCH +#ifdef DEBUG_PDCCH for (int m =0; m<12; m++) printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]); -#endif +#endif + dl_ch += 24; + pil += 2; rxF += 8; - dl_ch += 24; - k += 12; - - + k += 4; for (pilot_cnt=3; pilot_cnt<(3*nb_rb_coreset); pilot_cnt += 3) { - if (k >= ue->frame_parms.ofdm_symbol_size){ - k-=ue->frame_parms.ofdm_symbol_size; - rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];} + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -595,6 +604,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, pil += 2; rxF += 8; + k += 4; + + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -607,6 +622,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, 16); pil += 2; rxF += 8; + k += 4; + + if (k >= ue->frame_parms.ofdm_symbol_size) { + k -= ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)]; + } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -619,11 +640,15 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, ch, dl_ch, 16); +#ifdef DEBUG_PDCCH + for (int m =0; m<12; m++) + printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]); +#endif + dl_ch += 24; + pil += 2; rxF += 8; - dl_ch += 24; - k += 12; - + k += 4; } From 2655748b690e8d637b1385929e444ac619c9cbb9 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Wed, 17 Nov 2021 17:31:01 +0100 Subject: [PATCH 597/883] NR_UE: fix nr_pdcch_extract_rbs_single() for odd number od PDCCH RBs --- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 118 ++++++++++---------------- 1 file changed, 44 insertions(+), 74 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 84c9627c8a..b6ff0d9905 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -61,12 +61,8 @@ char nr_dci_format_string[8][30] = { //#define NR_LTE_PDCCH_DCI_SWITCH //#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs #ifdef NR_PDCCH_DCI_DEBUG -#define LOG_DNL(a, ...) printf("\n\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ ) -#define LOG_DD(a, ...) printf("\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ ) -#define LOG_DDD(a, ...) printf("\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ ) +#define LOG_DDD(a, ...) printf("<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ ) #else -#define LOG_DNL(a...) -#define LOG_DD(a...) #define LOG_DDD(a...) #endif #define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0) @@ -372,11 +368,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, uint8_t i, j, aarx; int32_t *dl_ch0, *dl_ch0_ext, *rxF, *rxF_ext; -#ifdef DEBUG_DCI_DECODING - uint8_t symbol_mod = (symbol >= (7 - frame_parms->Ncp)) ? symbol - (7 - frame_parms->Ncp) : symbol; - LOG_I(PHY, "extract_rbs_single: symbol_mod %d\n",symbol_mod); -#endif - for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { dl_ch0 = &dl_ch_estimates[aarx][frame_parms->ofdm_symbol_size*symbol]; LOG_DDD("dl_ch0 = &dl_ch_estimates[aarx = (%d)][0]\n",aarx); @@ -398,9 +389,9 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, * 1.2 The RB is >= than the N_RB_DL/2 -> IQ symbols are in the first half of the rxdataF (from element 0) * 2. Number of RBs in the system bandwidth is odd * (particular case when the RB with DC as it is treated differently: it is situated in symbol borders of rxdataF) - * 2.1 The RB is <= than the N_RB_DL/2 -> IQ symbols are in the second half of the rxdataF (from first_carrier_offset) - * 2.2 The RB is > than the N_RB_DL/2+1 -> IQ symbols are in the first half of the rxdataF (from element 0 + 2nd half RB containing DC) - * 2.3 The RB is == N_RB_DL/2+1 -> IQ symbols are in the lower border of the rxdataF for first 6 IQ element and the upper border of the rxdataF for the last 6 IQ elements + * 2.1 The RB is < than the N_RB_DL/2 -> IQ symbols are in the second half of the rxdataF (from first_carrier_offset) + * 2.2 The RB is > than the N_RB_DL/2 -> IQ symbols are in the first half of the rxdataF (from element 0 + 2nd half RB containing DC) + * 2.3 The RB is == N_RB_DL/2 -> IQ symbols are in the upper border of the rxdataF for first 6 IQ element and the lower border of the rxdataF for the last 6 IQ elements * If the first RB containing PDCCH within the UE BWP and within the CORESET is higher than half of the system bandwidth (N_RB_DL), * then the IQ symbol is going to be found at the position 0+c_rb-N_RB_DL/2 in rxdataF and * we have to point the pointer at (1+c_rb-N_RB_DL/2) in rxdataF @@ -430,64 +421,65 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, if (((c_rb + n_BWP_start) >= (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) == 0)) { // number of RBs is even and c_rb is higher than half system bandwidth (we don't skip DC) // if these conditions are true the pointer has to be situated at the 1st part of the rxdataF - rxF = &rxdataF[aarx][(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; // we point at the 1st part of the rxdataF in symbol - LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - c_rb,aarx,(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))); - //rxF = &rxdataF[aarx][(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))]; // we point at the 1st part of the rxdataF in symbol - //#ifdef NR_PDCCH_DCI_DEBUG - // LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - // c_rb,aarx,(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))); - //#endif + rxF = &rxdataF[aarx][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol + LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size)); } if (((c_rb + n_BWP_start) < (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) { //if RB to be treated is lower than middle system bandwidth then rxdataF pointed at (offset + c_br + symbol * ofdm_symbol_size): odd case - rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"in odd case c_rb (%d) is lower or equal than half N_RB_DL -> rxF = &rxdataF[aarx = (%d)][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - c_rb,aarx,(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))); -#endif + rxF = &rxdataF[aarx][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size]; + LOG_DDD("in odd case c_rb (%d) is lower or equal than half N_RB_DL -> rxF = &rxdataF[aarx = (%d)][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size)); } if (((c_rb + n_BWP_start) > (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) { // number of RBs is odd and c_rb is higher than half system bandwidth + 1 // if these conditions are true the pointer has to be situated at the 1st part of the rxdataF just after the first IQ symbols of the RB containing DC - rxF = &rxdataF[aarx][(12*(c_rb - (frame_parms->N_RB_DL>>1)) - 6 + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; // we point at the 1st part of the rxdataF in symbol -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"in odd case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(12*(c_rb - frame_parms->N_RB_DL) - 5 + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - c_rb,aarx,(12*(c_rb - (frame_parms->N_RB_DL>>1)) - 6 + (symbol * (frame_parms->ofdm_symbol_size)))); -#endif + rxF = &rxdataF[aarx][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol + LOG_DDD("in odd case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size)); } if (((c_rb + n_BWP_start) == (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) { // treatment of RB containing the DC // if odd number RBs in system bandwidth and first RB to be treated is higher than middle system bandwidth (around DC) // we have to treat the RB in two parts: first part from i=0 to 5, the data is at the end of rxdataF (pointing at the end of the table) - rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"in odd case c_rb (%d) is half N_RB_DL + 1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n", - c_rb,aarx,(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))); -#endif + rxF = &rxdataF[aarx][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size]; + LOG_DDD("in odd case c_rb (%d) is half N_RB_DL + 1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size)); j = 0; for (i = 0; i < 6; i++) { //treating first part of the RB note that i=5 would correspond to DC. We treat it in NR if ((i != 1) && (i != 5)) { dl_ch0_ext[j] = dl_ch0[i]; - rxF_ext[j++] = rxF[i]; - // printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1])); + rxF_ext[j] = rxF[i]; + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n", + c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i, + *(short *) &rxF[i], *(1 + (short *) &rxF[i])); + j++; + } else { + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n", + c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i, + *(short *) &rxF[i], *(1 + (short *) &rxF[i])); } } // then we point at the begining of the symbol part of rxdataF do process second part of RB - rxF = &rxdataF[aarx][((symbol * (frame_parms->ofdm_symbol_size)))]; // we point at the 1st part of the rxdataF in symbol -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"in odd case c_rb (%d) is half N_RB_DL +1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][(symbol * (frame_parms->ofdm_symbol_size)) = (%d)]\n", - c_rb,aarx,(symbol * (frame_parms->ofdm_symbol_size))); -#endif + rxF = &rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol + LOG_DDD("in odd case c_rb (%d) is half N_RB_DL +1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][symbol * frame_parms->ofdm_symbol_size = (%d)]\n", + c_rb,aarx,(symbol * frame_parms->ofdm_symbol_size)); for (; i < 12; i++) { if ((i != 9)) { dl_ch0_ext[j] = dl_ch0[i]; - rxF_ext[j++] = rxF[(1 + i - 6)]; - // printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1])); + rxF_ext[j] = rxF[i - 6]; + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n", + c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i, + *(short *) &rxF[i-6], *(1 + (short *) &rxF[i-6])); + j++; + } else { + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n", + c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i, + *(short *) &rxF[i-6], *(1 + (short *) &rxF[i-6])); } } @@ -495,32 +487,21 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, dl_ch0_ext += NBR_RE_PER_RB_WITHOUT_DMRS; rxF_ext += NBR_RE_PER_RB_WITHOUT_DMRS; dl_ch0 += 12; - //rxF += 7; - //c_rb++; - //n_BWP_start++; // We have to increment this variable here to be consequent in the for loop afterwards - //} } else { // treatment of any RB that does not contain the DC j = 0; for (i = 0; i < 12; i++) { if ((i != 1) && (i != 5) && (i != 9)) { rxF_ext[j] = rxF[i]; -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n", + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n", c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i, *(short *) &rxF[i], *(1 + (short *) &rxF[i])); -#endif dl_ch0_ext[j] = dl_ch0[i]; - - //LOG_DDD("ch %d => dl_ch0(%d,%d)\n", i, *(short *) &dl_ch0[i], *(1 + (short*) &dl_ch0[i])); - //printf("\t-> dl_ch0[%d] => dl_ch0_ext[%d](%d,%d)\n", i,j, *(short *) &dl_ch0[i], *(1 + (short*) &dl_ch0[i])); j++; } else { -#ifdef NR_PDCCH_DCI_DEBUG - LOG_D(PHY,"RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n", + LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n", c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i, *(short *) &rxF[i], *(1 + (short *) &rxF[i])); -#endif } } @@ -528,8 +509,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF, dl_ch0_ext += NBR_RE_PER_RB_WITHOUT_DMRS; rxF_ext += NBR_RE_PER_RB_WITHOUT_DMRS; dl_ch0 += 12; - //rxF += 12; - //} } } } @@ -783,16 +762,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, rel15->number_of_candidates, rel15->CCE, rel15->L); - /* - nr_pdcch_unscrambling(rel15->rnti, - frame_parms, - slot, - pdcch_vars->e_rx, - rel15->coreset.duration*n_rb*9*2, - // get_nCCE(n_pdcch_symbols, frame_parms, mi) * 72, - rel15->coreset.pdcch_dmrs_scrambling_id); - */ - LOG_D(PHY,"we end nr_pdcch_unscrambling()\n"); + LOG_D(PHY,"we end nr_pdcch_demapping_deinterleaving()\n"); LOG_D(PHY,"Ending nr_rx_pdcch() function\n"); return (0); @@ -888,16 +858,16 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, uint64_t dci_estimation[2]= {0}; const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList); - LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", - j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); + LOG_D(PHY, "(%i.%i) Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", + proc->frame_rx, proc->nr_slot_rx, j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); #ifdef DEBUG_DCI_DECODING uint32_t * z = (uint32_t *) &pdcch_vars->e_rx[CCEind*108]; - for (int index_z = 0; index_z < 96; index_z++){ + for (int index_z = 0; index_z < 6*L; index_z++){ for (int i=0; i<9; i++) { - LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i])); + LOG_I(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[9*index_z + i],*(1 + (int16_t *) &z[9*index_z + i])); } } #endif From e96bb10289b9eed85eb8631ca0cc501ad097751d Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 25 Feb 2022 10:05:14 +0100 Subject: [PATCH 598/883] improving also pusch dmrs init --- openair1/PHY/INIT/nr_init.c | 7 +++--- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 7 +++++- openair1/PHY/NR_REFSIG/nr_gold.c | 24 ++++++++----------- openair1/PHY/NR_REFSIG/nr_refsig.h | 2 +- openair1/PHY/defs_gNB.h | 1 + 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 95e7c011fb..e823267ce9 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -179,9 +179,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, } } - uint32_t Nid_pusch[2] = {cfg->cell_config.phy_cell_id.value,cfg->cell_config.phy_cell_id.value}; - LOG_D(PHY,"Initializing PUSCH DMRS Gold sequence with (%x,%x)\n",Nid_pusch[0],Nid_pusch[1]); - nr_gold_pusch(gNB, &Nid_pusch[0]); + for (int nscid=0; nscid<2; nscid++) { + gNB->pusch_gold_init[nscid] = cfg->cell_config.phy_cell_id.value; + nr_gold_pusch(gNB, nscid, gNB->pusch_gold_init[nscid]); + } //CSI RS init gNB->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index 9aaba7fb66..4a6f8ef9af 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -165,6 +165,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, //------------------generate DMRS------------------// + if(pusch_pdu->ul_dmrs_scrambling_id != gNB->pusch_gold_init[pusch_pdu->scid]) { + gNB->pusch_gold_init[pusch_pdu->scid] = pusch_pdu->ul_dmrs_scrambling_id; + nr_gold_pusch(gNB, pusch_pdu->scid, pusch_pdu->ul_dmrs_scrambling_id); + } + // transform precoding = 1 means disabled if (pusch_pdu->transform_precoding == 1) { nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch, @@ -1247,4 +1252,4 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB, #endif return 0; -} \ No newline at end of file +} diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index a844993689..dc1ceda5e5 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -100,27 +100,23 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint8_t nscid, uint32_t Nid) } -void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid) { +void nr_gold_pusch(PHY_VARS_gNB* gNB, int nscid, uint32_t nid) { unsigned char ns; unsigned int n,x1,x2; - int nscid, reset; - unsigned int nid; + int reset; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; unsigned short l; - for (nscid=0; nscid<2; nscid++) { - nid = Nid[nscid]; - for (ns=0; nsslots_per_frame; ns++) { - for (l=0; lsymbols_per_slot; l++) { - reset = 1; - x2 = ((1<<17) * (fp->symbols_per_slot*ns+l+1) * ((nid<<1)+1) +((nid<<1)+nscid)); - LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",ns,l,x2); + for (ns=0; nsslots_per_frame; ns++) { + for (l=0; lsymbols_per_slot; l++) { + reset = 1; + x2 = ((1<<17) * (fp->symbols_per_slot*ns+l+1) * ((nid<<1)+1) +((nid<<1)+nscid)); + LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",ns,l,x2); - for (n=0; nnr_gold_pusch_dmrs[nscid][ns][l][n] = lte_gold_generic(&x1, &x2, reset); - reset = 0; - } + for (n=0; nnr_gold_pusch_dmrs[nscid][ns][l][n] = lte_gold_generic(&x1, &x2, reset); + reset = 0; } } } diff --git a/openair1/PHY/NR_REFSIG/nr_refsig.h b/openair1/PHY/NR_REFSIG/nr_refsig.h index a9efdb8ad0..df3dad1e59 100644 --- a/openair1/PHY/NR_REFSIG/nr_refsig.h +++ b/openair1/PHY/NR_REFSIG/nr_refsig.h @@ -40,7 +40,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid); void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint8_t nscid, uint32_t Nid); void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid); -void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid); +void nr_gold_pusch(PHY_VARS_gNB* gNB, int nscid, uint32_t nid); int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB, unsigned int Ns, diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index f549e9591b..d0f06174cf 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -850,6 +850,7 @@ typedef struct PHY_VARS_gNB_s { int csi_gold_init; int pdcch_gold_init; int pdsch_gold_init[2]; + int pusch_gold_init[2]; int pucch0_thres; int pusch_thres; From b9ae5db874bf591a9102ab6ff98acd277a2ffb35 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 25 Feb 2022 12:09:42 +0100 Subject: [PATCH 599/883] gold init improvement at ue for dl channels --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 3 +- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 31 +++++------ openair1/PHY/NR_REFSIG/refsig_defs_ue.h | 3 +- .../nr_dl_channel_estimation.c | 22 ++++---- openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 3 ++ .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 9 ++-- .../PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 2 + openair1/PHY/defs_nr_UE.h | 2 +- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 2 + openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 3 ++ openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 51 ++++++++++++++----- 11 files changed, 82 insertions(+), 49 deletions(-) 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 3b429a5e84..ce43e23c15 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 @@ -464,7 +464,8 @@ typedef struct { uint8_t nEpreRatioOfPDSCHToPTRS; /// MCS table for this DLSCH uint8_t mcs_table; - + uint8_t nscid; + uint16_t dlDmrsScramblingId; uint16_t pduBitmap; } fapi_nr_dl_config_dlsch_pdu_rel15_t; diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index 623b86edfb..6c48cf1b73 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -75,33 +75,28 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue, } void nr_gold_pdsch(PHY_VARS_NR_UE* ue, - unsigned short *n_idDMRS) + int nscid, + uint32_t nid) { - unsigned char l; - unsigned int n,x1,x2,x2tmp0,ns; - int nscid; - unsigned int nid; + + unsigned int x1,x2,x2tmp0; uint8_t reset; /// to be updated from higher layer //unsigned short lbar = 0; - for (nscid=0; nscid<2; nscid++) { - for (ns=0; nsframe_parms.slots_per_frame; ns++) { + for (int ns=0; nsframe_parms.slots_per_frame; ns++) { - nid = n_idDMRS[nscid]; + for (int l=0; lframe_parms.symbols_per_slot; l++) { - for (l=0; lframe_parms.symbols_per_slot; l++) { + reset = 1; + x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17; + x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit + LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid); - reset = 1; - x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17; - x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit - LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid); - - for (n=0; nnr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset); - reset = 0; - } + for (int n=0; nnr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset); + reset = 0; } } } diff --git a/openair1/PHY/NR_REFSIG/refsig_defs_ue.h b/openair1/PHY/NR_REFSIG/refsig_defs_ue.h index 1fca2be2a1..db0cb674f7 100644 --- a/openair1/PHY/NR_REFSIG/refsig_defs_ue.h +++ b/openair1/PHY/NR_REFSIG/refsig_defs_ue.h @@ -61,7 +61,8 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue, unsigned short n_idDMRS); void nr_gold_pdsch(PHY_VARS_NR_UE* ue, - unsigned short *n_idDMRS); + int nscid, + uint32_t nid); void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, uint16_t *N_n_scid, diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 30eae2d30f..2387ae35ea 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -466,6 +466,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, uint8_t gNB_id, unsigned char Ns, unsigned char symbol, + unsigned short scrambling_id, unsigned short coreset_start_subcarrier, unsigned short nb_rb_coreset) { @@ -493,13 +494,11 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, fm = filt16a_m1; fr = filt16a_r1; - // checking if re-initialization of scrambling IDs is needed (should be done here but scrambling ID for PDCCH is not taken from RRC) -/* if (( != ue->scramblingID_pdcch){ - ue->scramblingID_pdcch=; - nr_gold_pdsch(ue,ue->scramblingID_pdcch); - }*/ - + if (scrambling_id != ue->scramblingID_pdcch){ + ue->scramblingID_pdcch = scrambling_id; + nr_gold_pdcch(ue,ue->scramblingID_pdcch); + } // generate pilot int pilot[nb_rb_coreset * 3] __attribute__((aligned(16))); @@ -641,6 +640,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, unsigned char Ns, unsigned short p, unsigned char symbol, + unsigned char nscid, + unsigned short scrambling_id, unsigned short BWPStart, unsigned short bwp_start_subcarrier, unsigned short nb_rb_pdsch) @@ -682,11 +683,10 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, int8_t delta = get_delta(p, config_type); // checking if re-initialization of scrambling IDs is needed - /*if ((XXX.scramblingID0 != ue->scramblingID[0]) || (XXX.scramblingID1 != ue->scramblingID[1])){ - ue->scramblingID[0] = XXX.scramblingID0; - ue->scramblingID[1] = XXX.scramblingID1; - nr_gold_pdsch(ue,ue->scramblingID); - }*/ + if (scrambling_id != ue->scramblingID_dlsch[nscid]){ + ue->scramblingID_dlsch[nscid] = scrambling_id; + nr_gold_pdsch(ue, nscid, scrambling_id); + } nr_pdsch_dmrs_rx(ue, Ns, ue->nr_gold_pdsch[gNB_id][Ns][symbol][0], &pilot[0], 1000+p, 0, nb_rb_pdsch+rb_offset, config_type); diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index c5330ce2f2..06394eb029 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -44,6 +44,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, uint8_t gNB_id, unsigned char Ns, unsigned char symbol, + unsigned short scrambling_id, unsigned short coreset_start_subcarrier, unsigned short nb_rb_coreset); @@ -71,6 +72,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, unsigned char Ns, unsigned short p, unsigned char symbol, + unsigned char nscid, + unsigned short scrambling_id, unsigned short BWPStart, unsigned short bwp_start_subcarrier, unsigned short nb_rb_pdsch); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index 203be1bd24..dd7a2144e0 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -310,10 +310,10 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, nr_gold_pdcch(ue,fp->Nid_cell); // compute the scrambling IDs for PDSCH DMRS - for (int i=0; i<2; i++) - ue->scramblingID[i]=fp->Nid_cell; - - nr_gold_pdsch(ue,ue->scramblingID); + for (int i=0; i<2; i++) { + ue->scramblingID_dlsch[i]=fp->Nid_cell; + nr_gold_pdsch(ue, i, ue->scramblingID_dlsch[i]); + } // initialize the pusch dmrs uint16_t N_n_scid[2] = {fp->Nid_cell,fp->Nid_cell}; @@ -509,6 +509,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, 0, pdcch_vars->slot, l, + fp->Nid_cell, fp->first_carrier_offset+(pdcch_vars->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12, coreset_nb_rb); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index 9b9f1add6e..0cd2f33b0c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -303,6 +303,8 @@ typedef struct { uint16_t ptrs_symbols; // PTRS symbol index, to be updated every PTRS symbol within a slot. uint8_t ptrs_symbol_index; + uint8_t nscid; + uint16_t dlDmrsScramblingId; /// PDU BITMAP uint16_t pduBitmap; } NR_DL_UE_HARQ_t; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index bca956bf75..b0568ebff5 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -859,7 +859,7 @@ typedef struct { uint32_t ****nr_gold_pdsch[NUMBER_OF_CONNECTED_eNB_MAX]; // Scrambling IDs used in PDSCH DMRS - uint16_t scramblingID[2]; + uint16_t scramblingID_dlsch[2]; /// PDCCH DMRS uint32_t ***nr_gold_pdcch[NUMBER_OF_CONNECTED_eNB_MAX]; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4f4757ec5a..2326b3518a 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -286,6 +286,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups; dlsch0_harq->mcs = dlsch_config_pdu->mcs; dlsch0_harq->rvidx = dlsch_config_pdu->rv; + dlsch0_harq->nscid = dlsch_config_pdu->nscid; + dlsch0_harq->dlDmrsScramblingId = dlsch_config_pdu->dlDmrsScramblingId; dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; //get nrOfLayers from DCI info uint8_t Nl = 0; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 97a7e2e489..d35fbf3b97 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -574,6 +574,8 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ nr_slot_rx, aatx /*p*/, m, + dlsch0_harq->nscid, + dlsch0_harq->dlDmrsScramblingId, BWPStart, ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12, pdsch_nb_rb); @@ -1470,6 +1472,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, gNB_id, nr_slot_rx, l, + pdcch_vars->pdcch_config[n_ss].coreset.pdcch_dmrs_scrambling_id, fp->first_carrier_offset+(pdcch_vars->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12, coreset_nb_rb); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 85bb10290a..d0f5c38d66 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -281,7 +281,6 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){ LOG_D(MAC, "In %s: returning rnti_type %s \n", __FUNCTION__, rnti_types[rnti_type]); return rnti_type; - } @@ -866,6 +865,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr } int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_0->start_symbol <= 3)? typeA: typeB); + struct NR_DMRS_DownlinkConfig *dl_dmrs_config = (mappingtype == typeA) ? + mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup : + mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup; + + dlsch_config_pdu_1_0->nscid = 0; + if(mac->DLbwp[0] && dl_dmrs_config->scramblingID0) + dlsch_config_pdu_1_0->dlDmrsScramblingId = *dl_dmrs_config->scramblingID0; + else + dlsch_config_pdu_1_0->dlDmrsScramblingId = mac->physCellId; + /* dmrs symbol positions*/ dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, (get_softmodem_params()->nsa) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position, @@ -873,7 +882,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_0->start_symbol, mappingtype); dlsch_config_pdu_1_0->dmrsConfigType = (mac->DLbwp[0] != NULL) ? - (mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0; + (dl_dmrs_config->dmrs_Type == NULL ? 0 : 1) : 0; /* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */ if (dlsch_config_pdu_1_0->number_symbols == 2) dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1; @@ -1062,6 +1071,29 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB); + struct NR_DMRS_DownlinkConfig *dl_dmrs_config = (mappingtype == typeA) ? + pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup : + pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup; + + switch (dci->dmrs_sequence_initialization.val) { + case 0: + dlsch_config_pdu_1_1->nscid = 0; + if(dl_dmrs_config->scramblingID0) + dlsch_config_pdu_1_1->dlDmrsScramblingId = *dl_dmrs_config->scramblingID0; + else + dlsch_config_pdu_1_1->dlDmrsScramblingId = mac->physCellId; + break; + case 1: + dlsch_config_pdu_1_1->nscid = 1; + if(dl_dmrs_config->scramblingID1) + dlsch_config_pdu_1_1->dlDmrsScramblingId = *dl_dmrs_config->scramblingID1; + else + dlsch_config_pdu_1_1->dlDmrsScramblingId = mac->physCellId; + break; + default: + AssertFatal(1==0,"Invalid dmrs sequence initialization value\n"); + } + /* dmrs symbol positions*/ dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config, mac->scc? mac->scc->dmrs_TypeA_Position:mac->mib->dmrs_TypeA_Position, @@ -1069,7 +1101,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_1->start_symbol, mappingtype); - dlsch_config_pdu_1_1->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2; + dlsch_config_pdu_1_1->dmrsConfigType = dl_dmrs_config->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2; /* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214, using tables 7.3.1.2.2-1, 7.3.1.2.2-2, 7.3.1.2.2-3, 7.3.1.2.2-4 of 3GPP TS 38.212 */ @@ -1130,16 +1162,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr /* ANTENNA_PORTS */ uint8_t n_codewords = 1; // FIXME!!! - long *max_length = NULL; - long *dmrs_type = NULL; - if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA) { - max_length = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength; - dmrs_type = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type; - } - if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB) { - max_length = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->maxLength; - dmrs_type = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type; - } + long *max_length = dl_dmrs_config->maxLength; + long *dmrs_type = dl_dmrs_config->dmrs_Type; + if ((dmrs_type == NULL) && (max_length == NULL)){ // Table 7.3.1.2.2-1: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=1 dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_1[dci->antenna_ports.val][0]; From 8cfb8b6a3bf6b33a0fb0b01f913f7ba04599e13d Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 25 Feb 2022 11:42:15 +0100 Subject: [PATCH 600/883] Fix correlation calculation in nr_dlsch_channel_compensation() --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index 7101cadac8..75517b7a6f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -931,12 +931,12 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, for (aarx=0; aarxnb_antennas_rx; aarx++) { for (aatx=0; aatxnb_antennas_rx+aarx][symbol*nb_rb*12]; for (atx=0; atxnb_antennas_rx+aarx][symbol*nb_rb*12]; dl_ch128_2 = (__m128i *)&dl_ch_estimates_ext[atx*frame_parms->nb_antennas_rx+aarx][symbol*nb_rb*12]; for (rb=0; rb Date: Fri, 25 Feb 2022 12:57:17 +0100 Subject: [PATCH 601/883] fix scrambling initialization in nr_dlsim and nr_ulsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 11 ++++++++++- openair1/SIMULATION/NR_PHY/ulsim.c | 19 ++++--------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index b8f51f8e95..fb99c50400 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -924,7 +924,16 @@ int main(int argc, char **argv) init_nr_ue_transport(UE,0); nr_gold_pbch(UE); - nr_gold_pdcch(UE,0); + + // compute the scramblingID_pdcch and the gold pdcch + UE->scramblingID_pdcch = frame_parms->Nid_cell; + nr_gold_pdcch(UE, frame_parms->Nid_cell); + + // compute the scrambling IDs for PDSCH DMRS + for (int i = 0; i < 2; i++) + UE->scramblingID[i] = frame_parms->Nid_cell; + + nr_gold_pdsch(UE, UE->scramblingID); nr_l2_init_ue(NULL); UE_mac = get_mac_inst(0); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index c71f52c41a..56f5d2dd71 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -755,28 +755,17 @@ int main(int argc, char **argv) PHY_vars_UE_g[0][0] = UE; memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); - //phy_init_nr_top(frame_parms); if (init_nr_ue_signal(UE, 1, 0) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } - //nr_init_frame_parms_ue(&UE->frame_parms); init_nr_ue_transport(UE, 0); - /* - for (int sf = 0; sf < 2; sf++) { - for (i = 0; i < 2; i++) { - - UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); - - if (!UE->ulsch[sf][0][i]) { - printf("Can't get ue ulsch structures\n"); - exit(-1); - } - } - } - */ + // initialize the pusch dmrs + uint16_t N_n_scid[2] = {frame_parms->Nid_cell,frame_parms->Nid_cell}; + int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization + nr_init_pusch_dmrs(UE, N_n_scid, n_scid); //Configure UE NR_UE_RRC_INST_t rrcue; From 34ab52b6c3227026dadbc14dd63fddd663887939 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 25 Feb 2022 12:57:17 +0100 Subject: [PATCH 602/883] fix scrambling initialization in nr_dlsim and nr_ulsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 11 ++++++++++- openair1/SIMULATION/NR_PHY/ulsim.c | 19 ++++--------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index b8f51f8e95..fb99c50400 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -924,7 +924,16 @@ int main(int argc, char **argv) init_nr_ue_transport(UE,0); nr_gold_pbch(UE); - nr_gold_pdcch(UE,0); + + // compute the scramblingID_pdcch and the gold pdcch + UE->scramblingID_pdcch = frame_parms->Nid_cell; + nr_gold_pdcch(UE, frame_parms->Nid_cell); + + // compute the scrambling IDs for PDSCH DMRS + for (int i = 0; i < 2; i++) + UE->scramblingID[i] = frame_parms->Nid_cell; + + nr_gold_pdsch(UE, UE->scramblingID); nr_l2_init_ue(NULL); UE_mac = get_mac_inst(0); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index c71f52c41a..56f5d2dd71 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -755,28 +755,17 @@ int main(int argc, char **argv) PHY_vars_UE_g[0][0] = UE; memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); - //phy_init_nr_top(frame_parms); if (init_nr_ue_signal(UE, 1, 0) != 0) { printf("Error at UE NR initialisation\n"); exit(-1); } - //nr_init_frame_parms_ue(&UE->frame_parms); init_nr_ue_transport(UE, 0); - /* - for (int sf = 0; sf < 2; sf++) { - for (i = 0; i < 2; i++) { - - UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0); - - if (!UE->ulsch[sf][0][i]) { - printf("Can't get ue ulsch structures\n"); - exit(-1); - } - } - } - */ + // initialize the pusch dmrs + uint16_t N_n_scid[2] = {frame_parms->Nid_cell,frame_parms->Nid_cell}; + int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization + nr_init_pusch_dmrs(UE, N_n_scid, n_scid); //Configure UE NR_UE_RRC_INST_t rrcue; From 15565c965976b78f1d4dd655688d78ec1636016b Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 25 Feb 2022 14:49:31 +0100 Subject: [PATCH 603/883] gold init improvement at ue for pusch --- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 4 ++-- openair1/PHY/NR_REFSIG/refsig_defs_ue.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 8 +++++--- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 6 ++++++ openair1/PHY/defs_nr_UE.h | 3 +++ openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 13 +++++++++++++ 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index 6c48cf1b73..abcdae5a33 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -103,7 +103,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue, } void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, - uint16_t *N_n_scid, + uint16_t N_n_scid, uint8_t n_scid) { uint32_t x1, x2, n; @@ -116,7 +116,7 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, for (symb=0; symbsymbols_per_slot; symb++) { reset = 1; - x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid)); + x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid<<1)+1) +((N_n_scid<<1)+n_scid)); for (n=0; nNid_cell,fp->Nid_cell}; - int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization - nr_init_pusch_dmrs(ue, N_n_scid, n_scid); + for (int i=0; i<2; i++) { + ue->scramblingID_ulsch[i]=fp->Nid_cell; + nr_init_pusch_dmrs(ue, ue->scramblingID_ulsch[i], i); + } + // we also need to take into account the shift by samples_per_frame in case the if is true if (ue->ssb_offset < sync_pos_frame){ diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index 41cf9c2ffa..e019077efd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -32,6 +32,7 @@ #include #include "PHY/NR_REFSIG/dmrs_nr.h" #include "PHY/NR_REFSIG/ptrs_nr.h" +#include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" #include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h" #include "PHY/MODULATION/nr_modulation.h" @@ -220,6 +221,11 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, /////////////////////////DMRS Modulation///////////////////////// /////////// + if(pusch_pdu->ul_dmrs_scrambling_id != UE->scramblingID_ulsch[pusch_pdu->scid]) { + UE->scramblingID_ulsch[pusch_pdu->scid] = pusch_pdu->ul_dmrs_scrambling_id; + nr_init_pusch_dmrs(UE, pusch_pdu->scid, pusch_pdu->ul_dmrs_scrambling_id); + } + uint32_t ***pusch_dmrs = UE->nr_gold_pusch_dmrs[slot]; uint16_t n_dmrs = (pusch_pdu->bwp_start + start_rb + nb_rb)*((dmrs_type == pusch_dmrs_type1) ? 6:4); int16_t mod_dmrs[n_dmrs<<1] __attribute((aligned(16))); diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index b0568ebff5..e2777cfd4b 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -861,6 +861,9 @@ typedef struct { // Scrambling IDs used in PDSCH DMRS uint16_t scramblingID_dlsch[2]; + // Scrambling IDs used in PUSCH DMRS + uint16_t scramblingID_ulsch[2]; + /// PDCCH DMRS uint32_t ***nr_gold_pdcch[NUMBER_OF_CONNECTED_eNB_MAX]; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 44bd8f0ce3..eaafbebbbf 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -732,6 +732,11 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ? pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup : pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup; } + pusch_config_pdu->scid = 0; + pusch_config_pdu->ul_dmrs_scrambling_id = mac->physCellId; + if(*dci_format == NR_UL_DCI_FORMAT_0_1) + pusch_config_pdu->scid = dci->dmrs_sequence_initialization.val; + /* TRANSFORM PRECODING ------------------------------------------------------------------------------------------*/ if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled) { @@ -757,6 +762,14 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, LOG_D(NR_MAC,"TRANSFORM PRECODING IS ENABLED. CDM groups: %d, U: %d \n", pusch_config_pdu->num_dmrs_cdm_grps_no_data, pusch_config_pdu->dfts_ofdm.low_papr_group_number); } + else { + if (pusch_config_pdu->scid == 0 && + NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID0) + pusch_config_pdu->ul_dmrs_scrambling_id = *NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID0; + if (pusch_config_pdu->scid == 1 && + NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID1) + pusch_config_pdu->ul_dmrs_scrambling_id = *NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID1; + } /* TRANSFORM PRECODING --------------------------------------------------------------------------------------------------------*/ From 866311ac1524afa35530f024c2eb5a1d543bd17f Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Tue, 22 Feb 2022 12:11:35 +0530 Subject: [PATCH 604/883] enabled second tx thread stats --- executables/nr-gnb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 2b1c36407b..7ca416b209 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -301,7 +301,7 @@ void rx_func(void *param) { static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) { int stroff = 0; stroff += print_meas_log(gNB->phy_proc_tx[0], "L1 Tx processing thread 0", NULL, NULL, output); - //stroff += print_meas_log(gNB->phy_proc_tx[1], "L1 Tx processing thread 1", NULL, NULL, output+stroff); + stroff += print_meas_log(gNB->phy_proc_tx[1], "L1 Tx processing thread 1", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff); @@ -338,7 +338,7 @@ void *nrL1_stats_thread(void *param) { AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n"); reset_meas(gNB->phy_proc_tx[0]); - //reset_meas(gNB->phy_proc_tx[1]); + reset_meas(gNB->phy_proc_tx[1]); reset_meas(&gNB->dlsch_encoding_stats); reset_meas(&gNB->phy_proc_rx); reset_meas(&gNB->ul_indication_stats); From 57c480a8a3d49fa8d39f045b131c83d82e593a28 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Tue, 22 Feb 2022 21:09:59 +0530 Subject: [PATCH 605/883] Merged the two thread stats into a global one --- executables/nr-gnb.c | 8 ++------ openair1/PHY/defs_gNB.h | 2 +- openair1/SCHED_NR/fapi_nr_l1.c | 2 ++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 5 ++++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 7ca416b209..cf48a1c3fd 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -300,8 +300,7 @@ void rx_func(void *param) { } static void dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output) { int stroff = 0; - stroff += print_meas_log(gNB->phy_proc_tx[0], "L1 Tx processing thread 0", NULL, NULL, output); - stroff += print_meas_log(gNB->phy_proc_tx[1], "L1 Tx processing thread 1", NULL, NULL, output+stroff); + stroff += print_meas_log(&gNB->phy_proc_tx, "L1 Tx processing", NULL, NULL, output); stroff += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output+stroff); stroff += print_meas_log(&gNB->ul_indication_stats, "UL Indication", NULL, NULL, output+stroff); @@ -337,8 +336,7 @@ void *nrL1_stats_thread(void *param) { fd=fopen("nrL1_stats.log","w"); AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n"); - reset_meas(gNB->phy_proc_tx[0]); - reset_meas(gNB->phy_proc_tx[1]); + reset_meas(&gNB->phy_proc_tx); reset_meas(&gNB->dlsch_encoding_stats); reset_meas(&gNB->phy_proc_rx); reset_meas(&gNB->ul_indication_stats); @@ -450,8 +448,6 @@ void init_gNB_Tpool(int inst) { processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); init_DLSCH_struct(gNB, msgDataTx); memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); - reset_meas(&msgDataTx->phy_proc_tx); - gNB->phy_proc_tx[i] = &msgDataTx->phy_proc_tx; pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning } diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7c7d30a6e2..7d5cb285b5 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -856,7 +856,7 @@ typedef struct PHY_VARS_gNB_s { /* time_stats_t phy_proc; */ - time_stats_t *phy_proc_tx[2]; + time_stats_t phy_proc_tx; time_stats_t phy_proc_rx; time_stats_t rx_prach; /* diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 2dbaa738dc..78e722c4b5 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -166,6 +166,8 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ res = pullTpool(gNB->L1_tx_free, gNB->threadPool); processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); + merge_meas(&gNB->phy_proc_tx, &msgTx->phy_proc_tx); + msgTx->num_pdsch_slot=0; msgTx->num_dl_pdcch=0; msgTx->num_ul_pdcch=number_ul_dci_pdu; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 41f395c090..bc4493cd1c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -134,7 +134,10 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,1); - if (do_meas==1) start_meas(&msgTx->phy_proc_tx); + if (do_meas==1) { + reset_meas(&msgTx->phy_proc_tx); + start_meas(&msgTx->phy_proc_tx); + } // clear the transmit data array and beam index for the current slot for (aa=0; aacarrier_config.num_tx_ant.value; aa++) { From b9b2eb007aa77c8a6362157fc3942be7fc1ef8c6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 23 Feb 2022 22:34:35 +0100 Subject: [PATCH 606/883] Fix for nr_dlsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 046f410bd4..7363d1abd5 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -1000,7 +1000,6 @@ int main(int argc, char **argv) msgDataTx->frame = frame; memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); reset_meas(&msgDataTx->phy_proc_tx); - gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx; for (SNR = snr0; SNR < snr1; SNR += .2) { @@ -1314,7 +1313,7 @@ int main(int argc, char **argv) printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, block %d)\n", 1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex, msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3); - printDistribution(gNB->phy_proc_tx[0],table_tx,"PHY proc tx"); + printDistribution(&gNB->phy_proc_tx,table_tx,"PHY proc tx"); printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time"); printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time"); printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time"); From 8a43a0306fea55049ea79d2e003167b070d3d9c6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Feb 2022 20:55:38 +0100 Subject: [PATCH 607/883] fix nr_ulsim --- openair1/SIMULATION/NR_PHY/ulsim.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 6e9b88593c..1f17c3adce 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -683,7 +683,6 @@ int main(int argc, char **argv) notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_free,NULL); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); msgDataTx->slot = -1; - gNB->phy_proc_tx[0] = &msgDataTx->phy_proc_tx; //gNB_config = &gNB->gNB_config; //memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO)); From a0ac75a45bd40878563d44d525d2c49b41ccc3b9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Feb 2022 19:07:50 +0100 Subject: [PATCH 608/883] Delete unused files --- targets/RT/USER/lte-hwlat.c | 944 ------------------------- targets/RT/USER/lte-hwlat2.c | 1282 ---------------------------------- 2 files changed, 2226 deletions(-) delete mode 100755 targets/RT/USER/lte-hwlat.c delete mode 100644 targets/RT/USER/lte-hwlat2.c diff --git a/targets/RT/USER/lte-hwlat.c b/targets/RT/USER/lte-hwlat.c deleted file mode 100755 index 20482adf87..0000000000 --- a/targets/RT/USER/lte-hwlat.c +++ /dev/null @@ -1,944 +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 - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "assertions.h" -#include "PHY/types.h" - -#include "PHY/defs.h" - -#include -#define GET_TIME_INIT(num) struct timeval _timers[num] -#define GET_TIME_VAL(num) gettimeofday(&_timers[num], NULL) -#define TIME_VAL_TO_MS(num) (((double)_timers[num].tv_sec*1000.0) + ((double)_timers[num].tv_usec/1000.0)) - -#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all -//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all - -#include "../../ARCH/COMMON/common_lib.h" - -#include "PHY/extern.h" -#include "SCHED/extern.h" -#include "LAYER2/MAC/extern.h" -#include "LAYER2/MAC/proto.h" - -#define SYRIQ_CHANNEL_TESTER 0 -#define SYRIQ_CHANNEL_TESTER2 0 -#define SYRIQ_CHANNEL_DATA1 1 - -volatile int oai_exit = 0; - -openair0_config_t openair0_cfg[MAX_CARDS]; - -#if 0 -#define NB_ANTENNAS_RX 4 - -#define DevAssert(cOND) _Assert_(cOND, _Assert_Exit_, "") -#define malloc16(x) memalign(16,x) - -#ifdef 0 -static inline void* malloc16_clear( size_t size ) -{ -#ifdef __AVX2__ - void* ptr = memalign(32, size); -#else - void* ptr = memalign(16, size); -#endif - if(ptr) - memset( ptr, 0, size ); - return ptr; -} -#endif - -#endif - -typedef struct latency_stat { - uint64_t counter; - - uint64_t stat250; - uint64_t stat500; - uint64_t stat600; - uint64_t stat700; - uint64_t stat800; - - uint64_t stat1300; - uint64_t stat1500; - uint64_t stat2000; - uint64_t stat2500; - uint64_t stat3000; - - uint64_t stat880; - uint64_t stat960; - uint64_t stat1040; - uint64_t stat1120; - uint64_t stat1200; -} latency_stat_t; - - -typedef struct timing_stats { - char *name; - double min; - double max; - double total; - unsigned int count; -} timing_stats_t; - - -//static struct timespec get_timespec_diff( -// struct timespec *start, -// struct timespec *stop ) -//{ -// struct timespec result; -// -// if ( ( stop->tv_nsec - start->tv_nsec ) < 0 ) { -// result.tv_sec = stop->tv_sec - start->tv_sec - 1; -// result.tv_nsec = stop->tv_nsec - start->tv_nsec + 1000000000; -// } -// else { -// result.tv_sec = stop->tv_sec - start->tv_sec; -// result.tv_nsec = stop->tv_nsec - start->tv_nsec; -// } -// -// return result; -//} - - -//static void measure_time ( -// openair0_device *rf_device, -// struct timespec *start, -// struct timespec *stop, -// timing_stats_t *stats, -// boolean_t START, -// uint8_t PRINT_INTERVAL ) -//{ -// if ( START ) { -// clock_gettime( CLOCK_MONOTONIC, start ); -// } -// else { -// clock_gettime( CLOCK_MONOTONIC, stop ); -// -// struct timespec diff; -// double current = 0; -//// boolean_t show_stats = false; -// -// diff = get_timespec_diff( start, stop ); -// current = (double)diff.tv_sec * 1000000 + (double)diff.tv_nsec / 1000; -// -// if ( current > stats->max ) { -// stats->max = current; -//// show_stats = true; -// } -// if ( stats->min == 0 || current < stats->min ) { -// stats->min = current; -//// show_stats = true; -// } -// stats->total += current; -// -//// if ( show_stats ) { -//// rf_device.trx_get_stats_func( &rf_device ); -//// } -// -//// if ( stats->count % PRINT_INTERVAL == 0 ) { -//// double avg = stats->total / ( stats->count + 1 ); -//// printf( "[%s][%d] Current : %.2lf µs, Min : %.2lf µs, Max : %.2lf µs, Avg : %.2lf µs\n", -//// stats->count, stats->name, current, stats->min, stats->max, avg ); -//// } -// -// stats->count++; -// } -//} -int32_t **rxdata; -int32_t **txdata; - -int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg); - -static inline void saif_meas(unsigned int frame_rx, unsigned int subframe_rx) { - static latency_stat_t __thread latency_stat; - static struct timespec __thread last= {0}; - struct timespec now; - clock_gettime(CLOCK_MONOTONIC_RAW, &now); - if ( last.tv_sec ) { - uint64_t diffTime = ((uint64_t)now.tv_sec *1000 *1000 *1000 + now.tv_nsec) - - ((uint64_t)last.tv_sec *1000 *1000 *1000 + last.tv_nsec); - diffTime/=1000; - latency_stat.counter++; - - if ( diffTime <= 800 ) { - if (diffTime < 250 ) - latency_stat.stat250++; - else if (diffTime < 500 ) - latency_stat.stat500++; - else if (diffTime < 600 ) - latency_stat.stat600++; - else if (diffTime < 700 ) - latency_stat.stat700++; - else - latency_stat.stat800++; - } - else if ( diffTime > 1200 ) { - if (diffTime < 1500 ) - latency_stat.stat1300++; - else if ( diffTime < 2000 ) - latency_stat.stat1500++; - else if ( diffTime < 2500 ) - latency_stat.stat2000++; - else if ( diffTime < 3000 ) - latency_stat.stat2500++; - else - latency_stat.stat3000++; - } - else - if (diffTime <= 880 ) - latency_stat.stat880++; - else if (diffTime <= 960 ) - latency_stat.stat960++; - else if (diffTime <= 1040 ) - latency_stat.stat1040++; - else if (diffTime < 1120 ) - latency_stat.stat1120++; - else - latency_stat.stat1200++; - - - if ( (diffTime>=1500) || ( !(frame_rx%1024) && subframe_rx == 0 ) ) { - time_t current=time(NULL); - printf("\n"); - printf("%.2f Period stats cnt=%7.7ld 0.. 250=%7.7ld 250.. 500=%7.7ld 500.. 600=%7.7ld 600.. 700=%7.7ld 700.. 800=%7.7ld - (frame_rx=%u) - %s", - now.tv_sec+(double)now.tv_nsec/1e9, - latency_stat.counter, - latency_stat.stat250, latency_stat.stat500, - latency_stat.stat600, latency_stat.stat700, - latency_stat.stat800, - frame_rx, - ctime(¤t)); - printf("%.2f Period stats cnt=%7.7ld 800.. 880=%7.7ld 880.. 960=%7.7ld 960..1040=%7.7ld 1040..1120=%7.7ld 1120..1200=%7.7ld - (frame_rx=%u) - %s", - now.tv_sec+(double)now.tv_nsec/1e9, - latency_stat.counter, - latency_stat.stat880, latency_stat.stat960, - latency_stat.stat1040, latency_stat.stat1120, - latency_stat.stat1200, - frame_rx, - ctime(¤t)); - printf("%.2f Period stats cnt=%7.7ld 1200..1300=%7.7ld 1300..1500=%7.7ld 1500..2000=%7.7ld 2000..2500=%7.7ld >3000=%7.7ld - (frame_rx=%u) - %s", - now.tv_sec+(double)now.tv_nsec/1e9, - latency_stat.counter, - latency_stat.stat1300, latency_stat.stat1500, - latency_stat.stat2000, latency_stat.stat2500, - latency_stat.stat3000, - frame_rx, - ctime(¤t)); - fflush(stdout); - } - } - last=now; -} -/* End of Changed by SYRTEM */ - -void exit_fun(const char* s) -{ - - if (s != NULL) { - printf("%s %s() Exiting OAI softmodem: %s\n",__FILE__, __FUNCTION__, s); - } - - oai_exit = 1; - -} - - -void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, char * name) { - -#ifdef DEADLINE_SCHEDULER - if (sched_runtime!=0) { - struct sched_attr attr= {0}; - attr.size = sizeof(attr); - // This creates a .5 ms fpga_recv_cnt reservation - attr.sched_policy = SCHED_DEADLINE; - attr.sched_runtime = sched_runtime; - attr.sched_deadline = sched_deadline; - attr.sched_period = 0; - AssertFatal(sched_setattr(0, &attr, 0) == 0, - "[SCHED] main eNB thread: sched_setattr failed %s \n",perror(errno)); - LOG_I(HW,"[SCHED][eNB] eNB main deadline thread %lu started on CPU %d\n", - (unsigned long)gettid(), sched_getcpu()); - } - -#else -#ifdef CPU_AFFINITY - if (get_nprocs() >2) { - for (j = 1; j < get_nprocs(); j++) - CPU_SET(j, &cpuset); - } - AssertFatal( 0 == pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)==0,""); -#endif - struct sched_param sp; - sp.sched_priority = sched_fifo; - AssertFatal(pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp)==0, - "Can't set thread priority, Are you root?\n"); -#endif - - // Lock memory from swapping. This is a process wide call (not constraint to this thread). - mlockall(MCL_CURRENT | MCL_FUTURE); - pthread_setname_np( pthread_self(), name ); - -} - - -int main(void) -{ - int ret; - uint64_t i; - openair0_device rf_device; - openair0_timestamp timestamp = 0; - - unsigned int sub_frame = 0; - unsigned int frame_rx = 0; - - unsigned int nb_antennas_tx = 1; - unsigned int nb_antennas_rx = 1; - - - openair0_cfg[0].mmapped_dma = 0; - openair0_cfg[0].configFilename = NULL; - openair0_cfg[0].duplex_mode = duplex_mode_FDD; - - uint32_t **sendbuff = NULL; - uint32_t **recvbuff = NULL; - uint32_t expected_value = 0; - uint32_t received_value = 0; - int nsamp = 0; // 1 ms - int antenna_id = 1; - int c = 0; - int numIter = 0; - int fpga_loop = 0; -#if SYRIQ_CHANNEL_DATA1 - uint64_t first_ts = 0; - uint8_t is_first_ts = 0; - uint64_t trx_read_cnt = 0; - uint32_t j = 0; - uint32_t err_cnt = 0; -#else - int failure = 0; -#endif -#if 0 // 5MHz BW - unsigned int nb_sample_per_tti = 7680; - openair0_cfg[0].sample_rate = 7.68e6; - openair0_cfg[0].samples_per_frame = nb_sample_per_tti*10; - openair0_cfg[0].rx_bw = 2.5e6; - openair0_cfg[0].tx_bw = 2.5e6; - openair0_cfg[0].num_rb_dl = 25; -#endif - -#if 0 // 10MHz BW - unsigned int nb_sample_per_tti = 15360; - openair0_cfg[0].sample_rate = 15.36e6; - openair0_cfg[0].samples_per_frame = nb_sample_per_tti*10; - openair0_cfg[0].rx_bw = 5.0e6; - openair0_cfg[0].tx_bw = 5.0e6; - openair0_cfg[0].num_rb_dl = 50; -#endif - -#if 1 // 20MHz BW - unsigned int nb_sample_per_tti = 30720; - openair0_cfg[0].sample_rate = 30.72e6; - openair0_cfg[0].samples_per_frame = nb_sample_per_tti*10; - openair0_cfg[0].rx_bw = 10.0e6; - openair0_cfg[0].tx_bw = 10.0e6; - openair0_cfg[0].num_rb_dl = 100; -#endif - - const char *openair_dir = getenv("OPENAIR_DIR"); - const char *ini_file = "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR20.dat"; - - int readBlockSize; - void* rxp[nb_antennas_rx]; - void* txp[nb_antennas_tx]; - -// int32_t rxdata[1][nb_sample_per_tti*10+2048]; -#if 0 - int32_t **rxdata; -#endif -// init_thread(100000, 500000, sched_get_priority_max(SCHED_FIFO),"main UE"); - - printf("LTE HARDWARE Latency debug utility \n"); - printf("INIT data buffers \n"); - -#if 0 - rxdata = (int32_t**)memalign(32, nb_antennas_rx*sizeof(int32_t*) ); - rxdata[0] = (int32_t*)memalign(32,(nb_sample_per_tti*10+2048)*sizeof(int32_t)); -#else - rxdata = (int32_t**)malloc16( nb_antennas_rx*sizeof(int32_t*) ); - txdata = (int32_t**)malloc16( nb_antennas_tx*sizeof(int32_t*) ); - rxdata[0] = (int32_t*)malloc16_clear( 307200*sizeof(int32_t) ); - txdata[0] = (int32_t*)malloc16_clear( 307200*sizeof(int32_t) ); -#endif - - printf("INIT done\n"); - - memset(&rf_device, 0, sizeof(openair0_device)); - - rf_device.host_type = BBU_HOST; - openair0_cfg[0].duplex_mode = duplex_mode_FDD; - openair0_cfg[0].rx_num_channels = 1; - openair0_cfg[0].tx_num_channels = 1; - - // configure channel 0 - for (i=0; i= 2-307200 -> check expected value + status (RxoVer TxUnder) - - rxp[0] = (void*)&rxdata[0][0]; - txp[0] = (void*)&txdata[0][0]; - timestamp = 0; - nsamp = 30720; // 30720 => 1ms buffer - trx_read_cnt = 100000; // 1 loop => 1ms (10sec=10000; 15min = 900000) - antenna_id = 1; - int diff = 0; - int compare_start = 0; - - uint32_t looploop=0; - uint64_t error_cnt = 0; - uint64_t error_ts_start; - - for (i = 0; i < trx_read_cnt; i++) - { - -// printf("\n\n"); - - -// ret = rf_device.trx_read_func( &rf_device, ×tamp, &(rxp[0][(i*30720)%307200]), nsamp, antenna_id ); -// ret = rf_device.trx_read_func( &rf_device, ×tamp, recvbuff[0][(i*30720)%307200], nsamp, antenna_id ); - rxp[0] = (void*)&rxdata[0][(i*30720)%307200]; - GET_TIME_VAL(0); - ret = rf_device.trx_read_func( &rf_device, ×tamp, rxp, nsamp, antenna_id ); - GET_TIME_VAL(1); - - if (ret != nsamp) - { - printf("Error: nsamp received (%d) != nsamp required (%d)\n", ret, nsamp); - fflush(stdout); - return (-1); - } - if (!is_first_ts) - { - first_ts = timestamp; - is_first_ts = 1; - } - -// printf("%d - trx_read_func ret=%d - ts = %d - @=0x%08lx\n", i, ret, timestamp, rxp[0] ); - - txp[0] = (void*)&(txdata[0][ ((i*30720)%307200+2*30720)%307200 ]); -// printf(" i=%d @txp[0][0] = 0x%016lx\n", i, &(((uint32_t *)txp[0])[0]) ); -// printf(" i=%d @txp[0][1] = 0x%016lx\n", i, &(((uint32_t *)txp[0])[1]) ); - - for ( c = 0; c < nsamp; c++ ) - { - (((uint32_t *)txp[0])[c]) = ( (((timestamp+c+2*30720)<<4)&0x0000FFF0) + (((timestamp+c+2*30720)<<8)&0xFFF00000) ); - } - -// printf(" txp[0][%d] = 0x%x\n",0,((uint32_t *)(txp[0]))[0]); -// printf(" txp[0][%d] = 0x%x\n",1,((uint32_t *)(txp[0]))[1]); -// printf(" ...\n"); -// printf(" txp[0][%d] = 0x%x\n",nsamp-2,((uint32_t *)(txp[0]))[nsamp-2]); -// printf(" txp[0][%d] = 0x%x\n",nsamp-1,((uint32_t *)(txp[0]))[nsamp-1]); - - - ret = rf_device.trx_write_func( &rf_device, (timestamp+2*30720), txp, nsamp, antenna_id, false ); - if (ret != nsamp) - { - printf("Error: nsamp sent (%d) != nsamp required (%d)\n", ret, nsamp); - fflush(stdout); - return (-1); - } - -// printf("%d - trx_write_func ret=%d - ts = %d - @=0x%08lx\n", i, ret, (timestamp+2*30720), txp[0] ); - - - if (timestamp >= (first_ts + 2 * 307200)) - { - - // check Rx Overflow - - // check Tx Underflow - - // check Expected Value - for ( c = 0; c < nsamp; c++ ) - { - -// LOOPBACK -#if 1 - expected_value = ((timestamp + c)&0xFFFFFF); - received_value = ((uint32_t *)(rxp[0]))[c]; - received_value = ((received_value)&0xFFF) + ((received_value>>4)&0xFFF000); - - if (compare_start == 0) - { - compare_start = 1; - diff = expected_value - received_value; - } - received_value = (received_value + diff)&0xFFFFFF; - -#if 1 - - if (expected_value != received_value) - { - if(!error_cnt) - error_ts_start = (timestamp + c); - else - { - if (looploop < 32) - printf("%d - %d != %d - ts %d - raw 0x%x - diff %d\n", - looploop, - expected_value, received_value, - (timestamp + c), ((uint32_t *)(rxp[0]))[c], - diff); - looploop++; - } - - error_cnt++; - - if(!(error_cnt%102400)) - printf(" -> error detected : cnt=%d - start=%ld - stop=... diff=%d\n", - error_cnt, - error_ts_start, - diff); - - } - else - { - if(error_cnt) - { - printf(" -> error detected : cnt=%d - start=%ld - stop=%ld\n\n", - error_cnt, - error_ts_start, - (timestamp + c) ); - looploop=0; - } - error_cnt=0; - } -#endif -#endif - -// DEBUG mode 0 -#if 0 - received_value = ((uint32_t *)(rxp[0]))[c]; - received_value = ((received_value)&0xFFF) + ((received_value>>4)&0xFFF000); - received_value = (received_value&0xFFFFFF); - if (compare_start == 0) - { - compare_start = 1; - expected_value = received_value; - } - else - { - expected_value++; - expected_value = (expected_value&0xFFFFFF); - } - - if (expected_value != received_value) - { - if(!error_cnt) - error_ts_start = (timestamp + c); - error_cnt++; - } - else - { - if(error_cnt) - { - printf(" -> error detected : cnt=%d - start=%ld - stop=%ld\n\n", - error_cnt, - error_ts_start, - (timestamp + c) ); - } - error_cnt=0; - } - - - -// if (expected_value != received_value) -// { -// printf("%d -> %d != %d (ts+c=%ld)(raw=0x%08x)\n", -// looploop, -// expected_value, received_value, -// (timestamp + c), -// ((uint32_t *)(rxp[0]))[c] ); -// -// if (received_value) -// expected_value = received_value; -// } -#endif - - } - } - } - - printf("HwLat Application returns !!!\n"); - fflush(stdout); - sleep(1); - - - printf("\n"); - rf_device.trx_end_func( &rf_device ); - - sleep(1); - free(sendbuff[0]); - free(sendbuff); - free(recvbuff[0]); - free(recvbuff); - - exit(0); - - - - return(0); - - - -// puts( "* Frequency modification test" ); -// rf_device.trx_set_freq_func( &rf_device, &openair0_cfg[0], 0 ); - -// puts( "* Gain modification test" ); -// rf_device.trx_set_gains_func( &rf_device, &openair0_cfg[0] ); // NOT working (cf. initialization) - -//#if LTE_UE -// sleep(1); - GET_TIME_VAL(0); - for (i = 0; i < trx_read_cnt; i++) - { - printf("\n"); - ret = rf_device.trx_read_func( &rf_device, ×tamp, rxp, nsamp, antenna_id ); - printf("* timestamp=%ld\n", timestamp); -#if 1 - for (j = 0; j < nsamp; j++) - { - if ( ((uint32_t *)rxp[0])[j] != ((expected_value + j + timestamp)%307200) ) - { - err_cnt++; - printf("rxp[%06d]=0x%08x (expected 0x%08lx)\n", j, ((uint32_t *)rxp[0])[j], ((expected_value + j + timestamp)%307200) ); - } - if (err_cnt >= 128) - { - printf("Error: more than 128 expected value failed !\n"); - i = (trx_read_cnt - 1); - j = nsamp; - break; - } - } - //expected_value = (expected_value + nsamp)%307200; - expected_value = (expected_value)%307200; -#endif - } - GET_TIME_VAL(1); -//#endif - -/* ********** ********** */ -/* SYRIQ_CHANNEL_DATA1 */ -/* ********** ********** */ -#if SYRIQ_CHANNEL_DATA1 - -// rf_device.trx_get_stats_func( &rf_device ); - - rf_device.trx_end_func( &rf_device ); - - printf("\n* rf_device.trx_read_func(%d) x %d: %.6lf s\n\n", nsamp, i, ((TIME_VAL_TO_MS(1) - TIME_VAL_TO_MS(0)))/1000.0 ); - -// rf_device.trx_get_stats_func( &rf_device ); - -#if 0 - for (i = 0; i < nsamp; i++) - { -// if ( ((uint32_t *)rxp[0])[i] != i) -// { - err_cnt++; - printf("rxp[%06d]=0x%08x (expected 0x%08x)\n", i, ((uint32_t *)rxp[0])[i], i); -// } -// if (err_cnt > 256) -// { -// i = 307200; -// break; -// } - } -#endif -// for (i = 1024-32; i < 1024+32; i++) -// { -//// if ( ((uint32_t *)rxp[0])[i] != i) -//// { -// err_cnt++; -// printf("rxp[%06d]=0x%08x (expected 0x%08x)\n", i, ((uint32_t *)rxp[0])[i], i); -//// } -// if (err_cnt > 256) -// { -// i = 307200; -// break; -// } -// } - printf("SYRIQ CHANNEL DATA1 done !!!\n"); - sleep(1); - return(0); -#endif -/* ********** ********** */ -/* SYRIQ_CHANNEL_DATA1 */ -/* ********** ********** */ - - - - timestamp = 0; - ret = rf_device.trx_write_func( &rf_device, timestamp, (void**)sendbuff, nsamp, antenna_id, false ); - printf("* rf_device.trx_write_func returns %d\n", ret); - - sleep(1); - - nsamp = 30720; - numIter = 100000; - for ( c = 0; c < numIter; c++ ) - { - fpga_loop ++; - if ( !(fpga_loop % 1000) ) - { - printf("\rtest loop %d / %d", fpga_loop, numIter); - fflush(stdout); - } - -// printf("* TEST : %08d\n", (c+1)); -// measure_time( &rf_device, &start, &stop, &tx_stats, true, 10 ); -// ret = rf_device.trx_write_func( &rf_device, timestamp, (void**)sendbuff, nsamp, antenna_id, false ); -// printf("* rf_device.trx_write_func returns %d\n", ret); -// measure_time( &rf_device, &start, &stop, &tx_stats, false, 10 ); - -// sleep(1); - -// measure_time( &rf_device, &start, &stop, &tx_stats, true, 10 ); - ret = rf_device.trx_read_func( &rf_device, ×tamp, (void**)recvbuff, nsamp, antenna_id ); -// measure_time( &rf_device, &start, &stop, &tx_stats, false, 10 ); - - // Check the data - if (ret > 0) - { -/* ********** ********** */ -/* SYRIQ_CHANNEL_TESTER */ -/* ********** ********** */ -#if SYRIQ_CHANNEL_TESTER - failure = 0; - for (i = 0; i < ret; i++) - { - if ( ((i%1024) == 0) || ((i%1024) == 1) || ((i%1024) == 2) || ((i%1024) == 3) ) - { - if ( (recvbuff[0])[i] != (1020 + ((i%1024)+1)) ) - { - printf("* ERROR (buff[0])[%d]: %d, expected %d\n", i, (uint32_t)(recvbuff[0])[i], ((i%1024)+1) ); - failure = 1; - } - } - else if ( (recvbuff[0])[i] != ((i%1024)+1) ) - { - printf("* ERROR (buff[0])[%d]: %d, expected %d\n", i, (uint32_t)(recvbuff[0])[i], ((i%1024)+1) ); - failure = 1; - } - else - { - printf("* DONE (buff[0])[%d]: %d, expected %d\n", i, (uint32_t)(recvbuff[0])[i], ((i%1024)+1) ); - } - if(failure) - break; - } - if (failure) - printf("* ERROR recv %08d checked FAILURE ret=%d\n", (c+1), ret); - else - { -// printf("* DONE recv %08d checked SUCCESSFULLY ret=%d\n", (c+1), ret); - } -#endif -/* ********** ********** */ -/* SYRIQ_CHANNEL_TESTER2*/ -/* ********** ********** */ -#if SYRIQ_CHANNEL_TESTER2 -// printf("* ret=%d timestamp=%ld (%ld)\n", ret, timestamp, (timestamp%307200)); - failure = 0; - for (i = 0; i < ret; i++) - { -// printf("* (recvbuff[0])[%d]: %d\n", i, (uint32_t)(recvbuff[0])[i]); -// printf("* timestamp+(i/1024+1)*1024 - 3 + i%1024: %d\n", (timestamp-nsamp+(i/1024+1)*1024 - 3 + i%1024)%307200 ); - expected_value = ((((i%1024)+1)/*>>4*/)&0x00000FFF); - if ( ((i%1024) == 0) || ((i%1024) == 1) || ((i%1024) == 2) || ((i%1024) == 3) ) - { - expected_value = ((((timestamp-nsamp+(i/1024+1)*1024 - 3 + i%1024))%307200)); - if ( (recvbuff[0])[i] != expected_value) - { - if ( (expected_value == 0) && ((recvbuff[0])[i] != 4915200) ) - { - printf("* ERROR (buff[0])[%d]: %d, expected %d\n", i, (uint32_t)(recvbuff[0])[i], expected_value ); - failure = 1; - } - if ( (expected_value == 0) && ((recvbuff[0])[i] == 4915200) ) - { -// printf("* DONE loop in circular buffer\n"); - } - } - } - else if ( (recvbuff[0])[i] != expected_value ) - { - printf("* ERROR (buff[0])[%d]: %d, expected %d\n", i, (uint32_t)(recvbuff[0])[i], ((i%1024)+1) ); - failure = 1; - } - else - { -// printf("* DONE (buff[0])[%d]: %d, expected %d\n", i, (uint32_t)(recvbuff[0])[i], ((i%1024)+1) ); - } -// if(failure) -// break; - } - if (failure) - printf("* ERROR recv %08d checked FAILURE ret=%d\n", (c+1), ret); - else - { -// printf("* DONE recv %08d checked SUCCESSFULLY ret=%d\n", (c+1), ret); - } -#endif -#if LOOPBACK - -#endif - } - else - { - printf("* ERROR rf_device.trx_read_func returns %d\n", ret); - } - - } - printf("\n"); - rf_device.trx_end_func( &rf_device ); - - sleep(1); - free(sendbuff[0]); - free(sendbuff); - free(recvbuff[0]); - free(recvbuff); - - exit(0); - -// END IS HERE ! - - rf_device.trx_set_freq_func(&rf_device,&openair0_cfg[0],0); - - if (rf_device.trx_start_func(&rf_device) != 0 ) { - printf("Could not start the device\n"); - oai_exit=1; - } - - while(!oai_exit){ - - rxp[0] = (void*)&rxdata[0][sub_frame*nb_sample_per_tti]; - - readBlockSize = rf_device.trx_read_func(&rf_device, - ×tamp, - rxp, - nb_sample_per_tti, - 0); - - if ( readBlockSize != nb_sample_per_tti ) - oai_exit = 1; - - sub_frame++; - sub_frame%=10; - - if( sub_frame == 0) - frame_rx++; - - saif_meas(frame_rx, sub_frame); - } - - return(0); -} diff --git a/targets/RT/USER/lte-hwlat2.c b/targets/RT/USER/lte-hwlat2.c deleted file mode 100644 index 85ec61e44f..0000000000 --- a/targets/RT/USER/lte-hwlat2.c +++ /dev/null @@ -1,1282 +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 - */ - - -/* ************************************************************************************************* - - USER GUIDE - - 1 - CONFIGURE TEST SESSION - see TESTS PARAMETERS section below - - 2 - COMPILATION CMD LINE (same as openair compilation) - - NO AVX SUPPORT - /usr/bin/cc -msse4.1 -mssse3 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -g -DMALLOC_CHECK_=3 -O2 -o lte-hwlat-test lte-hwlat2.c -lrt -lpthread -lm -ldl - - AVX2 Support - /usr/bin/cc -mavx2 -msse4.1 -mssse3 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -g -DMALLOC_CHECK_=3 -O2 -o lte-hwlat-test lte-hwlat2.c -lrt -lpthread -lm -ldl - - - 3 - RUN - sudo cset shield --force --kthread on -c 1-3 // for 4 cores - sudo cset shield --force --kthread on -c 1-7 // for 8 cores - sudo cset shield ./lte-hwlat-test - - 4 - remove cset shield - sudo cset shield --reset - - ***************************************************************************************************/ - -/* ************************************************************************************************* - * TESTS PARAMETERS - */ -#define HWLAT_LOOP_CNT 1000000 /* measurment loop count for each thread*/ -#define HWLAT_TTI_SLEEP_US 250 /* usleep duration -> IQ capture simulation (in µ seconds) */ - -#define RX_NB_TH 6 - -#define CALIB_RT_INTRUMENTATION 0 - -/* Laurent Thpmas instrumentation -> see openair2/UTIL/LOG/log.h for full implementation - -> This is a copy and paste implementation in this file for a self contained source */ -#define INSTRUMENTATION_LT_RDTSC 1 -/* SYRTEM rdtsc instrumentation implementation (see below for more infaormation) */ -#define INSTRUMENTATION_SYR_RDTSC 2 -/* SYRTEM instrumentation using clock_gettime MONOTONIC */ -#define INSTRUMENTATION_SYR_CLOCK_MONO 3 -/* SYRTEM instrumentation using clock_gettime REALTIME */ -#define INSTRUMENTATION_SYR_CLOCK_REALTIME 4 - -#define HWLAT_INSTRUMENTATION INSTRUMENTATION_LT_RDTSC - - -/* Statistics histogram output */ -#define HISTOGRAM_MIN_VALUE 0 -#define HISTOGRAM_MAX_VALUE 2000 -#define HISTOGRAM_STEP 1 -#define HISTOGRAM_SIZE ( ( ( HISTOGRAM_MAX_VALUE - HISTOGRAM_MIN_VALUE ) / HISTOGRAM_STEP ) + 1 ) - - - -/* *************************************************************************************************/ - - -/* - * INCLUDES - */ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* For SYS_xxx definitions */ -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS -#endif -#include - - -/* From rt_wrapper.h -****************************************************************************************/ -#define gettid() syscall(__NR_gettid) // for gettid - -/* From common/utils/itti/assertions.h -****************************************************************************************/ -# define display_backtrace() - -#define _Assert_Exit_ \ -{ \ - fprintf(stderr, "\nExiting execution\n"); \ - display_backtrace(); \ - fflush(stdout); \ - fflush(stderr); \ - exit(EXIT_FAILURE); \ -} - -#define _Assert_(cOND, aCTION, fORMAT, aRGS...) \ -do { \ - if (!(cOND)) { \ - fprintf(stderr, "\nAssertion ("#cOND") failed!\n" \ - "In %s() %s:%d\n" fORMAT, \ - __FUNCTION__, __FILE__, __LINE__, ##aRGS); \ - aCTION; \ - } \ -} while(0) - -#define AssertFatal(cOND, fORMAT, aRGS...) _Assert_(cOND, _Assert_Exit_, fORMAT, ##aRGS) - - -/* From "openair1/PHY/TOOLS/time_meas.h" -****************************************************************************************/ -double cpu_freq_GHz; - - -typedef struct { - - long long in; - long long diff; - long long diff_now; - long long p_time; /*!< \brief absolute process duration */ - long long diff_square; /*!< \brief process duration square */ - long long max; - int trials; - int meas_flag; -} time_stats_t; - -static inline unsigned long long rdtsc_oai(void) __attribute__((always_inline)); -static inline unsigned long long rdtsc_oai(void) -{ - unsigned long long a, d; - __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); - return (d<<32) | a; -} - -double get_cpu_freq_GHz(void); - -static inline void reset_meas(time_stats_t *ts) { - - ts->trials=0; - ts->diff=0; - ts->diff_now=0; - ts->p_time=0; - ts->diff_square=0; - ts->max=0; - ts->meas_flag=0; - -} - -double estimate_MHz_syr(void); -static __inline__ uint64_t pickCyclesStart(void); -static __inline__ uint64_t pickCyclesStop(void); - - -/* From "openair2/UTIL/LOG/log.h" -****************************************************************************************/ -extern double cpuf; -extern double cpu_mhz_syr; - - -static __inline__ uint64_t rdtsc(void) { - uint64_t a, d; - __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); - return (d<<32) | a; -} - -typedef struct m { - uint64_t iterations; - uint64_t sum; - uint64_t maxArray[11]; -} Meas; - -static inline void printMeas(char * txt, Meas *M, int period) { - if (M->iterations%period == 0 ) { - char txt2[512]; - sprintf(txt2,"%s avg=%" PRIu64 " iterations=%" PRIu64 " max=%" - PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 "\n", - txt, - M->sum/M->iterations, - M->iterations, - M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5], - M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]); -// SYRTEM : just use printf do not include all LOG_X for this test -//#if DISABLE_LOG_X - printf("%s",txt2); -//#else -// LOG_W(PHY, "%s",txt2); -//#endif - } -} - -static inline int cmpint(const void* a, const void* b) { - uint64_t* aa=(uint64_t*)a; - uint64_t* bb=(uint64_t*)b; - return (int)(*aa-*bb); -} - -static inline uint64_t updateTimes(uint64_t start, Meas *M, int period, char * txt) { - if (start!=0) { - uint64_t end=rdtsc(); - long long diff=(end-start)/(cpuf*1000); - M->maxArray[0]=diff; - M->sum+=diff; - M->iterations++; - qsort(M->maxArray, 11, sizeof(uint64_t), cmpint); -// printMeas(txt,M,period); // SYRTEM : Printed only a the end of the measurment loop - return diff; - } - return 0; -} - -static inline uint64_t updateTimes_syr(uint64_t start, Meas *M, int period, char * txt) { - if (start!=0) { -// uint64_t end=rdtsc(); - uint64_t end=pickCyclesStop(); - long long diff=(long long)((double)(end-start)/(cpu_mhz_syr)); -// long long diff=(end-start)/(cpuf*1000); - M->maxArray[0]=diff; - M->sum+=diff; - M->iterations++; - qsort(M->maxArray, 11, sizeof(uint64_t), cmpint); -// printMeas(txt,M,period); // SYRTEM : Printed only a the end of the measurment loop - return diff; - } - return 0; -} - - - - -#define initRefTimes(a) static __thread Meas a= {0} -#define pickTime(a) uint64_t a=rdtsc() -#define pickTime_syr(a) uint64_t a=pickCyclesStart() -#define readTime(a) a - - - - - - -/* - * DEFINES - */ - -#define TIMESPEC_TO_DOUBLE_US( t ) ( ( (double)t.tv_sec * 1000000 ) + ( (double)t.tv_nsec / 1000 ) ) - -typedef struct histo_time { - double max; - unsigned int count; -} histo_time_t; - -static void measure_time ( struct timespec *start, struct timespec *stop, uint8_t START, uint16_t PRINT_INTERVAL ); -static struct timespec get_timespec_diff( struct timespec *start, struct timespec *stop ); -void histogram_save_in_csv( histo_time_t *histo , char *file_prefix); -histo_time_t *histogram_init( histo_time_t *histo ); -void histogram_store_value( histo_time_t *histo, double value ); - - -#define FIFO_PRIORITY 40 - - - -#define true 1 -#define false 0 - - - - -/* - * STRUCTURES - */ - - -/* stub of UE_rxtx_proc full structure in openair1/PHY/defs.h -*/ -typedef struct UE_rxtx_proc { - int instance_cnt_rxtx; - pthread_t pthread_rxtx; - pthread_cond_t cond_rxtx; - pthread_mutex_t mutex_rxtx; - - - int sub_frame_start; - int sub_frame_step; - unsigned long long gotIQs; - - - unsigned long syr_rdtsc_rxtx_th_unlock_iteration; - uint64_t syr_rdtsc_ue_th_got_iq; - double syr_rdtsc_rxtx_th_unlock; - double syr_rdtsc_rxtx_th_unlock_max; - double syr_rdtsc_rxtx_th_unlock_mean; - double syr_rdtsc_rxtx_th_unlock_min; - histo_time_t *syr_rdtsc_rxtx_th_unlock_histogram; - -} UE_rxtx_proc_t; - - - -/* this structure is used to pass both UE phy vars and - * proc to the function UE_thread_rxn_txnp4 - */ -struct rx_tx_thread_data { - /* PHY_VARS_UE *UE; */ // UE phy vars not used for this test - UE_rxtx_proc_t *proc; // We use a stub of rxtx_proc see definition above -}; - - -// ODD / EVEN Scheduling -#if 0 -typedef struct threads_s { - int iq; - int odd; - int even; -} threads_t; -threads_t threads = { -1, -1, -1 }; // Core number for each thread (iq=3, even=2, odd=1) -#endif - -// SLOT 0 / SLOT 1 parallelization -typedef struct threads_s { - int iq; - int one; - int two; - int three; - int four; - int five; - int six; - int slot1_proc_one; - int slot1_proc_two; - int slot1_proc_three; -} threads_t; -threads_t threads= {7,6,5,4,3,2,1,-1,-1,-1}; - -/* - * FUNCTIONS DEFINITION - */ - -void *UE_thread(void *arg); -void init_UE(int nb_inst); - - - -/* - * GLOBALS VARIABLES - */ - -volatile int oai_exit = 0; -int th_count = 0; -double cpuf; -double cpu_mhz_syr; - - - - - - - -pthread_t pthread_ue; -pthread_attr_t attr_ue; - -UE_rxtx_proc_t **rxtx_proc; - -struct timespec even_start, even_stop; -struct timespec odd_start, odd_stop; - -histo_time_t *th_wake_histogram; - - -/* - * FUNCTIONS - */ - - - -void exit_fun(const char* s) { - if ( s != NULL ) { - printf("%s %s() Exiting OAI softmodem: %s\n",__FILE__, __FUNCTION__, s); - } - - oai_exit = 1; -} - - - - -void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char * name) { - -#ifdef DEADLINE_SCHEDULER - if (sched_runtime!=0) { - struct sched_attr attr= {0}; - attr.size = sizeof(attr); - attr.sched_policy = SCHED_DEADLINE; - attr.sched_runtime = sched_runtime; - attr.sched_deadline = sched_deadline; - attr.sched_period = 0; - AssertFatal(sched_setattr(0, &attr, 0) == 0, - "[SCHED] %s thread: sched_setattr failed %s \n", name, strerror(errno)); - LOG_I(HW,"[SCHED][eNB] %s deadline thread %lu started on CPU %d\n", - name, (unsigned long)gettid(), sched_getcpu()); - } - -#else - if (CPU_COUNT(cpuset) > 0) - AssertFatal( 0 == pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), cpuset), ""); - struct sched_param sp; - sp.sched_priority = sched_fifo; - AssertFatal(pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp)==0, - "Can't set thread priority, Are you root?\n"); - /* Check the actual affinity mask assigned to the thread */ - cpu_set_t *cset=CPU_ALLOC(CPU_SETSIZE); - if (0 == pthread_getaffinity_np(pthread_self(), CPU_ALLOC_SIZE(CPU_SETSIZE), cset)) { - char txt[512]={0}; - for (int j = 0; j < CPU_SETSIZE; j++) - if (CPU_ISSET(j, cset)) - sprintf(txt+strlen(txt), " %d ", j); - printf("CPU Affinity of thread %s is %s\n", name, txt); - } - CPU_FREE(cset); -#endif - - // Lock memory from swapping. This is a process wide call (not constraint to this thread). - mlockall(MCL_CURRENT | MCL_FUTURE); - pthread_setname_np( pthread_self(), name ); - -// SYRTEM : Synchronization thread is not simulated -> just ignore this part of code -// // LTS: this sync stuff should be wrong -// printf("waiting for sync (%s)\n",name); -// pthread_mutex_lock(&sync_mutex); -// printf("Locked sync_mutex, waiting (%s)\n",name); -// while (sync_var<0) -// pthread_cond_wait(&sync_cond, &sync_mutex); -// pthread_mutex_unlock(&sync_mutex); - printf("started %s as PID: %ld\n",name, gettid()); -} - -void init_UE(int nb_inst) -{ - int inst; - for (inst=0; inst < nb_inst; inst++) { - // UE->rfdevice.type = NONE_DEV; -// SYRTEM : we use a stub of phy_var_ue -// PHY_VARS_UE *UE = PHY_vars_UE_g[inst][0]; -// AssertFatal(0 == pthread_create(&UE->proc.pthread_ue, &UE->proc.attr_ue, UE_thread, (void*)UE), ""); - AssertFatal( 0 == pthread_create( &pthread_ue, &attr_ue, UE_thread, NULL ), "" ); - } - - printf("UE threads created by %ld\n", gettid()); -} - - -// SYRTEM - UE synchronization thread is not used in this latency test program -//static void *UE_thread_synch(void *arg) { -// ... -//} - - -// SYRTEM - Stub of UE_thread_rxn_txnp4 -// -> No DSP scheduled -// -> Only thread initialization and thread wake up are kept - -static void *UE_thread_rxn_txnp4(void *arg){ - static __thread int UE_thread_rxtx_retval; - struct rx_tx_thread_data *rtd = arg; - UE_rxtx_proc_t *proc = rtd->proc; - - proc->instance_cnt_rxtx=-1; - - char threadname[256]; - sprintf(threadname,"UE_%d_proc_%d", 0, proc->sub_frame_start); - - cpu_set_t cpuset; - CPU_ZERO(&cpuset); - - if ( (proc->sub_frame_start)%RX_NB_TH == 0 && threads.one != -1 ) - CPU_SET(threads.one, &cpuset); - if ( (proc->sub_frame_start)%RX_NB_TH == 1 && threads.two != -1 ) - CPU_SET(threads.two, &cpuset); - if ( (proc->sub_frame_start)%RX_NB_TH == 2 && threads.three != -1 ) - CPU_SET(threads.three, &cpuset); - if ( (proc->sub_frame_start)%RX_NB_TH == 3 && threads.four != -1 ) - CPU_SET(threads.four, &cpuset); - if ( (proc->sub_frame_start)%RX_NB_TH == 4 && threads.five != -1 ) - CPU_SET(threads.five, &cpuset); - if ( (proc->sub_frame_start)%RX_NB_TH == 5 && threads.six != -1 ) - CPU_SET(threads.six, &cpuset); - //CPU_SET(threads.three, &cpuset); - init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, - threadname); - - - proc->syr_rdtsc_rxtx_th_unlock_iteration=0; - proc->syr_rdtsc_rxtx_th_unlock_max=0; - proc->syr_rdtsc_rxtx_th_unlock_mean=0; - proc->syr_rdtsc_rxtx_th_unlock_min=1000; - proc->syr_rdtsc_rxtx_th_unlock_histogram = NULL; - proc->syr_rdtsc_rxtx_th_unlock_histogram = histogram_init (proc->syr_rdtsc_rxtx_th_unlock_histogram); - - while (!oai_exit) { - if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) { - printf("[SCHED][UE] error locking mutex for UE RXTX\n" ); - exit_fun("nothing to add"); - } - while (proc->instance_cnt_rxtx < 0) { - // most of the time, the thread is waiting here - pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx ); - } - if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) { - printf("[SCHED][UE] error unlocking mutex for UE RXn_TXnp4\n" ); - exit_fun("nothing to add"); - } - - - proc->syr_rdtsc_rxtx_th_unlock = (double)(pickCyclesStop()-proc->syr_rdtsc_ue_th_got_iq )/cpu_mhz_syr; - - proc->syr_rdtsc_rxtx_th_unlock_iteration++; - - proc->syr_rdtsc_rxtx_th_unlock_mean += proc->syr_rdtsc_rxtx_th_unlock; - if ( proc->syr_rdtsc_rxtx_th_unlock_max < proc->syr_rdtsc_rxtx_th_unlock ) - proc->syr_rdtsc_rxtx_th_unlock_max = proc->syr_rdtsc_rxtx_th_unlock; - if ( proc->syr_rdtsc_rxtx_th_unlock_min > proc->syr_rdtsc_rxtx_th_unlock ) - proc->syr_rdtsc_rxtx_th_unlock_min = proc->syr_rdtsc_rxtx_th_unlock; - histogram_store_value( proc->syr_rdtsc_rxtx_th_unlock_histogram, proc->syr_rdtsc_rxtx_th_unlock ); - - - if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) { - printf("[SCHED][UE] error locking mutex for UE RXTX\n" ); - exit_fun("noting to add"); - } - proc->instance_cnt_rxtx--; - if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) { - printf("[SCHED][UE] error unlocking mutex for UE RXTX\n" ); - exit_fun("noting to add"); - } - } - -// thread finished - free(arg); - return &UE_thread_rxtx_retval; -} - - - - -void *UE_thread(void *arg) { - - int i = 0; - int hw_loop_cnt = 0; - - int nb_threads = RX_NB_TH; - char threadname[128]; - cpu_set_t cpuset; - struct rx_tx_thread_data *rtd; - UE_rxtx_proc_t *proc; - - CPU_ZERO( &cpuset ); - - if ( threads.iq != -1 ) - CPU_SET( threads.iq, &cpuset ); - init_thread( 100000, 500000, FIFO_PRIORITY, &cpuset, "HDW Threads" ); - - sprintf( threadname, "Main UE %d", 0 ); - pthread_setname_np( pthread_self(), threadname ); - - -// init_UE_threads(UE) - pthread_attr_init( &attr_ue ); - pthread_attr_setstacksize( &attr_ue, 8192 );//5*PTHREAD_STACK_MIN); - - for ( i = 0; i < nb_threads; i++ ) { - - printf("\n"); - - rtd = calloc( 1, sizeof( struct rx_tx_thread_data ) ); - if ( rtd == NULL ) - abort(); - - rtd->proc = rxtx_proc[i]; // &UE->proc.proc_rxtx[i]; - - pthread_mutex_init( &rxtx_proc[i]->mutex_rxtx ,NULL ); // pthread_mutex_init( &UE->proc.proc_rxtx[i].mutex_rxtx,NULL ); - pthread_cond_init( &rxtx_proc[i]->cond_rxtx, NULL ); // pthread_cond_init(&UE->proc.proc_rxtx[i].cond_rxtx,NULL); - rtd->proc->sub_frame_start=i; - rtd->proc->sub_frame_step=nb_threads; - printf("Init_UE_threads rtd %d proc %d nb_threads %d i %d\n",rtd->proc->sub_frame_start, rxtx_proc[i]->sub_frame_start,nb_threads, i); - pthread_create( &rxtx_proc[i]->pthread_rxtx, NULL, UE_thread_rxn_txnp4, rtd ); // pthread_create( &UE->proc.proc_rxtx[i].pthread_rxtx, NULL, UE_thread_rxn_txnp4, rtd); - - usleep(1000); - - } -// init_UE_threads(UE) - - - - int sub_frame=-1; - while ( !oai_exit ) { - - sub_frame++; - sub_frame %= 10; - - proc = rxtx_proc[hw_loop_cnt%RX_NB_TH]; - - // Simulate IQ reception - usleep( HWLAT_TTI_SLEEP_US ); - - proc->syr_rdtsc_ue_th_got_iq = pickCyclesStart(); - - AssertFatal(pthread_mutex_lock(&proc->mutex_rxtx) ==0,""); - - proc->instance_cnt_rxtx++; - if ( proc->instance_cnt_rxtx == 0 ) { - if ( pthread_cond_signal( &proc->cond_rxtx) != 0 ) { - exit_fun( "nothing to add" ); - } - } else { - if ( proc->instance_cnt_rxtx > 2 ) - exit_fun( "instance_cnt_rxtx > 2" ); - } - - AssertFatal( pthread_cond_signal( &proc->cond_rxtx ) == 0 ,"" ); - AssertFatal(pthread_mutex_unlock(&proc->mutex_rxtx) ==0,""); - - - /* Do not go indefinitely */ - hw_loop_cnt++; - - if ( hw_loop_cnt%1000 == 0 ) - { - printf("\r%d/%d",hw_loop_cnt,HWLAT_LOOP_CNT*RX_NB_TH); - fflush(stdout); - } - - if (hw_loop_cnt >= HWLAT_LOOP_CNT*RX_NB_TH) - { - printf("\n\n"); - for (i=0 ; ipthread_rxtx,threadname,128 ); - printf("RxTX Thread unlock latency on thread %s (it. %lu) (us) : max=%8.3f - mean=%8.3f - min=%8.3f\n", - threadname, - proc->syr_rdtsc_rxtx_th_unlock_iteration, - proc->syr_rdtsc_rxtx_th_unlock_max, - proc->syr_rdtsc_rxtx_th_unlock_mean/proc->syr_rdtsc_rxtx_th_unlock_iteration, - proc->syr_rdtsc_rxtx_th_unlock_min); - - histogram_save_in_csv(proc->syr_rdtsc_rxtx_th_unlock_histogram, threadname ); - - } - printf("\n\n"); - oai_exit = 1; - } - - } // while !oai_exit - - oai_exit = 1; - - return NULL; -} - -#define CALIB_LOOP_CNT 1000000 //2000000000 -#define CALIB_LOOP_REPORT_PERIOD 1000 -#define CALIB_LOOP_UP_THRESHOLD 20 // 20 -> for NG Intel flat model -#define CALIB_USLEEP 250 - -int main( void ) -{ - - int i; - - -#if CALIB_RT_INTRUMENTATION - uint32_t calib_loop_count; - - - uint64_t lt_overhead_cur; - uint64_t lt_overhead_min; - uint64_t lt_overhead_max; - uint64_t lt_overhead_mean; - histo_time_t *lt_overhead_histogram = NULL; - - uint64_t lt_syr_overhead_cur; - uint64_t lt_syr_overhead_min; - uint64_t lt_syr_overhead_max; - uint64_t lt_syr_overhead_mean; - histo_time_t *lt_syr_overhead_histogram = NULL; - - double syr_rdtsc_overhead_cur; - double syr_rdtsc_overhead_min; - double syr_rdtsc_overhead_max; - double syr_rdtsc_overhead_mean; - histo_time_t *syr_rdtsc_overhead_histogram = NULL; - - double syr_clock_gettime_overhead_cur; - double syr_clock_gettime_overhead_min; - double syr_clock_gettime_overhead_max; - double syr_clock_gettime_overhead_mean; - histo_time_t *syr_clock_gettime_overhead_histogram = NULL; - - - uint64_t cycles_start; - uint64_t cycles_stop; - - uint64_t cycles_diff; - uint64_t cycles_diff_max = 0; - - - struct timespec start; - struct timespec stop; -#endif - - cpuf = get_cpu_freq_GHz(); - cpu_mhz_syr = estimate_MHz_syr(); - - printf("\n\ncpuf %f - cpu_mhz_syr %f\n\n", cpuf, cpu_mhz_syr); - -#if CALIB_RT_INTRUMENTATION - - /* ********************************************************************************************** */ - /* CALIBRATION */ - /* ********************************************************************************************** */ - - /* ************************************************************* - Laurent Thomas instrumentation overhead - */ - printf("\nCalibrating OAI Realtime Instrumentation (Laurent Thomas imp.)\n"); - calib_loop_count = CALIB_LOOP_CNT; - initRefTimes(lt_instru_calib); // Laurent Thomas realtime instrumentation calibration measurments - lt_overhead_min = 1000; - lt_overhead_max = 0; - lt_overhead_mean = 0; - lt_overhead_histogram = histogram_init( lt_overhead_histogram ); - while(calib_loop_count) - { - pickTime(lt_start); - -// asm volatile(""); // Nop instruction - usleep(CALIB_USLEEP); - - lt_overhead_cur = updateTimes( readTime(lt_start), - <_instru_calib, - CALIB_LOOP_CNT, - "Laurent Thomas realtime instrumentation calibration measurments"); - - lt_overhead_mean += lt_overhead_cur; - if ( lt_overhead_max < lt_overhead_cur ) - lt_overhead_max = lt_overhead_cur; - if ( lt_overhead_min > lt_overhead_cur ) - lt_overhead_min = lt_overhead_cur; - histogram_store_value( lt_overhead_histogram, (double)lt_overhead_cur ); - - if ( calib_loop_count%CALIB_LOOP_REPORT_PERIOD == 0 ) - { - printf("\r%d/%d",calib_loop_count,CALIB_LOOP_CNT); - fflush(stdout); - } - - calib_loop_count--; - } - lt_overhead_mean = lt_overhead_mean/CALIB_LOOP_CNT; - -// printMeas("\nLaurent Thomas realtime instrumentation calibration measurments",<_instru_calib,CALIB_LOOP_CNT); - - - /* ************************************************************* - Laurent Thomas instrumentation overhead - */ - printf("\nCalibrating OAI Realtime Instrumentation - SYRTEM revisited\n"); - calib_loop_count = CALIB_LOOP_CNT; - initRefTimes(lt_instru_calib_syr); // Laurent Thomas realtime instrumentation calibration measurments - lt_syr_overhead_min = 1000; - lt_syr_overhead_max = 0; - lt_syr_overhead_mean = 0; - lt_syr_overhead_histogram = histogram_init( lt_syr_overhead_histogram ); - while(calib_loop_count) - { - pickTime_syr(lt_start_syr); - -// asm volatile(""); // Nop instruction - usleep(CALIB_USLEEP); - - lt_syr_overhead_cur = updateTimes_syr(readTime(lt_start_syr), <_instru_calib_syr, CALIB_LOOP_CNT, "Laurent Thomas realtime instrumentation calibration measurments (SYRTEM Update)"); - - lt_syr_overhead_mean += lt_syr_overhead_cur; - if ( lt_syr_overhead_max < lt_syr_overhead_cur ) - lt_syr_overhead_max = lt_syr_overhead_cur; - if ( lt_syr_overhead_min > lt_syr_overhead_cur ) - lt_syr_overhead_min = lt_syr_overhead_cur; - histogram_store_value( lt_syr_overhead_histogram, (double)lt_syr_overhead_cur ); - - if ( calib_loop_count%CALIB_LOOP_REPORT_PERIOD == 0 ) - { - printf("\r%d/%d",calib_loop_count,CALIB_LOOP_CNT); - fflush(stdout); - } - - calib_loop_count--; - } - lt_syr_overhead_mean = lt_syr_overhead_mean / CALIB_LOOP_CNT; - -// printMeas("\nLaurent Thomas realtime instrumentation calibration measurments (SYRTEM Update)",<_instru_calib_syr,CALIB_LOOP_CNT); - - - - /* ************************************************************* - SYRTEM RDTSC instrumentation overhead - */ - printf("\nCalibrating SYRTEM RDTSC Realtime Instrumentation\n"); - calib_loop_count = CALIB_LOOP_CNT; - syr_rdtsc_overhead_min = 1000; - syr_rdtsc_overhead_max = 0; - syr_rdtsc_overhead_mean = 0; - syr_rdtsc_overhead_histogram = histogram_init( syr_rdtsc_overhead_histogram ); - while(calib_loop_count) - { - - cycles_start = pickCyclesStart(); - -// asm volatile(""); // Nop instruction - usleep(CALIB_USLEEP); - - cycles_stop = pickCyclesStop(); - - cycles_diff = cycles_stop - cycles_start; - if(cycles_diff_max < cycles_diff) - cycles_diff_max = cycles_diff; - - syr_rdtsc_overhead_cur = (double)cycles_diff/cpu_mhz_syr; - - syr_rdtsc_overhead_mean += syr_rdtsc_overhead_cur; - if ( syr_rdtsc_overhead_max < syr_rdtsc_overhead_cur ) - syr_rdtsc_overhead_max = syr_rdtsc_overhead_cur; - if ( syr_rdtsc_overhead_min > syr_rdtsc_overhead_cur ) - syr_rdtsc_overhead_min = syr_rdtsc_overhead_cur; - histogram_store_value( syr_rdtsc_overhead_histogram, (double)syr_rdtsc_overhead_cur ); - - if ( calib_loop_count%CALIB_LOOP_REPORT_PERIOD == 0 ) - { - printf("\r%d/%d",calib_loop_count,CALIB_LOOP_CNT); - fflush(stdout); - } - - calib_loop_count--; - } - syr_rdtsc_overhead_mean = syr_rdtsc_overhead_mean / CALIB_LOOP_CNT; - -// printf("\nSYRTEM RDTSV realtime instrumentation calibration : cycles_diff_max %ld - tsc_duration_max %f us\n ", cycles_diff_max, tsc_duration_max); - - - - /* ************************************************************* - SYRTEM Clock_gettime MONOTONIC instrumentation overhead - */ - printf("\nCalibrating SYRTEM clock_gettime Realtime Instrumentation\n"); - calib_loop_count = CALIB_LOOP_CNT; - syr_clock_gettime_overhead_min = 1000; - syr_clock_gettime_overhead_max = 0; - syr_clock_gettime_overhead_mean = 0; - syr_clock_gettime_overhead_histogram = histogram_init( syr_clock_gettime_overhead_histogram ); - while(calib_loop_count) - { - - clock_gettime( CLOCK_MONOTONIC, &start ); - -// asm volatile(""); // Nop instruction - usleep(CALIB_USLEEP); - - clock_gettime( CLOCK_MONOTONIC, &stop ); - syr_clock_gettime_overhead_cur = TIMESPEC_TO_DOUBLE_US( get_timespec_diff( &start, &stop ) ); - - syr_clock_gettime_overhead_mean += syr_clock_gettime_overhead_cur; - if ( syr_clock_gettime_overhead_max < syr_clock_gettime_overhead_cur ) - syr_clock_gettime_overhead_max = syr_clock_gettime_overhead_cur; - if ( syr_clock_gettime_overhead_min > syr_clock_gettime_overhead_cur ) - syr_clock_gettime_overhead_min = syr_clock_gettime_overhead_cur; - histogram_store_value( syr_clock_gettime_overhead_histogram, (double)syr_clock_gettime_overhead_cur ); - - if ( calib_loop_count%CALIB_LOOP_REPORT_PERIOD == 0 ) - { - printf("\r%d/%d",calib_loop_count,CALIB_LOOP_CNT); - fflush(stdout); - } - - calib_loop_count--; - } - syr_clock_gettime_overhead_mean = syr_clock_gettime_overhead_mean / CALIB_LOOP_CNT; - -// printf("\nSYRTEM clock_gettime MONOTONIC calibration : clock_gettime duration_max %f us\n ", max); - - - printf("\n"); - - printf("OAI LT RT profiling overhead (it. %d) (us) : max=%8ld - mean=%8ld - min=%8ld\n", - CALIB_LOOP_CNT, - lt_overhead_max, lt_overhead_mean, lt_overhead_min); - printf("OAI SYR RT profiling overhead (it. %d) (us) : max=%8ld - mean=%8ld - min=%8ld\n", - CALIB_LOOP_CNT, - lt_syr_overhead_max, lt_syr_overhead_mean, lt_syr_overhead_min); - printf("SYR RDTSC profiling overhead (it. %d) (us) : max=%8.3f - mean=%8.3f - min=%8.3f\n", - CALIB_LOOP_CNT, - syr_rdtsc_overhead_max, syr_rdtsc_overhead_mean, syr_rdtsc_overhead_min); - printf("SYR clock_gettime profiling overhead (it. %d) (us): max=%8.3f - mean=%8.3f - min=%8.3f\n", - CALIB_LOOP_CNT, - syr_clock_gettime_overhead_max, syr_clock_gettime_overhead_mean, syr_clock_gettime_overhead_min); - - return 0; -#endif - - rxtx_proc = calloc( RX_NB_TH, sizeof( UE_rxtx_proc_t* ) ); - for (i=0 ; i - * Small changes by David Sterba - * - */ - - struct timespec start; - struct timespec stop; - - unsigned long long int cycles[2]; /* must be 64 bit */ - double microseconds; /* total time taken */ - - - /* get this function in cached memory */ - cycles[0] = rdtsc (); - clock_gettime( CLOCK_REALTIME, &start ); - - /* we don't trust that this is any specific length of time */ - usleep (100000); - - cycles[1] = rdtsc (); - clock_gettime( CLOCK_REALTIME, &stop ); - microseconds = TIMESPEC_TO_DOUBLE_US( get_timespec_diff( &start, &stop ) ); - - unsigned long long int elapsed = 0; - if (cycles[1] < cycles[0]) - { - //printf("c0 = %llu c1 = %llu",cycles[0],cycles[1]); - elapsed = UINT32_MAX - cycles[0]; - elapsed = elapsed + cycles[1]; - //printf("c0 = %llu c1 = %llu max = %llu elapsed=%llu\n",cycles[0], cycles[1], UINT32_MAX,elapsed); - } - else - { - elapsed = cycles[1] - cycles[0]; - // printf("\nc0 = %llu c1 = %llu elapsed=%llu\n",cycles[0], cycles[1],elapsed); - } - - double mhz = elapsed / microseconds; - - - //printf("%llg MHz processor (estimate). diff cycles=%llu microseconds=%llu \n", mhz, elapsed, microseconds); - //printf("%g elapsed %llu microseconds %llu\n",mhz, elapsed, microseconds); - return (mhz); -} - - - -/** TSC Timestamp references - - - http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/#312-tsc-sync-behaviors-on-smp-system - - https://www.intel.com/content/www/us/en/embedded/training/ia-32-ia-64-benchmark-code-execution-paper.html - - https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3b-part-2-manual.pdf - - - http://blog.tinola.com/?e=54 - - https://stackoverflow.com/questions/24392392/getting-tsc-frequency-from-proc-cpuinfo !! warning on turbo - - https://gist.github.com/nfarring/1624742 - - https://www.lmax.com/blog/staff-blogs/2015/10/25/time-stamp-counters/ - - https://github.com/cyring/CoreFreq - - https://patchwork.kernel.org/patch/9438133/ --> TSC_ADJUST - to be checked - -> https://software.intel.com/en-us/forums/software-tuning-performance-optimization-platform-monitoring/topic/388964 - - https://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=11&ved=0ahUKEwjwpJbem5DVAhWBDpoKHXv0Dt04ChAWCCIwAA&url=https%3A%2F%2Fsigarra.up.pt%2Ffeup%2Fpt%2Fpub_geral.show_file%3Fpi_gdoc_id%3D809041&usg=AFQjCNFHTMjmjWMG6QSVnLDflEoU0RavKw&cad=rja - - https://unix4lyfe.org/benchmarking/ - - https://stackoverflow.com/questions/27693145/rdtscp-versus-rdtsc-cpuid - - https://github.com/dterei/tsc/blob/master/tsc.h - - https://software.intel.com/en-us/forums/intel-isa-extensions/topic/280440 - - https://stackoverflow.com/questions/19941588/wrong-clock-cycle-measurements-with-rdtsc - - - -*/ - - - - - - -static __inline__ uint64_t pickCyclesStart(void) { - unsigned cycles_low, cycles_high; - asm volatile( "CPUID\n\t" // serialize - "RDTSC\n\t" // read clock - "MOV %%edx, %0\n\t" - "MOV %%eax, %1\n\t" - : "=r" (cycles_high), "=r" (cycles_low) - :: "%rax", "%rbx", "%rcx", "%rdx" ); -return ((uint64_t) cycles_high << 32) | cycles_low; -} - -static __inline__ uint64_t pickCyclesStop(void) { - uint32_t eax, edx; - - __asm__ __volatile__("rdtscp" - : "=a" (eax), "=d" (edx) - : - : "%ecx", "memory"); - -return (((uint64_t)edx << 32) | eax); -} - - - - - - - - -/************************************************************************************** - EXTRACT from openair1/PHY/TOOLS/time_meas.c -***************************************************************************************/ -double get_cpu_freq_GHz(void) { - - time_stats_t ts = {0}; - reset_meas(&ts); - ts.trials++; - ts.in = rdtsc_oai(); - sleep(1); - ts.diff = (rdtsc_oai()-ts.in); - cpu_freq_GHz = (double)ts.diff/1000000000; - printf("CPU Freq is %f \n", cpu_freq_GHz); - return cpu_freq_GHz; -} - - - -/************************************************************************************** - SYRTEM STATISTICS HELPER -***************************************************************************************/ - - - -histo_time_t *histogram_init(histo_time_t *histo ) -{ - int i = 0; - double max_val = HISTOGRAM_MIN_VALUE + HISTOGRAM_STEP; - - histo = calloc( HISTOGRAM_SIZE, sizeof( histo_time_t ) ); - if ( histo == NULL ) { - printf( "ERROR allocating histogram structure !\n" ); - return NULL; - } - - for ( i = 0; i < HISTOGRAM_SIZE; i++ ) { - histo[i].max = max_val; - max_val += HISTOGRAM_STEP; - } - - return histo; -} - - -void histogram_store_value( histo_time_t *histo, double value ) -{ - int i = 0; - - for ( i = 0; i < HISTOGRAM_SIZE; i++ ) { - if ( histo[i].max >= value || ( i + 1 ) == HISTOGRAM_SIZE ) { - histo[i].count++; - break; - } - } -} - - -void histogram_save_in_csv( histo_time_t *histo , char *file_sufix) -{ - char *csv_filename; - char month[3], day[3], hour[3], min[3], sec[3]; - time_t curr_time; - struct tm *datetime; - - curr_time = time( NULL ); - datetime = localtime( &curr_time ); - - csv_filename = calloc( sizeof( char ), 64 ); - if ( csv_filename == NULL ) { - return; - } - - memset( csv_filename, 0x00, 64 ); - memset( month, 0x00, 3 ); - memset( day, 0x00, 3 ); - memset( hour, 0x00, 3 ); - memset( min, 0x00, 3 ); - memset( sec, 0x00, 3 ); - -/* Month. */ - if ( datetime->tm_mon < 9 ) - snprintf( month, 3, "0%d", datetime->tm_mon + 1 ); - else - snprintf( month, 3, "%d", datetime->tm_mon + 1 ); - -/* Day. */ - if ( datetime->tm_mday < 10 ) - snprintf( day, 3, "0%d", datetime->tm_mday ); - else - snprintf( day, 3, "%d", datetime->tm_mday ); - -/* Hour. */ - if ( datetime->tm_hour < 10 ) - snprintf( hour, 3, "0%d", datetime->tm_hour ); - else - snprintf( hour, 3, "%d", datetime->tm_hour ); - -/* Minute. */ - if ( datetime->tm_min < 10 ) - snprintf( min, 3, "0%d", datetime->tm_min ); - else - snprintf( min, 3, "%d", datetime->tm_min ); - -/* Second. */ - if ( datetime->tm_sec < 10 ) - snprintf( sec, 3, "0%d", datetime->tm_sec ); - else - snprintf( sec, 3, "%d", datetime->tm_sec ); - - snprintf( csv_filename, 63, "ADRV9371_ZC706_HISTO_UEtoRXTX_%d%s%s%s%s%s_%s.csv", - datetime->tm_year + 1900, month, day, hour, min, sec, file_sufix ); - - FILE *fp; - int i = 0; - int min_val = 0; - - fp = fopen( csv_filename, "w+" ); - - fprintf( fp, "range;count\n" ); - - for ( i = 0; i < HISTOGRAM_SIZE; i++ ) { - if ( i + 1 == HISTOGRAM_SIZE ) - fprintf( fp, "%d+;%u\n", min_val, histo[i].count ); - else - fprintf( fp, "%d-%.0f;%u\n", min_val, histo[i].max, histo[i].count ); - min_val = histo[i].max; - } - free(csv_filename); - fclose( fp ); -} - - - -static struct timespec get_timespec_diff( - struct timespec *start, - struct timespec *stop ) -{ - struct timespec result; - - if ( ( stop->tv_nsec - start->tv_nsec ) < 0 ) { - result.tv_sec = stop->tv_sec - start->tv_sec - 1; - result.tv_nsec = stop->tv_nsec - start->tv_nsec + 1000000000; - } - else { - result.tv_sec = stop->tv_sec - start->tv_sec; - result.tv_nsec = stop->tv_nsec - start->tv_nsec; - } - - return result; -} - - -static void measure_time ( - struct timespec *start, - struct timespec *stop, - uint8_t START, - uint16_t PRINT_INTERVAL ) -{ - static double max = 0; - static double min = 0; - static double total = 0; - static int count = 0; - - if ( START ) { - clock_gettime( CLOCK_REALTIME, start ); - } - else { - clock_gettime( CLOCK_REALTIME, stop ); - - struct timespec diff; - double current = 0; - - diff = get_timespec_diff( start, stop ); -// current = ( (double)diff.tv_sec * 1000000 ) + ( (double)diff.tv_nsec / 1000 ); - current = TIMESPEC_TO_DOUBLE_US( diff ); - - if ( current > max ) { - max = current; - } - if ( min == 0 || current < min ) { - min = current; - } - total += current; - - histogram_store_value( th_wake_histogram, current ); - - if ( count % PRINT_INTERVAL == 0 && count != 0 ) { - double avg = total / ( count + 1 ); - printf( "[%d] Current : %.2lf µs, Min : %.2lf µs, Max : %.2lf µs, Moy : %.2lf µs\n", - count, current, min, max, avg ); - } - count++; - } -} - - - - - - - - - - - - - - - - From b742717fb8ebc5299b7bd1c569babb72e4ead2ea Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Feb 2022 20:47:03 +0100 Subject: [PATCH 609/883] Remove timing functions from logging module --- common/utils/LOG/log.h | 124 ------------------------ common/utils/threadPool/thread-pool.h | 7 ++ executables/main-fs6.c | 61 +++++++++++- executables/nr-ue.c | 4 +- executables/transport_split.c | 2 +- openair1/PHY/defs_L1_NB_IoT.h | 3 - openair1/PHY/defs_UE.h | 1 - openair1/PHY/thread_NR_UE.h | 1 - openair1/SIMULATION/LTE_PHY/dlsim.c | 1 - openair1/SIMULATION/LTE_PHY/dlsim_tm4.c | 1 - openair1/SIMULATION/LTE_PHY/framegen.c | 1 - openair1/SIMULATION/LTE_PHY/mbmssim.c | 1 - targets/RT/USER/lte-ue.c | 24 ----- 13 files changed, 67 insertions(+), 164 deletions(-) diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 8299c48fbb..7c81088454 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -472,130 +472,6 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int /* @}*/ -static __inline__ uint64_t rdtsc(void) { - uint32_t a, d; - __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); - return (((uint64_t)d)<<32) | ((uint64_t)a); -} - -#define DEBUG_REALTIME 1 -#if DEBUG_REALTIME - -extern double cpuf; - -static inline uint64_t checkTCPU(int timeout, - char *file, - int line) -{ - static uint64_t __thread lastCPUTime=0; - static uint64_t __thread last=0; - uint64_t cur=rdtsc(); - struct timespec CPUt; - clock_gettime(CLOCK_THREAD_CPUTIME_ID, &CPUt); - uint64_t CPUTime=CPUt.tv_sec*1000*1000+CPUt.tv_nsec/1000; - double microCycles=(double)(cpuf*1000); - int duration=(int)((cur-last)/microCycles); - - if ( last!=0 && duration > timeout ) { - //struct timespec ts; - //clock_gettime(CLOCK_MONOTONIC, &ts); - printf("%s:%d lte-ue delay %d (exceed %d), CPU for this period: %lld\n", file, line, - duration, timeout, (long long)CPUTime-lastCPUTime ); - } - - last=cur; - lastCPUTime=CPUTime; - return cur; -} - -static inline unsigned long long checkT(int timeout, - char *file, - int line) -{ - static unsigned long long __thread last=0; - unsigned long long cur=rdtsc(); - int microCycles=(int)(cpuf*1000); - int duration=(int)((cur-last)/microCycles); - - if ( last!=0 && duration > timeout ) - printf("%s:%d lte-ue delay %d (exceed %d)\n", file, line, - duration, timeout); - - last=cur; - return cur; -} - -typedef struct m { - uint64_t iterations; - uint64_t sum; - uint64_t maxArray[11]; -} Meas; - -static inline void printMeas(char *txt, - Meas *M, - int period) -{ - if (M->iterations%period == 0 ) { - char txt2[512]; - sprintf(txt2,"%s avg=%" PRIu64 " iterations=%" PRIu64 " max=%" - PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 "\n", - txt, - M->sum/M->iterations, - M->iterations, - M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5], - M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]); -#if T_TRACER - LOG_W(PHY,"%s",txt2); -#else - printf("%s",txt2); -#endif - } -} - -static inline int cmpint(const void *a, - const void *b) -{ - uint64_t *aa=(uint64_t *)a; - uint64_t *bb=(uint64_t *)b; - return (int)(*aa-*bb); -} - -static inline void updateTimes(uint64_t start, - Meas *M, - int period, - char *txt) -{ - if (start!=0) { - uint64_t end=rdtsc(); - long long diff=(end-start)/(cpuf*1000); - M->maxArray[0]=diff; - M->sum+=diff; - M->iterations++; - qsort(M->maxArray, 11, sizeof(uint64_t), cmpint); - printMeas(txt,M,period); - } -} - -#define check(a) do { checkT(a,__FILE__,__LINE__); } while (0) -#define checkcpu(a) do { checkTCPU(a,__FILE__,__LINE__); } while (0) -#define initRefTimes(a) static __thread Meas a= {0} -#define pickTime(a) uint64_t a=rdtsc() -#define readTime(a) a -#define initStaticTime(a) static __thread uint64_t a={0} -#define pickStaticTime(a) do { a=rdtsc(); } while (0) - -#else -#define check(a) do {} while (0) -#define checkcpu(a) do {} while (0) -#define initRefTimes(a) do {} while (0) -#define initStaticTime(a) do {} while (0) -#define pickTime(a) do {} while (0) -#define readTime(a) 0 -#define pickStaticTime(a) do {} while (0) -#define updateTimes(a,b,c,d) do {} while (0) -#define printMeas(a,b,c) do {} while (0) -#endif - #ifdef __cplusplus } #endif diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index a8f8572cfe..2ca152bb02 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -27,12 +27,19 @@ #include #include #include +#include #include #include #include #include //#include +static __inline__ uint64_t rdtsc(void) { + uint32_t a, d; + __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); + return (((uint64_t)d)<<32) | ((uint64_t)a); +} + #ifdef DEBUG #define THREADINIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP #else diff --git a/executables/main-fs6.c b/executables/main-fs6.c index 9e92f2e41a..e708d9c761 100644 --- a/executables/main-fs6.c +++ b/executables/main-fs6.c @@ -55,6 +55,59 @@ int sum(uint8_t *b, int s) { return sum; } + +extern double cpuf; + +typedef struct m { + uint64_t iterations; + uint64_t sum; + uint64_t maxArray[11]; +} Meas; + +int cmpint(const void *a, const void *b) +{ + uint64_t *aa=(uint64_t *)a; + uint64_t *bb=(uint64_t *)b; + return (int)(*aa-*bb); +} + +static inline void printMeas(char *txt, + Meas *M, + int period) +{ + if (M->iterations%period == 0 ) { + char txt2[512]; + sprintf(txt2,"%s avg=%" PRIu64 " iterations=%" PRIu64 " max=%" + PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 ":%" PRIu64 "\n", + txt, + M->sum/M->iterations, + M->iterations, + M->maxArray[1],M->maxArray[2], M->maxArray[3],M->maxArray[4], M->maxArray[5], + M->maxArray[6],M->maxArray[7], M->maxArray[8],M->maxArray[9],M->maxArray[10]); +#if T_TRACER + LOG_W(PHY,"%s",txt2); +#else + printf("%s",txt2); +#endif + } +} + +void updateTimes(uint64_t start, Meas *M, int period, char *txt) +{ + if (start!=0) { + uint64_t end=rdtsc_oai(); + long long diff=(end-start)/(cpuf*1000); + M->maxArray[0]=diff; + M->sum+=diff; + M->iterations++; + qsort(M->maxArray, 11, sizeof(uint64_t), cmpint); + printMeas(txt,M,period); + } +} + +#define initStaticTime(a) static __thread uint64_t a={0} +#define pickStaticTime(a) do { a=rdtsc_oai(); } while (0) +#define initRefTimes(a) static __thread Meas a= {0} static inline int cmpintRev(const void *a, const void *b) { uint64_t *aa=(uint64_t *)a; uint64_t *bb=(uint64_t *)b; @@ -82,7 +135,7 @@ static inline void printMeas2(char *txt, Meas *M, int period, bool MaxMin) { static inline void updateTimesReset(uint64_t start, Meas *M, int period, bool MaxMin, char *txt) { if (start!=0) { - uint64_t end=rdtsc(); + uint64_t end=rdtsc_oai(); long long diff=(end-start)/(cpuf*1000); M->maxArray[0]=diff; M->sum+=diff; @@ -107,7 +160,7 @@ static inline void updateTimesReset(uint64_t start, Meas *M, int period, bool Ma static inline void measTransportTime(uint64_t DuSend, uint64_t CuMicroSec, Meas *M, int period, bool MaxMin, char *txt) { if (DuSend!=0) { - uint64_t end=rdtsc(); + uint64_t end=rdtsc_oai(); long long diff=(end-DuSend)/(cpuf*1000)-CuMicroSec; M->maxArray[0]=diff; M->sum+=diff; @@ -1463,7 +1516,7 @@ void DL_cu_fs6(RU_t *ru, L1_rxtx_proc_t *proc, uint64_t DuClock, uint64_t start } hDL(bufferZone)->DuClock=DuClock; - hDL(bufferZone)->CuSpentMicroSec=(rdtsc()-startCycle)/(cpuf*1000); + hDL(bufferZone)->CuSpentMicroSec=(rdtsc_oai()-startCycle)/(cpuf*1000); updateTimesReset(startCycle, &CUprocessing, 1000, true,"CU entire processing from recv to send"); sendSubFrame(&sockFS6, bufferZone, sizeof(fs6_dl_t), CTsentCUv0 ); return; @@ -1476,7 +1529,7 @@ void UL_cu_fs6(RU_t *ru, L1_rxtx_proc_t *proc, uint64_t *TS, uint64_t *DuClock, pickStaticTime(begingWait); int nb_blocks=receiveSubFrame(&sockFS6, bufferZone, sizeof(bufferZone), CTsentDUv0 ); * DuClock=hUDP(bufferZone)->senderClock; - * startProcessing=rdtsc(); + * startProcessing=rdtsc_oai(); updateTimesReset(begingWait, &fullLoop, 1000, false, "CU wait DU"); if (nb_blocks ==0) { diff --git a/executables/nr-ue.c b/executables/nr-ue.c index d1b26601b4..ecadef1ac2 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -766,9 +766,9 @@ void processSlotRX(void *arg) { #ifdef UE_SLOT_PARALLELISATION phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL ); #else - uint64_t a=rdtsc(); + uint64_t a=rdtsc_oai(); phy_procedures_nrUE_RX(UE, proc, gNB_id, get_nrUE_params()->nr_dlsch_parallel, &rxtxD->txFifo); - LOG_D(PHY, "In %s: slot %d, time %lu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc()-a)/3500); + LOG_D(PHY, "In %s: slot %d, time %llu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc_oai()-a)/3500); #endif if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa){ diff --git a/executables/transport_split.c b/executables/transport_split.c index f380eb90e3..e7199637cc 100644 --- a/executables/transport_split.c +++ b/executables/transport_split.c @@ -156,7 +156,7 @@ int receiveSubFrame(UDPsock_t *sock, void *bufferZone, int bufferSize, uint16_t int sendSubFrame(UDPsock_t *sock, void *bufferZone, ssize_t secondHeaderSize, uint16_t contentType) { commonUDP_t *UDPheader=(commonUDP_t *)bufferZone ; UDPheader->contentType=contentType; - UDPheader->senderClock=rdtsc(); + UDPheader->senderClock=rdtsc_oai(); int nbBlocks=UDPheader->nbBlocks; int blockId=0; diff --git a/openair1/PHY/defs_L1_NB_IoT.h b/openair1/PHY/defs_L1_NB_IoT.h index a4552c8c27..51b7c63b72 100644 --- a/openair1/PHY/defs_L1_NB_IoT.h +++ b/openair1/PHY/defs_L1_NB_IoT.h @@ -452,9 +452,6 @@ typedef struct { int sub_frame_start; /// int sub_frame_step; - /// - unsigned long long gotIQs; - } UE_rxtx_proc_NB_IoT_t; /// Context data structure for eNB subframe processing diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index fc3d939f65..06aad301ca 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -154,7 +154,6 @@ typedef struct { int sub_frame_start; int sub_frame_step; - unsigned long long gotIQs; } UE_rxtx_proc_t; /// Context data structure for eNB subframe processing diff --git a/openair1/PHY/thread_NR_UE.h b/openair1/PHY/thread_NR_UE.h index 901d8faec9..a3cc2d9782 100644 --- a/openair1/PHY/thread_NR_UE.h +++ b/openair1/PHY/thread_NR_UE.h @@ -62,7 +62,6 @@ typedef struct { int sub_frame_start; int sub_frame_step; - unsigned long long gotIQs; uint8_t decoder_thread_available1; int dci_err_cnt; } UE_nr_rxtx_proc_t; diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index c1443700f3..9f176ae768 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -122,7 +122,6 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_ slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); for (aa=0; aanb_antennas_tx; aa++) { - // printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc()); if (frame_parms->Ncp == 1) PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input &txdata[aa][slot_offset], // output diff --git a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c index 3b4e6782da..57c06e3b13 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim_tm4.c @@ -112,7 +112,6 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_ slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); for (aa=0; aanb_antennas_tx; aa++) { - // printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc()); if (frame_parms->Ncp == 1) PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input diff --git a/openair1/SIMULATION/LTE_PHY/framegen.c b/openair1/SIMULATION/LTE_PHY/framegen.c index f5b1e6d45e..b9f0221b2d 100644 --- a/openair1/SIMULATION/LTE_PHY/framegen.c +++ b/openair1/SIMULATION/LTE_PHY/framegen.c @@ -333,7 +333,6 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_ slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); for (aa=0; aanb_antennas_tx; aa++) { - // printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc()); if (frame_parms->Ncp == 1) PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c index 31c3b47227..7efe9f4530 100644 --- a/openair1/SIMULATION/LTE_PHY/mbmssim.c +++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c @@ -121,7 +121,6 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_ slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); for (aa=0; aanb_antennas_tx; aa++) { - // printf("Thread %d starting ... aa %d (%llu)\n",omp_get_thread_num(),aa,rdtsc()); if (frame_parms->Ncp == 1) PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input &txdata[aa][slot_offset], // output diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 1643ca36ca..2e95e56d85 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -815,11 +815,6 @@ static void *UE_thread_rxn_txnp4(void *arg) pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx ); } - //printf("Processing sub frqme %d in %s\n", proc->subframe_rx, threadname); - initRefTimes(t2); - initRefTimes(t3); - pickTime(current); - updateTimes(proc->gotIQs, &t2, 10000, "Delay to wake up UE_Thread_Rx (case 2)"); // Process Rx data for one sub-frame lte_subframe_t sf_type = subframe_select( &UE->frame_parms, proc->subframe_rx); @@ -886,7 +881,6 @@ static void *UE_thread_rxn_txnp4(void *arg) if (UE->mode != loop_through_memory) phy_procedures_UE_S_TX(UE,0,0); - updateTimes(current, &t3, 10000, "Delay to process sub-frame (case 3)"); proc->instance_cnt_rxtx--; if ( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { @@ -1470,12 +1464,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) oai_subframe_ind(proc->frame_rx, proc->subframe_rx); } - //Guessing that the next 4 lines are not needed for the phy_stub mode. - /*initRefTimes(t2); - initRefTimes(t3); - pickTime(current); - updateTimes(proc->gotIQs, &t2, 10000, "Delay to wake up UE_Thread_Rx (case 2)");*/ - if (pthread_mutex_lock(&phy_stub_ticking->mutex_single_thread) != 0) { LOG_E( MAC, "[SCHED][UE] error locking mutex for ue_thread_id %d (mutex_single_thread)\n",ue_thread_id); exit_fun("nothing to add"); @@ -2225,8 +2213,6 @@ void *UE_thread(void *arg) LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols); } - pickTime(gotIQs); - /* no timeout in IS_SOFTMODEM_BASICSIM or IS_SOFTMODEM_RFSIM mode */ if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) { ret = pthread_mutex_lock(&proc->mutex_rxtx); @@ -2264,12 +2250,6 @@ void *UE_thread(void *arg) } } - //UE->proc.proc_rxtx[0].gotIQs=readTime(gotIQs); - //UE->proc.proc_rxtx[1].gotIQs=readTime(gotIQs); - for (th_id=0; th_id < RX_NB_TH; th_id++) { - UE->proc.proc_rxtx[th_id].gotIQs=readTime(gotIQs); - } - proc->subframe_rx=sub_frame; proc->subframe_tx=(sub_frame+4)%10; proc->frame_tx = proc->frame_rx + (proc->subframe_rx>5?1:0); @@ -2281,10 +2261,6 @@ void *UE_thread(void *arg) T(T_UE_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx)); AssertFatal (pthread_cond_signal(&proc->cond_rxtx) ==0,""); AssertFatal(pthread_mutex_unlock(&proc->mutex_rxtx) ==0,""); - initRefTimes(t1); - initStaticTime(lastTime); - updateTimes(lastTime, &t1, 20000, "Delay between two IQ acquisitions (case 1)"); - pickStaticTime(lastTime); } else { printf("Processing subframe %d",proc->subframe_rx); getchar(); From d20ff45fc6086da492c4e226258748f05caf1fda Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Feb 2022 20:55:53 +0100 Subject: [PATCH 610/883] Remove logging module dependency from Tpool --- common/utils/threadPool/thread-pool.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index 2ca152bb02..7d2365fb52 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -30,7 +30,6 @@ #include #include #include -#include #include //#include @@ -103,13 +102,9 @@ static inline void *NotifiedFifoData(notifiedFIFO_elt_t *elt) { } static inline void delNotifiedFIFO_elt(notifiedFIFO_elt_t *elt) { - if (elt->malloced) { - elt->malloced=false; - free(elt); - } else - printf("delNotifiedFIFO on something not allocated by newNotifiedFIFO\n"); - - //LOG_W(UTIL,"delNotifiedFIFO on something not allocated by newNotifiedFIFO\n"); + AssertFatal(elt->malloced, "delNotifiedFIFO on something not allocated by newNotifiedFIFO\n"); + elt->malloced=false; + free(elt); } static inline void initNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf) { @@ -148,8 +143,7 @@ static inline notifiedFIFO_elt_t *pullNotifiedFIFO_nothreadSafe(notifiedFIFO_t notifiedFIFO_elt_t *ret=nf->outF; - if (nf->outF==nf->outF->next) - LOG_E(UTIL,"Circular list in thread pool: push several times the same buffer is forbidden\n"); + AssertFatal(nf->outF != nf->outF->next,"Circular list in thread pool: push several times the same buffer is forbidden\n"); nf->outF=nf->outF->next; From 76d609f7fa4bde2351e03ce7b9c66e98d907477a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 13:00:04 +0100 Subject: [PATCH 611/883] Delete unused code --- cmake_targets/CMakeLists.txt | 41 +- .../nrLDPC_encoder/ldpc_encode_parity_check.c | 1 - .../PHY/CODING/nrLDPC_encoder/ldpc_encoder.c | 3 +- .../nrLDPC_encoder/ldpc_encoder_optim.c | 1 - .../nrLDPC_encoder/ldpc_encoder_optim8seg.c | 1 - .../ldpc_encoder_optim8segmulti.c | 1 - openair1/SIMULATION/TOOLS/channel_sim.c | 1 - openair2/UTIL/FIFO/pad_list.c | 607 ------------------ openair2/UTIL/FIFO/pad_list.h | 87 --- openair2/UTIL/FIFO/types.h | 127 ---- 10 files changed, 2 insertions(+), 868 deletions(-) delete mode 100644 openair2/UTIL/FIFO/pad_list.c delete mode 100644 openair2/UTIL/FIFO/pad_list.h delete mode 100644 openair2/UTIL/FIFO/types.h diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 82022da78f..d059a34247 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1281,55 +1281,16 @@ add_library(HASHTABLE include_directories(${OPENAIR_DIR}/common/utils/hashtable) set(UTIL_SRC - # ${OPENAIR2_DIR}/UTIL/CLI/cli.c - # ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c - # ${OPENAIR2_DIR}/UTIL/CLI/cli_server.c - ${OPENAIR2_DIR}/UTIL/FIFO/pad_list.c ${OPENAIR2_DIR}/UTIL/LISTS/list.c ${OPENAIR2_DIR}/UTIL/LISTS/list2.c ${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/utils/LOG/vcd_signal_dumper.c ${OPENAIR2_DIR}/UTIL/MATH/oml.c - # ${OPENAIR2_DIR}/UTIL/MEM/mem_block.c - # ${OPENAIR2_DIR}/UTIL/OCG/OCG.c - # ${OPENAIR2_DIR}/UTIL/OCG/OCG_create_dir.c - # ${OPENAIR2_DIR}/UTIL/OCG/OCG_detect_file.c - # ${OPENAIR2_DIR}/UTIL/OCG/OCG_generate_report.c - # ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_filename.c - # ${OPENAIR2_DIR}/UTIL/OCG/OCG_parse_XML.c - # ${OPENAIR2_DIR}/UTIL/OCG/OCG_save_XML.c - # ${OPENAIR2_DIR}/UTIL/OMG/common.c - # ${OPENAIR2_DIR}/UTIL/OMG/grid.c - # ${OPENAIR2_DIR}/UTIL/OMG/job.c - # ${OPENAIR2_DIR}/UTIL/OMG/mobility_parser.c - # ${OPENAIR2_DIR}/UTIL/OMG/omg.c - # ${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c - # ${OPENAIR2_DIR}/UTIL/OMG/rwalk.c - # ${OPENAIR2_DIR}/UTIL/OMG/rwp.c - # ${OPENAIR2_DIR}/UTIL/OMG/static.c - # ${OPENAIR2_DIR}/UTIL/OMG/steadystaterwp.c - # ${OPENAIR2_DIR}/UTIL/OMG/trace.c - # ${OPENAIR2_DIR}/UTIL/OMG/trace_hashtable.c ${OPENAIR2_DIR}/UTIL/OPT/probe.c - # ${OPENAIR2_DIR}/UTIL/OTG/otg_tx.c - # ${OPENAIR2_DIR}/UTIL/OTG/otg.c - # ${OPENAIR2_DIR}/UTIL/OTG/otg_kpi.c - # ${OPENAIR2_DIR}/UTIL/OTG/otg_models.c - # ${OPENAIR2_DIR}/UTIL/OTG/otg_form.c - # ${OPENAIR2_DIR}/UTIL/OTG/otg_rx.c - ) +) add_library(UTIL ${UTIL_SRC}) add_dependencies(UTIL rrc_flag) -#set(OMG_SUMO_SRC -# ${OPENAIR2_DIR}/UTIL/OMG/client_traci_OMG.c -# ${OPENAIR2_DIR}/UTIL/OMG/id_manager.c -# ${OPENAIR2_DIR}/UTIL/OMG/sumo.c -# ${OPENAIR2_DIR}/UTIL/OMG/socket_traci_OMG.c -# ${OPENAIR2_DIR}/UTIL/OMG/storage_traci_OMG.c -# ) -#add_library(OMG_SUMO ${OMG_SUMO_SRC}) - set(SECU_OSA_SRC ${OPENAIR2_DIR}/UTIL/OSA/osa_key_deriver.c ${OPENAIR2_DIR}/UTIL/OSA/osa_rijndael.c diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c index 69d2ac4972..d36398a13a 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encode_parity_check.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "assertions.h" #include "common/utils/LOG/log.h" diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c index 76f92574ba..d5669fbbab 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c @@ -35,7 +35,6 @@ #include #include #include -#include #include "defs.h" #include "assertions.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" @@ -280,4 +279,4 @@ int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,int int nrLDPC_encod(unsigned char **test_input,unsigned char **channel_input,int Zc,int Kb,short block_length, short BG, encoder_implemparams_t *impp) { return ldpc_encoder_orig(test_input[0],channel_input[0],Zc,Kb,block_length,BG,impp->gen_code); -} \ No newline at end of file +} diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c index 07062f6123..0537d0c1ef 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "assertions.h" #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c index 6fa9c5ff53..5fa7a9e125 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "assertions.h" #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c index 15d4481eb6..5b8c5cb205 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "assertions.h" #include "common/utils/LOG/log.h" #include "PHY/TOOLS/time_meas.h" diff --git a/openair1/SIMULATION/TOOLS/channel_sim.c b/openair1/SIMULATION/TOOLS/channel_sim.c index 197a296a51..de8db5d7cb 100644 --- a/openair1/SIMULATION/TOOLS/channel_sim.c +++ b/openair1/SIMULATION/TOOLS/channel_sim.c @@ -40,7 +40,6 @@ #include "PHY_INTERFACE/phy_interface_extern.h" #include "UTIL/OCG/OCG.h" #include "UTIL/OPT/opt.h" // to test OPT -#include "UTIL/FIFO/types.h" #define RF diff --git a/openair2/UTIL/FIFO/pad_list.c b/openair2/UTIL/FIFO/pad_list.c deleted file mode 100644 index 124893a756..0000000000 --- a/openair2/UTIL/FIFO/pad_list.c +++ /dev/null @@ -1,607 +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 pad_list.c -* \brief list management primimtives -* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein -* \date 2012 - 2014 -* \version 0.5 -* @ingroup util -*/ -//#define LIST_C -//#define NULL 0 - -#include -#include -#include "pad_list.h" -//#include - - -void job_list_init (Job_List_t *listP) { - listP->tail = NULL; - listP->head = NULL; - listP->nb_elements = 0; -} - -void event_list_init (Event_List_t *listP) { - listP->tail = NULL; - listP->head = NULL; - listP->nb_elements = 0; -} - -void pkt_list_init (Packet_OTG_List_t *listP) { - listP->tail = NULL; - listP->head = NULL; - listP->nb_elements = 0; -} - -//----------------------------------------------------------------------------- - -void job_list_free (Job_List_t *listP) { - Job_elt_t *le; - - while ((le = job_list_remove_head (listP))) { - free(le); - } -} - -void event_list_free (Event_List_t *listP) { - Event_elt_t *le; - - while ((le = event_list_remove_head (listP))) { - free(le); - } -} - -void pkt_list_free (Packet_OTG_List_t *listP) { - Packet_otg_elt_t *le; - - while ((le = pkt_list_remove_head (listP))) { - free(le); - } -} - -//----------------------------------------------------------------------------- - -Job_elt_t *job_list_get_head (Job_List_t *listP) { - return listP->head; -} - -Event_elt_t *event_list_get_head (Event_List_t *listP) { - return listP->head; -} - -Packet_otg_elt_t *pkt_list_get_head (Packet_OTG_List_t *listP) { - return listP->head; -} - -//----------------------------------------------------------------------------- - -/* - * remove an element from head of a list - * @param pointer on targeted list - * @return pointer on removed Job_elt_t - */ -Job_elt_t *job_list_remove_head (Job_List_t *listP) { - // access optimisation - Job_elt_t *head; - head = listP->head; - - // almost one element - if (head != NULL) { - listP->head = head->next; - listP->nb_elements = listP->nb_elements - 1; - - // if only one element, update tail - if (listP->head == NULL) { - listP->tail = NULL; - } else { - head->next = NULL; - } - } else { - //msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name); - } - - return head; -} - -Event_elt_t *event_list_remove_head (Event_List_t *listP) { - // access optimisation - Event_elt_t *head; - head = listP->head; - - // almost one element - if (head != NULL) { - listP->head = head->next; - listP->nb_elements = listP->nb_elements - 1; - - // if only one element, update tail - if (listP->head == NULL) { - listP->tail = NULL; - } else { - head->next = NULL; - } - } else { - //msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name); - } - - return head; -} - -Packet_otg_elt_t *pkt_list_remove_head (Packet_OTG_List_t *listP) { - // access optimisation - Packet_otg_elt_t *head; - head = listP->head; - - // almost one element - if (head != NULL) { - listP->head = head->next; - listP->nb_elements = listP->nb_elements - 1; - - // if only one element, update tail - if (listP->head == NULL) { - listP->tail = NULL; - } else { - head->next = NULL; - } - } else { - //msg("[MEM_MGT][WARNING] remove_head_from_list(%s) no elements\n",listP->name); - } - - return head; -} - -//----------------------------------------------------------------------------- - -Job_elt_t *job_list_remove_element (Job_elt_t *elementP, Job_List_t *listP) { - // access optimisation; - Job_elt_t *head; - - if (elementP != NULL) { - // test head - head = listP->head; - - if (listP->head == elementP) { - // almost one element - if (head != NULL) { - listP->head = head->next; - listP->nb_elements = listP->nb_elements - 1; - - // if only one element, update tail - if (listP->head == NULL) { - listP->tail = NULL; - } else { - head->next = NULL; - } - } - } else { - while (head) { - if (head->next == elementP) { - head->next = elementP->next; - listP->nb_elements = listP->nb_elements - 1; - - if (listP->tail == elementP) { - listP->tail = head; - } - - return elementP; - } else { - head = head->next; - } - } - } - } - - return elementP; -} - -Event_elt_t *event_list_remove_element (Event_elt_t *elementP, Event_List_t *listP) { - // access optimisation; - Event_elt_t *head; - - if (elementP != NULL) { - // test head - head = listP->head; - - if (listP->head == elementP) { - // almost one element - if (head != NULL) { - listP->head = head->next; - listP->nb_elements = listP->nb_elements - 1; - - // if only one element, update tail - if (listP->head == NULL) { - listP->tail = NULL; - } else { - head->next = NULL; - } - } - } else { - while (head) { - if (head->next == elementP) { - head->next = elementP->next; - listP->nb_elements = listP->nb_elements - 1; - - if (listP->tail == elementP) { - listP->tail = head; - } - - return elementP; - } else { - head = head->next; - } - } - } - } - - return elementP; -} - -Packet_otg_elt_t *pkt_list_remove_element (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) { - // access optimisation; - Packet_otg_elt_t *head; - - if (elementP != NULL) { - // test head - head = listP->head; - - if (listP->head == elementP) { - // almost one element - if (head != NULL) { - listP->head = head->next; - listP->nb_elements = listP->nb_elements - 1; - - // if only one element, update tail - if (listP->head == NULL) { - listP->tail = NULL; - } else { - head->next = NULL; - } - } - } else { - while (head) { - if (head->next == elementP) { - head->next = elementP->next; - listP->nb_elements = listP->nb_elements - 1; - - if (listP->tail == elementP) { - listP->tail = head; - } - - return elementP; - } else { - head = head->next; - } - } - } - } - - return elementP; -} - -//----------------------------------------------------------------------------- -/* - * add an element to the beginning of a list - * @param pointer on targeted list - * @return pointer on removed Job_elt_t - */ - -void job_list_add_head (Job_elt_t *elementP, Job_List_t *listP) { - // access optimisation; - Job_elt_t *head; - - if (elementP != NULL) { - head = listP->head; - listP->nb_elements = listP->nb_elements + 1; - - // almost one element - if (head == NULL) { - listP->head = elementP; - listP->tail = elementP; - } else { - elementP->next = head; - listP->head = elementP; - } - } -} - -void event_list_add_head (Event_elt_t *elementP, Event_List_t *listP) { - // access optimisation; - Event_elt_t *head; - - if (elementP != NULL) { - head = listP->head; - listP->nb_elements = listP->nb_elements + 1; - - // almost one element - if (head == NULL) { - listP->head = elementP; - listP->tail = elementP; - } else { - elementP->next = head; - listP->head = elementP; - } - } -} - -void pkt_list_add_head (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) { - // access optimisation; - Packet_otg_elt_t *head; - - if (elementP != NULL) { - head = listP->head; - listP->nb_elements = listP->nb_elements + 1; - - // almost one element - if (head == NULL) { - listP->head = elementP; - listP->tail = elementP; - } else { - elementP->next = head; - listP->head = elementP; - } - } -} - -void event_list_add_element (Event_elt_t *elementP, Event_elt_t *previous, Event_List_t *listP) { - // access optimisation; - Event_elt_t *next; - - if (elementP != NULL && previous != NULL) { - elementP->next = NULL; - next = previous->next; - listP->nb_elements = listP->nb_elements + 1; - - // almost one element - if (next == NULL) { - previous->next = elementP; - listP->tail = elementP; - } else { - elementP->next = previous->next; - previous->next = elementP; - } - } -} - - -//----------------------------------------------------------------------------- -/* - * add an element to the end of a list - * @param pointer on targeted list - * @return pointer on removed Job_elt_t - */ -void job_list_add_tail_eurecom (Job_elt_t *elementP, Job_List_t *listP) { - Job_elt_t *tail; - - if (elementP != NULL) { - // access optimisation - listP->nb_elements = listP->nb_elements + 1; - elementP->next = NULL; - tail = listP->tail; - - // almost one element - if (tail == NULL) { - listP->head = elementP; - } else { - tail->next = elementP; - } - - listP->tail = elementP; - } else { - //msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n"); - } -} - -void event_list_add_tail_eurecom (Event_elt_t *elementP, Event_List_t *listP) { - Event_elt_t *tail; - - if (elementP != NULL) { - // access optimisation - listP->nb_elements = listP->nb_elements + 1; - elementP->next = NULL; - tail = listP->tail; - - // almost one element - if (tail == NULL) { - listP->head = elementP; - } else { - tail->next = elementP; - } - - listP->tail = elementP; - } else { - //msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n"); - } -} - -void pkt_list_add_tail_eurecom (Packet_otg_elt_t *elementP, Packet_OTG_List_t *listP) { - Packet_otg_elt_t *tail; - - if (elementP != NULL) { - // access optimisation - listP->nb_elements = listP->nb_elements + 1; - elementP->next = NULL; - tail = listP->tail; - - // almost one element - if (tail == NULL) { - listP->head = elementP; - } else { - tail->next = elementP; - } - - listP->tail = elementP; - } else { - //msg("[CNT_LIST][ERROR] add_cnt_tail() element NULL\n"); - } -} - -//----------------------------------------------------------------------------- -void job_list_add_list (Job_List_t *sublistP, Job_List_t *listP) { - if (sublistP) { - if (sublistP->head) { - // access optimisation - Job_elt_t *tail; - tail = listP->tail; - - // almost one element - if (tail == NULL) { - listP->head = sublistP->head; - } else { - tail->next = sublistP->head; - } - - listP->tail = sublistP->tail; - // clear sublist - sublistP->head = NULL; - sublistP->tail = NULL; - listP->nb_elements = listP->nb_elements + sublistP->nb_elements; - sublistP->nb_elements = 0; - } - } -} - -void event_list_add_list (Event_List_t *sublistP, Event_List_t *listP) { - if (sublistP) { - if (sublistP->head) { - // access optimisation - Event_elt_t *tail; - tail = listP->tail; - - // almost one element - if (tail == NULL) { - listP->head = sublistP->head; - } else { - tail->next = sublistP->head; - } - - listP->tail = sublistP->tail; - // clear sublist - sublistP->head = NULL; - sublistP->tail = NULL; - listP->nb_elements = listP->nb_elements + sublistP->nb_elements; - sublistP->nb_elements = 0; - } - } -} - -void pkt_list_add_list (Packet_OTG_List_t *sublistP, Packet_OTG_List_t *listP) { - if (sublistP) { - if (sublistP->head) { - // access optimisation - Packet_otg_elt_t *tail; - tail = listP->tail; - - // almost one element - if (tail == NULL) { - listP->head = sublistP->head; - } else { - tail->next = sublistP->head; - } - - listP->tail = sublistP->tail; - // clear sublist - sublistP->head = NULL; - sublistP->tail = NULL; - listP->nb_elements = listP->nb_elements + sublistP->nb_elements; - sublistP->nb_elements = 0; - } - } -} - -//----------------------------------------------------------------------------- -void job_list_display (Job_List_t *listP) { - //Correct the output once the content of struct Job is fixed - /*Job_elt_t *cursor; - unsigned short nb_elements = 0; - - if (listP) { - cursor = listP->head; - if (cursor) { - while (cursor != NULL) { - if (cursor->job.type == eNB_DL) - printf ("DL eNB From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid); - else if (cursor->job.type == UE_DL) - printf ("DL UE From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid); - else if (cursor->job.type == UE_UL) - printf ("UL UE From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid); - else if (cursor->job.type == eNB_UL) - printf ("UL eNB From (%d,%d)\n", (cursor->job).nid, (cursor->job).mid); - //msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2); - cursor = cursor->next; - nb_elements++; - } - printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements); - //msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements); - } - } else { - printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n"); - //msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n"); - }*/ -} - -void event_list_display (Event_List_t *listP) { - Event_elt_t *cursor; - unsigned short nb_elements = 0; - - if (listP) { - cursor = listP->head; - - if (cursor) { - while (cursor != NULL) { - printf ("Ev (%d,%d)\n", (cursor->event).type, (cursor->event).frame); - //msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2); - cursor = cursor->next; - nb_elements++; - } - - printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements); - //msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements); - } - } else { - printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n"); - //msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n"); - } -} - -void pkt_list_display (Packet_OTG_List_t *listP) { - Packet_otg_elt_t *cursor; - unsigned short nb_elements = 0; - - if (listP) { - cursor = listP->head; - - if (cursor) { - while (cursor != NULL) { - printf ("Pkt (DST %d, RB %ld)\n", (cursor->otg_pkt).dst_id, (cursor->otg_pkt).rb_id); - //msg ("From (%d,%d) To (%d,%d)\n", (cursor->job).node1, (cursor->job).master1, (cursor->job).node2, (cursor->job).master2); - cursor = cursor->next; - nb_elements++; - } - - printf ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements); - //msg ("Found nb_elements %d nb_elements %d\n", nb_elements, listP->nb_elements); - } - } else { - printf ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n"); - //msg ("[SDU_MNGT][WARNING] display_cnt_dbl_lk_list_up() : list is NULL\n"); - } -} diff --git a/openair2/UTIL/FIFO/pad_list.h b/openair2/UTIL/FIFO/pad_list.h deleted file mode 100644 index 2a9ef9893f..0000000000 --- a/openair2/UTIL/FIFO/pad_list.h +++ /dev/null @@ -1,87 +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 pad_list.c -* \brief list management primimtives -* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein -* \date 2012 - 2014 -* \version 0.5 -* @ingroup util -*/ - -#ifndef __list_H__ -#define __list_H__ - -#include "types.h" -//----------------------------------------------------------------------------- - -typedef struct Job_List_s { - Job_elt_t *head; - Job_elt_t *tail; - int nb_elements; -} Job_List_t; - -typedef struct Event_List_s { - Event_elt_t *head; - Event_elt_t *tail; - int nb_elements; -} Event_List_t; - -typedef struct Packet_OTG_List_s { - Packet_otg_elt_t *head; - Packet_otg_elt_t *tail; - int nb_elements; -} Packet_OTG_List_t; - -//----------------------------------------------------------------------------- -void job_list_init (Job_List_t*); -void job_list_free (Job_List_t* listP); -Job_elt_t* job_list_get_head (Job_List_t*); -Job_elt_t* job_list_remove_head (Job_List_t* ); -Job_elt_t* job_list_remove_element (Job_elt_t*, Job_List_t*); -void job_list_add_head (Job_elt_t* , Job_List_t* ); -void job_list_add_tail_eurecom (Job_elt_t* , Job_List_t* ); -void job_list_add_list (Job_List_t* , Job_List_t* ); -void job_list_display (Job_List_t* ); - -void event_list_init (Event_List_t*); -void event_list_free (Event_List_t* listP); -Event_elt_t* event_list_get_head (Event_List_t*); -Event_elt_t* event_list_remove_head (Event_List_t* ); -Event_elt_t* event_list_remove_element (Event_elt_t*, Event_List_t*); -void event_list_add_head (Event_elt_t* , Event_List_t* ); -void event_list_add_element (Event_elt_t* , Event_elt_t* , Event_List_t* ); -void event_list_add_tail_eurecom (Event_elt_t* , Event_List_t* ); -void event_list_add_list (Event_List_t* , Event_List_t* ); -void event_list_display (Event_List_t* ); - -void pkt_list_init (Packet_OTG_List_t*); -void pkt_list_free (Packet_OTG_List_t* listP); -Packet_otg_elt_t* pkt_list_get_head (Packet_OTG_List_t*); -Packet_otg_elt_t* pkt_list_remove_head (Packet_OTG_List_t* ); -Packet_otg_elt_t* pkt_list_remove_element (Packet_otg_elt_t*, Packet_OTG_List_t*); -void pkt_list_add_head (Packet_otg_elt_t* , Packet_OTG_List_t* ); -void pkt_list_add_element (Packet_otg_elt_t* , Packet_otg_elt_t* , Packet_OTG_List_t* ); -void pkt_list_add_tail_eurecom (Packet_otg_elt_t* , Packet_OTG_List_t* ); -void pkt_list_add_list (Packet_OTG_List_t* , Packet_OTG_List_t* ); -void pkt_list_display (Packet_OTG_List_t* ); - -#endif diff --git a/openair2/UTIL/FIFO/types.h b/openair2/UTIL/FIFO/types.h deleted file mode 100644 index f949b2b72b..0000000000 --- a/openair2/UTIL/FIFO/types.h +++ /dev/null @@ -1,127 +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 pad_list.c -* \brief list management primimtives -* \author Mohamed Said MOSLI BOUKSIAA, Lionel GAUTHIER, Navid Nikaein -* \date 2012 - 2014 -* \version 0.5 -* @ingroup util -*/ - -#ifndef __FIFO_TYPES_H__ -#define __FIFO_TYPES_H__ -#include "platform_types.h" - -/* Types regrouping both user-defined and regular events */ -typedef enum { - MIN_ET=0, - OAI_ET=MIN_ET, // config events - SYS_ET, - TOPO_ET, - APP_ET, - EMU_ET, - DL_ET, // frame events - UL_ET, - S_ET, - PHY_ET, // protocol events - MAC_ET, - RLC_ET, - PDCP_ET, - RRC_ET, - MAX_ET -} Event_Type_t; - -/* decomposition of node functions into jobs for a given event */ -typedef enum Job_type_e { JT_OTG, JT_PDCP, JT_PHY_MAC, JT_INIT_SYNC, JT_DL, JT_UL, RN_DL, RN_UL, JT_END} Job_Type_t; - -typedef enum Operation_Type_e { READ, WRITE, RESET} Operation_Type_t; - -typedef struct Job_s { - enum Job_type_e type; - int exe_time; /* execution time at the worker*/ - int nid; /* node id*/ - eNB_flag_t eNB_flag; - frame_t frame; - int last_slot; - int next_slot; - int ctime; -} Job_t; - -typedef struct Signal_buffers_s { // (s = transmit, r,r0 = receive) - double **s_re; - double **s_im; - double **r_re; - double **r_im; - double **r_re0; - double **r_im0; -} Signal_buffers_t; - -/*!\brief sybframe type : DL, UL, SF, */ - -typedef struct Packet_otg_s { - unsigned int sdu_buffer_size; - unsigned char *sdu_buffer; - module_id_t module_id; - rb_id_t rb_id; - module_id_t dst_id; - boolean_t is_ue; - pdcp_transmission_mode_t mode; -} Packet_otg_t; - -typedef struct { - Event_Type_t type; - enum Operation_Type_e optype; //op - char *key; - void *value; - frame_t frame; - int ue; - int lcid; -} Event_t; - -/*typedef struct Global_Time { - uint32_t frame; - int32_t slot; - int32_t last_slot; - int32_t next_slot; - double time_s; - double time_ms; -};*/ - - - -typedef struct Packet_otg_elt_s { - struct Packet_otg_elt_s *next; - struct Packet_otg_elt_s *previous; - Packet_otg_t otg_pkt; -} Packet_otg_elt_t; - -typedef struct Job_element_s { - struct Job_element_s *next; - Job_t job; -} Job_elt_t; - -typedef struct Event_element_s { - struct Event_element_s *next; - struct Event_element_s *previous; - Event_t event; -} Event_elt_t; -#endif From 9ead3d7ad2c4e54abbb1ceed0a405b72664b0da1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 13:33:26 +0100 Subject: [PATCH 612/883] Clean up CMakeLists.txt (no functional changes) --- cmake_targets/CMakeLists.txt | 137 +++++++---------------------------- 1 file changed, 25 insertions(+), 112 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index d059a34247..ad5594d393 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -790,19 +790,13 @@ add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET") #NOKIA config enhancement -set (CONFIG_ROOTDIR - ${OPENAIR_DIR}/common/config - ) -set (CONFIG_SOURCES +set (CONFIG_ROOTDIR ${OPENAIR_DIR}/common/config) +add_library(CONFIG_LIB ${CONFIG_ROOTDIR}/config_load_configmodule.c ${CONFIG_ROOTDIR}/config_userapi.c ${CONFIG_ROOTDIR}/config_cmdline.c - ) -set (CONFIG_LIBCONFIG_SOURCES - ${CONFIG_ROOTDIR}/libconfig/config_libconfig.c - ) -add_library(CONFIG_LIB ${CONFIG_SOURCES}) -add_library(params_libconfig MODULE ${CONFIG_LIBCONFIG_SOURCES} ) +) +add_library(params_libconfig MODULE ${CONFIG_ROOTDIR}/libconfig/config_libconfig.c) target_link_libraries(params_libconfig config) # shared library loader set (SHLIB_LOADER_SOURCES @@ -1261,15 +1255,6 @@ set(FSPT_MSG_LIB FSPT_MSG) message("fspt c dir is : ${FSPT_C_DIR}") include_directories (${FSPT_C_DIR}) -# add_library(ASYNC_IF -# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/socket_link.c -# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/link_manager.c -# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/message_queue.c -# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/ringbuffer_queue.c -# ) -# set(ASYNC_IF_LIB ASYNC_IF) -# include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF) - set(PROTOBUF_LIB "protobuf-c") #set(PROTOBUF_LIB "protobuf") #for Cpp @@ -1280,16 +1265,18 @@ add_library(HASHTABLE ) include_directories(${OPENAIR_DIR}/common/utils/hashtable) -set(UTIL_SRC +add_library(UTIL ${OPENAIR2_DIR}/UTIL/LISTS/list.c ${OPENAIR2_DIR}/UTIL/LISTS/list2.c ${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/utils/LOG/vcd_signal_dumper.c ${OPENAIR2_DIR}/UTIL/MATH/oml.c ${OPENAIR2_DIR}/UTIL/OPT/probe.c + ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c + ${OPENAIR_DIR}/common/utils/utils.c + ${OPENAIR_DIR}/common/utils/system.c + ${OPENAIR_DIR}/common/utils/backtrace.c ) -add_library(UTIL ${UTIL_SRC}) -add_dependencies(UTIL rrc_flag) set(SECU_OSA_SRC ${OPENAIR2_DIR}/UTIL/OSA/osa_key_deriver.c @@ -2662,7 +2649,7 @@ add_library(minimal_lib ${OPENAIR_DIR}/common/utils/minimal_stub.c ${T_SOURCE} ) -target_link_libraries(minimal_lib pthread dl ${T_LIB} ${CONFIG_LIB}) +target_link_libraries(minimal_lib pthread dl ${T_LIB} CONFIG_LIB) add_executable(nfapi_test ${OPENAIR_DIR}/openair2/NR_PHY_INTERFACE/nfapi_5g_test.c @@ -2691,7 +2678,6 @@ add_executable(lte-softmodem ${OPENAIR_TARGETS}/RT/USER/lte-ru.c ${OPENAIR_TARGETS}/RT/USER/ru_control.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/ENB_APP/NB_IoT_interface.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c @@ -2706,14 +2692,11 @@ add_executable(lte-softmodem ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${PHY_INTERFACE_DIR}/queue_t.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer) @@ -2726,14 +2709,13 @@ target_link_libraries (lte-softmodem -Wl,--end-group z dl) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) +target_link_libraries (lte-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-softmodem ${T_LIB}) add_executable(ocp-enb ${OPENAIR_DIR}/executables/main-ocp.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/executables/main-fs6.c ${OPENAIR_DIR}/executables/transport_split.c @@ -2749,14 +2731,11 @@ add_executable(ocp-enb ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${PHY_INTERFACE_DIR}/queue_t.c ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_libconfig rfsimulator) @@ -2768,7 +2747,7 @@ target_link_libraries (ocp-enb PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) -target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB}) +target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB}) add_executable(oairu ${OPENAIR_TARGETS}/RT/USER/lte-ru.c @@ -2777,23 +2756,18 @@ add_executable(oairu ${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/executables/main_ru.c ${T_SOURCE} - ${OPENAIR_DIR}/common/utils/LOG/log.c - ${CONFIG_SOURCES} - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${SHLIB_LOADER_SOURCES} ) target_link_libraries (oairu -Wl,--start-group SCHED_RU_LIB - PHY_COMMON PHY_RU + PHY_COMMON PHY_RU UTIL -Wl,--end-group z dl) -target_link_libraries (oairu pthread m ${CONFIG_LIB} rt ${CMAKE_DL_LIBS} ${T_LIB}) +target_link_libraries (oairu pthread m CONFIG_LIB rt ${CMAKE_DL_LIBS} ${T_LIB}) # lte-uesoftmodem is UE implementation @@ -2812,13 +2786,10 @@ add_executable(lte-uesoftmodem ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) @@ -2836,7 +2807,7 @@ target_link_libraries (lte-uesoftmodem -Wl,--end-group z dl) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (lte-uesoftmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${T_LIB}) @@ -2849,7 +2820,6 @@ add_executable(nr-softmodem ${s1ap_h} # ${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_DIR}/executables/nr-gnb.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/executables/nr-ru.c ${OPENAIR_DIR}/executables/nr-softmodem.c ${OPENAIR_DIR}/executables/softmodem-common.c @@ -2859,15 +2829,12 @@ add_executable(nr-softmodem ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${PHY_INTERFACE_DIR}/queue_t.c ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c ) @@ -2881,7 +2848,7 @@ target_link_libraries (nr-softmodem -Wl,--end-group z dl) target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (nr-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (nr-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (nr-softmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (nr-softmodem ${T_LIB}) @@ -2893,7 +2860,6 @@ add_executable(ocp-gnb ${s1ap_h} # ${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_DIR}/executables/ocp-gnb.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c @@ -2902,12 +2868,9 @@ add_executable(ocp-gnb ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${PHY_INTERFACE_DIR}/queue_t.c ${XFORMS_SOURCE_NR} ${T_SOURCE} - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ${XFORMSINTERFACE_SOURCE} ) @@ -2921,7 +2884,7 @@ target_link_libraries (ocp-gnb -Wl,--end-group z dl) target_link_libraries (ocp-gnb ${LIBXML2_LIBRARIES} ) -target_link_libraries (ocp-gnb pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (ocp-gnb pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (ocp-gnb ${LIB_LMS_LIBRARIES}) target_link_libraries (ocp-gnb ${T_LIB}) add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif rfsimulator nrscope) @@ -2934,7 +2897,6 @@ add_executable(nr-uesoftmodem ${rrc_h} ${s1ap_h} # ${OPENAIR_BIN_DIR}/messages_xml.h - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/executables/nr-uesoftmodem.c ${OPENAIR_DIR}/executables/nr-ue.c ${OPENAIR_DIR}/executables/softmodem-common.c @@ -2946,13 +2908,9 @@ add_executable(nr-uesoftmodem ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} - ${UTIL_SRC} - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) @@ -2967,7 +2925,7 @@ target_link_libraries (nr-uesoftmodem -Wl,--end-group z dl) target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) -target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (nr-uesoftmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${T_LIB}) @@ -2989,30 +2947,25 @@ endif (CUDA_FOUND) add_executable(dlsim_tm4 ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/dlsim_tm4.c ${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope_tm4.c - ${OPENAIR_DIR}/common/utils/system.c ${T_SOURCE} ) target_link_libraries (dlsim_tm4 -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ITTI -Wl,--end-group - pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${T_LIB} + pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${T_LIB} ) add_executable(rftest ${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_test.c ${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_scope.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR_DIR}/executables/softmodem-common.c - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) -target_link_libraries(rftest minimal_lib PHY_NR_COMMON pthread dl m forms ${T_LIB} ) +target_link_libraries(rftest minimal_lib CONFIG_LIB PHY_NR_COMMON UTIL pthread dl m forms ${T_LIB} ) add_executable(polartest ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c - ${OPENAIR_DIR}/common/utils/backtrace.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/common/utils/system.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -3023,9 +2976,7 @@ target_link_libraries(polartest add_executable(smallblocktest ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/smallblocktest.c - ${OPENAIR_DIR}/common/utils/backtrace.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/common/utils/system.c ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -3055,11 +3006,7 @@ target_link_libraries(ldpctest add_executable(nr_dlschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c - ${UTIL_SRC} ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -3070,11 +3017,7 @@ target_link_libraries(nr_dlschsim add_executable(nr_pbchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c - ${UTIL_SRC} ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -3086,12 +3029,7 @@ target_link_libraries(nr_pbchsim #PUCCH ---> Prashanth add_executable(nr_pucchsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c - ${OPENAIR_DIR}/common/utils/backtrace.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/common/utils/system.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c - ${UTIL_SRC} ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -3102,17 +3040,13 @@ target_link_libraries(nr_pucchsim add_executable(nr_dlsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlsim.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${NR_UE_RRC_DIR}/rrc_nsa.c ${NFAPI_USER_DIR}/nfapi.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${PHY_INTERFACE_DIR}/queue_t.c - ${UTIL_SRC} ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -3124,17 +3058,13 @@ target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR) add_executable(nr_prachsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${NR_UE_RRC_DIR}/rrc_nsa.c ${NFAPI_USER_DIR}/nfapi.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${PHY_INTERFACE_DIR}/queue_t.c - ${UTIL_SRC} ${T_SOURCE} ${SHLIB_LOADER_SOURCES}) target_link_libraries(nr_prachsim @@ -3143,12 +3073,8 @@ target_link_libraries(nr_prachsim add_executable(nr_ulschsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${PHY_INTERFACE_DIR}/queue_t.c - ${UTIL_SRC} ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -3159,9 +3085,6 @@ target_link_libraries(nr_ulschsim add_executable(nr_ulsim ${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c @@ -3169,7 +3092,6 @@ add_executable(nr_ulsim ${NR_UE_RRC_DIR}/rrc_nsa.c ${NFAPI_USER_DIR}/nfapi.c ${PHY_INTERFACE_DIR}/queue_t.c - ${UTIL_SRC} ${T_SOURCE} ${SHLIB_LOADER_SOURCES} ) @@ -3183,22 +3105,17 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr add_executable(${myExe} ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c - ${OPENAIR_DIR}/common/utils/backtrace.c - ${OPENAIR_DIR}/common/utils/system.c - ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c ${XFORMS_SOURCE} ${T_SOURCE} - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ${NFAPI_USER_DIR}/nfapi.c ) target_link_libraries (${myExe} -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU LFDS ITTI LFDS7 -Wl,--end-group - pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl + pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl ) endforeach(myExe) @@ -3212,7 +3129,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY LFDS ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY LFDS ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} CONFIG_LIB ) add_executable(test_epc_play_scenario @@ -3231,7 +3148,7 @@ add_executable(test_epc_play_scenario ) target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} CONFIG_LIB ) @@ -3251,7 +3168,7 @@ foreach(myExe s1ap ${OPENAIR3_DIR}/TEST/test_${myExe}.c ) target_link_libraries (test_${myExe} - -Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} CONFIG_LIB ) endforeach(myExe) @@ -3370,16 +3287,12 @@ add_executable(nr-ittisim ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c - ${OPENAIR_DIR}/common/utils/utils.c - ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} - ${CONFIG_SOURCES} ${SHLIB_LOADER_SOURCES} ) @@ -3393,7 +3306,7 @@ target_link_libraries (nr-ittisim -Wl,--end-group z dl) target_link_libraries (nr-ittisim ${LIBXML2_LIBRARIES}) -target_link_libraries (nr-ittisim pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) +target_link_libraries (nr-ittisim pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (nr-ittisim ${LIB_LMS_LIBRARIES}) target_link_libraries (nr-ittisim ${T_LIB}) From 8419166fc47252040de44ad335bea3b30e59960b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 16:52:49 +0100 Subject: [PATCH 613/883] Move time_meas.{c,h} to common/utils/ --- cmake_targets/CMakeLists.txt | 4 +--- {openair1/PHY/TOOLS => common/utils}/time_meas.c | 0 {openair1/PHY/TOOLS => common/utils}/time_meas.h | 0 executables/nr-softmodem.c | 2 -- executables/nr-uesoftmodem.c | 1 - openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h | 2 +- openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c | 2 +- openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c | 2 +- openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c | 2 +- .../PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c | 2 +- openair1/PHY/defs_L1_NB_IoT.h | 2 +- openair1/PHY/defs_RU.h | 2 +- openair1/PHY/defs_UE.h | 2 +- openair1/PHY/defs_common.h | 2 +- openair1/PHY/defs_eNB.h | 4 ++-- openair1/PHY/defs_nr_UE.h | 2 +- openair2/LAYER2/MAC/mac.h | 2 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 +- targets/RT/USER/lte-ru.c | 1 - targets/RT/USER/lte-softmodem.c | 1 - 20 files changed, 15 insertions(+), 22 deletions(-) rename {openair1/PHY/TOOLS => common/utils}/time_meas.c (100%) rename {openair1/PHY/TOOLS => common/utils}/time_meas.h (100%) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index ad5594d393..742dfa67fe 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1276,6 +1276,7 @@ add_library(UTIL ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/backtrace.c + ${OPENAIR_DIR}/common/utils/time_meas.c ) set(SECU_OSA_SRC @@ -1539,7 +1540,6 @@ set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c ${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c - ${OPENAIR1_DIR}/PHY/TOOLS/time_meas.c ${OPENAIR1_DIR}/PHY/TOOLS/lut.c ) @@ -1676,7 +1676,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c ${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c - ${OPENAIR1_DIR}/PHY/TOOLS/time_meas.c ${OPENAIR1_DIR}/PHY/TOOLS/lut.c ${PHY_POLARSRC} ${PHY_SMALLBLOCKSRC} @@ -1730,7 +1729,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/TOOLS/signal_energy.c ${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c ${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c - ${OPENAIR1_DIR}/PHY/TOOLS/time_meas.c ${OPENAIR1_DIR}/PHY/TOOLS/lut.c ${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c # ${OPENAIR1_DIR}/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_test.c diff --git a/openair1/PHY/TOOLS/time_meas.c b/common/utils/time_meas.c similarity index 100% rename from openair1/PHY/TOOLS/time_meas.c rename to common/utils/time_meas.c diff --git a/openair1/PHY/TOOLS/time_meas.h b/common/utils/time_meas.h similarity index 100% rename from openair1/PHY/TOOLS/time_meas.h rename to common/utils/time_meas.h diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 7410e303b1..551e22d19f 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -62,8 +62,6 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "common/utils/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" -//#include "PHY/TOOLS/time_meas.h" - #include "intertask_interface.h" #include "PHY/INIT/phy_init.h" diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 7663e9ebd8..76c21bb422 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -61,7 +61,6 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "UTIL/OPT/opt.h" #include "enb_config.h" -//#include "PHY/TOOLS/time_meas.h" #include "intertask_interface.h" diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h index 99b6f75f93..b7b15b5d33 100644 --- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h +++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h @@ -31,7 +31,7 @@ #ifndef __NR_LDPC_TYPES__H__ #define __NR_LDPC_TYPES__H__ -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "nrLDPCdecoder_defs.h" // ============================================================================== // TYPES diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c index bef5b291dc..73c165a2c8 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder2.c @@ -36,7 +36,7 @@ #include #include "assertions.h" #include "common/utils/LOG/log.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "defs.h" #include "ldpc384_byte.c" diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c index 0537d0c1ef..d05ced18c6 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim.c @@ -35,7 +35,7 @@ #include #include "assertions.h" #include "common/utils/LOG/log.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c index 5fa7a9e125..958ef5aca7 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8seg.c @@ -35,7 +35,7 @@ #include #include "assertions.h" #include "common/utils/LOG/log.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" #include "ldpc_encode_parity_check.c" #include "ldpc_generate_coefficient.c" diff --git a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c index 5b8c5cb205..9ef8cbfe65 100644 --- a/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c +++ b/openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c @@ -35,7 +35,7 @@ #include #include "assertions.h" #include "common/utils/LOG/log.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "openair1/PHY/CODING/nrLDPC_defs.h" #include "ldpc_encode_parity_check.c" diff --git a/openair1/PHY/defs_L1_NB_IoT.h b/openair1/PHY/defs_L1_NB_IoT.h index 51b7c63b72..b4aee78310 100644 --- a/openair1/PHY/defs_L1_NB_IoT.h +++ b/openair1/PHY/defs_L1_NB_IoT.h @@ -122,7 +122,7 @@ static inline void* malloc16_clear( size_t size ) #include "PHY/impl_defs_top_NB_IoT.h" #include "PHY/impl_defs_lte_NB_IoT.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" //#include "PHY/CODING/defs.h" #include "PHY/CODING/defs_NB_IoT.h" #include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h" diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 76dd92ef5d..6b18e55c4b 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -36,7 +36,7 @@ #include "common_lib.h" #include "openairinterface5g_limits.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "defs_common.h" #include "nfapi_nr_interface_scf.h" diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 06aad301ca..fa55384093 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -59,7 +59,7 @@ #include "defs_common.h" #include "impl_defs_top.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "PHY/CODING/coding_defs.h" #include "PHY/TOOLS/tools_defs.h" #include "platform_types.h" diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index c79530434a..86df85db5c 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -58,7 +58,7 @@ #include "assertions.h" //#include -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "platform_types.h" #define MAX_NUM_RU_PER_eNB 64 diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 995a4a934e..3a48dc51d6 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -58,7 +58,7 @@ #include "defs_common.h" #include "defs_RU.h" #include "impl_defs_top.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" //#include "PHY/CODING/coding_defs.h" #include "PHY/TOOLS/tools_defs.h" #include "platform_types.h" @@ -202,7 +202,7 @@ typedef struct { int repetition_number[4]; } LTE_eNB_PRACH; -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "PHY/CODING/coding_defs.h" #include "PHY/TOOLS/tools_defs.h" #include "PHY/LTE_TRANSPORT/transport_eNB.h" diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 0fa839f104..72755374ce 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -96,7 +96,7 @@ #include "impl_defs_top.h" #include "impl_defs_nr.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "PHY/CODING/coding_defs.h" #include "PHY/TOOLS/tools_defs.h" #include "platform_types.h" diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index cb93c2feb8..6637d05a8a 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -69,7 +69,7 @@ #include "nfapi_interface.h" #include "PHY_INTERFACE/IF_Module.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" #include "PHY/defs_common.h" // for PRACH_RESOURCES_t #include "PHY/LTE_TRANSPORT/transport_common.h" diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 22a0932c3f..be7a58154d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -55,7 +55,7 @@ /* PHY */ #include "PHY/defs_gNB.h" -#include "PHY/TOOLS/time_meas.h" +#include "time_meas.h" /* Interface */ #include "nfapi_nr_interface_scf.h" diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 15b4319260..7e897c7deb 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -61,7 +61,6 @@ #include "common/utils/LOG/vcd_signal_dumper.h" #include "targets/ARCH/COMMON/common_lib.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" -//#include "PHY/TOOLS/time_meas.h" /* these variables have to be defined before including ENB_APP/enb_paramdef.h */ static int DEFBANDS[] = {7}; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 61e2982626..07f900b641 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -75,7 +75,6 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "common/utils/LOG/vcd_signal_dumper.h" #include "UTIL/OPT/opt.h" #include "enb_config.h" -//#include "PHY/TOOLS/time_meas.h" #include "create_tasks.h" From 7d70d45d13f09d38973b2abefd59fe41fff2da3d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 16:55:48 +0100 Subject: [PATCH 614/883] Remove dead code --- ci-scripts/cppcheck_suppressions.list | 4 - cmake_targets/CMakeLists.txt | 32 - .../attach_complete.pdml | 4242 ---------------- .../enb.band7.tm1.usrpb210.epc.local.conf | 162 - .../TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf | 159 - .../TEST_1MME_1ENB_1UE_ATTACH_GUTI/trace.pdml | 4411 ----------------- openair3/TEST/EPC_TEST/generate_scenario.c | 684 --- openair3/TEST/EPC_TEST/generate_scenario.h | 119 - openair3/TEST/EPC_TEST/play_scenario.c | 1240 ----- openair3/TEST/EPC_TEST/play_scenario.h | 499 -- openair3/TEST/EPC_TEST/play_scenario_decode.c | 68 - .../TEST/EPC_TEST/play_scenario_display.c | 348 -- openair3/TEST/EPC_TEST/play_scenario_fsm.c | 586 --- openair3/TEST/EPC_TEST/play_scenario_parse.c | 592 --- openair3/TEST/EPC_TEST/play_scenario_s1ap.c | 1168 ----- .../EPC_TEST/play_scenario_s1ap_compare_ie.c | 231 - .../EPC_TEST/play_scenario_s1ap_eNB_defs.h | 242 - openair3/TEST/EPC_TEST/play_scenario_sctp.c | 112 - openair3/TEST/oaisim_mme_client_test.c | 122 - openair3/TEST/oaisim_mme_itti_test.c | 93 - openair3/TEST/oaisim_mme_list_benchmark.c | 261 - openair3/TEST/oaisim_mme_s1ap_test.c | 179 - openair3/TEST/oaisim_mme_sctp_test.c | 74 - openair3/TEST/oaisim_mme_test_s1c.c | 339 -- openair3/TEST/oaisim_mme_test_s1c.h | 30 - openair3/TEST/oaisim_mme_test_s1c_s1ap.c | 291 -- openair3/TEST/oaisim_mme_test_s1c_s1ap.h | 60 - openair3/TEST/oaisim_mme_test_s1c_scenario.c | 279 -- openair3/TEST/oaisim_mme_test_s1c_scenario.h | 56 - openair3/TEST/oaisim_mme_test_s1c_scenario1.c | 181 - 30 files changed, 16864 deletions(-) delete mode 100644 openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml delete mode 100644 openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf delete mode 100644 openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf delete mode 100644 openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/trace.pdml delete mode 100644 openair3/TEST/EPC_TEST/generate_scenario.c delete mode 100644 openair3/TEST/EPC_TEST/generate_scenario.h delete mode 100644 openair3/TEST/EPC_TEST/play_scenario.c delete mode 100644 openair3/TEST/EPC_TEST/play_scenario.h delete mode 100644 openair3/TEST/EPC_TEST/play_scenario_decode.c delete mode 100644 openair3/TEST/EPC_TEST/play_scenario_display.c delete mode 100644 openair3/TEST/EPC_TEST/play_scenario_fsm.c delete mode 100644 openair3/TEST/EPC_TEST/play_scenario_parse.c delete mode 100644 openair3/TEST/EPC_TEST/play_scenario_s1ap.c delete mode 100644 openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c delete mode 100644 openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h delete mode 100644 openair3/TEST/EPC_TEST/play_scenario_sctp.c delete mode 100644 openair3/TEST/oaisim_mme_client_test.c delete mode 100644 openair3/TEST/oaisim_mme_itti_test.c delete mode 100644 openair3/TEST/oaisim_mme_list_benchmark.c delete mode 100644 openair3/TEST/oaisim_mme_s1ap_test.c delete mode 100644 openair3/TEST/oaisim_mme_sctp_test.c delete mode 100644 openair3/TEST/oaisim_mme_test_s1c.c delete mode 100644 openair3/TEST/oaisim_mme_test_s1c.h delete mode 100644 openair3/TEST/oaisim_mme_test_s1c_s1ap.c delete mode 100644 openair3/TEST/oaisim_mme_test_s1c_s1ap.h delete mode 100644 openair3/TEST/oaisim_mme_test_s1c_scenario.c delete mode 100644 openair3/TEST/oaisim_mme_test_s1c_scenario.h delete mode 100644 openair3/TEST/oaisim_mme_test_s1c_scenario1.c diff --git a/ci-scripts/cppcheck_suppressions.list b/ci-scripts/cppcheck_suppressions.list index f8438a4276..ff4cac20b3 100644 --- a/ci-scripts/cppcheck_suppressions.list +++ b/ci-scripts/cppcheck_suppressions.list @@ -50,10 +50,6 @@ memleak:openair1/PHY/CODING/TESTBENCH/ltetest.c invalidPrintfArgType_sint:openair1/PHY/CODING/TESTBENCH/pdcch_test.c // //----------------------------------------------------------------------------- -// oaisim deprecated, remove? -doubleFree:openair3/TEST/oaisim_mme_list_benchmark.c -// -//----------------------------------------------------------------------------- // is itti analyzer deprecated nullPointer:common/utils/itti_analyzer/itti_analyzer.c nullPointerRedundantCheck:common/utils/itti_analyzer/libbuffers/buffers.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 742dfa67fe..d3041f9112 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -3118,38 +3118,6 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr endforeach(myExe) -add_executable(test_epc_generate_scenario - ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.h - ${OPENAIR2_DIR}/ENB_APP/enb_config.h - ${OPENAIR2_DIR}/COMMON/commonDef.h - ${OPENAIR2_DIR}/COMMON/messages_def.h - ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h - ) -target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY LFDS ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} CONFIG_LIB - ) - -add_executable(test_epc_play_scenario - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_decode.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_display.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c - ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h - ${OPENAIR2_DIR}/COMMON/commonDef.h - ${OPENAIR2_DIR}/COMMON/messages_def.h - ) -target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) -target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} CONFIG_LIB - ) - - #unitary tests for Core NEtwork pieces ################################# foreach(myExe s1ap diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml deleted file mode 100644 index f7c27272aa..0000000000 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml +++ /dev/null @@ -1,4242 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf deleted file mode 100644 index ad6c81f56b..0000000000 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf +++ /dev/null @@ -1,162 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - plmn_list = ( { mcc = 208; mnc = 95; mnc_length = 2; } ); - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 0; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- SCTP definitions - SCTP : - { - # Number of streams to use in input/output - SCTP_INSTREAMS = 2; - SCTP_OUTSTREAMS = 2; - }; - - - ////////// MME parameters: - mme_ip_address = ( { ipv4 = "192.188.2.2"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "tun2"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.188.2.2/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1/24"; - ENB_PORT_FOR_S1U = 2153; # Spec 2152 - }; - - 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"; - gtpu_log_level ="info"; - udp_log_level ="info"; - }; - - } -); diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf deleted file mode 100644 index 9ffed9c5fe..0000000000 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb1.conf +++ /dev/null @@ -1,159 +0,0 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - -eNBs = -( - { - ////////// Identification parameters: - eNB_ID = 0xe00; - - cell_type = "CELL_MACRO_ENB"; - - eNB_name = "eNB_Eurecom_LTEBox"; - - // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; - plmn_list = ( { mcc = 208; mnc = 95; mnc_length = 2; } ); - - ////////// Physical parameters: - - component_carriers = ( - { - frame_type = "FDD"; - tdd_config = 3; - tdd_config_s = 0; - prefix_type = "NORMAL"; - eutra_band = 7; - downlink_frequency = 2660000000L; - uplink_frequency_offset = -120000000; - Nid_cell = 0; - N_RB_DL = 25; - Nid_cell_mbsfn = 0; - nb_antennas_tx = 1; - nb_antennas_rx = 1; - tx_gain = 90; - rx_gain = 120; - prach_root = 0; - prach_config_index = 0; - prach_high_speed = "DISABLE"; - prach_zero_correlation = 1; - prach_freq_offset = 2; - pucch_delta_shift = 1; - pucch_nRB_CQI = 1; - pucch_nCS_AN = 0; - pucch_n1_AN = 0; - pdsch_referenceSignalPower = -26; - pdsch_p_b = 0; - pusch_n_SB = 1; - pusch_enable64QAM = "DISABLE"; - pusch_hoppingMode = "interSubFrame"; - pusch_hoppingOffset = 0; - pusch_groupHoppingEnabled = "ENABLE"; - pusch_groupAssignment = 0; - pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; - phich_duration = "NORMAL"; - phich_resource = "ONESIXTH"; - srs_enable = "DISABLE"; - /* srs_BandwidthConfig =; - srs_SubframeConfig =; - srs_ackNackST =; - srs_MaxUpPts =;*/ - - pusch_p0_Nominal = -90; - pusch_alpha = "AL1"; - pucch_p0_Nominal = -108; - msg3_delta_Preamble = 6; - pucch_deltaF_Format1 = "deltaF2"; - pucch_deltaF_Format1b = "deltaF3"; - pucch_deltaF_Format2 = "deltaF0"; - pucch_deltaF_Format2a = "deltaF0"; - pucch_deltaF_Format2b = "deltaF0"; - - rach_numberOfRA_Preambles = 64; - rach_preamblesGroupAConfig = "DISABLE"; - /* - rach_sizeOfRA_PreamblesGroupA = ; - rach_messageSizeGroupA = ; - rach_messagePowerOffsetGroupB = ; - */ - rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; - rach_preambleTransMax = 10; - rach_raResponseWindowSize = 10; - rach_macContentionResolutionTimer = 48; - rach_maxHARQ_Msg3Tx = 4; - - pcch_default_PagingCycle = 128; - pcch_nB = "oneT"; - bcch_modificationPeriodCoeff = 2; - ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; - } - ); - - - srb1_parameters : - { - # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] - timer_poll_retransmit = 80; - - # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] - timer_reordering = 35; - - # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] - timer_status_prohibit = 0; - - # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] - poll_pdu = 4; - - # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] - poll_byte = 99999; - - # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] - max_retx_threshold = 4; - } - - # ------- 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.17"; - ipv6 = "192:168:30::17"; - active = "yes"; - preference = "ipv4"; - } - ); - - NETWORK_INTERFACES : - { - ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24"; - - ENB_INTERFACE_NAME_FOR_S1U = "eth0"; - ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24"; - ENB_PORT_FOR_S1U = 2152; # Spec 2152 - }; - - log_config : - { - global_log_level ="debug"; - hw_log_level ="info"; - phy_log_level ="info"; - rlc_log_level ="info"; - pdcp_log_level ="info"; - rrc_log_level ="info"; - }; - - } -); diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/trace.pdml b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/trace.pdml deleted file mode 100644 index d2d2598de6..0000000000 --- a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/trace.pdml +++ /dev/null @@ -1,4411 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c deleted file mode 100644 index a8a3590945..0000000000 --- a/openair3/TEST/EPC_TEST/generate_scenario.c +++ /dev/null @@ -1,684 +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 - */ - -/* - generate_scenario.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "assertions.h" -#include "generate_scenario.h" -#include "s1ap_eNB.h" -#include "intertask_interface.h" - -#define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" - -#define ENB_CONFIG_STRING_ENB_LIST "eNBs" -#define ENB_CONFIG_STRING_ENB_ID "eNB_ID" -#define ENB_CONFIG_STRING_CELL_TYPE "cell_type" -#define ENB_CONFIG_STRING_ENB_NAME "eNB_name" - -#define ENB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code" -#define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE "mobile_country_code" -#define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE "mobile_network_code" - - -#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" -#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" -#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" -#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" -#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" - -#define ENB_CONFIG_STRING_SCTP_CONFIG "SCTP" -#define ENB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS" -#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS" - -#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES" -#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME" -#define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME "ENB_IPV4_ADDRESS_FOR_S1_MME" -#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U "ENB_INTERFACE_NAME_FOR_S1U" -#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" -#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" - - -#define ENB_CONFIG_MAX_XSLT_PARAMS 32 - -Enb_properties_array_t g_enb_properties; -char *g_test_dir = NULL; -char *g_pdml_in_origin = NULL; -extern int xmlLoadExtDtdDefaultValue; - -#define GENERATE_PDML_FILE 1 -#define GENERATE_SCENARIO 2 - -#define GS_IS_FILE 1 -#define GS_IS_DIR 2 - -//------------------------------------------------------------------------------ -// test if file exist in current directory -int is_file_exists( const char const * file_nameP, const char const *file_roleP) -{ - struct stat s; - int err = stat(file_nameP, &s); - if(-1 == err) { - if(ENOENT == errno) { - fprintf(stderr, "Please provide a valid %s, %s does not exist\n", file_roleP, file_nameP); - } else { - perror("stat"); - exit(1); - } - } else { - if(S_ISREG(s.st_mode)) { - return GS_IS_FILE; - } else if(S_ISDIR(s.st_mode)) { - return GS_IS_DIR; - } else { - fprintf(stderr, "Please provide a valid test %s, %s exists but is not found valid\n", file_roleP, file_nameP); - } - } - return 0; -} - - -//------------------------------------------------------------------------------ -int strip_extension(char *in_filename) -{ - static const uint8_t name_min_len = 1; - static const uint8_t max_ext_len = 5; // .pdml ! - fprintf(stdout, "strip_extension %s\n", in_filename); - - if (NULL != in_filename) { - /* Check chars starting at end of string to find last '.' */ - for (ssize_t i = strlen(in_filename); i >= name_min_len; i--) { - if (in_filename[i] == '.') { - in_filename[i] = '\0'; - return i; - } - } - } - return -1; -} -//------------------------------------------------------------------------------ -// return number of splitted items -int split_path( char * pathP, char *** resP) -{ - char * saveptr1; - char * p = strtok_r (pathP, "/", &saveptr1); - int n_spaces = 0; - - /// split string and append tokens to 'res' - while (p) { - *resP = realloc (*resP, sizeof (char*) * ++n_spaces); - AssertFatal (*resP, "realloc failed"); - (*resP)[n_spaces-1] = p; - p = strtok_r (NULL, "/", &saveptr1); - } - return n_spaces; -} - -//------------------------------------------------------------------------------ -int generate_test_scenario(const char const * test_nameP, const char const * pdml_in_basenameP) -//------------------------------------------------------------------------------ -{ - //int fd_pdml_in; - xsltStylesheetPtr cur = NULL; - xmlDocPtr doc, res; - FILE *test_scenario_file = NULL; - const char test_scenario_filename[NAME_MAX]; - const char *params[2*ENB_CONFIG_MAX_XSLT_PARAMS]; - int nb_params = 0; - int i,j; - char astring[1024]; - char *astring2 = NULL; - struct in_addr addr; - - memset(test_scenario_filename, 0, sizeof(test_scenario_filename)); - memset(astring, 0, sizeof(astring)); - if (getcwd(astring, sizeof(astring)) != NULL) { - fprintf(stdout, "working in %s directory\n", astring); - } else { - perror("getcwd() error"); - exit(1); - } - - xmlSubstituteEntitiesDefault(1); - xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile("/usr/share/oai/xsl/generic_scenario.xsl"); - if (NULL == cur) { - AssertFatal (0, "Could not parse stylesheet file /usr/share/oai/xsl/generic_scenario.xsl!\n"); - } else { - fprintf(stdout, "XSLT style sheet: /usr/share/oai/xsl/generic_scenario.xsl\n"); - } - - doc = xmlParseFile(pdml_in_basenameP); - if (NULL == doc) { - AssertFatal (0, "Could not parse pdml file %s!\n", pdml_in_basenameP); - } else { - fprintf(stdout, "pdml file: %s\n", pdml_in_basenameP); - } - params[nb_params++] = "test_name"; - sprintf(astring, "%s", pdml_in_basenameP); - if (strip_extension(astring) > 0) { - astring2 = strdup(astring); - sprintf(astring, "\"%s\"", astring2); - free(astring2); - astring2 = NULL; - } else { - fprintf(stderr, "Assigning test name failed: %s\n", astring); - } - params[nb_params++] = strdup(astring); - - for (i = 0; i < g_enb_properties.number; i++) { - // eNB S1-C IPv4 address - sprintf(astring, "enb%d_s1c", i); - params[nb_params++] = strdup(astring); - addr.s_addr = g_enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; - sprintf(astring, "\"%s\"", inet_ntoa(addr)); - params[nb_params++] = strdup(astring); - - // MME S1-C IPv4 address - for (j = 0; j < g_enb_properties.properties[i]->nb_mme; j++) { - sprintf(astring, "mme%d_s1c_%d", i, j); - params[nb_params++] = strdup(astring); - AssertFatal (g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address, - "Only support MME IPv4 address\n"); - sprintf(astring, "\"%s\"", g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address); - params[nb_params++] = strdup(astring); - } - } - params[nb_params] = NULL; - res = xsltApplyStylesheet(cur, doc, params); - if (NULL != res) { - // since pdml filename is not relative (no path), just filename in current directory we can safely remove - sprintf(test_scenario_filename,"%s",pdml_in_basenameP); - if (strip_extension(test_scenario_filename) > 0) { - strcat(test_scenario_filename, ".xml"); - test_scenario_file = fopen( test_scenario_filename, "w+"); - if (NULL != test_scenario_file) { - xsltSaveResultToFile(test_scenario_file, res, cur); - fclose(test_scenario_file); - fprintf(stdout, "Wrote test scenario to %s\n", test_scenario_filename); - } else { - fprintf(stderr, "Error in fopen(%s)\n", test_scenario_filename); - } - } else { - fprintf(stderr, "Error in strip_extension()\n"); - } - } else { - fprintf(stderr, "Error in xsltApplyStylesheet()\n"); - } - xsltFreeStylesheet(cur); - xmlFreeDoc(res); - xmlFreeDoc(doc); - - xsltCleanupGlobals(); - xmlCleanupParser(); -} - -//------------------------------------------------------------------------------ -static void enb_config_display(void) -//------------------------------------------------------------------------------ -{ - int i; - - printf( "\n----------------------------------------------------------------------\n"); - printf( " ENB CONFIG FILE CONTENT LOADED:\n"); - printf( "----------------------------------------------------------------------\n"); - for (i = 0; i < g_enb_properties.number; i++) { - printf( "ENB CONFIG for instance %d:\n\n", i); - printf( "\teNB name: \t%s\n",g_enb_properties.properties[i]->eNB_name); - printf( "\teNB ID: \t%"PRIu32"\n",g_enb_properties.properties[i]->eNB_id); - printf( "\tCell type: \t%s\n",g_enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB"); - printf( "\tTAC: \t%"PRIu16"\n",g_enb_properties.properties[i]->tac); - printf( "\tMCC: \t%"PRIu16"\n",g_enb_properties.properties[i]->mcc); - - if (g_enb_properties.properties[i]->mnc_digit_length == 3) { - printf( "\tMNC: \t%03"PRIu16"\n",g_enb_properties.properties[i]->mnc); - } else { - printf( "\tMNC: \t%02"PRIu16"\n",g_enb_properties.properties[i]->mnc); - } - printf( "\n--------------------------------------------------------\n"); - } -} - - -#ifdef LIBCONFIG_LONG -#define libconfig_int long -#else -#define libconfig_int int -#endif -//------------------------------------------------------------------------------ -void enb_config_init(const char const * lib_config_file_name_pP) -//------------------------------------------------------------------------------ -{ - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *subsetting = NULL; - config_setting_t *setting_mme_addresses = NULL; - config_setting_t *setting_mme_address = NULL; - config_setting_t *setting_enb = NULL; - int num_enb_properties = 0; - int enb_properties_index = 0; - int num_enbs = 0; - int num_mme_address = 0; - int i = 0; - int j = 0; - int parse_errors = 0; - libconfig_int enb_id = 0; - const char* cell_type = NULL; - const char* tac = 0; - const char* enb_name = NULL; - const char* mcc = 0; - const char* mnc = 0; - char* ipv4 = NULL; - char* ipv6 = NULL; - char* active = NULL; - char* preference = NULL; - const char* active_enb[EPC_TEST_SCENARIO_MAX_ENB]; - char* enb_interface_name_for_S1U = NULL; - char* enb_ipv4_address_for_S1U = NULL; - libconfig_int enb_port_for_S1U = 0; - char* enb_interface_name_for_S1_MME = NULL; - char* enb_ipv4_address_for_S1_MME = NULL; - char *address = NULL; - char *cidr = NULL; - - - AssertFatal (lib_config_file_name_pP != NULL, - "Bad parameter lib_config_file_name_pP %s , must reference a valid eNB config file\n", - lib_config_file_name_pP); - - memset((char*)active_enb, 0 , EPC_TEST_SCENARIO_MAX_ENB * sizeof(char*)); - - config_init(&cfg); - - /* Read the file. If there is an error, report it and exit. */ - if (! config_read_file(&cfg, lib_config_file_name_pP)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP); - } - - // Get list of active eNBs, (only these will be configured) - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - - for (i = 0; i < num_enbs; i++) { - setting_enb = config_setting_get_elem(setting, i); - active_enb[i] = config_setting_get_string (setting_enb); - AssertFatal (active_enb[i] != NULL, - "Failed to parse config file %s, %dth attribute %s \n", - lib_config_file_name_pP, i, ENB_CONFIG_STRING_ACTIVE_ENBS); - active_enb[i] = strdup(active_enb[i]); - num_enb_properties += 1; - } - } - - /* Output a list of all eNBs. */ - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - - if (setting != NULL) { - enb_properties_index = g_enb_properties.number; - parse_errors = 0; - num_enbs = config_setting_length(setting); - - for (i = 0; i < num_enbs; i++) { - setting_enb = config_setting_get_elem(setting, i); - - if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) { - /* Calculate a default eNB ID */ -# if defined(ENABLE_USE_MME) - uint32_t hash; - - hash = s1ap_generate_eNB_id (); - enb_id = i + (hash & 0xFFFF8); -# else - enb_id = i; -# endif - } - - if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME, &enb_name) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE, &tac) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc) - - - ) - ) { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, %d th enb\n", - lib_config_file_name_pP, i); - continue; // FIXME this prevents segfaults below, not sure what happens after function exit - } - - // search if in active list - for (j=0; j < num_enb_properties; j++) { - if (strcmp(active_enb[j], enb_name) == 0) { - g_enb_properties.properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t)); - - g_enb_properties.properties[enb_properties_index]->eNB_id = enb_id; - - if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) { - g_enb_properties.properties[enb_properties_index]->cell_type = CELL_MACRO_ENB; - } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { - g_enb_properties.properties[enb_properties_index]->cell_type = CELL_HOME_ENB; - } else { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", - lib_config_file_name_pP, i, cell_type); - } - - g_enb_properties.properties[enb_properties_index]->eNB_name = strdup(enb_name); - g_enb_properties.properties[enb_properties_index]->tac = (uint16_t)atoi(tac); - g_enb_properties.properties[enb_properties_index]->mcc = (uint16_t)atoi(mcc); - g_enb_properties.properties[enb_properties_index]->mnc = (uint16_t)atoi(mnc); - g_enb_properties.properties[enb_properties_index]->mnc_digit_length = strlen(mnc); - AssertFatal((g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 2) || - (g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 3), - "BAD MNC DIGIT LENGTH %d", - g_enb_properties.properties[i]->mnc_digit_length); - - - setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); - num_mme_address = config_setting_length(setting_mme_addresses); - g_enb_properties.properties[enb_properties_index]->nb_mme = 0; - - for (j = 0; j < num_mme_address; j++) { - setting_mme_address = config_setting_get_elem(setting_mme_addresses, j); - - if ( !( - config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV4_ADDRESS, (const char **)&ipv4) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV6_ADDRESS, (const char **)&ipv6) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, (const char **)&active) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference) - ) - ) { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, %d th enb %d th mme address !\n", - lib_config_file_name_pP, i, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - g_enb_properties.properties[enb_properties_index]->nb_mme += 1; - - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4); - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6); - - if (strcmp(active, "yes") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].active = 1; - } // else { (calloc) - - if (strcmp(preference, "ipv4") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; - } else if (strcmp(preference, "ipv6") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; - } else if (strcmp(preference, "no") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; - } - } - - - // NETWORK_INTERFACES - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); - - if (subsetting != NULL) { - if ( ( - config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, - (const char **)&enb_interface_name_for_S1_MME) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, - (const char **)&enb_ipv4_address_for_S1_MME) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, - (const char **)&enb_interface_name_for_S1U) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, - (const char **)&enb_ipv4_address_for_S1U) - && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, - &enb_port_for_S1U) - ) - ) { - g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); - cidr = enb_ipv4_address_for_S1U; - address = strtok(cidr, "/"); - - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); - } - - g_enb_properties.properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U; - - g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); - cidr = enb_ipv4_address_for_S1_MME; - address = strtok(cidr, "/"); - - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); - } - } - } // if (subsetting != NULL) { - enb_properties_index += 1; - } // if (strcmp(active_enb[j], enb_name) == 0) - } // for (j=0; j < num_enb_properties; j++) - } // for (i = 0; i < num_enbs; i++) - } // if (setting != NULL) { - - g_enb_properties.number += num_enb_properties; - - - AssertFatal (parse_errors == 0, - "Failed to parse eNB configuration file %s, found %d error%s !\n", - lib_config_file_name_pP, parse_errors, parse_errors > 1 ? "s" : ""); -} - - -//------------------------------------------------------------------------------ -static void usage ( - int argc, - char *argv[]) -//------------------------------------------------------------------------------ -{ - fprintf (stdout, "Please report any bug to: %s\n",PACKAGE_BUGREPORT); - fprintf (stdout, "Usage: %s [options]\n\n", argv[0]); - fprintf (stdout, "\n"); - fprintf (stdout, "Mandatory options:\n"); - fprintf (stdout, "\t-c | --enb-conf-file Provide the old eNB config file for generating a copy of the original test\n"); - fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); - fprintf (stdout, "\t-p | --pdml File name (with no path) in 'test-dir' directory of an original scenario that has to be reworked (IP addresses) with new testbed\n"); - fprintf (stdout, "\n"); - fprintf (stdout, "Other options:\n"); - fprintf (stdout, "\t-h | --help Print this help and return\n"); - fprintf (stdout, "\t-v | --version Print informations about the version of this executable\n"); - fprintf (stdout, "\n"); - fprintf (stdout, "Example of generate_scenario use case: \n"); - fprintf (stdout, "\n"); - fprintf (stdout, " Generate a generix xml scenario from a captured pcap file: \n"); - fprintf (stdout, " +---------------------+ \n"); - fprintf (stdout, " |captured pcap-ng file| \n"); - fprintf (stdout, " +----------+----------+ \n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " mme_test_s1_pcap2pdml --pcap_file <`captured pcap-ng file`>\n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " +--------V----------+ +--------------------+\n"); - fprintf (stdout, " |'pdml-in-orig' file| |'enb-conf-file' file|\n"); - fprintf (stdout, " +--------+----------+ +--------------------+\n"); - fprintf (stdout, " | |\n"); - fprintf (stdout, " +----------------------------+\n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " generate_scenario -d -p <'pdml-in-orig' file> -c <'enb-conf-file' file> \n"); - fprintf (stdout, " |\n"); - fprintf (stdout, " +------------V--------------+\n"); - fprintf (stdout, " +'xml-test-scenario' file |\n"); - fprintf (stdout, " +---------------------------+\n"); - fprintf (stdout, "\n"); -} - -//------------------------------------------------------------------------------ -int -config_parse_opt_line ( - int argc, - char *argv[]) -//------------------------------------------------------------------------------ -{ - int option; - int rv = 0; - char *enb_config_file_name = NULL; - char *pdml_in_file_name = NULL; - char *test_dir_name = NULL; - - enum long_option_e { - LONG_OPTION_START = 0x100, /* Start after regular single char options */ - LONG_OPTION_ENB_CONF_FILE, - LONG_OPTION_PDML, - LONG_OPTION_TEST_DIR, - LONG_OPTION_HELP, - LONG_OPTION_VERSION, - }; - - static struct option long_options[] = { - {"enb-conf-file", required_argument, 0, LONG_OPTION_ENB_CONF_FILE}, - {"pdml ", required_argument, 0, LONG_OPTION_PDML}, - {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, - {"help", no_argument, 0, LONG_OPTION_HELP}, - {"version", no_argument, 0, LONG_OPTION_VERSION}, - {NULL, 0, NULL, 0} - }; - - /* - * Parsing command line - */ - while ((option = getopt_long (argc, argv, "vhp:n:c:s:d:", long_options, NULL)) != -1) { - switch (option) { - case LONG_OPTION_ENB_CONF_FILE: - case 'c': - if (optarg) { - enb_config_file_name = optarg; - printf("eNB config file name is %s\n", enb_config_file_name); - rv |= GENERATE_SCENARIO; - } - break; - - case LONG_OPTION_PDML: - case 'p': - if (optarg) { - pdml_in_file_name = strdup(optarg); - printf("PDML input file name is %s\n", pdml_in_file_name); - rv |= GENERATE_SCENARIO; - } - break; - - case LONG_OPTION_TEST_DIR: - case 'd': - if (optarg) { - test_dir_name = strdup(optarg); - if (is_file_exists(test_dir_name, "test dirname") != GS_IS_DIR) { - fprintf(stderr, "Please provide a valid test dirname, %s is not a valid directory name\n", test_dir_name); - exit(1); - } - printf("Test dir name is %s\n", test_dir_name); - } - break; - - case LONG_OPTION_VERSION: - case 'v': - printf("Version %s\n", PACKAGE_VERSION); - exit (0); - break; - - case LONG_OPTION_HELP: - case 'h': - default: - usage (argc, argv); - exit (0); - } - } - if (NULL == test_dir_name) { - fprintf(stderr, "Please provide a valid test dirname\n"); - exit(1); - } - g_test_dir = test_dir_name; test_dir_name = NULL; - if (chdir(g_test_dir) != 0) { - fprintf(stderr, "Error: chdir %s returned %s\n", g_test_dir, strerror(errno)); - exit(1); - } - if (rv & GENERATE_SCENARIO) { - if (NULL == enb_config_file_name) { - fprintf(stderr, "Error: please provide the original eNB config file name that should be in %s\n", g_test_dir); - } - if (is_file_exists(enb_config_file_name, "ENB config file") != GS_IS_FILE) { - fprintf(stderr, "Error: eNB config file name %s is not found in dir %s\n", enb_config_file_name, g_test_dir); - } - enb_config_init(enb_config_file_name); - //enb_config_display(); - - if (NULL == pdml_in_file_name) { - fprintf(stderr, "Error: please provide the PDML file name that should be in %s\n", g_test_dir); - } - if (is_file_exists(pdml_in_file_name, "PDML file") != GS_IS_FILE) { - fprintf(stderr, "Error: PDML file name %s is not found in dir %s\n", pdml_in_file_name, g_test_dir); - } - g_pdml_in_origin = pdml_in_file_name; pdml_in_file_name = NULL; - } - return rv; -} - -//------------------------------------------------------------------------------ -int main( int argc, char **argv ) -//------------------------------------------------------------------------------ -{ - int actions = 0; - - memset((char*) &g_enb_properties, 0 , sizeof(g_enb_properties)); - - actions = config_parse_opt_line (argc, argv); //Command-line options - if (actions & GENERATE_SCENARIO) { - generate_test_scenario(g_test_dir, g_pdml_in_origin); - } - - return 0; -} diff --git a/openair3/TEST/EPC_TEST/generate_scenario.h b/openair3/TEST/EPC_TEST/generate_scenario.h deleted file mode 100644 index 8deded3f52..0000000000 --- a/openair3/TEST/EPC_TEST/generate_scenario.h +++ /dev/null @@ -1,119 +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 - */ - -/* - generate_scenario.h - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr -*/ - -#ifndef GENERATE_SCENARIO_H_ -#define GENERATE_SCENARIO_H_ -#include -#include -#include - -#include "commonDef.h" -#include "platform_types.h" -#include "platform_constants.h" -#include "s1ap_messages_types.h" -#include "SystemInformationBlockType2.h" - -#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\ - struct in_addr inp;\ - if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\ - AssertFatal (0, MeSsAgE);\ - } else {\ - NwBo = inp.s_addr;\ - }\ - } while (0); - -/** @defgroup _enb_app ENB APP - * @ingroup _oai2 - * @{ - */ - -// Hard to find a defined value for max enb... -#define EPC_TEST_SCENARIO_MAX_ENB 4 - - -typedef struct mme_ip_address_s { - unsigned ipv4:1; - unsigned ipv6:1; - unsigned active:1; - char *ipv4_address; - char *ipv6_address; -} mme_ip_address_t; - -typedef struct Enb_properties_s { - /* Unique eNB_id to identify the eNB within EPC. - * For macro eNB ids this field should be 20 bits long. - * For home eNB ids this field should be 28 bits long. - */ - uint32_t eNB_id; - - /* The type of the cell */ - enum cell_type_e cell_type; - - /* Optional name for the cell - * NOTE: the name can be NULL (i.e no name) and will be cropped to 150 - * characters. - */ - char *eNB_name; - - /* Tracking area code */ - uint16_t tac; - - /* Mobile Country Code - * Mobile Network Code - */ - uint16_t mcc; - uint16_t mnc; - uint8_t mnc_digit_length; - - /* Nb of MME to connect to */ - uint8_t nb_mme; - /* List of MME to connect to */ - mme_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; - - int sctp_in_streams; - int sctp_out_streams; - - char *enb_interface_name_for_S1U; - in_addr_t enb_ipv4_address_for_S1U; - tcp_udp_port_t enb_port_for_S1U; - - char *enb_interface_name_for_S1_MME; - in_addr_t enb_ipv4_address_for_S1_MME; - -} Enb_properties_t; - -typedef struct Enb_properties_array_s { - int number; - Enb_properties_t *properties[EPC_TEST_SCENARIO_MAX_ENB]; -} Enb_properties_array_t; - -void enb_config_init(const char const * lib_config_file_name_pP); - -#endif /* ENB_CONFIG_H_ */ -/** @} */ diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c deleted file mode 100644 index ebaffdb39e..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario.c +++ /dev/null @@ -1,1240 +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 - */ - -/* - play_scenario.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "assertions.h" -#include "s1ap_common.h" -#include "intertask_interface.h" -#include "play_scenario.h" -#include "sctp_eNB_task.h" -#include "sctp_default_values.h" -#include "log.h" -//------------------------------------------------------------------------------ -#define PLAY_SCENARIO 1 -#define GS_IS_FILE 1 -#define GS_IS_DIR 2 -//------------------------------------------------------------------------------ -Enb_properties_array_t g_enb_properties; -int g_max_speed = 0; -//------------------------------------------------------------------------------ -extern et_scenario_t *g_scenario; -extern int xmlLoadExtDtdDefaultValue; -extern int asn_debug; -extern int asn1_xer_print; -extern pthread_mutex_t g_fsm_lock; - -//------------------------------------------------------------------------------ -// MEMO: -// Scenario with several eNBs: We may have to create ethx.y interfaces -// - - - -//------------------------------------------------------------------------------ -// test if file exist in current directory -int is_file_exists( const char const * file_nameP, const char const *file_roleP) -{ - struct stat s; - int err = stat(file_nameP, &s); - if(-1 == err) { - if(ENOENT == errno) { - fprintf(stderr, "Please provide a valid %s, %s does not exist\n", file_roleP, file_nameP); - } else { - perror("stat"); - exit(1); - } - } else { - if(S_ISREG(s.st_mode)) { - return GS_IS_FILE; - } else if(S_ISDIR(s.st_mode)) { - return GS_IS_DIR; - } else { - fprintf(stderr, "Please provide a valid test %s, %s exists but is not found valid\n", file_roleP, file_nameP); - } - } - return 0; -} - - -//------------------------------------------------------------------------------ -int et_strip_extension(char *in_filename) -{ - static const uint8_t name_min_len = 1; - static const uint8_t max_ext_len = 5; // .pdml ! - fprintf(stdout, "strip_extension %s\n", in_filename); - - if (NULL != in_filename) { - /* Check chars starting at end of string to find last '.' */ - for (ssize_t i = strlen(in_filename); i > name_min_len; i--) { - if (in_filename[i] == '.') { - in_filename[i] = '\0'; - return i; - } - } - } - return -1; -} -//------------------------------------------------------------------------------ -// return number of splitted items -void et_get_shift_arg( char * line_argument, shift_packet_t * const shift) -{ - int len = strlen(line_argument); - int i = 0; - int j = 0; - int num_milli = 0; - char my_num[64]; - int negative = 0; - - - while ((line_argument[i] != ':') && (i < len)) { - if (isdigit(line_argument[i])) { // may occur '\"' - my_num[j++] = line_argument[i]; - } - i += 1; - } - AssertFatal(':' == line_argument[i], "Bad format"); - i += 1; // ':' - my_num[j++] = '\0'; - shift->frame_number = atoi(my_num); - AssertFatal(ishift_seconds = atoi(my_num); - // may omit .mmm, accept .m or .mm or .mmm or ... - while ((i < len) && (num_milli++ < 3)){ - my_num[j++] = line_argument[i++]; - } - while (num_milli++ < 6){ - my_num[j++] = '0'; - } - my_num[j] = '\0'; - shift->shift_microseconds = atoi(my_num); - if (negative == 1) { - shift->shift_seconds = - shift->shift_seconds; - shift->shift_microseconds = - shift->shift_microseconds; - } -} -//------------------------------------------------------------------------------ -// return number of splitted items -int split_path( char * pathP, char *** resP) -{ - char * saveptr1; - char * p = strtok_r (pathP, "/", &saveptr1); - int n_spaces = 0; - - /// split string and append tokens to 'res' - while (p) { - *resP = realloc (*resP, sizeof (char*) * ++n_spaces); - AssertFatal (*resP, "realloc failed"); - (*resP)[n_spaces-1] = p; - p = strtok_r (NULL, "/", &saveptr1); - } - return n_spaces; -} -//------------------------------------------------------------------------------ -void et_free_packet(et_packet_t* packet) -{ - if (packet) { - switch (packet->sctp_hdr.chunk_type) { - case SCTP_CID_DATA: - et_free_pointer(packet->sctp_hdr.u.data_hdr.payload.binary_stream); - break; - default: - ; - } - et_free_pointer(packet); - } -} - -//------------------------------------------------------------------------------ -void et_free_scenario(et_scenario_t* scenario) -{ - et_packet_t *packet = NULL; - et_packet_t *next_packet = NULL; - if (scenario) { - packet = scenario->list_packet; - while (packet) { - next_packet = packet->next; - et_free_packet(packet); - packet = next_packet->next; - } - et_free_pointer(scenario); - pthread_mutex_destroy(&g_fsm_lock); - } -} - -//------------------------------------------------------------------------------ -char * et_ip2ip_str(const et_ip_t * const ip) -{ - static char str[INET6_ADDRSTRLEN]; - - sprintf(str, "ERROR"); - switch (ip->address_family) { - case AF_INET6: - inet_ntop(AF_INET6, &(ip->address.ipv6), str, INET6_ADDRSTRLEN); - break; - case AF_INET: - inet_ntop(AF_INET, &(ip->address.ipv4), str, INET_ADDRSTRLEN); - break; - default: - ; - } - return str; -} -//------------------------------------------------------------------------------ -//convert hexstring to len bytes of data -//returns 0 on success, negative on error -//data is a buffer of at least len bytes -//hexstring is upper or lower case hexadecimal, NOT prepended with "0x" -int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len) -{ - unsigned const char *pos = hexstring; - char *endptr = NULL; - size_t count = 0; - - fprintf(stdout, "%s(%s,%u)\n", __FUNCTION__, hexstring, len); - - if ((len > 1) && (strlen((const char*)hexstring) % 2)) { - //or hexstring has an odd length - return -3; - } - - if (len == 1) { - char buf[5] = {'0', 'x', 0, pos[0], '\0'}; - data[0] = strtol(buf, &endptr, 16); - /* Check for various possible errors */ - AssertFatal ((errno == 0) || (data[0] != 0), "ERROR %s() strtol: %s\n", __FUNCTION__, strerror(errno)); - AssertFatal (endptr != buf, "ERROR %s() No digits were found\n", __FUNCTION__); - return 0; - } - - for(count = 0; count < len/2; count++) { - char buf[5] = {'0', 'x', pos[0], pos[1], 0}; - data[count] = strtol(buf, &endptr, 16); - pos += 2 * sizeof(char); - AssertFatal (endptr[0] == '\0', "ERROR %s() non-hexadecimal character encountered buf %p endptr %p buf %s count %zu pos %p\n", __FUNCTION__, buf, endptr, buf, count, pos); - AssertFatal (endptr != buf, "ERROR %s() No digits were found\n", __FUNCTION__); - } - return 0; -} -//------------------------------------------------------------------------------ -sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str) -{ - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"DATA"))) { return SCTP_CID_DATA;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"INIT"))) { return SCTP_CID_INIT;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"INIT_ACK"))) { return SCTP_CID_INIT_ACK;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SACK"))) { return SCTP_CID_SACK;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"HEARTBEAT"))) { return SCTP_CID_HEARTBEAT;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"HEARTBEAT_ACK"))) { return SCTP_CID_HEARTBEAT_ACK;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ABORT"))) { return SCTP_CID_ABORT;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN"))) { return SCTP_CID_SHUTDOWN;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN_ACK"))) { return SCTP_CID_SHUTDOWN_ACK;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ERROR"))) { return SCTP_CID_ERROR;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"COOKIE_ECHO"))) { return SCTP_CID_COOKIE_ECHO;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"COOKIE_ACK"))) { return SCTP_CID_COOKIE_ACK;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ECN_ECNE"))) { return SCTP_CID_ECN_ECNE;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ECN_CWR"))) { return SCTP_CID_ECN_CWR;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN_COMPLETE"))) { return SCTP_CID_SHUTDOWN_COMPLETE;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"AUTH"))) { return SCTP_CID_AUTH;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"FWD_TSN"))) { return SCTP_CID_FWD_TSN;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ASCONF"))) { return SCTP_CID_ASCONF;} - if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ASCONF_ACK"))) { return SCTP_CID_ASCONF_ACK;} - AssertFatal (0, "ERROR: %s() cannot convert: %s\n", __FUNCTION__, chunk_type_str); -} -//------------------------------------------------------------------------------ -const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type) -{ - switch (chunk_type) { - case SCTP_CID_DATA: return "DATA"; break; - case SCTP_CID_INIT: return "INIT"; break; - case SCTP_CID_INIT_ACK: return "INIT_ACK"; break; - case SCTP_CID_SACK: return "SACK"; break; - case SCTP_CID_HEARTBEAT: return "HEARTBEAT"; break; - case SCTP_CID_HEARTBEAT_ACK: return "HEARTBEAT_ACK"; break; - case SCTP_CID_ABORT: return "ABORT"; break; - case SCTP_CID_SHUTDOWN: return "SHUTDOWN"; break; - case SCTP_CID_SHUTDOWN_ACK: return "SHUTDOWN_ACK"; break; - case SCTP_CID_ERROR: return "ERROR"; break; - case SCTP_CID_COOKIE_ECHO: return "COOKIE_ECHO"; break; - case SCTP_CID_COOKIE_ACK: return "COOKIE_ACK"; break; - case SCTP_CID_ECN_ECNE: return "ECN_ECNE"; break; - case SCTP_CID_ECN_CWR: return "ECN_CWR"; break; - case SCTP_CID_SHUTDOWN_COMPLETE: return "SHUTDOWN_COMPLETE"; break; - case SCTP_CID_AUTH: return "AUTH"; break; - case SCTP_CID_FWD_TSN: return "FWD_TSN"; break; - case SCTP_CID_ASCONF: return "ASCONF"; break; - case SCTP_CID_ASCONF_ACK: return "ASCONF_ACK"; break; - default: - AssertFatal (0, "ERROR: Unknown chunk_type %d!\n", chunk_type); - } -} -//------------------------------------------------------------------------------ -const char * const et_error_match2str(const int err) -{ - switch (err) { - // from asn_compare.h - case COMPARE_ERR_CODE_NO_MATCH: return "CODE_NO_MATCH"; break; - case COMPARE_ERR_CODE_TYPE_MISMATCH: return "TYPE_MISMATCH"; break; - case COMPARE_ERR_CODE_TYPE_ARG_NULL: return "TYPE_ARG_NULL"; break; - case COMPARE_ERR_CODE_VALUE_NULL: return "VALUE_NULL"; break; - case COMPARE_ERR_CODE_VALUE_ARG_NULL: return "VALUE_ARG_NULL"; break; - case COMPARE_ERR_CODE_CHOICE_NUM: return "CHOICE_NUM"; break; - case COMPARE_ERR_CODE_CHOICE_PRESENT: return "CHOICE_PRESENT"; break; - case COMPARE_ERR_CODE_CHOICE_MALFORMED: return "CHOICE_MALFORMED"; break; - case COMPARE_ERR_CODE_SET_MALFORMED: return "SET_MALFORMED"; break; - case COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS: return "COLLECTION_NUM_ELEMENTS"; break; - // from play_scenario.h - case ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE: return "SCTP_CHUNK_TYPE"; break; - case ET_ERROR_MATCH_PACKET_SCTP_PPID: return "SCTP_PPID"; break; - case ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID: return "SCTP_ASSOC_ID"; break; - case ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID: return "SCTP_STREAM_ID"; break; - case ET_ERROR_MATCH_PACKET_SCTP_SSN: return "SCTP_SSN"; break; - case ET_ERROR_MATCH_PACKET_S1AP_PRESENT: return "S1AP_PRESENT"; break; - case ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE: return "S1AP_PROCEDURE_CODE"; break; - case ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY: return "S1AP_CRITICALITY"; break; - default: - AssertFatal (0, "ERROR: Unknown match error %d!(TODO handle an1c error codes)\n", err); - } -} -//------------------------------------------------------------------------------ -et_packet_action_t et_action_str2et_action_t(const xmlChar * const action) -{ - if ((!xmlStrcmp(action, (const xmlChar *)"SEND"))) { return ET_PACKET_ACTION_S1C_SEND;} - if ((!xmlStrcmp(action, (const xmlChar *)"RECEIVE"))) { return ET_PACKET_ACTION_S1C_RECEIVE;} - AssertFatal (0, "ERROR: cannot convert: %s\n", action); - //if (NULL == action) {return ACTION_S1C_NULL;} -} -//------------------------------------------------------------------------------ -void et_ip_str2et_ip(const xmlChar * const ip_str, et_ip_t * const ip) -{ - AssertFatal (NULL != ip_str, "ERROR Cannot convert null string to ip address!\n"); - AssertFatal (NULL != ip, "ERROR out parameter pointer is NULL!\n"); - // store this IP address in sa: - if (inet_pton(AF_INET, (const char*)ip_str, (void*)&(ip->address.ipv4)) > 0) { - ip->address_family = AF_INET; - strncpy((char *)ip->str, (const char *)ip_str, INET_ADDRSTRLEN+1); - } else if (inet_pton(AF_INET6, (const char*)ip_str, (void*)&(ip->address.ipv6)) > 0) { - ip->address_family = AF_INET6; - strncpy((char *)ip->str, (const char *)ip_str, INET6_ADDRSTRLEN+1); - } else { - ip->address_family = AF_UNSPEC; - AssertFatal (0, "ERROR %s() Could not parse ip address %s!\n", __FUNCTION__, ip_str); - } -} -//------------------------------------------------------------------------------ -int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_address_t * const net_ip) -{ - AssertFatal (NULL != ip, "ERROR ip parameter\n"); - AssertFatal (NULL != net_ip, "ERROR net_ip parameter\n"); - switch (ip->address_family) { - case AF_INET: - if (net_ip->ipv4) { - //S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv4_address)); - return strcmp(ip->str, net_ip->ipv4_address); - } - //S1AP_DEBUG("%s(%s,%s)=-1 (IP version (4) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv4_address); - return -1; - break; - case AF_INET6: - if (net_ip->ipv6) { - //S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv6_address)); - return strcmp(ip->str, net_ip->ipv6_address); - } - //S1AP_DEBUG("%s(%s,%s)=-1 (IP version (6) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv6_address); - return -1; - break; - default: - S1AP_DEBUG("%s(%s,...)=-1 (unknown IP version)\n",__FUNCTION__,ip->str); - return -1; - } -} - -#ifdef LIBCONFIG_LONG -#define libconfig_int long -#else -#define libconfig_int int -#endif -//------------------------------------------------------------------------------ -void et_enb_config_init(const char const * lib_config_file_name_pP) -//------------------------------------------------------------------------------ -{ - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *subsetting = NULL; - config_setting_t *setting_mme_addresses = NULL; - config_setting_t *setting_mme_address = NULL; - config_setting_t *setting_enb = NULL; - libconfig_int my_int; - int num_enb_properties = 0; - int enb_properties_index = 0; - int num_enbs = 0; - int num_mme_address = 0; - int i = 0; - int j = 0; - int parse_errors = 0; - libconfig_int enb_id = 0; - const char* cell_type = NULL; - const char* tac = 0; - const char* enb_name = NULL; - const char* mcc = 0; - const char* mnc = 0; - char* ipv4 = NULL; - char* ipv6 = NULL; - char* active = NULL; - char* preference = NULL; - const char* active_enb[MAX_ENB]; - char* enb_interface_name_for_S1U = NULL; - char* enb_ipv4_address_for_S1U = NULL; - libconfig_int enb_port_for_S1U = 0; - char* enb_interface_name_for_S1_MME = NULL; - char* enb_ipv4_address_for_S1_MME = NULL; - char *address = NULL; - char *cidr = NULL; - - - AssertFatal (lib_config_file_name_pP != NULL, - "Bad parameter lib_config_file_name_pP %s , must reference a valid eNB config file\n", - lib_config_file_name_pP); - - memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); - - config_init(&cfg); - - /* Read the file. If there is an error, report it and exit. */ - if (! config_read_file(&cfg, lib_config_file_name_pP)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP); - } - - // Get list of active eNBs, (only these will be configured) - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - - for (i = 0; i < num_enbs; i++) { - setting_enb = config_setting_get_elem(setting, i); - active_enb[i] = config_setting_get_string (setting_enb); - AssertFatal (active_enb[i] != NULL, - "Failed to parse config file %s, %dth attribute %s \n", - lib_config_file_name_pP, i, ENB_CONFIG_STRING_ACTIVE_ENBS); - active_enb[i] = strdup(active_enb[i]); - num_enb_properties += 1; - } - } - - /* Output a list of all eNBs. */ - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - - if (setting != NULL) { - enb_properties_index = g_enb_properties.number; - parse_errors = 0; - num_enbs = config_setting_length(setting); - - for (i = 0; i < num_enbs; i++) { - setting_enb = config_setting_get_elem(setting, i); - - if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) { - /* Calculate a default eNB ID */ -# if defined(ENABLE_USE_MME) - uint32_t hash; - - hash = et_s1ap_generate_eNB_id (); - enb_id = i + (hash & 0xFFFF8); -# else - enb_id = i; -# endif - } - - if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME, &enb_name) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE, &tac) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc) - - - ) - ) { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, %d th enb\n", - lib_config_file_name_pP, i); - continue; // FIXME this prevents segfaults below, not sure what happens after function exit - } - - // search if in active list - for (j=0; j < num_enb_properties; j++) { - if (strcmp(active_enb[j], enb_name) == 0) { - g_enb_properties.properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t)); - - g_enb_properties.properties[enb_properties_index]->eNB_id = enb_id; - - if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) { - g_enb_properties.properties[enb_properties_index]->cell_type = CELL_MACRO_ENB; - } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { - g_enb_properties.properties[enb_properties_index]->cell_type = CELL_HOME_ENB; - } else { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", - lib_config_file_name_pP, i, cell_type); - } - - g_enb_properties.properties[enb_properties_index]->eNB_name = strdup(enb_name); - g_enb_properties.properties[enb_properties_index]->tac = (uint16_t)atoi(tac); - g_enb_properties.properties[enb_properties_index]->mcc = (uint16_t)atoi(mcc); - g_enb_properties.properties[enb_properties_index]->mnc = (uint16_t)atoi(mnc); - g_enb_properties.properties[enb_properties_index]->mnc_digit_length = strlen(mnc); - AssertFatal((g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 2) || - (g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 3), - "BAD MNC DIGIT LENGTH %d", - g_enb_properties.properties[i]->mnc_digit_length); - - - setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); - num_mme_address = config_setting_length(setting_mme_addresses); - g_enb_properties.properties[enb_properties_index]->nb_mme = 0; - - for (j = 0; j < num_mme_address; j++) { - setting_mme_address = config_setting_get_elem(setting_mme_addresses, j); - - if ( !( - config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV4_ADDRESS, (const char **)&ipv4) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV6_ADDRESS, (const char **)&ipv6) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, (const char **)&active) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference) - ) - ) { - AssertError (0, parse_errors ++, - "Failed to parse eNB configuration file %s, %d th enb %d th mme address !\n", - lib_config_file_name_pP, i, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - g_enb_properties.properties[enb_properties_index]->nb_mme += 1; - - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4); - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6); - - if (strcmp(active, "yes") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].active = 1; - } // else { (calloc) - - if (strcmp(preference, "ipv4") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; - } else if (strcmp(preference, "ipv6") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; - } else if (strcmp(preference, "no") == 0) { - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1; - g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; - } - } - // SCTP SETTING - g_enb_properties.properties[enb_properties_index]->sctp_out_streams = SCTP_OUT_STREAMS; - g_enb_properties.properties[enb_properties_index]->sctp_in_streams = SCTP_IN_STREAMS; - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SCTP_CONFIG); - - if (subsetting != NULL) { - if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_INSTREAMS, &my_int) )) { - g_enb_properties.properties[enb_properties_index]->sctp_in_streams = (uint16_t)my_int; - } - - if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_OUTSTREAMS, &my_int) )) { - g_enb_properties.properties[enb_properties_index]->sctp_out_streams = (uint16_t)my_int; - } - } - - - // NETWORK_INTERFACES - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); - - if (subsetting != NULL) { - if ( ( - config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, - (const char **)&enb_interface_name_for_S1_MME) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, - (const char **)&enb_ipv4_address_for_S1_MME) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, - (const char **)&enb_interface_name_for_S1U) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, - (const char **)&enb_ipv4_address_for_S1U) - && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, - &enb_port_for_S1U) - ) - ) { - g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); - cidr = enb_ipv4_address_for_S1U; - address = strtok(cidr, "/"); - - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); - } - - g_enb_properties.properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U; - - g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME); - cidr = enb_ipv4_address_for_S1_MME; - address = strtok(cidr, "/"); - - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" ); - } - } - } // if (subsetting != NULL) { - enb_properties_index += 1; - } // if (strcmp(active_enb[j], enb_name) == 0) - } // for (j=0; j < num_enb_properties; j++) - } // for (i = 0; i < num_enbs; i++) - } // if (setting != NULL) { - - g_enb_properties.number += num_enb_properties; - - - AssertFatal (parse_errors == 0, - "Failed to parse eNB configuration file %s, found %d error%s !\n", - lib_config_file_name_pP, parse_errors, parse_errors > 1 ? "s" : ""); -} -/*------------------------------------------------------------------------------*/ -const Enb_properties_array_t *et_enb_config_get(void) -{ - return &g_enb_properties; -} -/*------------------------------------------------------------------------------*/ -void et_eNB_app_register(const Enb_properties_array_t *enb_properties) -{ - uint32_t enb_id = 0; - uint32_t mme_id = 0; - MessageDef *msg_p = NULL; - char *str = NULL; - struct in_addr addr = {.s_addr = 0}; - - - g_scenario->register_enb_pending = 0; - for (enb_id = 0; (enb_id < enb_properties->number) ; enb_id++) { - { - s1ap_register_enb_req_t *s1ap_register_eNB = NULL; - - /* note: there is an implicit relationship between the data structure and the message name */ - msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ); - - s1ap_register_eNB = &S1AP_REGISTER_ENB_REQ(msg_p); - - /* Some default/random parameters */ - s1ap_register_eNB->eNB_id = enb_properties->properties[enb_id]->eNB_id; - s1ap_register_eNB->cell_type = enb_properties->properties[enb_id]->cell_type; - s1ap_register_eNB->eNB_name = enb_properties->properties[enb_id]->eNB_name; - s1ap_register_eNB->tac = enb_properties->properties[enb_id]->tac; - s1ap_register_eNB->mcc = enb_properties->properties[enb_id]->mcc; - s1ap_register_eNB->mnc = enb_properties->properties[enb_id]->mnc; - s1ap_register_eNB->mnc_digit_length = enb_properties->properties[enb_id]->mnc_digit_length; - - s1ap_register_eNB->nb_mme = enb_properties->properties[enb_id]->nb_mme; - AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme, - S1AP_MAX_NB_MME_IP_ADDRESS); - - for (mme_id = 0; mme_id < s1ap_register_eNB->nb_mme; mme_id++) { - s1ap_register_eNB->mme_ip_address[mme_id].ipv4 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4; - s1ap_register_eNB->mme_ip_address[mme_id].ipv6 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv6; - strncpy (s1ap_register_eNB->mme_ip_address[mme_id].ipv4_address, - enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4_address, - sizeof(s1ap_register_eNB->mme_ip_address[0].ipv4_address)); - strncpy (s1ap_register_eNB->mme_ip_address[mme_id].ipv6_address, - enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv6_address, - sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address)); - } - - s1ap_register_eNB->sctp_in_streams = enb_properties->properties[enb_id]->sctp_in_streams; - s1ap_register_eNB->sctp_out_streams = enb_properties->properties[enb_id]->sctp_out_streams; - - - s1ap_register_eNB->enb_ip_address.ipv6 = 0; - s1ap_register_eNB->enb_ip_address.ipv4 = 1; - addr.s_addr = enb_properties->properties[enb_id]->enb_ipv4_address_for_S1_MME; - str = inet_ntoa(addr); - strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str); - - g_scenario->register_enb_pending++; - itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); - } - } -} -/*------------------------------------------------------------------------------*/ -void *et_eNB_app_task(void *args_p) -{ - et_scenario_t *scenario = (et_scenario_t*)args_p; - MessageDef *msg_p = NULL; - const char *msg_name = NULL; - instance_t instance = 0; - int result = 0; - - itti_mark_task_ready (TASK_ENB_APP); - - do { - // Wait for a message - itti_receive_msg (TASK_ENB_APP, &msg_p); - - msg_name = ITTI_MSG_NAME (msg_p); - instance = ITTI_MSG_DESTINATION_INSTANCE (msg_p); - - switch (ITTI_MSG_ID(msg_p)) { - case TERMINATE_MESSAGE: - itti_exit_task (); - break; - - case S1AP_REGISTER_ENB_CNF: - LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name, - S1AP_REGISTER_ENB_CNF(msg_p).nb_mme); - - DevAssert(scenario->register_enb_pending > 0); - scenario->register_enb_pending--; - - /* Check if at least eNB is registered with one MME */ - if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) { - scenario->registered_enb++; - } - - /* Check if all register eNB requests have been processed */ - if (scenario->register_enb_pending == 0) { - timer_remove(scenario->enb_register_retry_timer_id); - if (scenario->registered_enb == scenario->enb_properties->number) { - /* If all eNB are registered, start scenario */ - LOG_D(ENB_APP, " All eNB are now associated with a MME\n"); - et_event_t event; - event.code = ET_EVENT_S1C_CONNECTED; - et_scenario_fsm_notify_event(event); - } else { - uint32_t not_associated = scenario->enb_properties->number - scenario->registered_enb; - - LOG_W(ENB_APP, " %d eNB %s not associated with a MME, retrying registration in %d seconds ...\n", - not_associated, not_associated > 1 ? "are" : "is", ET_ENB_REGISTER_RETRY_DELAY); - - /* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */ - if (timer_setup (ET_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, - NULL, &scenario->enb_register_retry_timer_id) < 0) { - LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n"); - - sleep(ET_ENB_REGISTER_RETRY_DELAY); - /* Restart the registration process */ - scenario->registered_enb = 0; - et_eNB_app_register (scenario->enb_properties); - } - } - } - - break; - - case S1AP_DEREGISTERED_ENB_IND: - LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name, - S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme); - - /* TODO handle recovering of registration */ - break; - - case TIMER_HAS_EXPIRED: - LOG_I(ENB_APP, " Received %s: timer_id %d\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id); - - if (TIMER_HAS_EXPIRED (msg_p).timer_id == scenario->enb_register_retry_timer_id) { - /* Restart the registration process */ - scenario->registered_enb = 0; - et_eNB_app_register (scenario->enb_properties); - } - break; - - default: - LOG_E(ENB_APP, "Received unexpected message %s\n", msg_name); - break; - } - - result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - } while (1); - return NULL; -} - -//------------------------------------------------------------------------------ -int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s *shifts) -{ - et_event_t event; - struct shift_packet_s *shift = shifts; - et_packet_t *packet = NULL; - et_packet_t *next_packet = NULL; - struct timeval shift_all_packets = { .tv_sec = 0, .tv_usec = 0 }; - struct timeval relative_last_sent_packet = { .tv_sec = 0, .tv_usec = 0 }; - struct timeval relative_last_received_packet = { .tv_sec = 0, .tv_usec = 0 }; - struct timeval initial_time = { .tv_sec = 0, .tv_usec = 0 }; - char first_packet = 1; - char first_sent_packet = 1; - char first_received_packet = 1; - - // first apply timing shifts if requested - while (shift) { - packet = scenario->list_packet; - while (packet) { - //fprintf(stdout, "*shift: %p\n", shift); - //fprintf(stdout, "\tframe_number: %d\n", shift->frame_number); - //fprintf(stdout, "\tshift_seconds: %ld\n", shift->shift_seconds); - //fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds); - //fprintf(stdout, "\tsingle: %d\n\n", shift->single); - //fprintf(stdout, "\tshift_all_packets_seconds: %ld\n", shift_all_packets.tv_sec); - //fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec); - - AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), - "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec, - packet->packet_number, - packet->original_frame_number); - AssertFatal((packet->time_relative_to_last_received_packet.tv_sec >= 0) && (packet->time_relative_to_last_received_packet.tv_usec >= 0), - "Bad timing result time_relative_to_last_received_packet=%d.%d packet num %u, original frame number %u", - packet->time_relative_to_last_received_packet.tv_sec, - packet->time_relative_to_last_received_packet.tv_usec, - packet->packet_number, - packet->original_frame_number); - AssertFatal((packet->time_relative_to_last_sent_packet.tv_sec >= 0) && (packet->time_relative_to_last_sent_packet.tv_usec >= 0), - "Bad timing result time_relative_to_last_sent_packet=%d.%d packet num %u, original frame number %u", - packet->time_relative_to_last_sent_packet.tv_sec, - packet->time_relative_to_last_sent_packet.tv_usec, - packet->packet_number, - packet->original_frame_number); -// fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_first_packet=%d.%d\n", -// packet->packet_number, -// packet->original_frame_number, -// packet->time_relative_to_first_packet.tv_sec, -// packet->time_relative_to_first_packet.tv_usec); -// fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_received_packet=%d.%d\n", -// packet->packet_number, -// packet->original_frame_number, -// packet->time_relative_to_last_received_packet.tv_sec, -// packet->time_relative_to_last_received_packet.tv_usec); -// fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_sent_packet=%d.%d\n", -// packet->packet_number, -// packet->original_frame_number, -// packet->time_relative_to_last_sent_packet.tv_sec, -// packet->time_relative_to_last_sent_packet.tv_usec); - - if ((shift->single) && (shift->frame_number == packet->original_frame_number)) { - struct timeval t_offset = { .tv_sec = shift->shift_seconds, .tv_usec = shift->shift_microseconds }; - et_packet_shift_timing(packet, &t_offset); - next_packet = packet->next; - if (next_packet) { - t_offset.tv_sec = -t_offset.tv_sec; - t_offset.tv_usec = -t_offset.tv_usec; - - if (packet->action == ET_PACKET_ACTION_S1C_SEND) { - timeval_add(&next_packet->time_relative_to_last_sent_packet, &next_packet->time_relative_to_last_sent_packet, &t_offset); - } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - timeval_add(&next_packet->time_relative_to_last_received_packet, &next_packet->time_relative_to_last_received_packet, &t_offset); - } - } - } - if ((0 == shift->single) && (shift->frame_number == packet->original_frame_number)) { - shift_all_packets.tv_sec = shift->shift_seconds; - shift_all_packets.tv_usec = shift->shift_microseconds; - timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets); - fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", - packet->packet_number, - packet->original_frame_number, - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec); - AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), - "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec, - packet->packet_number, - packet->original_frame_number); - } else if ((0 == shift->single) && (shift->frame_number < packet->original_frame_number)) { - timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets); - fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n", - packet->packet_number, - packet->original_frame_number, - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec); - AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), - "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec, - packet->packet_number, - packet->original_frame_number); - } - packet = packet->next; - } - shift = shift->next; - } - // now recompute time_relative_to_last_received_packet, time_relative_to_last_sent_packet - packet = scenario->list_packet; - while (packet) { - if (first_packet > 0) { - initial_time = packet->time_relative_to_first_packet; - packet->time_relative_to_first_packet.tv_sec = 0; - packet->time_relative_to_first_packet.tv_usec = 0; - first_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &initial_time, - &packet->time_relative_to_first_packet); - } - if (packet->action == ET_PACKET_ACTION_S1C_SEND) { - if (first_sent_packet > 0) { - relative_last_sent_packet = packet->time_relative_to_first_packet; - packet->time_relative_to_last_sent_packet.tv_sec = 0; - packet->time_relative_to_last_sent_packet.tv_usec = 0; - first_sent_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, - &packet->time_relative_to_last_sent_packet); - relative_last_sent_packet = packet->time_relative_to_first_packet; - } - if (first_received_packet > 0) { - packet->time_relative_to_last_received_packet.tv_sec = 0; - packet->time_relative_to_last_received_packet.tv_usec = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, - &packet->time_relative_to_last_received_packet); - } - } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if (first_received_packet > 0) { - relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec; - relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec; - packet->time_relative_to_last_received_packet.tv_sec = 0; - packet->time_relative_to_last_received_packet.tv_usec = 0; - first_received_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet, - &packet->time_relative_to_last_received_packet); - relative_last_received_packet = packet->time_relative_to_first_packet; - } - if (first_sent_packet > 0) { - packet->time_relative_to_last_sent_packet.tv_sec = 0; - packet->time_relative_to_last_sent_packet.tv_usec = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet, - &packet->time_relative_to_last_sent_packet); - } - } - packet = packet->next; - } - //et_display_scenario(scenario); - - // create SCTP ITTI task: same as eNB code - if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) { - LOG_E(SCTP, "Create task for SCTP failed\n"); - return -1; - } - - // create S1AP ITTI task: not as same as eNB code - if (itti_create_task (TASK_S1AP, et_s1ap_eNB_task, NULL) < 0) { - LOG_E(S1AP, "Create task for S1AP failed\n"); - return -1; - } - - // create ENB_APP ITTI task: not as same as eNB code - if (itti_create_task (TASK_ENB_APP, et_eNB_app_task, scenario) < 0) { - LOG_E(ENB_APP, "Create task for ENB_APP failed\n"); - return -1; - } - - event.code = ET_EVENT_INIT; - event.u.init.scenario = scenario; - et_scenario_fsm_notify_event(event); - - - return 0; -} - -//------------------------------------------------------------------------------ -static void et_usage ( - int argc, - char *argv[]) -//------------------------------------------------------------------------------ -{ - fprintf (stdout, "Please report any bug to: %s\n",PACKAGE_BUGREPORT); - fprintf (stdout, "Usage: %s [options]\n\n", argv[0]); - fprintf (stdout, "\n"); - fprintf (stdout, "\t-d | --test-dir Directory where a set of files related to a particular test are located\n"); - fprintf (stdout, "\t-c | --enb-conf-file Provide an eNB config file, valid for the testbed\n"); - fprintf (stdout, "\t-D | --delay-on-exit Wait delay-in-sec before exiting\n"); - fprintf (stdout, "\t-f | --shift-packet Shift the timing of a packet'\n"); - fprintf (stdout, "\t-F | --shift-packets Shift the timing of packets starting at frame 'frame' included\n"); - fprintf (stdout, "\t-m | --max-speed Play scenario as fast as possible without respecting frame timings\n"); - fprintf (stdout, "\t-s | --scenario File name (with no path) of a test scenario that has to be replayed ()\n"); - fprintf (stdout, "\n"); - fprintf (stdout, "Other options:\n"); - fprintf (stdout, "\t-h | --help Print this help and return\n"); - fprintf (stdout, "\t-v | --version Print informations about the version of this executable\n"); - fprintf (stdout, "\n"); -} - -//------------------------------------------------------------------------------ -int -et_config_parse_opt_line ( - int argc, - char *argv[], - char **et_dir_name, - char **scenario_file_name, - char **enb_config_file_name, - shift_packet_t **shifts, - int *delay_on_exit) -//------------------------------------------------------------------------------ -{ - int option = 0; - int rv = 0; - shift_packet_t *shift = NULL; - - enum long_option_e { - LONG_OPTION_START = 0x100, /* Start after regular single char options */ - LONG_OPTION_ENB_CONF_FILE, - LONG_OPTION_SCENARIO_FILE, - LONG_OPTION_MAX_SPEED, - LONG_OPTION_TEST_DIR, - LONG_OPTION_DELAY_EXIT, - LONG_OPTION_SHIFT_PACKET, - LONG_OPTION_SHIFT_PACKETS, - LONG_OPTION_HELP, - LONG_OPTION_VERSION - }; - - static struct option long_options[] = { - {"enb-conf-file", required_argument, 0, LONG_OPTION_ENB_CONF_FILE}, - {"scenario ", required_argument, 0, LONG_OPTION_SCENARIO_FILE}, - {"max-speed ", no_argument, 0, LONG_OPTION_MAX_SPEED}, - {"test-dir", required_argument, 0, LONG_OPTION_TEST_DIR}, - {"delay-on-exit", required_argument, 0, LONG_OPTION_DELAY_EXIT}, - {"shift-packet", required_argument, 0, LONG_OPTION_SHIFT_PACKET}, - {"shift-packets", required_argument, 0, LONG_OPTION_SHIFT_PACKETS}, - {"help", no_argument, 0, LONG_OPTION_HELP}, - {"version", no_argument, 0, LONG_OPTION_VERSION}, - {NULL, 0, NULL, 0} - }; - - /* - * Parsing command line - */ - while ((option = getopt_long (argc, argv, "vhmc:s:d:f:F", long_options, NULL)) != -1) { - switch (option) { - case LONG_OPTION_ENB_CONF_FILE: - case 'c': - if (optarg) { - *enb_config_file_name = strdup(optarg); - printf("eNB config file name is %s\n", *enb_config_file_name); - rv |= PLAY_SCENARIO; - } - break; - - case LONG_OPTION_SCENARIO_FILE: - case 's': - if (optarg) { - *scenario_file_name = strdup(optarg); - printf("Scenario file name is %s\n", *scenario_file_name); - rv |= PLAY_SCENARIO; - } - break; - - case LONG_OPTION_TEST_DIR: - case 'd': - if (optarg) { - *et_dir_name = strdup(optarg); - if (is_file_exists(*et_dir_name, "test dirname") != GS_IS_DIR) { - fprintf(stderr, "Please provide a valid test dirname, %s is not a valid directory name\n", *et_dir_name); - exit(1); - } - printf("Test dir name is %s\n", *et_dir_name); - } - break; - - case LONG_OPTION_DELAY_EXIT: - case 'D': - if (optarg) { - delay_on_exit = atoi(optarg); - if (0 > delay_on_exit) { - fprintf(stderr, "Please provide a valid -D/--delay-on-exit argument, %s is not a valid value\n", delay_on_exit); - exit(1); - } - printf("Delay on exit is %d\n", (int) delay_on_exit); - } - break; - - - case LONG_OPTION_SHIFT_PACKET: - case 'f': - if (optarg) { - if (NULL == *shifts) { - shift = calloc(1, sizeof (*shift)); - *shifts = shift; - } else { - shift->next = calloc(1, sizeof (*shift)); - shift = shift->next; - } - shift->single = 1; - printf("Arg Shift packet %s\n", optarg); - et_get_shift_arg(optarg, shift); - } - break; - - case LONG_OPTION_SHIFT_PACKETS: - case 'F': - if (optarg) { - if (NULL == *shifts) { - shift = calloc(1, sizeof (*shift)); - *shifts = shift; - } else { - shift->next = calloc(1, sizeof (*shift)); - shift = shift->next; - } - et_get_shift_arg(optarg, shift); - printf("Arg Shift packets %s\n", optarg); - } - break; - - case LONG_OPTION_MAX_SPEED: - case 'm': - g_max_speed = 1; - break; - - case LONG_OPTION_VERSION: - case 'v': - printf("Version %s\n", PACKAGE_VERSION); - exit (0); - break; - - case LONG_OPTION_HELP: - case 'h': - default: - et_usage (argc, argv); - exit (0); - } - } - if (NULL == *et_dir_name) { - fprintf(stderr, "Please provide a valid test dirname\n"); - exit(1); - } - if (chdir(*et_dir_name) != 0) { - fprintf(stderr, "ERROR: chdir %s returned %s\n", *et_dir_name, strerror(errno)); - exit(1); - } - if (rv & PLAY_SCENARIO) { - if (NULL == *enb_config_file_name) { - fprintf(stderr, "ERROR: please provide the original eNB config file name that should be in %s\n", *et_dir_name); - } - if (is_file_exists(*enb_config_file_name, "eNB config file") != GS_IS_FILE) { - fprintf(stderr, "ERROR: original eNB config file name %s is not found in dir %s\n", *enb_config_file_name, *et_dir_name); - } - et_enb_config_init(*enb_config_file_name); - - if (NULL == *scenario_file_name) { - fprintf(stderr, "ERROR: please provide the scenario file name that should be in %s\n", *et_dir_name); - } - if (is_file_exists(*scenario_file_name, "Scenario file") != GS_IS_FILE) { - fprintf(stderr, "ERROR: Scenario file name %s is not found in dir %s\n", *scenario_file_name, *et_dir_name); - } - } - return rv; -} - -//------------------------------------------------------------------------------ -int main( int argc, char **argv ) -//------------------------------------------------------------------------------ -{ - int actions = 0; - char *et_dir_name = NULL; - char *scenario_file_name = NULL; - char *enb_config_file_name = NULL; - struct shift_packet_s *shifts = NULL; - int ret = 0; - int delay_on_exit = 0; - et_scenario_t *scenario = NULL; - char play_scenario_filename[NAME_MAX]; - - memset(play_scenario_filename, 0, sizeof(play_scenario_filename)); - - // logging - logInit(); - set_glog(LOG_TRACE, LOG_MED); - - itti_init(TASK_MAX, tasks_info); - - set_comp_log(ENB_APP, LOG_TRACE, LOG_MED, 1); - set_comp_log(S1AP, LOG_TRACE, LOG_MED, 1); - set_comp_log(SCTP, LOG_TRACE, LOG_FULL, 1); - asn_debug = 0; - asn1_xer_print = 1; - - //parameters - actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name, &shifts, &delay_on_exit); //Command-line options - if (actions & PLAY_SCENARIO) { - if (et_generate_xml_scenario(et_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) { - if (NULL != (scenario = et_generate_scenario(play_scenario_filename))) { - ret = et_play_scenario(scenario, shifts); - } else { - fprintf(stderr, "ERROR: Could not generate scenario from tsml file\n"); - ret = -1; - } - } else { - fprintf(stderr, "ERROR: Could not generate tsml scenario from xml file\n"); - ret = -1; - } - et_free_pointer(et_dir_name); - et_free_pointer(scenario_file_name); - et_free_pointer(enb_config_file_name); - } - itti_wait_tasks_end(); - if (0 < delay_on_exit) { - sleep(delay_on_exit); - } - return ret; -} - - diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h deleted file mode 100644 index 6a2264f8ba..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario.h +++ /dev/null @@ -1,499 +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 - */ - -/* - play_scenario.h - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr -*/ - -#ifndef PLAY_SCENARIO_H_ -#define PLAY_SCENARIO_H_ -# include -# include -# include -# include -# include - -#include "S1AP-PDU.h" -#include "s1ap_ies_defs.h" -#include "play_scenario_s1ap_eNB_defs.h" -#include "hashtable.h" -#include "asn_compare.h" - -#define ET_XPATH_EXPRESSION_MAX_LENGTH 400 - - -// powers of 2 -#define ET_BIT_MASK_MATCH_SCTP_STREAM 1 -#define ET_BIT_MASK_MATCH_SCTP_SSN 2 -//#define ET_BIT_MASK_MATCH_S1AP_ 2 - -#define MAX_ENB 16 - -#define ENB_CONFIG_STRING_ACTIVE_ENBS "Active_eNBs" - -#define ENB_CONFIG_STRING_ENB_LIST "eNBs" -#define ENB_CONFIG_STRING_ENB_ID "eNB_ID" -#define ENB_CONFIG_STRING_CELL_TYPE "cell_type" -#define ENB_CONFIG_STRING_ENB_NAME "eNB_name" - -#define ENB_CONFIG_STRING_TRACKING_AREA_CODE "tracking_area_code" -#define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE "mobile_country_code" -#define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE "mobile_network_code" - - -#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" -#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" -#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" -#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active" -#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference" - -#define ENB_CONFIG_STRING_SCTP_CONFIG "SCTP" -#define ENB_CONFIG_STRING_SCTP_INSTREAMS "SCTP_INSTREAMS" -#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS "SCTP_OUTSTREAMS" - -#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES" -#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME" -#define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME "ENB_IPV4_ADDRESS_FOR_S1_MME" -#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U "ENB_INTERFACE_NAME_FOR_S1U" -#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U "ENB_IPV4_ADDRESS_FOR_S1U" -#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U "ENB_PORT_FOR_S1U" - - -typedef struct shift_packet_s { - unsigned int frame_number; // original frame number - int shift_seconds; - int shift_microseconds; - int single; // shift timing only for this packet (not also following packets) - struct shift_packet_s *next; -} shift_packet_t; - - -typedef struct mme_ip_address_s { - unsigned ipv4:1; - unsigned ipv6:1; - unsigned active:1; - char *ipv4_address; - char *ipv6_address; -} mme_ip_address_t; - -#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\ - struct in_addr inp;\ - if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\ - AssertFatal (0, MeSsAgE);\ - } else {\ - NwBo = inp.s_addr;\ - }\ - } while (0); - - -typedef struct Enb_properties_s { - /* Unique eNB_id to identify the eNB within EPC. - * For macro eNB ids this field should be 20 bits long. - * For home eNB ids this field should be 28 bits long. - */ - uint32_t eNB_id; - - /* The type of the cell */ - enum cell_type_e cell_type; - - /* Optional name for the cell - * NOTE: the name can be NULL (i.e no name) and will be cropped to 150 - * characters. - */ - char *eNB_name; - - /* Tracking area code */ - uint16_t tac; - - /* Mobile Country Code - * Mobile Network Code - */ - uint16_t mcc; - uint16_t mnc; - uint8_t mnc_digit_length; - - - - /* Physical parameters */ - - int16_t Nid_cell[1+MAX_NUM_CCs];// for testing, change later - /* Nb of MME to connect to */ - uint8_t nb_mme; - /* List of MME to connect to */ - mme_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS]; - - int sctp_in_streams; - int sctp_out_streams; - - char *enb_interface_name_for_S1U; - in_addr_t enb_ipv4_address_for_S1U; - tcp_udp_port_t enb_port_for_S1U; - - char *enb_interface_name_for_S1_MME; - in_addr_t enb_ipv4_address_for_S1_MME; - -} Enb_properties_t; - -typedef struct Enb_properties_array_s { - int number; - Enb_properties_t *properties[MAX_ENB]; -} Enb_properties_array_t; - -# define ET_ENB_REGISTER_RETRY_DELAY 3 -# define ET_FSM_STATE_WAITING_RX_EVENT_DELAY_SEC 15 - -typedef enum { - ET_PACKET_STATUS_START = 0, - ET_PACKET_STATUS_NONE = ET_PACKET_STATUS_START, - ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT, - ET_PACKET_STATUS_SCHEDULED_FOR_SENDING, - ET_PACKET_STATUS_SENT, - ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING, - ET_PACKET_STATUS_RECEIVED, - ET_PACKET_STATUS_END -} et_packet_status_t; - -typedef enum { - ET_FSM_STATE_START = 0, - ET_FSM_STATE_NULL = ET_FSM_STATE_START, - ET_FSM_STATE_CONNECTING_S1C, - ET_FSM_STATE_WAITING_RX_EVENT, - ET_FSM_STATE_WAITING_TX_EVENT, - ET_FSM_STATE_RUNNING, - ET_FSM_STATE_END -} et_fsm_state_t; - -enum COMPARE_ERR_CODE_e; - -typedef enum { - ET_ERROR_MATCH_START = COMPARE_ERR_CODE_END, - ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE = ET_ERROR_MATCH_START, - ET_ERROR_MATCH_PACKET_SCTP_PPID, - ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID, - ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID, - ET_ERROR_MATCH_PACKET_SCTP_SSN, - ET_ERROR_MATCH_PACKET_S1AP_PRESENT, - ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE, - ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY, - ET_ERROR_MATCH_END -} et_error_match_code_t; - - - - -typedef enum { - ET_PACKET_ACTION_S1C_START = 0, - ET_PACKET_ACTION_S1C_NULL = ET_PACKET_ACTION_S1C_START, - ET_PACKET_ACTION_S1C_SEND, - ET_PACKET_ACTION_S1C_RECEIVE, - ET_PACKET_ACTION_S1C_END -} et_packet_action_t; - -// from kernel source file 3.19/include/linux/sctp.h -typedef enum { - SCTP_CID_DATA = 0, - SCTP_CID_INIT = 1, - SCTP_CID_INIT_ACK = 2, - SCTP_CID_SACK = 3, - SCTP_CID_HEARTBEAT = 4, - SCTP_CID_HEARTBEAT_ACK = 5, - SCTP_CID_ABORT = 6, - SCTP_CID_SHUTDOWN = 7, - SCTP_CID_SHUTDOWN_ACK = 8, - SCTP_CID_ERROR = 9, - SCTP_CID_COOKIE_ECHO = 10, - SCTP_CID_COOKIE_ACK = 11, - SCTP_CID_ECN_ECNE = 12, - SCTP_CID_ECN_CWR = 13, - SCTP_CID_SHUTDOWN_COMPLETE = 14, - - /* AUTH Extension Section 4.1 */ - SCTP_CID_AUTH = 0x0F, - - /* PR-SCTP Sec 3.2 */ - SCTP_CID_FWD_TSN = 0xC0, - - /* Use hex, as defined in ADDIP sec. 3.1 */ - SCTP_CID_ASCONF = 0xC1, - SCTP_CID_ASCONF_ACK = 0x80, -} sctp_cid_t; /* enum */ - -typedef enum { - TEST_S1AP_PDU_TYPE_START = 0, - TEST_S1AP_PDU_TYPE_UNKNOWN = TEST_S1AP_PDU_TYPE_START, - TEST_S1AP_PDU_TYPE_INITIATING, - TEST_S1AP_PDU_TYPE_SUCCESSFUL_OUTCOME, - TEST_S1AP_PDU_TYPE_UNSUCCESSFUL_OUTCOME, - TEST_S1AP_PDU_TYPE_END -} et_s1ap_pdu_type_t; - - -typedef struct et_s1ap_s { - //et_s1ap_pdu_type_t pdu_type; - S1AP_S1AP_PDU_t pdu; // decoded ASN1 C type: choice of initiatingMessage, successfulOutcome, unsuccessfulOutcome - uint16_t xml_stream_pos_offset; - uint16_t binary_stream_pos; - uint16_t binary_stream_allocated_size; - uint8_t *binary_stream; - xmlDocPtr doc; // XML representation of the S1AP PDU -} et_s1ap_t; - - -// from kernel source file 3.19/include/linux/sctp.h, Big Endians -typedef struct sctp_datahdr_s { - uint32_t tsn; - uint16_t stream; - uint16_t ssn; - uint32_t ppid; - uint32_t assoc_id; // filled when running scenario - et_s1ap_t payload; -} sctp_datahdr_t; - -// from kernel source file 3.19/include/linux/sctp.h, Big Endians -typedef struct sctp_inithdr { - uint32_t init_tag; - uint32_t a_rwnd; - uint16_t num_outbound_streams; - uint16_t num_inbound_streams; - uint32_t initial_tsn; - uint8_t params[0]; -} sctp_inithdr_t; - -typedef sctp_inithdr_t sctp_initackhdr_t; - -typedef struct et_sctp_hdr_s { - unsigned int src_port; - unsigned int dst_port; - sctp_cid_t chunk_type; - union { - sctp_datahdr_t data_hdr; - sctp_inithdr_t init_hdr; - sctp_initackhdr_t init_ack_hdr; - } u; -} et_sctp_hdr_t; - -typedef struct et_ip_s { - unsigned int address_family; // AF_INET, AF_INET6 - union { - struct in6_addr ipv6; - in_addr_t ipv4; - } address; - char str[INET6_ADDRSTRLEN+1]; -} et_ip_t; - -typedef struct et_ip_hdr_s { - et_ip_t src; - et_ip_t dst; -} et_ip_hdr_t; - -typedef struct et_packet_s { - et_packet_action_t action; - struct timeval time_relative_to_first_packet; - struct timeval time_relative_to_last_sent_packet; - struct timeval time_relative_to_last_received_packet; - unsigned int original_frame_number; - unsigned int packet_number; - instance_t enb_instance; - et_ip_hdr_t ip_hdr; - et_sctp_hdr_t sctp_hdr; - struct et_packet_s *next; - - //scenario running vars - et_packet_status_t status; - long timer_id; // ITTI timer id for waiting rx packets - struct timeval timestamp_packet; // timestamp when rx or tx packet -} et_packet_t; - - -typedef struct sctp_epoll_s { - /* Array of events monitored by the task. - * By default only one fd is monitored (the one used to received messages - * from other tasks). - * More events can be suscribed later by the task itself. - */ - struct epoll_event *events; - - int epoll_nb_events; - -} thread_desc_t; - -typedef struct et_scenario_s { - xmlChar *name; - et_packet_t *list_packet; - //-------------------------- - // playing scenario - //-------------------------- - Enb_properties_array_t *enb_properties; - uint32_t register_enb_pending; - uint32_t registered_enb; - long enb_register_retry_timer_id; - - - hash_table_t *hash_mme2association_id; - hash_table_t *hash_old_ue_mme_id2ue_mme_id; - struct timeval time_last_tx_packet; // Time last sent packet - struct timeval time_last_rx_packet; // Time last packet received with all previous scenario RX packet received. - et_packet_t *last_rx_packet; // Last packet received with all previous scenario RX packet received. - et_packet_t *last_tx_packet; // Last sent packet - et_packet_t *next_packet; // Next packet to be handled in the scenario (RX or TX packet) - - int timer_count; -} et_scenario_t; - - -typedef enum { - ET_EVENT_START = 0, - ET_EVENT_INIT = ET_EVENT_START, - ET_EVENT_S1C_CONNECTED, - ET_EVENT_RX_SCTP_EVENT, - ET_EVENT_RX_S1AP, - ET_EVENT_RX_PACKET_TIME_OUT, - ET_EVENT_TX_TIMED_PACKET, - ET_EVENT_TICK, - ET_EVENT_END -} et_event_code_t; - -typedef struct et_event_init_s { - et_scenario_t *scenario; -} et_event_init_t; - -typedef struct et_event_s1ap_data_ind_s { - sctp_datahdr_t sctp_datahdr; -} et_event_s1ap_data_ind_t; - -typedef struct et_event_s1ap_data_req_s { - -} et_event_s1ap_data_req_t; - -typedef struct et_event_s { - et_event_code_t code; - union { - et_event_init_t init; - et_event_s1ap_data_ind_t s1ap_data_ind; - et_packet_t *tx_timed_packet; - et_packet_t *rx_packet_time_out; - } u; -} et_event_t; - -inline void et_free_pointer(void *p) {if (NULL != p) {free(p);}}; - -//------------------------- -void et_free_packet(et_packet_t *packet); -void et_free_scenario(et_scenario_t *scenario); -//------------------------- -void et_display_packet_s1ap_data(const et_s1ap_t *const s1ap); -void et_display_packet_sctp_init(const sctp_inithdr_t *const sctp); -void et_display_packet_sctp_initack(const sctp_initackhdr_t *const sctp); -void et_display_packet_sctp_data(const sctp_datahdr_t *const sctp); -void et_display_packet_sctp(const et_sctp_hdr_t *const sctp); -void et_display_packet_ip(const et_ip_hdr_t *const ip); -void et_display_packet(const et_packet_t *const packet); -void et_display_scenario(const et_scenario_t *const scenario); -//------------------------- -int et_s1ap_decode_initiating_message(s1ap_message *message, S1AP_InitiatingMessage_t *initiating_p); -int et_s1ap_decode_successful_outcome(s1ap_message *message, S1AP_SuccessfulOutcome_t *successfullOutcome_p); -int et_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1AP_UnsuccessfulOutcome_t *unSuccessfullOutcome_p); -int et_s1ap_decode_pdu(S1AP_PDU_t *const pdu, s1ap_message *const message, const uint8_t *const buffer, const uint32_t length); -void et_decode_s1ap(et_s1ap_t *const s1ap); -//------------------------- -int et_s1ap_eNB_compare_assoc_id( struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2); -uint32_t et_s1ap_generate_eNB_id(void); -uint16_t et_s1ap_eNB_fetch_add_global_cnx_id(void); -void et_s1ap_eNB_prepare_internal_data(void); -void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p); -struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME(s1ap_eNB_instance_t *instance_p,int32_t assoc_id, uint16_t cnx_id); -s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance); -void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream); -int et_handle_s1ap_mismatch_mme_ue_s1ap_id(et_packet_t *const spacket, et_packet_t *const rx_packet); -asn_comp_rval_t *et_s1ap_is_matching(et_s1ap_t *const s1ap1, et_s1ap_t *const s1ap2, const uint32_t constraints); -et_packet_t *et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t *const s1ap_data_ind); -int et_scenario_set_packet_received(et_packet_t *const packet); -int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t *const sctp_data_ind); -void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *const sctp_data_ind); -void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, - net_ip_address_t *mme_ip_address, - net_ip_address_t *local_ip_addr, - uint16_t in_streams, - uint16_t out_streams); -void et_s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown); -void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); -void et_s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); -void *et_s1ap_eNB_task(void *arg); -//------------------------- -int et_generate_xml_scenario( - const char const *xml_in_dir_name, - const char const *xml_in_scenario_filename, - const char const *enb_config_filename, - char const *tsml_out_scenario_filename); -//------------------------- -void timeval_add (struct timeval *const result, const struct timeval *const a, const struct timeval *const b); -int timeval_subtract (struct timeval *const result, struct timeval *const a, struct timeval *const b); -void et_scenario_wait_rx_packet(et_packet_t *const packet); -void et_scenario_schedule_tx_packet(et_packet_t *packet); -et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event); -et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event); -et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event); -et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t event); -et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event); -et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event); -//------------------------- -void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t *const s1ap); -void et_parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t *const sctp_hdr); -void et_parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t *const sctp_hdr); -void et_parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t *const sctp_hdr); -void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t *const sctp_hdr); -et_packet_t *et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node); -et_scenario_t *et_generate_scenario(const char *const et_scenario_filename); -//------------------------- -asn_comp_rval_t *et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message *const m1, s1ap_message *const m2, const uint32_t constraints); -void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t *const s1ap, xmlNode *node, const S1AP_MME_UE_S1AP_ID_t new_id); -void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t *const s1ap_payload, xmlNodeSetPtr nodes, const S1AP_MME_UE_S1AP_ID_t new_id); -int et_s1ap_update_mme_ue_s1ap_id(et_packet_t *const packet, const S1AP_MME_UE_S1AP_ID_t old_id, const S1AP_MME_UE_S1AP_ID_t new_id); -//------------------------- -asn_comp_rval_t *et_sctp_data_is_matching(sctp_datahdr_t *const sctp1, sctp_datahdr_t *const sctp2, const uint32_t constraints); -asn_comp_rval_t *et_sctp_is_matching(et_sctp_hdr_t *const sctp1, et_sctp_hdr_t *const sctp2, const uint32_t constraints); -//------------------------------------------------------------------------------ -void et_print_hex_octets(const unsigned char *const byte_stream, const unsigned long int num); -int et_is_file_exists ( const char const *file_nameP, const char const *file_roleP); -int et_strip_extension( char *in_filename); -void et_get_shift_arg( char *line_argument, shift_packet_t *const shift); -int et_split_path ( char *pathP, char *** resP); -void et_display_node ( xmlNodePtr node, unsigned int indent); -void et_display_tree ( xmlNodePtr node, unsigned int indent); -char *et_ip2ip_str(const et_ip_t *const ip); -int et_compare_et_ip_to_net_ip_address(const et_ip_t *const ip, const net_ip_address_t *const net_ip); -int et_hex2data(unsigned char *const data, const unsigned char *const hexstring, const unsigned int len); -sctp_cid_t et_chunk_type_str2cid(const xmlChar *const chunk_type_str); -const char *const et_chunk_type_cid2str(const sctp_cid_t chunk_type); -const char *const et_error_match2str(const int err); -et_packet_action_t et_action_str2et_action_t(const xmlChar *const action); -void et_ip_str2et_ip(const xmlChar *const ip_str, et_ip_t *const ip); -void et_enb_config_init(const char const *lib_config_file_name_pP); -const Enb_properties_array_t *et_enb_config_get(void); -void et_eNB_app_register(const Enb_properties_array_t *enb_properties); -void *et_eNB_app_task(void *args_p); -int et_play_scenario(et_scenario_t *const scenario, const struct shift_packet_s *shifts); - -#endif /* PLAY_SCENARIO_H_ */ diff --git a/openair3/TEST/EPC_TEST/play_scenario_decode.c b/openair3/TEST/EPC_TEST/play_scenario_decode.c deleted file mode 100644 index f6b983bf73..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario_decode.c +++ /dev/null @@ -1,68 +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 - */ - -/* - play_scenario_decode.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ - -#include "intertask_interface.h" -#include "platform_types.h" -#include "s1ap_eNB_decoder.h" -#include "assertions.h" -#include "play_scenario.h" - -//------------------------------------------------------------------------------ -int et_s1ap_decode_pdu(S1AP_PDU_t *const pdu, const uint8_t *const buffer, const uint32_t length) -{ - asn_dec_rval_t dec_ret; - - DevAssert(buffer != NULL); - - memset((void *)pdu, 0, sizeof(S1AP_S1AP_PDU_t)); - dec_ret = aper_decode(NULL, - &asn_DEF_S1AP_S1AP_PDU, - (void **)&pdu, - buffer, - length, - 0, - 0); - - if (dec_ret.code != RC_OK) { - S1AP_ERROR("Failed to decode pdu\n"); - return -1; - } - - return dec_ret.code; -} - -//------------------------------------------------------------------------------ -void et_decode_s1ap(et_s1ap_t *const s1ap) -{ - if (NULL != s1ap) { - if (et_s1ap_decode_pdu(&s1ap->pdu, s1ap->binary_stream, s1ap->binary_stream_allocated_size) < 0) { - AssertFatal (0, "ERROR %s() Cannot decode S1AP message!\n", __FUNCTION__); - } - } -} diff --git a/openair3/TEST/EPC_TEST/play_scenario_display.c b/openair3/TEST/EPC_TEST/play_scenario_display.c deleted file mode 100644 index b29c0758c4..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario_display.c +++ /dev/null @@ -1,348 +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 - */ - -/* - play_scenario_display.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ -#include -#include - -#include "intertask_interface.h" -#include "platform_types.h" -#include "assertions.h" -#include "s1ap_eNB_decoder.h" -#include "play_scenario.h" -//----------------------------------------------------------------------------- -void et_print_hex_octets(const unsigned char *const byte_stream, const unsigned long int num) -{ - unsigned long octet_index = 0; - - if (byte_stream == NULL) { - return; - } - - fprintf(stdout, "+-----+-------------------------------------------------+\n"); - fprintf(stdout, "| | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n"); - fprintf(stdout, "+-----+-------------------------------------------------+\n"); - - for (octet_index = 0; octet_index < num; octet_index++) { - if ((octet_index % 16) == 0) { - if (octet_index != 0) { - fprintf(stdout, " |\n"); - } - - fprintf(stdout, " %04lu |", octet_index); - } - - /* - * Print every single octet in hexadecimal form - */ - fprintf(stdout, " %02x", byte_stream[octet_index]); - /* - * Align newline and pipes according to the octets in groups of 2 - */ - } - - /* - * Append enough spaces and put final pipe - */ - unsigned char index; - - for (index = octet_index; index < 16; ++index) { - fprintf(stdout, " "); - } - - fprintf(stdout, " |\n"); -} - -//------------------------------------------------------------------------------ -void et_display_node(xmlNodePtr node, unsigned int indent) -{ - int i = 0; - - if (node->type == XML_ELEMENT_NODE) { - xmlChar *path = xmlGetNodePath(node); - - for (i=0; ichildren != NULL && node->children->type == XML_TEXT_NODE) { - xmlChar *content = xmlNodeGetContent(node); - printf("%s -> %s\n", path, content); - xmlFree(content); - } else { - printf("%s\n", path); - } - - xmlFree(path); - } -} -//------------------------------------------------------------------------------ -void et_display_tree(xmlNodePtr node, unsigned int indent) -{ - xmlNode *cur_node = NULL; - - for (cur_node = node; cur_node; cur_node = cur_node->next) { - if (cur_node->type == XML_ELEMENT_NODE) { - et_display_node(cur_node, indent); - } - - et_display_tree(cur_node->children, indent++); - } -} -//------------------------------------------------------------------------------ -void et_display_packet_S1AP_data(const et_S1AP_t *const s1ap) -{ - char *message_string = NULL; - - if (s1ap) { - message_string = calloc(20000, sizeof(char)); - AssertFatal (NULL != message_string, "ERROR malloc()failed!\n"); - - switch(s1ap->pdu.present) { - case S1AP_S1AP_PDU_PR_initiatingMessage: - switch(s1ap->pdu.choice.initiatingMessage.procedureCode) { - case S1AP_ProcedureCode_id_downlinkNASTransport: s1ap_xer_print_s1ap_downlinknastransport(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_InitialContextSetup: s1ap_xer_print_s1ap_initialcontextsetuprequest(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_UEContextRelease: s1ap_xer_print_s1ap_uecontextreleasecommand(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_Paging: s1ap_xer_print_s1ap_paging(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_uplinkNASTransport: s1ap_xer_print_s1ap_uplinknastransport(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_S1Setup: s1ap_xer_print_s1ap_s1setuprequest(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_initialUEMessage: s1ap_xer_print_s1ap_initialuemessage(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_UEContextReleaseRequest: s1ap_xer_print_s1ap_uecontextreleaserequest(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_UECapabilityInfoIndication:s1ap_xer_print_s1ap_uecapabilityinfoindication(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_NASNonDeliveryIndication: s1ap_xer_print_s1ap_nasnondeliveryindication_(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - default: - AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n", - (int)s1ap->pdu.choice.initiatingMessage.procedureCode); - } - - break; - - case S1AP_S1AP_PDU_PR_successfulOutcome: - switch(s1ap->pdu.choice.successfulOutcome.procedureCode) { - case S1AP_ProcedureCode_id_S1Setup: s1ap_xer_print_s1ap_s1setupresponse(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_InitialContextSetup: s1ap_xer_print_s1ap_initialcontextsetupresponse(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_UEContextRelease: s1ap_xer_print_s1ap_uecontextreleasecomplete(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - default: - AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n", - (int)s1ap->pdu.choice.successfulOutcome.procedureCode); - } - - break; - - case S1AP_S1AP_PDU_PR_unsuccessfulOutcome: - switch(s1ap->pdu.choice.unsuccessfulOutcome.procedureCode) { - case S1AP_ProcedureCode_id_S1Setup: s1ap_xer_print_s1ap_s1setupfailure(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - case S1AP_ProcedureCode_id_InitialContextSetup: s1ap_xer_print_s1ap_initialcontextsetupfailure(s1ap_xer__print2sp, message_string, (S1AP_message *)&s1ap->message); break; - - default: - et_free_pointer(message_string); - AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n", - (int)s1ap->pdu.choice.unsuccessfulOutcome.procedureCode); - break; - } - - break; - - default: - AssertFatal(0, "Unknown presence (%d) or not implemented\n", (int)s1ap->pdu.present); - break; - } - - fprintf(stdout, "\t\tSCTP.data XML dump:\n%s\n", message_string); - et_free_pointer(message_string); - } -} -//------------------------------------------------------------------------------ -void et_display_packet_sctp_init(const sctp_inithdr_t *const sctp) -{ - if (sctp) { - fprintf(stdout, "\t\tSCTP.init.init_tag : %u\n", sctp->init_tag); - fprintf(stdout, "\t\tSCTP.init.a_rwnd : %u\n", sctp->a_rwnd); - fprintf(stdout, "\t\tSCTP.init.num_inbound_streams : %u\n", sctp->num_inbound_streams); - fprintf(stdout, "\t\tSCTP.init.num_outbound_streams : %u\n", sctp->num_outbound_streams); - fprintf(stdout, "\t\tSCTP.init.initial_tsn : %u\n", sctp->initial_tsn); - } -} -//------------------------------------------------------------------------------ -void et_display_packet_sctp_initack(const sctp_initackhdr_t *const sctp) -{ - if (sctp) { - fprintf(stdout, "\t\tSCTP.initack.init_tag : %u\n", sctp->init_tag); - fprintf(stdout, "\t\tSCTP.initack.a_rwnd : %u\n", sctp->a_rwnd); - fprintf(stdout, "\t\tSCTP.initack.num_inbound_streams : %u\n", sctp->num_inbound_streams); - fprintf(stdout, "\t\tSCTP.initack.num_outbound_streams : %u\n", sctp->num_outbound_streams); - fprintf(stdout, "\t\tSCTP.initack.initial_tsn : %u\n", sctp->initial_tsn); - } -} -//------------------------------------------------------------------------------ -void et_display_packet_sctp_data(const sctp_datahdr_t *const sctp) -{ - if (sctp) { - fprintf(stdout, "\t\tSCTP.data.tsn : %u\n", sctp->tsn); - fprintf(stdout, "\t\tSCTP.data.stream : %u\n", sctp->stream); - fprintf(stdout, "\t\tSCTP.data.ssn : %u\n", sctp->ssn); - fprintf(stdout, "\t\tSCTP.data.ppid : %u\n", sctp->ppid); - - if (sctp->ppid == 18) { - et_display_packet_s1ap_data(&sctp->payload); - } - - fprintf(stdout, "\t\tSCTP.data.binary_stream_allocated_size : %u\n", sctp->payload.binary_stream_allocated_size); - - if (NULL != sctp->payload.binary_stream) { - fprintf(stdout, "\t\tSCTP.data.binary_stream :\n"); - et_print_hex_octets(sctp->payload.binary_stream, sctp->payload.binary_stream_allocated_size); - } else { - fprintf(stdout, "\t\tSCTP.data.binary_stream : NULL\n"); - } - } -} - -//------------------------------------------------------------------------------ -void et_display_packet_sctp(const et_sctp_hdr_t *const sctp) -{ - if (sctp) { - fprintf(stdout, "\t\tSCTP.src_port : %u\n", sctp->src_port); - fprintf(stdout, "\t\tSCTP.dst_port : %u\n", sctp->dst_port); - fprintf(stdout, "\t\tSCTP.chunk_type : %s\n", et_chunk_type_cid2str(sctp->chunk_type)); - - switch (sctp->chunk_type) { - case SCTP_CID_DATA: - et_display_packet_sctp_data(&sctp->u.data_hdr); - break; - - case SCTP_CID_INIT: - et_display_packet_sctp_initack(&sctp->u.init_hdr); - break; - - case SCTP_CID_INIT_ACK: - et_display_packet_sctp_initack(&sctp->u.init_ack_hdr); - break; - - default: - ; - } - } -} -//------------------------------------------------------------------------------ -void et_display_packet_ip(const et_ip_hdr_t *const ip) -{ - if (ip) { - fprintf(stdout, "\t\tSource address : %s\n", et_ip2ip_str(&ip->src)); - fprintf(stdout, "\t\tDestination address : %s\n", et_ip2ip_str(&ip->dst)); - } -} - -//------------------------------------------------------------------------------ -void et_display_packet(const et_packet_t *const packet) -{ - if (packet) { - fprintf(stdout, "-------------------------------------------------------------------------------\n"); - fprintf(stdout, "\tPacket:\tnum %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); - fprintf(stdout, "\tPacket:\ttime relative to 1st packet %ld.%06lu\n", - packet->time_relative_to_first_packet.tv_sec, packet->time_relative_to_first_packet.tv_usec); - fprintf(stdout, "\tPacket:\ttime relative to last tx packet %ld.%06lu\n", - packet->time_relative_to_last_sent_packet.tv_sec, packet->time_relative_to_last_sent_packet.tv_usec); - fprintf(stdout, "\tPacket:\ttime relative to last_received packet %ld.%06lu\n", - packet->time_relative_to_last_received_packet.tv_sec, packet->time_relative_to_last_received_packet.tv_usec); - - switch(packet->action) { - case ET_PACKET_ACTION_S1C_SEND: - fprintf(stdout, "\tPacket:\tAction SEND\n"); - break; - - case ET_PACKET_ACTION_S1C_RECEIVE: - fprintf(stdout, "\tPacket:\tAction RECEIVE\n"); - break; - - default: - fprintf(stdout, "\tPacket:\tAction UNKNOWN\n"); - } - - switch(packet->status) { - case ET_PACKET_STATUS_NONE: - fprintf(stdout, "\tPacket:\tStatus NONE\n"); - break; - - case ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT: - fprintf(stdout, "\tPacket:\tStatus NOT_TAKEN_IN_ACCOUNT\n"); - break; - - case ET_PACKET_STATUS_SCHEDULED_FOR_SENDING: - fprintf(stdout, "\tPacket:\tStatus SCHEDULED_FOR_SENDING\n"); - break; - - case ET_PACKET_STATUS_SENT: - fprintf(stdout, "\tPacket:\tStatus SENT\n"); - break; - - case ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING: - fprintf(stdout, "\tPacket:\tStatus SCHEDULED_FOR_RECEIVING\n"); - break; - - case ET_PACKET_STATUS_RECEIVED: - fprintf(stdout, "\tPacket:\tStatus RECEIVED\n"); - break; - - default: - fprintf(stdout, "\tPacket:\tStatus UNKNOWN\n"); - } - - et_display_packet_ip(&packet->ip_hdr); - et_display_packet_sctp(&packet->sctp_hdr); - } -} -//------------------------------------------------------------------------------ -void et_display_scenario(const et_scenario_t *const scenario) -{ - et_packet_t *packet = NULL; - - if (scenario) { - fprintf(stdout, "Scenario: %s\n", (scenario->name != NULL) ? (char *)scenario->name:"UNKNOWN NAME"); - packet = scenario->list_packet; - - while (packet) { - et_display_packet(packet); - packet = packet->next; - } - } -} diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c deleted file mode 100644 index 0459f4d5dd..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario_fsm.c +++ /dev/null @@ -1,586 +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 - */ - -/* - play_scenario_fsm.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ -#include -#include -#include - -#include "intertask_interface.h" -#include "platform_types.h" -#include "assertions.h" -#include "play_scenario.h" -#include "play_scenario_s1ap_eNB_defs.h" - -//------------------------------------------------------------------------------ -extern int g_max_speed; -//------------------------------------------------------------------------------ -et_scenario_t *g_scenario = NULL; -pthread_mutex_t g_fsm_lock = PTHREAD_MUTEX_INITIALIZER; -et_fsm_state_t g_fsm_state = ET_FSM_STATE_NULL; -uint32_t g_constraints = ET_BIT_MASK_MATCH_SCTP_STREAM | ET_BIT_MASK_MATCH_SCTP_SSN; -//------------------------------------------------------------------------------ -// it is assumed that if a time is negative tv_sec and tv_usec are both negative -void timeval_add (struct timeval *const result, const struct timeval *const a, const struct timeval *const b) -{ - AssertFatal(((a->tv_sec <= 0) && (a->tv_usec <= 0)) || ((a->tv_sec >= 0) && (a->tv_usec >= 0)), " Bad time format arg a\n"); - AssertFatal(((b->tv_sec <= 0) && (b->tv_usec <= 0)) || ((b->tv_sec >= 0) && (b->tv_usec >= 0)), " Bad time format arg b\n"); - // may happen overflows but were are not dealing with very large timings - long long int r = a->tv_usec + b->tv_usec + (a->tv_sec + b->tv_sec) * 1000000; - result->tv_sec = r / (long long int)1000000; - result->tv_usec = r % (long long int)1000000; - - if ((result != a) && (result != b)) { - LOG_D(ENB_APP, "timeval_add(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec); - } -} - -//------------------------------------------------------------------------------ -// it is assumed that if a time is negative tv_sec and tv_usec are both negative -// return true if result is positive -int timeval_subtract (struct timeval *const result, struct timeval *const a, struct timeval *const b) -{ - AssertFatal(((a->tv_sec <= 0) && (a->tv_usec <= 0)) || ((a->tv_sec >= 0) && (a->tv_usec >= 0)), " Bad time format arg a\n"); - AssertFatal(((b->tv_sec <= 0) && (b->tv_usec <= 0)) || ((b->tv_sec >= 0) && (b->tv_usec >= 0)), " Bad time format arg b\n"); - // may happen overflows but were are not dealing with very large timings - long long int r = a->tv_usec - b->tv_usec + (a->tv_sec - b->tv_sec) * 1000000; - result->tv_sec = r / (long long int)1000000; - result->tv_usec = r % (long long int)1000000; - - if ((result != a) && (result != b)) { - LOG_D(ENB_APP, "timeval_subtract(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec); - } - - return (result->tv_sec >= 0) && (result->tv_usec >= 0); -} - -//------------------------------------------------------------------------------ -void et_scenario_wait_rx_packet(et_packet_t *const packet) -{ - packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING; - g_fsm_state = ET_FSM_STATE_WAITING_RX_EVENT; - - if (timer_setup (ET_FSM_STATE_WAITING_RX_EVENT_DELAY_SEC, 0, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, - packet, &packet->timer_id) < 0) { - AssertFatal(0, " Can not start waiting RX event timer\n"); - } - - g_scenario->timer_count++; - LOG_D(ENB_APP, "Waiting RX packet num %d original frame number %u\n", packet->packet_number, packet->original_frame_number); -} -//------------------------------------------------------------------------------ -void et_scenario_schedule_tx_packet(et_packet_t *packet) -{ - s1ap_eNB_instance_t *s1ap_eNB_instance = NULL; - struct timeval now = { .tv_sec = 0, .tv_usec = 0 }; - struct timeval offset_last_tx_packet = { .tv_sec = 0, .tv_usec = 0 }; - struct timeval offset_last_rx_packet = { .tv_sec = 0, .tv_usec = 0 }; - struct timeval offset_tx_rx = { .tv_sec = 0, .tv_usec = 0 }; - struct timeval offset = { .tv_sec = 0, .tv_usec = 0 }; - int last_packet_was_rx = 0; - int we_are_too_late = 0; - int original_frame_number = -1; - AssertFatal(NULL != packet, "packet argument is NULL"); - s1ap_eNB_instance = et_s1ap_eNB_get_instance(packet->enb_instance); - AssertFatal(NULL != s1ap_eNB_instance, "Cannot get s1ap_eNB_instance_t for eNB instance %d", packet->enb_instance); - LOG_D(ENB_APP, "%s\n", __FUNCTION__); - g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; - - switch (packet->sctp_hdr.chunk_type) { - case SCTP_CID_DATA: - // check if we can send it now - // TODO: BUG we have to discard in scenario all packets that cannot be processed (SACK, COOKIEs, etc) - AssertFatal(gettimeofday(&now, NULL) == 0, "gettimeofday failed"); - timeval_subtract(&offset_last_tx_packet,&now,&g_scenario->time_last_tx_packet); - timeval_subtract(&offset_last_rx_packet,&now,&g_scenario->time_last_rx_packet); - LOG_D(ENB_APP, "offset_last_tx_packet=%ld.%06d\n", offset_last_tx_packet.tv_sec, offset_last_tx_packet.tv_usec); - LOG_D(ENB_APP, "offset_last_rx_packet=%ld.%06d\n", offset_last_rx_packet.tv_sec, offset_last_rx_packet.tv_usec); - last_packet_was_rx = timeval_subtract(&offset_tx_rx,&offset_last_tx_packet,&offset_last_rx_packet); - - if (last_packet_was_rx) { - LOG_D(ENB_APP, "last_packet_was_rx\n"); - we_are_too_late = timeval_subtract(&offset,&offset_last_rx_packet,&packet->time_relative_to_last_received_packet); - LOG_D(ENB_APP, "we_are_too_late=%d, offset=%ld.%06d\n", we_are_too_late, offset.tv_sec, offset.tv_usec); - } else { - LOG_D(ENB_APP, "last_packet_was_tx\n"); - we_are_too_late = timeval_subtract(&offset,&offset_last_tx_packet,&packet->time_relative_to_last_sent_packet); - LOG_D(ENB_APP, "we_are_too_late=%d, offset=%ld.%06d\n", we_are_too_late, offset.tv_sec, offset.tv_usec); - } - - if ((0 == we_are_too_late) && (0 == g_max_speed)) { - // set timer - if ((offset.tv_sec <= 0) || (offset.tv_usec <= 0)) { - offset.tv_sec = -offset.tv_sec; - offset.tv_usec = -offset.tv_usec; - } - - LOG_D(ENB_APP, "Send packet num %u original frame number %u in %ld.%06d sec\n", - packet->packet_number, packet->original_frame_number, offset.tv_sec, offset.tv_usec); - packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_SENDING; - - if (timer_setup (offset.tv_sec, offset.tv_usec, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,packet, &packet->timer_id) < 0) { - AssertFatal(0, " Can not start TX event timer\n"); - } - - g_scenario->timer_count++; - // Done g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT; - } else { - // send immediately - AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed"); - original_frame_number = packet->original_frame_number; - - do { - g_scenario->time_last_tx_packet.tv_sec = packet->timestamp_packet.tv_sec; - g_scenario->time_last_tx_packet.tv_usec = packet->timestamp_packet.tv_usec; - LOG_D(ENB_APP, "Sending packet num %d original frame number %u immediately\n",packet->packet_number, packet->original_frame_number); - et_s1ap_eNB_itti_send_sctp_data_req( - packet->enb_instance, - packet->sctp_hdr.u.data_hdr.assoc_id, - packet->sctp_hdr.u.data_hdr.payload.binary_stream, - packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, - packet->sctp_hdr.u.data_hdr.stream); - packet->status = ET_PACKET_STATUS_SENT; - g_scenario->next_packet = g_scenario->next_packet->next; - packet = packet->next; - } while ((NULL != packet) && (packet->original_frame_number == original_frame_number)); - - g_fsm_state = ET_FSM_STATE_RUNNING; - } - - break; - - case SCTP_CID_INIT: - case SCTP_CID_INIT_ACK: - AssertFatal(0, "Invalid case TX packet SCTP_CID_INIT or SCTP_CID_INIT_ACK"); - break; - - default: - AssertFatal(0, "Invalid case TX packet SCTP_CID %d", packet->sctp_hdr.chunk_type); - } -} -//------------------------------------------------------------------------------ -et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event) -{ - switch (event.code) { - case ET_EVENT_TICK: - while (NULL != g_scenario->next_packet) { - LOG_D(ENB_APP, "EVENT_TICK: Considering packet num %d original frame number %u\n", g_scenario->next_packet->packet_number, g_scenario->next_packet->original_frame_number); - - switch (g_scenario->next_packet->sctp_hdr.chunk_type) { - case SCTP_CID_DATA : - - // no init in this scenario, may be sub-scenario - if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { - if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { - et_scenario_schedule_tx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_fsm_lock); - et_event_t continue_event; - continue_event.code = ET_EVENT_TICK; - et_scenario_fsm_notify_event(continue_event); - return g_fsm_state; - } else if (g_scenario->next_packet->status != ET_PACKET_STATUS_SCHEDULED_FOR_SENDING) { - AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); - } - } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { - g_scenario->next_packet = g_scenario->next_packet->next; - } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { - et_scenario_wait_rx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_fsm_lock); - return g_fsm_state; - } else { - AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); - } - } else { - AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action); - } - - break; - - case SCTP_CID_INIT: - case SCTP_CID_INIT_ACK: - case SCTP_CID_HEARTBEAT: - case SCTP_CID_HEARTBEAT_ACK: - case SCTP_CID_COOKIE_ECHO: - case SCTP_CID_COOKIE_ACK: - case SCTP_CID_ECN_ECNE: - case SCTP_CID_ECN_CWR: - LOG_D(ENB_APP, "EVENT_TICK: Ignoring packet num %d SCTP CID %s\n", - g_scenario->next_packet->packet_number, - et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); - g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - g_scenario->next_packet = g_scenario->next_packet->next; - break; - - case SCTP_CID_ABORT: - case SCTP_CID_SHUTDOWN: - case SCTP_CID_SHUTDOWN_ACK: - case SCTP_CID_ERROR: - case SCTP_CID_SHUTDOWN_COMPLETE: - AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)", - et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); - break; - - default: - LOG_D(ENB_APP, "EVENT_TICK: Ignoring packet num %d SCTP CID %s\n", - g_scenario->next_packet->packet_number, - et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); - g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - g_scenario->next_packet = g_scenario->next_packet->next; - } - } - - fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name); - g_fsm_state = ET_FSM_STATE_NULL; - pthread_mutex_unlock(&g_fsm_lock); - - if (0 == g_scenario->timer_count) { - fprintf(stderr, "End of scenario: %s\n", g_scenario->name); - fflush(stderr); - fflush(stdout); - return 0; - //exit(0); - } - - fprintf(stderr, "Remaining timers running: %d\n", g_scenario->timer_count); - return g_fsm_state; - break; - - case ET_EVENT_RX_PACKET_TIME_OUT: - AssertFatal(0, "Event ET_EVENT_RX_PACKET_TIME_OUT not handled in FSM state ET_FSM_STATE_RUNNING"); - break; - - case ET_EVENT_TX_TIMED_PACKET: - AssertFatal(0, "Event ET_EVENT_TX_TIMED_PACKET not handled in FSM state ET_FSM_STATE_RUNNING"); - break; - - case ET_EVENT_RX_S1AP: - et_s1ap_process_rx_packet(&event.u.s1ap_data_ind); - break; - - default: - AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_RUNNING", event.code); - } - - pthread_mutex_unlock(&g_fsm_lock); - return 0; -} - -//------------------------------------------------------------------------------ -et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event) -{ - int rv = 0; - int original_frame_number = -1; - et_packet_t *packet = NULL; - - switch (event.code) { - case ET_EVENT_TICK: - fprintf(stdout, "EVENT_TICK: waiting for tx event\n"); - break; - - case ET_EVENT_RX_S1AP: - rv = et_s1ap_process_rx_packet(&event.u.s1ap_data_ind); - break; - - case ET_EVENT_TX_TIMED_PACKET: - // send immediately - packet = event.u.tx_timed_packet; - AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed"); - original_frame_number = packet->original_frame_number; - - do { - g_scenario->time_last_tx_packet.tv_sec = packet->timestamp_packet.tv_sec; - g_scenario->time_last_tx_packet.tv_usec = packet->timestamp_packet.tv_usec; - LOG_D(ENB_APP, "Sending packet num %d original frame number %u immediately\n",packet->packet_number, packet->original_frame_number); - et_s1ap_eNB_itti_send_sctp_data_req( - packet->enb_instance, - packet->sctp_hdr.u.data_hdr.assoc_id, - packet->sctp_hdr.u.data_hdr.payload.binary_stream, - packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size, - packet->sctp_hdr.u.data_hdr.stream); - packet->status = ET_PACKET_STATUS_SENT; - packet = packet->next; - g_scenario->next_packet = packet; - } while ( (NULL != packet) && (packet->original_frame_number == original_frame_number)); - - g_fsm_state = ET_FSM_STATE_RUNNING; - break; - - case ET_EVENT_RX_PACKET_TIME_OUT: - default: - AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING_TX", event.code); - } - - pthread_mutex_unlock(&g_fsm_lock); - return 0; -} - -//------------------------------------------------------------------------------ -et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event) -{ - int rv = 0; - - switch (event.code) { - case ET_EVENT_TICK: - fprintf(stdout, "EVENT_TICK: waiting for rx event\n"); - break; - - case ET_EVENT_RX_PACKET_TIME_OUT: - fprintf(stderr, "Error The following packet is not received:\n"); - //et_display_packet(event.u.rx_packet_time_out); - AssertFatal(0, "Waited packet not received"); - break; - - case ET_EVENT_RX_S1AP: - rv = et_s1ap_process_rx_packet(&event.u.s1ap_data_ind); - - // waited packet - if (rv == 0) { - g_fsm_state = ET_FSM_STATE_RUNNING; - } - - break; - - case ET_EVENT_TX_TIMED_PACKET: - default: - AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING_RX", event.code); - } - - pthread_mutex_unlock(&g_fsm_lock); - return 0; -} - -//------------------------------------------------------------------------------ -et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t event) -{ - switch (event.code) { - case ET_EVENT_TICK: - break; - - case ET_EVENT_S1C_CONNECTED: - // hack simulate we have been able to get the right timing values for STCP connect - AssertFatal(gettimeofday(&g_scenario->time_last_rx_packet, NULL) == 0, "gettimeofday failed"); - - while (NULL != g_scenario->next_packet) { - switch (g_scenario->next_packet->sctp_hdr.chunk_type) { - case SCTP_CID_DATA : - - // no init in this scenario, may be sub-scenario - if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { - et_scenario_schedule_tx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_fsm_lock); - et_event_t continue_event; - continue_event.code = ET_EVENT_TICK; - et_scenario_fsm_notify_event(continue_event); - return g_fsm_state; - } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { - g_scenario->last_rx_packet = g_scenario->next_packet; - g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet; - g_scenario->next_packet = g_scenario->next_packet->next; - } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { - et_scenario_wait_rx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_fsm_lock); - return g_fsm_state; - } else { - AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); - } - } else { - AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action); - } - - break; - - case SCTP_CID_INIT: - case SCTP_CID_INIT_ACK: - case SCTP_CID_HEARTBEAT: - case SCTP_CID_HEARTBEAT_ACK: - case SCTP_CID_COOKIE_ECHO: - case SCTP_CID_COOKIE_ACK: - case SCTP_CID_ECN_ECNE: - case SCTP_CID_ECN_CWR: - g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - g_scenario->next_packet = g_scenario->next_packet->next; - break; - - case SCTP_CID_ABORT: - case SCTP_CID_SHUTDOWN: - case SCTP_CID_SHUTDOWN_ACK: - case SCTP_CID_ERROR: - case SCTP_CID_SHUTDOWN_COMPLETE: - AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)", - et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); - break; - - default: - g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - g_scenario->next_packet = g_scenario->next_packet->next; - } - } - - fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name); - g_fsm_state = ET_FSM_STATE_NULL; - pthread_mutex_unlock(&g_fsm_lock); - - if (0 == g_scenario->timer_count) { - fprintf(stderr, "End of scenario: %s\n", g_scenario->name); - fflush(stderr); - fflush(stdout); - exit(0); - } - - fprintf(stderr, "Remaining timers running: %d\n", g_scenario->timer_count); - return g_fsm_state; - break; - - default: - AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_CONNECTING_S1C", event.code); - } - - pthread_mutex_unlock(&g_fsm_lock); - return 0; -} -//------------------------------------------------------------------------------ -et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event) -{ - switch (event.code) { - case ET_EVENT_TICK: - break; - - case ET_EVENT_INIT: - AssertFatal(NULL == g_scenario, "Current scenario not ended"); - g_scenario = event.u.init.scenario; - g_scenario->next_packet = g_scenario->list_packet; - g_scenario->last_rx_packet = NULL; - g_scenario->last_tx_packet = NULL; - - while (NULL != g_scenario->next_packet) { - switch (g_scenario->next_packet->sctp_hdr.chunk_type) { - case SCTP_CID_DATA : - - // no init in this scenario, may be sub-scenario, ... - if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) { - et_scenario_schedule_tx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_fsm_lock); - et_event_t continue_event; - continue_event.code = ET_EVENT_TICK; - et_scenario_fsm_notify_event(continue_event); - return g_fsm_state; - } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) { - g_scenario->last_rx_packet = g_scenario->next_packet; - g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet; - g_scenario->next_packet = g_scenario->next_packet->next; - } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) { - et_scenario_wait_rx_packet(g_scenario->next_packet); - pthread_mutex_unlock(&g_fsm_lock); - return g_fsm_state; - } else { - AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status); - } - } else { - AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action); - } - - break; - - case SCTP_CID_INIT: - case SCTP_CID_INIT_ACK: - g_scenario->enb_properties = (Enb_properties_array_t *)et_enb_config_get(); - g_scenario->hash_old_ue_mme_id2ue_mme_id = hashtable_create (256,NULL,NULL); - g_scenario->hash_mme2association_id = hashtable_create (256,NULL,NULL); - // Try to register each eNB - g_scenario->registered_enb = 0; - g_fsm_state = ET_FSM_STATE_CONNECTING_S1C; - AssertFatal(gettimeofday(&g_scenario->time_last_tx_packet, NULL) == 0, "gettimeofday failed"); - et_eNB_app_register (g_scenario->enb_properties); - pthread_mutex_unlock(&g_fsm_lock); - return g_fsm_state; - break; - - case SCTP_CID_HEARTBEAT: - case SCTP_CID_HEARTBEAT_ACK: - case SCTP_CID_COOKIE_ECHO: - case SCTP_CID_COOKIE_ACK: - case SCTP_CID_ECN_ECNE: - case SCTP_CID_ECN_CWR: - g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - g_scenario->next_packet = g_scenario->next_packet->next; - break; - - case SCTP_CID_ABORT: - case SCTP_CID_SHUTDOWN: - case SCTP_CID_SHUTDOWN_ACK: - case SCTP_CID_ERROR: - case SCTP_CID_SHUTDOWN_COMPLETE: - AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)", - et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type)); - break; - - default: - g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT; - g_scenario->next_packet = g_scenario->next_packet->next; - } - } - - fprintf(stderr, "No Useful packet found in this scenario: %s\n", g_scenario->name); - g_fsm_state = ET_FSM_STATE_NULL; - pthread_mutex_unlock(&g_fsm_lock); - return g_fsm_state; - break; - - default: - AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_NULL", event.code); - } - - return 0; -} - -//------------------------------------------------------------------------------ -et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event) -{ - AssertFatal((event.code >= ET_EVENT_START) && (event.code < ET_EVENT_END), "Unknown et_event_t.code %d", event.code); - pthread_mutex_lock(&g_fsm_lock); - - switch (g_fsm_state) { - case ET_FSM_STATE_NULL: return et_scenario_fsm_notify_event_state_null(event); break; - - case ET_FSM_STATE_CONNECTING_S1C: return et_scenario_fsm_notify_event_state_connecting_s1c(event); break; - - case ET_FSM_STATE_WAITING_TX_EVENT: return et_scenario_fsm_notify_event_state_waiting_tx(event); break; - - case ET_FSM_STATE_WAITING_RX_EVENT: return et_scenario_fsm_notify_event_state_waiting_rx(event); break; - - case ET_FSM_STATE_RUNNING: return et_scenario_fsm_notify_event_state_running(event); break; - - default: - AssertFatal(0, "Case fsm_state %d not handled", g_fsm_state); - } - - pthread_mutex_unlock(&g_fsm_lock); - return g_fsm_state; -} diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c deleted file mode 100644 index 607ec34dfc..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario_parse.c +++ /dev/null @@ -1,592 +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 - */ - -/* - play_scenario_parse.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "intertask_interface.h" -#include "platform_types.h" -#include "assertions.h" -#include "play_scenario.h" -//------------------------------------------------------------------------------ -#define ENB_CONFIG_MAX_XSLT_PARAMS 32 -//------------------------------------------------------------------------------ -extern Enb_properties_array_t g_enb_properties; -//------------------------------------------------------------------------------ -void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap) -{ - xmlNodePtr cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - unsigned int size = 0; - int rc = 0; - unsigned int go_deeper_in_tree = 1; - - if ((NULL != s1ap_node) && (NULL != s1ap)) { - // see http://www.xmlsoft.org/html/libxml-tree.html#xmlCopyNode - if (NULL == s1ap->doc) { - xmlUnlinkNode(s1ap_node); - //cur_node = xmlCopyNodeList(s1ap_node); - // arg2: if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) - //cur_node = xmlCopyNode(s1ap_node, 1); - //AssertFatal(NULL != cur_node, "xmlCopyNode Failed"); - s1ap->doc = xmlNewDoc(BAD_CAST "1.0"); - xmlDocSetRootElement(s1ap->doc, s1ap_node); - } - - for (cur_node = (xmlNode *)s1ap_node; cur_node; cur_node = cur_node->next) { - go_deeper_in_tree = 1; - if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) { - // do not get hidden fields - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) { - go_deeper_in_tree = 0; - } - xmlFree(xml_char); - } - if (0 < go_deeper_in_tree) { - // first get size - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); - if (NULL != xml_char) { - size = strtoul((const char *)xml_char, NULL, 0); - xmlFree(xml_char); - // second: try to get value (always hex) - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); - if (NULL != xml_char) { - xml_char2 = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); - fprintf(stdout, "s1ap %p field name %s size %u value %s\n",s1ap, xml_char2, size, xml_char); - xmlFree(xml_char2); - // if success to get value, do not parse children - //AssertFatal ((xmlStrlen(xml_char) == size), "ERROR %s() mismatch in size %d and strlen %d\n", __FUNCTION__, size, xmlStrlen(xml_char)); - //if (xmlStrlen(xml_char) == size) { - AssertFatal ((s1ap->binary_stream_pos+xmlStrlen(xml_char)/2) <= s1ap->binary_stream_allocated_size, - "ERROR in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", s1ap->binary_stream_pos, xmlStrlen(xml_char)/2); - rc = et_hex2data( &s1ap->binary_stream[s1ap->binary_stream_pos], xml_char, xmlStrlen(xml_char)); - s1ap->binary_stream_pos += xmlStrlen(xml_char)/2; - //et_display_node(cur_node, 0); - AssertFatal (rc >= 0, "ERROR in converting hex string %s len %d size %u rc %d\n", xml_char, xmlStrlen(xml_char), size, rc); - go_deeper_in_tree = 0; - //} - xmlFree(xml_char); - } - } - } - } - if (0 < go_deeper_in_tree) { - et_parse_s1ap(doc, cur_node->children, s1ap); - } - } - } -} - -//------------------------------------------------------------------------------ -void et_parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - - if ((NULL != sctp_node) && (NULL != sctp_hdr)) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_payload_proto_id"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->ppid = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_sid"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->stream = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_tsn"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->tsn = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_ssn"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->ssn = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } - xmlFree(xml_char); - } - for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { - et_parse_sctp_data_chunk(doc, cur_node, sctp_hdr); - } - } - -} -//------------------------------------------------------------------------------ -void et_parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - - if ((NULL != sctp_node) && (NULL != sctp_hdr)) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_out_streams"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_in_streams"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_credit"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initial_tsn"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initiate_tag"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } - xmlFree(xml_char); - } - for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { - et_parse_sctp_init_chunk(doc, cur_node, sctp_hdr); - } - } -} -//------------------------------------------------------------------------------ -void et_parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - - if ((NULL != sctp_node) && (NULL != sctp_hdr)) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_out_streams"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_in_streams"))) { - xml_char2 = xmlGetProp((xmlNode *)(xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_credit"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initial_tsn"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initiate_tag"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show"); - if (NULL != xml_char2) { - sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } - xmlFree(xml_char); - } - for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { - et_parse_sctp_init_ack_chunk(doc, cur_node, sctp_hdr); - } - } -} -//------------------------------------------------------------------------------ -void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t * const sctp_hdr) -{ - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - xmlChar *xml_char2 = NULL; - - if ((NULL != sctp_node) && (NULL != sctp_hdr)) { - if ((!xmlStrcmp(sctp_node->name, (const xmlChar *)"proto"))) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"s1ap"))) { - xmlFree(xml_char); - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"pos"); - if (NULL != xml_char) { - sctp_hdr->u.data_hdr.payload.xml_stream_pos_offset = strtoul((const char *)xml_char, NULL, 0); - xmlFree(xml_char); - - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"size"); - if (NULL != xml_char2) { - sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size = strtoul((const char *)xml_char2, NULL, 0); - sctp_hdr->u.data_hdr.payload.binary_stream = calloc(1, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size); - sctp_hdr->u.data_hdr.payload.binary_stream_pos = 0; - fprintf(stdout, "Allocating payload of sctp_hdr %p %u bytes\n", sctp_hdr, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size); - xmlFree(xml_char2); - } - et_parse_s1ap(doc, sctp_node, &sctp_hdr->u.data_hdr.payload); - et_decode_s1ap(&sctp_hdr->u.data_hdr.payload); - return; - } - } - xmlFree(xml_char); - } - } - //if ((cur_node->type == XML_ATTRIBUTE_NODE) || (cur_node->type == XML_ELEMENT_NODE)) { - xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.srcport"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->src_port = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.dstport"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->dst_port = strtoul((const char *)xml_char2, NULL, 16); - xmlFree(xml_char2); - } - } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.chunk_type"))) { - xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value"); - if (NULL != xml_char2) { - sctp_hdr->chunk_type = strtoul((const char *)xml_char2, NULL, 0); - xmlFree(xml_char2); - switch (sctp_hdr->chunk_type) { - case SCTP_CID_DATA: - et_parse_sctp_data_chunk(doc, sctp_node->parent, &sctp_hdr->u.data_hdr); - break; - case SCTP_CID_INIT: - et_parse_sctp_init_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_hdr); - break; - case SCTP_CID_INIT_ACK: - et_parse_sctp_init_ack_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_ack_hdr); - break; - default: - ; - } - } - } - } - for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) { - et_parse_sctp(doc, cur_node, sctp_hdr); - } - } -} -//------------------------------------------------------------------------------ -void et_packet_shift_timing(et_packet_t * const packet, const struct timeval * const shift) -{ - timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, shift); - AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0), - "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u", - packet->time_relative_to_first_packet.tv_sec, - packet->time_relative_to_first_packet.tv_usec, - packet->packet_number, - packet->original_frame_number); - - timeval_add(&packet->time_relative_to_last_received_packet, &packet->time_relative_to_last_received_packet, shift); - AssertFatal((packet->time_relative_to_last_received_packet.tv_sec >= 0) && (packet->time_relative_to_last_received_packet.tv_usec >= 0), - "Bad timing result time_relative_to_last_received_packet=%d.%d packet num %u, original frame number %u", - packet->time_relative_to_last_received_packet.tv_sec, - packet->time_relative_to_last_received_packet.tv_usec, - packet->packet_number, - packet->original_frame_number); - - timeval_add(&packet->time_relative_to_last_sent_packet, &packet->time_relative_to_last_sent_packet, shift); - AssertFatal((packet->time_relative_to_last_sent_packet.tv_sec >= 0) && (packet->time_relative_to_last_sent_packet.tv_usec >= 0), - "Bad timing result time_relative_to_last_sent_packet=%d.%d packet num %u, original frame number %u", - packet->time_relative_to_last_sent_packet.tv_sec, - packet->time_relative_to_last_sent_packet.tv_usec, - packet->packet_number, - packet->original_frame_number); -} - -//------------------------------------------------------------------------------ -et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node) -{ - - et_packet_t *packet = NULL; - xmlNode *cur_node = NULL; - xmlChar *xml_char = NULL; - float afloat = (float)0.0; - static struct timeval initial_time = { .tv_sec = 0, .tv_usec = 0 }; - static struct timeval relative_last_sent_packet = { .tv_sec = 0, .tv_usec = 0 }; - static struct timeval relative_last_received_packet = { .tv_sec = 0, .tv_usec = 0 }; - static char first_packet = 1; - static char first_sent_packet = 1; - static char first_received_packet = 1; - static unsigned int packet_number = 1; - - - if (NULL != node) { - packet = calloc(1, sizeof(*packet)); - - xml_char = xmlGetProp(node, (const xmlChar *)"action"); - packet->action = et_action_str2et_action_t(xml_char); - packet->status = ET_PACKET_STATUS_NONE; - xmlFree(xml_char); - packet->packet_number = packet_number++; - - for (cur_node = node->children; cur_node; cur_node = cur_node->next) { - //if (cur_node->type == XML_ELEMENT_NODE) { - if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.time_relative"))) { - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); - afloat = atof((const char*)xml_char); - xmlFree(xml_char); - fprintf(stdout, "Parsing packet frame.time_relative: %f\n", afloat); - packet->time_relative_to_first_packet.tv_sec = (int)afloat; - packet->time_relative_to_first_packet.tv_usec = (int)((afloat - packet->time_relative_to_first_packet.tv_sec)*1000000.0); - - if (first_packet > 0) { - initial_time = packet->time_relative_to_first_packet; - packet->time_relative_to_first_packet.tv_sec = 0; - packet->time_relative_to_first_packet.tv_usec = 0; - first_packet = 0; - } else { - timersub(&packet->time_relative_to_first_packet, &initial_time, - &packet->time_relative_to_first_packet); - } - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.number"))) { - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); - packet->original_frame_number = strtoul((const char *)xml_char, NULL, 0); - fprintf(stdout, "Parsing packet frame.number: %u\n", packet->original_frame_number); - xmlFree(xml_char); - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.src"))) { - xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); - et_ip_str2et_ip(xml_char, &packet->ip_hdr.src); - xmlFree(xml_char); - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.dst"))) { - xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); - et_ip_str2et_ip(xml_char, &packet->ip_hdr.dst); - xmlFree(xml_char); - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"proto"))) { - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp"))) { - et_parse_sctp(doc, cur_node, &packet->sctp_hdr); - } - xmlFree(xml_char); - } - } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"eNB.instance"))) { - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value"); - packet->enb_instance = strtoul((const char *)xml_char, NULL, 0); - xmlFree(xml_char); - } - //} - } - } - return packet; -} -//------------------------------------------------------------------------------ -et_scenario_t* et_generate_scenario( - const char * const tsml_out_scenario_filename) -{ - xmlDocPtr doc = NULL; - xmlNodePtr root = NULL; - xmlNodePtr node = NULL; - xmlChar *xml_char = NULL; - et_scenario_t *scenario = NULL; - et_packet_t *last_packet = NULL; - et_packet_t *packet = NULL; - et_packet_t **next_packet = NULL; - - doc = xmlParseFile(tsml_out_scenario_filename); - if (NULL == doc) { - AssertFatal (0, "Could not parse scenario xml file %s!\n", tsml_out_scenario_filename); - } else { - fprintf(stdout, "Test scenario file to play: %s\n", tsml_out_scenario_filename); - //xmlDebugDumpDocument(NULL, doc); - } - - // Get root - root = xmlDocGetRootElement(doc); - if (NULL != root) { - if ((!xmlStrcmp(root->name, (const xmlChar *)"scenario"))) { - xml_char = xmlGetProp(root, (const xmlChar *)"name"); - printf("scenario name: %s\n", xml_char); - scenario = calloc(1, sizeof(*scenario)); - scenario->name = xml_char; // nodup nofree - - next_packet = &scenario->list_packet; - for (node = root->children; node != NULL; node = node->next) { - if ((!xmlStrcmp(node->name, (const xmlChar *)"packet"))) { - packet = et_parse_xml_packet(doc, node); - if (NULL != packet) { - // special case: S1AP same frame for 2 packets - if (NULL != last_packet) { - if (last_packet->original_frame_number == packet->original_frame_number) { - // updating because these informations are not in 2nd sctp header (same IP packet) - packet->sctp_hdr.dst_port = last_packet->sctp_hdr.dst_port; - packet->sctp_hdr.src_port = last_packet->sctp_hdr.src_port; - } - } - *next_packet = packet; - next_packet = &packet->next; - } else { - fprintf(stdout, "WARNING omitted packet\n"); - } - } - last_packet = packet; - } - } - } else { - fprintf(stderr, "Empty xml document\n"); - } - xmlFreeDoc(doc); - xmlCleanupParser(); - return scenario; -} -//------------------------------------------------------------------------------ -int et_generate_xml_scenario( - const char const * xml_in_dir_name, - const char const * xml_in_scenario_filename, - const char const * enb_config_filename, - char const * tsml_out_scenario_filename) -//------------------------------------------------------------------------------ -{ - //int fd_pdml_in; - xsltStylesheetPtr cur = NULL; - xmlDocPtr doc, res; - FILE *play_scenario_file = NULL; - const char *params[2*ENB_CONFIG_MAX_XSLT_PARAMS]; - int nb_params = 0; - int i,j; - char astring[1024]; - struct in_addr addr; - int ret = 0; - - memset(astring, 0, sizeof(astring)); - if (getcwd(astring, sizeof(astring)) != NULL) { - fprintf(stdout, "working in %s directory\n", astring); - } else { - perror("getcwd() ERROR"); - exit(1); - } - - - xmlSubstituteEntitiesDefault(1); - xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile((const xmlChar *)"/usr/share/oai/xsl/play_scenario.xsl"); - if (NULL == cur) { - AssertFatal (0, "Could not parse stylesheet file /usr/share/oai/xsl/play_scenario.xsl!\n"); - } else { - fprintf(stdout, "XSLT style sheet: /usr/share/oai/xsl/play_scenario.xsl\n"); - } - - doc = xmlParseFile(xml_in_scenario_filename); - if (NULL == doc) { - AssertFatal (0, "Could not parse scenario xml file %s!\n", xml_in_scenario_filename); - } else { - fprintf(stdout, "Test scenario file: %s\n", xml_in_scenario_filename); - } - - for (i = 0; i < g_enb_properties.number; i++) { - // eNB S1-C IPv4 address - sprintf(astring, "enb%d_s1c", i); - params[nb_params++] = strdup(astring); - addr.s_addr = g_enb_properties.properties[i]->enb_ipv4_address_for_S1_MME; - sprintf(astring, "\"%s\"", inet_ntoa(addr)); - params[nb_params++] = strdup(astring); - - // MME S1-C IPv4 address - for (j = 0; j < g_enb_properties.properties[i]->nb_mme; j++) { - sprintf(astring, "mme%d_s1c_%d", i, j); - params[nb_params++] = strdup(astring); - AssertFatal (g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address, - "Only support MME IPv4 address\n"); - sprintf(astring, "\"%s\"", g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address); - params[nb_params++] = strdup(astring); - } - } - params[nb_params] = NULL; - res = xsltApplyStylesheet(cur, doc, params); - if (NULL != res) { - sprintf((char *)tsml_out_scenario_filename,"%s",xml_in_scenario_filename); - if (et_strip_extension((char *)tsml_out_scenario_filename) > 0) { - strcat((char *)tsml_out_scenario_filename, ".tsml"); - play_scenario_file = fopen( tsml_out_scenario_filename, "w+"); - if (NULL != play_scenario_file) { - xsltSaveResultToFile(play_scenario_file, res, cur); - fclose(play_scenario_file); - fprintf(stdout, "Wrote test scenario to %s\n", tsml_out_scenario_filename); - } else { - fprintf(stderr, "ERROR in fopen(%s)\n", tsml_out_scenario_filename); - ret = -1; - } - } else { - fprintf(stderr, "ERROR in strip_extension()\n"); - ret = -1; - } - } else { - fprintf(stderr, "ERROR in xsltApplyStylesheet()\n"); - ret = -1; - } - xsltFreeStylesheet(cur); - xmlFreeDoc(doc); - xmlFreeDoc(res); - - xsltCleanupGlobals(); - xmlCleanupParser(); - return ret; -} - diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c deleted file mode 100644 index fe132fd2f5..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c +++ /dev/null @@ -1,1168 +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 - */ - -/* - play_scenario_s1ap.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ -#include -#include -#include -#include -#include -#include -#include -#include "tree.h" -#include "queue.h" - - -#include "intertask_interface.h" -#include "platform_types.h" -#include "assertions.h" -#include "conversions.h" -#include "s1ap_common.h" -#include "play_scenario_s1ap_eNB_defs.h" -#include "play_scenario.h" -//------------------------------------------------------------------------------ -s1ap_eNB_internal_data_t s1ap_eNB_internal_data; -RB_GENERATE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, et_s1ap_eNB_compare_assoc_id); -//------------------------------------------------------------------------------ -extern et_scenario_t *g_scenario; -extern uint32_t g_constraints; -//------------------------------------------------------------------------------ -int et_s1ap_eNB_compare_assoc_id( - struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2) -{ - if (p1->assoc_id == -1) { - if (p1->cnx_id < p2->cnx_id) { - return -1; - } - if (p1->cnx_id > p2->cnx_id) { - return 1; - } - } else { - if (p1->assoc_id < p2->assoc_id) { - return -1; - } - if (p1->assoc_id > p2->assoc_id) { - return 1; - } - } - - /* Matching reference */ - return 0; -} -//------------------------------------------------------------------------------ -uint32_t et_s1ap_generate_eNB_id(void) -{ - char *out; - char hostname[50]; - int ret; - uint32_t eNB_id; - - /* Retrieve the host name */ - ret = gethostname(hostname, sizeof(hostname)); - DevAssert(ret == 0); - - out = crypt(hostname, "eurecom"); - DevAssert(out != NULL); - - eNB_id = ((out[0] << 24) | (out[1] << 16) | (out[2] << 8) | out[3]); - - return eNB_id; -} -//------------------------------------------------------------------------------ -uint16_t et_s1ap_eNB_fetch_add_global_cnx_id(void) -{ - return ++s1ap_eNB_internal_data.global_cnx_id; -} - -//------------------------------------------------------------------------------ -void et_s1ap_eNB_prepare_internal_data(void) -{ - memset(&s1ap_eNB_internal_data, 0, sizeof(s1ap_eNB_internal_data)); - STAILQ_INIT(&s1ap_eNB_internal_data.s1ap_eNB_instances_head); -} - -//------------------------------------------------------------------------------ -void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p) -{ - DevAssert(new_instance_p != NULL); - - STAILQ_INSERT_TAIL(&s1ap_eNB_internal_data.s1ap_eNB_instances_head, - new_instance_p, s1ap_eNB_entries); -} - -//------------------------------------------------------------------------------ -struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME( - s1ap_eNB_instance_t *instance_p, - int32_t assoc_id, uint16_t cnx_id) -{ - struct s1ap_eNB_mme_data_s temp; - struct s1ap_eNB_mme_data_s *found; - - memset(&temp, 0, sizeof(struct s1ap_eNB_mme_data_s)); - - temp.assoc_id = assoc_id; - temp.cnx_id = cnx_id; - - if (instance_p == NULL) { - STAILQ_FOREACH(instance_p, &s1ap_eNB_internal_data.s1ap_eNB_instances_head, - s1ap_eNB_entries) { - found = RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp); - - if (found != NULL) { - return found; - } - } - } else { - return RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp); - } - - return NULL; -} - -//------------------------------------------------------------------------------ -s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance) -{ - s1ap_eNB_instance_t *temp = NULL; - - STAILQ_FOREACH(temp, &s1ap_eNB_internal_data.s1ap_eNB_instances_head, - s1ap_eNB_entries) { - if (temp->instance == instance) { - /* Matching occurence */ - return temp; - } - } - - return NULL; -} -//------------------------------------------------------------------------------ -void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, - uint32_t buffer_length, uint16_t stream) -{ - MessageDef *message_p; - sctp_data_req_t *sctp_data_req; - - message_p = itti_alloc_new_message(TASK_S1AP, SCTP_DATA_REQ); - - sctp_data_req = &message_p->ittiMsg.sctp_data_req; - - sctp_data_req->assoc_id = assoc_id; - sctp_data_req->buffer = buffer; - sctp_data_req->buffer_length = buffer_length; - sctp_data_req->stream = stream; - - itti_send_msg_to_task(TASK_SCTP, instance, message_p); -} -//------------------------------------------------------------------------------ -int et_handle_s1ap_mismatch_mme_ue_s1ap_id(et_packet_t * const spacket, et_packet_t * const rx_packet) -{ - S1AP_MME_UE_S1AP_ID_t scenario_mme_ue_s1ap_id = 0; - S1AP_MME_UE_S1AP_ID_t rx_mme_ue_s1ap_id = 0; - S1AP_PDU_PR present; - - present = rx_packet->sctp_hdr.u.data_hdr.payload.pdu.present; - - switch (rx_packet->sctp_hdr.u.data_hdr.payload.message.procedureCode) { - case S1AP_ProcedureCode_id_HandoverPreparation: - if (present == S1AP_S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCommandIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCommandIEs.mme_ue_s1ap_id; - } - break; - - case S1AP_ProcedureCode_id_HandoverResourceAllocation: - if (present == S1AP_S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestIEs.mme_ue_s1ap_id; - } else if (present == S1AP_S1AP_PDU_PR_successfulOutcome) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestAcknowledgeIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestAcknowledgeIEs.mme_ue_s1ap_id; - } else if (present == S1AP_S1AP_PDU_PR_unsuccessfulOutcome) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverFailureIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverFailureIEs.mme_ue_s1ap_id; - } - break; - - case S1AP_ProcedureCode_id_HandoverNotification: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverNotifyIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverNotifyIEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_PathSwitchRequest: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_HandoverCancel: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCancelIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCancelIEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_E_RABSetup: - if (present == S1AP_S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupRequestIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupResponseIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_E_RABModify: - if (present == S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyRequestIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyResponseIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_E_RABRelease: - if (present == S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseCommandIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseCommandIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseResponseIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_E_RABReleaseIndication: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseIndicationIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_InitialContextSetup: - if (present == S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupRequestIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupResponseIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_Paging: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_downlinkNASTransport: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_initialUEMessage: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_uplinkNASTransport: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_Reset: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_ErrorIndication: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ErrorIndicationIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ErrorIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_NASNonDeliveryIndication: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_NASNonDeliveryIndication_IEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_NASNonDeliveryIndication_IEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_S1Setup: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1ap_ProcedureCode_id_UEContextReleaseRequest: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseRequestIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_UEContextModification: - if (present == S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationRequestIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationResponseIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationFailureIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationFailureIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_UECapabilityInfoIndication: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UECapabilityInfoIndicationIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UECapabilityInfoIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_UEContextRelease: - if (present == S1AP_PDU_PR_initiatingMessage) { - switch (rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.present) { - case S1ap_UE_S1AP_IDs_PR_uE_S1AP_ID_pair: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID; - break; - case S1ap_UE_S1AP_IDs_PR_mME_UE_S1AP_ID: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.mME_UE_S1AP_ID; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.mME_UE_S1AP_ID; - break; - } - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id; - } - break; - - case S1ap_ProcedureCode_id_eNBStatusTransfer: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBStatusTransferIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBStatusTransferIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_MMEStatusTransfer: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEStatusTransferIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEStatusTransferIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_DeactivateTrace: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DeactivateTraceIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DeactivateTraceIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_TraceStart: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceStartIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceStartIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_TraceFailureIndication: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceFailureIndicationIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceFailureIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_ENBConfigurationUpdate: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1ap_ProcedureCode_id_MMEConfigurationUpdate: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id; - } else if (present == S1AP_PDU_PR_successfulOutcome) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1ap_ProcedureCode_id_LocationReportingControl: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingControlIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingControlIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_LocationReportingFailureIndication: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingFailureIndicationIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingFailureIndicationIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_LocationReport: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_OverloadStart: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_OverloadStop: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id; - break; - - case S1ap_ProcedureCode_id_WriteReplaceWarning: - /*if (present == S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1AP_ProcedureCode_id_eNBDirectInformationTransfer: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_MMEDirectInformationTransfer: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_PrivateMessage: - case S1AP_ProcedureCode_id_eNBConfigurationTransfer: - case S1AP_ProcedureCode_id_MMEConfigurationTransfer: - AssertFatal(0, "TODO"); - break; - - case S1AP_ProcedureCode_id_CellTrafficTrace: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_CellTrafficTraceIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_CellTrafficTraceIEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_Kill: - /*if (present == S1AP_S1AP_PDU_PR_initiatingMessage) { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id; - } else { - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id; - }*/ - break; - - case S1AP_ProcedureCode_id_downlinkUEAssociatedLPPaTransport: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_uplinkUEAssociatedLPPaTransport: - rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - break; - - case S1AP_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport: - //rx_mme_ue_s1ap_id = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id; - break; - - default: - AssertFatal(0, "Unknown procedure code %ld", rx_packet->sctp_hdr.u.data_hdr.payload.message.procedureCode); - } - - if (scenario_mme_ue_s1ap_id != rx_mme_ue_s1ap_id) { - S1AP_DEBUG("%s() Updating mme_ue_s1ap_id %u -> %u \n", __FUNCTION__, scenario_mme_ue_s1ap_id, rx_mme_ue_s1ap_id); - et_packet_t *p = spacket; - - while (p) { - et_s1ap_update_mme_ue_s1ap_id(p, scenario_mme_ue_s1ap_id, rx_mme_ue_s1ap_id); - p = p->next; - } - return 0; - } - return 1; -} -//------------------------------------------------------------------------------ -asn_comp_rval_t * et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints) -{ - asn_comp_rval_t *rv = NULL; - if (s1ap1->pdu.present != s1ap2->pdu.present) {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PRESENT; return rv;} - switch (s1ap1->pdu.present) { - case S1AP_PDU_PR_NOTHING: - break; - case S1AP_PDU_PR_initiatingMessage: - if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode) - {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;} - if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality) - {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;} - break; - case S1AP_PDU_PR_successfulOutcome: - if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode) - {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;} - if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality) - {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;} - break; - case S1AP_PDU_PR_unsuccessfulOutcome: - if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode) - {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;} - if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality) - {rv = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;} - break; - default: - AssertFatal(0, "Unknown pdu.present %d", s1ap1->pdu.present); - } - - if (s1ap1->binary_stream_allocated_size == s1ap2->binary_stream_allocated_size) { - if (memcmp((void*)s1ap1->binary_stream, (void*)s1ap2->binary_stream, s1ap1->binary_stream_allocated_size) == 0) return NULL; - } - // if no matching, may be the scenario need minor corrections (same enb_ue_s1ap_id but need to update mme_ue_s1ap_id) - return et_s1ap_ies_is_matching(s1ap1->pdu.present, &s1ap1->message, &s1ap2->message, constraints); -} - -//------------------------------------------------------------------------------ -et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind) -{ - et_packet_t * packet = NULL; - AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n"); - packet = calloc(1, sizeof(*packet)); - packet->action = ET_PACKET_ACTION_S1C_NULL; - //packet->time_relative_to_first_packet.tv_sec = 0; - //packet->time_relative_to_first_packet.tv_usec = 0; - //packet->time_relative_to_last_sent_packet.tv_sec = 0; - //packet->time_relative_to_last_sent_packet.tv_usec = 0; - //packet->time_relative_to_last_received_packet.tv_sec = 0; - //packet->time_relative_to_last_received_packet.tv_usec = 0; - //packet->original_frame_number = 0; - //packet->packet_number = 0; - packet->enb_instance = 0; //TODO - //packet->ip_hdr; - // keep in mind: allocated buffer: sctp_datahdr.payload.binary_stream - packet->sctp_hdr.chunk_type = SCTP_CID_DATA; - memcpy((void*)&packet->sctp_hdr.u.data_hdr, (void*)&s1ap_data_ind->sctp_datahdr, sizeof(packet->sctp_hdr)); - //packet->next = NULL; - packet->status = ET_PACKET_STATUS_RECEIVED; - //packet->timer_id = 0; - AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed"); - return packet; -} - - -//------------------------------------------------------------------------------ -// return 0 if packet was waited -int et_scenario_set_packet_received(et_packet_t * const packet) -{ - et_packet_t * p = NULL; - int rc = 0; - - packet->status = ET_PACKET_STATUS_RECEIVED; - S1AP_DEBUG("Packet received: num %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); - S1AP_DEBUG("Last Packet received: num %u | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number); - - p = g_scenario->last_rx_packet; - while (NULL != p) { - if (ET_PACKET_ACTION_S1C_RECEIVE == p->action) { - if ((ET_PACKET_STATUS_RECEIVED == p->status) || (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT == p->status)) { - g_scenario->last_rx_packet = p; - g_scenario->time_last_rx_packet.tv_sec = p->timestamp_packet.tv_sec; - g_scenario->time_last_rx_packet.tv_usec = p->timestamp_packet.tv_usec; - S1AP_DEBUG("Set Last Packet received: num %u | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number); - S1AP_DEBUG("Set time_last_rx_packet %ld.%06d\n", g_scenario->time_last_rx_packet.tv_sec, g_scenario->time_last_rx_packet.tv_usec); - } else { - break; - } - } - p = p->next; - } - - if (0 != packet->timer_id) { - rc = timer_remove(packet->timer_id); - AssertFatal(rc == 0, "TODO: Debug Timer on Rx packet num %u unknown", packet->packet_number); - g_scenario->timer_count--; - return rc; - } - return 1; -} - -//------------------------------------------------------------------------------ -int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind) -{ - et_packet_t *packet = NULL; - et_packet_t *rx_packet = NULL; - unsigned long int not_found = 1; - asn_comp_rval_t *comp_results = NULL; - asn_comp_rval_t *comp_results2 = NULL; - unsigned char error_code = 0; - - AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n"); - rx_packet = et_build_packet_from_s1ap_data_ind(s1ap_data_ind); - - if (NULL == g_scenario->last_rx_packet) { - packet = g_scenario->list_packet; - while (NULL != packet) { - if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - if ((ET_PACKET_STATUS_RECEIVED == packet->status) || (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT == packet->status)) { - g_scenario->last_rx_packet = packet; - if (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT != packet->status) { - g_scenario->time_last_rx_packet.tv_sec = packet->timestamp_packet.tv_sec; - g_scenario->time_last_rx_packet.tv_usec = packet->timestamp_packet.tv_usec; - } - S1AP_DEBUG("Set Last Packet received: num %u | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number); - S1AP_DEBUG("Set time_last_rx_packet %ld.%06d\n", g_scenario->time_last_rx_packet.tv_sec, g_scenario->time_last_rx_packet.tv_usec); - } else { - break; - } - } - packet = packet->next; - } - packet = g_scenario->list_packet; - } else { - packet = g_scenario->last_rx_packet->next; - } - // not_found threshold may sure depend on number of mme, may be not sure on number of UE - while ((NULL != packet) && (not_found < 9)) { - S1AP_DEBUG("%s() Considering packet num %d original frame number %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number); - if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - comp_results = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints); - if (NULL == comp_results) { - S1AP_DEBUG("Compare RX packet with packet: num %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); - packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; - packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; - return et_scenario_set_packet_received(packet); - } else { - S1AP_DEBUG("Compare RX packet with packet: num %u | original frame number %u failed\n", - packet->packet_number, packet->original_frame_number); - while (comp_results) { - S1AP_DEBUG("Result err code %s(%u) ASN1 struct name %s\n", - et_error_match2str(comp_results->err_code), comp_results->err_code, comp_results->name); - - // (each asn1 rc <= 166 (enum e_S1AP_ProtocolIE_ID, in generated file S1AP_ProtocolIE_ID.h)) - if (comp_results->err_code == COMPARE_ERR_CODE_NO_MATCH) { - //TODO MME_UE_S1AP_ID, etc. - // get latest error code - if (strcmp(comp_results->name, "S1ap-MME-UE-S1AP-ID") == 0) { - if (0 == et_handle_s1ap_mismatch_mme_ue_s1ap_id((et_packet_t *const)packet, (et_packet_t *const)rx_packet)) { - packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; - packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; - return et_scenario_set_packet_received(packet); - } - } else if (strcmp(comp_results->name, "S1ap-TransportLayerAddress") == 0) { - S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add sgw conf file in the process, anyway continuing...\n",comp_results->name); - packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec; - packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec; - return et_scenario_set_packet_received(packet); - } else { - S1AP_WARN("\n\nRX PACKET:\n"); - et_display_packet_sctp(&rx_packet->sctp_hdr); - S1AP_WARN("\n\nWAITED PACKET:\n"); - et_display_packet_sctp(&packet->sctp_hdr); - AssertFatal(0,"Some work needed there"); - } - } - comp_results2 = comp_results; - comp_results = comp_results2->next; - et_free_pointer(comp_results2); - } - } - } - not_found += 1; - packet = packet->next; - } - et_display_packet_sctp(&rx_packet->sctp_hdr); - AssertFatal(0, "Rx packet not found in scenario (see dump above)"); - return -1; -} - -//------------------------------------------------------------------------------ -void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind) -{ - int result = 0; - et_event_t event; - - DevAssert(sctp_data_ind != NULL); - - memset((void*)&event, 0, sizeof(event)); - - event.code = ET_EVENT_RX_S1AP; - event.u.s1ap_data_ind.sctp_datahdr.tsn = 0; - event.u.s1ap_data_ind.sctp_datahdr.stream = sctp_data_ind->stream; - event.u.s1ap_data_ind.sctp_datahdr.ssn = 0; - event.u.s1ap_data_ind.sctp_datahdr.ppid = S1AP_SCTP_PPID; - event.u.s1ap_data_ind.sctp_datahdr.assoc_id = sctp_data_ind->assoc_id; - - event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_pos = 0; - event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_allocated_size = sctp_data_ind->buffer_length; - event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream = NULL; - if ((sctp_data_ind->buffer_length > 0) && (NULL != sctp_data_ind->buffer)) { - event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream = calloc(1, sctp_data_ind->buffer_length); - memcpy(event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream, - sctp_data_ind->buffer, - sctp_data_ind->buffer_length); - - if (et_s1ap_decode_pdu( - &event.u.s1ap_data_ind.sctp_datahdr.payload.pdu, - &event.u.s1ap_data_ind.sctp_datahdr.payload.message, - event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream, - event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_allocated_size) < 0) { - AssertFatal (0, "ERROR Cannot decode RX S1AP message!\n"); - } - - } - - result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - - et_scenario_fsm_notify_event(event); - - memset((void*)&event, 0, sizeof(event)); - event.code = ET_EVENT_TICK; - et_scenario_fsm_notify_event(event); - -} -//------------------------------------------------------------------------------ -void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, - net_ip_address_t *mme_ip_address, - net_ip_address_t *local_ip_addr, - uint16_t in_streams, - uint16_t out_streams) -{ - MessageDef *message_p = NULL; - sctp_new_association_req_t *sctp_new_association_req_p = NULL; - s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL; - - DevAssert(instance_p != NULL); - DevAssert(mme_ip_address != NULL); - - message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ); - - sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req; - - sctp_new_association_req_p->port = S1AP_PORT_NUMBER; - sctp_new_association_req_p->ppid = S1AP_SCTP_PPID; - - sctp_new_association_req_p->in_streams = in_streams; - sctp_new_association_req_p->out_streams = out_streams; - - memcpy(&sctp_new_association_req_p->remote_address, - mme_ip_address, - sizeof(*mme_ip_address)); - - memcpy(&sctp_new_association_req_p->local_address, - local_ip_addr, - sizeof(*local_ip_addr)); - - /* Create new MME descriptor */ - s1ap_mme_data_p = calloc(1, sizeof(*s1ap_mme_data_p)); - DevAssert(s1ap_mme_data_p != NULL); - - s1ap_mme_data_p->cnx_id = et_s1ap_eNB_fetch_add_global_cnx_id(); - sctp_new_association_req_p->ulp_cnx_id = s1ap_mme_data_p->cnx_id; - - s1ap_mme_data_p->assoc_id = -1; - s1ap_mme_data_p->s1ap_eNB_instance = instance_p; - - memcpy((void*)&s1ap_mme_data_p->mme_net_ip_address, mme_ip_address, sizeof(*mme_ip_address)); - - - STAILQ_INIT(&s1ap_mme_data_p->served_gummei); - - /* Insert the new descriptor in list of known MME - * but not yet associated. - */ - RB_INSERT(s1ap_mme_map, &instance_p->s1ap_mme_head, s1ap_mme_data_p); - s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING; - instance_p->s1ap_mme_nb ++; - instance_p->s1ap_mme_pending_nb ++; - - itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p); -} -//------------------------------------------------------------------------------ -void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id, - struct s1ap_eNB_instance_s * const s1ap_eNB_instance, - s1ap_eNB_mme_data_t * const mme_desc_p) -{ - et_packet_t *packet = NULL; - int ret; - unsigned int old_enb_port = 0; - unsigned int old_mme_port = 0; - - S1AP_DEBUG("%s for SCTP association (%u)\n",__FUNCTION__,assoc_id); - - packet = g_scenario->list_packet; - while (NULL != packet) { - switch (packet->sctp_hdr.chunk_type) { - - case SCTP_CID_DATA : - S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_DATA\n",__FUNCTION__,assoc_id); - if ((ET_PACKET_STATUS_NONE == packet->status) || (ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING == packet->status)) { - if (0 < old_mme_port) { - if (packet->action == ET_PACKET_ACTION_S1C_SEND) { - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); - if (0 == ret) { - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); - if (0 == ret) { - // same IP src, same IP dst - if ((packet->sctp_hdr.dst_port == old_mme_port) && (packet->sctp_hdr.src_port == old_enb_port)) { - packet->sctp_hdr.u.data_hdr.assoc_id = assoc_id; - S1AP_DEBUG("tPacket:\tnum %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); - S1AP_DEBUG("\tUpdated assoc id: %u\n", assoc_id); - } - } - } - } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) { - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address); - if (0 == ret) { - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address); - if (0 == ret) { - // same IP src, same IP dst - if ((packet->sctp_hdr.src_port == old_mme_port) && (packet->sctp_hdr.dst_port == old_enb_port)) { - packet->sctp_hdr.u.data_hdr.assoc_id = assoc_id; - S1AP_DEBUG("tPacket:\tnum %u | original frame number %u \n", packet->packet_number, packet->original_frame_number); - S1AP_DEBUG("\tUpdated assoc id: %u\n", assoc_id); - } - } - } - } - } - } - break; - - // Strong assumption - // in replayed scenario, the order of SCTP INIT packets is supposed to be the same as in the catched scenario - case SCTP_CID_INIT: - S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT\n",__FUNCTION__,assoc_id); - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address); - if (0 == ret) { - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address); - if (0 == ret) { - if (0 == old_enb_port) { - if (ET_PACKET_STATUS_NONE == packet->status) { - packet->status = ET_PACKET_STATUS_SENT; - old_enb_port = packet->sctp_hdr.src_port; - S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT SUCCESS\n",__FUNCTION__,assoc_id); - } - } - } - } - break; - - case SCTP_CID_INIT_ACK: - S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT_ACK\n",__FUNCTION__,assoc_id); - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address); - if (0 == ret) { - ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address); - if (0 == ret) { - if (old_enb_port == packet->sctp_hdr.dst_port) { - if (ET_PACKET_STATUS_NONE == packet->status) { - packet->status = ET_PACKET_STATUS_RECEIVED; - old_mme_port = packet->sctp_hdr.dst_port; - S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT_ACK SUCCESS\n",__FUNCTION__,assoc_id); - } - } - } - } - break; - - case SCTP_CID_HEARTBEAT: - case SCTP_CID_HEARTBEAT_ACK: - case SCTP_CID_COOKIE_ECHO: - case SCTP_CID_COOKIE_ACK: - case SCTP_CID_ECN_ECNE: - case SCTP_CID_ECN_CWR: - break; - - case SCTP_CID_ABORT: - case SCTP_CID_SHUTDOWN: - case SCTP_CID_SHUTDOWN_ACK: - case SCTP_CID_ERROR: - case SCTP_CID_SHUTDOWN_COMPLETE: - //TODO - break; - - default: - AssertFatal(0, "Unknown chunk_type %d packet num %u", packet->sctp_hdr.chunk_type, packet->packet_number); - ; - } - packet = packet->next; - } -} -//------------------------------------------------------------------------------ -void et_s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown) -{ - if (sctp_shutdown) { - /* A previously connected MME has been shutdown */ - - /* TODO check if it was used by some eNB and send a message to inform these eNB if there is no more associated MME */ - if (mme_desc_p->state == S1AP_ENB_STATE_CONNECTED) { - mme_desc_p->state = S1AP_ENB_STATE_DISCONNECTED; - - if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb > 0) { - /* Decrease associated MME number */ - mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb --; - } - - /* If there are no more associated MME, inform eNB app */ - if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb == 0) { - MessageDef *message_p; - - message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DEREGISTERED_ENB_IND); - S1AP_DEREGISTERED_ENB_IND(message_p).nb_mme = 0; - itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p); - } - } - } else { - /* Check that at least one setup message is pending */ - DevCheck(mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0, mme_desc_p->s1ap_eNB_instance->instance, - mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb, 0); - - if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0) { - /* Decrease pending messages number */ - mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb --; - mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb++; - } - - et_s1ap_update_assoc_id_of_packets(mme_desc_p->assoc_id, - mme_desc_p->s1ap_eNB_instance, - mme_desc_p); - - - /* If there are no more pending messages, inform eNB app */ - if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb == 0) { - MessageDef *message_p; - - message_p = itti_alloc_new_message(TASK_S1AP, S1AP_REGISTER_ENB_CNF); - S1AP_REGISTER_ENB_CNF(message_p).nb_mme = mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb; - itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p); - } - } -} -//------------------------------------------------------------------------------ -void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB) -{ - s1ap_eNB_instance_t *new_instance; - uint8_t index; - - DevAssert(s1ap_register_eNB != NULL); - - /* Look if the provided instance already exists */ - new_instance = et_s1ap_eNB_get_instance(instance); - - if (new_instance != NULL) { - /* Checks if it is a retry on the same eNB */ - DevCheck(new_instance->eNB_id == s1ap_register_eNB->eNB_id, new_instance->eNB_id, s1ap_register_eNB->eNB_id, 0); - DevCheck(new_instance->cell_type == s1ap_register_eNB->cell_type, new_instance->cell_type, s1ap_register_eNB->cell_type, 0); - DevCheck(new_instance->tac == s1ap_register_eNB->tac, new_instance->tac, s1ap_register_eNB->tac, 0); - DevCheck(new_instance->mcc == s1ap_register_eNB->mcc, new_instance->mcc, s1ap_register_eNB->mcc, 0); - DevCheck(new_instance->mnc == s1ap_register_eNB->mnc, new_instance->mnc, s1ap_register_eNB->mnc, 0); - DevCheck(new_instance->mnc_digit_length == s1ap_register_eNB->mnc_digit_length, new_instance->mnc_digit_length, s1ap_register_eNB->mnc_digit_length, 0); - DevCheck(memcmp((void*)&new_instance->s1c_net_ip_address, (void*)&s1ap_register_eNB->enb_ip_address, sizeof(new_instance->s1c_net_ip_address)) == 0, 0,0,0); - } else { - new_instance = calloc(1, sizeof(s1ap_eNB_instance_t)); - DevAssert(new_instance != NULL); - - RB_INIT(&new_instance->s1ap_ue_head); - RB_INIT(&new_instance->s1ap_mme_head); - - /* Copy usefull parameters */ - new_instance->instance = instance; - new_instance->eNB_name = s1ap_register_eNB->eNB_name; - new_instance->eNB_id = s1ap_register_eNB->eNB_id; - new_instance->cell_type = s1ap_register_eNB->cell_type; - new_instance->tac = s1ap_register_eNB->tac; - new_instance->mcc = s1ap_register_eNB->mcc; - new_instance->mnc = s1ap_register_eNB->mnc; - new_instance->mnc_digit_length = s1ap_register_eNB->mnc_digit_length; - memcpy((void*)&new_instance->s1c_net_ip_address, (void*)&s1ap_register_eNB->enb_ip_address, sizeof(new_instance->s1c_net_ip_address)); - - /* Add the new instance to the list of eNB (meaningfull in virtual mode) */ - et_s1ap_eNB_insert_new_instance(new_instance); - - S1AP_DEBUG("Registered new eNB[%d] and %s eNB id %u\n", - instance, - s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home", - s1ap_register_eNB->eNB_id); - } - - DevCheck(s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, - S1AP_MAX_NB_MME_IP_ADDRESS, s1ap_register_eNB->nb_mme, 0); - - /* Trying to connect to provided list of MME ip address */ - for (index = 0; index < s1ap_register_eNB->nb_mme; index++) { - et_s1ap_eNB_register_mme(new_instance, - &s1ap_register_eNB->mme_ip_address[index], - &s1ap_register_eNB->enb_ip_address, - s1ap_register_eNB->sctp_in_streams, - s1ap_register_eNB->sctp_out_streams); - } -} - -//------------------------------------------------------------------------------ -void et_s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) -{ - s1ap_eNB_instance_t *instance_p = NULL; - s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL; - - DevAssert(sctp_new_association_resp != NULL); - - instance_p = et_s1ap_eNB_get_instance(instance); - DevAssert(instance_p != NULL); - - s1ap_mme_data_p = et_s1ap_eNB_get_MME(instance_p, -1, - sctp_new_association_resp->ulp_cnx_id); - DevAssert(s1ap_mme_data_p != NULL); - - if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) { - S1AP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n", - sctp_new_association_resp->sctp_state, - instance, - sctp_new_association_resp->ulp_cnx_id); - - et_s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN); - - return; - } - - S1AP_DEBUG("Received successful result for SCTP association (%u), instance %d, cnx_id %u\n", - sctp_new_association_resp->sctp_state, - instance, - sctp_new_association_resp->ulp_cnx_id); - /* Update parameters */ - s1ap_mme_data_p->assoc_id = sctp_new_association_resp->assoc_id; - s1ap_mme_data_p->in_streams = sctp_new_association_resp->in_streams; - s1ap_mme_data_p->out_streams = sctp_new_association_resp->out_streams; - - et_s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN); -} - -//------------------------------------------------------------------------------ -void *et_s1ap_eNB_task(void *arg) -{ - MessageDef *received_msg = NULL; - int result; - - S1AP_DEBUG("Starting S1AP layer\n"); - - et_s1ap_eNB_prepare_internal_data(); - - itti_mark_task_ready(TASK_S1AP); - - while (1) { - itti_receive_msg(TASK_S1AP, &received_msg); - - switch (ITTI_MSG_ID(received_msg)) { - case TERMINATE_MESSAGE: - S1AP_WARN("*** Exiting S1AP thread\n"); - itti_exit_task(); - break; - - case S1AP_REGISTER_ENB_REQ: { - /* Register a new eNB. - * in Virtual mode eNBs will be distinguished using the mod_id/ - * Each eNB has to send an S1AP_REGISTER_ENB message with its - * own parameters. - */ - et_s1ap_eNB_handle_register_eNB(ITTI_MSG_DESTINATION_INSTANCE(received_msg), - &S1AP_REGISTER_ENB_REQ(received_msg)); - } - break; - - case SCTP_NEW_ASSOCIATION_RESP: { - et_s1ap_eNB_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg), - &received_msg->ittiMsg.sctp_new_association_resp); - } - break; - - case SCTP_DATA_IND: { - et_s1ap_eNB_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind); - } - break; - - case TIMER_HAS_EXPIRED: - LOG_I(S1AP, " Received TIMER_HAS_EXPIRED: timer_id %d\n", TIMER_HAS_EXPIRED(received_msg).timer_id); - { - et_packet_t * packet = (et_packet_t*)TIMER_HAS_EXPIRED (received_msg).arg; - et_event_t event; - g_scenario->timer_count--; - if (NULL != packet) { - if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING) { - memset((void*)&event, 0, sizeof(event)); - event.code = ET_EVENT_RX_PACKET_TIME_OUT; - event.u.rx_packet_time_out = packet; - et_scenario_fsm_notify_event(event); - } else if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_SENDING) { - memset((void*)&event, 0, sizeof(event)); - event.code = ET_EVENT_TX_TIMED_PACKET; - event.u.tx_timed_packet = packet; - et_scenario_fsm_notify_event(event); - - et_event_t continue_event; - continue_event.code = ET_EVENT_TICK; - et_scenario_fsm_notify_event(continue_event); - } else if ((packet->status != ET_PACKET_STATUS_SENT) && ((packet->status != ET_PACKET_STATUS_RECEIVED))) { - AssertFatal (0, "Bad status %d of packet timed out!\n", packet->status); - } - } else { - LOG_W(S1AP, " Received TIMER_HAS_EXPIRED: timer_id %d, no packet attached to timer\n", TIMER_HAS_EXPIRED(received_msg).timer_id); - } - } - if (TIMER_HAS_EXPIRED (received_msg).timer_id == g_scenario->enb_register_retry_timer_id) { - /* Restart the registration process */ - g_scenario->registered_enb = 0; - et_eNB_app_register (g_scenario->enb_properties); - } - break; - - default: - S1AP_ERROR("Received unhandled message: %d:%s\n", - ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); - break; - } - - result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - - received_msg = NULL; - } - - return NULL; -} - - diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c deleted file mode 100644 index 40654fc771..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c +++ /dev/null @@ -1,231 +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 - */ - -/* - play_scenario_s1ap_compare_ie.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "tree.h" -#include "queue.h" - - -#include "intertask_interface.h" -#include "platform_types.h" -#include "assertions.h" -#include "conversions.h" -#include "s1ap_common.h" -#include "play_scenario_s1ap_eNB_defs.h" -#include "play_scenario.h" -//------------------------------------------------------------------------------ -extern et_scenario_t *g_scenario; -extern uint32_t g_constraints; -//------------------------------------------------------------------------------ - -//asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints) -//{ -//} - -void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, const S1ap_MME_UE_S1AP_ID_t new_id) -{ - xmlNode *cur_node = NULL; - xmlAttrPtr attr = NULL; - xmlChar *xml_char = NULL; - int size = 0; - int pos = 0; - int go_deeper_in_tree = 1; - //S1AP_INFO("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id); - - // modify - for (cur_node = (xmlNode *)node; cur_node; cur_node = cur_node->next) { - go_deeper_in_tree = 1; - if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) { - // do not get hidden fields - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide"); - if (NULL != xml_char) { - if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) { - go_deeper_in_tree = 0; - } - xmlFree(xml_char); - } - if (0 < go_deeper_in_tree) { - // first get size - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"pos"); - if (NULL != xml_char) { - pos = strtoul((const char *)xml_char, NULL, 0); - pos -= s1ap->xml_stream_pos_offset; - AssertFatal(pos >= 0, "Bad pos %d xml_stream_pos_offset %d", pos, s1ap->xml_stream_pos_offset); - xmlFree(xml_char); - xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size"); - if (NULL != xml_char) { - const xmlChar value_d[32]; - const xmlChar value_h[20]; - const xmlChar showname[64]; - int ret = 0; - int pos2 = 0; - unsigned long int uli = 0; - char hex[3] = {0,0,0}; - char *end_ptr = NULL; - - size = strtoul((const char *)xml_char, NULL, 0); - xmlFree(xml_char); - // second: try to set value (always hex) - ret = snprintf((char *)value_d, 32, "%ld", new_id); - AssertFatal((ret > 0) && (ret < 32), "Could not convert int to dec str"); - ret = snprintf((char *)value_h, 20, "C0%08X", new_id); - AssertFatal((ret > 0) && (ret < 20), "Could not convert int to hex str"); - ret = snprintf((char *)showname, 64, "MME-UE-S1AP-ID: %d", new_id); - AssertFatal((ret > 0) && (ret < 64), "Could not convert int to dec str"); - - attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"value", value_h); - attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"show", value_d); - attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"showname", showname); - //TODO update s1ap->binary_stream @pos with new_id_hex, size - AssertFatal((pos+size) < s1ap->binary_stream_allocated_size, "Rewrite of mme_ue_s1ap_id out of bounds of binary_stream"); - //avoid endianess issues - do { - hex[0] = value_h[pos2++]; - hex[1] = value_h[pos2++]; - hex[2] = '\0'; - end_ptr = hex; - uli = strtoul(hex, &end_ptr, 16); - AssertFatal((uli != ULONG_MAX) && (end_ptr != NULL) && (*end_ptr == '\0'), "Conversion of hexstring %s failed returned %lu errno %d", hex, uli, errno); - s1ap->binary_stream[pos++] = (unsigned char)uli; - } while (pos2 < (2*5)); - // update ASN1 - et_decode_s1ap(s1ap); - //S1AP_INFO("Updated ASN1 for %s\n", showname); - } - } - } - } - if (0 < go_deeper_in_tree) { - update_xpath_node_mme_ue_s1ap_id(s1ap, cur_node->children, new_id); - } - } -} - -/** - * update_xpath_nodes: - * @nodes: the nodes set. - * @value: the new value for the node(s) - * - * Prints the @nodes content to @output. - * From http://www.xmlsoft.org/examples/#xpath2.c - */ -void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSetPtr nodes, const S1ap_MME_UE_S1AP_ID_t new_id) -{ - int size = 0; - int i = 0; - xmlNode *s1ap_node = NULL; - - size = (nodes) ? nodes->nodeNr : 0; - //S1AP_DEBUG("%s() num nodes %u\n", __FUNCTION__, size); - - /* - * NOTE: the nodes are processed in reverse order, i.e. reverse document - * order because xmlNodeSetContent can actually free up descendant - * of the node and such nodes may have been selected too ! Handling - * in reverse order ensure that descendant are accessed first, before - * they get removed. Mixing XPath and modifications on a tree must be - * done carefully ! - */ - for(i = size - 1; i >= 0; i--) { - s1ap_node = nodes->nodeTab[i]; - AssertFatal(NULL != s1ap_node, "One element of resultset of XPATH expression is NULL\n"); - update_xpath_node_mme_ue_s1ap_id(s1ap_payload, s1ap_node, new_id); - /* - * All the elements returned by an XPath query are pointers to - * elements from the tree *except* namespace nodes where the XPath - * semantic is different from the implementation in libxml2 tree. - * As a result when a returned node set is freed when - * xmlXPathFreeObject() is called, that routine must check the - * element type. But node from the returned set may have been removed - * by xmlNodeSetContent() resulting in access to freed data. - * This can be exercised by running valgrind - * There is 2 ways around it: - * - make a copy of the pointers to the nodes from the result set - * then call xmlXPathFreeObject() and then modify the nodes - * or - * - remove the reference to the modified nodes from the node set - * as they are processed, if they are not namespace nodes. - */ - if (nodes->nodeTab[i]->type != XML_NAMESPACE_DECL) { - nodes->nodeTab[i] = NULL; - } - } -} -//------------------------------------------------------------------------------ -int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_S1AP_ID_t old_id, const S1ap_MME_UE_S1AP_ID_t new_id) -{ - xmlChar xpath_expression[ET_XPATH_EXPRESSION_MAX_LENGTH]; - int ret = 0; - xmlDocPtr doc = NULL; - xmlXPathContextPtr xpath_ctx = NULL; - xmlXPathObjectPtr xpath_obj = NULL; - - //S1AP_DEBUG("%s() packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id); - - ret = snprintf(xpath_expression, ET_XPATH_EXPRESSION_MAX_LENGTH, "//field[@name=\"s1ap.MME_UE_S1AP_ID\"][@show=\"%u\"]", old_id); - AssertFatal((ret > 0) && (ret < ET_XPATH_EXPRESSION_MAX_LENGTH), "Could not build XPATH expression err=%d", ret); - - doc = packet->sctp_hdr.u.data_hdr.payload.doc; - // Create xpath evaluation context - xpath_ctx = xmlXPathNewContext(doc); - if(xpath_ctx == NULL) { - fprintf(stderr,"Error: unable to create new XPath context\n"); - xmlFreeDoc(doc); - return(-1); - } - - // Evaluate xpath expression - xpath_obj = xmlXPathEvalExpression(xpath_expression, xpath_ctx); - xmlXPathFreeContext(xpath_ctx); - AssertFatal(xpath_obj != NULL, "Unable to evaluate XPATH expression \"%s\"\n", xpath_expression); - - if(xmlXPathNodeSetIsEmpty(xpath_obj->nodesetval)){ - xmlXPathFreeObject(xpath_obj); - S1AP_DEBUG("%s() No match \"%s\"packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", - __FUNCTION__, xpath_expression, packet->packet_number, packet->original_frame_number, old_id, new_id); - return -1; - } - // update selected nodes - update_xpath_nodes_mme_ue_s1ap_id(&packet->sctp_hdr.u.data_hdr.payload, xpath_obj->nodesetval, new_id); - - // Cleanup of XPath data - xmlXPathFreeObject(xpath_obj); - - return 0; -} diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h b/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h deleted file mode 100644 index 532e14bb1d..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h +++ /dev/null @@ -1,242 +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 - */ - -#include - -#include "queue.h" -#include "tree.h" - -#include "sctp_eNB_defs.h" - -#ifndef PLAY_SCENARIO_S1AP_ENB_DEFS_H_ -#define PLAY_SCENARIO_S1AP_ENB_DEFS_H_ - -#define ENB_TAC (1) -#define ENB_MCC (208) -#define ENB_MNC (92) - -#define ENB_NAME "Eurecom ENB" -#define ENB_NAME_FORMAT (ENB_NAME" %u") - -#define S1AP_PORT_NUMBER (36412) -#define S1AP_SCTP_PPID (18) - -#define X2AP_PORT_NUMBER (36422) -#define X2AP_SCTP_PPID (27) - -#define S1AP_ENB_NAME_LENGTH_MAX (150) - -typedef enum { - /* Disconnected state: initial state for any association. */ - S1AP_ENB_STATE_DISCONNECTED = 0x0, - /* State waiting for S1 Setup response message if eNB is MME accepted or - * S1 Setup failure if MME rejects the eNB. - */ - S1AP_ENB_STATE_WAITING = 0x1, - /* The eNB is successfully connected to MME, UE contexts can be created. */ - S1AP_ENB_STATE_CONNECTED = 0x2, - /* The MME has sent an overload start message. Once the MME disables the - * OVERLOAD marker, the state of the association will be - * S1AP_ENB_STATE_CONNECTED. - */ - S1AP_ENB_OVERLOAD = 0x3, - /* Max number of states available */ - S1AP_ENB_STATE_MAX, -} s1ap_eNB_state_t; - - -/* If the Overload Action IE in the OVERLOAD START message is set to - * - “reject all RRC connection establishments for non-emergency mobile - * originated data transfer “ (i.e. reject traffic corresponding to RRC cause - * “mo-data “ (TS 36.331 [16])), or - * - “reject all RRC connection establishments for signalling “ (i.e. reject - * traffic corresponding to RRC cause “modata” and “mo-signalling” - * (TS 36.331 [16])),or - * - “only permit RRC connection establishments for emergency sessions and - * mobile terminated services” (i.e. only permit traffic corresponding to RRC - * cause “emergency” and “mt-Access” (TS 36.331 [16])). - * - * NOTE: When the Overload Action IE is set to “only permit RRC connection - * establishments for emergency sessions and mobile terminated services”, - * emergency calls with RRC cause “highPriorityAcess” from high priority users - * are rejected (TS 24.301 [24]). - */ -typedef enum { - S1AP_OVERLOAD_REJECT_MO_DATA = 0x0, - S1AP_OVERLOAD_REJECT_ALL_SIGNALLING = 0x1, - S1AP_OVERLOAD_ONLY_EMERGENCY_AND_MT = 0x2, - S1AP_NO_OVERLOAD = 0x3, - S1AP_OVERLOAD_MAX, -} s1ap_overload_state_t; - -/* Served PLMN identity element */ -struct plmn_identity_s { - uint16_t mcc; - uint16_t mnc; - uint8_t mnc_digit_length; - STAILQ_ENTRY(plmn_identity_s) next; -}; - -/* Served group id element */ -struct served_group_id_s { - uint16_t mme_group_id; - STAILQ_ENTRY(served_group_id_s) next; -}; - -/* Served mme code for a particular MME */ -struct mme_code_s { - uint8_t mme_code; - STAILQ_ENTRY(mme_code_s) next; -}; - -/* Served gummei element */ -struct served_gummei_s { - /* Number of MME served PLMNs */ - uint8_t nb_served_plmns; - /* List of served PLMNs by MME */ - STAILQ_HEAD(served_plmns_s, plmn_identity_s) served_plmns; - - /* Number of group id in list */ - uint8_t nb_group_id; - /* Served group id list */ - STAILQ_HEAD(served_group_ids_s, served_group_id_s) served_group_ids; - - /* Number of MME code */ - uint8_t nb_mme_code; - /* MME Code to uniquely identify an MME within an MME pool area */ - STAILQ_HEAD(mme_codes_s, mme_code_s) mme_codes; - - /* Next GUMMEI element */ - STAILQ_ENTRY(served_gummei_s) next; -}; - -struct s1ap_eNB_instance_s; - -/* This structure describes association of a eNB to a MME */ -typedef struct s1ap_eNB_mme_data_s { - /* MME descriptors tree, ordered by sctp assoc id */ - RB_ENTRY(s1ap_eNB_mme_data_s) entry; - - /* This is the optional name provided by the MME */ - char *mme_name; - net_ip_address_t mme_net_ip_address; // useful for joining assoc_id and ip address of packets - - /* List of served GUMMEI per MME. There is one GUMMEI per RAT with a max - * number of 8 RATs but in our case only one is used. The LTE related pool - * configuration is included on the first place in the list. - */ - STAILQ_HEAD(served_gummeis_s, served_gummei_s) served_gummei; - - /* Relative processing capacity of an MME with respect to the other MMEs - * in the pool in order to load-balance MMEs within a pool as defined - * in TS 23.401. - */ - uint8_t relative_mme_capacity; - - /* Current MME overload information (if any). */ - s1ap_overload_state_t overload_state; - /* Current eNB->MME S1AP association state */ - s1ap_eNB_state_t state; - - /* Next usable stream for UE signalling */ - int32_t nextstream; - - /* Number of input/ouput streams */ - uint16_t in_streams; - uint16_t out_streams; - - /* Connexion id used between SCTP/S1AP */ - uint16_t cnx_id; - - /* SCTP association id */ - int32_t assoc_id; - - /* Only meaningfull in virtual mode */ - struct s1ap_eNB_instance_s *s1ap_eNB_instance; -} s1ap_eNB_mme_data_t; - -typedef struct s1ap_eNB_instance_s { - /* Next s1ap eNB association. - * Only used for virtual mode. - */ - STAILQ_ENTRY(s1ap_eNB_instance_s) s1ap_eNB_entries; - - /* Number of MME requested by eNB (tree size) */ - uint32_t s1ap_mme_nb; - /* Number of MME for which association is pending */ - uint32_t s1ap_mme_pending_nb; - /* Number of MME successfully associated to eNB */ - uint32_t s1ap_mme_associated_nb; - /* Tree of S1AP MME associations ordered by association ID */ - RB_HEAD(s1ap_mme_map, s1ap_eNB_mme_data_s) s1ap_mme_head; - - /* TODO: add a map ordered by relative MME capacity */ - - /* Tree of UE ordered by eNB_ue_s1ap_id's */ - RB_HEAD(s1ap_ue_map, s1ap_eNB_ue_context_s) s1ap_ue_head; - - /* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */ - instance_t instance; - - /* Displayable name of eNB */ - char *eNB_name; - net_ip_address_t s1c_net_ip_address; - - /* Unique eNB_id to identify the eNB within EPC. - * In our case the eNB is a macro eNB so the id will be 20 bits long. - * For Home eNB id, this field should be 28 bits long. - */ - uint32_t eNB_id; - /* The type of the cell */ - enum cell_type_e cell_type; - - /* Tracking area code */ - uint16_t tac; - - /* Mobile Country Code - * Mobile Network Code - */ - uint16_t mcc; - uint16_t mnc; - uint8_t mnc_digit_length; - -} s1ap_eNB_instance_t; - -typedef struct { - /* List of served eNBs - * Only used for virtual mode - */ - STAILQ_HEAD(s1ap_eNB_instances_head_s, s1ap_eNB_instance_s) s1ap_eNB_instances_head; - /* Nb of registered eNBs */ - uint8_t nb_registered_eNBs; - - /* Generate a unique connexion id used between S1AP and SCTP */ - uint16_t global_cnx_id; -} s1ap_eNB_internal_data_t; - -int s1ap_eNB_compare_assoc_id( - struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2); - -/* Generate the tree management functions */ -RB_PROTOTYPE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, - s1ap_eNB_compare_assoc_id); - -#endif /* PLAY_SCENARIO_S1AP_ENB_DEFS_H_ */ diff --git a/openair3/TEST/EPC_TEST/play_scenario_sctp.c b/openair3/TEST/EPC_TEST/play_scenario_sctp.c deleted file mode 100644 index c126608598..0000000000 --- a/openair3/TEST/EPC_TEST/play_scenario_sctp.c +++ /dev/null @@ -1,112 +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 - */ - -/* - play_scenario_sctp.c - ------------------- - AUTHOR : Lionel GAUTHIER - COMPANY : EURECOM - EMAIL : Lionel.Gauthier@eurecom.fr - */ - - -#include - -#include "intertask_interface.h" -#include "platform_types.h" -#include "assertions.h" -#include "play_scenario.h" - -//------------------------------------------------------------------------------ -asn_comp_rval_t *et_sctp_data_is_matching(sctp_datahdr_t *const sctp1, sctp_datahdr_t *const sctp2, const uint32_t constraints) -{ - asn_comp_rval_t *rv = NULL; - - // no comparison for ports - if (sctp1->ppid != sctp2->ppid) { - S1AP_WARN("No Matching SCTP PPID %u %u\n", sctp1->ppid, sctp2->ppid); - rv = calloc(1, sizeof(asn_comp_rval_t)); - rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_PPID; - return rv; - } - - if (sctp1->assoc_id != sctp2->assoc_id) { - S1AP_WARN("No Matching SCTP assoc id %u %u\n", sctp1->assoc_id, sctp2->assoc_id); - rv = calloc(1, sizeof(asn_comp_rval_t)); - rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID; - return rv; - } - - if (sctp1->stream != sctp2->stream) { - if (constraints & ET_BIT_MASK_MATCH_SCTP_STREAM) { - rv = calloc(1, sizeof(asn_comp_rval_t)); - rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID; - return rv; - } else { - S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream); - } - } - - // We do not have SSN from lower layers - // if (sctp1->ssn != sctp2->ssn) { - // if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) { - // rv = calloc(1, sizeof(asn_comp_rval_t)); - // rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_SSN; - // return rv; - // } else { - // S1AP_WARN("No Matching SCTP STREAM SN %u %u\n", sctp1->ssn, sctp2->ssn); - // } - // } - return et_s1ap_is_matching(&sctp1->payload, &sctp2->payload, constraints); -} - -//------------------------------------------------------------------------------ -asn_comp_rval_t *et_sctp_is_matching(et_sctp_hdr_t *const sctp1, et_sctp_hdr_t *const sctp2, const uint32_t constraints) -{ - // no comparison for ports - asn_comp_rval_t *rv = NULL; - - if (sctp1->chunk_type != sctp2->chunk_type) { - S1AP_WARN("No Matching chunk_type %u %u\n", sctp1->chunk_type, sctp2->chunk_type); - rv = calloc(1, sizeof(asn_comp_rval_t)); - rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE; - return rv; - } - - switch (sctp1->chunk_type) { - case SCTP_CID_DATA: - return et_sctp_data_is_matching(&sctp1->u.data_hdr, &sctp2->u.data_hdr, constraints); - break; - - case SCTP_CID_INIT: - AssertFatal(0, "Not needed now"); - break; - - case SCTP_CID_INIT_ACK: - AssertFatal(0, "Not needed now"); - break; - - default: - AssertFatal(0, "Not needed now cid %d", sctp1->chunk_type); - } - - return NULL; -} diff --git a/openair3/TEST/oaisim_mme_client_test.c b/openair3/TEST/oaisim_mme_client_test.c deleted file mode 100644 index 8fcda8a5ad..0000000000 --- a/openair3/TEST/oaisim_mme_client_test.c +++ /dev/null @@ -1,122 +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 - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "sctp_primitives_client.h" - -#include "s1ap_common.h" -#include "s1ap_eNB.h" -#include "s1ap_mme.h" - -char ip_addr[] = "127.0.0.1"; - -int assoc[2]; -uint8_t id[] = { 0x03, 0x56, 0xf0, 0xd8 }; -char identity[] = { 0x02, 0x08, 0x34 }; -char tac[] = { 0x00, 0x01 }; -char infoNAS[] = { 0x07, 0x42, 0x01, 0xE0, 0x06, 0x00, 0x00, 0xF1, 0x10, 0x00, 0x01, 0x00, 0x2C, - 0x52, 0x01, 0xC1, 0x01, 0x09, 0x10, 0x03, 0x77, 0x77, 0x77, 0x07, 0x61, 0x6E, 0x72, 0x69, 0x74, - 0x73, 0x75, 0x03, 0x63, 0x6F, 0x6D, 0x05, 0x01, 0x0A, 0x01, 0x20, 0x37, 0x27, 0x0E, 0x80, 0x80, - 0x21, 0x0A, 0x03, 0x00, 0x00, 0x0A, 0x81, 0x06, 0x0A, 0x00, 0x00, 0x01, 0x50, 0x0B, 0xF6, - 0x00, 0xF1, 0x10, 0x80, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01 - }; - -uint32_t eNB_UE_S1AP_ID = 0; - -int s1ap_eNB_generate_initial_ue_message(uint8_t **buffer, - uint32_t *length); - -int s1ap_eNB_generate_initial_ue_message(uint8_t **buffer, - uint32_t *length) -{ - InitialUEMessageIEs initialUEmessageIEs; - InitialUEMessageIEs *initialUEmessageIEs_p = &initialUEmessageIEs; - memset(initialUEmessageIEs_p, 0, sizeof(InitialUEMessageIEs)); - initialUEmessageIEs.eNB_UE_S1AP_ID = eNB_UE_S1AP_ID; - initialUEmessageIEs.nas_pdu.buf = infoNAS; - initialUEmessageIEs.nas_pdu.size = sizeof(infoNAS); - initialUEmessageIEs.tai.tAC.buf = tac; - initialUEmessageIEs.tai.tAC.size = 2; - initialUEmessageIEs.tai.pLMNidentity.buf = identity; - initialUEmessageIEs.tai.pLMNidentity.size = 3; - initialUEmessageIEs.eutran_cgi.pLMNidentity.buf = identity; - initialUEmessageIEs.eutran_cgi.pLMNidentity.size = 3; - initialUEmessageIEs.eutran_cgi.cell_ID.buf = id; - initialUEmessageIEs.eutran_cgi.cell_ID.size = 4; - initialUEmessageIEs.eutran_cgi.cell_ID.bits_unused = 4; - initialUEmessageIEs.rrC_Establishment_Cause = RRC_Establishment_Cause_mo_Data; - return s1ap_eNB_encode_initial_ue_message(initialUEmessageIEs_p, buffer, length); -} - -void recv_callback(uint8_t *buffer, uint32_t length) -{ - uint8_t *bufferS; - uint32_t len; - s1ap_eNB_generate_initial_ue_message(&bufferS, &len); - sctp_send_msg(assoc[0], 1, bufferS, len); -} - -int main(int argc, char *argv[]) -{ - asn_enc_rval_t retVal; - uint8_t *buffer; - uint32_t len; - SupportedTAs_Item_t ta; - PLMNidentity_t plmnIdentity; - asn_debug = 0; - asn1_xer_print = 0; - S1SetupRequestIEs s1SetupRequest; - memset(&s1SetupRequest, 0, sizeof(S1SetupRequestIEs)); - s1SetupRequest.global_ENB_ID.eNB_ID.present = ENB_ID_PR_macroENB_ID; - s1SetupRequest.global_ENB_ID.eNB_ID.choice.macroENB_ID.buf = id; - s1SetupRequest.global_ENB_ID.eNB_ID.choice.macroENB_ID.size = 3; - s1SetupRequest.global_ENB_ID.eNB_ID.choice.macroENB_ID.bits_unused = 4; - OCTET_STRING_fromBuf(&s1SetupRequest.global_ENB_ID.pLMNidentity, identity, 3); - s1SetupRequest.presenceMask |= S1SETUPREQUESTIES_ENBNAME_PRESENT; - OCTET_STRING_fromBuf(&s1SetupRequest.eNBname, "ENB 1 eurecom", - strlen("ENB 1 eurecom")); - memset(&ta, 0, sizeof(SupportedTAs_Item_t)); - memset(&plmnIdentity, 0, sizeof(PLMNidentity_t)); - OCTET_STRING_fromBuf(&ta.tAC, tac, 2); - OCTET_STRING_fromBuf(&plmnIdentity, identity, 3); - ASN_SEQUENCE_ADD(&ta.broadcastPLMNs, &plmnIdentity); - ASN_SEQUENCE_ADD(&s1SetupRequest.supportedTAs, &ta); - s1SetupRequest.defaultPagingDRX = PagingDRX_v64; - s1ap_eNB_encode_s1setuprequest(&s1SetupRequest, &buffer, &len); - assoc[0] = sctp_connect_to_remote_host(ip_addr, 36412, &recv_callback); - sctp_send_msg(0, 0, buffer, len); - free(buffer); - // generateUplinkNASTransport(&buffer, &len); - // sctp_send_msg(assoc[0], 0, buffer, len); - // s1ap_mme_decode_pdu(buffer, len); - pthread_join(sctp_get_receiver_thread(assoc[0]), NULL); - return(0); -} diff --git a/openair3/TEST/oaisim_mme_itti_test.c b/openair3/TEST/oaisim_mme_itti_test.c deleted file mode 100644 index ecfbdb0acb..0000000000 --- a/openair3/TEST/oaisim_mme_itti_test.c +++ /dev/null @@ -1,93 +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 - */ - -#include -#include -#include -#include - -#include -#include - -#include - -#include "mme_config.h" -#include "gtpv1u_sgw_defs.h" - -#include "intertask_interface.h" - -#include "sctp_primitives_server.h" -#include "udp_primitives_server.h" -#include "s1ap_mme.h" -#include "log.h" -#include "sgw_lite_defs.h" -#include "ipv4_defs.h" - -int main(int argc, char *argv[]) -{ - int i = 0; - int prio = 0; - mme_config_t mme_config; - MessageDef *message_p; - struct sched_param param = { - .sched_priority = 10, - }; - - config_parse_opt_line(argc, argv, &mme_config); - fprintf(stdout, "Starting %s ITTI test\n", PACKAGE_STRING); - - if (setpriority(PRIO_PROCESS, 0, prio) < 0) { - fprintf(stderr, "Cannot assign requested prio: %d\n" - "%d:%s\n", prio, errno, strerror(errno)); - return -1; - } - - if (sched_setscheduler(0, SCHED_RR, ¶m) < 0) { - fprintf(stderr, "Cannot assign requested scheduler policy\n" - "%d:%s\n", errno, strerror(errno)); - return -1; - } - - /* Calling each layer init function */ - log_init(&mme_config); - itti_init(TASK_MAX, tasks_info); - sctp_init(&mme_config); - udp_init(&mme_config); - s1ap_mme_init(&mme_config); - gtpv1u_init(&mme_config); - ipv4_init(&mme_config); - - sgw_lite_init(&mme_config); - - message_p = itti_alloc_new_message(TASK_S1AP, MESSAGE_TEST); - - while(i < (1 << 15)) { - if (send_broadcast_message(message_p) < 0) { - fprintf(stderr, "Failed to send broadcast message %d\n", i); - } - - i++; - } - - fprintf(stderr, "Successfully sent %lu messages", get_current_message_number()); - - return 0; -} diff --git a/openair3/TEST/oaisim_mme_list_benchmark.c b/openair3/TEST/oaisim_mme_list_benchmark.c deleted file mode 100644 index 633e83aace..0000000000 --- a/openair3/TEST/oaisim_mme_list_benchmark.c +++ /dev/null @@ -1,261 +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 - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "sctp_primitives_client.h" - -#include "s1ap_common.h" -#include "s1ap_eNB.h" -#include "s1ap_mme.h" - -#include "s1ap_eNB_encoder.h" -#include "s1ap_eNB_decoder.h" - -#define NB_OF_ENB 10 -#define NB_OF_UES 100 - -static int connected_eNB = 0; -static char ip_addr[] = "127.0.0.1"; -uint32_t ipv4_local = 0x7F000001; -static uint8_t id[] = { 0x03, 0x56, 0xf0, 0xd8 }; -static char identity[] = { 0x02, 0x08, 0x34 }; -static char tac[] = { 0x00, 0x01 }; -static char infoNAS[] = { 0x07, 0x42, 0x01, 0xE0, 0x06, 0x00, 0x00, 0xF1, 0x10, 0x00, 0x01, 0x00, 0x2C, - 0x52, 0x01, 0xC1, 0x01, 0x09, 0x10, 0x03, 0x77, 0x77, 0x77, 0x07, 0x61, 0x6E, 0x72, 0x69, 0x74, - 0x73, 0x75, 0x03, 0x63, 0x6F, 0x6D, 0x05, 0x01, 0x0A, 0x01, 0x20, 0x37, 0x27, 0x0E, 0x80, 0x80, - 0x21, 0x0A, 0x03, 0x00, 0x00, 0x0A, 0x81, 0x06, 0x0A, 0x00, 0x00, 0x01, 0x50, 0x0B, 0xF6, - 0x00, 0xF1, 0x10, 0x80, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01 - }; -uint32_t nb_eNB = NB_OF_ENB; -uint32_t nb_ue = NB_OF_UES; - -void s1ap_test_generate_s1_setup_request(uint32_t eNB_id, uint8_t **buffer, - uint32_t *length); -int s1ap_test_generate_initial_ue_message(uint32_t eNB_UE_S1AP_ID, - uint8_t **buffer, - uint32_t *length); -int recv_callback(uint32_t assocId, - uint32_t stream, - uint8_t *buffer, - uint32_t length); -int sctp_connected(void *args, - uint32_t assocId, - uint32_t instreams, - uint32_t outstreams); - -void s1ap_test_generate_s1_setup_request(uint32_t eNB_id, uint8_t **buffer, - uint32_t *length) -{ - S1SetupRequestIEs_t s1SetupRequest; - SupportedTAs_Item_t ta; - PLMNidentity_t plmnIdentity; - uint8_t *id_p = (uint8_t *)(&eNB_id + 1); - memset(&s1SetupRequest, 0, sizeof(S1SetupRequestIEs_t)); - s1SetupRequest.global_ENB_ID.eNB_ID.present = ENB_ID_PR_macroENB_ID; - s1SetupRequest.global_ENB_ID.eNB_ID.choice.macroENB_ID.buf = id_p; - s1SetupRequest.global_ENB_ID.eNB_ID.choice.macroENB_ID.size = 3; - s1SetupRequest.global_ENB_ID.eNB_ID.choice.macroENB_ID.bits_unused = 4; - OCTET_STRING_fromBuf(&s1SetupRequest.global_ENB_ID.pLMNidentity, identity, 3); - s1SetupRequest.presenceMask |= S1SETUPREQUESTIES_ENBNAME_PRESENT; - OCTET_STRING_fromBuf(&s1SetupRequest.eNBname, "ENB 1 eurecom", - strlen("ENB 1 eurecom")); - memset(&ta, 0, sizeof(SupportedTAs_Item_t)); - memset(&plmnIdentity, 0, sizeof(PLMNidentity_t)); - OCTET_STRING_fromBuf(&ta.tAC, tac, 2); - OCTET_STRING_fromBuf(&plmnIdentity, identity, 3); - ASN_SEQUENCE_ADD(&ta.broadcastPLMNs, &plmnIdentity); - ASN_SEQUENCE_ADD(&s1SetupRequest.supportedTAs, &ta); - s1SetupRequest.defaultPagingDRX = PagingDRX_v64; - s1ap_eNB_encode_s1_setup_request(&s1SetupRequest, buffer, length); -} - -int s1ap_test_generate_initial_ue_message(uint32_t eNB_UE_S1AP_ID, - uint8_t **buffer, - uint32_t *length) -{ - InitialUEMessageIEs_t initialUEmessageIEs; - InitialUEMessageIEs_t *initialUEmessageIEs_p = &initialUEmessageIEs; - memset(initialUEmessageIEs_p, 0, sizeof(InitialUEMessageIEs_t)); - initialUEmessageIEs.eNB_UE_S1AP_ID = eNB_UE_S1AP_ID & 0x00ffffff; - initialUEmessageIEs.nas_pdu.buf = (uint8_t *)infoNAS; - initialUEmessageIEs.nas_pdu.size = sizeof(infoNAS); - initialUEmessageIEs.tai.tAC.buf = (uint8_t *)tac; - initialUEmessageIEs.tai.tAC.size = 2; - initialUEmessageIEs.tai.pLMNidentity.buf = (uint8_t *)identity; - initialUEmessageIEs.tai.pLMNidentity.size = 3; - initialUEmessageIEs.eutran_cgi.pLMNidentity.buf = (uint8_t *)identity; - initialUEmessageIEs.eutran_cgi.pLMNidentity.size = 3; - initialUEmessageIEs.eutran_cgi.cell_ID.buf = (uint8_t *)id; - initialUEmessageIEs.eutran_cgi.cell_ID.size = 4; - initialUEmessageIEs.eutran_cgi.cell_ID.bits_unused = 4; - initialUEmessageIEs.rrC_Establishment_Cause = RRC_Establishment_Cause_mo_Data; - return s1ap_eNB_encode_initial_ue_message(initialUEmessageIEs_p, buffer, length); -} - -int s1ap_test_generate_initial_setup_resp(uint32_t eNB_UE_S1AP_ID, - uint32_t mme_UE_S1AP_ID, - uint8_t eRAB_id, - uint32_t teid, - uint8_t **buffer, - uint32_t *length) -{ - InitialContextSetupResponseIEs_t initialResponseIEs; - InitialContextSetupResponseIEs_t *initialResponseIEs_p = &initialResponseIEs; - E_RABSetupItemCtxtSURes_t e_RABSetupItemCtxtSURes; - memset(initialResponseIEs_p, 0, sizeof(InitialContextSetupResponseIEs_t)); - memset(&e_RABSetupItemCtxtSURes, 0, sizeof(E_RABSetupItemCtxtSURes_t)); - initialResponseIEs_p->mme_ue_s1ap_id = mme_UE_S1AP_ID; - initialResponseIEs_p->eNB_UE_S1AP_ID = eNB_UE_S1AP_ID; - e_RABSetupItemCtxtSURes.e_RAB_ID = eRAB_id; - e_RABSetupItemCtxtSURes.transportLayerAddress.buf = (uint8_t *)&ipv4_local; - e_RABSetupItemCtxtSURes.transportLayerAddress.size = 4; - e_RABSetupItemCtxtSURes.gTP_TEID.buf = (uint8_t *)&teid; - e_RABSetupItemCtxtSURes.gTP_TEID.size = 4; - ASN_SEQUENCE_ADD( - &initialResponseIEs_p->e_RABSetupListCtxtSURes.e_RABSetupItemCtxtSURes, - &e_RABSetupItemCtxtSURes); - return s1ap_eNB_encode_initial_context_setup_response(initialResponseIEs_p, - buffer, length); -} - -int recv_callback(uint32_t assocId, - uint32_t stream, - uint8_t *buffer, - uint32_t length) -{ - S1AP_S1AP_PDU_t pdu; - uint8_t *buffer2; - uint32_t len; - int j; - - if (s1ap_eNB_decode_pdu(&pdu, buffer, length) < 0) { - fprintf(stderr, "s1ap_eNB_decode_pdu returned status < 0\n"); - free(buffer); - return -1; - } - - if (pdu.initiatingMessage.procedureCode == S1AP_ProcedureCode_id_S1Setup - && pdu.present == S1AP_S1AP_PDU_PR_successfulOutcome) { - for (j = 0; j < nb_ue; j++) { - s1ap_test_generate_initial_ue_message(j, &buffer2, &len); - - if (sctp_send_msg(assocId, j % 64 + 1, buffer2, len) < 0) { - fprintf(stderr, - "sctp_send_msg returned status < 0\nSomething bad happened on SCTP layer\n"); - free(buffer2); - break; - } - - free(buffer2); - } - } else if (pdu.initiatingMessage.procedureCode == S1AP_ProcedureCode_id_InitialContextSetup - && pdu.present == S1AP_PDU_PR_initiatingMessage) { - fprintf(stdout, "Received InitialContextSetup request\n"); - s1ap_test_generate_initial_setup_resp( - message.msg.initialContextSetupRequestIEs.eNB_UE_S1AP_ID, - message.msg.initialContextSetupRequestIEs.mme_ue_s1ap_id, - 0x5, - 0x1, - &buffer2, - &len); - - if (sctp_send_msg(assocId, stream, buffer2, len) < 0) { - fprintf(stderr, - "sctp_send_msg returned status < 0\nSomething bad happened on SCTP layer\n"); - free(buffer2); - } - - free(buffer2); - } else { - fprintf(stderr, "Received unexpected message %d %d\n", message.procedureCode, - message.direction); - free(buffer); - return -1; - } - - free(buffer); - return 0; -} - -int sctp_connected(void *args, - uint32_t assocId, - uint32_t instreams, - uint32_t outstreams) -{ - uint8_t *buffer; - uint32_t len; - fprintf(stdout, "New association %d\n", assocId); - s1ap_test_generate_s1_setup_request(assocId * nb_eNB, &buffer, &len); - - if (sctp_send_msg(assocId, 0, buffer, len) < 0) { - free(buffer); - fprintf(stderr, - "sctp_send_msg returned status < 0. Something bad happened on SCTP layer\n"); - exit(0); - } - - free(buffer); - connected_eNB++; - return 0; -} - -int main(int argc, char *argv[]) -{ - asn_enc_rval_t retVal; - int i; - SupportedTAs_Item_t ta; - PLMNidentity_t plmnIdentity; - asn_debug = 0; - asn1_xer_print = 0; - - if (argc > 1) { - nb_eNB = atoi(argv[1]); - - if (argc > 2) { - nb_ue = atoi(argv[2]); - } - } - - for (i = 0; i < nb_eNB; i++) { - sctp_connect_to_remote_host(ip_addr, 36412, 18, NULL, sctp_connected, - recv_callback); - } - - while (1) { - sleep(1); - } - - // generateUplinkNASTransport(&buffer, &len); - // sctp_send_msg(assoc[0], 0, buffer, len); - // s1ap_mme_decode_pdu(buffer, len); - sctp_terminate(); - return(0); -} diff --git a/openair3/TEST/oaisim_mme_s1ap_test.c b/openair3/TEST/oaisim_mme_s1ap_test.c deleted file mode 100644 index aa8f92aee1..0000000000 --- a/openair3/TEST/oaisim_mme_s1ap_test.c +++ /dev/null @@ -1,179 +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 - */ - -#include -#include -#include - -#include "s1ap_common.h" -#include "s1ap_eNB_decoder.h" -#include "s1ap_mme_decoder.h" -#include "s1ap_eNB_encoder.h" - -#define MAX_BUF_LENGTH (1024) - -typedef struct { - char *procedure_name; - uint8_t buffer[MAX_BUF_LENGTH]; - uint32_t buf_len; -} s1ap_test_t; - -s1ap_test_t s1ap_test[] = { - // { - // .procedure_name = "Downlink NAS transport", - // .buffer = { - // 0x00, 0x0B, 0x40, 0x21, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - // 0x05, 0xC0, 0x01, 0x10, 0xCE, 0xCC, 0x00, 0x08, 0x00, 0x03, - // 0x40, 0x01, 0xB3, 0x00, 0x1A, 0x00, 0x0A, 0x09, 0x27, 0xAB, - // 0x1F, 0x7C, 0xEC, 0x01, 0x02, 0x01, 0xD9 - // }, - // .buf_len = 37, - // }, - { - .procedure_name = "Uplink NAS transport", - .buffer = { - 0x00, 0x0D, 0x40, 0x41, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x05, 0xC0, 0x01, 0x10, 0xCE, 0xCC, 0x00, 0x08, 0x00, 0x03, - 0x40, 0x01, 0xB3, 0x00, 0x1A, 0x00, 0x14, 0x13, 0x27, 0xD3, - 0x77, 0xED, 0x4C, 0x01, 0x02, 0x01, 0xDA, 0x28, 0x08, 0x03, - 0x69, 0x6D, 0x73, 0x03, 0x70, 0x66, 0x74, 0x00, 0x64, 0x40, - 0x08, 0x00, 0x02, 0xF8, 0x29, 0x00, 0x00, 0x20, 0x40, 0x00, - 0x43, 0x40, 0x06, 0x00, 0x02, 0xF8, 0x29, 0x00, 0x04, - }, - .buf_len = 69, - }, - { - .procedure_name = "UE capability info indication", - .buffer = { - 0x00, 0x16, 0x40, 0x37, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x05, 0xC0, 0x01, 0x10, 0xCE, 0xCC, 0x00, 0x08, 0x00, 0x03, - 0x40, 0x01, 0xB3, 0x00, 0x4A, 0x40, 0x20, 0x1F, 0x00, 0xE8, - 0x01, 0x01, 0xA8, 0x13, 0x80, 0x00, 0x20, 0x83, 0x13, 0x05, - 0x0B, 0x8B, 0xFC, 0x2E, 0x2F, 0xF0, 0xB8, 0xBF, 0xAF, 0x87, - 0xFE, 0x40, 0x44, 0x04, 0x07, 0x0C, 0xA7, 0x4A, 0x80, - }, - .buf_len = 59, - }, - { - .procedure_name = "Initial Context Setup Request", - .buffer = { - 0x00, 0x09, 0x00, 0x80, 0xD4, 0x00, 0x00, 0x06, 0x00, 0x00, - 0x00, 0x05, 0xC0, 0x01, 0x10, 0xCE, 0xCC, 0x00, 0x08, 0x00, - 0x03, 0x40, 0x01, 0xB3, 0x00, 0x42, 0x00, 0x0A, 0x18, 0x08, - 0xF0, 0xD1, 0x80, 0x60, 0x02, 0xFA, 0xF0, 0x80, 0x00, 0x18, - 0x00, 0x80, 0x81, 0x00, 0x00, 0x34, 0x00, 0x7C, 0x45, 0x00, - 0x09, 0x3D, 0x0F, 0x80, 0x0A, 0x05, 0x00, 0x02, 0x03, 0x78, - 0x48, 0x86, 0x6D, 0x27, 0xC7, 0x97, 0x8E, 0xA1, 0x02, 0x07, - 0x42, 0x01, 0x49, 0x06, 0x00, 0x02, 0xF8, 0x29, 0x00, 0x04, - 0x00, 0x48, 0x52, 0x01, 0xC1, 0x01, 0x09, 0x1B, 0x03, 0x69, - 0x6D, 0x73, 0x03, 0x70, 0x66, 0x74, 0x06, 0x6D, 0x6E, 0x63, - 0x30, 0x39, 0x32, 0x06, 0x6D, 0x63, 0x63, 0x32, 0x30, 0x38, - 0x04, 0x67, 0x70, 0x72, 0x73, 0x05, 0x01, 0x0A, 0x80, 0x00, - 0x24, 0x5D, 0x01, 0x00, 0x30, 0x10, 0x23, 0x93, 0x1F, 0x93, - 0x96, 0xFE, 0xFE, 0x74, 0x4B, 0xFF, 0xFF, 0x00, 0xC5, 0x00, - 0x6C, 0x00, 0x32, 0x0B, 0x84, 0x34, 0x01, 0x08, 0x5E, 0x04, - 0xFE, 0xFE, 0xC5, 0x6C, 0x50, 0x0B, 0xF6, 0x02, 0xF8, 0x29, - 0x80, 0x00, 0x01, 0xF0, 0x00, 0x70, 0x8A, 0x53, 0x12, 0x64, - 0x01, 0x01, 0x00, 0x6B, 0x00, 0x05, 0x18, 0x00, 0x0C, 0x00, - 0x00, 0x00, 0x49, 0x00, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - }, - .buf_len = 217, - }, - { - .procedure_name = "Initial context setup response", - .buffer = { - 0x20, 0x09, 0x00, 0x26, 0x00, 0x00, 0x03, 0x00, 0x00, 0x40, - 0x05, 0xC0, 0x01, 0x10, 0xCE, 0xCC, 0x00, 0x08, 0x40, 0x03, - 0x40, 0x01, 0xB3, 0x00, 0x33, 0x40, 0x0F, 0x00, 0x00, 0x32, - 0x40, 0x0A, 0x0A, 0x1F, 0x0A, 0x05, 0x02, 0x05, 0x00, 0x0F, - 0x7A, 0x03, - }, - .buf_len = 42, - } -}; - -static int compare_buffer(uint8_t *buffer, uint32_t length_buffer, - uint8_t *pattern, - uint32_t length_pattern) -{ - int i; - - if (length_buffer != length_pattern) { - printf("Length mismatch, expecting %d bytes, got %d bytes\n", length_pattern, - length_buffer); - return -1; - } - - for (i = 0; i < length_buffer; i++) { - if (pattern[i] != buffer[i]) { - printf("Mismatch fount in bytes %d\nExpecting 0x%02x, got 0x%02x\n", - i, pattern[i], buffer[i]); - } - } - - return 0; -} - -int main(int argc, char *argv[]) -{ - int i; - asn1_xer_print = 2; - - if (argc > 1) { - asn_debug = 1; - } - - for (i = 0; i < sizeof(s1ap_test) / sizeof(s1ap_test_t); i++) { - S1AP_S1AP_PDU_t pdu; - uint8_t *buffer; - uint32_t length; - memset(&pdu, 0, sizeof(pdu)); - printf("Trying to decode %s procedure with asn1c decoder\n", - s1ap_test[i].procedure_name); - - if (s1ap_mme_decode_pdu(&pdu, s1ap_test[i].buffer, - s1ap_test[i].buf_len) < 0) { - if (s1ap_eNB_decode_pdu(&pdu, s1ap_test[i].buffer, - s1ap_test[i].buf_len) < 0) { - printf("Failed to decode this message\n"); - } else { - printf("Succesfully decoded %s with eNB decoder\n", s1ap_test[i].procedure_name); - } - } else { - printf("Succesfully decoded %s with MME decoder\n", s1ap_test[i].procedure_name); - } - - printf("Trying to encode %s procedure with asn1c encoder\n", - s1ap_test[i].procedure_name); - - if (s1ap_eNB_encode_pdu(&pdu, &buffer, &length) < 0) { - printf("Failed to encode this message on MME side, trying eNB side\n"); - } else { - compare_buffer(buffer, length, s1ap_test[i].buffer, s1ap_test[i].buf_len); - free(buffer); - } - } - - return 0; -} diff --git a/openair3/TEST/oaisim_mme_sctp_test.c b/openair3/TEST/oaisim_mme_sctp_test.c deleted file mode 100644 index b8be3e185c..0000000000 --- a/openair3/TEST/oaisim_mme_sctp_test.c +++ /dev/null @@ -1,74 +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 - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "sctp_primitives_client.h" - -#include "s1ap_common.h" -#include "s1ap_eNB.h" -#include "s1ap_mme.h" - -#include "s1ap_eNB_encoder.h" -#include "s1ap_eNB_decoder.h" - -int recv_callback(uint32_t assocId, - uint32_t stream, - uint8_t *buffer, - uint32_t length) -{ - free(buffer); - return 0; -} - -int sctp_connected(void *args, - uint32_t assocId, - uint32_t instreams, - uint32_t outstreams) -{ - return 0; -} - -int main(int argc, char *argv[]) -{ - asn_enc_rval_t retVal; - int i; - - for (i = 0; i < nb_eNB; i++) { - sctp_connect_to_remote_host(ip_addr, 36412, NULL, sctp_connected, recv_callback); - } - - while (1) { - sleep(1); - } - - sctp_terminate(); - return(0); -} diff --git a/openair3/TEST/oaisim_mme_test_s1c.c b/openair3/TEST/oaisim_mme_test_s1c.c deleted file mode 100644 index 94a554ab5f..0000000000 --- a/openair3/TEST/oaisim_mme_test_s1c.c +++ /dev/null @@ -1,339 +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 - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "UTIL/LOG/log_extern.h" -#include "assertions.h" -#include "intertask_interface.h" -#include "sctp_eNB_task.h" -#include "s1ap_eNB.h" -#include "enb_config.h" - -#include "oaisim_mme_test_s1c.h" - -# define ENB_REGISTER_RETRY_DELAY 5 -//------------------------------------------------------------------------------ -static void get_options (int argc, char **argv); -static uint32_t eNB_app_register(const uint32_t enb_id_start, const uint32_t enb_id_end, const Enb_properties_array_t *enb_properties); -static void *eNB_app_task (void *args_p); -void mme_test_s1_start_test(instance_t instance); -//------------------------------------------------------------------------------ -static char *conf_config_file_name = NULL; -const Enb_properties_array_t *enb_properties = NULL; -int16_t glog_level = LOG_INFO; -int16_t glog_verbosity = LOG_MED; -s1c_test_t s1c_test = { - 0, // scenario_index - 0, // tx_next_message_index - 0, // rx_next_message_index - 0 // assoc_id - }; - -//------------------------------------------------------------------------------ -static void get_options (int argc, char **argv) -//------------------------------------------------------------------------------ -{ - int c; - - - while ((c = getopt_long (argc, argv, "K:g:G:O:",NULL,NULL)) != -1) { - switch (c) { - case 'O': - conf_config_file_name = optarg; - break; - - case 'g': - glog_level=atoi(optarg); // value between 1 - 9 - break; - - case 'G': - glog_verbosity=atoi(optarg);// value from 0, 0x5, 0x15, 0x35, 0x75 - break; - - default: - break; - } - } - - AssertFatal(conf_config_file_name != NULL,"Please provide a configuration file\n"); - - -} - - -//------------------------------------------------------------------------------ -static uint32_t eNB_app_register(const uint32_t enb_id_start, const uint32_t enb_id_end, const Enb_properties_array_t *enb_properties) -//------------------------------------------------------------------------------ -{ - uint32_t enb_id; - uint32_t mme_id; - MessageDef *msg_p; - uint32_t register_enb_pending = 0; - char *str = NULL; - struct in_addr addr; - - // 1 eNB should be max. - // 1 eNB should be max. - for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) { - { - s1ap_register_enb_req_t *s1ap_register_eNB; - - /* note: there is an implicit relationship between the data structure and the message name */ - msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ); - - s1ap_register_eNB = &S1AP_REGISTER_ENB_REQ(msg_p); - - /* Some default/random parameters */ - s1ap_register_eNB->eNB_id = enb_properties->properties[enb_id]->eNB_id; - s1ap_register_eNB->cell_type = enb_properties->properties[enb_id]->cell_type; - s1ap_register_eNB->eNB_name = enb_properties->properties[enb_id]->eNB_name; - s1ap_register_eNB->tac = enb_properties->properties[enb_id]->tac; - s1ap_register_eNB->mcc = enb_properties->properties[enb_id]->mcc; - s1ap_register_eNB->mnc = enb_properties->properties[enb_id]->mnc; - s1ap_register_eNB->mnc_digit_length = enb_properties->properties[enb_id]->mnc_digit_length; - s1ap_register_eNB->default_drx = enb_properties->properties[enb_id]->pcch_defaultPagingCycle[0]; - - s1ap_register_eNB->nb_mme = enb_properties->properties[enb_id]->nb_mme; - AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme, - S1AP_MAX_NB_MME_IP_ADDRESS); - - for (mme_id = 0; mme_id < s1ap_register_eNB->nb_mme; mme_id++) { - s1ap_register_eNB->mme_ip_address[mme_id].ipv4 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4; - s1ap_register_eNB->mme_ip_address[mme_id].ipv6 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv6; - strncpy (s1ap_register_eNB->mme_ip_address[mme_id].ipv4_address, - enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4_address, - sizeof(s1ap_register_eNB->mme_ip_address[0].ipv4_address)); - strncpy (s1ap_register_eNB->mme_ip_address[mme_id].ipv6_address, - enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv6_address, - sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address)); - } - - s1ap_register_eNB->enb_ip_address.ipv6 = 0; - s1ap_register_eNB->enb_ip_address.ipv4 = 1; - addr.s_addr = enb_properties->properties[enb_id]->enb_ipv4_address_for_S1_MME; - str = inet_ntoa(addr); - strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str); - - itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); - - register_enb_pending++; - } - } - - return register_enb_pending; -} - -//------------------------------------------------------------------------------ -static void *eNB_app_task(void *args_p) -//------------------------------------------------------------------------------ -{ - const Enb_properties_array_t *enb_properties_p = NULL; - uint32_t enb_nb = 1; /* Default number of eNB is 1 */ - uint32_t enb_id_start = 0; - uint32_t enb_id_end = enb_id_start + enb_nb; - uint32_t register_enb_pending; - uint32_t registered_enb; - long enb_register_retry_timer_id; - MessageDef *msg_p = NULL; - const char *msg_name = NULL; - instance_t instance; - int result; - - itti_mark_task_ready (TASK_ENB_APP); - - enb_properties_p = enb_config_get(); - - AssertFatal (enb_nb <= enb_properties_p->number, - "Number of eNB is greater than eNB defined in configuration file (%d/%d)!", - enb_nb, enb_properties_p->number); - - - /* Try to register each eNB */ - registered_enb = 0; - register_enb_pending = eNB_app_register (enb_id_start, enb_id_end, enb_properties_p); - - do { - // Wait for a message - itti_receive_msg (TASK_ENB_APP, &msg_p); - - msg_name = ITTI_MSG_NAME (msg_p); - instance = ITTI_MSG_DESTINATION_INSTANCE (msg_p); - - switch (ITTI_MSG_ID(msg_p)) { - case TERMINATE_MESSAGE: - itti_exit_task (); - break; - - case MESSAGE_TEST: - LOG_I(ENB_APP, "Received %s\n", ITTI_MSG_NAME(msg_p)); - break; - - - case S1AP_REGISTER_ENB_CNF: - LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name, - S1AP_REGISTER_ENB_CNF(msg_p).nb_mme); - - DevAssert(register_enb_pending > 0); - register_enb_pending--; - - /* Check if at least eNB is registered with one MME */ - if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) { - registered_enb++; - } - - /* Check if all register eNB requests have been processed */ - if (register_enb_pending == 0) { - if (registered_enb == enb_nb) { - mme_test_s1_start_test(instance); - - - } else { - uint32_t not_associated = enb_nb - registered_enb; - - LOG_W(ENB_APP, " %d eNB %s not associated with a MME, retrying registration in %d seconds ...\n", - not_associated, not_associated > 1 ? "are" : "is", ENB_REGISTER_RETRY_DELAY); - - /* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */ - if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT, - NULL, &enb_register_retry_timer_id) < 0) { - LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n"); - - sleep(ENB_REGISTER_RETRY_DELAY); - /* Restart the registration process */ - registered_enb = 0; - register_enb_pending = eNB_app_register (enb_id_start, enb_id_end, enb_properties_p); - } - } - } - - break; - - case S1AP_DEREGISTERED_ENB_IND: - LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name, - S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme); - - /* TODO handle recovering of registration */ - break; - - case TIMER_HAS_EXPIRED: - LOG_I(ENB_APP, " Received %s: timer_id %d\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id); - - if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) { - /* Restart the registration process */ - registered_enb = 0; - register_enb_pending = eNB_app_register (enb_id_start, enb_id_end, enb_properties_p); - } - - break; - - default: - LOG_E(ENB_APP, "Received unexpected message %s\n", msg_name); - break; - } - - result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - } while (1); - - return NULL; -} - - -//------------------------------------------------------------------------------ -void mme_test_s1_start_test(instance_t instance) -//------------------------------------------------------------------------------ -{ - s1ap_eNB_itti_send_sctp_data_req(instance, - s1c_test.assoc_id, - s1ap_scenarios[s1c_test.scenario_index][s1c_test.tx_next_message_index].buffer, - s1ap_scenarios[s1c_test.scenario_index][s1c_test.tx_next_message_index].buf_len, - s1ap_scenarios[s1c_test.scenario_index][s1c_test.tx_next_message_index].sctp_stream_id); -} - - -//------------------------------------------------------------------------------ -void mme_test_s1_notify_sctp_data_ind(uint32_t assoc_id, int32_t stream, const uint8_t * const data, const uint32_t data_length) -//------------------------------------------------------------------------------ -{ - -} - - -//------------------------------------------------------------------------------ -int main( int argc, char **argv ) -//------------------------------------------------------------------------------ -{ - // initialize the log (see log.h for details) - logInit(); - - get_options (argc, argv); //Command-line options - set_glog(glog_level, glog_verbosity); - log_set_instance_type (LOG_INSTANCE_ENB); - - /* Read eNB configuration file */ - enb_properties = enb_config_init(conf_config_file_name); - - itti_init(TASK_MAX, tasks_info); - - itti_wait_ready(1); - - if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) { - LOG_E(SCTP, "Create task for SCTP failed\n"); - return -1; - } - - if (itti_create_task (TASK_S1AP, s1ap_eNB_task, NULL) < 0) { - LOG_E(S1AP, "Create task for S1AP failed\n"); - return -1; - } - - if (itti_create_task (TASK_ENB_APP, eNB_app_task, NULL) < 0) { - LOG_E(S1AP, "Create task for S1AP failed\n"); - return -1; - } - - itti_wait_ready(0); - - - - sleep(30); - - logClean(); - return 0; -} diff --git a/openair3/TEST/oaisim_mme_test_s1c.h b/openair3/TEST/oaisim_mme_test_s1c.h deleted file mode 100644 index 91e4472caf..0000000000 --- a/openair3/TEST/oaisim_mme_test_s1c.h +++ /dev/null @@ -1,30 +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 - */ - -typedef struct s1c_test_s { - int scenario_index; - int tx_next_message_index; - int rx_next_message_index; - int32_t assoc_id; -}s1c_test_t; - -void mme_test_s1_start_test(instance_t instance); -void mme_test_s1_notify_sctp_data_ind(uint32_t assoc_id, int32_t stream, const uint8_t * const data, const uint32_t data_length); diff --git a/openair3/TEST/oaisim_mme_test_s1c_s1ap.c b/openair3/TEST/oaisim_mme_test_s1c_s1ap.c deleted file mode 100644 index 60da125073..0000000000 --- a/openair3/TEST/oaisim_mme_test_s1c_s1ap.c +++ /dev/null @@ -1,291 +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 - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "tree.h" -#include "queue.h" -#include "intertask_interface.h" -#include "s1ap_eNB_default_values.h" -#include "s1ap_common.h" -#include "s1ap_eNB_defs.h" -#include "s1ap_eNB_management_procedures.h" -#include "assertions.h" - -#include "platform_types.h" -#include "oaisim_mme_test_s1c.h" - - -void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) -{ - int result; - DevAssert(sctp_data_ind != NULL); - mme_test_s1_notify_sctp_data_ind(sctp_data_ind->assoc_id, sctp_data_ind->stream, - sctp_data_ind->buffer, sctp_data_ind->buffer_length); - result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); -} - - -void s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, - uint32_t buffer_length, uint16_t stream) -{ - MessageDef *message_p; - sctp_data_req_t *sctp_data_req; - message_p = itti_alloc_new_message(TASK_S1AP, SCTP_DATA_REQ); - sctp_data_req = &message_p->ittiMsg.sctp_data_req; - sctp_data_req->assoc_id = assoc_id; - sctp_data_req->buffer = buffer; - sctp_data_req->buffer_length = buffer_length; - sctp_data_req->stream = stream; - itti_send_msg_to_task(TASK_SCTP, instance, message_p); -} - -void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown) -{ - if (sctp_shutdown) { - /* A previously connected MME has been shutdown */ - - /* TODO check if it was used by some eNB and send a message to inform these eNB if there is no more associated MME */ - if (mme_desc_p->state == S1AP_ENB_STATE_CONNECTED) { - mme_desc_p->state = S1AP_ENB_STATE_DISCONNECTED; - - if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb > 0) { - /* Decrease associated MME number */ - mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb --; - } - - /* If there are no more associated MME, inform eNB app */ - if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb == 0) { - MessageDef *message_p; - message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DEREGISTERED_ENB_IND); - S1AP_DEREGISTERED_ENB_IND(message_p).nb_mme = 0; - itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p); - } - } - } else { - /* Check that at least one setup message is pending */ - DevCheck(mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0, mme_desc_p->s1ap_eNB_instance->instance, - mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb, 0); - - if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0) { - /* Decrease pending messages number */ - mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb --; - } - - /* If there are no more pending messages, inform eNB app */ - if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb == 0) { - MessageDef *message_p; - message_p = itti_alloc_new_message(TASK_S1AP, S1AP_REGISTER_ENB_CNF); - S1AP_REGISTER_ENB_CNF(message_p).nb_mme = mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb; - itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p); - } - } -} - -void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) -{ - s1ap_eNB_instance_t *instance_p; - s1ap_eNB_mme_data_t *s1ap_mme_data_p; - DevAssert(sctp_new_association_resp != NULL); - instance_p = s1ap_eNB_get_instance(instance); - DevAssert(instance_p != NULL); - s1ap_mme_data_p = s1ap_eNB_get_MME(instance_p, -1, - sctp_new_association_resp->ulp_cnx_id); - DevAssert(s1ap_mme_data_p != NULL); - - if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) { - S1AP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n", - sctp_new_association_resp->sctp_state, - instance, - sctp_new_association_resp->ulp_cnx_id); - s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN); - return; - } - - /* Update parameters */ - s1ap_mme_data_p->assoc_id = sctp_new_association_resp->assoc_id; - s1ap_mme_data_p->in_streams = sctp_new_association_resp->in_streams; - s1ap_mme_data_p->out_streams = sctp_new_association_resp->out_streams; - /* Prepare new S1 Setup Request */ - mme_test_s1_start_test(instance_p, s1ap_mme_data_p); -} - -void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, - net_ip_address_t *mme_ip_address, - net_ip_address_t *local_ip_addr) -{ - MessageDef *message_p = NULL; - sctp_new_association_req_t *sctp_new_association_req_p = NULL; - s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL; - DevAssert(instance_p != NULL); - DevAssert(mme_ip_address != NULL); - message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ); - sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req; - sctp_new_association_req_p->port = S1AP_PORT_NUMBER; - sctp_new_association_req_p->ppid = S1AP_SCTP_PPID; - memcpy(&sctp_new_association_req_p->remote_address, - mme_ip_address, - sizeof(*mme_ip_address)); - memcpy(&sctp_new_association_req_p->local_address, - local_ip_addr, - sizeof(*local_ip_addr)); - /* Create new MME descriptor */ - s1ap_mme_data_p = calloc(1, sizeof(*s1ap_mme_data_p)); - DevAssert(s1ap_mme_data_p != NULL); - s1ap_mme_data_p->cnx_id = s1ap_eNB_fetch_add_global_cnx_id(); - sctp_new_association_req_p->ulp_cnx_id = s1ap_mme_data_p->cnx_id; - s1ap_mme_data_p->assoc_id = -1; - s1ap_mme_data_p->s1ap_eNB_instance = instance_p; - STAILQ_INIT(&s1ap_mme_data_p->served_gummei); - /* Insert the new descriptor in list of known MME - * but not yet associated. - */ - RB_INSERT(s1ap_mme_map, &instance_p->s1ap_mme_head, s1ap_mme_data_p); - s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING; - instance_p->s1ap_mme_nb ++; - instance_p->s1ap_mme_pending_nb ++; - itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p); -} - - - -void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB) -{ - s1ap_eNB_instance_t *new_instance; - uint8_t index; - DevAssert(s1ap_register_eNB != NULL); - /* Look if the provided instance already exists */ - new_instance = s1ap_eNB_get_instance(instance); - - if (new_instance != NULL) { - /* Checks if it is a retry on the same eNB */ - DevCheck(new_instance->eNB_id == s1ap_register_eNB->eNB_id, new_instance->eNB_id, s1ap_register_eNB->eNB_id, 0); - DevCheck(new_instance->cell_type == s1ap_register_eNB->cell_type, new_instance->cell_type, s1ap_register_eNB->cell_type, 0); - DevCheck(new_instance->tac == s1ap_register_eNB->tac, new_instance->tac, s1ap_register_eNB->tac, 0); - DevCheck(new_instance->mcc == s1ap_register_eNB->mcc, new_instance->mcc, s1ap_register_eNB->mcc, 0); - DevCheck(new_instance->mnc == s1ap_register_eNB->mnc, new_instance->mnc, s1ap_register_eNB->mnc, 0); - DevCheck(new_instance->mnc_digit_length == s1ap_register_eNB->mnc_digit_length, new_instance->mnc_digit_length, s1ap_register_eNB->mnc_digit_length, 0); - DevCheck(new_instance->default_drx == s1ap_register_eNB->default_drx, new_instance->default_drx, s1ap_register_eNB->default_drx, 0); - } else { - new_instance = calloc(1, sizeof(s1ap_eNB_instance_t)); - DevAssert(new_instance != NULL); - RB_INIT(&new_instance->s1ap_ue_head); - RB_INIT(&new_instance->s1ap_mme_head); - /* Copy usefull parameters */ - new_instance->instance = instance; - new_instance->eNB_name = s1ap_register_eNB->eNB_name; - new_instance->eNB_id = s1ap_register_eNB->eNB_id; - new_instance->cell_type = s1ap_register_eNB->cell_type; - new_instance->tac = s1ap_register_eNB->tac; - new_instance->mcc = s1ap_register_eNB->mcc; - new_instance->mnc = s1ap_register_eNB->mnc; - new_instance->mnc_digit_length = s1ap_register_eNB->mnc_digit_length; - new_instance->default_drx = s1ap_register_eNB->default_drx; - /* Add the new instance to the list of eNB (meaningfull in virtual mode) */ - s1ap_eNB_insert_new_instance(new_instance); - S1AP_DEBUG("Registered new eNB[%d] and %s eNB id %u\n", - instance, - s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home", - s1ap_register_eNB->eNB_id); - } - - DevCheck(s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, - S1AP_MAX_NB_MME_IP_ADDRESS, s1ap_register_eNB->nb_mme, 0); - - /* Trying to connect to provided list of MME ip address */ - for (index = 0; index < s1ap_register_eNB->nb_mme; index++) { - s1ap_eNB_register_mme(new_instance, &s1ap_register_eNB->mme_ip_address[index], - &s1ap_register_eNB->enb_ip_address); - } -} - - - - -void *s1ap_eNB_task(void *arg) -{ - MessageDef *received_msg = NULL; - int result; - S1AP_DEBUG("Starting S1AP layer\n"); - s1ap_eNB_prepare_internal_data(); - itti_mark_task_ready(TASK_S1AP); - - while (1) { - itti_receive_msg(TASK_S1AP, &received_msg); - - switch (ITTI_MSG_ID(received_msg)) { - case TERMINATE_MESSAGE: - itti_exit_task(); - break; - - case S1AP_REGISTER_ENB_REQ: { - /* Register a new eNB. - * in Virtual mode eNBs will be distinguished using the mod_id/ - * Each eNB has to send an S1AP_REGISTER_ENB message with its - * own parameters. - */ - s1ap_eNB_handle_register_eNB(ITTI_MSG_DESTINATION_INSTANCE(received_msg), - &S1AP_REGISTER_ENB_REQ(received_msg)); - } - break; - - case SCTP_NEW_ASSOCIATION_RESP: { - s1ap_eNB_handle_sctp_association_resp(ITTI_MSG_DESTINATION_INSTANCE(received_msg), - &received_msg->ittiMsg.sctp_new_association_resp); - } - break; - - case SCTP_DATA_IND: { - s1ap_eNB_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind); - } - break; - - default: - S1AP_ERROR("Received unhandled message: %d:%s\n", - ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); - break; - } - - result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - received_msg = NULL; - } - - return NULL; -} diff --git a/openair3/TEST/oaisim_mme_test_s1c_s1ap.h b/openair3/TEST/oaisim_mme_test_s1c_s1ap.h deleted file mode 100644 index 4faec0e66e..0000000000 --- a/openair3/TEST/oaisim_mme_test_s1c_s1ap.h +++ /dev/null @@ -1,60 +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 - */ - -#ifndef __TEST_OAISIM_MME_TEST_S1C_S1AP__H__ -#define __TEST_OAISIM_MME_TEST_S1C_S1AP__H__ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind); - -void s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer, - uint32_t buffer_length, uint16_t stream); - -void s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown); - -void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); - -void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, - net_ip_address_t *mme_ip_address, - net_ip_address_t *local_ip_addr, - uint16_t in_streams, - uint16_t out_streams); -void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); -void *s1ap_eNB_task(void *arg); - -#endif diff --git a/openair3/TEST/oaisim_mme_test_s1c_scenario.c b/openair3/TEST/oaisim_mme_test_s1c_scenario.c deleted file mode 100644 index 60d74866c8..0000000000 --- a/openair3/TEST/oaisim_mme_test_s1c_scenario.c +++ /dev/null @@ -1,279 +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 - */ - -#include -#include -#include -#include - -#include "oaisim_mme_test_s1c_scenario.h" - -int scenario_index = 0; -int scenario_message_index = 0; -int debug = 0; -int error_count = 0; -int break_on_error = 0; - - -extern s1ap_message_test_t s1ap_scenario1[]; - -s1ap_message_test_t s1ap_scenarios[][] = {s1ap_scenario1}; - -/* -1 means invalid */ -static const signed char hex_digits[0x100] = { - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, - -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 -}; - -//------------------------------------------------------------------------------ -void -fail (const char *format, ...) -//------------------------------------------------------------------------------ -{ - char str[1024]; - va_list arg_ptr; - - va_start (arg_ptr, format); - vsnprintf ( str, sizeof(str), format, arg_ptr); - va_end (arg_ptr); - fputs(str, stderr); - error_count++; - - if (break_on_error) - exit (1); -} - -//------------------------------------------------------------------------------ -void -success (const char *format, ...) -//------------------------------------------------------------------------------ -{ - char str[1024]; - va_list arg_ptr; - - va_start (arg_ptr, format); - vsnprintf ( str, sizeof(str), format, arg_ptr); - va_end (arg_ptr); - fputs(str, stderr); -} - -//------------------------------------------------------------------------------ -void -escapeprint (const char *str, size_t len) -//------------------------------------------------------------------------------ -{ - size_t i; - - printf (" (length %d bytes):\n\t", (int) len); - - for (i = 0; i < len; i++) { - if (((str[i] & 0xFF) >= 'A' && (str[i] & 0xFF) <= 'Z') || - ((str[i] & 0xFF) >= 'a' && (str[i] & 0xFF) <= 'z') || - ((str[i] & 0xFF) >= '0' && (str[i] & 0xFF) <= '9') - || (str[i] & 0xFF) == ' ' || (str[i] & 0xFF) == '.') - printf ("%c", (str[i] & 0xFF)); - else - printf ("\\x%02X", (str[i] & 0xFF)); - - if ((i + 1) % 16 == 0 && (i + 1) < len) - printf ("'\n\t'"); - } - - printf ("\n"); -} - -//------------------------------------------------------------------------------ -void -hexprint (const void *_str, size_t len) -//------------------------------------------------------------------------------ -{ - size_t i; - const char* str = _str; - - printf ("\t;; "); - - for (i = 0; i < len; i++) { - printf ("%02x ", (str[i] & 0xFF)); - - if ((i + 1) % 8 == 0) - printf (" "); - - if ((i + 1) % 16 == 0 && i + 1 < len) - printf ("\n\t;; "); - } - - printf ("\n"); -} - -//------------------------------------------------------------------------------ -void -binprint (const void *_str, size_t len) -//------------------------------------------------------------------------------ -{ - size_t i; - const char* str = _str; - - printf ("\t;; "); - - for (i = 0; i < len; i++) { - printf ("%d%d%d%d%d%d%d%d ", - (str[i] & 0xFF) & 0x80 ? 1 : 0, - (str[i] & 0xFF) & 0x40 ? 1 : 0, - (str[i] & 0xFF) & 0x20 ? 1 : 0, - (str[i] & 0xFF) & 0x10 ? 1 : 0, - (str[i] & 0xFF) & 0x08 ? 1 : 0, - (str[i] & 0xFF) & 0x04 ? 1 : 0, - (str[i] & 0xFF) & 0x02 ? 1 : 0, (str[i] & 0xFF) & 0x01 ? 1 : 0); - - if ((i + 1) % 3 == 0) - printf (" "); - - if ((i + 1) % 6 == 0 && i + 1 < len) - printf ("\n\t;; "); - } - - printf ("\n"); -} - -//------------------------------------------------------------------------------ -int -compare_buffer(const uint8_t *buffer, const uint32_t length_buffer, - const uint8_t *pattern, const uint32_t length_pattern) -//------------------------------------------------------------------------------ -{ - int i; - - if (length_buffer != length_pattern) { - printf("Length mismatch, expecting %d bytes, got %d bytes\n", length_pattern, - length_buffer); - hexprint(buffer, length_buffer); - return -1; - } - - for (i = 0; i < length_buffer; i++) { - if (pattern[i] != buffer[i]) { - printf("Expecting:\n"); - hexprint(pattern, length_pattern); - printf("Received:\n"); - hexprint(buffer, length_buffer); - printf("Mismatch fount in byte %d\nExpecting 0x%02x, got 0x%02x\n", - i, pattern[i], buffer[i]); - return -1; - } - } - - return 0; -} - -//------------------------------------------------------------------------------ -unsigned -decode_hex_length(const char *h) -//------------------------------------------------------------------------------ -{ - const unsigned char *hex = (const unsigned char *) h; - unsigned count; - unsigned i; - - for (count = i = 0; hex[i]; i++) { - if (isspace(hex[i])) - continue; - - if (hex_digits[hex[i]] < 0) - abort(); - - count++; - } - - if (count % 2) - abort(); - - return count / 2; -} - -//------------------------------------------------------------------------------ -int -decode_hex(uint8_t *dst, const char *h) -//------------------------------------------------------------------------------ -{ - const unsigned char *hex = (const unsigned char *) h; - unsigned i = 0; - - for (;;) { - int high, low; - - while (*hex && isspace(*hex)) - hex++; - - if (!*hex) - return 1; - - high = hex_digits[*hex++]; - - if (high < 0) - return 0; - - while (*hex && isspace(*hex)) - hex++; - - if (!*hex) - return 0; - - low = hex_digits[*hex++]; - - if (low < 0) - return 0; - - dst[i++] = (high << 4) | low; - } -} - -//------------------------------------------------------------------------------ -uint8_t * -decode_hex_dup(const char *hex) -//------------------------------------------------------------------------------ -{ - uint8_t *p; - unsigned length = decode_hex_length(hex); - - p = malloc(length * sizeof(uint8_t)); - - if (decode_hex(p, hex)) - return p; - else { - free(p); - return NULL; - } -} - diff --git a/openair3/TEST/oaisim_mme_test_s1c_scenario.h b/openair3/TEST/oaisim_mme_test_s1c_scenario.h deleted file mode 100644 index 8b9a8dd54a..0000000000 --- a/openair3/TEST/oaisim_mme_test_s1c_scenario.h +++ /dev/null @@ -1,56 +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 - */ - -#ifndef __TEST_OAISIM_MME_TEST_S1C_SCENARIO__H__ -#define __TEST_OAISIM_MME_TEST_S1C_SCENARIO__H__ - -#include -#include - -#define MME_TEST_S1_MAX_BUF_LENGTH (1024) -#define MME_TEST_S1_MAX_BYTES_TEST (32) - -typedef enum entity_s{ - MME, - ENB -} entity_t; - -typedef struct s1ap_message_test_s{ - char *procedure_name; - uint8_t buffer[MME_TEST_S1_MAX_BUF_LENGTH]; - uint16_t dont_check[MME_TEST_S1_MAX_BYTES_TEST]; // bytes index test that can be omitted - uint32_t buf_len; - entity_t originating; - uint16_t sctp_stream_id; - uint32_t assoc_id; -} s1ap_message_test_t; - -void fail (const char *format, ...); -void success (const char *format, ...); -void escapeprint (const char *str, size_t len); -void hexprint (const void *_str, size_t len); -void binprint (const void *_str, size_t len); -int compare_buffer(const uint8_t *buffer, const uint32_t length_buffer, const uint8_t *pattern, const uint32_t length_pattern); -unsigned decode_hex_length(const char *h); -int decode_hex(uint8_t *dst, const char *h); -uint8_t *decode_hex_dup(const char *hex); - -#endif diff --git a/openair3/TEST/oaisim_mme_test_s1c_scenario1.c b/openair3/TEST/oaisim_mme_test_s1c_scenario1.c deleted file mode 100644 index 87a63b876a..0000000000 --- a/openair3/TEST/oaisim_mme_test_s1c_scenario1.c +++ /dev/null @@ -1,181 +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 - */ - -#include -#include "oaisim_mme_test_s1c_scenario.h" - - -// Description succesfull attach of UE, release UE. - -s1ap_message_test_t s1ap_scenario1[] = { - { - .procedure_name = "id-initialUEMessage", - .buffer = { - 0x00, 0x0C, - 0x00, 0x5C, 0x00, 0x00, 0x05, 0x00, 0x08, 0x00, 0x04, 0x80, 0x06, 0x69, 0x2D, 0x00, 0x1A, 0x00, - 0x32, 0x31, 0x07, 0x41, 0x71, 0x08, 0x29, 0x80, 0x39, 0x00, 0x00, 0x00, 0x00, 0x10, 0x02, 0xE0, - 0xE0, 0x00, 0x20, 0x02, 0x01, 0xD0, 0x11, 0x27, 0x1A, 0x80, 0x80, 0x21, 0x10, 0x01, 0x00, 0x00, - 0x10, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, - 0x00, 0x0A, 0x00, 0x00, 0x43, 0x00, 0x06, 0x00, 0x02, 0xF8, 0x39, 0x00, 0x01, 0x00, 0x64, 0x40, - 0x08, 0x00, 0x02, 0xF8, 0x39, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x86, 0x40, 0x01, 0x30 - }, - .dont_check = { - -1 - }, - .buf_len = 96, - .sctp_stream_id = 1, - .originating = ENB, - }, - { - .procedure_name = "id-downlinkNASTransport, Authentication request", - .buffer = { - 0x00, 0x0B, - 0x00, 0x3D, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0xC0, 0x80, 0x00, 0x15, 0x20, 0x00, 0x08, - 0x00, 0x04, 0x80, 0x06, 0x69, 0x2D, 0x00, 0x1A, 0x00, 0x25, 0x24, 0x07, 0x52, 0x00, 0xD3, 0xB5, - 0xF0, 0x89, 0x68, 0x02, 0x66, 0x5A, 0x08, 0xE6, 0x51, 0xC7, 0x29, 0x6B, 0x4D, 0xA0, 0x10, 0xDD, - 0x04, 0x53, 0xC8, 0x3F, 0x94, 0x80, 0x00, 0x03, 0xAF, 0x2F, 0x49, 0xF3, 0xC8, 0x38, 0x90, 0x00, - 0x00, 0x00 - }, - .dont_check = { - -1 - }, - .buf_len = 65, - .sctp_stream_id = 1, - .originating = MME, - }, - { - .procedure_name = "id-uplinkNASTransport, 0xAuthentication response", - .buffer = { - 0x00, 0x0d, - 0x40, 0x3a, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0xc0, 0x80, 0x00, 0x15, 0x20, 0x00, 0x08, - 0x00, 0x04, 0x80, 0x06, 0x69, 0x2d, 0x00, 0x1a, 0x00, 0x0C, 0x0b, 0x07, 0x53, 0x08, 0x11, 0x82, - 0x98, 0x98, 0x3b, 0xca, 0xF2, 0x97, 0x00, 0x64, 0x40, 0x08, 0x00, 0x02, 0xF8, 0x39, 0x00, 0x00, - 0xe0, 0x00, 0x00, 0x43, 0x40, 0x06, 0x00, 0x02, 0xF8, 0x39, 0x00, 0x01, 0x00, 0x00 - }, - .dont_check = { - -1 - }, - .buf_len = 62, - .sctp_stream_id = 1, - .originating = ENB, - }, - { - .procedure_name = "id-downlinkNASTransport, Security mode command", - .buffer = { - 0x00, 0x0b, - 0x00, 0x26, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0xc0, 0x80, 0x00, 0x15, 0x20, 0x00, 0x08, - 0x00, 0x04, 0x80, 0x06, 0x69, 0x2d, 0x00, 0x1a, 0x00, 0x0e, 0x0d, 0x37, 0xFC, 0xc1, 0xda, 0xd9, - 0x00, 0x07, 0x5d, 0x02, 0x00, 0x02, 0xe0, 0xe0, 0x00, 0x00 - }, - .dont_check = { - -1 - }, - .buf_len = 42, - .sctp_stream_id = 1, - .originating = MME, - }, - { - .procedure_name = "id-uplinkNASTransport, Security mode complete", - .buffer = { - 0x00, 0x0d, - 0x40, 0x37, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0xc0, 0x80, 0x00, 0x15, 0x20, 0x00, 0x08, - 0x00, 0x04, 0x80, 0x06, 0x69, 0x2d, 0x00, 0x1a, 0x00, 0x09, 0x08, 0x47, 0x1d, 0xd0, 0xbb, 0xad, - 0x00, 0x07, 0x5e, 0x00, 0x64, 0x40, 0x08, 0x00, 0x02, 0xF8, 0x39, 0x00, 0x00, 0xe0, 0x00, 0x00, - 0x43, 0x40, 0x06, 0x00, 0x02, 0xF8, 0x39, 0x00, 0x01, 0x00 - }, - .dont_check = { - -1 - }, - .buf_len = 59, - .sctp_stream_id = 1, - .originating = ENB, - }, - { - .procedure_name = "id-InitialContextSetup, InitialContextSetupRequest , Attach accept, Activate default EPS bearer context request", - .buffer = { - 0x00, 0x09, - 0x00, 0x80, 0xba, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0xc0, 0x80, 0x00, 0x15, 0x20, 0x00, - 0x08, 0x00, 0x04, 0x80, 0x06, 0x69, 0x2d, 0x00, 0x42, 0x00, 0x0a, 0x18, 0x05, 0xF5, 0xe1, 0x00, - 0x60, 0x02, 0xFa, 0xF0, 0x80, 0x00, 0x18, 0x00, 0x67, 0x00, 0x00, 0x34, 0x00, 0x62, 0x45, 0x00, - 0x09, 0x04, 0x0f, 0x80, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x53, 0x27, 0x8b, 0xe6, - 0x60, 0xb5, 0x01, 0x07, 0x42, 0x01, 0x4a, 0x06, 0x20, 0x02, 0xF8, 0x39, 0x00, 0x01, 0x00, 0x31, - 0x52, 0x01, 0xc1, 0x01, 0x09, 0x09, 0x03, 0x6f, 0x61, 0x69, 0x04, 0x69, 0x70, 0x76, 0x34, 0x05, - 0x01, 0xc0, 0xbb, 0x00, 0x02, 0x5e, 0x04, 0xFe, 0xFe, 0xde, 0x9e, 0x27, 0x14, 0x80, 0x80, 0x21, - 0x10, 0x03, 0x00, 0x00, 0x10, 0x81, 0x06, 0xc0, 0xa8, 0x0C, 0x64, 0x83, 0x06, 0xc0, 0xa8, 0x6a, - 0x0C, 0x50, 0x0b, 0xF6, 0x02, 0xF8, 0x39, 0x80, 0x00, 0x01, 0x78, 0x00, 0x0C, 0x20, 0x17, 0x2C, - 0x00, 0x6b, 0x00, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x49, 0x00, 0x20, 0xFa, 0x59, 0x15, - 0x4e, 0x32, 0x95, 0x04, 0x2d, 0x35, 0xa4, 0x47, 0xc3, 0x80, 0xab, 0x63, 0xd8, 0xe6, 0x91, 0x83, - 0x6C, 0x9a, 0xF0, 0xed, 0x85, 0x38, 0xa8, 0x27, 0x41, 0x6b, 0x2b, 0x64, 0x86, 0x00 - }, - .dont_check = { - -1 - }, - .buf_len = 191, - .sctp_stream_id = 1, - .originating = MME, - }, - { - .procedure_name = "id-UECapabilityInfoIndication", - .buffer = { - 0x00, 0x16, - 0x40, 0x2C, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0xc0, 0x80, 0x00, 0x15, 0x20, 0x00, 0x08, - 0x00, 0x04, 0x80, 0x06, 0x69, 0x2d, 0x00, 0x4a, 0x40, 0x14, 0x13, 0x81, 0x20, 0x00, 0x03, 0x00, - 0x10, 0x60, 0xe0, 0xc1, 0xF8, 0x3f, 0x07, 0xe0 ,0xfd, 0x78, 0x37, 0x62, 0x00, 0x00 - }, - .dont_check = { - -1 - }, - .buf_len = 48, - .originating = ENB, - }, - { - .procedure_name = "id-InitialContextSetup, InitialContextSetupResponse ", - .buffer = { - 0x20, 0x09, - 0x00, 0x27, 0x00, 0x00, 0x03, 0x00, 0x00, 0x40, 0x05, 0xc0, 0x80, 0x00, 0x15, 0x20, 0x00, 0x08, - 0x40, 0x04, 0x80, 0x06, 0x69, 0x2d, 0x00, 0x33, 0x40, 0x0f, 0x00, 0x00, 0x32, 0x40, 0x0a, 0x0a, - 0x1f, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01 - }, - .dont_check = { - -1 - }, - .buf_len = 64, - .sctp_stream_id = 1, - .originating = ENB, - }, - { - .procedure_name = "id-uplinkNASTransport, Attach complete, Activate default EPS bearer context accept", - .buffer = { - - 0x00, 0x0d, - 0x05, 0x00, 0x00, 0x00, 0x05, 0xc0, 0x80, 0x00, 0x15, 0x20, 0x00, 0x08, 0x00, 0x04, 0x80, 0x06, - 0x69, 0x2d, 0x00, 0x1a, 0x00, 0x0e, 0x0d, 0x27, 0xc7, 0x8f, 0x5a, 0xd2, 0x01, 0x07, 0x43, 0x00, - 0x03, 0x52, 0x00, 0xc2, 0x00, 0x64, 0x40, 0x08, 0x00, 0x02, 0xF8, 0x39, 0x00, 0x00, 0xe0, 0x00, - 0x00, 0x43, 0x40, 0x06, 0x00, 0x02, 0xF8, 0x39, 0x00, 0x01 - }, - .dont_check = { - -1 - }, - .buf_len = 64, - .sctp_stream_id = 1, - .originating = ENB, - } -}; From cf815ffbce3f89ce6c7d3eb0f39a78b6ee6cafb1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 17:54:13 +0100 Subject: [PATCH 615/883] Fix compilation error in ocp-enb --- executables/main-ocp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/executables/main-ocp.c b/executables/main-ocp.c index 04315a4d57..c9388e179d 100644 --- a/executables/main-ocp.c +++ b/executables/main-ocp.c @@ -87,10 +87,10 @@ AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0}; AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]= {0}; void flexran_agent_slice_update(mid_t module_idP) { } -int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) { +int proto_agent_start(mid_t mod_id, const cudu_params_t *p) { return 0; } -void proto_agent_stop(mod_id_t mod_id) { +void proto_agent_stop(mid_t mod_id) { } static void *ru_thread( void *param ); From c6ac88ffa61e99b915af18d425d5c997ddd9abfe Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 17:15:05 +0100 Subject: [PATCH 616/883] Remove deprecated ocp-gnb --- cmake_targets/CMakeLists.txt | 37 -- doc/5Gnas.md | 1 - doc/SW_archi.md | 4 - executables/ocp-gnb.c | 1006 ---------------------------------- 4 files changed, 1048 deletions(-) delete mode 100644 executables/ocp-gnb.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index d3041f9112..9710d3a8ca 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -2852,42 +2852,6 @@ target_link_libraries (nr-softmodem ${T_LIB}) add_dependencies( nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc ) -add_executable(ocp-gnb - ${rrc_h} - ${nr_rrc_h} - ${s1ap_h} -# ${OPENAIR_BIN_DIR}/messages_xml.h - ${OPENAIR_DIR}/executables/ocp-gnb.c - ${OPENAIR_DIR}/executables/softmodem-common.c - ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c - ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - ${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c - ${OPENAIR2_DIR}/RRC/NAS/nas_config.c - ${OPENAIR2_DIR}/RRC/NAS/rb_config.c - ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c - ${OPENAIR_DIR}/common/utils/nr/nr_common.c - ${PHY_INTERFACE_DIR}/queue_t.c - ${XFORMS_SOURCE_NR} - ${T_SOURCE} - ${SHLIB_LOADER_SOURCES} - ${XFORMSINTERFACE_SOURCE} - ) - -target_link_libraries (ocp-gnb - -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB - NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB - X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON - -Wl,--end-group z dl) - -target_link_libraries (ocp-gnb ${LIBXML2_LIBRARIES} ) -target_link_libraries (ocp-gnb pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) -target_link_libraries (ocp-gnb ${LIB_LMS_LIBRARIES}) -target_link_libraries (ocp-gnb ${T_LIB}) -add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif rfsimulator nrscope) - - # nr-uesoftmodem is UE implementation ####################################### @@ -2931,7 +2895,6 @@ add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc ) if (CUDA_FOUND) add_dependencies( nr-uesoftmodem ldpc_cuda) add_dependencies( nr-softmodem ldpc_cuda) - add_dependencies( ocp-gnb ldpc_cuda) endif (CUDA_FOUND) ###################################" # Addexecutables for tests diff --git a/doc/5Gnas.md b/doc/5Gnas.md index 3d33af426c..db0c19f07e 100644 --- a/doc/5Gnas.md +++ b/doc/5Gnas.md @@ -23,7 +23,6 @@ This tuto for 5G gNB NAS design # source files -executables/ocp-gnb.c: a main loop to create a debuggable gNB, see document SW_archi.md openair2/RRC/NR/nr_ngap_gNB.c: skeleton for interface with NGAP openair3/NAS/COMMON/milenage.h: a simple milenage implementation, depend only on crypto library openair3/NAS/COMMON/NR_NAS_defs.h: messages defined for NAS implemented in C: C struct, C enums and automatic conversion to labels for debug messages diff --git a/doc/SW_archi.md b/doc/SW_archi.md index 7648fb2e16..0a53bf3793 100644 --- a/doc/SW_archi.md +++ b/doc/SW_archi.md @@ -85,10 +85,6 @@ end This tuto for 5G gNB design, with Open Cells main {: .text-center} -# Top file: executables/ocp-gnb.c - -the function main() initializes the data from configuration file - # The main thread is in ru_thread() The infinite loop: ## rx_rf() diff --git a/executables/ocp-gnb.c b/executables/ocp-gnb.c deleted file mode 100644 index 23fd3ae132..0000000000 --- a/executables/ocp-gnb.c +++ /dev/null @@ -1,1006 +0,0 @@ -/* - * Author: Laurent Thomas, Open Cells Project - * all rights reserved - */ - -#define _GNU_SOURCE -#include -#include "assertions.h" -#include -#include - -#include "PHY/types.h" - -#include "PHY/INIT/phy_init.h" - -#include "PHY/defs_gNB.h" -#include "SCHED/sched_eNB.h" -#include "SCHED_NR/sched_nr.h" -#include "SCHED_NR/fapi_nr_l1.h" -#include "PHY/LTE_TRANSPORT/transport_proto.h" -#include "../../ARCH/COMMON/common_lib.h" - -#include "PHY/phy_extern.h" -#include "LAYER2/MAC/mac.h" -#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h" -#include "LAYER2/MAC/mac_proto.h" -#include "RRC/LTE/rrc_extern.h" -#include "PHY_INTERFACE/phy_interface.h" -#include "common/utils/LOG/log_extern.h" -#include "UTIL/OTG/otg_tx.h" -#include "UTIL/OTG/otg_externs.h" -#include "UTIL/MATH/oml.h" -#include "common/utils/LOG/vcd_signal_dumper.h" -#include "UTIL/OPT/opt.h" -#include "enb_config.h" -#include "s1ap_eNB.h" -#include "SIMULATION/ETH_TRANSPORT/proto.h" -#include -#include -#include -#include -#include -#include -#include -#include - -// should be in a shared lib -#include -#include -#include -#include - -// Global vars -#include -#include -#include -#include -volatile int oai_exit; -int single_thread_flag=1; -uint32_t do_forms=0; -unsigned int mmapped_dma=0; -int8_t threequarter_fs=0; - -int chain_offset=0; -uint16_t sl_ahead=6; -uint16_t sf_ahead=6; -uint32_t timing_advance = 0; -int transmission_mode=1; -int emulate_rf = 0; -int numerology = 0; - - -int config_sync_var=-1; -pthread_mutex_t nfapi_sync_mutex; -pthread_cond_t nfapi_sync_cond; -int nfapi_sync_var=-1; -double cpuf; - -THREAD_STRUCT thread_struct; - -pthread_cond_t sync_cond; -pthread_mutex_t sync_mutex; -int sync_var=-1; //!< protected by mutex \ref sync_mutex. - - -uint64_t downlink_frequency[MAX_NUM_CCs][4]; -int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; -time_stats_t softmodem_stats_mt; // main thread -time_stats_t softmodem_stats_hw; // hw acquisition -time_stats_t softmodem_stats_rxtx_sf; // total tx time -time_stats_t nfapi_meas; // total tx time -time_stats_t softmodem_stats_rx_sf; // total rx time -// not used but needed for link -openair0_config_t openair0_cfg[MAX_CARDS]; -uint16_t slot_ahead=6; -AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]; -AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; -int flexran_agent_start(mid_t mod_id) { - memset (agent_rrc_xface, 0, sizeof(agent_rrc_xface)); - memset (agent_mac_xface, 0, sizeof(agent_mac_xface)); - return 0; -} -void flexran_agent_slice_update(mid_t module_idP) { -} -int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) { - return 0; -} -void proto_agent_stop(mod_id_t mod_id) { -} -int split73=0; -void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) { - AssertFatal(false, "Must not be called in this context\n"); -} -int stop_L1L2(module_id_t gnb_id) { - AssertFatal(false, "Must not be called in this context\n"); -} -int restart_L1L2(module_id_t gnb_id) { - AssertFatal(false, "Must not be called in this context\n"); -} - -static int wait_for_sync = 0; -static double snr_dB=20; -static int DEFBANDS[] = {7}; -static int DEFENBS[] = {0}; -static int DEFBFW[] = {0x00007fff}; - -extern double cpuf; - -short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,16384,16384,-16384,-16384,16384,16384,16384,-16384,-16384,16384,-16384,-16384,7327,7327,7327,21981,21981,7327,21981,21981,7327,-7327,7327,-21981,21981,-7327,21981,-21981,-7327,7327,-7327,21981,-21981,7327,-21981,21981,-7327,-7327,-7327,-21981,-21981,-7327,-21981,-21981,10726,10726,10726,3576,3576,10726,3576,3576,10726,17876,10726,25027,3576,17876,3576,25027,17876,10726,17876,3576,25027,10726,25027,3576,17876,17876,17876,25027,25027,17876,25027,25027,10726,-10726,10726,-3576,3576,-10726,3576,-3576,10726,-17876,10726,-25027,3576,-17876,3576,-25027,17876,-10726,17876,-3576,25027,-10726,25027,-3576,17876,-17876,17876,-25027,25027,-17876,25027,-25027,-10726,10726,-10726,3576,-3576,10726,-3576,3576,-10726,17876,-10726,25027,-3576,17876,-3576,25027,-17876,10726,-17876,3576,-25027,10726,-25027,3576,-17876,17876,-17876,25027,-25027,17876,-25027,25027,-10726,-10726,-10726,-3576,-3576,-10726,-3576,-3576,-10726,-17876,-10726,-25027,-3576,-17876,-3576,-25027,-17876,-10726,-17876,-3576,-25027,-10726,-25027,-3576,-17876,-17876,-17876,-25027,-25027,-17876,-25027,-25027,8886,8886,8886,12439,12439,8886,12439,12439,8886,5332,8886,1778,12439,5332,12439,1778,5332,8886,5332,12439,1778,8886,1778,12439,5332,5332,5332,1778,1778,5332,1778,1778,8886,19547,8886,15993,12439,19547,12439,15993,8886,23101,8886,26655,12439,23101,12439,26655,5332,19547,5332,15993,1778,19547,1778,15993,5332,23101,5332,26655,1778,23101,1778,26655,19547,8886,19547,12439,15993,8886,15993,12439,19547,5332,19547,1778,15993,5332,15993,1778,23101,8886,23101,12439,26655,8886,26655,12439,23101,5332,23101,1778,26655,5332,26655,1778,19547,19547,19547,15993,15993,19547,15993,15993,19547,23101,19547,26655,15993,23101,15993,26655,23101,19547,23101,15993,26655,19547,26655,15993,23101,23101,23101,26655,26655,23101,26655,26655,8886,-8886,8886,-12439,12439,-8886,12439,-12439,8886,-5332,8886,-1778,12439,-5332,12439,-1778,5332,-8886,5332,-12439,1778,-8886,1778,-12439,5332,-5332,5332,-1778,1778,-5332,1778,-1778,8886,-19547,8886,-15993,12439,-19547,12439,-15993,8886,-23101,8886,-26655,12439,-23101,12439,-26655,5332,-19547,5332,-15993,1778,-19547,1778,-15993,5332,-23101,5332,-26655,1778,-23101,1778,-26655,19547,-8886,19547,-12439,15993,-8886,15993,-12439,19547,-5332,19547,-1778,15993,-5332,15993,-1778,23101,-8886,23101,-12439,26655,-8886,26655,-12439,23101,-5332,23101,-1778,26655,-5332,26655,-1778,19547,-19547,19547,-15993,15993,-19547,15993,-15993,19547,-23101,19547,-26655,15993,-23101,15993,-26655,23101,-19547,23101,-15993,26655,-19547,26655,-15993,23101,-23101,23101,-26655,26655,-23101,26655,-26655,-8886,8886,-8886,12439,-12439,8886,-12439,12439,-8886,5332,-8886,1778,-12439,5332,-12439,1778,-5332,8886,-5332,12439,-1778,8886,-1778,12439,-5332,5332,-5332,1778,-1778,5332,-1778,1778,-8886,19547,-8886,15993,-12439,19547,-12439,15993,-8886,23101,-8886,26655,-12439,23101,-12439,26655,-5332,19547,-5332,15993,-1778,19547,-1778,15993,-5332,23101,-5332,26655,-1778,23101,-1778,26655,-19547,8886,-19547,12439,-15993,8886,-15993,12439,-19547,5332,-19547,1778,-15993,5332,-15993,1778,-23101,8886,-23101,12439,-26655,8886,-26655,12439,-23101,5332,-23101,1778,-26655,5332,-26655,1778,-19547,19547,-19547,15993,-15993,19547,-15993,15993,-19547,23101,-19547,26655,-15993,23101,-15993,26655,-23101,19547,-23101,15993,-26655,19547,-26655,15993,-23101,23101,-23101,26655,-26655,23101,-26655,26655,-8886,-8886,-8886,-12439,-12439,-8886,-12439,-12439,-8886,-5332,-8886,-1778,-12439,-5332,-12439,-1778,-5332,-8886,-5332,-12439,-1778,-8886,-1778,-12439,-5332,-5332,-5332,-1778,-1778,-5332,-1778,-1778,-8886,-19547,-8886,-15993,-12439,-19547,-12439,-15993,-8886,-23101,-8886,-26655,-12439,-23101,-12439,-26655,-5332,-19547,-5332,-15993,-1778,-19547,-1778,-15993,-5332,-23101,-5332,-26655,-1778,-23101,-1778,-26655,-19547,-8886,-19547,-12439,-15993,-8886,-15993,-12439,-19547,-5332,-19547,-1778,-15993,-5332,-15993,-1778,-23101,-8886,-23101,-12439,-26655,-8886,-26655,-12439,-23101,-5332,-23101,-1778,-26655,-5332,-26655,-1778,-19547,-19547,-19547,-15993,-15993,-19547,-15993,-15993,-19547,-23101,-19547,-26655,-15993,-23101,-15993,-26655,-23101,-19547,-23101,-15993,-26655,-19547,-26655,-15993,-23101,-23101,-23101,-26655,-26655,-23101,-26655,-26655}; - -static inline int ocp_rxtx(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc) { - nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; - start_meas(&softmodem_stats_rxtx_sf); - - // ******************************************************************* - - if (nfapi_mode == NFAPI_MODE_PNF) { - // I am a PNF and I need to let nFAPI know that we have a (sub)frame tick - //add_subframe(&frame, &subframe, 4); - //oai_subframe_ind(proc->frame_tx, proc->subframe_tx); - //LOG_D(PHY, "oai_subframe_ind(frame:%u, subframe:%d) - NOT CALLED ********\n", frame, subframe); - start_meas(&nfapi_meas); - oai_subframe_ind(proc->frame_rx, proc->slot_rx); - stop_meas(&nfapi_meas); - /*if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus|| - gNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs || - gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs || - gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles || - gNB->UL_INFO.cqi_ind.number_of_cqis - ) { - LOG_D(PHY, "UL_info[rx_ind:%05d:%d harqs:%05d:%d crcs:%05d:%d preambles:%05d:%d cqis:%d] RX:%04d%d TX:%04d%d \n", - NFAPI_SFNSF2DEC(gNB->UL_INFO.rx_ind.sfn_sf), gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus, - NFAPI_SFNSF2DEC(gNB->UL_INFO.harq_ind.sfn_sf), gNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs, - NFAPI_SFNSF2DEC(gNB->UL_INFO.crc_ind.sfn_sf), gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, - NFAPI_SFNSF2DEC(gNB->UL_INFO.rach_ind.sfn_sf), gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles, - gNB->UL_INFO.cqi_ind.number_of_cqis, - frame_rx, slot_rx, - frame_tx, slot_tx); - }*/ - } - - /// NR disabling - // **************************************** - // Common RX procedures subframe n - pthread_mutex_lock(&gNB->UL_INFO_mutex); - gNB->UL_INFO.frame = proc->frame_rx; - gNB->UL_INFO.slot = proc->slot_rx; - gNB->UL_INFO.module_id = gNB->Mod_id; - gNB->UL_INFO.CC_id = gNB->CC_id; - gNB->if_inst->NR_UL_indication(&gNB->UL_INFO); - pthread_mutex_unlock(&gNB->UL_INFO_mutex); - // RX processing - int tx_slot_type = nr_slot_select(cfg,proc->frame_tx,proc->slot_tx); - int rx_slot_type = nr_slot_select(cfg,proc->frame_rx,proc->slot_rx); - - if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) { - // Do PRACH RU processing - L1_nr_prach_procedures(gNB,proc->frame_rx,proc->slot_rx); - phy_procedures_gNB_uespec_RX(gNB, proc->frame_rx, proc->slot_rx); - } - - if (oai_exit) return(-1); - - // ***************************************** - // TX processing for subframe n+sf_ahead - // run PHY TX procedures the one after the other for all CCs to avoid race conditions - // (may be relaxed in the future for performance reasons) - // ***************************************** - - if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) { - phy_procedures_gNB_TX(gNB, proc->frame_tx,proc->slot_tx, 1); - } - - stop_meas( &softmodem_stats_rxtx_sf ); - LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, proc->frame_rx, proc->slot_rx, proc->frame_tx, proc->slot_tx); - return(0); -} - - -static void *process_stats_thread(void *param) { - PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param; - reset_meas(&gNB->dlsch_encoding_stats); - reset_meas(&gNB->dlsch_scrambling_stats); - reset_meas(&gNB->dlsch_modulation_stats); - - while(!oai_exit) { - sleep(1); - print_meas(&gNB->dlsch_encoding_stats, "pdsch_encoding", NULL, NULL); - print_meas(&gNB->dlsch_scrambling_stats, "pdsch_scrambling", NULL, NULL); - print_meas(&gNB->dlsch_modulation_stats, "pdsch_modulation", NULL, NULL); - } - - return(NULL); -} - -void init_gNB_proc(int inst) { - PHY_VARS_gNB *gNB = RC.gNB[inst]; - gNB_L1_proc_t *proc = &gNB->proc; - gNB_L1_rxtx_proc_t *L1_proc = &proc->L1_proc; - gNB_L1_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx; - L1_proc->instance_cnt = -1; - L1_proc_tx->instance_cnt = -1; - L1_proc->instance_cnt_RUs = 0; - L1_proc_tx->instance_cnt_RUs = 0; - proc->instance_cnt_prach = -1; - proc->instance_cnt_asynch_rxtx = -1; - proc->CC_id = 0; - proc->first_rx =1; - proc->first_tx =1; - proc->RU_mask =0; - proc->RU_mask_tx = (1<num_RU)-1; - proc->RU_mask_prach =0; - pthread_mutex_init( &gNB->UL_INFO_mutex, NULL); - gNB->threadPool = (tpool_t *)malloc(sizeof(tpool_t)); - gNB->respDecode = (notifiedFIFO_t *) malloc(sizeof(notifiedFIFO_t)); - char ul_pool[] = "-1,-1"; - initTpool(ul_pool, gNB->threadPool, false); - initNotifiedFIFO(gNB->respDecode); -} - -/// eNB kept in function name for nffapi calls, TO FIX -void init_gNB_phase2(RU_t *ru) { - int inst; - LOG_I(PHY,"%s() RC.nb_nr_inst:%d\n", __FUNCTION__, RC.nb_nr_inst); - - for (inst=0; instnum_RU:%d\n", gNB->num_RU); - phy_init_nr_gNB(gNB,0,0); - RC.gNB[inst]->num_RU=1; - RC.gNB[inst]->RU_list[0]=ru; - //init_precoding_weights(RC.gNB[inst][CC_id]); - } -} - -void init_gNB(int single_thread_flag,int wait_for_sync) { - for (int inst=0; instRCconfig_NR_L1\n"); - PHY_VARS_gNB *gNB= RC.gNB[inst]; - gNB->abstraction_flag = false; - gNB->single_thread_flag = true; - /*nr_polar_init(&gNB->nrPolar_params, - NR_POLAR_PBCH_MESSAGE_TYPE, - NR_POLAR_PBCH_PAYLOAD_BITS, - NR_POLAR_PBCH_AGGREGATION_LEVEL);*/ - LOG_I(PHY,"Registering with MAC interface module\n"); - AssertFatal((gNB->if_inst = NR_IF_Module_init(inst))!=NULL,"Cannot register interface"); - gNB->if_inst->NR_Schedule_response = nr_schedule_response; - gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; - memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO)); - memset((void *)&gNB->UL_tti_req,0,sizeof(nfapi_nr_ul_tti_request_t)); - //memset((void *)&gNB->Sched_INFO,0,sizeof(gNB->Sched_INFO)); - LOG_I(PHY,"Setting indication lists\n"); - gNB->UL_INFO.rx_ind.pdu_list = gNB->rx_pdu_list; - gNB->UL_INFO.crc_ind.crc_list = gNB->crc_pdu_list; - /*gNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = gNB->sr_pdu_list; - gNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = gNB->harq_pdu_list; - gNB->UL_INFO.cqi_ind.cqi_pdu_list = gNB->cqi_pdu_list; - gNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = gNB->cqi_raw_pdu_list;*/ - gNB->prach_energy_counter = 0; - } - - LOG_I(PHY,"[nr-softmodem.c] gNB structure allocated\n"); -} - - -void stop_gNB(int nb_inst) { -} - -static void get_options(void) { - paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ; - config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); - - if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) { - memset((void *)&RC,0,sizeof(RC)); - /* Read RC configuration file */ - NRRCConfig(); - printf("Configuration: nb_rrc_inst %d, nb_nr_L1_inst %d, nb_ru %hhd\n", RC.nb_nr_inst,RC.nb_nr_L1_inst,RC.nb_RU); - } - - AssertFatal(RC.nb_nr_L1_inst == 1 && RC.nb_RU == 1, "Only one gNB, one RU and one carrier is supported\n"); -} - -void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], - NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { - for (int CC_id=0; CC_idsubframe_config.numerology_index_mu.value =1; - config[CC_id]->subframe_config.duplex_mode.value = 1; //FDD - config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL - config[CC_id]->rf_config.dl_carrier_bandwidth.value = 106; - config[CC_id]->rf_config.ul_carrier_bandwidth.value = 106; - config[CC_id]->sch_config.physical_cell_id.value = 0; - } -} - -static void init_pdcp(void) { - //if (!NODE_IS_DU(RC.rrc[0]->node_type)) { - pdcp_layer_init(); - uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? - (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; - - if (IS_SOFTMODEM_NOS1) { - printf("IS_SOFTMODEM_NOS1 option enabled \n"); - pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ; - } - - nr_pdcp_module_init(pdcp_initmask, 0); - pdcp_set_rlc_data_req_func(rlc_data_req); - pdcp_set_pdcp_data_ind_func(pdcp_data_ind); -} - -void init_main_gNB(void) { - RCconfig_NR_L1(); - RCconfig_nr_macrlc(); - - if (RC.nb_nr_L1_inst>0) - AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n"); - - LOG_I(GNB_APP,"Allocating gNB_RRC_INST for %d instances\n",RC.nb_nr_inst); - RC.nrrrc = (gNB_RRC_INST **)calloc(RC.nb_nr_inst*sizeof(gNB_RRC_INST *),1); - LOG_I(PHY, "%s() RC.nb_nr_inst:%d RC.nrrrc:%p\n", __FUNCTION__, RC.nb_nr_inst, RC.nrrrc); - int gnb_id=0; // only 1 gnb per process, index 0 for now - RC.nrrrc[gnb_id] = (gNB_RRC_INST *)calloc(sizeof(gNB_RRC_INST),1); - MessageDef *msg_p = itti_alloc_new_message (TASK_GNB_APP, 0, NRRRC_CONFIGURATION_REQ); - RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]); - openair_rrc_gNB_configuration(GNB_INSTANCE_TO_MODULE_ID(ITTI_MSG_DESTINATION_INSTANCE(msg_p)), &NRRRC_CONFIGURATION_REQ(msg_p)); - //AssertFatal(itti_create_task(TASK_GNB_APP, gNB_app_task, NULL) >= 0, ""); - AssertFatal(itti_create_task(TASK_RRC_GNB, rrc_gnb_task, NULL) >= 0, ""); - //AssertFatal(itti_create_task(TASK_X2AP, x2ap_task, NULL) >= 0, ""); -} - -static void wait_nfapi_init(char *thread_name) { - printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name); - pthread_mutex_lock( &nfapi_sync_mutex ); - - while (nfapi_sync_var<0) - pthread_cond_wait( &nfapi_sync_cond, &nfapi_sync_mutex ); - - pthread_mutex_unlock(&nfapi_sync_mutex); - printf( "NFAPI: got sync (%s)\n", thread_name); -} - -void exit_function(const char *file, const char *function, const int line, const char *s) { - if (s != NULL) { - printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s); - } - - oai_exit = 1; - sleep(1); //allow lte-softmodem threads to exit first - exit(1); -} - -void stop_RU(int nb_ru) { - return; -} - -void OCPconfig_RU(RU_t *ru) { - int i = 0, j = 0; // Ru and gNB cardinality - paramdef_t RUParams[] = RUPARAMS_DESC; - paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; - config_getlist( &RUParamList, RUParams, sizeof(RUParams)/sizeof(paramdef_t), NULL); - AssertFatal( RUParamList.numelt == 1 && RC.nb_nr_L1_inst ==1,"" ); - ru->idx=0; - ru->nr_frame_parms = (NR_DL_FRAME_PARMS *)calloc(sizeof(NR_DL_FRAME_PARMS),1); - ru->frame_parms = (LTE_DL_FRAME_PARMS *)calloc(sizeof(LTE_DL_FRAME_PARMS),1); - ru->if_timing = synch_to_ext_device; - ru->num_gNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt; - ru->gNB_list[i] = &RC.gNB[RUParamList.paramarray[j][RU_ENB_LIST_IDX].iptr[i]][0]; - - if (config_isparamset(RUParamList.paramarray[j], RU_SDR_ADDRS)) { - ru->openair0_cfg.sdr_addrs = strdup(*(RUParamList.paramarray[j][RU_SDR_ADDRS].strptr)); - } - - if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) { - if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) { - ru->openair0_cfg.clock_source = internal; - LOG_D(PHY, "RU clock source set as internal\n"); - } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "external") == 0) { - ru->openair0_cfg.clock_source = external; - LOG_D(PHY, "RU clock source set as external\n"); - } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "gpsdo") == 0) { - ru->openair0_cfg.clock_source = gpsdo; - LOG_D(PHY, "RU clock source set as gpsdo\n"); - } else { - LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr)); - } - } else { - ru->openair0_cfg.clock_source = unset; - } - - if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) { - if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) { - ru->if_south = REMOTE_IF5; //TBD: max value to avoid to call "ru" functions - ru->function = gNodeB_3GPP; - printf("Setting function for RU %d to gNodeB_3GPP\n",j); - } else { - } - - ru->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; - ru->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); - ru->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; - - for (i=0; inum_bands; i++) ru->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; - } //strcmp(local_rf, "yes") == 0 - else { - } - - ru->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr); - ru->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr); - ru->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); - ru->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); - - if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) { - ru->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt; - - for (i=0; inum_gNB; i++) { - ru->bw_list[i] = (int32_t *)malloc16_clear((ru->nb_bfw)*sizeof(int32_t)); - - for (int b=0; bnb_bfw; b++) ru->bw_list[i][b] = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].iptr[b]; - } - } - - return; -} - -// this is for RU with local RF unit -void fill_rf_config(RU_t *ru, char *rf_config_file) { - int i; - NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; - nfapi_nr_config_request_scf_t *gNB_config = &ru->gNB_list[0]->gNB_config; //tmp index - openair0_config_t *cfg = &ru->openair0_cfg; - int mu = gNB_config->ssb_config.scs_common.value; - int N_RB = gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value; - fp->threequarter_fs=threequarter_fs; - - if (mu == NR_MU_0) { //or if LTE - if(N_RB == 100) { - if (fp->threequarter_fs) { - cfg->sample_rate=23.04e6; - cfg->samples_per_frame = 230400; - cfg->tx_bw = 10e6; - cfg->rx_bw = 10e6; - } else { - cfg->sample_rate=30.72e6; - cfg->samples_per_frame = 307200; - cfg->tx_bw = 10e6; - cfg->rx_bw = 10e6; - } - } else if(N_RB == 50) { - cfg->sample_rate=15.36e6; - cfg->samples_per_frame = 153600; - cfg->tx_bw = 5e6; - cfg->rx_bw = 5e6; - } else if (N_RB == 25) { - cfg->sample_rate=7.68e6; - cfg->samples_per_frame = 76800; - cfg->tx_bw = 2.5e6; - cfg->rx_bw = 2.5e6; - } else if (N_RB == 6) { - cfg->sample_rate=1.92e6; - cfg->samples_per_frame = 19200; - cfg->tx_bw = 1.5e6; - cfg->rx_bw = 1.5e6; - } else AssertFatal(1==0,"Unknown N_RB %d\n",N_RB); - } else if (mu == NR_MU_1) { - if(N_RB == 273) { - if (fp->threequarter_fs) { - AssertFatal(0 == 1,"three quarter sampling not supported for N_RB 273\n"); - } else { - cfg->sample_rate=122.88e6; - cfg->samples_per_frame = 1228800; - cfg->tx_bw = 100e6; - cfg->rx_bw = 100e6; - } - } else if(N_RB == 217) { - if (fp->threequarter_fs) { - cfg->sample_rate=92.16e6; - cfg->samples_per_frame = 921600; - cfg->tx_bw = 80e6; - cfg->rx_bw = 80e6; - } else { - cfg->sample_rate=122.88e6; - cfg->samples_per_frame = 1228800; - cfg->tx_bw = 80e6; - cfg->rx_bw = 80e6; - } - } else if(N_RB == 106) { - if (fp->threequarter_fs) { - cfg->sample_rate=46.08e6; - cfg->samples_per_frame = 460800; - cfg->tx_bw = 40e6; - cfg->rx_bw = 40e6; - } else { - cfg->sample_rate=61.44e6; - cfg->samples_per_frame = 614400; - cfg->tx_bw = 40e6; - cfg->rx_bw = 40e6; - } - } else { - AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu); - } - } else if (mu == NR_MU_3) { - if (N_RB == 66) { - cfg->sample_rate = 122.88e6; - cfg->samples_per_frame = 1228800; - cfg->tx_bw = 100e6; - cfg->rx_bw = 100e6; - } else if(N_RB == 32) { - cfg->sample_rate=61.44e6; - cfg->samples_per_frame = 614400; - cfg->tx_bw = 50e6; - cfg->rx_bw = 50e6; - } - } else { - AssertFatal(0 == 1,"Numerology %d not supported for the moment\n",mu); - } - - if (gNB_config->cell_config.frame_duplex_type.value==TDD) - cfg->duplex_mode = duplex_mode_TDD; - else //FDD - cfg->duplex_mode = duplex_mode_FDD; - - cfg->Mod_id = 0; - cfg->num_rb_dl=N_RB; - cfg->tx_num_channels=ru->nb_tx; - cfg->rx_num_channels=ru->nb_rx; - - for (i=0; inb_tx; i++) { - if (ru->if_frequency == 0) { - cfg->tx_freq[i] = (double)fp->dl_CarrierFreq; - cfg->rx_freq[i] = (double)fp->ul_CarrierFreq; - } else { - cfg->tx_freq[i] = (double)ru->if_frequency; - cfg->rx_freq[i] = (double)(ru->if_frequency+fp->ul_CarrierFreq-fp->dl_CarrierFreq); - } - - cfg->tx_gain[i] = ru->att_tx; - cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx; - cfg->configFilename = rf_config_file; - printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n", - i, cfg->tx_gain[i], - cfg->rx_gain[i], - cfg->tx_freq[i], - cfg->rx_freq[i]); - } -} - -/* this function maps the RU tx and rx buffers to the available rf chains. - Each rf chain is is addressed by the card number and the chain on the card. The - rf_map specifies for each antenna port, on which rf chain the mapping should start. Multiple - antennas are mapped to successive RF chains on the same card. */ -int setup_RU_buffers(RU_t *ru) { - int i,j; - int card,ant; - //uint16_t N_TA_offset = 0; - NR_DL_FRAME_PARMS *frame_parms; - nfapi_nr_config_request_scf_t *config = &ru->config; - - if (ru) { - frame_parms = ru->nr_frame_parms; - printf("setup_RU_buffers: frame_parms = %p\n",frame_parms); - } else { - printf("ru pointer is NULL\n"); - return(-1); - } - - int mu = config->ssb_config.scs_common.value; - int N_RB = config->carrier_config.dl_grid_size[config->ssb_config.scs_common.value].value; - - if (config->cell_config.frame_duplex_type.value == TDD) { - int N_TA_offset = config->carrier_config.uplink_frequency.value < 6000000 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2 - double factor=1; - - switch (mu) { - case 0: //15 kHz scs - AssertFatal(N_TA_offset == 400,"scs_common 15kHz only for FR1\n"); - - if (N_RB <= 25) factor = .25; // 7.68 Ms/s - else if (N_RB <=50) factor = .5; // 15.36 Ms/s - else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s - else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s - else AssertFatal(1==0,"Too many PRBS for mu=0\n"); - - break; - - case 1: //30 kHz sc - AssertFatal(N_TA_offset == 400,"scs_common 30kHz only for FR1\n"); - - if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s - else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s - - break; - - case 2: //60 kHz scs - AssertFatal(1==0,"scs_common should not be 60 kHz\n"); - break; - - case 3: //120 kHz scs - AssertFatal(N_TA_offset == 431,"scs_common 120kHz only for FR2\n"); - break; - - case 4: //240 kHz scs - AssertFatal(1==0,"scs_common should not be 60 kHz\n"); - - if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s - else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s - else AssertFatal(1==0,"N_RB %d is too big for curretn FR2 implementation\n",N_RB); - - break; - - if (N_RB == 100) ru->N_TA_offset = 624; - else if (N_RB == 50) ru->N_TA_offset = 624/2; - else if (N_RB == 25) ru->N_TA_offset = 624/4; - } - - if (frame_parms->threequarter_fs == 1) factor = factor*.75; - - ru->N_TA_offset = (int)(N_TA_offset * factor); - LOG_I(PHY,"RU %d Setting N_TA_offset to %d samples (factor %f, UL Freq %d, N_RB %d)\n",ru->idx,ru->N_TA_offset,factor, - config->carrier_config.uplink_frequency.value, N_RB); - } else ru->N_TA_offset = 0; - - if (ru->openair0_cfg.mmapped_dma == 1) { - // replace RX signal buffers with mmaped HW versions - for (i=0; inb_rx; i++) { - card = i/4; - ant = i%4; - printf("Mapping RU id %u, rx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant); - free(ru->common.rxdata[i]); - ru->common.rxdata[i] = ru->openair0_cfg.rxbase[ru->rf_map.chain+ant]; - printf("rxdata[%d] @ %p\n",i,ru->common.rxdata[i]); - - for (j=0; j<16; j++) { - printf("rxbuffer %d: %x\n",j,ru->common.rxdata[i][j]); - ru->common.rxdata[i][j] = 16-j; - } - } - - for (i=0; inb_tx; i++) { - card = i/4; - ant = i%4; - printf("Mapping RU id %u, tx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant); - free(ru->common.txdata[i]); - ru->common.txdata[i] = ru->openair0_cfg.txbase[ru->rf_map.chain+ant]; - printf("txdata[%d] @ %p\n",i,ru->common.txdata[i]); - - for (j=0; j<16; j++) { - printf("txbuffer %d: %x\n",j,ru->common.txdata[i][j]); - ru->common.txdata[i][j] = 16-j; - } - } - } else { // not memory-mapped DMA - //nothing to do, everything already allocated in lte_init - } - - return(0); -} -int rx_rf(int rxBufOffet, int nbSamples, int nb_rx, int32_t **rxdata, openair0_device *rfdevice, openair0_timestamp *HWtimeStamp) { - void *rxp[nb_rx]; - - for (int i=0; itrx_read_func(rfdevice, - HWtimeStamp, - rxp, - nbSamples, - nb_rx); - - if (rxs != nbSamples ) - LOG_E(PHY, "rx_rf: Asked for %d samples, got %d from USRP\n",nbSamples,rxs); - - return rxs; -} - -void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { - RU_proc_t *proc = &ru->proc; - NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; - nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config; - int i,txsymb; - int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame); - int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame); - int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame); - int sf_extension = 0; //sf_extension = ru->sf_extension; - int siglen=fp->get_samples_per_slot(slot,fp); - int flags=1; - - //nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame); - if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT || IS_SOFTMODEM_RFSIM) { - if(slot_type == NR_MIXED_SLOT) { - txsymb = 0; - - for(int symbol_count =0; symbol_counttdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==0) - txsymb++; - } - - AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb); - - if(slot%(fp->slots_per_subframe/2)) - siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples); - else - siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples); - - //+ ru->end_of_burst_delay; - flags=3; // end of burst - } - - if (cfg->cell_config.frame_duplex_type.value == TDD && - slot_type == NR_DOWNLINK_SLOT && - prevslot_type == NR_UPLINK_SLOT) { - flags = 2; // start of burst - } - - if (cfg->cell_config.frame_duplex_type.value == TDD && - slot_type == NR_DOWNLINK_SLOT && - nextslot_type == NR_UPLINK_SLOT) { - flags = 3; // end of burst - } - - if (fp->freq_range==nr_FR2) { - // the beam index is written in bits 8-10 of the flags - // bit 11 enables the gpio programming - int beam=0; - - if (slot==0) beam = 11; //3 for boresight & 8 to enable - - /* - if (slot==0 || slot==40) beam=0&8; - if (slot==10 || slot==50) beam=1&8; - if (slot==20 || slot==60) beam=2&8; - if (slot==30 || slot==70) beam=3&8; - */ - flags |= beam<<8; - } - - void *txp[ru->nb_tx]; - - for (i=0; inb_tx; i++) - txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)-sf_extension]; - - // prepare tx buffer pointers - unsigned int txs = ru->rfdevice.trx_write_func(&ru->rfdevice, - timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension, - txp, - siglen+sf_extension, - ru->nb_tx, - flags); - LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %d\n",ru->idx, - (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot); - AssertFatal(txs == siglen+sf_extension,"TX : Timeout (sent %u/%d)\n", txs, siglen); - } -} - -static void *ru_thread( void *param ) { - RU_t *ru = (RU_t *)param; - NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; - LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]); - nr_dump_frame_parms(fp); - AssertFatal(openair0_device_load(&ru->rfdevice,&ru->openair0_cfg)==0,"Cannot connect to local radio\n"); - AssertFatal(ru->rfdevice.trx_start_func(&ru->rfdevice) == 0,"Could not start the RF device\n"); - int64_t slot=-1; - int64_t nextHWTSshouldBe=0, nextRxTSlogical=0; - // weird globals, used in NR_IF_Module.c - sf_ahead = (uint16_t) ceil((float)6/(0x01<numerology_index)); - sl_ahead = sf_ahead*fp->slots_per_subframe; - - // This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices - - while (!oai_exit) { - int nextSlot=(slot+1)%fp->slots_per_frame; - uint32_t samples_per_slot = fp->get_samples_per_slot(nextSlot,fp); - int rxBuffOffset=fp->get_samples_slot_timestamp(nextSlot,fp,0); - AssertFatal(rxBuffOffset + samples_per_slot <= fp->samples_per_frame, "Will read outside allocated buffer\n"); - int samples=fp->get_samples_per_slot(nextSlot,fp); - openair0_timestamp HWtimeStamp=0; //for multi RU - int rxs=rx_rf(rxBuffOffset, - samples, - ru->nb_rx, - ru->common.rxdata, - &ru->rfdevice, - &HWtimeStamp); - LOG_D(PHY,"Reading %d samples for slot %d\n",samples_per_slot,nextSlot); - - if ( HWtimeStamp != nextHWTSshouldBe) - LOG_E(HW,"reading a stream must be continuous, %ld, %ld\n", HWtimeStamp, nextHWTSshouldBe); - - nextHWTSshouldBe=HWtimeStamp+rxs; - ru->proc.timestamp_rx=nextRxTSlogical; - nextRxTSlogical+=samples_per_slot; - int64_t HW_to_logical_RxTSoffset=(int64_t)HWtimeStamp-(int64_t)ru->proc.timestamp_rx; - ru->proc.frame_rx = (ru->proc.timestamp_rx / (fp->samples_per_subframe*10))&1023; - uint32_t idx_sf = ru->proc.timestamp_rx / fp->samples_per_subframe; - float offsetInSubframe=ru->proc.timestamp_rx % fp->samples_per_subframe; - ru->proc.tti_rx = (idx_sf * fp->slots_per_subframe + - lroundf(offsetInSubframe / fp->samples_per_slot0))% - fp->slots_per_frame; - LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n", - ru->idx, 0, - (unsigned long long int)ru->proc.timestamp_rx, - (int)ru->ts_offset,ru->proc.frame_rx,ru->proc.tti_rx,ru->proc.tti_tx,fp->slots_per_frame); - int slot_type = nr_slot_select(&ru->gNB_list[0]->gNB_config,ru->proc.frame_rx,ru->proc.tti_rx); - - if (slot_type == NR_UPLINK_SLOT || slot_type == NR_MIXED_SLOT) { - nr_fep_full(ru,ru->proc.tti_rx); - - for (int aa=0; aanb_rx; aa++) - memcpy((void *)RC.gNB[0]->common_vars.rxdataF[aa], - (void *)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t)); - - LOG_D(PHY, "rxdataF energy: %d\n", signal_energy(ru->common.rxdataF[0], fp->symbols_per_slot*fp->ofdm_symbol_size)); - } - - gNB_L1_proc_t *gNBproc=&RC.gNB[0][0].proc; - gNB_L1_rxtx_proc_t *L1_proc = &gNBproc->L1_proc; - NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; - gNBproc->timestamp_rx = ru->proc.timestamp_rx; - L1_proc->frame_rx = gNBproc->frame_rx = gNBproc->frame_prach = ru->proc.frame_rx = - (ru->proc.timestamp_rx / (fp->samples_per_subframe*10))&1023; - L1_proc->slot_rx = gNBproc->slot_rx = gNBproc->slot_prach = - ru->proc.tti_rx; // computed before in caller function - L1_proc->timestamp_tx = gNBproc->timestamp_tx = ru->proc.timestamp_tx = - ru->proc.timestamp_rx + - sf_ahead*fp->samples_per_subframe; - L1_proc->frame_tx = gNBproc->frame_tx = ru->proc.frame_tx = - (gNBproc->timestamp_tx / (fp->samples_per_subframe*10))&1023; - L1_proc->slot_tx = ru->proc.tti_tx = - (L1_proc->slot_rx + sl_ahead)%fp->slots_per_frame; - - if (ocp_rxtx(&RC.gNB[0][0],L1_proc) < 0) - LOG_E(PHY,"gNB %d CC_id %d failed during execution\n",RC.gNB[0][0].Mod_id,RC.gNB[0][0].CC_id); - - // do TX front-end processing if needed (precoding and/or IDFTs) - //ru->feptx_prec(ru,proc->frame_tx,proc->tti_tx); - nr_feptx_prec(ru,ru->proc.frame_tx,ru->proc.tti_tx); - // do OFDM with/without TX front-end processing if needed - //ru->feptx_ofdm - nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config; - - if (nr_slot_select(cfg,ru->proc.frame_tx, ru->proc.tti_tx ) != NR_UPLINK_SLOT) { - int aa=0; // antenna 0 hardcoded - NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms; - nr_feptx0(ru,ru->proc.tti_tx,0,fp->symbols_per_slot,aa); - int *txdata = &ru->common.txdata[aa][fp->get_samples_slot_timestamp(ru->proc.tti_tx,fp,0)]; - int slot_sizeF = (fp->ofdm_symbol_size)* - ((NFAPI_CP_NORMAL == 1) ? 12 : 14); - LOG_D(PHY,"feptx_ofdm (TXPATH): frame %d, slot %d: txp (time %ld) %d dB, txp (freq) %d dB\n", - ru->proc.frame_tx,ru->proc.tti_tx,ru->proc.timestamp_tx, - dB_fixed(signal_energy((int32_t *)txdata,fp->get_samples_per_slot(ru->proc.tti_tx,fp))), - dB_fixed(signal_energy_nodc(ru->common.txdataF_BF[aa],2*slot_sizeF))); - } - - // do outgoing fronthaul (south) if needed - tx_rf(ru,ru->proc.frame_tx,ru->proc.tti_tx,ru->proc.timestamp_tx+HW_to_logical_RxTSoffset); - slot++; - } - - printf( "Exiting ru_thread \n"); - ru->rfdevice.trx_end_func(&ru->rfdevice); - static int ru_thread_status = 0; - return &ru_thread_status; -} - -void launch_NR_RU(RU_t *ru, char *rf_config_file) { - LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n", - RC.nb_nr_L1_inst,RC.nb_RU,get_nprocs()); - LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU); - - for (int ru_id=0; ru_idrf_config_file = rf_config_file; - ru->idx = ru_id; - ru->ts_offset = 0; - // use gNB_list[0] as a reference for RU frame parameters - // NOTE: multiple CC_id are not handled here yet! - LOG_D(PHY, "%s() RC.ru[%d].num_gNB:%d ru->gNB_list[0]:%p rf_config_file:%s\n", - __FUNCTION__, ru_id, ru->num_gNB, ru->gNB_list[0], ru->rf_config_file); - LOG_E(PHY,"ru->gNB_list ru->num_gNB hardcoded: one RU connected to carrier 0 of gNB 0\n"); - ru->gNB_list[0] = &RC.gNB[0][0]; - ru->num_gNB=1; - LOG_I(PHY,"Copying frame parms from gNB in RC to ru %d and frame_parms in ru\n",ru->idx); - RU_proc_t *proc = &ru->proc; - threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "MainLoop", -1, OAI_PRIORITY_RT_MAX ); - } -} - -void init_eNB_afterRU(void) { - AssertFatal(false,""); -} - -int main( int argc, char **argv ) { - AssertFatal(load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY), - "[SOFTMODEM] Error, configuration module init failed\n"); - logInit(); -#ifndef PACKAGE_VERSION -# define PACKAGE_VERSION "UNKNOWN" -#endif - LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - set_latency_target(); - get_options (); - get_common_options(SOFTMODEM_GNB_BIT ); - AssertFatal(!CONFIG_ISFLAGSET(CONFIG_ABORT),"Getting configuration failed\n"); - cpuf=get_cpu_freq_GHz(); - itti_init(TASK_MAX, tasks_info); - set_taus_seed (0); - init_opt(); - init_pdcp(); - init_main_gNB(); - init_gNB(true, wait_for_sync); - /* Start the agent. If it is turned off in the configuration, it won't start */ - RCconfig_nr_flexran(); - - for (int i = 0; i < RC.nb_nr_L1_inst; i++) { - flexran_agent_start(i); - } - - /* - *nfapi stuff very buggy in 4G, not yet implemented in 5G - */ - // init UE_PF_PO and mutex lock (paging from S1AP) - pthread_mutex_init(&ue_pf_po_mutex, NULL); - printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n"); - pthread_cond_init(&nfapi_sync_cond,NULL); - pthread_mutex_init(&nfapi_sync_mutex, NULL); - const char *nfapi_mode_str[] = { - "MONOLITHIC", "PNF", "VNF", - }; - AssertFatal(nfapi_mode < 3,""); - printf("NFAPI MODE:%s\n", nfapi_mode_str[nfapi_mode]); - - if (nfapi_mode==NFAPI_MODE_VNF) // VNF - wait_nfapi_init("main?"); - - for (int i=0; iconfigured, "Remain threads to manage\n"); - - printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU); - config_sync_var=0; - - if (nfapi_mode==NFAPI_MODE_PNF) { // PNF - wait_nfapi_init("main?"); - } - - printf("wait RUs\n"); - printf("ALL RUs READY!\n"); - printf("RC.nb_RU:%d\n", RC.nb_RU); - // once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration) - printf("ALL RUs ready - init gNBs\n"); - LOG_E(PHY,"configuring RU from file, hardcoded one gNB for one RU, one carrier\n"); - RU_t ru= {0}; - OCPconfig_RU(&ru); - ru.nr_frame_parms->threequarter_fs=threequarter_fs; - fill_rf_config(&ru,ru.rf_config_file); - init_gNB_phase2(&ru); - memcpy((void *)ru.nr_frame_parms,&RC.gNB[0][0].frame_parms,sizeof(NR_DL_FRAME_PARMS)); - memcpy((void *)&ru.config,(void *)&RC.gNB[0]->gNB_config,sizeof(ru.config)); - AssertFatal(setup_RU_buffers(&ru)==0,"Inconsistent configuration"); - nr_phy_init_RU(&ru); - init_gNB_proc(0); // only instance 0 (one gNB per process) - - if (RC.nb_RU >0) { - printf("Initializing RU threads\n"); - launch_NR_RU(&ru, get_softmodem_params()->rf_config_file); - } - - if (opp_enabled ==1) { - pthread_t t; - threadCreate(&t, process_stats_thread, - (void *)NULL, "time_meas", -1, OAI_PRIORITY_RT_LOW); - } - - if(IS_SOFTMODEM_DOSCOPE) { - scopeParms_t tmp= {&argc, argv, &ru, RC.gNB[0]}; - load_softscope("nr",&tmp); - } - - while(!oai_exit) - sleep(1); - - logClean(); - printf("Bye.\n"); - return 0; -} From 211b6feadf9e1ebc1ab38134ad2a96f3e9c7425b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 17:09:24 +0100 Subject: [PATCH 617/883] Use (portable) rdtsc_oai() in tpool --- .../utils/telnetsrv/telnetsrv_measurements.c | 1 + common/utils/threadPool/measurement_display.c | 4 +-- common/utils/threadPool/thread-pool.c | 4 +-- common/utils/threadPool/thread-pool.h | 30 ++++++++----------- common/utils/time_meas.c | 9 ++++++ common/utils/time_meas.h | 27 ++++++----------- 6 files changed, 35 insertions(+), 40 deletions(-) diff --git a/common/utils/telnetsrv/telnetsrv_measurements.c b/common/utils/telnetsrv/telnetsrv_measurements.c index 786cbd094c..2af76753b8 100644 --- a/common/utils/telnetsrv/telnetsrv_measurements.c +++ b/common/utils/telnetsrv/telnetsrv_measurements.c @@ -51,6 +51,7 @@ static char *grouptypes[] = {"ltestats","cpustats"}; static double cpufreq; +extern notifiedFIFO_t measur_fifo; #define TELNET_NUM_MEASURTYPES (sizeof(grouptypes)/sizeof(char *)) #define HDR "---------------------------------" diff --git a/common/utils/threadPool/measurement_display.c b/common/utils/threadPool/measurement_display.c index 0f5a3e0f69..cf2febaf33 100644 --- a/common/utils/threadPool/measurement_display.c +++ b/common/utils/threadPool/measurement_display.c @@ -43,9 +43,9 @@ int main(int argc, char *argv[]) { exit(1); } - uint64_t deb=rdtsc(); + uint64_t deb=rdtsc_oai(); usleep(100000); - cpuCyclesMicroSec=(rdtsc()-deb)/100000; + cpuCyclesMicroSec=(rdtsc_oai()-deb)/100000; printf("Cycles per µs: %lu\n",cpuCyclesMicroSec); printf("Key" SEP "delay to process" SEP "processing time" SEP "delay to be read answer\n"); notifiedFIFO_elt_t doneRequest; diff --git a/common/utils/threadPool/thread-pool.c b/common/utils/threadPool/thread-pool.c index fff09528a8..4a5485e89e 100644 --- a/common/utils/threadPool/thread-pool.c +++ b/common/utils/threadPool/thread-pool.c @@ -72,11 +72,11 @@ void *one_thread(void *arg) { do { notifiedFIFO_elt_t *elt=pullNotifiedFifoRemember(&tp->incomingFifo, myThread); - if (tp->measurePerf) elt->startProcessingTime=rdtsc(); + if (tp->measurePerf) elt->startProcessingTime=rdtsc_oai(); elt->processingFunc(NotifiedFifoData(elt)); - if (tp->measurePerf) elt->endProcessingTime=rdtsc(); + if (tp->measurePerf) elt->endProcessingTime=rdtsc_oai(); if (elt->reponseFifo) { // Check if the job is still alive, else it has been aborted diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index 7d2365fb52..da4e9cb04c 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -29,15 +29,9 @@ #include #include #include -#include -#include -//#include - -static __inline__ uint64_t rdtsc(void) { - uint32_t a, d; - __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); - return (((uint64_t)d)<<32) | ((uint64_t)a); -} +#include "assertions.h" +#include "common/utils/time_meas.h" +#include "common/utils/system.h" #ifdef DEBUG #define THREADINIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP @@ -66,10 +60,10 @@ typedef struct notifiedFIFO_elt_s { struct notifiedFIFO_s *reponseFifo; void (*processingFunc)(void *); bool malloced; - uint64_t creationTime; - uint64_t startProcessingTime; - uint64_t endProcessingTime; - uint64_t returnTime; + OAI_CPUTIME_TYPE creationTime; + OAI_CPUTIME_TYPE startProcessingTime; + OAI_CPUTIME_TYPE endProcessingTime; + OAI_CPUTIME_TYPE returnTime; void *msgData; } notifiedFIFO_elt_t; @@ -225,18 +219,18 @@ typedef struct thread_pool { } tpool_t; static inline void pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg) { - if (t->measurePerf) msg->creationTime=rdtsc(); + if (t->measurePerf) msg->creationTime=rdtsc_oai(); if ( t->activated) pushNotifiedFIFO(&t->incomingFifo, msg); else { if (t->measurePerf) - msg->startProcessingTime=rdtsc(); + msg->startProcessingTime=rdtsc_oai(); msg->processingFunc(NotifiedFifoData(msg)); if (t->measurePerf) - msg->endProcessingTime=rdtsc(); + msg->endProcessingTime=rdtsc_oai(); if (msg->reponseFifo) pushNotifiedFIFO(msg->reponseFifo, msg); @@ -247,7 +241,7 @@ static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_ notifiedFIFO_elt_t *msg= pullNotifiedFIFO(responseFifo); AssertFatal(t->traceFd, "Thread pool used while not initialized"); if (t->measurePerf) - msg->returnTime=rdtsc(); + msg->returnTime=rdtsc_oai(); if (t->traceFd > 0) if(write(t->traceFd, msg, sizeof(*msg))); @@ -262,7 +256,7 @@ static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpo return NULL; if (t->measurePerf) - msg->returnTime=rdtsc(); + msg->returnTime=rdtsc_oai(); if (t->traceFd) if(write(t->traceFd, msg, sizeof(*msg))); diff --git a/common/utils/time_meas.c b/common/utils/time_meas.c index 353f170434..df2bfd64de 100644 --- a/common/utils/time_meas.c +++ b/common/utils/time_meas.c @@ -267,6 +267,15 @@ void init_meas(void) { AssertFatal(rt==0, "couldn't create cpu measurment thread: %s\n",strerror(errno)); } +void send_meas(time_stats_t *ts, int msgid) { + if (MEASURE_ENABLED(ts) ) { + ts->tstatptr->timestat_id=ts->meas_index; + ts->tstatptr->msgid = msgid ; + ts->tstatptr->ts = rdtsc_oai(); + pushNotifiedFIFO(&measur_fifo, ts->tpoolmsg); + } + } + void end_meas(void) { notifiedFIFO_elt_t *nfe = newNotifiedFIFO_elt(sizeof(time_stats_msg_t),0,NULL,NULL); time_stats_msg_t *msg = (time_stats_msg_t *)NotifiedFifoData(nfe); diff --git a/common/utils/time_meas.h b/common/utils/time_meas.h index ed4e9a125f..98c4b3fe8a 100644 --- a/common/utils/time_meas.h +++ b/common/utils/time_meas.h @@ -31,7 +31,6 @@ #include #include #include -#include "common/utils/threadPool/thread-pool.h" // global var to enable openair performance profiler extern int opp_enabled; extern double cpu_freq_GHz __attribute__ ((aligned(32)));; @@ -58,8 +57,8 @@ typedef struct { meas_printfunc_t displayFunc; /*!< \brief function to call when DISPLAY message is received*/ } time_stats_msg_t; - -typedef struct { +struct notifiedFIFO_elt_s; +typedef struct time_stats { OAI_CPUTIME_TYPE in; /*!< \brief time at measure starting point */ OAI_CPUTIME_TYPE diff; /*!< \brief average difference between time at starting point and time at endpoint*/ OAI_CPUTIME_TYPE p_time; /*!< \brief absolute process duration */ @@ -70,7 +69,7 @@ typedef struct { char *meas_name; /*!< \brief name to use when printing the measure (not used for PHY simulators)*/ int meas_index; /*!< \brief index of this measure in the measure array (not used for PHY simulators)*/ int meas_enabled; /*!< \brief per measure enablement flag. send_meas tests this flag, unused today in start_meas and stop_meas*/ - notifiedFIFO_elt_t *tpoolmsg; /*!< \brief message pushed to the cpu measurment queue to report a measure START or STOP */ + struct notifiedFIFO_elt_s *tpoolmsg; /*!< \brief message pushed to the cpu measurment queue to report a measure START or STOP */ time_stats_msg_t *tstatptr; /*!< \brief pointer to the time_stats_msg_t data in the tpoolmsg, stored here for perf considerations*/ } time_stats_t; #define MEASURE_ENABLED(X) (X->meas_enabled) @@ -189,25 +188,17 @@ static inline void merge_meas(time_stats_t *dst_ts, time_stats_t *src_ts) dst_ts->max = src_ts->max; } -extern notifiedFIFO_t measur_fifo; #define CPUMEASUR_SECTION "cpumeasur" #define CPUMEASUR_PARAMS_DESC { \ {"max_cpumeasur", "Max number of cpu measur entries", 0, uptr:&max_cpumeasur, defintval:100, TYPE_UINT, 0},\ } - void init_meas(void); - time_stats_t *register_meas(char *name); - #define START_MEAS(X) send_meas(X, TIMESTAT_MSGID_START) - #define STOP_MEAS(X) send_meas(X, TIMESTAT_MSGID_STOP) - static inline void send_meas(time_stats_t *ts, int msgid) { - if (MEASURE_ENABLED(ts) ) { - ts->tstatptr->timestat_id=ts->meas_index; - ts->tstatptr->msgid = msgid ; - ts->tstatptr->ts = rdtsc_oai(); - pushNotifiedFIFO(&measur_fifo, ts->tpoolmsg); - } - } - void end_meas(void); +void init_meas(void); +time_stats_t *register_meas(char *name); +#define START_MEAS(X) send_meas(X, TIMESTAT_MSGID_START) +#define STOP_MEAS(X) send_meas(X, TIMESTAT_MSGID_STOP) +void send_meas(time_stats_t *ts, int msgid); +void end_meas(void); #endif From 26d0d65747ee04d2677da5ed1857cbe309ccd4ce Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 17:55:12 +0100 Subject: [PATCH 618/883] get execution time_stats_t from Tpool job --- common/utils/threadPool/thread-pool.h | 12 ++++++++++++ common/utils/time_meas.h | 2 +- executables/nr-gnb.c | 2 +- openair1/PHY/defs_gNB.h | 1 - openair1/SCHED_NR/fapi_nr_l1.c | 4 ++-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 7 ------- openair1/SIMULATION/NR_PHY/dlsim.c | 1 - 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index da4e9cb04c..6df98e2ba4 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -169,6 +169,18 @@ static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) { return ret; } +static inline time_stats_t exec_time_stats_NotifiedFIFO(const notifiedFIFO_elt_t* elt) +{ + time_stats_t ts = {0}; + ts.in = elt->startProcessingTime; + ts.diff = elt->endProcessingTime - ts.in; + ts.p_time = ts.diff; + ts.diff_square = ts.diff * ts.diff; + ts.max = ts.diff; + ts.trials = 1; + return ts; +} + // This function aborts all messages matching the key // If the queue is used in thread pools, it doesn't cancels already running processing // because the message has already been picked diff --git a/common/utils/time_meas.h b/common/utils/time_meas.h index 98c4b3fe8a..81a1a893cd 100644 --- a/common/utils/time_meas.h +++ b/common/utils/time_meas.h @@ -178,7 +178,7 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) { } } -static inline void merge_meas(time_stats_t *dst_ts, time_stats_t *src_ts) +static inline void merge_meas(time_stats_t *dst_ts, const time_stats_t *src_ts) { if (!opp_enabled) return; diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index cf48a1c3fd..9f3f2e36bf 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -423,7 +423,7 @@ void init_gNB_Tpool(int inst) { s_offset += 3; } if (getenv("noThreads")) strcpy(pool, "n"); - initTpool(pool, gNB->threadPool, false); + initTpool(pool, gNB->threadPool, true); // ULSCH decoder result FIFO gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->respDecode); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7d5cb285b5..78ed890aef 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -973,7 +973,6 @@ typedef struct processingData_L1tx { uint16_t num_pdsch_slot; int num_dl_pdcch; int num_ul_pdcch; - time_stats_t phy_proc_tx; } processingData_L1tx_t; #endif diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c index 78e722c4b5..4b9f9534f0 100644 --- a/openair1/SCHED_NR/fapi_nr_l1.c +++ b/openair1/SCHED_NR/fapi_nr_l1.c @@ -165,8 +165,8 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){ notifiedFIFO_elt_t *res; res = pullTpool(gNB->L1_tx_free, gNB->threadPool); processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res); - - merge_meas(&gNB->phy_proc_tx, &msgTx->phy_proc_tx); + const time_stats_t ts = exec_time_stats_NotifiedFIFO(res); + merge_meas(&gNB->phy_proc_tx, &ts); msgTx->num_pdsch_slot=0; msgTx->num_dl_pdcch=0; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index bc4493cd1c..1ddf4b0d07 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -134,11 +134,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,1); - if (do_meas==1) { - reset_meas(&msgTx->phy_proc_tx); - start_meas(&msgTx->phy_proc_tx); - } - // clear the transmit data array and beam index for the current slot for (aa=0; aacarrier_config.num_tx_ant.value; aa++) { memset(&gNB->common_vars.txdataF[aa][txdataF_offset],0,fp->samples_per_slot_wCP*sizeof(int32_t)); @@ -196,8 +191,6 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); - - if (do_meas==1) stop_meas(&msgTx->phy_proc_tx); } void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) { diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 7363d1abd5..98b9e03a7e 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -999,7 +999,6 @@ int main(int argc, char **argv) msgDataTx->slot = slot; msgDataTx->frame = frame; memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); - reset_meas(&msgDataTx->phy_proc_tx); for (SNR = snr0; SNR < snr1; SNR += .2) { From 823aaa70dd8668a76b1f33ee779d4d213c7158fa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Feb 2022 18:00:10 +0100 Subject: [PATCH 619/883] Fix warning in lte UE scope and ocp-enb --- executables/main-fs6.c | 2 +- openair1/PHY/TOOLS/lte_ue_scope.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/executables/main-fs6.c b/executables/main-fs6.c index e708d9c761..fff4c51155 100644 --- a/executables/main-fs6.c +++ b/executables/main-fs6.c @@ -947,7 +947,7 @@ void phy_procedures_eNB_TX_fromsplit(uint8_t *bufferZone, int nbBlocks, PHY_VARS memcpy(eNB->pbch_pdu,hDL(bufferZone)->pbch_pdu, 4); // Remove all scheduled DL, we will populate from the CU sending - for (int UE_id=0; UE_iddlsch[UE_id][0]; if ( dlsch0 && dlsch0->rnti>0 ) { diff --git a/openair1/PHY/TOOLS/lte_ue_scope.c b/openair1/PHY/TOOLS/lte_ue_scope.c index 00560f2d74..9b3f65d7d1 100644 --- a/openair1/PHY/TOOLS/lte_ue_scope.c +++ b/openair1/PHY/TOOLS/lte_ue_scope.c @@ -51,7 +51,7 @@ void reset_stats(FL_OBJECT *button, long arg) { int i,j,k; PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0]; - for (i=0; idlsch[i][0]->Mlimit; j++) { phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0; From 588e013d2ddd525b365ff091dbc1ca7fbe95417d Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 25 Feb 2022 18:23:39 +0100 Subject: [PATCH 620/883] fix physim compilation --- openair1/SIMULATION/NR_PHY/dlsim.c | 8 ++++---- openair1/SIMULATION/NR_PHY/ulsim.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index fb99c50400..4b6045b93b 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -930,10 +930,10 @@ int main(int argc, char **argv) nr_gold_pdcch(UE, frame_parms->Nid_cell); // compute the scrambling IDs for PDSCH DMRS - for (int i = 0; i < 2; i++) - UE->scramblingID[i] = frame_parms->Nid_cell; - - nr_gold_pdsch(UE, UE->scramblingID); + for (int i = 0; i < 2; i++) { + UE->scramblingID_dlsch[i] = frame_parms->Nid_cell; + nr_gold_pdsch(UE, i, UE->scramblingID_dlsch[i]); + } nr_l2_init_ue(NULL); UE_mac = get_mac_inst(0); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 56f5d2dd71..7e192ec8d8 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -762,10 +762,10 @@ int main(int argc, char **argv) init_nr_ue_transport(UE, 0); - // initialize the pusch dmrs - uint16_t N_n_scid[2] = {frame_parms->Nid_cell,frame_parms->Nid_cell}; - int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization - nr_init_pusch_dmrs(UE, N_n_scid, n_scid); + for(int n_scid = 0; n_scid<2; n_scid++) { + UE->scramblingID_ulsch[n_scid] = frame_parms->Nid_cell; + nr_init_pusch_dmrs(UE, frame_parms->Nid_cell, n_scid); + } //Configure UE NR_UE_RRC_INST_t rrcue; From b8511d511d4b3babbb548e1926460560bdf15d33 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 26 Feb 2022 00:05:36 +0100 Subject: [PATCH 621/883] fix --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index b76a781491..c83882935e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2148,11 +2148,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; memset(sched_ctrl, 0, sizeof(*sched_ctrl)); sched_ctrl->set_mcs = TRUE; - sched_ctrl->lcid_mask = 0; - if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) { - sched_ctrl->lcid_mask = 1<dl_lc_num = 0; sched_ctrl->ta_frame = 0; sched_ctrl->ta_update = 31; sched_ctrl->ta_apply = false; From 2adf56b08a525e65479f2583cd7a641d92b4ac3f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 26 Feb 2022 11:15:36 +0100 Subject: [PATCH 622/883] Lower logging in handle_nr_ulsch() --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 4f50e0481c..2654988557 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -185,7 +185,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) { const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i]; const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[i]; - LOG_I(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x " + LOG_D(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x " "UL_info->rx_ind.pdu_list[%d].rnti:%04x\n", i, crc->rnti, i, rx->rnti); From 368819310d3cce2a8ad3aabca8d6e62358a4ea7e Mon Sep 17 00:00:00 2001 From: matzakos Date: Mon, 28 Feb 2022 10:14:29 +0100 Subject: [PATCH 623/883] Synchronize config files of CU/DU with the ones of the CI --- .../PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf | 194 +++++++++++++++++- .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 77 ++++--- 2 files changed, 233 insertions(+), 38 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf index 43c2ab20ad..5e8527b4d1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf @@ -13,7 +13,6 @@ gNBs = gNB_name = "gNB-Eurecom-CU"; - // Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; plmn_list = ({ @@ -27,14 +26,14 @@ gNBs = }, { sst = 1; - sd = 0x1; #112233; // 0 false, else true + sd = 0x112233; // 0 false, else true } ); }); - nr_cellid = 12345678L + nr_cellid = 12345678L; tr_s_preference = "f1"; @@ -43,9 +42,170 @@ gNBs = remote_s_address = "127.0.0.3"; local_s_portc = 501; local_s_portd = 2152; - remote_s_portc = 501; + remote_s_portc = 500; remote_s_portd = 2152; + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + min_rxtxtime = 6; + sib1_tda = 0; + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 641280; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 640008; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + + 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 : { @@ -56,7 +216,7 @@ gNBs = ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "192.168.69.131"; + amf_ip_address = ( { ipv4 = "192.168.69.131"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -66,15 +226,31 @@ gNBs = NETWORK_INTERFACES : { - GNB_INTERFACE_NAME_FOR_NG_AMF = "bond0"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.207/24"; - GNB_INTERFACE_NAME_FOR_NGU = "bond0"; - GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.207/24"; + GNB_INTERFACE_NAME_FOR_NG_AMF = "eth0"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.207"; + GNB_INTERFACE_NAME_FOR_NGU = "eth0"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.207"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; } ); +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"; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 0b6d7cd7c8..95fa75bc1d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -12,7 +12,6 @@ gNBs = gNB_name = "gNB-Eurecom-DU"; - // Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; plmn_list = ({ @@ -26,25 +25,23 @@ gNBs = }, { sst = 1; - sd = 0x1; #112233; // 0 false, else true + sd = 0x112233; // 0 false, else true } ); }); - nr_cellid = 12345678L - -# tr_s_preference = "local_mac" + nr_cellid = 12345678L; ////////// Physical parameters: ssb_SubcarrierOffset = 0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; + min_rxtxtime = 6; sib1_tda = 0; - pdcch_ConfigSIB1 = ( { controlResourceSetZero = 12; @@ -74,14 +71,22 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 12952; + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -95,7 +100,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 12952; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; @@ -107,7 +112,7 @@ gNBs = prach_msg1_FDM = 0; prach_msg1_FrequencyStart = 0; zeroCorrelationZoneConfig = 13; - preambleReceivedTargetPower = -118; + preambleReceivedTargetPower = -96; #preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) preambleTransMax = 6; #powerRampingStep @@ -118,9 +123,9 @@ gNBs = 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 = 3; + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; #oneHalf (0..15) 4,8,12,16,...60,64 - ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15; + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; #ra_ContentionResolutionTimer #(0..7) 8,16,24,32,40,48,56,64 ra_ContentionResolutionTimer = 7; @@ -136,6 +141,18 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; @@ -177,7 +194,7 @@ gNBs = nrofUplinkSlots = 2; nrofUplinkSymbols = 4; - ssPBCH_BlockPower = 10; + ssPBCH_BlockPower = -25; } ); @@ -201,9 +218,9 @@ MACRLCs = ( local_n_if_name = "lo"; local_n_address = "127.0.0.3"; remote_n_address = "127.0.0.4"; - local_n_portc = 601; + local_n_portc = 500; local_n_portd = 2152; - remote_n_portc = 600; + remote_n_portc = 501; remote_n_portd = 2152; } @@ -214,6 +231,9 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; thread_pool_size = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); @@ -224,21 +244,13 @@ RUs = ( nb_rx = 1 att_tx = 0 att_rx = 0; - bands = [7]; + bands = [78]; max_pdschReferenceSignalPower = -27; - max_rxgain = 75; + max_rxgain = 114; eNB_instances = [0]; - ##beamforming 1x2 matrix: 1 layer x 2 antennas - bf_weights = [0x00007fff, 0x0000]; - ##beamforming 1x4 matrix: 1 layer x 4 antennas - #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; - ## beamforming 2x2 matrix: - # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; - ## beamforming 4x4 matrix: - #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - - sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2"; - clock_src = "external"; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; } ); @@ -250,6 +262,13 @@ THREAD_STRUCT = ( worker_config = "WORKER_ENABLE"; } ); +rfsimulator: { +serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs" +} log_config : { @@ -257,7 +276,7 @@ THREAD_STRUCT = ( hw_log_level ="info"; phy_log_level ="info"; mac_log_level ="info"; - rlc_log_level ="debug"; + rlc_log_level ="info"; pdcp_log_level ="info"; rrc_log_level ="info"; f1ap_log_level ="debug"; From 49196f3c91fd8465725ee24a6cb3c2a13a0b91d9 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 28 Feb 2022 14:08:45 +0100 Subject: [PATCH 624/883] NR_UE: fix nr_dlsch_extract_rbs_single() for start_rb > nb_rb_pdsch/2 --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index ef7d398edf..ccce0d6861 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -2006,7 +2006,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, "n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups); } - const unsigned short start_re = frame_parms->first_carrier_offset + start_rb * NR_NB_SC_PER_RB; + const unsigned short start_re = (frame_parms->first_carrier_offset + start_rb * NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size; const int8_t validDmrsEst = get_valid_dmrs_idx_for_channel_est(dlDmrsSymbPos, symbol); for (unsigned char aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) { From d90f9d8d6fadab3145a9f0bc9ac833820b299dc1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 28 Feb 2022 14:13:01 +0100 Subject: [PATCH 625/883] CI: show correct Tx Processing in HTML, add processing count number --- ci-scripts/datalog_rt_stats.2x2.yaml | 11 ++++------- ci-scripts/datalog_rt_stats.default.yaml | 11 ++++------- ci-scripts/html.py | 14 ++++++-------- ci-scripts/ran.py | 5 +++-- ci-scripts/stats_monitor_conf.yaml | 8 +++----- 5 files changed, 20 insertions(+), 29 deletions(-) diff --git a/ci-scripts/datalog_rt_stats.2x2.yaml b/ci-scripts/datalog_rt_stats.2x2.yaml index 9e2b66862d..a93ef6aa8c 100644 --- a/ci-scripts/datalog_rt_stats.2x2.yaml +++ b/ci-scripts/datalog_rt_stats.2x2.yaml @@ -4,16 +4,14 @@ Title : Processing Time (us) ColNames : - Metric - - Average - - Max - - Average vs Reference Deviation (Reference Value ; Acceptability Threshold) + - Average; Max; Count + - Average vs Reference Deviation (Reference Value; Acceptability Threshold) Ref : feprx : 120.0 feptx_prec : 8.0 feptx_ofdm : 50.0 feptx_total : 75.0 - L1 Tx processing thread 0 : 300.0 - L1 Tx processing thread 1 : 300.0 + L1 Tx processing : 300.0 DLSCH encoding : 230.0 L1 Rx processing : 175.0 PUSCH inner-receiver : 100.0 @@ -25,8 +23,7 @@ Threshold : feptx_prec : 1.25 feptx_ofdm : 1.25 feptx_total : 1.25 - L1 Tx processing thread 0 : 1.25 - L1 Tx processing thread 1 : 1.25 + L1 Tx processing : 1.25 DLSCH encoding : 1.25 L1 Rx processing : 1.25 PUSCH inner-receiver : 1.25 diff --git a/ci-scripts/datalog_rt_stats.default.yaml b/ci-scripts/datalog_rt_stats.default.yaml index a2d4768752..02a90c86f4 100644 --- a/ci-scripts/datalog_rt_stats.default.yaml +++ b/ci-scripts/datalog_rt_stats.default.yaml @@ -4,16 +4,14 @@ Title : Processing Time (us) ColNames : - Metric - - Average - - Max - - Average vs Reference Deviation (Reference Value ; Acceptability Threshold) + - Average; Max; Count + - Average vs Reference Deviation (Reference Value; Acceptability Threshold) Ref : feprx : 60.0 feptx_prec : 8.0 feptx_ofdm : 50.0 feptx_total : 75.0 - L1 Tx processing thread 0 : 300.0 - L1 Tx processing thread 1 : 300.0 + L1 Tx processing : 300.0 DLSCH encoding : 230.0 L1 Rx processing : 175.0 PUSCH inner-receiver : 100.0 @@ -25,8 +23,7 @@ Threshold : feptx_prec : 1.25 feptx_ofdm : 1.25 feptx_total : 1.25 - L1 Tx processing thread 0 : 1.25 - L1 Tx processing thread 1 : 1.25 + L1 Tx processing : 1.25 DLSCH encoding : 1.25 L1 Rx processing : 1.25 PUSCH inner-receiver : 1.25 diff --git a/ci-scripts/html.py b/ci-scripts/html.py index b172ffb711..c618ea5abc 100644 --- a/ci-scripts/html.py +++ b/ci-scripts/html.py @@ -478,21 +478,19 @@ class HTMLManagement(): self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' '+ DataLog['ColNames'][0] +'\n') - self.htmlFile.write(' ' + DataLog['ColNames'][1] + '\n') - self.htmlFile.write(' ' + DataLog['ColNames'][2] + '\n') - self.htmlFile.write(' '+ DataLog['ColNames'][3] +'\n') + self.htmlFile.write(' ' + DataLog['ColNames'][1] + '\n') + self.htmlFile.write(' '+ DataLog['ColNames'][2] +'\n') self.htmlFile.write(' \n') for k in DataLog['Data']: # TestRow self.htmlFile.write(' \n') self.htmlFile.write(' ' + k + ' \n') - self.htmlFile.write(' ' + DataLog['Data'][k][0] + ' \n') - self.htmlFile.write(' ' + DataLog['Data'][k][1] + ' \n') - if float(DataLog['Data'][k][2])> DataLog['Threshold'][k]: - self.htmlFile.write(' ' + DataLog['Data'][k][2] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + '\n') + self.htmlFile.write(' ' + DataLog['Data'][k][0] + '; ' + DataLog['Data'][k][1] + '; ' + DataLog['Data'][k][2] + ' \n') + if float(DataLog['Data'][k][3])> DataLog['Threshold'][k]: + self.htmlFile.write(' ' + DataLog['Data'][k][3] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + '\n') else: - self.htmlFile.write(' ' + DataLog['Data'][k][2] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + '\n') + self.htmlFile.write(' ' + DataLog['Data'][k][3] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + '\n') self.htmlFile.write(' \n') self.htmlFile.close() diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index ad360d2179..d295339cca 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -1125,12 +1125,13 @@ class RANManagement(): datalog_rt_stats['Data']={} if len(real_time_stats)!=0: #check if dictionary is not empty for k in real_time_stats: - tmp=re.match(r'^(?P.*):\s+(?P\d+\.\d+) us;\s+\d+;\s+(?P\d+\.\d+) us;',real_time_stats[k]) + tmp=re.match(r'^(?P.*):\s+(?P\d+\.\d+) us;\s+(?P\d+);\s+(?P\d+\.\d+) us;',real_time_stats[k]) if tmp is not None: metric=tmp.group('metric') avg=float(tmp.group('avg')) max=float(tmp.group('max')) - datalog_rt_stats['Data'][metric]=["{:.0f}".format(avg),"{:.0f}".format(max),"{:.2f}".format(avg/datalog_rt_stats['Ref'][metric])] + count=float(tmp.group('count')) + datalog_rt_stats['Data'][metric]=["{:.0f}".format(avg),"{:.0f}".format(max),"{:d}".format(count),"{:.2f}".format(avg/datalog_rt_stats['Ref'][metric])] #once all metrics are collected, store the data as a class attribute to build a dedicated HTML table afterward self.datalog_rt_stats=datalog_rt_stats #check if there is a fail => will render the test as failed diff --git a/ci-scripts/stats_monitor_conf.yaml b/ci-scripts/stats_monitor_conf.yaml index 8760c067fc..9a2ececd18 100644 --- a/ci-scripts/stats_monitor_conf.yaml +++ b/ci-scripts/stats_monitor_conf.yaml @@ -20,8 +20,7 @@ gnb : feptx_prec: feptx_ofdm: feptx_total: - L1 Tx processing thread 0: - L1 Tx processing thread 1: + L1 Tx processing: DLSCH encoding: L1 Rx processing: PUSCH inner-receiver: @@ -40,12 +39,11 @@ gnb : rt.feptx_ofdm: rt.feptx_total: page3: - rt.L1 Tx processing thread 0: - rt.L1 Tx processing thread 1: + rt.L1 Tx processing: rt.DLSCH encoding: rt.L1 Rx processing: page4: rt.PUSCH inner-receiver: rt.PUSCH decoding: rt.DL & UL scheduling timing stats: - rt.UL Indication: \ No newline at end of file + rt.UL Indication: From cf5dafe74e042a8ada6adf1131f18b668f2313d3 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 28 Feb 2022 14:14:01 +0100 Subject: [PATCH 626/883] use only one memcpy() in case "start_re + nb_re == ofdm_symbol_size" in nr_ulsch_demodulation.c and nr_dlsch_demodulation.c --- openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 681a9eae16..e53b930bbb 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -356,7 +356,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF, if (is_dmrs_symbol == 0) { // //rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]); - if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) { + if (start_re + nb_re_pusch <= frame_parms->ofdm_symbol_size) { memcpy1((void*)rxF_ext, (void*)&rxF[start_re*2], nb_re_pusch*sizeof(int32_t)); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c index ccce0d6861..384d27ff7d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c @@ -2017,7 +2017,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, int32_t *rxF = &rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size]; if (pilots == 0) { //data symbol only - if (start_re + nb_rb_pdsch * NR_NB_SC_PER_RB < frame_parms->ofdm_symbol_size) { + if (start_re + nb_rb_pdsch * NR_NB_SC_PER_RB <= frame_parms->ofdm_symbol_size) { memcpy((void*)rxF_ext, (void*)&rxF[start_re], nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t)); } else { int neg_length = frame_parms->ofdm_symbol_size - start_re; From 63dea20c64c043e71be54777c41b85491818e62e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 28 Feb 2022 14:35:18 +0100 Subject: [PATCH 627/883] Address review comments --- common/utils/threadPool/thread-pool.h | 17 ++++++++++------- common/utils/time_meas.h | 16 ++++++++-------- executables/nr-gnb.c | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index 6df98e2ba4..dc2655f741 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -60,10 +60,10 @@ typedef struct notifiedFIFO_elt_s { struct notifiedFIFO_s *reponseFifo; void (*processingFunc)(void *); bool malloced; - OAI_CPUTIME_TYPE creationTime; - OAI_CPUTIME_TYPE startProcessingTime; - OAI_CPUTIME_TYPE endProcessingTime; - OAI_CPUTIME_TYPE returnTime; + oai_cputime_t creationTime; + oai_cputime_t startProcessingTime; + oai_cputime_t endProcessingTime; + oai_cputime_t returnTime; void *msgData; } notifiedFIFO_elt_t; @@ -96,9 +96,12 @@ static inline void *NotifiedFifoData(notifiedFIFO_elt_t *elt) { } static inline void delNotifiedFIFO_elt(notifiedFIFO_elt_t *elt) { - AssertFatal(elt->malloced, "delNotifiedFIFO on something not allocated by newNotifiedFIFO\n"); - elt->malloced=false; - free(elt); + if (elt->malloced) { + elt->malloced = false; + free(elt); + } + /* it is allowed to call delNotifiedFIFO_elt when the memory is managed by + * the caller */ } static inline void initNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf) { diff --git a/common/utils/time_meas.h b/common/utils/time_meas.h index 81a1a893cd..382dd7455a 100644 --- a/common/utils/time_meas.h +++ b/common/utils/time_meas.h @@ -36,9 +36,9 @@ extern int opp_enabled; extern double cpu_freq_GHz __attribute__ ((aligned(32)));; // structure to store data to compute cpu measurment #if defined(__x86_64__) || defined(__i386__) - #define OAI_CPUTIME_TYPE long long + typedef long long oai_cputime_t; #elif defined(__arm__) - #define OAI_CPUTIME_TYPE uint32_t + typedef uint32_t oai_cputime_t; #else #error "building on unsupported CPU architecture" #endif @@ -53,17 +53,17 @@ typedef void(*meas_printfunc_t)(const char* format, ...); typedef struct { int msgid; /*!< \brief message id, as defined by TIMESTAT_MSGID_X macros */ int timestat_id; /*!< \brief points to the time_stats_t entry in cpumeas table */ - OAI_CPUTIME_TYPE ts; /*!< \brief time stamp */ + oai_cputime_t ts; /*!< \brief time stamp */ meas_printfunc_t displayFunc; /*!< \brief function to call when DISPLAY message is received*/ } time_stats_msg_t; struct notifiedFIFO_elt_s; typedef struct time_stats { - OAI_CPUTIME_TYPE in; /*!< \brief time at measure starting point */ - OAI_CPUTIME_TYPE diff; /*!< \brief average difference between time at starting point and time at endpoint*/ - OAI_CPUTIME_TYPE p_time; /*!< \brief absolute process duration */ - OAI_CPUTIME_TYPE diff_square; /*!< \brief process duration square */ - OAI_CPUTIME_TYPE max; /*!< \brief maximum difference between time at starting point and time at endpoint*/ + oai_cputime_t in; /*!< \brief time at measure starting point */ + oai_cputime_t diff; /*!< \brief average difference between time at starting point and time at endpoint*/ + oai_cputime_t p_time; /*!< \brief absolute process duration */ + oai_cputime_t diff_square; /*!< \brief process duration square */ + oai_cputime_t max; /*!< \brief maximum difference between time at starting point and time at endpoint*/ int trials; /*!< \brief number of start point - end point iterations */ int meas_flag; /*!< \brief 1: stop_meas not called (consecutive calls of start_meas) */ char *meas_name; /*!< \brief name to use when printing the measure (not used for PHY simulators)*/ diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 9f3f2e36bf..fa0c3a1f63 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -423,7 +423,7 @@ void init_gNB_Tpool(int inst) { s_offset += 3; } if (getenv("noThreads")) strcpy(pool, "n"); - initTpool(pool, gNB->threadPool, true); + initTpool(pool, gNB->threadPool, cpumeas(CPUMEAS_GETSTATE)); // ULSCH decoder result FIFO gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t)); initNotifiedFIFO(gNB->respDecode); From 8d871c3c3b6e6fdb37e528e75c9e0ec18db40348 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 16 Feb 2022 15:22:02 +0100 Subject: [PATCH 628/883] add Detected UL Failure marker --- ci-scripts/ran.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index ad360d2179..87951eb033 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -815,8 +815,8 @@ class RANManagement(): removing_ue = 0 #count"X2AP-PDU" x2ap_pdu = 0 - #NSA specific log markers - nsa_markers ={'SgNBReleaseRequestAcknowledge': [],'FAILURE': [], 'scgFailureInformationNR-r15': [], 'SgNBReleaseRequest': []} + #gnb specific log markers + gnb_markers ={'SgNBReleaseRequestAcknowledge': [],'FAILURE': [], 'scgFailureInformationNR-r15': [], 'SgNBReleaseRequest': [], 'Detected UL Failure on PUSCH':[]} nodeB_prefix_found = False RealTimeProcessingIssue = False @@ -1008,11 +1008,11 @@ class RANManagement(): result = re.search('X2AP-PDU', str(line)) if result is not None: x2ap_pdu += 1 - #nsa markers logging - for k in nsa_markers: + #gnb markers logging + for k in gnb_markers: result = re.search(k, line) if result is not None: - nsa_markers[k].append(line_cnt) + gnb_markers[k].append(line_cnt) enb_log_file.close() @@ -1096,19 +1096,23 @@ class RANManagement(): htmlMsg = statMsg+'\n' logging.debug(statMsg) htmleNBFailureMsg += htmlMsg - #nsa markers + #gnb markers statMsg = 'logfile line count = ' + str(line_cnt) htmlMsg = statMsg+'\n' logging.debug(statMsg) htmleNBFailureMsg += htmlMsg - if len(nsa_markers['SgNBReleaseRequestAcknowledge'])!=0: - statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(nsa_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences , starting line ' + str(nsa_markers['SgNBReleaseRequestAcknowledge'][0]) + if len(gnb_markers['SgNBReleaseRequestAcknowledge'])!=0: + statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(gnb_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences , starting line ' + str(gnb_markers['SgNBReleaseRequestAcknowledge'][0]) else: - statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(nsa_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences' + statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(gnb_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences' htmlMsg = statMsg+'\n' logging.debug(statMsg) htmleNBFailureMsg += htmlMsg - statMsg = 'FAILURE = ' + str(len(nsa_markers['FAILURE'])) + ' occurences' + statMsg = 'FAILURE = ' + str(len(gnb_markers['FAILURE'])) + ' occurences' + htmlMsg = statMsg+'\n' + logging.debug(statMsg) + htmleNBFailureMsg += htmlMsg + statMsg = 'Detected UL Failure on PUSCH = ' + str(len(gnb_markers['Detected UL Failure on PUSCH'])) + ' occurences' htmlMsg = statMsg+'\n' logging.debug(statMsg) htmleNBFailureMsg += htmlMsg @@ -1158,14 +1162,14 @@ class RANManagement(): htmlMsg = statMsg+'\n' logging.debug(statMsg) htmleNBFailureMsg += htmlMsg - if len(nsa_markers['SgNBReleaseRequest'])!=0: - statMsg = 'SgNBReleaseRequest = ' + str(len(nsa_markers['SgNBReleaseRequest'])) + ' occurences , starting line ' + str(nsa_markers['SgNBReleaseRequest'][0]) + if len(gnb_markers['SgNBReleaseRequest'])!=0: + statMsg = 'SgNBReleaseRequest = ' + str(len(gnb_markers['SgNBReleaseRequest'])) + ' occurences , starting line ' + str(gnb_markers['SgNBReleaseRequest'][0]) else: - statMsg = 'SgNBReleaseRequest = ' + str(len(nsa_markers['SgNBReleaseRequest'])) + ' occurences' + statMsg = 'SgNBReleaseRequest = ' + str(len(gnb_markers['SgNBReleaseRequest'])) + ' occurences' htmlMsg = statMsg+'\n' logging.debug(statMsg) htmleNBFailureMsg += htmlMsg - statMsg = 'scgFailureInformationNR-r15 = ' + str(len(nsa_markers['scgFailureInformationNR-r15'])) + ' occurences' + statMsg = 'scgFailureInformationNR-r15 = ' + str(len(gnb_markers['scgFailureInformationNR-r15'])) + ' occurences' htmlMsg = statMsg+'\n' logging.debug(statMsg) htmleNBFailureMsg += htmlMsg From 1fc6d12aeffa73a2879c143ecbefda7724b4514c Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 28 Feb 2022 16:43:29 +0100 Subject: [PATCH 629/883] Add retx checkers to make CI test fail on retx thresholds --- ci-scripts/cls_containerize.py | 8 ++- ci-scripts/constants.py | 1 + ci-scripts/main.py | 6 ++ ci-scripts/ran.py | 67 ++++++++++++++++++- .../xml_files/container_5g_f1_rfsim.xml | 2 + .../xml_files/container_5g_fdd_rfsim.xml | 2 + ci-scripts/xml_files/container_5g_rfsim.xml | 2 + 7 files changed, 83 insertions(+), 5 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 2b19a80984..fdc2bc1597 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -106,6 +106,9 @@ class Containerize(): self.registrySvrId = '' self.testSvrId = '' + #checkers from xml + self.ran_checkers={} + #----------------------------------------------------------- # Container management functions #----------------------------------------------------------- @@ -624,7 +627,7 @@ class Containerize(): else: if containerToKill: logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance]) - logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML) + logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML, self.ran_checkers) else: logStatus = 0 if (logStatus < 0): @@ -788,9 +791,10 @@ class Containerize(): continue logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') - logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) + logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers) if (logStatus < 0): fullStatus = False + self.exitStatus = 1 HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) else: HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) diff --git a/ci-scripts/constants.py b/ci-scripts/constants.py index 3c05675928..4f82811ac1 100644 --- a/ci-scripts/constants.py +++ b/ci-scripts/constants.py @@ -45,6 +45,7 @@ ENB_PROCESS_REALTIME_ISSUE = -13 ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14 ENB_PROCESS_SLAVE_RRU_NOT_SYNCED = -15 ENB_REAL_TIME_PROCESSING_ISSUE = -16 +ENB_RETX_ISSUE = -17 HSS_PROCESS_FAILED = -2 HSS_PROCESS_OK = +2 MME_PROCESS_FAILED = -3 diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5357a90a3d..aa7d512b3d 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -401,6 +401,12 @@ def GetParametersFromXML(action): string_field=test.findtext('nb_healthy') if (string_field is not None): CONTAINERS.nb_healthy[0] = int(string_field) + string_field=test.findtext('d_retx_th') + if (string_field is not None): + CONTAINERS.ran_checkers['d_retx_th']= string_field + string_field=test.findtext('u_retx_th') + if (string_field is not None): + CONTAINERS.ran_checkers['u_retx_th']= string_field elif action == 'PingFromContainer': string_field = test.findtext('container_name') diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 87951eb033..9bb2a816ab 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -39,6 +39,7 @@ import time from multiprocessing import Process, Lock, SimpleQueue import yaml + #----------------------------------------------------------- # OAI Testing modules #----------------------------------------------------------- @@ -758,7 +759,7 @@ class RANManagement(): mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15) mySSH.close() - def AnalyzeLogFile_eNB(self, eNBlogFile, HTML): + def AnalyzeLogFile_eNB(self, eNBlogFile, HTML, checkers={}): if (not os.path.isfile('./' + eNBlogFile)): return -1 enb_log_file = open('./' + eNBlogFile, 'r') @@ -819,6 +820,8 @@ class RANManagement(): gnb_markers ={'SgNBReleaseRequestAcknowledge': [],'FAILURE': [], 'scgFailureInformationNR-r15': [], 'SgNBReleaseRequest': [], 'Detected UL Failure on PUSCH':[]} nodeB_prefix_found = False RealTimeProcessingIssue = False + DLRetxIssue = False + ULRetxIssue = False line_cnt=0 #log file line counter for line in enb_log_file.readlines(): @@ -1117,14 +1120,56 @@ class RANManagement(): logging.debug(statMsg) htmleNBFailureMsg += htmlMsg - #ulsch and dlsch statistics + #ulsch and dlsch statistics and checkers + #print statistics into html if len(dlsch_ulsch_stats)!=0: #check if dictionary is not empty + #for each dictionary key, generate the msg for html as information statMsg='' - for key in dlsch_ulsch_stats: #for each dictionary key + for key in dlsch_ulsch_stats: statMsg += dlsch_ulsch_stats[key] + '\n' logging.debug(dlsch_ulsch_stats[key]) htmleNBFailureMsg += statMsg + #checker + if (len(dlsch_ulsch_stats)!=0) and (len(checkers)!=0): + if 'd_retx_th' in checkers: + checkers['d_retx_th'] = [float(x) for x in checkers['d_retx_th'].split(',')] + dlsch_checker_status = list(0 for i in checkers['d_retx_th'])#status 0 / -1 + d_perc_retx = list(0 for i in checkers['d_retx_th'])#results in % + + if 'u_retx_th' in checkers: + checkers['u_retx_th'] = [float(x) for x in checkers['u_retx_th'].split(',')] + ulsch_checker_status = list(0 for i in checkers['u_retx_th']) + u_perc_retx = list(0 for i in checkers['u_retx_th']) + + #ul and dl retransmissions checkers + #NOTICE: DL and UL regex are different + + if ('dlsch_rounds' in dlsch_ulsch_stats) and ('d_retx_th' in checkers): + tmp=re.match(r'^.*dlsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+dlsch_errors\s+(\d+)',dlsch_ulsch_stats['dlsch_rounds']) + if tmp is not None : + #captures the different groups from the regex + retx_data=[float(x) for x in tmp.groups()] + for i in range(0,len(d_perc_retx)): + #case where numerator > denumerator with denum ==0 is disregarded, cannot hapen in principle, will lead to 0% + d_perc_retx[i] = 0 if (retx_data[i] == 0) else 100*retx_data[i+1]/retx_data[i] + #treating % > 100 , % > requirement + if (d_perc_retx[i] > 100) or (d_perc_retx[i] > checkers['d_retx_th'][i]): dlsch_checker_status[i] = -1 + if -1 in dlsch_checker_status: + DLRetxIssue = True + + if ('ulsch_rounds' in dlsch_ulsch_stats) and ('u_retx_th' in checkers): + tmp=re.match(r'^.*ulsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+.*,\s+ulsch_errors\s+(\d+)',dlsch_ulsch_stats['ulsch_rounds']) + if tmp is not None : + retx_data=[float(x) for x in tmp.groups()] + for i in range(0,len(d_perc_retx)): + u_perc_retx[i] = 0 if (retx_data[i] == 0) else 100*retx_data[i+1]/retx_data[i] + if (u_perc_retx[i] > 100) or (u_perc_retx[i] > checkers['u_retx_th'][i]): ulsch_checker_status[i] = -1 + if -1 in ulsch_checker_status: + ULRetxIssue = True + + + #real time statistics datalog_rt_stats['Data']={} if len(real_time_stats)!=0: #check if dictionary is not empty @@ -1174,6 +1219,22 @@ class RANManagement(): logging.debug(statMsg) htmleNBFailureMsg += htmlMsg + if DLRetxIssue: + retx_checker_status_str = '' + for status in dlsch_checker_status : retx_checker_status_str+=str(status)+ ' ' + logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with too many retransmissions / errors issue in DL ! \u001B[0m') + logging.debug('\u001B[1;37;41m Status : ' + retx_checker_status_str + ' \u001B[0m') + htmleNBFailureMsg += 'Fail due to retransmissions / errors issue in DL, status : ' + retx_checker_status_str + '\n' + global_status = CONST.ENB_RETX_ISSUE + + if ULRetxIssue: + retx_checker_status_str = '' + for status in ulsch_checker_status : retx_checker_status_str+=str(status)+ ' ' + logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with too many retransmissions / errors issue in UL ! \u001B[0m') + logging.debug('\u001B[1;37;41m Status : ' + retx_checker_status_str + ' \u001B[0m') + htmleNBFailureMsg += 'Fail due to retransmissions / errors issue in UL, status : ' + retx_checker_status_str + '\n' + global_status = CONST.ENB_RETX_ISSUE + if RealTimeProcessingIssue: logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with real time processing issue! \u001B[0m') htmleNBFailureMsg += 'Fail due to real time processing issue\n' diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml index fc24a3d67c..05b20afed3 100644 --- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml @@ -116,6 +116,8 @@ UndeployGenObject Undeploy all OAI 5G stack yaml_files/5g_f1_rfsimulator + 5,0,0,0 + 5,0,0,0 diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index 28269b2d03..61a2af9e54 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -111,6 +111,8 @@ UndeployGenObject Undeploy all OAI 5G stack yaml_files/5g_fdd_rfsimulator + 5,0,0,0 + 5,0,0,0 diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index 7485b1f8ba..bab7f9637a 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -109,6 +109,8 @@ UndeployGenObject Undeploy all OAI 5G stack yaml_files/5g_rfsimulator + 5,0,0,0 + 5,0,0,0 From f2ffe3f9b05842d7e1f9794ab4778bb0babd5641 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 28 Feb 2022 16:58:11 +0100 Subject: [PATCH 630/883] Fix CI code --- ci-scripts/ran.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index d295339cca..44626dba74 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -1130,7 +1130,7 @@ class RANManagement(): metric=tmp.group('metric') avg=float(tmp.group('avg')) max=float(tmp.group('max')) - count=float(tmp.group('count')) + count=int(tmp.group('count')) datalog_rt_stats['Data'][metric]=["{:.0f}".format(avg),"{:.0f}".format(max),"{:d}".format(count),"{:.2f}".format(avg/datalog_rt_stats['Ref'][metric])] #once all metrics are collected, store the data as a class attribute to build a dedicated HTML table afterward self.datalog_rt_stats=datalog_rt_stats From c8abd3c0bf16fd6973df5122172dba30bb50de91 Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Mon, 28 Feb 2022 20:47:27 +0100 Subject: [PATCH 631/883] remove lfds v6, lfds v7 for flexran only --- cmake_targets/CMakeLists.txt | 129 ++- .../LFDS/liblfds6.1.1/liblfds611/building.txt | 40 - .../UTIL/LFDS/liblfds6.1.1/liblfds611/dirs | 2 - .../liblfds6.1.1/liblfds611/inc/liblfds611.h | 334 -------- .../liblfds6.1.1/liblfds611/liblfds611.def | 57 -- .../liblfds6.1.1/liblfds611/liblfds611.sln | 38 - .../liblfds6.1.1/liblfds611/liblfds611.vcproj | 800 ------------------ .../liblfds6.1.1/liblfds611/makefile.linux | 111 --- .../liblfds6.1.1/liblfds611/makefile.windows | 97 --- .../LFDS/liblfds6.1.1/liblfds611/readme.txt | 147 ---- .../runme_before_win_kernel_build_readme.txt | 32 - ...me_before_win_kernel_dynamic_lib_build.bat | 15 - ...nme_before_win_kernel_static_lib_build.bat | 15 - .../liblfds6.1.1/liblfds611/sources.dynamic | 37 - .../liblfds6.1.1/liblfds611/sources.static | 35 - .../LFDS/liblfds6.1.1/liblfds611/src/dirs | 3 - .../liblfds611/src/driver_entry.c | 16 - .../liblfds611/src/driver_entry_readme.txt | 4 - .../lfds611_abstraction_cas.c | 71 -- .../lfds611_abstraction_dcas.c | 157 ---- .../lfds611_abstraction_free.c | 44 - .../lfds611_abstraction_increment.c | 98 --- .../lfds611_abstraction_internal_body.h | 2 - .../lfds611_abstraction_internal_wrapper.h | 6 - .../lfds611_abstraction_malloc.c | 40 - .../lfds611_freelist_delete.c | 35 - .../lfds611_freelist_get_and_set.c | 37 - .../lfds611_freelist_internal.h | 40 - .../lfds611_freelist/lfds611_freelist_new.c | 136 --- .../lfds611_freelist_pop_push.c | 87 -- .../lfds611_freelist/lfds611_freelist_query.c | 110 --- ...lfds611_liblfds_abstraction_test_helpers.c | 106 --- .../lfds611_liblfds_aligned_free.c | 17 - .../lfds611_liblfds_aligned_malloc.c | 31 - .../lfds611_liblfds_internal.h | 4 - .../lfds611_liblfds_readme.txt | 2 - .../src/lfds611_queue/lfds611_queue_delete.c | 57 -- .../lfds611_queue/lfds611_queue_internal.h | 59 -- .../src/lfds611_queue/lfds611_queue_new.c | 158 ---- .../src/lfds611_queue/lfds611_queue_query.c | 150 ---- .../src/lfds611_queue/lfds611_queue_queue.c | 184 ---- .../lfds611_ringbuffer_delete.c | 22 - .../lfds611_ringbuffer_get_and_put.c | 105 --- .../lfds611_ringbuffer_internal.h | 24 - .../lfds611_ringbuffer_new.c | 63 -- .../lfds611_ringbuffer_query.c | 64 -- .../src/lfds611_slist/lfds611_slist_delete.c | 83 -- .../lfds611_slist/lfds611_slist_get_and_set.c | 133 --- .../lfds611_slist/lfds611_slist_internal.h | 53 -- .../src/lfds611_slist/lfds611_slist_link.c | 53 -- .../src/lfds611_slist/lfds611_slist_new.c | 114 --- .../src/lfds611_stack/lfds611_stack_delete.c | 67 -- .../lfds611_stack/lfds611_stack_internal.h | 51 -- .../src/lfds611_stack/lfds611_stack_new.c | 156 ---- .../lfds611_stack/lfds611_stack_push_pop.c | 110 --- .../src/lfds611_stack/lfds611_stack_query.c | 154 ---- .../liblfds611/src/liblfds611_internal.h | 25 - .../UTIL/LFDS/liblfds6.1.1/test/building.txt | 51 -- .../LFDS/liblfds6.1.1/test/makefile.linux | 82 -- .../LFDS/liblfds6.1.1/test/makefile.windows | 64 -- .../LFDS/liblfds6.1.1/test/src/abstraction.h | 50 -- .../test/src/abstraction_cpu_count.c | 81 -- .../test/src/abstraction_thread_start.c | 141 --- .../test/src/abstraction_thread_wait.c | 71 -- .../test/src/benchmark_freelist.c | 134 --- .../liblfds6.1.1/test/src/benchmark_queue.c | 138 --- .../test/src/benchmark_ringbuffer.c | 137 --- .../liblfds6.1.1/test/src/benchmark_stack.c | 134 --- .../LFDS/liblfds6.1.1/test/src/internal.h | 123 --- .../UTIL/LFDS/liblfds6.1.1/test/src/main.c | 83 -- .../UTIL/LFDS/liblfds6.1.1/test/src/misc.c | 119 --- .../LFDS/liblfds6.1.1/test/src/structures.h | 205 ----- .../liblfds6.1.1/test/src/test_abstraction.c | 323 ------- .../liblfds6.1.1/test/src/test_freelist.c | 673 --------------- .../LFDS/liblfds6.1.1/test/src/test_queue.c | 515 ----------- .../liblfds6.1.1/test/src/test_ringbuffer.c | 472 ----------- .../LFDS/liblfds6.1.1/test/src/test_slist.c | 388 --------- .../LFDS/liblfds6.1.1/test/src/test_stack.c | 582 ------------- openair2/UTIL/LFDS/liblfds6.1.1/test/test.sln | 79 -- .../UTIL/LFDS/liblfds6.1.1/test/test.vcproj | 415 --------- 80 files changed, 55 insertions(+), 9825 deletions(-) delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/building.txt delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/dirs delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/inc/liblfds611.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.def delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.sln delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.vcproj delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/makefile.linux delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/makefile.windows delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/readme.txt delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_build_readme.txt delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_dynamic_lib_build.bat delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_static_lib_build.bat delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/sources.dynamic delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/sources.static delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/dirs delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/driver_entry.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/driver_entry_readme.txt delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_cas.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_dcas.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_free.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_increment.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_internal_body.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_internal_wrapper.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_malloc.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_delete.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_get_and_set.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_internal.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_pop_push.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_query.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_abstraction_test_helpers.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_aligned_free.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_aligned_malloc.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_internal.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_readme.txt delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_internal.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_queue.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_delete.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_get_and_put.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_internal.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_delete.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_get_and_set.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_internal.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_link.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_internal.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_push_pop.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_query.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/liblfds611_internal.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/building.txt delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/makefile.linux delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/makefile.windows delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_cpu_count.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_thread_start.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_thread_wait.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_freelist.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_queue.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_ringbuffer.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_stack.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/internal.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/main.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/misc.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/structures.h delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_abstraction.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_freelist.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_queue.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_ringbuffer.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_slist.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_stack.c delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/test.sln delete mode 100644 openair2/UTIL/LFDS/liblfds6.1.1/test/test.vcproj diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 82022da78f..d6c70ebdc8 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1103,8 +1103,6 @@ include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC") include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PDCP") include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/S1AP") include_directories("${OPENAIR2_DIR}/UTIL/OSA") -include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc") -include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc") include_directories("${OPENAIR2_DIR}/UTIL/MEM") include_directories("${OPENAIR2_DIR}/UTIL/LISTS") include_directories("${OPENAIR2_DIR}/UTIL/FIFO") @@ -1119,8 +1117,29 @@ include_directories("${OPENAIR2_DIR}/UTIL/OMV") include_directories("${OPENAIR2_DIR}/RRC/LTE/MESSAGES") include_directories("${OPENAIR_DIR}") -# Utilities Library +# flexran ################ +# Make lfds as a own source code (even if it is a outside library) +# only user: Flexran, please don't use lfds in any other component +################################################################### + +set(lfds7 ${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/src/) +file(GLOB lfds7_queue ${lfds7}/lfds700_queue/*.c) +file(GLOB lfds7_ring ${lfds7}/lfds700_ringbuffer/*.c) +file(GLOB lfds7_qbss ${lfds7}/lfds700_queue_bounded_singleconsumer_singleproducer/*.c) +file(GLOB lfds7_stack ${lfds7}/lfds700_stack/*.c) +file(GLOB lfds7_freelist ${lfds7}/lfds700_freelist/*.c) +file(GLOB lfds7_btree ${lfds7}/lfds700_btree_addonly_unbalanced/*.c) +file(GLOB lfds7_hash ${lfds7}/lfds700_hash_addonly/*.c) +file(GLOB lfds7_ordered_list ${lfds7}/lfds700_list_addonly_ordered_singlylinked/*.c) +file(GLOB lfds7_unordered_list ${lfds7}/lfds700_list_addonly_singlylinked_unordered/*.c) +file(GLOB lfds7_misc ${lfds7}/lfds700_misc/*.c) + +add_library(LFDS7 + ${lfds7_queue} ${lfds7_ring} ${lfds7_qbss} ${lfds7_stack} ${lfds7_freelist} ${lfds7_btree} ${lfds7_hash} ${lfds7_ordered_list} ${lfds7_unordered_list} ${lfds7_misc} +) + +target_include_directories(LFDS7 PRIVATE "${lfds7}") # set the version of protobuf messages, V3 not supported yet add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3) @@ -1168,6 +1187,9 @@ add_library(FLPT_MSG ${FLPT_OAI_generated} ${FLPT_source} ) +target_link_libraries(FLPT_MSG LFDS7) +add_dependencies(FLPT_MSG LFDS7) + set(FLPT_MSG_LIB FLPT_MSG) #message("prpt c dir is : ${FLPT_C_DIR}") include_directories (${FLPT_C_DIR}) @@ -1179,6 +1201,7 @@ add_library(ASYNC_IF ${OPENAIR2_DIR}/UTIL/ASYNC_IF/ringbuffer_queue.c ) set(ASYNC_IF_LIB ASYNC_IF) +target_include_directories(ASYNC_IF PRIVATE "${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc") include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF) add_library(FLEXRAN_AGENT @@ -1201,7 +1224,9 @@ add_library(FLEXRAN_AGENT ${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_slice_verification.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_app.c ) -add_dependencies(FLEXRAN_AGENT rrc_flag) +add_dependencies(FLEXRAN_AGENT rrc_flag ASYNC_IF) +target_link_libraries(FLEXRAN_AGENT ASYNC_IF LFDS7) +target_include_directories(FLEXRAN_AGENT PRIVATE "${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc") set(FLEXRAN_AGENT_LIB FLEXRAN_AGENT) add_library(flapp_sample SHARED ${OPENAIR2_DIR}/ENB_APP/flexran_apps/sample.c @@ -1261,19 +1286,14 @@ set(FSPT_MSG_LIB FSPT_MSG) message("fspt c dir is : ${FSPT_C_DIR}") include_directories (${FSPT_C_DIR}) -# add_library(ASYNC_IF -# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/socket_link.c -# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/link_manager.c -# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/message_queue.c -# ${OPENAIR2_DIR}/UTIL/ASYNC_IF/ringbuffer_queue.c -# ) -# set(ASYNC_IF_LIB ASYNC_IF) -# include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF) - set(PROTOBUF_LIB "protobuf-c") #set(PROTOBUF_LIB "protobuf") #for Cpp +########### +# Utilities +############### + add_library(HASHTABLE ${OPENAIR_DIR}/common/utils/hashtable/hashtable.c ${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c @@ -1935,7 +1955,6 @@ set(L2_SRC ${PDCP_DIR}/pdcp_primitives.c ${PDCP_DIR}/pdcp_util.c ${PDCP_DIR}/pdcp_security.c - ${PDCP_DIR}/pdcp_netlink.c ${OPENAIR2_DIR}/LAYER2/openair2_proc.c # ${RRC_DIR}/rrc_UE.c ${RRC_DIR}/rrc_eNB.c @@ -1990,7 +2009,6 @@ set(L2_SRC_UE ${PDCP_DIR}/pdcp_primitives.c ${PDCP_DIR}/pdcp_util.c ${PDCP_DIR}/pdcp_security.c - ${PDCP_DIR}/pdcp_netlink.c ${RRC_DIR}/rrc_UE.c ${RRC_DIR}/rrc_common.c ${RRC_DIR}/L2_interface_common.c @@ -2530,43 +2548,6 @@ add_library(LIB_5GNAS_GNB ) target_link_libraries(LIB_5GNAS_GNB SECU_CN ${CRYPTO_LIBRARIES}) -# Make lfds as a own source code (even if it is a outside library) -# For better intergration with compilation flags & structure of cmake -################################################################### -set(lfds ${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/src/) -file(GLOB lfds_queue ${lfds}/lfds611_queue/*.c) -file(GLOB lfds_ring ${lfds}/lfds611_ringbuffer/*.c) -file(GLOB lfds_slist ${lfds}/lfds611_slist/*.c) -file(GLOB lfds_stack ${lfds}/lfds611_stack/*.c) -file(GLOB lfds_freelist ${lfds}/lfds611_freelist/*.c) - -include_directories(${lfds}) -add_library(LFDS - ${lfds_queue} ${lfds_ring} ${lfds_slist} ${lfds_stack} ${lfds_freelist} - ${lfds}/lfds611_liblfds/lfds611_liblfds_abstraction_test_helpers.c - ${lfds}/lfds611_liblfds/lfds611_liblfds_aligned_free.c - ${lfds}/lfds611_liblfds/lfds611_liblfds_aligned_malloc.c - ${lfds}/lfds611_abstraction/lfds611_abstraction_free.c - ${lfds}/lfds611_abstraction/lfds611_abstraction_malloc.c -) - -set(lfds7 ${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/src/) -file(GLOB lfds7_queue ${lfds7}/lfds700_queue/*.c) -file(GLOB lfds7_ring ${lfds7}/lfds700_ringbuffer/*.c) -file(GLOB lfds7_qbss ${lfds7}/lfds700_queue_bounded_singleconsumer_singleproducer/*.c) -file(GLOB lfds7_stack ${lfds7}/lfds700_stack/*.c) -file(GLOB lfds7_freelist ${lfds7}/lfds700_freelist/*.c) -file(GLOB lfds7_btree ${lfds7}/lfds700_btree_addonly_unbalanced/*.c) -file(GLOB lfds7_hash ${lfds7}/lfds700_hash_addonly/*.c) -file(GLOB lfds7_ordered_list ${lfds7}/lfds700_list_addonly_ordered_singlylinked/*.c) -file(GLOB lfds7_unordered_list ${lfds7}/lfds700_list_addonly_singlylinked_unordered/*.c) -file(GLOB lfds7_misc ${lfds7}/lfds700_misc/*.c) - -include_directories(${lfds7}) -add_library(LFDS7 - ${lfds7_queue} ${lfds7_ring} ${lfds7_qbss} ${lfds7_stack} ${lfds7_freelist} ${lfds7_btree} ${lfds7_hash} ${lfds7_ordered_list} ${lfds7_unordered_list} ${lfds7_misc} -) - add_library(SIMU_COMMON ${OPENAIR1_DIR}/SIMULATION/TOOLS/random_channel.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/rangen_double.c @@ -2760,8 +2741,8 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer) target_link_libraries (lte-softmodem -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB - PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7 - ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} + PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) @@ -2804,8 +2785,8 @@ target_link_libraries (ocp-enb -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB - PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON - ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} + PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU_COMMON + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} -Wl,--end-group z dl) target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB}) @@ -2870,8 +2851,8 @@ target_link_libraries (lte-uesoftmodem -Wl,--start-group RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON - PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB - ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES} + PHY_UE PHY_RU L2_UE L2_LTE SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES} -Wl,--end-group z dl) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) @@ -2913,8 +2894,8 @@ add_executable(nr-softmodem target_link_libraries (nr-softmodem -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA + ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB} -Wl,--end-group z dl) @@ -2953,8 +2934,8 @@ add_executable(ocp-gnb target_link_libraries (ocp-gnb -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA + ITTI ${FLPT_MSG_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON -Wl,--end-group z dl) @@ -2998,11 +2979,11 @@ add_executable(nr-uesoftmodem target_link_libraries (nr-uesoftmodem -Wl,--start-group RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB - PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB + PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB - ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES} NFAPI_USER_LIB S1AP_LIB S1AP_ENB - ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} + ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} -Wl,--end-group z dl) target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) @@ -3032,7 +3013,7 @@ add_executable(dlsim_tm4 ${T_SOURCE} ) target_link_libraries (dlsim_tm4 - -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ITTI -Wl,--end-group + -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY ITTI -Wl,--end-group pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${T_LIB} ) @@ -3236,7 +3217,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr ${NFAPI_USER_DIR}/nfapi.c ) target_link_libraries (${myExe} - -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU LFDS ITTI LFDS7 -Wl,--end-group + -Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU ITTI -Wl,--end-group pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl ) @@ -3251,7 +3232,7 @@ add_executable(test_epc_generate_scenario ${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h ) target_link_libraries (test_epc_generate_scenario - -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY LFDS ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) add_executable(test_epc_play_scenario @@ -3270,7 +3251,7 @@ add_executable(test_epc_play_scenario ) target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c) target_link_libraries (test_epc_play_scenario - -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) @@ -3290,7 +3271,7 @@ foreach(myExe s1ap ${OPENAIR3_DIR}/TEST/test_${myExe}.c ) target_link_libraries (test_${myExe} - -Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} + -Wl,--start-group SECU_CN UTIL -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB} ) endforeach(myExe) @@ -3311,12 +3292,12 @@ if (${T_TRACER}) ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai - coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO + coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB - CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB + CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts) if (TARGET ${i}) add_dependencies(${i} generate_T) @@ -3424,8 +3405,8 @@ add_executable(nr-ittisim target_link_libraries (nr-ittisim -Wl,--start-group - UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA - ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB + UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA + ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB} PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/building.txt b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/building.txt deleted file mode 100644 index 56b4be609f..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/building.txt +++ /dev/null @@ -1,40 +0,0 @@ -building liblfds -================ - -Windows (user-mode) -=================== -1. Use Microsoft Visual Studio 2008 or Visual C++ 2008 Express Edition (or - later versions) to load "liblfds.sln". The "Win32" platform is x86, - the "x64" platform is x64. - -2. Use Microsoft Windows SDK and GNUmake to run makefile.windows (obviously - you'll need to have run setenv.bat or the appropriate vcvars*.bat first; - you can build for x64/64-bit and x86/32-bit - just run the correct batch - file). - - Targets are "librel", "libdbg", "dllrel", "dlldbg" and "clean". You need - to clean between switching targets. - -Windows (kernel) -================ -Use the Windows Driver Kit "build" command. Prior to running "build", -if you wish to build a static library, run the batch file -"runme_before_win_kernel_static_lib_build.bat"; if you wish to -build a dynamic library, instead run "runme_before_win_kernel_dynamic_lib_build.bat". - -The Windows kernel build system is rather limited and rather than -really rather messing up the directory/file structure just for the -Windows kernel platform, I've instead arranged it that these batch -files do the necessary work so that "build" will work. - -The batch files are idempotent; you can run them as often as you -like, in any order, at any time (before or after builds), and they'll -do the right thing. You need to clean between switching targets. - -Linux -===== -Use GNUmake to run "makefile.linux". Targets are "arrel", "ardbg", -"sorel", "sodbg" and "clean". You need to clean between switching -targets. - - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/dirs b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/dirs deleted file mode 100644 index 0be5295378..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/dirs +++ /dev/null @@ -1,2 +0,0 @@ -DIRS = src - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/inc/liblfds611.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/inc/liblfds611.h deleted file mode 100644 index f2c05ee5e3..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/inc/liblfds611.h +++ /dev/null @@ -1,334 +0,0 @@ -#ifndef __LIBLFDS611_H - -/***** library header *****/ -#define LFDS611_RELEASE_NUMBER_STRING "6.1.1" - - - - -/***** lfds611_abstraction *****/ - -/***** defines *****/ -#if (defined _WIN64 && defined _MSC_VER && !defined WIN_KERNEL_BUILD) -// TRD : 64-bit Windows user-mode with the Microsoft C compiler, any CPU -#include -#include -#include -#include -#include -typedef unsigned __int64 lfds611_atom_t; -#define LFDS611_INLINE __forceinline -#define LFDS611_ALIGN(alignment) __declspec( align(alignment) ) -#define LFDS611_ALIGN_SINGLE_POINTER 8 -#define LFDS611_ALIGN_DOUBLE_POINTER 16 -#define LFDS611_BARRIER_COMPILER_LOAD _ReadBarrier() -#define LFDS611_BARRIER_COMPILER_STORE _WriteBarrier() -#define LFDS611_BARRIER_COMPILER_FULL _ReadWriteBarrier() -#define LFDS611_BARRIER_PROCESSOR_LOAD _mm_lfence() -#define LFDS611_BARRIER_PROCESSOR_STORE _mm_sfence() -#define LFDS611_BARRIER_PROCESSOR_FULL _mm_mfence() -#endif - -#if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD) -// TRD : 32-bit Windows user-mode with the Microsoft C compiler, any CPU -#include -#include -#include -#include -#include -typedef unsigned long int lfds611_atom_t; -#define LFDS611_INLINE __forceinline -#define LFDS611_ALIGN(alignment) __declspec( align(alignment) ) -#define LFDS611_ALIGN_SINGLE_POINTER 4 -#define LFDS611_ALIGN_DOUBLE_POINTER 8 -#define LFDS611_BARRIER_COMPILER_LOAD _ReadBarrier() -#define LFDS611_BARRIER_COMPILER_STORE _WriteBarrier() -#define LFDS611_BARRIER_COMPILER_FULL _ReadWriteBarrier() -#define LFDS611_BARRIER_PROCESSOR_LOAD _mm_lfence() -#define LFDS611_BARRIER_PROCESSOR_STORE _mm_sfence() -#define LFDS611_BARRIER_PROCESSOR_FULL _mm_mfence() - -// TRD : this define is documented but missing in Microsoft Platform SDK v7.0 -#define _InterlockedCompareExchangePointer(destination, exchange, compare) _InterlockedCompareExchange((volatile long *) destination, (long) exchange, (long) compare) -#endif - -#if (defined _WIN64 && defined _MSC_VER && defined WIN_KERNEL_BUILD) -// TRD : 64-bit Windows kernel with the Microsoft C compiler, any CPU -#include -#include -#include -#include -typedef unsigned __int64 lfds611_atom_t; -#define LFDS611_INLINE __forceinline -#define LFDS611_ALIGN(alignment) __declspec( align(alignment) ) -#define LFDS611_ALIGN_SINGLE_POINTER 8 -#define LFDS611_ALIGN_DOUBLE_POINTER 16 -#define LFDS611_BARRIER_COMPILER_LOAD _ReadBarrier() -#define LFDS611_BARRIER_COMPILER_STORE _WriteBarrier() -#define LFDS611_BARRIER_COMPILER_FULL _ReadWriteBarrier() -#define LFDS611_BARRIER_PROCESSOR_LOAD _mm_lfence() -#define LFDS611_BARRIER_PROCESSOR_STORE _mm_sfence() -#define LFDS611_BARRIER_PROCESSOR_FULL _mm_mfence() -#endif - -#if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD) -// TRD : 32-bit Windows kernel with the Microsoft C compiler, any CPU -#include -#include -#include -#include -typedef unsigned long int lfds611_atom_t; -#define LFDS611_INLINE __forceinline -#define LFDS611_ALIGN(alignment) __declspec( align(alignment) ) -#define LFDS611_ALIGN_SINGLE_POINTER 4 -#define LFDS611_ALIGN_DOUBLE_POINTER 8 -#define LFDS611_BARRIER_COMPILER_LOAD _ReadBarrier() -#define LFDS611_BARRIER_COMPILER_STORE _WriteBarrier() -#define LFDS611_BARRIER_COMPILER_FULL _ReadWriteBarrier() -#define LFDS611_BARRIER_PROCESSOR_LOAD _mm_lfence() -#define LFDS611_BARRIER_PROCESSOR_STORE _mm_sfence() -#define LFDS611_BARRIER_PROCESSOR_FULL _mm_mfence() - -// TRD : this define is documented but missing in Microsoft Platform SDK v7.0 -#define _InterlockedCompareExchangePointer(destination, exchange, compare) _InterlockedCompareExchange((volatile long *) destination, (long) exchange, (long) compare) -#endif - -#if (defined __unix__ && defined __x86_64__ && __GNUC__) -// TRD : any UNIX with GCC on x64 -#include -#include -#include -typedef unsigned long long int lfds611_atom_t; -#define LFDS611_INLINE inline -#define LFDS611_ALIGN(alignment) __attribute__( (aligned(alignment)) ) -#define LFDS611_ALIGN_SINGLE_POINTER 8 -#define LFDS611_ALIGN_DOUBLE_POINTER 16 -#define LFDS611_BARRIER_COMPILER_LOAD __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_COMPILER_STORE __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_COMPILER_FULL __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_PROCESSOR_LOAD __sync_synchronize() -#define LFDS611_BARRIER_PROCESSOR_STORE __sync_synchronize() -#define LFDS611_BARRIER_PROCESSOR_FULL __sync_synchronize() -#endif - -#if (defined __unix__ && defined __i386__ && __GNUC__) -// TRD : any UNIX with GCC on x86 -#include -#include -#include -typedef unsigned long int lfds611_atom_t; -#define LFDS611_INLINE inline -#define LFDS611_ALIGN(alignment) __attribute__( (aligned(alignment)) ) -#define LFDS611_ALIGN_SINGLE_POINTER 4 -#define LFDS611_ALIGN_DOUBLE_POINTER 8 -#define LFDS611_BARRIER_COMPILER_LOAD __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_COMPILER_STORE __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_COMPILER_FULL __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_PROCESSOR_LOAD __sync_synchronize() -#define LFDS611_BARRIER_PROCESSOR_STORE __sync_synchronize() -#define LFDS611_BARRIER_PROCESSOR_FULL __sync_synchronize() -#endif - -#if (defined __unix__ && defined __arm__ && __GNUC__) -// TRD : any UNIX with GCC on ARM -#include -#include -#include -typedef unsigned long int lfds611_atom_t; -#define LFDS611_INLINE inline -#define LFDS611_ALIGN(alignment) __attribute__( (aligned(alignment)) ) -#define LFDS611_ALIGN_SINGLE_POINTER 4 -#define LFDS611_ALIGN_DOUBLE_POINTER 8 -#define LFDS611_BARRIER_COMPILER_LOAD __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_COMPILER_STORE __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_COMPILER_FULL __asm__ __volatile__ ( "" : : : "memory" ) -#define LFDS611_BARRIER_PROCESSOR_LOAD __sync_synchronize() -#define LFDS611_BARRIER_PROCESSOR_STORE __sync_synchronize() -#define LFDS611_BARRIER_PROCESSOR_FULL __sync_synchronize() -#endif - -#define LFDS611_BARRIER_LOAD LFDS611_BARRIER_COMPILER_LOAD; LFDS611_BARRIER_PROCESSOR_LOAD; LFDS611_BARRIER_COMPILER_LOAD -#define LFDS611_BARRIER_STORE LFDS611_BARRIER_COMPILER_STORE; LFDS611_BARRIER_PROCESSOR_STORE; LFDS611_BARRIER_COMPILER_STORE -#define LFDS611_BARRIER_FULL LFDS611_BARRIER_COMPILER_FULL; LFDS611_BARRIER_PROCESSOR_FULL; LFDS611_BARRIER_COMPILER_FULL - -/***** enums *****/ -enum lfds611_data_structure_validity { - LFDS611_VALIDITY_VALID, - LFDS611_VALIDITY_INVALID_LOOP, - LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS, - LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS, - LFDS611_VALIDITY_INVALID_TEST_DATA -}; - -/***** structs *****/ -struct lfds611_validation_info { - lfds611_atom_t - min_elements, - max_elements; -}; - -/***** public prototypes *****/ -void *lfds611_abstraction_malloc( size_t size ); -void lfds611_abstraction_free( void *memory ); - - - - - -/***** lfds611_freelist *****/ - -/***** enums *****/ -enum lfds611_freelist_query_type { - LFDS611_FREELIST_QUERY_ELEMENT_COUNT, - LFDS611_FREELIST_QUERY_VALIDATE -}; - -/***** incomplete types *****/ -struct lfds611_freelist_state; -struct lfds611_freelist_element; - -/***** public prototypes *****/ -int lfds611_freelist_new( struct lfds611_freelist_state **fs, lfds611_atom_t number_elements, int (*user_data_init_function)(void **user_data, void *user_state), void *user_state ); -void lfds611_freelist_use( struct lfds611_freelist_state *fs ); -void lfds611_freelist_delete( struct lfds611_freelist_state *fs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ); - -lfds611_atom_t lfds611_freelist_new_elements( struct lfds611_freelist_state *fs, lfds611_atom_t number_elements ); - -struct lfds611_freelist_element *lfds611_freelist_pop( struct lfds611_freelist_state *fs, struct lfds611_freelist_element **fe ); -struct lfds611_freelist_element *lfds611_freelist_guaranteed_pop( struct lfds611_freelist_state *fs, struct lfds611_freelist_element **fe ); -void lfds611_freelist_push( struct lfds611_freelist_state *fs, struct lfds611_freelist_element *fe ); - -void *lfds611_freelist_get_user_data_from_element( struct lfds611_freelist_element *fe, void **user_data ); -void lfds611_freelist_set_user_data_in_element( struct lfds611_freelist_element *fe, void *user_data ); - -void lfds611_freelist_query( struct lfds611_freelist_state *fs, enum lfds611_freelist_query_type query_type, void *query_input, void *query_output ); - - - - - -/***** lfds611_liblfds *****/ - -/***** public prototypes *****/ -void lfds611_liblfds_abstraction_test_helper_increment_non_atomic( lfds611_atom_t *shared_counter ); -void lfds611_liblfds_abstraction_test_helper_increment_atomic( volatile lfds611_atom_t *shared_counter ); -void lfds611_liblfds_abstraction_test_helper_cas( volatile lfds611_atom_t *shared_counter, lfds611_atom_t *local_counter ); -void lfds611_liblfds_abstraction_test_helper_dcas( volatile lfds611_atom_t *shared_counter, lfds611_atom_t *local_counter ); - - - - - -/***** lfds611_queue *****/ - -/***** enums *****/ -enum lfds611_queue_query_type { - LFDS611_QUEUE_QUERY_ELEMENT_COUNT, - LFDS611_QUEUE_QUERY_VALIDATE -}; - -/***** incomplete types *****/ -struct lfds611_queue_state; - -/***** public prototypes *****/ -int lfds611_queue_new( struct lfds611_queue_state **sq, lfds611_atom_t number_elements ); -void lfds611_queue_use( struct lfds611_queue_state *qs ); -void lfds611_queue_delete( struct lfds611_queue_state *qs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ); - -int lfds611_queue_enqueue( struct lfds611_queue_state *qs, void *user_data ); -int lfds611_queue_guaranteed_enqueue( struct lfds611_queue_state *qs, void *user_data ); -int lfds611_queue_dequeue( struct lfds611_queue_state *qs, void **user_data ); - -void lfds611_queue_query( struct lfds611_queue_state *qs, enum lfds611_queue_query_type query_type, void *query_input, void *query_output ); - - - - - -/***** lfds611_ringbuffer *****/ - -/***** enums *****/ -enum lfds611_ringbuffer_query_type { - LFDS611_RINGBUFFER_QUERY_VALIDATE -}; - -/***** incomplete types *****/ -struct lfds611_ringbuffer_state; - -/***** public prototypes *****/ -int lfds611_ringbuffer_new( struct lfds611_ringbuffer_state **rs, lfds611_atom_t number_elements, int (*user_data_init_function)(void **user_data, void *user_state), void *user_state ); -void lfds611_ringbuffer_use( struct lfds611_ringbuffer_state *rs ); -void lfds611_ringbuffer_delete( struct lfds611_ringbuffer_state *rs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ); - -struct lfds611_freelist_element *lfds611_ringbuffer_get_read_element( struct lfds611_ringbuffer_state *rs, struct lfds611_freelist_element **fe ); -struct lfds611_freelist_element *lfds611_ringbuffer_get_write_element( struct lfds611_ringbuffer_state *rs, struct lfds611_freelist_element **fe, int *overwrite_flag ); - -void lfds611_ringbuffer_put_read_element( struct lfds611_ringbuffer_state *rs, struct lfds611_freelist_element *fe ); -void lfds611_ringbuffer_put_write_element( struct lfds611_ringbuffer_state *rs, struct lfds611_freelist_element *fe ); - -void lfds611_ringbuffer_query( struct lfds611_ringbuffer_state *rs, enum lfds611_ringbuffer_query_type query_type, void *query_input, void *query_output ); - - - - - -/***** lfds611_slist *****/ - -/***** incomplete types *****/ -struct lfds611_slist_state; -struct lfds611_slist_element; - -/***** public prototypes *****/ -int lfds611_slist_new( struct lfds611_slist_state **ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ); -void lfds611_slist_use( struct lfds611_slist_state *ss ); -void lfds611_slist_delete( struct lfds611_slist_state *ss ); - -struct lfds611_slist_element *lfds611_slist_new_head( struct lfds611_slist_state *ss, void *user_data ); -struct lfds611_slist_element *lfds611_slist_new_next( struct lfds611_slist_element *se, void *user_data ); - -int lfds611_slist_logically_delete_element( struct lfds611_slist_state *ss, struct lfds611_slist_element *se ); -void lfds611_slist_single_threaded_physically_delete_all_elements( struct lfds611_slist_state *ss ); - -int lfds611_slist_get_user_data_from_element( struct lfds611_slist_element *se, void **user_data ); -int lfds611_slist_set_user_data_in_element( struct lfds611_slist_element *se, void *user_data ); - -struct lfds611_slist_element *lfds611_slist_get_head( struct lfds611_slist_state *ss, struct lfds611_slist_element **se ); -struct lfds611_slist_element *lfds611_slist_get_next( struct lfds611_slist_element *se, struct lfds611_slist_element **next_se ); -struct lfds611_slist_element *lfds611_slist_get_head_and_then_next( struct lfds611_slist_state *ss, struct lfds611_slist_element **se ); - - - - - -/***** lfds611_stack *****/ - -/***** enums *****/ -enum lfds611_stack_query_type { - LFDS611_STACK_QUERY_ELEMENT_COUNT, - LFDS611_STACK_QUERY_VALIDATE -}; - -/***** incomplete types *****/ -struct lfds611_stack_state; - -/***** public prototypes *****/ -int lfds611_stack_new( struct lfds611_stack_state **ss, lfds611_atom_t number_elements ); -void lfds611_stack_use( struct lfds611_stack_state *ss ); -void lfds611_stack_delete( struct lfds611_stack_state *ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ); - -void lfds611_stack_clear( struct lfds611_stack_state *ss, void (*user_data_clear_function)(void *user_data, void *user_state), void *user_state ); - -int lfds611_stack_push( struct lfds611_stack_state *ss, void *user_data ); -int lfds611_stack_guaranteed_push( struct lfds611_stack_state *ss, void *user_data ); -int lfds611_stack_pop( struct lfds611_stack_state *ss, void **user_data ); - -void lfds611_stack_query( struct lfds611_stack_state *ss, enum lfds611_stack_query_type query_type, void *query_input, void *query_output ); - - - - - -#define __LIBLFDS611_H - -#endif - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.def b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.def deleted file mode 100644 index b9c92b0cf9..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.def +++ /dev/null @@ -1,57 +0,0 @@ -EXPORTS - -lfds611_liblfds_abstraction_test_helper_increment_non_atomic = lfds611_liblfds_abstraction_test_helper_increment_non_atomic @1 -lfds611_liblfds_abstraction_test_helper_increment_atomic = lfds611_liblfds_abstraction_test_helper_increment_atomic @2 -lfds611_liblfds_abstraction_test_helper_cas = lfds611_liblfds_abstraction_test_helper_cas @3 -lfds611_liblfds_abstraction_test_helper_dcas = lfds611_liblfds_abstraction_test_helper_dcas @4 - -lfds611_freelist_delete = lfds611_freelist_delete @5 -lfds611_freelist_get_user_data_from_element = lfds611_freelist_get_user_data_from_element @6 -lfds611_freelist_guaranteed_pop = lfds611_freelist_guaranteed_pop @7 -lfds611_freelist_new = lfds611_freelist_new @8 -lfds611_freelist_new_elements = lfds611_freelist_new_elements @9 -lfds611_freelist_pop = lfds611_freelist_pop @10 -lfds611_freelist_push = lfds611_freelist_push @11 -lfds611_freelist_query = lfds611_freelist_query @12 -lfds611_freelist_set_user_data_in_element = lfds611_freelist_set_user_data_in_element @13 -lfds611_freelist_use = lfds611_freelist_use @14 - -lfds611_queue_delete = lfds611_queue_delete @15 -lfds611_queue_dequeue = lfds611_queue_dequeue @16 -lfds611_queue_enqueue = lfds611_queue_enqueue @17 -lfds611_queue_guaranteed_enqueue = lfds611_queue_guaranteed_enqueue @18 -lfds611_queue_new = lfds611_queue_new @19 -lfds611_queue_query = lfds611_queue_query @20 -lfds611_queue_use = lfds611_queue_use @21 - -lfds611_ringbuffer_delete = lfds611_ringbuffer_delete @22 -lfds611_ringbuffer_get_read_element = lfds611_ringbuffer_get_read_element @23 -lfds611_ringbuffer_get_write_element = lfds611_ringbuffer_get_write_element @24 -lfds611_ringbuffer_new = lfds611_ringbuffer_new @25 -lfds611_ringbuffer_put_read_element = lfds611_ringbuffer_put_read_element @26 -lfds611_ringbuffer_put_write_element = lfds611_ringbuffer_put_write_element @27 -lfds611_ringbuffer_query = lfds611_ringbuffer_query @28 -lfds611_ringbuffer_use = lfds611_ringbuffer_use @29 - -lfds611_slist_delete = lfds611_slist_delete @30 -lfds611_slist_get_head = lfds611_slist_get_head @31 -lfds611_slist_get_head_and_then_next = lfds611_slist_get_head_and_then_next @32 -lfds611_slist_get_next = lfds611_slist_get_next @33 -lfds611_slist_get_user_data_from_element = lfds611_slist_get_user_data_from_element @34 -lfds611_slist_logically_delete_element = lfds611_slist_logically_delete_element @35 -lfds611_slist_new = lfds611_slist_new @36 -lfds611_slist_new_head = lfds611_slist_new_head @37 -lfds611_slist_new_next = lfds611_slist_new_next @38 -lfds611_slist_set_user_data_in_element = lfds611_slist_set_user_data_in_element @39 -lfds611_slist_single_threaded_physically_delete_all_elements = lfds611_slist_single_threaded_physically_delete_all_elements @40 -lfds611_slist_use = lfds611_slist_use @41 - -lfds611_stack_clear = lfds611_stack_clear @42 -lfds611_stack_delete = lfds611_stack_delete @43 -lfds611_stack_guaranteed_push = lfds611_stack_guaranteed_push @44 -lfds611_stack_new = lfds611_stack_new @45 -lfds611_stack_pop = lfds611_stack_pop @46 -lfds611_stack_push = lfds611_stack_push @47 -lfds611_stack_query = lfds611_stack_query @48 -lfds611_stack_use = lfds611_stack_use @49 - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.sln b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.sln deleted file mode 100644 index de51b657c4..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblfds611", "liblfds611.vcproj", "{F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug DLL|Win32 = Debug DLL|Win32 - Debug DLL|x64 = Debug DLL|x64 - Debug Lib|Win32 = Debug Lib|Win32 - Debug Lib|x64 = Debug Lib|x64 - Release DLL|Win32 = Release DLL|Win32 - Release DLL|x64 = Release DLL|x64 - Release Lib|Win32 = Release Lib|Win32 - Release Lib|x64 = Release Lib|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|x64.Build.0 = Debug DLL|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|Win32.ActiveCfg = Debug Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|Win32.Build.0 = Debug Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|x64.ActiveCfg = Debug Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|x64.Build.0 = Debug Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|Win32.Build.0 = Release DLL|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|x64.ActiveCfg = Release DLL|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|x64.Build.0 = Release DLL|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|Win32.ActiveCfg = Release Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|Win32.Build.0 = Release Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|x64.ActiveCfg = Release Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|x64.Build.0 = Release Lib|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.vcproj b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.vcproj deleted file mode 100644 index 96d5028eb8..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/liblfds611.vcproj +++ /dev/null @@ -1,800 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/makefile.linux b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/makefile.linux deleted file mode 100644 index 2655d8ec5e..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/makefile.linux +++ /dev/null @@ -1,111 +0,0 @@ -##### paths ##### -OUTDIR := . -BINDIR = $(OUTDIR)/bin -OBJDIR = $(OUTDIR)/obj -INCDIR = inc -SRCDIR = src - -##### misc ##### -QUIETLY = 1>/dev/null 2>/dev/null - -##### sources, objects and libraries ##### -BINNAME = liblfds611 -AR_BINARY = $(BINDIR)/$(BINNAME).a -$(info $(AR_BINARY)) -SO_BINARY = $(BINDIR)/$(BINNAME).so -SRCDIRS = lfds611_abstraction lfds611_freelist lfds611_liblfds lfds611_queue lfds611_ringbuffer lfds611_slist lfds611_stack -# TRD : be aware - in the linux makefile, with the one-pass linking behaviour of the GNU linker, the order -# of source files matters! this is because it leads to the ordering of objects in the library and -# that in turn, since the data structures all use the freelist API and the abstraction API, has to be -# correct -# TRD : lfds611_abstraction_cas.c lfds611_abstraction_dcas.c lfds611_abstraction_increment.c are inlined and are compiled by every C file -SOURCES = lfds611_queue_delete.c lfds611_queue_new.c lfds611_queue_query.c lfds611_queue_queue.c \ - lfds611_ringbuffer_delete.c lfds611_ringbuffer_get_and_put.c lfds611_ringbuffer_new.c lfds611_ringbuffer_query.c \ - lfds611_slist_delete.c lfds611_slist_get_and_set.c lfds611_slist_link.c lfds611_slist_new.c \ - lfds611_stack_delete.c lfds611_stack_new.c lfds611_stack_push_pop.c lfds611_stack_query.c \ - lfds611_freelist_delete.c lfds611_freelist_get_and_set.c lfds611_freelist_new.c lfds611_freelist_query.c lfds611_freelist_pop_push.c \ - lfds611_liblfds_abstraction_test_helpers.c lfds611_liblfds_aligned_free.c lfds611_liblfds_aligned_malloc.c \ - lfds611_abstraction_free.c lfds611_abstraction_malloc.c -OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES))) - -##### CPU variants ##### -UNAME = $(shell uname -m) -GCCARCH = -march=$(UNAME) - -ifeq ($(UNAME),x86_64) - GCCARCH = -march=core2 -endif - -ifeq ($(findstring arm,$(UNAME)),arm) - GCCARCH = -march=armv6k -marm -endif - -##### tools ##### -MAKE = make -MFLAGS = - -DG = gcc -DGFLAGS = -MM -std=c99 -I"$(SRCDIR)" -I"$(INCDIR)" - -CC = gcc -CBASE = -Wall -Wno-unknown-pragmas -std=c99 $(GCCARCH) -pthread -c -I"$(SRCDIR)" -I"$(INCDIR)" -CFREL = -O2 -finline-functions -Wno-strict-aliasing -CFDBG = -O0 -g - -AR = ar -AFLAGS = -rcs - -LD = gcc -LFBASE = -Wall -std=c99 -shared -LFREL = -O2 -s -LFDBG = -O0 -g - -##### rel/dbg .a/.so variants ##### -ifeq ($(findstring so,$(MAKECMDGOALS)),so) - CBASE := $(CBASE) -fpic -endif - -CFLAGS = $(CBASE) $(CFDBG) -LFLAGS = $(LFBASE) $(LFDBG) - -ifeq ($(findstring rel,$(MAKECMDGOALS)),rel) - CFLAGS = $(CBASE) $(CFREL) - LFLAGS = $(LFBASE) $(LFREL) -endif - -##### search paths ##### -vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS)) - -##### implicit rules ##### -$(OBJDIR)/%.o : %.c - @echo "Compiling $<" - @$(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d - @$(CC) $(CFLAGS) -o $@ $< - -##### explicit rules ##### -$(AR_BINARY) : $(OBJECTS) - @echo "Creating $(AR_BINARY)" - @$(AR) $(AFLAGS) $(AR_BINARY) $(OBJECTS) - -$(SO_BINARY) : $(OBJECTS) - @echo "Creating $(SO_BINARY)" - $(LD) $(LFLAGS) $(SYSLIBS) $(OBJECTS) -o $(SO_BINARY) - -##### phony ##### -.PHONY : clean arrel ardbg sorel sodbg - -clean : - @rm -f $(BINDIR)/$(BINNAME).* $(OBJDIR)/*.o $(OBJDIR)/*.d - -arrel : $(AR_BINARY) -ardbg : $(AR_BINARY) - -sorel : $(SO_BINARY) -sodbg : $(SO_BINARY) - -##### dependencies ##### --include $(DEPENDS) - -##### notes ##### -# TRD : we use -std=c99 purely to permit C++ style comments - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/makefile.windows b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/makefile.windows deleted file mode 100644 index 9948e7cea7..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/makefile.windows +++ /dev/null @@ -1,97 +0,0 @@ -##### paths ##### -BINDIR = bin -INCDIR = inc -OBJDIR = obj -SRCDIR = src - -##### misc ##### -QUIETLY = 1>nul 2>nul - -##### sources, objects and libraries ##### -BINNAME = liblfds611 -LIB_BINARY = $(BINDIR)\$(BINNAME).lib -DLL_BINARY = $(BINDIR)\$(BINNAME).dll -SRCDIRS = lfds611_abstraction lfds611_freelist lfds611_liblfds lfds611_queue lfds611_ringbuffer lfds611_slist lfds611_stack -# TRD : lfds611_abstraction_cas.c lfds611_abstraction_dcas.c lfds611_abstraction_increment.c are inlined and are compiled by every C file -SOURCES = lfds611_abstraction_free.c lfds611_abstraction_malloc.c \ - lfds611_freelist_delete.c lfds611_freelist_get_and_set.c lfds611_freelist_new.c lfds611_freelist_query.c lfds611_freelist_pop_push.c \ - lfds611_liblfds_abstraction_test_helpers.c lfds611_liblfds_aligned_free.c lfds611_liblfds_aligned_malloc.c \ - lfds611_queue_delete.c lfds611_queue_new.c lfds611_queue_query.c lfds611_queue_queue.c \ - lfds611_ringbuffer_delete.c lfds611_ringbuffer_get_and_put.c lfds611_ringbuffer_new.c lfds611_ringbuffer_query.c \ - lfds611_slist_delete.c lfds611_slist_get_and_set.c lfds611_slist_link.c lfds611_slist_new.c \ - lfds611_stack_delete.c lfds611_stack_new.c lfds611_stack_push_pop.c lfds611_stack_query.c -OBJECTS = $(patsubst %.c,$(OBJDIR)/%.obj,$(notdir $(SOURCES))) -SYSLIBS = kernel32.lib - -##### tools ##### -MAKE = make -MFLAGS = - -CC = cl -CBASE = /nologo /W4 /WX /c "-I$(SRCDIR)" "-I$(INCDIR)" "/Fd$(BINDIR)\$(BINNAME).pdb" /DUNICODE /D_UNICODE /DWIN32_LEAN_AND_MEAN -CFREL = /Ox /DNDEBUG -CFDBG = /Od /Gm /Zi /D_DEBUG - -AR = lib -AFLAGS = /nologo /subsystem:console /wx /verbose - -LD = link -LFBASE = /dll /def:$(BINNAME).def /nologo /subsystem:console /wx /nodefaultlib /nxcompat -LFREL = /incremental:no -LFDBG = /debug "/pdb:$(BINDIR)\$(BINNAME).pdb" - -##### variants ##### -CFLAGS = $(CBASE) $(CFDBG) /MTd -LFLAGS = $(LFBASE) $(LFDBG) -CLIB = libcmtd.lib - -ifeq ($(MAKECMDGOALS),librel) - CFLAGS = $(CBASE) $(CFREL) /MT - LFLAGS = $(LFBASE) $(LFREL) - CLIB = libcmt.lib -endif - -ifeq ($(MAKECMDGOALS),libdbg) - CFLAGS = $(CBASE) $(CFDBG) /MTd - LFLAGS = $(LFBASE) $(LFDBG) - CLIB = libcmtd.lib -endif - -ifeq ($(MAKECMDGOALS),dllrel) - CFLAGS = $(CBASE) $(CFREL) /MD - LFLAGS = $(LFBASE) $(LFREL) - CLIB = msvcrt.lib -endif - -ifeq ($(MAKECMDGOALS),dlldbg) - CFLAGS = $(CBASE) $(CFDBG) /MDd - LFLAGS = $(LFBASE) $(LFDBG) - CLIB = msvcrtd.lib -endif - -##### search paths ##### -vpath %.c $(patsubst %,$(SRCDIR)/%;,$(SRCDIRS)) - -##### implicit rules ##### -$(OBJDIR)/%.obj : %.c - $(CC) $(CFLAGS) "/Fo$@" $< - -##### explicit rules ##### -$(LIB_BINARY) : $(OBJECTS) - $(AR) $(AFLAGS) $(OBJECTS) /out:$(LIB_BINARY) - -$(DLL_BINARY) : $(OBJECTS) - $(LD) $(LFLAGS) $(CLIB) $(SYSLIBS) $(OBJECTS) /out:$(DLL_BINARY) - -##### phony ##### -.PHONY : clean librel libdbg dllrel dlldbg - -clean : - @erase /Q $(BINDIR)\$(BINNAME).* $(OBJDIR)\*.obj $(QUIETLY) - -librel : $(LIB_BINARY) -libdbg : $(LIB_BINARY) - -dllrel : $(DLL_BINARY) -dlldbg : $(DLL_BINARY) - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/readme.txt b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/readme.txt deleted file mode 100644 index cbe196238c..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/readme.txt +++ /dev/null @@ -1,147 +0,0 @@ -introduction -============ -Welcome to liblfds, a portable, license-free, lock-free data structure library -written in C. - -supported platforms -=================== -Out-of-the-box ports are provided for; - -Operating System CPU Toolchain Choices -================ ============= ================= -Windows 64-bit x64 1. Microsoft Visual Studio - 2. Microsoft Windows SDK and GNUmake - -Windows 32-bit x64, x86 1. Microsoft Visual Studio - 2. Visual C++ Express Edition - 3. Microsoft Windows SDK and GNUmake - -Windows Kernel x64, x86 1. Windows Driver Kit - -Linux 64-bit x64 1. GCC and GNUmake - -Linux 32-bit ARM, x64, x86 1. GCC and GNUmake - -For more information including version requirements, see the building guide (lfds). - -data structures -=============== -This release of liblfds provides the following; - - * Freelist - * Queue - * Ringbuffer (each element read by a single reader) - * Singly-linked list (logical delete only) - * Stack - -These are all many-readers, many-writers. - -liblfds on-line -=============== -On the liblfds home page, you will find the blog, a bugzilla, a forum, a -mediawiki and the current and all historical releases. - -The mediawiki contains comprehensive documentation for development, building, -testing and porting. - -http://www.liblfds.org - -license -======= -There is no license. You are free to use this code in any way. - -using -===== -Once built, there is a single header file, /inc/liblfds.h, which you must include -in your source code, and a single library file /bin/liblfds.*, where the suffix -depends on your platform and your build choice (static or dynamic), to which, -if statically built, you must link directly or, if dynamically built, you must -arrange your system such that the library can be found by the loader at run-time. - -testing -======= -The library comes with a command line test and benchmark program. This program -requires threads. As such, it is only suitable for platforms which can execute -a command line binary and provide thread support. Currently this means the test -and benchmark program works for all platforms except the Windows Kernel. - -For documentation, see the testing and benchmarking guide in the mediawiki. - -porting -======= -Both the test program and liblfds provide an abstraction layer which acts to -mask platform differences. Porting is the act of implementing on your platform -the functions which make up the abstraction layers. You do not need to port -the test program to port liblfds, but obviously it is recommended, so you can -test your port. - -To support liblfds, your platform MUST support; - - * atomic single-word* increment - * atomic single-word compare-and-swap - * atomic contiguous double-word compare-and-swap* - * malloc and free - * compiler directive for alignment of variables declared on the stack - * compiler directives for compiler barriers and processor barriers - -* A ''word'' here means a type equal in length to the platform pointer size. -* This requirement excludes the Alpha, IA64, MIPS, PowerPC and SPARC platforms. - -Also, your platform MAY support; - - * compiler keyword for function inlining - -To support the test programme, your platform MUST support; - - * determining the number of logical cores - * threads (starting and waiting on for completion) - -For documentation, see the porting guide (lfds) in the mediawiki. - -release history -=============== -release 1, 25th September 2009, svn revision 1574. - - initial release - -release 2, 5th October 2009, svn revision 1599. - - added abstraction layer for Windows kernel - - minor code tidyups/fixes - -release 3, 25th October 2009, svn revision 1652. - - added singly linked list (logical delete only) - - minor code tidyups/fixes - -release 4, 7th December 2009, svn revision 1716. - - added ARM support - - added benchmarking functionality to the test program - - fixed a profound and pervasive pointer - declaration bug; earlier releases of liblfds - *should not be used* - -release 5, 19th December 2009, svn revision 1738. - - fixed subtle queue bug, which also affected ringbuffer - and caused data re-ordering under high load - - added benchmarks for freelist, ringbuffer and stack - -release 6, 29th December 2009, svn revision 1746. - - fixed two implementation errors, which reduced performance, - spotted by Codeplug from "http://cboard.cprogramming.com". - -release 6.0.0, 18th December 2012, svn revision 2537 - - introduction of namespaces, e.g. the "lfds600_" prefix - code otherwise COMPLETELY AND WHOLLY UNCHANGED - this release is a stepping-stone to 6.1.0 - -release 6.0.1, 2nd January 2013, svn revision 3296 - - bug fix where an enum wasn't moved into the new namespacing policy - -release 6.1.0, 31th December 2012, svn revision 2600 - - fixed all existing non-enhancement bugs - - discovered some new bugs and fixed them too - - a very few minor changes/enhancements - -release 6.1.1, 2nd January 2013, svn revision 3297 - - crucial bug fix where compiler barriers for atomic operations - were not brought over from 7.0.0 during backporting - - minor fix for abstraction tests, two missing store barriers - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_build_readme.txt b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_build_readme.txt deleted file mode 100644 index d7087ecd48..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_build_readme.txt +++ /dev/null @@ -1,32 +0,0 @@ -The Windows kernel build environment is primitive and has a number -of severe limitations; in particular, all source files must be in -one directory and it is not possible to choose the output binary type -(static or dynamic library) from the build command line; rather, -a string has to be modified in a text file used by the build (!) - -To deal with these limitations, it is necessary for a Windows kernel -build to run a batch file prior to building. - -There are two batch files, one for static library builds and the other -for dynamic library builds. - -They are both idempotent; you can run them as often as you like and -switch between them as often as you want. It's all fine; whenever -you run one of them, it will take you from whatever state you were -previously in, into the state you want to be in. - -Both batch files copy all the sources file into a single directory, -"/src/single_dir_for_windows_kernel/". - -The static library batch file will then copy "/sources.static" into -"/src/single_dir_for_windows_kernel/", which will cause a static -library to be built. - -The dynamic library batch file will then copy "/sources.dynamic" into -"/src/single_dir_for_windows_kernel/", which will cause a dynamic -library to be built. It will also copy "src/driver_entry.c" into -"/src/single_dir_for_windows_kernel/", since the linker requires -the DriverEntry function to exist for dynamic libraries, even -though it's not used. - - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_dynamic_lib_build.bat b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_dynamic_lib_build.bat deleted file mode 100644 index 6a9f68b428..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_dynamic_lib_build.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -rmdir /q /s src\single_dir_for_windows_kernel 1>nul 2>nul -mkdir src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_abstraction\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_freelist\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_liblfds\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_queue\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_ringbuffer\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_slist\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_stack\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y sources.dynamic src\single_dir_for_windows_kernel\sources 1>nul 2>nul -copy /y src\driver_entry.c src\single_dir_for_windows_kernel 1>nul 2>nul -echo Windows kernel dynamic library build directory structure created. -echo (Note the effects of this batch file are idempotent). - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_static_lib_build.bat b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_static_lib_build.bat deleted file mode 100644 index a3b9362b0e..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/runme_before_win_kernel_static_lib_build.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -rmdir /q /s src\single_dir_for_windows_kernel 1>nul 2>nul -mkdir src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_abstraction\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_freelist\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_liblfds\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_queue\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_ringbuffer\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_slist\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y src\lfds611_stack\* src\single_dir_for_windows_kernel 1>nul 2>nul -copy /y sources.static src\single_dir_for_windows_kernel\sources 1>nul 2>nul -erase /f src\single_dir_for_windows_kernel\driver_entry.c 1>nul 2>nul -echo Windows kernel static library build directory structure created. -echo (Note the effects of this batch file are idempotent). - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/sources.dynamic b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/sources.dynamic deleted file mode 100644 index 0ed73dc06e..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/sources.dynamic +++ /dev/null @@ -1,37 +0,0 @@ -MSC_WARNING_LEVEL = /WX /W4 -DLLDEF = ../../liblfds611.def -TARGETNAME = liblfds611 -TARGETPATH = ../../bin/ -TARGETTYPE = EXPORT_DRIVER -UMTYPE = nt -USER_C_FLAGS = /DWIN_KERNEL_BUILD - -INCLUDES = ..;../../inc/ -SOURCES = lfds611_abstraction_free.c \ - lfds611_abstraction_malloc.c \ - lfds611_freelist_delete.c \ - lfds611_freelist_get_and_set.c \ - lfds611_freelist_new.c \ - lfds611_freelist_pop_push.c \ - lfds611_freelist_query.c \ - lfds611_liblfds_abstraction_test_helpers.c \ - lfds611_liblfds_aligned_free.c \ - lfds611_liblfds_aligned_malloc.c \ - lfds611_queue_delete.c \ - lfds611_queue_new.c \ - lfds611_queue_query.c \ - lfds611_queue_queue.c \ - lfds611_ringbuffer_delete.c \ - lfds611_ringbuffer_get_and_put.c \ - lfds611_ringbuffer_new.c \ - lfds611_ringbuffer_query.c \ - lfds611_slist_delete.c \ - lfds611_slist_get_and_set.c \ - lfds611_slist_link.c \ - lfds611_slist_new.c \ - lfds611_stack_delete.c \ - lfds611_stack_new.c \ - lfds611_stack_push_pop.c \ - lfds611_stack_query.c \ - driver_entry.c - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/sources.static b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/sources.static deleted file mode 100644 index 64965033ed..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/sources.static +++ /dev/null @@ -1,35 +0,0 @@ -MSC_WARNING_LEVEL = /WX /W4 -TARGETNAME = liblfds611 -TARGETPATH = ../../bin/ -TARGETTYPE = DRIVER_LIBRARY -UMTYPE = nt -USER_C_FLAGS = /DWIN_KERNEL_BUILD - -INCLUDES = ..;../../inc/ -SOURCES = lfds611_abstraction_free.c \ - lfds611_abstraction_malloc.c \ - lfds611_freelist_delete.c \ - lfds611_freelist_get_and_set.c \ - lfds611_freelist_new.c \ - lfds611_freelist_pop_push.c \ - lfds611_freelist_query.c \ - lfds611_liblfds_abstraction_test_helpers.c \ - lfds611_liblfds_aligned_free.c \ - lfds611_liblfds_aligned_malloc.c \ - lfds611_queue_delete.c \ - lfds611_queue_new.c \ - lfds611_queue_query.c \ - lfds611_queue_queue.c \ - lfds611_ringbuffer_delete.c \ - lfds611_ringbuffer_get_and_put.c \ - lfds611_ringbuffer_new.c \ - lfds611_ringbuffer_query.c \ - lfds611_slist_delete.c \ - lfds611_slist_get_and_set.c \ - lfds611_slist_link.c \ - lfds611_slist_new.c \ - lfds611_stack_delete.c \ - lfds611_stack_new.c \ - lfds611_stack_push_pop.c \ - lfds611_stack_query.c - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/dirs b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/dirs deleted file mode 100644 index 64e002cc57..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/dirs +++ /dev/null @@ -1,3 +0,0 @@ -DIRS = single_dir_for_windows_kernel - - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/driver_entry.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/driver_entry.c deleted file mode 100644 index a2dac56f2d..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/driver_entry.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "liblfds611_internal.h" - - - - - -/****************************************************************************/ -#pragma warning( disable : 4100 ) - -NTSTATUS DriverEntry( struct _DRIVER_OBJECT *DriverObject, PUNICODE_STRING RegistryPath ) -{ - return( STATUS_SUCCESS ); -} - -#pragma warning( default : 4100 ) - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/driver_entry_readme.txt b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/driver_entry_readme.txt deleted file mode 100644 index a3979772f2..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/driver_entry_readme.txt +++ /dev/null @@ -1,4 +0,0 @@ -This C file (driver_entry.c) is used when building a dynamic library for -the Windows kernel. It exists to work around one of the limitations of -that build environment. It is not used by any other build; just ignore it. - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_cas.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_cas.c deleted file mode 100644 index ed3d7d7d26..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_cas.c +++ /dev/null @@ -1,71 +0,0 @@ -#include "lfds611_abstraction_internal_body.h" - - - - - -/****************************************************************************/ -#if (defined _WIN32 && defined _MSC_VER) - -/* TRD : 64 bit and 32 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler -*/ - -static LFDS611_INLINE lfds611_atom_t lfds611_abstraction_cas( volatile lfds611_atom_t *destination, lfds611_atom_t exchange, lfds611_atom_t compare ) -{ - lfds611_atom_t - rv; - - assert( destination != NULL ); - // TRD : exchange can be any value in its range - // TRD : compare can be any value in its range - - LFDS611_BARRIER_COMPILER_FULL; - - rv = (lfds611_atom_t) _InterlockedCompareExchangePointer( (void * volatile *) destination, (void *) exchange, (void *) compare ); - - LFDS611_BARRIER_COMPILER_FULL; - - return( rv ); -} - -#endif - - - - - -/****************************************************************************/ -#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 1 && __GNUC_PATCHLEVEL__ >= 0) - -/* TRD : any OS on any CPU with GCC 4.1.0 or better - - GCC 4.1.0 introduced the __sync_*() atomic intrinsics - - __GNUC__ / __GNUC_MINOR__ / __GNUC_PATCHLEVEL__ indicates GCC and which version -*/ - -static LFDS611_INLINE lfds611_atom_t lfds611_abstraction_cas( volatile lfds611_atom_t *destination, lfds611_atom_t exchange, lfds611_atom_t compare ) -{ - lfds611_atom_t - rv; - - assert( destination != NULL ); - // TRD : exchange can be any value in its range - // TRD : compare can be any value in its range - - // TRD : note the different argument order for the GCC instrinsic to the MSVC instrinsic - - LFDS611_BARRIER_COMPILER_FULL; - - rv = (lfds611_atom_t) __sync_val_compare_and_swap( destination, compare, exchange ); - - LFDS611_BARRIER_COMPILER_FULL; - - return( rv ); -} - -#endif - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_dcas.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_dcas.c deleted file mode 100644 index 61f243735b..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_dcas.c +++ /dev/null @@ -1,157 +0,0 @@ -#include "lfds611_abstraction_internal_body.h" - - - - - -/****************************************************************************/ -#if (defined _WIN64 && defined _MSC_VER) - -/* TRD : 64 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler - - _WIN64 indicates 64 bit Windows - _MSC_VER indicates Microsoft C compiler -*/ - -static LFDS611_INLINE unsigned char lfds611_abstraction_dcas( volatile lfds611_atom_t *destination, lfds611_atom_t *exchange, lfds611_atom_t *compare ) -{ - unsigned char - cas_result; - - assert( destination != NULL ); - assert( exchange != NULL ); - assert( compare != NULL ); - - LFDS611_BARRIER_COMPILER_FULL; - - cas_result = _InterlockedCompareExchange128( (volatile __int64 *) destination, (__int64) *(exchange+1), (__int64) *exchange, (__int64 *) compare ); - - LFDS611_BARRIER_COMPILER_FULL; - - return( cas_result ) ; -} - -#endif - - - - - -/****************************************************************************/ -#if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER) - -/* TRD : 32 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler - - (!defined _WIN64 && defined _WIN32) indicates 32 bit Windows - _MSC_VER indicates Microsoft C compiler -*/ - -static LFDS611_INLINE unsigned char lfds611_abstraction_dcas( volatile lfds611_atom_t *destination, lfds611_atom_t *exchange, lfds611_atom_t *compare ) -{ - __int64 - original_compare; - - assert( destination != NULL ); - assert( exchange != NULL ); - assert( compare != NULL ); - - *(__int64 *) &original_compare = *(__int64 *) compare; - - LFDS611_BARRIER_COMPILER_FULL; - - *(__int64 *) compare = _InterlockedCompareExchange64( (volatile __int64 *) destination, *(__int64 *) exchange, *(__int64 *) compare ); - - LFDS611_BARRIER_COMPILER_FULL; - - return( (unsigned char) (*(__int64 *) compare == *(__int64 *) &original_compare) ); -} - -#endif - - - - - -/****************************************************************************/ -#if (defined __x86_64__ && defined __GNUC__) - -/* TRD : any OS on x64 with GCC - - __x86_64__ indicates x64 - __GNUC__ indicates GCC -*/ - -static LFDS611_INLINE unsigned char lfds611_abstraction_dcas( volatile lfds611_atom_t *destination, lfds611_atom_t *exchange, lfds611_atom_t *compare ) -{ - unsigned char - cas_result; - - assert( destination != NULL ); - assert( exchange != NULL ); - assert( compare != NULL ); - - // TRD : __asm__ with "memory" in the clobber list is for GCC a full compiler barrier - __asm__ __volatile__ - ( - "lock;" // make cmpxchg16b atomic - "cmpxchg16b %0;" // cmpxchg16b sets ZF on success - "setz %3;" // if ZF set, set cas_result to 1 - - // output - : "+m" (*(volatile lfds611_atom_t (*)[2]) destination), "+a" (*compare), "+d" (*(compare+1)), "=q" (cas_result) - - // input - : "b" (*exchange), "c" (*(exchange+1)) - - // clobbered - : "cc", "memory" - ); - - return( cas_result ); -} - -#endif - - - - - -/****************************************************************************/ -#if ((defined __i686__ || defined __arm__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1 && __GNUC_PATCHLEVEL__ >= 0) - -/* TRD : any OS on x86 or ARM with GCC 4.1.0 or better - - GCC 4.1.0 introduced the __sync_*() atomic intrinsics - - __GNUC__ / __GNUC_MINOR__ / __GNUC_PATCHLEVEL__ indicates GCC and which version -*/ - -static LFDS611_INLINE unsigned char lfds611_abstraction_dcas( volatile lfds611_atom_t *destination, lfds611_atom_t *exchange, lfds611_atom_t *compare ) -{ - unsigned char - cas_result = 0; - - unsigned long long int - original_destination; - - assert( destination != NULL ); - assert( exchange != NULL ); - assert( compare != NULL ); - - LFDS611_BARRIER_COMPILER_FULL; - - original_destination = __sync_val_compare_and_swap( (volatile unsigned long long int *) destination, *(unsigned long long int *) compare, *(unsigned long long int *) exchange ); - - LFDS611_BARRIER_COMPILER_FULL; - - if( original_destination == *(unsigned long long int *) compare ) - cas_result = 1; - - *(unsigned long long int *) compare = original_destination; - - return( cas_result ); -} - -#endif - - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_free.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_free.c deleted file mode 100644 index e582374c98..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_free.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "lfds611_abstraction_internal_wrapper.h" - - - - - -/****************************************************************************/ -#if (!defined WIN_KERNEL_BUILD) - -/* TRD : any OS except Windows kernel on any CPU with any compiler - - !WIN_KERNEL_BUILD indicates not Windows kernel -*/ - -void lfds611_abstraction_free( void *memory ) -{ - free( memory ); - - return; -} - -#endif - - - - - -/****************************************************************************/ -#if (defined WIN_KERNEL_BUILD) - -/* TRD : any Windows (kernel) on any CPU with the Microsoft C compiler - - WIN_KERNEL_BUILD indicates Windows kernel -*/ - -void lfds611_abstraction_free( void *memory ) -{ - ExFreePoolWithTag( memory, 'sdfl' ); - - return; -} - -#endif - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_increment.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_increment.c deleted file mode 100644 index 4cdd068d02..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_increment.c +++ /dev/null @@ -1,98 +0,0 @@ -#include "lfds611_abstraction_internal_body.h" - - - - - -/****************************************************************************/ -#if (defined _WIN64 && defined _MSC_VER) - -/* TRD : 64 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler - - _WIN64 indicates 64 bit Windows - _MSC_VER indicates Microsoft C compiler -*/ - -static LFDS611_INLINE lfds611_atom_t lfds611_abstraction_increment( volatile lfds611_atom_t *value ) -{ - lfds611_atom_t - rv; - - assert( value != NULL ); - - LFDS611_BARRIER_COMPILER_FULL; - - rv = (lfds611_atom_t) _InterlockedIncrement64( (__int64 *) value ); - - LFDS611_BARRIER_COMPILER_FULL; - - return( rv ); -} - -#endif - - - - - -/****************************************************************************/ -#if (!defined _WIN64 && defined _WIN32 && defined _MSC_VER) - -/* TRD : 32 bit Windows (user-mode or kernel) on any CPU with the Microsoft C compiler - - (!defined _WIN64 && defined _WIN32) indicates 32 bit Windows - _MSC_VER indicates Microsoft C compiler -*/ - -static LFDS611_INLINE lfds611_atom_t lfds611_abstraction_increment( volatile lfds611_atom_t *value ) -{ - lfds611_atom_t - rv; - - assert( value != NULL ); - - LFDS611_BARRIER_COMPILER_FULL; - - rv = (lfds611_atom_t) _InterlockedIncrement( (long int *) value ); - - LFDS611_BARRIER_COMPILER_FULL; - - return( rv ); -} - -#endif - - - - - -/****************************************************************************/ -#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 1 && __GNUC_PATCHLEVEL__ >= 0) - -/* TRD : any OS on any CPU with GCC 4.1.0 or better - - GCC 4.1.0 introduced the __sync_*() atomic intrinsics - - __GNUC__ / __GNUC_MINOR__ / __GNUC_PATCHLEVEL__ indicates GCC and which version -*/ - -static LFDS611_INLINE lfds611_atom_t lfds611_abstraction_increment( volatile lfds611_atom_t *value ) -{ - lfds611_atom_t - rv; - - assert( value != NULL ); - - // TRD : no need for casting here, GCC has a __sync_add_and_fetch() for all native types - - LFDS611_BARRIER_COMPILER_FULL; - - rv = (lfds611_atom_t) __sync_add_and_fetch( value, 1 ); - - LFDS611_BARRIER_COMPILER_FULL; - - return( rv ); -} - -#endif - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_internal_body.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_internal_body.h deleted file mode 100644 index ac10143514..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_internal_body.h +++ /dev/null @@ -1,2 +0,0 @@ -/***** private prototypes *****/ - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_internal_wrapper.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_internal_wrapper.h deleted file mode 100644 index c9129c2748..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_internal_wrapper.h +++ /dev/null @@ -1,6 +0,0 @@ -/***** the library wide include file *****/ -#include "liblfds611_internal.h" - -/***** the internal header body *****/ -#include "lfds611_abstraction_internal_body.h" - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_malloc.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_malloc.c deleted file mode 100644 index d97b820872..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_abstraction/lfds611_abstraction_malloc.c +++ /dev/null @@ -1,40 +0,0 @@ -#include "lfds611_abstraction_internal_wrapper.h" - - - - - -/****************************************************************************/ -#if (!defined WIN_KERNEL_BUILD) - -/* TRD : any OS except Windows kernel on any CPU with any compiler - - !WIN_KERNEL_BUILD indicates not Windows kernel -*/ - -void *lfds611_abstraction_malloc( size_t size ) -{ - return( malloc(size) ); -} - -#endif - - - - - -/****************************************************************************/ -#if (defined WIN_KERNEL_BUILD) - -/* TRD : any Windows (kernel) on any CPU with the Microsoft C compiler - - WIN_KERNEL_BUILD indicates Windows kernel -*/ - -void *lfds611_abstraction_malloc( size_t size ) -{ - return( ExAllocatePoolWithTag(NonPagedPool, size, 'sdfl') ); -} - -#endif - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_delete.c deleted file mode 100644 index b5de6f6ac2..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_delete.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "lfds611_freelist_internal.h" - - - - - -/****************************************************************************/ -void lfds611_freelist_delete( struct lfds611_freelist_state *fs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ) -{ - struct lfds611_freelist_element - *fe; - - void - *user_data; - - assert( fs != NULL ); - // TRD : user_data_delete_function can be NULL - // TRD : user_state can be NULL - - // TRD : leading load barrier not required as it will be performed by the pop - - while( lfds611_freelist_pop(fs, &fe) ) { - if( user_data_delete_function != NULL ) { - lfds611_freelist_get_user_data_from_element( fe, &user_data ); - user_data_delete_function( user_data, user_state ); - } - - lfds611_liblfds_aligned_free( fe ); - } - - lfds611_liblfds_aligned_free( fs ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_get_and_set.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_get_and_set.c deleted file mode 100644 index 9e5108c5b5..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_get_and_set.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "lfds611_freelist_internal.h" - - - - - -/****************************************************************************/ -void *lfds611_freelist_get_user_data_from_element( struct lfds611_freelist_element *fe, void **user_data ) -{ - assert( fe != NULL ); - // TRD : user_data can be NULL - - LFDS611_BARRIER_LOAD; - - if( user_data != NULL ) - *user_data = fe->user_data; - - return( fe->user_data ); -} - - - - - -/****************************************************************************/ -void lfds611_freelist_set_user_data_in_element( struct lfds611_freelist_element *fe, void *user_data ) -{ - assert( fe != NULL ); - // TRD : user_data can be NULL - - fe->user_data = user_data; - - LFDS611_BARRIER_STORE; - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_internal.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_internal.h deleted file mode 100644 index a593a4d959..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_internal.h +++ /dev/null @@ -1,40 +0,0 @@ -/***** the library wide include file *****/ -#include "liblfds611_internal.h" - -/***** defines *****/ -#define LFDS611_FREELIST_POINTER 0 -#define LFDS611_FREELIST_COUNTER 1 -#define LFDS611_FREELIST_PAC_SIZE 2 - -/***** structures *****/ -#pragma pack( push, LFDS611_ALIGN_DOUBLE_POINTER ) - -struct lfds611_freelist_state { - struct lfds611_freelist_element - *volatile top[LFDS611_FREELIST_PAC_SIZE]; - - int - (*user_data_init_function)( void **user_data, void *user_state ); - - void - *user_state; - - lfds611_atom_t - aba_counter, - element_count; -}; - -struct lfds611_freelist_element { - struct lfds611_freelist_element - *next[LFDS611_FREELIST_PAC_SIZE]; - - void - *user_data; -}; - -#pragma pack( pop ) - -/***** private prototypes *****/ -lfds611_atom_t lfds611_freelist_internal_new_element( struct lfds611_freelist_state *fs, struct lfds611_freelist_element **fe ); -void lfds611_freelist_internal_validate( struct lfds611_freelist_state *fs, struct lfds611_validation_info *vi, enum lfds611_data_structure_validity *lfds611_freelist_validity ); - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c deleted file mode 100644 index 2eeae80097..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c +++ /dev/null @@ -1,136 +0,0 @@ -#include "lfds611_freelist_internal.h" - - - - - -/****************************************************************************/ -int lfds611_freelist_new( struct lfds611_freelist_state **fs, lfds611_atom_t number_elements, int (*user_data_init_function)(void **user_data, void *user_state), void *user_state ) -{ - int - rv = 0; - - lfds611_atom_t - element_count; - - assert( fs != NULL ); - // TRD : number_elements can be any value in its range - // TRD : user_data_init_function can be NULL - - *fs = (struct lfds611_freelist_state *) lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_freelist_state), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( (*fs) != NULL ) { - (*fs)->top[LFDS611_FREELIST_POINTER] = NULL; - (*fs)->top[LFDS611_FREELIST_COUNTER] = 0; - (*fs)->user_data_init_function = user_data_init_function; - (*fs)->user_state = user_state; - (*fs)->aba_counter = 0; - (*fs)->element_count = 0; - - element_count = lfds611_freelist_new_elements( *fs, number_elements ); - - if( element_count == number_elements ) - rv = 1; - - if( element_count != number_elements ) { - lfds611_liblfds_aligned_free( (*fs) ); - *fs = NULL; - } - } - - LFDS611_BARRIER_STORE; - - return( rv ); -} - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_freelist_use( struct lfds611_freelist_state *fs ) -{ - assert( fs != NULL ); - - LFDS611_BARRIER_LOAD; - - return; -} - -//#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -lfds611_atom_t lfds611_freelist_new_elements( struct lfds611_freelist_state *fs, lfds611_atom_t number_elements ) -{ - struct lfds611_freelist_element - *fe; - - lfds611_atom_t - loop, - count = 0; - - assert( fs != NULL ); - // TRD : number_elements can be any value in its range - // TRD : user_data_init_function can be NULL - - for( loop = 0 ; loop < number_elements ; loop++ ) - if( lfds611_freelist_internal_new_element(fs, &fe) ) { - lfds611_freelist_push( fs, fe ); - count++; - } - - return( count ); -} - - - - - -/****************************************************************************/ -lfds611_atom_t lfds611_freelist_internal_new_element( struct lfds611_freelist_state *fs, struct lfds611_freelist_element **fe ) -{ - lfds611_atom_t - rv = 0; - - assert( fs != NULL ); - assert( fe != NULL ); - - /* TRD : basically, does what you'd expect; - - allocates an element - calls the user init function - if anything fails, cleans up, - sets *fe to NULL - and returns 0 - */ - - *fe = (struct lfds611_freelist_element *) lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_freelist_element), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( *fe != NULL ) { - if( fs->user_data_init_function == NULL ) { - (*fe)->user_data = NULL; - rv = 1; - } - - if( fs->user_data_init_function != NULL ) { - rv = fs->user_data_init_function( &(*fe)->user_data, fs->user_state ); - - if( rv == 0 ) { - lfds611_liblfds_aligned_free( *fe ); - *fe = NULL; - } - } - } - - if( rv == 1 ) - lfds611_abstraction_increment( (lfds611_atom_t *) &fs->element_count ); - - return( rv ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_pop_push.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_pop_push.c deleted file mode 100644 index c0e2282414..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_pop_push.c +++ /dev/null @@ -1,87 +0,0 @@ -#include "lfds611_freelist_internal.h" - - - - - -/****************************************************************************/ -struct lfds611_freelist_element *lfds611_freelist_pop( struct lfds611_freelist_state *fs, struct lfds611_freelist_element **fe ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_freelist_element - *fe_local[LFDS611_FREELIST_PAC_SIZE]; - - assert( fs != NULL ); - assert( fe != NULL ); - - LFDS611_BARRIER_LOAD; - - fe_local[LFDS611_FREELIST_COUNTER] = fs->top[LFDS611_FREELIST_COUNTER]; - fe_local[LFDS611_FREELIST_POINTER] = fs->top[LFDS611_FREELIST_POINTER]; - - /* TRD : note that lfds611_abstraction_dcas loads the original value of the destination (fs->top) into the compare (fe_local) - (this happens of course after the CAS itself has occurred inside lfds611_abstraction_dcas) - */ - - do { - if( fe_local[LFDS611_FREELIST_POINTER] == NULL ) { - *fe = NULL; - return( *fe ); - } - } while( 0 == lfds611_abstraction_dcas((volatile lfds611_atom_t *) fs->top, (lfds611_atom_t *) fe_local[LFDS611_FREELIST_POINTER]->next, (lfds611_atom_t *) fe_local) ); - - *fe = (struct lfds611_freelist_element *) fe_local[LFDS611_FREELIST_POINTER]; - - return( *fe ); -} - - - - - -/****************************************************************************/ -struct lfds611_freelist_element *lfds611_freelist_guaranteed_pop( struct lfds611_freelist_state *fs, struct lfds611_freelist_element **fe ) -{ - assert( fs != NULL ); - assert( fe != NULL ); - - lfds611_freelist_internal_new_element( fs, fe ); - - return( *fe ); -} - - - - - -/****************************************************************************/ -void lfds611_freelist_push( struct lfds611_freelist_state *fs, struct lfds611_freelist_element *fe ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_freelist_element - *fe_local[LFDS611_FREELIST_PAC_SIZE], - *original_fe_next[LFDS611_FREELIST_PAC_SIZE]; - - assert( fs != NULL ); - assert( fe != NULL ); - - LFDS611_BARRIER_LOAD; - - fe_local[LFDS611_FREELIST_POINTER] = fe; - fe_local[LFDS611_FREELIST_COUNTER] = (struct lfds611_freelist_element *) lfds611_abstraction_increment( (lfds611_atom_t *) &fs->aba_counter ); - - original_fe_next[LFDS611_FREELIST_POINTER] = fs->top[LFDS611_FREELIST_POINTER]; - original_fe_next[LFDS611_FREELIST_COUNTER] = fs->top[LFDS611_FREELIST_COUNTER]; - - /* TRD : note that lfds611_abstraction_dcas loads the original value of the destination (fs->top) into the compare (original_fe_next) - (this happens of course after the CAS itself has occurred inside lfds611_abstraction_dcas) - this then causes us in our loop, should we repeat it, to update fe_local->next to a more - up-to-date version of the head of the lfds611_freelist - */ - - do { - fe_local[LFDS611_FREELIST_POINTER]->next[LFDS611_FREELIST_POINTER] = original_fe_next[LFDS611_FREELIST_POINTER]; - fe_local[LFDS611_FREELIST_POINTER]->next[LFDS611_FREELIST_COUNTER] = original_fe_next[LFDS611_FREELIST_COUNTER]; - } while( 0 == lfds611_abstraction_dcas((volatile lfds611_atom_t *) fs->top, (lfds611_atom_t *) fe_local, (lfds611_atom_t *) original_fe_next) ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_query.c deleted file mode 100644 index 9e42ee0361..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_query.c +++ /dev/null @@ -1,110 +0,0 @@ -#include "lfds611_freelist_internal.h" - - - - - -/****************************************************************************/ -void lfds611_freelist_query( struct lfds611_freelist_state *fs, enum lfds611_freelist_query_type query_type, void *query_input, void *query_output ) -{ - assert( fs != NULL ); - // TRD : query type can be any value in its range - // TRD : query_input can be NULL in some cases - assert( query_output != NULL ); - - LFDS611_BARRIER_LOAD; - - switch( query_type ) { - case LFDS611_FREELIST_QUERY_ELEMENT_COUNT: - assert( query_input == NULL ); - - *(lfds611_atom_t *) query_output = fs->element_count; - break; - - case LFDS611_FREELIST_QUERY_VALIDATE: - // TRD : query_input can be NULL - - lfds611_freelist_internal_validate( fs, (struct lfds611_validation_info *) query_input, (enum lfds611_data_structure_validity *) query_output ); - break; - } - - return; -} - - - - - -/****************************************************************************/ -void lfds611_freelist_internal_validate( struct lfds611_freelist_state *fs, struct lfds611_validation_info *vi, enum lfds611_data_structure_validity *lfds611_freelist_validity ) -{ - struct lfds611_freelist_element - *fe, - *fe_slow, - *fe_fast; - - lfds611_atom_t - element_count = 0; - - assert( fs != NULL ); - // TRD : vi can be NULL - assert( lfds611_freelist_validity != NULL ); - - *lfds611_freelist_validity = LFDS611_VALIDITY_VALID; - - fe_slow = fe_fast = (struct lfds611_freelist_element *) fs->top[LFDS611_FREELIST_POINTER]; - - /* TRD : first, check for a loop - we have two pointers - both of which start at the top of the lfds611_freelist - we enter a loop - and on each iteration - we advance one pointer by one element - and the other by two - - we exit the loop when both pointers are NULL - (have reached the end of the lfds611_freelist) - - or - - if we fast pointer 'sees' the slow pointer - which means we have a loop - */ - - if( fe_slow != NULL ) - do { - fe_slow = fe_slow->next[LFDS611_FREELIST_POINTER]; - - if( fe_fast != NULL ) - fe_fast = fe_fast->next[LFDS611_FREELIST_POINTER]; - - if( fe_fast != NULL ) - fe_fast = fe_fast->next[LFDS611_FREELIST_POINTER]; - } while( fe_slow != NULL and fe_fast != fe_slow ); - - if( fe_fast != NULL and fe_slow != NULL and fe_fast == fe_slow ) - *lfds611_freelist_validity = LFDS611_VALIDITY_INVALID_LOOP; - - /* TRD : now check for expected number of elements - vi can be NULL, in which case we do not check - we know we don't have a loop from our earlier check - */ - - if( *lfds611_freelist_validity == LFDS611_VALIDITY_VALID and vi != NULL ) { - fe = (struct lfds611_freelist_element *) fs->top[LFDS611_FREELIST_POINTER]; - - while( fe != NULL ) { - element_count++; - fe = (struct lfds611_freelist_element *) fe->next[LFDS611_FREELIST_POINTER]; - } - - if( element_count < vi->min_elements ) - *lfds611_freelist_validity = LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS; - - if( element_count > vi->max_elements ) - *lfds611_freelist_validity = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - } - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_abstraction_test_helpers.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_abstraction_test_helpers.c deleted file mode 100644 index a015159b7f..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_abstraction_test_helpers.c +++ /dev/null @@ -1,106 +0,0 @@ -#include "lfds611_liblfds_internal.h" - - - - - -/****************************************************************************/ -void lfds611_liblfds_abstraction_test_helper_increment_non_atomic( lfds611_atom_t *shared_counter ) -{ - /* TRD : lfds611_atom_t must be volatile or the compiler - optimizes it away into a single store - */ - - volatile lfds611_atom_t - count = 0; - - assert( shared_counter != NULL ); - - while( count++ < 10000000 ) - (*(lfds611_atom_t *) shared_counter)++; - - return; -} - - - - - -/****************************************************************************/ -void lfds611_liblfds_abstraction_test_helper_increment_atomic( volatile lfds611_atom_t *shared_counter ) -{ - lfds611_atom_t - count = 0; - - assert( shared_counter != NULL ); - - while( count++ < 10000000 ) - lfds611_abstraction_increment( shared_counter ); - - return; -} - - - - - -/****************************************************************************/ -void lfds611_liblfds_abstraction_test_helper_cas( volatile lfds611_atom_t *shared_counter, lfds611_atom_t *local_counter ) -{ - lfds611_atom_t - loop = 0, - original_destination; - - LFDS611_ALIGN(LFDS611_ALIGN_SINGLE_POINTER) lfds611_atom_t - exchange, - compare; - - assert( shared_counter != NULL ); - assert( local_counter != NULL ); - - while( loop++ < 1000000 ) { - do { - compare = *shared_counter; - exchange = compare + 1; - - original_destination = lfds611_abstraction_cas( shared_counter, exchange, compare ); - } while( original_destination != compare ); - - (*local_counter)++; - } - - return; -} - - - - - -/****************************************************************************/ -void lfds611_liblfds_abstraction_test_helper_dcas( volatile lfds611_atom_t *shared_counter, lfds611_atom_t *local_counter ) -{ - lfds611_atom_t - loop = 0; - - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) lfds611_atom_t - exchange[2], - compare[2]; - - assert( shared_counter != NULL ); - assert( local_counter != NULL ); - - while( loop++ < 1000000 ) { - compare[0] = *shared_counter; - compare[1] = *(shared_counter+1); - - do { - exchange[0] = compare[0] + 1; - exchange[1] = compare[1]; - } while( 0 == lfds611_abstraction_dcas(shared_counter, exchange, compare) ); - - (*local_counter)++; - } - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_aligned_free.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_aligned_free.c deleted file mode 100644 index 0449f8b244..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_aligned_free.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "lfds611_liblfds_internal.h" - - - - - -/****************************************************************************/ -void lfds611_liblfds_aligned_free( void *memory ) -{ - assert( memory != NULL ); - - // TRD : the "void *" stored above memory points to the root of the allocation - lfds611_abstraction_free( *( (void **) memory - 1 ) ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_aligned_malloc.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_aligned_malloc.c deleted file mode 100644 index ef6ee57426..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_aligned_malloc.c +++ /dev/null @@ -1,31 +0,0 @@ -#include "lfds611_liblfds_internal.h" - - - - - -/****************************************************************************/ -void *lfds611_liblfds_aligned_malloc( size_t size, size_t align_in_bytes ) -{ - void - *original_memory, - *memory; - - size_t - offset; - - // TRD : size can be any value in its range - // TRD : align_in_bytes can be any value in its range - - original_memory = memory = lfds611_abstraction_malloc( size + sizeof(void *) + align_in_bytes ); - - if( memory != NULL ) { - memory = (void **) memory + 1; - offset = align_in_bytes - (size_t) memory % align_in_bytes; - memory = (unsigned char *) memory + offset; - *( (void **) memory - 1 ) = original_memory; - } - - return( memory ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_internal.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_internal.h deleted file mode 100644 index d6fa122759..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_internal.h +++ /dev/null @@ -1,4 +0,0 @@ -/***** the library wide include file *****/ -#include "liblfds611_internal.h" - - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_readme.txt b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_readme.txt deleted file mode 100644 index aa3327028c..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_liblfds/lfds611_liblfds_readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is not a data structure but rather functions internal to the library. - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c deleted file mode 100644 index a11b501e56..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "lfds611_queue_internal.h" - - - - - -/****************************************************************************/ -void lfds611_queue_delete( struct lfds611_queue_state *qs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ) -{ - void - *user_data; - - assert( qs != NULL ); - // TRD : user_data_delete_function can be NULL - // TRD : user_state can be NULL - - // TRD : leading load barrier not required as it will be performed by the dequeue - - while( lfds611_queue_dequeue(qs, &user_data) ) - if( user_data_delete_function != NULL ) - user_data_delete_function( user_data, user_state ); - - /* TRD : fully dequeuing will leave us - with a single dummy element - which both qs->enqueue and qs->dequeue point at - we push this back onto the lfds611_freelist - before we delete the lfds611_freelist - */ - - lfds611_freelist_push( qs->fs, qs->enqueue[LFDS611_QUEUE_POINTER]->fe ); - - lfds611_freelist_delete( qs->fs, lfds611_queue_internal_freelist_delete_function, NULL ); - - lfds611_liblfds_aligned_free( qs ); - - return; -} - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_queue_internal_freelist_delete_function( void *user_data, void *user_state ) -{ - assert( user_data != NULL ); - assert( user_state == NULL ); - - lfds611_liblfds_aligned_free( user_data ); - - return; -} - -//#pragma warning( default : 4100 ) - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_internal.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_internal.h deleted file mode 100644 index e84e35035a..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_internal.h +++ /dev/null @@ -1,59 +0,0 @@ -/***** the library wide include file *****/ -#include "liblfds611_internal.h" - -/***** pragmas *****/ - -/***** defines *****/ -#define LFDS611_QUEUE_STATE_UNKNOWN -1 -#define LFDS611_QUEUE_STATE_EMPTY 0 -#define LFDS611_QUEUE_STATE_ENQUEUE_OUT_OF_PLACE 1 -#define LFDS611_QUEUE_STATE_ATTEMPT_DELFDS611_QUEUE 2 - -#define LFDS611_QUEUE_POINTER 0 -#define LFDS611_QUEUE_COUNTER 1 -#define LFDS611_QUEUE_PAC_SIZE 2 - -/***** structures *****/ -#pragma pack( push, LFDS611_ALIGN_DOUBLE_POINTER ) - -struct lfds611_queue_state { - struct lfds611_queue_element - *volatile enqueue[LFDS611_QUEUE_PAC_SIZE], - *volatile dequeue[LFDS611_QUEUE_PAC_SIZE]; - - lfds611_atom_t - aba_counter; - - struct lfds611_freelist_state - *fs; -}; - -struct lfds611_queue_element { - // TRD : next in a lfds611_queue requires volatile as it is target of CAS - struct lfds611_queue_element - *volatile next[LFDS611_QUEUE_PAC_SIZE]; - - struct lfds611_freelist_element - *fe; - - void - *user_data; -}; - -#pragma pack( pop ) - -/***** externs *****/ - -/***** private prototypes *****/ -int lfds611_queue_internal_freelist_init_function( void **user_data, void *user_state ); -void lfds611_queue_internal_freelist_delete_function( void *user_data, void *user_state ); - -void lfds611_queue_internal_new_element_from_freelist( struct lfds611_queue_state *qs, struct lfds611_queue_element *qe[LFDS611_QUEUE_PAC_SIZE], void *user_data ); -void lfds611_queue_internal_guaranteed_new_element_from_freelist( struct lfds611_queue_state *qs, struct lfds611_queue_element * qe[LFDS611_QUEUE_PAC_SIZE], void *user_data ); -void lfds611_queue_internal_init_element( struct lfds611_queue_state *qs, struct lfds611_queue_element *qe[LFDS611_QUEUE_PAC_SIZE], struct lfds611_freelist_element *fe, void *user_data ); - -void lfds611_queue_internal_queue( struct lfds611_queue_state *qs, struct lfds611_queue_element *qe[LFDS611_QUEUE_PAC_SIZE] ); - -void lfds611_queue_internal_validate( struct lfds611_queue_state *qs, struct lfds611_validation_info *vi, enum lfds611_data_structure_validity *lfds611_queue_validity, - enum lfds611_data_structure_validity *lfds611_freelist_validity ); - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c deleted file mode 100644 index 7fec0a2e90..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c +++ /dev/null @@ -1,158 +0,0 @@ -#include "lfds611_queue_internal.h" - - - - - -/****************************************************************************/ -int lfds611_queue_new( struct lfds611_queue_state **qs, lfds611_atom_t number_elements ) -{ - int - rv = 0; - - struct lfds611_queue_element - *qe[LFDS611_QUEUE_PAC_SIZE]; - - assert( qs != NULL ); - // TRD : number_elements can be any value in its range - - *qs = (struct lfds611_queue_state *) lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_queue_state), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( *qs != NULL ) { - // TRD : the size of the lfds611_freelist is the size of the lfds611_queue (+1 for the leading dummy element, which is hidden from the caller) - lfds611_freelist_new( &(*qs)->fs, number_elements+1, lfds611_queue_internal_freelist_init_function, NULL ); - - if( (*qs)->fs != NULL ) { - lfds611_queue_internal_new_element_from_freelist( *qs, qe, NULL ); - (*qs)->enqueue[LFDS611_QUEUE_POINTER] = (*qs)->dequeue[LFDS611_QUEUE_POINTER] = qe[LFDS611_QUEUE_POINTER]; - (*qs)->enqueue[LFDS611_QUEUE_COUNTER] = (*qs)->dequeue[LFDS611_QUEUE_COUNTER] = 0; - (*qs)->aba_counter = 0; - rv = 1; - } - - if( (*qs)->fs == NULL ) { - lfds611_liblfds_aligned_free( *qs ); - *qs = NULL; - } - } - - LFDS611_BARRIER_STORE; - - return( rv ); -} - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_queue_use( struct lfds611_queue_state *qs ) -{ - assert( qs != NULL ); - - LFDS611_BARRIER_LOAD; - - return; -} - -//#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -int lfds611_queue_internal_freelist_init_function( void **user_data, void *user_state ) -{ - int - rv = 0; - - assert( user_data != NULL ); - assert( user_state == NULL ); - - *user_data = lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_queue_element), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( *user_data != NULL ) - rv = 1; - - return( rv ); -} - -//#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -void lfds611_queue_internal_new_element_from_freelist( struct lfds611_queue_state *qs, struct lfds611_queue_element *qe[LFDS611_QUEUE_PAC_SIZE], void *user_data ) -{ - struct lfds611_freelist_element - *fe; - - assert( qs != NULL ); - assert( qe != NULL ); - // TRD : user_data can be any value in its range - - qe[LFDS611_QUEUE_POINTER] = NULL; - - lfds611_freelist_pop( qs->fs, &fe ); - - if( fe != NULL ) - lfds611_queue_internal_init_element( qs, qe, fe, user_data ); - - return; -} - - - - - -/****************************************************************************/ -void lfds611_queue_internal_guaranteed_new_element_from_freelist( struct lfds611_queue_state *qs, struct lfds611_queue_element *qe[LFDS611_QUEUE_PAC_SIZE], void *user_data ) -{ - struct lfds611_freelist_element - *fe; - - assert( qs != NULL ); - assert( qe != NULL ); - // TRD : user_data can be any value in its range - - qe[LFDS611_QUEUE_POINTER] = NULL; - - lfds611_freelist_guaranteed_pop( qs->fs, &fe ); - - if( fe != NULL ) - lfds611_queue_internal_init_element( qs, qe, fe, user_data ); - - return; -} - - - - - -/****************************************************************************/ -void lfds611_queue_internal_init_element( struct lfds611_queue_state *qs, struct lfds611_queue_element *qe[LFDS611_QUEUE_PAC_SIZE], struct lfds611_freelist_element *fe, void *user_data ) -{ - assert( qs != NULL ); - assert( qe != NULL ); - assert( fe != NULL ); - // TRD : user_data can be any value in its range - - lfds611_freelist_get_user_data_from_element( fe, (void **) &qe[LFDS611_QUEUE_POINTER] ); - qe[LFDS611_QUEUE_COUNTER] = (struct lfds611_queue_element *) lfds611_abstraction_increment( (lfds611_atom_t *) &qs->aba_counter ); - - qe[LFDS611_QUEUE_POINTER]->next[LFDS611_QUEUE_POINTER] = NULL; - qe[LFDS611_QUEUE_POINTER]->next[LFDS611_QUEUE_COUNTER] = (struct lfds611_queue_element *) lfds611_abstraction_increment( (lfds611_atom_t *) &qs->aba_counter ); - - qe[LFDS611_QUEUE_POINTER]->fe = fe; - qe[LFDS611_QUEUE_POINTER]->user_data = user_data; - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c deleted file mode 100644 index 504485d7b5..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c +++ /dev/null @@ -1,150 +0,0 @@ -#include "lfds611_queue_internal.h" - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_queue_query( struct lfds611_queue_state *qs, enum lfds611_queue_query_type query_type, void *query_input, void *query_output ) -{ - assert( qs != NULL ); - // TRD : query_type can be any value in its range - // TRD : query_input can be NULL - assert( query_output != NULL ); - - switch( query_type ) { - case LFDS611_QUEUE_QUERY_ELEMENT_COUNT: - assert( query_input == NULL ); - - lfds611_freelist_query( qs->fs, LFDS611_FREELIST_QUERY_ELEMENT_COUNT, NULL, query_output ); - break; - - case LFDS611_QUEUE_QUERY_VALIDATE: - // TRD : query_input can be NULL - - lfds611_queue_internal_validate( qs, (struct lfds611_validation_info *) query_input, (enum lfds611_data_structure_validity *) query_output, ((enum lfds611_data_structure_validity *) query_output)+1 ); - break; - } - - return; -} - -//#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -void lfds611_queue_internal_validate( struct lfds611_queue_state *qs, struct lfds611_validation_info *vi, enum lfds611_data_structure_validity *lfds611_queue_validity, - enum lfds611_data_structure_validity *lfds611_freelist_validity ) -{ - struct lfds611_queue_element - *qe, - *qe_slow, - *qe_fast; - - lfds611_atom_t - element_count = 0, - total_elements; - - struct lfds611_validation_info - lfds611_freelist_vi; - - assert( qs != NULL ); - // TRD : vi can be NULL - assert( lfds611_queue_validity != NULL ); - assert( lfds611_freelist_validity != NULL ); - - *lfds611_queue_validity = LFDS611_VALIDITY_VALID; - - LFDS611_BARRIER_LOAD; - - qe_slow = qe_fast = (struct lfds611_queue_element *) qs->dequeue[LFDS611_QUEUE_POINTER]; - - /* TRD : first, check for a loop - we have two pointers - both of which start at the dequeue end of the lfds611_queue - we enter a loop - and on each iteration - we advance one pointer by one element - and the other by two - - we exit the loop when both pointers are NULL - (have reached the end of the lfds611_queue) - - or - - if we fast pointer 'sees' the slow pointer - which means we have a loop - */ - - if( qe_slow != NULL ) - do { - qe_slow = qe_slow->next[LFDS611_QUEUE_POINTER]; - - if( qe_fast != NULL ) - qe_fast = qe_fast->next[LFDS611_QUEUE_POINTER]; - - if( qe_fast != NULL ) - qe_fast = qe_fast->next[LFDS611_QUEUE_POINTER]; - } while( qe_slow != NULL and qe_fast != qe_slow ); - - if( qe_fast != NULL and qe_slow != NULL and qe_fast == qe_slow ) - *lfds611_queue_validity = LFDS611_VALIDITY_INVALID_LOOP; - - /* TRD : now check for expected number of elements - vi can be NULL, in which case we do not check - we know we don't have a loop from our earlier check - */ - - if( *lfds611_queue_validity == LFDS611_VALIDITY_VALID and vi != NULL ) { - qe = (struct lfds611_queue_element *) qs->dequeue[LFDS611_QUEUE_POINTER]; - - while( qe != NULL ) { - element_count++; - qe = (struct lfds611_queue_element *) qe->next[LFDS611_QUEUE_POINTER]; - } - - /* TRD : remember there is a dummy element in the lfds611_queue */ - element_count--; - - if( element_count < vi->min_elements ) - *lfds611_queue_validity = LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS; - - if( element_count > vi->max_elements ) - *lfds611_queue_validity = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - } - - /* TRD : now we validate the lfds611_freelist - - we may be able to check for the expected number of - elements in the lfds611_freelist - - if the caller has given us an expected min and max - number of elements in the lfds611_queue, then the total number - of elements in the lfds611_freelist, minus that min and max, - gives us the expected number of elements in the - lfds611_freelist - */ - - if( vi != NULL ) { - lfds611_freelist_query( qs->fs, LFDS611_FREELIST_QUERY_ELEMENT_COUNT, NULL, (void *) &total_elements ); - - /* TRD : remember there is a dummy element in the lfds611_queue */ - total_elements--; - - lfds611_freelist_vi.min_elements = total_elements - vi->max_elements; - lfds611_freelist_vi.max_elements = total_elements - vi->min_elements; - - lfds611_freelist_query( qs->fs, LFDS611_FREELIST_QUERY_VALIDATE, (void *) &lfds611_freelist_vi, (void *) lfds611_freelist_validity ); - } - - if( vi == NULL ) - lfds611_freelist_query( qs->fs, LFDS611_FREELIST_QUERY_VALIDATE, NULL, (void *) lfds611_freelist_validity ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_queue.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_queue.c deleted file mode 100644 index c3abe45043..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_queue.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "lfds611_queue_internal.h" - - - - - -/****************************************************************************/ -int lfds611_queue_enqueue( struct lfds611_queue_state *qs, void *user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_queue_element - *qe[LFDS611_QUEUE_PAC_SIZE]; - - assert( qs != NULL ); - // TRD : user_data can be NULL - - lfds611_queue_internal_new_element_from_freelist( qs, qe, user_data ); - - if( qe[LFDS611_QUEUE_POINTER] == NULL ) - return( 0 ); - - lfds611_queue_internal_queue( qs, qe ); - - return( 1 ); -} - - - - - -/****************************************************************************/ -int lfds611_queue_guaranteed_enqueue( struct lfds611_queue_state *qs, void *user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_queue_element - *qe[LFDS611_QUEUE_PAC_SIZE]; - - assert( qs != NULL ); - // TRD : user_data can be NULL - - lfds611_queue_internal_guaranteed_new_element_from_freelist( qs, qe, user_data ); - - if( qe[LFDS611_QUEUE_POINTER] == NULL ) - return( 0 ); - - lfds611_queue_internal_queue( qs, qe ); - - return( 1 ); -} - - - - - -/****************************************************************************/ -void lfds611_queue_internal_queue( struct lfds611_queue_state *qs, struct lfds611_queue_element *qe[LFDS611_QUEUE_PAC_SIZE] ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_queue_element - *enqueue[LFDS611_QUEUE_PAC_SIZE], - *next[LFDS611_QUEUE_PAC_SIZE]; - - unsigned char - cas_result = 0; - - assert( qs != NULL ); - assert( qe != NULL ); - - // TRD : the DCAS operation issues a read and write barrier, so we don't need a read barrier in the do() loop - - LFDS611_BARRIER_LOAD; - - do { - enqueue[LFDS611_QUEUE_POINTER] = qs->enqueue[LFDS611_QUEUE_POINTER]; - enqueue[LFDS611_QUEUE_COUNTER] = qs->enqueue[LFDS611_QUEUE_COUNTER]; - - next[LFDS611_QUEUE_POINTER] = enqueue[LFDS611_QUEUE_POINTER]->next[LFDS611_QUEUE_POINTER]; - next[LFDS611_QUEUE_COUNTER] = enqueue[LFDS611_QUEUE_POINTER]->next[LFDS611_QUEUE_COUNTER]; - - /* TRD : this if() ensures that the next we read, just above, - really is from qs->enqueue (which we copied into enqueue) - */ - - LFDS611_BARRIER_LOAD; - - if( qs->enqueue[LFDS611_QUEUE_POINTER] == enqueue[LFDS611_QUEUE_POINTER] and qs->enqueue[LFDS611_QUEUE_COUNTER] == enqueue[LFDS611_QUEUE_COUNTER] ) { - if( next[LFDS611_QUEUE_POINTER] == NULL ) { - qe[LFDS611_QUEUE_COUNTER] = next[LFDS611_QUEUE_COUNTER] + 1; - cas_result = lfds611_abstraction_dcas( (volatile lfds611_atom_t *) enqueue[LFDS611_QUEUE_POINTER]->next, (lfds611_atom_t *) qe, (lfds611_atom_t *) next ); - } else { - next[LFDS611_QUEUE_COUNTER] = enqueue[LFDS611_QUEUE_COUNTER] + 1; - lfds611_abstraction_dcas( (volatile lfds611_atom_t *) qs->enqueue, (lfds611_atom_t *) next, (lfds611_atom_t *) enqueue ); - } - } - } while( cas_result == 0 ); - - qe[LFDS611_QUEUE_COUNTER] = enqueue[LFDS611_QUEUE_COUNTER] + 1; - lfds611_abstraction_dcas( (volatile lfds611_atom_t *) qs->enqueue, (lfds611_atom_t *) qe, (lfds611_atom_t *) enqueue ); - - return; -} - - - - - -/****************************************************************************/ -int lfds611_queue_dequeue( struct lfds611_queue_state *qs, void **user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_queue_element - *enqueue[LFDS611_QUEUE_PAC_SIZE], - *dequeue[LFDS611_QUEUE_PAC_SIZE], - *next[LFDS611_QUEUE_PAC_SIZE]; - - unsigned char - cas_result = 0; - - int - rv = 1, - state = LFDS611_QUEUE_STATE_UNKNOWN, - finished_flag = LOWERED; - - assert( qs != NULL ); - assert( user_data != NULL ); - - // TRD : the DCAS operation issues a read and write barrier, so we don't need a read barrier in the do() loop - - LFDS611_BARRIER_LOAD; - - do { - dequeue[LFDS611_QUEUE_POINTER] = qs->dequeue[LFDS611_QUEUE_POINTER]; - dequeue[LFDS611_QUEUE_COUNTER] = qs->dequeue[LFDS611_QUEUE_COUNTER]; - - enqueue[LFDS611_QUEUE_POINTER] = qs->enqueue[LFDS611_QUEUE_POINTER]; - enqueue[LFDS611_QUEUE_COUNTER] = qs->enqueue[LFDS611_QUEUE_COUNTER]; - - next[LFDS611_QUEUE_POINTER] = dequeue[LFDS611_QUEUE_POINTER]->next[LFDS611_QUEUE_POINTER]; - next[LFDS611_QUEUE_COUNTER] = dequeue[LFDS611_QUEUE_POINTER]->next[LFDS611_QUEUE_COUNTER]; - - /* TRD : confirm that dequeue didn't move between reading it - and reading its next pointer - */ - - LFDS611_BARRIER_LOAD; - - if( dequeue[LFDS611_QUEUE_POINTER] == qs->dequeue[LFDS611_QUEUE_POINTER] and dequeue[LFDS611_QUEUE_COUNTER] == qs->dequeue[LFDS611_QUEUE_COUNTER] ) { - if( enqueue[LFDS611_QUEUE_POINTER] == dequeue[LFDS611_QUEUE_POINTER] and next[LFDS611_QUEUE_POINTER] == NULL ) - state = LFDS611_QUEUE_STATE_EMPTY; - - if( enqueue[LFDS611_QUEUE_POINTER] == dequeue[LFDS611_QUEUE_POINTER] and next[LFDS611_QUEUE_POINTER] != NULL ) - state = LFDS611_QUEUE_STATE_ENQUEUE_OUT_OF_PLACE; - - if( enqueue[LFDS611_QUEUE_POINTER] != dequeue[LFDS611_QUEUE_POINTER] ) - state = LFDS611_QUEUE_STATE_ATTEMPT_DELFDS611_QUEUE; - - switch( state ) { - case LFDS611_QUEUE_STATE_EMPTY: - *user_data = NULL; - rv = 0; - finished_flag = RAISED; - break; - - case LFDS611_QUEUE_STATE_ENQUEUE_OUT_OF_PLACE: - next[LFDS611_QUEUE_COUNTER] = enqueue[LFDS611_QUEUE_COUNTER] + 1; - lfds611_abstraction_dcas( (volatile lfds611_atom_t *) qs->enqueue, (lfds611_atom_t *) next, (lfds611_atom_t *) enqueue ); - break; - - case LFDS611_QUEUE_STATE_ATTEMPT_DELFDS611_QUEUE: - *user_data = next[LFDS611_QUEUE_POINTER]->user_data; - - next[LFDS611_QUEUE_COUNTER] = dequeue[LFDS611_QUEUE_COUNTER] + 1; - cas_result = lfds611_abstraction_dcas( (volatile lfds611_atom_t *) qs->dequeue, (lfds611_atom_t *) next, (lfds611_atom_t *) dequeue ); - - if( cas_result == 1 ) - finished_flag = RAISED; - - break; - } - } - } while( finished_flag == LOWERED ); - - if( cas_result == 1 ) - lfds611_freelist_push( qs->fs, dequeue[LFDS611_QUEUE_POINTER]->fe ); - - return( rv ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_delete.c deleted file mode 100644 index 847d442d28..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_delete.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "lfds611_ringbuffer_internal.h" - - - - - -/****************************************************************************/ -void lfds611_ringbuffer_delete( struct lfds611_ringbuffer_state *rs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ) -{ - assert( rs != NULL ); - // TRD : user_data_delete_function can be NULL - // TRD : user_state can be NULL - - lfds611_queue_delete( rs->qs, NULL, NULL ); - - lfds611_freelist_delete( rs->fs, user_data_delete_function, user_state ); - - lfds611_liblfds_aligned_free( rs ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_get_and_put.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_get_and_put.c deleted file mode 100644 index 9b0ea2a667..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_get_and_put.c +++ /dev/null @@ -1,105 +0,0 @@ -#include "lfds611_ringbuffer_internal.h" - - - - - -/****************************************************************************/ -struct lfds611_freelist_element *lfds611_ringbuffer_get_read_element( struct lfds611_ringbuffer_state *rs, struct lfds611_freelist_element **fe ) -{ - assert( rs != NULL ); - assert( fe != NULL ); - - lfds611_queue_dequeue( rs->qs, (void **) fe ); - - return( *fe ); -} - - - - - -/****************************************************************************/ -struct lfds611_freelist_element *lfds611_ringbuffer_get_write_element( struct lfds611_ringbuffer_state *rs, struct lfds611_freelist_element **fe, int *overwrite_flag ) -{ - assert( rs != NULL ); - assert( fe != NULL ); - // TRD : overwrite_flag can be NULL - - /* TRD : we try to obtain an element from the lfds611_freelist - if we can, we populate it and add it to the lfds611_queue - - if we cannot, then the lfds611_ringbuffer is full - so instead we grab the current read element and - use that instead - - dequeue may fail since the lfds611_queue may be emptied - during our dequeue attempt - - so what we actually do here is a loop, attempting - the lfds611_freelist and if it fails then a dequeue, until - we obtain an element - - once we have an element, we lfds611_queue it - - you may be wondering why this operation is in a loop - remember - these operations are lock-free; anything - can happen in between - - so for example the pop could fail because the lfds611_freelist - is empty; but by the time we go to get an element from - the lfds611_queue, the whole lfds611_queue has been emptied back into - the lfds611_freelist! - - if overwrite_flag is provided, we set it to 0 if we - obtained a new element from the lfds611_freelist, 1 if we - stole an element from the lfds611_queue - */ - - do { - if( overwrite_flag != NULL ) - *overwrite_flag = 0; - - lfds611_freelist_pop( rs->fs, fe ); - - if( *fe == NULL ) { - lfds611_ringbuffer_get_read_element( rs, fe ); - - if( overwrite_flag != NULL and *fe != NULL ) - *overwrite_flag = 1; - } - } while( *fe == NULL ); - - return( *fe ); -} - - - - - -/****************************************************************************/ -void lfds611_ringbuffer_put_read_element( struct lfds611_ringbuffer_state *rs, struct lfds611_freelist_element *fe ) -{ - assert( rs != NULL ); - assert( fe != NULL ); - - lfds611_freelist_push( rs->fs, fe ); - - return; -} - - - - - -/****************************************************************************/ -void lfds611_ringbuffer_put_write_element( struct lfds611_ringbuffer_state *rs, struct lfds611_freelist_element *fe ) -{ - assert( rs != NULL ); - assert( fe != NULL ); - - lfds611_queue_enqueue( rs->qs, fe ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_internal.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_internal.h deleted file mode 100644 index e32a5f2d13..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_internal.h +++ /dev/null @@ -1,24 +0,0 @@ -/***** the library wide include file *****/ -#include "liblfds611_internal.h" - -/***** defines *****/ - -/***** structures *****/ -#pragma pack( push, LFDS611_ALIGN_DOUBLE_POINTER ) - -struct lfds611_ringbuffer_state { - struct lfds611_queue_state - *qs; - - struct lfds611_freelist_state - *fs; -}; - -#pragma pack( pop ) - -/***** externs *****/ - -/***** private prototypes *****/ -void lfds611_ringbuffer_internal_validate( struct lfds611_ringbuffer_state *rs, struct lfds611_validation_info *vi, enum lfds611_data_structure_validity *lfds611_queue_validity, - enum lfds611_data_structure_validity *lfds611_freelist_validity ); - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c deleted file mode 100644 index 6d8dde2a54..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c +++ /dev/null @@ -1,63 +0,0 @@ -#include "lfds611_ringbuffer_internal.h" - - - - - -/****************************************************************************/ -int lfds611_ringbuffer_new( struct lfds611_ringbuffer_state **rs, lfds611_atom_t number_elements, int (*user_data_init_function)(void **user_data, void *user_state), void *user_state ) -{ - int - rv = 0; - - assert( rs != NULL ); - // TRD : number_elements can be any value in its range - // TRD : user_data_init_function can be NULL - // TRD : user_state can be NULL - - *rs = (struct lfds611_ringbuffer_state *) lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_ringbuffer_state), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( *rs != NULL ) { - lfds611_freelist_new( &(*rs)->fs, number_elements, user_data_init_function, user_state ); - - if( (*rs)->fs != NULL ) { - lfds611_queue_new( &(*rs)->qs, number_elements ); - - if( (*rs)->qs != NULL ) - rv = 1; - - if( (*rs)->qs == NULL ) { - lfds611_liblfds_aligned_free( *rs ); - *rs = NULL; - } - } - - if( (*rs)->fs == NULL ) { - lfds611_liblfds_aligned_free( *rs ); - *rs = NULL; - } - } - - LFDS611_BARRIER_STORE; - - return( rv ); -} - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_ringbuffer_use( struct lfds611_ringbuffer_state *rs ) -{ - assert( rs != NULL ); - - LFDS611_BARRIER_LOAD; - - return; -} - -//#pragma warning( default : 4100 ) - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c deleted file mode 100644 index 11bf8b0b6e..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "lfds611_ringbuffer_internal.h" - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_ringbuffer_query( struct lfds611_ringbuffer_state *rs, enum lfds611_ringbuffer_query_type query_type, void *query_input, void *query_output ) -{ - assert( rs != NULL ); - // TRD : query_type can be any value in its range - // TRD : query_input can be NULL - assert( query_output != NULL ); - - switch( query_type ) { - case LFDS611_RINGBUFFER_QUERY_VALIDATE: - // TRD : query_input can be NULL - - lfds611_ringbuffer_internal_validate( rs, (struct lfds611_validation_info *) query_input, (enum lfds611_data_structure_validity *) query_output, - ((enum lfds611_data_structure_validity *) query_output)+2 ); - break; - } - - return; -} - -//#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -void lfds611_ringbuffer_internal_validate( struct lfds611_ringbuffer_state *rs, struct lfds611_validation_info *vi, enum lfds611_data_structure_validity *lfds611_queue_validity, - enum lfds611_data_structure_validity *lfds611_freelist_validity ) -{ - assert( rs != NULL ); - // TRD : vi can be NULL - assert( lfds611_queue_validity != NULL ); - assert( lfds611_freelist_validity != NULL ); - - lfds611_queue_query( rs->qs, LFDS611_QUEUE_QUERY_VALIDATE, vi, lfds611_queue_validity ); - - if( vi != NULL ) { - struct lfds611_validation_info - lfds611_freelist_vi; - - lfds611_atom_t - total_elements; - - lfds611_freelist_query( rs->fs, LFDS611_FREELIST_QUERY_ELEMENT_COUNT, NULL, (void *) &total_elements ); - lfds611_freelist_vi.min_elements = total_elements - vi->max_elements; - lfds611_freelist_vi.max_elements = total_elements - vi->min_elements; - lfds611_freelist_query( rs->fs, LFDS611_FREELIST_QUERY_VALIDATE, (void *) &lfds611_freelist_vi, (void *) lfds611_freelist_validity ); - } - - if( vi == NULL ) - lfds611_freelist_query( rs->fs, LFDS611_FREELIST_QUERY_VALIDATE, NULL, (void *) lfds611_freelist_validity ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_delete.c deleted file mode 100644 index 18a897b593..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_delete.c +++ /dev/null @@ -1,83 +0,0 @@ -#include "lfds611_slist_internal.h" - - - - - -/****************************************************************************/ -void lfds611_slist_delete( struct lfds611_slist_state *ss ) -{ - lfds611_slist_single_threaded_physically_delete_all_elements( ss ); - - lfds611_liblfds_aligned_free( ss ); - - return; -} - - - - - -/****************************************************************************/ -int lfds611_slist_logically_delete_element( struct lfds611_slist_state *ss, struct lfds611_slist_element *se ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) void - *volatile user_data_and_flags[2], - *volatile new_user_data_and_flags[2]; - - unsigned char - cas_rv = 0; - - assert( ss != NULL ); - assert( se != NULL ); - - LFDS611_BARRIER_LOAD; - - user_data_and_flags[LFDS611_SLIST_USER_DATA] = se->user_data_and_flags[LFDS611_SLIST_USER_DATA]; - user_data_and_flags[LFDS611_SLIST_FLAGS] = se->user_data_and_flags[LFDS611_SLIST_FLAGS]; - - do { - new_user_data_and_flags[LFDS611_SLIST_USER_DATA] = user_data_and_flags[LFDS611_SLIST_USER_DATA]; - new_user_data_and_flags[LFDS611_SLIST_FLAGS] = (void *) ((lfds611_atom_t) user_data_and_flags[LFDS611_SLIST_FLAGS] | LFDS611_SLIST_FLAG_DELETED); - } while( !((lfds611_atom_t) user_data_and_flags[LFDS611_SLIST_FLAGS] & LFDS611_SLIST_FLAG_DELETED) - and 0 == (cas_rv = lfds611_abstraction_dcas((volatile lfds611_atom_t *) se->user_data_and_flags, (lfds611_atom_t *) new_user_data_and_flags, (lfds611_atom_t *) user_data_and_flags)) ); - - if( cas_rv == 1 ) - if( ss->user_data_delete_function != NULL ) - ss->user_data_delete_function( (void *) user_data_and_flags[LFDS611_SLIST_USER_DATA], ss->user_state ); - - return( cas_rv ); -} - - - - - -/****************************************************************************/ -void lfds611_slist_single_threaded_physically_delete_all_elements( struct lfds611_slist_state *ss ) -{ - struct lfds611_slist_element - *volatile se, - *volatile se_temp; - - LFDS611_BARRIER_LOAD; - - se = ss->head; - - while( se != NULL ) { - // TRD : if a non-deleted element and there is a delete function, call the delete function - if( ss->user_data_delete_function != NULL ) - ss->user_data_delete_function( (void *) se->user_data_and_flags[LFDS611_SLIST_USER_DATA], ss->user_state ); - - se_temp = se; - se = se->next; - lfds611_liblfds_aligned_free( (void *) se_temp ); - } - - lfds611_slist_internal_init_slist( ss, ss->user_data_delete_function, ss->user_state ); - - LFDS611_BARRIER_STORE; - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_get_and_set.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_get_and_set.c deleted file mode 100644 index 5d5112b3b3..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_get_and_set.c +++ /dev/null @@ -1,133 +0,0 @@ -#include "lfds611_slist_internal.h" - - - - - -/****************************************************************************/ -int lfds611_slist_get_user_data_from_element( struct lfds611_slist_element *se, void **user_data ) -{ - int - rv = 1; - - assert( se != NULL ); - assert( user_data != NULL ); - - LFDS611_BARRIER_LOAD; - - *user_data = (void *) se->user_data_and_flags[LFDS611_SLIST_USER_DATA]; - - if( (lfds611_atom_t) se->user_data_and_flags[LFDS611_SLIST_FLAGS] & LFDS611_SLIST_FLAG_DELETED ) - rv = 0; - - return( rv ); -} - - - - - -/****************************************************************************/ -int lfds611_slist_set_user_data_in_element( struct lfds611_slist_element *se, void *user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) void - *user_data_and_flags[2], - *new_user_data_and_flags[2]; - - int - rv = 1; - - assert( se != NULL ); - // TRD : user_data can be NULL - - LFDS611_BARRIER_LOAD; - - user_data_and_flags[LFDS611_SLIST_USER_DATA] = se->user_data_and_flags[LFDS611_SLIST_USER_DATA]; - user_data_and_flags[LFDS611_SLIST_FLAGS] = se->user_data_and_flags[LFDS611_SLIST_FLAGS]; - - new_user_data_and_flags[LFDS611_SLIST_USER_DATA] = user_data; - - do { - new_user_data_and_flags[LFDS611_SLIST_FLAGS] = user_data_and_flags[LFDS611_SLIST_FLAGS]; - } while( !((lfds611_atom_t) user_data_and_flags[LFDS611_SLIST_FLAGS] & LFDS611_SLIST_FLAG_DELETED) and - 0 == lfds611_abstraction_dcas((volatile lfds611_atom_t *) se->user_data_and_flags, (lfds611_atom_t *) new_user_data_and_flags, (lfds611_atom_t *) user_data_and_flags) ); - - if( (lfds611_atom_t) user_data_and_flags[LFDS611_SLIST_FLAGS] & LFDS611_SLIST_FLAG_DELETED ) - rv = 0; - - LFDS611_BARRIER_STORE; - - return( rv ); -} - - - - - -/****************************************************************************/ -struct lfds611_slist_element *lfds611_slist_get_head( struct lfds611_slist_state *ss, struct lfds611_slist_element **se ) -{ - assert( ss != NULL ); - assert( se != NULL ); - - LFDS611_BARRIER_LOAD; - - *se = (struct lfds611_slist_element *) ss->head; - - lfds611_slist_internal_move_to_first_undeleted_element( se ); - - return( *se ); -} - - - - - -/****************************************************************************/ -struct lfds611_slist_element *lfds611_slist_get_next( struct lfds611_slist_element *se, struct lfds611_slist_element **next_se ) -{ - assert( se != NULL ); - assert( next_se != NULL ); - - LFDS611_BARRIER_LOAD; - - *next_se = (struct lfds611_slist_element *) se->next; - - lfds611_slist_internal_move_to_first_undeleted_element( next_se ); - - return( *next_se ); -} - - - - - -/****************************************************************************/ -struct lfds611_slist_element *lfds611_slist_get_head_and_then_next( struct lfds611_slist_state *ss, struct lfds611_slist_element **se ) -{ - assert( ss != NULL ); - assert( se != NULL ); - - if( *se == NULL ) - lfds611_slist_get_head( ss, se ); - else - lfds611_slist_get_next( *se, se ); - - return( *se ); -} - - - - - -/****************************************************************************/ -void lfds611_slist_internal_move_to_first_undeleted_element( struct lfds611_slist_element **se ) -{ - assert( se != NULL ); - - while( *se != NULL and (lfds611_atom_t) (*se)->user_data_and_flags[LFDS611_SLIST_FLAGS] & LFDS611_SLIST_FLAG_DELETED ) - (*se) = (struct lfds611_slist_element *) (*se)->next; - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_internal.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_internal.h deleted file mode 100644 index fe7e767515..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_internal.h +++ /dev/null @@ -1,53 +0,0 @@ -/***** the library wide include file *****/ -#include "liblfds611_internal.h" - -/***** defines *****/ -#define LFDS611_SLIST_USER_DATA 0 -#define LFDS611_SLIST_FLAGS 1 - -#define LFDS611_SLIST_NO_FLAGS 0x0 -#define LFDS611_SLIST_FLAG_DELETED 0x1 - -/***** structures *****/ -#pragma pack( push, LFDS611_ALIGN_SINGLE_POINTER ) - -struct lfds611_slist_state { - struct lfds611_slist_element - *volatile head; - - void - (*user_data_delete_function)( void *user_data, void *user_state ), - *user_state; -}; - -#pragma pack( pop ) - -#pragma pack( push, LFDS611_ALIGN_DOUBLE_POINTER ) - -/* TRD : this pragma pack doesn't seem to work under Windows - if the structure members are the correct way round - (next first), then user_data_and_flags ends up on - a single pointer boundary and DCAS crashes - - accordingly, I've moved user_data_and_flags first -*/ - -struct lfds611_slist_element { - void - *volatile user_data_and_flags[2]; - - // TRD : requires volatile as is target of CAS - struct lfds611_slist_element - *volatile next; -}; - -#pragma pack( pop ) - -/***** private prototypes *****/ -void lfds611_slist_internal_init_slist( struct lfds611_slist_state *ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ); - -void lfds611_slist_internal_link_element_to_head( struct lfds611_slist_state *lfds611_slist_state, struct lfds611_slist_element *volatile se ); -void lfds611_slist_internal_link_element_after_element( struct lfds611_slist_element *volatile lfds611_slist_in_list_element, struct lfds611_slist_element *volatile se ); - -void lfds611_slist_internal_move_to_first_undeleted_element( struct lfds611_slist_element **se ); - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_link.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_link.c deleted file mode 100644 index 3df2775c4f..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_link.c +++ /dev/null @@ -1,53 +0,0 @@ -#include "lfds611_slist_internal.h" - - - - - -/****************************************************************************/ -void lfds611_slist_internal_link_element_to_head( struct lfds611_slist_state *ss, struct lfds611_slist_element *volatile se ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_SINGLE_POINTER) struct lfds611_slist_element - *se_next; - - assert( ss != NULL ); - assert( se != NULL ); - - LFDS611_BARRIER_LOAD; - - se_next = ss->head; - - do { - se->next = se_next; - } while( se->next != (se_next = (struct lfds611_slist_element *) lfds611_abstraction_cas((volatile lfds611_atom_t *) &ss->head, (lfds611_atom_t) se, (lfds611_atom_t) se->next)) ); - - return; -} - - - - - -/****************************************************************************/ -void lfds611_slist_internal_link_element_after_element( struct lfds611_slist_element *volatile lfds611_slist_in_list_element, struct lfds611_slist_element *volatile se ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_SINGLE_POINTER) struct lfds611_slist_element - *se_prev, - *se_next; - - assert( lfds611_slist_in_list_element != NULL ); - assert( se != NULL ); - - LFDS611_BARRIER_LOAD; - - se_prev = (struct lfds611_slist_element *) lfds611_slist_in_list_element; - - se_next = se_prev->next; - - do { - se->next = se_next; - } while( se->next != (se_next = (struct lfds611_slist_element *) lfds611_abstraction_cas((volatile lfds611_atom_t *) &se_prev->next, (lfds611_atom_t) se, (lfds611_atom_t) se->next)) ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c deleted file mode 100644 index b48e349ab0..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c +++ /dev/null @@ -1,114 +0,0 @@ -#include "lfds611_slist_internal.h" - - - - - -/****************************************************************************/ -int lfds611_slist_new( struct lfds611_slist_state **ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ) -{ - int - rv = 0; - - assert( ss != NULL ); - // TRD : user_data_delete_function can be NULL - // TRD : user_state can be NULL - - *ss = (struct lfds611_slist_state *) lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_slist_state), LFDS611_ALIGN_SINGLE_POINTER ); - - if( *ss != NULL ) { - lfds611_slist_internal_init_slist( *ss, user_data_delete_function, user_state ); - rv = 1; - } - - LFDS611_BARRIER_STORE; - - return( rv ); -} - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_slist_use( struct lfds611_slist_state *ss ) -{ - assert( ss != NULL ); - - LFDS611_BARRIER_LOAD; - - return; -} - -//#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -void lfds611_slist_internal_init_slist( struct lfds611_slist_state *ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ) -{ - assert( ss != NULL ); - // TRD : user_data_delete_function can be NULL - // TRD : user_state can be NULL - - ss->head = NULL; - ss->user_data_delete_function = user_data_delete_function; - ss->user_state = user_state; - - return; -} - - - - - -/****************************************************************************/ -struct lfds611_slist_element *lfds611_slist_new_head( struct lfds611_slist_state *ss, void *user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_SINGLE_POINTER) struct lfds611_slist_element - *volatile se; - - assert( ss != NULL ); - // TRD : user_data can be NULL - - se = (struct lfds611_slist_element *) lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_slist_element), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( se != NULL ) { - se->user_data_and_flags[LFDS611_SLIST_USER_DATA] = user_data; - se->user_data_and_flags[LFDS611_SLIST_FLAGS] = LFDS611_SLIST_NO_FLAGS; - - lfds611_slist_internal_link_element_to_head( ss, se ); - } - - return( (struct lfds611_slist_element *) se ); -} - - - - - -/****************************************************************************/ -struct lfds611_slist_element *lfds611_slist_new_next( struct lfds611_slist_element *se, void *user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_SINGLE_POINTER) struct lfds611_slist_element - *volatile se_next; - - assert( se != NULL ); - // TRD : user_data can be NULL - - se_next = (struct lfds611_slist_element *) lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_slist_element), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( se_next != NULL ) { - se_next->user_data_and_flags[LFDS611_SLIST_USER_DATA] = user_data; - se_next->user_data_and_flags[LFDS611_SLIST_FLAGS] = LFDS611_SLIST_NO_FLAGS; - - lfds611_slist_internal_link_element_after_element( se, se_next ); - } - - return( (struct lfds611_slist_element *) se_next ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c deleted file mode 100644 index 75700e6b39..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c +++ /dev/null @@ -1,67 +0,0 @@ -#include "lfds611_stack_internal.h" - - - - - -/****************************************************************************/ -void lfds611_stack_delete( struct lfds611_stack_state *ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state ) -{ - void - *user_data; - - assert( ss != NULL ); - // TRD : user_data_delete_function can be NULL - // TRD : user_state can be NULL - - while( lfds611_stack_pop(ss, &user_data) ) - if( user_data_delete_function != NULL ) - user_data_delete_function( user_data, user_state ); - - lfds611_freelist_delete( ss->fs, lfds611_stack_internal_freelist_delete_function, NULL ); - - lfds611_liblfds_aligned_free( ss ); - - return; -} - - - - - -/****************************************************************************/ -void lfds611_stack_clear( struct lfds611_stack_state *ss, void (*user_data_clear_function)(void *user_data, void *user_state), void *user_state ) -{ - void - *user_data; - - assert( ss != NULL ); - // TRD : user_data_clear_function can be NULL - // TRD : user_state can be NULL - - while( lfds611_stack_pop(ss, &user_data) ) - if( user_data_clear_function != NULL ) - user_data_clear_function( user_data, user_state ); - - return; -} - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_stack_internal_freelist_delete_function( void *user_data, void *user_state ) -{ - assert( user_data != NULL ); - assert( user_state == NULL ); - - lfds611_liblfds_aligned_free( user_data ); - - return; -} - -//#pragma warning( default : 4100 ) - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_internal.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_internal.h deleted file mode 100644 index 32f4f3fa40..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_internal.h +++ /dev/null @@ -1,51 +0,0 @@ -/***** the library wide include file *****/ -#include "liblfds611_internal.h" - -/***** pragmas *****/ - -/***** defines *****/ -#define LFDS611_STACK_POINTER 0 -#define LFDS611_STACK_COUNTER 1 -#define LFDS611_STACK_PAC_SIZE 2 - -/***** structures *****/ -#pragma pack( push, LFDS611_ALIGN_DOUBLE_POINTER ) - -struct lfds611_stack_state { - // TRD : must come first for alignment - struct lfds611_stack_element - *volatile top[LFDS611_STACK_PAC_SIZE]; - - lfds611_atom_t - aba_counter; - - struct lfds611_freelist_state - *fs; -}; - -struct lfds611_stack_element { - struct lfds611_stack_element - *next[LFDS611_STACK_PAC_SIZE]; - - struct lfds611_freelist_element - *fe; - - void - *user_data; -}; - -#pragma pack( pop ) - -/***** private prototypes *****/ -int lfds611_stack_internal_freelist_init_function( void **user_data, void *user_state ); -void lfds611_stack_internal_freelist_delete_function( void *user_data, void *user_state ); - -void lfds611_stack_internal_new_element_from_freelist( struct lfds611_stack_state *ss, struct lfds611_stack_element *se[LFDS611_STACK_PAC_SIZE], void *user_data ); -void lfds611_stack_internal_new_element( struct lfds611_stack_state *ss, struct lfds611_stack_element *se[LFDS611_STACK_PAC_SIZE], void *user_data ); -void lfds611_stack_internal_init_element( struct lfds611_stack_state *ss, struct lfds611_stack_element *se[LFDS611_STACK_PAC_SIZE], struct lfds611_freelist_element *fe, void *user_data ); - -void lfds611_stack_internal_push( struct lfds611_stack_state *ss, struct lfds611_stack_element *se[LFDS611_STACK_PAC_SIZE] ); - -void lfds611_stack_internal_validate( struct lfds611_stack_state *ss, struct lfds611_validation_info *vi, enum lfds611_data_structure_validity *stack_validity, - enum lfds611_data_structure_validity *freelist_validity ); - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c deleted file mode 100644 index 927f28c88c..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c +++ /dev/null @@ -1,156 +0,0 @@ -#include "lfds611_stack_internal.h" - - - - - -/****************************************************************************/ -int lfds611_stack_new( struct lfds611_stack_state **ss, lfds611_atom_t number_elements ) -{ - int - rv = 0; - - assert( ss != NULL ); - // TRD : number_elements can be any value in its range - - *ss = (struct lfds611_stack_state *) lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_stack_state), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( *ss != NULL ) { - // TRD : the size of the lfds611_freelist is the size of the lfds611_stack - lfds611_freelist_new( &(*ss)->fs, number_elements, lfds611_stack_internal_freelist_init_function, NULL ); - - if( (*ss)->fs == NULL ) { - lfds611_liblfds_aligned_free( *ss ); - *ss = NULL; - } - - if( (*ss)->fs != NULL ) { - (*ss)->top[LFDS611_STACK_POINTER] = NULL; - (*ss)->top[LFDS611_STACK_COUNTER] = 0; - (*ss)->aba_counter = 0; - rv = 1; - } - } - - LFDS611_BARRIER_STORE; - - return( rv ); -} - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -void lfds611_stack_use( struct lfds611_stack_state *ss ) -{ - assert( ss != NULL ); - - LFDS611_BARRIER_LOAD; - - return; -} - -//#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -//#pragma warning( disable : 4100 ) - -int lfds611_stack_internal_freelist_init_function( void **user_data, void *user_state ) -{ - int - rv = 0; - - assert( user_data != NULL ); - assert( user_state == NULL ); - - *user_data = lfds611_liblfds_aligned_malloc( sizeof(struct lfds611_stack_element), LFDS611_ALIGN_DOUBLE_POINTER ); - - if( *user_data != NULL ) - rv = 1; - - return( rv ); -} - -//#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -void lfds611_stack_internal_new_element_from_freelist( struct lfds611_stack_state *ss, struct lfds611_stack_element *se[LFDS611_STACK_PAC_SIZE], void *user_data ) -{ - struct lfds611_freelist_element - *fe; - - assert( ss != NULL ); - assert( se != NULL ); - // TRD : user_data can be any value in its range - - lfds611_freelist_pop( ss->fs, &fe ); - - if( fe == NULL ) - se[LFDS611_STACK_POINTER] = NULL; - - if( fe != NULL ) - lfds611_stack_internal_init_element( ss, se, fe, user_data ); - - return; -} - - - - - -/****************************************************************************/ -void lfds611_stack_internal_new_element( struct lfds611_stack_state *ss, struct lfds611_stack_element *se[LFDS611_STACK_PAC_SIZE], void *user_data ) -{ - struct lfds611_freelist_element - *fe; - - assert( ss != NULL ); - assert( se != NULL ); - // TRD : user_data can be any value in its range - - lfds611_freelist_guaranteed_pop( ss->fs, &fe ); - - if( fe == NULL ) - se[LFDS611_STACK_POINTER] = NULL; - - if( fe != NULL ) - lfds611_stack_internal_init_element( ss, se, fe, user_data ); - - return; -} - - - - - -/****************************************************************************/ -void lfds611_stack_internal_init_element( struct lfds611_stack_state *ss, struct lfds611_stack_element *se[LFDS611_STACK_PAC_SIZE], struct lfds611_freelist_element *fe, void *user_data ) -{ - assert( ss != NULL ); - assert( se != NULL ); - assert( fe != NULL ); - // TRD : user_data can be any value in its range - - lfds611_freelist_get_user_data_from_element( fe, (void **) &se[LFDS611_STACK_POINTER] ); - - se[LFDS611_STACK_COUNTER] = (struct lfds611_stack_element *) lfds611_abstraction_increment( (lfds611_atom_t *) &ss->aba_counter ); - - se[LFDS611_STACK_POINTER]->next[LFDS611_STACK_POINTER] = NULL; - se[LFDS611_STACK_POINTER]->next[LFDS611_STACK_COUNTER] = 0; - se[LFDS611_STACK_POINTER]->fe = fe; - se[LFDS611_STACK_POINTER]->user_data = user_data; - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_push_pop.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_push_pop.c deleted file mode 100644 index 402051114b..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_push_pop.c +++ /dev/null @@ -1,110 +0,0 @@ -#include "lfds611_stack_internal.h" - - - - - -/****************************************************************************/ -int lfds611_stack_push( struct lfds611_stack_state *ss, void *user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_stack_element - *se[LFDS611_STACK_PAC_SIZE]; - - assert( ss != NULL ); - // TRD : user_data can be NULL - - lfds611_stack_internal_new_element_from_freelist( ss, se, user_data ); - - if( se[LFDS611_STACK_POINTER] == NULL ) - return( 0 ); - - lfds611_stack_internal_push( ss, se ); - - return( 1 ); -} - - - - - -/****************************************************************************/ -int lfds611_stack_guaranteed_push( struct lfds611_stack_state *ss, void *user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_stack_element - *se[LFDS611_STACK_PAC_SIZE]; - - assert( ss != NULL ); - // TRD : user_data can be NULL - - /* TRD : this function allocated a new lfds611_freelist element and uses that - to push onto the lfds611_stack, guaranteeing success (unless malloc() - fails of course) - */ - - lfds611_stack_internal_new_element( ss, se, user_data ); - - // TRD : malloc failed - if( se[LFDS611_STACK_POINTER] == NULL ) - return( 0 ); - - lfds611_stack_internal_push( ss, se ); - - return( 1 ); -} - - - - - -/****************************************************************************/ -void lfds611_stack_internal_push( struct lfds611_stack_state *ss, struct lfds611_stack_element *se[LFDS611_STACK_PAC_SIZE] ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_stack_element - *original_se_next[LFDS611_STACK_PAC_SIZE]; - - assert( ss != NULL ); - assert( se != NULL ); - - LFDS611_BARRIER_LOAD; - - original_se_next[LFDS611_STACK_POINTER] = ss->top[LFDS611_STACK_POINTER]; - original_se_next[LFDS611_STACK_COUNTER] = ss->top[LFDS611_STACK_COUNTER]; - - do { - se[LFDS611_STACK_POINTER]->next[LFDS611_STACK_POINTER] = original_se_next[LFDS611_STACK_POINTER]; - se[LFDS611_STACK_POINTER]->next[LFDS611_STACK_COUNTER] = original_se_next[LFDS611_STACK_COUNTER]; - } while( 0 == lfds611_abstraction_dcas((volatile lfds611_atom_t *) ss->top, (lfds611_atom_t *) se, (lfds611_atom_t *) original_se_next) ); - - return; -} - - - - - -/****************************************************************************/ -int lfds611_stack_pop( struct lfds611_stack_state *ss, void **user_data ) -{ - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) struct lfds611_stack_element - *se[LFDS611_STACK_PAC_SIZE]; - - assert( ss != NULL ); - assert( user_data != NULL ); - - LFDS611_BARRIER_LOAD; - - se[LFDS611_STACK_COUNTER] = ss->top[LFDS611_STACK_COUNTER]; - se[LFDS611_STACK_POINTER] = ss->top[LFDS611_STACK_POINTER]; - - do { - if( se[LFDS611_STACK_POINTER] == NULL ) - return( 0 ); - } while( 0 == lfds611_abstraction_dcas((volatile lfds611_atom_t *) ss->top, (lfds611_atom_t *) se[LFDS611_STACK_POINTER]->next, (lfds611_atom_t *) se) ); - - *user_data = se[LFDS611_STACK_POINTER]->user_data; - - lfds611_freelist_push( ss->fs, se[LFDS611_STACK_POINTER]->fe ); - - return( 1 ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_query.c deleted file mode 100644 index 51ef2d1283..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_query.c +++ /dev/null @@ -1,154 +0,0 @@ -#include "lfds611_stack_internal.h" - - - - - -/****************************************************************************/ -void lfds611_stack_query( struct lfds611_stack_state *ss, enum lfds611_stack_query_type query_type, void *query_input, void *query_output ) -{ - assert( ss != NULL ); - // TRD : query_type can be any value in its range - // TRD : query_iput can be NULL - assert( query_output != NULL ); - - LFDS611_BARRIER_LOAD; - - switch( query_type ) { - case LFDS611_STACK_QUERY_ELEMENT_COUNT: - assert( query_input == NULL ); - - lfds611_freelist_query( ss->fs, LFDS611_FREELIST_QUERY_ELEMENT_COUNT, NULL, query_output ); - break; - - case LFDS611_STACK_QUERY_VALIDATE: - // TRD : query_input can be NULL - - /* TRD : the validation info passed in is for the stack - it indicates the minimum and maximum number of elements - which should be present - - we need to validate the freelist - and validate the stack - - we cannot know the min/max for the freelist, given only - the min/max for the stack - */ - - lfds611_freelist_query( ss->fs, LFDS611_FREELIST_QUERY_VALIDATE, NULL, (enum lfds611_data_structure_validity *) query_output ); - - if( *(enum lfds611_data_structure_validity *) query_output == LFDS611_VALIDITY_VALID ) - lfds611_stack_internal_validate( ss, (struct lfds611_validation_info *) query_input, (enum lfds611_data_structure_validity *) query_output, ((enum lfds611_data_structure_validity *) query_output)+1 ); - - break; - } - - return; -} - - - - - -/****************************************************************************/ -void lfds611_stack_internal_validate( struct lfds611_stack_state *ss, struct lfds611_validation_info *vi, enum lfds611_data_structure_validity *stack_validity, - enum lfds611_data_structure_validity *freelist_validity ) -{ - struct lfds611_stack_element - *se, - *se_slow, - *se_fast; - - lfds611_atom_t - element_count = 0, - total_elements; - - struct lfds611_validation_info - freelist_vi; - - assert( ss != NULL ); - // TRD : vi can be NULL - assert( stack_validity != NULL ); - - *stack_validity = LFDS611_VALIDITY_VALID; - - se_slow = se_fast = (struct lfds611_stack_element *) ss->top[LFDS611_STACK_POINTER]; - - /* TRD : first, check for a loop - we have two pointers - both of which start at the top of the stack - we enter a loop - and on each iteration - we advance one pointer by one element - and the other by two - - we exit the loop when both pointers are NULL - (have reached the end of the stack) - - or - - if we fast pointer 'sees' the slow pointer - which means we have a loop - */ - - if( se_slow != NULL ) - do { - se_slow = se_slow->next[LFDS611_STACK_POINTER]; - - if( se_fast != NULL ) - se_fast = se_fast->next[LFDS611_STACK_POINTER]; - - if( se_fast != NULL ) - se_fast = se_fast->next[LFDS611_STACK_POINTER]; - } while( se_slow != NULL and se_fast != se_slow ); - - if( se_fast != NULL and se_slow != NULL and se_fast == se_slow ) - *stack_validity = LFDS611_VALIDITY_INVALID_LOOP; - - /* TRD : now check for expected number of elements - vi can be NULL, in which case we do not check - we know we don't have a loop from our earlier check - */ - - if( *stack_validity == LFDS611_VALIDITY_VALID and vi != NULL ) { - se = (struct lfds611_stack_element *) ss->top[LFDS611_STACK_POINTER]; - - while( se != NULL ) { - element_count++; - se = (struct lfds611_stack_element *) se->next[LFDS611_STACK_POINTER]; - } - - if( element_count < vi->min_elements ) - *stack_validity = LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS; - - if( element_count > vi->max_elements ) - *stack_validity = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - } - - /* TRD : now we validate the freelist - - we may be able to check for the expected number of - elements in the freelist - - if the caller has given us an expected min and max - number of elements in the stack, then the total number - of elements in the freelist, minus that min and max, - gives us the expected number of elements in the - freelist - */ - - if( vi != NULL ) { - lfds611_freelist_query( ss->fs, LFDS611_FREELIST_QUERY_ELEMENT_COUNT, NULL, (void *) &total_elements ); - - freelist_vi.min_elements = total_elements - vi->max_elements; - freelist_vi.max_elements = total_elements - vi->min_elements; - - lfds611_freelist_query( ss->fs, LFDS611_FREELIST_QUERY_VALIDATE, (void *) &freelist_vi, (void *) freelist_validity ); - } - - if( vi == NULL ) - lfds611_freelist_query( ss->fs, LFDS611_FREELIST_QUERY_VALIDATE, NULL, (void *) freelist_validity ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/liblfds611_internal.h b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/liblfds611_internal.h deleted file mode 100644 index 9bcf726504..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/liblfds611_internal.h +++ /dev/null @@ -1,25 +0,0 @@ -/***** public prototypes *****/ -#include "liblfds611.h" - -/***** defines *****/ -#define and && -#define or || - -#define RAISED 1 -#define LOWERED 0 - -#define NO_FLAGS 0x0 - -/***** private prototypes *****/ -void *lfds611_liblfds_aligned_malloc( size_t size, size_t align_in_bytes ); -void lfds611_liblfds_aligned_free( void *memory ); - -static LFDS611_INLINE lfds611_atom_t lfds611_abstraction_cas( volatile lfds611_atom_t *destination, lfds611_atom_t exchange, lfds611_atom_t compare ); -static LFDS611_INLINE unsigned char lfds611_abstraction_dcas( volatile lfds611_atom_t *destination, lfds611_atom_t *exchange, lfds611_atom_t *compare ); -static LFDS611_INLINE lfds611_atom_t lfds611_abstraction_increment( volatile lfds611_atom_t *value ); - -/***** inlined code *****/ -#include "lfds611_abstraction/lfds611_abstraction_cas.c" -#include "lfds611_abstraction/lfds611_abstraction_dcas.c" -#include "lfds611_abstraction/lfds611_abstraction_increment.c" - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/building.txt b/openair2/UTIL/LFDS/liblfds6.1.1/test/building.txt deleted file mode 100644 index 685cda0cf1..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/building.txt +++ /dev/null @@ -1,51 +0,0 @@ -building test -============= - -Windows (user-mode) -=================== -1. Use Microsoft Visual Studio 2008 or Visual C++ 2008 Express Edition (or - later versions) to load "liblfds.sln". The "Win32" platform is x86, - the "x64" platform is x64. The test programme provides the "Release" - and "Debug" targets. The other targets ("Release DLL", "Release Lib", - "Debug DLL" and "Debug Lib") are carried over will-nilly from the liblds - library. - - All builds will work, but DLL builds will require the DLL from liblfds - to be placed into a location where the test executable can find it (e.g. - the same directory). - -2. Use Microsoft Windows SDK and GNUmake to run makefile.windows (obviously - you'll need to have run setenv.bat or the appropriate vcvars*.bat first; - you can build for x64/64-bit and x86/32-bit - just run the correct batch - file). - - If liblfds has been built as a DLL, the DLL from liblfds needs to be - placed into a location where the test executable can find it (e.g. the - same directory). - - Targets are "rel", "dbg" and "clean". You need to clean between switching - targets. - -Windows (kernel) -================ -No build supported, since this is a command line utility. - -Linux -===== -Use GNUmake to run "makefile.linux". Targets are "rel", "dbg" and -"clean". You need to clean between switching targets. - -If liblfds has been built as a shared object, the shared object file from -liblfds will need to be placed somewhere the text executable can find it. - -A convenient solution is to place the shared object file in the same -directory as the text executable and set the environment variable -"LD_LIBRARY_PATH" to ".", e.g. in bash; - -export LD_LIBRARY_PATH=. - -Remember to unset after finishing testing, or your system will continue -to scan the current directory for shared object files. - -unset LD_LIBRARY_PATH - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/makefile.linux b/openair2/UTIL/LFDS/liblfds6.1.1/test/makefile.linux deleted file mode 100644 index 8bc0c1c860..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/makefile.linux +++ /dev/null @@ -1,82 +0,0 @@ -##### paths ##### -BINDIR = bin -INCDIR = ../liblfds611/inc -LIBDIR = ../liblfds611/bin -OBJDIR = obj -SRCDIR = src - -##### misc ##### -QUIETLY = 1>nul 2>nul - -##### sources, objects and libraries ##### -BINNAME = test -BINARY = $(BINDIR)/$(BINNAME) -SRCDIRS = . -SOURCES = abstraction_cpu_count.c test_abstraction.c abstraction_thread_start.c abstraction_thread_wait.c benchmark_freelist.c benchmark_queue.c benchmark_ringbuffer.c benchmark_stack.c test_freelist.c main.c misc.c test_queue.c test_ringbuffer.c test_slist.c test_stack.c -OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES))) -SYSLIBS = -lpthread -lc -lm -USRLIBS = -llfds611 - -##### CPU variants ##### -UNAME = $(shell uname -m) -GCCARCH = -march=$(UNAME) - -ifeq ($(UNAME),x86_64) - GCCARCH = -march=core2 -endif - -ifeq ($(findstring arm,$(UNAME)),arm) - GCCARCH = -march=armv6k -marm -endif - -##### tools ##### -MAKE = make -MFLAGS = - -DG = gcc -DGFLAGS = -MM -std=c99 -I"$(SRCDIR)" -I"$(INCDIR)" - -CC = gcc -CFBASE = -Wall -Wno-unknown-pragmas -std=c99 $(GCCARCH) -pthread -c -I"$(SRCDIR)" -I"$(INCDIR)" -CFREL = -O2 -Wno-strict-aliasing -CFDBG = -O0 -g - -LD = gcc -LFBASE = -L"$(LIBDIR)" -LFREL = -O2 -s -LFDBG = -O0 -g - -##### variants ##### -CFLAGS = $(CFBASE) $(CFDBG) -LFLAGS = $(LFBASE) $(LFDBG) - -ifeq ($(MAKECMDGOALS),rel) - CFLAGS = $(CFBASE) $(CFREL) - LFLAGS = $(LFBASE) $(LFREL) -endif - -##### search paths ##### -vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS)) - -##### implicit rules ##### -$(OBJDIR)/%.o : %.c - $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d - $(CC) $(CFLAGS) -o $@ $< - -##### explicit rules ##### -$(BINARY) : $(OBJECTS) - $(LD) -o $(BINARY) $(LFLAGS) $(OBJECTS) $(USRLIBS) $(SYSLIBS) - chmod +x $(BINARY) - -##### phony ##### -.PHONY : clean rel dbg - -clean : - @rm -f $(BINDIR)/$(BINNAME) $(OBJDIR)/*.o $(OBJDIR)/*.d - -rel : $(BINARY) -dbg : $(BINARY) - -##### dependencies ##### --include $(DEPENDS) - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/makefile.windows b/openair2/UTIL/LFDS/liblfds6.1.1/test/makefile.windows deleted file mode 100644 index d899414b07..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/makefile.windows +++ /dev/null @@ -1,64 +0,0 @@ -##### paths ##### -BINDIR = bin -INCDIR = ../liblfds611/inc -LIBDIR = ../liblfds611/bin -OBJDIR = obj -SRCDIR = src - -##### misc ##### -QUIETLY = 1>nul 2>nul - -##### sources, objects and libraries ##### -BINNAME = test -BINARY = $(BINDIR)\$(BINNAME).exe -SRCDIRS = . -SOURCES = abstraction_cpu_count.c test_abstraction.c abstraction_thread_start.c abstraction_thread_wait.c benchmark_freelist.c benchmark_queue.c benchmark_ringbuffer.c benchmark_stack.c test_freelist.c main.c misc.c test_queue.c test_ringbuffer.c test_slist.c test_stack.c -OBJECTS = $(patsubst %.c,$(OBJDIR)/%.obj,$(notdir $(SOURCES))) -SYSLIBS = kernel32.lib -USRLIBS = liblfds611.lib - -##### tools ##### -MAKE = make -MFLAGS = - -CC = cl -CFBASE = /nologo /W4 /WX /c "-I$(SRCDIR)" "-I$(INCLUDE)" "-I$(INCDIR)" "/Fd$(BINDIR)\$(BINNAME).pdb" /D UNICODE /D _UNICODE /DWIN32_LEAN_AND_MEAN /D_CRT_SECURE_NO_WARNINGS -CFREL = /Ox /DNDEBUG /MT -CFDBG = /Od /Gm /Zi /D_DEBUG /MTd - -LD = link -LFBASE = "/libpath:$(LIB)" "/libpath:$(LIBDIR)" /nologo /subsystem:console /nodefaultlib /nxcompat /wx -LFREL = /incremental:no -LFDBG = /debug "/pdb:$(BINDIR)\$(BINNAME).pdb" - -##### variants ##### -CFLAGS = $(CFBASE) $(CFDBG) -LFLAGS = $(LFBASE) $(LFDBG) -CLIB = libcmtd.lib - -ifeq ($(MAKECMDGOALS),rel) - CFLAGS = $(CFBASE) $(CFREL) - LFLAGS = $(LFBASE) $(LFREL) - CLIB = libcmt.lib -endif - -##### search paths ##### -vpath %.c $(patsubst %,$(SRCDIR)/%;,$(SRCDIRS)) - -##### implicit rules ##### -$(OBJDIR)/%.obj : %.c - $(CC) $(CFLAGS) "/Fo$@" $< - -##### explicit rules ##### -$(BINARY) : $(OBJECTS) - $(LD) $(LFLAGS) $(CLIB) $(SYSLIBS) $(USRLIBS) $(OBJECTS) /out:$(BINARY) - -##### phony ##### -.PHONY : clean rel dbg - -clean : - @erase /Q $(OBJDIR)\*.obj $(BINDIR)\$(BINNAME).* $(QUIETLY) - -rel : $(BINARY) -dbg : $(BINARY) - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction.h b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction.h deleted file mode 100644 index 7a7e82f9bb..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction.h +++ /dev/null @@ -1,50 +0,0 @@ -/***** defines *****/ -#if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD) -/* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler - !WIN_KERNEL_BUILD indicates Windows user-mode -*/ - -#include -typedef HANDLE thread_state_t; -typedef DWORD thread_return_t; -#define CALLING_CONVENTION WINAPI -#endif - -#if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD) -/* TRD : any Windows (kernel-mode) on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler - WIN_KERNEL_BUILD indicates Windows kernel -*/ - -#include -typedef HANDLE thread_state_t; -typedef VOID thread_return_t; -#define CALLING_CONVENTION -#endif - -#if (defined __unix__ && defined __GNUC__) -/* TRD : any UNIX on any CPU with GCC - - __unix__ indicates Solaris, Linux, HPUX, etc - __GNUC__ indicates GCC -*/ -#include -#include -#include -typedef pthread_t thread_state_t; -typedef void * thread_return_t; -#define CALLING_CONVENTION -#endif - -typedef thread_return_t (CALLING_CONVENTION *thread_function_t)( void *thread_user_state ); - -/***** public prototypes *****/ -unsigned int abstraction_cpu_count( void ); -int abstraction_thread_start( thread_state_t *thread_state, unsigned int cpu, thread_function_t thread_function, void *thread_user_state ); -void abstraction_thread_wait( thread_state_t thread_state ); - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_cpu_count.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_cpu_count.c deleted file mode 100644 index fb6ff5e79c..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_cpu_count.c +++ /dev/null @@ -1,81 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -#if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD) - -/* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler - !WIN_KERNEL_BUILD indicates Windows user-mode -*/ - -unsigned int abstraction_cpu_count() -{ - SYSTEM_INFO - si; - - GetNativeSystemInfo( &si ); - - return( (unsigned int) si.dwNumberOfProcessors ); -} - -#endif - - - - - -/****************************************************************************/ -#if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD) - -/* TRD : any Windows on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler - WIN_KERNEL_BUILD indicates Windows kernel -*/ - -unsigned int abstraction_cpu_count() -{ - unsigned int - active_processor_count; - - active_processor_count = KeQueryActiveProcessorCount( NULL ); - - return( active_processor_count ); -} - -#endif - - - - - -/****************************************************************************/ -#if (defined __linux__ && defined __GNUC__) - -/* TRD : Linux on any CPU with GCC - - this function I believe is Linux specific and varies by UNIX flavour - - __linux__ indicates Linux - __GNUC__ indicates GCC -*/ - -unsigned int abstraction_cpu_count() -{ - long int - cpu_count; - - cpu_count = sysconf( _SC_NPROCESSORS_ONLN ); - - return( (unsigned int) cpu_count ); -} - -#endif - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_thread_start.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_thread_start.c deleted file mode 100644 index 5075c5f8de..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_thread_start.c +++ /dev/null @@ -1,141 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -#if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD) - -/* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler - !WIN_KERNEL_BUILD indicates Windows user-mode -*/ - -int abstraction_thread_start( thread_state_t *thread_state, unsigned int cpu, thread_function_t thread_function, void *thread_user_state ) -{ - int - rv = 0; - - DWORD - thread_id; - - DWORD_PTR - affinity_mask, - result; - - assert( thread_state != NULL ); - // TRD : cpu can be any value in its range - assert( thread_function != NULL ); - // TRD : thread_user_state can be NULL - - affinity_mask = (DWORD_PTR) (1 << cpu); - - *thread_state = CreateThread( NULL, 0, thread_function, thread_user_state, NO_FLAGS, &thread_id ); - - result = SetThreadAffinityMask( *thread_state, affinity_mask ); - - if( *thread_state != NULL and result != 0 ) - rv = 1; - - return( rv ); -} - -#endif - - - - - -/****************************************************************************/ -#if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD) - -/* TRD : any Windows on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler - WIN_KERNEL_BUILD indicates Windows kernel -*/ - -int abstraction_thread_start( thread_state_t *thread_state, unsigned int cpu, thread_function_t thread_function, void *thread_user_state ) -{ - int - rv = 0; - - KAFFINITY - affinity_mask - - NTSTATUS - nts_create, - nts_affinity; - - assert( thread_state != NULL ); - // TRD : cpu can be any value in its range - assert( thread_function != NULL ); - // TRD : thread_user_state can be NULL - - affinity_mask = 1 << cpu; - - nts_create = PsCreateSystemThread( thread_state, THREAD_ALL_ACCESS, NULL, NULL, NULL, thread_function, thread_user_state ); - - nts_affinity = ZwSetInformationThread( thread_state, ThreadAffinityMask, &affinity_mask, sizeof(KAFFINITY) ); - - if( nts_create == STATUS_SUCCESS and nts_affinity == STATUS_SUCCESS ) - rv = 1; - - return( rv ); -} - -#endif - - - - - -/****************************************************************************/ -#if (defined __unix__) - -/* TRD : any UNIX on any CPU with any compiler - - I assumed pthreads is available on any UNIX. - - __unix__ indicates Solaris, Linux, HPUX, etc -*/ - -int abstraction_thread_start( thread_state_t *thread_state, unsigned int cpu, thread_function_t thread_function, void *thread_user_state ) -{ - int - rv = 0, - rv_create; - - pthread_attr_t - attr; - - cpu_set_t - cpuset; - - assert( thread_state != NULL ); - // TRD : cpu can be any value in its range - assert( thread_function != NULL ); - // TRD : thread_user_state can be NULL - - pthread_attr_init( &attr ); - - CPU_ZERO( &cpuset ); - CPU_SET( cpu, &cpuset ); - pthread_attr_setaffinity_np( &attr, sizeof(cpuset), &cpuset ); - - rv_create = pthread_create( thread_state, &attr, thread_function, thread_user_state ); - - if( rv_create == 0 ) - rv = 1; - - pthread_attr_destroy( &attr ); - - return( rv ); -} - -#endif - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_thread_wait.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_thread_wait.c deleted file mode 100644 index a5835c9051..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/abstraction_thread_wait.c +++ /dev/null @@ -1,71 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -#if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD) - -/* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler - !WIN_KERNEL_BUILD indicates Windows user-mode -*/ - -void abstraction_thread_wait( thread_state_t thread_state ) -{ - WaitForSingleObject( thread_state, INFINITE ); - - return; -} - -#endif - - - - - -/****************************************************************************/ -#if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD) - -/* TRD : any Windows on any CPU with the Microsoft C compiler - - _WIN32 indicates 64-bit or 32-bit Windows - _MSC_VER indicates Microsoft C compiler - WIN_KERNEL_BUILD indicates Windows kernel -*/ - -void abstraction_thread_wait( thread_state_t thread_state ) -{ - KeWaitForSingleObject( thread_state, Executive, KernelMode, FALSE, NULL ); - - return; -} - -#endif - - - - - -/****************************************************************************/ -#if (defined __unix__) - -/* TRD : any UNIX on any CPU with any compiler - - I assumed pthreads is available on any UNIX. - - __unix__ indicates Solaris, Linux, HPUX, etc -*/ - -void abstraction_thread_wait( thread_state_t thread_state ) -{ - pthread_join( thread_state, NULL ); - - return; -} - -#endif - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_freelist.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_freelist.c deleted file mode 100644 index 689de3eaa7..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_freelist.c +++ /dev/null @@ -1,134 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void benchmark_lfds611_freelist( void ) -{ - unsigned int - loop, - thread_count, - cpu_count; - - struct lfds611_freelist_state - *fs; - - struct lfds611_freelist_benchmark - *fb; - - thread_state_t - *thread_handles; - - lfds611_atom_t - total_operations_for_full_test_for_all_cpus, - total_operations_for_full_test_for_all_cpus_for_one_cpu = 0; - - double - mean_operations_per_second_per_cpu, - difference_per_second_per_cpu, - total_difference_per_second_per_cpu, - std_dev_per_second_per_cpu, - scalability; - - /* TRD : here we benchmark the freelist - - the benchmark is to have a single freelist - where a worker thread busy-works popping and then pushing - */ - - cpu_count = abstraction_cpu_count(); - - thread_handles = (thread_state_t *) malloc( sizeof(thread_state_t) * cpu_count ); - - fb = (struct lfds611_freelist_benchmark *) malloc( sizeof(struct lfds611_freelist_benchmark) * cpu_count ); - - // TRD : print the benchmark ID and CSV header - printf( "\n" - "Release %s Freelist Benchmark #1\n" - "CPUs,total ops,mean ops/sec per CPU,standard deviation,scalability\n", LFDS611_RELEASE_NUMBER_STRING ); - - // TRD : we run CPU count times for scalability - for( thread_count = 1 ; thread_count <= cpu_count ; thread_count++ ) { - // TRD : initialisation - lfds611_freelist_new( &fs, 1000, NULL, NULL ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (fb+loop)->fs = fs; - (fb+loop)->operation_count = 0; - } - - // TRD : main test - for( loop = 0 ; loop < thread_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, benchmark_lfds611_freelist_thread_pop_and_push, fb+loop ); - - for( loop = 0 ; loop < thread_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - // TRD : post test math - total_operations_for_full_test_for_all_cpus = 0; - total_difference_per_second_per_cpu = 0; - - for( loop = 0 ; loop < thread_count ; loop++ ) - total_operations_for_full_test_for_all_cpus += (fb+loop)->operation_count; - - mean_operations_per_second_per_cpu = ((double) total_operations_for_full_test_for_all_cpus / (double) thread_count) / (double) 10; - - if( thread_count == 1 ) - total_operations_for_full_test_for_all_cpus_for_one_cpu = total_operations_for_full_test_for_all_cpus; - - for( loop = 0 ; loop < thread_count ; loop++ ) { - difference_per_second_per_cpu = ((double) (fb+loop)->operation_count / (double) 10) - mean_operations_per_second_per_cpu; - total_difference_per_second_per_cpu += difference_per_second_per_cpu * difference_per_second_per_cpu; - } - - std_dev_per_second_per_cpu = sqrt( (double) total_difference_per_second_per_cpu ); - - scalability = (double) total_operations_for_full_test_for_all_cpus / (double) (total_operations_for_full_test_for_all_cpus_for_one_cpu * thread_count); - - printf( "%u,%u,%.0f,%.0f,%0.2f\n", thread_count, (unsigned int) total_operations_for_full_test_for_all_cpus, mean_operations_per_second_per_cpu, std_dev_per_second_per_cpu, scalability ); - - // TRD : cleanup - lfds611_freelist_delete( fs, NULL, NULL ); - } - - free( fb ); - - free( thread_handles ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION benchmark_lfds611_freelist_thread_pop_and_push( void *freelist_benchmark ) -{ - struct lfds611_freelist_benchmark - *fb; - - struct lfds611_freelist_element - *fe; - - time_t - start_time; - - assert( freelist_benchmark != NULL ); - - fb = (struct lfds611_freelist_benchmark *) freelist_benchmark; - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_freelist_pop( fb->fs, &fe ); - lfds611_freelist_push( fb->fs, fe ); - - fb->operation_count += 2; - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_queue.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_queue.c deleted file mode 100644 index 70ab8e06e5..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_queue.c +++ /dev/null @@ -1,138 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void benchmark_lfds611_queue( void ) -{ - unsigned int - loop, - thread_count, - cpu_count; - - struct lfds611_queue_state - *qs; - - struct lfds611_queue_benchmark - *qb; - - thread_state_t - *thread_handles; - - lfds611_atom_t - total_operations_for_full_test_for_all_cpus, - total_operations_for_full_test_for_all_cpus_for_one_cpu = 0; - - double - mean_operations_per_second_per_cpu, - difference_per_second_per_cpu, - total_difference_per_second_per_cpu, - std_dev_per_second_per_cpu, - scalability; - - /* TRD : here we benchmark the queue - - the benchmark is to have a single queue - where a worker thread busy-works dequeuing and then queuing - */ - - cpu_count = abstraction_cpu_count(); - - thread_handles = (thread_state_t *) malloc( sizeof(thread_state_t) * cpu_count ); - - qb = (struct lfds611_queue_benchmark *) malloc( sizeof(struct lfds611_queue_benchmark) * cpu_count ); - - // TRD : print the benchmark ID and CSV header - printf( "\n" - "Release %s Queue Benchmark #1\n" - "CPUs,total ops,mean ops/sec per CPU,standard deviation,scalability\n", LFDS611_RELEASE_NUMBER_STRING ); - - // TRD : we run CPU count times for scalability - for( thread_count = 1 ; thread_count <= cpu_count ; thread_count++ ) { - // TRD : initialisation - lfds611_queue_new( &qs, 1000 ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (qb+loop)->qs = qs; - (qb+loop)->operation_count = 0; - } - - // TRD : populate the queue (we don't actually use the user data) - for( loop = 0 ; loop < 500 ; loop++ ) - lfds611_queue_enqueue( qs, (void *) (lfds611_atom_t) loop ); - - // TRD : main test - for( loop = 0 ; loop < thread_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, benchmark_lfds611_queue_thread_delfds611_queue_and_enqueue, qb+loop ); - - for( loop = 0 ; loop < thread_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - // TRD : post test math - total_operations_for_full_test_for_all_cpus = 0; - total_difference_per_second_per_cpu = 0; - - for( loop = 0 ; loop < thread_count ; loop++ ) - total_operations_for_full_test_for_all_cpus += (qb+loop)->operation_count; - - mean_operations_per_second_per_cpu = ((double) total_operations_for_full_test_for_all_cpus / (double) thread_count) / (double) 10; - - if( thread_count == 1 ) - total_operations_for_full_test_for_all_cpus_for_one_cpu = total_operations_for_full_test_for_all_cpus; - - for( loop = 0 ; loop < thread_count ; loop++ ) { - difference_per_second_per_cpu = ((double) (qb+loop)->operation_count / (double) 10) - mean_operations_per_second_per_cpu; - total_difference_per_second_per_cpu += difference_per_second_per_cpu * difference_per_second_per_cpu; - } - - std_dev_per_second_per_cpu = sqrt( (double) total_difference_per_second_per_cpu ); - - scalability = (double) total_operations_for_full_test_for_all_cpus / (double) (total_operations_for_full_test_for_all_cpus_for_one_cpu * thread_count); - - printf( "%u,%u,%.0f,%.0f,%0.2f\n", thread_count, (unsigned int) total_operations_for_full_test_for_all_cpus, mean_operations_per_second_per_cpu, std_dev_per_second_per_cpu, scalability ); - - // TRD : cleanup - lfds611_queue_delete( qs, NULL, NULL ); - } - - free( qb ); - - free( thread_handles ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION benchmark_lfds611_queue_thread_delfds611_queue_and_enqueue( void *queue_benchmark ) -{ - struct lfds611_queue_benchmark - *qb; - - void - *user_data; - - time_t - start_time; - - assert( queue_benchmark != NULL ); - - qb = (struct lfds611_queue_benchmark *) queue_benchmark; - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_queue_dequeue( qb->qs, &user_data ); - lfds611_queue_enqueue( qb->qs, user_data ); - - qb->operation_count += 2; - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_ringbuffer.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_ringbuffer.c deleted file mode 100644 index 1322b4e0ce..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_ringbuffer.c +++ /dev/null @@ -1,137 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void benchmark_lfds611_ringbuffer( void ) -{ - unsigned int - loop, - thread_count, - cpu_count; - - struct lfds611_ringbuffer_state - *rs; - - struct lfds611_ringbuffer_benchmark - *rb; - - thread_state_t - *thread_handles; - - lfds611_atom_t - total_operations_for_full_test_for_all_cpus, - total_operations_for_full_test_for_all_cpus_for_one_cpu = 0; - - double - mean_operations_per_second_per_cpu, - difference_per_second_per_cpu, - total_difference_per_second_per_cpu, - std_dev_per_second_per_cpu, - scalability; - - /* TRD : here we benchmark the ringbuffer - - the benchmark is to have a single ringbuffer - where a worker thread busy-works writing and then reading - */ - - cpu_count = abstraction_cpu_count(); - - thread_handles = (thread_state_t *) malloc( sizeof(thread_state_t) * cpu_count ); - - rb = (struct lfds611_ringbuffer_benchmark *) malloc( sizeof(struct lfds611_ringbuffer_benchmark) * cpu_count ); - - // TRD : print the benchmark ID and CSV header - printf( "\n" - "Release %s Ringbuffer Benchmark #1\n" - "CPUs,total ops,mean ops/sec per CPU,standard deviation,scalability\n", LFDS611_RELEASE_NUMBER_STRING ); - - // TRD : we run CPU count times for scalability - for( thread_count = 1 ; thread_count <= cpu_count ; thread_count++ ) { - // TRD : initialisation - lfds611_ringbuffer_new( &rs, 1000, NULL, NULL ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (rb+loop)->rs = rs; - (rb+loop)->operation_count = 0; - } - - // TRD : main test - for( loop = 0 ; loop < thread_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, benchmark_lfds611_ringbuffer_thread_write_and_read, rb+loop ); - - for( loop = 0 ; loop < thread_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - // TRD : post test math - total_operations_for_full_test_for_all_cpus = 0; - total_difference_per_second_per_cpu = 0; - - for( loop = 0 ; loop < thread_count ; loop++ ) - total_operations_for_full_test_for_all_cpus += (rb+loop)->operation_count; - - mean_operations_per_second_per_cpu = ((double) total_operations_for_full_test_for_all_cpus / (double) thread_count) / (double) 10; - - if( thread_count == 1 ) - total_operations_for_full_test_for_all_cpus_for_one_cpu = total_operations_for_full_test_for_all_cpus; - - for( loop = 0 ; loop < thread_count ; loop++ ) { - difference_per_second_per_cpu = ((double) (rb+loop)->operation_count / (double) 10) - mean_operations_per_second_per_cpu; - total_difference_per_second_per_cpu += difference_per_second_per_cpu * difference_per_second_per_cpu; - } - - std_dev_per_second_per_cpu = sqrt( (double) total_difference_per_second_per_cpu ); - - scalability = (double) total_operations_for_full_test_for_all_cpus / (double) (total_operations_for_full_test_for_all_cpus_for_one_cpu * thread_count); - - printf( "%u,%u,%.0f,%.0f,%0.2f\n", thread_count, (unsigned int) total_operations_for_full_test_for_all_cpus, mean_operations_per_second_per_cpu, std_dev_per_second_per_cpu, scalability ); - - // TRD : cleanup - lfds611_ringbuffer_delete( rs, NULL, NULL ); - } - - free( rb ); - - free( thread_handles ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION benchmark_lfds611_ringbuffer_thread_write_and_read( void *ringbuffer_benchmark ) -{ - struct lfds611_ringbuffer_benchmark - *rb; - - struct lfds611_freelist_element - *fe; - - time_t - start_time; - - assert( ringbuffer_benchmark != NULL ); - - rb = (struct lfds611_ringbuffer_benchmark *) ringbuffer_benchmark; - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_ringbuffer_get_write_element( rb->rs, &fe, NULL ); - lfds611_ringbuffer_put_write_element( rb->rs, fe ); - - lfds611_ringbuffer_get_read_element( rb->rs, &fe ); - lfds611_ringbuffer_put_read_element( rb->rs, fe ); - - rb->operation_count += 2; - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_stack.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_stack.c deleted file mode 100644 index 0a9f6c8698..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/benchmark_stack.c +++ /dev/null @@ -1,134 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void benchmark_lfds611_stack( void ) -{ - unsigned int - loop, - thread_count, - cpu_count; - - struct lfds611_stack_state - *ss; - - struct lfds611_stack_benchmark - *sb; - - thread_state_t - *thread_handles; - - lfds611_atom_t - total_operations_for_full_test_for_all_cpus, - total_operations_for_full_test_for_all_cpus_for_one_cpu = 0; - - double - mean_operations_per_second_per_cpu, - difference_per_second_per_cpu, - total_difference_per_second_per_cpu, - std_dev_per_second_per_cpu, - scalability; - - /* TRD : here we benchmark the stack - - the benchmark is to have a single stack - where a worker thread busy-works pushing then popping - */ - - cpu_count = abstraction_cpu_count(); - - thread_handles = (thread_state_t *) malloc( sizeof(thread_state_t) * cpu_count ); - - sb = (struct lfds611_stack_benchmark *) malloc( sizeof(struct lfds611_stack_benchmark) * cpu_count ); - - // TRD : print the benchmark ID and CSV header - printf( "\n" - "Release %s Stack Benchmark #1\n" - "CPUs,total ops,mean ops/sec per CPU,standard deviation,scalability\n", LFDS611_RELEASE_NUMBER_STRING ); - - // TRD : we run CPU count times for scalability - for( thread_count = 1 ; thread_count <= cpu_count ; thread_count++ ) { - // TRD : initialisation - lfds611_stack_new( &ss, 1000 ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (sb+loop)->ss = ss; - (sb+loop)->operation_count = 0; - } - - // TRD : main test - for( loop = 0 ; loop < thread_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, benchmark_lfds611_stack_thread_push_and_pop, sb+loop ); - - for( loop = 0 ; loop < thread_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - // TRD : post test math - total_operations_for_full_test_for_all_cpus = 0; - total_difference_per_second_per_cpu = 0; - - for( loop = 0 ; loop < thread_count ; loop++ ) - total_operations_for_full_test_for_all_cpus += (sb+loop)->operation_count; - - mean_operations_per_second_per_cpu = ((double) total_operations_for_full_test_for_all_cpus / (double) thread_count) / (double) 10; - - if( thread_count == 1 ) - total_operations_for_full_test_for_all_cpus_for_one_cpu = total_operations_for_full_test_for_all_cpus; - - for( loop = 0 ; loop < thread_count ; loop++ ) { - difference_per_second_per_cpu = ((double) (sb+loop)->operation_count / (double) 10) - mean_operations_per_second_per_cpu; - total_difference_per_second_per_cpu += difference_per_second_per_cpu * difference_per_second_per_cpu; - } - - std_dev_per_second_per_cpu = sqrt( (double) total_difference_per_second_per_cpu ); - - scalability = (double) total_operations_for_full_test_for_all_cpus / (double) (total_operations_for_full_test_for_all_cpus_for_one_cpu * thread_count); - - printf( "%u,%u,%.0f,%.0f,%0.2f\n", thread_count, (unsigned int) total_operations_for_full_test_for_all_cpus, mean_operations_per_second_per_cpu, std_dev_per_second_per_cpu, scalability ); - - // TRD : cleanup - lfds611_stack_delete( ss, NULL, NULL ); - } - - free( sb ); - - free( thread_handles ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION benchmark_lfds611_stack_thread_push_and_pop( void *stack_benchmark ) -{ - struct lfds611_stack_benchmark - *sb; - - void - *user_data = NULL; - - time_t - start_time; - - assert( stack_benchmark != NULL ); - - sb = (struct lfds611_stack_benchmark *) stack_benchmark; - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_stack_push( sb->ss, user_data ); - lfds611_stack_pop( sb->ss, &user_data ); - - sb->operation_count += 2; - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/internal.h b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/internal.h deleted file mode 100644 index ae30bf142c..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/internal.h +++ /dev/null @@ -1,123 +0,0 @@ -/***** ANSI includes *****/ -/* TRD : _GNU_SOURCE is required by sched.h for pthread_attr_setaffinity_np, CPU_ZERO and CPU_SET - however it has to be defined very early as even the ANSI headers pull in stuff - which uses _GNU_SOURCE and which I think must be protected against multiple inclusion, - which basically means if you set it too late, it's not seen, because the headers - have already been parsed with _GNU_SOURCE unset -*/ - -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include -#include - -/***** internal includes *****/ -#include "abstraction.h" - -/***** external includes *****/ -#include "liblfds611.h" - -/***** defines *****/ -#define and && -#define or || - -#define RAISED 1 -#define LOWERED 0 - -#define NO_FLAGS 0x0 - -/***** enums *****/ -enum lfds611_test_operation { - UNKNOWN, - HELP, - TEST, - BENCHMARK -}; - -/***** structs *****/ -#include "structures.h" - -/***** prototypes *****/ -int main( int argc, char **argv ); - -void internal_display_test_name( char *test_name ); -void internal_display_test_result( unsigned int number_name_dvs_pairs, ... ); -void internal_display_lfds611_data_structure_validity( enum lfds611_data_structure_validity dvs ); - -void benchmark_lfds611_freelist( void ); -thread_return_t CALLING_CONVENTION benchmark_lfds611_freelist_thread_pop_and_push( void *freelist_benchmark ); - -void benchmark_lfds611_queue( void ); -thread_return_t CALLING_CONVENTION benchmark_lfds611_queue_thread_delfds611_queue_and_enqueue( void *queue_benchmark ); - -void benchmark_lfds611_ringbuffer( void ); -thread_return_t CALLING_CONVENTION benchmark_lfds611_ringbuffer_thread_write_and_read( void *ringbuffer_benchmark ); - -void benchmark_lfds611_stack( void ); -thread_return_t CALLING_CONVENTION benchmark_lfds611_stack_thread_push_and_pop( void *stack_benchmark ); - -void test_lfds611_abstraction( void ); -void abstraction_test_increment( void ); -thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_increment( void *shared_counter ); -thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_atomic_increment( void *shared_counter ); -void abstraction_test_cas( void ); -thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_cas( void *abstraction_test_cas_state ); -void abstraction_test_dcas( void ); -thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_dcas( void *abstraction_test_dcas_state ); - -void test_lfds611_freelist( void ); -void freelist_test_internal_popping( void ); -int freelist_test_internal_popping_init( void **user_data, void *user_state ); -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping( void *freelist_test_popping_state ); -void freelist_test_internal_pushing( void ); -int freelist_test_internal_pushing_init( void **user_data, void *user_state ); -void freelist_test_internal_pushing_delete( void *user_data, void *user_state ); -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_pushing( void *freelist_test_pushing_state ); -void freelist_test_internal_popping_and_pushing( void ); -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping_and_pushing_start_popping( void *freelist_test_popping_and_pushing_state ); -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping_and_pushing_start_pushing( void *freelist_test_popping_and_pushing_state ); -void freelist_test_internal_rapid_popping_and_pushing( void ); -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_rapid_popping_and_pushing( void *lfds611_freelist_state ); - -void test_lfds611_queue( void ); -void queue_test_enqueuing( void ); -thread_return_t CALLING_CONVENTION queue_test_internal_thread_simple_enqueuer( void *queue_test_enqueuing_state ); -void queue_test_dequeuing( void ); -thread_return_t CALLING_CONVENTION queue_test_internal_thread_simple_dequeuer( void *queue_test_dequeuing_state ); -void queue_test_enqueuing_and_dequeuing( void ); -thread_return_t CALLING_CONVENTION queue_test_internal_thread_enqueuer_and_dequeuer( void *queue_test_rapid_enqueuing_and_dequeuing_state ); -void queue_test_rapid_enqueuing_and_dequeuing( void ); -thread_return_t CALLING_CONVENTION queue_test_internal_thread_rapid_enqueuer_and_dequeuer( void *queue_test_rapid_enqueuing_and_dequeuing_state ); - -void test_lfds611_ringbuffer( void ); -void ringbuffer_test_reading( void ); -thread_return_t CALLING_CONVENTION ringbuffer_test_thread_simple_reader( void *ringbuffer_test_reading_state ); -void ringbuffer_test_writing( void ); -thread_return_t CALLING_CONVENTION ringbuffer_test_thread_simple_writer( void *ringbuffer_test_writing_state ); -void ringbuffer_test_reading_and_writing( void ); -thread_return_t CALLING_CONVENTION ringbuffer_test_thread_reader_writer( void *ringbuffer_test_reading_and_writing_state ); - -void test_lfds611_slist( void ); -void test_slist_new_delete_get( void ); -thread_return_t CALLING_CONVENTION slist_test_internal_thread_new_delete_get_new_head_and_next( void *slist_test_state ); -thread_return_t CALLING_CONVENTION slist_test_internal_thread_new_delete_get_delete_and_get( void *slist_test_state ); -void test_slist_get_set_user_data( void ); -thread_return_t CALLING_CONVENTION slist_test_internal_thread_get_set_user_data( void *slist_test_state ); -void test_slist_delete_all_elements( void ); - -void test_lfds611_stack( void ); -void stack_test_internal_popping( void ); -thread_return_t CALLING_CONVENTION stack_test_internal_thread_popping( void *stack_test_popping_state ); -void stack_test_internal_pushing( void ); -thread_return_t CALLING_CONVENTION stack_test_internal_thread_pushing( void *stack_test_pushing_state ); -void stack_test_internal_popping_and_pushing( void ); -thread_return_t CALLING_CONVENTION stack_test_internal_thread_popping_and_pushing_start_popping( void *stack_test_popping_and_pushing_state ); -thread_return_t CALLING_CONVENTION stack_test_internal_thread_popping_and_pushing_start_pushing( void *stack_test_popping_and_pushing_state ); -void stack_test_internal_rapid_popping_and_pushing( void ); -thread_return_t CALLING_CONVENTION stack_test_internal_thread_rapid_popping_and_pushing( void *stack_state ); - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/main.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/main.c deleted file mode 100644 index 66836ba441..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/main.c +++ /dev/null @@ -1,83 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -int main( int argc, char **argv ) -{ - enum lfds611_test_operation - operation = UNKNOWN; - - unsigned int - loop, - iterations = 1; - - assert( argc >= 1 ); - assert( argv != NULL ); - - if( argc == 1 or argc >= 4 ) - operation = HELP; - - if( operation == UNKNOWN ) { - if( 0 == strcmp(*(argv+1), "test") ) { - operation = TEST; - - // TRD : sscanf() may fail, but iterations is initialised to 1, so it's okay - if( argc == 3 ) - sscanf( *(argv+2), "%u", &iterations ); - } - - if( 0 == strcmp(*(argv+1), "benchmark") ) { - operation = BENCHMARK; - - // TRD : sscanf() may fail, but iterations is initialised to 1, so it's okay - if( argc == 3 ) - sscanf( *(argv+2), "%u", &iterations ); - } - } - - switch( operation ) { - case UNKNOWN: - case HELP: - printf( "test [test|benchmark] [iterations]\n" - " test : run the test suite\n" - " benchmark : run the benchmark suite\n" - " iterations : optional, default is 1\n" ); - break; - - case TEST: - for( loop = 1 ; loop < iterations+1 ; loop++ ) { - printf( "\n" - "Test Iteration %02u\n" - "=================\n", loop ); - - test_lfds611_abstraction(); - test_lfds611_freelist(); - test_lfds611_queue(); - test_lfds611_ringbuffer(); - test_lfds611_slist(); - test_lfds611_stack(); - } - - break; - - case BENCHMARK: - for( loop = 1 ; loop < iterations+1 ; loop++ ) { - printf( "\n" - "Benchmark Iteration %02u\n" - "========================\n", loop ); - - benchmark_lfds611_freelist(); - benchmark_lfds611_queue(); - benchmark_lfds611_ringbuffer(); - benchmark_lfds611_stack(); - } - - break; - } - - return( EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/misc.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/misc.c deleted file mode 100644 index 9b5891832f..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/misc.c +++ /dev/null @@ -1,119 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void internal_display_test_name( char *test_name ) -{ - assert( test_name != NULL ); - - printf( "%s...", test_name ); - fflush( stdout ); - - return; -} - - - - - -/****************************************************************************/ -void internal_display_test_result( unsigned int number_name_dvs_pairs, ... ) -{ - va_list - va; - - int - passed_flag = RAISED; - - unsigned int - loop; - - char - *name; - - enum lfds611_data_structure_validity - dvs; - - // TRD : number_name_dvs_pairs can be any value in its range - - va_start( va, number_name_dvs_pairs ); - - for( loop = 0 ; loop < number_name_dvs_pairs ; loop++ ) { - name = va_arg( va, char * ); - dvs = va_arg( va, enum lfds611_data_structure_validity ); - - if( dvs != LFDS611_VALIDITY_VALID ) { - passed_flag = LOWERED; - break; - } - } - - va_end( va ); - - if( passed_flag == RAISED ) - puts( "passed" ); - - if( passed_flag == LOWERED ) { - printf( "failed (" ); - - va_start( va, number_name_dvs_pairs ); - - for( loop = 0 ; loop < number_name_dvs_pairs ; loop++ ) { - name = va_arg( va, char * ); - dvs = va_arg( va, enum lfds611_data_structure_validity ); - - printf( "%s ", name ); - internal_display_lfds611_data_structure_validity( dvs ); - - if( loop+1 < number_name_dvs_pairs ) - printf( ", " ); - } - - va_end( va ); - - printf( ")\n" ); - } - - return; -} - - - - - -/****************************************************************************/ -void internal_display_lfds611_data_structure_validity( enum lfds611_data_structure_validity dvs ) -{ - char - *string = NULL; - - switch( dvs ) { - case LFDS611_VALIDITY_VALID: - string = "valid"; - break; - - case LFDS611_VALIDITY_INVALID_LOOP: - string = "invalid - loop detected"; - break; - - case LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS: - string = "invalid - missing elements"; - break; - - case LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS: - string = "invalid - additional elements"; - break; - - case LFDS611_VALIDITY_INVALID_TEST_DATA: - string = "invalid - invalid test data"; - break; - } - - printf( "%s", string ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/structures.h b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/structures.h deleted file mode 100644 index 36d01536b5..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/structures.h +++ /dev/null @@ -1,205 +0,0 @@ -/***** structs *****/ -#pragma pack( push, LFDS611_ALIGN_DOUBLE_POINTER ) - -/***** abstraction tests *****/ -struct abstraction_test_cas_state { - volatile lfds611_atom_t - *shared_counter; - - lfds611_atom_t - local_counter; -}; - -struct abstraction_test_dcas_state { - volatile lfds611_atom_t - *shared_counter; - - lfds611_atom_t - local_counter; -}; - -/***** freelist tests *****/ -struct freelist_test_popping_state { - struct lfds611_freelist_state - *fs, - *fs_thread_local; -}; - -struct freelist_test_pushing_state { - lfds611_atom_t - *count, - thread_number; - - struct lfds611_freelist_state - *source_fs, - *fs; -}; - -struct freelist_test_popping_and_pushing_state { - struct lfds611_freelist_state - *local_fs, - *fs; -}; - -struct freelist_test_counter_and_thread_number { - lfds611_atom_t - thread_number; - - unsigned long long int - counter; -}; - -/***** queue tests *****/ -struct queue_test_enqueuing_state { - struct lfds611_queue_state - *qs; - - lfds611_atom_t - counter; -}; - -struct queue_test_dequeuing_state { - struct lfds611_queue_state - *qs; - - int - error_flag; -}; - -struct queue_test_enqueuing_and_dequeuing_state { - struct lfds611_queue_state - *qs; - - lfds611_atom_t - counter, - thread_number, - *per_thread_counters; - - unsigned int - cpu_count; - - int - error_flag; -}; - -struct queue_test_rapid_enqueuing_and_dequeuing_state { - struct lfds611_queue_state - *qs; - - lfds611_atom_t - counter; -}; - -/***** ringbuffer tests *****/ -struct ringbuffer_test_reading_state { - struct lfds611_ringbuffer_state - *rs; - - int - error_flag; - - lfds611_atom_t - read_count; -}; - -struct ringbuffer_test_writing_state { - struct lfds611_ringbuffer_state - *rs; - - lfds611_atom_t - write_count; -}; - -struct ringbuffer_test_reading_and_writing_state { - struct lfds611_ringbuffer_state - *rs; - - lfds611_atom_t - counter, - *per_thread_counters; - - unsigned int - cpu_count; - - int - error_flag; -}; - -/***** slist tests *****/ -struct slist_test_state { - struct lfds611_slist_state - *ss; - - size_t - create_count, - delete_count; - - lfds611_atom_t - thread_and_count; -}; - -/***** stack tests *****/ -struct stack_test_popping_state { - struct lfds611_stack_state - *ss, - *ss_thread_local; -}; - -struct stack_test_pushing_state { - lfds611_atom_t - thread_number; - - struct lfds611_stack_state - *ss; -}; - -struct stack_test_popping_and_pushing_state { - struct lfds611_stack_state - *local_ss, - *ss; -}; - -struct stack_test_counter_and_thread_number { - lfds611_atom_t - thread_number, - counter; -}; - -/***** freelist benchmarks *****/ -struct lfds611_freelist_benchmark { - struct lfds611_freelist_state - *fs; - - lfds611_atom_t - operation_count; -}; - -/***** queue benchmarks *****/ -struct lfds611_queue_benchmark { - struct lfds611_queue_state - *qs; - - lfds611_atom_t - operation_count; -}; - -/***** ringbuffer benchmarks *****/ -struct lfds611_ringbuffer_benchmark { - struct lfds611_ringbuffer_state - *rs; - - lfds611_atom_t - operation_count; -}; - -/***** stack benchmarks *****/ -struct lfds611_stack_benchmark { - struct lfds611_stack_state - *ss; - - lfds611_atom_t - operation_count; -}; - -#pragma pack( pop ) - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_abstraction.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_abstraction.c deleted file mode 100644 index 772fbf5ca3..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_abstraction.c +++ /dev/null @@ -1,323 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void test_lfds611_abstraction( void ) -{ - printf( "\n" - "Abstraction Tests\n" - "=================\n" ); - - abstraction_test_increment(); - abstraction_test_cas(); - abstraction_test_dcas(); - - return; -} - - - - - -/****************************************************************************/ -void abstraction_test_increment( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - LFDS611_ALIGN(LFDS611_ALIGN_SINGLE_POINTER) volatile lfds611_atom_t - shared_counter, - atomic_shared_counter; - - /* TRD : here we test lfds611_abstraction_increment - - first, we run one thread per CPU where each thread increments - a shared counter 10,000,000 times - however, this first test - does NOT use atomic increment; it uses "++" - - second, we repeat the exercise, but this time using - lfds611_abstraction_increment() - - if the final value in the first test is less than (10,000,000*cpu_count) - then the system is sensitive to non-atomic increments; this means if - our atomic version of the test passes, we can have some degree of confidence - that it works - - if the final value in the first test is in fact correct, then we can't know - that our atomic version has changed anything - - and of course if the final value in the atomic test is wrong, we know things - are broken - */ - - internal_display_test_name( "Atomic increment" ); - - cpu_count = abstraction_cpu_count(); - - shared_counter = 0; - atomic_shared_counter = 0; - - LFDS611_BARRIER_STORE; - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - // TRD : non-atomic - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, abstraction_test_internal_thread_increment, (void *) &shared_counter ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - // TRD : atomic - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, abstraction_test_internal_thread_atomic_increment, (void *) &atomic_shared_counter ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : results - if( shared_counter < (10000000 * cpu_count) and atomic_shared_counter == (10000000 * cpu_count) ) - puts( "passed" ); - - if( shared_counter == (10000000 * cpu_count) and atomic_shared_counter == (10000000 * cpu_count) ) - puts( "indeterminate" ); - - if( atomic_shared_counter < (10000000 * cpu_count) ) - puts( "failed" ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_increment( void *shared_counter ) -{ - assert( shared_counter != NULL ); - - LFDS611_BARRIER_LOAD; - - lfds611_liblfds_abstraction_test_helper_increment_non_atomic( shared_counter ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_atomic_increment( void *shared_counter ) -{ - assert( shared_counter != NULL ); - - LFDS611_BARRIER_LOAD; - - lfds611_liblfds_abstraction_test_helper_increment_atomic( shared_counter ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void abstraction_test_cas( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct abstraction_test_cas_state - *atcs; - - LFDS611_ALIGN(LFDS611_ALIGN_SINGLE_POINTER) volatile lfds611_atom_t - shared_counter; - - lfds611_atom_t - local_total = 0; - - // TRD : number_logical_processors can be any value in its range - - /* TRD : here we test lfds611_abstraction_cas - - we run one thread per CPU - we use lfds611_abstraction_cas() to increment a shared counter - every time a thread successfully increments the counter, - it increments a thread local counter - the threads run for ten seconds - after the threads finish, we total the local counters - they should equal the shared counter - */ - - internal_display_test_name( "Atomic CAS" ); - - cpu_count = abstraction_cpu_count(); - - shared_counter = 0; - - LFDS611_BARRIER_STORE; - - atcs = malloc( sizeof(struct abstraction_test_cas_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (atcs+loop)->shared_counter = &shared_counter; - (atcs+loop)->local_counter = 0; - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, abstraction_test_internal_thread_cas, atcs+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : results - for( loop = 0 ; loop < cpu_count ; loop++ ) - local_total += (atcs+loop)->local_counter; - - if( local_total == shared_counter ) - puts( "passed" ); - - if( local_total != shared_counter ) - puts( "failed" ); - - // TRD : cleanup - free( atcs ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_cas( void *abstraction_test_cas_state ) -{ - struct abstraction_test_cas_state - *atcs; - - assert( abstraction_test_cas_state != NULL ); - - atcs = (struct abstraction_test_cas_state *) abstraction_test_cas_state; - - LFDS611_BARRIER_LOAD; - - lfds611_liblfds_abstraction_test_helper_cas( atcs->shared_counter, &atcs->local_counter ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void abstraction_test_dcas( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct abstraction_test_dcas_state - *atds; - - LFDS611_ALIGN(LFDS611_ALIGN_DOUBLE_POINTER) volatile lfds611_atom_t - shared_counter[2] = { 0, 0 }; - - lfds611_atom_t - local_total = 0; - - /* TRD : here we test lfds611_abstraction_dcas - - we run one thread per CPU - we use lfds611_abstraction_dcas() to increment a shared counter - every time a thread successfully increments the counter, - it increments a thread local counter - the threads run for ten seconds - after the threads finish, we total the local counters - they should equal the shared counter - */ - - internal_display_test_name( "Atomic DCAS" ); - - cpu_count = abstraction_cpu_count(); - - atds = malloc( sizeof(struct abstraction_test_dcas_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (atds+loop)->shared_counter = shared_counter; - (atds+loop)->local_counter = 0; - } - - LFDS611_BARRIER_STORE; - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, abstraction_test_internal_thread_dcas, atds+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : results - for( loop = 0 ; loop < cpu_count ; loop++ ) - local_total += (atds+loop)->local_counter; - - if( local_total == shared_counter[0] ) - puts( "passed" ); - - if( local_total != shared_counter[0] ) - puts( "failed" ); - - // TRD : cleanup - free( atds ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_dcas( void *abstraction_test_dcas_state ) -{ - struct abstraction_test_dcas_state - *atds; - - assert( abstraction_test_dcas_state != NULL ); - - atds = (struct abstraction_test_dcas_state *) abstraction_test_dcas_state; - - LFDS611_BARRIER_LOAD; - - lfds611_liblfds_abstraction_test_helper_dcas( atds->shared_counter, &atds->local_counter ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_freelist.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_freelist.c deleted file mode 100644 index d915b815b0..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_freelist.c +++ /dev/null @@ -1,673 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void test_lfds611_freelist( void ) -{ - printf( "\n" - "Freelist Tests\n" - "==============\n" ); - - freelist_test_internal_popping(); - freelist_test_internal_pushing(); - freelist_test_internal_popping_and_pushing(); - freelist_test_internal_rapid_popping_and_pushing(); - - return; -} - - - - - -/****************************************************************************/ -void freelist_test_internal_popping( void ) -{ - unsigned int - loop, - cpu_count; - - lfds611_atom_t - count = 0; - - thread_state_t - *thread_handles; - - enum lfds611_data_structure_validity - dvs = LFDS611_VALIDITY_VALID; - - struct lfds611_freelist_state - *fs; - - struct lfds611_freelist_element - *fe; - - struct freelist_test_popping_state - *ftps; - - unsigned int - *found_count; - - /* TRD : we create a freelist with 1,000,000 elements - - the creation function runs in a single thread and creates - and pushes those elements onto the freelist - - each element contains a void pointer which is its element number - - we then run one thread per CPU - where each thread loops, popping as quickly as possible - each popped element is pushed onto a thread-local freelist - - the threads run till the source freelist is empty - - we then check the thread-local freelists - we should find we have every element - - then tidy up - */ - - internal_display_test_name( "Popping" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_freelist_new( &fs, 1000000, freelist_test_internal_popping_init, &count ); - ftps = malloc( sizeof(struct freelist_test_popping_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (ftps+loop)->fs = fs; - lfds611_freelist_new( &(ftps+loop)->fs_thread_local, 0, NULL, NULL ); - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, freelist_test_internal_thread_popping, ftps+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : now we check the thread-local freelists - found_count = malloc( sizeof(unsigned int) * 1000000 ); - - for( loop = 0 ; loop < 1000000 ; loop++ ) - *(found_count+loop) = 0; - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - while( lfds611_freelist_pop((ftps+loop)->fs_thread_local, &fe) ) { - lfds611_freelist_get_user_data_from_element( fe, (void **) &count ); - (*(found_count+count))++; - lfds611_freelist_push( fs, fe ); - } - } - - for( loop = 0 ; loop < 1000000 and dvs == LFDS611_VALIDITY_VALID ; loop++ ) { - if( *(found_count+loop) == 0 ) - dvs = LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS; - - if( *(found_count+loop) > 1 ) - dvs = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - } - - // TRD : cleanup - free( found_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - lfds611_freelist_delete( (ftps+loop)->fs_thread_local, NULL, NULL ); - - free( ftps ); - lfds611_freelist_delete( fs, NULL, NULL ); - - // TRD : print the test result - internal_display_test_result( 1, "freelist", dvs ); - - return; -} - - - - - -/****************************************************************************/ -#pragma warning( disable : 4100 ) - -int freelist_test_internal_popping_init( void **user_data, void *user_state ) -{ - lfds611_atom_t - *count; - - assert( user_data != NULL ); - assert( user_state != NULL ); - - count = (lfds611_atom_t *) user_state; - - *(lfds611_atom_t *) user_data = (*count)++; - - return( 1 ); -} - -#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping( void *freelist_test_popping_state ) -{ - struct freelist_test_popping_state - *ftps; - - struct lfds611_freelist_element - *fe; - - assert( freelist_test_popping_state != NULL ); - - ftps = (struct freelist_test_popping_state *) freelist_test_popping_state; - - lfds611_freelist_use( ftps->fs ); - lfds611_freelist_use( ftps->fs_thread_local ); - - while( lfds611_freelist_pop(ftps->fs, &fe) ) - lfds611_freelist_push( ftps->fs_thread_local, fe ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void freelist_test_internal_pushing( void ) -{ - unsigned int - loop, - cpu_count; - - lfds611_atom_t - count = 0; - - thread_state_t - *thread_handles; - - enum lfds611_data_structure_validity - dvs; - - struct freelist_test_pushing_state - *ftps; - - struct lfds611_freelist_element - *fe; - - struct lfds611_freelist_state - *fs, - *cleanup_fs; - - struct freelist_test_counter_and_thread_number - *cnt, - *counter_and_number_trackers; - - struct lfds611_validation_info - vi; - - /* TRD : we create an empty freelist, which we will push to - - we then create one freelist per CPU, where this freelist - contains 100,000 elements per thread and - each element is an incrementing counter and unique ID - (from 0 to number of CPUs) - - we then start one thread per CPU, where each thread is - given one of the populated freelists and pops from that - to push to the empty freelist - - the reason for this is to achieve memory pre-allocation - which allows the pushing threads to run at maximum speed - - the threads end when their freelists are empty - - we then fully pop the now populated main freelist (onto - a second freelist, so we can cleanly free all memory), - checking that the counts increment on a per unique ID basis - and that the number of elements we pop equals 1,000,000 per thread - (since each element has an incrementing counter which is - unique on a per unique ID basis, we can know we didn't lose - any elements) - */ - - internal_display_test_name( "Pushing" ); - - cpu_count = abstraction_cpu_count(); - - ftps = malloc( sizeof(struct freelist_test_pushing_state) * cpu_count ); - - lfds611_freelist_new( &fs, 0, NULL, NULL ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (ftps+loop)->thread_number = (lfds611_atom_t) loop; - // TRD : note count is shared across threads, so thread 0 is 0-100000, thread 1 is 100000-200000, etc - (ftps+loop)->count = &count; - lfds611_freelist_new( &(ftps+loop)->source_fs, 100000, freelist_test_internal_pushing_init, (void *) (ftps+loop) ); - (ftps+loop)->fs = fs; - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, freelist_test_internal_thread_pushing, ftps+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : now fully pop and verify the main freelist - lfds611_freelist_new( &cleanup_fs, 0, NULL, NULL ); - - counter_and_number_trackers = malloc( sizeof(struct freelist_test_counter_and_thread_number) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (counter_and_number_trackers+loop)->counter = 100000 * loop; - (counter_and_number_trackers+loop)->thread_number = (lfds611_atom_t) loop; - } - - vi.min_elements = vi.max_elements = 100000 * cpu_count; - - lfds611_freelist_query( fs, LFDS611_FREELIST_QUERY_VALIDATE, &vi, (void *) &dvs ); - - while( dvs == LFDS611_VALIDITY_VALID and lfds611_freelist_pop(fs, &fe) ) { - lfds611_freelist_get_user_data_from_element( fe, (void **) &cnt ); - - if( cnt->counter != (counter_and_number_trackers+cnt->thread_number)->counter++ ) - dvs = LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS; - - lfds611_freelist_push( cleanup_fs, fe ); - } - - // TRD : clean up - free( counter_and_number_trackers ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - lfds611_freelist_delete( (ftps+loop)->source_fs, NULL, NULL ); - - free( ftps ); - - lfds611_freelist_delete( cleanup_fs, freelist_test_internal_pushing_delete, NULL ); - lfds611_freelist_delete( fs, NULL, NULL ); - - // TRD : print the test result - internal_display_test_result( 1, "freelist", dvs ); - - return; -} - - - - - -/****************************************************************************/ -int freelist_test_internal_pushing_init( void **user_data, void *user_state ) -{ - struct freelist_test_counter_and_thread_number - *ftcatn; - - struct freelist_test_pushing_state - *ftps; - - assert( user_data != NULL ); - // TRD : user_state is being used as an integer type - - *user_data = malloc( sizeof(struct freelist_test_counter_and_thread_number) ); - ftps = (struct freelist_test_pushing_state *) user_state; - - ftcatn = (struct freelist_test_counter_and_thread_number *) *user_data; - - ftcatn->counter = (*ftps->count)++; - ftcatn->thread_number = ftps->thread_number; - - return( 1 ); -} - - - - - -/****************************************************************************/ -#pragma warning( disable : 4100 ) - -void freelist_test_internal_pushing_delete( void *user_data, void *user_state ) -{ - assert( user_data != NULL ); - assert( user_state == NULL ); - - free( user_data ); - - return; -} - -#pragma warning( default : 4100 ) - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_pushing( void *freelist_test_pushing_state ) -{ - struct freelist_test_pushing_state - *ftps; - - struct lfds611_freelist_element - *fe; - - assert( freelist_test_pushing_state != NULL ); - - ftps = (struct freelist_test_pushing_state *) freelist_test_pushing_state; - - lfds611_freelist_use( ftps->source_fs ); - lfds611_freelist_use( ftps->fs ); - - while( lfds611_freelist_pop(ftps->source_fs, &fe) ) - lfds611_freelist_push( ftps->fs, fe ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void freelist_test_internal_popping_and_pushing( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - enum lfds611_data_structure_validity - dvs; - - struct lfds611_freelist_state - *fs; - - struct freelist_test_popping_and_pushing_state - *pps; - - struct lfds611_validation_info - vi; - - /* TRD : we have two threads per CPU - the threads loop for ten seconds - the first thread pushes 100000 elements then pops 100000 elements - the second thread pops 100000 elements then pushes 100000 elements - all pushes and pops go onto the single main freelist - - after time is up, all threads push what they have remaining onto - the main freelist - - we then validate the main freelist - */ - - internal_display_test_name( "Popping and pushing (10 seconds)" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_freelist_new( &fs, 100000 * cpu_count, NULL, NULL ); - - pps = malloc( sizeof(struct freelist_test_popping_and_pushing_state) * cpu_count * 2 ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (pps+loop)->fs = fs; - lfds611_freelist_new( &(pps+loop)->local_fs, 0, NULL, NULL ); - - (pps+loop+cpu_count)->fs = fs; - lfds611_freelist_new( &(pps+loop+cpu_count)->local_fs, 100000, NULL, NULL ); - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count * 2 ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - abstraction_thread_start( &thread_handles[loop], loop, freelist_test_internal_thread_popping_and_pushing_start_popping, pps+loop ); - abstraction_thread_start( &thread_handles[loop+cpu_count], loop, freelist_test_internal_thread_popping_and_pushing_start_pushing, pps+loop+cpu_count ); - } - - for( loop = 0 ; loop < cpu_count * 2 ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - for( loop = 0 ; loop < cpu_count * 2 ; loop++ ) - lfds611_freelist_delete( (pps+loop)->local_fs, NULL, NULL ); - - free( pps ); - - vi.min_elements = vi.max_elements = 100000 * cpu_count * 2; - - lfds611_freelist_query( fs, LFDS611_FREELIST_QUERY_VALIDATE, (void *) &vi, (void *) &dvs ); - - lfds611_freelist_delete( fs, NULL, NULL ); - - // TRD : print the test result - internal_display_test_result( 1, "freelist", dvs ); - - return; -} - - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping_and_pushing_start_popping( void *freelist_test_popping_and_pushing_state ) -{ - struct freelist_test_popping_and_pushing_state - *pps; - - struct lfds611_freelist_element - *fe; - - time_t - start_time; - - unsigned int - count; - - assert( freelist_test_popping_and_pushing_state != NULL ); - - pps = (struct freelist_test_popping_and_pushing_state *) freelist_test_popping_and_pushing_state; - - lfds611_freelist_use( pps->fs ); - lfds611_freelist_use( pps->local_fs ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - count = 0; - - while( count < 100000 ) { - lfds611_freelist_pop( pps->fs, &fe ); - - if( fe != NULL ) { - lfds611_freelist_push( pps->local_fs, fe ); - count++; - } - } - - while( lfds611_freelist_pop(pps->local_fs, &fe) ) - lfds611_freelist_push( pps->fs, fe ); - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping_and_pushing_start_pushing( void *freelist_test_popping_and_pushing_state ) -{ - struct freelist_test_popping_and_pushing_state - *pps; - - struct lfds611_freelist_element - *fe; - - time_t - start_time; - - unsigned int - count; - - assert( freelist_test_popping_and_pushing_state != NULL ); - - pps = (struct freelist_test_popping_and_pushing_state *) freelist_test_popping_and_pushing_state; - - lfds611_freelist_use( pps->fs ); - lfds611_freelist_use( pps->local_fs ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - while( lfds611_freelist_pop(pps->local_fs, &fe) ) - lfds611_freelist_push( pps->fs, fe ); - - count = 0; - - while( count < 1000 ) { - lfds611_freelist_pop( pps->fs, &fe ); - - if( fe != NULL ) { - lfds611_freelist_push( pps->local_fs, fe ); - count++; - } - } - } - - // TRD : now push whatever we have in our local freelist - while( lfds611_freelist_pop(pps->local_fs, &fe) ) - lfds611_freelist_push( pps->fs, fe ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void freelist_test_internal_rapid_popping_and_pushing( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_freelist_state - *fs; - - struct lfds611_validation_info - vi; - - enum lfds611_data_structure_validity - dvs; - - /* TRD : in these tests there is a fundamental antagonism between - how much checking/memory clean up that we do and the - likelyhood of collisions between threads in their lock-free - operations - - the lock-free operations are very quick; if we do anything - much at all between operations, we greatly reduce the chance - of threads colliding - - so we have some tests which do enough checking/clean up that - they can tell the freelist is valid and don't leak memory - and here, this test now is one of those which does minimal - checking - in fact, the nature of the test is that you can't - do any real checking - but goes very quickly - - what we do is create a small freelist and then run one thread - per CPU, where each thread simply pops and then immediately - pushes - - the test runs for ten seconds - - after the test is done, the only check we do is to traverse - the freelist, checking for loops and ensuring the number of - elements is correct - */ - - internal_display_test_name( "Rapid popping and pushing (10 seconds)" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_freelist_new( &fs, cpu_count, NULL, NULL ); - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, freelist_test_internal_thread_rapid_popping_and_pushing, fs ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - vi.min_elements = cpu_count; - vi.max_elements = cpu_count; - - lfds611_freelist_query( fs, LFDS611_FREELIST_QUERY_VALIDATE, (void *) &vi, (void *) &dvs ); - - lfds611_freelist_delete( fs, NULL, NULL ); - - // TRD : print the test result - internal_display_test_result( 1, "freelist", dvs ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION freelist_test_internal_thread_rapid_popping_and_pushing( void *lfds611_freelist_state ) -{ - struct lfds611_freelist_state - *fs; - - struct lfds611_freelist_element - *fe; - - time_t - start_time; - - assert( lfds611_freelist_state != NULL ); - - fs = (struct lfds611_freelist_state *) lfds611_freelist_state; - - lfds611_freelist_use( fs ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_freelist_pop( fs, &fe ); - lfds611_freelist_push( fs, fe ); - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_queue.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_queue.c deleted file mode 100644 index 9acb516ff7..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_queue.c +++ /dev/null @@ -1,515 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void test_lfds611_queue( void ) -{ - printf( "\n" - "Queue Tests\n" - "===========\n" ); - - queue_test_enqueuing(); - queue_test_dequeuing(); - queue_test_enqueuing_and_dequeuing(); - queue_test_rapid_enqueuing_and_dequeuing(); - - return; -} - - - - - -/****************************************************************************/ -void queue_test_enqueuing( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_queue_state - *qs; - - struct queue_test_enqueuing_state - *qtes; - - lfds611_atom_t - user_data, - thread, - count, - *per_thread_counters; - - struct lfds611_validation_info - vi = { 1000000, 1000000 }; - - enum lfds611_data_structure_validity - dvs[2]; - - /* TRD : create an empty queue with 1,000,000 elements in its freelist - then run one thread per CPU - where each thread busy-works, enqueuing elements (until there are no more elements) - each element's void pointer of user data is (thread number | element number) - where element_number is a thread-local counter starting at 0 - where the thread_number occupies the top byte - - when we're done, we check that all the elements are present - and increment on a per-thread basis - */ - - internal_display_test_name( "Enqueuing" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_queue_new( &qs, 1000000 ); - - qtes = malloc( sizeof(struct queue_test_enqueuing_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (qtes+loop)->qs = qs; - (qtes+loop)->counter = (lfds611_atom_t) loop << (sizeof(lfds611_atom_t)*8-8); - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, queue_test_internal_thread_simple_enqueuer, qtes+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - free( qtes ); - - /* TRD : first, validate the queue - - then dequeue - we expect to find element numbers increment on a per thread basis - */ - - lfds611_queue_query( qs, LFDS611_QUEUE_QUERY_VALIDATE, &vi, dvs ); - - per_thread_counters = malloc( sizeof(lfds611_atom_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - *(per_thread_counters+loop) = 0; - - while( dvs[0] == LFDS611_VALIDITY_VALID and dvs[1] == LFDS611_VALIDITY_VALID and lfds611_queue_dequeue(qs, (void *) &user_data) ) { - thread = user_data >> (sizeof(lfds611_atom_t)*8-8); - count = (user_data << 8) >> 8; - - if( thread >= cpu_count ) { - dvs[0] = LFDS611_VALIDITY_INVALID_TEST_DATA; - break; - } - - if( count < per_thread_counters[thread] ) - dvs[0] = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - - if( count > per_thread_counters[thread] ) - dvs[0] = LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS; - - if( count == per_thread_counters[thread] ) - per_thread_counters[thread]++; - } - - free( per_thread_counters ); - - lfds611_queue_delete( qs, NULL, NULL ); - - internal_display_test_result( 2, "queue", dvs[0], "queue freelist", dvs[1] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION queue_test_internal_thread_simple_enqueuer( void *queue_test_enqueuing_state ) -{ - struct queue_test_enqueuing_state - *qtes; - - assert( queue_test_enqueuing_state != NULL ); - - qtes = (struct queue_test_enqueuing_state *) queue_test_enqueuing_state; - - lfds611_queue_use( qtes->qs ); - - // TRD : top byte of counter is already our thread number - while( lfds611_queue_enqueue(qtes->qs, (void *) qtes->counter++) ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void queue_test_dequeuing( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_queue_state - *qs; - - struct queue_test_dequeuing_state - *qtds; - - struct lfds611_validation_info - vi = { 0, 0 }; - - enum lfds611_data_structure_validity - dvs[2]; - - /* TRD : create a queue with 1,000,000 elements - - use a single thread to enqueue every element - each elements user data is an incrementing counter - - then run one thread per CPU - where each busy-works dequeuing - - when an element is dequeued, we check (on a per-thread basis) the - value deqeued is greater than the element previously dequeued - */ - - internal_display_test_name( "Dequeuing" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_queue_new( &qs, 1000000 ); - - for( loop = 0 ; loop < 1000000 ; loop++ ) - lfds611_queue_enqueue( qs, (void *) (lfds611_atom_t) loop ); - - qtds = malloc( sizeof(struct queue_test_dequeuing_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (qtds+loop)->qs = qs; - (qtds+loop)->error_flag = LOWERED; - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, queue_test_internal_thread_simple_dequeuer, qtds+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : check queue is empty - lfds611_queue_query( qs, LFDS611_QUEUE_QUERY_VALIDATE, (void *) &vi, (void *) dvs ); - - // TRD : check for raised error flags - for( loop = 0 ; loop < cpu_count ; loop++ ) - if( (qtds+loop)->error_flag == RAISED ) - dvs[0] = LFDS611_VALIDITY_INVALID_TEST_DATA; - - free( qtds ); - - lfds611_queue_delete( qs, NULL, NULL ); - - internal_display_test_result( 2, "queue", dvs[0], "queue freelist", dvs[1] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION queue_test_internal_thread_simple_dequeuer( void *queue_test_dequeuing_state ) -{ - struct queue_test_dequeuing_state - *qtds; - - lfds611_atom_t - *prev_user_data, - *user_data; - - assert( queue_test_dequeuing_state != NULL ); - - qtds = (struct queue_test_dequeuing_state *) queue_test_dequeuing_state; - - lfds611_queue_use( qtds->qs ); - - lfds611_queue_dequeue( qtds->qs, (void *) &prev_user_data ); - - while( lfds611_queue_dequeue(qtds->qs, (void *) &user_data) ) { - if( user_data <= prev_user_data ) - qtds->error_flag = RAISED; - - prev_user_data = user_data; - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void queue_test_enqueuing_and_dequeuing( void ) -{ - unsigned int - loop, - subloop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_queue_state - *qs; - - struct queue_test_enqueuing_and_dequeuing_state - *qteds; - - struct lfds611_validation_info - vi = { 0, 0 }; - - enum lfds611_data_structure_validity - dvs[2]; - - internal_display_test_name( "Enqueuing and dequeuing (10 seconds)" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_queue_new( &qs, cpu_count ); - - qteds = malloc( sizeof(struct queue_test_enqueuing_and_dequeuing_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (qteds+loop)->qs = qs; - (qteds+loop)->thread_number = loop; - (qteds+loop)->counter = (lfds611_atom_t) loop << (sizeof(lfds611_atom_t)*8-8); - (qteds+loop)->cpu_count = cpu_count; - (qteds+loop)->error_flag = LOWERED; - (qteds+loop)->per_thread_counters = malloc( sizeof(lfds611_atom_t) * cpu_count ); - - for( subloop = 0 ; subloop < cpu_count ; subloop++ ) - *((qteds+loop)->per_thread_counters+subloop) = 0; - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, queue_test_internal_thread_enqueuer_and_dequeuer, qteds+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - lfds611_queue_query( qs, LFDS611_QUEUE_QUERY_VALIDATE, (void *) &vi, (void *) dvs ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - if( (qteds+loop)->error_flag == RAISED ) - dvs[0] = LFDS611_VALIDITY_INVALID_TEST_DATA; - - for( loop = 0 ; loop < cpu_count ; loop++ ) - free( (qteds+loop)->per_thread_counters ); - - free( qteds ); - - lfds611_queue_delete( qs, NULL, NULL ); - - internal_display_test_result( 2, "queue", dvs[0], "queue freelist", dvs[1] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION queue_test_internal_thread_enqueuer_and_dequeuer( void *queue_test_enqueuing_and_dequeuing_state ) -{ - struct queue_test_enqueuing_and_dequeuing_state - *qteds; - - time_t - start_time; - - lfds611_atom_t - thread, - count, - user_data; - - assert( queue_test_enqueuing_and_dequeuing_state != NULL ); - - qteds = (struct queue_test_enqueuing_and_dequeuing_state *) queue_test_enqueuing_and_dequeuing_state; - - lfds611_queue_use( qteds->qs ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_queue_enqueue( qteds->qs, (void *) (qteds->counter++) ); - lfds611_queue_dequeue( qteds->qs, (void *) &user_data ); - - thread = user_data >> (sizeof(lfds611_atom_t)*8-8); - count = (user_data << 8) >> 8; - - if( thread >= qteds->cpu_count ) - qteds->error_flag = RAISED; - else { - if( count < qteds->per_thread_counters[thread] ) - qteds->error_flag = RAISED; - - if( count >= qteds->per_thread_counters[thread] ) - qteds->per_thread_counters[thread] = count+1; - } - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void queue_test_rapid_enqueuing_and_dequeuing( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_queue_state - *qs; - - struct queue_test_rapid_enqueuing_and_dequeuing_state - *qtreds; - - struct lfds611_validation_info - vi = { 50000, 50000 }; - - lfds611_atom_t - user_data, - thread, - count, - *per_thread_counters; - - enum lfds611_data_structure_validity - dvs[2]; - - internal_display_test_name( "Rapid enqueuing and dequeuing (10 seconds)" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_queue_new( &qs, 100000 ); - - for( loop = 0 ; loop < 50000 ; loop++ ) - lfds611_queue_enqueue( qs, NULL ); - - qtreds = malloc( sizeof(struct queue_test_rapid_enqueuing_and_dequeuing_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (qtreds+loop)->qs = qs; - (qtreds+loop)->counter = (lfds611_atom_t) loop << (sizeof(lfds611_atom_t)*8-8); - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, queue_test_internal_thread_rapid_enqueuer_and_dequeuer, qtreds+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - lfds611_queue_query( qs, LFDS611_QUEUE_QUERY_VALIDATE, (void *) &vi, (void *) dvs ); - - // TRD : now check results - per_thread_counters = malloc( sizeof(lfds611_atom_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - *(per_thread_counters+loop) = 0; - - while( dvs[0] == LFDS611_VALIDITY_VALID and dvs[1] == LFDS611_VALIDITY_VALID and lfds611_queue_dequeue(qs, (void *) &user_data) ) { - thread = user_data >> (sizeof(lfds611_atom_t)*8-8); - count = (user_data << 8) >> 8; - - if( thread >= cpu_count ) { - dvs[0] = LFDS611_VALIDITY_INVALID_TEST_DATA; - break; - } - - if( per_thread_counters[thread] == 0 ) - per_thread_counters[thread] = count; - - if( count < per_thread_counters[thread] ) - dvs[0] = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - - if( count >= per_thread_counters[thread] ) - per_thread_counters[thread] = count+1; - } - - free( per_thread_counters ); - - free( qtreds ); - - lfds611_queue_delete( qs, NULL, NULL ); - - internal_display_test_result( 2, "queue", dvs[0], "queue freelist", dvs[1] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION queue_test_internal_thread_rapid_enqueuer_and_dequeuer( void *queue_test_rapid_enqueuing_and_dequeuing_state ) -{ - struct queue_test_rapid_enqueuing_and_dequeuing_state - *qtreds; - - time_t - start_time; - - lfds611_atom_t - user_data; - - assert( queue_test_rapid_enqueuing_and_dequeuing_state != NULL ); - - qtreds = (struct queue_test_rapid_enqueuing_and_dequeuing_state *) queue_test_rapid_enqueuing_and_dequeuing_state; - - lfds611_queue_use( qtreds->qs ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_queue_enqueue( qtreds->qs, (void *) (qtreds->counter++) ); - lfds611_queue_dequeue( qtreds->qs, (void *) &user_data ); - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_ringbuffer.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_ringbuffer.c deleted file mode 100644 index c9c0fd1721..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_ringbuffer.c +++ /dev/null @@ -1,472 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void test_lfds611_ringbuffer( void ) -{ - printf( "\n" - "Ringbuffer Tests\n" - "================\n" ); - - ringbuffer_test_reading(); - ringbuffer_test_writing(); - ringbuffer_test_reading_and_writing(); - - return; -} - - - - - -/****************************************************************************/ -void ringbuffer_test_reading( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_ringbuffer_state - *rs; - - struct lfds611_freelist_element - *fe; - - struct ringbuffer_test_reading_state - *rtrs; - - struct lfds611_validation_info - vi = { 0, 0 }; - - enum lfds611_data_structure_validity - dvs[3]; - - lfds611_atom_t - total_read = 0; - - /* TRD : we create a single ringbuffer - with 1,000,000 elements - we populate the ringbuffer, where the - user data is an incrementing counter - - we create one thread per CPU - where each thread busy-works, - reading until the ringbuffer is empty - - each thread keeps track of the number of reads it manages - and that each user data it reads is greater than the - previous user data that was read - */ - - internal_display_test_name( "Reading" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_ringbuffer_new( &rs, 1000000, NULL, NULL ); - - for( loop = 0 ; loop < 1000000 ; loop++ ) { - lfds611_ringbuffer_get_write_element( rs, &fe, NULL ); - lfds611_freelist_set_user_data_in_element( fe, (void *) (lfds611_atom_t) loop ); - lfds611_ringbuffer_put_write_element( rs, fe ); - } - - rtrs = malloc( sizeof(struct ringbuffer_test_reading_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (rtrs+loop)->rs = rs; - (rtrs+loop)->read_count = 0; - (rtrs+loop)->error_flag = LOWERED; - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, ringbuffer_test_thread_simple_reader, rtrs+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - lfds611_ringbuffer_query( rs, LFDS611_RINGBUFFER_QUERY_VALIDATE, (void *) &vi, (void *) dvs ); - - // TRD : check for raised error flags - for( loop = 0 ; loop < cpu_count ; loop++ ) - if( (rtrs+loop)->error_flag == RAISED ) - dvs[0] = LFDS611_VALIDITY_INVALID_TEST_DATA; - - // TRD : check thread reads total to 1,000,000 - for( loop = 0 ; loop < cpu_count ; loop++ ) - total_read += (rtrs+loop)->read_count; - - if( total_read < 1000000 ) - dvs[0] = LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS; - - if( total_read > 1000000 ) - dvs[0] = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - - free( rtrs ); - - lfds611_ringbuffer_delete( rs, NULL, NULL ); - - internal_display_test_result( 3, "queue", dvs[0], "queue freelist", dvs[1], "freelist", dvs[2] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION ringbuffer_test_thread_simple_reader( void *ringbuffer_test_reading_state ) -{ - struct ringbuffer_test_reading_state - *rtrs; - - struct lfds611_freelist_element - *fe; - - lfds611_atom_t - *prev_user_data, - *user_data; - - assert( ringbuffer_test_reading_state != NULL ); - - rtrs = (struct ringbuffer_test_reading_state *) ringbuffer_test_reading_state; - - lfds611_ringbuffer_use( rtrs->rs ); - - /* TRD : read an initial element to load a value into prev_user_data - it may be (under valgrind for example) that by the time we start - there are no elements remaining to read - */ - - lfds611_ringbuffer_get_read_element( rtrs->rs, &fe ); - - if( fe == NULL ) - return( (thread_return_t) EXIT_SUCCESS ); - - lfds611_freelist_get_user_data_from_element( fe, (void **) &prev_user_data ); - lfds611_ringbuffer_put_read_element( rtrs->rs, fe ); - - rtrs->read_count++; - - while( lfds611_ringbuffer_get_read_element(rtrs->rs, &fe) ) { - lfds611_freelist_get_user_data_from_element( fe, (void **) &user_data ); - lfds611_ringbuffer_put_read_element( rtrs->rs, fe ); - - if( user_data <= prev_user_data ) - rtrs->error_flag = RAISED; - - prev_user_data = user_data; - - rtrs->read_count++; - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void ringbuffer_test_writing( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_ringbuffer_state - *rs; - - struct lfds611_freelist_element - *fe; - - struct ringbuffer_test_writing_state - *rtws; - - struct lfds611_validation_info - vi = { 100000, 100000 }; - - enum lfds611_data_structure_validity - dvs[3]; - - lfds611_atom_t - thread, - count, - user_data, - *per_thread_counters; - - /* TRD : we create a single ringbuffer - with 100000 elements - the ringbuffers starts empty - - we create one thread per CPU - where each thread busy-works writing - for ten seconds - - the user data in each written element is a combination - of the thread number and the counter - - after the threads are complete, we validate by - checking the user data counters increment on a per thread - basis - */ - - internal_display_test_name( "Writing (10 seconds)" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_ringbuffer_new( &rs, 100000, NULL, NULL ); - - rtws = malloc( sizeof(struct ringbuffer_test_writing_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (rtws+loop)->rs = rs; - (rtws+loop)->write_count = (lfds611_atom_t) loop << (sizeof(lfds611_atom_t)*8-8); - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, ringbuffer_test_thread_simple_writer, rtws+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : now check results - per_thread_counters = malloc( sizeof(lfds611_atom_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - *(per_thread_counters+loop) = 0; - - lfds611_ringbuffer_query( rs, LFDS611_RINGBUFFER_QUERY_VALIDATE, (void *) &vi, (void *) dvs ); - - while( dvs[0] == LFDS611_VALIDITY_VALID and dvs[1] == LFDS611_VALIDITY_VALID and dvs[2] == LFDS611_VALIDITY_VALID and lfds611_ringbuffer_get_read_element(rs, &fe) ) { - lfds611_freelist_get_user_data_from_element( fe, (void *) &user_data ); - - thread = user_data >> (sizeof(lfds611_atom_t)*8-8); - count = (user_data << 8) >> 8; - - if( thread >= cpu_count ) { - dvs[0] = LFDS611_VALIDITY_INVALID_TEST_DATA; - lfds611_ringbuffer_put_read_element( rs, fe ); - break; - } - - if( per_thread_counters[thread] == 0 ) - per_thread_counters[thread] = count; - - if( count < per_thread_counters[thread] ) - dvs[0] = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - - if( count >= per_thread_counters[thread] ) - per_thread_counters[thread] = count+1; - - lfds611_ringbuffer_put_read_element( rs, fe ); - } - - free( per_thread_counters ); - - free( rtws ); - - lfds611_ringbuffer_delete( rs, NULL, NULL ); - - internal_display_test_result( 3, "queue", dvs[0], "queue freelist", dvs[1], "freelist", dvs[2] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION ringbuffer_test_thread_simple_writer( void *ringbuffer_test_writing_state ) -{ - struct ringbuffer_test_writing_state - *rtws; - - struct lfds611_freelist_element - *fe; - - time_t - start_time; - - assert( ringbuffer_test_writing_state != NULL ); - - rtws = (struct ringbuffer_test_writing_state *) ringbuffer_test_writing_state; - - lfds611_ringbuffer_use( rtws->rs ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_ringbuffer_get_write_element( rtws->rs, &fe, NULL ); - lfds611_freelist_set_user_data_in_element( fe, (void *) (lfds611_atom_t) (rtws->write_count++) ); - lfds611_ringbuffer_put_write_element( rtws->rs, fe ); - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void ringbuffer_test_reading_and_writing( void ) -{ - unsigned int - loop, - subloop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_ringbuffer_state - *rs; - - struct ringbuffer_test_reading_and_writing_state - *rtrws; - - struct lfds611_validation_info - vi = { 0, 0 }; - - enum lfds611_data_structure_validity - dvs[3]; - - /* TRD : we create a single ringbuffer - with 100000 elements - the ringbuffers starts empty - - we create one thread per CPU - where each thread busy-works writing - and then immediately reading - for ten seconds - - the user data in each written element is a combination - of the thread number and the counter - - while a thread runs, it keeps track of the - counters for the other threads and throws an error - if it sees the number stay the same or decrease - */ - - internal_display_test_name( "Reading and writing (10 seconds)" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_ringbuffer_new( &rs, 100000, NULL, NULL ); - - rtrws = malloc( sizeof(struct ringbuffer_test_reading_and_writing_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (rtrws+loop)->rs = rs; - (rtrws+loop)->counter = (lfds611_atom_t) loop << (sizeof(lfds611_atom_t)*8-8); - (rtrws+loop)->cpu_count = cpu_count; - (rtrws+loop)->error_flag = LOWERED; - (rtrws+loop)->per_thread_counters = malloc( sizeof(lfds611_atom_t) * cpu_count ); - - for( subloop = 0 ; subloop < cpu_count ; subloop++ ) - *((rtrws+loop)->per_thread_counters+subloop) = 0; - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, ringbuffer_test_thread_reader_writer, rtrws+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - lfds611_ringbuffer_query( rs, LFDS611_RINGBUFFER_QUERY_VALIDATE, (void *) &vi, (void *) dvs ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - if( (rtrws+loop)->error_flag == RAISED ) - dvs[0] = LFDS611_VALIDITY_INVALID_TEST_DATA; - - for( loop = 0 ; loop < cpu_count ; loop++ ) - free( (rtrws+loop)->per_thread_counters ); - - free( rtrws ); - - lfds611_ringbuffer_delete( rs, NULL, NULL ); - - internal_display_test_result( 3, "queue", dvs[0], "queue freelist", dvs[1], "freelist", dvs[2] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION ringbuffer_test_thread_reader_writer( void *ringbuffer_test_reading_and_writing_state ) -{ - struct ringbuffer_test_reading_and_writing_state - *rtrws; - - struct lfds611_freelist_element - *fe; - - lfds611_atom_t - user_data, - thread, - count; - - time_t - start_time; - - assert( ringbuffer_test_reading_and_writing_state != NULL ); - - rtrws = (struct ringbuffer_test_reading_and_writing_state *) ringbuffer_test_reading_and_writing_state; - - lfds611_ringbuffer_use( rtrws->rs ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_ringbuffer_get_write_element( rtrws->rs, &fe, NULL ); - lfds611_freelist_set_user_data_in_element( fe, (void *) (lfds611_atom_t) (rtrws->counter++) ); - lfds611_ringbuffer_put_write_element( rtrws->rs, fe ); - - lfds611_ringbuffer_get_read_element( rtrws->rs, &fe ); - lfds611_freelist_get_user_data_from_element( fe, (void *) &user_data ); - - thread = user_data >> (sizeof(lfds611_atom_t)*8-8); - count = (user_data << 8) >> 8; - - if( thread >= rtrws->cpu_count ) - rtrws->error_flag = RAISED; - else { - if( count < rtrws->per_thread_counters[thread] ) - rtrws->error_flag = RAISED; - - if( count >= rtrws->per_thread_counters[thread] ) - rtrws->per_thread_counters[thread] = count+1; - } - - lfds611_ringbuffer_put_read_element( rtrws->rs, fe ); - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_slist.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_slist.c deleted file mode 100644 index 0388ad8c7d..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_slist.c +++ /dev/null @@ -1,388 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void test_lfds611_slist( void ) -{ - printf( "\n" - "SList Tests\n" - "===========\n" ); - - test_slist_new_delete_get(); - test_slist_get_set_user_data(); - test_slist_delete_all_elements(); - - return; -} - - - - - -/****************************************************************************/ -void test_slist_new_delete_get( void ) -{ - unsigned int - loop, - cpu_count; - - struct lfds611_slist_state - *ss; - - struct lfds611_slist_element - *se = NULL; - - struct slist_test_state - *sts; - - thread_state_t - *thread_handles; - - size_t - total_create_count = 0, - total_delete_count = 0, - element_count = 0; - - enum lfds611_data_structure_validity - dvs = LFDS611_VALIDITY_VALID; - - /* TRD : two threads per CPU - first simply alternates between new_head() and new_next() (next on element created by head) - second calls get_next, if NULL, then calls get_head, and deletes the element - both threads keep count of created and deleted - validate is to reconcile created, deleted and remaining in list - */ - - internal_display_test_name( "New head/next, delete and get next" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_slist_new( &ss, NULL, NULL ); - - sts = malloc( sizeof(struct slist_test_state) * cpu_count * 2 ); - - for( loop = 0 ; loop < cpu_count * 2 ; loop++ ) { - (sts+loop)->ss = ss; - (sts+loop)->create_count = 0; - (sts+loop)->delete_count = 0; - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count * 2 ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - abstraction_thread_start( &thread_handles[loop], loop, slist_test_internal_thread_new_delete_get_new_head_and_next, sts+loop ); - abstraction_thread_start( &thread_handles[loop+cpu_count], loop, slist_test_internal_thread_new_delete_get_delete_and_get, sts+loop+cpu_count ); - } - - for( loop = 0 ; loop < cpu_count * 2 ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : now validate - for( loop = 0 ; loop < cpu_count * 2 ; loop++ ) { - total_create_count += (sts+loop)->create_count; - total_delete_count += (sts+loop)->delete_count; - } - - while( NULL != lfds611_slist_get_head_and_then_next(ss, &se) ) - element_count++; - - if( total_create_count - total_delete_count - element_count != 0 ) - dvs = LFDS611_VALIDITY_INVALID_TEST_DATA; - - free( sts ); - - lfds611_slist_delete( ss ); - - internal_display_test_result( 1, "slist", dvs ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION slist_test_internal_thread_new_delete_get_new_head_and_next( void *slist_test_state ) -{ - struct slist_test_state - *sts; - - time_t - start_time; - - struct lfds611_slist_element - *se = NULL; - - assert( slist_test_state != NULL ); - - sts = (struct slist_test_state *) slist_test_state; - - lfds611_slist_use( sts->ss ); - - time( &start_time ); - - while( time(NULL) < start_time + 1 ) { - if( sts->create_count % 2 == 0 ) - se = lfds611_slist_new_head( sts->ss, NULL ); - else - lfds611_slist_new_next( se, NULL ); - - sts->create_count++; - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION slist_test_internal_thread_new_delete_get_delete_and_get( void *slist_test_state ) -{ - struct slist_test_state - *sts; - - time_t - start_time; - - struct lfds611_slist_element - *se = NULL; - - assert( slist_test_state != NULL ); - - sts = (struct slist_test_state *) slist_test_state; - - lfds611_slist_use( sts->ss ); - - time( &start_time ); - - while( time(NULL) < start_time + 1 ) { - if( se == NULL ) - lfds611_slist_get_head( sts->ss, &se ); - else - lfds611_slist_get_next( se, &se ); - - if( se != NULL ) { - if( 1 == lfds611_slist_logically_delete_element(sts->ss, se) ) - sts->delete_count++; - } - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void test_slist_get_set_user_data( void ) -{ - unsigned int - loop, - cpu_count; - - struct lfds611_slist_state - *ss; - - struct lfds611_slist_element - *se = NULL; - - struct slist_test_state - *sts; - - thread_state_t - *thread_handles; - - lfds611_atom_t - thread_and_count, - thread, - count, - *per_thread_counters, - *per_thread_drop_flags; - - enum lfds611_data_structure_validity - dvs = LFDS611_VALIDITY_VALID; - - /* TRD : create a list of (cpu_count*10) elements, user data 0 - one thread per CPU - each thread loops, setting user_data to ((thread_number << (sizeof(lfds611_atom_t)*8-8)) | count) - validation is to scan list, count on a per thread basis should go down only once - */ - - internal_display_test_name( "Get and set user data" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_slist_new( &ss, NULL, NULL ); - - for( loop = 0 ; loop < cpu_count * 10 ; loop++ ) - lfds611_slist_new_head( ss, NULL ); - - sts = malloc( sizeof(struct slist_test_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (sts+loop)->ss = ss; - (sts+loop)->thread_and_count = (lfds611_atom_t) loop << (sizeof(lfds611_atom_t)*8-8); - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, slist_test_internal_thread_get_set_user_data, sts+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // now validate - per_thread_counters = malloc( sizeof(lfds611_atom_t) * cpu_count ); - per_thread_drop_flags = malloc( sizeof(lfds611_atom_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - *(per_thread_counters+loop) = 0; - *(per_thread_drop_flags+loop) = 0; - } - - while( dvs == LFDS611_VALIDITY_VALID and NULL != lfds611_slist_get_head_and_then_next(ss, &se) ) { - lfds611_slist_get_user_data_from_element( se, (void **) &thread_and_count ); - - thread = thread_and_count >> (sizeof(lfds611_atom_t)*8-8); - count = (thread_and_count << 8) >> 8; - - if( thread >= cpu_count ) { - dvs = LFDS611_VALIDITY_INVALID_TEST_DATA; - break; - } - - if( per_thread_counters[thread] == 0 ) { - per_thread_counters[thread] = count; - continue; - } - - per_thread_counters[thread]++; - - if( count < per_thread_counters[thread] and per_thread_drop_flags[thread] == 1 ) { - dvs = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - break; - } - - if( count < per_thread_counters[thread] and per_thread_drop_flags[thread] == 0 ) { - per_thread_drop_flags[thread] = 1; - per_thread_counters[thread] = count; - continue; - } - - if( count < per_thread_counters[thread] ) - dvs = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - - if( count >= per_thread_counters[thread] ) - per_thread_counters[thread] = count; - } - - free( per_thread_drop_flags ); - free( per_thread_counters ); - - free( sts ); - - lfds611_slist_delete( ss ); - - internal_display_test_result( 1, "slist", dvs ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION slist_test_internal_thread_get_set_user_data( void *slist_test_state ) -{ - struct slist_test_state - *sts; - - time_t - start_time; - - struct lfds611_slist_element - *se = NULL; - - assert( slist_test_state != NULL ); - - sts = (struct slist_test_state *) slist_test_state; - - lfds611_slist_use( sts->ss ); - - time( &start_time ); - - while( time(NULL) < start_time + 1 ) { - if( se == NULL ) - lfds611_slist_get_head( sts->ss, &se ); - - lfds611_slist_set_user_data_in_element( se, (void *) sts->thread_and_count++ ); - - lfds611_slist_get_next( se, &se ); - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void test_slist_delete_all_elements( void ) -{ - struct lfds611_slist_state - *ss; - - struct lfds611_slist_element - *se = NULL; - - size_t - element_count = 0; - - unsigned int - loop; - - enum lfds611_data_structure_validity - dvs = LFDS611_VALIDITY_VALID; - - /* TRD : this test creates a list of 100,000 elements - then simply calls delete_all_elements() - we then count the number of elements remaining - should be zero :-) - */ - - internal_display_test_name( "Delete all elements" ); - - lfds611_slist_new( &ss, NULL, NULL ); - - for( loop = 0 ; loop < 1000000 ; loop++ ) - lfds611_slist_new_head( ss, NULL ); - - lfds611_slist_single_threaded_physically_delete_all_elements( ss ); - - while( NULL != lfds611_slist_get_head_and_then_next(ss, &se) ) - element_count++; - - if( element_count != 0 ) - dvs = LFDS611_VALIDITY_INVALID_TEST_DATA; - - lfds611_slist_delete( ss ); - - internal_display_test_result( 1, "slist", dvs ); - - return; -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_stack.c b/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_stack.c deleted file mode 100644 index cb5916620b..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/src/test_stack.c +++ /dev/null @@ -1,582 +0,0 @@ -#include "internal.h" - - - - - -/****************************************************************************/ -void test_lfds611_stack( void ) -{ - printf( "\n" - "Stack Tests\n" - "===========\n" ); - - stack_test_internal_popping(); - stack_test_internal_pushing(); - stack_test_internal_popping_and_pushing(); - stack_test_internal_rapid_popping_and_pushing(); - - return; -} - - - - - -/****************************************************************************/ -void stack_test_internal_popping( void ) -{ - unsigned int - loop, - *found_count, - cpu_count; - - lfds611_atom_t - count; - - thread_state_t - *thread_handles; - - enum lfds611_data_structure_validity - dvs = LFDS611_VALIDITY_VALID; - - struct lfds611_stack_state - *ss; - - struct stack_test_popping_state - *stps; - - /* TRD : we create a stack with 1,000,000 elements - - we then populate the stack, where each element is - set to contain a void pointer which is its element number - - we then run one thread per CPU - where each thread loops, popping as quickly as possible - each popped element is pushed onto a thread-local stack - - the threads run till the source stack is empty - - we then check the thread-local stacks - we should find we have every element - - then tidy up - */ - - internal_display_test_name( "Popping" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_stack_new( &ss, 1000000 ); - - for( loop = 0 ; loop < 1000000 ; loop++ ) - lfds611_stack_push( ss, (void *) (lfds611_atom_t) loop ); - - stps = malloc( sizeof(struct stack_test_popping_state) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (stps+loop)->ss = ss; - lfds611_stack_new( &(stps+loop)->ss_thread_local, 1000000 ); - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, stack_test_internal_thread_popping, stps+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : now we check the thread-local stacks - found_count = malloc( sizeof(unsigned int) * 1000000 ); - - for( loop = 0 ; loop < 1000000 ; loop++ ) - *(found_count+loop) = 0; - - for( loop = 0 ; loop < cpu_count ; loop++ ) - while( lfds611_stack_pop((stps+loop)->ss_thread_local, (void **) &count) ) - (*(found_count+count))++; - - for( loop = 0 ; loop < 1000000 and dvs == LFDS611_VALIDITY_VALID ; loop++ ) { - if( *(found_count+loop) == 0 ) - dvs = LFDS611_VALIDITY_INVALID_MISSING_ELEMENTS; - - if( *(found_count+loop) > 1 ) - dvs = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - } - - // TRD : cleanup - free( found_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - lfds611_stack_delete( (stps+loop)->ss_thread_local, NULL, NULL ); - - free( stps ); - lfds611_stack_delete( ss, NULL, NULL ); - - // TRD : print the test result - internal_display_test_result( 1, "stack", dvs ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION stack_test_internal_thread_popping( void *stack_test_popping_state ) -{ - struct stack_test_popping_state - *stps; - - lfds611_atom_t - count; - - assert( stack_test_popping_state != NULL ); - - stps = (struct stack_test_popping_state *) stack_test_popping_state; - - lfds611_stack_use( stps->ss ); - - while( lfds611_stack_pop(stps->ss, (void **) &count) ) - lfds611_stack_push( stps->ss_thread_local, (void *) count ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void stack_test_internal_pushing( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - enum lfds611_data_structure_validity - dvs[2]; - - struct stack_test_pushing_state - *stps; - - struct lfds611_stack_state - *ss; - - lfds611_atom_t - user_data, - thread, - count, - *per_thread_counters; - - struct lfds611_validation_info - vi = { 1000000, 1000000 }; - - /* TRD : we create a stack with 1,000,000 elements - - we then create one thread per CPU, where each thread - pushes as quickly as possible to the stack - - the data pushed is a counter and a thread ID - - the threads exit when the stack is full - - we then validate the stack; - - checking that the counts increment on a per unique ID basis - and that the number of elements we pop equals 1,000,000 - (since each element has an incrementing counter which is - unique on a per unique ID basis, we can know we didn't lose - any elements) - */ - - internal_display_test_name( "Pushing" ); - - cpu_count = abstraction_cpu_count(); - - stps = malloc( sizeof(struct stack_test_pushing_state) * cpu_count ); - - // TRD : the main stack - lfds611_stack_new( &ss, 1000000 ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (stps+loop)->thread_number = (lfds611_atom_t) loop; - (stps+loop)->ss = ss; - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, stack_test_internal_thread_pushing, stps+loop ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - // TRD : the stack is now fully pushed; time to verify - per_thread_counters = malloc( sizeof(lfds611_atom_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - *(per_thread_counters+loop) = 1000000; - - lfds611_stack_query( ss, LFDS611_STACK_QUERY_VALIDATE, &vi, (void *) dvs ); - - while( dvs[0] == LFDS611_VALIDITY_VALID and lfds611_stack_pop(ss, (void **) &user_data) ) { - thread = user_data >> (sizeof(lfds611_atom_t)*8-8); - count = (user_data << 8) >> 8; - - if( thread >= cpu_count ) { - dvs[0] = LFDS611_VALIDITY_INVALID_TEST_DATA; - break; - } - - if( count > per_thread_counters[thread] ) - dvs[0] = LFDS611_VALIDITY_INVALID_ADDITIONAL_ELEMENTS; - - if( count < per_thread_counters[thread] ) - per_thread_counters[thread] = count-1; - } - - // TRD : clean up - free( per_thread_counters ); - - free( stps ); - - lfds611_stack_delete( ss, NULL, NULL ); - - // TRD : print the test result - internal_display_test_result( 2, "stack", dvs[0], "stack freelist", dvs[1] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION stack_test_internal_thread_pushing( void *stack_test_pushing_state ) -{ - struct stack_test_pushing_state - *stps; - - lfds611_atom_t - counter = 0; - - assert( stack_test_pushing_state != NULL ); - - stps = (struct stack_test_pushing_state *) stack_test_pushing_state; - - lfds611_stack_use( stps->ss ); - - // TRD : we write (thread_number | counter), where thread_number is the top 8 bits of the lfds611_atom_t - while( lfds611_stack_push(stps->ss, (void **) ((stps->thread_number << (sizeof(lfds611_atom_t)*8-8)) | counter++)) ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void stack_test_internal_popping_and_pushing( void ) -{ - unsigned int - loop, - subloop, - cpu_count; - - thread_state_t - *thread_handles; - - enum lfds611_data_structure_validity - dvs[2]; - - struct lfds611_stack_state - *ss; - - struct stack_test_popping_and_pushing_state - *stpps; - - struct lfds611_validation_info - vi; - - /* TRD : we have two threads per CPU - the threads loop for ten seconds - the first thread pushes 100000 elements then pops 100000 elements - the second thread pops 100000 elements then pushes 100000 elements - all pushes and pops go onto the single main stack - - after time is up, all threads push what they have remaining onto - the main stack - - we then validate the main stack - */ - - internal_display_test_name( "Popping and pushing (10 seconds)" ); - - cpu_count = abstraction_cpu_count(); - - // TRD : just some initial elements so the pushing threads can start immediately - lfds611_stack_new( &ss, 100000 * cpu_count * 2 ); - - for( loop = 0 ; loop < 100000 * cpu_count ; loop++ ) - lfds611_stack_push( ss, (void *) (lfds611_atom_t) loop ); - - stpps = malloc( sizeof(struct stack_test_popping_and_pushing_state) * cpu_count * 2 ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - (stpps+loop)->ss = ss; - lfds611_stack_new( &(stpps+loop)->local_ss, 100000 ); - - (stpps+loop+cpu_count)->ss = ss; - lfds611_stack_new( &(stpps+loop+cpu_count)->local_ss, 100000 ); - - // TRD : fill the pushing thread stacks - for( subloop = 0 ; subloop < 100000 ; subloop++ ) - lfds611_stack_push( (stpps+loop+cpu_count)->local_ss, (void *) (lfds611_atom_t) subloop ); - } - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count * 2 ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) { - abstraction_thread_start( &thread_handles[loop], loop, stack_test_internal_thread_popping_and_pushing_start_popping, stpps+loop ); - abstraction_thread_start( &thread_handles[loop+cpu_count], loop, stack_test_internal_thread_popping_and_pushing_start_pushing, stpps+loop+cpu_count ); - } - - for( loop = 0 ; loop < cpu_count * 2 ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - for( loop = 0 ; loop < cpu_count * 2 ; loop++ ) - lfds611_stack_delete( (stpps+loop)->local_ss, NULL, NULL ); - - free( stpps ); - - vi.min_elements = vi.max_elements = 100000 * cpu_count * 2; - - lfds611_stack_query( ss, LFDS611_STACK_QUERY_VALIDATE, (void *) &vi, (void *) dvs ); - - lfds611_stack_delete( ss, NULL, NULL ); - - // TRD : print the test result - internal_display_test_result( 2, "stack", dvs[0], "stack freelist", dvs[1] ); - - return; -} - - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION stack_test_internal_thread_popping_and_pushing_start_popping( void *stack_test_popping_and_pushing_state ) -{ - struct stack_test_popping_and_pushing_state - *stpps; - - void - *user_data; - - time_t - start_time; - - unsigned int - count; - - assert( stack_test_popping_and_pushing_state != NULL ); - - stpps = (struct stack_test_popping_and_pushing_state *) stack_test_popping_and_pushing_state; - - lfds611_stack_use( stpps->ss ); - lfds611_stack_use( stpps->local_ss ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - count = 0; - - while( count < 100000 ) - if( lfds611_stack_pop(stpps->ss, &user_data) ) { - lfds611_stack_push( stpps->local_ss, user_data ); - count++; - } - - // TRD : return our local stack to the main stack - while( lfds611_stack_pop(stpps->local_ss, &user_data) ) - lfds611_stack_push( stpps->ss, user_data ); - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION stack_test_internal_thread_popping_and_pushing_start_pushing( void *stack_test_popping_and_pushing_state ) -{ - struct stack_test_popping_and_pushing_state - *stpps; - - void - *user_data; - - time_t - start_time; - - unsigned int - count; - - assert( stack_test_popping_and_pushing_state != NULL ); - - stpps = (struct stack_test_popping_and_pushing_state *) stack_test_popping_and_pushing_state; - - lfds611_stack_use( stpps->ss ); - lfds611_stack_use( stpps->local_ss ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - // TRD : return our local stack to the main stack - while( lfds611_stack_pop(stpps->local_ss, &user_data) ) - lfds611_stack_push( stpps->ss, user_data ); - - count = 0; - - while( count < 100000 ) - if( lfds611_stack_pop(stpps->ss, &user_data) ) { - lfds611_stack_push( stpps->local_ss, user_data ); - count++; - } - } - - // TRD : now push whatever we have in our local stack - while( lfds611_stack_pop(stpps->local_ss, &user_data) ) - lfds611_stack_push( stpps->ss, user_data ); - - return( (thread_return_t) EXIT_SUCCESS ); -} - - - - - -/****************************************************************************/ -void stack_test_internal_rapid_popping_and_pushing( void ) -{ - unsigned int - loop, - cpu_count; - - thread_state_t - *thread_handles; - - struct lfds611_stack_state - *ss; - - struct lfds611_validation_info - vi; - - enum lfds611_data_structure_validity - dvs[2]; - - /* TRD : in these tests there is a fundamental antagonism between - how much checking/memory clean up that we do and the - likelyhood of collisions between threads in their lock-free - operations - - the lock-free operations are very quick; if we do anything - much at all between operations, we greatly reduce the chance - of threads colliding - - so we have some tests which do enough checking/clean up that - they can tell the stack is valid and don't leak memory - and here, this test now is one of those which does minimal - checking - in fact, the nature of the test is that you can't - do any real checking - but goes very quickly - - what we do is create a small stack and then run one thread - per CPU, where each thread simply pushes and then immediately - pops - - the test runs for ten seconds - - after the test is done, the only check we do is to traverse - the stack, checking for loops and ensuring the number of - elements is correct - */ - - internal_display_test_name( "Rapid popping and pushing (10 seconds)" ); - - cpu_count = abstraction_cpu_count(); - - lfds611_stack_new( &ss, cpu_count ); - - thread_handles = malloc( sizeof(thread_state_t) * cpu_count ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_start( &thread_handles[loop], loop, stack_test_internal_thread_rapid_popping_and_pushing, ss ); - - for( loop = 0 ; loop < cpu_count ; loop++ ) - abstraction_thread_wait( thread_handles[loop] ); - - free( thread_handles ); - - vi.min_elements = 0; - vi.max_elements = 0; - - lfds611_stack_query( ss, LFDS611_STACK_QUERY_VALIDATE, (void *) &vi, (void *) dvs ); - - lfds611_stack_delete( ss, NULL, NULL ); - - // TRD : print the test result - internal_display_test_result( 2, "stack", dvs[0], "stack freelist", dvs[1] ); - - return; -} - - - - - -/****************************************************************************/ -thread_return_t CALLING_CONVENTION stack_test_internal_thread_rapid_popping_and_pushing( void *stack_state ) -{ - struct lfds611_stack_state - *ss; - - void - *user_data = NULL; - - time_t - start_time; - - assert( stack_state != NULL ); - - ss = (struct lfds611_stack_state *) stack_state; - - lfds611_stack_use( ss ); - - time( &start_time ); - - while( time(NULL) < start_time + 10 ) { - lfds611_stack_push( ss, user_data ); - lfds611_stack_pop( ss, &user_data ); - } - - return( (thread_return_t) EXIT_SUCCESS ); -} - diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/test.sln b/openair2/UTIL/LFDS/liblfds6.1.1/test/test.sln deleted file mode 100644 index 3cfb5b2031..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/test.sln +++ /dev/null @@ -1,79 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test.vcproj", "{6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}" - ProjectSection(ProjectDependencies) = postProject - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05} = {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblfds611", "..\liblfds611\liblfds611.vcproj", "{F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug DLL|Win32 = Debug DLL|Win32 - Debug DLL|x64 = Debug DLL|x64 - Debug Lib|Win32 = Debug Lib|Win32 - Debug Lib|x64 = Debug Lib|x64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release DLL|Win32 = Release DLL|Win32 - Release DLL|x64 = Release DLL|x64 - Release Lib|Win32 = Release Lib|Win32 - Release Lib|x64 = Release Lib|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug DLL|Win32.ActiveCfg = Debug|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug DLL|Win32.Build.0 = Debug|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug DLL|x64.ActiveCfg = Debug|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug DLL|x64.Build.0 = Debug|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug Lib|Win32.ActiveCfg = Debug|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug Lib|Win32.Build.0 = Debug|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug Lib|x64.ActiveCfg = Debug|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug Lib|x64.Build.0 = Debug|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug|Win32.ActiveCfg = Debug|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug|Win32.Build.0 = Debug|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug|x64.ActiveCfg = Debug|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Debug|x64.Build.0 = Debug|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release DLL|Win32.ActiveCfg = Release|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release DLL|Win32.Build.0 = Release|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release DLL|x64.ActiveCfg = Release|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release DLL|x64.Build.0 = Release|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release Lib|Win32.ActiveCfg = Release|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release Lib|Win32.Build.0 = Release|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release Lib|x64.ActiveCfg = Release|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release Lib|x64.Build.0 = Release|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release|Win32.ActiveCfg = Release|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release|Win32.Build.0 = Release|Win32 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release|x64.ActiveCfg = Release|x64 - {6E4CBF20-DF1A-4FA0-8A90-58E2A3A5CF09}.Release|x64.Build.0 = Release|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|x64.ActiveCfg = Debug DLL|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug DLL|x64.Build.0 = Debug DLL|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|Win32.ActiveCfg = Debug Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|Win32.Build.0 = Debug Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|x64.ActiveCfg = Debug Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug Lib|x64.Build.0 = Debug Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug|Win32.ActiveCfg = Debug Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug|Win32.Build.0 = Debug Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug|x64.ActiveCfg = Debug Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Debug|x64.Build.0 = Debug Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|Win32.Build.0 = Release DLL|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|x64.ActiveCfg = Release DLL|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release DLL|x64.Build.0 = Release DLL|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|Win32.ActiveCfg = Release Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|Win32.Build.0 = Release Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|x64.ActiveCfg = Release Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release Lib|x64.Build.0 = Release Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release|Win32.ActiveCfg = Release Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release|Win32.Build.0 = Release Lib|Win32 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release|x64.ActiveCfg = Release Lib|x64 - {F73AE755-F6D8-4C3A-977D-FBB40DC0ED05}.Release|x64.Build.0 = Release Lib|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/test/test.vcproj b/openair2/UTIL/LFDS/liblfds6.1.1/test/test.vcproj deleted file mode 100644 index 97159c86b4..0000000000 --- a/openair2/UTIL/LFDS/liblfds6.1.1/test/test.vcproj +++ /dev/null @@ -1,415 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 17a956067ad89ebc38f784c4291b84e2b8d06912 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Mar 2022 08:33:28 +0100 Subject: [PATCH 632/883] Fix HTML --- ci-scripts/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/html.py b/ci-scripts/html.py index c618ea5abc..13a1ab8691 100644 --- a/ci-scripts/html.py +++ b/ci-scripts/html.py @@ -486,7 +486,7 @@ class HTMLManagement(): # TestRow self.htmlFile.write(' \n') self.htmlFile.write(' ' + k + ' \n') - self.htmlFile.write(' ' + DataLog['Data'][k][0] + '; ' + DataLog['Data'][k][1] + '; ' + DataLog['Data'][k][2] + ' \n') + self.htmlFile.write(' ' + DataLog['Data'][k][0] + '; ' + DataLog['Data'][k][1] + '; ' + DataLog['Data'][k][2] + ' \n') if float(DataLog['Data'][k][3])> DataLog['Threshold'][k]: self.htmlFile.write(' ' + DataLog['Data'][k][3] + ' (Ref = ' + str(DataLog['Ref'][k]) + ' ; Thres = ' +str(DataLog['Threshold'][k])+') ' + '\n') else: From 261c80d659f9275786728c3add1483a756e06bdf Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Mar 2022 08:49:38 +0100 Subject: [PATCH 633/883] Tpool: don't override positive performanceFlag --- common/utils/threadPool/thread-pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils/threadPool/thread-pool.c b/common/utils/threadPool/thread-pool.c index 4a5485e89e..de9091de79 100644 --- a/common/utils/threadPool/thread-pool.c +++ b/common/utils/threadPool/thread-pool.c @@ -97,7 +97,7 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name char *measr=getenv("threadPoolMeasurements"); pool->measurePerf=performanceMeas; // force measurement if the output is defined - pool->measurePerf=measr!=NULL; + pool->measurePerf |= measr!=NULL; if (measr) { mkfifo(measr,0666); From 98a684d157a9ea247aa6b2ea204fae16b1b2c4c1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Mar 2022 08:57:32 +0100 Subject: [PATCH 634/883] Tpool: no measurements (no trials) if not measured --- common/utils/threadPool/thread-pool.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index dc2655f741..d06f2195ee 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -175,6 +175,8 @@ static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) { static inline time_stats_t exec_time_stats_NotifiedFIFO(const notifiedFIFO_elt_t* elt) { time_stats_t ts = {0}; + if (elt->startProcessingTime == 0 && elt->endProcessingTime == 0) + return ts; /* no measurements done */ ts.in = elt->startProcessingTime; ts.diff = elt->endProcessingTime - ts.in; ts.p_time = ts.diff; From 7681feee071b49949c638fa4fb2efae1bd9965f0 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 1 Mar 2022 07:23:14 -0800 Subject: [PATCH 635/883] Removing "included fixes" from root dir README --- README.md | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/README.md b/README.md index 4f38f77e4e..dba0bbfb73 100644 --- a/README.md +++ b/README.md @@ -21,29 +21,6 @@ # OpenAirInterface License # -### Included Fixes: ### -- Ease of use of gprof and address sanitizer for debugging purposes -- Updated json files to allow for GDB, real-time debugging capabilities -- Updated logging features to minimally log only key connection milestones. This imroves scalability of multiple UEs. -- Updated logging to include time stamp for timing analysis -- Updated memory allocation procedures to correct size requirements -- Added debugging features to handle signal terminations -- nfapi.c pullarray8 fix invalid pointer math -- Overlapping destination and source memory in memcpy, so updated to memmove to check for this bug -- Advanced error checking mechanisms in critical pack and unpack functions -- Created option for CPU assignment to UE to improve scalability -- Added EPC integration to allow multiple individual UE entities to each have their USIM information parced by the executables -- Updated random value seeds to minimize probability of error in generation of random values -- Enables capability round robin scheduler if desired -- Enables capability real time scheduler if desired -- Added new standalone functions to the UE phy-layer (phy_stub_ue.c) to incorporate individual UE entities -- Updated sending and packing functions in UE (lte_ue.c) to incorporate new standalone changes -- Incorporated semaphores to control timing of incoming downlink packets -- Implemented new queuing system to handle message exchange from UE to eNB and vice versa -- Updated global value in nFAPI for size of subframe -- Updated global value to increase scalability in system - - # Where to Start # * [The implemented features](./doc/FEATURE_SET.md) From 241f00d17001b9590703f312cfdb8d13b1331943 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 1 Mar 2022 08:29:27 -0800 Subject: [PATCH 636/883] Adding min_rxtxtime = 6; to NSA gNB conf file --- .../conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf index 9b3f205a0f..d8485483d8 100644 --- a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf @@ -24,7 +24,7 @@ gNBs = ssb_SubcarrierOffset = 31; //0; pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; - + min_rxtxtime = 6; servingCellConfigCommon = ( { #spCellConfigCommon From 7683014c8035888f3fbcf7f78da96d6fdaac2421 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Mar 2022 18:24:57 +0100 Subject: [PATCH 637/883] Fix nr_dlsim --- openair1/SIMULATION/NR_PHY/dlsim.c | 5 +++++ openair1/SIMULATION/NR_PHY/ulsim.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index cfc7cb00b0..6b50daac2a 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -87,6 +87,9 @@ PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; +/* dummy constant */ +NR_UE_RRC_INST_t *NR_UE_rrc_inst; + double cpuf; char *uecap_file; @@ -239,6 +242,8 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, return 0; } +nr_bler_struct nr_bler_data[NR_NUM_MCS]; + void processSlotTX(void *arg) {} //nFAPI P7 dummy functions to avoid linking errors diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index aebaf42483..a685ef3dc9 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -93,6 +93,9 @@ THREAD_STRUCT thread_struct; nfapi_ue_release_request_body_t release_rntis; uint32_t N_RB_DL = 106; +/* dummy constant */ +NR_UE_RRC_INST_t *NR_UE_rrc_inst; + //Fixme: Uniq dirty DU instance, by global var, datamodel need better management instance_t DUuniqInstance=0; instance_t CUuniqInstance=0; @@ -221,6 +224,8 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP, return 0; } +nr_bler_struct nr_bler_data[NR_NUM_MCS]; + //nFAPI P7 dummy functions int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); } From 6146f44b808d9a671186e37b6d44100e79f9cba1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 1 Mar 2022 18:50:53 +0100 Subject: [PATCH 638/883] CI: log to see why RT stats checking fails --- ci-scripts/ran.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 44626dba74..9feb9b4906 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -1137,6 +1137,7 @@ class RANManagement(): #check if there is a fail => will render the test as failed for k in datalog_rt_stats['Data']: if float(datalog_rt_stats['Data'][k][2])> datalog_rt_stats['Threshold'][k]: #condition for fail : avg/ref is greater than the fixed threshold + logging.debug('\u001B[1;30;43m datalog_rt_stats metric ' + k + '=' + datalog_rt_stats['Data'][k][2] + ' > threshold ' + str(datalog_rt_stats['Threshold'][k]) + ' \u001B[0m') RealTimeProcessingIssue = True else: statMsg = 'No real time stats found in the log file\n' From bf4429196a591095c333b5a2b2c4ed29bfc661ae Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 1 Mar 2022 17:13:31 +0100 Subject: [PATCH 639/883] NR_UE: fix UL retransmission --- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 10 +++++----- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 9aa84b6704..c1624fcb8b 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -352,7 +352,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu; current_harq_pid = pusch_config_pdu->pusch_data.harq_process_id; NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch0->harq_processes[current_harq_pid]; - harq_process_ul_ue->status = 0; if (harq_process_ul_ue){ @@ -368,15 +367,16 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ if ((tx_req_body->pdu_index == i) && (tx_req_body->pdu_length > 0)) { LOG_D(PHY,"%d.%d Copying %d bytes to harq_process_ul_ue->a (harq_pid %d)\n",scheduled_response->frame,slot,tx_req_body->pdu_length,current_harq_pid); memcpy(harq_process_ul_ue->a, tx_req_body->pdu, tx_req_body->pdu_length); - harq_process_ul_ue->status = ACTIVE; - ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more - pdu_done++; - LOG_D(PHY, "%d.%d ul A ul_config %p t %d pdu_done %d number_pdus %d\n", scheduled_response->frame, slot, ul_config, pdu_type, pdu_done, ul_config->number_pdus); break; } } } + harq_process_ul_ue->status = ACTIVE; + ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more + pdu_done++; + LOG_D(PHY, "%d.%d ul A ul_config %p t %d pdu_done %d number_pdus %d\n", scheduled_response->frame, slot, ul_config, pdu_type, pdu_done, ul_config->number_pdus); + } else { LOG_E(PHY, "[phy_procedures_nrUE_TX] harq_process_ul_ue is NULL !!\n"); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 1a2e52a603..c99ff58106 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1115,7 +1115,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in tx_req.number_of_pdus = 0; for (int j = 0; j < ul_config->number_pdus; j++) { - uint8_t *ulsch_input_buffer = &(ulsch_input_buffer_array[tx_req.number_of_pdus][MAX_ULSCH_PAYLOAD_BYTES]); + uint8_t *ulsch_input_buffer = ulsch_input_buffer_array[tx_req.number_of_pdus]; fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = &ul_config->ul_config_list[j]; From d09366c50328925cf1e38a370584257e0c74d018 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Tue, 1 Mar 2022 17:39:55 +0100 Subject: [PATCH 640/883] NR_UE: correctly scale UL frequency offset (relevant for FDD) --- openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c index 6530dd9512..d3f362b90c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c @@ -86,16 +86,17 @@ void nr_rf_card_config_freq(openair0_config_t *openair0_cfg, uint8_t cc_id = 0; PHY_VARS_NR_UE *ue = PHY_vars_UE_g[mod_id][cc_id]; int rf_chain = ue->rf_map.chain; + double freq_scale = (double)(dl_carrier + freq_offset) / dl_carrier; for (int i = rf_chain; i < rf_chain + 4; i++) { if (i < openair0_cfg->rx_num_channels) - openair0_cfg->rx_freq[i + rf_chain] = dl_carrier + freq_offset; + openair0_cfg->rx_freq[i + rf_chain] = dl_carrier * freq_scale; else openair0_cfg->rx_freq[i] = 0.0; if (itx_num_channels) - openair0_cfg->tx_freq[i] = ul_carrier + freq_offset; + openair0_cfg->tx_freq[i] = ul_carrier * freq_scale; else openair0_cfg->tx_freq[i] = 0.0; From bc158e4ce4d271272f1fe9a719c8b9e6cfbc20cf Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Mar 2022 11:00:17 +0100 Subject: [PATCH 641/883] fixing asan leaks after merge --- openair1/PHY/INIT/nr_init_ue.c | 7 ++++--- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 16 +++++++--------- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_scrambling.c | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 00abc91245..cccaa9a909 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -165,9 +165,10 @@ void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch, } } -void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch) +void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch, + const NR_DL_FRAME_PARMS* fp) { - for (int i = 0; i < NR_MAX_NB_LAYERS; i++) + for (int i = 0; i < fp->nb_antennas_tx; i++) free_and_zero(pusch->txdataF_layers[i]); } @@ -513,7 +514,7 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { - phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id]); + phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id],fp); free_and_zero(ue->pusch_vars[th_id][gNB_id]); free_and_zero(ue->pucch_vars[th_id][gNB_id]); } diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index f636c8ebda..876d6cc83a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -98,7 +98,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers; uint8_t Qm = rel15->qamModOrder[0]; uint32_t encoded_length = nb_re*Qm; - uint32_t scrambled_output[rel15->NrOfCodewords][encoded_length>>5]; + uint32_t scrambled_output[rel15->NrOfCodewords][(encoded_length>>5)+1]; int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16))); /* PTRS */ @@ -120,8 +120,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, /// CRC, coding, interleaving and rate matching AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); - unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * rel15->nrOfLayers] __attribute__((aligned(32))); - bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * rel15->nrOfLayers); + unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers] __attribute__((aligned(32))); + bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers); start_meas(dlsch_encoding_stats); if (nr_dlsch_encoding(gNB, @@ -146,20 +146,18 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, } printf("\n"); #endif - - - + /// scrambling start_meas(dlsch_scrambling_stats); - for (int q=0; qNrOfCodewords; q++) - memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t)); - for (int q=0; qNrOfCodewords; q++) + for (int q=0; qNrOfCodewords; q++) { + memset((void*)scrambled_output[q], 0, ((encoded_length>>5)+1)*sizeof(uint32_t)); nr_pdsch_codeword_scrambling(output, encoded_length, q, rel15->dataScramblingId, rel15->rnti, scrambled_output[q]); + } stop_meas(dlsch_scrambling_stats); #ifdef DEBUG_DLSCH diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 836d202d29..a11dfd697d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -83,7 +83,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, for (int q=0; qmod_symbs[q]); - for (int layer = 0; layer < NR_MAX_NB_LAYERS; layer++) { + for (int layer = 0; layer < max_layers; layer++) { free(dlsch->txdataF[layer]); for (int aa = 0; aa < 64; aa++) free(dlsch->ue_spec_bf_weights[layer][aa]); diff --git a/openair1/PHY/NR_TRANSPORT/nr_scrambling.c b/openair1/PHY/NR_TRANSPORT/nr_scrambling.c index b68ad2d89f..4bbecfd994 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_scrambling.c +++ b/openair1/PHY/NR_TRANSPORT/nr_scrambling.c @@ -40,7 +40,7 @@ void nr_codeword_scrambling(uint8_t *in, __m256i c = ((__m256i*)in)[i]; uint32_t in32 = _mm256_movemask_epi8(_mm256_slli_epi16(c,7)); out[i]=(in32^s); - //printf("in[%d] %x => %x\n",i,in32,out[i]); + LOG_D(PHY,"in[%d] %x => %x\n",i,in32,out[i]); s=lte_gold_generic(&x1, &x2, 0); } #elif defined(__SSE4__) From dcbc60df6b07671436b37e68ec36ed1154fdbf72 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Mar 2022 11:57:01 +0100 Subject: [PATCH 642/883] cleanup nr ue phy init --- openair1/PHY/INIT/nr_init_ue.c | 30 ------------------- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 16 ---------- openair1/PHY/defs_nr_UE.h | 28 ----------------- 3 files changed, 74 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 930fa76908..c687e20920 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -378,7 +378,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 ); ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); @@ -396,7 +395,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) // size_t num = 7*2*fp->N_RB_DL*12; size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); - ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num); } @@ -517,37 +515,11 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) // PDSCH for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { - for (int k = 0; k < 8; k++) { //harq_pid - for (int l = 0; l < 8; l++) { //round - for (int i = 0; i < fp->nb_antennas_rx; i++) { - for (int j = 0; j < 4; j++) { //frame_parms->nb_antennas_tx; j++) - const int idx = j * fp->nb_antennas_rx + i; - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx]); - } - } - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l]); - } - } - - for (int i = 0; i < fp->nb_antennas_rx; i++) { - for (int j = 0; j < 4; j++) { - const int idx = (j*fp->nb_antennas_rx)+i; - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx]); - } - } free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts); free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]); free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]); free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext); - phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp); free_and_zero(ue->pdsch_vars[th_id][gNB_id]); } @@ -559,7 +531,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx]); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx]); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx]); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx]); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx]); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx]); } @@ -570,7 +541,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->e_rx); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext); 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 308c536efd..ddbb2be5cf 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -830,22 +830,6 @@ void nr_dlsch_deinterleaving(uint8_t symbol, uint16_t *llr_deint, uint16_t nb_rb_pdsch); -void dlsch_dual_stream_correlation(NR_DL_FRAME_PARMS *frame_parms, - unsigned char symbol, - unsigned short nb_rb, - int **dl_ch_estimates_ext, - int **dl_ch_estimates_ext_i, - int **dl_ch_rho_ext, - unsigned char output_shift); - -void dlsch_dual_stream_correlationTM34(NR_DL_FRAME_PARMS *frame_parms, - unsigned char symbol, - unsigned short nb_rb, - int **dl_ch_estimates_ext, - int **dl_ch_estimates_ext_i, - int **dl_ch_rho_ext, - unsigned char output_shift0, - unsigned char output_shift1); //This function is used to compute multiplications in Hhermitian * H matrix void conjch0_mult_ch1(int *ch0, int *ch1, diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 9d5c979cd7..59ce97b557 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -276,12 +276,6 @@ typedef struct { /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: ? [0..168*N_RB_DL[ int32_t **rxdataF_comp0; - /// \brief Received frequency-domain signal after extraction and channel compensation for the second stream. For the SIC receiver we need to store the history of this for each harq process and round - /// - first index: ? [0..7] (hard coded) accessed via \c harq_pid - /// - second index: ? [0..7] (hard coded) accessed via \c round - /// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - fourth index: ? [0..168*N_RB_DL[ - int32_t **rxdataF_comp1[8][8]; /// \brief Hold the channel estimates in frequency domain. /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[ @@ -294,12 +288,6 @@ typedef struct { /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: ? [0..168*N_RB_DL[ int32_t **dl_ch_ptrs_estimates_ext; - /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. For the SIC receiver we need to store the history of this for each harq process and round - /// - first index: ? [0..7] (hard coded) accessed via \c harq_pid - /// - second index: ? [0..7] (hard coded) accessed via \c round - /// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - fourth index: ? [0..168*N_RB_DL[ - int32_t **dl_ch_rho_ext[8][8]; /// \brief Downlink beamforming channel estimates in frequency domain. /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[ @@ -308,10 +296,6 @@ typedef struct { /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: ? [0..168*N_RB_DL[ int32_t **dl_bf_ch_estimates_ext; - /// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - int32_t **dl_ch_rho2_ext; /// \brief Downlink PMIs extracted in PRBS and grouped in subbands. /// - first index: ressource block [0..N_RB_DL[ uint8_t *pmi_ext; @@ -319,18 +303,10 @@ typedef struct { /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: ? [0..168*N_RB_DL[ int32_t **dl_ch_mag0; - /// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level). - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - int32_t **dl_ch_mag1[8][8]; /// \brief Magnitude of Downlink Channel, first layer (2nd 64QAM level). /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx /// - second index: ? [0..168*N_RB_DL[ int32_t **dl_ch_magb0; - /// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level). - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - int32_t **dl_ch_magb1[8][8]; /// \brief Magnitude of Downlink Channel, first layer (256QAM level). int32_t **dl_ch_magr0; /// \brief Cross-correlation Matrix of the gNB Tx channel signals. @@ -600,10 +576,6 @@ typedef struct { /// - second index: ? [0..168*N_RB_DL[ int32_t **dl_ch_estimates_ext; /// \brief Pointers to channel cross-correlation vectors for multi-gNB detection. - /// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx - /// - second index: ? [0..168*N_RB_DL[ - int32_t **dl_ch_rho_ext; - /// \brief Pointers to channel cross-correlation vectors for multi-gNB detection. /// - first index: rx antenna [0..nb_antennas_rx[ /// - second index: ? [0..] int32_t **rho; From 3a55cff7705cb574922f6925115abcf88269a8e0 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 2 Mar 2022 15:14:23 +0100 Subject: [PATCH 643/883] bugfix indexing for rt stats detection --- ci-scripts/ran.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 9feb9b4906..a84de792fd 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -1136,8 +1136,8 @@ class RANManagement(): self.datalog_rt_stats=datalog_rt_stats #check if there is a fail => will render the test as failed for k in datalog_rt_stats['Data']: - if float(datalog_rt_stats['Data'][k][2])> datalog_rt_stats['Threshold'][k]: #condition for fail : avg/ref is greater than the fixed threshold - logging.debug('\u001B[1;30;43m datalog_rt_stats metric ' + k + '=' + datalog_rt_stats['Data'][k][2] + ' > threshold ' + str(datalog_rt_stats['Threshold'][k]) + ' \u001B[0m') + if float(datalog_rt_stats['Data'][k][3])> datalog_rt_stats['Threshold'][k]: #condition for fail : avg/ref is greater than the fixed threshold + logging.debug('\u001B[1;30;43m datalog_rt_stats metric ' + k + '=' + datalog_rt_stats['Data'][k][3] + ' > threshold ' + str(datalog_rt_stats['Threshold'][k]) + ' \u001B[0m') RealTimeProcessingIssue = True else: statMsg = 'No real time stats found in the log file\n' From 647adcd6cea28d256d7ba9e6bea5765b95b344b3 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Mar 2022 15:48:40 +0100 Subject: [PATCH 644/883] more leaks fixed --- openair1/PHY/INIT/nr_init.c | 7 +++-- openair1/PHY/INIT/nr_init_ue.c | 29 +------------------ openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 4 +++ .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 3 ++ openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 9 ++++-- openair1/PHY/defs_nr_UE.h | 6 ---- openair1/SIMULATION/NR_PHY/dlschsim.c | 20 +++---------- 7 files changed, 23 insertions(+), 55 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index c38a6c16d9..ff3bdf3b8e 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -364,6 +364,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i]); free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i]); } + free_and_zero(gNB->nr_srs_info[id]->sc_list); free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal); free_and_zero(gNB->nr_srs_info[id]->noise_power); free_and_zero(gNB->nr_srs_info[id]->srs_received_signal); @@ -572,9 +573,10 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) { uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value; msg->num_pdsch_slot = 0; + int num_cw = NR_MAX_NB_LAYERS > 4? 2:1; for (int i=0; inumber_of_nr_dlsch_max; i++) { LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,gNB->number_of_nr_dlsch_max); - for (int j=0; j<2; j++) { + for (int j=0; jdlsch[i][j] = new_gNB_dlsch(fp,1,16,NSOFT,0,grid_size); AssertFatal(msg->dlsch[i][j]!=NULL,"Can't initialize dlsch %d \n", i); } @@ -586,8 +588,9 @@ void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; const nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; const uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value; + int num_cw = NR_MAX_NB_LAYERS > 4? 2:1; for (int i=0; inumber_of_nr_dlsch_max; i++) - for (int j=0; j<2; j++) + for (int j=0; jdlsch[i][j], grid_size, fp); } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index cccaa9a909..6ad07a77f6 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -155,23 +155,6 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp free_and_zero(pdsch->dl_ch_ptrs_estimates_ext); } -void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch, - const NR_DL_FRAME_PARMS *const fp) { - AssertFatal( pusch, "pusch==0" ); - int max_pusch_length = fp->N_RB_UL*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8*fp->nb_antennas_tx; - pusch->txdataF_layers = (int32_t **)malloc16_clear(fp->nb_antennas_tx*sizeof(int32_t *)); - for (int i=0; inb_antennas_tx; i++) { - pusch->txdataF_layers[i] = (int32_t *)malloc16_clear(max_pusch_length*sizeof(int32_t)); - } -} - -void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch, - const NR_DL_FRAME_PARMS* fp) -{ - for (int i = 0; i < fp->nb_antennas_tx; i++) - free_and_zero(pusch->txdataF_layers[i]); -} - int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) { // create shortcuts @@ -215,15 +198,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) // init NR modulation lookup tables nr_generate_modulation_table(); - /////////////////////////PUSCH init///////////////////////// - /////////// - for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { - for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { - ue->pusch_vars[th_id][gNB_id] = (NR_UE_PUSCH *)malloc16(sizeof(NR_UE_PUSCH)); - phy_init_nr_ue_PUSCH( ue->pusch_vars[th_id][gNB_id], fp ); - } - } - /////////////////////////PUCCH init///////////////////////// /////////// for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { @@ -514,8 +488,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { - phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id],fp); - free_and_zero(ue->pusch_vars[th_id][gNB_id]); free_and_zero(ue->pucch_vars[th_id][gNB_id]); } } @@ -640,6 +612,7 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->nr_srs_info->srs_estimated_channel_time[i]); free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted[i]); } + free_and_zero(ue->nr_srs_info->sc_list); free_and_zero(ue->nr_srs_info->srs_generated_signal); free_and_zero(ue->nr_srs_info->noise_power); free_and_zero(ue->nr_srs_info->srs_received_signal); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index a11dfd697d..229f59032e 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -73,6 +73,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, free(harq->c[r]); harq->c[r] = NULL; } + free(harq->c); free(harq->pdu); for (int aa = 0; aa < 64; aa++) @@ -82,6 +83,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; for (int q=0; qmod_symbs[q]); + free(dlsch->mod_symbs); for (int layer = 0; layer < max_layers; layer++) { free(dlsch->txdataF[layer]); @@ -89,6 +91,8 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, free(dlsch->ue_spec_bf_weights[layer][aa]); free(dlsch->ue_spec_bf_weights[layer]); } + free(dlsch->txdataF); + free(dlsch->ue_spec_bf_weights); free(dlsch); *dlschptr = NULL; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 7652db98c0..0e2abf40aa 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -102,7 +102,10 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) { for (int r=0; rharq_processes[i]->c[r],1056); dlsch->harq_processes[i]->c[r] = NULL; + nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]); } + free16(dlsch->harq_processes[i]->c,a_segments); + free16(dlsch->harq_processes[i]->p_nrLDPC_procBuf,a_segments); free16(dlsch->harq_processes[i],sizeof(NR_DL_UE_HARQ_t)); dlsch->harq_processes[i] = NULL; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index f7191b9b12..802cb55e03 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -114,7 +114,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, LOG_D(PHY,"nr_ue_ulsch_procedures hard_id %d %d.%d\n",harq_pid,frame,slot); uint32_t available_bits; - int16_t **tx_layers; int32_t **txdataF; int8_t Wf[2], Wt[2]; int l_prime[2], delta; @@ -123,7 +122,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, int sample_offsetF, N_RE_prime; NR_DL_FRAME_PARMS *frame_parms = &UE->frame_parms; - NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id]; int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig uint16_t number_dmrs_symbols = 0; @@ -253,7 +251,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, /////////////////////////ULSCH layer mapping///////////////////////// /////////// - tx_layers = (int16_t **)pusch_ue->txdataF_layers; + int16_t **tx_layers = (int16_t **)malloc16_clear(Nl*sizeof(int16_t *)); + for (int nl=0; nl4 ? 2:1]; // two RxTx Threads NR_UE_ULSCH_t *ulsch[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX]; diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 277a7dae7e..d6812dd541 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -395,19 +395,6 @@ int main(int argc, char **argv) load_pbch_desc(pbch_file_fd); } - /* for (int k=0; k<2; k++) { - // Create transport channel structures for 2 transport blocks (MIMO) - for (i=0; i<2; i++) { - gNB->dlsch[k][i] = new_gNB_dlsch(Kmimo,8,Nsoft,0,frame_parms,gNB_config); - - if (!gNB->dlsch[k][i]) { - printf("Can't get eNB dlsch structures\n"); - exit(-1); - } - gNB->dlsch[k][i]->Nsoft = 10; - gNB->dlsch[k][i]->rnti = n_rnti+k; - } - }*/ //configure UE UE = malloc(sizeof(PHY_VARS_NR_UE)); memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS)); @@ -434,8 +421,8 @@ int main(int argc, char **argv) } unsigned char harq_pid = 0; //dlsch->harq_ids[subframe]; - processingData_L1tx_t msgDataTx; - init_DLSCH_struct(gNB, &msgDataTx); + processingData_L1tx_t msgDataTx; + init_DLSCH_struct(gNB, &msgDataTx); NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0]; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15; //time_stats_t *rm_stats, *te_stats, *i_stats; @@ -642,8 +629,9 @@ int main(int argc, char **argv) free(RC.gNB[0]); free(RC.gNB); + int num_cw = NR_MAX_NB_LAYERS > 4? 2:1; for (int sf = 0; sf < 2; sf++) - for (int i = 0; i < 2; i++) + for (int i = 0; i < num_cw; i++) free_nr_ue_dlsch(&UE->dlsch[sf][0][i], N_RB_DL); term_nr_ue_signal(UE, 1); free(UE); From c36c8ccae05f04067c2d795f0161bec64d21f06e Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Mar 2022 18:54:35 +0100 Subject: [PATCH 645/883] addressing additional review and some wrong allocation --- executables/nr-gnb.c | 1 - openair1/PHY/INIT/nr_init.c | 34 ++++++++++++++++++++---------- openair1/PHY/INIT/nr_init_ue.c | 23 ++++---------------- openair1/PHY/defs_gNB.h | 1 + openair1/SIMULATION/NR_PHY/dlsim.c | 5 ++--- openair2/GNB_APP/gnb_paramdef.h | 6 +++--- 6 files changed, 33 insertions(+), 37 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index caa5a52014..dbe1075884 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -512,7 +512,6 @@ void init_eNB_afterRU(void) { gNB = RC.gNB[inst]; phy_init_nr_gNB(gNB,0,0); - init_codebook_gNB(gNB); // map antennas and PRACH signals to gNB RX if (0) AssertFatal(gNB->num_RU>0,"Number of RU attached to gNB %d is zero\n",gNB->Mod_id); diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 9c466f9574..358fb54aeb 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -144,8 +144,8 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Table 5.2.2.2.1-5: //Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS - int pmiq_size = N1*O1*N2*O2*4+1; - mat[0] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + gNB->pmiq_size[0] = N1*O1*N2*O2*4+1; + mat[0] = (int32_t **)malloc16(gNB->pmiq_size[0]*sizeof(int32_t *)); //pmi=0 corresponds to unit matrix mat[0][0] = (int32_t *)calloc(2*N1*N2,sizeof(int32_t)); @@ -202,19 +202,19 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Compute the code book size for generating 2 layers out of Tx antenna ports //pmi_size is computed as follows - pmiq_size = 1;//1 for unity matrix + gNB->pmiq_size[1] = 1;//1 for unity matrix for(int llb=0; llbpmiq_size[1] += 1; } } } } } - mat[1] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + mat[1] = (int32_t **)malloc16(gNB->pmiq_size[1]*sizeof(int32_t *)); //pmi=0 corresponds to unit matrix mat[1][0] = (int32_t *)calloc((2*N1*N2)*(2),sizeof(int32_t)); @@ -287,19 +287,19 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { if(max_mimo_layers>=3) { //pmi_size is computed as follows - pmiq_size = 1;//unity matrix + gNB->pmiq_size[2] = 1;//unity matrix for(int llb=0; llbpmiq_size[2] += 1; } } } } } - mat[2] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + mat[2] = (int32_t **)malloc16(gNB->pmiq_size[2]*sizeof(int32_t *)); //pmi=0 corresponds to unit matrix mat[2][0] = (int32_t *)calloc((2*N1*N2)*(3),sizeof(int32_t)); for(int j_col=0; j_col<3; j_col++) { //3 layers @@ -376,20 +376,20 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { //Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS if(max_mimo_layers>=4) { //pmi_size is computed as follows - pmiq_size = 1;//unity matrix + gNB->pmiq_size[3] = 1;//unity matrix for(int llb=0; llbpmiq_size[3] += 1; } } } } } - mat[3] = (int32_t **)malloc16(pmiq_size*sizeof(int32_t *)); + mat[3] = (int32_t **)malloc16(gNB->pmiq_size[3]*sizeof(int32_t *)); //pmi=0 corresponds to unit matrix mat[3][0] = (int32_t *)calloc((2*N1*N2)*(4),sizeof(int32_t)); for(int j_col=0; j_col<4; j_col++) { //4 layers @@ -509,6 +509,9 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, init_scrambling_luts(); init_pucch2_luts(); load_nrLDPClib(NULL); + + init_codebook_gNB(gNB); + // PBCH DMRS gold sequences generation nr_init_pbch_dmrs(gNB); //PDCCH DMRS init @@ -706,6 +709,15 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB() const int n_buf = Prx * max_ul_mimo_layers; + int max_dl_mimo_layers =(fp->nb_antennas_txnb_antennas_tx : NR_MAX_NB_LAYERS; + for (int nl = 0; nl < max_dl_mimo_layers; nl++) { + for(int size = 0; size < gNB->pmiq_size[nl]; size++) { + free_and_zero(gNB->nr_mimo_precoding_matrix[nl][size]); + } + free_and_zero(gNB->nr_mimo_precoding_matrix[nl]); + } + free_and_zero(gNB->nr_mimo_precoding_matrix); + uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs; for (int slot = 0; slot < fp->slots_per_frame; slot++) { for (int symb = 0; symb < fp->symbols_per_slot; symb++) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index c687e20920..6a3c5c765c 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -59,7 +59,6 @@ void phy_init_nr_ue_PDSCH(NR_UE_PDSCH *const pdsch, const NR_DL_FRAME_PARMS *const fp) { AssertFatal( pdsch, "pdsch==0" ); - //pdsch->layer_llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) ); pdsch->llr128 = (int16_t **)malloc16_clear( sizeof(int16_t *) ); // FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV // FK, 11-3-2015: this is only as a temporary pointer, no memory is stored there @@ -130,8 +129,10 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp free_and_zero(pdsch->rho[i]); } free_and_zero(pdsch->pmi_ext); - free_and_zero(pdsch->llr[0]); - free_and_zero(pdsch->layer_llr[0]); + for (int i=0; illr[i]); + for (int i=0; ilayer_llr[i]); free_and_zero(pdsch->llr128); free_and_zero(pdsch->rxdataF_ext); free_and_zero(pdsch->rxdataF_uespec_pilots); @@ -426,13 +427,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64); } - // initialization for the last instance of pdsch_vars (used for MU-MIMO) - for (th_id=0; th_idpdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH)); - ue->pdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); - ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t)); - } - ue->sinr_CQI_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) ); ue->init_averaging = 1; @@ -517,8 +511,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]); free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream); phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp); free_and_zero(ue->pdsch_vars[th_id][gNB_id]); @@ -594,13 +586,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->prach_vars[gNB_id]); } - const int gNB_id = ue->n_connected_gNB; - for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]); - free_and_zero(ue->pdsch_vars[th_id][gNB_id]); - } - free_and_zero(ue->sinr_CQI_dB); } diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index cf1da93c70..a849c5a0f2 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -807,6 +807,7 @@ typedef struct PHY_VARS_gNB_s { /// second dimension: PMI [0,...,CodeSize-1[ /// third dimension: [i_rows*noOfLayers+j_col], i_rows=0,...pdsch_AntennaPorts-1 and j_col=0,...,noOfLayers-1 int32_t ***nr_mimo_precoding_matrix; + int pmiq_size[NR_MAX_NB_LAYERS]; /// PUSCH DMRS uint32_t ****nr_gold_pusch_dmrs; diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 7f966380db..a106dab20a 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -785,9 +785,9 @@ int main(int argc, char **argv) prepare_scd(scd); rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts; - pdsch_AntennaPorts.N1 = n_tx; + pdsch_AntennaPorts.N1 = n_tx>1 ? n_tx>>1 : 1; pdsch_AntennaPorts.N2 = 1; - pdsch_AntennaPorts.XP = 1; + pdsch_AntennaPorts.XP = n_tx>1 ? 2 : 1; gNB->ap_N1 = pdsch_AntennaPorts.N1; gNB->ap_N2 = pdsch_AntennaPorts.N2; gNB->ap_XP = pdsch_AntennaPorts.XP; @@ -819,7 +819,6 @@ int main(int argc, char **argv) // rrc_mac_config_req_gNB gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; phy_init_nr_gNB(gNB,0,1); - init_codebook_gNB(gNB); N_RB_DL = gNB->frame_parms.N_RB_DL; NR_UE_info_t *UE_info = &RC.nrmac[0]->UE_info; UE_info->num_UEs=1; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index dc319fbccf..d3a0218a0f 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -146,9 +146,9 @@ typedef enum { {GNB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {GNB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N1, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N2, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_XP, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N1, "horiz. log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N2, "vert. log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_XP, "XP log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ From e0acdf6d67bd95ec9fe72018d38113940a9d3acc Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Mar 2022 08:59:13 +0100 Subject: [PATCH 646/883] missing condition on free nr_mimo_precoding_matrix --- openair1/PHY/INIT/nr_init.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 358fb54aeb..913fafc291 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -710,13 +710,14 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) const int n_buf = Prx * max_ul_mimo_layers; int max_dl_mimo_layers =(fp->nb_antennas_txnb_antennas_tx : NR_MAX_NB_LAYERS; - for (int nl = 0; nl < max_dl_mimo_layers; nl++) { - for(int size = 0; size < gNB->pmiq_size[nl]; size++) { - free_and_zero(gNB->nr_mimo_precoding_matrix[nl][size]); + if (fp->nb_antennas_tx>1) { + for (int nl = 0; nl < max_dl_mimo_layers; nl++) { + for(int size = 0; size < gNB->pmiq_size[nl]; size++) + free_and_zero(gNB->nr_mimo_precoding_matrix[nl][size]); + free_and_zero(gNB->nr_mimo_precoding_matrix[nl]); } - free_and_zero(gNB->nr_mimo_precoding_matrix[nl]); + free_and_zero(gNB->nr_mimo_precoding_matrix); } - free_and_zero(gNB->nr_mimo_precoding_matrix); uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs; for (int slot = 0; slot < fp->slots_per_frame; slot++) { From f2314ff6a746ebad97b385ccc06bdc0ea810b972 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Mar 2022 11:29:06 +0100 Subject: [PATCH 647/883] logs --- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index abcdae5a33..beee2ed862 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -117,7 +117,7 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, reset = 1; x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid<<1)+1) +((N_n_scid<<1)+n_scid)); - + LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",slot,symb,x2); for (n=0; n Date: Thu, 3 Mar 2022 13:55:02 +0100 Subject: [PATCH 648/883] bugfix for pusch --- openair1/PHY/INIT/nr_init_ue.c | 4 ++-- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 8 +++----- openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index a27c541c80..af06935e52 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -242,10 +242,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) AssertFatal(pusch_dmrs[slot]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d - malloc failed\n", slot); for (symb=0; symbsymbols_per_slot; symb++) { - pusch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *)); + pusch_dmrs[slot][symb] = (uint32_t **)malloc16(2*sizeof(uint32_t *)); AssertFatal(pusch_dmrs[slot][symb]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); - for (q=0; qframe_parms; uint32_t ****pusch_dmrs = ue->nr_gold_pusch_dmrs; @@ -119,12 +119,10 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid<<1)+1) +((N_n_scid<<1)+n_scid)); LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",slot,symb,x2); for (n=0; nscid], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated } else { dmrs_idx = 0; @@ -408,7 +408,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE, if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols)) { is_ptrs_sym = 1; - nr_modulation(pusch_dmrs[l][0], nb_rb, DMRS_MOD_ORDER, mod_ptrs); + nr_modulation(pusch_dmrs[l][pusch_pdu->scid], nb_rb, DMRS_MOD_ORDER, mod_ptrs); } } From 29fa47467340d703f532a1bd8e32fa3753daca50 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 3 Mar 2022 16:37:58 +0100 Subject: [PATCH 649/883] Correctly reconfigure nrofHARQ processes --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 938b9f2584..febe6cde9f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1943,7 +1943,6 @@ void create_nr_list(NR_list_t *list, int len) { list->head = -1; list->next = malloc(len * sizeof(*list->next)); - LOG_W(NR_MAC, "NR list->next %p\n", list->next); AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n"); for (int i = 0; i < len; ++i) list->next[i] = -1; @@ -2278,8 +2277,16 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); + } else if (sched_ctrl->available_dl_harq.len == nrofHARQ) { + LOG_D(NR_MAC, "nrofHARQ %d already configured\n", nrofHARQ); } else { + const int old_nrofHARQ = sched_ctrl->available_dl_harq.len; + AssertFatal(nrofHARQ > old_nrofHARQ, + "cannot resize HARQ list to be smaller (nrofHARQ %d, old_nrofHARQ %d)\n", + nrofHARQ, old_nrofHARQ); resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ); + for (int harq = old_nrofHARQ; harq < nrofHARQ; harq++) + add_tail_nr_list(&sched_ctrl->available_dl_harq, harq); resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ); resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ); } From 38ad1237148d9b171b7ad26c43cf5b9d96485145 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Mar 2022 17:50:57 +0100 Subject: [PATCH 650/883] fix for VRB map occupation for PRACH --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 8b5e1857a7..486c5d0763 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -389,7 +389,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP const int16_t N_RA_RB = get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, mu_pusch); uint16_t *vrb_map_UL = &cc->vrb_map_UL[slotP * MAX_BWP_SIZE]; for (int i = 0; i < N_RA_RB * fdm; ++i) - vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] = 0x3fff; // all symbols + vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] = SL_to_bitmap(start_symbol, N_t_slot*N_dur); } } } From f9cebbdebbb48e7c8f0caf42fc2ba694dc68b31c Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Mar 2022 18:34:09 +0100 Subject: [PATCH 651/883] bugfix for dl_dmrs_config in SA --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 12 +++++++----- 1 file changed, 7 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 8a9ea85f15..d2fd64667a 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -865,12 +865,14 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr } int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_0->start_symbol <= 3)? typeA: typeB); - struct NR_DMRS_DownlinkConfig *dl_dmrs_config = (mappingtype == typeA) ? - mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup : - mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup; + struct NR_DMRS_DownlinkConfig *dl_dmrs_config = NULL; + if(mac->DLbwp[0]) + dl_dmrs_config = (mappingtype == typeA) ? + mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup : + mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup; dlsch_config_pdu_1_0->nscid = 0; - if(mac->DLbwp[0] && dl_dmrs_config->scramblingID0) + if(dl_dmrs_config && dl_dmrs_config->scramblingID0) dlsch_config_pdu_1_0->dlDmrsScramblingId = *dl_dmrs_config->scramblingID0; else dlsch_config_pdu_1_0->dlDmrsScramblingId = mac->physCellId; @@ -881,7 +883,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr dlsch_config_pdu_1_0->number_symbols, dlsch_config_pdu_1_0->start_symbol, mappingtype, 1); - dlsch_config_pdu_1_0->dmrsConfigType = (mac->DLbwp[0] != NULL) ? + dlsch_config_pdu_1_0->dmrsConfigType = (dl_dmrs_config != NULL) ? (dl_dmrs_config->dmrs_Type == NULL ? 0 : 1) : 0; /* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */ From 7e0757fb488ebad535ae350acf7ab827194deec7 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 3 Mar 2022 15:46:54 -0800 Subject: [PATCH 652/883] Addressing MR review comments - OPENAIR_DIR replaced with AWGN_RESULTS_DIR - Copying UCI_2_3_4 PDU with rx'd PDU from proxy - Reverting hacks/whitespace changes --- executables/nr-uesoftmodem.c | 47 ++++++++----------- nfapi/oai_integration/nfapi_vnf.c | 3 +- oaienv | 1 + .../bler_tx1_chan18_nrx1_mcs28.csv | 21 +++++++++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 6 +-- 5 files changed, 45 insertions(+), 33 deletions(-) create mode 100644 openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs28.csv diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index c1c64ef913..bbe10b3d6d 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -156,7 +156,7 @@ uint32_t N_RB_DL = 106; /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed * this is very hackish - find a proper solution */ -uint8_t abstraction_flag = 0; +uint8_t abstraction_flag=0; nr_bler_struct nr_bler_data[NR_NUM_MCS]; @@ -552,50 +552,43 @@ int main( int argc, char **argv ) { } // Read in each MCS file and build BLER-SINR-TB table -static void init_bler_table(void) -{ - const char *openair_dir = getenv("OPENAIR_DIR"); - if (!openair_dir) - { - LOG_E(MAC, "No $OPENAIR_DIR\n"); - abort(); +static void init_bler_table(void) { + memset(nr_bler_data, 0, sizeof(nr_bler_data)); + + const char *awgn_results_dir = getenv("AWGN_RESULTS_DIR"); + if (!awgn_results_dir) { + LOG_W(NR_MAC, "No $AWGN_RESULTS_DIR\n"); + return; } - for (unsigned int i = 0; i < NR_NUM_MCS; i++) - { + for (unsigned int i = 0; i < NR_NUM_MCS; i++) { char fName[1024]; - snprintf(fName, sizeof(fName), "%s/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/mcs%d_awgn_5G.csv", openair_dir, i); + snprintf(fName, sizeof(fName), "%s/mcs%d_awgn_5G.csv", awgn_results_dir, i); FILE *pFile = fopen(fName, "r"); - if (!pFile) - { - LOG_E(MAC, "Bler File ERROR! - fopen(), file: %s\n", fName); - abort(); + if (!pFile) { + LOG_E(NR_MAC, "%s: open %s: %s\n", __func__, fName, strerror(errno)); + continue; } size_t bufSize = 1024; char * line = NULL; char * token; char * temp = NULL; int nlines = 0; - while (getline(&line, &bufSize, pFile) > 0) - { - if (!strncmp(line, "SNR", 3)) - { + while (getline(&line, &bufSize, pFile) > 0) { + if (!strncmp(line, "SNR", 3)) { continue; } - if (nlines > NUM_SINR) - { - LOG_E(MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName); + if (nlines > NUM_SINR) { + LOG_E(NR_MAC, "BLER FILE ERROR - num lines greater than expected - file: %s\n", fName); abort(); } token = strtok_r(line, ";", &temp); int ncols = 0; - while (token != NULL) - { - if (ncols > NUM_BLER_COL) - { - LOG_E(MAC, "BLER FILE ERROR - num of cols greater than expected\n"); + while (token != NULL) { + if (ncols > NUM_BLER_COL) { + LOG_E(NR_MAC, "BLER FILE ERROR - num of cols greater than expected\n"); abort(); } diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 56ad438e0e..d19d2db597 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -787,8 +787,8 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) if (ind_pdu->harq) { uci_ind_pdu->harq = CALLOC(1, sizeof(*uci_ind_pdu->harq)); AssertFatal(uci_ind_pdu->harq != NULL, "Memory not allocated for uci_ind_pdu->harq in phy_nr_uci_indication."); - *uci_ind_pdu->harq = *ind_pdu->harq; + uci_ind_pdu->harq->harq_list = CALLOC(uci_ind_pdu->harq->num_harq, sizeof(*uci_ind_pdu->harq->harq_list)); AssertFatal(uci_ind_pdu->harq->harq_list != NULL, "Memory not allocated for uci_ind_pdu->harq->harq_list in phy_nr_uci_indication."); for (int j = 0; j < uci_ind_pdu->harq->num_harq; j++) @@ -800,6 +800,7 @@ int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_2_3_4; nfapi_nr_uci_pucch_pdu_format_2_3_4_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_2_3_4; + *uci_ind_pdu = *ind_pdu; if (ind_pdu->harq.harq_payload) { uci_ind_pdu->harq.harq_payload = CALLOC(1, sizeof(*uci_ind_pdu->harq.harq_payload)); AssertFatal(uci_ind_pdu->harq.harq_payload != NULL, "Memory not allocated for uci_ind_pdu->harq.harq_payload in phy_nr_uci_indication."); diff --git a/oaienv b/oaienv index f8ef707c12..bb24469703 100644 --- a/oaienv +++ b/oaienv @@ -1,6 +1,7 @@ export OPENAIR_HOME=$(pwd) export OPENAIR_DIR=$(pwd) +export AWGN_RESULTS_DIR=$OPENAIR_DIR/openair1/SIMULATION/NR_PHY/BLER_SIMULATIONS/AWGN/AWGN_results export OPENAIR1_DIR=$OPENAIR_HOME/openair1 export OPENAIR2_DIR=$OPENAIR_HOME/openair2 export OPENAIR3_DIR=$OPENAIR_HOME/openair3 diff --git a/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs28.csv b/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs28.csv new file mode 100644 index 0000000000..11771acc87 --- /dev/null +++ b/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs28.csv @@ -0,0 +1,21 @@ +SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err +16.000000;27;15840;0.704000;5002;5002;0;0;0;0;0;0;0 +16.100000;27;15840;0.704000;5002;5002;0;0;0;0;0;0;0 +16.200000;27;15840;0.704000;5002;5002;0;0;0;0;0;0;0 +16.300000;27;15840;0.704000;5002;5002;0;0;0;0;0;0;0 +16.400000;27;15840;0.704000;4999;5002;0;0;0;0;0;0;0 +16.500000;27;15840;0.704000;4981;5002;0;0;0;0;0;0;0 +16.600000;27;15840;0.704000;4887;5002;0;0;0;0;0;0;0 +16.700000;27;15840;0.704000;4688;5002;0;0;0;0;0;0;0 +16.800000;27;15840;0.704000;4176;5002;0;0;0;0;0;0;0 +16.900000;27;15840;0.704000;3340;5002;0;0;0;0;0;0;0 +17.000000;27;15840;0.704000;2386;5002;0;0;0;0;0;0;0 +17.100000;27;15840;0.704000;1510;5002;0;0;0;0;0;0;0 +17.200000;27;15840;0.704000;1000;5552;0;0;0;0;0;0;0 +17.300000;27;15840;0.704000;926;10000;0;0;0;0;0;0;0 +17.400000;27;15840;0.704000;516;10000;0;0;0;0;0;0;0 +17.500000;27;15840;0.704000;287;10000;0;0;0;0;0;0;0 +17.600000;27;15840;0.704000;198;10000;0;0;0;0;0;0;0 +17.700000;27;15840;0.704000;135;10000;0;0;0;0;0;0;0 +17.800000;27;15840;0.704000;102;10000;0;0;0;0;0;0;0 +17.900000;27;15840;0.704000;94;10000;0;0;0;0;0;0;0 diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 94b8aadcfb..cfff41a6ad 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1650,13 +1650,9 @@ int nr_acknack_scheduling(int mod_id, /* we need to find a new PUCCH occasion */ /*(Re)Inizialization of timing information*/ - /* TODO: This is something of a hack. The last condition in the - if statement below was added. OAI is looking into this and is - expected to provide a solution. Without the hack, the gNB will - incorrectly schedule more than 2 ACK/nACKs in a single SFN/Slot. */ if ((pucch->frame == 0 && pucch->ul_slot == 0) || ((pucch->frame*n_slots_frame + pucch->ul_slot) < - (frame * n_slots_frame + slot)) && (frame != 1023)) { + (frame*n_slots_frame + slot))) { AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); From bc2246a5669d97e92be5548a626c03a6e1ce4299 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 4 Mar 2022 09:21:02 +0100 Subject: [PATCH 653/883] Remove usage of MSC library after last merge --- openair2/RRC/NR/rrc_gNB.c | 10 ---------- openair2/RRC/NR/rrc_gNB_NGAP.c | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 28d0ced571..0a30569b81 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1169,16 +1169,6 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( LOG_D(NR_RRC, "[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n", ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_RRC_UE, - buffer, - size, - MSC_AS_TIME_FMT" dedicated RRCReconfiguration UE %x MUI %d size %u", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_context.rnti, - rrc_gNB_mui, - size); #ifdef ITTI_SIM MessageDef *message_p; diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 59ace94cc0..4286ea0d62 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -1307,16 +1307,6 @@ rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP( if (pdu_sessions_done > 0 || pdu_sessions_failed > 0) { LOG_D(NR_RRC,"NGAP_PDUSESSION_MODIFY_RESP: sending the message: nb_of_pdusessions %d, total pdu session %d, index %d\n", ue_context_pP->ue_context.nb_of_modify_pdusessions, ue_context_pP->ue_context.setup_pdu_sessions, i); - MSC_LOG_TX_MESSAGE( - MSC_RRC_GNB, - MSC_NGAP_GNB, - (const char *)&NGAP_PDUSESSION_MODIFY_RESP(msg_p), - sizeof(ngap_pdusession_modify_resp_t), - MSC_AS_TIME_FMT" PDUSESSION_MODIFY_RESP UE %X gNB_ue_ngap_id %u pdu_sessions:%u succ %u fail", - MSC_AS_TIME_ARGS(ctxt_pP), - ue_context_pP->ue_id_rnti, - NGAP_PDUSESSION_MODIFY_RESP(msg_p).gNB_ue_ngap_id, - pdu_sessions_done, pdu_sessions_failed); itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p); } else { itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); From 41635fafd71575df266e6c8c46bf147dad14c7d3 Mon Sep 17 00:00:00 2001 From: matzakos Date: Fri, 4 Mar 2022 13:09:06 +0100 Subject: [PATCH 654/883] Remove redundant BWP conf. parameters in CU/DU configuration files --- ci-scripts/conf_files/gNB_SA_CU.conf | 24 +------------------ ci-scripts/conf_files/gNB_SA_DU.conf | 24 +------------------ .../PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf | 24 +------------------ .../PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 24 +------------------ 4 files changed, 4 insertions(+), 92 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf index 1e84e479bc..39c9a43ad4 100644 --- a/ci-scripts/conf_files/gNB_SA_CU.conf +++ b/ci-scripts/conf_files/gNB_SA_CU.conf @@ -84,17 +84,8 @@ gNBs = # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -149,19 +140,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index 95fa75bc1d..c30805a2d9 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -76,17 +76,8 @@ gNBs = # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -141,19 +132,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf index 5e8527b4d1..c07a0db649 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf @@ -84,17 +84,8 @@ gNBs = # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -149,19 +140,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 95fa75bc1d..c30805a2d9 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -76,17 +76,8 @@ gNBs = # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; #pdcch-ConfigCommon - initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPcontrolResourceSetZero = 11; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL @@ -141,19 +132,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; From ce9229a1d2ea28414ab27b49cc2210038195856d Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 28 Feb 2022 15:32:11 +0100 Subject: [PATCH 655/883] change log rotation concept for module UE --- ci-scripts/cls_log_mgt.py | 65 ++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/ci-scripts/cls_log_mgt.py b/ci-scripts/cls_log_mgt.py index cf7b91d3c0..905a105512 100644 --- a/ci-scripts/cls_log_mgt.py +++ b/ci-scripts/cls_log_mgt.py @@ -30,11 +30,15 @@ - +import logging import re import subprocess -import logging -import math +import sshconnection + +logging.basicConfig( + level=logging.DEBUG, + format="[%(asctime)s] %(name)s:%(levelname)s: %(message)s" +) class Log_Mgt: @@ -49,40 +53,25 @@ class Log_Mgt: #-----------------$ - def __CheckAvailSpace(self): + def __CheckUsedSpace(self): HOST=self.Username+'@'+self.IPAddress COMMAND="df "+ self.path ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) result = ssh.stdout.readlines() s=result[1].decode('utf-8').rstrip()#result[1] is the second line with the results we are looking for - tmp=s.split() - return tmp[3] #return avail space from the line + used=s.split()[4] #get 4th field ex: 70% + m = re.match('^(\d+)\%',used) + if m is not None: + return int(m.group(1)) - def __GetOldestFile(self): - HOST=self.Username+'@'+self.IPAddress - COMMAND="ls -rtl "+ self.path #-rtl will bring oldest file on top - ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - result = ssh.stdout.readlines() - s=result[1].decode('utf-8').rstrip() - tmp=s.split() - return tmp[8]#return filename from the line + def __RemoveOldest(self): + mySSH = sshconnection.SSHConnection() + mySSH.open(self.IPAddress, self.Username, self.Password) + COMMAND='echo ' + self.Password + ' | sudo -S find ' + self.path + ' -type f -mtime +14 -delete' + mySSH.command(COMMAND,'\$',20) + mySSH.close() - def __AvgSize(self): - HOST=self.Username+'@'+self.IPAddress - COMMAND="ls -rtl "+ self.path - ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - result = ssh.stdout.readlines() - if len(result)>1: #at least 1 file present - total_size=0 - for i in range(1,len(result)): - s=result[i].decode('utf-8').rstrip() - tmp=s.split() - total_size+=int(tmp[4]) #get filesize - return math.floor(total_size/(len(result)-1)) #compute average file/artifact size - else:#empty,no files - return 0 - #-----------------$ #PUBLIC Methods$ @@ -90,17 +79,15 @@ class Log_Mgt: def LogRotation(self): - avail_space =int(self.__CheckAvailSpace())*1000 #avail space in target folder, initially displayed in Gb - avg_size=self.__AvgSize() #average size of artifacts in the target folder - logging.debug("Avail Space : " + str(avail_space) + " / Artifact Avg Size : " + str(avg_size)) - if avail_space < 50*avg_size: #reserved space is 50x artifact file ; oldest file will be deleted - oldestfile=self.__GetOldestFile() - HOST=self.Username+'@'+self.IPAddress - COMMAND="echo " + self.Password + " | sudo -S rm "+ self.path + "/" + oldestfile - logging.debug(COMMAND) - ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) + used_space = self.__CheckUsedSpace() #avail space in target folder + if used_space > 80 : + logging.debug('\u001B[1;37;41m Used Disk > 80%, on ' + self.Username+'@'+self.IPAddress + '\u001B[0m') + logging.debug('\u001B[1;37;41m Removing Artifacts older than 14 days \u001B[0m') + self.__RemoveOldest() else: - logging.debug("Still some space left for artifacts storage") + logging.debug('Used Disk < 80%, on ' + self.Username+'@'+self.IPAddress +', no cleaning required') + + From 0e85b51f7628551c524600a84fb618609a142d74 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 4 Mar 2022 14:15:58 +0000 Subject: [PATCH 656/883] Creation of get_dl_bwp_genericParameters and get_ul_bwp_genericParameters functions to avoid replicated code --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 55 +++++------------ .../NR_MAC_gNB/gNB_scheduler_primitives.c | 52 ++++++++++------ .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 24 ++------ .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 60 +++++-------------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 8 +++ 5 files changed, 77 insertions(+), 122 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 8e4ad8b3f6..0089d83fa5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -573,15 +573,9 @@ bool allocate_dl_retransmission(module_id_t module_id, cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; - NR_BWP_t *genericParameters = NULL; - if(sched_ctrl->active_bwp) { - genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; - } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) { - genericParameters = &RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp, + RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -828,15 +822,9 @@ void pf_dl(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const uint16_t rnti = UE_info->rnti[UE_id]; - NR_BWP_t *genericParameters = NULL; - if(sched_ctrl->active_bwp) { - genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; - } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) { - genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp, + RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -975,15 +963,9 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); - NR_BWP_t *genericParameters = NULL; - if(sched_ctrl->active_bwp) { - genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; - } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) { - genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp, + RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); NR_BWP_DownlinkDedicated_t *bwpd = UE_info->CellGroup[UE_id] && @@ -1158,25 +1140,16 @@ void nr_schedule_ue_spec(module_id_t module_id, sched_ctrl->tpc1); NR_BWP_Downlink_t *bwp = sched_ctrl->active_bwp; - - /* look up the PDCCH PDU for this CC, BWP, and CORESET. If it does not - * exist, create it */ - - // BWP - NR_BWP_t *genericParameters = NULL; - if(bwp) { - genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; - } else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) { - genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(bwp, + RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space : gNB_mac->sched_ctrlCommon->search_space; const int bwpid = bwp ? bwp->bwp_Id : 0; const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId; + + /* look up the PDCCH PDU for this CC, BWP, and CORESET. If it does not exist, create it */ nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][coresetid]; if (!pdcch_pdu) { LOG_D(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n"); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index f4a4176bac..dc5ce1bd5b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -226,6 +226,34 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { } } +NR_BWP_t *get_dl_bwp_genericParameters(NR_BWP_Downlink_t *active_bwp, + NR_ServingCellConfigCommon_t *ServingCellConfigCommon, + NR_SIB1_t *sib1) { + NR_BWP_t *genericParameters = NULL; + if (active_bwp) { + genericParameters = &active_bwp->bwp_Common->genericParameters; + } else if (ServingCellConfigCommon) { + genericParameters = &ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters; + } else { + genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters; + } + return genericParameters; +} + +NR_BWP_t *get_ul_bwp_genericParameters(NR_BWP_Uplink_t *active_ubwp, + NR_ServingCellConfigCommon_t *ServingCellConfigCommon, + NR_SIB1_t *sib1) { + NR_BWP_t *genericParameters = NULL; + if (active_ubwp) { + genericParameters = &active_ubwp->bwp_Common->genericParameters; + } else if (ServingCellConfigCommon) { + genericParameters = &ServingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP->genericParameters; + } else { + genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; + } + return genericParameters; +} + NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_ServingCellConfigCommon_t *scc, void *bwp, @@ -936,15 +964,9 @@ void config_uldci(module_id_t module_id, int n_ubwp, int bwp_id) { - NR_BWP_t *genericParameters = NULL; - if(ubwp) { - genericParameters = &ubwp->bwp_Common->genericParameters; - } else if(scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters((NR_BWP_Uplink_t *)ubwp, + (NR_ServingCellConfigCommon_t *)scc, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); const int bw = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -1149,15 +1171,9 @@ void nr_configure_pucch(module_id_t module_id, else pucch_pdu->hopping_id = *scc->physCellId; - NR_BWP_t *genericParameters = NULL; - if (bwp) { - genericParameters = &bwp->bwp_Common->genericParameters; - } else if (scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(bwp, + scc, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); pucch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index e05318f6f0..85ad214b41 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -742,15 +742,9 @@ void nr_csi_meas_reporting(int Mod_idP, curr_pucch->csi_bits += nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id); - NR_BWP_t *genericParameters = NULL; - if(sched_ctrl->active_ubwp) { - genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; - } else if(scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[Mod_idP]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, + scc, + RC.nrmac[Mod_idP]->common_channels[0].sib1 ? RC.nrmac[Mod_idP]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); @@ -1762,15 +1756,9 @@ int nr_acknack_scheduling(int mod_id, pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; } - NR_BWP_t *genericParameters = NULL; - if(sched_ctrl->active_ubwp) { - genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; - } else if(scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[mod_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, + (NR_ServingCellConfigCommon_t *)scc, + RC.nrmac[mod_id]->common_channels[0].sib1 ? RC.nrmac[mod_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 70f5c075ac..0df1f9d2ce 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -990,15 +990,9 @@ bool allocate_ul_retransmission(module_id_t module_id, cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; - NR_BWP_t *genericParameters = NULL; - if (sched_ctrl->active_ubwp) { - genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; - } else if (scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, + (NR_ServingCellConfigCommon_t *)scc, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); int rbStart = 0; // wrt BWP start const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -1163,15 +1157,9 @@ void pf_ul(module_id_t module_id, LOG_D(NR_MAC,"pf_ul: preparing UL scheduling for UE %d\n",UE_id); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - NR_BWP_t *genericParameters = NULL; - if (sched_ctrl->active_ubwp) { - genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; - } else if (scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, + scc, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); int rbStart = 0; // wrt BWP start NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; @@ -1365,15 +1353,9 @@ void pf_ul(module_id_t module_id, && cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; - NR_BWP_t *genericParameters = NULL; - if (sched_ctrl->active_ubwp) { - genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; - } else if (scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, + scc, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0; const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -1513,15 +1495,9 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; - NR_BWP_t *genericParameters = NULL; - if (sched_ctrl->active_ubwp) { - genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; - } else if (scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, + scc, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); const uint16_t bwpStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); @@ -1763,15 +1739,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) pusch_pdu->handle = 0; //not yet used /* FAPI: BWP */ - NR_BWP_t *genericParameters = NULL; - if (sched_ctrl->active_ubwp) { - genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; - } else if (scc) { - genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters; - } + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, + scc, + RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); pusch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pusch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 5db381ff50..480ddc791b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -300,6 +300,14 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup, nr_dci_format_t format, int bwp_id); +NR_BWP_t *get_dl_bwp_genericParameters(NR_BWP_Downlink_t *active_bwp, + NR_ServingCellConfigCommon_t *ServingCellConfigCommon, + NR_SIB1_t *sib1); + +NR_BWP_t *get_ul_bwp_genericParameters(NR_BWP_Uplink_t *active_ubwp, + NR_ServingCellConfigCommon_t *ServingCellConfigCommon, + NR_SIB1_t *sib1); + /* find coreset within the search space */ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_ServingCellConfigCommon_t *scc, From 11334aa45f629b167cab872a99a24d21973d42ba Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 4 Mar 2022 14:34:26 +0000 Subject: [PATCH 657/883] Delete duplicated prototype function (update to develop implementation) --- openair2/RRC/NR/rrc_gNB.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 335a126c41..1fb3541f0e 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -107,27 +107,6 @@ extern RAN_CONTEXT_t RC; -extern boolean_t nr_rrc_pdcp_config_asn1_req( - const protocol_ctxt_t *const ctxt_pP, - NR_SRB_ToAddModList_t *const srb2add_list, - NR_DRB_ToAddModList_t *const drb2add_list, - NR_DRB_ToReleaseList_t *const drb2release_list, - const uint8_t security_modeP, - uint8_t *const kRRCenc, - uint8_t *const kRRCint, - uint8_t *const kUPenc, - uint8_t *const kUPint - ,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9 - ,rb_id_t *const defaultDRB, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - -extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP, - const NR_SRB_ToAddModList_t * const srb2add_listP, - const NR_DRB_ToAddModList_t * const drb2add_listP, - const NR_DRB_ToReleaseList_t * const drb2release_listP, - const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP, - struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list); - static inline uint64_t bitStr_to_uint64(BIT_STRING_t *asn); mui_t rrc_gNB_mui = 0; From 3f0eee5019b2b5aff9f81d0304d9ffd59c2a1a64 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 4 Mar 2022 15:38:48 +0000 Subject: [PATCH 658/883] Replace module_id by sib1 as input parameter in some functions where only sib1 is required --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 +- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 41 +++++++++++++++--- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 4 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 29 ++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 ++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 43 ++++++++++++++++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 10 ++--- 9 files changed, 97 insertions(+), 43 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 5b139a7005..4f803cc80f 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -272,7 +272,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, /* manually set free CCE to 0 */ const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; - sched_ctrl->search_space = get_searchspace(module_id, scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); + sched_ctrl->search_space = get_searchspace(NULL, scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); uint8_t nr_of_candidates; find_aggregation_candidates(&sched_ctrl->aggregation_level, &nr_of_candidates, @@ -282,7 +282,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - nr_set_pdsch_semi_static(module_id, + nr_set_pdsch_semi_static(NULL, scc, UE_info->CellGroup[0], sched_ctrl->active_bwp, diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 6307ac7394..7c699fc088 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -654,7 +654,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; } - sched_ctrl->search_space = get_searchspace(Mod_idP, scc, bwpd, target_ss); + sched_ctrl->search_space = get_searchspace(sib1 ? sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, scc, bwpd, target_ss); sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss); sched_ctrl->sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP], sched_ctrl->search_space, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 7fb518804b..25708ad5fe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -869,7 +869,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t dci_pdu_rel15_t uldci_payload; memset(&uldci_payload, 0, sizeof(uldci_payload)); - config_uldci(module_idP, + config_uldci(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, ubwp, ubwpd, scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 0089d83fa5..4d16e81bd9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -86,7 +86,11 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * else { target_ss = NR_SearchSpace__searchSpaceType_PR_common; } - NR_SearchSpace_t *search_space = get_searchspace(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, target_ss); + NR_SearchSpace_t *search_space = get_searchspace(nrmac->common_channels[0].sib1 ? nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, + bwp ? bwp->bwp_Dedicated : NULL, + target_ss); + NR_ControlResourceSet_t *coreset = get_coreset(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, search_space, target_ss); // get coreset symbol "map" const uint16_t symb_coreset = (1 << coreset->duration) - 1; @@ -554,8 +558,9 @@ bool allocate_dl_retransmission(module_id_t module_id, int UE_id, int current_harq_pid) { - const NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels->ServingCellConfigCommon; - NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; + gNB_MAC_INST *nr_mac = RC.nrmac[module_id]; + const NR_ServingCellConfigCommon_t *scc = nr_mac->common_channels->ServingCellConfigCommon; + NR_UE_info_t *UE_info = &nr_mac->UE_info; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; @@ -606,13 +611,29 @@ bool allocate_dl_retransmission(module_id_t module_id, /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ if (ps->time_domain_allocation != tda) - nr_set_pdsch_semi_static(module_id, scc, cg, sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, ps); + nr_set_pdsch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, + cg, + sched_ctrl->active_bwp, + bwpd, + tda, + ps->nrOfLayers, + sched_ctrl, + ps); } else { /* the retransmission will use a different time domain allocation, check * that we have enough resources */ NR_pdsch_semi_static_t temp_ps = *ps; - nr_set_pdsch_semi_static(module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, &temp_ps); + nr_set_pdsch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, + UE_info->CellGroup[UE_id], + sched_ctrl->active_bwp, + bwpd, + tda, + ps->nrOfLayers, + sched_ctrl, + &temp_ps); while (rbStart < bwpSize && !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) rbStart++; @@ -898,7 +919,15 @@ void pf_dl(module_id_t module_id, NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda) - nr_set_pdsch_semi_static(module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, layers[UE_id], sched_ctrl, ps); + nr_set_pdsch_semi_static(mac->common_channels[0].sib1 ? (const NR_SIB1_t *)mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, + UE_info->CellGroup[UE_id], + sched_ctrl->active_bwp, + bwpd, + tda, + layers[UE_id], + sched_ctrl, + ps); const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); // Freq-demain allocation diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index c1e30e8595..f8ccd2f361 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -282,7 +282,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ps->nrOfLayers = target_dl_Nl; if (ps->time_domain_allocation != tda || ps->nrOfLayers != target_dl_Nl) - nr_set_pdsch_semi_static(module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, target_dl_Nl, sched_ctrl, ps); + nr_set_pdsch_semi_static(NULL, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, target_dl_Nl, sched_ctrl, ps); /* find largest unallocated chunk */ const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); @@ -465,7 +465,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) - nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pusch_semi_static(NULL, scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps); uint16_t rbStart = 0; uint16_t rbSize; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index dc5ce1bd5b..2565f8f904 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -290,7 +290,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, } } -NR_SearchSpace_t *get_searchspace(module_id_t module_id, +NR_SearchSpace_t *get_searchspace(NR_SIB1_t *sib1, NR_ServingCellConfigCommon_t *scc, NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_SearchSpace__searchSpaceType_PR target_ss) { @@ -301,7 +301,6 @@ NR_SearchSpace_t *get_searchspace(module_id_t module_id, } else if(scc) { n = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count; } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; n = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count; } @@ -312,7 +311,6 @@ NR_SearchSpace_t *get_searchspace(module_id_t module_id, } else if(scc) { ss = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i]; } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; ss = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i]; } AssertFatal(ss->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n"); @@ -546,7 +544,7 @@ bool nr_find_nb_rb(uint16_t Qm, return *tbs >= bytes && *nb_rb <= nb_rb_max; } -void nr_set_pdsch_semi_static(module_id_t module_id, +void nr_set_pdsch_semi_static(const NR_SIB1_t *sib1, const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *secondaryCellGroup, const NR_BWP_Downlink_t *bwp, @@ -595,7 +593,6 @@ void nr_set_pdsch_semi_static(module_id_t module_id, } else if(scc) { tdaList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; } AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); @@ -651,7 +648,7 @@ void nr_set_pdsch_semi_static(module_id_t module_id, LOG_D(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT); } -void nr_set_pusch_semi_static(module_id_t module_id, +void nr_set_pusch_semi_static(const NR_SIB1_t *sib1, const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, const NR_BWP_UplinkDedicated_t *ubwpd, @@ -668,7 +665,6 @@ void nr_set_pusch_semi_static(module_id_t module_id, } else if(scc) { tdaList = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; tdaList = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; } @@ -952,7 +948,7 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, } -void config_uldci(module_id_t module_id, +void config_uldci(const NR_SIB1_t *sib1, const NR_BWP_Uplink_t *ubwp, const NR_BWP_UplinkDedicated_t *ubwpd, const NR_ServingCellConfigCommon_t *scc, @@ -966,7 +962,7 @@ void config_uldci(module_id_t module_id, NR_BWP_t *genericParameters = get_ul_bwp_genericParameters((NR_BWP_Uplink_t *)ubwp, (NR_ServingCellConfigCommon_t *)scc, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + (NR_SIB1_t *)sib1); const int bw = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -1091,7 +1087,7 @@ int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset, } // This function configures pucch pdu fapi structure -void nr_configure_pucch(module_id_t module_id, +void nr_configure_pucch(NR_SIB1_t *sib1, nfapi_nr_pucch_pdu_t* pucch_pdu, NR_ServingCellConfigCommon_t *scc, NR_CellGroupConfig_t *CellGroup, @@ -1141,7 +1137,6 @@ void nr_configure_pucch(module_id_t module_id, } else if(scc) { pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup; } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; pucch_ConfigCommon = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup; } @@ -1171,9 +1166,7 @@ void nr_configure_pucch(module_id_t module_id, else pucch_pdu->hopping_id = *scc->physCellId; - NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(bwp, - scc, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(bwp,scc, sib1); pucch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); @@ -2247,8 +2240,9 @@ int get_ul_bwp_id(const NR_ServingCellConfig_t *servingCellConfig) //------------------------------------------------------------------------------ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellGroup) { - NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_idP]->common_channels[0].ServingCellConfigCommon; - NR_UE_info_t *UE_info = &RC.nrmac[mod_idP]->UE_info; + gNB_MAC_INST *nr_mac = RC.nrmac[mod_idP]; + NR_ServingCellConfigCommon_t *scc = nr_mac->common_channels[0].ServingCellConfigCommon; + NR_UE_info_t *UE_info = &nr_mac->UE_info; LOG_I(NR_MAC, "[gNB %d] Adding UE with rnti 0x%04x (num_UEs %d)\n", mod_idP, rntiP, @@ -2307,7 +2301,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG &sched_ctrl->active_bwp->bwp_Common->genericParameters: &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common; - sched_ctrl->search_space = get_searchspace(mod_idP, scc, + sched_ctrl->search_space = get_searchspace(nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); sched_ctrl->coreset = get_coreset(mod_idP, scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 85ad214b41..10a21cd07d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -44,7 +44,8 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, const NR_sched_pucch_t *pucch, int UE_id) { - NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info; + gNB_MAC_INST *nr_mac = RC.nrmac[mod_id]; + NR_UE_info_t *UE_info = &nr_mac->UE_info; nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[mod_id]->UL_tti_req_ahead[0][pucch->ul_slot]; @@ -81,7 +82,7 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); - nr_configure_pucch(mod_id, + nr_configure_pucch(nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, pucch_pdu, scc, UE_info->CellGroup[UE_id], diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 0df1f9d2ce..019238d0f8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -980,8 +980,9 @@ bool allocate_ul_retransmission(module_id_t module_id, int harq_pid) { const int CC_id = 0; - const NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[CC_id].ServingCellConfigCommon; - NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; + gNB_MAC_INST *nr_mac = RC.nrmac[module_id]; + const NR_ServingCellConfigCommon_t *scc = nr_mac->common_channels[CC_id].ServingCellConfigCommon; + NR_UE_info_t *UE_info = &nr_mac->UE_info; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_sched_pusch_t *retInfo = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; @@ -1018,7 +1019,14 @@ bool allocate_ul_retransmission(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) - nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pusch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, + sched_ctrl->active_ubwp, + ubwpd, + dci_format, + tda, + num_dmrs_cdm_grps_no_data, + ps); LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size); } else { /* the retransmission will use a different time domain allocation, check @@ -1030,7 +1038,14 @@ bool allocate_ul_retransmission(module_id_t module_id, rbSize++; NR_pusch_semi_static_t temp_ps; int dci_format = get_dci_format(sched_ctrl); - nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps); + nr_set_pusch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, + sched_ctrl->active_ubwp, + ubwpd, + dci_format, + tda, + num_dmrs_cdm_grps_no_data, + &temp_ps); uint32_t new_tbs; uint16_t new_rbSize; bool success = nr_find_nb_rb(retInfo->Qm, @@ -1262,7 +1277,14 @@ void pf_ul(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) - nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pusch_semi_static(nrmac->common_channels[0].sib1 ? (const NR_SIB1_t *)nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, + sched_ctrl->active_ubwp, + ubwpd, + dci_format, + tda, + num_dmrs_cdm_grps_no_data, + ps); NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; sched_pusch->mcs = 9; update_ul_ue_R_Qm(sched_pusch, ps); @@ -1385,7 +1407,14 @@ void pf_ul(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) - nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); + nr_set_pusch_semi_static(nrmac->common_channels[0].sib1 ? (const NR_SIB1_t *)nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + scc, + sched_ctrl->active_ubwp, + ubwpd, + dci_format, + tda, + num_dmrs_cdm_grps_no_data, + ps); update_ul_ue_R_Qm(sched_pusch, ps); /* Calculate the current scheduling bytes and the necessary RBs */ @@ -1892,7 +1921,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) n_ubwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count; } - config_uldci(module_id, + config_uldci(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, sched_ctrl->active_ubwp, ubwpd, scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 480ddc791b..6085b9d7ef 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -177,7 +177,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234); -void config_uldci(module_id_t module_id, +void config_uldci(const NR_SIB1_t *sib1, const NR_BWP_Uplink_t *ubwp, const NR_BWP_UplinkDedicated_t *ubwpd, const NR_ServingCellConfigCommon_t *scc, @@ -242,7 +242,7 @@ int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset, NR_BWP_UplinkDedicated_t *bwpd, int CCEIndex); -void nr_configure_pucch(module_id_t module_id, +void nr_configure_pucch(NR_SIB1_t *sib1, nfapi_nr_pucch_pdu_t* pucch_pdu, NR_ServingCellConfigCommon_t *scc, NR_CellGroupConfig_t *CellGroup, @@ -316,7 +316,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_SearchSpace__searchSpaceType_PR ss_type); /* find a search space within a BWP */ -NR_SearchSpace_t *get_searchspace(module_id_t module_id, +NR_SearchSpace_t *get_searchspace(NR_SIB1_t *sib1, NR_ServingCellConfigCommon_t *scc, NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_SearchSpace__searchSpaceType_PR target_ss); @@ -327,7 +327,7 @@ long get_K2(NR_ServingCellConfigCommon_t *scc, int time_domain_assignment, int mu); -void nr_set_pdsch_semi_static(module_id_t module_id, +void nr_set_pdsch_semi_static(const NR_SIB1_t *sib1, const NR_ServingCellConfigCommon_t *scc, const NR_CellGroupConfig_t *secondaryCellGroup, const NR_BWP_Downlink_t *bwp, @@ -337,7 +337,7 @@ void nr_set_pdsch_semi_static(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl, NR_pdsch_semi_static_t *ps); -void nr_set_pusch_semi_static(module_id_t module_id, +void nr_set_pusch_semi_static(const NR_SIB1_t *sib1, const NR_ServingCellConfigCommon_t *scc, const NR_BWP_Uplink_t *ubwp, const NR_BWP_UplinkDedicated_t *ubwpd, From 078dff03b191a4ef3f439287ad358d8bfed92ec9 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 4 Mar 2022 15:43:52 +0000 Subject: [PATCH 659/883] Revert do_SRS to develop version in config files (re-enable SRS) --- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 2 +- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index b8248b02dd..9bf20b54ab 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -37,7 +37,7 @@ gNBs = pusch_AntennaPorts = 1; min_rxtxtime = 6; sib1_tda = 0; - do_SRS = 0; + do_SRS = 1; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 54016c6b0e..ddc02dd932 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -36,7 +36,7 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; sib1_tda = 0; - do_SRS = 0; + do_SRS = 1; ul_prbblacklist = "51,52,53,54" pdcch_ConfigSIB1 = ( From 9f88fe18a3674d3441a408b49c03f884947c65ad Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 4 Mar 2022 16:10:45 +0000 Subject: [PATCH 660/883] Creation of get_pdsch_TimeDomainAllocationList function to avoid replicated code --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 16 ++++--------- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 24 ++++++++++++------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 4 ++++ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 4d16e81bd9..208ea50fbc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -95,18 +95,12 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * // get coreset symbol "map" const uint16_t symb_coreset = (1 << coreset->duration) - 1; - /* check that TDA index 0 fits into DL and does not overlap CORESET */ - NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = NULL; - if (bwp) { - tdaList = bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - } else if (scc) { - tdaList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - } else { - NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1; - tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - } - + NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = get_pdsch_TimeDomainAllocationList(bwp, + scc, + nrmac->common_channels[0].sib1 ? (const NR_SIB1_t *)nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); AssertFatal(tdaList->list.count >= 1, "need to have at least one TDA for DL slots\n"); + + /* check that TDA index 0 fits into DL and does not overlap CORESET */ const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_DL = tdaList->list.array[0]; AssertFatal(!tdaP_DL->k0 || *tdaP_DL->k0 == 0, "TimeDomainAllocation at index 1: non-null k0 (%ld) is not supported by the scheduler\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 2565f8f904..f2a73572dc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -254,6 +254,21 @@ NR_BWP_t *get_ul_bwp_genericParameters(NR_BWP_Uplink_t *active_ubwp, return genericParameters; } +NR_PDSCH_TimeDomainResourceAllocationList_t *get_pdsch_TimeDomainAllocationList(const NR_BWP_Downlink_t *active_bwp, + const NR_ServingCellConfigCommon_t *ServingCellConfigCommon, + const NR_SIB1_t *sib1) { + NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = NULL; + if (active_bwp) { + tdaList = active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } else if (ServingCellConfigCommon) { + tdaList = ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } else { + tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; + } + return tdaList; +} + + NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_ServingCellConfigCommon_t *scc, void *bwp, @@ -587,14 +602,7 @@ void nr_set_pdsch_semi_static(const NR_SIB1_t *sib1, if (ps->time_domain_allocation != tda) { reset_dmrs = true; ps->time_domain_allocation = tda; - NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = NULL; - if(bwp) { - tdaList = bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - } else if(scc) { - tdaList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - } else { - tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; - } + NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = get_pdsch_TimeDomainAllocationList(bwp, scc, sib1); AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); ps->mapping_type = tdaList->list.array[tda]->mappingType; if (pdsch_Config) { diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 6085b9d7ef..dbe1a61404 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -308,6 +308,10 @@ NR_BWP_t *get_ul_bwp_genericParameters(NR_BWP_Uplink_t *active_ubwp, NR_ServingCellConfigCommon_t *ServingCellConfigCommon, NR_SIB1_t *sib1); +NR_PDSCH_TimeDomainResourceAllocationList_t *get_pdsch_TimeDomainAllocationList(const NR_BWP_Downlink_t *active_bwp, + const NR_ServingCellConfigCommon_t *ServingCellConfigCommon, + const NR_SIB1_t *sib1); + /* find coreset within the search space */ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_ServingCellConfigCommon_t *scc, From 79a5249a725bec9f251e5f676436e4a4e945f270 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 5 Mar 2022 16:18:06 +0100 Subject: [PATCH 661/883] for testing --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index a48a59b67b..4c902e2675 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -979,6 +979,9 @@ void nr_schedule_ue_spec(module_id_t module_id, gNB_MAC_INST *gNB_mac = RC.nrmac[module_id]; if (!is_xlsch_in_slot(gNB_mac->dlsch_slot_bitmap[slot / 64], slot)) return; + + //if (slot==7 || slot == 17) return; + /* PREPROCESSOR */ gNB_mac->pre_processor_dl(module_id, frame, slot); From 4ca985858ffaf42bbb000da04a4a002d48c13f5d Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 5 Mar 2022 22:24:34 +0100 Subject: [PATCH 662/883] to trigger CI --- targets/ARCH/AW2SORI/oaiori.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/ARCH/AW2SORI/oaiori.c b/targets/ARCH/AW2SORI/oaiori.c index fc35e021b8..3c424086dd 100644 --- a/targets/ARCH/AW2SORI/oaiori.c +++ b/targets/ARCH/AW2SORI/oaiori.c @@ -417,7 +417,7 @@ int aw2s_startstreaming(openair0_device *device) { (openair0_cfg->rx_num_channels > 1 && rx1->fst != ORI_FST_Operational) || tx0->fst != ORI_FST_Operational || (openair0_cfg->tx_num_channels > 1 && tx1->fst != ORI_FST_Operational)) - {}*/ + {}*/ // test RX interface uint64_t TS; char temp_rx[2048] __attribute__((aligned(32))); From 091386174e476a224ebcaeddb0bfbf2f346ea12f Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 5 Mar 2022 23:20:35 +0100 Subject: [PATCH 663/883] bugfix for new sf_ahead parameter --- targets/RT/USER/lte-ru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 16f26cc95c..8a5ae99f19 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -3070,7 +3070,7 @@ RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mas ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr); ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); - ru[j]->sf_ahead = *(RUParamList.paramarray[j][RU_SF_AHEAD_IDX].uptr); + ru[j]->sf_ahead = *(RUParamList.paramarray[j][RU_SF_AHEAD].uptr); *ru_mask= (*ru_mask)|(1< Date: Sun, 6 Mar 2022 09:40:36 +0100 Subject: [PATCH 664/883] build for NR UE --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 56 ++++++++++++++++++++ openair2/RRC/NR/nr_rrc_proto.h | 1 + openair2/RRC/NR/rrc_gNB_reconfig.c | 55 ------------------- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 4 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 665e27f7b7..d3e4b615a4 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1004,6 +1004,62 @@ long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS) { return c_srs; } +void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, + NR_CSI_MeasConfig_t *csi_MeasConfig, + int dl_antenna_ports, + int curr_bwp, + int do_csirs) { + + if (do_csirs) { + csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); + NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); + nzpcsi0->nzp_CSI_RS_ResourceId = 0; + NR_CSI_RS_ResourceMapping_t resourceMapping; + switch (dl_antenna_ports) { + case 1: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2; + resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; + resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0; + resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; + break; + case 2: + resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; + resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t)); + resourceMapping.frequencyDomainAllocation.choice.other.size = 1; + resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2; + resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4; + resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; + resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; + break; + default: + AssertFatal(1==0,"Number of ports not yet supported\n"); + } + resourceMapping.firstOFDMSymbolInTimeDomain = 6; + resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; + resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; + resourceMapping.density.choice.one = (NULL_t)0; + resourceMapping.freqBand.startingRB = 0; + resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2; + nzpcsi0->resourceMapping = resourceMapping; + nzpcsi0->powerControlOffset = 0; + nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); + *nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0; + nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; + nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); + nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; + nzpcsi0->periodicityAndOffset->choice.slots320 = 0; + nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS)); + *nzpcsi0->qcl_InfoPeriodicCSI_RS=0; + ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); + } + else + csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL; +} + void fill_initial_SpCellConfig(int uid, NR_SpCellConfig_t *SpCellConfig, NR_ServingCellConfigCommon_t *scc, diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 205267e288..08c6709497 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -84,6 +84,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int do_srs, int uid); + void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 120a508cdf..7c733a19e6 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -1318,61 +1318,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco } -void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, - NR_CSI_MeasConfig_t *csi_MeasConfig, - int dl_antenna_ports, - int curr_bwp, - int do_csirs) { - - if (do_csirs) { - csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList)); - NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0)); - nzpcsi0->nzp_CSI_RS_ResourceId = 0; - NR_CSI_RS_ResourceMapping_t resourceMapping; - switch (dl_antenna_ports) { - case 1: - resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2; - resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.row2.size = 2; - resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0; - resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16; - resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1; - resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM; - break; - case 2: - resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other; - resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t)); - resourceMapping.frequencyDomainAllocation.choice.other.size = 1; - resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2; - resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4; - resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2; - resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2; - break; - default: - AssertFatal(1==0,"Number of ports not yet supported\n"); - } - resourceMapping.firstOFDMSymbolInTimeDomain = 6; - resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; - resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; - resourceMapping.density.choice.one = (NULL_t)0; - resourceMapping.freqBand.startingRB = 0; - resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2; - nzpcsi0->resourceMapping = resourceMapping; - nzpcsi0->powerControlOffset = 0; - nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS)); - *nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0; - nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; - nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); - nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; - nzpcsi0->periodicityAndOffset->choice.slots320 = 0; - nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS)); - *nzpcsi0->qcl_InfoPeriodicCSI_RS=0; - ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); - } - else - csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL; -} void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon, diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 5da5cd0b67..0533f2f100 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -673,7 +673,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp if (samples_received == nsamps) s->wait_for_first_pps=0; // bring RX data into 12 LSBs for softmodem RX - for (int i=0; itype==USRP_X300_DEV) { openair0_cfg[0].rx_gain_calib_table = calib_table_x310; std::cerr << "-- Using calibration table: calib_table_x310" << std::endl; - // s->usrp->set_rx_dc_offset(true); } if (device->type==USRP_N300_DEV) { From aa910f52b6d573a453170d4c4848778c951b4c1f Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Sun, 6 Mar 2022 15:52:42 +0100 Subject: [PATCH 665/883] debug after develop merge --- openair1/PHY/INIT/nr_init_ue.c | 8 ++-- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 6 +-- openair2/RRC/NR/rrc_gNB_NGAP.c | 31 +++++++------- openair3/NGAP/ngap_gNB_nas_procedures.c | 55 ++++++++++++------------- 4 files changed, 47 insertions(+), 53 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 1e4723538a..8b798dd090 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -413,10 +413,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } } - // PBCH - prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); - prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); - // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); @@ -449,6 +445,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } } + // RACH + prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + } // initialization for the last instance of pdsch_vars (used for MU-MIMO) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index be1555fd54..2705132bc6 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -504,10 +504,10 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, nr_pbch_unscrambling(nr_ue_pbch_vars, pbch_e_rx, frame_parms->Nid_cell, nushift, M, NR_POLAR_PBCH_E, 0, 0, pbch_a_prime, &pbch_a_interleaved); //polar decoding de-rate matching - - decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&pbch_a_prime,0, + uint64_t tmp=0; + decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&tmp,0, NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL); - + pbch_a_prime=tmp; if(decoderState) return(decoderState); diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 08f5a01986..eb0e2019d1 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -905,30 +905,27 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP( for (pdusession = 0; pdusession < ue_context_pP->ue_context.setup_pdu_sessions; pdusession++) { // if (xid == ue_context_pP->ue_context.pdusession[pdusession].xid) { if (ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_DONE) { - NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id; - // NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].pdusession_id = 1; - NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].nb_of_qos_flow = ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos; - NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gtp_teid = ue_context_pP->ue_context.gnb_gtp_teid[pdusession]; - NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.pdu_session_type = PDUSessionType_ipv4; - NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.length = ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].length; - memcpy(NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.buffer, - ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].buffer, sizeof(uint8_t)*20); - for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].nb_of_qos_flow; qos_flow_index++) { - NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qfi = + pdusession_setup_t * tmp=&NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession]; + tmp->pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id; + // tmp->pdusession_id = 1; + tmp->nb_of_qos_flow = ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos; + tmp->gtp_teid = ue_context_pP->ue_context.gnb_gtp_teid[pdusession]; + tmp->gNB_addr.pdu_session_type = PDUSessionType_ipv4; + tmp->gNB_addr.length = ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].length; + memcpy(tmp->gNB_addr.buffer, + ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].buffer, tmp->gNB_addr.length); + for (qos_flow_index = 0; qos_flow_index < tmp->nb_of_qos_flow; qos_flow_index++) { + tmp->associated_qos_flows[qos_flow_index].qfi = ue_context_pP->ue_context.pduSession[pdusession].param.qos[qos_flow_index].qfi; - NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qos_flow_mapping_ind = QOSFLOW_MAPPING_INDICATION_DL; + tmp->associated_qos_flows[qos_flow_index].qos_flow_mapping_ind = QOSFLOW_MAPPING_INDICATION_DL; } ue_context_pP->ue_context.pduSession[pdusession].status = PDU_SESSION_STATUS_ESTABLISHED; - LOG_I (NR_RRC,"gnb_gtp_addr (msg index %d, pdu_sessions index %d, status %d, xid %d): nb_of_pdusessions %d, pdusession_id %d, teid: %u, addr: %d.%d.%d.%d \n ", + LOG_I (NR_RRC,"gnb_gtp_addr (msg index %d, pdu_sessions index %d, status %d, xid %d): nb_of_pdusessions %d, pdusession_id %d, teid: %u \n ", pdu_sessions_done, pdusession, ue_context_pP->ue_context.pduSession[pdusession].status, xid, ue_context_pP->ue_context.nb_of_pdusessions, NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].pdusession_id, - NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gtp_teid, - NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[0], - NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[1], - NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[2], - NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[3]); + NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gtp_teid); pdu_sessions_done++; } else if ((ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_NEW) || (ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_ESTABLISHED)) { diff --git a/openair3/NGAP/ngap_gNB_nas_procedures.c b/openair3/NGAP/ngap_gNB_nas_procedures.c index a40e8328da..75e3bfe3af 100644 --- a/openair3/NGAP/ngap_gNB_nas_procedures.c +++ b/openair3/NGAP/ngap_gNB_nas_procedures.c @@ -680,24 +680,20 @@ int ngap_gNB_initial_ctxt_resp( pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.present = NGAP_UPTransportLayerInformation_PR_gTPTunnel; - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel = (NGAP_GTPTunnel_t *)calloc(1, sizeof(NGAP_GTPTunnel_t)); - GTP_TEID_TO_ASN1(initial_ctxt_resp_p->pdusessions[i].gtp_teid, &pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID); + pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel = (NGAP_GTPTunnel_t *)calloc(1, sizeof(NGAP_GTPTunnel_t)); + struct NGAP_GTPTunnel *tmp=pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel; + GTP_TEID_TO_ASN1(initial_ctxt_resp_p->pdusessions[i].gtp_teid, &tmp->gTP_TEID); - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf = malloc(initial_ctxt_resp_p->pdusessions[i].gNB_addr.length); + tmp->transportLayerAddress.buf = malloc(initial_ctxt_resp_p->pdusessions[i].gNB_addr.length); - memcpy(pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf, + memcpy(tmp->transportLayerAddress.buf, initial_ctxt_resp_p->pdusessions[i].gNB_addr.buffer, initial_ctxt_resp_p->pdusessions[i].gNB_addr.length); - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.size = initial_ctxt_resp_p->pdusessions[i].gNB_addr.length; - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.bits_unused = 0; + tmp->transportLayerAddress.size = initial_ctxt_resp_p->pdusessions[i].gNB_addr.length; + tmp->transportLayerAddress.bits_unused = 0; - NGAP_DEBUG("initial_ctxt_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld \n", - item->pDUSessionID, - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[0], - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[1], - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[2], - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[3], - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.size); + NGAP_DEBUG("initial_ctxt_resp_p: pdusession ID %ld\n", + item->pDUSessionID); /* associatedQosFlowList. number of 1? */ for(int j=0; j < initial_ctxt_resp_p->pdusessions[i].nb_of_qos_flow; j++) { @@ -987,24 +983,25 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.present = NGAP_UPTransportLayerInformation_PR_gTPTunnel; pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel = calloc(1, sizeof(struct NGAP_GTPTunnel)); + struct NGAP_GTPTunnel *tmp=pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel; + GTP_TEID_TO_ASN1(pdusession_setup_resp_p->pdusessions[i].gtp_teid, &tmp->gTP_TEID); + if (pdusession_setup_resp_p->pdusessions[i].gNB_addr.length) { + tmp->transportLayerAddress.buf = malloc(pdusession_setup_resp_p->pdusessions[i].gNB_addr.length); - GTP_TEID_TO_ASN1(pdusession_setup_resp_p->pdusessions[i].gtp_teid, &pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->gTP_TEID); + memcpy(tmp->transportLayerAddress.buf, + pdusession_setup_resp_p->pdusessions[i].gNB_addr.buffer, + pdusession_setup_resp_p->pdusessions[i].gNB_addr.length); + tmp->transportLayerAddress.size = pdusession_setup_resp_p->pdusessions[i].gNB_addr.length; + tmp->transportLayerAddress.bits_unused = 0; - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf = malloc(pdusession_setup_resp_p->pdusessions[i].gNB_addr.length); - - memcpy(pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf, - pdusession_setup_resp_p->pdusessions[i].gNB_addr.buffer, - pdusession_setup_resp_p->pdusessions[i].gNB_addr.length); - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.size = pdusession_setup_resp_p->pdusessions[i].gNB_addr.length; - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.bits_unused = 0; - - NGAP_DEBUG("pdusession_setup_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld \n", - item->pDUSessionID, - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[0], - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[1], - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[2], - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.buf[3], - pdusessionTransfer_p->dLQosFlowPerTNLInformation.uPTransportLayerInformation.choice.gTPTunnel->transportLayerAddress.size); + NGAP_DEBUG("pdusession_setup_resp_p: pdusession ID %ld, gnb_addr %d.%d.%d.%d, SIZE %ld \n", + item->pDUSessionID, + tmp->transportLayerAddress.buf[0], + tmp->transportLayerAddress.buf[1], + tmp->transportLayerAddress.buf[2], + tmp->transportLayerAddress.buf[3], + tmp->transportLayerAddress.size); + } /* associatedQosFlowList. number of 1? */ for(int j=0; j < pdusession_setup_resp_p->pdusessions[i].nb_of_qos_flow; j++) { From fcd88de2ab2fe1b640ce5eb1f4070fb5fe57ceaa Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 7 Mar 2022 00:08:12 +0100 Subject: [PATCH 666/883] SR/CSI multiplexing fix. default sl_head=6 instead of 4 to check if RF simulator behaves better --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 2 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 1 + openair2/ENB_APP/enb_paramdef.h | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 5 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 1 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 49 +++++++++++++++++-- openair2/RRC/NR/MESSAGES/asn1_msg.c | 6 +-- 7 files changed, 55 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 283ff1934c..db36b39f99 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -104,6 +104,8 @@ void nr_fill_pucch(PHY_VARS_gNB *gNB, pucch->frame = frame; pucch->slot = slot; pucch->active = 1; + if (pucch->pucch_pdu.format_type > 0) LOG_D(PHY,"Programming PUCCH[%d] for %d.%d, format %d, nb_harq %d, nb_sr %d, nb_csi %d\n",id, + pucch->frame,pucch->slot,pucch->pucch_pdu.format_type,pucch->pucch_pdu.bit_len_harq,pucch->pucch_pdu.sr_flag,pucch->pucch_pdu.bit_len_csi_part1); memcpy((void*)&pucch->pucch_pdu, (void*)pucch_pdu, sizeof(nfapi_nr_pucch_pdu_t)); } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 6ba673dbc7..435b633c3b 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -699,6 +699,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->uci_pdu_list[num_ucis].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_2_3_4_t); nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu_format2 = &gNB->uci_pdu_list[num_ucis].pucch_pdu_format_2_3_4; + LOG_D(PHY,"%d.%d Calling nr_decode_pucch2\n",frame_rx,slot_rx); nr_decode_pucch2(gNB, slot_rx, uci_pdu_format2, diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index a533b8cb23..21e2e1b703 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -172,7 +172,7 @@ typedef enum { {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_SF_AHEAD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \ - {CONFIG_STRING_RU_SL_AHEAD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_SL_AHEAD, NULL, 0, iptr:NULL, defintval:6, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_FLAG, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_SCS_FOR_RASTER, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 51541353f4..e97e75ea16 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -368,8 +368,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, schedule_nr_prach(module_idP, f, s); } - // This schedule SR - nr_sr_reporting(module_idP, frame, slot); // Schedule CSI-RS transmission nr_csirs_scheduling(module_idP, frame, slot, nr_slots_per_frame[*scc->ssbSubcarrierSpacing]); @@ -398,6 +396,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_pucch(module_idP, frame, slot); + // This schedule SR after PUCCH for multiplexing + nr_sr_reporting(module_idP, frame, slot); + stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 3203b536f6..886b675e41 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1225,6 +1225,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, } } AssertFatal(res_found==1,"No PUCCH resource found corresponding to id %ld\n",*resource_id); + LOG_D(NR_MAC,"Configure pucch: pucch_pdu->format_type %d pucch_pdu->bit_len_harq %d, pucch->pdu->bit_len_csi %d\n",pucch_pdu->format_type,pucch_pdu->bit_len_harq,pucch_pdu->bit_len_csi_part1); } else { // this is the default PUCCH configuration, PUCCH format 0 or 1 LOG_D(NR_MAC,"pucch_acknak: Filling default PUCCH configuration from Tables (r_pucch %d, bwp %p)\n",r_pucch,bwp); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 8ca409695e..3688ac7771 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -153,7 +153,8 @@ void nr_schedule_pucch(int Mod_idP, || frameP != curr_pucch->frame || slotP != curr_pucch->ul_slot) continue; - LOG_D(NR_MAC,"Scheduling PUCCH[%d] RX for UE %d in %d.%d O_ack %d\n",i,UE_id,curr_pucch->frame,curr_pucch->ul_slot,O_ack); + if (O_csi > 0) LOG_D(NR_MAC,"Scheduling PUCCH[%d] RX for UE %d in %d.%d O_ack %d, O_sr %d, O_csi %d\n", + i,UE_id,curr_pucch->frame,curr_pucch->ul_slot,O_ack,O_sr,O_csi); nr_fill_nfapi_pucch(Mod_idP, frameP, slotP, curr_pucch, UE_id); memset(curr_pucch, 0, sizeof(*curr_pucch)); } @@ -773,6 +774,7 @@ void nr_csi_meas_reporting(int Mod_idP, len = pucchres->format.choice.format2->nrofPRBs; mask = ((1 << pucchres->format.choice.format2->nrofSymbols) - 1) << pucchres->format.choice.format2->startingSymbolIndex; 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); break; case NR_PUCCH_Resource__format_PR_format3: len = pucchres->format.choice.format3->nrofPRBs; @@ -1171,9 +1173,6 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info, // including ssb rsrp in mac stats stats->cumul_rsrp += strongest_ssb_rsrp; stats->num_rsrp_meas++; - LOG_D(MAC,"rsrp_id = %d rsrp = %d\n", - sched_ctrl->CSI_report.ssb_cri_report.RSRP, - get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP)); } @@ -1888,11 +1887,51 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot) && 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 nFAPI SR for RNTI %04x\n", SFN, slot, pdu->rnti); + 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_info->rnti[UE_id] + && 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_info->rnti[UE_id] + && 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_info->rnti[UE_id] + && 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_info->rnti[UE_id] + && 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; + break; + + } } if (nfapi_allocated) // break scheduling resource loop, continue next UE diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index d3e4b615a4..f5d6b228f9 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1051,7 +1051,7 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; - nzpcsi0->periodicityAndOffset->choice.slots320 = 0; + nzpcsi0->periodicityAndOffset->choice.slots320 = 20; nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS)); *nzpcsi0->qcl_InfoPeriodicCSI_RS=0; ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); @@ -1596,7 +1596,7 @@ void fill_initial_SpCellConfig(int uid, csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic)); csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; - csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 8 + (20 * uid) % 320; + csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = (8 + (20 * uid)) % 320; ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0; @@ -1655,7 +1655,7 @@ void fill_initial_SpCellConfig(int uid, csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic)); csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; - csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = 28 + (20 * uid) % 320; + csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = (28 + (20 * uid)) % 320; ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP; csirep2->reportQuantity.choice.cri_RSRP=(NULL_t)0; From ea984f8c4cd4ec467e18f551c596e78c1732ee3d Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 7 Mar 2022 15:51:33 +0100 Subject: [PATCH 667/883] using a global definition for the number of nscid for dmrs --- openair1/PHY/INIT/nr_init.c | 12 ++++++------ openair1/PHY/INIT/nr_init_ue.c | 10 +++++----- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 4 ++-- openair1/PHY/defs_nr_common.h | 2 ++ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index f8d9b74b80..58347a800c 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -142,10 +142,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot); for (int symb=0; symbsymbols_per_slot; symb++) { - pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(2*sizeof(uint32_t *)); + pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_NB_NSCID*sizeof(uint32_t *)); AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); - for (int q=0; q<2; q++) { + for (int q=0; qpdsch_gold_init[nscid] = cfg->cell_config.phy_cell_id.value; nr_init_pdsch_dmrs(gNB, nscid, cfg->cell_config.phy_cell_id.value); } //PUSCH DMRS init - gNB->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(2*sizeof(uint32_t ***)); + gNB->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(NR_NB_NSCID*sizeof(uint32_t ***)); uint32_t ****pusch_dmrs = gNB->nr_gold_pusch_dmrs; - for(int nscid=0; nscid<2; nscid++) { + for(int nscid=0; nscidslots_per_frame*sizeof(uint32_t **)); AssertFatal(pusch_dmrs[nscid]!=NULL, "NR init: pusch_dmrs for nscid %d - malloc failed\n", nscid); @@ -178,7 +178,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, } } - for (int nscid=0; nscid<2; nscid++) { + for (int nscid=0; nscidpusch_gold_init[nscid] = cfg->cell_config.phy_cell_id.value; nr_gold_pusch(gNB, nscid, gNB->pusch_gold_init[nscid]); } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index af06935e52..034c3e97e2 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -242,11 +242,11 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) AssertFatal(pusch_dmrs[slot]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d - malloc failed\n", slot); for (symb=0; symbsymbols_per_slot; symb++) { - pusch_dmrs[slot][symb] = (uint32_t **)malloc16(2*sizeof(uint32_t *)); + pusch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_NB_NSCID*sizeof(uint32_t *)); AssertFatal(pusch_dmrs[slot][symb]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); - for (q=0; q<2; q++) { - pusch_dmrs[slot][symb][q] = (uint32_t *)malloc16(NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + for (q=0; qsymbols_per_slot; symb++) { - pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *)); + pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_NB_NSCID*sizeof(uint32_t *)); AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb); - for (int q=0; qNid_cell); // compute the scrambling IDs for PDSCH DMRS - for (int i=0; i<2; i++) { + for (int i=0; iscramblingID_dlsch[i]=fp->Nid_cell; nr_gold_pdsch(ue, i, ue->scramblingID_dlsch[i]); } // initialize the pusch dmrs - for (int i=0; i<2; i++) { + for (int i=0; iscramblingID_ulsch[i]=fp->Nid_cell; nr_init_pusch_dmrs(ue, ue->scramblingID_ulsch[i], i); } diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index d3352fb520..f38df302c6 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -114,6 +114,8 @@ #define NR_RX_NB_TH 1 #define NR_NB_TH_SLOT 2 +#define NR_NB_NSCID 2 + extern const uint8_t nr_rv_round_map[4]; static inline From e7500354c1440d5447cb84d5345d2ce0363c6339 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 7 Mar 2022 16:02:01 +0100 Subject: [PATCH 668/883] harmonize RLC and PDCP configurations in nr_DRB_preconfiguration() and fill_default_secondaryCellGroup() nr_DRB_preconfiguration() is used in phy-test mode by both, OAI UE and gNB, and in all other modes by OAI UE. Because of inconsistencies, data transfer with OAI UE was only reliably working in phy-test mode. Ultimately, OAI UE should use nr_DRB_preconfiguration() only in phy-test mode and do proper DRB configuration instead in all other modes! --- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 7 ++++--- openair2/RRC/NR/rrc_gNB_reconfig.c | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index a08c9d2c78..0c869ceeb1 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -1156,9 +1156,9 @@ void nr_DRB_preconfiguration(uint16_t crnti) drb_ToAddMod->pdcp_Config->drb->discardTimer = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->discardTimer)); *drb_ToAddMod->pdcp_Config->drb->discardTimer=NR_PDCP_Config__drb__discardTimer_infinity; drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL)); - *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len12bits; + *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits; drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL)); - *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len12bits; + *drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits; drb_ToAddMod->pdcp_Config->drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed; drb_ToAddMod->pdcp_Config->drb->headerCompression.choice.notUsed = 0; @@ -1188,7 +1188,8 @@ void nr_DRB_preconfiguration(uint16_t crnti) NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig)); nr_rlc_bearer_init(RLC_BearerConfig,NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity); - nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); + nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional); + //nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig); Rlc_Bearer_ToAdd_list = calloc(1,sizeof(*Rlc_Bearer_ToAdd_list)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index b4938404bd..610fd8e699 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -89,10 +89,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco secondaryCellGroup->cellGroupId = scg_id; NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig)); nr_rlc_bearer_init(RLC_BearerConfig, NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity); - if (get_softmodem_params()->do_ra || get_softmodem_params()->sa) - nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional); - else - nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); + nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional); + //nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig); secondaryCellGroup->rlc_BearerToAddModList = calloc(1,sizeof(*secondaryCellGroup->rlc_BearerToAddModList)); From e3901a499be0bd5584421a65adc2ee8696703fe0 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 7 Mar 2022 16:22:50 +0100 Subject: [PATCH 669/883] call process_CellGroup() after add_new_nr_ue() in gNB_scheduler_ulsch.c In case of do-ra mode (NSA) the OAI UE needs this, so the gNB correctly establishes the DRB. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 34d4496eee..4b72b9cea3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -818,6 +818,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); UE_info->active[UE_id] = true; + process_CellGroup(ra->CellGroup, UE_scheduling_control); + } else { LOG_A(NR_MAC,"[RAPROC] RA-Msg3 received (sdu_lenP %d)\n",sdu_lenP); From 473328a0576f1665858799f2356290e15d4c139f Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Mon, 7 Mar 2022 18:00:57 +0100 Subject: [PATCH 670/883] Add support for USRP X400 --- targets/ARCH/COMMON/common_lib.h | 2 + targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 53 ++++++++++++++------ 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 0c71a9999a..7228fe24eb 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -92,6 +92,8 @@ typedef enum { USRP_X300_DEV, /*!\brief device is USRP N300/N310*/ USRP_N300_DEV, + /*!\brief device is USRP X400/X410*/ + USRP_X400_DEV, /*!\brief device is BLADE RF*/ BLADERF_DEV, /*!\brief device is LMSSDR (SoDeRa)*/ diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index e3b06a6438..76517a34a1 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -273,18 +273,20 @@ static int sync_to_gps(openair0_device *device) { static int trx_usrp_start(openair0_device *device) { usrp_state_t *s = (usrp_state_t *)device->priv; - // setup GPIO for TDD, GPIO(4) = ATR_RX - //set data direction register (DDR) to output - s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff); - //set lower 7 bits to be controlled automatically by ATR (the rest 5 bits are controlled manually) - s->usrp->set_gpio_attr("FP0", "CTRL", 0x7f,0xfff); - //set pins 4 (RX_TX_Switch) and 6 (Shutdown PA) to 1 when the radio is only receiving (ATR_RX) - s->usrp->set_gpio_attr("FP0", "ATR_RX", (1<<4)|(1<<6), 0x7f); - // set pin 5 (Shutdown LNA) to 1 when the radio is transmitting and receiveing (ATR_XX) - // (we use full duplex here, because our RX is on all the time - this might need to change later) - s->usrp->set_gpio_attr("FP0", "ATR_XX", (1<<5), 0x7f); - // set the output pins to 1 - s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80); + if (device->type != USRP_X400_DEV) { + // setup GPIO for TDD, GPIO(4) = ATR_RX + //set data direction register (DDR) to output + s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff); + //set lower 7 bits to be controlled automatically by ATR (the rest 5 bits are controlled manually) + s->usrp->set_gpio_attr("FP0", "CTRL", 0x7f,0xfff); + //set pins 4 (RX_TX_Switch) and 6 (Shutdown PA) to 1 when the radio is only receiving (ATR_RX) + s->usrp->set_gpio_attr("FP0", "ATR_RX", (1<<4)|(1<<6), 0x7f); + // set pin 5 (Shutdown LNA) to 1 when the radio is transmitting and receiveing (ATR_XX) + // (we use full duplex here, because our RX is on all the time - this might need to change later) + s->usrp->set_gpio_attr("FP0", "ATR_XX", (1<<5), 0x7f); + // set the output pins to 1 + s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80); + } s->wait_for_first_pps = 1; s->rx_count = 0; @@ -847,7 +849,7 @@ rx_gain_calib_table_t calib_table_x310[] = { {-1,0} }; -/*! \brief USRPB210 RX calibration table */ +/*! \brief USRPn3xf RX calibration table */ rx_gain_calib_table_t calib_table_n310[] = { {3500000000.0,0.0}, {2660000000.0,0.0}, @@ -857,6 +859,16 @@ rx_gain_calib_table_t calib_table_n310[] = { {-1,0} }; +/*! \brief Empty RX calibration table */ +rx_gain_calib_table_t calib_table_none[] = { + {3500000000.0,0.0}, + {2660000000.0,0.0}, + {2300000000.0,0.0}, + {1880000000.0,0.0}, + {816000000.0, 0.0}, + {-1,0} +}; + /*! \brief Set RX gain offset * \param openair0_cfg RF frontend parameters set by application @@ -1011,7 +1023,6 @@ extern "C" { device->type=USRP_N300_DEV; usrp_master_clock = 122.88e6; args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock); - //args += ", send_buff_size=33554432"; } if (device_adds[0].get("type") == "x300") { @@ -1025,6 +1036,13 @@ extern "C" { LOG_W(HW,"Can't set kernel parameters for X3xx\n"); } + if (device_adds[0].get("type") == "x4xx") { + printf("Found USRP x400\n"); + device->type = USRP_X400_DEV; + usrp_master_clock = 245.76e6; + args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock); + } + s->usrp = uhd::usrp::multi_usrp::make(args); if (args.find("clock_source")==std::string::npos) { @@ -1103,8 +1121,13 @@ extern "C" { std::cerr << "-- Using calibration table: calib_table_n310" << std::endl; } + if (device->type == USRP_X400_DEV) { + openair0_cfg[0].rx_gain_calib_table = calib_table_none; + std::cerr << "-- Using calibration table: calib_table_none" << std::endl; + } - if (device->type==USRP_N300_DEV || device->type==USRP_X300_DEV) { + + if (device->type==USRP_N300_DEV || device->type==USRP_X300_DEV || device->type==USRP_X400_DEV) { LOG_I(HW,"%s() sample_rate:%u\n", __FUNCTION__, (int)openair0_cfg[0].sample_rate); switch ((int)openair0_cfg[0].sample_rate) { From 4d9ee5d11c8cb5417aa8709ce8ebcc2ab2661138 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 2 Mar 2022 11:56:31 +0100 Subject: [PATCH 671/883] Add X400 to devtype_names, make char* array --- targets/ARCH/COMMON/common_lib.c | 23 +++++++++++++++++++---- targets/ARCH/COMMON/common_lib.h | 6 ++++-- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index c4f4e3ead5..08daf58cf7 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -43,16 +43,31 @@ //#include "targets/RT/USER/lte-softmodem.h" #include "executables/softmodem-common.h" -char *get_devname(int devtype) { -char *devnames[MAX_RF_DEV_TYPE]=DEVTYPE_NAMES; +const char* devtype_names[MAX_RF_DEV_TYPE] = { + "", + "EXMIMO", + "USRP B200", + "USRP X300", + "USRP N300", + "USRP X400", + "BLADERF", + "LMSSDR", + "IRIS", + "No HW", + "ADRV9371_ZC706", + "UEDv2", + "RFSIMULATOR" +}; + +const char *get_devname(int devtype) { if (devtype < MAX_RF_DEV_TYPE && devtype !=MIN_RF_DEV_TYPE ) - return devnames[devtype]; + return devtype_names[devtype]; return "none"; } int set_device(openair0_device *device) { - char *devname = get_devname(device->type); + const char *devname = get_devname(device->type); if (strcmp(devname,"none") != 0) { LOG_I(HW,"[%s] has loaded %s device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"),devname); } else { diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 7228fe24eb..38a7b0fa67 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -109,7 +109,9 @@ typedef enum { RFSIMULATOR, MAX_RF_DEV_TYPE } dev_type_t; -#define DEVTYPE_NAMES {"","EXMIMO","USRP B200","USRP X300","USRP N300","BLADERF","LMSSDR","IRIS","No HW","ADRV9371_ZC706","UEDv2", "RFSIMULATOR"} +/* list of names of devices, needs to match dev_type_t */ +extern const char* devtype_names[MAX_RF_DEV_TYPE]; + /*!\brief transport protocol types */ typedef enum { @@ -537,7 +539,7 @@ extern "C" /*! \brief get device name from device type */ -char *get_devname(int devtype); +const char *get_devname(int devtype); /*! \brief Initialize openair RF target. It returns 0 if OK */ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg); /*! \brief Initialize transport protocol . It returns 0 if OK */ From d03a8b387fa7a730773e1f7e4b0f64b2c865ee21 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 3 Mar 2022 17:29:26 +0100 Subject: [PATCH 672/883] Set kernel parameters when loading N300 --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 76517a34a1..4259304643 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -1023,6 +1023,9 @@ extern "C" { device->type=USRP_N300_DEV; usrp_master_clock = 122.88e6; args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock); + + if ( 0 != system("sysctl -w net.core.rmem_max=62500000 net.core.wmem_max=62500000") ) + LOG_W(HW,"Can't set kernel parameters for N3x0\n"); } if (device_adds[0].get("type") == "x300") { From a6049bcddf06e4bdedea9738ff096fedba34b281 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 7 Mar 2022 11:59:23 -0800 Subject: [PATCH 673/883] Relying on mac->ra.ra_state instead of RRC state. --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index d6abb15c02..2dd7e0cb27 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1494,8 +1494,8 @@ static inline bool is_channel_modeling(void) Replace with a command line option to enable/disable channel modeling. The LTE UE will crash when channel modeling is conducted for NSA mode. It does not crash for LTE mode. We have not implemented channel - modeling for NSA mode yet. For now, we ensure only do do chanel modeling - in LTE mode. */ + modeling for NSA mode yet. For now, we ensure only do do channel modeling + in LTE/NR mode. */ return get_softmodem_params()->node_number == 0 && !get_softmodem_params()->nsa; } @@ -1506,13 +1506,11 @@ static bool should_drop_transport_block(int slot, uint16_t rnti) return false; } - /* We want to avoid dropping setup messages because this would be pathological. - This assumes were in standalone_pnf mode where - UE_rrc_inst[0] is module_id = 0 and Info[0] is eNB_index = 0. */ - NR_UE_STATE_t state = NR_UE_rrc_inst[0].Info[0].State; - if (state < NR_RRC_CONNECTED) + /* We want to avoid dropping setup messages because this would be pathological. */ + NR_UE_MAC_INST_t *mac = get_mac_inst(0); + if (mac->ra.ra_state < RA_SUCCEEDED) { - LOG_I(NR_MAC, "Not dropping because state: %d", state); + LOG_I(NR_MAC, "Not dropping because MAC state: %d", mac->ra.ra_state); return false; } @@ -1522,7 +1520,7 @@ static bool should_drop_transport_block(int slot, uint16_t rnti) int num_pdus = slot_rnti_mcs[slot].num_pdus; assert(slot < 20 && slot >= 0); LOG_I(NR_MAC, "rnti: %x num_pdus %d state %d slot %u sinr %f\n", - rnti, num_pdus, state, slot, slot_rnti_mcs[slot].sinr); + rnti, num_pdus, mac->ra.ra_state, slot, slot_rnti_mcs[slot].sinr); assert(num_pdus > 0); CHECK_INDEX(slot_rnti_mcs[slot].rnti, num_pdus); CHECK_INDEX(slot_rnti_mcs[slot].mcs, num_pdus); From b66d18747770e09c7bd5fc224820a76986af560f Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 7 Mar 2022 12:00:10 -0800 Subject: [PATCH 674/883] Including more UE conf files for multi-UE tests --- .../episci/episci_nr-ue4.nfapi.conf | 45 +++++++++++++++++++ .../episci/episci_nr-ue5.nfapi.conf | 45 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 ci-scripts/conf_files/episci/episci_nr-ue4.nfapi.conf create mode 100644 ci-scripts/conf_files/episci/episci_nr-ue5.nfapi.conf diff --git a/ci-scripts/conf_files/episci/episci_nr-ue4.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue4.nfapi.conf new file mode 100644 index 0000000000..3d1d53463d --- /dev/null +++ b/ci-scripts/conf_files/episci/episci_nr-ue4.nfapi.conf @@ -0,0 +1,45 @@ +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"; +}; + +uicc0 = { +imsi = "208950000000035"; +key = "0c0a34601d4f07677303652c0462535b"; +opc= "63bfa50ee6523365ff14c1f45f88737d"; +dnn= "oai"; +nssai_sst=222; +nssai_sd=123; +} + +L1s = ( + { + num_cc = 1; + tr_n_preference = "nfapi"; + local_n_if_name = "ens3"; + remote_n_address = "127.0.0.1"; //Proxy IP + local_n_address = "127.0.0.1"; + local_n_portc = 50600; + remote_n_portc = 50601; + local_n_portd = 50610; + remote_n_portd = 50611; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 90 + att_rx = 0; + bands = [7,38,42,43]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 125; + } +); diff --git a/ci-scripts/conf_files/episci/episci_nr-ue5.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue5.nfapi.conf new file mode 100644 index 0000000000..98b4c341ca --- /dev/null +++ b/ci-scripts/conf_files/episci/episci_nr-ue5.nfapi.conf @@ -0,0 +1,45 @@ +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"; +}; + +uicc0 = { +imsi = "208950000000036"; +key = "0c0a34601d4f07677303652c0462535b"; +opc= "63bfa50ee6523365ff14c1f45f88737d"; +dnn= "oai"; +nssai_sst=222; +nssai_sd=123; +} + +L1s = ( + { + num_cc = 1; + tr_n_preference = "nfapi"; + local_n_if_name = "ens3"; + remote_n_address = "127.0.0.1"; //Proxy IP + local_n_address = "127.0.0.1"; + local_n_portc = 50600; + remote_n_portc = 50601; + local_n_portd = 50610; + remote_n_portd = 50611; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 90 + att_rx = 0; + bands = [7,38,42,43]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 125; + } +); From d8209228e74a5e91b67c1e883c0795ff2821377b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 7 Mar 2022 23:24:25 +0100 Subject: [PATCH 675/883] Hide warning of unused variable From the comment above the line with the warning: > This asn1cCalloc leaks memory but also masks a bug. > If we delete this asn1cCalloc statement, eNB will crash in NSA mode. > Please don't delete the following line unless the bug has been found --- openair2/RRC/LTE/MESSAGES/asn1_msg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.c b/openair2/RRC/LTE/MESSAGES/asn1_msg.c index c3e41978e5..bd09540627 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.c @@ -4297,6 +4297,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer, If we delete this asn1cCalloc statement, eNB will crash in NSA mode. Please don't delete the following line unless the bug has been found. */ asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2); + (void) measresult_cgi2; struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult; asn1cCallocOne(measResult->rsrpResult, rsrp_tar); asn1cCallocOne(measResult->rsrqResult, rsrq_tar); From f2e21b73812fe7a453807b9a696f044c5394ef1f Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 8 Mar 2022 07:47:46 +0100 Subject: [PATCH 676/883] removed AssertFatal in nr_sch_dmrs.c which prevented using type B configuration (e.g. for 10 MHz test in CI) --- openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c b/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c index 159f1172f8..a62138621d 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c +++ b/openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c @@ -92,6 +92,5 @@ uint8_t get_l0(uint16_t dlDmrsSymbPos) { if ((mask&1) == 1) break; mask>>=1; } - AssertFatal(l0 < 4,"impossible l0 %d, dlDmrsSymbPos %x\n",l0,dlDmrsSymbPos); return (l0); } From 05a63b60e5ce7b26e929af7d11b89c4d5dfe0c16 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 8 Mar 2022 10:58:31 +0100 Subject: [PATCH 677/883] fix(doc): README does not have anymore the license info * Also added obsolence messages for the old L2 simulator since 2022.w01 EpiSci merge * Added link to their new tutorial Signed-off-by: Raphael Defosseux --- README.md | 28 +++++++--------------------- doc/L2NFAPI.md | 15 +++++++++++++++ doc/L2NFAPI_NOS1.md | 4 ++++ doc/L2NFAPI_S1.md | 4 ++++ doc/RUNMODEM.md | 2 +- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 4f38f77e4e..2077b3d20b 100644 --- a/README.md +++ b/README.md @@ -21,28 +21,14 @@ # OpenAirInterface License # -### Included Fixes: ### -- Ease of use of gprof and address sanitizer for debugging purposes -- Updated json files to allow for GDB, real-time debugging capabilities -- Updated logging features to minimally log only key connection milestones. This imroves scalability of multiple UEs. -- Updated logging to include time stamp for timing analysis -- Updated memory allocation procedures to correct size requirements -- Added debugging features to handle signal terminations -- nfapi.c pullarray8 fix invalid pointer math -- Overlapping destination and source memory in memcpy, so updated to memmove to check for this bug -- Advanced error checking mechanisms in critical pack and unpack functions -- Created option for CPU assignment to UE to improve scalability -- Added EPC integration to allow multiple individual UE entities to each have their USIM information parced by the executables -- Updated random value seeds to minimize probability of error in generation of random values -- Enables capability round robin scheduler if desired -- Enables capability real time scheduler if desired -- Added new standalone functions to the UE phy-layer (phy_stub_ue.c) to incorporate individual UE entities -- Updated sending and packing functions in UE (lte_ue.c) to incorporate new standalone changes -- Incorporated semaphores to control timing of incoming downlink packets -- Implemented new queuing system to handle message exchange from UE to eNB and vice versa -- Updated global value in nFAPI for size of subframe -- Updated global value to increase scalability in system + * [OAI License Model](http://www.openairinterface.org/?page_id=101) + * [OAI License v1.1 on our website](http://www.openairinterface.org/?page_id=698) +It is distributed under **OAI Public License V1.1**. + +The license information is distributed under [LICENSE](LICENSE) file in the same directory. + +Please see [NOTICE](NOTICE.md) file for third party software that is included in the sources. # Where to Start # diff --git a/doc/L2NFAPI.md b/doc/L2NFAPI.md index 137e4847e4..5b8c0f546c 100644 --- a/doc/L2NFAPI.md +++ b/doc/L2NFAPI.md @@ -18,6 +18,10 @@ The UE executable is able to "simulate" multiple UEs in order to stimulate the s **This simulator is available starting the `v1.0.0` release on the `master` branch.** +**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.** + +**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.** + Currently the Continuous Integration process is validating this simulator the following way: * the LTE modem executable is run on one host (in our CI deployment it is a **Xenial Virtual Machine**) @@ -31,6 +35,17 @@ Normally it should be fine to run both executables on the same host using the `l 1. [With S1 -- eNB and UE on 2 hosts](L2NFAPI_S1.md) 2. [No S1 -- eNB and UE on 2 hosts](L2NFAPI_NOS1.md) + +**2022/03/08: Starting the `2022.w01` tag on the `develop` branch, the L2 nFAPI simulation is using a proxy.** + +A tutorial is available on the [EpiSci GitHub Repository](https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy#readme). + +This proxy allows to perform L2 nFAPI simulator for: + +* LTE +* 5G-NSA +* 5G-SA + ---- [oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home) diff --git a/doc/L2NFAPI_NOS1.md b/doc/L2NFAPI_NOS1.md index bb4c32ec08..4f56be3416 100644 --- a/doc/L2NFAPI_NOS1.md +++ b/doc/L2NFAPI_NOS1.md @@ -12,6 +12,10 @@ +**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.** + +**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.** + ## Table of Contents ## 1. [Environment](#1-environment) diff --git a/doc/L2NFAPI_S1.md b/doc/L2NFAPI_S1.md index 9fd6d51818..824e9e469a 100644 --- a/doc/L2NFAPI_S1.md +++ b/doc/L2NFAPI_S1.md @@ -12,6 +12,10 @@ +**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.** + +**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.** + ## Table of Contents ## 1. [Environment](#1-environment) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 449859b042..7ee3ae9d7e 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -33,7 +33,7 @@ It is planned to enhance this simulator with the following functionalities: This simulator connects a eNodeB and UEs through a nfapi interface, short-cutting the L1 layer. The objective of this simulator is to allow multi UEs simulation, with a large number of UEs (ideally up to 255 ) .Here to ease the platform setup, UEs are simulated via a single `lte-uesoftmodem` instance. Today the CI tests just with one UE and architecture has to be reviewed to allow a number of UE above about 16. This work is on-going. -As for the rf simulator, no specific hardware is required. The [L2 nfapi simlator page](L2NFAPI.md) contains the detailed documentation. +As for the rf simulator, no specific hardware is required. The [L2 nfapi simulator page](L2NFAPI.md) contains the detailed documentation. # L1 Simulator From afb4cab5e1eb936218f58fb347a4a7b95e4feb29 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 8 Mar 2022 14:29:07 +0100 Subject: [PATCH 678/883] fix dl retransmissions --- cmake_targets/autotests/test_case_list.xml | 8 ++++---- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 18 +++++++++++------- openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 2 ++ openair1/SIMULATION/NR_PHY/dlsim.c | 5 +++-- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 7497fb419c..ce1b9dcdf4 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1093,10 +1093,10 @@ (Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset), (Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27), (Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16), - (Test11: 106 MCS-TABLE 256 QAM MCS Index 26), - (Test12: HARQ test 25% TP (4 rounds), - (Test13: HARQ test 33% TP (3 rounds), - (Test14: HARQ test 50% TP (2 rounds), + (Test11: 106 MCS-TABLE 256 QAM MCS Index 27), + (Test12: HARQ test 25% TP 4 rounds), + (Test13: HARQ test 33% TP 3 rounds), + (Test14: HARQ test 50% TP 2 rounds), (Test15: 3 PTRS, 8 Interpolated Symbols), (Test16: 6 PTRS, 5 Interpolated Symbols), (Test17: 11 PTRS, 0 Interpolated Symbols), diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 0e2abf40aa..54b7c34608 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -102,9 +102,12 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) { for (int r=0; rharq_processes[i]->c[r],1056); dlsch->harq_processes[i]->c[r] = NULL; + free16(dlsch->harq_processes[i]->d[r],5*8448); + dlsch->harq_processes[i]->d[r] = NULL; nrLDPC_free_mem(dlsch->harq_processes[i]->p_nrLDPC_procBuf[r]); } free16(dlsch->harq_processes[i]->c,a_segments); + free16(dlsch->harq_processes[i]->d,a_segments); free16(dlsch->harq_processes[i]->p_nrLDPC_procBuf,a_segments); free16(dlsch->harq_processes[i],sizeof(NR_DL_UE_HARQ_t)); @@ -157,13 +160,16 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint exit_flag=3; dlsch->harq_processes[i]->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *)); + dlsch->harq_processes[i]->d = (int16_t **)malloc16(a_segments*sizeof(int16_t *)); dlsch->harq_processes[i]->p_nrLDPC_procBuf = (t_nrLDPC_procBuf **)malloc16(a_segments*sizeof(t_nrLDPC_procBuf *)); for (int r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem(); dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056); - + dlsch->harq_processes[i]->d[r] = (int16_t *)malloc16(5*8448*sizeof(int16_t)); if (dlsch->harq_processes[i]->c[r]) memset(dlsch->harq_processes[i]->c[r],0,1056); + if (dlsch->harq_processes[i]->d[r]) + memset(dlsch->harq_processes[i]->d[r],0,5*8448); else exit_flag=2; } @@ -323,13 +329,11 @@ void nr_processDLSegment(void* arg) { harq_process->round); */ //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN); - int16_t d[5*8448]; - memset(d,0,(5*8448)*sizeof(short)); if (nr_rate_matching_ldpc_rx(Ilbrm, Tbslbrm, p_decoderParms->BG, p_decoderParms->Z, - d, + harq_process->d[r], w, harq_process->C, harq_process->rvidx, @@ -351,7 +355,7 @@ void nr_processDLSegment(void* arg) { LOG_D(PHY,"decoder input(segment %u) :",r); for (int i=0; id[r][i]); LOG_D(PHY,"\n"); } @@ -377,9 +381,9 @@ void nr_processDLSegment(void* arg) { //set Filler bits memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t)); //Move coded bits before filler bits - memcpy((&z[0]+2*harq_process->Z),d,(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); + memcpy((&z[0]+2*harq_process->Z),harq_process->d[r],(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); //skip filler bits - memcpy((&z[0]+Kr),d+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); + memcpy((&z[0]+Kr),harq_process->d[r]+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); //Saturate coded bits before decoding into 8 bits values for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index a5ff4a18ff..f76119250f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -180,6 +180,8 @@ typedef struct { uint8_t *b; /// Pointers to transport block segments uint8_t **c; + /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) + int16_t **d; /// Index of current HARQ round for this DLSCH uint8_t round; /// MCS table for this DLSCH diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index cdc1106b0c..c3ff79ab07 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -656,7 +656,7 @@ int main(int argc, char **argv) printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", argv[0]); printf("-h This message\n"); - printf("-L \n"); + printf("-L \n"); //printf("-p Use extended prefix mode\n"); //printf("-d Use TDD\n"); printf("-n Number of frames to simulate\n"); @@ -1324,7 +1324,8 @@ int main(int argc, char **argv) printf("*****************************************\n"); printf("\n"); dump_pdsch_stats(stdout,gNB); - printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS); + printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", + SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS); printf("\n"); if (print_perf==1) { From d1cd5b771b9b8aebe036904d7a2e6e986db0f8aa Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 8 Mar 2022 07:47:44 -0800 Subject: [PATCH 679/883] Clean up to nFAPI and error checking UL_TTI_REQ n_pdus We seprarated out the large if block in the push/pull of the UL_TTI_REQ fields to make it easier to read and debug. Furthermore, we add in AsserFatals before indexing in UL_TTI_REQ PDU list to ensure we are not indexing past the end of the array. --- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 42 ++++++++++++------- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 5 +++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 4 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 3 ++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 ++ 5 files changed, 41 insertions(+), 16 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index cfd4cf64f4..ba30d8f469 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -1583,14 +1583,21 @@ static uint8_t pack_ul_config_request_body_value(void *tlv, uint8_t **ppWritePac static uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t *config) { nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg; - if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) && - push16(pNfapiMsg->Slot, ppWritePackedMsg, end) && - push8(pNfapiMsg->n_pdus, ppWritePackedMsg, end) && - push8(pNfapiMsg->rach_present, ppWritePackedMsg, end) && - push8(pNfapiMsg->n_ulsch, ppWritePackedMsg, end) && - push8(pNfapiMsg->n_ulcch, ppWritePackedMsg, end) && - push8(pNfapiMsg->n_group, ppWritePackedMsg, end) )) + if (!push16(pNfapiMsg->SFN, ppWritePackedMsg, end)) return 0; + if (!push16(pNfapiMsg->Slot, ppWritePackedMsg, end)) + return 0; + if (!push8(pNfapiMsg->n_pdus, ppWritePackedMsg, end)) + return 0; + if (!push8(pNfapiMsg->n_group, ppWritePackedMsg, end)) + return 0; + if (!push8(pNfapiMsg->rach_present, ppWritePackedMsg, end)) + return 0; + if (!push8(pNfapiMsg->n_ulsch, ppWritePackedMsg, end)) + return 0; + if (!push8(pNfapiMsg->n_ulcch, ppWritePackedMsg, end)) + return 0; + for(int i=0; in_pdus; i++) { if(!pack_ul_tti_pdu_list_value(&pNfapiMsg->pdus_list[i], ppWritePackedMsg, end)) @@ -4655,14 +4662,19 @@ static uint8_t unpack_ul_tti_groups_list_value(uint8_t **ppReadPackedMsg, uint8_ static uint8_t unpack_ul_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t *config) { nfapi_nr_ul_tti_request_t *pNfapiMsg = (nfapi_nr_ul_tti_request_t *)msg; - if (!( - pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end) && - pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->n_pdus, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->n_group, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->rach_present, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->n_ulcch, end) && - pull8(ppReadPackedMsg, &pNfapiMsg->n_ulsch, end) )) + if (!pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end)) + return 0; + if (!pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end)) + return 0; + if (!pull8(ppReadPackedMsg, &pNfapiMsg->n_pdus, end)) + return 0; + if (!pull8(ppReadPackedMsg, &pNfapiMsg->n_group, end)) + return 0; + if (!pull8(ppReadPackedMsg, &pNfapiMsg->rach_present, end)) + return 0; + if (!pull8(ppReadPackedMsg, &pNfapiMsg->n_ulcch, end)) + return 0; + if (!pull8(ppReadPackedMsg, &pNfapiMsg->n_ulsch, end)) return 0; for(int i=0; i< pNfapiMsg->n_pdus; i++) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index a10845a6ab..1d28fe8ed2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -300,6 +300,8 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP (RA_sfn_index + slot_index) * N_t_slot * fdm + td_index * fdm + fdm_index; if((prach_occasion_id < cc->total_prach_occasions) && (td_index == 0)){ + AssertFatal(UL_tti_req->n_pdus < sizeof(UL_tti_req->pdus_list) / sizeof(UL_tti_req->pdus_list[0]), + "Invalid UL_tti_req->n_pdus %d\n", UL_tti_req->n_pdus); UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE; UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_prach_pdu_t); @@ -801,6 +803,9 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t future_ul_tti_req->Slot, sched_frame, sched_slot); + AssertFatal(future_ul_tti_req->n_pdus < + sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]), + "Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus); future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE; future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pusch_pdu_t); nfapi_nr_pusch_pdu_t *pusch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pusch_pdu; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index a2b27357dd..bf2af3b388 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -85,7 +85,9 @@ void nr_configure_srs(nfapi_nr_srs_pdu_t *srs_pdu, int module_id, int CC_id, int void nr_fill_nfapi_srs(int module_id, int CC_id, int UE_id, sub_frame_t slot, NR_SRS_Resource_t *srs_resource) { nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][slot]; - + AssertFatal(future_ul_tti_req->n_pdus < + sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]), + "Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus); future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE; future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_srs_pdu_t); nfapi_nr_srs_pdu_t *srs_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].srs_pdu; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index cfff41a6ad..a7cf8993b7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -55,6 +55,9 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, future_ul_tti_req->Slot, pucch->frame, pucch->ul_slot); + AssertFatal(future_ul_tti_req->n_pdus < + sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]), + "Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus); future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE; future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pucch_pdu_t); nfapi_nr_pucch_pdu_t *pucch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pucch_pdu; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 7e092784dc..c9ede37785 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1704,6 +1704,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) future_ul_tti_req->Slot, sched_pusch->frame, sched_pusch->slot); + AssertFatal(future_ul_tti_req->n_pdus < + sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]), + "Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus); future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE; future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pusch_pdu_t); nfapi_nr_pusch_pdu_t *pusch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pusch_pdu; From 73bd9034aa49b8b2846e31c4c65eac278060cd68 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 9 Mar 2022 14:39:38 +0100 Subject: [PATCH 680/883] Use strtok_r() to split strings in gnb_config.c --- openair2/GNB_APP/gnb_config.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 2aaf15ae82..f5ff7ddf9e 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -624,15 +624,18 @@ void RCconfig_NR_L1(void) { config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr; if (ulprbbl) LOG_I(NR_PHY,"PRB blacklist %s\n",ulprbbl); - char *pt = strtok(ulprbbl,","); + char *save = NULL; + char *pt = strtok_r(ulprbbl, ",", &save); int prbbl[275]; int num_prbbl=0; memset(prbbl,0,275*sizeof(int)); while (pt) { - prbbl[atoi(pt)] = 1; + const int rb = atoi(pt); + AssertFatal(rb < 275, "RB %d out of bounds (max 275)\n", rb); + prbbl[rb] = 0x3FFF; // all symbols taken LOG_I(NR_PHY,"Blacklisting prb %d\n",atoi(pt)); - pt = strtok(NULL,","); + pt = strtok_r(NULL, ",", &save); num_prbbl++; } @@ -736,15 +739,16 @@ void RCconfig_nr_macrlc() { config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL); char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr; - char *pt = strtok(ulprbbl,","); + char *save = NULL; + char *pt = strtok_r(ulprbbl, ",", &save); uint16_t prbbl[275]; int num_prbbl=0; - int prb; memset(prbbl,0,sizeof(prbbl)); while (pt) { - prb=atoi(pt); + const int prb = atoi(pt); + AssertFatal(prb < 275, "RB %d out of bounds (max 275)\n", prb); prbbl[prb] = 0x3FFF; // all symbols taken - pt = strtok(NULL,","); + pt = strtok_r(NULL, ",", &save); num_prbbl++; } @@ -1458,7 +1462,8 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) { // NGAP_REGISTER_GNB_REQ (msg_p).enb_interface_name_for_NGU = strdup(enb_interface_name_for_NGU); cidr = *(NETParams[GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX].strptr); - address = strtok(cidr, "/"); + char *save = NULL; + address = strtok_r(cidr, "/", &save); NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv6 = 0; NGAP_REGISTER_GNB_REQ (msg_p).gnb_ip_address.ipv4 = 1; @@ -1730,7 +1735,8 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) { } cidr = *(NETParams[ENB_IPV4_ADDR_FOR_X2C_IDX].strptr); - address = strtok(cidr, "/"); + char *save = NULL; + address = strtok_r(cidr, "/", &save); X2AP_REGISTER_ENB_REQ (msg_p).enb_x2_ip_address.ipv6 = 0; X2AP_REGISTER_ENB_REQ (msg_p).enb_x2_ip_address.ipv4 = 1; strcpy(X2AP_REGISTER_ENB_REQ (msg_p).enb_x2_ip_address.ipv4_address, address); From e7508533b651de5cdb21aa62f1950442b49e0f68 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 9 Mar 2022 14:57:26 +0100 Subject: [PATCH 681/883] review fix --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 7d32eb1007..b4b44c26f0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1551,7 +1551,6 @@ bool test_acknack_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, } // verifying occupation of PRBs for ACK/NACK on dedicated pucch - bool ret = true; for (int l=0; lnr_of_symb; l++) { uint16_t symb = SL_to_bitmap(pucch->start_symb+l, 1); int prb; @@ -1560,11 +1559,11 @@ bool test_acknack_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, else prb = pucch->prb_start; if ((vrb_map_UL[bwp_start+prb] & symb) != 0) { - ret = false; + return false; break; } } - return ret; + return true; } From 0c28328986a2b3a6fdb0d7fed4412a26aef1783b Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 10 Mar 2022 15:19:42 +0530 Subject: [PATCH 682/883] Fixed merge errors --- openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index d79f2821b3..94aa6f73eb 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -113,8 +113,8 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint a_segments = a_segments/273 +1; } - uint16_t ulsch_bytes = a_segments*1056; // allocated bytes per segment - ulsch = (NR_gNB_ULSCH_t *)malloc16(sizeof(NR_gNB_ULSCH_t)); + uint32_t ulsch_bytes = a_segments*1056; // allocated bytes per segment + ulsch = (NR_gNB_ULSCH_t *)malloc16_clear(sizeof(NR_gNB_ULSCH_t)); ulsch->max_ldpc_iterations = max_ldpc_iterations; ulsch->Mlimit = 4; @@ -132,7 +132,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint } } - return(NULL); + return(ulsch); } void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch) From 48cd851cab084f11a68c407bca63ce656cfb0641 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 10 Mar 2022 18:31:46 +0100 Subject: [PATCH 683/883] SA SR bugfix --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index cfff41a6ad..3b0d49bc7a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -79,7 +79,9 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, NR_BWP_UplinkDedicated_t *ubwpd; ubwpd = cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL; - LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); + LOG_D(NR_MAC,"%d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch to be scheduled in %d.%d\n", + frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); + nr_configure_pucch(pucch_pdu, scc, UE_info->CellGroup[UE_id], @@ -1885,6 +1887,7 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot) sched_sr.frame = SFN; sched_sr.ul_slot = slot; sched_sr.resource_indicator = found; + sched_sr.r_pucch = -1; sched_sr.sr_flag = true; nr_fill_nfapi_pucch(Mod_idP, SFN, slot, &sched_sr, UE_id); } From d24068a33b173d9d8ba9a49310e5c843db0e8767 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 11 Mar 2022 01:23:39 +0100 Subject: [PATCH 684/883] some bugfixes for CSI reporting with PUCCH2. Configuration of cqi_Table 2 for CSI reporting when 256-QAM is enabled. --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 6 ++-- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 2 -- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 3 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 32 ++++++++++++++----- openair2/RRC/NR/MESSAGES/asn1_msg.c | 4 +-- openair2/RRC/NR/nr_rrc_config.c | 12 +++++++ openair2/RRC/NR/nr_rrc_config.h | 1 + openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- 8 files changed, 45 insertions(+), 17 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index db36b39f99..beab48b977 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -1178,9 +1178,9 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, } } } -#ifdef DEBUG_NR_PUCCH_RX - printf("Decoding pucch2 for %d symbols, %d PRB\n",pucch_pdu->nr_of_symbols,pucch_pdu->prb_size); -#endif + LOG_D(PHY,"Decoding pucch2 for %d symbols, %d PRB, nb_harq %d, nb_sr %d, nb_csi %d/%d\n", + pucch_pdu->nr_of_symbols,pucch_pdu->prb_size, + pucch_pdu->bit_len_harq,pucch_pdu->sr_flag,pucch_pdu->bit_len_csi_part1,pucch_pdu->bit_len_csi_part2); int nc_group_size=1; // 2 PRB int ngroup = prb_size_ext/nc_group_size/2; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 94b7ab18bf..d36e02b606 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -4057,8 +4057,6 @@ uint16_t compute_pucch_prb_size(uint8_t format, if ((O_tot+O_csi)>(nr_prbs*n_re_ctrl*n_symb*Qm*r)) AssertFatal(1==0,"MaxCodeRate %.2f can't support %d UCI bits and %d CRC bits with %d PRBs", r,O_tot,O_crc,nr_prbs); - else - return nr_prbs; } if (format==2){ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 81f4169e13..d2f726e0fc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -156,7 +156,8 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, uint16_t target_coderate,target_qm; if (cqi_idx>0) { int cqi_table = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table; - AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n"); + if (cqi_table != mcs_table_idx) + LOG_W(NR_MAC,"Indices of MCS tables don't correspond yet, cri_ri_li_pmi_cqi_report.cqi_table %d, mcs_table_index %d\n",cqi_table,mcs_table_idx); switch (cqi_table) { case 0: target_qm = cqi_table1[cqi_idx][0]; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 3688ac7771..53df37d139 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1559,7 +1559,6 @@ int nr_acknack_scheduling(int mod_id, // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration AssertFatal(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD,"Dynamic TDD not handled yet\n"); - NR_sched_pucch_t *csi_pucch; /* for the moment, we consider: * * only pucch_sched[0] holds HARQ (and SR) @@ -1578,13 +1577,18 @@ int nr_acknack_scheduling(int mod_id, 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: %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n", __FUNCTION__, frame, slot, f, s); - nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); + if (!(csi_pucch + && csi_pucch->csi_bits > 0 + && csi_pucch->frame == f + && csi_pucch->ul_slot == s)) + nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; if(((s + 1)%nr_slots_period) == 0) @@ -1592,11 +1596,11 @@ int nr_acknack_scheduling(int mod_id, else pucch->ul_slot = (s + 1) % n_slots_frame; // we assume that only two indices over the array sched_pucch exist - csi_pucch = &sched_ctrl->sched_pucch[1]; // 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_bits > 0 + if (csi_pucch + && csi_pucch->csi_bits > 0 && csi_pucch->frame == pucch->frame && csi_pucch->ul_slot == pucch->ul_slot && !csi_pucch->simultaneous_harqcsi) { @@ -1653,7 +1657,10 @@ int nr_acknack_scheduling(int mod_id, const int s = pucch->ul_slot; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; LOG_D(NR_MAC, "In %s: %d.%d DAI > 0, cannot reach timing for pucch in %d.%d, advancing slot by 1 and trying again\n", __FUNCTION__, frame, slot, f, s); - nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); + if (!(csi_pucch && + csi_pucch->csi_bits > 0 && + csi_pucch->frame == f && + csi_pucch->ul_slot == s)) nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id); memset(pucch, 0, sizeof(*pucch)); pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; if(((s + 1)%nr_slots_period) == 0) @@ -1665,6 +1672,14 @@ int nr_acknack_scheduling(int mod_id, 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: %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); return 0; @@ -1725,8 +1740,6 @@ int nr_acknack_scheduling(int mod_id, return -1; } - // is there already CSI in this slot? - csi_pucch = &sched_ctrl->sched_pucch[1]; if (csi_pucch && csi_pucch->csi_bits > 0 && csi_pucch->frame == pucch->frame && @@ -1755,7 +1768,10 @@ int nr_acknack_scheduling(int mod_id, else { csi_pucch->timing_indicator = ind_found; csi_pucch->dai_c++; - memset(pucch,0,sizeof(*pucch)); + // keep updating format 2 indicator + pucch->timing_indicator = ind_found; // index in the list of timing indicators + 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; } diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 73bb941af9..1bbecb3328 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1782,14 +1782,14 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP; set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing, - uecap, bwp_Dedicated, scc); + uecap, SpCellConfig, bwp_Dedicated, scc); struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; if (DL_BWP_list) { for (int i=0; ilist.count; i++){ NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i]; int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing; - set_dl_mcs_table(scs, uecap, bwp->bwp_Dedicated, carrier->servingcellconfigcommon); + set_dl_mcs_table(scs, uecap, SpCellConfig,bwp->bwp_Dedicated, carrier->servingcellconfigcommon); } } } diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 3cde364fb8..87543da5f9 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -172,6 +172,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap, + NR_SpCellConfig_t *SpCellConfig, NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_ServingCellConfigCommon_t *scc) { @@ -210,6 +211,17 @@ void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap, if(bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table == NULL) bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = calloc(1, sizeof(*bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table)); *bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NR_PDSCH_Config__mcs_Table_qam256; +// set table 2 in correct entry in SpCellConfig->spCellConfigDedicated->csi_MeasConfig->csi_ReportConfigToAddModList->list + AssertFatal(SpCellConfig!=NULL,"SpCellConfig shouldn't be null\n"); + AssertFatal(SpCellConfig->spCellConfigDedicated!=NULL,"SpCellConfigDedicated shouldn't be null\n"); + if (SpCellConfig->spCellConfigDedicated->csi_MeasConfig && + SpCellConfig->spCellConfigDedicated->csi_MeasConfig->present== NR_SetupRelease_CSI_MeasConfig_PR_setup && + SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup && + SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList) + for (int i=0;ispCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.count;i++) { + if (SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.array[i]->cqi_Table) + *SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup->csi_ReportConfigToAddModList->list.array[i]->cqi_Table=NR_CSI_ReportConfig__cqi_Table_table2; + } } else bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL; diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index 1a0d091e35..16a92b9a7e 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -114,6 +114,7 @@ typedef struct physicalcellgroup_s{ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc); void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay); void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap, + NR_SpCellConfig_t *SpCellConfig, NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_ServingCellConfigCommon_t *scc); void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 35412f4c0c..747db7878c 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -605,7 +605,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, uecap, bwp->bwp_Dedicated, servingcellconfigcommon); + set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, uecap, secondaryCellGroup->spCellConfig, bwp->bwp_Dedicated, servingcellconfigcommon); bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; From 595dd27ab02506d341eaa7929117a2ebac770b62 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 11 Mar 2022 09:43:35 +0100 Subject: [PATCH 685/883] Configure only one address for asterix's N310 Deletes the second_addr parameter in all files that also use the mgmt_addr=192.168.18.240 (asterix's N310). --- ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 2 +- ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 082cc826f3..7e6590cde2 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -258,7 +258,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 6af8a23407..3eeaac9875 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -254,7 +254,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index e798e40d64..c7ae676108 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -232,7 +232,7 @@ RUs = ( bf_weights = [0x00007fff, 0x00007fff]; #clock_src = "external"; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index b92c7df92d..3d94d65f6e 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -261,7 +261,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 6c778a7c31..83e947411d 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -265,7 +265,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 5c826ca862..c5effb39cd 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -260,7 +260,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" } ); From 0c5242ea8516e2b4ad428c753dc0175a9e9a1ea9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 11 Mar 2022 11:36:07 +0000 Subject: [PATCH 686/883] Apply review comment --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 3b0d49bc7a..e1663d535d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1882,13 +1882,13 @@ void nr_sr_reporting(int Mod_idP, frame_t SFN, sub_frame_t slot) } curr_pucch->sr_flag = true; } else { - NR_sched_pucch_t sched_sr; - memset(&sched_sr, 0, sizeof(sched_sr)); - sched_sr.frame = SFN; - sched_sr.ul_slot = slot; - sched_sr.resource_indicator = found; - sched_sr.r_pucch = -1; - sched_sr.sr_flag = true; + NR_sched_pucch_t sched_sr = { + .frame = SFN, + .ul_slot = slot, + .sr_flag = true, + .resource_indicator = found, + .r_pucch = -1 + }; nr_fill_nfapi_pucch(Mod_idP, SFN, slot, &sched_sr, UE_id); } } From 1ab1fde7b83c4b57582cd43c1a34672a8fa17d65 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 11 Mar 2022 14:00:30 +0100 Subject: [PATCH 687/883] fix for fdd and other warnings --- executables/nr-softmodem.c | 2 +- openair2/LAYER2/NR_MAC_gNB/config.c | 8 ++------ openair2/RRC/NR/MESSAGES/asn1_msg.c | 1 + openair2/RRC/NR/nr_rrc_config.c | 8 ++------ 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c index 2fe6c86b41..1c75d9a155 100644 --- a/executables/nr-softmodem.c +++ b/executables/nr-softmodem.c @@ -741,7 +741,7 @@ int main( int argc, char **argv ) { RC.ru[ru_id]->rf_map.card=0; RC.ru[ru_id]->rf_map.chain=CC_id+chain_offset; if (ru_id==0) sl_ahead = RC.ru[ru_id]->sl_ahead; - else AssertFatal(RC.ru[ru_id]->sl_ahead != RC.ru[0]->sl_ahead,"RU %d has different sl_ahead %d than RU 0 %d\n",RC.ru[ru_id]->sl_ahead,RC.ru[0]->sl_ahead); + else AssertFatal(RC.ru[ru_id]->sl_ahead != RC.ru[0]->sl_ahead,"RU %d has different sl_ahead %d than RU 0 %d\n",ru_id,RC.ru[ru_id]->sl_ahead,RC.ru[0]->sl_ahead); } } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index aaa97fea87..943bb04cb7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -446,11 +446,8 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, AssertFatal(RC.nrmac[Mod_idP]->UL_tti_req_ahead[0], "could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n"); /* fill in slot/frame numbers: slot is fixed, frame will be updated by scheduler - extern sf_ahead is initialized in ru_thread but that function is not executed yet here*/ - const uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing))); - const uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing)); - /* consider that scheduler runs sl_ahead: the first sl_ahead slots are - * already "in the past" and thus we put frame 1 instead of 0!*/ + * consider that scheduler runs sl_ahead: the first sl_ahead slots are + * already "in the past" and thus we put frame 1 instead of 0! */ for (int i = 0; i < n; ++i) { nfapi_nr_ul_tti_request_t *req = &RC.nrmac[Mod_idP]->UL_tti_req_ahead[0][i]; req->SFN = i < (RC.nrmac[Mod_idP]->if_inst->sl_ahead-1); @@ -667,7 +664,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_OUT); - return(0); }// END rrc_mac_config_req_gNB diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 1bbecb3328..1830a3ca3a 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -41,6 +41,7 @@ #include #include +#include "LAYER2/nr_rlc/nr_rlc_oai_api.h" #include "asn1_msg.h" #include "../nr_rrc_proto.h" #include "RRC/NR/nr_rrc_extern.h" diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 87543da5f9..2dbb8c93d5 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -110,13 +110,10 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ //TODO change to accomodate for SRS lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); - int temp_min_delay; + int temp_min_delay = 6; // k2 = 2 or 3 won'r work as well as higher values if(frame_type==TDD && scc->tdd_UL_DL_ConfigurationCommon) { - + switch (scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity) { - default: - temp_min_delay = 6; - break; case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms2p5: // 30kHz SCS case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms2: // 60kHz SCS case NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms1p25: // 60kHz SCS @@ -128,7 +125,6 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ } } - int k2 = (min_fb_delay Date: Mon, 14 Mar 2022 11:48:09 +0000 Subject: [PATCH 688/883] Move ternary operators to outside of functions input parameters --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 3 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 23 +++++++++------ .../NR_MAC_gNB/gNB_scheduler_primitives.c | 11 ++++---- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 9 ++++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 28 +++++++++++-------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 8 +++--- 6 files changed, 48 insertions(+), 34 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 25708ad5fe..790718e184 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -869,7 +869,8 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t dci_pdu_rel15_t uldci_payload; memset(&uldci_payload, 0, sizeof(uldci_payload)); - config_uldci(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + const NR_SIB1_t *sib1 = cc->sib1 ? cc->sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; + config_uldci(sib1, ubwp, ubwpd, scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 04440eb49a..28f28b62c2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -86,7 +86,8 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * else { target_ss = NR_SearchSpace__searchSpaceType_PR_common; } - NR_SearchSpace_t *search_space = get_searchspace(nrmac->common_channels[0].sib1 ? nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + const NR_SIB1_t *sib1 = nrmac->common_channels[0].sib1 ? nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; + NR_SearchSpace_t *search_space = get_searchspace(sib1, scc, bwp ? bwp->bwp_Dedicated : NULL, target_ss); @@ -97,7 +98,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * NR_PDSCH_TimeDomainResourceAllocationList_t *tdaList = get_pdsch_TimeDomainAllocationList(bwp, scc, - nrmac->common_channels[0].sib1 ? (const NR_SIB1_t *)nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); AssertFatal(tdaList->list.count >= 1, "need to have at least one TDA for DL slots\n"); /* check that TDA index 0 fits into DL and does not overlap CORESET */ @@ -577,9 +578,10 @@ bool allocate_dl_retransmission(module_id_t module_id, cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp, RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -610,7 +612,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ if (ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) { - nr_set_pdsch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + nr_set_pdsch_semi_static(sib1, scc, cg, sched_ctrl->active_bwp, @@ -626,7 +628,7 @@ bool allocate_dl_retransmission(module_id_t module_id, * that we have enough resources */ NR_pdsch_semi_static_t temp_ps = *ps; - nr_set_pdsch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + nr_set_pdsch_semi_static(sib1, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, @@ -843,10 +845,11 @@ void pf_dl(module_id_t module_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; const uint16_t rnti = UE_info->rnti[UE_id]; + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp, RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -920,7 +923,7 @@ void pf_dl(module_id_t module_id, NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) { - nr_set_pdsch_semi_static(mac->common_channels[0].sib1 ? (const NR_SIB1_t *)mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + nr_set_pdsch_semi_static(sib1, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, @@ -995,9 +998,10 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp, RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); NR_BWP_DownlinkDedicated_t *bwpd = UE_info->CellGroup[UE_id] && @@ -1172,9 +1176,10 @@ void nr_schedule_ue_spec(module_id_t module_id, sched_ctrl->tpc1); NR_BWP_Downlink_t *bwp = sched_ctrl->active_bwp; + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(bwp, RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space : gNB_mac->sched_ctrlCommon->search_space; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 1962dcfb97..5a6e571457 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -228,7 +228,7 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { NR_BWP_t *get_dl_bwp_genericParameters(NR_BWP_Downlink_t *active_bwp, NR_ServingCellConfigCommon_t *ServingCellConfigCommon, - NR_SIB1_t *sib1) { + const NR_SIB1_t *sib1) { NR_BWP_t *genericParameters = NULL; if (active_bwp) { genericParameters = &active_bwp->bwp_Common->genericParameters; @@ -242,7 +242,7 @@ NR_BWP_t *get_dl_bwp_genericParameters(NR_BWP_Downlink_t *active_bwp, NR_BWP_t *get_ul_bwp_genericParameters(NR_BWP_Uplink_t *active_ubwp, NR_ServingCellConfigCommon_t *ServingCellConfigCommon, - NR_SIB1_t *sib1) { + const NR_SIB1_t *sib1) { NR_BWP_t *genericParameters = NULL; if (active_ubwp) { genericParameters = &active_ubwp->bwp_Common->genericParameters; @@ -305,7 +305,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, } } -NR_SearchSpace_t *get_searchspace(NR_SIB1_t *sib1, +NR_SearchSpace_t *get_searchspace(const NR_SIB1_t *sib1, NR_ServingCellConfigCommon_t *scc, NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_SearchSpace__searchSpaceType_PR target_ss) { @@ -1096,7 +1096,7 @@ int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset, } // This function configures pucch pdu fapi structure -void nr_configure_pucch(NR_SIB1_t *sib1, +void nr_configure_pucch(const NR_SIB1_t *sib1, nfapi_nr_pucch_pdu_t* pucch_pdu, NR_ServingCellConfigCommon_t *scc, NR_CellGroupConfig_t *CellGroup, @@ -2309,7 +2309,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG &sched_ctrl->active_bwp->bwp_Common->genericParameters: &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common; - sched_ctrl->search_space = get_searchspace(nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + const NR_SIB1_t *sib1 = nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; + sched_ctrl->search_space = get_searchspace(sib1, scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 10a21cd07d..765e01868e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -82,7 +82,8 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); - nr_configure_pucch(nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + const NR_SIB1_t *sib1 = nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; + nr_configure_pucch(sib1, pucch_pdu, scc, UE_info->CellGroup[UE_id], @@ -743,9 +744,10 @@ void nr_csi_meas_reporting(int Mod_idP, curr_pucch->csi_bits += nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id); + const NR_SIB1_t *sib1 = RC.nrmac[Mod_idP]->common_channels[0].sib1 ? RC.nrmac[Mod_idP]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, scc, - RC.nrmac[Mod_idP]->common_channels[0].sib1 ? RC.nrmac[Mod_idP]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); @@ -1757,9 +1759,10 @@ int nr_acknack_scheduling(int mod_id, pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; } + const NR_SIB1_t *sib1 = RC.nrmac[mod_id]->common_channels[0].sib1 ? RC.nrmac[mod_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, (NR_ServingCellConfigCommon_t *)scc, - RC.nrmac[mod_id]->common_channels[0].sib1 ? RC.nrmac[mod_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 4a788d3f1c..b4749aafee 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -991,9 +991,10 @@ bool allocate_ul_retransmission(module_id_t module_id, cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, (NR_ServingCellConfigCommon_t *)scc, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); int rbStart = 0; // wrt BWP start const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -1020,7 +1021,7 @@ bool allocate_ul_retransmission(module_id_t module_id, || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data || sched_ctrl->update_pusch_ps) { - nr_set_pusch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + nr_set_pusch_semi_static(sib1, scc, sched_ctrl->active_ubwp, ubwpd, @@ -1041,7 +1042,7 @@ bool allocate_ul_retransmission(module_id_t module_id, rbSize++; NR_pusch_semi_static_t temp_ps; int dci_format = get_dci_format(sched_ctrl); - nr_set_pusch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + nr_set_pusch_semi_static(sib1, scc, sched_ctrl->active_ubwp, ubwpd, @@ -1161,6 +1162,7 @@ void pf_ul(module_id_t module_id, gNB_MAC_INST *nrmac = RC.nrmac[module_id]; NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; NR_UE_info_t *UE_info = &nrmac->UE_info; + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; const int min_rb = 5; float coeff_ue[MAX_MOBILES_PER_GNB]; // UEs that could be scheduled @@ -1177,7 +1179,7 @@ void pf_ul(module_id_t module_id, NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, scc, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); int rbStart = 0; // wrt BWP start NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; @@ -1281,7 +1283,7 @@ void pf_ul(module_id_t module_id, || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data || sched_ctrl->update_pusch_ps) { - nr_set_pusch_semi_static(nrmac->common_channels[0].sib1 ? (const NR_SIB1_t *)nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + nr_set_pusch_semi_static(sib1, scc, sched_ctrl->active_ubwp, ubwpd, @@ -1383,7 +1385,7 @@ void pf_ul(module_id_t module_id, NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, scc, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0; const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -1414,7 +1416,7 @@ void pf_ul(module_id_t module_id, || ps->dci_format != dci_format || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data || sched_ctrl->update_pusch_ps) { - nr_set_pusch_semi_static(nrmac->common_channels[0].sib1 ? (const NR_SIB1_t *)nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + nr_set_pusch_semi_static(sib1, scc, sched_ctrl->active_ubwp, ubwpd, @@ -1465,8 +1467,9 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t gNB_MAC_INST *nr_mac = RC.nrmac[module_id]; NR_COMMON_channels_t *cc = nr_mac->common_channels; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; - NR_ServingCellConfigCommonSIB_t *scc_sib1 = get_softmodem_params()->sa ? - RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1->servingCellConfigCommon : NULL; + const NR_SIB1_t *sib1 = get_softmodem_params()->sa ? + RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; + NR_ServingCellConfigCommonSIB_t *scc_sib1 = get_softmodem_params()->sa ? sib1->servingCellConfigCommon : NULL; AssertFatal(scc!=NULL || scc_sib1!=NULL,"We need one serving cell config common\n"); @@ -1535,7 +1538,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, scc, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); const uint16_t bwpStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); @@ -1646,6 +1649,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; const NR_list_t *UE_list = &UE_info->list; for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; @@ -1779,7 +1783,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) /* FAPI: BWP */ NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp, scc, - RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); + sib1); pusch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pusch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); @@ -1930,7 +1934,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) n_ubwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count; } - config_uldci(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, + config_uldci(sib1, sched_ctrl->active_ubwp, ubwpd, scc, diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index dbe1a61404..7d38931051 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -242,7 +242,7 @@ int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset, NR_BWP_UplinkDedicated_t *bwpd, int CCEIndex); -void nr_configure_pucch(NR_SIB1_t *sib1, +void nr_configure_pucch(const NR_SIB1_t *sib1, nfapi_nr_pucch_pdu_t* pucch_pdu, NR_ServingCellConfigCommon_t *scc, NR_CellGroupConfig_t *CellGroup, @@ -302,11 +302,11 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup, NR_BWP_t *get_dl_bwp_genericParameters(NR_BWP_Downlink_t *active_bwp, NR_ServingCellConfigCommon_t *ServingCellConfigCommon, - NR_SIB1_t *sib1); + const NR_SIB1_t *sib1); NR_BWP_t *get_ul_bwp_genericParameters(NR_BWP_Uplink_t *active_ubwp, NR_ServingCellConfigCommon_t *ServingCellConfigCommon, - NR_SIB1_t *sib1); + const NR_SIB1_t *sib1); NR_PDSCH_TimeDomainResourceAllocationList_t *get_pdsch_TimeDomainAllocationList(const NR_BWP_Downlink_t *active_bwp, const NR_ServingCellConfigCommon_t *ServingCellConfigCommon, @@ -320,7 +320,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_SearchSpace__searchSpaceType_PR ss_type); /* find a search space within a BWP */ -NR_SearchSpace_t *get_searchspace(NR_SIB1_t *sib1, +NR_SearchSpace_t *get_searchspace(const NR_SIB1_t *sib1, NR_ServingCellConfigCommon_t *scc, NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_SearchSpace__searchSpaceType_PR target_ss); From 2e0d8fd7537e5b5fa76a43e863e18cf1d53dd851 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 15 Mar 2022 08:56:21 -0700 Subject: [PATCH 689/883] Removing TimeDomainAllocationList from conf file Also updating pdcch_config for SIB1 --- ...sci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 9 -------- .../episci_rcc.band78.tm1.106PRB.nfapi.conf | 17 +++++++------- ...oxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 9 -------- .../proxy_rcc.band78.tm1.106PRB.nfapi.conf | 23 ------------------- 4 files changed, 8 insertions(+), 50 deletions(-) diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index a98179197f..e498e2a5c8 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -73,15 +73,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL diff --git a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf index d8485483d8..f7e14591a0 100644 --- a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf @@ -25,6 +25,14 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; min_rxtxtime = 6; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); servingCellConfigCommon = ( { #spCellConfigCommon @@ -54,15 +62,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 0; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 0597e96245..93835f6a1c 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -74,15 +74,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; #for DL slot - initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB - initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 - - initialDLBWPk0_1 = 0; #for mixed slot - initialDLBWPmappingType_1 = 0; - initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 #uplinkConfigCommon #frequencyInfoUL diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf index 9d74803161..32248559ce 100644 --- a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf @@ -54,29 +54,6 @@ gNBs = #pdcch-ConfigCommon initialDLBWPcontrolResourceSetZero = 12; initialDLBWPsearchSpaceZero = 0; - #pdsch-ConfigCommon - #pdschTimeDomainAllocationList (up to 16 entries) - initialDLBWPk0_0 = 0; - #initialULBWPmappingType - #0=typeA,1=typeB - initialDLBWPmappingType_0 = 0; - #this is SS=1,L=13 - initialDLBWPstartSymbolAndLength_0 = 40; - - initialDLBWPk0_1 = 0; - initialDLBWPmappingType_1 = 0; - #this is SS=2,L=12 - initialDLBWPstartSymbolAndLength_1 = 53; - - initialDLBWPk0_2 = 0; - initialDLBWPmappingType_2 = 0; - #this is SS=1,L=12 - initialDLBWPstartSymbolAndLength_2 = 54; - - initialDLBWPk0_3 = 0; - initialDLBWPmappingType_3 = 0; - #this is SS=1,L=5 - initialDLBWPstartSymbolAndLength_3 = 57; #uplinkConfigCommon #frequencyInfoUL From 5a8b235ab4872c1f88391cee7f7d37db5baa8422 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 16 Mar 2022 09:59:21 +0100 Subject: [PATCH 690/883] Fix: make simulators compile --- nfapi/oai_integration/nfapi_vnf.c | 22 ++-- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 8 +- openair1/SIMULATION/NR_PHY/dlsim.c | 3 - openair1/SIMULATION/NR_PHY/prachsim.c | 2 + openair1/SIMULATION/NR_PHY/ulsim.c | 3 - openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 134 ++++++++++---------- 6 files changed, 84 insertions(+), 88 deletions(-) diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index d19d2db597..6bc5a736de 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -244,13 +244,13 @@ void oai_create_gnb(void) { if (RC.gNB == NULL) { RC.gNB = (PHY_VARS_gNB **) calloc(1, sizeof(PHY_VARS_gNB *)); - LOG_I(PHY,"gNB L1 structure RC.gNB allocated @ %p\n",RC.gNB); + LOG_D(PHY,"gNB L1 structure RC.gNB allocated @ %p\n",RC.gNB); } if (RC.gNB[0] == NULL) { RC.gNB[0] = (PHY_VARS_gNB *) calloc(1, sizeof(PHY_VARS_gNB)); - LOG_I(PHY,"[nr-gnb.c] gNB structure RC.gNB[%d] allocated @ %p\n",0,RC.gNB[0]); + LOG_D(PHY,"[nr-gnb.c] gNB structure RC.gNB[%d] allocated @ %p\n",0,RC.gNB[0]); } PHY_VARS_gNB *gNB = RC.gNB[0]; @@ -491,7 +491,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) { L1_proc->frame_tx = (L1_proc->slot_rx > (19-slot_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; L1_proc->slot_tx = (L1_proc->slot_rx + slot_ahead)%20; - //LOG_I(PHY, "sfn/sf:%d%d proc[rx:%d%d] rx:%d%d] About to wake rxtx thread\n\n", sfn, slot, proc->frame_rx, proc->slot_rx, L1_proc->frame_rx, L1_proc->slot_rx); + //LOG_D(PHY, "sfn/sf:%d%d proc[rx:%d%d] rx:%d%d] About to wake rxtx thread\n\n", sfn, slot, proc->frame_rx, proc->slot_rx, L1_proc->frame_rx, L1_proc->slot_rx); //NFAPI_TRACE(NFAPI_TRACE_INFO, "\nEntering wake_gNB_rxtx sfn %d slot %d\n",L1_proc->frame_rx,L1_proc->slot_rx); // the thread can now be woken up if (pthread_cond_signal(&L1_proc->cond) != 0) { @@ -757,7 +757,7 @@ int phy_nr_rach_indication(nfapi_nr_rach_indication_t *ind) int phy_nr_uci_indication(nfapi_nr_uci_indication_t *ind) { - LOG_I(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n", + LOG_D(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n", __FUNCTION__,ind->sfn, ind->slot, ind->num_ucis); if(NFAPI_MODE == NFAPI_MODE_VNF) { @@ -950,7 +950,7 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_ int phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { - LOG_I(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n", + LOG_D(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n", __FUNCTION__,ind->sfn, ind->slot, ind->number_crcs); if(NFAPI_MODE == NFAPI_MODE_VNF) @@ -973,7 +973,7 @@ int phy_nr_crc_indication(nfapi_nr_crc_indication_t *ind) { crc_ind->crc_list[j].tb_crc_status = ind->crc_list[j].tb_crc_status; crc_ind->crc_list[j].timing_advance = ind->crc_list[j].timing_advance; crc_ind->crc_list[j].ul_cqi = ind->crc_list[j].ul_cqi; - LOG_I(NR_MAC, "Received crc_ind.harq_id = %d for %d index SFN SLot %u %u with rnti %x\n", + LOG_D(NR_MAC, "Received crc_ind.harq_id = %d for %d index SFN SLot %u %u with rnti %x\n", ind->crc_list[j].harq_id, j, ind->sfn, ind->slot, ind->crc_list[j].rnti); } if (!put_queue(&gnb_crc_ind_queue, crc_ind)) @@ -1069,7 +1069,7 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t int phy_nr_rx_data_indication(nfapi_nr_rx_data_indication_t *ind) { - LOG_I(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u, and pdu %p\n", + LOG_D(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u, and pdu %p\n", __FUNCTION__,ind->sfn, ind->slot, ind->number_of_pdus, ind->pdu_list[0].pdu); if(NFAPI_MODE == NFAPI_MODE_VNF) @@ -1171,7 +1171,7 @@ static void analyze_cqi_pdus_for_duplicates(nfapi_cqi_indication_t *ind) { nfapi_cqi_indication_pdu_t *src_pdu = &ind->cqi_indication_body.cqi_pdu_list[i]; - LOG_I(MAC, "CQI_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti, + LOG_D(MAC, "CQI_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti, src_pdu->ul_cqi_information.ul_cqi, src_pdu->ul_cqi_information.channel); for (int j = i + 1; j < num_cqis; j++) @@ -1893,7 +1893,7 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config; dl_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!! dl_config_req->header.message_id = NFAPI_DL_CONFIG_REQUEST; - LOG_I(PHY, "[VNF] %s() DL_CONFIG_REQ sfn_sf:%d_%d number_of_pdus:%d\n", __FUNCTION__, + LOG_D(PHY, "[VNF] %s() DL_CONFIG_REQ sfn_sf:%d_%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2SFN(dl_config_req->sfn_sf),NFAPI_SFNSF2SF(dl_config_req->sfn_sf), dl_config_req->dl_config_request_body.number_pdu); if (dl_config_req->dl_config_request_body.number_pdu > 0) { @@ -1904,7 +1904,7 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { { uint16_t dl_rnti = dl_config_req->dl_config_request_body.dl_config_pdu_list[i].dlsch_pdu.dlsch_pdu_rel8.rnti; uint16_t numPDUs = dl_config_req->dl_config_request_body.number_pdu; - LOG_I(MAC, "(OAI eNB) Sending dl_config_req at VNF during Frame: %d and Subframe: %d," + LOG_D(MAC, "(OAI eNB) Sending dl_config_req at VNF during Frame: %d and Subframe: %d," " with a RNTI value of: %x and with number of PDUs: %u\n", NFAPI_SFNSF2SFN(dl_config_req->sfn_sf),NFAPI_SFNSF2SF(dl_config_req->sfn_sf), dl_rnti, numPDUs); } @@ -2062,7 +2062,7 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { { uint8_t pdu_type = pdu_list[i].pdu_type; - LOG_I(MAC, "ul_config_req num_pdus: %u pdu_number: %d pdu_type: %u SFN.SF: %d.%d\n", + LOG_D(MAC, "ul_config_req num_pdus: %u pdu_number: %d pdu_type: %u SFN.SF: %d.%d\n", num_pdus, i, pdu_type, ul_config_req->sfn_sf >> 4, ul_config_req->sfn_sf & 15); if (pdu_type != NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 5f2f0e88ca..9bdaabd00b 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -117,7 +117,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response "Too many ul_config pdus %d", ul_config->number_pdus); for (int i = 0; i < ul_config->number_pdus; ++i) { - LOG_I(NR_PHY, "In %s: processing type %d PDU of %d total UL PDUs (ul_config %p) \n", + LOG_D(NR_PHY, "In %s: processing type %d PDU of %d total UL PDUs (ul_config %p) \n", __FUNCTION__, ul_config->ul_config_list[i].pdu_type, ul_config->number_pdus, ul_config); uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type; @@ -218,7 +218,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response uci_ind->uci_list = CALLOC(uci_ind->num_ucis, sizeof(*uci_ind->uci_list)); for (int j = 0; j < uci_ind->num_ucis; j++) { - LOG_I(NR_MAC, "ul_config->ul_config_list[%d].pucch_config_pdu.n_bit = %d\n", i, ul_config->ul_config_list[i].pucch_config_pdu.n_bit); + LOG_D(NR_MAC, "ul_config->ul_config_list[%d].pucch_config_pdu.n_bit = %d\n", i, ul_config->ul_config_list[i].pucch_config_pdu.n_bit); if (ul_config->ul_config_list[i].pucch_config_pdu.n_bit > 3 && mac->nr_ue_emul_l1.num_csi_reports > 0) { uci_ind->uci_list[j].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE; @@ -265,7 +265,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response } } - LOG_I(NR_PHY, "Sending UCI with %d PDUs in sfn.slot %d/%d\n", + LOG_D(NR_PHY, "Sending UCI with %d PDUs in sfn.slot %d/%d\n", uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot); NR_UL_IND_t ul_info = { .uci_ind = *uci_ind, @@ -276,7 +276,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response } default: - LOG_I(NR_MAC, "Unknown ul_config->pdu_type %d\n", pdu_type); + LOG_W(NR_MAC, "Unknown ul_config->pdu_type %d\n", pdu_type); break; } } diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 780fd42989..e998125e04 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -87,9 +87,6 @@ PHY_VARS_NR_UE *UE; RAN_CONTEXT_t RC; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; -/* dummy constant */ -NR_UE_RRC_INST_t *NR_UE_rrc_inst; - double cpuf; char *uecap_file; diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index bc4f4a0b60..f255ab5337 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -223,6 +223,8 @@ nrUE_params_t *get_nrUE_params(void) { return &nrUE_params; } +nr_bler_struct nr_bler_data[NR_NUM_MCS]; + void processSlotTX(void *arg) {} int main(int argc, char **argv){ diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 6efd423419..0144d0c0d3 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -93,9 +93,6 @@ THREAD_STRUCT thread_struct; nfapi_ue_release_request_body_t release_rntis; uint32_t N_RB_DL = 106; -/* dummy constant */ -NR_UE_RRC_INST_t *NR_UE_rrc_inst; - //Fixme: Uniq dirty DU instance, by global var, datamodel need better management instance_t DUuniqInstance=0; instance_t CUuniqInstance=0; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 2dd7e0cb27..3db2770af8 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -109,7 +109,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) } assert(ue_tx_sock_descriptor == -1); ue_tx_sock_descriptor = sd; - LOG_D(NR_RRC, "Successfully set up tx_socket in %s.\n", __FUNCTION__); + LOG_T(NR_RRC, "Successfully set up tx_socket in %s.\n", __FUNCTION__); } { @@ -135,9 +135,9 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) } assert(ue_rx_sock_descriptor == -1); ue_rx_sock_descriptor = sd; - LOG_D(NR_RRC, "Successfully set up rx_socket in %s.\n", __FUNCTION__); + LOG_T(NR_RRC, "Successfully set up rx_socket in %s.\n", __FUNCTION__); } - LOG_I(NR_RRC, "NRUE standalone socket info: tx_port %d rx_port %d on %s.\n", + LOG_D(NR_RRC, "NRUE standalone socket info: tx_port %d rx_port %d on %s.\n", tx_port, rx_port, stub_eth_params.remote_addr); } @@ -148,7 +148,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION: { char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - LOG_D(NR_MAC, "RACH header id :%d\n", UL_INFO->rach_ind.header.message_id); + LOG_T(NR_MAC, "RACH header id :%d\n", UL_INFO->rach_ind.header.message_id); int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->rach_ind, buffer, sizeof(buffer), NULL); if (encoded_size <= 0) { @@ -156,7 +156,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) return; } - LOG_I(NR_MAC, "NR_RACH_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size, + LOG_D(NR_MAC, "NR_RACH_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size, UL_INFO->rach_ind.sfn, UL_INFO->rach_ind.slot, UL_INFO->rach_ind.number_of_pdus); if (send(ue_tx_sock_descriptor, buffer, encoded_size, 0) < 0) { @@ -168,7 +168,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION: { char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - LOG_D(NR_MAC, "RX header id :%d\n", UL_INFO->rx_ind.header.message_id); + LOG_T(NR_MAC, "RX header id :%d\n", UL_INFO->rx_ind.header.message_id); int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->rx_ind, buffer, sizeof(buffer), NULL); if (encoded_size <= 0) { @@ -176,7 +176,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) return; } - LOG_I(NR_MAC, "NR_RX_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size, + LOG_D(NR_MAC, "NR_RX_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size, UL_INFO->rx_ind.sfn, UL_INFO->rx_ind.slot, UL_INFO->rx_ind.number_of_pdus); if (send(ue_tx_sock_descriptor, buffer, encoded_size, 0) < 0) { @@ -188,7 +188,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: { char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - LOG_D(NR_MAC, "CRC header id :%d\n", UL_INFO->crc_ind.header.message_id); + LOG_T(NR_MAC, "CRC header id :%d\n", UL_INFO->crc_ind.header.message_id); int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->crc_ind, buffer, sizeof(buffer), NULL); if (encoded_size <= 0) { @@ -196,7 +196,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) return; } - LOG_I(NR_MAC, "NR_CRC_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size, + LOG_D(NR_MAC, "NR_CRC_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size, UL_INFO->crc_ind.sfn, UL_INFO->crc_ind.slot, UL_INFO->crc_ind.number_crcs); if (send(ue_tx_sock_descriptor, buffer, encoded_size, 0) < 0) { @@ -208,7 +208,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION: { char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE]; - LOG_I(NR_MAC, "UCI header id :%d\n", UL_INFO->uci_ind.header.message_id); + LOG_D(NR_MAC, "UCI header id :%d\n", UL_INFO->uci_ind.header.message_id); int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->uci_ind, buffer, sizeof(buffer), NULL); if (encoded_size <= 0) { @@ -216,7 +216,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id) return; } - LOG_I(NR_MAC, "NR_UCI_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size, + LOG_D(NR_MAC, "NR_UCI_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size, UL_INFO->uci_ind.sfn, UL_INFO->uci_ind.slot, UL_INFO->uci_ind.num_ucis); if (send(ue_tx_sock_descriptor, buffer, encoded_size, 0) < 0) { @@ -298,11 +298,11 @@ bool sfn_slot_matcher(void *wanted, void *candidate) static void fill_dl_info_with_pdcch(fapi_nr_dci_indication_t *dci, nfapi_nr_dl_dci_pdu_t *rx_dci, int idx) { int num_bytes = (rx_dci->PayloadSizeBits + 7) / 8; - LOG_I(NR_PHY, "[%d, %d] PDCCH DCI (Payload) for rnti %x with PayloadSizeBits %d, num_bytes %d\n", + LOG_D(NR_PHY, "[%d, %d] PDCCH DCI (Payload) for rnti %x with PayloadSizeBits %d, num_bytes %d\n", dci->SFN, dci->slot, rx_dci->RNTI, rx_dci->PayloadSizeBits, num_bytes); for (int k = 0; k < num_bytes; k++) { - LOG_I(NR_MAC, "PDCCH DCI PDU payload[%d] = %d\n", k, rx_dci->Payload[k]); + LOG_D(NR_MAC, "PDCCH DCI PDU payload[%d] = %d\n", k, rx_dci->Payload[k]); dci->dci_list[idx].payloadBits[k] = rx_dci->Payload[k]; } dci->dci_list[idx].payloadSize = rx_dci->PayloadSizeBits; @@ -318,7 +318,7 @@ static void fill_mib_in_rx_ind(nfapi_nr_dl_tti_request_pdu_t *pdu_list, fapi_nr_ "pdu_index (%d) is greater than rx_indication_body size!\n", pdu_idx); AssertFatal(pdu_idx == rx_ind->number_pdus, "Invalid pdu_idx %d!\n", pdu_idx); - LOG_D(NR_MAC, "Recevied an SSB and are filling rx_ind with the MIB!\n"); + LOG_T(NR_MAC, "Recevied an SSB and are filling rx_ind with the MIB!\n"); nfapi_nr_dl_tti_ssb_pdu_rel15_t *ssb_pdu = &pdu_list->ssb_pdu.ssb_pdu_rel15; rx_ind->rx_indication_body[pdu_idx].ssb_pdu.cell_id = ssb_pdu->PhysCellId; @@ -387,13 +387,13 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ nfapi_nr_dl_tti_request_pdu_t *pdu_list = &dl_tti_request->dl_tti_request_body.dl_tti_pdu_list[i]; if (pdu_list->PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) { - LOG_I(NR_PHY, "[%d, %d] PDSCH PDU for rnti %x\n", + LOG_D(NR_PHY, "[%d, %d] PDSCH PDU for rnti %x\n", dl_tti_request->SFN, dl_tti_request->Slot, pdu_list->pdsch_pdu.pdsch_pdu_rel15.rnti); } if (pdu_list->PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) { - LOG_I(NR_PHY, "[%d, %d] PDCCH DCI PDU (Format for incoming PDSCH PDU)\n", + LOG_D(NR_PHY, "[%d, %d] PDCCH DCI PDU (Format for incoming PDSCH PDU)\n", dl_tti_request->SFN, dl_tti_request->Slot); uint16_t num_dcis = pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci; if (num_dcis > 0) @@ -418,19 +418,19 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ { mac->nr_ue_emul_l1.expected_sib = true; mac->nr_ue_emul_l1.index_has_sib[j] = true; - LOG_D(NR_MAC, "Setting index_has_sib[%d] = true\n", j); + LOG_T(NR_MAC, "Setting index_has_sib[%d] = true\n", j); } else if (dci_pdu_list->RNTI == mac->ra.ra_rnti) { mac->nr_ue_emul_l1.expected_rar = true; mac->nr_ue_emul_l1.index_has_rar[j] = true; - LOG_D(NR_MAC, "Setting index_has_rar[%d] = true\n", j); + LOG_T(NR_MAC, "Setting index_has_rar[%d] = true\n", j); } else { mac->nr_ue_emul_l1.expected_dci = true; mac->nr_ue_emul_l1.index_has_dci[j] = true; - LOG_D(NR_MAC, "Setting index_has_dci[%d] = true\n", j); + LOG_T(NR_MAC, "Setting index_has_dci[%d] = true\n", j); } pdu_idx++; } @@ -471,7 +471,7 @@ static void fill_rx_ind(nfapi_nr_pdu_t *pdu_list, fapi_nr_rx_indication_t *rx_in { length += pdu_list->TLVs[j].length; } - LOG_I(NR_PHY, "%s: num_tlv %d and length %d, pdu index %d\n", + LOG_D(NR_PHY, "%s: num_tlv %d and length %d, pdu index %d\n", __FUNCTION__, pdu_list->num_TLV, length, pdu_idx); uint8_t *pdu = malloc(length); AssertFatal(pdu != NULL, "%s: Out of memory in malloc", __FUNCTION__); @@ -537,7 +537,7 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi } else { - LOG_D(NR_MAC, "mac->nr_ue_emul_l1.index_has_dci[%d] = 0, so this index contained a DCI for a different UE\n", i); + LOG_T(NR_MAC, "mac->nr_ue_emul_l1.index_has_dci[%d] = 0, so this index contained a DCI for a different UE\n", i); } } @@ -558,7 +558,7 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n { nfapi_nr_ul_dci_request_pdus_t *pdu_list = &ul_dci_req->ul_dci_pdu_list[i]; AssertFatal(pdu_list->PDUType == 0, "ul_dci_req pdu type != PUCCH"); - LOG_I(NR_PHY, "[%d %d] PUCCH PDU in ul_dci for rnti %x and numDLDCI = %d\n", + LOG_D(NR_PHY, "[%d %d] PUCCH PDU in ul_dci for rnti %x and numDLDCI = %d\n", ul_dci_req->SFN, ul_dci_req->Slot, pdu_list->pdcch_pdu.pdcch_pdu_rel15.dci_pdu->RNTI, pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci); uint16_t num_dci = pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci; @@ -577,7 +577,7 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n nfapi_nr_dl_dci_pdu_t *dci_pdu_list = &pdu_list->pdcch_pdu.pdcch_pdu_rel15.dci_pdu[j]; if (dci_pdu_list->RNTI != mac->crnti) { - LOG_D(NR_MAC, "dci_pdu_list->RNTI (%x) != mac->crnti (%x)\n", dci_pdu_list->RNTI, mac->crnti); + LOG_T(NR_MAC, "dci_pdu_list->RNTI (%x) != mac->crnti (%x)\n", dci_pdu_list->RNTI, mac->crnti); continue; } fill_dl_info_with_pdcch(dl_info->dci_ind, dci_pdu_list, pdu_idx); @@ -601,7 +601,7 @@ static bool send_crc_ind_and_rx_ind(int sfn_slot) NR_UE_MAC_INST_t *mac = get_mac_inst(0); for (int i = 0; i < crc_ind->number_crcs; i++) { int harq_pid = crc_ind->crc_list[i].harq_id; - LOG_D(NR_MAC, "Resetting harq_pid %d active_ul_harq_sfn_slot\n", harq_pid); + LOG_T(NR_MAC, "Resetting harq_pid %d active_ul_harq_sfn_slot\n", harq_pid); mac->nr_ue_emul_l1.harq[harq_pid].active_ul_harq_sfn_slot = -1; } NR_UL_IND_t UL_INFO = { @@ -636,7 +636,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n "Too many pdus %d in ul_tti_req\n", num_pdus); if (!send_crc_ind_and_rx_ind(sfn_slot)) { - LOG_D(NR_MAC, "CRC_RX ind not sent\n"); + LOG_T(NR_MAC, "CRC_RX ind not sent\n"); if (!put_queue(&nr_ul_tti_req_queue, ul_tti_req)) { LOG_E(NR_PHY, "put_queue failed for ul_tti_req.\n"); @@ -659,13 +659,13 @@ static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_ "Too many dl_config pdus %d", dl_config->number_pdus); for (int i = 0; i < dl_config->number_pdus; i++) { - LOG_I(PHY, "In %s: filling DCI with a total of %d total DL PDUs (dl_config %p) \n", + LOG_D(PHY, "In %s: filling DCI with a total of %d total DL PDUs (dl_config %p) \n", __FUNCTION__, dl_config->number_pdus, dl_config); fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15_dci = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; int num_dci_options = rel15_dci->num_dci_options; if (num_dci_options <= 0) { - LOG_I(NR_MAC, "num_dci_opts = %d for pdu[%d] in dl_config_list\n", rel15_dci->num_dci_options, i); + LOG_D(NR_MAC, "num_dci_opts = %d for pdu[%d] in dl_config_list\n", rel15_dci->num_dci_options, i); } AssertFatal(num_dci_options <= sizeof(rel15_dci->dci_length_options) / sizeof(rel15_dci->dci_length_options[0]), "num_dci_options %d > dci_length_options array\n", num_dci_options); @@ -679,13 +679,13 @@ static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_ "dl_config->number_pdus %d > dci_ind->dci_list array\n", num_dcis); for (int k = 0; k < num_dcis; k++) { - LOG_D(NR_PHY, "Received len %d, length options[%d] %d, format assigned %d, format options[%d] %d\n", + LOG_T(NR_PHY, "Received len %d, length options[%d] %d, format assigned %d, format options[%d] %d\n", dl_ind->dci_ind->dci_list[k].payloadSize, j, rel15_dci->dci_length_options[j], dl_ind->dci_ind->dci_list[k].dci_format, j, rel15_dci->dci_format_options[j]); if (rel15_dci->dci_length_options[j] == dl_ind->dci_ind->dci_list[k].payloadSize) { dl_ind->dci_ind->dci_list[k].dci_format = rel15_dci->dci_format_options[j]; - LOG_I(NR_PHY, "format assigned dl_ind->dci_ind->dci_list[k].dci_format %d\n", + LOG_D(NR_PHY, "format assigned dl_ind->dci_ind->dci_list[k].dci_format %d\n", dl_ind->dci_ind->dci_list[k].dci_format); } } @@ -708,7 +708,7 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, { frame = dl_tti_request->SFN; slot = dl_tti_request->Slot; - LOG_I(NR_PHY, "[%d, %d] dl_tti_request\n", frame, slot); + LOG_D(NR_PHY, "[%d, %d] dl_tti_request\n", frame, slot); copy_dl_tti_req_to_dl_info(&mac->dl_info, dl_tti_request); } /* This checks if the previously recevied DCI matches our current RNTI @@ -722,27 +722,27 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, { frame = tx_data_request->SFN; slot = tx_data_request->Slot; - LOG_I(NR_PHY, "[%d, %d] PDSCH in tx_request\n", frame, slot); + LOG_D(NR_PHY, "[%d, %d] PDSCH in tx_request\n", frame, slot); copy_tx_data_req_to_dl_info(&mac->dl_info, tx_data_request); } else if (ul_dci_request) { frame = ul_dci_request->SFN; slot = ul_dci_request->Slot; - LOG_I(NR_PHY, "[%d, %d] ul_dci_request\n", frame, slot); + LOG_D(NR_PHY, "[%d, %d] ul_dci_request\n", frame, slot); copy_ul_dci_data_req_to_dl_info(&mac->dl_info, ul_dci_request); } else if (ul_tti_request) { frame = ul_tti_request->SFN; slot = ul_tti_request->Slot; - LOG_D(NR_PHY, "[%d, %d] ul_tti_request\n", frame, slot); + LOG_T(NR_PHY, "[%d, %d] ul_tti_request\n", frame, slot); copy_ul_tti_data_req_to_dl_info(&mac->dl_info, ul_tti_request); } else { if (pthread_mutex_unlock(&mac->mutex_dl_info)) abort(); - LOG_D(NR_MAC, "All indications were NULL in %s\n", __FUNCTION__); + LOG_T(NR_MAC, "All indications were NULL in %s\n", __FUNCTION__); return; } @@ -788,19 +788,19 @@ void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request) LOG_E(NR_PHY, "%s: dl_tti_request number of PDUS <= 0\n", __FUNCTION__); abort(); } - LOG_D(NR_PHY, "%s: dl_tti_request number of PDUS: %d\n", __FUNCTION__, num_pdus); + LOG_T(NR_PHY, "%s: dl_tti_request number of PDUS: %d\n", __FUNCTION__, num_pdus); for (int i = 0; i < num_pdus; i++) { nfapi_nr_dl_tti_request_pdu_t *pdu_list = &dl_tti_request->dl_tti_request_body.dl_tti_pdu_list[i]; if (pdu_list->PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) { - LOG_D(NR_PHY, "Cell_id: %d, the ssb_block_idx %d, sc_offset: %d and payload %d\n", + LOG_T(NR_PHY, "Cell_id: %d, the ssb_block_idx %d, sc_offset: %d and payload %d\n", pdu_list->ssb_pdu.ssb_pdu_rel15.PhysCellId, pdu_list->ssb_pdu.ssb_pdu_rel15.SsbBlockIndex, pdu_list->ssb_pdu.ssb_pdu_rel15.SsbSubcarrierOffset, pdu_list->ssb_pdu.ssb_pdu_rel15.bchPayload); pdu_list->ssb_pdu.ssb_pdu_rel15.ssbRsrp = 60; - LOG_D(NR_RRC, "Setting pdulist[%d].ssbRsrp to %d\n", i, pdu_list->ssb_pdu.ssb_pdu_rel15.ssbRsrp); + LOG_T(NR_RRC, "Setting pdulist[%d].ssbRsrp to %d\n", i, pdu_list->ssb_pdu.ssb_pdu_rel15.ssbRsrp); } } @@ -830,7 +830,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea LOG_E(NR_PHY, "Message dl_tti_request failed to unpack\n"); break; } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message in sfn/slot %d %d. \n", + LOG_D(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST message in sfn/slot %d %d. \n", dl_tti_request->SFN, dl_tti_request->Slot); if (is_channel_modeling()) @@ -854,7 +854,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea LOG_E(NR_PHY, "Message tx_data_request failed to unpack\n"); break; } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", + LOG_D(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST message in SFN/slot %d %d. \n", tx_data_request->SFN, tx_data_request->Slot); if (!put_queue(&nr_tx_req_queue, tx_data_request)) { @@ -874,7 +874,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea LOG_E(NR_PHY, "Message ul_dci_request failed to unpack\n"); break; } - LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST message in SFN/slot %d %d. \n", + LOG_D(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST message in SFN/slot %d %d. \n", ul_dci_request->SFN, ul_dci_request->Slot); if (!put_queue(&nr_ul_dci_req_queue, ul_dci_request)) { @@ -903,7 +903,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea mac->ra.ra_state >= RA_SUCCEEDED) { if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) { - LOG_I(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n"); + LOG_D(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n"); nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_ul_tti_req_queue, ul_tti_request); free(evicted_ul_tti_req); } @@ -912,7 +912,7 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea else if (mac->ra.ra_state < RA_SUCCEEDED) { if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request)) { - LOG_I(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n"); + LOG_D(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n"); nfapi_nr_ul_tti_request_t *evicted_ul_tti_req = put_queue_replace(&nr_ul_tti_req_queue, ul_tti_request); free(evicted_ul_tti_req); } @@ -952,7 +952,7 @@ static void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request) { read_channel_param(pdsch_pdu, dl_tti_request->Slot, count_sent); count_sent++; - LOG_D(NR_MAC, "pdsch_pdu->rnti %x mac->crnti %x mac->ra.ra_state %d count_sent %d\n", + LOG_T(NR_MAC, "pdsch_pdu->rnti %x mac->crnti %x mac->ra.ra_state %d count_sent %d\n", pdsch_pdu->rnti, mac->crnti, mac->ra.ra_state, count_sent); } } @@ -999,7 +999,7 @@ void *nrue_standalone_pnf_task(void *context) uint16_t *sfn_slot = CALLOC(1, sizeof(*sfn_slot)); memcpy(sfn_slot, buffer, sizeof(*sfn_slot)); - LOG_I(NR_PHY, "Received from proxy sfn %d slot %d\n", + LOG_D(NR_PHY, "Received from proxy sfn %d slot %d\n", NFAPI_SFNSLOT2SFN(*sfn_slot), NFAPI_SFNSLOT2SLOT(*sfn_slot)); if (!put_queue(&nr_sfn_slot_queue, sfn_slot)) @@ -1026,7 +1026,7 @@ void *nrue_standalone_pnf_task(void *context) { slot_rnti_mcs[NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)].sinr = ch_info->sinr[i]; - LOG_D(NR_PHY, "Received_SINR[%d] = %f, sfn:slot %d:%d\n", + LOG_T(NR_PHY, "Received_SINR[%d] = %f, sfn:slot %d:%d\n", i, ch_info->sinr[i], NFAPI_SFNSLOT2SFN(ch_info->sfn_slot), NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)); } @@ -1112,7 +1112,7 @@ void update_harq_status(module_id_t module_id, uint8_t harq_pid, uint8_t ack_nac if (current_harq->active) { current_harq->ack = ack_nack; current_harq->ack_received = true; - LOG_D(PHY,"Updating harq_status for harq_id %d,ack/nak %d\n",harq_pid,current_harq->ack); + LOG_T(PHY,"Updating harq_status for harq_id %d,ack/nak %d\n",harq_pid,current_harq->ack); } else { //shouldn't get here @@ -1134,7 +1134,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ ret = nr_ue_scheduler(NULL, ul_info); } else - LOG_D(NR_MAC, "In %s():%d not calling scheduler. sched mode = %d and mac->ra.ra_state = %d\n", + LOG_T(NR_MAC, "In %s():%d not calling scheduler. sched mode = %d and mac->ra.ra_state = %d\n", __FUNCTION__, __LINE__, ul_info->ue_sched_mode, mac->ra.ra_state); NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon; @@ -1174,9 +1174,9 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ } else { // UL indication after reception of DCI or DL PDU if (dl_info && dl_info->dci_ind && dl_info->dci_ind->number_of_dcis) { - LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n"); + LOG_T(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n"); for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) { - LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); + LOG_T(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); nr_scheduled_response_t scheduled_response; int8_t ret = handle_dci(dl_info->module_id, dl_info->cc_id, @@ -1189,12 +1189,12 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ /* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */ if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) { - LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); + LOG_T(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); break; } dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format]; g_harq_pid = def_dci_pdu_rel15->harq_pid; - LOG_D(NR_MAC, "Setting harq_pid = %d and dci_index = %d (based on format)\n", g_harq_pid, dci_index->dci_format); + LOG_T(NR_MAC, "Setting harq_pid = %d and dci_index = %d (based on format)\n", g_harq_pid, dci_index->dci_format); ret_mask |= (ret << FAPI_NR_DCI_IND); if (ret >= 0) { @@ -1213,7 +1213,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ for (int i=0; irx_ind->number_pdus; ++i) { - LOG_D(MAC, "In %s sending DL indication to MAC. 1 PDU type %d of %d total number of PDUs \n", + LOG_T(MAC, "In %s sending DL indication to MAC. 1 PDU type %d of %d total number of PDUs \n", __FUNCTION__, dl_info->rx_ind->rx_indication_body[i].pdu_type, dl_info->rx_ind->number_pdus); @@ -1297,7 +1297,7 @@ int nr_ue_dcireq(nr_dcireq_t *dcireq) { dl_config->sfn = UE_mac->dl_config_request.sfn; dl_config->slot = UE_mac->dl_config_request.slot; - LOG_D(PHY, "Entering UE DCI configuration frame %d slot %d \n", dcireq->frame, dcireq->slot); + LOG_T(PHY, "Entering UE DCI configuration frame %d slot %d \n", dcireq->frame, dcireq->slot); ue_dci_configuration(UE_mac, dl_config, dcireq->frame, dcireq->slot); @@ -1337,13 +1337,13 @@ static int get_mcs_from_sinr(float sinr) { if (sinr < (nr_bler_data[0].bler_table[0][0])) { - LOG_I(NR_MAC, "The SINR found is smaller than first MCS table\n"); + LOG_D(NR_MAC, "The SINR found is smaller than first MCS table\n"); return 0; } if (sinr > (nr_bler_data[NR_NUM_MCS-1].bler_table[nr_bler_data[NR_NUM_MCS-1].length - 1][0])) { - LOG_I(NR_MAC, "The SINR found is larger than last MCS table\n"); + LOG_D(NR_MAC, "The SINR found is larger than last MCS table\n"); return NR_NUM_MCS-1; } @@ -1354,7 +1354,7 @@ static int get_mcs_from_sinr(float sinr) float smallest_sinr = (nr_bler_data[n].bler_table[0][0]); if (sinr < largest_sinr && sinr > smallest_sinr) { - LOG_I(NR_MAC, "The SINR found in MCS %d table\n", n); + LOG_D(NR_MAC, "The SINR found in MCS %d table\n", n); return n; } } @@ -1383,7 +1383,7 @@ static int get_cqi_from_mcs(void) int mcs = get_mcs_from_sinr(slot_rnti_mcs[slot].sinr); CHECK_INDEX(mcs_to_cqi, mcs); int cqi = mcs_to_cqi[mcs]; - LOG_I(NR_MAC, "SINR: %f -> MCS: %d -> CQI: %d\n", slot_rnti_mcs[slot].sinr, mcs, cqi); + LOG_D(NR_MAC, "SINR: %f -> MCS: %d -> CQI: %d\n", slot_rnti_mcs[slot].sinr, mcs, cqi); return cqi; } slot++; @@ -1418,7 +1418,7 @@ static void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, in slot_rnti_mcs[slot].drop_flag[index] = false; slot_rnti_mcs[slot].num_pdus = index+1; //index starts at 0 so we incrament to get num of pdus slot_rnti_mcs[slot].latest = true; - LOG_I(NR_MAC, "Adding MCS %d and RNTI %x for slot_rnti_mcs[%d]\n", slot_rnti_mcs[slot].mcs[index], slot_rnti_mcs[slot].rnti[index], slot); + LOG_D(NR_MAC, "Adding MCS %d and RNTI %x for slot_rnti_mcs[%d]\n", slot_rnti_mcs[slot].mcs[index], slot_rnti_mcs[slot].rnti[index], slot); return; } @@ -1448,20 +1448,20 @@ static float get_bler_val(uint8_t mcs, int sinr) // 4th col = dropped packets, 5th col = total packets float bler_val = 0.0; CHECK_INDEX(nr_bler_data, mcs); - LOG_I(NR_MAC, "sinr %d min %d max %d\n", sinr, + LOG_D(NR_MAC, "sinr %d min %d max %d\n", sinr, (int)(nr_bler_data[mcs].bler_table[0][0] * 10), (int)(nr_bler_data[mcs].bler_table[nr_bler_data[mcs].length - 1][0] * 10) ); if (sinr < (int)(nr_bler_data[mcs].bler_table[0][0] * 10)) { - LOG_I(NR_MAC, "MCS %d table. SINR is smaller than lowest SINR, bler_val is set based on lowest SINR in table\n", mcs); + LOG_D(NR_MAC, "MCS %d table. SINR is smaller than lowest SINR, bler_val is set based on lowest SINR in table\n", mcs); bler_val = nr_bler_data[mcs].bler_table[0][4] / nr_bler_data[mcs].bler_table[0][5]; return bler_val; } if (sinr > (int)(nr_bler_data[mcs].bler_table[nr_bler_data[mcs].length - 1][0] * 10)) { - LOG_I(NR_MAC, "MCS %d table. SINR is greater than largest SINR. bler_val is set based on largest SINR in table\n", mcs); + LOG_D(NR_MAC, "MCS %d table. SINR is greater than largest SINR. bler_val is set based on largest SINR in table\n", mcs); bler_val = nr_bler_data[mcs].bler_table[(nr_bler_data[mcs].length - 1)][4] / nr_bler_data[mcs].bler_table[(nr_bler_data[mcs].length - 1)][5]; return bler_val; } @@ -1479,7 +1479,7 @@ static float get_bler_val(uint8_t mcs, int sinr) { float bler_val1 = nr_bler_data[mcs].bler_table[i - 1][4] / nr_bler_data[mcs].bler_table[i - 1][5]; float bler_val2 = nr_bler_data[mcs].bler_table[i][4] / nr_bler_data[mcs].bler_table[i][5]; - LOG_I(NR_MAC, "sinr %d min %f max %f\n", sinr, bler_val1, bler_val2); + LOG_D(NR_MAC, "sinr %d min %f max %f\n", sinr, bler_val1, bler_val2); return ((bler_val1 + bler_val2) / 2); } } @@ -1510,7 +1510,7 @@ static bool should_drop_transport_block(int slot, uint16_t rnti) NR_UE_MAC_INST_t *mac = get_mac_inst(0); if (mac->ra.ra_state < RA_SUCCEEDED) { - LOG_I(NR_MAC, "Not dropping because MAC state: %d", mac->ra.ra_state); + LOG_D(NR_MAC, "Not dropping because MAC state: %d", mac->ra.ra_state); return false; } @@ -1519,7 +1519,7 @@ static bool should_drop_transport_block(int slot, uint16_t rnti) Generate random uniform vairable to compare against bler_val. */ int num_pdus = slot_rnti_mcs[slot].num_pdus; assert(slot < 20 && slot >= 0); - LOG_I(NR_MAC, "rnti: %x num_pdus %d state %d slot %u sinr %f\n", + LOG_D(NR_MAC, "rnti: %x num_pdus %d state %d slot %u sinr %f\n", rnti, num_pdus, mac->ra.ra_state, slot, slot_rnti_mcs[slot].sinr); assert(num_pdus > 0); CHECK_INDEX(slot_rnti_mcs[slot].rnti, num_pdus); @@ -1540,7 +1540,7 @@ static bool should_drop_transport_block(int slot, uint16_t rnti) flagged for drop before returning. If even one is flagged for drop we return immediately because we drop the entire packet. */ - LOG_I(NR_MAC, "rnti: %x mcs %u slot %u sinr %f\n", + LOG_D(NR_MAC, "rnti: %x mcs %u slot %u sinr %f\n", slot_rnti_mcs[slot].rnti[n], mcs, slot, slot_rnti_mcs[slot].sinr); float bler_val; @@ -1550,11 +1550,11 @@ static bool should_drop_transport_block(int slot, uint16_t rnti) bler_val = get_bler_val(mcs, ((int)(slot_rnti_mcs[slot].sinr * 10))); double drop_cutoff = ((double) rand() / (RAND_MAX)); assert(drop_cutoff <= 1); - LOG_I(NR_MAC, "SINR = %f, Bler_val = %f, MCS = %"PRIu8"\n", slot_rnti_mcs[slot].sinr, bler_val, slot_rnti_mcs[slot].mcs[n]); + LOG_D(NR_MAC, "SINR = %f, Bler_val = %f, MCS = %"PRIu8"\n", slot_rnti_mcs[slot].sinr, bler_val, slot_rnti_mcs[slot].mcs[n]); if (drop_cutoff <= bler_val) { slot_rnti_mcs[slot].drop_flag[n] = true; - LOG_D(NR_MAC, "We are dropping this packet. Bler_val = %f, MCS = %"PRIu8", slot = %d\n", bler_val, slot_rnti_mcs[slot].mcs[n], slot); + LOG_T(NR_MAC, "We are dropping this packet. Bler_val = %f, MCS = %"PRIu8", slot = %d\n", bler_val, slot_rnti_mcs[slot].mcs[n], slot); return slot_rnti_mcs[slot].drop_flag[n]; } } From 57cfd7bc324406ef1271b4b1ea022e1fe54837b4 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 17 Mar 2022 08:25:16 +0100 Subject: [PATCH 691/883] Remove basic simulator The basic simulator can be replaced with the RF simulator. Use option --rfsim. --- ci-scripts/Jenkinsfile-gitlab | 45 +- ci-scripts/doc/vm_based_simulator_build.md | 1 - ci-scripts/doc/vm_based_simulator_create.md | 1 - .../doc/vm_based_simulator_main_scripts.md | 6 - ci-scripts/doc/vm_based_simulator_test.md | 70 +-- ci-scripts/oai-ci-vm-tool | 7 - ci-scripts/reportBuildLocally.sh | 23 - ci-scripts/reportTestLocally.sh | 150 ------ ci-scripts/runTestOnVM.sh | 426 +---------------- ci-scripts/waitBuildOnVM.sh | 14 +- cmake_targets/CMakeLists.txt | 24 +- cmake_targets/build_oai | 5 - common/utils/T/T.c | 6 - common/utils/T/T.h | 33 +- common/utils/T/T_defs.h | 14 +- common/utils/T/local_tracer.c | 16 - doc/BASIC_SIM.md | 191 -------- doc/RUNMODEM.md | 4 - docker/Dockerfile.eNB.rhel8.2 | 1 - docker/Dockerfile.eNB.rhel8.2.oc4-4 | 2 - docker/Dockerfile.eNB.ubuntu18 | 1 - docker/Dockerfile.gNB.rhel8.2 | 1 - docker/Dockerfile.gNB.rhel8.2.oc4-4 | 2 - docker/Dockerfile.gNB.ubuntu18 | 1 - docker/Dockerfile.lteRU.rhel8.2 | 1 - docker/Dockerfile.lteRU.ubuntu18 | 1 - docker/Dockerfile.lteUE.rhel8.2 | 1 - docker/Dockerfile.lteUE.rhel8.2.oc4-4 | 2 - docker/Dockerfile.lteUE.ubuntu18 | 1 - docker/Dockerfile.nrUE.rhel8.2 | 1 - docker/Dockerfile.nrUE.rhel8.2.oc4-4 | 2 - docker/Dockerfile.nrUE.ubuntu18 | 1 - executables/nr-uesoftmodem.c | 2 +- executables/softmodem-common.c | 6 +- executables/softmodem-common.h | 5 +- openair1/PHY/INIT/lte_param_init.c | 6 - openair1/PHY/LTE_TRANSPORT/pss.c | 4 - openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c | 5 - openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c | 77 ++- openair1/PHY/defs_RU.h | 2 - openair1/SCHED_UE/phy_procedures_lte_ue.c | 135 ++---- targets/ARCH/COMMON/common_lib.c | 3 - targets/ARCH/COMMON/common_lib.h | 2 - targets/ARCH/tcp_bridge/README | 4 - targets/ARCH/tcp_bridge/README.tcp_bridge_oai | 42 -- targets/ARCH/tcp_bridge/tcp_bridge.c | 292 ------------ targets/ARCH/tcp_bridge/tcp_bridge_oai.c | 443 ------------------ targets/RT/USER/lte-ru.c | 6 - targets/RT/USER/lte-ue.c | 20 +- targets/RT/USER/lte-uesoftmodem.c | 2 +- 50 files changed, 109 insertions(+), 2001 deletions(-) delete mode 100644 doc/BASIC_SIM.md delete mode 100644 targets/ARCH/tcp_bridge/README delete mode 100644 targets/ARCH/tcp_bridge/README.tcp_bridge_oai delete mode 100644 targets/ARCH/tcp_bridge/tcp_bridge.c delete mode 100644 targets/ARCH/tcp_bridge/tcp_bridge_oai.c diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 3042ada815..f331c975a8 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -159,16 +159,6 @@ pipeline { } } - stage ("Start VM -- basic-sim") { - steps { - lock (vmResource) { - timeout (time: 5, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon" - } - } - } - } - stage ("Start VM -- gnb-usrp") { steps { lock (vmResource) { @@ -211,15 +201,6 @@ pipeline { stage ("Variant Builds") { parallel { - stage ("Build basic simulator") { - steps { - gitlabCommitStatus(name: "Build basic-sim") { - timeout (time: 45, unit: 'MINUTES') { - sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } - } - } - } stage ("Build 5G gNB-USRP") { steps { gitlabCommitStatus(name: "Build gNB-USRP") { @@ -270,9 +251,9 @@ pipeline { script { dir ('archives') { if (fileExists('red_hat')) { - sh "zip -r -qq vm_build_logs.zip basic_sim enb_eth ue_eth gnb_usrp nr_ue_usrp red_hat" + sh "zip -r -qq vm_build_logs.zip enb_eth ue_eth gnb_usrp nr_ue_usrp red_hat" } else { - sh "zip -r -qq vm_build_logs.zip basic_sim enb_eth ue_eth gnb_usrp nr_ue_usrp" + sh "zip -r -qq vm_build_logs.zip enb_eth ue_eth gnb_usrp nr_ue_usrp" } } if(fileExists('archives/vm_build_logs.zip')) { @@ -324,26 +305,6 @@ pipeline { } } } - stage ("Test basic simulator") { - when { - expression {doMandatoryTests} - } - steps { - lock (vmResource) { - script { - timeout (time: 30, unit: 'MINUTES') { - try { - gitlabCommitStatus(name: "Test basic-sim") { - sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" - } - } catch (Exception e) { - currentBuild.result = 'FAILURE' - } - } - } - } - } - } stage ("Test L1 simulator") { when { expression {doMandatoryTests} @@ -581,7 +542,7 @@ pipeline { script { if (doMandatoryTests) { dir ('archives') { - sh "if [ -d basic_sim/test ] || [ -d rf_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi" + sh "if [ -d rf_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi" } if(fileExists('archives/vm_tests_logs.zip')) { archiveArtifacts artifacts: 'archives/vm_tests_logs.zip' diff --git a/ci-scripts/doc/vm_based_simulator_build.md b/ci-scripts/doc/vm_based_simulator_build.md index 28fbc955d5..16faa3ce9b 100644 --- a/ci-scripts/doc/vm_based_simulator_build.md +++ b/ci-scripts/doc/vm_based_simulator_build.md @@ -52,7 +52,6 @@ Options: -------- # OpenAirInterface Build Variants --variant enb-usrp OR -v1 ( build and test ) - --variant basic-sim OR -v2 ( build and test ) --variant phy-sim OR -v3 ( build and test ) --variant cppcheck OR -v4 ( build and test ) --variant gnb-usrp OR -v5 ( build and test ) diff --git a/ci-scripts/doc/vm_based_simulator_create.md b/ci-scripts/doc/vm_based_simulator_create.md index 09ce26c553..4681738038 100644 --- a/ci-scripts/doc/vm_based_simulator_create.md +++ b/ci-scripts/doc/vm_based_simulator_create.md @@ -45,7 +45,6 @@ Mandatory Options: # OpenAirInterface Build Variants --variant enb-usrp OR -v1 ( build and test ) - --variant basic-sim OR -v2 ( build and test ) --variant phy-sim OR -v3 ( build and test ) --variant cppcheck OR -v4 ( build and test ) --variant gnb-usrp OR -v5 ( build and test ) diff --git a/ci-scripts/doc/vm_based_simulator_main_scripts.md b/ci-scripts/doc/vm_based_simulator_main_scripts.md index 000d89a1eb..0d54d03521 100644 --- a/ci-scripts/doc/vm_based_simulator_main_scripts.md +++ b/ci-scripts/doc/vm_based_simulator_main_scripts.md @@ -109,12 +109,6 @@ You can get the list of variant specific variables specifying the variant argume NB_PATTERN_FILES=9 BUILD_OPTIONS="" LOG_PATTERN=.Rel15.txt - --variant basic-sim OR -v2 ( build and test ) - VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim - VM_MEMORY=8192 VM_CPU=4 - NB_PATTERN_FILES=13 BUILD_OPTIONS="--eNB --UE" - LOG_PATTERN=.Rel15.txt - --variant phy-sim OR -v3 ( build and test ) VM_NAME=ci-phy-sim ARCHIVES_LOC=phy_sim VM_MEMORY=2048 VM_CPU=4 diff --git a/ci-scripts/doc/vm_based_simulator_test.md b/ci-scripts/doc/vm_based_simulator_test.md index 73308b972e..ab28101543 100644 --- a/ci-scripts/doc/vm_based_simulator_test.md +++ b/ci-scripts/doc/vm_based_simulator_test.md @@ -18,16 +18,14 @@ 2. [Detailed Description](#2-detailed-description) 3. [Typical Usage](#3-typical-usage) 1. [Testing the physical simulators](#31-testing-the-physicals-simulators) - 2. [Testing the basic simulator](#32-testing-the-basic-simulator) - 3. [Testing the RF simulator](#33-testing-the-rf-simulator) - 4. [Testing the L2-nFAPI simulator](#33-testing-the-l2-nfapi-simulator) + 2. [Testing the RF simulator](#33-testing-the-rf-simulator) + 3. [Testing the L2-nFAPI simulator](#33-testing-the-l2-nfapi-simulator) # 1. Introduction # -Currently 2 build variants can be directly tested: +Currently 1 build variant can be directly tested: * Physical Simulators -* Basic Simulator In addition, 2 build variants are used: @@ -73,7 +71,6 @@ Options: # OpenAirInterface Build Variants --variant enb-usrp OR -v1 ( build and test ) - --variant basic-sim OR -v2 ( build and test ) --variant phy-sim OR -v3 ( build and test ) --variant cppcheck OR -v4 ( build and test ) --variant gnb-usrp OR -v5 ( build and test ) @@ -143,64 +140,7 @@ $ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-dev Note that the VM instance is destroyed. You do that when you are sure your test is passing. -## 3.2. Testing the basic simulator ## - -```bash -$ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant basic-sim --job-name RAN-CI-develop --build-id 48 -15:11:13 ############################################################ -15:11:13 OAI CI VM script -15:11:13 ############################################################ -15:11:13 VM_NAME = RAN-CI-develop-b48-basic-sim -15:11:13 VM_CMD_FILE = RAN-CI-develop-b48-basic-sim_cmds.txt -15:11:13 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop -15:11:13 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/basic_sim/test -15:11:13 ############################################################ -15:11:13 Waiting for VM to be started -15:11:13 ############################################################ -15:11:14 Warning: Permanently added '192.168.122.29' (ECDSA) to the list of known hosts. -15:11:15 RAN-CI-develop-b48-basic-sim has for IP addr = 192.168.122.29 -15:11:15 ############################################################ -15:11:15 Test EPC on VM (RAN-CI-develop-b48-epc) will be using ltebox -15:11:15 ############################################################ -15:11:15 EPC_VM_CMD_FILE = RAN-CI-develop-b48-epc_cmds.txt -15:11:15 ############################################################ -15:11:15 Creating test EPC VM (RAN-CI-develop-b48-epc) on Ubuntu Cloud Image base -15:11:15 ############################################################ -15:11:18 Waiting for VM to be started -15:13:25 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts. -15:13:25 RAN-CI-develop-b48-epc has for IP addr = 192.168.122.156 -15:13:25 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts. -15:13:25 ls: cannot access '/opt/ltebox/tools/start_ltebox': No such file or directory -15:13:25 ############################################################ -15:13:25 Copying ltebox archives into EPC VM (RAN-CI-develop-b48-epc) -15:13:25 ############################################################ -15:13:25 ############################################################ -15:13:25 Install EPC on EPC VM (RAN-CI-develop-b48-epc) -15:13:25 ############################################################ -.... -15:24:39 ############################################################ -15:24:39 Terminate EPC -15:24:39 ############################################################ -15:24:39 cd /opt/ltebox/tools -15:24:39 sudo ./stop_ltebox -15:24:40 sudo daemon --name=simulated_hss --stop -15:24:40 sudo killall --signal SIGKILL hss_sim -15:24:40 ############################################################ -15:24:40 Destroying VMs -15:24:40 ############################################################ -15:24:41 # Host 192.168.122.29 found: line 18 -15:24:41 /home/eurecom/.ssh/known_hosts updated. -15:24:41 Original contents retained as /home/eurecom/.ssh/known_hosts.old -15:24:43 # Host 192.168.122.60 found: line 20 -15:24:43 /home/eurecom/.ssh/known_hosts updated. -15:24:43 Original contents retained as /home/eurecom/.ssh/known_hosts.old -15:24:43 ############################################################ -15:24:43 Checking run status -15:24:43 ############################################################ -15:24:43 STATUS seems OK -``` - -## 3.3. Test the RF simulator ## +## 3.2. Test the RF simulator ## ```bash ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant rf-sim --job-name RAN-CI-develop --build-id 48 --keep-vm-alive @@ -209,7 +149,7 @@ $ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-dev 15:24:45 STATUS seems OK ``` -## 3.4. Testing the L2-nFAPI simulator +## 3.3. Testing the L2-nFAPI simulator ```bash ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant l2-sim --job-name RAN-CI-develop --build-id 48 diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index 5ee653c8e1..49b9ee14f7 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -175,13 +175,6 @@ function variant__v1__enb_usrp { VM_MEMORY=3072 } -function variant__v2__basic_sim { - NB_PATTERN_FILES=11 - BUILD_OPTIONS="--eNB --UE" - VM_MEMORY=8192 - RUN_OPTIONS="complex" -} - function variant__v3__phy_sim { NB_PATTERN_FILES=11 BUILD_OPTIONS="--phy_simulators" diff --git a/ci-scripts/reportBuildLocally.sh b/ci-scripts/reportBuildLocally.sh index 8b6db9261a..bcd3e2f7fe 100755 --- a/ci-scripts/reportBuildLocally.sh +++ b/ci-scripts/reportBuildLocally.sh @@ -574,7 +574,6 @@ function report_build { summary_table_row "OAI ETHERNET transport - Release 15" ./archives/enb_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./enb_eth_row3.html summary_table_row "Parameters Lib Config - Release 15" ./archives/enb_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_eth_row4.html summary_table_row "RF Simulator - Release 15" ./archives/enb_eth/rfsimulator.Rel15.txt "Built target rfsimulator" ./enb_eth_row5.html - summary_table_row "TCP OAI Bridge - Release 15" ./archives/enb_eth/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./enb_eth_row6.html summary_table_row "OAI USRP device if - Release 15" ./archives/enb_eth/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./enb_eth_row7.html summary_table_footer @@ -584,7 +583,6 @@ function report_build { summary_table_row "OAI ETHERNET transport - Release 15" ./archives/ue_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./ue_eth_row3.html summary_table_row "Parameters Lib Config - Release 15" ./archives/ue_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./ue_eth_row4.html summary_table_row "RF Simulator - Release 15" ./archives/ue_eth/rfsimulator.Rel15.txt "Built target rfsimulator" ./ue_eth_row5.html - summary_table_row "TCP OAI Bridge - Release 15" ./archives/ue_eth/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./ue_eth_row6.html summary_table_row "Conf 2 UE Data - Release 15" ./archives/ue_eth/conf2uedata.Rel15.txt "Built target conf2uedata" ./ue_eth_row7.html summary_table_row "NVRAM - Release 15" ./archives/ue_eth/nvram.Rel15.txt "Built target nvram" ./ue_eth_row8.html summary_table_row "UE IP - Release 15" ./archives/ue_eth/ue_ip.Rel15.txt "Built target ue_ip" ./ue_eth_row9.html @@ -592,20 +590,6 @@ function report_build { summary_table_row "OAI USRP device if - Release 15" ./archives/ue_eth/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./ue_eth_row9b.html summary_table_footer - summary_table_header "OAI Build: 4G LTE basic simulator option" ./archives/basic_sim - summary_table_row "LTE SoftModem - Release 15" ./archives/basic_sim/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./basic_sim_row1.html - summary_table_row "LTE UE SoftModem - Release 15" ./archives/basic_sim/lte-uesoftmodem.Rel15.txt "Built target lte-uesoftmodem" ./basic_sim_row2.htm - summary_table_row "Coding - Release 15" ./archives/basic_sim/coding.Rel15.txt "Built target coding" ./basic_sim_row3.html - summary_table_row "Conf 2 UE data - Release 15" ./archives/basic_sim/conf2uedata.Rel15.txt "Built target conf2uedata" ./basic_sim_row4.html - summary_table_row "OAI ETHERNET transport - Release 15" ./archives/basic_sim/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./basic_sim_row5.html - summary_table_row "Parameters Lib Config - Release 15" ./archives/basic_sim/params_libconfig.Rel15.txt "Built target params_libconfig" ./basic_sim_row7.html - summary_table_row "RF Simulator - Release 15" ./archives/basic_sim/rfsimulator.Rel15.txt "Built target rfsimulator" ./basic_sim_row9.html - summary_table_row "TCP Bridge - Release 15" ./archives/basic_sim/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./basic_sim_row10.html - summary_table_row "UE IP - Release 15" ./archives/basic_sim/ue_ip.Rel15.txt "Built target ue_ip" ./basic_sim_row11.html - summary_table_row "USIM - Release 15" ./archives/basic_sim/usim.Rel15.txt "Built target usim" ./basic_sim_row12.html - summary_table_row "NVRAM - Release 15" ./archives/basic_sim/nvram.Rel15.txt "Built target nvram" ./basic_sim_row13.html - summary_table_footer - if [ -f archives/gnb_usrp/nr-softmodem.Rel15.txt ] then summary_table_header "OAI Build: 5G NR gNB -- USRP option" ./archives/gnb_usrp @@ -658,13 +642,6 @@ function report_build { cat $DETAILS_TABLE >> ./build_results.html done fi - if [ -f ./basic_sim_row1.html ] || [ -f ./basic_sim_row2.html ] || [ -f ./basic_sim_row3.html ] || [ -f ./basic_sim_row4.html ] || [ -f ./basic_sim_row5.html ] - then - for DETAILS_TABLE in `ls ./basic_sim_row*.html` - do - cat $DETAILS_TABLE >> ./build_results.html - done - fi if [ -f ./gnb_usrp_row1.html ] || [ -f ./gnb_usrp_row2.html ] || [ -f ./gnb_usrp_row3.html ] || [ -f ./gnb_usrp_row4.html ] then for DETAILS_TABLE in `ls ./gnb_usrp_row*.html` diff --git a/ci-scripts/reportTestLocally.sh b/ci-scripts/reportTestLocally.sh index d22bfe177a..c137fcdcbb 100755 --- a/ci-scripts/reportTestLocally.sh +++ b/ci-scripts/reportTestLocally.sh @@ -250,156 +250,6 @@ function report_test { echo " " >> ./test_simulator_results.html echo "

Test Summary

" >> ./test_simulator_results.html - ARCHIVES_LOC=archives/basic_sim/test - if [ -d $ARCHIVES_LOC ] - then - echo "

4G LTE Basic Simulator Check

" >> ./test_simulator_results.html - - if [ -f $ARCHIVES_LOC/test_final_status.log ] - then - if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ] - then - echo "
" >> ./test_simulator_results.html - echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - else - echo "
" >> ./test_simulator_results.html - echo " TEST was a FAILURE! " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - else - echo "
" >> ./test_simulator_results.html - echo " COULD NOT DETERMINE TEST FINAL STATUS! " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - - echo " " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - TRANS_MODES=("fdd" "tdd") - BW_CASES=(05 10 20) - for TMODE in ${TRANS_MODES[@]} - do - echo " " >> ./test_simulator_results.html - if [[ $TMODE =~ .*fdd.* ]] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - for BW in ${BW_CASES[@]} - do - ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_enb.log - UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"` - if [ -f $ENB_LOG ] && [ -f $UE_LOG ] - then - NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` - NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG` - NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG` - NB_ENB_SYNCED_WITH_UE=`egrep -c "got UE capabilities for UE" $ENB_LOG` - if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -eq 2 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ] - then - echo " " >> ./test_simulator_results.html - else - echo " " >> ./test_simulator_results.html - fi - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - fi - PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_ping_ue.txt 2> /dev/null` - analyzePingFiles - - IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}*iperf*client*txt 2> /dev/null` - analyzeIperfFiles - done - done - - echo "
Log File NameCommandStatusStatistics
Test in FDDTest in TDD
$NAME_ENB --- $NAME_UEN/AOKKO
" >> ./test_simulator_results.html
-                    if [ $NB_ENB_GOT_SYNC -gt 0 ]
-                    then
-                        echo "- eNB --> got sync" >> ./test_simulator_results.html
-                    else
-                        echo "- eNB NEVER got sync" >> ./test_simulator_results.html
-                    fi
-                    if [ $NB_UE_GOT_SYNC -eq 2 ]
-                    then
-                        echo "- UE --> got sync" >> ./test_simulator_results.html
-                    else
-                        echo "- UE NEVER got sync" >> ./test_simulator_results.html
-                    fi
-                    if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
-                    then
-                        echo "- UE attached to eNB" >> ./test_simulator_results.html
-                    else
-                        echo "- UE NEVER attached to eNB" >> ./test_simulator_results.html
-                    fi
-                    NB_SEGFAULT_ENB=`egrep -i -c "Segmentation Fault" $ENB_LOG`
-                    if [ $NB_SEGFAULT_ENB -ne 0 ]
-                    then
-                        echo "- eNB --> Segmentation Fault" >> ./test_simulator_results.html
-                    fi
-                    NB_SEGFAULT_UE=`egrep -i -c "Segmentation Fault" $UE_LOG`
-                    if [ $NB_SEGFAULT_UE -ne 0 ]
-                    then
-                        echo "- UE --> Segmentation Fault" >> ./test_simulator_results.html
-                    fi
-                    NB_ASSERTION_ENB=`egrep -i -c "Assertion" $ENB_LOG`
-                    if [ $NB_ASSERTION_ENB -ne 0 ]
-                    then
-                        echo "- eNB --> Assertion" >> ./test_simulator_results.html
-                        awk 'BEGIN{assertion=10}{if(assertion < 3){print "    " $0; assertion++};if ($0 ~/Assertion/){print "    " $0;assertion=1}}END{}' $ENB_LOG >> ./test_simulator_results.html
-                    fi
-                    NB_ASSERTION_UE=`egrep -i -c "Assertion" $UE_LOG`
-                    if [ $NB_ASSERTION_UE -ne 0 ]
-                    then
-                        echo "- eNB --> Assertion" >> ./test_simulator_results.html
-                        awk 'BEGIN{assertion=10}{if(assertion < 3){print "    " $0; assertion++};if ($0 ~/Assertion/){print "    " $0;assertion=1}}END{}' $UE_LOG >> ./test_simulator_results.html
-                    fi
-                    echo "        
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - - if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ] - then - echo "

4G LTE Basic Simulator + FlexRan Controller Check

" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " TEST was SUCCESSFUL " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - - FLEXRAN_QUERIES=`ls $ARCHIVES_LOC/flexran_ctl_query_*log` - for QUERY in $FLEXRAN_QUERIES - do - echo " " >> ./test_simulator_results.html - NAME=`echo $QUERY | sed -e "s#$ARCHIVES_LOC/##"` - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - echo " " >> ./test_simulator_results.html - done - echo "
Log File NameJSON Query Response
$NAME
" >> ./test_simulator_results.html
-            egrep -v "LOG_NAME|\-\-\-\-\-" $QUERY >> ./test_simulator_results.html
-            echo "        
" >> ./test_simulator_results.html - echo "
" >> ./test_simulator_results.html - fi - ARCHIVES_LOC=archives/rf_sim/test if [ -d $ARCHIVES_LOC ] then diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index b5abb5ff45..25e11edc4f 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -36,137 +36,6 @@ function test_usage { command_options_usage } -function start_basic_sim_enb { - local LOC_VM_IP_ADDR=$2 - local LOC_EPC_IP_ADDR=$3 - local LOC_LOG_FILE=$4 - local LOC_NB_RBS=$5 - local LOC_CONF_FILE=$6 - local LOC_FLEXRAN_CTL_IP_ADRR=$7 - echo "cd /home/ubuntu/tmp" > $1 - echo "echo \"sudo apt-get --yes --quiet install daemon \"" >> $1 - echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1 - echo "echo \"export ENODEB=1\"" >> $1 - echo "export ENODEB=1" >> $1 - echo "echo \"source oaienv\"" >> $1 - echo "source oaienv" >> $1 - echo "cd ci-scripts/conf_files/" >> $1 - echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1 - echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1 - if [[ $LOC_FLEXRAN_CTL_IP_ADRR =~ .*none.* ]] - then - echo "sed -i -e 's#CI_FLEXRAN_CTL_IP_ADDR#127.0.0.1#' ci-$LOC_CONF_FILE" >> $1 - else - echo "sed -i -e 's#FLEXRAN_ENABLED = .*no.*;#FLEXRAN_ENABLED = \"yes\";#' -e 's#CI_FLEXRAN_CTL_IP_ADDR#$LOC_FLEXRAN_CTL_IP_ADRR#' ci-$LOC_CONF_FILE" >> $1 - fi - echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1 - echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/" >> $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --basicsim\" > ./my-lte-softmodem-run.sh " >> $1 - echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1 - echo "cat ./my-lte-softmodem-run.sh" >> $1 - echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1 - - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 - rm $1 - sleep 5 - - local i="0" - echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - sleep 5 - i=$[$i+1] - fi - done - ENB_SYNC=0 - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1 - rm $1 - if [ $i -lt 50 ] - then - ENB_SYNC=0 - echo "Basic-Sim eNB: eNB did NOT got sync" - else - echo "Basic-Sim eNB: eNB GOT SYNC --> waiting for UE to connect" - fi - sleep 5 -} - -function start_basic_sim_ue { - local LOC_UE_LOG_FILE=$3 - local LOC_NB_RBS=$4 - local LOC_FREQUENCY=$5 - echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" > $1 - echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1 - echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build" >> $1 - echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options nocolor,line_num,level --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1 - echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1 - echo "cat ./my-lte-uesoftmodem-run.sh" >> $1 - echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1 - echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build -o /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ./my-lte-uesoftmodem-run.sh" >> $1 - - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 - - local i="0" - echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1 - while [ $i -lt 10 ] - do - sleep 5 - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1` - if [ $CONNECTED -eq 1 ] - then - i="100" - else - i=$[$i+1] - fi - done - UE_SYNC=1 - rm $1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "Basic-Sim UE: oaitun_ue1 is DOWN and/or NOT CONFIGURED" - else - echo "Basic-Sim UE: oaitun_ue1 is UP and CONFIGURED" - fi - i="0" - echo "egrep -c \"Generating RRCConnectionReconfigurationComplete\" /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE" > $1 - while [ $i -lt 10 ] - do - CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1` - if [ $CONNECTED -ne 0 ] - then - i="100" - else - sleep 5 - i=$[$i+1] - fi - done - echo "echo \"free -m\"" > $1 - echo "free -m" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 - if [ $i -lt 50 ] - then - UE_SYNC=0 - echo "Basic-Sim UE: UE did NOT complete RRC Connection" - else - echo "Basic-Sim UE: UE did COMPLETE RRC Connection" - fi -} - function get_ue_ip_addr { local LOC_IF_ID=$3 echo "ifconfig oaitun_ue${LOC_IF_ID} | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1 @@ -417,7 +286,6 @@ function check_iperf { local LOC_REQ_BW_MINUS_TWO=`echo "$LOC_REQ_BW - 2" | bc -l` local LOC_REQ_BW_MINUS_THREE=`echo "$LOC_REQ_BW - 3" | bc -l` local LOC_IS_DL=`echo $LOC_BASE_LOG | grep -c _dl` - local LOC_IS_BASIC_SIM=`echo $LOC_BASE_LOG | grep -c basic_sim` local LOC_IS_RF_SIM=`echo $LOC_BASE_LOG | grep -c rf_sim` local LOC_IS_NR=`echo $LOC_BASE_LOG | grep -c _106prb` if [ -f ${LOC_BASE_LOG}_client.txt ] @@ -438,28 +306,17 @@ function check_iperf { local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Kbits/sec" | sed -e "s#^.*KBytes *##" -e "s#sec.*#sec#"` local BW_PREFIX="K" fi - if [ $LOC_IS_DL -eq 1 ] && [ $LOC_IS_BASIC_SIM -eq 1 ] + if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] then - if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_TWO}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_THREE}.*${BW_PREFIX}bits.* ]] + if [ $LOC_IS_DL -eq 1 ] then echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH" else - echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH" - IPERF_STATUS=-1 + echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH" fi else - if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] - then - if [ $LOC_IS_DL -eq 1 ] - then - echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH" - else - echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH" - fi - else - echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH" - IPERF_STATUS=-1 - fi + echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH" + IPERF_STATUS=-1 fi fi else @@ -526,22 +383,6 @@ function full_terminate { sleep 10 } -function full_basic_sim_destroy { - if [ $KEEP_VM_ALIVE -eq 0 ] - then - echo "############################################################" - echo "Destroying VMs" - echo "############################################################" - uvt-kvm destroy $VM_NAME - ssh-keygen -R $VM_IP_ADDR - if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ] - then - uvt-kvm destroy $FLEXRAN_CTL_VM_NAME - ssh-keygen -R $FLEXRAN_CTL_VM_IP_ADDR - fi - fi -} - function install_epc_on_vm { local LOC_EPC_VM_NAME=$1 local LOC_EPC_VM_CMDS=$2 @@ -744,35 +585,6 @@ function terminate_epc { fi } -function start_flexran_ctrl { - echo "cd /home/ubuntu/tmp" > $1 - echo "if [ -f cmake_targets/log/flexran_ctl_run.log ]; then rm -f cmake_targets/log/flexran_ctl_run.log cmake_targets/log/flexran_ctl_query*.log; fi" >> $1 - echo "echo \" sudo build/rt_controller -c log_config/basic_log\"" >> $1 - echo "nohup sudo build/rt_controller -c log_config/basic_log > cmake_targets/log/flexran_ctl_run.log 2>&1 &" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 - sleep 10 -} - -function stop_flexran_ctrl { - echo "echo \"sudo killall --signal SIGKILL rt_controller\"" > $1 - echo "sudo killall --signal SIGKILL rt_controller" > $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 - sleep 2 -} - -function query_flexran_ctrl_status { - local LOC_MESSAGE=$3 - echo "cd /home/ubuntu/tmp" > $1 - echo "echo \"------------------------------------------------------------\" > cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1 - echo "echo \"LOG_NAME: $LOC_MESSAGE\" >> cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1 - echo "echo \"------------------------------------------------------------\" >> cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1 - echo "curl http://localhost:9999/stats | jq '.' | tee -a cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1 - ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1 - rm $1 -} - function build_ue_on_separate_folder { echo "mkdir tmp-ue" > $1 echo "cd tmp-ue" >> $1 @@ -1667,234 +1479,6 @@ function run_test_on_vm { fi fi - if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-basic-sim.* ]] - then - PING_STATUS=0 - IPERF_STATUS=0 - if [ -d $ARCHIVES_LOC ] - then - rm -Rf $ARCHIVES_LOC - fi - mkdir --parents $ARCHIVES_LOC - - # Creating a VM for EPC and installing SW - EPC_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#epc#"` - EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt - LTEBOX=0 - if [[ "$EPC_IPADDR" == "" ]] - then - # Creating a VM for EPC and installing SW - install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS - EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME` - - # Starting EPC - start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - else - echo "We will use EPC on $EPC_IPADDR" - EPC_VM_IP_ADDR=$EPC_IPADDR - fi - - # Retrieve EPC real IP address - retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR - - TRANS_MODES=("fdd" "tdd") - BW_CASES=(05 10 20) - - for TMODE in ${TRANS_MODES[@]} - do - for BW in ${BW_CASES[@]} - do - # Not Running in TDD-20MHz : too unstable - if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi - - if [[ $BW =~ .*05.* ]]; then PRB=25; fi - if [[ $BW =~ .*10.* ]]; then PRB=50; fi - if [[ $BW =~ .*20.* ]]; then PRB=100; fi - if [[ $TMODE =~ .*fdd.* ]]; then FREQUENCY=2680; else FREQUENCY=2350; fi - - echo "############################################################" - echo "Starting the eNB in ${TMODE}-${BW}MHz mode" - echo "############################################################" - CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE $PRB lte-${TMODE}-basic-sim.conf none - - echo "############################################################" - echo "Starting the UE in ${TMODE}-${BW}MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" - full_terminate - STATUS=-1 - continue - fi - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1 - - echo "############################################################" - echo "Pinging the UE" - echo "############################################################" - PING_LOG_FILE=${TMODE}_${BW}MHz_ping_ue.txt - ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC - check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20 - - # Not more testing in any TDD : too unstable - if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*05.* ]]; then full_terminate; continue; fi - if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then full_terminate; continue; fi - if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then full_terminate; continue; fi - echo "############################################################" - echo "Iperf DL" - echo "############################################################" - if [[ $TMODE =~ .*fdd.* ]] - then - if [[ $BW =~ .*20.* ]]; then THROUGHPUT=12; else THROUGHPUT=10; fi - else - THROUGHPUT=6 - fi - CURR_IPERF_LOG_BASE=${TMODE}_${BW}MHz_iperf_dl - generic_iperf $VM_CMDS $VM_IP_ADDR $UE_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 0 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT - - # Not more testing in FDD-20MHz : too unstable - if [[ $TMODE =~ .*fdd.* ]] && [[ $BW =~ .*20.* ]]; then full_terminate; continue; fi - echo "############################################################" - echo "Iperf UL" - echo "############################################################" - THROUGHPUT=2 - CURR_IPERF_LOG_BASE=${TMODE}_${BW}MHz_iperf_ul - generic_iperf $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $VM_CMDS $VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 0 0 - scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC - check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT - - full_terminate - - done - done - - if [ -d $JENKINS_WKSP/flexran ] - then - echo "############################################################" - echo "Flexran testing is possible" - echo "############################################################" - local j="0" - while [ $j -lt 20 ] - do - if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ] - then - echo "Found an proper flexran controller vm build" - j="100" - else - j=$[$j+1] - sleep 30 - fi - done - if [ $j -lt 50 ] - then - echo "ERROR: compiling flexran controller on vm went wrong" - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - FLEXRAN_CTL_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#flexran-rtc#"` - FLEXRAN_CTL_VM_CMDS=`echo $VM_CMDS | sed -e "s#cmds#flexran-rtc-cmds#"` - IS_FLEXRAN_VM_ALIVE=`uvt-kvm list | grep -c $FLEXRAN_CTL_VM_NAME` - if [ $IS_FLEXRAN_VM_ALIVE -eq 0 ] - then - echo "ERROR: Flexran Ctl VM is not alive" - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - full_basic_sim_destroy - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - uvt-kvm wait $FLEXRAN_CTL_VM_NAME --insecure - FLEXRAN_CTL_VM_IP_ADDR=`uvt-kvm ip $FLEXRAN_CTL_VM_NAME` - - echo "$FLEXRAN_CTL_VM_NAME has for IP addr = $FLEXRAN_CTL_VM_IP_ADDR" - echo "FLEXRAN_CTL_VM_CMDS = $FLEXRAN_CTL_VM_CMDS" - echo "############################################################" - echo "Starting the FLEXRAN CONTROLLER" - echo "############################################################" - start_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR - query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 01_no_enb_connected - - echo "############################################################" - echo "Starting the eNB in FDD-5MHz mode with Flexran ON" - echo "############################################################" - CURRENT_ENB_LOG_FILE=fdd_05fMHz_enb.log - start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-fdd-basic-sim.conf $FLEXRAN_CTL_VM_IP_ADDR - query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 02_enb_connected - - echo "############################################################" - echo "Starting the UE in FDD-5MHz mode" - echo "############################################################" - CURRENT_UE_LOG_FILE=fdd_05fMHz_ue.log - start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2680 - if [ $UE_SYNC -eq 0 ] - then - echo "Problem w/ eNB and UE not syncing" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - STATUS=-1 - return - fi - query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 03_enb_ue_connected - get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1 - - sleep 30 - echo "############################################################" - echo "Terminate enb/ue simulators" - echo "############################################################" - terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0 - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC - recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC - sleep 10 - - echo "############################################################" - echo "Stopping the FLEXRAN CONTROLLER" - echo "############################################################" - stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR - scp -o StrictHostKeyChecking=no ubuntu@$FLEXRAN_CTL_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/flexran_ctl_*.log $ARCHIVES_LOC - fi - - echo "############################################################" - echo "Terminate EPC" - echo "############################################################" - - if [[ "$EPC_IPADDR" == "" ]] - then - terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR - fi - - full_basic_sim_destroy - - echo "############################################################" - echo "Checking run status" - echo "############################################################" - - if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi - if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi - - if [ $STATUS -eq 0 ] - then - echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log - else - echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log - fi - fi - if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]] then PING_STATUS=0 diff --git a/ci-scripts/waitBuildOnVM.sh b/ci-scripts/waitBuildOnVM.sh index 4a604a1fe9..946c0866e2 100755 --- a/ci-scripts/waitBuildOnVM.sh +++ b/ci-scripts/waitBuildOnVM.sh @@ -174,13 +174,13 @@ function check_on_vm_build { fi # If we were building the FlexRan Controller, flag-touch for basic-simulator to continue - if [[ "$VM_NAME" == *"-flexran-rtc"* ]] - then - if [[ $STATUS -eq 0 ]] - then - touch $JENKINS_WKSP/flexran/flexran_build_complete.txt - fi - fi + #if [[ "$VM_NAME" == *"-flexran-rtc"* ]] + #then + # if [[ $STATUS -eq 0 ]] + # then + # touch $JENKINS_WKSP/flexran/flexran_build_complete.txt + # fi + #fi if [[ "$VM_NAME" == *"-cppcheck"* ]] then diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 7975d4bc77..46e33e8803 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -755,27 +755,6 @@ add_library(oai_irisdevif MODULE ${HWLIB_IRIS_SOURCE}) target_include_directories(oai_irisdevif PRIVATE /usr/local/lib/SoapySDR/modules0.7/) target_link_libraries(oai_irisdevif SoapySDR) -# TCP bridge libraries -###################################################################### - -# this one is for internal use at Eurecom and is not documented -set(HWLIB_TCP_BRIDGE_SOURCE - ${OPENAIR_TARGETS}/ARCH/tcp_bridge/tcp_bridge.c - ) -add_library(tcp_bridge MODULE ${HWLIB_TCP_BRIDGE_SOURCE} ) - -#get_target_property(tcp_bridge_cflags tcp_bridge COMPILE_FLAGS) -#set_target_properties(tcp_bridge PROPERTIES COMPILE_FLAGS "${tcp_bridge_cflags} -fvisibility=hidden") -set_target_properties(tcp_bridge PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") - -# this one is to connect OAI eNB and OAI UE in the basic simulator -# see targets/ARCH/tcp_bridge/README.tcp_bridge_oai for usage -set(HWLIB_TCP_BRIDGE_OAI_SOURCE - ${OPENAIR_TARGETS}/ARCH/tcp_bridge/tcp_bridge_oai.c - ) -add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} ) -set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") - # Benetel 4G library ###################################################################### @@ -3008,8 +2987,7 @@ if (${T_TRACER}) #all "add_library" definitions ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer - oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai - coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO + oai_eth_transpro oai_mobipass coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 930f2a7f77..c65728a41d 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -894,11 +894,6 @@ function main() { compilations \ $BUILD_DIR rfsimulator \ librfsimulator.so $dbin/librfsimulator.so.$REL - - echo_info "Compiling tcp_bridge_oai" - compilations \ - $BUILD_DIR tcp_bridge_oai \ - libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL fi #build transport protocol libraries (currently only ETHERNET is available) diff --git a/common/utils/T/T.c b/common/utils/T/T.c index 49742bf600..2d724ffd00 100644 --- a/common/utils/T/T.c +++ b/common/utils/T/T.c @@ -33,12 +33,6 @@ volatile int _T_freelist_head; volatile int *T_freelist_head = &_T_freelist_head; T_cache_t *T_cache; -#if BASIC_SIMULATOR - /* global variables used by T_GET_SLOT, see in T.h */ - volatile uint64_t T_next_id; - volatile uint64_t T_active_id; -#endif - static void get_message(int s) { char t; int l; diff --git a/common/utils/T/T.h b/common/utils/T/T.h index 0142945054..df1e95d2df 100644 --- a/common/utils/T/T.h +++ b/common/utils/T/T.h @@ -111,39 +111,8 @@ typedef struct { extern volatile int *T_freelist_head; extern T_cache_t *T_cache; extern int *T_active; -/* When running the basic simulator, we may fill the T cache too fast. - * Let's serialize write accesses to the T cache. For that, we use a - * 'ticket' mechanism. To acquire a T slot the caller needs to own the - * current active ticket. We also wait for the slot to be free if - * it is already in use. - */ -#if BASIC_SIMULATOR -# define T_GET_SLOT \ - do { \ - extern volatile uint64_t T_next_id; \ - extern volatile uint64_t T_active_id; \ - uint64_t id; \ - /* get a ticket */ \ - id = __sync_fetch_and_add(&T_next_id, 1); \ - /* wait for our turn */ \ - while (id != __sync_fetch_and_add(&T_active_id, 0)) /* busy wait */; \ - /* this is our turn, try to acquire the slot until it's free */ \ - do { \ - T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); \ - if (T_LOCAL_busy & 0x01) usleep(100); \ - } while (T_LOCAL_busy & 0x01); \ - /* check that there are still some tickets */ \ - if (__sync_fetch_and_add(&T_active_id, 0) == 0xffffffffffffffff) { \ - printf("T: reached the end of times, bye...\n"); \ - abort(); \ - } \ - /* free our ticket, which signals the next waiter that it's its turn */ \ - (void)__sync_fetch_and_add(&T_active_id, 1); \ - } while (0) -#else -# define T_GET_SLOT \ +#define T_GET_SLOT \ T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); -#endif /* used at header of Tn, allocates buffer */ #define T_LOCAL_DATA \ diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h index b74c0567ce..00e0df4963 100644 --- a/common/utils/T/T_defs.h +++ b/common/utils/T/T_defs.h @@ -40,20 +40,10 @@ #define T_MAX_ARGS 16 /* maximum size of a message - increase if needed */ -#if BASIC_SIMULATOR - /* let's have 100 RBs functional for the basic simulator */ -# define T_BUFFER_MAX (1024*64*4) -#else -# define T_BUFFER_MAX (1024*64*4) -#endif +#define T_BUFFER_MAX (1024*64*4) /* size of the local cache for messages (must be pow(2,something)) */ -#if BASIC_SIMULATOR - /* we don't need much space for the basic simulator */ -# define T_CACHE_SIZE 1024 -#else -# define T_CACHE_SIZE (8192) -#endif +#define T_CACHE_SIZE (8192) /* maximum number of bytes a message can contain */ #ifdef T_SEND_TIME diff --git a/common/utils/T/local_tracer.c b/common/utils/T/local_tracer.c index 539e72b223..b4f1804c41 100644 --- a/common/utils/T/local_tracer.c +++ b/common/utils/T/local_tracer.c @@ -357,22 +357,6 @@ static void forward(void *_forwarder, char *buf, int size) { if (f->tail != NULL) f->tail->next = new; f->tail = new; -#if BASIC_SIMULATOR - /* When runnng the basic simulator, the tracer may be too slow. - * Let's not take too much memory in the tracee and - * wait if there is too much data to send. 200MB is - * arbitrary. - */ - while (f->memusage > 200 * 1024 * 1024) { - if (pthread_cond_signal(&f->cond)) abort(); - - if (pthread_mutex_unlock(&f->lock)) abort(); - - usleep(1000); - - if (pthread_mutex_lock(&f->lock)) abort(); - } -#endif f->memusage += size+4; /* warn every 100MB */ diff --git a/doc/BASIC_SIM.md b/doc/BASIC_SIM.md deleted file mode 100644 index 1bfc6e76d2..0000000000 --- a/doc/BASIC_SIM.md +++ /dev/null @@ -1,191 +0,0 @@ - - - - - -
- - - - - - Running OAI Basic Simulator -
- -This page is valid on the following branches: - -- `master` starting from tag `v1.1.0` -- `develop` starting from tag `2019.w11` - -# 1. Building the basic-simulator. - -After the build simplification, the basic simulator is available directly from the standard build. - -```bash -$ source oaienv -$ cd cmake_targets -$ ./build_oai --eNB --UE -``` - -Both eNB (lte-softmodem) and UE (lte-uesoftmodem) are present on `cmake_targets/ran_build/build` folder. - -More details are available on the [build page](BUILD.md). - -# 2. Running the basic simulator. - -The basic simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE and the oai eNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. - -This is the ideal tool to check signal processing algorithms and protocols implementation and having debug sessions without any HW radio equipment. - -The main limitations are: - -- A single OAI UE will connect to the OAI eNB -- No channel noise - -## 2.1. Starting eNB - -The basic simulator is able to run with a connected EPC or without any (the so-called "noS1" mode). - -Example 1: running in FDD mode with EPC. - -```bash -$ source oaienv -$ cd cmake_targets/ran_build/build -$ ENODEB=1 sudo -E ./lte-softmodem -O $OPENAIR_HOME/ci-scripts/conf_files/lte-fdd-basic-sim.conf --basicsim -``` - -Edit previously the `ci-scripts/conf_files/lte-fdd-basic-sim.conf` file to modify: - -- `N_RB_DL` field to change the Bandwidth (25, 50, 100) -- `CI_MME_IP_ADDR` with the EPC IP address -- `CI_ENB_IP_ADDR` with the container (physical server, virtual machine, ...) on which you are executing the eNB soft-modem - -Example 2: running in TDD mode without any EPC. - -```bash -$ source oaienv -$ cd cmake_targets/ran_build/build -$ ENODEB=1 sudo -E ./lte-softmodem -O $OPENAIR_HOME/ci-scripts/conf_files/lte-tdd-basic-sim.conf --basicsim --noS1 -``` - -## 2.2. Starting UE - -Before starting the UE, you may need to edit the SIM parameters to adapt to your eNB configuration and HSS database. - -The file to use for conf2uedate is `openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf` - -You need to set the correct OPC, USIM_API_K, MSIN (this is the end par of the IMSI), HPLMN (the front part of IMSI) to match values from HSS. - -```bash -$ source oaienv -# Edit openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -$ cd cmake_targets/ran_build/build -$ ../../nas_sim_tools/build/conf2uedata -c $OPENAIR_HOME/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o . -$ sudo -E ./lte-uesoftmodem -C 2625000000 -r 25 --ue-rxgain 140 --basicsim [--noS1] -``` - -The `-r 25` is to use if in the conf file of the eNB you use N_RB_DL=25. Use 50 if you have N_RB_DL=50 and 100 if you have N_RB_DL=100. - -The `-C 2625000000` is the downlink frequency. Use the same value as `downlink_frequency` in the eNB configuration file. - -The `--noS1` is mandatory if you started the eNB in that mode. - -# 3. Testing the data plane - -# 3.1. In S1 mode - -First we need to retrieve the IP address allocated to the OAI UE. - -On the server that runs the UE: - -```bash -$ ifconfig oaitun_ue1 -oaitun_ue1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 - inet addr:192.172.0.2 P-t-P:192.172.0.2 Mask:255.255.255.0 -... -``` - -`192.172.0.2` is the IP address that has been allocated by the SPGW in the EPC. - -On the server that runs the EPC: - -```bash -$ ping -c 20 192.172.0.2 - --- 192.172.0.2 ping statistics --- - 20 packets transmitted, 20 received, 0% packet loss, time 19020ms - rtt min/avg/max/mdev = 13.241/18.999/24.208/2.840 ms -``` - -You can ping the EPC from the UE: - -```bash -$ ping -I oaitun_ue1 -c 20 192.172.0.1 - --- 192.172.0.1 ping statistics --- -... - 20 packets transmitted, 20 received, 0% packet loss, time 19019ms - rtt min/avg/max/mdev = 13.015/18.674/23.738/2.917 ms -``` - -For DL iperf testing: - -On the server that runs the UE. - -```bash -$ iperf -B 192.172.0.2 -u -s -i 1 -fm -p 5001 -``` - -On the server that runs the EPC. - -```bash -$ iperf -c 192.172.0.2 -u -t 30 -b 10M -i 1 -fm -B 192.172.0.1 -p 5001 -``` - -For UL iperf testing: - -On the server that runs the EPC. - -```bash -$ iperf -B 192.172.0.1 -u -s -i 1 -fm -p 5001 -``` - -On the server that runs the UE. - -```bash -$ iperf -c 192.172.0.1 -u -t 30 -b 2M -i 1 -fm -B 192.172.0.2 -p 5001 -``` - -# 3.2. In noS1 mode - -The IP addresses are fixed. But we can still retrieve them programmatically. - -For the UE it is quite the same: - -```bash -$ ifconfig oaitun_ue1 -oaitun_ue1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 - inet addr:10.0.1.2 P-t-P:10.0.1.2 Mask:255.255.255.0 -... -``` - -For the eNB: - -```bash -$ ifconfig oaitun_enb1 -oaitun_enb1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 - inet addr:10.0.1.1 P-t-P:10.0.1.1 Mask:255.255.255.0 -... -``` - -Pinging like this: - -```bash -$ ping -I oaitun_ue1 -c 20 10.0.1.1 -$ ping -I oaitun_enb1 -c 20 10.0.1.2 -``` - -And the same for iperf: - -```bash -$ iperf -B 10.0.1.2 -u -s -i 1 -fm -$ iperf -c 10.0.1.2 -u -b 1.00M -t 30 -i 1 -fm -B 10.0.1.1 -``` diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 7ee3ae9d7e..919bbc2dc0 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -14,10 +14,6 @@ After you have [built the softmodem executables](BUILD.md) you can set your default directory to the build directory `cmake_targets/ran_build/build/` and start testing some use cases. Below, the description of the different oai functionalities should help you choose the oai configuration that suits your need. -# Basic Simulator - -See the [dedicated page](BASIC_SIM.md). - # RF Simulator The rf simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE (LTE or 5G) and respectively the oai eNodeB or gNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. This is the ideal tool to check signal processing algorithms and protocols implementation. The rf simulator has some preliminary support for channel modeling. diff --git a/docker/Dockerfile.eNB.rhel8.2 b/docker/Dockerfile.eNB.rhel8.2 index 6c921a4932..7924f5bd78 100644 --- a/docker/Dockerfile.eNB.rhel8.2 +++ b/docker/Dockerfile.eNB.rhel8.2 @@ -62,7 +62,6 @@ COPY --from=enb-build \ COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.eNB.rhel8.2.oc4-4 b/docker/Dockerfile.eNB.rhel8.2.oc4-4 index 5b784c08a2..03f6ec8e45 100644 --- a/docker/Dockerfile.eNB.rhel8.2.oc4-4 +++ b/docker/Dockerfile.eNB.rhel8.2.oc4-4 @@ -62,7 +62,6 @@ COPY --from=enb-build /oai-ran/targets/bin/lte-softmodem.Rel15 . WORKDIR /usr/local/lib/ COPY --from=enb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . -COPY --from=enb-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . COPY --from=enb-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . COPY --from=enb-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . COPY --from=enb-build /oai-ran/targets/bin/libcoding.so . @@ -95,7 +94,6 @@ RUN ldconfig #debug RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15 -RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15 RUN ldd /usr/local/lib/librfsimulator.so.Rel15 RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15 RUN ldd /usr/local/lib/libcoding.so diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18 index 1f375a20dc..222a7f42bb 100644 --- a/docker/Dockerfile.eNB.ubuntu18 +++ b/docker/Dockerfile.eNB.ubuntu18 @@ -69,7 +69,6 @@ COPY --from=enb-build \ COPY --from=enb-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.gNB.rhel8.2 b/docker/Dockerfile.gNB.rhel8.2 index 703f4c67b5..6a1b447a62 100644 --- a/docker/Dockerfile.gNB.rhel8.2 +++ b/docker/Dockerfile.gNB.rhel8.2 @@ -64,7 +64,6 @@ COPY --from=gnb-build \ COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.gNB.rhel8.2.oc4-4 b/docker/Dockerfile.gNB.rhel8.2.oc4-4 index 1e1eba016e..6c88d3ad8e 100644 --- a/docker/Dockerfile.gNB.rhel8.2.oc4-4 +++ b/docker/Dockerfile.gNB.rhel8.2.oc4-4 @@ -65,7 +65,6 @@ COPY --from=gnb-build /oai-ran/targets/bin/nr-softmodem.Rel15 . WORKDIR /usr/local/lib/ COPY --from=gnb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . -COPY --from=gnb-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . COPY --from=gnb-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . COPY --from=gnb-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . COPY --from=gnb-build /oai-ran/targets/bin/libcoding.so . @@ -102,7 +101,6 @@ RUN ldconfig #debug RUN ldd /opt/oai-gnb/bin/nr-softmodem.Rel15 RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15 -RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15 RUN ldd /usr/local/lib/librfsimulator.so.Rel15 RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15 RUN ldd /usr/local/lib/libcoding.so diff --git a/docker/Dockerfile.gNB.ubuntu18 b/docker/Dockerfile.gNB.ubuntu18 index 24e4bcbc7c..6f990db833 100644 --- a/docker/Dockerfile.gNB.ubuntu18 +++ b/docker/Dockerfile.gNB.ubuntu18 @@ -68,7 +68,6 @@ COPY --from=gnb-build \ COPY --from=gnb-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.lteRU.rhel8.2 b/docker/Dockerfile.lteRU.rhel8.2 index 5addbca655..b41aee36dc 100644 --- a/docker/Dockerfile.lteRU.rhel8.2 +++ b/docker/Dockerfile.lteRU.rhel8.2 @@ -59,7 +59,6 @@ COPY --from=ru-build \ COPY --from=ru-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ diff --git a/docker/Dockerfile.lteRU.ubuntu18 b/docker/Dockerfile.lteRU.ubuntu18 index 1f1c903a15..1810afb621 100644 --- a/docker/Dockerfile.lteRU.ubuntu18 +++ b/docker/Dockerfile.lteRU.ubuntu18 @@ -64,7 +64,6 @@ COPY --from=ru-build \ COPY --from=ru-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \ diff --git a/docker/Dockerfile.lteUE.rhel8.2 b/docker/Dockerfile.lteUE.rhel8.2 index f547558bdb..cc1be3d41d 100644 --- a/docker/Dockerfile.lteUE.rhel8.2 +++ b/docker/Dockerfile.lteUE.rhel8.2 @@ -66,7 +66,6 @@ COPY --from=lte-ue-build \ COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.lteUE.rhel8.2.oc4-4 b/docker/Dockerfile.lteUE.rhel8.2.oc4-4 index 1339d18de6..cc492882f5 100644 --- a/docker/Dockerfile.lteUE.rhel8.2.oc4-4 +++ b/docker/Dockerfile.lteUE.rhel8.2.oc4-4 @@ -68,7 +68,6 @@ COPY --from=lte-ue-build /oai-ran/targets/bin/.usim.nvram0 . WORKDIR /usr/local/lib/ COPY --from=lte-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . -COPY --from=lte-ue-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . COPY --from=lte-ue-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . COPY --from=lte-ue-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . COPY --from=lte-ue-build /oai-ran/targets/bin/libcoding.so . @@ -105,7 +104,6 @@ RUN ldd /opt/oai-lte-ue/bin/conf2uedata RUN ldd /opt/oai-lte-ue/bin/nvram RUN ldd /opt/oai-lte-ue/bin/usim RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15 -RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15 RUN ldd /usr/local/lib/librfsimulator.so.Rel15 RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15 RUN ldd /usr/local/lib/libcoding.so diff --git a/docker/Dockerfile.lteUE.ubuntu18 b/docker/Dockerfile.lteUE.ubuntu18 index a5bf4cfe94..292ac37e5f 100644 --- a/docker/Dockerfile.lteUE.ubuntu18 +++ b/docker/Dockerfile.lteUE.ubuntu18 @@ -73,7 +73,6 @@ COPY --from=lte-ue-build \ COPY --from=lte-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.nrUE.rhel8.2 b/docker/Dockerfile.nrUE.rhel8.2 index cbc8d8c65f..d38e81bd71 100644 --- a/docker/Dockerfile.nrUE.rhel8.2 +++ b/docker/Dockerfile.nrUE.rhel8.2 @@ -66,7 +66,6 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf . COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/docker/Dockerfile.nrUE.rhel8.2.oc4-4 b/docker/Dockerfile.nrUE.rhel8.2.oc4-4 index d900fff998..2d018c96af 100644 --- a/docker/Dockerfile.nrUE.rhel8.2.oc4-4 +++ b/docker/Dockerfile.nrUE.rhel8.2.oc4-4 @@ -64,7 +64,6 @@ COPY --from=nr-ue-build /oai-ran/targets/bin/nr-uesoftmodem.Rel15 . WORKDIR /usr/local/lib/ COPY --from=nr-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 . -COPY --from=nr-ue-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 . COPY --from=nr-ue-build /oai-ran/targets/bin/librfsimulator.so.Rel15 . COPY --from=nr-ue-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 . COPY --from=nr-ue-build /oai-ran/targets/bin/libcoding.so . @@ -100,7 +99,6 @@ COPY --from=nr-ue-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64 RUN ldconfig RUN ldd /opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15 RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15 -RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15 RUN ldd /usr/local/lib/librfsimulator.so.Rel15 RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15 RUN ldd /usr/local/lib/libcoding.so diff --git a/docker/Dockerfile.nrUE.ubuntu18 b/docker/Dockerfile.nrUE.ubuntu18 index 126f268e00..0fa219296b 100644 --- a/docker/Dockerfile.nrUE.ubuntu18 +++ b/docker/Dockerfile.nrUE.ubuntu18 @@ -71,7 +71,6 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf . COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ - /oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \ /oai-ran/cmake_targets/ran_build/build/librfsimulator.so \ /oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \ /oai-ran/cmake_targets/ran_build/build/libcoding.so \ diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 76c21bb422..00f019c03a 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -373,7 +373,7 @@ void init_openair0(void) { static void init_pdcp(int ue_id) { uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT); - /*if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { + /*if (IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; }*/ diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c index 12c60e98fd..c78fc70243 100644 --- a/executables/softmodem-common.c +++ b/executables/softmodem-common.c @@ -89,7 +89,7 @@ void get_common_options(uint32_t execmask) { uint32_t glog_level=0 ; uint32_t start_telnetsrv = 0, start_telnetclt = 0; uint32_t noS1 = 0, nokrnmod = 1, nonbiot = 0; - uint32_t rfsim = 0, basicsim = 0, do_forms = 0; + uint32_t rfsim = 0, do_forms = 0; char *logmem_filename = NULL; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; @@ -141,10 +141,6 @@ void get_common_options(uint32_t execmask) { set_softmodem_optmask(SOFTMODEM_RFSIM_BIT); } - if (basicsim) { - set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); - } - if (do_forms) { set_softmodem_optmask(SOFTMODEM_DOSCOPE_BIT); } diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 1f73720e70..06b53aac84 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -93,7 +93,7 @@ extern "C" #define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n" #define CONFIG_HLP_NOS1 "Disable s1 interface\n" -#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n" +#define CONFIG_HLP_RFSIM "Run in rf simulator mode\n" #define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n" @@ -154,7 +154,6 @@ extern int usrp_tx_thread; {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, uptr:&noS1, defintval:0, TYPE_INT, 0}, \ {"rfsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&rfsim, defintval:0, TYPE_INT, 0}, \ - {"basicsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&basicsim, defintval:0, TYPE_INT, 0}, \ {"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \ {"nsa", CONFIG_HLP_NSA, PARAMFLAG_BOOL, iptr:&NSA, defintval:0, TYPE_INT, 0}, \ @@ -201,7 +200,6 @@ extern int usrp_tx_thread; #define SOFTMODEM_NOKRNMOD_BIT (1<<1) #define SOFTMODEM_NONBIOT_BIT (1<<2) #define SOFTMODEM_RFSIM_BIT (1<<10) -#define SOFTMODEM_BASICSIM_BIT (1<<11) #define SOFTMODEM_SIML1_BIT (1<<12) #define SOFTMODEM_DOSCOPE_BIT (1<<15) #define SOFTMODEM_RECPLAY_BIT (1<<16) @@ -218,7 +216,6 @@ extern int usrp_tx_thread; #define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT) #define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_BIT) #define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT) -#define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT) #define IS_SOFTMODEM_SIML1 ( get_softmodem_optmask() & SOFTMODEM_SIML1_BIT) #define IS_SOFTMODEM_DOSCOPE ( get_softmodem_optmask() & SOFTMODEM_DOSCOPE_BIT) #define IS_SOFTMODEM_IQPLAYER ( get_softmodem_optmask() & SOFTMODEM_RECPLAY_BIT) diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c index 504c8fa80a..5b661d7c2d 100644 --- a/openair1/PHY/INIT/lte_param_init.c +++ b/openair1/PHY/INIT/lte_param_init.c @@ -151,11 +151,5 @@ void lte_param_init(PHY_VARS_eNB **eNBp, else if (eNB->frame_parms.N_RB_DL == 25) ru->N_TA_offset = 624/4; } else ru->N_TA_offset=0; - if (IS_SOFTMODEM_BASICSIM) - /* this is required for the basic simulator in TDD mode - * TODO: find a proper cleaner solution - */ - UE->N_TA_offset = 0; - printf("Done lte_param_init\n"); } diff --git a/openair1/PHY/LTE_TRANSPORT/pss.c b/openair1/PHY/LTE_TRANSPORT/pss.c index 9ebd841430..ce524ef611 100644 --- a/openair1/PHY/LTE_TRANSPORT/pss.c +++ b/openair1/PHY/LTE_TRANSPORT/pss.c @@ -72,10 +72,6 @@ int generate_pss(int32_t **txdataF, a = (frame_parms->nb_antenna_ports_eNB == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15)>>15; //printf("[PSS] amp=%d, a=%d\n",amp,a); - if (IS_SOFTMODEM_BASICSIM) - /* a hack to remove at some point (the UE doesn't synch with 100 RBs) */ - a = (frame_parms->nb_antenna_ports_eNB == 1) ? 4*amp: (amp*ONE_OVER_SQRT2_Q15)>>15; - Nsymb = (frame_parms->Ncp==NORMAL)?14:12; for (aa=0; aanb_antenna_ports_eNB; aa++) { diff --git a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c index ba904629a1..ff7affe1b3 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/initial_sync.c @@ -557,11 +557,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); - if (IS_SOFTMODEM_BASICSIM ) - phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); - } else { - if (IS_SOFTMODEM_BASICSIM ) - phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); } return ret; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c index 929f63e9fc..82120dc3c3 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c @@ -81,29 +81,20 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 int i, prach_len; uint16_t first_nonzero_root_idx=0; - if ( !(IS_SOFTMODEM_BASICSIM ) ) { - prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset); + prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset); #ifdef PRACH_DEBUG - LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, - prach_start, - ue->rx_offset, - ue->hw_timing_advance, - ue->N_TA_offset); + LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, + prach_start, + ue->rx_offset, + ue->hw_timing_advance, + ue->N_TA_offset); #endif - if (prach_start<0) - prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); + if (prach_start<0) + prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); - if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); - } else { //normal case (simulation) - prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset; - LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, - prach_start, - ue->rx_offset, - ue->hw_timing_advance, - ue->N_TA_offset); - } + if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME); // First compute physical root sequence if (restricted_set == 0) { @@ -476,40 +467,32 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 AssertFatal(prach_fmt<4, "prach_fmt4 not fully implemented" ); - if (!(IS_SOFTMODEM_BASICSIM ) ) { - int j; - int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti; - LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow ); + int j; + int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti; + LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow ); - for (i=prach_start,j=0; iframe_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) { - ((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j]; - ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; - } + for (i=prach_start,j=0; iframe_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) { + ((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j]; + ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; + } - for (i=0; icommon_vars.txdata[0])[2*i] = prach[2*j]; - ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; - } + for (i=0; icommon_vars.txdata[0])[2*i] = prach[2*j]; + ((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1]; + } #if defined(EXMIMO) - // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on - for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; kcommon_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else - ue->common_vars.txdata[0][k] &= 0xFFFEFFFE; - } - -#endif - } else { // simulators - for (i=0; icommon_vars.txdata[0][prach_start]))[2*i] = prach[2*i]; - ((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1]; - } + // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on + for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; kcommon_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else + ue->common_vars.txdata[0][k] &= 0xFFFEFFFE; } +#endif #if defined(PRACH_WRITE_OUTPUT_DEBUG) LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1); diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 6b18e55c4b..0b20aa409b 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -458,8 +458,6 @@ typedef struct RU_t_s { int emulate_rf; /// numerology index int numerology; - /// flag to indicate basicsim operation - int basicsim; /// flag to indicate the RU is in sync with a master reference int in_synch; /// timing offset diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index 4635f2b741..b02f24e04e 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -1150,20 +1150,14 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, nsymb = (frame_parms->Ncp == 0) ? 14 : 12; - if (!IS_SOFTMODEM_BASICSIM) { - ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti- - ue->hw_timing_advance- - ue->timing_advance- - ue->N_TA_offset+5); + ulsch_start = ue->rx_offset + subframe_tx * frame_parms->samples_per_tti + - ue->hw_timing_advance - ue->timing_advance - ue->N_TA_offset + 5; - if(ulsch_start < 0) - ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); + if(ulsch_start < 0) + ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); - if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)) - ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); - } else { //this is the simulators case - ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance; - } + if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti)) + ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); if (empty_subframe) { overflow = ulsch_start - 9*frame_parms->samples_per_tti; @@ -1181,8 +1175,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, } for (aa=0; aanb_antennas_tx; aa++) { - int *Buff = IS_SOFTMODEM_BASICSIM ? &ue->common_vars.txdata[aa][ulsch_start] :dummy_tx_buffer; - + int *Buff = dummy_tx_buffer; if (frame_parms->Ncp == 1) { PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size], Buff, @@ -1202,41 +1195,33 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, &ue->frame_parms); } - if (IS_SOFTMODEM_BASICSIM) { - apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0); - apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1); - } else { - apply_7_5_kHz(ue,dummy_tx_buffer,0); - apply_7_5_kHz(ue,dummy_tx_buffer,1); + apply_7_5_kHz(ue,dummy_tx_buffer,0); + apply_7_5_kHz(ue,dummy_tx_buffer,1); + + overflow = ulsch_start - 9*frame_parms->samples_per_tti; + + for (k=ulsch_start,l=0; ksamples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) { + ((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; + ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; } - if (!(IS_SOFTMODEM_BASICSIM) ) { - overflow = ulsch_start - 9*frame_parms->samples_per_tti; - - for (k=ulsch_start,l=0; ksamples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) { - ((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; - ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; - } - - for (k=0; kcommon_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; - ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; - } + for (k=0; kcommon_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l]; + ((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1]; + } #if defined(EXMIMO) - // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on - for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; kcommon_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) - ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; - else - ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; - } - -#endif + // handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on + for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; kcommon_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)) + ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE; + else + ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE; } +#endif /* only for debug @@ -1314,14 +1299,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue, ue->prach_resources[eNB_id]->ra_RNTI); ue->tx_total_RE[subframe_tx] = 96; - if (IS_SOFTMODEM_BASICSIM) { - ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 6); - } else { - ue->prach_vars[eNB_id]->amp = AMP; - } + ue->prach_vars[eNB_id]->amp = AMP; if ((mode == calib_prach_tx) && (((proc->frame_tx&0xfffe)%100)==0)) LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n", @@ -1688,14 +1666,10 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue, ue->tx_total_RE[subframe_tx] = nb_rb*12; - if (IS_SOFTMODEM_BASICSIM) { - tx_amp = AMP; - } else { - tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - nb_rb); - } + tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx], + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + nb_rb); T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb)); @@ -1765,17 +1739,13 @@ void ue_srs_procedures(PHY_VARS_UE *ue, Po_SRS = ue->tx_power_max_dBm; } - if (IS_SOFTMODEM_BASICSIM) { - tx_amp = AMP; + if (ue->mac_enabled==1) { + tx_amp = get_tx_amp(Po_SRS, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + nb_rb_srs); } else { - if (ue->mac_enabled==1) { - tx_amp = get_tx_amp(Po_SRS, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - nb_rb_srs); - } else { - tx_amp = AMP; - } + tx_amp = AMP; } LOG_D(PHY,"SRS PROC; TX_MAX_POWER %d, Po_SRS %d, NB_RB_UL %d, NB_RB_SRS %d TX_AMPL %d\n",ue->tx_power_max_dBm, @@ -2008,14 +1978,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue, ue->tx_power_dBm[subframe_tx] = Po_PUCCH; ue->tx_total_RE[subframe_tx] = 12; - if (IS_SOFTMODEM_BASICSIM) { - tx_amp = AMP; - } else { - tx_amp = get_tx_amp(Po_PUCCH, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 1); - } + tx_amp = get_tx_amp(Po_PUCCH, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 1); T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); @@ -2089,14 +2055,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue, ue->tx_power_dBm[subframe_tx] = Po_PUCCH; ue->tx_total_RE[subframe_tx] = 12; - if (IS_SOFTMODEM_BASICSIM) { - tx_amp = AMP; - } else { - tx_amp = get_tx_amp(Po_PUCCH, - ue->tx_power_max_dBm, - ue->frame_parms.N_RB_UL, - 1); - } + tx_amp = get_tx_amp(Po_PUCCH, + ue->tx_power_max_dBm, + ue->frame_parms.N_RB_UL, + 1); T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]), T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id))); @@ -2344,9 +2306,6 @@ void ue_measurement_procedures(uint16_t l, // symbol index of each slot [0..6 // AGC VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN); - if (IS_SOFTMODEM_BASICSIM) - phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT); eNB_id = 0; diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c index 08daf58cf7..4d681b8d62 100644 --- a/targets/ARCH/COMMON/common_lib.c +++ b/targets/ARCH/COMMON/common_lib.c @@ -116,9 +116,6 @@ int load_lib(openair0_device *device, deflibname=OAI_IQPLAYER_LIBNAME; shlib_fdesc[0].fname="device_init"; set_softmodem_optmask(SOFTMODEM_RECPLAY_BIT); // softmodem has to know we use the iqplayer to workaround randomized algorithms - } else if ( IS_SOFTMODEM_BASICSIM ) { - deflibname=OAI_BASICSIM_LIBNAME; - shlib_fdesc[0].fname="device_init"; } else if (IS_SOFTMODEM_RFSIM && flag == RAU_LOCAL_RADIO_HEAD) { deflibname=OAI_RFSIM_LIBNAME; shlib_fdesc[0].fname="device_init"; diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 38a7b0fa67..a60d5e78fc 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -46,8 +46,6 @@ #define OAI_THIRDPARTY_TP_LIBNAME "thirdparty_transpro" /* name of shared library implementing the rf simulator */ #define OAI_RFSIM_LIBNAME "rfsimulator" -/* name of shared library implementing the basic simulator */ -#define OAI_BASICSIM_LIBNAME "tcp_bridge_oai" /* name of shared library implementing the iq player */ #define OAI_IQPLAYER_LIBNAME "oai_iqplayer" diff --git a/targets/ARCH/tcp_bridge/README b/targets/ARCH/tcp_bridge/README deleted file mode 100644 index 9bd1a16e59..0000000000 --- a/targets/ARCH/tcp_bridge/README +++ /dev/null @@ -1,4 +0,0 @@ -This is sort of a "TCP driver" to ease debugging. This is mostly internal -to EURECOM. You probably don't want to use it. - -Same license as the rest. diff --git a/targets/ARCH/tcp_bridge/README.tcp_bridge_oai b/targets/ARCH/tcp_bridge/README.tcp_bridge_oai deleted file mode 100644 index 05a520f6ae..0000000000 --- a/targets/ARCH/tcp_bridge/README.tcp_bridge_oai +++ /dev/null @@ -1,42 +0,0 @@ -The driver tcp_bridge_oai.c is to be used with the basic simulator. - -To build the basic simulator: - cd [openair top directory] - . oaienv - cd cmake_targets - ./build_oai -I -w USRP - ./build_oai --basic-simulator - cd ../common/utils/T/tracer - make - -To use it, you need to run the eNB and the UE. - -The eNB requires the T tracer. -Open two terminals. -In one terminal, run: - cd [openair top directory] - cd common/utils/T/tracer - ./enb -d ../T_messages.txt -In the other terminal, run: - cd [openair top directory] - cd cmake_targets/basic_simulator/enb - export ENODEB=1 - sudo -E ./lte-softmodem -O [configuration file] --T_stdout 0 -[configuration file] is just a regular configuration file. -The eNB needs an EPC. - -To run the UE, open a terminal and run: - cd [openair top directory] - cd cmake_targets/basic_simulator/ue - sudo ./lte-uesoftmodem -C 2680000000 -r 25 --ue-rxgain 140 -Adapt the value of -r, it has to match the value N_RB_DL in the configuration -file of the eNB. (Same for -C which should match the value downlink_frequency -in the configuration file.) - -The UE configuration (security keys) is generated from the file -openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf. You need to configure -your EPC to know about the UE. If you change the file -openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf then you need to -regenerate the configuration files using the program targets/bin/conf2uedata. -You run it as: - $OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o $OPENAIR_DIR/cmake_targets/basic_simulator/ue diff --git a/targets/ARCH/tcp_bridge/tcp_bridge.c b/targets/ARCH/tcp_bridge/tcp_bridge.c deleted file mode 100644 index f8c12dcb7a..0000000000 --- a/targets/ARCH/tcp_bridge/tcp_bridge.c +++ /dev/null @@ -1,292 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -int fullread(int fd, void *_buf, int count) -{ - char *buf = _buf; - int ret = 0; - int l; - while (count) { - l = read(fd, buf, count); - if (l <= 0) return -1; - count -= l; - buf += l; - ret += l; - } - return ret; -} - -int fullwrite(int fd, void *_buf, int count) -{ - char *buf = _buf; - int ret = 0; - int l; - while (count) { - l = write(fd, buf, count); - if (l <= 0) return -1; - count -= l; - buf += l; - ret += l; - } - return ret; -} - -#include "common_lib.h" - -typedef struct { - int32_t data[30720]; /* max 20MHz */ - unsigned long timestamp; - int size; -} input_buffer; - -#define BSIZE 16 - -typedef struct { - int sock; - int samples_per_subframe; - input_buffer b[BSIZE]; - int bstart; - int blen; - unsigned long read_timestamp; -} tcp_bridge_state_t; - - -/****************************************************************************/ -/* buffer management */ -/* (could be simpler, we are synchronous) */ -/* maybe we should lock */ -/****************************************************************************/ - -void put_buffer(tcp_bridge_state_t *t, void *data, int size, unsigned long timestamp) -{ - int nextpos; - if (t->blen == BSIZE) { printf("tcp_bridge: buffer full\n"); exit(1); } - if (size > 30720*4) abort(); - if (t->blen) { - int lastpos = (t->bstart+t->blen-1) % BSIZE; - if (timestamp != t->b[lastpos].timestamp + t->samples_per_subframe) - { printf("tcp_bridge: discontinuity\n"); exit(1); } - } - nextpos = (t->bstart+t->blen) % BSIZE; - t->b[nextpos].timestamp = timestamp; - t->b[nextpos].size = size; - memcpy(t->b[nextpos].data, data, size); - t->blen++; -} - -void get_buffer(tcp_bridge_state_t *t, void *data, int size, unsigned long timestamp) -{ - int pos; - if (t->blen == 0) { printf("tcp_bridge: buffer empty\n"); exit(1); } - if (size >30720*4) abort(); - pos = t->bstart; - if (size != t->b[pos].size) { printf("tcp_bridge: bad size\n"); exit(1); } - memcpy(data, t->b[pos].data, size); - t->bstart = (t->bstart + 1) % BSIZE; - t->blen--; -} - -/****************************************************************************/ -/* end of buffer management */ -/****************************************************************************/ - - -/****************************************************************************/ -/* network management (read/write) */ -/****************************************************************************/ - -void read_data_from_network(int sock, input_buffer *b) -{ - if (fullread(sock, &b->timestamp, sizeof(b->timestamp)) != sizeof(b->timestamp)) goto err; - if (fullread(sock, &b->size, sizeof(b->size)) != sizeof(b->size)) goto err; - if (fullread(sock, b->data, b->size) != b->size) goto err; - return; - -err: - printf("tcp_bridge: read_data_from_network fails\n"); - exit(1); -} - -void write_data_to_network(int sock, input_buffer *b) -{ - if (fullwrite(sock, &b->timestamp, sizeof(b->timestamp)) != sizeof(b->timestamp)) goto err; - if (fullwrite(sock, &b->size, sizeof(b->size)) != sizeof(b->size)) goto err; - if (fullwrite(sock, b->data, b->size) != b->size) goto err; - return; - -err: - printf("tcp_bridge: write_data_to_network fails\n"); - exit(1); -} - -/****************************************************************************/ -/* end of network management */ -/****************************************************************************/ - - -int tcp_bridge_start(openair0_device *device) -{ - int i; - int port = 4042; - tcp_bridge_state_t *tcp_bridge = device->priv; - - int sock = socket(AF_INET, SOCK_STREAM, 0); - if (sock == -1) { perror("tcp_bridge: socket"); exit(1); } - - int enable = 1; - if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) - { perror("tcp_bridge: SO_REUSEADDR"); exit(1); } - - struct sockaddr_in addr = { - sin_family: AF_INET, - sin_port: htons(port), - sin_addr: { s_addr: INADDR_ANY } - }; - - if (bind(sock, (struct sockaddr *)&addr, sizeof(addr))) - { perror("tcp_bridge: bind"); exit(1); } - - if (listen(sock, 5)) - { perror("tcp_bridge: listen"); exit(1); } - - printf("tcp_bridge: wait for connection on port %d\n", port); - - socklen_t len = sizeof(addr); - int sock2 = accept(sock, (struct sockaddr *)&addr, &len); - if (sock2 == -1) - { perror("tcp_bridge: accept"); exit(1); } - - close(sock); - - tcp_bridge->sock = sock2; - - /* the other end has to send 10 subframes at startup */ - for (i = 0; i < 10; i++) - read_data_from_network(sock2, &tcp_bridge->b[i]); - tcp_bridge->bstart = 0; - tcp_bridge->blen = 10; - - printf("tcp_bridge: connection established\n"); - - return 0; -} - -int tcp_bridge_request(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; } -int tcp_bridge_reply(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; } -int tcp_bridge_get_stats(openair0_device* device) { return 0; } -int tcp_bridge_reset_stats(openair0_device* device) { return 0; } -void tcp_bridge_end(openair0_device *device) {} -int tcp_bridge_stop(openair0_device *device) { return 0; } -int tcp_bridge_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { return 0; } -int tcp_bridge_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { return 0; } - -int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) -{ - tcp_bridge_state_t *t = device->priv; - input_buffer out; - int i; -//printf("write ts %ld nsamps %d\n", timestamp, nsamps); - - if (nsamps > 30720) abort(); - - /* read buffer timestamped with 'timestamp' if not already here */ - for (i = 0; i < t->blen; i++) { - input_buffer *b = &t->b[(t->bstart + i) % BSIZE]; - if (b->timestamp == timestamp) break; - } - if (i == t->blen) { - int nextpos = (t->bstart + t->blen) % BSIZE; - if (t->blen == BSIZE) abort(); - read_data_from_network(t->sock, &t->b[nextpos]); - t->blen++; - if (t->b[nextpos].timestamp != timestamp) abort(); - } - - memcpy(out.data, buff[0], nsamps * 4); - out.timestamp = timestamp; - out.size = nsamps * 4; - write_data_to_network(t->sock, &out); - - return nsamps; -} - -int tcp_bridge_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) -{ - tcp_bridge_state_t *t = device->priv; - input_buffer *b; - - if (cc != 1) abort(); - if (t->blen == 0) abort(); - - b = &t->b[t->bstart]; - - if (b->timestamp != t->read_timestamp) abort(); - if (b->size != nsamps * 4) abort(); - - *timestamp = b->timestamp; - memcpy(buff[0], b->data, b->size); - - t->read_timestamp += nsamps; - t->bstart = (t->bstart + 1) % BSIZE; - t->blen--; - -static unsigned long ts = 0; -//printf("read ts %ld nsamps %d\n", ts, nsamps); -*timestamp = ts; -ts += nsamps; - - return nsamps; -} - -int tcp_bridge_write_init(openair0_device *device) -{ - return 0; -} - -__attribute__((__visibility__("default"))) -int device_init(openair0_device* device, openair0_config_t *openair0_cfg) -{ - tcp_bridge_state_t *tcp_bridge = (tcp_bridge_state_t*)malloc(sizeof(tcp_bridge_state_t)); - memset(tcp_bridge, 0, sizeof(tcp_bridge_state_t)); - - /* only 25 or 50 PRBs handled for the moment */ - if (openair0_cfg[0].sample_rate != 61440000 && - openair0_cfg[0].sample_rate != 30720000 && - openair0_cfg[0].sample_rate != 15360000 && - openair0_cfg[0].sample_rate != 7680000) { - printf("tcp_bridge: ERROR: only sample rate 61.44, 30.72, 15.36, and 7.68 Msps supported\n"); - exit(1); - } - - device->trx_start_func = tcp_bridge_start; - device->trx_get_stats_func = tcp_bridge_get_stats; - device->trx_reset_stats_func = tcp_bridge_reset_stats; - device->trx_end_func = tcp_bridge_end; - device->trx_stop_func = tcp_bridge_stop; - device->trx_set_freq_func = tcp_bridge_set_freq; - device->trx_set_gains_func = tcp_bridge_set_gains; - device->trx_write_func = tcp_bridge_write; - device->trx_read_func = tcp_bridge_read; - device->trx_write_init = tcp_bridge_write_init; - - device->priv = tcp_bridge; - - switch ((int)openair0_cfg[0].sample_rate) { - case 61440000: tcp_bridge->samples_per_subframe = 61440; break; - case 30720000: tcp_bridge->samples_per_subframe = 30720; break; - case 15360000: tcp_bridge->samples_per_subframe = 15360; break; - case 7680000: tcp_bridge->samples_per_subframe = 7680; break; - } - - /* let's pretend to be a b2x0 */ - device->type = USRP_B200_DEV; - - device->openair0_cfg=&openair0_cfg[0]; - - return 0; -} diff --git a/targets/ARCH/tcp_bridge/tcp_bridge_oai.c b/targets/ARCH/tcp_bridge/tcp_bridge_oai.c deleted file mode 100644 index c3d5355876..0000000000 --- a/targets/ARCH/tcp_bridge/tcp_bridge_oai.c +++ /dev/null @@ -1,443 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const int port = 4043; -#define helpTxt "\ -\x1b[31m\ -tcp_bridge: error: you have to run one UE and one eNB\n\ -For this, export TCPBRIDGE=enb (eNB case) or \n\ - TCPBRIDGE= (UE case)\n\ -\x1b[m" - -int fullread(int fd, void *_buf, int count) { - char *buf = _buf; - int ret = 0; - int l; - - while (count) { - l = read(fd, buf, count); - - if (l <= 0) return -1; - - count -= l; - buf += l; - ret += l; - } - - return ret; -} - -int fullwrite(int fd, void *_buf, int count) { - char *buf = _buf; - int ret = 0; - int l; - - while (count) { - l = write(fd, buf, count); - - if (l <= 0) return -1; - - count -= l; - buf += l; - ret += l; - } - - return ret; -} - -#include "common_lib.h" - -typedef struct { - int sock; - int samples_per_subframe; - uint64_t timestamp; - uint64_t next_tx_timestamp; - int is_enb; - char *ip; -} tcp_bridge_state_t; - -void verify_connection(int fd, int is_enb) { - char c = is_enb; - - if (fullwrite(fd, &c, 1) != 1) exit(1); - - if (fullread(fd, &c, 1) != 1) exit(1); - - if (c == is_enb) { - printf(helpTxt); - exit(1); - } -} - - -int start_enb(tcp_bridge_state_t *tcp_bridge) { - struct sockaddr_in addr = { -sin_family: - AF_INET, -sin_port: - htons(port), -sin_addr: - { s_addr: INADDR_ANY } - }; - - if (bind(tcp_bridge->sock, (struct sockaddr *)&addr, sizeof(addr))) { - perror("tcp_bridge: bind"); - exit(1); - } - - if (listen(tcp_bridge->sock, 5)) { - perror("tcp_bridge: listen"); - exit(1); - } - - printf("tcp_bridge: wait for connection on port %d\n", port); - socklen_t len = sizeof(addr); - int sockServ = accept(tcp_bridge->sock, (struct sockaddr *)&addr, &len); - - if ( sockServ == -1) { - perror("tcp_bridge: accept"); - exit(1); - } - - verify_connection(sockServ, tcp_bridge->is_enb); - printf("tcp_bridge: connection established\n"); - close(tcp_bridge->sock); - tcp_bridge->sock=sockServ; - return 0; -} - -int start_ue(tcp_bridge_state_t *tcp_bridge) { -struct sockaddr_in addr = {sin_family: - AF_INET, -sin_port: - htons(port), -sin_addr: - { s_addr: INADDR_ANY } - }; - addr.sin_addr.s_addr = inet_addr(tcp_bridge->ip); - - while(1) { - printf("tcp_bridge: trying to connect to %s:%d\n", tcp_bridge->ip, port); - - if (connect(tcp_bridge->sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) { - verify_connection(tcp_bridge->sock, tcp_bridge->is_enb); - printf("tcp_bridge: connection established\n"); - return 0; - } - - perror("tcp_bridge"); - sleep(1); - } - - return 0; -} - -int tcp_bridge_start(openair0_device *device) { - tcp_bridge_state_t *tcp_bridge = device->priv; - tcp_bridge->sock = socket(AF_INET, SOCK_STREAM, 0); - - if (tcp_bridge->sock == -1) { - perror("tcp_bridge: socket"); - exit(1); - } - - int enable = 1; - - if (setsockopt(tcp_bridge->sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) { - perror("tcp_bridge: SO_REUSEADDR"); - exit(1); - } - - if ( tcp_bridge->is_enb ) - return start_enb(tcp_bridge); - else - return start_ue(tcp_bridge); -} - -int tcp_bridge_request(openair0_device *device, void *msg, ssize_t msg_len) { - abort(); - return 0; -} -int tcp_bridge_reply(openair0_device *device, void *msg, ssize_t msg_len) { - abort(); - return 0; -} -int tcp_bridge_get_stats(openair0_device *device) { - return 0; -} -int tcp_bridge_reset_stats(openair0_device *device) { - return 0; -} -void tcp_bridge_end(openair0_device *device) {} -int tcp_bridge_stop(openair0_device *device) { - return 0; -} -int tcp_bridge_set_freq(openair0_device *device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { - return 0; -} -int tcp_bridge_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) { - return 0; -} - -int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) { - if (cc != 1) { - printf("tcp_bridge: only 1 antenna supported\n"); - exit(1); - } - - tcp_bridge_state_t *t = device->priv; - - /* deal with discontinuities in output (think: eNB in TDD mode) */ - if (t->next_tx_timestamp && timestamp != t->next_tx_timestamp) { - uint32_t b[4096]; - uint64_t to_send = timestamp - t->next_tx_timestamp; - memset(b, 0, 4096 * sizeof(uint32_t)); - - while (to_send) { - int len = to_send > 4096 ? 4096 : to_send; - int n = fullwrite(t->sock, b, len * 4); - - if (n != len * 4) { - printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno)); - abort(); - } - - to_send -= len; - } - } - - int n = fullwrite(t->sock, buff[0], nsamps * 4); - - if (n != nsamps * 4) { - printf("tcp_bridge: write error ret %d (wanted %d) error %s\n", n, nsamps*4, strerror(errno)); - abort(); - } - - t->next_tx_timestamp = timestamp + nsamps; - return nsamps; -} - -int tcp_bridge_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { - if (cc != 1) { - printf("tcp_bridge: only 1 antenna supported\n"); - exit(1); - } - - tcp_bridge_state_t *t = device->priv; - int n = fullread(t->sock, buff[0], nsamps * 4); - - if (n != nsamps * 4) { - printf("tcp_bridge: read error ret %d nsamps*4 %d error %s\n", n, nsamps * 4, strerror(errno)); - abort(); - } - - *timestamp = t->timestamp; - t->timestamp += nsamps; - return nsamps; -} - -int tcp_bridge_read_ue(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { - if (cc != 1) { - printf("tcp_bridge: only 1 antenna supported\n"); - exit(1); - } - - tcp_bridge_state_t *t = device->priv; - int n; - - /* In synch mode, UE does not write, but we need to - send something to the eNodeB. - We know that UE is in synch mode when it reads - 10 subframes at a time. - */ - if (nsamps == t->samples_per_subframe * 10) { - uint32_t b[nsamps]; - memset(b, 0, nsamps * 4); - n = fullwrite(t->sock, b, nsamps * 4); - - if (n != nsamps * 4) { - printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno)); - abort(); - } - } - - return tcp_bridge_read(device, timestamp, buff, nsamps, cc); -} - -/* To startup proper communcation between eNB and UE, - we need to understand that: - - eNodeB starts reading subframe 0 - - then eNodeB starts sending subframe 4 - and then repeats read/write for each subframe. - The UE: - - reads 10 subframes at a time until it is synchronized - - then reads subframe n and writes subframe n+2 - We also want to enforce that the subframe 0 is read - at the beginning of the UE RX buffer, not in the middle - of it. - So it means: - - for the eNodeB: let it run as in normal mode (as with a B210) - - for the UE, on its very first read: - - we want this read to get data from subframe 0 - but the first write of eNodeB is subframe 4 - so we first need to read and ignore 6 subframes - - the UE will start its TX only at the subframe 2 - corresponding to the subframe 0 it just read, - so we need to write 12 subframes before anything - (the function tcp_bridge_read_ue takes care to - insert dummy TX data during the synch phase) - - Here is a drawing of the beginning of things to make - this logic clearer. - - We see that eNB starts RX at subframe 0, starts TX at subfram 4, - and that UE starts RX at subframe 10 and TX at subframe 12. - - We understand that the UE has to transmit 12 empty - subframes for the eNodeB to start its processing. - - And because the eNodeB starts its TX at subframe 4 and we - want the UE to start its RX at subframe 10, we need to - read and ignore 6 subframes in the UE. - - ------------------------------------------------------------------------- - eNB RX: | *0* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ... - ------------------------------------------------------------------------- - - ------------------------------------------------------------------------- - eNB TX: | 0 | 1 | 2 | 3 | *4* | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ... - ------------------------------------------------------------------------- - - ------------------------------------------------------------------------- - UE RX: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *10* | 11 | 12 | 13 | 14 ... - ------------------------------------------------------------------------- - - ------------------------------------------------------------------------- - UE TX: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | *12* | 13 | 14 ... - ------------------------------------------------------------------------- - - As a final note, we do TX before RX to ensure that the eNB will - get some data and send us something so there is no deadlock - at the beginning of things. Hopefully the kernel buffers for - the sockets are big enough so that the first (big) TX can - return to user mode before the buffers are full. If this - is wrong in some environment, we will need to work by smaller - units of data at a time. -*/ -int tcp_bridge_ue_first_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { - if (cc != 1) { - printf("tcp_bridge: only 1 antenna supported\n"); - exit(1); - } - - tcp_bridge_state_t *t = device->priv; - uint32_t b[t->samples_per_subframe * 12]; - memset(b, 0, t->samples_per_subframe * 12 * 4); - int n = fullwrite(t->sock, b, t->samples_per_subframe * 12 * 4); - - if (n != t->samples_per_subframe * 12 * 4) { - printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno)); - abort(); - } - - n = fullread(t->sock, b, t->samples_per_subframe * 6 * 4); - - if (n != t->samples_per_subframe * 6 * 4) { - printf("tcp_bridge: read error ret %d error %s\n", n, strerror(errno)); - abort(); - } - - /* Due to some unknown bug in the eNB (or UE, or both), the first frames - * are not correctly generated (or handled), which leads to a bad behavior - * of the simulator in some cases (seen with 100 RBs: the UE reads a bad - * MIB and switches to 25 RBs, which results in a deadlock in this driver). - * Let's skip 10 frames to avoid this issue. - */ - for (int i = 0; i < 10 * 10; i++) { - memset(b, 0, t->samples_per_subframe * 4); - n = fullwrite(t->sock, b, t->samples_per_subframe * 4); - - if (n != t->samples_per_subframe * 4) { - printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno)); - abort(); - } - - n = fullread(t->sock, b, t->samples_per_subframe * 4); - - if (n != t->samples_per_subframe * 4) { - printf("tcp_bridge: read error ret %d error %s\n", n, strerror(errno)); - abort(); - } - } - - device->trx_read_func = tcp_bridge_read_ue; - return tcp_bridge_read_ue(device, timestamp, buff, nsamps, cc); -} - -__attribute__((__visibility__("default"))) -int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { - tcp_bridge_state_t *tcp_bridge = (tcp_bridge_state_t *)calloc(sizeof(tcp_bridge_state_t),1); - - if ((tcp_bridge->ip=getenv("TCPBRIDGE")) == NULL ) { - /* for compatibility, we test the ENB environment variable */ - if ((tcp_bridge->ip=getenv("ENODEB")) != NULL ) { - tcp_bridge->ip=strdup("enb"); - } else { - tcp_bridge->ip=strdup("127.0.0.1"); - } - } - - tcp_bridge->is_enb = strncasecmp(tcp_bridge->ip,"enb",3) == 0; - printf("tcp_bridge: running as %s\n", tcp_bridge->is_enb ? "eNB" : "UE"); - - if (openair0_cfg[0].sample_rate != 61440000 && - openair0_cfg[0].sample_rate != 30720000 && - openair0_cfg[0].sample_rate != 15360000 && - openair0_cfg[0].sample_rate != 7680000) { - printf("tcp_bridge: ERROR: only sample rate 61.44, 30.72, 15.36, and 7.68 Msps supported\n"); - exit(1); - } - - device->trx_start_func = tcp_bridge_start; - device->trx_get_stats_func = tcp_bridge_get_stats; - device->trx_reset_stats_func = tcp_bridge_reset_stats; - device->trx_end_func = tcp_bridge_end; - device->trx_stop_func = tcp_bridge_stop; - device->trx_set_freq_func = tcp_bridge_set_freq; - device->trx_set_gains_func = tcp_bridge_set_gains; - device->trx_write_func = tcp_bridge_write; - - if (tcp_bridge->is_enb) { - device->trx_read_func = tcp_bridge_read; - } else { - device->trx_read_func = tcp_bridge_ue_first_read; - } - - device->priv = tcp_bridge; - - switch ((int)openair0_cfg[0].sample_rate) { - case 30720000: - tcp_bridge->samples_per_subframe = 30720; - break; - - case 15360000: - tcp_bridge->samples_per_subframe = 15360; - break; - - case 7680000: - tcp_bridge->samples_per_subframe = 7680; - break; - } - - /* let's pretend to be a b2x0 */ - device->type = USRP_B200_DEV; - device->openair0_cfg=&openair0_cfg[0]; - return 0; -} diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 7e897c7deb..66ce6ef247 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1387,12 +1387,6 @@ int setup_RU_buffers(RU_t *ru) { else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2; else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4; - if(IS_SOFTMODEM_BASICSIM) - /* this is required for the basic simulator in TDD mode - * TODO: find a proper cleaner solution - */ - ru->N_TA_offset = 0; - if (frame_parms->N_RB_DL == 100) /* no scaling to do */; else if (frame_parms->N_RB_DL == 50) { ru->sf_extension /= 2; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 2e95e56d85..90a0534136 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -360,12 +360,6 @@ void init_UE(int nb_inst, } } else UE->N_TA_offset = 0; - if( IS_SOFTMODEM_BASICSIM) - /* this is required for the basic simulator in TDD mode - * TODO: find a proper cleaner solution - */ - UE->N_TA_offset = 0; - LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); init_UE_threads(inst); @@ -883,7 +877,7 @@ static void *UE_thread_rxn_txnp4(void *arg) proc->instance_cnt_rxtx--; - if ( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + if (IS_SOFTMODEM_RFSIM) { if (pthread_cond_signal(&proc->cond_rxtx) != 0) abort(); } @@ -1998,12 +1992,6 @@ void *UE_thread(void *arg) log_scheduler(__func__); while (!oai_exit) { - if (IS_SOFTMODEM_BASICSIM) - while (!(UE->proc.instance_cnt_synch < 0)) { - printf("ue sync not ready\n"); - usleep(500*1000); - } - AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), ""); int instance_cnt_synch = UE->proc.instance_cnt_synch; int is_synchronized = UE->is_synchronized; @@ -2121,7 +2109,7 @@ void *UE_thread(void *arg) // update thread index for received subframe UE->current_thread_id[sub_frame] = thread_idx; - if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM ) { + if (IS_SOFTMODEM_RFSIM ) { int t; for (t = 0; t < 2; t++) { @@ -2213,8 +2201,8 @@ void *UE_thread(void *arg) LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols); } - /* no timeout in IS_SOFTMODEM_BASICSIM or IS_SOFTMODEM_RFSIM mode */ - if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM) { + /* no timeout in IS_SOFTMODEM_RFSIM mode */ + if (IS_SOFTMODEM_RFSIM) { ret = pthread_mutex_lock(&proc->mutex_rxtx); } else { struct timespec tv; diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 2b39bd3f0f..8cdef647ca 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -519,7 +519,7 @@ int restart_L1L2(module_id_t enb_id) { static void init_pdcp(int ue_id) { uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT); - if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { + if (IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) { pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT; } From 91d42fd5ec9062c47eae149dde88d2758eb7c941 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 17 Mar 2022 12:44:30 -0700 Subject: [PATCH 692/883] Fixing memory leaks and hoping to fix num_dci_option bug --- executables/nr-ue.c | 6 ++-- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 31 +++++++++++---------- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 30 ++++++++++++-------- 3 files changed, 38 insertions(+), 29 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index c13adb70b3..66b08522f6 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -380,9 +380,11 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) } if (slot_ind) { sfn_slot = *slot_ind; + free_and_zero(slot_ind); } else if (ch_info) { sfn_slot = ch_info->sfn_slot; + free_and_zero(ch_info); } frame_t frame = NFAPI_SFNSLOT2SFN(sfn_slot); @@ -465,10 +467,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) pdcp_run(&ctxt); } process_queued_nr_nfapi_msgs(mac, sfn_slot); - free(slot_ind); - slot_ind = NULL; - free(ch_info); - ch_info = NULL; } return NULL; } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 31e8231465..a68cd469fd 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2255,26 +2255,29 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in int O_CSI = 0; int N_UCI = 0; - PUCCH_sched_t *pucch = calloc(1,sizeof(*pucch)); - pucch->resource_indicator = -1; - pucch->initial_pucch_id = -1; + PUCCH_sched_t pucch = { + .resource_indicator = -1, + .initial_pucch_id = -1 + }; + pucch.resource_indicator = -1; + pucch.initial_pucch_id = -1; uint16_t rnti = mac->crnti; //FIXME not sure this is valid for all pucch instances // SR - if(trigger_periodic_scheduling_request(mac, pucch, frameP, slotP)) { + if (trigger_periodic_scheduling_request(mac, &pucch, frameP, slotP)) { O_SR = 1; /* sr_payload = 1 means that this is a positive SR, sr_payload = 0 means that it is a negative SR */ - pucch->sr_payload = nr_ue_get_SR(module_idP, + pucch.sr_payload = nr_ue_get_SR(module_idP, frameP, slotP); } // CSI if (mac->ra.ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test == 1) - O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch); + O_CSI = nr_get_csi_measurements(mac, frameP, slotP, &pucch); // ACKNACK - O_ACK = get_downlink_ack(mac, frameP, slotP, pucch); + O_ACK = get_downlink_ack(mac, frameP, slotP, &pucch); NR_BWP_Id_t bwp_id = mac->UL_BWP_Id; NR_PUCCH_Config_t *pucch_Config = NULL; @@ -2304,8 +2307,8 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in pucch_Config->format2 && (pucch_Config->format2->choice.setup->simultaneousHARQ_ACK_CSI == NULL)) { O_CSI = 0; - pucch->csi_part1_payload = 0; - pucch->csi_part2_payload = 0; + pucch.csi_part1_payload = 0; + pucch.csi_part2_payload = 0; } N_UCI = O_SR + O_ACK + O_CSI; @@ -2314,13 +2317,13 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in mac->nr_ue_emul_l1.num_csi_reports = O_CSI; // do no transmit pucch if only SR scheduled and it is negative - if ((O_ACK + O_CSI) == 0 && pucch->sr_payload == 0) + if ((O_ACK + O_CSI) == 0 && pucch.sr_payload == 0) return; if (N_UCI > 0) { LOG_D(NR_MAC,"%d.%d configure pucch, O_SR %d, O_ACK %d, O_CSI %d\n",frameP,slotP,O_SR,O_ACK,O_CSI); - pucch->resource_set_id = find_pucch_resource_set(mac, O_ACK + O_CSI); - select_pucch_resource(mac, pucch); + pucch.resource_set_id = find_pucch_resource_set(mac, O_ACK + O_CSI); + select_pucch_resource(mac, &pucch); fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP); pthread_mutex_lock(&ul_config->mutex_ul_config); AssertFatal(ul_config->number_pdusnumber_pdus %d out of bounds\n",ul_config->number_pdus); @@ -2333,10 +2336,10 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in nr_ue_configure_pucch(mac, slotP, rnti, - pucch, + &pucch, pucch_pdu, O_SR, O_ACK, O_CSI); - LOG_D(NR_MAC,"Configuring pucch, is_common = %d\n",pucch->is_common); + LOG_D(NR_MAC, "Configuring pucch, is_common = %d\n", pucch.is_common); nr_scheduled_response_t scheduled_response; fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 2dd7e0cb27..a402e36222 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -640,12 +640,9 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n if (!put_queue(&nr_ul_tti_req_queue, ul_tti_req)) { LOG_E(NR_PHY, "put_queue failed for ul_tti_req.\n"); - free(ul_tti_req); - ul_tti_req = NULL; } return; } - free(ul_tti_req); } static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_config_request_t *dl_config) @@ -710,20 +707,29 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, slot = dl_tti_request->Slot; LOG_I(NR_PHY, "[%d, %d] dl_tti_request\n", frame, slot); copy_dl_tti_req_to_dl_info(&mac->dl_info, dl_tti_request); + free_and_zero(dl_tti_request); } /* This checks if the previously recevied DCI matches our current RNTI value. The assumption is that if the DCI matches our RNTI, then the incoming tx_data_request is also destined for the current UE. If the RAR hasn't been processed yet, we do not want to be filtering the tx_data_requests. */ - if (tx_data_request && (mac->nr_ue_emul_l1.expected_sib || - mac->nr_ue_emul_l1.expected_rar || - mac->nr_ue_emul_l1.expected_dci)) + if (tx_data_request) { - frame = tx_data_request->SFN; - slot = tx_data_request->Slot; - LOG_I(NR_PHY, "[%d, %d] PDSCH in tx_request\n", frame, slot); - copy_tx_data_req_to_dl_info(&mac->dl_info, tx_data_request); + if (mac->nr_ue_emul_l1.expected_sib || + mac->nr_ue_emul_l1.expected_rar || + mac->nr_ue_emul_l1.expected_dci) + { + frame = tx_data_request->SFN; + slot = tx_data_request->Slot; + LOG_I(NR_PHY, "[%d, %d] PDSCH in tx_request\n", frame, slot); + copy_tx_data_req_to_dl_info(&mac->dl_info, tx_data_request); + } + else + { + LOG_D(NR_MAC, "Unexpected tx_data_req\n"); + } + free_and_zero(tx_data_request); } else if (ul_dci_request) { @@ -731,6 +737,7 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, slot = ul_dci_request->Slot; LOG_I(NR_PHY, "[%d, %d] ul_dci_request\n", frame, slot); copy_ul_dci_data_req_to_dl_info(&mac->dl_info, ul_dci_request); + free_and_zero(ul_dci_request); } else if (ul_tti_request) { @@ -738,6 +745,7 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, slot = ul_tti_request->Slot; LOG_D(NR_PHY, "[%d, %d] ul_tti_request\n", frame, slot); copy_ul_tti_data_req_to_dl_info(&mac->dl_info, ul_tti_request); + free_and_zero(ul_tti_request); } else { @@ -771,7 +779,7 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request, mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon, ul_info.slot_tx, - mac->frame_type)) + mac->frame_type) && mac->ra.ra_state != RA_SUCCEEDED) { nr_ue_scheduler(NULL, &ul_info); nr_ue_prach_scheduler(ul_info.module_id, ul_info.frame_tx, ul_info.slot_tx, ul_info.thread_id); From 85e879b1ea47304e42a0b6c5d1497b7d814451b5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 18 Mar 2022 10:30:12 +0100 Subject: [PATCH 693/883] remove call to csirs configuration in SA (not working yet, asn1 encoding fails) --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index c25060208e..02471b2f11 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1462,17 +1462,6 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon; - NR_CSI_MeasConfig_t *csi_MeasConfig; - if(!SpCellConfig->spCellConfigDedicated->csi_MeasConfig) { - csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig)); - SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig; - } - else - csi_MeasConfig = SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; - - int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE); - config_csirs(scc, csi_MeasConfig, uid, carrier->pdsch_AntennaPorts, curr_bwp, carrier->do_CSIRS); - NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP; set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing, uecap, bwp_Dedicated, scc); From 4d4f946a10f10a7e59c0e6cc3d1abc08975cb273 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 18 Mar 2022 10:39:58 +0100 Subject: [PATCH 694/883] fix(ci): properly disabling basic-sim build and test and also the obsolete flexran-rtc Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-gitlab | 28 ---------------------------- ci-scripts/buildOnVM.sh | 2 +- ci-scripts/oai-ci-vm-tool | 9 ++++++++- ci-scripts/runTestOnVM.sh | 5 +++++ ci-scripts/waitBuildOnVM.sh | 4 ++-- 5 files changed, 16 insertions(+), 32 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index f331c975a8..54be9b653d 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -136,16 +136,6 @@ pipeline { // For the moment, there is no fail criteria. Just a notification of number of files that do not follow sh "./ci-scripts/checkCodingFormattingRules.sh" } - // With Mosaic 5G being part of OSA and making all it's repositories public - // No need to pass credentials to clone flexran-rtc - if (doMandatoryTests) { - sh "mkdir flexran" - dir ('flexran') { - sh "git clone https://gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1" - sh "git checkout develop >> ../git_clone.log 2>&1" - sh "zip -r -qq flexran.zip ." - } - } } } post { @@ -287,24 +277,6 @@ pipeline { parallel { stage ("VM-based tests") { stages { - stage ("Build Flexran Controller") { - when { - expression {doMandatoryTests} - } - steps { - lock (vmResource) { - script { - timeout (time: 20, unit: 'MINUTES') { - try { - sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant flexran-rtc --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive" - } catch (Exception e) { - currentBuild.result = 'FAILURE' - } - } - } - } - } - } stage ("Test L1 simulator") { when { expression {doMandatoryTests} diff --git a/ci-scripts/buildOnVM.sh b/ci-scripts/buildOnVM.sh index f4cf3931dd..eaca22f550 100755 --- a/ci-scripts/buildOnVM.sh +++ b/ci-scripts/buildOnVM.sh @@ -62,7 +62,7 @@ function build_on_vm { echo "ARCHIVES_LOC = $ARCHIVES_LOC" echo "BUILD_OPTIONS = $BUILD_OPTIONS" - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] + if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] then echo "This VM type is no longer supported in the pipeline framework" return diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index 49b9ee14f7..5c17d5d4f9 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -174,7 +174,14 @@ function variant__v1__enb_usrp { BUILD_OPTIONS="--eNB -w USRP --mu" VM_MEMORY=3072 } - + +function variant__v2__basic_sim { + NB_PATTERN_FILES=11 + BUILD_OPTIONS="--eNB --UE" + VM_MEMORY=8192 + RUN_OPTIONS="complex" +} + function variant__v3__phy_sim { NB_PATTERN_FILES=11 BUILD_OPTIONS="--phy_simulators" diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 25e11edc4f..69f19a6cda 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -1292,6 +1292,11 @@ function run_test_on_vm { echo "This VM test type is no longer supported in the pipeline framework" return fi + if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-basic-sim.* )) ]] + then + echo "This VM test type is no longer supported in the pipeline framework" + return + fi if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]] then ENB_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#enb-ethernet#"` diff --git a/ci-scripts/waitBuildOnVM.sh b/ci-scripts/waitBuildOnVM.sh index 946c0866e2..73a8b558fe 100755 --- a/ci-scripts/waitBuildOnVM.sh +++ b/ci-scripts/waitBuildOnVM.sh @@ -47,7 +47,7 @@ function wait_on_vm_build { echo "ARCHIVES_LOC = $ARCHIVES_LOC" echo "BUILD_OPTIONS = $BUILD_OPTIONS" - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] + if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] then echo "This VM type is no longer supported in the pipeline framework" return @@ -93,7 +93,7 @@ function wait_on_vm_build { } function check_on_vm_build { - if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] + if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]] then echo "This VM type is no longer supported in the pipeline framework" return From 256a00af7744fcdfd409267627339d9e08e4036e Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 18 Mar 2022 11:10:21 +0100 Subject: [PATCH 695/883] default SIB TDA = 1 (and chech to avoid csi-rs overlapping) --- openair2/GNB_APP/gnb_paramdef.h | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 2 ++ openair2/RRC/NR/nr_rrc_config.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index cde7819e25..10e99ea921 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -146,7 +146,7 @@ typedef enum { {GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOSRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 7d16a4ee01..b8f03e7f3a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -620,6 +620,8 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) 1, &is_typeA, &startSymbolIndex, &nrOfSymbols); + AssertFatal((startSymbolIndex+nrOfSymbols)<14,"SIB1 TDA %d would cause overlap with CSI-RS. Please select a different SIB1 TDA.\n",time_domain_allocation); + int mappingtype = is_typeA? typeA: typeB; uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1); diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index e52ead6980..bb2a180146 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -38,6 +38,7 @@ void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0, int uid, int nb_sl nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); int ideal_period = nb_slots_per_period*MAX_MOBILES_PER_GNB; + if (ideal_period<5) { nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots4; nzpcsi0->periodicityAndOffset->choice.slots4 = nb_slots_per_period*uid; From 94f8e5b2134e78f0711a75a96b723e113829ba7a Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 18 Mar 2022 11:20:17 +0100 Subject: [PATCH 696/883] fix(ci): tcp_bridge_oai.Rel15.txt is no longer built. That's one less report file Signed-off-by: Raphael Defosseux --- ci-scripts/oai-ci-vm-tool | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/oai-ci-vm-tool b/ci-scripts/oai-ci-vm-tool index 5c17d5d4f9..8363c91461 100755 --- a/ci-scripts/oai-ci-vm-tool +++ b/ci-scripts/oai-ci-vm-tool @@ -200,28 +200,28 @@ function variant__v4__cppcheck { function variant__v5__gnb_usrp { VM_MEMORY=10240 VM_CPU=8 - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=6 BUILD_OPTIONS="--gNB -w USRP" } function variant__v6__nr_ue_usrp { VM_MEMORY=4096 VM_CPU=4 - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=6 BUILD_OPTIONS="--nrUE -w USRP" } function variant__v7__enb_ethernet { VM_MEMORY=4096 ARCHIVES_LOC=enb_eth - NB_PATTERN_FILES=7 + NB_PATTERN_FILES=6 BUILD_OPTIONS="--eNB -w USRP" } function variant__v8__ue_ethernet { VM_MEMORY=4096 ARCHIVES_LOC=ue_eth - NB_PATTERN_FILES=11 + NB_PATTERN_FILES=10 BUILD_OPTIONS="--UE -w USRP" } From 663ad7df5cf2718cc49471e6f0d70ad43b5ca291 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 18 Mar 2022 17:57:53 +0100 Subject: [PATCH 697/883] fix(ci): typo on bash variable setting Signed-off-by: Raphael Defosseux --- ci-scripts/runTestOnVM.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 69f19a6cda..31ffa9d727 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -1932,11 +1932,11 @@ function run_test_on_vm { echo "SA test NOT OK" echo "try_cnt = " $try_cnt try_cnt=$((try_cnt+1)) - SA_106PRB_STATUS = -1 + SA_106PRB_STATUS=-1 else echo "SA test OK" try_cnt=$((try_cnt+10)) - SA_106PRB_STATUS = 0 + SA_106PRB_STATUS=0 fi done ########### end SA test @@ -2015,11 +2015,11 @@ function run_test_on_vm { echo "SA test NOT OK" echo "try_cnt = " $try_cnt try_cnt=$((try_cnt+1)) - SA_24PRB_STATUS = -1 + SA_24PRB_STATUS=-1 else echo "SA test OK" try_cnt=$((try_cnt+10)) - SA_24PRB_STATUS = 0 + SA_24PRB_STATUS=0 fi done ########### end SA test From f646b9a57c7f8f227de10443ca447fab0eb9e903 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Mar 2022 07:57:39 +0100 Subject: [PATCH 698/883] Add parameter to disable 256 QAM activation --- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulsim.c | 2 +- openair2/COMMON/rrc_messages_types.h | 1 + openair2/GNB_APP/gnb_config.c | 4 ++- openair2/GNB_APP/gnb_paramdef.h | 7 +++++- openair2/RRC/NR/MESSAGES/asn1_msg.c | 4 +-- openair2/RRC/NR/nr_rrc_defs.h | 1 + openair2/RRC/NR/nr_rrc_proto.h | 2 ++ openair2/RRC/NR/rrc_gNB.c | 1 + openair2/RRC/NR/rrc_gNB_nsa.c | 37 +++++++++++----------------- openair2/RRC/NR/rrc_gNB_reconfig.c | 5 +++- 11 files changed, 36 insertions(+), 30 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index e797c01096..b465f47a33 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -789,7 +789,7 @@ int main(int argc, char **argv) N_RB_DL,g_mcsTableIdx); // TODO do a UECAP for phy-sim - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, n_tx, 6, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, n_tx, 6, 0, 0, false, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 76d896a047..4fc91b3858 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -731,7 +731,7 @@ int main(int argc, char **argv) prepare_scd(scd); // TODO do a UECAP for phy-sim - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 0, 0, 0, 0); + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 0, 0, 0, false, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 769bc7d01d..28a08c1dac 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -418,6 +418,7 @@ typedef struct NRRrcConfigurationReq_s { int minRXTXTIME; int do_CSIRS; int do_SRS; + bool force_256qam_off; int pusch_TargetSNRx10; int pucch_TargetSNRx10; } gNB_RrcConfigurationReq; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 2795c07ce7..ee0bbb6843 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1172,8 +1172,10 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; LOG_I(RRC,"Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; - printf("Do SRS %d\n",*GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr); + LOG_I(RRC, "Do SRS %d\n",*GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr); NRRRC_CONFIGURATION_REQ (msg_p).do_SRS = *GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr; + NRRRC_CONFIGURATION_REQ (msg_p).force_256qam_off = *GNBParamList.paramarray[i][GNB_FORCE256QAMOFF_IDX].iptr; + LOG_I(RRC, "256 QAM: %s\n", NRRRC_CONFIGURATION_REQ (msg_p).force_256qam_off ? "force off" : "may be on"); NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index cde7819e25..1d88426336 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -122,8 +122,11 @@ typedef enum { #define GNB_CONFIG_STRING_NRCELLID "nr_cellid" #define GNB_CONFIG_STRING_MINRXTXTIME "min_rxtxtime" #define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" +#define GNB_CONFIG_STRING_FORCE256QAMOFF "force_256qam_off" +#define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support" + /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* cell configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -151,7 +154,8 @@ typedef enum { {GNB_CONFIG_STRING_DOSRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_MINRXTXTIME, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \ +{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0}, \ +{GNB_CONFIG_STRING_FORCE256QAMOFF, GNB_CONFIG_HLP_FORCE256QAMOFF, PARAMFLAG_BOOL, iptr:NULL, defintval:0, TYPE_INT, 0} \ } #define GNB_GNB_ID_IDX 0 @@ -177,6 +181,7 @@ typedef enum { #define GNB_NRCELLID_IDX 20 #define GNB_MINRXTXTIME_IDX 21 #define GNB_ULPRBBLACKLIST_IDX 22 +#define GNB_FORCE256QAMOFF_IDX 23 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index d04ed78270..cde4aa4482 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1462,14 +1462,14 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP; set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing, - uecap, bwp_Dedicated, scc); + carrier->force_256qam_off ? NULL : uecap, bwp_Dedicated, scc); struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; if (DL_BWP_list) { for (int i=0; ilist.count; i++){ NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i]; int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing; - set_dl_mcs_table(scs, uecap, bwp->bwp_Dedicated, carrier->servingcellconfigcommon); + set_dl_mcs_table(scs, carrier->force_256qam_off ? NULL : uecap, bwp->bwp_Dedicated, carrier->servingcellconfigcommon); } } } diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index 1b2c38c835..b6c6ead920 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -456,6 +456,7 @@ typedef struct { int minRXTXTIME; int do_CSIRS; int do_SRS; + bool force_256qam_off; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; NR_PDCCH_ConfigSIB1_t *pdcch_ConfigSIB1; diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 7dceb55a4b..db16d4e00a 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -83,6 +83,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int minRXTXTIMEpdsch, int do_csirs, int do_srs, + bool force_256qam_off, int uid); void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, @@ -100,6 +101,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon int minRXTXTIMEpdsch, int do_csirs, int do_srs, + bool force_256qam_off, int uid); void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index d6c658f01d..85e264d1d8 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -224,6 +224,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->carrier.sib1_tda = configuration->sib1_tda; rrc->carrier.do_CSIRS = configuration->do_CSIRS; rrc->carrier.do_SRS = configuration->do_SRS; + rrc->carrier.force_256qam_off = configuration->force_256qam_off; nr_rrc_config_ul_tda(configuration->scc,configuration->minRXTXTIME); /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 70dfebaaf7..02f1edf55c 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -240,29 +240,20 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ cipher_algo, NR_SecurityConfig__keyToUse_secondary); } - if (ue_context_p->ue_context.spCellConfig) { - fill_default_reconfig(carrier->servingcellconfigcommon, - ue_context_p->ue_context.spCellConfig->spCellConfigDedicated, - reconfig_ies, - ue_context_p->ue_context.secondaryCellGroup, - ue_context_p->ue_context.UE_Capability_nr, - carrier->pdsch_AntennaPorts, - carrier->minRXTXTIME, - carrier->do_CSIRS, - carrier->do_SRS, - ue_context_p->local_uid); - } else { - fill_default_reconfig(carrier->servingcellconfigcommon, - NULL, - reconfig_ies, - ue_context_p->ue_context.secondaryCellGroup, - ue_context_p->ue_context.UE_Capability_nr, - carrier->pdsch_AntennaPorts, - carrier->minRXTXTIME, - carrier->do_CSIRS, - carrier->do_SRS, - ue_context_p->local_uid); - } + NR_ServingCellConfig_t *scc = ue_context_p->ue_context.spCellConfig + ? ue_context_p->ue_context.spCellConfig->spCellConfigDedicated + : NULL; + fill_default_reconfig(carrier->servingcellconfigcommon, + scc, + reconfig_ies, + ue_context_p->ue_context.secondaryCellGroup, + ue_context_p->ue_context.UE_Capability_nr, + carrier->pdsch_AntennaPorts, + carrier->minRXTXTIME, + carrier->do_CSIRS, + carrier->do_SRS, + carrier->force_256qam_off, + ue_context_p->local_uid); ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity; NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config)); memset((void *)CG_Config,0,sizeof(*CG_Config)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 1de34804df..80347bddf5 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -60,6 +60,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco int minRXTXTIME, int do_csirs, int do_srs, + bool force_256qam_off, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); @@ -605,7 +606,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, uecap, bwp->bwp_Dedicated, servingcellconfigcommon); + set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, force_256qam_off ? NULL : uecap, bwp->bwp_Dedicated, servingcellconfigcommon); bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; @@ -1347,6 +1348,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon int minRXTXTIME, int do_csirs, int do_srs, + bool force_256qam_off, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(reconfig!=NULL,"reconfig is null\n"); @@ -1364,6 +1366,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon minRXTXTIME, do_csirs, do_srs, + force_256qam_off, uid); xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); From e89dfc02437537650174f770239412a58d093d35 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Mar 2022 18:07:49 +0100 Subject: [PATCH 699/883] Refactor RRC: do not duplicate configuration in rrc_gNB_carrier_t --- openair2/RRC/NR/L2_nr_interface.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 40 +++++----- openair2/RRC/NR/MESSAGES/asn1_msg.h | 18 +++-- openair2/RRC/NR/nr_rrc_defs.h | 8 -- openair2/RRC/NR/rrc_gNB.c | 116 ++++++++++++++-------------- openair2/RRC/NR/rrc_gNB_nsa.c | 31 ++++---- 6 files changed, 106 insertions(+), 109 deletions(-) diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c index 1cf690ac0c..e30b55cc94 100644 --- a/openair2/RRC/NR/L2_nr_interface.c +++ b/openair2/RRC/NR/L2_nr_interface.c @@ -321,7 +321,7 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, ue_context_p->ue_context.Srb0.Active = 1; RB_INSERT(rrc_nr_ue_tree_s, &RC.nrrrc[module_idP]->rrc_ue_head, ue_context_p); - fill_initial_cellGroupConfig(ue_context_p->local_uid,&cellGroupConfig,scc,&RC.nrrrc[module_idP]->carrier); + fill_initial_cellGroupConfig(ue_context_p->local_uid,&cellGroupConfig,scc, &RC.nrrrc[module_idP]->configuration); MessageDef* tmp=itti_alloc_new_message_sized(TASK_RRC_GNB, 0, F1AP_INITIAL_UL_RRC_MESSAGE, sizeof(f1ap_initial_ul_rrc_message_t) + sdu_lenP); f1ap_initial_ul_rrc_message_t *msg = &F1AP_INITIAL_UL_RRC_MESSAGE(tmp); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index cde4aa4482..9a59d1977a 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -197,6 +197,7 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) { asn_enc_rval_t enc_rval; rrc_gNB_carrier_data_t *carrier = &rrc->carrier; + const gNB_RrcConfigurationReq *configuration = &rrc->configuration; NR_BCCH_BCH_Message_t *mib = &carrier->mib; NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon; @@ -220,7 +221,7 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) { mib->message.choice.mib->spare.size = 1; mib->message.choice.mib->spare.bits_unused = 7; // This makes a spare of 1 bits - mib->message.choice.mib->ssb_SubcarrierOffset = (carrier->ssb_SubcarrierOffset)&15; + mib->message.choice.mib->ssb_SubcarrierOffset = (configuration->ssb_SubcarrierOffset)&15; /* * The SIB1 will be sent in this allocation (Type0-PDCCH) : 38.213, 13-4 Table and 38.213 13-11 to 13-14 tables @@ -1007,8 +1008,8 @@ long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS) { void fill_initial_SpCellConfig(int uid, NR_SpCellConfig_t *SpCellConfig, NR_ServingCellConfigCommon_t *scc, - rrc_gNB_carrier_data_t *carrier) { - + const gNB_RrcConfigurationReq *configuration) +{ // This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4. // However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources, // where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations. @@ -1139,7 +1140,7 @@ void fill_initial_SpCellConfig(int uid, ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list,srs_resset0_id); srs_Config->srs_ResourceToReleaseList=NULL; - if(carrier->do_SRS) { + if (configuration->do_SRS) { srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic)); srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL; @@ -1183,7 +1184,7 @@ void fill_initial_SpCellConfig(int uid, srs_res0->freqHopping.b_SRS); srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither; - if(carrier->do_SRS) { + if (configuration->do_SRS) { srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl160; @@ -1229,9 +1230,9 @@ void fill_initial_SpCellConfig(int uid, long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - AssertFatal(carrier->minRXTXTIME >=2 && carrier->minRXTXTIME <7, - "check minRXTXTIME %d\n",carrier->minRXTXTIME); - *delay[i] = (i+carrier->minRXTXTIME); + AssertFatal(configuration->minRXTXTIME >= 2 && configuration->minRXTXTIME < 7, + "minRXTXTIME is %d but should be within [2,7)\n", configuration->minRXTXTIME); + *delay[i] = i + configuration->minRXTXTIME; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } @@ -1453,8 +1454,9 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, rrc_gNB_carrier_data_t *carrier, - NR_UE_NR_Capability_t *uecap) { - + NR_UE_NR_Capability_t *uecap, + const gNB_RrcConfigurationReq* configuration) +{ NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig; if (SpCellConfig == NULL) return; @@ -1462,14 +1464,14 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP; set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing, - carrier->force_256qam_off ? NULL : uecap, bwp_Dedicated, scc); + configuration->force_256qam_off ? NULL : uecap, bwp_Dedicated, scc); struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; if (DL_BWP_list) { for (int i=0; ilist.count; i++){ NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i]; int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing; - set_dl_mcs_table(scs, carrier->force_256qam_off ? NULL : uecap, bwp->bwp_Dedicated, carrier->servingcellconfigcommon); + set_dl_mcs_table(scs, configuration->force_256qam_off ? NULL : uecap, bwp->bwp_Dedicated, carrier->servingcellconfigcommon); } } } @@ -1478,8 +1480,8 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, void fill_initial_cellGroupConfig(int uid, NR_CellGroupConfig_t *cellGroupConfig, NR_ServingCellConfigCommon_t *scc, - rrc_gNB_carrier_data_t *carrier) { - + const gNB_RrcConfigurationReq *configuration) +{ NR_RLC_BearerConfig_t *rlc_BearerConfig = NULL; NR_RLC_Config_t *rlc_Config = NULL; NR_LogicalChannelConfig_t *logicalChannelConfig = NULL; @@ -1569,7 +1571,7 @@ void fill_initial_cellGroupConfig(int uid, cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig)); - fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,carrier); + fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,configuration); cellGroupConfig->sCellToAddModList = NULL; cellGroupConfig->sCellToReleaseList = NULL; @@ -1581,7 +1583,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, const uint8_t transaction_id, OCTET_STRING_t *masterCellGroup_from_DU, NR_ServingCellConfigCommon_t *scc, - rrc_gNB_carrier_data_t *carrier) + const gNB_RrcConfigurationReq *configuration) //------------------------------------------------------------------------------ { asn_enc_rval_t enc_rval; @@ -1648,7 +1650,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, } else { cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t)); - fill_initial_cellGroupConfig(ue_context_pP->local_uid,cellGroupConfig,scc,carrier); + fill_initial_cellGroupConfig(ue_context_pP->local_uid, cellGroupConfig, scc, configuration); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, @@ -1896,6 +1898,7 @@ int16_t do_RRCReconfiguration( struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, rrc_gNB_ue_context_t *const ue_context_pP, rrc_gNB_carrier_data_t *carrier, + const gNB_RrcConfigurationReq *configuration, NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig) //------------------------------------------------------------------------------ @@ -1949,7 +1952,8 @@ int16_t do_RRCReconfiguration( if(cellGroupConfig!=NULL){ update_cellGroupConfig(cellGroupConfig, carrier, - ue_context_pP->ue_context.UE_Capability_nr); + ue_context_pP->ue_context.UE_Capability_nr, + configuration); enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)cellGroupConfig, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index 7fe08704c2..befe83b141 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -101,18 +101,19 @@ uint8_t do_RRCReject(uint8_t Mod_id, uint8_t *const buffer); void fill_initial_SpCellConfig(int uid, - NR_SpCellConfig_t *SpCellConfig, - NR_ServingCellConfigCommon_t *scc, - rrc_gNB_carrier_data_t *carrier); + NR_SpCellConfig_t *SpCellConfig, + NR_ServingCellConfigCommon_t *scc, + const gNB_RrcConfigurationReq *configuration); void fill_initial_cellGroupConfig(int uid, - NR_CellGroupConfig_t *cellGroupConfig, - NR_ServingCellConfigCommon_t *scc, - rrc_gNB_carrier_data_t *carrier); + NR_CellGroupConfig_t *cellGroupConfig, + NR_ServingCellConfigCommon_t *scc, + const gNB_RrcConfigurationReq *configuration); void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, rrc_gNB_carrier_data_t *carrier, - NR_UE_NR_Capability_t *uecap); + NR_UE_NR_Capability_t *uecap, + const gNB_RrcConfigurationReq *configuration); void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup); @@ -121,7 +122,7 @@ uint8_t do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP, const uint8_t transaction_id, OCTET_STRING_t *masterCellGroup_from_DU, NR_ServingCellConfigCommon_t *scc, - rrc_gNB_carrier_data_t *carrier); + const gNB_RrcConfigurationReq *configuration); uint8_t do_NR_SecurityModeCommand( const protocol_ctxt_t *const ctxt_pP, @@ -151,6 +152,7 @@ int16_t do_RRCReconfiguration( struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, rrc_gNB_ue_context_t *const ue_context_pP, rrc_gNB_carrier_data_t *carrier, + const gNB_RrcConfigurationReq *configuration, NR_MAC_CellGroupConfig_t *mac_CellGroupConfig, NR_CellGroupConfig_t *cellGroupConfig); diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index b6c6ead920..4ba8c4c3fa 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -449,14 +449,6 @@ typedef struct { NR_SIB2_t *sib2; NR_SIB3_t *sib3; NR_BCCH_DL_SCH_Message_t systemInformation; // SIB23 - int ssb_SubcarrierOffset; - int sib1_tda; - int pdsch_AntennaPorts; - int pusch_AntennaPorts; - int minRXTXTIME; - int do_CSIRS; - int do_SRS; - bool force_256qam_off; NR_BCCH_DL_SCH_Message_t *siblock1; NR_ServingCellConfigCommon_t *servingcellconfigcommon; NR_PDCCH_ConfigSIB1_t *pdcch_ConfigSIB1; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 85e264d1d8..86b767f83c 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -166,17 +166,16 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration if (NODE_IS_MONOLITHIC(rrc->node_type)){ rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, - rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIME, - (NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon, - &rrc->carrier.mib, - 0, - 0, // WIP hardcoded rnti - (NR_CellGroupConfig_t *)NULL - ); + rrc->configuration.ssb_SubcarrierOffset, + rrc->configuration.pdsch_AntennaPorts, + rrc->configuration.pusch_AntennaPorts, + rrc->configuration.sib1_tda, + rrc->configuration.minRXTXTIME, + rrc->carrier.servingcellconfigcommon, + &rrc->carrier.mib, + 0, + 0, // WIP hardcoded rnti + NULL); } /* set flag to indicate that cell information is configured. This is required @@ -216,15 +215,8 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu rrc->s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL); rrc->initial_id2_ngap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL); rrc->ngap_id2_ngap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL); + rrc->configuration = *configuration; rrc->carrier.servingcellconfigcommon = configuration->scc; - rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset; - rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts; - rrc->carrier.pusch_AntennaPorts = configuration->pusch_AntennaPorts; - rrc->carrier.minRXTXTIME = configuration->minRXTXTIME; - rrc->carrier.sib1_tda = configuration->sib1_tda; - rrc->carrier.do_CSIRS = configuration->do_CSIRS; - rrc->carrier.do_SRS = configuration->do_SRS; - rrc->carrier.force_256qam_off = configuration->force_256qam_off; nr_rrc_config_ul_tda(configuration->scc,configuration->minRXTXTIME); /// System Information INIT pthread_mutex_init(&rrc->cell_info_mutex,NULL); @@ -280,24 +272,25 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *const ue_context_pP, const protocol_ctxt_t *const ctxt_pP ) { - rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, - rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIME, - NULL, - NULL, - 0, - ue_context_pP->ue_context.rnti, - get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : (NR_CellGroupConfig_t *)NULL); + NR_CellGroupConfig_t *cgc = get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : NULL; + rrc_mac_config_req_gNB(rrc->module_id, + rrc->configuration.ssb_SubcarrierOffset, + rrc->configuration.pdsch_AntennaPorts, + rrc->configuration.pusch_AntennaPorts, + rrc->configuration.sib1_tda, + rrc->configuration.minRXTXTIME, + NULL, + NULL, + 0, + ue_context_pP->ue_context.rnti, + cgc); - nr_rrc_rlc_config_asn1_req(ctxt_pP, - ue_context_pP->ue_context.SRB_configList, - ue_context_pP->ue_context.DRB_configList, - NULL, - NULL, - get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList : NULL); + nr_rrc_rlc_config_asn1_req(ctxt_pP, + ue_context_pP->ue_context.SRB_configList, + ue_context_pP->ue_context.DRB_configList, + NULL, + NULL, + get_softmodem_params()->sa ? cgc->rlc_BearerToAddModList : NULL); } @@ -341,10 +334,11 @@ rrc_gNB_generate_RRCSetup( gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context; gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id]; ue_p->Srb0.Tx_buffer.payload_size = do_RRCSetup(ue_context_pP, - (uint8_t *) ue_p->Srb0.Tx_buffer.Payload, - rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id), - masterCellGroup_from_DU, - scc,&rrc->carrier); + (uint8_t *) ue_p->Srb0.Tx_buffer.Payload, + rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id), + masterCellGroup_from_DU, + scc, + &rrc->configuration); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)(ue_p->Srb0.Tx_buffer.Payload), @@ -451,10 +445,11 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context; ue_p->Srb0.Tx_buffer.payload_size = do_RRCSetup(ue_context_pP, - (uint8_t *) ue_p->Srb0.Tx_buffer.Payload, - rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id), - NULL, - scc,&rrc_instance_p->carrier); + (uint8_t *) ue_p->Srb0.Tx_buffer.Payload, + rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id), + NULL, + scc, + &rrc_instance_p->configuration); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)(ue_p->Srb0.Tx_buffer.Payload), @@ -466,17 +461,16 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest( PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)); rrc_mac_config_req_gNB(rrc_instance_p->module_id, - rrc_instance_p->carrier.ssb_SubcarrierOffset, - rrc_instance_p->carrier.pdsch_AntennaPorts, - rrc_instance_p->carrier.pusch_AntennaPorts, - rrc_instance_p->carrier.sib1_tda, - rrc_instance_p->carrier.minRXTXTIME, - (NR_ServingCellConfigCommon_t *)rrc_instance_p->carrier.servingcellconfigcommon, + rrc_instance_p->configuration.ssb_SubcarrierOffset, + rrc_instance_p->configuration.pdsch_AntennaPorts, + rrc_instance_p->configuration.pusch_AntennaPorts, + rrc_instance_p->configuration.sib1_tda, + rrc_instance_p->configuration.minRXTXTIME, + rrc_instance_p->carrier.servingcellconfigcommon, &rrc_instance_p->carrier.mib, 0, ue_context_pP->ue_context.rnti, - (NR_CellGroupConfig_t *)NULL - ); + NULL); LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n", @@ -724,6 +718,7 @@ rrc_gNB_generate_defaultRRCReconfiguration( dedicatedNAS_MessageList, ue_context_pP, &rrc->carrier, + &rrc->configuration, NULL, ue_p->masterCellGroup); @@ -987,6 +982,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( dedicatedNAS_MessageList, ue_context_pP, &rrc->carrier, + &rrc->configuration, NULL, cellGroupConfig); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n"); @@ -1160,6 +1156,7 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( NULL, NULL, NULL, + NULL, NULL); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); @@ -1260,6 +1257,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL, NULL, NULL, + NULL, NULL); ue_context_pP->ue_context.pdu_session_release_command_flag = 1; @@ -1363,17 +1361,16 @@ rrc_gNB_process_RRCReconfigurationComplete( if (!NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) { rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, - rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIME, + rrc->configuration.ssb_SubcarrierOffset, + rrc->configuration.pdsch_AntennaPorts, + rrc->configuration.pusch_AntennaPorts, + rrc->configuration.sib1_tda, + rrc->configuration.minRXTXTIME, NULL, NULL, 0, ue_context_pP->ue_context.rnti, - ue_context_pP->ue_context.masterCellGroup - ); + ue_context_pP->ue_context.masterCellGroup); LOG_D(NR_RRC,"Configuring RLC DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti); nr_rrc_rlc_config_asn1_req(ctxt_pP, SRB_configList, // NULL, @@ -1811,6 +1808,7 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, NULL, NULL, + NULL, NULL); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 02f1edf55c..ce858aec94 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -116,6 +116,7 @@ RB_PROTOTYPE(rrc_nr_ue_tree_s, rrc_gNB_ue_context_s, entries, void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_p, x2ap_ENDC_sgnb_addition_req_t *m) { // generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331) rrc_gNB_carrier_data_t *carrier=&rrc->carrier; + const gNB_RrcConfigurationReq *configuration = &rrc->configuration; MessageDef *msg; msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_ENDC_SGNB_ADDITION_REQ_ACK); gtpv1u_enb_create_tunnel_req_t create_tunnel_req; @@ -248,11 +249,11 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, ue_context_p->ue_context.UE_Capability_nr, - carrier->pdsch_AntennaPorts, - carrier->minRXTXTIME, - carrier->do_CSIRS, - carrier->do_SRS, - carrier->force_256qam_off, + configuration->pdsch_AntennaPorts, + configuration->minRXTXTIME, + configuration->do_CSIRS, + configuration->do_SRS, + configuration->force_256qam_off, ue_context_p->local_uid); ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity; NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config)); @@ -350,11 +351,11 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ // configure MAC and RLC if (NODE_IS_DU(rrc->node_type)) { rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, - rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIME, + rrc->configuration.ssb_SubcarrierOffset, + rrc->configuration.pdsch_AntennaPorts, + rrc->configuration.pusch_AntennaPorts, + rrc->configuration.sib1_tda, + rrc->configuration.minRXTXTIME, rrc->carrier.servingcellconfigcommon, &rrc->carrier.mib, 1, // add_ue flag @@ -362,11 +363,11 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.secondaryCellGroup); } else { rrc_mac_config_req_gNB(rrc->module_id, - rrc->carrier.ssb_SubcarrierOffset, - rrc->carrier.pdsch_AntennaPorts, - rrc->carrier.pusch_AntennaPorts, - rrc->carrier.sib1_tda, - rrc->carrier.minRXTXTIME, + rrc->configuration.ssb_SubcarrierOffset, + rrc->configuration.pdsch_AntennaPorts, + rrc->configuration.pusch_AntennaPorts, + rrc->configuration.sib1_tda, + rrc->configuration.minRXTXTIME, NULL, NULL, 1, // add_ue flag From 05c07c401ff13219e1b3edda4f574a74ef3a840e Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Fri, 18 Mar 2022 18:51:22 +0100 Subject: [PATCH 700/883] removal of some logs. Temporary suppression of QAM256 for 5G Records testing --- openair1/PHY/CODING/nr_rate_matching.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 18 ++++++++-- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 +-- openair1/SCHED_NR/nr_prach_procedures.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 34 +++++++++---------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 14 ++++---- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 4 +-- 8 files changed, 47 insertions(+), 33 deletions(-) diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index 29cba0a557..e693e8542a 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -409,7 +409,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, #endif if (Foffset > E) { - LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > E %d)\n",Foffset,E); + LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > E %d) F %d, k0 %d, Ncb %d, rvidx %d, Ilbrm %d\n",Foffset,E,F, ind, Ncb, rvidx, Ilbrm); return -1; } if (Foffset > Ncb) { diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index cdf0e6c152..8803e6ff26 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -218,14 +218,14 @@ void ldpc8blocks( void *p) { #endif uint32_t E = nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, rr); //#ifdef DEBUG_DLSCH_CODING - LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", + LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d,nrOfLayer %d)...\n", rr, impp->n_segments, G, E, impp->F, Kr-impp->F-2*(*impp->Zc), - mod_order,nb_rb); + mod_order,nb_rb,rel15->nrOfLayers); // for tbslbrm calculation according to 5.4.2.1 of 38.212 uint8_t Nl = 4; @@ -248,6 +248,20 @@ void ldpc8blocks( void *p) { Kr-impp->F-2*(*impp->Zc), rel15->rvIndex[0], E); + if (Kr-impp->F-2*(*impp->Zc)> E) { + LOG_E(PHY,"dlsch coding A %d Kr %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n", + A,impp->K,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order); + + LOG_E(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Kr %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", + rr, + impp->n_segments, + G, + E, + Kr, + impp->F, + Kr-impp->F-2*(*impp->Zc), + mod_order,nb_rb); + } #ifdef DEBUG_DLSCH_CODING for (int i =0; i<16; i++) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index beab48b977..7e4f9a9eaa 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -439,7 +439,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = !(index&0x01); - if (no_conf) LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { @@ -458,7 +458,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list[1].harq_value = !(index&0x01); uci_pdu->harq->harq_list[0].harq_value = !((index>>1)&0x01); - if (no_conf) LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index b0f59d5f47..7b5b6d22ff 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -173,7 +173,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) { if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) { - LOG_I(NR_PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n", + LOG_D(NR_PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n", gNB->Mod_id, frame, slot, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index fe0ba251cb..19145aadb9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -228,7 +228,7 @@ void find_SSB_and_RO_available(module_id_t module_idP) { cc->total_prach_occasions = total_RA_occasions - unused_RA_occasion; cc->num_active_ssb = num_active_ssb; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "Total available RO %d, num of active SSB %d: unused RO = %d association_period %u N_RA_sfn %u total_prach_occasions_per_config_period %u\n", cc->total_prach_occasions, cc->num_active_ssb, @@ -676,7 +676,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ra->preamble_index = preamble_index; ra->beam_id = beam_index; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "[gNB %d][RAPROC] CC_id %d Frame %d Activating Msg2 generation in frame %d, slot %d using RA rnti %x SSB " "index %u RA index %d\n", module_idP, @@ -791,7 +791,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t return; } - LOG_I(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d Scheduling retransmission of Msg3 in (%d,%d)\n", + LOG_D(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d Scheduling retransmission of Msg3 in (%d,%d)\n", module_idP, frame, slot, CC_id, sched_frame, sched_slot); nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_idP]->UL_tti_req_ahead[CC_id][sched_slot]; @@ -946,7 +946,7 @@ void nr_get_Msg3alloc(module_id_t module_id, k2 = *pusch_TimeDomainAllocationList->list.array[i]->k2; int start_symbol_index,nr_of_symbols; SLIV2SL(pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength, &start_symbol_index, &nr_of_symbols); - LOG_I(NR_MAC,"Checking Msg3 TDA %d : k2 %d, sliv %d,S %d L %d\n",i,(int)k2,(int)pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength,start_symbol_index,nr_of_symbols); + LOG_D(NR_MAC,"Checking Msg3 TDA %d : k2 %d, sliv %d,S %d L %d\n",i,(int)k2,(int)pusch_TimeDomainAllocationList->list.array[i]->startSymbolAndLength,start_symbol_index,nr_of_symbols); // we want to transmit in the uplink symbols of mixed slot AND assuming Msg2 was in the mixed slot if ((k2 + DELTA[mu])%nb_slots_per_period == 0) { temp_slot = current_slot + k2 + DELTA[mu]; // msg3 slot according to 8.3 in 38.213 @@ -987,7 +987,7 @@ void nr_get_Msg3alloc(module_id_t module_id, tdd_beam_association[num_tdd_period] = ra->beam_id; } - LOG_I(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id); + LOG_D(NR_MAC, "[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u\n", ra->Msg3_slot, current_slot, ra->Msg3_frame, k2,ra->Msg3_tda_id); uint16_t *vrb_map_UL = &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[ra->Msg3_slot * MAX_BWP_SIZE]; @@ -1156,7 +1156,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t fh = ubwp->bwp_Dedicated->pusch_Config->choice.setup->frequencyHopping ? 1 : 0; } - LOG_I(NR_MAC, "Frame %d, Slot %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", + LOG_D(NR_MAC, "Frame %d, Slot %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", frameP, slotP, ra->Msg3_frame, @@ -1310,7 +1310,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_req->nPDUs+=1; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15; - LOG_A(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%x, state %d, CoreSetType %d\n", + LOG_D(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%x, state %d, CoreSetType %d\n", module_idP, CC_id, frameP, slotP, ra->RA_rnti, ra->state,pdcch_pdu_rel15->CoreSetType); // SCF222: PDU index incremented for each PDSCH PDU sent in TX control message. This is used to associate control @@ -1471,9 +1471,9 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_add_msg3(module_idP, CC_id, frameP, slotP, ra, (uint8_t *) &tx_req->TLVs[0].value.direct[0]); if(ra->cfra) { - LOG_I(NR_MAC, "Frame %d, Subframe %d: Setting RA-Msg3 reception (CFRA) for SFN.Slot %d.%d\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot); + LOG_D(NR_MAC, "Frame %d, Subframe %d: Setting RA-Msg3 reception (CFRA) for SFN.Slot %d.%d\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot); } - else LOG_I(NR_MAC, "Frame %d, Subframe %d: Setting RA-Msg3 reception (CBRA) for SFN.Slot %d.%d\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot); + else LOG_D(NR_MAC, "Frame %d, Subframe %d: Setting RA-Msg3 reception (CBRA) for SFN.Slot %d.%d\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot); T(T_GNB_MAC_DL_RAR_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(ra->RA_rnti), T_INT(frameP), T_INT(slotP), T_INT(0), T_BUFFER(&tx_req->TLVs[0].value.direct[0], tx_req->TLVs[0].length)); @@ -1749,7 +1749,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_req->nPDUs+=1; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15; - LOG_A(NR_MAC, "[gNB %d] [RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg4 DCI, state %d\n", module_idP, CC_id, frameP, slotP, ra->state); + LOG_D(NR_MAC, "[gNB %d] [RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg4 DCI, state %d\n", module_idP, CC_id, frameP, slotP, ra->state); // SCF222: PDU index incremented for each PDSCH PDU sent in TX control message. This is used to associate control // information to data and is reset every slot. @@ -1823,7 +1823,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dci_payload.pucch_resource_indicator = delta_PRI; // This is delta_PRI from 9.2.1 in 38.213 dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; - LOG_I(NR_MAC, + LOG_D(NR_MAC, "[RAPROC] DCI 1_0 payload: freq_alloc %d (%d,%d,%d), time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d pucchres %d harqtiming %d\n", dci_payload.frequency_domain_assignment.val, pdsch_pdu_rel15->rbStart, @@ -1836,7 +1836,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dci_payload.pucch_resource_indicator, dci_payload.pdsch_to_harq_feedback_timing_indicator.val); - LOG_I(NR_MAC, + LOG_D(NR_MAC, "[RAPROC] DCI params: rnti 0x%x, rnti_type %d, dci_format %d coreset params: FreqDomainResource %llx, start_symbol %d n_symb %d, BWPsize %d\n", pdcch_pdu_rel15->dci_pdu[0].RNTI, NR_RNTI_TC, @@ -1906,7 +1906,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if(ra->msg3_dcch_dtch) { // If the UE used MSG3 to transfer a DCCH or DTCH message, then contention resolution is successful upon transmission of PDCCH - LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) CBRA procedure succeeded!\n", UE_id, ra->rnti); + LOG_D(NR_MAC, "(ue %i, rnti 0x%04x) CBRA procedure succeeded!\n", UE_id, ra->rnti); nr_clear_ra_proc(module_idP, CC_id, frameP, ra); UE_info->active[UE_id] = true; UE_info->Msg4_ACKed[UE_id] = true; @@ -1939,12 +1939,12 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram if (harq->is_waiting == 0) { if (harq->round == 0) { if (stats->dlsch_errors == 0) { - LOG_A(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti); + LOG_D(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti); UE_info->active[UE_id] = true; UE_info->Msg4_ACKed[UE_id] = true; } else { - LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti); + LOG_D(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti); } nr_clear_ra_proc(module_id, CC_id, frame, ra); @@ -1953,7 +1953,7 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram } } else { - LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) Received Nack of RA-Msg4. Preparing retransmission!\n", UE_id, ra->rnti); + LOG_D(NR_MAC, "(ue %i, rnti 0x%04x) Received Nack of RA-Msg4. Preparing retransmission!\n", UE_id, ra->rnti); ra->Msg4_frame = (frame + 1) % 1024; ra->Msg4_slot = 1; ra->state = Msg4; @@ -2010,7 +2010,7 @@ void nr_fill_rar(uint8_t Mod_idP, uint8_t * dlsch_buffer, nfapi_nr_pusch_pdu_t *pusch_pdu){ - LOG_I(NR_MAC, "[gNB] Generate RAR MAC PDU frame %d slot %d preamble index %u TA command %d \n", ra->Msg2_frame, ra-> Msg2_slot, ra->preamble_index, ra->timing_offset); + LOG_D(NR_MAC, "[gNB] Generate RAR MAC PDU frame %d slot %d preamble index %u TA command %d \n", ra->Msg2_frame, ra-> Msg2_slot, ra->preamble_index, ra->timing_offset); NR_RA_HEADER_BI *rarbi = (NR_RA_HEADER_BI *) dlsch_buffer; NR_RA_HEADER_RAPID *rarh = (NR_RA_HEADER_RAPID *) (dlsch_buffer + 1); NR_MAC_RAR *rar = (NR_MAC_RAR *) (dlsch_buffer + 2); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 342880f293..30d484ae08 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -756,20 +756,20 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, continue; if(no_sig) { - LOG_W(NR_MAC, "Random Access %i failed at state %i (no signal)\n", i, ra->state); + LOG_D(NR_MAC, "Random Access %i failed at state %i (no signal)\n", i, ra->state); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); } else { // random access pusch with TC-RNTI if (ra->rnti != current_rnti) { - LOG_W(NR_MAC, + LOG_D(NR_MAC, "expected TC_RNTI %04x to match current RNTI %04x\n", ra->rnti, current_rnti); if( (frameP==ra->Msg3_frame) && (slotP==ra->Msg3_slot) ) { - LOG_W(NR_MAC, "Random Access %i failed at state %i (TC_RNTI %04x RNTI %04x)\n", i, ra->state,ra->rnti,current_rnti); + LOG_D(NR_MAC, "Random Access %i failed at state %i (TC_RNTI %04x RNTI %04x)\n", i, ra->state,ra->rnti,current_rnti); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); } @@ -781,7 +781,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_id = add_new_nr_ue(gnb_mod_idP, ra->rnti, ra->CellGroup); if (UE_id<0) { - LOG_W(NR_MAC, "Random Access %i discarded at state %i (TC_RNTI %04x RNTI %04x): max number of users achieved!\n", i, ra->state,ra->rnti,current_rnti); + LOG_D(NR_MAC, "Random Access %i discarded at state %i (TC_RNTI %04x RNTI %04x): max number of users achieved!\n", i, ra->state,ra->rnti,current_rnti); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); return; @@ -877,20 +877,20 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, // for CFRA (NSA) do not schedule retransmission of msg3 if (ra->cfra) { - LOG_W(NR_MAC, "Random Access %i failed at state %i (NSA msg3 reception failed)\n", i, ra->state); + LOG_D(NR_MAC, "Random Access %i failed at state %i (NSA msg3 reception failed)\n", i, ra->state); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); return; } if (ra->msg3_round >= MAX_HARQ_ROUNDS - 1) { - LOG_W(NR_MAC, "Random Access %i failed at state %i (Reached msg3 max harq rounds)\n", i, ra->state); + LOG_D(NR_MAC, "Random Access %i failed at state %i (Reached msg3 max harq rounds)\n", i, ra->state); nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); return; } - LOG_W(NR_MAC, "Random Access %i Msg3 CRC did not pass)\n", i); + LOG_D(NR_MAC, "Random Access %i Msg3 CRC did not pass)\n", i); ra->msg3_round++; ra->state = Msg3_retransmission; } diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index ad4ab7da05..c860d847d9 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -77,7 +77,7 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) bool in_timewindow = frame_diff == 0 || (frame_diff == 1 && UL_info->slot < 7); if (UL_info->rach_ind.number_of_pdus > 0 && in_timewindow) { - LOG_A(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n", + LOG_D(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n", UL_info->frame, UL_info->slot, UL_info->rach_ind.sfn, UL_info->rach_ind.slot); for (int i = 0; i < UL_info->rach_ind.number_of_pdus; i++) { UL_info->rach_ind.number_of_pdus--; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 1830a3ca3a..02c42b4e5f 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1783,14 +1783,14 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP; set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing, - uecap, SpCellConfig, bwp_Dedicated, scc); + NULL/*uecap*/, SpCellConfig, bwp_Dedicated, scc); struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList; if (DL_BWP_list) { for (int i=0; ilist.count; i++){ NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i]; int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing; - set_dl_mcs_table(scs, uecap, SpCellConfig,bwp->bwp_Dedicated, carrier->servingcellconfigcommon); + set_dl_mcs_table(scs, NULL,/*uecap,*/ SpCellConfig,bwp->bwp_Dedicated, carrier->servingcellconfigcommon); } } } From 70265d9c64fdea6ed164fad20f4f2b7bffcd81f0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Mar 2022 18:45:14 +0100 Subject: [PATCH 701/883] Refactor fill_default_secondaryCellGroup(): less parameters --- openair1/SIMULATION/NR_PHY/dlsim.c | 9 +++++++- openair1/SIMULATION/NR_PHY/ulsim.c | 9 +++++++- openair2/RRC/NR/nr_rrc_proto.h | 12 ++--------- openair2/RRC/NR/rrc_gNB_nsa.c | 6 +----- openair2/RRC/NR/rrc_gNB_reconfig.c | 34 ++++++++++++------------------ 5 files changed, 33 insertions(+), 37 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index b465f47a33..ddab46f8c2 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -789,7 +789,14 @@ int main(int argc, char **argv) N_RB_DL,g_mcsTableIdx); // TODO do a UECAP for phy-sim - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, n_tx, 6, 0, 0, false, 0); + const gNB_RrcConfigurationReq conf = { + .pdsch_AntennaPorts = n_tx, + .minRXTXTIME = 6, + .do_CSIRS = 0, + .do_SRS = 0, + .force_256qam_off = false + }; + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, &conf, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 4fc91b3858..cb9e4ffbd8 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -731,7 +731,14 @@ int main(int argc, char **argv) prepare_scd(scd); // TODO do a UECAP for phy-sim - fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 0, 0, 0, false, 0); + const gNB_RrcConfigurationReq conf = { + .pdsch_AntennaPorts = n_tx, + .minRXTXTIME = 0, + .do_CSIRS = 0, + .do_SRS = 0, + .force_256qam_off = false + }; + fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, &conf, 0); // xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index db16d4e00a..f1462fee34 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -79,11 +79,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, - int dl_antenna_ports, - int minRXTXTIMEpdsch, - int do_csirs, - int do_srs, - bool force_256qam_off, + const gNB_RrcConfigurationReq *configuration, int uid); void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, @@ -97,11 +93,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, NR_UE_NR_Capability_t *uecap, - int dl_antenna_ports, - int minRXTXTIMEpdsch, - int do_csirs, - int do_srs, - bool force_256qam_off, + const gNB_RrcConfigurationReq *configuration, int uid); void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig, diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index ce858aec94..ea34cdd65a 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -249,11 +249,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ reconfig_ies, ue_context_p->ue_context.secondaryCellGroup, ue_context_p->ue_context.UE_Capability_nr, - configuration->pdsch_AntennaPorts, - configuration->minRXTXTIME, - configuration->do_CSIRS, - configuration->do_SRS, - configuration->force_256qam_off, + configuration, ue_context_p->local_uid); ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity; NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 80347bddf5..5e2c8e366d 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -56,12 +56,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, - int dl_antenna_ports, - int minRXTXTIME, - int do_csirs, - int do_srs, - bool force_256qam_off, - int uid) { + const gNB_RrcConfigurationReq *configuration, + int uid) +{ + const int dl_antenna_ports = configuration->pdsch_AntennaPorts; + const int do_csirs = configuration->do_CSIRS; AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n"); @@ -606,7 +605,10 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup1=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rateMatchPatternGroup2=NULL; bwp->bwp_Dedicated->pdsch_Config->choice.setup->rbg_Size=NR_PDSCH_Config__rbg_Size_config1; - set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, force_256qam_off ? NULL : uecap, bwp->bwp_Dedicated, servingcellconfigcommon); + set_dl_mcs_table(bwp->bwp_Common->genericParameters.subcarrierSpacing, + configuration->force_256qam_off ? NULL : uecap, + bwp->bwp_Dedicated, + servingcellconfigcommon); bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI)); *bwp->bwp_Dedicated->pdsch_Config->choice.setup->maxNrofCodeWordsScheduledByDCI = NR_PDSCH_Config__maxNrofCodeWordsScheduledByDCI_n1; bwp->bwp_Dedicated->pdsch_Config->choice.setup->prb_BundlingType.present = NR_PDSCH_Config__prb_BundlingType_PR_staticBundling; @@ -771,7 +773,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ASN_SEQUENCE_ADD(&srs_resset0->srs_ResourceIdList->list,srs_resset0_id); srs_Config->srs_ResourceToReleaseList=NULL; - if(do_srs) { + if (configuration->do_SRS) { srs_resset0->resourceType.present = NR_SRS_ResourceSet__resourceType_PR_periodic; srs_resset0->resourceType.choice.periodic = calloc(1,sizeof(*srs_resset0->resourceType.choice.periodic)); srs_resset0->resourceType.choice.periodic->associatedCSI_RS = NULL; @@ -815,7 +817,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco srs_res0->freqHopping.b_SRS); srs_res0->groupOrSequenceHopping=NR_SRS_Resource__groupOrSequenceHopping_neither; - if(do_srs) { + if (configuration->do_SRS) { srs_res0->resourceType.present= NR_SRS_Resource__resourceType_PR_periodic; srs_res0->resourceType.choice.periodic=calloc(1,sizeof(*srs_res0->resourceType.choice.periodic)); srs_res0->resourceType.choice.periodic->periodicityAndOffset_p.present = NR_SRS_PeriodicityAndOffset_PR_sl160; @@ -936,7 +938,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = i+minRXTXTIME; + *delay[i] = i + configuration->minRXTXTIME; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); @@ -1344,11 +1346,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, NR_UE_NR_Capability_t *uecap, - int dl_antenna_ports, - int minRXTXTIME, - int do_csirs, - int do_srs, - bool force_256qam_off, + const gNB_RrcConfigurationReq *configuration, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(reconfig!=NULL,"reconfig is null\n"); @@ -1362,11 +1360,7 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon uecap, 1, 1, - dl_antenna_ports, - minRXTXTIME, - do_csirs, - do_srs, - force_256qam_off, + configuration, uid); xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); From 3dc7da3b2269c9902bc58f5339a48e41833f88b8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 20 Mar 2022 15:08:56 +0100 Subject: [PATCH 702/883] fix for bad merge issues --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 12 +----------- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 1 - 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 89ba28b0c3..de3a1d274a 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -241,7 +241,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, #ifdef DEBUG_DLSCH_MAPPING uint8_t dmrs_symbol = l0+l_prime; - printf("DMRS Type %d params for ap %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n", + printf("DMRS Type %d params for nl %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n", 1+dmrs_Type,nl, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime, l0, dmrs_symbol); #endif @@ -338,13 +338,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15; #ifdef DEBUG_DLSCH_MAPPING printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n", -<<<<<<< HEAD - ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)], - ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)],mod_ptrs[ptrs_idx<<1],mod_ptrs[(ptrs_idx<<1)+1]); -======= ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF_precoding[nl])[((l*frame_parms->ofdm_symbol_size + k)<<1)], ((int16_t*)txdataF_precoding[nl])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1],mod_ptrs[ptrs_idx<<1],mod_ptrs[(ptrs_idx<<1)+1]); ->>>>>>> origin/develop #endif ptrs_idx++; } @@ -354,13 +349,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[nl][(m<<1) + 1]) >> 15; #ifdef DEBUG_DLSCH_MAPPING printf("m %d\t l %d \t k %d \t txdataF: %d %d\n", -<<<<<<< HEAD - m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)], - txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); -======= m, l, k, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1)], txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]); ->>>>>>> origin/develop #endif m++; } diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index beab48b977..7e4f9a9eaa 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -439,7 +439,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = !(index&0x01); - if (no_conf) LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { @@ -458,7 +458,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list[1].harq_value = !(index&0x01); uci_pdu->harq->harq_list[0].harq_value = !((index>>1)&0x01); - if (no_conf) LOG_I(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d (0 pass, 1 fail) and %d with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index f165656f95..e797c01096 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -286,7 +286,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, UE_info->CellGroup[0], sched_ctrl->active_bwp, NULL, - /* tda = */ 0, + /* tda = */ 2, g_nrOfLayers, sched_ctrl, ps); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 9270540d26..c57736990c 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -1154,7 +1154,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<1) + (table_7_3_2_3_3_1[dci->antenna_ports.val][3]<<2) + (table_7_3_2_3_3_1[dci->antenna_ports.val][4]<<3)); - dlsch_config_pdu_1_1->n_front_load_symb = 1; } if ((dmrs_type == NULL) && (max_length != NULL)){ // Table 7.3.1.2.2-2: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=2 From 3be77c09b57646a47c35ebef241fcbdc185de8a9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 22 Mar 2022 17:33:45 +0100 Subject: [PATCH 703/883] Change asterix's N310 USRP Replace the N310. Thus, the management IP address works, and the second SFP connector can be used. --- ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf | 2 +- ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf | 2 +- ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 7e6590cde2..8b14b74556 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -258,7 +258,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 3eeaac9875..02035ea827 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -254,7 +254,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index c7ae676108..84b66060d9 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -232,7 +232,7 @@ RUs = ( bf_weights = [0x00007fff, 0x00007fff]; #clock_src = "external"; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 3d94d65f6e..9f5c2875b3 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -261,7 +261,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index 83e947411d..594bd5e4c8 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -265,7 +265,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index c5effb39cd..2361437f7c 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -260,7 +260,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); From f5e143ec78aa34e6051692a8c4700ae0d8c3619a Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 22 Mar 2022 14:49:23 -0700 Subject: [PATCH 704/883] Removing multiple conf files when running multiple NRUEs --- .../episci/episci_nr-ue0.nfapi.conf | 45 ------------------- .../episci/episci_nr-ue1.nfapi.conf | 45 ------------------- .../episci/episci_nr-ue2.nfapi.conf | 45 ------------------- .../episci/episci_nr-ue3.nfapi.conf | 45 ------------------- .../episci/episci_nr-ue4.nfapi.conf | 45 ------------------- .../episci/episci_nr-ue5.nfapi.conf | 45 ------------------- 6 files changed, 270 deletions(-) delete mode 100644 ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf delete mode 100644 ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf delete mode 100644 ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf delete mode 100644 ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf delete mode 100644 ci-scripts/conf_files/episci/episci_nr-ue4.nfapi.conf delete mode 100644 ci-scripts/conf_files/episci/episci_nr-ue5.nfapi.conf diff --git a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf deleted file mode 100644 index 22ffb4cd3d..0000000000 --- a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf +++ /dev/null @@ -1,45 +0,0 @@ -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"; -}; - -uicc0 = { -imsi = "208950000000031"; -key = "0c0a34601d4f07677303652c0462535b"; -opc= "63bfa50ee6523365ff14c1f45f88737d"; -dnn= "oai"; -nssai_sst=222; -nssai_sd=123; -} - -L1s = ( - { - num_cc = 1; - tr_n_preference = "nfapi"; - local_n_if_name = "ens3"; - remote_n_address = "127.0.0.1"; //Proxy IP - local_n_address = "127.0.0.1"; - local_n_portc = 50600; - remote_n_portc = 50601; - local_n_portd = 50610; - remote_n_portd = 50611; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 90 - att_rx = 0; - bands = [7,38,42,43]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 125; - } -); diff --git a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf deleted file mode 100644 index 3d1c008f23..0000000000 --- a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf +++ /dev/null @@ -1,45 +0,0 @@ -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"; -}; - -uicc0 = { -imsi = "208950000000032"; -key = "0c0a34601d4f07677303652c0462535b"; -opc= "63bfa50ee6523365ff14c1f45f88737d"; -dnn= "oai"; -nssai_sst=222; -nssai_sd=123; -} - -L1s = ( - { - num_cc = 1; - tr_n_preference = "nfapi"; - local_n_if_name = "ens3"; - remote_n_address = "127.0.0.1"; //Proxy IP - local_n_address = "127.0.0.1"; - local_n_portc = 50600; - remote_n_portc = 50601; - local_n_portd = 50610; - remote_n_portd = 50611; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 90 - att_rx = 0; - bands = [7,38,42,43]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 125; - } -); diff --git a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf deleted file mode 100644 index 73c3292809..0000000000 --- a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf +++ /dev/null @@ -1,45 +0,0 @@ -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"; -}; - -uicc0 = { -imsi = "208950000000033"; -key = "0c0a34601d4f07677303652c0462535b"; -opc= "63bfa50ee6523365ff14c1f45f88737d"; -dnn= "oai"; -nssai_sst=222; -nssai_sd=123; -} - -L1s = ( - { - num_cc = 1; - tr_n_preference = "nfapi"; - local_n_if_name = "ens3"; - remote_n_address = "127.0.0.1"; //Proxy IP - local_n_address = "127.0.0.1"; - local_n_portc = 50600; - remote_n_portc = 50601; - local_n_portd = 50610; - remote_n_portd = 50611; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 90 - att_rx = 0; - bands = [7,38,42,43]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 125; - } -); diff --git a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf deleted file mode 100644 index 1f8f7306c6..0000000000 --- a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf +++ /dev/null @@ -1,45 +0,0 @@ -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"; -}; - -uicc0 = { -imsi = "208950000000034"; -key = "0c0a34601d4f07677303652c0462535b"; -opc= "63bfa50ee6523365ff14c1f45f88737d"; -dnn= "oai"; -nssai_sst=222; -nssai_sd=123; -} - -L1s = ( - { - num_cc = 1; - tr_n_preference = "nfapi"; - local_n_if_name = "ens3"; - remote_n_address = "127.0.0.1"; //Proxy IP - local_n_address = "127.0.0.1"; - local_n_portc = 50600; - remote_n_portc = 50601; - local_n_portd = 50610; - remote_n_portd = 50611; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 90 - att_rx = 0; - bands = [7,38,42,43]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 125; - } -); diff --git a/ci-scripts/conf_files/episci/episci_nr-ue4.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue4.nfapi.conf deleted file mode 100644 index 3d1d53463d..0000000000 --- a/ci-scripts/conf_files/episci/episci_nr-ue4.nfapi.conf +++ /dev/null @@ -1,45 +0,0 @@ -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"; -}; - -uicc0 = { -imsi = "208950000000035"; -key = "0c0a34601d4f07677303652c0462535b"; -opc= "63bfa50ee6523365ff14c1f45f88737d"; -dnn= "oai"; -nssai_sst=222; -nssai_sd=123; -} - -L1s = ( - { - num_cc = 1; - tr_n_preference = "nfapi"; - local_n_if_name = "ens3"; - remote_n_address = "127.0.0.1"; //Proxy IP - local_n_address = "127.0.0.1"; - local_n_portc = 50600; - remote_n_portc = 50601; - local_n_portd = 50610; - remote_n_portd = 50611; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 90 - att_rx = 0; - bands = [7,38,42,43]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 125; - } -); diff --git a/ci-scripts/conf_files/episci/episci_nr-ue5.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue5.nfapi.conf deleted file mode 100644 index 98b4c341ca..0000000000 --- a/ci-scripts/conf_files/episci/episci_nr-ue5.nfapi.conf +++ /dev/null @@ -1,45 +0,0 @@ -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"; -}; - -uicc0 = { -imsi = "208950000000036"; -key = "0c0a34601d4f07677303652c0462535b"; -opc= "63bfa50ee6523365ff14c1f45f88737d"; -dnn= "oai"; -nssai_sst=222; -nssai_sd=123; -} - -L1s = ( - { - num_cc = 1; - tr_n_preference = "nfapi"; - local_n_if_name = "ens3"; - remote_n_address = "127.0.0.1"; //Proxy IP - local_n_address = "127.0.0.1"; - local_n_portc = 50600; - remote_n_portc = 50601; - local_n_portd = 50610; - remote_n_portd = 50611; - } -); - -RUs = ( - { - local_rf = "yes" - nb_tx = 1 - nb_rx = 1 - att_tx = 90 - att_rx = 0; - bands = [7,38,42,43]; - max_pdschReferenceSignalPower = -27; - max_rxgain = 125; - } -); From 3387a94ae3008c35b7c3e271cd9ef90b5200d762 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 23 Mar 2022 15:47:07 +0100 Subject: [PATCH 705/883] fix for fr2 sl_ahead --- .../conf_files/gnb.band261.tm1.32PRB.usrpn300.conf | 1 + openair1/PHY/NR_UE_TRANSPORT/nr_prach.c | 9 ++++++--- openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h | 2 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf index e8c6cab1b4..0bb8346f6a 100644 --- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf @@ -227,6 +227,7 @@ RUs = ( att_tx = 0; att_rx = 0; bands = [7]; + sl_ahead = 12; max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c index 24299fd788..4927fe37a2 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c @@ -57,7 +57,7 @@ extern const char *prachfmt[]; // - idft for short sequence assumes we are transmitting starting in symbol 0 of a PRACH slot // - Assumes that PRACH SCS is same as PUSCH SCS @ 30 kHz, take values for formats 0-2 and adjust for others below // - Preamble index different from 0 is not detected by gNB -int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ +int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot){ NR_DL_FRAME_PARMS *fp=&ue->frame_parms; fapi_nr_config_request_t *nrUE_config = &ue->nrUE_config; @@ -190,8 +190,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ // now generate PRACH signal #ifdef NR_PRACH_DEBUG if (NCS>0) - LOG_I(PHY, "PRACH [UE %d] generate PRACH in slot %d for RootSeqIndex %d, Preamble Index %d, PRACH Format %s, NCS %d (N_ZC %d): Preamble_offset %d, Preamble_shift %d msg1 frequency start %d\n", + LOG_I(PHY, "PRACH [UE %d] generate PRACH in frame.slot %d.%d for RootSeqIndex %d, Preamble Index %d, PRACH Format %s, NCS %d (N_ZC %d): Preamble_offset %d, Preamble_shift %d msg1 frequency start %d\n", Mod_id, + frame, slot, rootSequenceIndex, preamble_index, @@ -221,7 +222,9 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ k += kbar; k *= 2; - LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id, + LOG_I(PHY, "PRACH [UE %d] in frame.slot %d.%d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", + Mod_id, + frame, slot, k, n_ra_prb, 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 aac59a7da1..35e30d63bf 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1704,7 +1704,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, unsigned char i_mod, unsigned char harq_pid); -int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t subframe); +int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot); void dump_nrdlsch(PHY_VARS_NR_UE *ue,uint8_t gNB_id,uint8_t nr_slot_rx,unsigned int *coded_bits_per_codeword,int round, unsigned char harq_pid); /**@}*/ diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index ddddcd09e2..be229f68c3 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1801,7 +1801,7 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_IN); - prach_power = generate_nr_prach(ue, gNB_id, nr_slot_tx); + prach_power = generate_nr_prach(ue, gNB_id, frame_tx, nr_slot_tx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 670f337c31..a63419f8e9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -466,12 +466,12 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, uint8_t start_next_period = (rach_slot-(rach_slot%tdd_period_slot)+tdd_period_slot)%nr_slots_per_frame[mu]; *msg2_slot = start_next_period + last_dl_slot_period; // initializing scheduling of slot to next mixed (or last dl) slot *msg2_frame = ((*msg2_slot>(rach_slot))? rach_frame : (rach_frame+1))%1024; - // we can't schedule msg2 before sl_ahead since prach int eff_slot = *msg2_slot+(*msg2_frame-rach_frame)*nr_slots_per_frame[mu]; - if ((eff_slot-rach_slot)<=sl_ahead) { + while ((eff_slot-rach_slot)<=sl_ahead) { *msg2_slot = (*msg2_slot+tdd_period_slot)%nr_slots_per_frame[mu]; *msg2_frame = ((*msg2_slot>(rach_slot))? rach_frame : (rach_frame+1))%1024; + eff_slot = *msg2_slot+(*msg2_frame-rach_frame)*nr_slots_per_frame[mu]; } if (FR==nr_FR2) { int num_tdd_period = *msg2_slot/tdd_period_slot; From 548315ff64a9915d3c12877a9c50d527d9390a01 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 23 Mar 2022 16:22:51 +0100 Subject: [PATCH 706/883] fix memory leaks after merge --- openair1/PHY/INIT/nr_init.c | 3 +-- openair1/PHY/INIT/nr_init_ue.c | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 9c80782ccf..85d1b55912 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -331,10 +331,9 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) free_and_zero(pdcch_dmrs); uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs; - int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; for (int slot = 0; slot < fp->slots_per_frame; slot++) { for (int symb = 0; symb < fp->symbols_per_slot; symb++) { - for (int q = 0; q < nb_codewords; q++) + for (int q = 0; q < NR_NB_NSCID; q++) free_and_zero(pdsch_dmrs[slot][symb][q]); free_and_zero(pdsch_dmrs[slot][symb]); } diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 9e41d00b3e..c5b611c7b6 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -216,7 +216,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK) int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1; - ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***)); uint32_t ****pusch_dmrs = ue->nr_gold_pusch_dmrs; @@ -230,7 +229,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) for (int q=0; qslots_per_frame; slot++) { for (int symb = 0; symb < fp->symbols_per_slot; symb++) { + for (int q=0; qnr_gold_pusch_dmrs[slot][symb][q]); free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb]); } free_and_zero(ue->nr_gold_pusch_dmrs[slot]); @@ -511,10 +512,9 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } free_and_zero(ue->nr_gold_pdcch[0]); - int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; for (int slot=0; slotslots_per_frame; slot++) { for (int symb=0; symbsymbols_per_slot; symb++) { - for (int q=0; qnr_gold_pdsch[0][slot][symb][q]); free_and_zero(ue->nr_gold_pdsch[0][slot][symb]); } From 3e6f957a63ace3cabae6142ca41172faf8ac4157 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 22 Mar 2022 14:50:03 -0700 Subject: [PATCH 707/883] Several nfapi bug fixes for RX ind and SR ind The SR ind was not properly being packed and unpacked. The RX inidcation was not properly being allocated prior to unpacking. The freq_shift field was declared as a uint16_t but push/pulled as a uint8_t. Added MSG_TRUNC in the nfapi VNF recvfrom. --- nfapi/open-nFAPI/nfapi/src/nfapi_p7.c | 31 +++++++++------------------ nfapi/open-nFAPI/vnf/src/vnf_p7.c | 30 +++++++++++--------------- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index ba30d8f469..3adde23e7d 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -1048,7 +1048,7 @@ static uint8_t pack_ul_tti_request_srs_pdu(nfapi_nr_srs_pdu_t *srs_pdu, uint8_t push8(srs_pdu->comb_offset, ppWritePackedMsg, end) && push8(srs_pdu->cyclic_shift, ppWritePackedMsg, end) && push8(srs_pdu->frequency_position, ppWritePackedMsg, end) && - push8(srs_pdu->frequency_shift, ppWritePackedMsg, end) && + push16(srs_pdu->frequency_shift, ppWritePackedMsg, end) && push8(srs_pdu->frequency_hopping, ppWritePackedMsg, end) && push8(srs_pdu->group_or_sequence_hopping, ppWritePackedMsg, end) && push8(srs_pdu->resource_type, ppWritePackedMsg, end) && @@ -1598,7 +1598,6 @@ static uint8_t pack_ul_tti_request(void *msg, uint8_t **ppWritePackedMsg, uint8_ if (!push8(pNfapiMsg->n_ulcch, ppWritePackedMsg, end)) return 0; - for(int i=0; in_pdus; i++) { if(!pack_ul_tti_pdu_list_value(&pNfapiMsg->pdus_list[i], ppWritePackedMsg, end)) return 0; @@ -3023,10 +3022,8 @@ return 1; //RX DATA INDICATION -static uint8_t pack_nr_rx_data_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +static uint8_t pack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t *value, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv; - if(!(push32(value->handle, ppWritePackedMsg, end) && push16(value->rnti, ppWritePackedMsg, end) && push8(value->harq_id, ppWritePackedMsg, end) && @@ -3056,7 +3053,7 @@ static uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg, for (int i = 0; i < pNfapiMsg->number_of_pdus; i++) { - if(!pack_nr_rx_data_indication_body(&(pNfapiMsg->pdu_list[i]), ppWritePackedMsg, end)) + if(!pack_nr_rx_data_indication_body(&(pNfapiMsg->pdu_list[i]), ppWritePackedMsg, end)) return 0; } @@ -3104,10 +3101,8 @@ return 1; //SRS INDICATION -static uint8_t pack_nr_srs_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) +static uint8_t pack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t *value, uint8_t **ppWritePackedMsg, uint8_t *end) { - nfapi_nr_srs_indication_pdu_t* value = (nfapi_nr_srs_indication_pdu_t*)tlv; - if(!(push32(value->handle, ppWritePackedMsg, end) && push16(value->rnti, ppWritePackedMsg, end) && push16(value->timing_advance, ppWritePackedMsg, end) && @@ -3119,8 +3114,7 @@ static uint8_t pack_nr_srs_indication_body(void* tlv, uint8_t **ppWritePackedMsg return 0; for(int i = 0; i < value->reported_symbol_list->num_rbs; i++) { - if(!(push8(value->reported_symbol_list->rb_list->rb_snr, ppWritePackedMsg, end) - )) + if (!push8(value->reported_symbol_list->rb_list[i].rb_snr, ppWritePackedMsg, end)) return 0; } return 1; @@ -5722,7 +5716,7 @@ static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t* value, return 0; uint16_t length = value->pdu_length; - value->pdu = nfapi_p7_allocate(length, config); + value->pdu = nfapi_p7_allocate(sizeof(*value->pdu) * length, config); if (pullarray8(ppReadPackedMsg, value->pdu, length, length, end) == 0) { @@ -5803,10 +5797,8 @@ return 1; //SRS INDICATION -static uint8_t unpack_nr_srs_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) +static uint8_t unpack_nr_srs_indication_body(nfapi_nr_srs_indication_pdu_t* value, uint8_t **ppReadPackedMsg, uint8_t *end) { - nfapi_nr_srs_indication_pdu_t* value = (nfapi_nr_srs_indication_pdu_t*)tlv; - if(!(pull32(ppReadPackedMsg, &value->handle, end) && pull16(ppReadPackedMsg, &value->rnti, end) && pull16(ppReadPackedMsg, &value->timing_advance, end) && @@ -5818,17 +5810,14 @@ static uint8_t unpack_nr_srs_indication_body(void* tlv, uint8_t **ppReadPackedMs return 0; for(int i = 0; i < value->reported_symbol_list->num_rbs; i++) { - if(!(pull8(ppReadPackedMsg, &value->reported_symbol_list->rb_list->rb_snr, end) - )) + if (!pull8(ppReadPackedMsg, &value->reported_symbol_list->rb_list[i].rb_snr, end)) return 0; } return 1; } -static uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) +static uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_nr_srs_indication_t *pNfapiMsg, nfapi_p7_codec_config_t* config) { - nfapi_nr_srs_indication_t *pNfapiMsg = (nfapi_nr_srs_indication_t*)msg; - if (!(pull16(ppReadPackedMsg,&pNfapiMsg->sfn , end) && pull16(ppReadPackedMsg,&pNfapiMsg->slot , end) && pull8(ppReadPackedMsg,&pNfapiMsg->number_of_pdus, end) @@ -5837,7 +5826,7 @@ static uint8_t unpack_nr_srs_indication(uint8_t **ppReadPackedMsg, uint8_t *end, for(int i=0; inumber_of_pdus;i++) { - if(!unpack_nr_srs_indication_body(&pNfapiMsg->pdu_list,ppReadPackedMsg,end)) + if (!unpack_nr_srs_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end)) return 0; } diff --git a/nfapi/open-nFAPI/vnf/src/vnf_p7.c b/nfapi/open-nFAPI/vnf/src/vnf_p7.c index 2ac59dd7be..e4b4bef848 100644 --- a/nfapi/open-nFAPI/vnf/src/vnf_p7.c +++ b/nfapi/open-nFAPI/vnf/src/vnf_p7.c @@ -1473,7 +1473,7 @@ void vnf_handle_nr_slot_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf } else { - NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling NR SLOT Indication\n", __FUNCTION__); + NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling NR SLOT Indication\n", __FUNCTION__); if(vnf_p7->_public.nr_slot_indication) { (vnf_p7->_public.nr_slot_indication)(&ind); @@ -2574,32 +2574,28 @@ int vnf_p7_read_dispatch_message(vnf_p7_t* vnf_p7) // resize the buffer if we have a large segment if(header.message_length > vnf_p7->rx_message_buffer_size) { - NFAPI_TRACE(NFAPI_TRACE_NOTE, "reallocing rx buffer %d\n", header.message_length); + NFAPI_TRACE(NFAPI_TRACE_NOTE, "reallocing rx buffer %d\n", header.message_length); vnf_p7->rx_message_buffer = realloc(vnf_p7->rx_message_buffer, header.message_length); vnf_p7->rx_message_buffer_size = header.message_length; } // read the segment - recvfrom_result = recvfrom(vnf_p7->socket, vnf_p7->rx_message_buffer, header.message_length, MSG_WAITALL, (struct sockaddr*)&remote_addr, &remote_addr_size); + recvfrom_result = recvfrom(vnf_p7->socket, vnf_p7->rx_message_buffer, header.message_length, MSG_WAITALL | MSG_TRUNC, (struct sockaddr*)&remote_addr, &remote_addr_size); + NFAPI_TRACE(NFAPI_TRACE_INFO, "recvfrom_result = %d from %s():%d\n", recvfrom_result, __FUNCTION__, __LINE__); // todo : how to handle incomplete readfroms, need some sort of buffer/select - if(recvfrom_result == 0) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "recvfrom returned 0\n"); - } - else if(recvfrom_result != -1 && recvfrom_result != header.message_length) - { - NFAPI_TRACE(NFAPI_TRACE_ERROR, "Received unexpected number of bytes %d %d\n", recvfrom_result, header.message_length); - - recvfrom_result += recvfrom(vnf_p7->socket, &vnf_p7->rx_message_buffer[recvfrom_result], header.message_length - recvfrom_result, MSG_WAITALL, (struct sockaddr*)&remote_addr, &remote_addr_size); - - } - - - if(recvfrom_result > 0) + if (recvfrom_result > 0) { + if (recvfrom_result != header.message_length) + { + NFAPI_TRACE(NFAPI_TRACE_ERROR, "(%d) Received unexpected number of bytes. %d != %d", + __LINE__, recvfrom_result, header.message_length); + break; + } + NFAPI_TRACE(NFAPI_TRACE_INFO, "Calling vnf_nr_handle_p7_message from %d\n", __LINE__); vnf_handle_p7_message(vnf_p7->rx_message_buffer, recvfrom_result, vnf_p7); + return 0; } else { From 4a00c99ab0af31c538ce135af0797550564c6685 Mon Sep 17 00:00:00 2001 From: Mario Hudon Date: Wed, 23 Mar 2022 17:11:02 -0400 Subject: [PATCH 708/883] Fixed rebaseline to develop --- openair1/PHY/INIT/nr_init_ue.c | 34 +++------------------ openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 6 +--- openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 3 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 2 +- 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index cab4583efd..94f3564baa 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -410,9 +410,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12)); } } - } } } + + // RACH + prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) ); + } // initialization for the last instance of pdsch_vars (used for MU-MIMO) @@ -539,34 +543,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->pdsch_vars[th_id][gNB_id]); } - for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { - for (int i = 0; i < fp->nb_antennas_rx; i++) { - for (int j = 0; j < 4; j++) { - int idx = j * fp->nb_antennas_rx + i; - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx]); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx]); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx]); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx]); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx]); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx]); - } - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho[i]); - } - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr16); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->e_rx); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time); - - free_and_zero(ue->pdcch_vars[th_id][gNB_id]); - } - for (int i = 0; i < fp->nb_antennas_rx; i++) { free_and_zero(ue->nr_srs_info->srs_received_signal[i]); free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index dcb373e057..48b08d761e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -391,12 +391,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t i_ssb, MIMO_mode_t mimo_mode, -<<<<<<< HEAD - NR_UE_PDCCH_CONFIG *phy_pdcch_config) { - -======= + NR_UE_PDCCH_CONFIG *phy_pdcch_config, fapiPbch_t *result) { ->>>>>>> oai-eurecom/develop NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars; int max_h=0; int symbol; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 4aa0c5d4b3..279a0d8ce5 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -286,6 +286,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ if(scheduled_response->dl_config != NULL){ fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config; fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu; + fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config; for (int i = 0; i < dl_config->number_pdus; ++i){ AssertFatal(dl_config->number_pdus < FAPI_NR_DL_CONFIG_LIST_NUM,"dl_config->number_pdus %d out of bounds\n",dl_config->number_pdus); @@ -299,7 +300,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ phy_pdcch_config = (NR_UE_PDCCH_CONFIG *)scheduled_response->phy_data; phy_pdcch_config->nb_search_space = 0; } - fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; + pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15; memcpy((void*)&phy_pdcch_config->pdcch_config[phy_pdcch_config->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config)); phy_pdcch_config->nb_search_space = phy_pdcch_config->nb_search_space + 1; phy_pdcch_config->sfn = scheduled_response->frame; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 7ae66ec448..6ba740eeaf 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1013,7 +1013,7 @@ int handle_bcch_bch(module_id_t module_id, int cc_id, return nr_ue_decode_mib(module_id, cc_id, gNB_index, - phy_data, + phy_data, additional_bits, ssb_length, // Lssb = 64 is not support ssb_index, From 408c9ec7c2aeae0cd806e4a17d47dff7d4ae4bb9 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 23 Mar 2022 22:17:03 +0000 Subject: [PATCH 709/883] Fix RIV value for 162 PRBs --- .../conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 4 ++-- .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 2361437f7c..fef2a47b9b 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -83,7 +83,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=0,L=106 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 31899; + initialDLBWPlocationAndBandwidth = 31624; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -103,7 +103,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 31899; + initialULBWPlocationAndBandwidth = 31624; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index fac54a298b..3e2c8fc95c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -66,7 +66,7 @@ gNBs = #initialDownlinkBWP #genericParameters # this is RBstart=0,L=162 (275*(275-L+1))+(274-RBstart)) - initialDLBWPlocationAndBandwidth = 31899; + initialDLBWPlocationAndBandwidth = 31624; # # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 @@ -100,7 +100,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 31899; + initialULBWPlocationAndBandwidth = 31624; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; From 1a60377c56651244adf433eec9e6206c14e5cd97 Mon Sep 17 00:00:00 2001 From: Manish Date: Thu, 24 Mar 2022 08:05:53 +0000 Subject: [PATCH 710/883] Updating the 5G RF simulator tutorial for registration of 2 OAI UE with 5GC Signed-off-by: Manish --- .../yaml_files/5g_rfsimulator/README.md | 112 +++++++++++++++++- 1 file changed, 109 insertions(+), 3 deletions(-) diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index fc562dd1eb..5eb2a789a9 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -23,6 +23,7 @@ This page is only valid for an `Ubuntu18` host. 1. [Deploy OAI 5G Core Network](#21-deploy-oai-5g-core-network) 2. [Deploy OAI gNB in RF simulator mode and in Standalone Mode](#22-deploy-oai-gnb-in-rf-simulator-mode-and-in-standalone-mode) 3. [Deploy OAI NR-UE in RF simulator mode and in Standalone Mode](#23-deploy-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode) + 4. [Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode](#24-deploy-second-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode) 3. [Check traffic](#3-check-traffic) 1. [Check your Internet connectivity](#31-check-your-internet-connectivity) 2. [Start the iperf server inside the NR-UE container](#32-start-the-iperf-server-inside-the-nr-ue-container) @@ -203,6 +204,8 @@ $ docker logs rfsim5g-oai-amf $ docker-compose up -d oai-nr-ue rfsim5g-mysql is up-to-date rfsim5g-oai-nrf is up-to-date +rfsim5g-oai-amf is up-to-date +rfsim5g-oai-smf is up-to-date rfsim5g-oai-spgwu is up-to-date rfsim5g-oai-ext-dn is up-to-date rfsim5g-oai-gnb is up-to-date @@ -255,6 +258,98 @@ oaitun_ue1: flags=4305 mtu 1500 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` +## 2.4. Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode ## + +```bash +Create a entry for new IMSI (208990100001101) in oai_db.sql file +Refer Section - [Making the NR-UE connect to the core network](#51-making-the-nr-ue-connect-to-the-core-network) + +Create entry for Second UE in docker-compose.yaml file as follows: + oai-nr-ue2: + image: oai-nr-ue:develop + privileged: true + container_name: rfsim5g-oai-nr-ue2 + environment: + RFSIMULATOR: 192.168.71.136 + FULL_IMSI: '208990100001101' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + NSSAI_SD: 1 + USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time + depends_on: + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.71.138 + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 +``` + + +```bash +$ docker-compose up -d oai-nr-ue2 +rfsim5g-mysql is up-to-date +rfsim5g-oai-nrf is up-to-date +rfsim5g-oai-amf is up-to-date +rfsim5g-oai-smf is up-to-date +rfsim5g-oai-spgwu is up-to-date +rfsim5g-oai-ext-dn is up-to-date +rfsim5g-oai-gnb is up-to-date +Creating rfsim5g-oai-nr-ue2 ... done +``` + +Wait for a bit. + +```bash +$ docker-compose ps -a + Name Command State Ports +------------------------------------------------------------------------------------------------- +rfsim5g-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp +rfsim5g-oai-amf /bin/bash /openair-amf/bin ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp +rfsim5g-oai-ext-dn /bin/bash -c apt update; ... Up (healthy) +rfsim5g-oai-gnb /opt/oai-gnb/bin/entrypoin ... Up (healthy) +rfsim5g-oai-nr-ue /opt/oai-nr-ue/bin/entrypo ... Up (healthy) +rfsim5g-oai-nr-ue2 /opt/oai-nr-ue/bin/entrypo ... Up (healthy) +rfsim5g-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/tcp +rfsim5g-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp +rfsim5g-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +``` + +Making sure the Second OAI UE is connected: + +```bash +$ docker exec -it rfsim5g-oai-nr-ue2 /bin/bash +root@bb4d400a832d:/opt/oai-nr-ue# ifconfig +eth0: flags=4163 mtu 1500 + inet 192.168.71.138 netmask 255.255.255.192 broadcast 192.168.71.191 + ether 02:42:c0:a8:47:8a txqueuelen 0 (Ethernet) + RX packets 3192021 bytes 67784900946 (67.7 GB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 3397743 bytes 91320004542 (91.3 GB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +lo: flags=73 mtu 65536 + inet 127.0.0.1 netmask 255.0.0.0 + loop txqueuelen 1000 (Local Loopback) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +oaitun_ue1: flags=4305 mtu 1500 + inet 12.1.1.3 netmask 255.255.255.0 destination 12.1.1.3 + unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 +``` + # 3. Check traffic # ## 3.1. Check your Internet connectivity ## @@ -299,6 +394,9 @@ Let now try to check UDP traffic in Downlink. You will need 2 terminals: one in the NR-UE container, one in the ext-dn container. +Note: +Similarly, Second OAI UE Internet connectivity can be checked. + ## 3.2. Start the `iperf` server inside the NR-UE container ## ```bash @@ -384,24 +482,26 @@ The `500 Kbits/sec` value may change depending on your CPU power! ```bash $ docker-compose down +Stopping rfsim5g-oai-nr-ue2 ... done Stopping rfsim5g-oai-nr-ue ... done Stopping rfsim5g-oai-gnb ... done Stopping rfsim5g-oai-ext-dn ... done +Stopping rfsim5g-oai-spgwu ... done Stopping rfsim5g-oai-smf ... done Stopping rfsim5g-oai-amf ... done -Stopping rfsim5g-oai-spgwu ... done Stopping rfsim5g-oai-nrf ... done Stopping rfsim5g-mysql ... done +Removing rfsim5g-oai-nr-ue2 ... done Removing rfsim5g-oai-nr-ue ... done Removing rfsim5g-oai-gnb ... done Removing rfsim5g-oai-ext-dn ... done +Removing rfsim5g-oai-spgwu ... done Removing rfsim5g-oai-smf ... done Removing rfsim5g-oai-amf ... done -Removing rfsim5g-oai-spgwu ... done Removing rfsim5g-oai-nrf ... done Removing rfsim5g-mysql ... done Removing network rfsim5g-oai-public-net -Removing network rfsim5g-oai-traffic_net-net +Removing network rfsim5g-oai-traffic-net ``` # 5. Explanations on the configuration in the `docker-compose.yaml` # @@ -419,13 +519,19 @@ This value is also present in the `oai_db.sql` file: ```bash INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); +INSERT INTO `users` VALUES ('208990100001101','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); ``` As you can see, 2 other values shall match in the NR-UE section of `docker-compose.yaml`: +OAI UE - 1 * `FULL_IMSI: '208990100001100'` * `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'` +OAI UE - 2 +* `FULL_IMSI: '208990100001101'` +* `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'` + We are also using a dedicated `oai-smf.conf` for the `SMF` container: the `oai` DNN shall match the one in the NR-UE section of `docker-compose.yaml` (`DNN: oai`). ## 5.2. Making the gNB connect to the core network ## From 154c5d587c8009616cb6a6af41eed002c363e4b6 Mon Sep 17 00:00:00 2001 From: Manish Date: Thu, 24 Mar 2022 08:05:53 +0000 Subject: [PATCH 711/883] Updating the 5G RF simulator tutorial for registration of 2 OAI UE with 5GC Signed-off-by: Manish --- .../yaml_files/5g_rfsimulator/README.md | 112 +++++++++++++++++- 1 file changed, 109 insertions(+), 3 deletions(-) diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index fc562dd1eb..5eb2a789a9 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -23,6 +23,7 @@ This page is only valid for an `Ubuntu18` host. 1. [Deploy OAI 5G Core Network](#21-deploy-oai-5g-core-network) 2. [Deploy OAI gNB in RF simulator mode and in Standalone Mode](#22-deploy-oai-gnb-in-rf-simulator-mode-and-in-standalone-mode) 3. [Deploy OAI NR-UE in RF simulator mode and in Standalone Mode](#23-deploy-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode) + 4. [Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode](#24-deploy-second-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode) 3. [Check traffic](#3-check-traffic) 1. [Check your Internet connectivity](#31-check-your-internet-connectivity) 2. [Start the iperf server inside the NR-UE container](#32-start-the-iperf-server-inside-the-nr-ue-container) @@ -203,6 +204,8 @@ $ docker logs rfsim5g-oai-amf $ docker-compose up -d oai-nr-ue rfsim5g-mysql is up-to-date rfsim5g-oai-nrf is up-to-date +rfsim5g-oai-amf is up-to-date +rfsim5g-oai-smf is up-to-date rfsim5g-oai-spgwu is up-to-date rfsim5g-oai-ext-dn is up-to-date rfsim5g-oai-gnb is up-to-date @@ -255,6 +258,98 @@ oaitun_ue1: flags=4305 mtu 1500 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` +## 2.4. Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode ## + +```bash +Create a entry for new IMSI (208990100001101) in oai_db.sql file +Refer Section - [Making the NR-UE connect to the core network](#51-making-the-nr-ue-connect-to-the-core-network) + +Create entry for Second UE in docker-compose.yaml file as follows: + oai-nr-ue2: + image: oai-nr-ue:develop + privileged: true + container_name: rfsim5g-oai-nr-ue2 + environment: + RFSIMULATOR: 192.168.71.136 + FULL_IMSI: '208990100001101' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + NSSAI_SD: 1 + USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time + depends_on: + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.71.138 + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 +``` + + +```bash +$ docker-compose up -d oai-nr-ue2 +rfsim5g-mysql is up-to-date +rfsim5g-oai-nrf is up-to-date +rfsim5g-oai-amf is up-to-date +rfsim5g-oai-smf is up-to-date +rfsim5g-oai-spgwu is up-to-date +rfsim5g-oai-ext-dn is up-to-date +rfsim5g-oai-gnb is up-to-date +Creating rfsim5g-oai-nr-ue2 ... done +``` + +Wait for a bit. + +```bash +$ docker-compose ps -a + Name Command State Ports +------------------------------------------------------------------------------------------------- +rfsim5g-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp +rfsim5g-oai-amf /bin/bash /openair-amf/bin ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp +rfsim5g-oai-ext-dn /bin/bash -c apt update; ... Up (healthy) +rfsim5g-oai-gnb /opt/oai-gnb/bin/entrypoin ... Up (healthy) +rfsim5g-oai-nr-ue /opt/oai-nr-ue/bin/entrypo ... Up (healthy) +rfsim5g-oai-nr-ue2 /opt/oai-nr-ue/bin/entrypo ... Up (healthy) +rfsim5g-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/tcp +rfsim5g-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp +rfsim5g-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +``` + +Making sure the Second OAI UE is connected: + +```bash +$ docker exec -it rfsim5g-oai-nr-ue2 /bin/bash +root@bb4d400a832d:/opt/oai-nr-ue# ifconfig +eth0: flags=4163 mtu 1500 + inet 192.168.71.138 netmask 255.255.255.192 broadcast 192.168.71.191 + ether 02:42:c0:a8:47:8a txqueuelen 0 (Ethernet) + RX packets 3192021 bytes 67784900946 (67.7 GB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 3397743 bytes 91320004542 (91.3 GB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +lo: flags=73 mtu 65536 + inet 127.0.0.1 netmask 255.0.0.0 + loop txqueuelen 1000 (Local Loopback) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +oaitun_ue1: flags=4305 mtu 1500 + inet 12.1.1.3 netmask 255.255.255.0 destination 12.1.1.3 + unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 +``` + # 3. Check traffic # ## 3.1. Check your Internet connectivity ## @@ -299,6 +394,9 @@ Let now try to check UDP traffic in Downlink. You will need 2 terminals: one in the NR-UE container, one in the ext-dn container. +Note: +Similarly, Second OAI UE Internet connectivity can be checked. + ## 3.2. Start the `iperf` server inside the NR-UE container ## ```bash @@ -384,24 +482,26 @@ The `500 Kbits/sec` value may change depending on your CPU power! ```bash $ docker-compose down +Stopping rfsim5g-oai-nr-ue2 ... done Stopping rfsim5g-oai-nr-ue ... done Stopping rfsim5g-oai-gnb ... done Stopping rfsim5g-oai-ext-dn ... done +Stopping rfsim5g-oai-spgwu ... done Stopping rfsim5g-oai-smf ... done Stopping rfsim5g-oai-amf ... done -Stopping rfsim5g-oai-spgwu ... done Stopping rfsim5g-oai-nrf ... done Stopping rfsim5g-mysql ... done +Removing rfsim5g-oai-nr-ue2 ... done Removing rfsim5g-oai-nr-ue ... done Removing rfsim5g-oai-gnb ... done Removing rfsim5g-oai-ext-dn ... done +Removing rfsim5g-oai-spgwu ... done Removing rfsim5g-oai-smf ... done Removing rfsim5g-oai-amf ... done -Removing rfsim5g-oai-spgwu ... done Removing rfsim5g-oai-nrf ... done Removing rfsim5g-mysql ... done Removing network rfsim5g-oai-public-net -Removing network rfsim5g-oai-traffic_net-net +Removing network rfsim5g-oai-traffic-net ``` # 5. Explanations on the configuration in the `docker-compose.yaml` # @@ -419,13 +519,19 @@ This value is also present in the `oai_db.sql` file: ```bash INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); +INSERT INTO `users` VALUES ('208990100001101','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); ``` As you can see, 2 other values shall match in the NR-UE section of `docker-compose.yaml`: +OAI UE - 1 * `FULL_IMSI: '208990100001100'` * `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'` +OAI UE - 2 +* `FULL_IMSI: '208990100001101'` +* `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'` + We are also using a dedicated `oai-smf.conf` for the `SMF` container: the `oai` DNN shall match the one in the NR-UE section of `docker-compose.yaml` (`DNN: oai`). ## 5.2. Making the gNB connect to the core network ## From 7bdf4f19a79ddcbc5245c0257b29843573c976ce Mon Sep 17 00:00:00 2001 From: Manish Date: Thu, 24 Mar 2022 11:09:35 +0000 Subject: [PATCH 712/883] OAI Database Updated for IMSI and OAI UE Added in Docker Compose. Signed-off-by: Manish --- .../5g_rfsimulator/docker-compose.yaml | 24 +++++++++++++++++++ .../yaml_files/5g_rfsimulator/oai_db.sql | 1 + 2 files changed, 25 insertions(+) diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml index 808be7d83d..f27ec3050d 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml @@ -279,6 +279,30 @@ services: timeout: 5s retries: 5 + oai-nr-ue2: + image: oai-nr-ue:develop + privileged: true + container_name: rfsim5g-oai-nr-ue2 + environment: + RFSIMULATOR: 192.168.71.140 + FULL_IMSI: '208990100001101' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + NSSAI_SD: 1 + USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time + depends_on: + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.71.151 + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + networks: public_net: driver: bridge diff --git a/ci-scripts/yaml_files/5g_rfsimulator/oai_db.sql b/ci-scripts/yaml_files/5g_rfsimulator/oai_db.sql index fbd7907a71..75f586c299 100755 --- a/ci-scripts/yaml_files/5g_rfsimulator/oai_db.sql +++ b/ci-scripts/yaml_files/5g_rfsimulator/oai_db.sql @@ -192,6 +192,7 @@ LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` VALUES ('20834123456789','380561234567','35609204079300',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,'+�E��ų\0�,IH��H',0,0,00000000000000000096,'Px�X \Z1��x��','^��K�����FeU���'),('20810000001234','33611123456','35609204079299',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000281454575616225,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','�4�s@���z��~�'),('31002890832150','33638060059','35611302209414',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012416,'`�F�݆��D��ϛ���','�4�s@���z��~�'),('001010123456789','33600101789','35609204079298',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'\0 \n \r',1,0,00000000000000000351,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','L�*\\�����^��]� '),('208930000000001','33638030001','35609204079301',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000002','33638050002','35609204079502',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000020471,'\0 \n \r','�4�s@���z��~�'),('208950000000003','33638050003','35609204079503',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012343,'\0 \n \r','�4�s@���z��~�'),('208950000000004','33638050004','35609204079504',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000005','33638050005','35609204079505',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000001','33638050001','35609204079501',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000006','33638050006','35609204079506',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000007','33638050007','35609204079507',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208930000000002','33638030002','35609204079302',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000003','33638030003','35609204079303',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000004','33638030004','35609204079304',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000005','33638030005','35609204079305',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000006','33638030006','35609204079306',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000007','33638030007','35609204079307',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000007','33638040007','35609204079407',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000006','33638040006','35609204079406',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000005','33638040005','35609204079405',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000004','33638040004','35609204079404',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000003','33638040003','35609204079403',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000002','33638040002','35609204079402',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000001','33638040001','35609204079401',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208920100001100','33638020001','35609204079201',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001101','33638020001','35609204079201',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204937234,'\0 \n \r','�$I6;��+f�k�u�|�'),('208920100001102','33638020002','35609204079202',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001103','33638020003','35609204079203',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001104','33638020004','35609204079204',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001105','33638020005','35609204079205',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001106','33638020006','35609204079206',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000000000000006103,'ebd07771ace8677a','�$I6;��+f�k�u�|�'),('208920100001107','33638020007','35609204079207',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001108','33638020008','35609204079208',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001109','33638020009','35609204079209',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001110','33638020010','35609204079210',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001111','33638030011','35609304079211',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001112','33638030012','35609304079212',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001113','33638030013','35609304079213',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006263,'�SNܒ�Iv��e�6','�4�s@���z��~�'),('208950000000008','33638050008','35609204079508',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000009','33638050009','35609204079509',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000010','33638050010','35609204079510',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000011','33638050011','35609204079511',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000012','33638050012','35609204079512',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000013','33638050013','35609204079513',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000014','33638050014','35609204079514',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000015','33638050015','35609204079515',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000000000,'3536663032363164','�4�s@���z��~�'),('208920100001118','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204934762,'~?03�u-%�ey�y�','�$I6;��+f�k�u�|�'),('208920100001121','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'&��@xg�]���\n��Vp','�$I6;��+f�k�u�|�'),('208920100001119','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'269482407867805d','�$I6;��+f�k�u�|�'),('208920100001120','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'3236393438323430','�$I6;��+f�k�u�|�'); INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); +INSERT INTO `users` VALUES ('208990100001101','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1); INSERT INTO `users` VALUES ('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); INSERT INTO `users` VALUES ('208950000000032','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); INSERT INTO `users` VALUES ('208950000000033','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d); From 128bd86f67ba36611d8785281824515c3908d7d7 Mon Sep 17 00:00:00 2001 From: Manish Date: Thu, 24 Mar 2022 11:33:19 +0000 Subject: [PATCH 713/883] OAI UE IP Address Aligned in Readme with New IP Series for OAI UEs Signed-off-by: Manish --- ci-scripts/yaml_files/5g_rfsimulator/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index 5eb2a789a9..64c9084500 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -234,7 +234,7 @@ Making sure the OAI UE is connected: $ docker exec -it rfsim5g-oai-nr-ue /bin/bash root@bb4d400a832d:/opt/oai-nr-ue# ifconfig eth0: flags=4163 mtu 1500 - inet 192.168.71.137 netmask 255.255.255.192 broadcast 192.168.71.191 + inet 192.168.71.150 netmask 255.255.255.192 broadcast 192.168.71.191 ether 02:42:c0:a8:47:89 txqueuelen 0 (Ethernet) RX packets 224259 bytes 5821372018 (5.8 GB) RX errors 0 dropped 0 overruns 0 frame 0 @@ -270,7 +270,7 @@ Create entry for Second UE in docker-compose.yaml file as follows: privileged: true container_name: rfsim5g-oai-nr-ue2 environment: - RFSIMULATOR: 192.168.71.136 + RFSIMULATOR: 192.168.71.140 FULL_IMSI: '208990100001101' FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' OPC: 'C42449363BBAD02B66D16BC975D77CC1' @@ -282,7 +282,7 @@ Create entry for Second UE in docker-compose.yaml file as follows: - oai-gnb networks: public_net: - ipv4_address: 192.168.71.138 + ipv4_address: 192.168.71.151 healthcheck: test: /bin/bash -c "pgrep nr-uesoftmodem" interval: 10s @@ -326,7 +326,7 @@ Making sure the Second OAI UE is connected: $ docker exec -it rfsim5g-oai-nr-ue2 /bin/bash root@bb4d400a832d:/opt/oai-nr-ue# ifconfig eth0: flags=4163 mtu 1500 - inet 192.168.71.138 netmask 255.255.255.192 broadcast 192.168.71.191 + inet 192.168.71.151 netmask 255.255.255.192 broadcast 192.168.71.191 ether 02:42:c0:a8:47:8a txqueuelen 0 (Ethernet) RX packets 3192021 bytes 67784900946 (67.7 GB) RX errors 0 dropped 0 overruns 0 frame 0 From ed1c87b59816b3979146f5d33bd33f0f6d597a1f Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 14 Mar 2022 17:53:57 +0100 Subject: [PATCH 714/883] commit before rebase --- cmake_targets/phy_simulators | 1 - common/utils/lte/ue_power.c | 6 +- executables/nr-uesoftmodem.c | 9 +- .../PHY/NR_ESTIMATION/nr_measurements_gNB.c | 23 ++--- openair1/PHY/NR_TRANSPORT/nr_dci.c | 2 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 92 +++++++++++-------- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 9 +- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 8 +- openair1/PHY/TOOLS/dB_routines.h | 35 ------- openair1/PHY/TOOLS/tools_defs.h | 22 +++-- openair1/SCHED/sched_common_vars.h | 1 + openair1/SCHED_NR_UE/harq_nr.c | 64 ++++--------- openair2/LAYER2/MAC/config.c | 5 - openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 1 + .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 3 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 24 ++--- targets/RT/USER/lte-ue.c | 12 +-- 17 files changed, 125 insertions(+), 192 deletions(-) delete mode 120000 cmake_targets/phy_simulators delete mode 100644 openair1/PHY/TOOLS/dB_routines.h diff --git a/cmake_targets/phy_simulators b/cmake_targets/phy_simulators deleted file mode 120000 index 2a12e92f3e..0000000000 --- a/cmake_targets/phy_simulators +++ /dev/null @@ -1 +0,0 @@ -ran_build/ \ No newline at end of file diff --git a/common/utils/lte/ue_power.c b/common/utils/lte/ue_power.c index b377abf2ff..aaa2826275 100644 --- a/common/utils/lte/ue_power.c +++ b/common/utils/lte/ue_power.c @@ -33,10 +33,8 @@ #include #include #include "PHY/defs_eNB.h" -#include "PHY/TOOLS/dB_routines.h" - -extern int16_t hundred_times_delta_TF[100]; -extern uint16_t hundred_times_log10_NPRB[100]; +#include +#include int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, int ncp, uint8_t use_srs) { diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 76c21bb422..649b68631b 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -241,14 +241,17 @@ nrUE_params_t *get_nrUE_params(void) { } /* initialie thread pools used for NRUE processing paralleliation */ void init_tpools(uint8_t nun_dlsch_threads) { - char *params = NULL; - params = calloc(1,(NR_RX_NB_TH*NR_NB_TH_SLOT*3)+1); + char params[NR_RX_NB_TH*NR_NB_TH_SLOT*3+1]; for (int i=0; iframe_parms; NR_gNB_COMMON *common_vars = &gNB->common_vars; PHY_MEASUREMENTS_gNB *measurements = &gNB->measurements; - int rb, offset, offset0, nb_symb[275], len; - int32_t *ul_ch; - - LOG_D(PHY,"slot %d Doing I0 for first_symb %d, num_symb %d\n",slot,first_symb,num_symb); + int rb, nb_symb[275]={0}; + + memset(measurements->n0_subband_power, 0, sizeof(measurements->n0_subband_power)); + for (int s=first_symb;s<(first_symb+num_symb);s++) { for (rb=0; rbN_RB_UL; rb++) { - - if (s==first_symb) { - nb_symb[rb]=0; - for (int aarx=0; aarxnb_antennas_rx;aarx++) - measurements->n0_subband_power[aarx][rb]=0; - } - offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) + (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size; + int offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) + + (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size; if ((gNB->rb_mask_ul[s][rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe nb_symb[rb]++; for (int aarx=0; aarxnb_antennas_rx; aarx++) { - offset = offset0 + (s*frame_parms->ofdm_symbol_size); - ul_ch = &common_vars->rxdataF[aarx][offset]; - len = 12; + int offset = offset0 + (s*frame_parms->ofdm_symbol_size); + int32_t *ul_ch = &common_vars->rxdataF[aarx][offset]; + int len = 12; if (((frame_parms->N_RB_UL&1) == 1) && (rb==(frame_parms->N_RB_UL>>1))) { len=6; diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index 0af56ba706..ae96eb26bc 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -132,7 +132,7 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI, 1, NR_POLAR_DCI_MESSAGE_TYPE, dci_pdu->PayloadSizeBits, dci_pdu->AggregationLevel); -#ifdef DEBUG_CHANNEL_CODING +#if 1 printf("polar rnti %x,length %d, L %d\n",n_RNTI, dci_pdu->PayloadSizeBits,pdcch_pdu_rel15->dci_pdu->AggregationLevel); printf("DCI PDU: [0]->0x%lx \t [1]->0x%lx\n", ((uint64_t*)dci_pdu->Payload)[0], ((uint64_t*)dci_pdu->Payload)[1]); diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 50c3b62f50..17f145b98a 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -243,7 +243,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, * x(l*12+n) = r_u_v_alpha_delta(n) */ // the value of u,v (delta always 0 for PUCCH) has to be calculated according to TS 38.211 Subclause 6.3.2.2.1 - uint8_t u[2]={0,0},v[2]={0,0}; + uint8_t u[2]={0},v[2]={0}; // x_n contains the sequence r_u_v_alpha_delta(n) @@ -262,7 +262,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, AssertFatal(pucch_pdu->nr_of_symbols < 3,"nr_of_symbols %d not allowed\n",pucch_pdu->nr_of_symbols); - uint32_t re_offset[2]={0,0}; + uint32_t re_offset[2]={0}; uint8_t l2; const int16_t *x_re[2],*x_im[2]; @@ -271,16 +271,11 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, x_re[1] = table_5_2_2_2_2_Re[u[1]]; x_im[1] = table_5_2_2_2_2_Im[u[1]]; - int16_t xr[1+frame_parms->nb_antennas_rx][1+pucch_pdu->nr_of_symbols][24] __attribute__((aligned(32))); + c64_t xr[frame_parms->nb_antennas_rx][pucch_pdu->nr_of_symbols][12] __attribute__((aligned(32))); + memset(xr, 0, sizeof(xr)); int64_t xrtmag=0,xrtmag_next=0; uint8_t maxpos=0; uint8_t index=0; - for (int l=0; lnr_of_symbols; l++) { - for (int aarx=0;aarxnb_antennas_rx;aarx++) { - memset((void*)xr[aarx][l],0,24*sizeof(int16_t)); - } - } - int n2; for (int l=0; lnr_of_symbols; l++) { l2 = l+pucch_pdu->start_symbol_index; @@ -289,23 +284,23 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, re_offset[l]-=frame_parms->ofdm_symbol_size; AssertFatal(re_offset[l]+12 < frame_parms->ofdm_symbol_size,"pucch straddles DC carrier, handle this!\n"); - int16_t *r; for (int aa=0;aanb_antennas_rx;aa++) { - r=(int16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]]; - n2=0; - for (n=0;n<12;n++,n2+=2) { - xr[aa][l][n2] +=(int16_t)(((int32_t)x_re[l][n]*r[n2]+(int32_t)x_im[l][n]*r[n2+1])>>15); - xr[aa][l][n2+1]+=(int16_t)(((int32_t)x_re[l][n]*r[n2+1]-(int32_t)x_im[l][n]*r[n2])>>15); + c16_t *r=(c16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]]; + for (n=0;n<12;n++) { + xr[aa][l][n].r +=(int32_t)x_re[l][n]*r[n].r+(int32_t)x_im[l][n]*r[n].i; + xr[aa][l][n].i +=(int32_t)x_re[l][n]*r[n].i-(int32_t)x_im[l][n]*r[n].r; #ifdef DEBUG_NR_PUCCH_RX - printf("x (%d,%d), r%d.%d (%d,%d), xr (%d,%d)\n", - x_re[l][n],x_im[l][n],l2,re_offset[l],r[n2],r[n2+1],xr[aa][l][n2],xr[aa][l][n2+1]); + printf("x (%d,%d), r%d.%d (%d,%d), xr (%lld,%lld)\n", + x_re[l][n],x_im[l][n],l2,re_offset[l],r[n].r,r[n].i,xr[aa][l][n].r,xr[aa][l][n].i); #endif } + xr[aa][l][n].r>>=15; + xr[aa][l][n].i>>=15; } } - int32_t corr_re[1+frame_parms->nb_antennas_rx][2]; - int32_t corr_im[1+frame_parms->nb_antennas_rx][2]; + int64_t corr_re[frame_parms->nb_antennas_rx][2]; + int64_t corr_im[frame_parms->nb_antennas_rx][2]; //int32_t no_corr = 0; int seq_index = 0; int64_t temp; @@ -322,19 +317,19 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, for (int aa=0;aanb_antennas_rx;aa++) { corr_re[aa][l]=0; corr_im[aa][l]=0; - - n2=0; - for (n=0;n<12;n++,n2+=2) { - corr_re[aa][l]+=(xr[aa][l][n2]*idft12_re[seq_index][n]+xr[aa][l][n2+1]*idft12_im[seq_index][n])>>15; - corr_im[aa][l]+=(xr[aa][l][n2]*idft12_im[seq_index][n]-xr[aa][l][n2+1]*idft12_re[seq_index][n])>>15; + for (n=0;n<12;n++) { + corr_re[aa][l]+=xr[aa][l][n].r*idft12_re[seq_index][n]+xr[aa][l][n].i*idft12_im[seq_index][n]; + corr_im[aa][l]+=xr[aa][l][n].r*idft12_im[seq_index][n]-xr[aa][l][n].i*idft12_re[seq_index][n]; } + corr_re[aa][l]>>=15; + corr_im[aa][l]>>=15; } } - LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%d,%d)=>%f\n", + LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%ld,%ld)=>%f\n", mcs[i],seq_index,corr_re[0][0],corr_im[0][0], 10*log10((double)corr_re[0][0]*corr_re[0][0] + (double)corr_im[0][0]*corr_im[0][0])); if (pucch_pdu->nr_of_symbols==2) - LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n", + LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%ld,%ld)=>%f\n", mcs[i],seq_index,corr_re[0][1],corr_im[0][1], 10*log10((double)corr_re[0][1]*corr_re[0][1] + (double)corr_im[0][1]*corr_im[0][1])); if (pucch_pdu->freq_hop_flag == 0) { @@ -392,7 +387,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_stats->pucch0_n01 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]; LOG_D(PHY,"n00[%d] = %d, n01[%d] = %d\n",prb_offset[0],uci_stats->pucch0_n00,prb_offset[1],uci_stats->pucch0_n01); // estimate CQI for MAC (from antenna port 0 only) - int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01; + int max_n0 = max(gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]], + gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]); int SNRtimes10,sigenergy=0; for (int aa=0;aanb_antennas_rx;aa++) sigenergy += signal_energy_nodc(&rxdataF[aa][soffset+ @@ -407,8 +403,16 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_stats->pucch0_thres = gNB->pucch0_thres; /* + (10*max_n0);*/ bool no_conf=false; if (nr_sequences>1) { - if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < uci_stats->pucch0_thres) + if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < gNB->pucch0_thres) { no_conf=true; + LOG_W(PHY,"%d.%d PUCCH bad confidence: %d threshold, %d, %d, %d\n", + frame, slot, + uci_stats->pucch0_thres, + SNRtimes10, + xrtmag_dBtimes10, + xrtmag_next_dBtimes10); + abort(); + } } gNB->bad_pucch += no_conf; // first bit of bitmap for sr presence and second bit for acknack presence @@ -422,7 +426,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (pucch_pdu->bit_len_harq==0) { uci_pdu->harq = NULL; uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); - uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0; + uci_pdu->sr->sr_confidence_level = no_conf; uci_stats->pucch0_sr_trials++; if (xrtmag_dBtimes10>(10*gNB->measurements.n0_power_tot_dB)) { uci_pdu->sr->sr_indication = 1; @@ -434,17 +438,19 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, else if (pucch_pdu->bit_len_harq==1) { uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); uci_pdu->harq->num_harq = 1; - uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; - uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); + uci_pdu->harq->harq_confidence_level = no_conf; + uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(sizeof *uci_pdu->harq->harq_list); uci_pdu->harq->harq_list[0].harq_value = !(index&0x01); - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad) xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", - frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ %s with confidence level %s xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n", + frame,slot,uci_pdu->harq->harq_list[0].harq_value==0?"ACK":"NACK", + uci_pdu->harq->harq_confidence_level==0?"good":"bad", + xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); - uci_pdu->sr->sr_indication = (index>1) ? 1 : 0; - uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0; + uci_pdu->sr->sr_indication = (index>1); + uci_pdu->sr->sr_confidence_level = no_conf; uci_stats->pucch0_positive_SR++; } uci_stats->pucch01_trials++; @@ -452,17 +458,23 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, else { uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); uci_pdu->harq->num_harq = 2; - uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0; - uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); + uci_pdu->harq->harq_confidence_level = no_conf; + uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2 * sizeof( *uci_pdu->harq->harq_list)); uci_pdu->harq->harq_list[1].harq_value = !(index&0x01); uci_pdu->harq->harq_list[0].harq_value = !((index>>1)&0x01); - LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d (0 pass, 1 fail) with confidence level %d (0 is good, 1 is bad), xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", - frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos); + LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values (%s, %s) with confidence level %s, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n", + frame,slot, + uci_pdu->harq->harq_list[1].harq_value == 0 ? "ACK" : "NACK", + uci_pdu->harq->harq_list[0].harq_value == 0 ? "ACK" : "NACK", + uci_pdu->harq->harq_confidence_level == 0 ? "good" : "bad", + xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0, + uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi, + SNRtimes10,gNB->ulsch_stats[0].sync_pos); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>3) ? 1 : 0; - uci_pdu->sr->sr_confidence_level = (no_conf) ? 1 : 0; + uci_pdu->sr->sr_confidence_level = no_conf; } } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 5e18f6cc6d..9f0e1bea71 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -817,6 +817,10 @@ void nr_pdcch_unscrambling(int16_t *z, if (((s >> (i % 32)) & 1) == 1) z2[i] = -z[i]; else z2[i]=z[i]; } + printf("Encoded Payload (length:%d dwords):\n", length>>5); + + for (int i=0; i>5; i++) + printf("[%d]->0x%08x \t", i, z2[i]); } @@ -868,6 +872,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, int L = rel15->L[j]; // Loop over possible DCI lengths + for (int k = 0; k < rel15->num_dci_options; k++) { // skip this candidate if we've already found one with the // same rnti and format at a different aggregation level @@ -902,8 +907,8 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L); n_rnti = rel15->rnti; - LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n", - proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length); + LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx )\n", + proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length, *(unsigned long long*)dci_estimation); if (crc == n_rnti) { LOG_D(PHY, "(%i.%i) Received dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx)\n", proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length,*(unsigned long long*)dci_estimation); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 54b7c34608..bf9cfaaa70 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -172,6 +172,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint memset(dlsch->harq_processes[i]->d[r],0,5*8448); else exit_flag=2; + } } else { exit_flag=1; @@ -299,17 +300,14 @@ void nr_processDLSegment(void* arg) { K_bits_F = Kr-harq_process->F; t_nrLDPC_time_stats procTime = {0}; - t_nrLDPC_time_stats* p_procTime = &procTime ; t_nrLDPC_procBuf **p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf; - int16_t w[5*8448]; - memset(w,0,(5*8448)*sizeof(short)); - start_meas(&rdata->ts_deinterleave); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN); + int16_t w[E]; nr_deinterleaving_ldpc(E, Qm, w, // [hna] w is e @@ -397,7 +395,7 @@ void nr_processDLSegment(void* arg) { (int8_t *)&pl[0], llrProcBuf, p_nrLDPC_procBuf[r], - p_procTime); + &procTime); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_OUT); // Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int diff --git a/openair1/PHY/TOOLS/dB_routines.h b/openair1/PHY/TOOLS/dB_routines.h deleted file mode 100644 index 185913cf5b..0000000000 --- a/openair1/PHY/TOOLS/dB_routines.h +++ /dev/null @@ -1,35 +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 - */ - -/* - * dB_routines.h - * - * Created on: Nov 12, 2013 - * Author: winckel - */ - -#ifndef DB_ROUTINES_H_ -#define DB_ROUTINES_H_ - -int16_t dB_fixed_times10(uint32_t x); -int16_t dB_fixed_x10(uint32_t x); - -#endif /* DB_ROUTINES_H_ */ diff --git a/openair1/PHY/TOOLS/tools_defs.h b/openair1/PHY/TOOLS/tools_defs.h index 966e93440e..13ce9d85c7 100644 --- a/openair1/PHY/TOOLS/tools_defs.h +++ b/openair1/PHY/TOOLS/tools_defs.h @@ -39,26 +39,30 @@ extern "C" { #define CEILIDIV(a,b) ((a+b-1)/b) #define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1)) -struct complexd { +typedef struct complexd { double r; double i; -}; +} cd_t; -struct complexf { +typedef struct complexf { float r; float i; -}; +} cf_t; -struct complex16 { +typedef struct complex16 { int16_t r; int16_t i; -}; +} c16_t; -struct complex32 { +typedef struct complex32 { int32_t r; int32_t i; -}; - +} c32_t; + +typedef struct complex64 { + int64_t r; + int64_t i; +} c64_t; //cmult_sv.h /*!\fn void multadd_real_vector_complex_scalar(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N) diff --git a/openair1/SCHED/sched_common_vars.h b/openair1/SCHED/sched_common_vars.h index 2cae2aa96f..8886e0d576 100644 --- a/openair1/SCHED/sched_common_vars.h +++ b/openair1/SCHED/sched_common_vars.h @@ -20,6 +20,7 @@ */ #include +#include // This is the formula from Section 5.1.1.1 in 36.213 100*10*log10((2^(MPR*Ks)-1)), where MPR is in the range [0,6] and Ks=1.25 diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c index 4afe5f41d3..6508e2568e 100644 --- a/openair1/SCHED_NR_UE/harq_nr.c +++ b/openair1/SCHED_NR_UE/harq_nr.c @@ -339,55 +339,23 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int dl_harq->first_rx = 1; } else{ - switch(rv){ - case 0: - dl_harq->round = 0; + LOG_D(PHY,"receive harq process: %p harqPid=%d, rv=%d, ndi=%d, rntiType=%d, DCIndi=%d\n", + dl_harq, harq_pid, rv, ndi, rnti_type, dl_harq->DCINdi); + AssertFatal(rv<4 && rv>=0, "invalid redondancy version %d\n", rv); + if (rv!=0 && dl_harq->ack == DL_NACK) + LOG_D(PHY,"New transmission on a harq pid (%d) never acknowledged\n", harq_pid); + if (rv==0 && ndi == dl_harq->DCINdi ) + LOG_D(PHY,"Missed previous DCI detections. redondancy version is new transmission, but ndi doesn't toogle\n"); + dl_harq->first_rx = (rv==0); + const int rounds[4]={0,3,1,2}; + dl_harq->round = rounds[rv]; dl_harq->status = ACTIVE; - dl_harq->first_rx = 1; - if (dl_harq->DCINdi == ndi) - LOG_E(PHY,"Warning! rv %d indicates new transmission but new ndi %d is the same as old ndi %d\n",rv,ndi,dl_harq->DCINdi); + if (rv!=0 && dl_harq->DCINdi != ndi ) + LOG_E(PHY,"Missed previous DCI detections. redondancy version (%d) is retransmission, but ndi toogle\n", rv); + if (rv!=0 && dl_harq->ack != DL_NACK) + LOG_E(PHY,"Missed previous DCI detections. redondancy version (%d) is retransmission, but status is not DL_NACK\n", rv); dl_harq->DCINdi = ndi; - break; - case 1: - dl_harq->round = 3; - dl_harq->status = ACTIVE; - dl_harq->first_rx = 0; - if (dl_harq->DCINdi != ndi) { - LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv); - dl_harq->first_rx = 1; - dl_harq->DCINdi = ndi; - } - else if (dl_harq->ack == 1) - dl_harq->status = SCH_IDLE; - break; - case 2: - dl_harq->round = 1; - dl_harq->status = ACTIVE; - dl_harq->first_rx = 0; - if (dl_harq->DCINdi != ndi) { - LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv); - dl_harq->first_rx = 1; - dl_harq->DCINdi = ndi; - } - else if (dl_harq->ack == 1) - dl_harq->status = SCH_IDLE; - break; - case 3: - dl_harq->round = 2; - dl_harq->status = ACTIVE; - dl_harq->first_rx = 0; - if (dl_harq->DCINdi != ndi) { - LOG_E(PHY,"Missed previous DCI detections. NDI toggled but rv %d does not correspond to first reception\n",rv); - dl_harq->first_rx = 1; - dl_harq->DCINdi = ndi; - } - else if (dl_harq->ack == 1) - dl_harq->status = SCH_IDLE; - break; - default: - AssertFatal(1==0,"Invalid value for rv %d\n",rv); - } - } - + //dl_harq->status = SCH_IDLE; + } } diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 209275acb3..d22485d23f 100644 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -58,11 +58,6 @@ extern int l2_init_eNB(void); extern void mac_top_init_eNB(void); extern void mac_init_cell_params(int Mod_idP,int CC_idP); - -int32_t **rxdata; -int32_t **txdata; - - typedef struct eutra_bandentry_s { int16_t band; uint32_t ul_min; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index c57736990c..0c339ee70a 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2092,6 +2092,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, pucch->is_common = current_harq->is_common; current_harq->active = false; current_harq->ack_received = false; + LOG_D(PHY,"%d.%d Sent %d ack on harq pid %d\n", frame, slot, current_harq->ack, dl_harq_pid); } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index cedc78097e..fad5643370 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -811,6 +811,7 @@ static void handle_dl_harq(module_id_t mod_id, stats->dlsch_errors++; LOG_D(NR_MAC, "retransmission error for UE %d (total %"PRIu64")\n", UE_id, stats->dlsch_errors); } else { + LOG_D(PHY,"NACK for: pid %d, ue %x\n",harq_pid, UE_id); add_tail_nr_list(&UE_info->UE_sched_ctrl[UE_id].retrans_dl_harq, harq_pid); harq->round++; } @@ -1442,7 +1443,7 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, DevAssert(harq->is_waiting); const int8_t pid = sched_ctrl->feedback_dl_harq.head; remove_front_nr_list(&sched_ctrl->feedback_dl_harq); - LOG_D(NR_MAC,"bit %d pid %d ack/nack %d\n",harq_bit,pid,harq_value); + LOG_D(NR_MAC,"%d.%d bit %d pid %d ack/nack %d\n",frame, slot, harq_bit,pid,harq_value); handle_dl_harq(mod_id, UE_id, pid, harq_value == 0 && harq_confidence == 0); if (harq_confidence == 1) UE_info->mac_stats[UE_id].pucch0_DTX++; } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index f7323010cb..99897f9060 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -78,13 +78,13 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) int sd = socket(server_address.sin_family, SOCK_DGRAM, 0); if (sd < 0) { - LOG_E(MAC, "Socket creation error standalone PNF\n"); + LOG_E(NR_MAC, "Socket creation error standalone PNF\n"); return; } if (inet_pton(server_address.sin_family, stub_eth_params.remote_addr, &server_address.sin_addr) <= 0) { - LOG_E(MAC, "Invalid standalone PNF Address\n"); + LOG_E(NR_MAC, "Invalid standalone PNF Address\n"); close(sd); return; } @@ -92,7 +92,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) // Using connect to use send() instead of sendto() if (connect(sd, (struct sockaddr *)&server_address, addr_len) < 0) { - LOG_E(MAC, "Connection to standalone PNF failed: %s\n", strerror(errno)); + LOG_E(NR_MAC, "Connection to standalone PNF failed: %s\n", strerror(errno)); close(sd); return; } @@ -118,7 +118,7 @@ void nrue_init_standalone_socket(int tx_port, int rx_port) if (bind(sd, (struct sockaddr *)&server_address, addr_len) < 0) { - LOG_E(MAC, "Connection to standalone PNF failed: %s\n", strerror(errno)); + LOG_E(NR_MAC, "Connection to standalone PNF failed: %s\n", strerror(errno)); close(sd); return; } @@ -603,10 +603,6 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n pdu_0_1->harq->num_harq = 1; pdu_0_1->harq->harq_confidence_level = 0; pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list)); - for (int k = 0; k < pdu_0_1->harq->num_harq; k++) - { - pdu_0_1->harq->harq_list[k].harq_value = 0; - } } } LOG_I(NR_MAC, "We have dequeued the previously filled uci_ind and updated the snf/slot to %d/%d.\n", @@ -986,7 +982,7 @@ void *nrue_standalone_pnf_task(void *context) if (sem_post(&sfn_slot_semaphore) != 0) { - LOG_E(MAC, "sem_post() error\n"); + LOG_E(NR_MAC, "sem_post() error\n"); abort(); } } @@ -1062,7 +1058,7 @@ void update_harq_status(module_id_t module_id, uint8_t harq_pid, uint8_t ack_nac } else { //shouldn't get here - LOG_E(MAC, "Trying to process acknack for an inactive harq process (%d)\n", harq_pid); + LOG_E(NR_MAC, "Trying to process acknack for an inactive harq process (%d)\n", harq_pid); } } @@ -1121,9 +1117,9 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ } else { // UL indication after reception of DCI or DL PDU if (dl_info && dl_info->dci_ind && dl_info->dci_ind->number_of_dcis) { - LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n"); + LOG_D(NR_MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n"); for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) { - LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); + LOG_D(NR_MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis); nr_scheduled_response_t scheduled_response; int8_t ret = handle_dci(dl_info->module_id, dl_info->cc_id, @@ -1137,7 +1133,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ /* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */ if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) { LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); - break; + continue; } dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format]; g_harq_pid = def_dci_pdu_rel15->harq_pid; @@ -1160,7 +1156,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ for (int i=0; irx_ind->number_pdus; ++i) { - LOG_D(MAC, "In %s sending DL indication to MAC. 1 PDU type %d of %d total number of PDUs \n", + LOG_D(NR_MAC, "In %s sending DL indication to MAC. 1 PDU type %d of %d total number of PDUs \n", __FUNCTION__, dl_info->rx_ind->rx_indication_body[i].pdu_type, dl_info->rx_ind->number_pdus); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 25da395b90..13a09db5a3 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -93,9 +93,6 @@ extern uint16_t sf_ahead; void ue_stub_rx_handler(unsigned int, char *); -int32_t **rxdata; -int32_t **txdata; - int timer_subframe = 0; int timer_frame = 0; SF_ticking *phy_stub_ticking = NULL; @@ -2498,23 +2495,18 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, AssertFatal( phy_vars_ue[CC_id] !=0, ""); frame_parms = &(phy_vars_ue[CC_id]->frame_parms); // replace RX signal buffers with mmaped HW versions - rxdata = (int32_t **)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t *) ); - txdata = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t *) ); - for (i=0; inb_antennas_rx; i++) { LOG_I(PHY, "Mapping UE CC_id %d, rx_ant %d, freq %lu on card %d, chain %d\n", CC_id, i, downlink_frequency[CC_id][i], phy_vars_ue[CC_id]->rf_map.card, (phy_vars_ue[CC_id]->rf_map.chain)+i ); free( phy_vars_ue[CC_id]->common_vars.rxdata[i] ); - rxdata[i] = (int32_t *)malloc16_clear( 307200*sizeof(int32_t) ); - phy_vars_ue[CC_id]->common_vars.rxdata[i] = rxdata[i]; // what about the "-N_TA_offset" ? // N_TA offset for TDD + phy_vars_ue[CC_id]->common_vars.rxdata[i] = malloc16_clear( 307200*sizeof(int32_t) ); // what about the "-N_TA_offset" ? // N_TA offset for TDD } for (i=0; inb_antennas_tx; i++) { LOG_I(PHY, "Mapping UE CC_id %d, tx_ant %d, freq %lu on card %d, chain %d\n", CC_id, i, downlink_frequency[CC_id][i], phy_vars_ue[CC_id]->rf_map.card, (phy_vars_ue[CC_id]->rf_map.chain)+i ); free( phy_vars_ue[CC_id]->common_vars.txdata[i] ); - txdata[i] = (int32_t *)malloc16_clear( 307200*sizeof(int32_t) ); - phy_vars_ue[CC_id]->common_vars.txdata[i] = txdata[i]; + phy_vars_ue[CC_id]->common_vars.txdata[i] = malloc16_clear( 307200*sizeof(int32_t) ); } // rxdata[x] points now to the same memory region as phy_vars_ue[CC_id]->common_vars.rxdata[x] From 42c16795454fdaaed2617ac32e4eada3ec71318f Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 15 Mar 2022 14:23:25 +0100 Subject: [PATCH 715/883] remove one global --- openair1/PHY/INIT/nr_init_ue.c | 2 -- openair1/PHY/NR_TRANSPORT/nr_dci.c | 3 +- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 28 +++++++++++-------- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 7 +++-- openair1/PHY/defs_nr_UE.h | 3 -- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 5 ++-- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 75315187d9..5a3c2569da 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -404,7 +404,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ue->pdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); - ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 ); ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) ); ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) ); @@ -574,7 +573,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr16); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar); - free_and_zero(ue->pdcch_vars[th_id][gNB_id]->e_rx); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext); free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index ae96eb26bc..9876dfca86 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -132,7 +132,8 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI, 1, NR_POLAR_DCI_MESSAGE_TYPE, dci_pdu->PayloadSizeBits, dci_pdu->AggregationLevel); -#if 1 +#ifdef DEBUG_CHANNEL_CODING +//debug dump dci printf("polar rnti %x,length %d, L %d\n",n_RNTI, dci_pdu->PayloadSizeBits,pdcch_pdu_rel15->dci_pdu->AggregationLevel); printf("DCI PDU: [0]->0x%lx \t [1]->0x%lx\n", ((uint64_t*)dci_pdu->Payload)[0], ((uint64_t*)dci_pdu->Payload)[1]); diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 9f0e1bea71..66422a9dfa 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -83,7 +83,7 @@ char nr_dci_format_string[8][30] = { //static const int16_t conjugate[8]__attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1}; -void nr_pdcch_demapping_deinterleaving(uint32_t *llr, +static void nr_pdcch_demapping_deinterleaving(uint32_t *llr, uint32_t *z, uint8_t coreset_time_dur, uint8_t start_symbol, @@ -685,7 +685,8 @@ void nr_pdcch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, - fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) { + fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, + int16_t e_rx[4*2*100*12] ) { uint32_t frame = proc->frame_rx; uint32_t slot = proc->nr_slot_rx; @@ -772,7 +773,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, LOG_D(PHY,"we enter nr_pdcch_demapping_deinterleaving(), number of candidates %d\n",rel15->number_of_candidates); nr_pdcch_demapping_deinterleaving((uint32_t *) pdcch_vars->llr, - (uint32_t *) pdcch_vars->e_rx, + (uint32_t *) e_rx, rel15->coreset.duration, rel15->coreset.StartSymbolIndex, n_rb, @@ -791,7 +792,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, -void nr_pdcch_unscrambling(int16_t *z, +void nr_pdcch_unscrambling(int16_t e_rx[4*2*100*12], uint16_t scrambling_RNTI, uint32_t length, uint16_t pdcch_DMRS_scrambling_id, @@ -814,13 +815,15 @@ void nr_pdcch_unscrambling(int16_t *z, reset = 0; } - if (((s >> (i % 32)) & 1) == 1) z2[i] = -z[i]; - else z2[i]=z[i]; + if (((s >> (i % 32)) & 1) == 1) + z2[i] = -e_rx[i]; + else + z2[i]=e_rx[i]; } - printf("Encoded Payload (length:%d dwords):\n", length>>5); + printf("Encoded Payload (length:%d dwords):\n", length); - for (int i=0; i>5; i++) - printf("[%d]->0x%08x \t", i, z2[i]); + for (int i=0; i0x%x \t", i, z2[i]); } @@ -855,7 +858,8 @@ static uint16_t nr_dci_false_detection(uint64_t *dci, return x; } -uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, +uint8_t nr_dci_decoding_procedure(int16_t e_rx[4*2*100*12], + PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, fapi_nr_dci_indication_t *dci_ind, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15) { @@ -891,10 +895,10 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); - nr_pdcch_unscrambling(&pdcch_vars->e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); + nr_pdcch_unscrambling(&e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); #ifdef DEBUG_DCI_DECODING - uint32_t *z = (uint32_t *) &pdcch_vars->e_rx[e_rx_cand_idx]; + uint32_t *z = (uint32_t *) &e_rx[e_rx_cand_idx]; for (int index_z = 0; index_z < L*6; index_z++){ for (int i=0; i<9; i++) { LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i])); 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 aac59a7da1..945eb5df0f 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1105,8 +1105,8 @@ uint32_t dlsch_decoding_emul(PHY_VARS_NR_UE *phy_vars_ue, int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, - fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15); - + fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15, + int16_t e_rx[4*2*100*12]); /*! \brief Extract PSS and SSS resource elements @param phy_vars_ue Pointer to UE variables @@ -1667,7 +1667,8 @@ uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms, #include -uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, +uint8_t nr_dci_decoding_procedure(int16_t e_rx[4*2*100*12], + PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, fapi_nr_dci_indication_t *dci_ind, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15); diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 04080e7215..3762107d5d 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -611,9 +611,6 @@ typedef struct { /// \brief \f$\overline{w}\f$ from 36-211. /// - first index: ? [0..48*N_RB_DL[ int16_t *wbar; - /// \brief PDCCH/DCI e-sequence (input to rate matching). - /// - first index: ? [0..96*N_RB_DL[ - int16_t *e_rx; /// Total number of PDU errors (diagnostic mode) uint32_t dci_errors; /// Total number of PDU received diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index ddddcd09e2..52fa0d4b2f 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -500,7 +500,8 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, start_meas(&ue->dlsch_rx_pdcch_stats); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN); - nr_rx_pdcch(ue, proc, rel15); + int16_t e_rx[4*2*100*12]={0}; + nr_rx_pdcch(ue, proc, rel15, e_rx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_OUT); @@ -511,7 +512,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id, n_ss); #endif - dci_cnt = nr_dci_decoding_procedure(ue, proc, dci_ind, rel15); + dci_cnt = nr_dci_decoding_procedure(e_rx, ue, proc, dci_ind, rel15); #ifdef NR_PDCCH_SCHED_DEBUG LOG_I(PHY,"<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%u\n",dci_cnt); From a7e7d05da340aa0aadb134a49773071e3e159c8e Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 16 Mar 2022 21:23:53 +0100 Subject: [PATCH 716/883] fix difficult to read code --- executables/nr-gnb.c | 1 + executables/nr-uesoftmodem.c | 10 +- .../PHY/LTE_ESTIMATION/lte_est_freq_offset.c | 18 +-- openair1/PHY/LTE_ESTIMATION/lte_sync_time.c | 22 +-- openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c | 2 +- .../LTE_TRANSPORT/transport_common_proto.h | 2 +- openair1/PHY/LTE_UE_TRANSPORT/get_pmi.c | 2 +- .../PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 10 -- openair1/PHY/NR_REFSIG/pss_nr.h | 6 - openair1/PHY/NR_REFSIG/ptrs_nr.c | 6 +- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 46 +++--- openair1/PHY/NR_TRANSPORT/nr_dlsch.h | 4 +- openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c | 12 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 3 +- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 6 +- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 12 +- .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 10 -- openair1/PHY/NR_UE_TRANSPORT/pss_nr.c | 75 ++++------ openair1/PHY/TOOLS/angle.c | 2 +- openair1/PHY/TOOLS/cadd_sv.c | 2 +- openair1/PHY/TOOLS/cadd_vv.c | 2 +- openair1/PHY/TOOLS/calibration_test.c | 10 +- openair1/PHY/TOOLS/nr_phy_scope.c | 2 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- .../unit_tests/src/frame_config_test.c | 2 +- .../NR_UE_PHY/unit_tests/src/harq_test.c | 2 +- .../NR_UE_PHY/unit_tests/src/pbch_test.c | 2 +- .../NR_UE_PHY/unit_tests/src/pss_test.c | 2 +- .../NR_UE_PHY/unit_tests/src/pss_util_test.c | 2 +- .../NR_UE_PHY/unit_tests/src/pss_util_test.h | 2 +- .../unit_tests/src/pucch_uci_generator_test.c | 2 +- .../NR_UE_PHY/unit_tests/src/pucch_uci_test.c | 2 +- .../NR_UE_PHY/unit_tests/src/srs_test.c | 2 +- .../NR_UE_PHY/unit_tests/src/sss_test.c | 2 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 15 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 128 +++++----------- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 3 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 6 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 79 ++++------ .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 137 ++++++------------ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 2 +- openair2/RRC/NR/rrc_gNB_NGAP.c | 6 +- openair3/NAS/NR_UE/nr_nas_msg_sim.c | 2 +- targets/ARCH/rfsimulator/apply_channelmod.c | 6 +- targets/ARCH/rfsimulator/rfsimulator.h | 4 +- targets/ARCH/rfsimulator/simulator.c | 8 +- targets/RT/USER/lte-ue.c | 2 +- 49 files changed, 258 insertions(+), 431 deletions(-) diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 4793ef4e95..b6c95de4ce 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -458,6 +458,7 @@ void init_gNB_Tpool(int inst) { for (int i=0; i < 2; i++) { notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->L1_tx_out,tx_func); processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx); + memset(msgDataTx,0, sizeof(processingData_L1tx_t)); init_DLSCH_struct(gNB, msgDataTx); memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t)); pushNotifiedFIFO(gNB->L1_tx_free,msgL1Tx); // to unblock the process in the beginning diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 649b68631b..82ba86ea63 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -241,16 +241,16 @@ nrUE_params_t *get_nrUE_params(void) { } /* initialie thread pools used for NRUE processing paralleliation */ void init_tpools(uint8_t nun_dlsch_threads) { - char params[NR_RX_NB_TH*NR_NB_TH_SLOT*3+1]; + char params[NR_RX_NB_TH*NR_NB_TH_SLOT*3+1]={0}; for (int i=0; iN_RB_DL/2 - 1)*12,dl_ch_shift); //omega = dot_product(dl_ch,dl_ch_prev,frame_parms->ofdm_symbol_size,15); - omega_cpx.r = ((struct complex16*) &omega)->r; - omega_cpx.i = ((struct complex16*) &omega)->i; + omega_cpx.r = ((c16_t*) &omega)->r; + omega_cpx.i = ((c16_t*) &omega)->i; dl_ch = (int16_t *)&dl_ch_estimates[aa][(((frame_parms->N_RB_DL/2) + 1)*12) + ch_offset]; @@ -155,8 +155,8 @@ int lte_est_freq_offset(int **dl_ch_estimates, // calculate omega = angle(conj(dl_ch)*dl_ch_prev)) omega = dot_product(dl_ch,dl_ch_prev,((frame_parms->N_RB_DL/2) - 1)*12,dl_ch_shift); - omega_cpx.r += ((struct complex16*) &omega)->r; - omega_cpx.i += ((struct complex16*) &omega)->i; + omega_cpx.r += ((c16_t*) &omega)->r; + omega_cpx.i += ((c16_t*) &omega)->i; // phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r); phase_offset += atan2((double)omega_cpx.i,(double)omega_cpx.r); @@ -195,7 +195,7 @@ int lte_mbsfn_est_freq_offset(int **dl_ch_estimates, { int ch_offset, omega, dl_ch_shift; - struct complex16 *omega_cpx; + c16_t *omega_cpx; double phase_offset; int freq_offset_est; unsigned char aa; @@ -234,7 +234,7 @@ int lte_mbsfn_est_freq_offset(int **dl_ch_estimates, // printf("Computing freq_offset\n"); omega = dot_product(dl_ch,dl_ch_prev,(frame_parms->N_RB_DL/2 - 1)*12,dl_ch_shift); //omega = dot_product(dl_ch,dl_ch_prev,frame_parms->ofdm_symbol_size,15); - omega_cpx = (struct complex16*) ω + omega_cpx = (c16_t*) ω // printf("omega (%d,%d)\n",omega_cpx->r,omega_cpx->i); @@ -247,8 +247,8 @@ int lte_mbsfn_est_freq_offset(int **dl_ch_estimates, // calculate omega = angle(conj(dl_ch)*dl_ch_prev)) omega = dot_product(dl_ch,dl_ch_prev,((frame_parms->N_RB_DL/2) - 1)*12,dl_ch_shift); - omega_cpx->r += ((struct complex16*) &omega)->r; - omega_cpx->i += ((struct complex16*) &omega)->i; + omega_cpx->r += ((c16_t*) &omega)->r; + omega_cpx->i += ((c16_t*) &omega)->i; // phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r); phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r); // printf("omega (%d,%d) -> %f\n",omega_cpx->r,omega_cpx->i,phase_offset); diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c index 1fbc8b7ef2..b21f526fcc 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c @@ -34,9 +34,9 @@ // Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs) #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" -static struct complex16 *primary_synch0_time __attribute__((aligned(32))); -static struct complex16 *primary_synch1_time __attribute__((aligned(32))); -static struct complex16 *primary_synch2_time __attribute__((aligned(32))); +static c16_t *primary_synch0_time __attribute__((aligned(32))); +static c16_t *primary_synch1_time __attribute__((aligned(32))); +static c16_t *primary_synch2_time __attribute__((aligned(32))); static void doIdft(int size, short *in, short *out) { switch (size) { @@ -67,7 +67,7 @@ static void doIdft(int size, short *in, short *out) { } } -static void copyPrimary( struct complex16 *out, struct complex16 *in, int ofdmSize) { +static void copyPrimary( c16_t *out, struct complex16 *in, int ofdmSize) { int k=ofdmSize-36; for (int i=0; i<72; i++) { @@ -83,20 +83,20 @@ static void copyPrimary( struct complex16 *out, struct complex16 *in, int ofdmSi } int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) { // LTE_UE_COMMON *common_vars - struct complex16 syncF_tmp[2048]__attribute__((aligned(32)))= {{0}}; + c16_t syncF_tmp[2048]__attribute__((aligned(32)))= {{0}}; int sz=frame_parms->ofdm_symbol_size*sizeof(*primary_synch0_time); - AssertFatal( NULL != (primary_synch0_time = (struct complex16 *)malloc16(sz)),""); + AssertFatal( NULL != (primary_synch0_time = (c16_t *)malloc16(sz)),""); bzero(primary_synch0_time,sz); - AssertFatal( NULL != (primary_synch1_time = (struct complex16 *)malloc16(sz)),""); + AssertFatal( NULL != (primary_synch1_time = (c16_t *)malloc16(sz)),""); bzero(primary_synch1_time,sz); - AssertFatal( NULL != (primary_synch2_time = (struct complex16 *)malloc16(sz)),""); + AssertFatal( NULL != (primary_synch2_time = (c16_t *)malloc16(sz)),""); bzero(primary_synch2_time,sz); // generate oversampled sync_time sequences - copyPrimary( syncF_tmp, (struct complex16 *) primary_synch0, frame_parms->ofdm_symbol_size); + copyPrimary( syncF_tmp, (c16_t *) primary_synch0, frame_parms->ofdm_symbol_size); doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch0_time); - copyPrimary( syncF_tmp, (struct complex16 *) primary_synch1, frame_parms->ofdm_symbol_size); + copyPrimary( syncF_tmp, (c16_t *) primary_synch1, frame_parms->ofdm_symbol_size); doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch1_time); - copyPrimary( syncF_tmp, (struct complex16 *) primary_synch2, frame_parms->ofdm_symbol_size); + copyPrimary( syncF_tmp, (c16_t *) primary_synch2, frame_parms->ofdm_symbol_size); doIdft(frame_parms->N_RB_DL, (short *)syncF_tmp,(short *)primary_synch2_time); if ( LOG_DUMPFLAG(DEBUG_LTEESTIM)){ diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c index c6b312cc61..de21b7f4e2 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c @@ -2237,7 +2237,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, int P1_SHIFT[13],P2_SHIFT[13]; int offset,nushiftmod3; - uint8_t get_pmi_temp; + int get_pmi_temp; MIMO_mode_t mimo_mode = -1; uint8_t mprime=0,Ns; diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h index af8e63c3ed..e6240a4e78 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h @@ -299,7 +299,7 @@ uint64_t pmi2hex_2Ar1(uint32_t pmi); uint64_t pmi2hex_2Ar2(uint32_t pmi); -uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb); +uint8_t get_pmi(int N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb); // DL power control functions double get_pa_dB(uint8_t pa); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/get_pmi.c b/openair1/PHY/LTE_UE_TRANSPORT/get_pmi.c index 7bbe8e8942..6ab2ad9fdd 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/get_pmi.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/get_pmi.c @@ -21,7 +21,7 @@ #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" -uint8_t get_pmi(uint8_t N_RB_DL, MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb) +uint8_t get_pmi(int N_RB_DL, MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb) { /* MIMO_mode_t mode = dlsch_harq->mimo_mode; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index c5d096ceb7..bdfe0b8d07 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -1550,16 +1550,6 @@ uint64_t cqi2hex(uint32_t cqi); uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs); - -/** \brief This routine extracts a single subband PMI from a bitmap coming from UCI or the pmi_extend function - @param N_RB_DL number of resource blocks - @param mimo_mode - @param pmi_alloc subband PMI bitmap - @param rb resource block for which to extract PMI - @returns subband PMI -*/ -uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb); - int get_nCCE_offset_l1(int *CCE_table, const unsigned char L, const int nCCE, diff --git a/openair1/PHY/NR_REFSIG/pss_nr.h b/openair1/PHY/NR_REFSIG/pss_nr.h index b32d48a2e9..c65ca3799d 100644 --- a/openair1/PHY/NR_REFSIG/pss_nr.h +++ b/openair1/PHY/NR_REFSIG/pss_nr.h @@ -113,12 +113,6 @@ EXTERN int16_t *primary_synchro_time_nr[NUMBER_PSS_SEQUENCE] #endif ; -EXTERN int64_t *pss_corr_ue[NUMBER_PSS_SEQUENCE] -#ifdef INIT_VARIABLES_PSS_NR_H -= { NULL, NULL, NULL} -#endif -; - /* profiling structure */ EXTERN time_stats_t generic_time[TIME_LAST]; diff --git a/openair1/PHY/NR_REFSIG/ptrs_nr.c b/openair1/PHY/NR_REFSIG/ptrs_nr.c index 40a6a56611..68134eb02d 100644 --- a/openair1/PHY/NR_REFSIG/ptrs_nr.c +++ b/openair1/PHY/NR_REFSIG/ptrs_nr.c @@ -268,8 +268,8 @@ void nr_ptrs_cpe_estimation(uint8_t K_ptrs, return; } uint16_t sc_per_symbol = (nb_rb + K_ptrs - 1)/K_ptrs; - struct complex16 ptrs_p[(1 + sc_per_symbol/4)*4]; - struct complex16 dmrs_comp_p[(1 + sc_per_symbol/4)*4]; + c16_t ptrs_p[(1 + sc_per_symbol/4)*4]; + c16_t dmrs_comp_p[(1 + sc_per_symbol/4)*4]; double abs = 0.0; double real = 0.0; double imag = 0.0; @@ -422,7 +422,7 @@ void get_slope_from_estimates(uint8_t start, uint8_t end, int16_t *est_p, double /* estimate from slope */ void ptrs_estimate_from_slope(int16_t *error_est, double *slope_p, uint8_t start, uint8_t end) { - struct complex16 *error=(struct complex16 *) error_est; + c16_t *error=(struct complex16 *) error_est; for(uint8_t i = 1; i< (end -start);i++) { error[start+i].r = error[start].r + (int16_t)(i * slope_p[0]);// real error[start+i].i = error[start].i + (int16_t)(i * slope_p[1]); //imag diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 876d6cc83a..e4fe9b8371 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -98,7 +98,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers; uint8_t Qm = rel15->qamModOrder[0]; uint32_t encoded_length = nb_re*Qm; - uint32_t scrambled_output[rel15->NrOfCodewords][(encoded_length>>5)+1]; int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16))); /* PTRS */ @@ -125,7 +124,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, start_meas(dlsch_encoding_stats); if (nr_dlsch_encoding(gNB, - harq->pdu, frame, slot, dlsch, frame_parms,output,tinput,tprep,tparity,toutput, + frame, slot, harq, frame_parms,output,tinput,tprep,tparity,toutput, dlsch_rate_matching_stats, dlsch_interleaving_stats, dlsch_segmentation_stats) == -1) @@ -148,46 +147,41 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, #endif /// scrambling - start_meas(dlsch_scrambling_stats); for (int q=0; qNrOfCodewords; q++) { - memset((void*)scrambled_output[q], 0, ((encoded_length>>5)+1)*sizeof(uint32_t)); + uint32_t scrambled_output[encoded_length]; + start_meas(dlsch_scrambling_stats); nr_pdsch_codeword_scrambling(output, encoded_length, q, rel15->dataScramblingId, rel15->rnti, - scrambled_output[q]); - } - - stop_meas(dlsch_scrambling_stats); + scrambled_output); + stop_meas(dlsch_scrambling_stats); + #ifdef DEBUG_DLSCH - printf("PDSCH scrambling:\n"); - for (int i=0; i>8; i++) { - for (int j=0; j<8; j++) - printf("0x%08x\t", scrambled_output[0][(i<<3)+j]); - printf("\n"); - } + printf("PDSCH scrambling:\n"); + for (int i=0; i>8; i++) { + for (int j=0; j<8; j++) + printf("0x%08x\t", scrambled_output[(i<<3)+j]); + printf("\n"); + } #endif - - /// Modulation start_meas(dlsch_modulation_stats); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 1); - for (int q=0; qNrOfCodewords; q++) - nr_modulation(scrambled_output[q], + nr_modulation(scrambled_output, encoded_length, Qm, mod_symbs[q]); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 0); stop_meas(dlsch_modulation_stats); #ifdef DEBUG_DLSCH - printf("PDSCH Modulation: Qm %d(%d)\n", Qm, nb_re); - for (int i=0; i>3; i++) { - for (int j=0; j<8; j++) { - printf("%d %d\t", mod_symbs[0][((i<<3)+j)<<1], mod_symbs[0][(((i<<3)+j)<<1)+1]); + printf("PDSCH Modulation: Qm %d(%d)\n", Qm, nb_re); + for (int i=0; i>3; i++) { + for (int j=0; j<8; j++) { + printf("%d %d\t", mod_symbs[0][((i<<3)+j)<<1], mod_symbs[0][(((i<<3)+j)<<1)+1]); + } + printf("\n"); } - printf("\n"); - } #endif + } start_meas(&gNB->dlsch_layer_mapping_stats); /// Layer mapping diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index 28676b49f2..daa4ed1723 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -78,9 +78,9 @@ int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type); NR_gNB_SCH_STATS_t *find_nr_dlsch_stats(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type); int nr_dlsch_encoding(PHY_VARS_gNB *gNB, - unsigned char *a,int frame, + int frame, uint8_t slot, - NR_gNB_DLSCH_t *dlsch, + NR_DL_gNB_HARQ_t *harq, NR_DL_FRAME_PARMS* frame_parms, unsigned char * output, time_stats_t *tinput, diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 229f59032e..bf33457aaa 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -286,10 +286,9 @@ void ldpc8blocks( void *p) { } int nr_dlsch_encoding(PHY_VARS_gNB *gNB, - unsigned char *a, int frame, uint8_t slot, - NR_gNB_DLSCH_t *dlsch, + NR_DL_gNB_HARQ_t *harq, NR_DL_FRAME_PARMS *frame_parms, unsigned char * output, time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput, @@ -298,13 +297,12 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, encoder_implemparams_t impp; impp.output=output; unsigned int crc=1; - NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15; - impp.Zc = &dlsch->harq_process.Z; + impp.Zc = &harq->Z; float Coderate = 0.0; VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN); uint32_t A = rel15->TBSize[0]<<3; - + unsigned char *a=harq->pdu; if ( rel15->rnti != SI_RNTI) trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], 0, WS_C_RNTI, rel15->rnti, frame, slot,0, 0); @@ -317,14 +315,14 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, stats=&gNB->dlsch_stats[i]; } - if (gNB->dlsch_stats[i].rnti == dlsch->rnti) { + if (gNB->dlsch_stats[i].rnti == rel15->rnti) { stats=&gNB->dlsch_stats[i]; break; } } if (stats) { - stats->rnti = dlsch->rnti; + stats->rnti = rel15->rnti; stats->total_bytes_tx += rel15->TBSize[0]; stats->current_RI = rel15->nrOfLayers; stats->current_Qm = rel15->qamModOrder[0]; diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 17f145b98a..eda53e1c84 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -405,13 +405,12 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (nr_sequences>1) { if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < gNB->pucch0_thres) { no_conf=true; - LOG_W(PHY,"%d.%d PUCCH bad confidence: %d threshold, %d, %d, %d\n", + LOG_D(PHY,"%d.%d PUCCH bad confidence: %d threshold, %d, %d, %d\n", frame, slot, uci_stats->pucch0_thres, SNRtimes10, xrtmag_dBtimes10, xrtmag_next_dBtimes10); - abort(); } } gNB->bad_pucch += no_conf; diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 66422a9dfa..5b0544bf21 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -820,10 +820,6 @@ void nr_pdcch_unscrambling(int16_t e_rx[4*2*100*12], else z2[i]=e_rx[i]; } - printf("Encoded Payload (length:%d dwords):\n", length); - - for (int i=0; i0x%x \t", i, z2[i]); } @@ -898,7 +894,7 @@ uint8_t nr_dci_decoding_procedure(int16_t e_rx[4*2*100*12], nr_pdcch_unscrambling(&e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); #ifdef DEBUG_DCI_DECODING - uint32_t *z = (uint32_t *) &e_rx[e_rx_cand_idx]; + uint32_t *z = (uint32_t *) &pdcch_vars->e_rx[e_rx_cand_idx]; for (int index_z = 0; index_z < L*6; index_z++){ for (int i=0; i<9; i++) { LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i])); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index bf9cfaaa70..6163a95e5c 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -168,8 +168,6 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint dlsch->harq_processes[i]->d[r] = (int16_t *)malloc16(5*8448*sizeof(int16_t)); if (dlsch->harq_processes[i]->c[r]) memset(dlsch->harq_processes[i]->c[r],0,1056); - if (dlsch->harq_processes[i]->d[r]) - memset(dlsch->harq_processes[i]->d[r],0,5*8448); else exit_flag=2; @@ -326,12 +324,12 @@ void nr_processDLSegment(void* arg) { harq_process->rvidx, harq_process->round); */ //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN); - + int16_t d[5*8448]; if (nr_rate_matching_ldpc_rx(Ilbrm, Tbslbrm, p_decoderParms->BG, p_decoderParms->Z, - harq_process->d[r], + d, w, harq_process->C, harq_process->rvidx, @@ -353,7 +351,7 @@ void nr_processDLSegment(void* arg) { LOG_D(PHY,"decoder input(segment %u) :",r); for (int i=0; id[r][i]); + LOG_D(PHY,"%d : %d\n",i,d[i]); LOG_D(PHY,"\n"); } @@ -379,9 +377,9 @@ void nr_processDLSegment(void* arg) { //set Filler bits memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t)); //Move coded bits before filler bits - memcpy((&z[0]+2*harq_process->Z),harq_process->d[r],(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); + memcpy((&z[0]+2*harq_process->Z),d,(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); //skip filler bits - memcpy((&z[0]+Kr),harq_process->d[r]+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); + memcpy((&z[0]+Kr),d+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); //Saturate coded bits before decoding into 8 bits values for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) { 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 945eb5df0f..ead5ec2da5 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1480,16 +1480,6 @@ uint64_t cqi2hex(uint32_t cqi); uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs); - -/** \brief This routine extracts a single subband PMI from a bitmap coming from UCI or the pmi_extend function - @param N_RB_DL number of resource blocks - @param mimo_mode - @param pmi_alloc subband PMI bitmap - @param rb resource block for which to extract PMI - @returns subband PMI -*/ -uint8_t get_pmi(uint8_t N_RB_DL,MIMO_mode_t mode, uint32_t pmi_alloc,uint16_t rb); - int get_nCCE_offset_l1(int *CCE_table, const unsigned char L, const int nCCE, diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c index 54712cb64e..13ed436273 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c @@ -381,7 +381,6 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue) int sizePss = LENGTH_PSS_NR * IQ_SIZE; /* complex value i & q signed 16 bits */ int size = ofdm_symbol_size * IQ_SIZE; /* i and q samples signed 16 bits */ int16_t *p = NULL; - int64_t *q = NULL; AssertFatal(ofdm_symbol_size > 127, "illegal ofdm_symbol_size %d\n",ofdm_symbol_size); for (int i = 0; i < NUMBER_PSS_SEQUENCE; i++) { @@ -410,17 +409,6 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue) assert(0); } - size = sizeof(int64_t)*(frame_parms_ue->samples_per_frame + (2*ofdm_symbol_size)); - q = (int64_t*)malloc16(size); - if (q != NULL) { - pss_corr_ue[i] = q; - bzero( pss_corr_ue[i], size); - } - else { - LOG_E(PHY,"Fatal memory allocation problem \n"); - assert(0); - } - generate_pss_nr(frame_parms_ue,i); } } @@ -443,7 +431,6 @@ void free_context_pss_nr(void) free_and_zero(primary_synchro_nr[i]); free_and_zero(primary_synchro_nr2[i]); free_and_zero(primary_synchro_time_nr[i]); - free_and_zero(pss_corr_ue[i]); } } @@ -801,7 +788,6 @@ static inline double angle64(int64_t x) *********************************************************************/ #define DOT_PRODUCT_SCALING_SHIFT (17) - int pss_search_time_nr(int **rxdata, ///rx data in time domain NR_DL_FRAME_PARMS *frame_parms, int fo_flag, @@ -812,7 +798,7 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain unsigned int n, ar, peak_position, pss_source; int64_t peak_value; int64_t result; - int64_t avg[NUMBER_PSS_SEQUENCE]; + int64_t avg[NUMBER_PSS_SEQUENCE]={0}; double ffo_est=0; // performing the correlation on a frame length plus one symbol for the first of the two frame @@ -823,9 +809,8 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain else length = frame_parms->samples_per_frame; - AssertFatal(length>0,"illegal length %d\n",length); - for (int i = 0; i < NUMBER_PSS_SEQUENCE; i++) AssertFatal(pss_corr_ue[i] != NULL,"pss_corr_ue[%d] not yet allocated! Exiting.\n", i); + AssertFatal(length>0,"illegal length %d\n",length); peak_value = 0; peak_position = 0; pss_source = 0; @@ -846,47 +831,41 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain /* Correlation computation is based on a a dot product which is realized thank to SIMS extensions */ for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) { - avg[pss_index]=0; - memset(pss_corr_ue[pss_index],0,length*sizeof(int64_t)); - } - for (n=0; n < length; n+=4) { // + for (n=0; n < length; n+=4) { // - for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) { + int64_t pss_corr_ue=0; + /* calculate dot product of primary_synchro_time_nr and rxdata[ar][n] + * (ar=0..nb_ant_rx) and store the sum in temp[n]; */ + for (ar=0; arnb_antennas_rx; ar++) { - if ( n < (length - frame_parms->ofdm_symbol_size)) { + /* perform correlation of rx data and pss sequence ie it is a dot product */ + result = dot_product64((short*)primary_synchro_time_nr[pss_index], + (short*)&(rxdata[ar][n+is*frame_parms->samples_per_frame]), + frame_parms->ofdm_symbol_size, + shift); + pss_corr_ue += abs64(result); + //((short*)pss_corr_ue[pss_index])[2*n] += ((short*) &result)[0]; /* real part */ + //((short*)pss_corr_ue[pss_index])[2*n+1] += ((short*) &result)[1]; /* imaginary part */ + //((short*)&synchro_out)[0] += ((int*) &result)[0]; /* real part */ + //((short*)&synchro_out)[1] += ((int*) &result)[1]; /* imaginary part */ - /* calculate dot product of primary_synchro_time_nr and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n]; */ - for (ar=0; arnb_antennas_rx; ar++) { - - /* perform correlation of rx data and pss sequence ie it is a dot product */ - result = dot_product64((short*)primary_synchro_time_nr[pss_index], - (short*)&(rxdata[ar][n+is*frame_parms->samples_per_frame]), - frame_parms->ofdm_symbol_size, - shift); - pss_corr_ue[pss_index][n] += abs64(result); - //((short*)pss_corr_ue[pss_index])[2*n] += ((short*) &result)[0]; /* real part */ - //((short*)pss_corr_ue[pss_index])[2*n+1] += ((short*) &result)[1]; /* imaginary part */ - //((short*)&synchro_out)[0] += ((int*) &result)[0]; /* real part */ - //((short*)&synchro_out)[1] += ((int*) &result)[1]; /* imaginary part */ - - } } - + /* calculate the absolute value of sync_corr[n] */ - avg[pss_index]+=pss_corr_ue[pss_index][n]; - if (pss_corr_ue[pss_index][n] > peak_value) { - peak_value = pss_corr_ue[pss_index][n]; + avg[pss_index]+=pss_corr_ue; + if (pss_corr_ue > peak_value) { + peak_value = pss_corr_ue; peak_position = n; pss_source = pss_index; - + #ifdef DEBUG_PSS_NR - printf("pss_index %d: n %6u peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[pss_index][n]); + printf("pss_index %d: n %6u peak_value %15llu\n", pss_index, n, (unsigned long long)pss_corr_ue[n]); #endif } } } - + if (fo_flag){ // fractional frequency offset computation according to Cross-correlation Synchronization Algorithm Using PSS @@ -922,7 +901,8 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain // computing absolute value of frequency offset *f_off = ffo_est*frame_parms->subcarrier_spacing; - for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) avg[pss_index]/=(length/4); + for (int pss_index = 0; pss_index < NUMBER_PSS_SEQUENCE; pss_index++) + avg[pss_index]/=(length/4); *eNB_id = pss_source; @@ -937,9 +917,6 @@ int pss_search_time_nr(int **rxdata, ///rx data in time domain static int debug_cnt = 0; if (debug_cnt == 0) { - LOG_M("pss_corr_ue0.m","pss_corr_ue0",pss_corr_ue[0],length,1,6); - LOG_M("pss_corr_ue1.m","pss_corr_ue1",pss_corr_ue[1],length,1,6); - LOG_M("pss_corr_ue2.m","pss_corr_ue2",pss_corr_ue[2],length,1,6); if (is) LOG_M("rxdata1.m","rxd0",rxdata[frame_parms->samples_per_frame],length,1,1); else diff --git a/openair1/PHY/TOOLS/angle.c b/openair1/PHY/TOOLS/angle.c index a06640d1cf..89ffc3cb60 100644 --- a/openair1/PHY/TOOLS/angle.c +++ b/openair1/PHY/TOOLS/angle.c @@ -29,7 +29,7 @@ #include "costable.h" #include "defs.h" -unsigned int angle(struct complex16 perror) +unsigned int angle(c16_t perror) { int a; diff --git a/openair1/PHY/TOOLS/cadd_sv.c b/openair1/PHY/TOOLS/cadd_sv.c index caa8d1cc04..56dcb71847 100644 --- a/openair1/PHY/TOOLS/cadd_sv.c +++ b/openair1/PHY/TOOLS/cadd_sv.c @@ -129,7 +129,7 @@ main () short output[256] __attribute__((aligned(16))); int i; - struct complex16 alpha; + c16_t alpha; Zero_Buffer(output,256*2); diff --git a/openair1/PHY/TOOLS/cadd_vv.c b/openair1/PHY/TOOLS/cadd_vv.c index 77346a97f7..08bf514cb3 100644 --- a/openair1/PHY/TOOLS/cadd_vv.c +++ b/openair1/PHY/TOOLS/cadd_vv.c @@ -278,7 +278,7 @@ main () short output[256] __attribute__((aligned(16))); int i; - struct complex16 alpha; + c16_t alpha; Zero_Buffer(output,256*2); diff --git a/openair1/PHY/TOOLS/calibration_test.c b/openair1/PHY/TOOLS/calibration_test.c index 5dced27060..650d5e420c 100644 --- a/openair1/PHY/TOOLS/calibration_test.c +++ b/openair1/PHY/TOOLS/calibration_test.c @@ -305,15 +305,15 @@ int main(int argc, char **argv) { openair0_device_load(&rfdevice,&openair0_cfg); - void ** samplesRx = (void **)malloc16(antennas* sizeof(struct complex16 *) ); - void ** samplesTx = (void **)malloc16(antennas* sizeof(struct complex16 *) ); + void ** samplesRx = (void **)malloc16(antennas* sizeof(c16_t *) ); + void ** samplesTx = (void **)malloc16(antennas* sizeof(c16_t *) ); int fd=open(getenv("rftestInputFile"),O_RDONLY); AssertFatal(fd>=0,"%s",strerror(errno)); for (int i=0; irbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32))); bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS); if (input_fd == NULL) { - nr_dlsch_encoding(gNB, test_input, frame, slot, dlsch, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + nr_dlsch_encoding(gNB, frame, slot, &dlsch->harq_process, frame_parms,output,NULL,NULL,NULL,NULL,NULL,NULL,NULL); } for (SNR = snr0; SNR < snr1; SNR += snr_step) { diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 151d51d726..b6dc3d8f11 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -551,7 +551,7 @@ int main(int argc, char **argv) if (n_trials==1) printf("txlev %d (%f dB), offset %d, sigma2 %f ( %f dB)\n",txlev,10*log10(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size,sigma2,sigma2_dB); - struct complex16 **rxdataF = (struct complex16 **)gNB->common_vars.rxdataF; + c16_t **rxdataF = (struct complex16 **)gNB->common_vars.rxdataF; for (int symb=0; symbframe_parms.symbols_per_slot;symb++) { if (symb= startingSymbolIndex+nrofSymbols) { int i0 = symb*gNB->frame_parms.ofdm_symbol_size; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/frame_config_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/frame_config_test.c index c88c261667..093bb2d000 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/frame_config_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/frame_config_test.c @@ -285,7 +285,7 @@ int main(int argc, char *argv[]) uint8_t nb_antennas_tx = 1; uint8_t nb_antennas_rx = 1; uint8_t frame_type = FDD; - uint8_t N_RB_DL=100; + int N_RB_DL=100; lte_prefix_type_t extended_prefix_flag = NORMAL; int Nid_cell[] = {(3*0+0)}; VOID_PARAMETER argc; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/harq_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/harq_test.c index 05170e0bc9..96d7382f2b 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/harq_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/harq_test.c @@ -200,7 +200,7 @@ int main(int argc, char *argv[]) uint8_t nb_antennas_tx = 1; uint8_t nb_antennas_rx = 1; uint8_t frame_type = FDD; - uint8_t N_RB_DL=100; + int N_RB_DL=100; lte_prefix_type_t extended_prefix_flag = NORMAL; int Nid_cell[] = {(3*0+0)}; VOID_PARAMETER argc; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pbch_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pbch_test.c index 7600dfb08f..5c7f3157e7 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pbch_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pbch_test.c @@ -379,7 +379,7 @@ int main(int argc, char *argv[]) uint8_t nb_antennas_tx = 1; uint8_t nb_antennas_rx = 1; uint8_t frame_type = FDD; - uint8_t N_RB_DL=100; + int N_RB_DL=100; lte_prefix_type_t extended_prefix_flag = NORMAL; int decoded_pbch = -1; int Nid1, Nid2; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_test.c index 2088d558cb..de1249457f 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_test.c @@ -184,7 +184,7 @@ int main(int argc, char *argv[]) uint8_t nb_antennas_rx = 1; uint16_t Nid_cell=123; uint8_t frame_type=FDD; - uint8_t N_RB_DL=100; + int N_RB_DL=100; lte_prefix_type_t extended_prefix_flag=NORMAL; const char *name_test = "PSS NR"; test_t test = { name_test, 0, 0, 0, 0}; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c index 4334bd12f9..2302c50ab1 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c @@ -206,7 +206,7 @@ void undefined_function(const char *function) { *********************************************************************/ int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission_mode, - unsigned char extended_prefix_flag, uint8_t frame_type, uint16_t Nid_cell, uint8_t N_RB_DL) { + unsigned char extended_prefix_flag, uint8_t frame_type, uint16_t Nid_cell, int N_RB_DL) { (void) transmission_mode; NR_DL_FRAME_PARMS *frame_parms; int log_level = OAILOG_TRACE; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.h b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.h index f0929e88c0..78efc2234b 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.h +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.h @@ -90,7 +90,7 @@ int set_pss_in_rx_buffer(PHY_VARS_NR_UE *PHY_vars_UE, int position_symbol, int p int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission_mode, unsigned char extended_prefix_flag, uint8_t frame_type, uint16_t Nid_cell, - uint8_t N_RB_DL); + int N_RB_DL); void display_test_configuration_pss(int position, int pss_sequence_number); diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_generator_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_generator_test.c index 68acea6d98..4948d0a876 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_generator_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_generator_test.c @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) { uint8_t nb_antennas_tx = 1; uint8_t nb_antennas_rx = 1; uint8_t frame_type = FDD; - uint8_t N_RB_DL=106; + int N_RB_DL=106; lte_prefix_type_t extended_prefix_flag = NORMAL; int Nid_cell[] = {(3*1+3)}; VOID_PARAMETER argc; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_test.c index f731edc20a..31fe15a6de 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pucch_uci_test.c @@ -1239,7 +1239,7 @@ int main(int argc, char *argv[]) uint8_t nb_antennas_tx = 1; uint8_t nb_antennas_rx = 1; uint8_t frame_type = FDD; - uint8_t N_RB_DL=100; + int N_RB_DL=100; lte_prefix_type_t extended_prefix_flag = NORMAL; int Nid_cell[] = {(3*1+3)}; VOID_PARAMETER argc; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c index 34ea68bc61..235387acf7 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/srs_test.c @@ -442,7 +442,7 @@ int main(int argc, char *argv[]) uint8_t nb_antennas_tx = 1; uint8_t nb_antennas_rx = 1; uint8_t frame_type = FDD; - uint8_t N_RB_DL=100; + int N_RB_DL=100; lte_prefix_type_t extended_prefix_flag = NORMAL; int Nid_cell[] = {(3*0+0)}; VOID_PARAMETER argc; diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/sss_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/sss_test.c index 34127b604f..6f6594861a 100644 --- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/sss_test.c +++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/sss_test.c @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) uint8_t nb_antennas_tx = 1; uint8_t nb_antennas_rx = 1; uint8_t frame_type = FDD; - uint8_t N_RB_DL=100; + int N_RB_DL=100; lte_prefix_type_t extended_prefix_flag = NORMAL; int phase; int Nid1, Nid2; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index ba3128923f..f084cb2d63 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -109,8 +109,7 @@ typedef struct { uint8_t LCID: 6; // octet 1 [5:0] uint8_t F: 1; // octet 1 [6] uint8_t R: 1; // octet 1 [7] - uint8_t L1: 8; // octet 2 [7:0] - uint8_t L2: 8; // octet 3 [7:0] + uint16_t L: 16; // octet 2 [7:0] } __attribute__ ((__packed__)) NR_MAC_SUBHEADER_LONG; typedef struct { @@ -118,6 +117,18 @@ typedef struct { uint8_t R: 2; // octet 1 [7:6] } __attribute__ ((__packed__)) NR_MAC_SUBHEADER_FIXED; +static inline void getMacLen(uint8_t* pdu, uint16_t *mac_ce_len, uint16_t *mac_subheader_len) { + NR_MAC_SUBHEADER_SHORT *s=(NR_MAC_SUBHEADER_SHORT*) pdu; + NR_MAC_SUBHEADER_LONG *l=(NR_MAC_SUBHEADER_LONG*) pdu; + if (s->F) { + *mac_subheader_len=sizeof(*l); + *mac_ce_len=ntohs(l->L); + } else { + *mac_subheader_len=sizeof(*s); + *mac_ce_len=s->L; + } +} + // BSR MAC CEs // TS 38.321 ch. 6.1.3.1 // Short BSR for a specific logical channel group ID diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 0c339ee70a..05313f388a 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3326,10 +3326,6 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){ - uint8_t rx_lcid; - uint16_t mac_ce_len; - uint16_t mac_subheader_len; - uint16_t mac_sdu_len; module_id_t module_idP = dl_info->module_id; frame_t frameP = dl_info->frame; int slot = dl_info->slot; @@ -3348,10 +3344,9 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, LOG_D(MAC, "In %s [%d.%d]: processing PDU %d (with length %d) of %d total number of PDUs...\n", __FUNCTION__, frameP, slot, pdu_id, pdu_len, dl_info->rx_ind->number_pdus); while (!done && pdu_len > 0){ - mac_ce_len = 0x0000; - mac_subheader_len = 0x0001; // default to fixed-length subheader = 1-oct - mac_sdu_len = 0x0000; - rx_lcid = ((NR_MAC_SUBHEADER_FIXED *)pduP)->LCID; + uint16_t mac_len = 0x0000; + uint16_t mac_subheader_len = 0x0001; // default to fixed-length subheader = 1-oct + uint8_t rx_lcid = ((NR_MAC_SUBHEADER_FIXED *)pduP)->LCID; LOG_D(MAC, "[UE] LCID %d, PDU length %d\n", rx_lcid, pdu_len); switch(rx_lcid){ @@ -3359,128 +3354,89 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, case DL_SCH_LCID_CCCH: // MSG4 RRC Setup 38.331 // variable length - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) - | ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff); - mac_subheader_len = 3; - } else { - mac_sdu_len = ((NR_MAC_SUBHEADER_SHORT *) pduP)->L; - mac_subheader_len = 2; - } - - AssertFatal(pdu_len > mac_sdu_len, "The mac_sdu_len (%d) has an invalid size. PDU len = %d! \n", - mac_sdu_len, pdu_len); + getMacLen(pduP, &mac_len, &mac_subheader_len); + AssertFatal(pdu_len > mac_len, "The mac_len (%d) has an invalid size. PDU len = %d! \n", + mac_len, pdu_len); // Check if it is a valid CCCH message, we get all 00's messages very often int i = 0; - for(i=0; i<(mac_subheader_len+mac_sdu_len); i++) { + for(i=0; i<(mac_subheader_len+mac_len); i++) { if(pduP[i] != 0) { break; } } - if (i == (mac_subheader_len+mac_sdu_len)) { + if (i == (mac_subheader_len+mac_len)) { LOG_D(NR_MAC, "%s() Invalid CCCH message!, pdu_len: %d\n", __func__, pdu_len); done = 1; break; } - if ( mac_sdu_len > 0 ) { - LOG_D(NR_MAC,"DL_SCH_LCID_CCCH (e.g. RRCSetup) with payload len %d\n", mac_sdu_len); + if ( mac_len > 0 ) { + LOG_D(NR_MAC,"DL_SCH_LCID_CCCH (e.g. RRCSetup) with payload len %d\n", mac_len); for (int i = 0; i < mac_subheader_len; i++) { LOG_D(NR_MAC, "MAC header %d: 0x%x\n", i, pduP[i]); } - for (int i = 0; i < mac_sdu_len; i++) { + for (int i = 0; i < mac_len; i++) { LOG_D(NR_MAC, "%d: 0x%x\n", i, pduP[mac_subheader_len + i]); } - nr_mac_rrc_data_ind_ue(module_idP, CC_id, gNB_index, frameP, 0, mac->crnti, CCCH, pduP+mac_subheader_len, mac_sdu_len); + nr_mac_rrc_data_ind_ue(module_idP, CC_id, gNB_index, frameP, 0, mac->crnti, CCCH, pduP+mac_subheader_len, mac_len); } break; case DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH: + case DL_SCH_LCID_APERIODIC_CSI_TRI_STATE_SUBSEL: + case DL_SCH_LCID_SP_CSI_RS_CSI_IM_RES_SET_ACT: + case DL_SCH_LCID_SP_SRS_ACTIVATION: // 38.321 Ch6.1.3.14 // varialbe length - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - } - break; - case DL_SCH_LCID_APERIODIC_CSI_TRI_STATE_SUBSEL: - // 38.321 Ch6.1.3.13 - // varialbe length - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - } - break; - case DL_SCH_LCID_SP_CSI_RS_CSI_IM_RES_SET_ACT: - // 38.321 Ch6.1.3.12 - // varialbe length - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - } - break; - case DL_SCH_LCID_SP_SRS_ACTIVATION: - // 38.321 Ch6.1.3.17 - // varialbe length - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - } + getMacLen(pduP, &mac_len, &mac_subheader_len); break; + case DL_SCH_LCID_RECOMMENDED_BITRATE: // 38.321 Ch6.1.3.20 - mac_ce_len = 2; + mac_len = 2; break; case DL_SCH_LCID_SP_ZP_CSI_RS_RES_SET_ACT: // 38.321 Ch6.1.3.19 - mac_ce_len = 2; + mac_len = 2; break; case DL_SCH_LCID_PUCCH_SPATIAL_RELATION_ACT: // 38.321 Ch6.1.3.18 - mac_ce_len = 3; + mac_len = 3; break; case DL_SCH_LCID_SP_CSI_REP_PUCCH_ACT: // 38.321 Ch6.1.3.16 - mac_ce_len = 2; + mac_len = 2; break; case DL_SCH_LCID_TCI_STATE_IND_UE_SPEC_PDCCH: // 38.321 Ch6.1.3.15 - mac_ce_len = 2; + mac_len = 2; break; case DL_SCH_LCID_DUPLICATION_ACT: // 38.321 Ch6.1.3.11 - mac_ce_len = 1; + mac_len = 1; break; case DL_SCH_LCID_SCell_ACT_4_OCT: // 38.321 Ch6.1.3.10 - mac_ce_len = 4; + mac_len = 4; break; case DL_SCH_LCID_SCell_ACT_1_OCT: // 38.321 Ch6.1.3.10 - mac_ce_len = 1; + mac_len = 1; break; case DL_SCH_LCID_L_DRX: // 38.321 Ch6.1.3.6 // fixed length but not yet specify. - mac_ce_len = 0; + mac_len = 0; break; case DL_SCH_LCID_DRX: // 38.321 Ch6.1.3.5 // fixed length but not yet specify. - mac_ce_len = 0; + mac_len = 0; break; case DL_SCH_LCID_TA_COMMAND: // 38.321 Ch6.1.3.4 - mac_ce_len = 1; + mac_len = 1; /*uint8_t ta_command = ((NR_MAC_CE_TA *)pduP)[1].TA_COMMAND; uint8_t tag_id = ((NR_MAC_CE_TA *)pduP)[1].TAGID;*/ @@ -3502,14 +3458,14 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, // Clause 5.1.5 and 6.1.3.3 of 3GPP TS 38.321 version 16.2.1 Release 16 // MAC Header: 1 byte (R/R/LCID) // MAC SDU: 6 bytes (UE Contention Resolution Identity) - mac_ce_len = 6; + mac_len = 6; if(ra->ra_state == WAIT_CONTENTION_RESOLUTION) { LOG_I(MAC, "[UE %d][RAPROC] Frame %d : received contention resolution identity: 0x%02x%02x%02x%02x%02x%02x Terminating RA procedure\n", module_idP, frameP, pduP[1], pduP[2], pduP[3], pduP[4], pduP[5], pduP[6]); bool ra_success = true; - for(int i = 0; icont_res_id[i] != pduP[i+1]) { ra_success = false; break; @@ -3540,22 +3496,8 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, // check if LCID is valid at current time. if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) return; - NR_MAC_SUBHEADER_SHORT *shs = (NR_MAC_SUBHEADER_SHORT *)pduP; - if (shs->F) { - //mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) - return; - NR_MAC_SUBHEADER_LONG *shl = (NR_MAC_SUBHEADER_LONG *)pduP; - mac_sdu_len = ((uint16_t)(shl->L1 & 0x7f) << 8) | (uint16_t)(shl->L2 & 0xff); - } else { - if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) - return; - mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - } - - LOG_D(NR_MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len); + getMacLen(pduP, &mac_len, &mac_subheader_len); + LOG_D(NR_MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_len); #if defined(ENABLE_MAC_PAYLOAD_DEBUG) LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP); @@ -3576,7 +3518,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, MBMS_FLAG_NO, rx_lcid, (char *) (pduP + mac_subheader_len), - mac_sdu_len, + mac_len, 1, NULL); } else { @@ -3587,8 +3529,8 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, break; } } - pduP += ( mac_subheader_len + mac_ce_len + mac_sdu_len ); - pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len ); + pduP += ( mac_subheader_len + mac_len ); + pdu_len -= ( mac_subheader_len + mac_len ); if (pdu_len < 0) LOG_E(MAC, "[UE %d][%d.%d] nr_ue_process_mac_pdu, residual mac pdu length %d < 0!\n", module_idP, frameP, slot, pdu_len); } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index bc9895ac2e..05c57d19ea 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -3118,8 +3118,7 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP, header->R = 0; header->F = 1; header->LCID = lcid; - header->L1 = ((unsigned short) sdu_length >> 8) & 0x7f; - header->L2 = (unsigned short) sdu_length & 0xff; + header->L = htons(sdu_length); #ifdef ENABLE_MAC_PAYLOAD_DEBUG LOG_I(NR_MAC, "In %s: dumping MAC sub-header with length %d: \n", __FUNCTION__, sh_size); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index f36dbc4a16..2263f4656b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1619,7 +1619,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra harq->feedback_slot = pucch->ul_slot; harq->feedback_frame = pucch->frame; - uint8_t *buf = (uint8_t *) harq->tb; + uint8_t *buf = (uint8_t *) harq->transportBlock; // Bytes to be transmitted if (harq->round == 0) { if (ra->msg3_dcch_dtch) { @@ -1866,11 +1866,11 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra } T(T_GNB_MAC_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(ra->rnti), - T_INT(frameP), T_INT(slotP), T_INT(current_harq_pid), T_BUFFER(harq->tb, harq->tb_size)); + T_INT(frameP), T_INT(slotP), T_INT(current_harq_pid), T_BUFFER(harq->transportBlock, harq->tb_size)); // DL TX request nfapi_nr_pdu_t *tx_req = &nr_mac->TX_req[CC_id].pdu_list[nr_mac->TX_req[CC_id].Number_of_PDUs]; - memcpy(tx_req->TLVs[0].value.direct, harq->tb, sizeof(uint8_t) * harq->tb_size); + memcpy(tx_req->TLVs[0].value.direct, harq->transportBlock, sizeof(uint8_t) * harq->tb_size); tx_req->PDU_length = harq->tb_size; tx_req->PDU_index = pduindex; tx_req->num_TLV = 1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 5032ee601f..ccbd6d43f8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1320,12 +1320,12 @@ void nr_schedule_ue_spec(module_id_t module_id, current_harq_pid); T(T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti), - T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->tb, TBS)); + T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->transportBlock, TBS)); } else { /* initial transmission */ LOG_D(NR_MAC, "[%s] Initial HARQ transmission in %d.%d\n", __FUNCTION__, frame, slot); - uint8_t *buf = (uint8_t *) harq->tb; + uint8_t *buf = (uint8_t *) harq->transportBlock; /* first, write all CEs that might be there */ int written = nr_write_ce_dlsch_pdu(module_id, @@ -1334,8 +1334,8 @@ void nr_schedule_ue_spec(module_id_t module_id, 255, // no drx NULL); // contention res id buf += written; - int size = TBS - written; - DevAssert(size >= 0); + uint8_t* bufEnd = buf + TBS - written; + DevAssert(TBS > written); /* next, get RLC data */ @@ -1345,18 +1345,15 @@ void nr_schedule_ue_spec(module_id_t module_id, start_meas(&gNB_mac->rlc_data_req); if (sched_ctrl->num_total_bytes > 0) { tbs_size_t len = 0; - while (size > 3) { + while (bufEnd-buf > sizeof(NR_MAC_SUBHEADER_LONG) + 1 ) { // we do not know how much data we will get from RLC, i.e., whether it // will be longer than 256B or not. Therefore, reserve space for long header, then // fetch data, then fill real length NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; - buf += 3; - size -= 3; - /* limit requested number of bytes to what preprocessor specified, or * such that TBS is full */ - const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size); - + const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, + bufEnd-buf-+sizeof(NR_MAC_SUBHEADER_LONG)); len = mac_rlc_data_req(module_id, rnti, module_id, @@ -1365,12 +1362,12 @@ void nr_schedule_ue_spec(module_id_t module_id, MBMS_FLAG_NO, lcid, ndata, - (char *)buf, + (char *)buf+sizeof(NR_MAC_SUBHEADER_LONG), 0, 0); - + LOG_D(NR_MAC, - "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n", + "%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %ld)\n", frame, slot, rnti, @@ -1378,59 +1375,45 @@ void nr_schedule_ue_spec(module_id_t module_id, lcid < 4 ? "DCCH" : "DTCH", lcid, ndata, - size); + bufEnd-buf-+sizeof(NR_MAC_SUBHEADER_LONG)); if (len == 0) break; header->R = 0; header->F = 1; header->LCID = lcid; - header->L1 = (len >> 8) & 0xff; - header->L2 = len & 0xff; - size -= len; - buf += len; + header->L = htons(len); + buf += len+sizeof(NR_MAC_SUBHEADER_LONG); dlsch_total_bytes += len; } - if (len == 0) { - /* RLC did not have data anymore, mark buffer as unused */ - buf -= 3; - size += 3; - } } else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra || get_softmodem_params()->sa) { /* we will need the large header, phy-test typically allocates all * resources and fills to the last byte below */ - NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; - buf += 3; - size -= 3; - DevAssert(size > 0); - LOG_D(NR_MAC, "Configuring DL_TX in %d.%d: TBS %d with %d B of random data\n", frame, slot, TBS, size); - // fill dlsch_buffer with random data - for (int i = 0; i < size; i++) - buf[i] = lrand48() & 0xff; - header->R = 0; - header->F = 1; - header->LCID = DL_SCH_LCID_PADDING; - header->L1 = (size >> 8) & 0xff; - header->L2 = size & 0xff; - size -= size; - buf += size; - dlsch_total_bytes += size; + LOG_D(NR_MAC, "Configuring DL_TX in %d.%d: TBS %d of random data\n", frame, slot, TBS); + if (bufEnd-buf > sizeof(NR_MAC_SUBHEADER_LONG) ) { + NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf; + // fill dlsch_buffer with random data + header->R = 0; + header->F = 1; + header->LCID = DL_SCH_LCID_PADDING; + buf += sizeof(NR_MAC_SUBHEADER_LONG); + header->L = htons(bufEnd-buf); + dlsch_total_bytes += bufEnd-buf; + for (; buf < bufEnd; buf++) + *buf = lrand48() & 0xff; + } } stop_meas(&gNB_mac->rlc_data_req); // Add padding header and zero rest out if there is space left - if (size > 0) { + if (bufEnd-buf > 0) { NR_MAC_SUBHEADER_FIXED *padding = (NR_MAC_SUBHEADER_FIXED *) buf; padding->R = 0; padding->LCID = DL_SCH_LCID_PADDING; - size -= 1; buf += 1; - while (size > 0) { - *buf = 0; - buf += 1; - size -= 1; - } + memset(buf,0,bufEnd-buf); + buf=bufEnd; } UE_info->mac_stats[UE_id].dlsch_total_bytes += TBS; @@ -1455,7 +1438,7 @@ void nr_schedule_ue_spec(module_id_t module_id, } T(T_GNB_MAC_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti), - T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_BUFFER(harq->tb, TBS)); + T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_BUFFER(harq->transportBlock, TBS)); } const int ntx_req = gNB_mac->TX_req[CC_id].Number_of_PDUs; @@ -1464,7 +1447,7 @@ void nr_schedule_ue_spec(module_id_t module_id, tx_req->PDU_index = pduindex; tx_req->num_TLV = 1; tx_req->TLVs[0].length = TBS + 2; - memcpy(tx_req->TLVs[0].value.direct, harq->tb, TBS); + memcpy(tx_req->TLVs[0].value.direct, harq->transportBlock, TBS); gNB_mac->TX_req[CC_id].Number_of_PDUs++; gNB_mac->TX_req[CC_id].SFN = frame; gNB_mac->TX_req[CC_id].Slot = slot; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index aa49b14fe5..6c89d30800 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -205,11 +205,7 @@ int nr_process_mac_pdu(module_id_t module_idP, int pdu_len) { - uint8_t rx_lcid; uint8_t done = 0; - uint16_t mac_ce_len; - uint16_t mac_subheader_len; - uint16_t mac_sdu_len; NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; @@ -223,10 +219,9 @@ int nr_process_mac_pdu(module_id_t module_idP, #endif while (!done && pdu_len > 0){ - mac_ce_len = 0; - mac_subheader_len = sizeof(NR_MAC_SUBHEADER_FIXED); - mac_sdu_len = 0; - rx_lcid = ((NR_MAC_SUBHEADER_FIXED *)pduP)->LCID; + uint16_t mac_len=0; + uint16_t mac_subheader_len=sizeof(NR_MAC_SUBHEADER_FIXED); + uint8_t rx_lcid = ((NR_MAC_SUBHEADER_FIXED *)pduP)->LCID; LOG_D(NR_MAC, "In %s: received UL-SCH sub-PDU with LCID 0x%x in %d.%d (remaining PDU length %d)\n", __func__, rx_lcid, frameP, slot, pdu_len); @@ -241,7 +236,7 @@ int nr_process_mac_pdu(module_id_t module_idP, #endif*/ case UL_SCH_LCID_RECOMMENDED_BITRATE_QUERY: // 38.321 Ch6.1.3.20 - mac_ce_len = 2; + mac_len = 2; break; case UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION: // 38.321 Ch6.1.3.7 @@ -251,7 +246,7 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_S_TRUNCATED_BSR: //38.321 section 6.1.3.1 //fixed length - mac_ce_len =1; + mac_len =1; /* Extract short BSR value */ ce_ptr = &pduP[mac_subheader_len]; NR_BSR_SHORT *bsr_s = (NR_BSR_SHORT *) ce_ptr; @@ -269,25 +264,20 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_L_BSR: case UL_SCH_LCID_L_TRUNCATED_BSR: - //38.321 section 6.1.3.1 - //variable length - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - } - /* Extract long BSR value */ - ce_ptr = &pduP[mac_subheader_len]; - NR_BSR_LONG *bsr_l = (NR_BSR_LONG *) ce_ptr; - sched_ctrl->estimated_ul_buffer = 0; + //38.321 section 6.1.3.1 + //variable length + getMacLen(pduP, &mac_len, &mac_subheader_len); + /* Extract long BSR value */ + ce_ptr = &pduP[mac_subheader_len]; + NR_BSR_LONG *bsr_l = (NR_BSR_LONG *) ce_ptr; + sched_ctrl->estimated_ul_buffer = 0; + + n_Lcg = bsr_l->LcgID7 + bsr_l->LcgID6 + bsr_l->LcgID5 + bsr_l->LcgID4 + + bsr_l->LcgID3 + bsr_l->LcgID2 + bsr_l->LcgID1 + bsr_l->LcgID0; - n_Lcg = bsr_l->LcgID7 + bsr_l->LcgID6 + bsr_l->LcgID5 + bsr_l->LcgID4 + - bsr_l->LcgID3 + bsr_l->LcgID2 + bsr_l->LcgID1 + bsr_l->LcgID0; - - LOG_D(NR_MAC, "LONG BSR, LCG ID(7-0) %d/%d/%d/%d/%d/%d/%d/%d\n", - bsr_l->LcgID7, bsr_l->LcgID6, bsr_l->LcgID5, bsr_l->LcgID4, - bsr_l->LcgID3, bsr_l->LcgID2, bsr_l->LcgID1, bsr_l->LcgID0); + LOG_D(NR_MAC, "LONG BSR, LCG ID(7-0) %d/%d/%d/%d/%d/%d/%d/%d\n", + bsr_l->LcgID7, bsr_l->LcgID6, bsr_l->LcgID5, bsr_l->LcgID4, + bsr_l->LcgID3, bsr_l->LcgID2, bsr_l->LcgID1, bsr_l->LcgID0); for (int n = 0; n < n_Lcg; n++){ LOG_D(NR_MAC, "LONG BSR, %d/%d (n/n_Lcg), BS Index %d, BS value < %d", @@ -322,14 +312,14 @@ int nr_process_mac_pdu(module_id_t module_idP, //38.321 section 6.1.3.2 //fixed length - mac_ce_len = 2; + mac_len = 2; /* Extract CRNTI value */ break; case UL_SCH_LCID_SINGLE_ENTRY_PHR: //38.321 section 6.1.3.8 //fixed length - mac_ce_len = 2; + mac_len = 2; /* Extract SINGLE ENTRY PHR elements for PHR calculation */ ce_ptr = &pduP[mac_subheader_len]; NR_SINGLE_ENTRY_PHR_MAC_CE *phr = (NR_SINGLE_ENTRY_PHR_MAC_CE *) ce_ptr; @@ -348,26 +338,11 @@ int nr_process_mac_pdu(module_id_t module_idP, break; case UL_SCH_LCID_MULTI_ENTRY_PHR_1_OCT: - //38.321 section 6.1.3.9 - // varialbe length - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - } - /* Extract MULTI ENTRY PHR elements from single octet bitmap for PHR calculation */ - break; - case UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT: - //38.321 section 6.1.3.9 - // varialbe length - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - } + // varialbe length + getMacLen(pduP, &mac_len, &mac_subheader_len); + //Extract MULTI ENTRY PHR elements from single octet bitmap for PHR calculation */ + break; /* Extract MULTI ENTRY PHR elements from four octets bitmap for PHR calculation */ break; @@ -378,23 +353,14 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_SRB1: case UL_SCH_LCID_SRB2: - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - //mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) - | ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff); - } else { - mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - } - + getMacLen(pduP, &mac_len, &mac_subheader_len); rnti_t crnti = UE_info->rnti[UE_id]; int UE_idx = UE_id; for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) { NR_RA_t *ra = &RC.nrmac[module_idP]->common_channels[CC_id].ra[i]; if (ra->state >= WAIT_Msg3 && ra->rnti == UE_info->rnti[UE_id]) { - uint8_t *next_subpduP = pduP + mac_subheader_len + mac_sdu_len; - if ((pduP[mac_subheader_len+mac_sdu_len] & 0x3F) == UL_SCH_LCID_C_RNTI) { + uint8_t *next_subpduP = pduP + mac_subheader_len + mac_len; + if ((pduP[mac_subheader_len+mac_len] & 0x3F) == UL_SCH_LCID_C_RNTI) { crnti = ((next_subpduP[1]&0xFF)<<8)|(next_subpduP[2]&0xFF); UE_idx = find_nr_UE_id(module_idP, crnti); break; @@ -403,7 +369,7 @@ int nr_process_mac_pdu(module_id_t module_idP, } if (UE_info->CellGroup[UE_idx]) { - LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: 0x%04x \n", module_idP, frameP, rx_lcid, module_idP, mac_sdu_len, crnti); + LOG_D(NR_MAC, "[UE %d] Frame %d : ULSCH -> UL-DCCH %d (gNB %d, %d bytes), rnti: 0x%04x \n", module_idP, frameP, rx_lcid, module_idP, mac_len, crnti); mac_rlc_data_ind(module_idP, crnti, module_idP, @@ -412,7 +378,7 @@ int nr_process_mac_pdu(module_id_t module_idP, MBMS_FLAG_NO, rx_lcid, (char *) (pduP + mac_subheader_len), - mac_sdu_len, + mac_len, 1, NULL); } else { @@ -430,23 +396,23 @@ int nr_process_mac_pdu(module_id_t module_idP, if ( rx_lcid == UL_SCH_LCID_CCCH1 ) { // RRCResumeRequest1 message includes the full I-RNTI and has a size of 8 bytes - mac_sdu_len = 8; + mac_len = 8; // Check if it is a valid CCCH1 message, we get all 00's messages very often int i = 0; - for(i=0; i<(mac_subheader_len+mac_sdu_len); i++) { + for(i=0; i<(mac_subheader_len+mac_len); i++) { if(pduP[i] != 0) { break; } } - if (i == (mac_subheader_len+mac_sdu_len)) { + if (i == (mac_subheader_len+mac_len)) { LOG_D(NR_MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len); done = 1; break; } } else { // fixed length of 6 bytes - mac_sdu_len = 6; + mac_len = 6; } nr_mac_rrc_data_ind(module_idP, @@ -457,23 +423,12 @@ int nr_process_mac_pdu(module_id_t module_idP, UE_info->rnti[UE_id], CCCH, pduP + mac_subheader_len, - mac_sdu_len, + mac_len, 0); break; case UL_SCH_LCID_DTCH: - // check if LCID is valid at current time. - if (((NR_MAC_SUBHEADER_SHORT *)pduP)->F) { - // mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L1 & 0x7f) << 8) - | ((uint16_t)((NR_MAC_SUBHEADER_LONG *)pduP)->L2 & 0xff); - - } else { - mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - } - + getMacLen(pduP, &mac_len, &mac_subheader_len); LOG_D(NR_MAC, "In %s: [UE %d] %d.%d : ULSCH -> UL-%s %d (gNB %d, %d bytes)\n", __func__, module_idP, @@ -482,8 +437,8 @@ int nr_process_mac_pdu(module_id_t module_idP, rx_lcid<4?"DCCH":"DTCH", rx_lcid, module_idP, - mac_sdu_len); - UE_info->mac_stats[UE_id].lc_bytes_rx[rx_lcid] += mac_sdu_len; + mac_len); + UE_info->mac_stats[UE_id].lc_bytes_rx[rx_lcid] += mac_len; mac_rlc_data_ind(module_idP, UE_info->rnti[UE_id], @@ -493,13 +448,13 @@ int nr_process_mac_pdu(module_id_t module_idP, MBMS_FLAG_NO, rx_lcid, (char *)(pduP + mac_subheader_len), - mac_sdu_len, + mac_len, 1, NULL); /* Updated estimated buffer when receiving data */ - if (sched_ctrl->estimated_ul_buffer >= mac_sdu_len) - sched_ctrl->estimated_ul_buffer -= mac_sdu_len; + if (sched_ctrl->estimated_ul_buffer >= mac_len) + sched_ctrl->estimated_ul_buffer -= mac_len; else sched_ctrl->estimated_ul_buffer = 0; break; @@ -514,16 +469,16 @@ int nr_process_mac_pdu(module_id_t module_idP, if (rx_lcid < 45 || rx_lcid == 52 || rx_lcid == 63) { LOG_I(NR_MAC, "In %s: dumping UL MAC SDU sub-header with length %d (LCID = 0x%02x):\n", __func__, mac_subheader_len, rx_lcid); log_dump(NR_MAC, pduP, mac_subheader_len, LOG_DUMP_CHAR, "\n"); - LOG_I(NR_MAC, "In %s: dumping UL MAC SDU with length %d (LCID = 0x%02x):\n", __func__, mac_sdu_len, rx_lcid); - log_dump(NR_MAC, pduP + mac_subheader_len, mac_sdu_len, LOG_DUMP_CHAR, "\n"); + LOG_I(NR_MAC, "In %s: dumping UL MAC SDU with length %d (LCID = 0x%02x):\n", __func__, mac_len, rx_lcid); + log_dump(NR_MAC, pduP + mac_subheader_len, mac_len, LOG_DUMP_CHAR, "\n"); } else { - LOG_I(NR_MAC, "In %s: dumping UL MAC CE with length %d (LCID = 0x%02x):\n", __func__, mac_ce_len, rx_lcid); - log_dump(NR_MAC, pduP + mac_subheader_len + mac_sdu_len, mac_ce_len, LOG_DUMP_CHAR, "\n"); + LOG_I(NR_MAC, "In %s: dumping UL MAC CE with length %d (LCID = 0x%02x):\n", __func__, mac_len, rx_lcid); + log_dump(NR_MAC, pduP + mac_subheader_len + mac_len, mac_len, LOG_DUMP_CHAR, "\n"); } #endif - pduP += ( mac_subheader_len + mac_ce_len + mac_sdu_len ); - pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len ); + pduP += ( mac_subheader_len + mac_len ); + pdu_len -= ( mac_subheader_len + mac_len ); if (pdu_len < 0) { LOG_E(NR_MAC, "In %s: residual UL MAC PDU in %d.%d with length < 0!, pdu_len %d \n", __func__, frameP, slot, pdu_len); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index eccffca031..eba9bc52b3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -444,7 +444,7 @@ typedef struct NR_UE_harq { /* Transport block to be sent using this HARQ process, its size is in * sched_pdsch */ - uint32_t tb[16384]; + uint32_t transportBlock[16384]; uint32_t tb_size; /// sched_pdsch keeps information on MCS etc used for the initial transmission diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 99897f9060..59cf465ac1 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1065,7 +1065,7 @@ void update_harq_status(module_id_t module_id, uint8_t harq_pid, uint8_t ack_nac int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ - NR_UE_L2_STATE_t ret; + NR_UE_L2_STATE_t ret=0; module_id_t module_id = ul_info->module_id; NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); diff --git a/openair2/RRC/NR/rrc_gNB_NGAP.c b/openair2/RRC/NR/rrc_gNB_NGAP.c index 4492380d7f..c73c3d9649 100644 --- a/openair2/RRC/NR/rrc_gNB_NGAP.c +++ b/openair2/RRC/NR/rrc_gNB_NGAP.c @@ -969,9 +969,9 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ( uint16_t ue_initial_id; uint32_t gNB_ue_ngap_id; rrc_gNB_ue_context_t *ue_context_p = NULL; - protocol_ctxt_t ctxt; - gtpv1u_gnb_create_tunnel_req_t create_tunnel_req; - gtpv1u_gnb_create_tunnel_resp_t create_tunnel_resp; + protocol_ctxt_t ctxt={0}; + gtpv1u_gnb_create_tunnel_req_t create_tunnel_req={0}; + gtpv1u_gnb_create_tunnel_resp_t create_tunnel_resp={0}; uint8_t pdu_sessions_done; uint8_t inde_list[NR_NB_RB_MAX - 3]= {0}; int ret = 0; diff --git a/openair3/NAS/NR_UE/nr_nas_msg_sim.c b/openair3/NAS/NR_UE/nr_nas_msg_sim.c index 283f3b7311..e151fec9b4 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg_sim.c +++ b/openair3/NAS/NR_UE/nr_nas_msg_sim.c @@ -428,7 +428,7 @@ void generateRegistrationRequest(as_nas_info_t *initialNasMsg, int Mod_id) { size += 10; // encode the message - initialNasMsg->data = (Byte_t *)malloc(size * sizeof(Byte_t)); + initialNasMsg->data = malloc16_clear(size * sizeof(Byte_t)); registration_request_buf = initialNasMsg->data; initialNasMsg->length = mm_msg_encode(mm_msg, (uint8_t*)(initialNasMsg->data), size); diff --git a/targets/ARCH/rfsimulator/apply_channelmod.c b/targets/ARCH/rfsimulator/apply_channelmod.c index d7d3a68965..6e26120e29 100644 --- a/targets/ARCH/rfsimulator/apply_channelmod.c +++ b/targets/ARCH/rfsimulator/apply_channelmod.c @@ -52,7 +52,7 @@ either we regenerate the channel (call again random_channel(desc,0)), or we keep it over subframes legacy: we regenerate each sub frame in UL, and each frame only in DL */ -void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_sig, +void rxAddInput( c16_t *input_sig, c16_t *after_channel_sig, int rxAnt, channel_desc_t *channelDesc, int nbSamples, @@ -73,7 +73,7 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si const int nbTx=channelDesc->nb_tx; for (int i=0; i<((int)nbSamples-dd); i++) { - struct complex16 *out_ptr=after_channel_sig+dd+i; + c16_t *out_ptr=after_channel_sig+dd+i; struct complexd rx_tmp= {0}; for (int txAnt=0; txAnt < nbTx; txAnt++) { @@ -87,7 +87,7 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si // but it is not very usefull // it would be better to split out each antenna in a separate flow // that will allow to mix ru antennas freely - struct complex16 tx16=input_sig[((TS+i-l)*nbTx+txAnt)%CirSize]; + c16_t tx16=input_sig[((TS+i-l)*nbTx+txAnt)%CirSize]; rx_tmp.r += tx16.r * channelModel[l].r - tx16.i * channelModel[l].i; rx_tmp.i += tx16.i * channelModel[l].r + tx16.r * channelModel[l].i; } //l diff --git a/targets/ARCH/rfsimulator/rfsimulator.h b/targets/ARCH/rfsimulator/rfsimulator.h index 292873032e..33583f2d32 100644 --- a/targets/ARCH/rfsimulator/rfsimulator.h +++ b/targets/ARCH/rfsimulator/rfsimulator.h @@ -25,8 +25,8 @@ #define __RFSIMULATOR_H double gaussZiggurat(double mean, double variance); void tableNor(unsigned long seed); -void rxAddInput( struct complex16 *input_sig, - struct complex16 *after_channel_sig, +void rxAddInput( c16_t *input_sig, + c16_t *after_channel_sig, int rxAnt, channel_desc_t *channelDesc, int nbSamples, diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index 013e542689..0a05f2cbef 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -100,7 +100,7 @@ static telnetshell_vardef_t rfsimu_vardef[] = { }; pthread_mutex_t Sockmutex; -typedef struct complex16 sample_t; // 2*16 bits complex number +typedef c16_t sample_t; // 2*16 bits complex number typedef struct buffer_s { int conn_sock; @@ -495,7 +495,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi setblocking(conn_sock, notBlocking); allocCirBuf(t, conn_sock); LOG_I(HW,"A client connected, sending the current time\n"); - struct complex16 v= {0}; + c16_t v= {0}; void *samplesVoid[t->tx_num_channels]; for ( int i=0; i < t->tx_num_channels; i++) @@ -665,7 +665,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest // We send timestamp for nb samples required // assuming this should have been done earlier if a Tx would exist pthread_mutex_unlock(&Sockmutex); - struct complex16 v= {0}; + c16_t v= {0}; void *dummyS[t->tx_num_channels]; for ( int i=0; i < t->tx_num_channels; i++) @@ -728,7 +728,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest for (int a=0; achannel_model != NULL ) // apply a channel model - rxAddInput( ptr->circularBuf, (struct complex16 *) samplesVoid[a], + rxAddInput( ptr->circularBuf, (c16_t *) samplesVoid[a], a, ptr->channel_model, nsamps, diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 13a09db5a3..1b59ba9b2b 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1941,7 +1941,7 @@ void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) { // we have to write to tell explicitly to the eNB, else it will wait for us forever // we write the next subframe (always write in future of what we received) // - struct complex16 v= {0}; + c16_t v= {0}; void *samplesVoid[UE->frame_parms.nb_antennas_tx]; for ( int i=0; i < UE->frame_parms.nb_antennas_tx; i++) From 288c29da84fa2466ea4d503bbdbcce16e8528bf1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Mar 2022 19:46:42 +0000 Subject: [PATCH 717/883] Apply review suggestions --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 14 +++++++------- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 12 ++++++------ openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index eda53e1c84..b8eaefedb1 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -287,8 +287,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, for (int aa=0;aanb_antennas_rx;aa++) { c16_t *r=(c16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]]; for (n=0;n<12;n++) { - xr[aa][l][n].r +=(int32_t)x_re[l][n]*r[n].r+(int32_t)x_im[l][n]*r[n].i; - xr[aa][l][n].i +=(int32_t)x_re[l][n]*r[n].i-(int32_t)x_im[l][n]*r[n].r; + xr[aa][l][n].r += (int32_t)x_re[l][n] * r[n].r + (int32_t)x_im[l][n] * r[n].i; + xr[aa][l][n].i += (int32_t)x_re[l][n] * r[n].i - (int32_t)x_im[l][n] * r[n].r; #ifdef DEBUG_NR_PUCCH_RX printf("x (%d,%d), r%d.%d (%d,%d), xr (%lld,%lld)\n", x_re[l][n],x_im[l][n],l2,re_offset[l],r[n].r,r[n].i,xr[aa][l][n].r,xr[aa][l][n].i); @@ -317,12 +317,12 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, for (int aa=0;aanb_antennas_rx;aa++) { corr_re[aa][l]=0; corr_im[aa][l]=0; - for (n=0;n<12;n++) { - corr_re[aa][l]+=xr[aa][l][n].r*idft12_re[seq_index][n]+xr[aa][l][n].i*idft12_im[seq_index][n]; - corr_im[aa][l]+=xr[aa][l][n].r*idft12_im[seq_index][n]-xr[aa][l][n].i*idft12_re[seq_index][n]; + for (n = 0; n < 12; n++) { + corr_re[aa][l] += xr[aa][l][n].r * idft12_re[seq_index][n] + xr[aa][l][n].i * idft12_im[seq_index][n]; + corr_im[aa][l] += xr[aa][l][n].r * idft12_im[seq_index][n] - xr[aa][l][n].i * idft12_re[seq_index][n]; } - corr_re[aa][l]>>=15; - corr_im[aa][l]>>=15; + corr_re[aa][l] >>= 15; + corr_im[aa][l] >>= 15; } } LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%ld,%ld)=>%f\n", diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index f084cb2d63..248c30f26f 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -118,14 +118,14 @@ typedef struct { } __attribute__ ((__packed__)) NR_MAC_SUBHEADER_FIXED; static inline void getMacLen(uint8_t* pdu, uint16_t *mac_ce_len, uint16_t *mac_subheader_len) { - NR_MAC_SUBHEADER_SHORT *s=(NR_MAC_SUBHEADER_SHORT*) pdu; - NR_MAC_SUBHEADER_LONG *l=(NR_MAC_SUBHEADER_LONG*) pdu; + NR_MAC_SUBHEADER_SHORT *s = (NR_MAC_SUBHEADER_SHORT*) pdu; + NR_MAC_SUBHEADER_LONG *l = (NR_MAC_SUBHEADER_LONG*) pdu; if (s->F) { - *mac_subheader_len=sizeof(*l); - *mac_ce_len=ntohs(l->L); + *mac_subheader_len = sizeof(*l); + *mac_ce_len = ntohs(l->L); } else { - *mac_subheader_len=sizeof(*s); - *mac_ce_len=s->L; + *mac_subheader_len = sizeof(*s); + *mac_ce_len = s->L; } } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 05313f388a..61a2902690 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2092,7 +2092,7 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, pucch->is_common = current_harq->is_common; current_harq->active = false; current_harq->ack_received = false; - LOG_D(PHY,"%d.%d Sent %d ack on harq pid %d\n", frame, slot, current_harq->ack, dl_harq_pid); + LOG_D(PHY,"%4d.%2d Sent %d ack on harq pid %d\n", frame, slot, current_harq->ack, dl_harq_pid); } } } @@ -3497,7 +3497,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) return; getMacLen(pduP, &mac_len, &mac_subheader_len); - LOG_D(NR_MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_len); + LOG_D(NR_MAC, "[UE %d] %4d.%2d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, slot, rx_lcid, gNB_index, mac_len); #if defined(ENABLE_MAC_PAYLOAD_DEBUG) LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP); From 9a884af00adf6b0001976a03e73060644b328a27 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 10 Mar 2022 13:19:40 +0000 Subject: [PATCH 718/883] Fix rballoc_mask variable type from uint8_t to uint16_t --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index aa49b14fe5..ea4628818c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -956,7 +956,7 @@ int next_list_entry_looped(NR_list_t *list, int UE_id) bool allocate_ul_retransmission(module_id_t module_id, frame_t frame, sub_frame_t slot, - uint8_t *rballoc_mask, + uint16_t *rballoc_mask, int *n_rb_sched, int UE_id, int harq_pid) @@ -1119,7 +1119,7 @@ void pf_ul(module_id_t module_id, NR_list_t *UE_list, int max_num_ue, int n_rb_sched, - uint8_t *rballoc_mask) { + uint16_t *rballoc_mask) { const int CC_id = 0; gNB_MAC_INST *nrmac = RC.nrmac[module_id]; @@ -1503,7 +1503,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t LOG_D(NR_MAC,"UL %d.%d : start_prb %d, end PRB %d\n",frame,slot,st,e); - uint8_t rballoc_mask[bwpSize]; + uint16_t rballoc_mask[bwpSize]; /* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */ for (int i = 0; i < bwpSize; i++) From ed4cc7c2570ab76e2057e0fe10de318822ad07e1 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 24 Mar 2022 15:37:26 +0000 Subject: [PATCH 719/883] Fix segmentation fault when using CU-DU split --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index a356b1f773..8b3acdbddf 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1478,9 +1478,8 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t gNB_MAC_INST *nr_mac = RC.nrmac[module_id]; NR_COMMON_channels_t *cc = nr_mac->common_channels; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; - const NR_SIB1_t *sib1 = get_softmodem_params()->sa ? - RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; - NR_ServingCellConfigCommonSIB_t *scc_sib1 = get_softmodem_params()->sa ? sib1->servingCellConfigCommon : NULL; + const NR_SIB1_t *sib1 = nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; + NR_ServingCellConfigCommonSIB_t *scc_sib1 = sib1 ? sib1->servingCellConfigCommon : NULL; AssertFatal(scc!=NULL || scc_sib1!=NULL,"We need one serving cell config common\n"); From b153d2d1ee021116226707fbdef90b62b31126c0 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Thu, 24 Mar 2022 21:10:23 +0100 Subject: [PATCH 720/883] fix bug in nr_rate_matching --- openair1/PHY/CODING/nr_rate_matching.c | 97 ++++++++++++++------------ 1 file changed, 54 insertions(+), 43 deletions(-) diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index 29cba0a557..84e6615ed9 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -309,60 +309,71 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f) void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) { - int16_t *e1,*e2,*e3,*e4,*e5,*e6,*e7; switch(Qm) { case 2: - e1=e+(E/2); - for (int j = 0,j2=0; j< E/2; j+=2,j2+=4){ - e[j] = f[j2]; - e1[j] = f[j2+1]; - e[j+1] = f[j2+2]; - e1[j+1] = f[j2+3]; + { + int16_t *e1=e+(E/2); + int16_t *end=f+E-4; + while( f Date: Fri, 25 Mar 2022 08:21:25 +0100 Subject: [PATCH 721/883] removing wrong sib1_tda in config files --- ci-scripts/conf_files/gNB_SA_CU.conf | 1 - ci-scripts/conf_files/gNB_SA_DU.conf | 1 - ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf | 1 - 3 files changed, 3 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf index 1e84e479bc..6501509fb6 100644 --- a/ci-scripts/conf_files/gNB_SA_CU.conf +++ b/ci-scripts/conf_files/gNB_SA_CU.conf @@ -48,7 +48,6 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index 95fa75bc1d..4a4e658bd7 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -40,7 +40,6 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf index 7f5a9d4343..f667959f15 100644 --- a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -36,7 +36,6 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { From 73053aa712504070badaaa3855b4476eab94aa9a Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Fri, 25 Mar 2022 16:32:07 +0100 Subject: [PATCH 722/883] fix bug introduced in this branch --- openair1/PHY/CODING/nr_rate_matching.c | 2 +- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 60 +++++++++++--------------- openair1/PHY/TOOLS/tools_defs.h | 3 ++ 3 files changed, 30 insertions(+), 35 deletions(-) diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index 84e6615ed9..29a1e363e9 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -307,7 +307,7 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f) void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) -{ +{ switch(Qm) { case 2: diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index b8eaefedb1..06b3c6e9e7 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -272,7 +272,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, x_im[1] = table_5_2_2_2_2_Im[u[1]]; c64_t xr[frame_parms->nb_antennas_rx][pucch_pdu->nr_of_symbols][12] __attribute__((aligned(32))); - memset(xr, 0, sizeof(xr)); int64_t xrtmag=0,xrtmag_next=0; uint8_t maxpos=0; uint8_t index=0; @@ -287,72 +286,65 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, for (int aa=0;aanb_antennas_rx;aa++) { c16_t *r=(c16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]]; for (n=0;n<12;n++) { - xr[aa][l][n].r += (int32_t)x_re[l][n] * r[n].r + (int32_t)x_im[l][n] * r[n].i; - xr[aa][l][n].i += (int32_t)x_re[l][n] * r[n].i - (int32_t)x_im[l][n] * r[n].r; + xr[aa][l][n].r = (int32_t)x_re[l][n] * r[n].r + (int32_t)x_im[l][n] * r[n].i; + xr[aa][l][n].i = (int32_t)x_re[l][n] * r[n].i - (int32_t)x_im[l][n] * r[n].r; #ifdef DEBUG_NR_PUCCH_RX printf("x (%d,%d), r%d.%d (%d,%d), xr (%lld,%lld)\n", x_re[l][n],x_im[l][n],l2,re_offset[l],r[n].r,r[n].i,xr[aa][l][n].r,xr[aa][l][n].i); #endif } - xr[aa][l][n].r>>=15; - xr[aa][l][n].i>>=15; } } - int64_t corr_re[frame_parms->nb_antennas_rx][2]; - int64_t corr_im[frame_parms->nb_antennas_rx][2]; //int32_t no_corr = 0; int seq_index = 0; int64_t temp; for(i=0;inr_of_symbols;l++) { - seq_index = (pucch_pdu->initial_cyclic_shift+ - mcs[i]+ - gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12; + c64_t corr[frame_parms->nb_antennas_rx][2]; + for (int aa=0;aanb_antennas_rx;aa++) { + for (int l=0;lnr_of_symbols;l++) { + seq_index = (pucch_pdu->initial_cyclic_shift+ + mcs[i]+ + gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12; #ifdef DEBUG_NR_PUCCH_RX - printf("PUCCH symbol %d seq %d, seq_index %d, mcs %d\n",l,i,seq_index,mcs[i]); + printf("PUCCH symbol %d seq %d, seq_index %d, mcs %d\n",l,i,seq_index,mcs[i]); #endif - for (int aa=0;aanb_antennas_rx;aa++) { - corr_re[aa][l]=0; - corr_im[aa][l]=0; + corr[aa][l]=(c64_t){0}; for (n = 0; n < 12; n++) { - corr_re[aa][l] += xr[aa][l][n].r * idft12_re[seq_index][n] + xr[aa][l][n].i * idft12_im[seq_index][n]; - corr_im[aa][l] += xr[aa][l][n].r * idft12_im[seq_index][n] - xr[aa][l][n].i * idft12_re[seq_index][n]; + corr[aa][l].r += xr[aa][l][n].r * idft12_re[seq_index][n] + xr[aa][l][n].i * idft12_im[seq_index][n]; + corr[aa][l].i += xr[aa][l][n].r * idft12_im[seq_index][n] - xr[aa][l][n].i * idft12_re[seq_index][n]; } - corr_re[aa][l] >>= 15; - corr_im[aa][l] >>= 15; + corr[aa][l].r >>= 31; + corr[aa][l].i >>= 31; } } LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%ld,%ld)=>%f\n", - mcs[i],seq_index,corr_re[0][0],corr_im[0][0], - 10*log10((double)corr_re[0][0]*corr_re[0][0] + (double)corr_im[0][0]*corr_im[0][0])); + mcs[i],seq_index,corr[0][0].r,corr[0][0].i, + 10*log10((double)squaredMod(corr[0][0]))); if (pucch_pdu->nr_of_symbols==2) LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%ld,%ld)=>%f\n", - mcs[i],seq_index,corr_re[0][1],corr_im[0][1], - 10*log10((double)corr_re[0][1]*corr_re[0][1] + (double)corr_im[0][1]*corr_im[0][1])); + mcs[i],seq_index,corr[0][1].r,corr[0][1].i, + 10*log10((double)squaredMod(corr[0][1]))); if (pucch_pdu->freq_hop_flag == 0) { if (pucch_pdu->nr_of_symbols==1) {// non-coherent correlation temp=0; for (int aa=0;aanb_antennas_rx;aa++) - temp+=(int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0]; + temp+=squaredMod(corr[aa][0]); } else { - int64_t corr_re2=0; - int64_t corr_im2=0; temp=0; for (int aa=0;aanb_antennas_rx;aa++) { - corr_re2 = (int64_t)corr_re[aa][0]+corr_re[aa][1]; - corr_im2 = (int64_t)corr_im[aa][0]+corr_im[aa][1]; - // coherent combining of 2 symbols and then complex modulus for single-frequency case - temp+=corr_re2*corr_re2 + corr_im2*corr_im2; + c64_t corr2; + csum(corr2, corr[aa][0], corr[aa][1]); + // coherent combining of 2 symbols and then complex modulus for single-frequency case + temp+=corr2.r*corr2.r + corr2.i*corr2.i; } } } else if (pucch_pdu->freq_hop_flag == 1) { // full non-coherent combining of 2 symbols for frequency-hopping case temp=0; for (int aa=0;aanb_antennas_rx;aa++) - temp += (int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0] + (int64_t)corr_re[aa][1]*corr_re[aa][1] + (int64_t)corr_im[aa][1]*corr_im[aa][1]; + temp += squaredMod(corr[aa][0]) + squaredMod(corr[aa][1]); } else AssertFatal(1==0,"shouldn't happen\n"); @@ -364,9 +356,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_stats->current_pucch0_stat0 = 0; int64_t temp2=0,temp3=0;; for (int aa=0;aanb_antennas_rx;aa++) { - temp2 += ((int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0]); + temp2 += squaredMod(corr[aa][0]); if (pucch_pdu->nr_of_symbols==2) - temp3 += ((int64_t)corr_re[aa][1]*corr_re[aa][1] + (int64_t)corr_im[aa][1]*corr_im[aa][1]); + temp3 += squaredMod(corr[aa][1]); } uci_stats->current_pucch0_stat0= dB_fixed64(temp2); if ( pucch_pdu->nr_of_symbols==2) diff --git a/openair1/PHY/TOOLS/tools_defs.h b/openair1/PHY/TOOLS/tools_defs.h index 13ce9d85c7..c763ec6bac 100644 --- a/openair1/PHY/TOOLS/tools_defs.h +++ b/openair1/PHY/TOOLS/tools_defs.h @@ -63,6 +63,9 @@ typedef struct complex64 { int64_t r; int64_t i; } c64_t; + +#define squaredMod(a) ((a).r*(a).r+(a).i*(a).i) +#define csum(res, i1, i2) (res).r=(i1).r+(i2).r ; (res).i=(i1).i+(i2).i //cmult_sv.h /*!\fn void multadd_real_vector_complex_scalar(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N) From 9be58373bc35b076b07f8bcc9d5aedb487956e5c Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Fri, 25 Mar 2022 18:20:05 +0100 Subject: [PATCH 723/883] fix regression on harq in UE --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 12 +++++++----- openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h | 1 + openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 6163a95e5c..eac595b39e 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -168,6 +168,8 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint dlsch->harq_processes[i]->d[r] = (int16_t *)malloc16(5*8448*sizeof(int16_t)); if (dlsch->harq_processes[i]->c[r]) memset(dlsch->harq_processes[i]->c[r],0,1056); + if (dlsch->harq_processes[i]->d[r]) + memset(dlsch->harq_processes[i]->d[r],0,5*8448); else exit_flag=2; @@ -306,6 +308,7 @@ void nr_processDLSegment(void* arg) { //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN); int16_t w[E]; + memset(w, 0, sizeof(w)); nr_deinterleaving_ldpc(E, Qm, w, // [hna] w is e @@ -324,12 +327,11 @@ void nr_processDLSegment(void* arg) { harq_process->rvidx, harq_process->round); */ //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN); - int16_t d[5*8448]; if (nr_rate_matching_ldpc_rx(Ilbrm, Tbslbrm, p_decoderParms->BG, p_decoderParms->Z, - d, + harq_process->d[r], w, harq_process->C, harq_process->rvidx, @@ -351,7 +353,7 @@ void nr_processDLSegment(void* arg) { LOG_D(PHY,"decoder input(segment %u) :",r); for (int i=0; id[r][i]); LOG_D(PHY,"\n"); } @@ -377,9 +379,9 @@ void nr_processDLSegment(void* arg) { //set Filler bits memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t)); //Move coded bits before filler bits - memcpy((&z[0]+2*harq_process->Z),d,(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); + memcpy((&z[0]+2*harq_process->Z),harq_process->d[r],(K_bits_F-2*harq_process->Z)*sizeof(int16_t)); //skip filler bits - memcpy((&z[0]+Kr),d+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); + memcpy((&z[0]+Kr),harq_process->d[r]+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t)); //Saturate coded bits before decoding into 8 bits values for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) { diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h index f76119250f..ef42bb2abd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h @@ -181,6 +181,7 @@ typedef struct { /// Pointers to transport block segments uint8_t **c; /// soft bits for each received segment ("d"-sequence)(for definition see 36-212 V8.6 2009-03, p.15) + /// Accumulates the soft bits for each round to increase decoding success (HARQ) int16_t **d; /// Index of current HARQ round for this DLSCH uint8_t round; diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index c8969d7a0f..eb48d26908 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -483,7 +483,7 @@ int main(int argc, char **argv) //unsigned char test_input[TBS / 8] __attribute__ ((aligned(16))); for (i = 0; i < TBS / 8; i++) test_input[i] = (unsigned char) rand(); - + harq->pdu=test_input; //estimated_output = harq_process->b; #ifdef DEBUG_NR_DLSCHSIM From a79ccb99926ab6e93e826a93441347436a6f5269 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Fri, 25 Mar 2022 21:45:37 +0100 Subject: [PATCH 724/883] fix nr_deinterleaving_ldpc() again, we are now too short in the buffer --- common/utils/assertions.h | 4 ++-- openair1/PHY/CODING/nr_rate_matching.c | 27 +++++++++++++++----------- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 +- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/common/utils/assertions.h b/common/utils/assertions.h index 573036b1d9..c8959d0adb 100644 --- a/common/utils/assertions.h +++ b/common/utils/assertions.h @@ -44,9 +44,9 @@ #define _Assert_(cOND, aCTION, fORMAT, aRGS...) \ do { \ if (!(cOND)) { \ - fprintf(stderr, "\nAssertion ("#cOND") failed!\n" \ + fprintf(stderr, "\nAssertion (%s) failed!\n" \ "In %s() %s:%d\n" fORMAT, \ - __FUNCTION__, __FILE__, __LINE__, ##aRGS); \ + #cOND, __FUNCTION__, __FILE__, __LINE__, ##aRGS); \ aCTION; \ } \ } while(0) diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index 29a1e363e9..fbad79cad7 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -309,25 +309,28 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f) void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) { + switch(Qm) { case 2: { - int16_t *e1=e+(E/2); - int16_t *end=f+E-4; - while( fpdu=test_input; + dlsch->harq_process.pdu=test_input; //estimated_output = harq_process->b; #ifdef DEBUG_NR_DLSCHSIM From a020c51772714988919eab6d50e43de571a140c7 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 28 Mar 2022 10:31:50 +0100 Subject: [PATCH 725/883] Fix warning after merge --- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index f43cb6a70c..0bf119f342 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -38,12 +38,13 @@ void set_cset_offset(uint16_t); void mac_top_init_gNB(void); +void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl); + void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, int pusch_AntennaPorts, - NR_ServingCellConfigCommon_t *scc - ); + NR_ServingCellConfigCommon_t *scc); int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, From c0568a997a003b15b64e47c3ae8c4868d0630425 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 22 Mar 2022 15:23:44 +0100 Subject: [PATCH 726/883] fix bugs, delete dead code --- executables/nr-ue.c | 27 +++--- openair1/PHY/defs_RU.h | 1 - openair1/PHY/defs_UE.h | 14 --- openair1/PHY/defs_gNB.h | 3 - openair1/SCHED_UE/phy_procedures_lte_ue.c | 106 ---------------------- openair2/RRC/LTE/rrc_UE.c | 3 +- targets/ARCH/rfsimulator/simulator.c | 72 ++++----------- targets/RT/USER/lte-ru.c | 19 +++- targets/RT/USER/lte-softmodem.h | 1 - targets/RT/USER/lte-uesoftmodem.c | 9 -- 10 files changed, 51 insertions(+), 204 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 3cc71b8b3a..aef0370e53 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -654,17 +654,15 @@ static void UE_synch(void *arg) { openair0_cfg[UE->rf_map.card].rx_freq[0], openair0_cfg[UE->rf_map.card].tx_freq[0]); - if (UE->mode != loop_through_memory) { - UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); - //UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]); - //UE->rfdevice.trx_stop_func(&UE->rfdevice); - // sleep(1); - /*if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { - LOG_E(HW,"Could not start the device\n"); - oai_exit=1; - }*/ - } - + UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); + //UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]); + //UE->rfdevice.trx_stop_func(&UE->rfdevice); + // sleep(1); + /*if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { + LOG_E(HW,"Could not start the device\n"); + oai_exit=1; + }*/ + if (UE->UE_scan_carrier == 1) { UE->UE_scan_carrier = 0; } else { @@ -683,8 +681,7 @@ static void UE_synch(void *arg) { LOG_I(PHY, "Initial sync failed: trying carrier off %d Hz\n", freq_offset); - if (UE->mode != loop_through_memory) - UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); + UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); } break; @@ -729,7 +726,7 @@ void processSlotTX(void *arg) { stop_meas(&UE->ue_ul_indication_stats); } - if ((UE->mode != loop_through_memory) && (rxtxD->ue_sched_mode != NOT_PUSCH)) { + if (rxtxD->ue_sched_mode != NOT_PUSCH) { phy_procedures_nrUE_TX(UE,proc,0); } } @@ -873,7 +870,7 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) { *timestamp += UE->frame_parms.get_samples_per_slot(1,&UE->frame_parms); for ( int size=UE->rx_offset ; size > 0 ; size -= UE->frame_parms.samples_per_subframe ) { int unitTransfer=size>UE->frame_parms.samples_per_subframe ? UE->frame_parms.samples_per_subframe : size ; - // we write before read becasue gNB waits for UE to write and both executions halt + // we write before read because gNB waits for UE to write and both executions halt // this happens here as the read size is samples_per_subframe which is very much larger than samp_per_slot if (IS_SOFTMODEM_RFSIM) dummyWrite(UE,*timestamp, unitTransfer); AssertFatal(unitTransfer == diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h index 0b20aa409b..243e76f851 100644 --- a/openair1/PHY/defs_RU.h +++ b/openair1/PHY/defs_RU.h @@ -54,7 +54,6 @@ typedef enum { no_L2_connect=5, calib_prach_tx=6, rx_dump_frame=7, - loop_through_memory=8 } runmode_t; /*! \brief Extension Type */ diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index 7f4d07ddae..a634a0d585 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -168,19 +168,6 @@ typedef struct { struct sched_param sched_param_ue; /// pthread descriptor main UE thread pthread_t pthread_ue; - /// \brief Instance count for synch thread. - /// \internal This variable is protected by \ref mutex_synch. - int instance_cnt_synch; - /// pthread attributes for synch processing thread - pthread_attr_t attr_synch; - /// scheduling parameters for synch thread - struct sched_param sched_param_synch; - /// pthread descriptor synch thread - pthread_t pthread_synch; - /// condition variable for UE synch thread; - pthread_cond_t cond_synch; - /// mutex for UE synch thread - pthread_mutex_t mutex_synch; /// instance count for eNBs int instance_cnt_eNBs; /// set of scheduling variables RXn-TXnp4 threads @@ -833,7 +820,6 @@ typedef struct { pthread_mutex_t timer_mutex; pthread_cond_t timer_cond; int instance_cnt_timer; - /// RF and Interface devices per CC openair0_device rfdevice; diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 6dcce5df0a..66bf3e8b03 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -589,9 +589,6 @@ typedef struct gNB_L1_proc_t_s { int instance_cnt_te; /// \internal This variable is protected by \ref mutex_prach. int instance_cnt_prach; - - // instance count for over-the-air gNB synchronization - int instance_cnt_synch; /// \internal This variable is protected by \ref mutex_asynch_rxtx. int instance_cnt_asynch_rxtx; /// pthread structure for eNB single processing thread diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index b02f24e04e..52e7351e24 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -4870,109 +4870,3 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue, LOG_D(PHY," ****** end RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, subframe_rx); return (0); } - - -void phy_procedures_UE_lte(PHY_VARS_UE *ue, - UE_rxtx_proc_t *proc, - uint8_t eNB_id, - uint8_t abstraction_flag, - uint8_t do_pdcch_flag, - runmode_t mode) { - MessageDef *msg_p; - int result; - int frame_rx = proc->frame_rx; - int frame_tx = proc->frame_tx; - int subframe_rx = proc->subframe_rx; - int subframe_tx = proc->subframe_tx; - UE_L2_STATE_t ret; - int slot; - - if (ue->mac_enabled == 0) { - ue->UE_mode[eNB_id]=PUSCH; - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1); - - if ( LOG_DEBUGFLAG(UE_TIMING)) { - start_meas(&ue->phy_proc[ue->current_thread_id[subframe_rx]]); - } - do { - // Checks if a message has been sent to PHY sub-task - itti_poll_msg (TASK_PHY_UE, &msg_p); - - if (msg_p != NULL) { - switch (ITTI_MSG_ID(msg_p)) { - case PHY_FIND_CELL_REQ: - LOG_I(PHY, "[UE ] Received %s\n", ITTI_MSG_NAME (msg_p)); - /* TODO process the message */ - break; - - default: - LOG_E(PHY, "[UE %ld] Received unexpected message %s\n", ITTI_MSG_DESTINATION_INSTANCE (msg_p), ITTI_MSG_NAME (msg_p)); - break; - } - - result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - } - } while(msg_p != NULL); - - for (slot=0; slot<2; slot++) { - if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_UL)|| - (ue->frame_parms.frame_type == FDD)) { - phy_procedures_UE_TX(ue,proc,eNB_id,abstraction_flag,mode); - } - - if ((subframe_select(&ue->frame_parms,subframe_rx)==SF_DL) || - (ue->frame_parms.frame_type == FDD)) { - phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,do_pdcch_flag,mode); - } - - if ((subframe_select(&ue->frame_parms,subframe_tx)==SF_S) && - (slot==1)) { - phy_procedures_UE_S_TX(ue,eNB_id,abstraction_flag); - } - - if ((subframe_select(&ue->frame_parms,subframe_rx)==SF_S) && - (slot==0)) { - phy_procedures_UE_RX(ue,proc,eNB_id,abstraction_flag,do_pdcch_flag,mode); - } - - if (ue->mac_enabled==1) { - if (slot==0) { - //LOG_I(PHY,"[UE %d] Frame %d, subframe %d, star ue_scheduler\n", ue->Mod_id,frame_rx,subframe_tx); - ret = ue_scheduler(ue->Mod_id, - frame_rx, - subframe_rx, - frame_tx, - subframe_tx, - subframe_select(&ue->frame_parms,subframe_tx), - eNB_id, - 0/*FIXME CC_id*/); - - if (ret == CONNECTION_LOST) { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",ue->Mod_id, - frame_rx,subframe_tx); - ue->UE_mode[eNB_id] = PRACH; - // mac_xface->macphy_exit("Connection lost"); - } else if (ret == PHY_RESYNCH) { - LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, trying to resynch\n", - ue->Mod_id, - frame_rx,subframe_tx); - ue->UE_mode[eNB_id] = RESYNCH; - // mac_xface->macphy_exit("Connection lost"); - } else if (ret == PHY_HO_PRACH) { - LOG_I(PHY,"[UE %d] Frame %d, subframe %d, return to PRACH and perform a contention-free access\n", - ue->Mod_id,frame_rx,subframe_tx); - ue->UE_mode[eNB_id] = PRACH; - } - } - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,0); - - if (LOG_DEBUGFLAG(UE_TIMING)) { - stop_meas(&ue->phy_proc[ue->current_thread_id[subframe_rx]]); - } - } // slot -} diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index b46bba2492..9b37853ed2 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -3175,7 +3175,8 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, const size_t num_plmn_data = sizeof(plmn_data) / sizeof(plmn_data[0]); for (size_t plmn_ind = 0;; ++plmn_ind) { if (plmn_ind == num_plmn_data) { - LOG_E( RRC, "Did not find name from internal table for %u %u\n", mcc, mnc); + LOG_W( RRC, "Did not find operator name from internal table for MCC %0*d, MNC %0*d\n", + mccdigits, mcc, mncdigits, mnc); break; } if ((plmn_data[plmn_ind].mcc == mcc) && (plmn_data[plmn_ind].mnc == mnc)) { diff --git a/targets/ARCH/rfsimulator/simulator.c b/targets/ARCH/rfsimulator/simulator.c index 013e542689..dc5eab2f34 100644 --- a/targets/ARCH/rfsimulator/simulator.c +++ b/targets/ARCH/rfsimulator/simulator.c @@ -117,7 +117,7 @@ typedef struct buffer_s { typedef struct { int listen_sock, epollfd; - openair0_timestamp nextTimestamp; + openair0_timestamp nextRxTstamp; openair0_timestamp lastWroteTS; uint64_t typeStamp; char *ip; @@ -196,7 +196,7 @@ static void removeCirBuf(rfsimulator_state_t *bridge, int sock) { free(bridge->buf[sock].circularBuf); // Fixme: no free_channel_desc_scm(bridge->buf[sock].channel_model) implemented // a lot of mem leaks - free(bridge->buf[sock].channel_model); + //free(bridge->buf[sock].channel_model); memset(&bridge->buf[sock], 0, sizeof(buffer_t)); bridge->buf[sock].conn_sock=-1; } @@ -429,8 +429,6 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t, openair0_timestamp if (!alreadyLocked) pthread_mutex_lock(&Sockmutex); - LOG_D(HW,"sending %d samples at time: %ld\n", nsamps, timestamp); - for (int i=0; ibuf[i]; @@ -549,14 +547,14 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi (t->typeStamp == ENB_MAGICDL && b->th.magic==UE_MAGICDL), "Socket Error in protocol"); b->headerMode=false; - if ( t->nextTimestamp == 0 ) { // First block in UE, resync with the eNB current TS - t->nextTimestamp=b->th.timestamp> nsamps_for_initial ? + if ( t->nextRxTstamp == 0 ) { // First block in UE, resync with the eNB current TS + t->nextRxTstamp=b->th.timestamp> nsamps_for_initial ? b->th.timestamp - nsamps_for_initial : 0; b->lastReceivedTS=b->th.timestamp> nsamps_for_initial ? b->th.timestamp : nsamps_for_initial; - LOG_W(HW,"UE got first timestamp: starting at %lu\n", t->nextTimestamp); + LOG_W(HW,"UE got first timestamp: starting at %lu\n", t->nextRxTstamp); b->trashingPacket=true; } else if ( b->lastReceivedTS < b->th.timestamp) { int nbAnt= b->th.nbAnt; @@ -623,7 +621,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest } rfsimulator_state_t *t = device->priv; - LOG_D(HW, "Enter rfsimulator_read, expect %d samples, will release at TS: %ld\n", nsamps, t->nextTimestamp+nsamps); + LOG_D(HW, "Enter rfsimulator_read, expect %d samples, will release at TS: %ld\n", nsamps, t->nextRxTstamp+nsamps); // deliver data from received data // check if a UE is connected int first_sock; @@ -634,54 +632,22 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest if ( first_sock == FD_SETSIZE ) { // no connected device (we are eNB, no UE is connected) - if ( t->nextTimestamp == 0) + if ( t->nextRxTstamp == 0) LOG_W(HW,"No connected device, generating void samples...\n"); if (!flushInput(t, 10, nsamps)) { for (int x=0; x < nbAnt; x++) memset(samplesVoid[x],0,sampleToByte(nsamps,1)); - t->nextTimestamp+=nsamps; + t->nextRxTstamp+=nsamps; - if ( ((t->nextTimestamp/nsamps)%100) == 0) - LOG_D(HW,"No UE, Generated void samples for Rx: %ld\n", t->nextTimestamp); + if ( ((t->nextRxTstamp/nsamps)%100) == 0) + LOG_D(HW,"No UE, Generated void samples for Rx: %ld\n", t->nextRxTstamp); - *ptimestamp = t->nextTimestamp-nsamps; + *ptimestamp = t->nextRxTstamp-nsamps; return nsamps; } } else { - pthread_mutex_lock(&Sockmutex); - - if ( t->nextTimestamp > 0 && t->lastWroteTS < t->nextTimestamp) { - pthread_mutex_unlock(&Sockmutex); - usleep(10000); - pthread_mutex_lock(&Sockmutex); - - if ( t->lastWroteTS < t->nextTimestamp ) { - // Assuming Tx is not done fully in another thread - // We can never write is the past from the received time - // So, the node perform receive but will never write these symbols - // let's tell this to the opposite node - // We send timestamp for nb samples required - // assuming this should have been done earlier if a Tx would exist - pthread_mutex_unlock(&Sockmutex); - struct complex16 v= {0}; - void *dummyS[t->tx_num_channels]; - - for ( int i=0; i < t->tx_num_channels; i++) - dummyS[i]=(void *)&v; - - LOG_I(HW, "No samples Tx occured, so we send 1 sample to notify it: Tx:%lu, Rx:%lu\n", - t->lastWroteTS, t->nextTimestamp); - rfsimulator_write_internal(t, t->nextTimestamp, - dummyS, 1, - t->tx_num_channels, 1, true); - } else { - pthread_mutex_unlock(&Sockmutex); - LOG_W(HW, "trx_write came from another thread\n"); - } - } else - pthread_mutex_unlock(&Sockmutex); bool have_to_wait; @@ -692,7 +658,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest buffer_t *b=&t->buf[sock]; if ( b->circularBuf ) - if ( t->nextTimestamp+nsamps > b->lastReceivedTS ) { + if ( t->nextRxTstamp+nsamps > b->lastReceivedTS ) { have_to_wait=true; break; } @@ -701,7 +667,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest if (have_to_wait) /*printf("Waiting on socket, current last ts: %ld, expected at least : %ld\n", ptr->lastReceivedTS, - t->nextTimestamp+nsamps); + t->nextRxTstamp+nsamps); */ flushInput(t, 3, nsamps); } while (have_to_wait); @@ -732,7 +698,7 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest a, ptr->channel_model, nsamps, - t->nextTimestamp, + t->nextRxTstamp, CirSize ); else { // no channel modeling @@ -747,8 +713,8 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest //LOG_I(HW, "nbAnt_tx %d\n",nbAnt_tx); for (int i=0; i < nsamps; i++) {//loop over nsamps for (int a_tx=0; a_txcircularBuf[((t->nextTimestamp+i)*nbAnt_tx+a_tx)%CirSize].r*H_awgn_mimo[a][a_tx]); - out[i].i += (short)(ptr->circularBuf[((t->nextTimestamp+i)*nbAnt_tx+a_tx)%CirSize].i*H_awgn_mimo[a][a_tx]); + out[i].r += (short)(ptr->circularBuf[((t->nextRxTstamp+i)*nbAnt_tx+a_tx)%CirSize].r*H_awgn_mimo[a][a_tx]); + out[i].i += (short)(ptr->circularBuf[((t->nextRxTstamp+i)*nbAnt_tx+a_tx)%CirSize].i*H_awgn_mimo[a][a_tx]); } // end for a_tx } // end for i (number of samps) } // end of no channel modeling @@ -756,11 +722,11 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest } } - *ptimestamp = t->nextTimestamp; // return the time of the first sample - t->nextTimestamp+=nsamps; + *ptimestamp = t->nextRxTstamp; // return the time of the first sample + t->nextRxTstamp+=nsamps; LOG_D(HW,"Rx to upper layer: %d from %ld to %ld, energy in first antenna %d\n", nsamps, - *ptimestamp, t->nextTimestamp, + *ptimestamp, t->nextRxTstamp, signal_energy(samplesVoid[0], nsamps)); return nsamps; } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 66ce6ef247..f6cf51f101 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -733,7 +733,7 @@ void tx_rf(RU_t *ru, int sf_extension = 0; if ((SF_type == SF_DL) || - (SF_type == SF_S)) { + (SF_type == SF_S) ) { int siglen=fp->samples_per_tti,flags=1; if (SF_type == SF_S) { @@ -831,6 +831,23 @@ void tx_rf(RU_t *ru, late_control=STATE_BURST_TERMINATE; LOG_E(PHY,"TX : Timeout (sent %d/%d) state =%d\n",txs, siglen,late_control); } + } else if (IS_SOFTMODEM_RFSIM ) { + // in case of rfsim, we always enable tx because we need to feed rx of the opposite side + // we write 1 single I/Q sample to trigger Rx (rfsim will fill gaps with 0 I/Q) + void *dummy_tx[ru->frame_parms->nb_antennas_tx]; + for (int i=0; iframe_parms->nb_antennas_tx; i++) + dummy_tx[i]=malloc16_clear(4); + + AssertFatal( 1 == + ru->rfdevice.trx_write_func(&ru->rfdevice, + timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension, + dummy_tx, + 1, + ru->frame_parms->nb_antennas_tx, + 4),""); + + for (int i=0; iframe_parms->nb_antennas_tx; i++) + free(dummy_tx[i]); } } diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 0267ad8ce0..1c887dd3c8 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -49,7 +49,6 @@ {"debug-ue-prach", CONFIG_HLP_DBGUEPR, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ {"no-L2-connect", CONFIG_HLP_NOL2CN, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ {"calib-prach-tx", CONFIG_HLP_CALPRACH, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \ - {"loop-memory", CONFIG_HLP_UELOOP, 0, strptr:&loopfile, defstrval:"iqs.in", TYPE_STRING,0}, \ {"ue-dump-frame", CONFIG_HLP_DUMPFRAME, PARAMFLAG_BOOL, iptr:&dumpframe, defintval:0, TYPE_INT, 0}, \ } #define CMDLINE_CALIBUERX_IDX 0 diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 8cdef647ca..089941c7df 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -276,7 +276,6 @@ uint16_t node_number; static void get_options(void) { int CC_id=0; int tddflag=0; - char *loopfile=NULL; int dumpframe=0; int timingadv=0; uint8_t nfapi_mode = NFAPI_MONOLITHIC; @@ -293,14 +292,6 @@ static void get_options(void) { config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL); nfapi_setmode(nfapi_mode); - - if (loopfile != NULL) { - printf("Input file for hardware emulation: %s",loopfile); - mode=loop_through_memory; - input_fd = fopen(loopfile,"r"); - AssertFatal(input_fd != NULL,"Please provide a valid input file\n"); - } - get_softmodem_params()->hw_timing_advance = timingadv; if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue; From 9bd16f3c664af14b3d8f2184c91a698cef6ce1b8 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 28 Mar 2022 21:45:50 +0200 Subject: [PATCH 727/883] - fix for CSI-RS allocation (slot slot 0 in symbol 13, SIB1 10 symbols instead of 12 by default) - extra logging for CRNTI procedure (to catch bug in nr_free_list --- openair2/GNB_APP/gnb_paramdef.h | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 11 ++++++++++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 4 ++-- openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 5 +++-- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index 28aa60d54b..e5f15969ac 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -146,7 +146,7 @@ typedef enum { {GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ -{GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_DOSRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index d2f726e0fc..b9615eb99d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2015,7 +2015,16 @@ void remove_nr_list(NR_list_t *listP, int id) prev = cur; cur = &listP->next[*cur]; } - AssertFatal(*cur != -1, "ID %d not found in UE_list\n", id); + if (*cur == -1) { + cur = &listP->head; + prev=&listP->head; + while (*cur != -1 && *cur != id) { + LOG_I(NR_MAC,"remove_nr_list : id %d, *cur %d\n",id,*cur); + prev = cur; + cur = &listP->next[*cur]; + } + AssertFatal(1==0, "ID %d not found in UE_list\n", id); + } int *next = &listP->next[*cur]; *cur = listP->next[*cur]; *next = -1; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 30d484ae08..1a66f336c8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -679,11 +679,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, UE_scheduling_control->ta_update = timing_advance; UE_scheduling_control->raw_rssi = rssi; UE_scheduling_control->pusch_snrx10 = ul_cqi * 5 - 640; - LOG_D(NR_MAC, "[UE %d] PUSCH TPC %d and TA %d\n",UE_id,UE_scheduling_control->tpc0,UE_scheduling_control->ta_update); + LOG_D(NR_MAC, "[UE %d] PUSCH TPC %d(SNRx10 %d) and TA %d\n",UE_id,UE_scheduling_control->tpc0,UE_scheduling_control->pusch_snrx10,UE_scheduling_control->ta_update); } else{ LOG_D(NR_MAC,"[UE %d] Detected DTX : increasing UE TX power\n",UE_id); - UE_scheduling_control->tpc0 = 3; + UE_scheduling_control->tpc0 = 1; } #if defined(ENABLE_MAC_PAYLOAD_DEBUG) diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c index 62aa101a50..007750c9fe 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c @@ -108,7 +108,7 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity, if (rcvd_count < entity->rx_deliv || nr_pdcp_sdu_in_list(entity->rx_list, rcvd_count)) { - LOG_W(PDCP, "discard NR PDU rcvd_count=%d\n", rcvd_count); + LOG_W(PDCP, "discard NR PDU rcvd_count=%d, entity->rx_deliv %d,sdu_in_list %d\n", rcvd_count,entity->rx_deliv,nr_pdcp_sdu_in_list(entity->rx_list,rcvd_count)); return; } diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 02c42b4e5f..18e4d76075 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1039,7 +1039,8 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, default: AssertFatal(1==0,"Number of ports not yet supported\n"); } - resourceMapping.firstOFDMSymbolInTimeDomain = 6; + // This programs CSI-RS in slot 0 symbol 13. Note: need to use a SIB1 configuration which leaves the last symbol free for CSI-RS. + resourceMapping.firstOFDMSymbolInTimeDomain = 13; resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL; resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one; resourceMapping.density.choice.one = (NULL_t)0; @@ -1052,7 +1053,7 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId; nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset)); nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320; - nzpcsi0->periodicityAndOffset->choice.slots320 = 20; + nzpcsi0->periodicityAndOffset->choice.slots320 = 0; nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS)); *nzpcsi0->qcl_InfoPeriodicCSI_RS=0; ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0); From a87741cedadf6a4928eef15d60f35bd557596e03 Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 25 Mar 2022 10:48:15 +0000 Subject: [PATCH 728/883] Ubuntu 20.04 compilation support added in buil-oai Compilation flag updated for native architecture Signed-off-by: Manish --- cmake_targets/CMakeLists.txt | 2 +- cmake_targets/tools/build_helper | 46 ++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 46e33e8803..506fad9a4d 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -236,7 +236,7 @@ endif() add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP") -set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic") +set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -march=native") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops") diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 55a39c6b2b..792246338d 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -103,6 +103,8 @@ get_distribution_release() { check_supported_distribution() { local distribution=$(get_distribution_release) case "$distribution" in + "ubuntu21.04") return 0 ;; + "ubuntu20.04") return 0 ;; "ubuntu18.04") return 0 ;; "ubuntu17.10") return 0 ;; "ubuntu17.04") return 0 ;; @@ -574,7 +576,16 @@ check_install_soapy () { check_install_additional_tools (){ $SUDO $INSTALLER update -y + local optional_packages="" if [[ "$OS_DISTRO" == "ubuntu" ]]; then + case "$(get_distribution_release)" in + "ubuntu14.04"| "ubuntu16.04"| "ubuntu17.04"| "ubuntu17.10"| "ubuntu18.04") + optional_packages="python-dev python-pexpect python-numpy python-scipy python-matplotlib" + ;; + "ubuntu20.04"| "ubuntu21.04") + optional_packages="python3 python3-pip python3-dev python3-scipy python3-matplotlib exuberant-ctags" + ;; + esac PACKAGE_LIST="\ check \ dialog \ @@ -584,8 +595,6 @@ check_install_additional_tools (){ libpthread-stubs0-dev \ openvpn \ pkg-config \ - python-dev \ - python-pexpect \ sshfs \ swig \ tshark \ @@ -598,13 +607,10 @@ check_install_additional_tools (){ iperf3 \ android-tools-adb \ wvdial \ - python-numpy \ sshpass \ nscd \ bc \ - ntp \ - python-scipy \ - python-matplotlib" + ntp" elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then PACKAGE_LIST="\ check \ @@ -662,7 +668,7 @@ check_install_additional_tools (){ python2-scipy \ python2-matplotlib" fi - $SUDO $INSTALLER install -y $PACKAGE_LIST + $SUDO $INSTALLER install -y $PACKAGE_LIST $optional_packages $SUDO rm -fr /opt/ssh $SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh @@ -697,23 +703,33 @@ check_install_oai_software() { $SUDO apt install -y software-properties-common case "$(get_distribution_release)" in "ubuntu14.04") - specific_packages="libtasn1-3-dev libgnutls-dev libatlas-dev iproute libconfig8-dev" + specific_packages="libtasn1-3-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-de python-pip pydb" # For iperf3 $SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe" $SUDO apt-get update ;; "ubuntu16.04") - specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev" + specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb" ;; "ubuntu17.04") - specific_packages="libtasn1-6-dev libgnutls28-dev libatlas-dev iproute libconfig8-dev" + specific_packages="libtasn1-6-dev libgnutls28-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb" ;; "ubuntu17.10") - specific_packages="libtasn1-6-dev libgnutls28-dev iproute libconfig8-dev" + specific_packages="libtasn1-6-dev libgnutls28-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb" LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" ;; "ubuntu18.04") + specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev iptables-dev libgcrypt11-dev python-pip pydb" + LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" + LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" + ;; + "ubuntu20.04") + specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev" + LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" + LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" + ;; + "ubuntu21.04") specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev" LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" @@ -741,15 +757,13 @@ check_install_oai_software() { guile-2.0-dev \ iperf \ iptables \ - iptables-dev \ libatlas-base-dev \ libblas-dev \ - liblapack-dev\ - liblapacke-dev\ + liblapack-dev \ + liblapacke-dev \ libffi-dev \ libforms-bin \ libforms-dev \ - libgcrypt11-dev \ libgmp-dev \ libgtk-3-dev \ libidn2-0-dev \ @@ -772,8 +786,6 @@ check_install_oai_software() { python \ subversion \ xmlstarlet \ - python-pip \ - pydb \ libyaml-dev \ wget \ libxpm-dev \ From 8f64e6414c02d1b9eb9820c3d4f653af3441edfd Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 25 Mar 2022 10:55:54 +0000 Subject: [PATCH 729/883] Build document updated for compilation on Ubuntu 20 using buil-oai Signed-off-by: Manish --- doc/BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/BUILD.md b/doc/BUILD.md index 852a248659..a52ce98cb5 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -77,7 +77,7 @@ cd cmake_targets/ ./build_oai -I -w USRP --eNB --UE --nrUE --gNB ``` -- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. Note: for Ubuntu 20 use cmake_targets/install_external_packages.ubuntu20 instead! +- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. - The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. The RF simulator[RF simulator](../targets/ARCH/rfsimulator/README.md) is implemented as a specific device replacing RF hardware, it can be specifically built using `-w SIMU` option, but is also built during any softmodem build. - `--eNB` is to build the `lte-softmodem` executable and all required shared libraries - `--gNB` is to build the `nr-softmodem` executable and all required shared libraries From 08c06b96ad4c877ebe8e764a9d10f10976f0ed63 Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 25 Mar 2022 11:29:20 +0000 Subject: [PATCH 730/883] install_external_packages.ubuntu20 file removed native architecture flag removed as compilation happen on diffrent server in CI Signed-off-by: Manish --- cmake_targets/CMakeLists.txt | 2 +- .../install_external_packages.ubuntu20 | 499 ------------------ 2 files changed, 1 insertion(+), 500 deletions(-) delete mode 100755 cmake_targets/install_external_packages.ubuntu20 diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 506fad9a4d..46e33e8803 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -236,7 +236,7 @@ endif() add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP") -set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -march=native") +set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=gnu99 -funroll-loops") diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20 deleted file mode 100755 index a2f6a9709c..0000000000 --- a/cmake_targets/install_external_packages.ubuntu20 +++ /dev/null @@ -1,499 +0,0 @@ -#!/bin/bash -#/* -# * 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 -# */ - -# brief -# authors Laurent Thomas -# -####################################### - -if [ ! -f /etc/os-release ]; then - echo "No /etc/os-release file found. You're likely on an unsupported distro." - exit 1 -fi -OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g") -OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g") -case "$OS_DISTRO" in - ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt"; CMAKE="cmake" ;; -esac - -SUDO='sudo -E' - -############################### -## echo and family -############################### -black='\E[30m' -red='\E[31m' -green='\E[32m' -yellow='\E[33m' -blue='\E[1;34m' -magenta='\E[35m' -cyan='\E[36m' -white='\E[37m' -reset_color='\E[00m' -COLORIZE=1 - -cecho() { - # Color-echo - # arg1 = message - # arg2 = color - local default_msg="No Message." - message=${1:-$default_msg} - color=${2:-$green} - [ "$COLORIZE" = "1" ] && message="$color$message$reset_color" - echo -e "$message" - return -} - -echo_error() { cecho "$* $red" ;} -echo_fatal() { cecho "$* $red"; exit 1 ;} -echo_warning() { cecho "$* $yellow" ;} -echo_success() { cecho "$* $green" ;} -echo_info() { cecho "$* $blue" ;} - -######################## -# distribution helpers # -######################## - -# This function return a string to identify the distribution we are running -# Examples: -# ubuntu16.04 -# debian8.5 -get_distribution_release() { - echo "$OS_DISTRO$OS_RELEASE" -} - -check_supported_distribution() { - case $(get_distribution_release) in - "ubuntu20.04") return 0 ;; - "ubuntu20.10") return 0 ;; - "ubuntu21.04") return 0 ;; - "ubuntu21.10") return 0 ;; - esac - return 1 -} - -################## -# Error handlers # -################## - -handler_EXIT() { - local exit_code=$? - [ "$exit_code" -eq 0 ] || echo_error "build have failed" - exit $exit_code -} - -trap handler_EXIT EXIT - -########################### -# Cleaners -########################### - -clean_kernel() { - $SUDO modprobe ip_tables - $SUDO modprobe x_tables - $SUDO iptables -P INPUT ACCEPT - $SUDO iptables -F INPUT - $SUDO iptables -P OUTPUT ACCEPT - $SUDO iptables -F OUTPUT - $SUDO iptables -P FORWARD ACCEPT - $SUDO iptables -F FORWARD - $SUDO iptables -t nat -F - $SUDO iptables -t mangle -F - $SUDO iptables -t filter -F - $SUDO iptables -t raw -F - echo_info "Flushed iptables" - $SUDO rmmod nasmesh > /dev/null 2>&1 - $SUDO rmmod oai_nw_drv > /dev/null 2>&1 - $SUDO rmmod openair_rf > /dev/null 2>&1 - $SUDO rmmod ue_ip > /dev/null 2>&1 - echo_info "removed drivers from kernel" -} - -clean_all_files() { - set_openair_env - rm -rf "$OPENAIR_DIR"/targets/bin/* - dir="$OPENAIR_DIR/cmake_targets" - rm -rf "$dir"/log/* - rm -rf "$dir"/ran_build/build - rm -rf "$dir"/ran_build_noLOG/build - rm -rf "$dir"/lte-simulators/build - rm -rf "$dir"/nas_sim_tools/build - rm -rf "$dir"/oaisim_build_oai/build - rm -rf "$dir"/oaisim_build_oai/CMakeLists.txt - rm -rf "$dir"/autotests/bin - rm -rf "$dir"/autotests/log - rm -rf "$dir"/autotests/*/build -} - -############################################ -# External packages installers -############################################ - -install_protobuf_from_source(){ - protobuf_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_install_log.txt - echo_info "\nInstalling Google Protobuf from sources. The log file for Protobuf installation is here: $protobuf_install_log " - ( - cd /tmp || exit - echo "Downloading protobuf" - #rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1 - #wget https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz - #tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner - #cd protobuf-2.6.1/ - rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0 - wget --tries=3 --retry-connrefused https://github.com/protocolbuffers/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz - tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner "$USER" --group "$(groups | cut -d" " -f1)" --no-same-owner - cd protobuf-3.3.0/ || exit - ./configure - echo "Compiling protobuf" - make -j"$(nproc)" - $SUDO make install - $SUDO ldconfig - ) >& "$protobuf_install_log" -} - -install_protobuf_c_from_source(){ - protobuf_c_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_c_install_log.txt - echo_info "\nInstalling Google Protobuf_C from sources. The log file for Protobuf_C installation is here: $protobuf_c_install_log " - ( - if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig - fi - cd /tmp || exit - echo "Downloading protobuf-c" - rm -rf /tmp/protobuf-c - git clone https://github.com/protobuf-c/protobuf-c.git - cd protobuf-c || exit - git checkout 2a46af42784abf86804d536f6e0122d47cfeea45 - ./autogen.sh - ./configure - echo "Compiling protobuf-c" - make -j"$(nproc)" - $SUDO make install - $SUDO ldconfig - ) >& "$protobuf_c_install_log" -} - -install_usrp_uhd_driver_from_source(){ - uhd_install_log=$OPENAIR_DIR/cmake_targets/log/uhd_install_log.txt - echo_info "\nInstalling UHD driver from sources. The log file for UHD driver installation is here: $uhd_install_log " - ( - cd /tmp || exit - echo "Downloading UHD driver" - rm -rf /tmp/uhd - git clone https://github.com/EttusResearch/uhd.git - cd uhd || exit - git checkout UHD-3.15.LTS - mkdir -p host/build - cd host/build || exit - $CMAKE ../ -GNinja - echo "Compiling UHD" - ninja - $SUDO ninja install - $SUDO ldconfig - $SUDO /usr/lib/uhd/utils/uhd_images_downloader.py - ) >& "$uhd_install_log" -} - -install_bladerf_driver_from_source(){ - bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt - echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log " - ( - cd /tmp || exit - echo "Downloading BladeRF driver" - rm -rf /tmp/bladeRF - git clone https://github.com/Nuand/bladeRF.git - cd bladeRF || exit - git checkout tags/2016.06 - mkdir -p build - cd build || exit - $CMAKE ../ - echo "Compiling BladeRF driver" - make -j"$(nproc)" - $SUDO make install - $SUDO ldconfig - echo "Downloading FPGA and firmware images" - cd /tmp/bladeRF || exit - wget --tries=3 --retry-connrefused https://www.nuand.com/fx3/bladeRF_fw_latest.img - wget --tries=3 --retry-connrefused https://www.nuand.com/fpga/hostedx40-latest.rbf - sudo mkdir -p /usr/share/Nuand/bladeRF - sudo mv bladeRF_fw_latest.img /usr/share/Nuand/bladeRF/bladeRF_fw.img - sudo mv hostedx40-latest.rbf /usr/share/Nuand/bladeRF/hostedx40.rbf - ) >& "$bladerf_install_log" -} - -check_install_bladerf_driver(){ - if [[ "$OS_DISTRO" == "ubuntu" ]]; then - $SUDO apt-get install -y bladerf libbladerf-dev - $SUDO apt-get install -y bladerf-firmware-fx3 - $SUDO apt-get install -y bladerf-fpga-hostedx40 - elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then - install_bladerf_driver_from_source - else - echo_error "BladeRF Installer for OAI does not support automatic build. Install BladeRF compiling sources manually from BladeRF website" - fi -} - -flash_firmware_bladerf() { - $SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img -} - -install_soapy_from_source(){ - soapy_install_log=$OPENAIR_DIR/cmake_targets/log/soapy_install_log.txt - echo_info "\nInstalling Soapy EcoSystem from source. The log file for Soapy installation is here: $soapy_install_log " - ( - cd /tmp || exit - echo "Downloading SoapySDR" - rm -rf /tmp/soapysdr - git clone -b soapy-sdr-0.7.0 --single-branch https://github.com/pothosware/SoapySDR.git - cd SoapySDR || exit - #git checkout tags/release_003_010_001_001 - mkdir -p build - cd build || exit - $CMAKE ../ - echo "Compiling SoapySDR" - make -j"$(nproc)" - $SUDO make install - $SUDO ldconfig - cd /tmp || exit - echo "Downloading SoapyRemote" - rm -rf /tmp/soapyremote - git clone -b soapy-remote-0.5.0 --single-branch https://github.com/pothosware/SoapyRemote.git - cd SoapyRemote || exit - #git checkout tags/release_003_010_001_001 - mkdir -p build - cd build || exit - cmake ../ - echo "Compiling SoapyRemote" - make -j"$(nproc)" - $SUDO make install - $SUDO ldconfig - ) >& "$soapy_install_log" -} - -install_soapy_iris_from_source(){ - iris_install_log=$OPENAIR_DIR/cmake_targets/log/iris_install_log.txt - echo_info "\nInstalling Iris driver from source. The log file for Iris driver installation is here: $iris_install_log " - ( - cd /tmp || exit - echo "Downloading SoapyIris" - rm -rf /tmp/sklk-soapyiris - git clone -b soapy-iris-2018.08.0.1 --single-branch https://github.com/skylarkwireless/sklk-soapyiris.git - cd sklk-soapyiris || exit - mkdir -p build - cd build ||exit - cmake ../ - echo "Compiling SoapyIris" - make -j"$(nproc)" - $SUDO make install - $SUDO ldconfig - ) >& "$iris_install_log" -} - -check_install_soapy () { - #if [[ "$OS_DISTRO" == "ubuntu" ]]; then - #first we remove old installation - $SUDO apt-get remove -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote || true - #$SUDO add-apt-repository -y ppa:myriadrf/drivers - #$SUDO apt-get update - #$SUDO apt-get install -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote - - #elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then - # $SUDO $INSTALLER -y install software-properties-common python3-software-properties python-software-properties subversion git python3 python-numpy python3-numpy cmake swig python-dev - install_soapy_from_source - #fi - install_soapy_iris_from_source - -} - -check_install_ubuntu_packages() { - $SUDO $INSTALLER update -y - if [[ "$OS_DISTRO" == "ubuntu" ]]; then - local LAPACK_LIBNAME="liblapack.so" - local LAPACK_TARGET="/usr/lib/atlas-base/atlas/liblapack.so" - $SUDO apt install -y software-properties-common - case "$(get_distribution_release)" in - "ubuntu20.04") - specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev" - LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" - LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" - ;; - "ubuntu21.04") - specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev" - LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" - LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" - ;; - esac - $SUDO $INSTALLER install -y \ - $specific_packages \ - check \ - dialog \ - dkms \ - gawk \ - libboost-all-dev \ - libpthread-stubs0-dev \ - openvpn \ - pkg-config \ - python3-dev \ - sshfs \ - swig \ - tshark \ - uml-utilities \ - unzip \ - valgrind \ - vlan \ - exuberant-ctags \ - ntpdate \ - iperf3 \ - android-tools-adb \ - wvdial \ - sshpass \ - nscd \ - bc \ - ntp \ - python3-scipy \ - python3-matplotlib \ - bison \ - build-essential \ - cmake \ - cmake-curses-gui \ - ninja-build \ - doxygen \ - doxygen-gui \ - texlive-latex-base \ - ethtool \ - flex \ - gdb \ - git \ - graphviz \ - gtkwave \ - iperf \ - iptables \ - libxtables-dev \ - libatlas-base-dev \ - libblas-dev \ - liblapack-dev\ - liblapacke-dev\ - libffi-dev \ - libforms-bin \ - libforms-dev \ - libgcrypt20-dev \ - libgmp-dev \ - libgtk-3-dev \ - libidn2-0-dev \ - libidn11-dev \ - libmysqlclient-dev \ - libpython2.7-dev \ - libsctp1 \ - libsctp-dev \ - libssl-dev \ - libtool \ - libusb-1.0-0-dev \ - libxml2 \ - libxml2-dev \ - libxslt1-dev \ - octave-signal \ - openssh-client \ - openssh-server \ - openssl \ - python3 \ - subversion \ - xmlstarlet \ - python3-pip \ - libyaml-dev \ - wget \ - libxpm-dev \ - libboost-all-dev \ - nettle-dev \ - nettle-bin \ - libreadline-dev - fi - - $SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET" - -} - -install_asn1c_from_source(){ - asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt - echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log " - ( - $SUDO rm -rf /tmp/asn1c - # GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c - git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c - cd /tmp/asn1c || exit - # better to use a given commit than a branch in case the branch - # is updated and requires modifications in the source of OAI - #git checkout velichkov_s1ap_plus_option_group - git checkout f12568d617dbf48497588f8e227d70388fa217c9 - autoreconf -iv - ./configure - make -j"$(nproc)" - $SUDO make install - cd - || exit - $SUDO ldconfig - ) > "$asn1_install_log" 2>&1 -} - -################################ -# set_openair_env -############################### -set_openair_env(){ - fullpath=$(readlink -f "${BASH_SOURCE[0]}") - [ -f "/.$fullpath" ] || fullpath=$(readlink -f "$PWD/$fullpath") - openair_path=${fullpath%/cmake_targets/*} - openair_path=${openair_path%/targets/*} - openair_path=${openair_path%/openair[123]/*} - export OPENAIR_DIR=$openair_path - export OPENAIR1_DIR=$openair_path/openair1 - export OPENAIR2_DIR=$openair_path/openair2 - export OPENAIR3_DIR=$openair_path/openair3 - export OPENAIR_TARGETS=$openair_path/targets -} - -if ! check_supported_distribution; then - echo_error "Your distribution $(get_distribution_release) is not supported by oai !" - exit 1 -fi -set_openair_env -echo_info "Installing packages" -check_install_ubuntu_packages - -echo_info "installing ASN.1 compiler" -install_asn1c_from_source - -echo_info "installing protobuf/protobuf-c for flexran agent support" -install_protobuf_from_source -install_protobuf_c_from_source - -if [ "$1" == "USRP" ] ; then - echo_info "installing packages for USRP support" - install_usrp_uhd_driver -fi -if [ "$1" == "BLADERF" ] ; then - echo_info "installing packages for BLADERF support" - check_install_bladerf_driver - flash_firmware_bladerf -fi -if [ "$1" == "IRIS" ] ; then - echo_info "installing packages for IRIS support" - check_install_soapy - # flash_firmware_iris -fi From 686bacabbebc7938ec07c446dc81b26db65c52a6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Mar 2022 15:00:55 +0100 Subject: [PATCH 731/883] Do not trap ^C in build_oai, and remove unused bash function --- cmake_targets/build_oai | 1 - cmake_targets/tools/build_helper | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index c65728a41d..ecfc7d7387 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -59,7 +59,6 @@ BUILD_ECLIPSE=0 NR="False" OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope" RU=0 -trap handle_ctrl_c INT function print_help() { echo_info " diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 792246338d..afc0a6ae2b 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -967,23 +967,3 @@ do fi done } - - -# get from http://www.linuxjournal.com/content/validating-ip-address-bash-script -validate_ip() { - -local ip=$1 -local stat=1 - -if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then - OIFS=$IFS - IFS='.' - ip=($ip) - IFS=$OIFS - [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ - && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] - stat=$? -fi - -return $stat -} From a2e7a770c021fedff1243344352273ccc7aebea6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Mar 2022 15:05:05 +0100 Subject: [PATCH 732/883] Remove unused ssh repository --- cmake_targets/tools/build_helper | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index afc0a6ae2b..adc9d6d9e9 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -670,9 +670,6 @@ check_install_additional_tools (){ fi $SUDO $INSTALLER install -y $PACKAGE_LIST $optional_packages - $SUDO rm -fr /opt/ssh - $SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh - #The packages below are already installed for Redhat distros (RHEL, CentOS, Fedora) if [[ "$OS_DISTRO" == "ubuntu" ]]; then $SUDO -H pip install paramiko @@ -872,8 +869,6 @@ check_install_oai_software() { fi install_asn1c_from_source $1 - $SUDO rm -fr /opt/ssh - $SUDO git clone https://gist.github.com/2190472.git /opt/ssh } install_asn1c_from_source(){ From 951682821c07e45031296c34da68efe485b9cd23 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Mar 2022 15:19:18 +0100 Subject: [PATCH 733/883] Remove old Ubuntu releases --- cmake_targets/tools/build_helper | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index adc9d6d9e9..aa01c35e1c 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -106,10 +106,7 @@ check_supported_distribution() { "ubuntu21.04") return 0 ;; "ubuntu20.04") return 0 ;; "ubuntu18.04") return 0 ;; - "ubuntu17.10") return 0 ;; - "ubuntu17.04") return 0 ;; "ubuntu16.04") return 0 ;; - "ubuntu14.04") return 0 ;; "fedora24") return 0 ;; "rhel7") return 0 ;; "rhel7.6") return 0 ;; @@ -473,10 +470,6 @@ install_bladerf_driver_from_source(){ check_install_bladerf_driver(){ if [[ "$OS_DISTRO" == "ubuntu" ]]; then - if [ "$(get_distribution_release)" == "ubuntu14.04" ] ; then - $SUDO add-apt-repository -y ppa:bladerf/bladerf - $SUDO apt-get update - fi $SUDO apt-get install -y bladerf libbladerf-dev $SUDO apt-get install -y bladerf-firmware-fx3 $SUDO apt-get install -y bladerf-fpga-hostedx40 @@ -579,7 +572,7 @@ check_install_additional_tools (){ local optional_packages="" if [[ "$OS_DISTRO" == "ubuntu" ]]; then case "$(get_distribution_release)" in - "ubuntu14.04"| "ubuntu16.04"| "ubuntu17.04"| "ubuntu17.10"| "ubuntu18.04") + "ubuntu16.04"| "ubuntu18.04") optional_packages="python-dev python-pexpect python-numpy python-scipy python-matplotlib" ;; "ubuntu20.04"| "ubuntu21.04") @@ -699,23 +692,9 @@ check_install_oai_software() { local LAPACK_TARGET="/usr/lib/atlas-base/atlas/liblapack.so" $SUDO apt install -y software-properties-common case "$(get_distribution_release)" in - "ubuntu14.04") - specific_packages="libtasn1-3-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-de python-pip pydb" - # For iperf3 - $SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe" - $SUDO apt-get update - ;; "ubuntu16.04") specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb" ;; - "ubuntu17.04") - specific_packages="libtasn1-6-dev libgnutls28-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb" - ;; - "ubuntu17.10") - specific_packages="libtasn1-6-dev libgnutls28-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb" - LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" - LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" - ;; "ubuntu18.04") specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev iptables-dev libgcrypt11-dev python-pip pydb" LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" From 38e0bacf2661e75bf43c04394b69704a140e3226 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Mar 2022 16:57:14 +0100 Subject: [PATCH 734/883] Install protobuf from repository if available --- cmake_targets/build_oai | 3 +- cmake_targets/tools/build_helper | 51 +++++++++----------------------- 2 files changed, 15 insertions(+), 39 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index ecfc7d7387..8d221dd9f2 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -564,8 +564,7 @@ function main() { #fi fi echo_info "Installing protobuf/protobuf-c for flexran agent support" - install_protobuf_from_source - install_protobuf_c_from_source + install_protobuf_c echo_success "protobuf/protobuf-c installation successful" fi diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index aa01c35e1c..68ad2e18b5 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -251,43 +251,6 @@ compilations() { # External packages installers ############################################ -install_protobuf_from_source(){ - protobuf_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_install_log.txt - echo_info "\nInstalling Google Protobuf from sources. The log file for Protobuf installation is here: $protobuf_install_log " - ( - cd /tmp - echo "Downloading protobuf" - #rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1 - #wget https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz - #tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner - #cd protobuf-2.6.1/ - - if [ $IS_CONTAINER -eq 0 ] - then - rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0 - wget --tries=3 --retry-connrefused https://github.com/protocolbuffers/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz - tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $(id -u) --group $(id -g) --no-same-owner - cd protobuf-3.3.0/ - else - export LD_LIBRARY_PATH=/usr/local/lib #protoc needs to know where toclook for shared libs - rm -rf /tmp/protobuf - git clone --depth=1 --branch=v3.3.0 https://github.com/protocolbuffers/protobuf.git /tmp/protobuf - cd /tmp/protobuf - git submodule update --init --recursive - ./autogen.sh - fi - ./configure - echo "Compiling protobuf" - make -j`nproc` - $SUDO make install - $SUDO ldconfig - if [[ -v CI_ENV ]]; then - cd /tmp - $SUDO rm -rf protobuf* - fi - ) >& $protobuf_install_log -} - install_protobuf_c_from_source(){ protobuf_c_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_c_install_log.txt echo_info "\nInstalling Google Protobuf_C from sources. The log file for Protobuf_C installation is here: $protobuf_c_install_log " @@ -314,6 +277,20 @@ install_protobuf_c_from_source(){ ) >& $protobuf_c_install_log } +install_protobuf_c() { + local protobuf_packages="" + case "$(get_distribution_release)" in + "ubuntu18.04" | "ubuntu20.04" | "ubuntu21.04") + protobuf_packages="protobuf-c-compiler libprotobuf-c1 libprotobuf-c-dev" + ;; + esac + if [[ "$protobuf_packages" == "" ]]; then + install_protobuf_c_from_source + else + $SUDO $INSTALLER -y install $protobuf_packages + fi +} + install_usrp_uhd_driver_from_source(){ uhd_install_log=$OPENAIR_DIR/cmake_targets/log/uhd_install_log.txt echo_info "\nInstalling UHD driver from sources. The log file for UHD driver installation is here: $uhd_install_log " From 51e3b6c79022d7e8113469d3ad6ace04c7bd7e92 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Mar 2022 17:11:24 +0100 Subject: [PATCH 735/883] Add support for Fedora 35 and add missing gcc/g++ packages (both required) --- cmake_targets/tools/build_helper | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 68ad2e18b5..bdb96b0a83 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -107,7 +107,7 @@ check_supported_distribution() { "ubuntu20.04") return 0 ;; "ubuntu18.04") return 0 ;; "ubuntu16.04") return 0 ;; - "fedora24") return 0 ;; + "fedora35") return 0 ;; "rhel7") return 0 ;; "rhel7.6") return 0 ;; "rhel7.7") return 0 ;; @@ -284,6 +284,11 @@ install_protobuf_c() { protobuf_packages="protobuf-c-compiler libprotobuf-c1 libprotobuf-c-dev" ;; esac + case "$OS_DISTRO" in + "rhel" | "centos" | "fedora") # in EPEL and Fedora repos (at least as of 35) + protobuf_packages="protobuf-c-compiler protobuf-c protobuf-c-devel" + ;; + esac if [[ "$protobuf_packages" == "" ]]; then install_protobuf_c_from_source else @@ -703,6 +708,8 @@ check_install_oai_software() { texlive-latex-base \ ethtool \ flex \ + g++ \ + gcc \ gdb \ git \ graphviz \ @@ -756,8 +763,6 @@ check_install_oai_software() { $SUDO $INSTALLER install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm fi $SUDO $INSTALLER install -y python-epdb vim-common - else - $SUDO $INSTALLER install -y pydb fi $SUDO $INSTALLER install -y \ @@ -769,6 +774,8 @@ check_install_oai_software() { doxygen \ ethtool \ flex \ + g++ \ + gcc \ gdb \ git \ graphviz \ From 1fc659331fe0d65930dda34a5a616022d284c8f8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Mar 2022 17:32:26 +0100 Subject: [PATCH 736/883] Stop build_oai after dep installation if no compilation requested --- cmake_targets/build_oai | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 8d221dd9f2..31acd2e8fb 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -573,19 +573,6 @@ function main() { check_install_additional_tools fi - - - echo_info "3. building the compilation directives ..." - - DIR=$OPENAIR_DIR/cmake_targets - - [ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build - mkdir -p $DIR/$BUILD_DIR/build - - cd $DIR/$BUILD_DIR/build - echo_info "running $CMAKE_CMD" - eval $CMAKE_CMD ../.. - execlist="" if [ "$eNB" = "1" ] ; then execlist="$execlist lte-softmodem" @@ -605,10 +592,25 @@ function main() { if [ "$nrUE" = 1 ] ; then execlist="$execlist nr-uesoftmodem" fi - if [ "$ittiSIM" = "1" ] ; then execlist="$execlist nr-ittisim" fi + + if [[ "$execlist" == "" && "$SIMUS_PHY" != "1" ]]; then + echo_success "installing dependencies successful" + exit + fi + + echo_info "3. building the compilation directives ..." + + DIR=$OPENAIR_DIR/cmake_targets + + [ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build + mkdir -p $DIR/$BUILD_DIR/build + + cd $DIR/$BUILD_DIR/build + echo_info "running $CMAKE_CMD" + eval $CMAKE_CMD ../.. for f in $execlist ; do echo_info "Compiling $f..." From 255f4f1f402a7c0ac67c9c96bfc9737ee0043678 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Mar 2022 18:18:24 +0100 Subject: [PATCH 737/883] Fix additional packages for Fedora 35 --- cmake_targets/tools/build_helper | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index bdb96b0a83..1763d681a6 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -631,17 +631,17 @@ check_install_additional_tools (){ valgrind \ vconfig \ ctags \ - ntpdate \ + ntpsec \ iperf3 \ wvdial \ python-numpy \ sshpass \ nscd \ - python2-paramiko \ + python-paramiko \ python-pyroute2 \ python-netifaces \ - python2-scipy \ - python2-matplotlib" + python-scipy \ + python-matplotlib" fi $SUDO $INSTALLER install -y $PACKAGE_LIST $optional_packages From df93c43ec45fdde023c55e2a7c8a4302e4c997c5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 25 Mar 2022 18:30:23 +0100 Subject: [PATCH 738/883] Add support for Ubuntu 22 --- cmake_targets/tools/build_helper | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 1763d681a6..e6801902bb 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -103,6 +103,7 @@ get_distribution_release() { check_supported_distribution() { local distribution=$(get_distribution_release) case "$distribution" in + "ubuntu22.04") return 0 ;; "ubuntu21.04") return 0 ;; "ubuntu20.04") return 0 ;; "ubuntu18.04") return 0 ;; @@ -280,7 +281,7 @@ install_protobuf_c_from_source(){ install_protobuf_c() { local protobuf_packages="" case "$(get_distribution_release)" in - "ubuntu18.04" | "ubuntu20.04" | "ubuntu21.04") + "ubuntu18.04" | "ubuntu20.04" | "ubuntu21.04" | "ubuntu22.04") protobuf_packages="protobuf-c-compiler libprotobuf-c1 libprotobuf-c-dev" ;; esac @@ -555,10 +556,10 @@ check_install_additional_tools (){ if [[ "$OS_DISTRO" == "ubuntu" ]]; then case "$(get_distribution_release)" in "ubuntu16.04"| "ubuntu18.04") - optional_packages="python-dev python-pexpect python-numpy python-scipy python-matplotlib" + optional_packages="python-dev python-pexpect python-numpy python-scipy python-matplotlib ctags" ;; - "ubuntu20.04"| "ubuntu21.04") - optional_packages="python3 python3-pip python3-dev python3-scipy python3-matplotlib exuberant-ctags" + "ubuntu20.04" | "ubuntu21.04" | "ubuntu22.04" ) + optional_packages="python3 python3-pip python3-dev python3-scipy python3-matplotlib universal-ctags" ;; esac PACKAGE_LIST="\ @@ -577,7 +578,6 @@ check_install_additional_tools (){ unzip \ valgrind \ vlan \ - ctags \ ntpdate \ iperf3 \ android-tools-adb \ @@ -675,20 +675,25 @@ check_install_oai_software() { $SUDO apt install -y software-properties-common case "$(get_distribution_release)" in "ubuntu16.04") - specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb" + specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb python guile-2.0-dev" ;; "ubuntu18.04") - specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev iptables-dev libgcrypt11-dev python-pip pydb" + specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev iptables-dev libgcrypt11-dev python-pip pydb python guile-2.0-dev" LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" ;; "ubuntu20.04") - specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev" + specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev python guile-2.0-dev" LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" ;; "ubuntu21.04") - specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev" + specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev python guile-2.0-dev" + LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" + LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" + ;; + "ubuntu22.04") + specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev python2 guile-2.2-dev" LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu" LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so" ;; @@ -714,7 +719,6 @@ check_install_oai_software() { git \ graphviz \ gtkwave \ - guile-2.0-dev \ iperf \ iptables \ libatlas-base-dev \ @@ -743,7 +747,6 @@ check_install_oai_software() { openssh-client \ openssh-server \ openssl \ - python \ subversion \ xmlstarlet \ libyaml-dev \ From 8c8f3f8678c939c4ed47df5a71e5ab00dd1f51d3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 26 Mar 2022 10:43:47 +0100 Subject: [PATCH 739/883] Compiling protobuf-c requires protobuf, so add it --- cmake_targets/tools/build_helper | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index e6801902bb..554f3ccfe5 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -252,6 +252,43 @@ compilations() { # External packages installers ############################################ +install_protobuf_from_source(){ + protobuf_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_install_log.txt + echo_info "\nInstalling Google Protobuf from sources. The log file for Protobuf installation is here: $protobuf_install_log " + ( + cd /tmp + echo "Downloading protobuf" + #rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1 + #wget https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz + #tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner + #cd protobuf-2.6.1/ + + if [ $IS_CONTAINER -eq 0 ] + then + rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0 + wget --tries=3 --retry-connrefused https://github.com/protocolbuffers/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz + tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $(id -u) --group $(id -g) --no-same-owner + cd protobuf-3.3.0/ + else + export LD_LIBRARY_PATH=/usr/local/lib #protoc needs to know where toclook for shared libs + rm -rf /tmp/protobuf + git clone --depth=1 --branch=v3.3.0 https://github.com/protocolbuffers/protobuf.git /tmp/protobuf + cd /tmp/protobuf + git submodule update --init --recursive + ./autogen.sh + fi + ./configure + echo "Compiling protobuf" + make -j`nproc` + $SUDO make install + $SUDO ldconfig + if [[ -v CI_ENV ]]; then + cd /tmp + $SUDO rm -rf protobuf* + fi + ) >& $protobuf_install_log +} + install_protobuf_c_from_source(){ protobuf_c_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_c_install_log.txt echo_info "\nInstalling Google Protobuf_C from sources. The log file for Protobuf_C installation is here: $protobuf_c_install_log " @@ -291,6 +328,7 @@ install_protobuf_c() { ;; esac if [[ "$protobuf_packages" == "" ]]; then + install_protobuf_from_source install_protobuf_c_from_source else $SUDO $INSTALLER -y install $protobuf_packages From ee9ec777e643fe4a3ff521bf62a36076a94f0d2e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 26 Mar 2022 10:50:33 +0100 Subject: [PATCH 740/883] Update libprotobuf-c docker file paths (now installed from package) --- docker/Dockerfile.eNB.rhel8.2 | 2 +- docker/Dockerfile.eNB.ubuntu18 | 2 +- docker/Dockerfile.gNB.rhel8.2 | 2 +- docker/Dockerfile.gNB.ubuntu18 | 2 +- docker/Dockerfile.lteUE.rhel8.2 | 2 +- docker/Dockerfile.lteUE.ubuntu18 | 2 +- docker/Dockerfile.nrUE.rhel8.2 | 2 +- docker/Dockerfile.nrUE.ubuntu18 | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile.eNB.rhel8.2 b/docker/Dockerfile.eNB.rhel8.2 index 7924f5bd78..5296ac2172 100644 --- a/docker/Dockerfile.eNB.rhel8.2 +++ b/docker/Dockerfile.eNB.rhel8.2 @@ -96,7 +96,7 @@ COPY --from=enb-base \ # Now we are copying from builder-image the UHD files. COPY --from=enb-base /usr/local/bin/uhd_find_devices /usr/local/bin -COPY --from=enb-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib +COPY --from=enb-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib COPY --from=enb-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64 COPY --from=enb-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18 index 222a7f42bb..f95a03398a 100644 --- a/docker/Dockerfile.eNB.ubuntu18 +++ b/docker/Dockerfile.eNB.ubuntu18 @@ -83,7 +83,7 @@ COPY --from=enb-build \ COPY --from=enb-base /usr/local/bin/uhd_find_devices /usr/local/bin COPY --from=enb-base \ /usr/local/lib/libuhd.so.3.15.0 \ - /usr/local/lib/libprotobuf-c.so.1 \ + /usr/lib/x86_64-linux-gnu/libprotobuf-c.so.1 \ /usr/local/lib/ COPY --from=enb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin COPY --from=enb-base \ diff --git a/docker/Dockerfile.gNB.rhel8.2 b/docker/Dockerfile.gNB.rhel8.2 index 6a1b447a62..9ec7ee7556 100644 --- a/docker/Dockerfile.gNB.rhel8.2 +++ b/docker/Dockerfile.gNB.rhel8.2 @@ -100,7 +100,7 @@ COPY --from=gnb-base \ # Now we are copying from builder-image the UHD files. COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin -COPY --from=gnb-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib +COPY --from=gnb-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib COPY --from=gnb-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64 COPY --from=gnb-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin diff --git a/docker/Dockerfile.gNB.ubuntu18 b/docker/Dockerfile.gNB.ubuntu18 index 6f990db833..6a98c8d3ce 100644 --- a/docker/Dockerfile.gNB.ubuntu18 +++ b/docker/Dockerfile.gNB.ubuntu18 @@ -84,7 +84,7 @@ COPY --from=gnb-build \ COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin COPY --from=gnb-base \ /usr/local/lib/libuhd.so.3.15.0 \ - /usr/local/lib/libprotobuf-c.so.1 \ + /usr/lib/x86_64-linux-gnu/libprotobuf-c.so.1 \ /usr/local/lib/ COPY --from=gnb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin COPY --from=gnb-base \ diff --git a/docker/Dockerfile.lteUE.rhel8.2 b/docker/Dockerfile.lteUE.rhel8.2 index cc1be3d41d..ab7d224939 100644 --- a/docker/Dockerfile.lteUE.rhel8.2 +++ b/docker/Dockerfile.lteUE.rhel8.2 @@ -98,7 +98,7 @@ COPY --from=lte-ue-base \ # Now we are copying from builder-image the UHD files. COPY --from=lte-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin -COPY --from=lte-ue-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib +COPY --from=lte-ue-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib COPY --from=lte-ue-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64 COPY --from=lte-ue-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin diff --git a/docker/Dockerfile.lteUE.ubuntu18 b/docker/Dockerfile.lteUE.ubuntu18 index 292ac37e5f..b2a0fd6e93 100644 --- a/docker/Dockerfile.lteUE.ubuntu18 +++ b/docker/Dockerfile.lteUE.ubuntu18 @@ -86,7 +86,7 @@ COPY --from=lte-ue-build \ COPY --from=lte-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin COPY --from=lte-ue-base \ /usr/local/lib/libuhd.so.3.15.0 \ - /usr/local/lib/libprotobuf-c.so.1 \ + /usr/lib/x86_64-linux-gnu/libprotobuf-c.so.1 \ /usr/local/lib/ COPY --from=lte-ue-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin diff --git a/docker/Dockerfile.nrUE.rhel8.2 b/docker/Dockerfile.nrUE.rhel8.2 index d38e81bd71..498e6bedcf 100644 --- a/docker/Dockerfile.nrUE.rhel8.2 +++ b/docker/Dockerfile.nrUE.rhel8.2 @@ -103,7 +103,7 @@ COPY --from=nr-ue-base \ # Now we are copying from builder-image the UHD files. COPY --from=nr-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin -COPY --from=nr-ue-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib +COPY --from=nr-ue-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib COPY --from=nr-ue-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64 COPY --from=nr-ue-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin diff --git a/docker/Dockerfile.nrUE.ubuntu18 b/docker/Dockerfile.nrUE.ubuntu18 index 0fa219296b..0edfdd2160 100644 --- a/docker/Dockerfile.nrUE.ubuntu18 +++ b/docker/Dockerfile.nrUE.ubuntu18 @@ -88,7 +88,7 @@ COPY --from=nr-ue-build \ COPY --from=nr-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin COPY --from=nr-ue-base \ /usr/local/lib/libuhd.so.3.15.0 \ - /usr/local/lib/libprotobuf-c.so.1 \ + /usr/lib/x86_64-linux-gnu/libprotobuf-c.so.1 \ /usr/local/lib/ COPY --from=nr-ue-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin From 10b4f4331e940131fae968bfa7071f2c8a8e8eaa Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 29 Mar 2022 23:10:08 +0200 Subject: [PATCH 741/883] CQI report in slots 7/27 --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 18e4d76075..9854398501 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1598,7 +1598,7 @@ void fill_initial_SpCellConfig(int uid, csirep1->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; csirep1->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep1->reportConfigType.choice.periodic)); csirep1->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; - csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = (8 + (20 * uid)) % 320; + csirep1->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = (7 + (20 * uid)) % 320; ASN_SEQUENCE_ADD(&csirep1->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); csirep1->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI; csirep1->reportQuantity.choice.cri_RI_PMI_CQI=(NULL_t)0; @@ -1657,7 +1657,7 @@ void fill_initial_SpCellConfig(int uid, csirep2->reportConfigType.present = NR_CSI_ReportConfig__reportConfigType_PR_periodic; csirep2->reportConfigType.choice.periodic = calloc(1,sizeof(*csirep2->reportConfigType.choice.periodic)); csirep2->reportConfigType.choice.periodic->reportSlotConfig.present=NR_CSI_ReportPeriodicityAndOffset_PR_slots320; - csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = (28 + (20 * uid)) % 320; + csirep2->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320 = (27 + (20 * uid)) % 320; ASN_SEQUENCE_ADD(&csirep2->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list,pucchcsires1); csirep2->reportQuantity.present = NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP; csirep2->reportQuantity.choice.cri_RSRP=(NULL_t)0; From 8df0cc3aa93c59f6d5d6e6fd91073934babeed83 Mon Sep 17 00:00:00 2001 From: Manish Date: Tue, 29 Mar 2022 04:13:45 +0000 Subject: [PATCH 742/883] Compile time flag added for native architecture compilation Signed-off-by: Manish --- cmake_targets/build_oai | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 31acd2e8fb..5099743be1 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -59,6 +59,8 @@ BUILD_ECLIPSE=0 NR="False" OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope" RU=0 +CMAKE_C_FLAGS=() +CMAKE_CXX_FLAGS=() function print_help() { echo_info " @@ -182,6 +184,10 @@ function main() { until [ -z "$1" ] do case "$1" in + --archnative) + CMAKE_C_FLAGS+=("-march=native") + CMAKE_CXX_FLAGS+=("-march=native") + shift;; -c | --clean) CLEAN=1 shift;; @@ -609,6 +615,8 @@ function main() { mkdir -p $DIR/$BUILD_DIR/build cd $DIR/$BUILD_DIR/build + if [[ ${#CMAKE_C_FLAGS[@]} > 0 ]]; then CMAKE_CMD="$CMAKE_CMD -DCMAKE_C_FLAGS=\"${CMAKE_C_FLAGS[*]}\""; fi + if [[ ${#CMAKE_CXX_FLAGS[@]} > 0 ]]; then CMAKE_CMD="$CMAKE_CMD -DCMAKE_CXX_FLAGS=\"${CMAKE_CXX_FLAGS[*]}\""; fi echo_info "running $CMAKE_CMD" eval $CMAKE_CMD ../.. From 73277172f69f65acfc8ee3fa9f635c3b8d6d909d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 30 Mar 2022 08:00:46 +0200 Subject: [PATCH 743/883] Update build_oai -h --- cmake_targets/build_oai | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 5099743be1..9bb07ef6a4 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -64,9 +64,11 @@ CMAKE_CXX_FLAGS=() function print_help() { echo_info " -This program installs OpenAirInterface Software -You should have ubuntu 16.xx or 18.04 updated -Options +This script compiles OpenAirInterface Software, and can install dependencies +for a number of distributions (Ubuntu 18-22, Fedora, RHEL7/8). +Options: +--arch-native + Passes -march=native to the compiler. -c | --clean Erase all files to make a rebuild from start -C | --clean-all From 4a51762a83a07f30bb0dbc3b9a7f0cf51026362d Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 30 Mar 2022 13:46:48 +0200 Subject: [PATCH 744/883] feat(ci): adding automation for 5G NR SA L2 simulator with Proxy - Adding new templates for nFAPI in gNB and NR-UE images - Better entrypoint for NR-UE (alignment on others) - New Test method: StatsFromGenObject - At deployment, image name, size and date are printed - Initial scenario with 1 NR-UE and just ping operations - Trigger new child sub-pipeline for L2-sim-5G tests Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 20 ++ ci-scripts/cls_containerize.py | 81 ++++- ci-scripts/cls_oaicitest.py | 27 +- ci-scripts/main.py | 4 +- ci-scripts/ran.py | 29 +- ci-scripts/xml_class_list.yml | 1 + .../xml_files/container_5g_l2sim_tdd.xml | 115 +++++++ .../xml_files/container_5g_l2sim_tdd_down.xml | 38 +++ .../5g_l2sim_tdd/docker-compose.yaml | 322 ++++++++++++++++++ docker/Dockerfile.nrUE.rhel8.2 | 10 +- docker/Dockerfile.nrUE.ubuntu18 | 10 +- docker/scripts/generateTemplate.py | 12 +- docker/scripts/gnb_entrypoint.sh | 3 +- docker/scripts/gnb_parameters.yaml | 36 ++ docker/scripts/nr_ue_entrypoint.sh | 16 +- docker/scripts/nr_ue_parameters.yaml | 49 +++ 16 files changed, 743 insertions(+), 30 deletions(-) create mode 100644 ci-scripts/xml_files/container_5g_l2sim_tdd.xml create mode 100644 ci-scripts/xml_files/container_5g_l2sim_tdd_down.xml create mode 100644 ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml create mode 100644 docker/scripts/nr_ue_parameters.yaml diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index f5852bace5..a76323513f 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -238,6 +238,26 @@ pipeline { } } } + stage ("5G L2 Simulators") { + when { expression {doMandatoryTests} } + steps { + script { + triggerSlaveJob ('RAN-L2-Sim-Test-5G', 'Test-L2-Sim-Container-4G') + } + } + post { + always { + script { + finalizeSlaveJob('RAN-L2-Sim-Test-5G') + } + } + failure { + script { + currentBuild.result = 'FAILURE' + } + } + } + } stage ("NSA B200 Sanity Check") { when { expression {doMandatoryTests} } steps { diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index fdc2bc1597..533b32058f 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -93,6 +93,7 @@ class Containerize(): self.allImagesSize = {} self.collectInfo = {} + self.deployedContainers = [] self.tsharkStarted = False self.pingContName = '' self.pingOptions = '' @@ -680,12 +681,28 @@ class Containerize(): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps -a' count = 0 healthy = 0 + newContainers = [] while (count < 10): count += 1 containerStatus = [] deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) healthy = 0 for state in deployStatus.split('\n'): + res = re.search('Name|----------', state) + if res is not None: + continue + if len(state) == 0: + continue + res = re.search('^(?P[a-zA-Z0-9\-\_]+) ', state) + if res is not None: + cName = res.group('container_name') + found = False + for alreadyDeployed in self.deployedContainers: + if cName == alreadyDeployed: + found = True + if not found: + newContainers.append(cName) + self.deployedContainers.append(cName) if re.search('Up \(healthy\)', state) is not None: healthy += 1 if re.search('rfsim4g-db-init.*Exit 0', state) is not None: @@ -696,16 +713,33 @@ class Containerize(): else: time.sleep(10) + imagesInfo = '' + for newCont in newContainers: + cmd = 'docker inspect -f "{{.Config.Image}}" ' + newCont + imageName = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + imageName = str(imageName).strip() + cmd = 'docker image inspect --format "{{.RepoTags}}\t{{.Size}}\t{{.Created}}" ' + imageName + imagesInfo += subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + + html_queue = SimpleQueue() + html_cell = '
\n'
+		for imageInfo in imagesInfo.split('\n'):
+			html_cell += imageInfo[:-11] + '\n'
+		html_cell += '\n'
+		for cState in containerStatus:
+			html_cell += cState + '\n'
+		html_cell += '
' + html_queue.put(html_cell) if count == 100 and healthy == self.nb_healthy[0]: if self.tsharkStarted == False: logging.debug('Starting tshark on public network') self.CaptureOnDockerNetworks() - HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRowQueue('n/a', 'OK', 1, html_queue) for cState in containerStatus: logging.debug(cState) logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m') else: - HTML.CreateHtmlTestRow('Could not deploy in time', 'KO', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRowQueue('Could not deploy in time', 'KO', 1, html_queue) for cState in containerStatus: logging.debug(cState) logging.error('\u001B[1m Deploying OAI Object(s) FAILED\u001B[0m') @@ -724,10 +758,12 @@ class Containerize(): cmd = 'sudo nohup tshark -f "(host 192.168.61.11 and icmp) or (not host 192.168.61.11 and not host 192.168.61.30 and not arp and not port 53 and not port 2152)"' elif re.search('5g.*rfsimulator', self.yamlPath[0]) is not None: cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not arp and not port 53 and not port 2152 and not port 2153)"' + elif re.search('5g_l2sim', self.yamlPath[0]) is not None: + cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not arp and not port 53 and not port 2152 and not port 2153)"' else: return for name in networkNames.split('\n'): - if re.search('rfsim', name) is not None: + if re.search('rfsim', name) is not None or re.search('l2sim', name) is not None: cmd += ' -i ' + name cmd += ' -w /tmp/capture_' ymlPath = self.yamlPath[0].split('/') @@ -779,7 +815,7 @@ class Containerize(): # Analyzing log file(s)! listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du'] for container in listOfPossibleRanContainers: - filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' + filename = self.yamlPath[0] + '/*-oai-' + container + '.log' cmd = 'ls ' + filename containerStatus = True try: @@ -801,7 +837,7 @@ class Containerize(): listOfPossibleUeContainers = ['lte-ue*', 'nr-ue*'] for container in listOfPossibleUeContainers: - filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' + filename = self.yamlPath[0] + '/*-oai-' + container + '.log' cmd = 'ls ' + filename containerStatus = True try: @@ -849,6 +885,7 @@ class Containerize(): logging.error('\u001B[1m Undeploying OAI Object(s) FAILED\u001B[0m') return + self.deployedContainers = [] # Cleaning any created tmp volume cmd = 'docker volume prune --force || true' logging.debug(cmd) @@ -861,6 +898,40 @@ class Containerize(): HTML.CreateHtmlTestRow('n/a', 'KO', CONST.ALL_PROCESSES_OK) logging.info('\u001B[1m Undeploying OAI Object(s) FAIL\u001B[0m') + def StatsFromGenObject(self, HTML): + self.exitStatus = 0 + ymlPath = self.yamlPath[0].split('/') + logPath = '../cmake_targets/log/' + ymlPath[1] + + # if the containers are running, recover the logs! + cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps --all' + logging.debug(cmd) + deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + cmd = 'docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}" ' + anyLogs = False + for state in deployStatus.split('\n'): + res = re.search('Name|----------', state) + if res is not None: + continue + if len(state) == 0: + continue + res = re.search('^(?P[a-zA-Z0-9\-\_]+) ', state) + if res is not None: + anyLogs = True + cmd += res.group('container_name') + ' ' + message = '' + if anyLogs: + logging.debug(cmd) + stats = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) + for statLine in stats.split('\n'): + logging.debug(statLine) + message += statLine + '\n' + + html_queue = SimpleQueue() + html_cell = '
\n' + message + '
' + html_queue.put(html_cell) + HTML.CreateHtmlTestRowQueue(self.pingOptions, 'OK', 1, html_queue) + def PingFromContainer(self, HTML, RAN, UE): self.exitStatus = 0 ymlPath = self.yamlPath[0].split('/') diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 5d89a7b2e0..75fd1bf05e 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -3156,10 +3156,12 @@ class OaiCiTest(): nrFoundDCI = 0 nrCRCOK = 0 mbms_messages = 0 + nbPduSessAccept = 0 + nbPduDiscard = 0 HTML.htmlUEFailureMsg='' global_status = CONST.ALL_PROCESSES_OK for line in ue_log_file.readlines(): - result = re.search('nr_synchro_time', str(line)) + result = re.search('nr_synchro_time|Starting NR UE soft modem', str(line)) if result is not None: nrUEFlag = True if nrUEFlag: @@ -3172,6 +3174,15 @@ class OaiCiTest(): result = re.search('CRC OK', str(line)) if result is not None: nrCRCOK += 1 + result = re.search('Received PDU Session Establishment Accept', str(line)) + if result is not None: + nbPduSessAccept += 1 + result = re.search('warning: discard PDU, sn out of window', str(line)) + if result is not None: + nbPduDiscard += 1 + result = re.search('--nfapi 5 --node-number 2 --sa', str(line)) + if result is not None: + frequency_found = True result = re.search('Exiting OAI softmodem', str(line)) if result is not None: exitSignalReceived = True @@ -3302,21 +3313,29 @@ class OaiCiTest(): HTML.htmlUEFailureMsg=HTML.htmlUEFailureMsg + statMsg + '\n' if nrUEFlag: if nrDecodeMib > 0: - statMsg = 'UE showed ' + str(nrDecodeMib) + ' MIB decode message(s)' + statMsg = 'UE showed ' + str(nrDecodeMib) + ' "MIB decode" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') HTML.htmlUEFailureMsg=HTML.htmlUEFailureMsg + statMsg + '\n' if nrFoundDCI > 0: - statMsg = 'UE showed ' + str(nrFoundDCI) + ' DCI found message(s)' + statMsg = 'UE showed ' + str(nrFoundDCI) + ' "DCI found" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') HTML.htmlUEFailureMsg=HTML.htmlUEFailureMsg + statMsg + '\n' if nrCRCOK > 0: - statMsg = 'UE showed ' + str(nrCRCOK) + ' PDSCH decoding message(s)' + statMsg = 'UE showed ' + str(nrCRCOK) + ' "PDSCH decoding" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') HTML.htmlUEFailureMsg=HTML.htmlUEFailureMsg + statMsg + '\n' if not frequency_found: statMsg = 'NR-UE could NOT synch!' logging.error('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') HTML.htmlUEFailureMsg=HTML.htmlUEFailureMsg + statMsg + '\n' + if nbPduSessAccept > 0: + statMsg = 'UE showed ' + str(nbPduSessAccept) + ' "Received PDU Session Establishment Accept" message(s)' + logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') + HTML.htmlUEFailureMsg=HTML.htmlUEFailureMsg + statMsg + '\n' + if nbPduDiscard > 0: + statMsg = 'UE showed ' + str(nbPduDiscard) + ' "warning: discard PDU, sn out of window" message(s)' + logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') + HTML.htmlUEFailureMsg=HTML.htmlUEFailureMsg + statMsg + '\n' if uciStatMsgCount > 0: statMsg = 'UE showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') diff --git a/ci-scripts/main.py b/ci-scripts/main.py index aa7d512b3d..3236676e14 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -391,7 +391,7 @@ def GetParametersFromXML(action): if (string_field is not None): CONTAINERS.yamlPath[CONTAINERS.eNB_instance] = string_field - elif action == 'DeployGenObject' or action == 'UndeployGenObject': + elif action == 'DeployGenObject' or action == 'UndeployGenObject' or action == 'StatsFromGenObject': string_field=test.findtext('yaml_path') if (string_field is not None): CONTAINERS.yamlPath[0] = string_field @@ -931,6 +931,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re CONTAINERS.IperfFromContainer(HTML, RAN) if CONTAINERS.exitStatus==1: RAN.prematureExit = True + elif action == 'StatsFromGenObject': + CONTAINERS.StatsFromGenObject(HTML) else: sys.exit('Invalid class (action) from xml') if RAN.prematureExit: diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 3b32a75542..26abef94f2 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -677,13 +677,13 @@ class RANManagement(): # if T tracer was run with option 0 (no logs), analyze logs # from textlog, otherwise do normal analysis (e.g., option 2) result = re.search('T_stdout 0', str(self.Initialize_eNB_args)) - enbLogFile = self.eNBLogFiles[int(self.eNB_instance)] - raw_record_file = enbLogFile.replace('.log', '_record.raw') - replay_log_file = enbLogFile.replace('.log', '_replay.log') if (result is not None): logging.debug('\u001B[1m Replaying RAW record file\u001B[0m') mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.command('cd ' + lSourcePath + '/common/utils/T/tracer/', '\$', 5) + enbLogFile = self.eNBLogFiles[int(self.eNB_instance)] + raw_record_file = enbLogFile.replace('.log', '_record.raw') + replay_log_file = enbLogFile.replace('.log', '_replay.log') extracted_txt_file = enbLogFile.replace('.log', '_extracted_messages.txt') extracted_log_file = enbLogFile.replace('.log', '_extracted_messages.log') mySSH.command('./extract_config -i ' + lSourcePath + '/cmake_targets/' + raw_record_file + ' > ' + lSourcePath + '/cmake_targets/' + extracted_txt_file, '\$', 5) @@ -706,8 +706,6 @@ class RANManagement(): mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*stats.log', '.') mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.pickle', '.') mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.png', '.') - mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/'+raw_record_file, '.') - mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/'+replay_log_file, '.') # copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.') if (copyin_res == -1): @@ -723,9 +721,7 @@ class RANManagement(): mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrL1_stats.log', self.eNBSourceCodePath + '/cmake_targets/') mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrMAC_stats.log', self.eNBSourceCodePath + '/cmake_targets/') mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.pickle', self.eNBSourceCodePath + '/cmake_targets/') - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/')#RH 21/02/2002 this does not work, there are more than 1 png file - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword,'./'+raw_record_file, self.eNBSourceCodePath + '/cmake_targets/') - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword,'./'+replay_log_file, self.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/') # mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/') logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze) @@ -826,6 +822,8 @@ class RANManagement(): RealTimeProcessingIssue = False DLRetxIssue = False ULRetxIssue = False + nrRrcRcfgComplete = 0 + harqFeedbackPast = 0 line_cnt=0 #log file line counter for line in enb_log_file.readlines(): @@ -1002,6 +1000,13 @@ class RANManagement(): #remove 1- all useless char before relevant info (ulsch or dlsch) 2- trailing char dlsch_ulsch_stats[k]=re.sub(r'^.*\]\s+', r'' , line.rstrip()) + result = re.search('Received NR_RRCReconfigurationComplete from UE', str(line)) + if result is not None: + nrRrcRcfgComplete += 1 + result = re.search('HARQ feedback is in the past', str(line)) + if result is not None: + harqFeedbackPast += 1 + #count "problem receiving samples" msg result = re.search('\[PHY\]\s+problem receiving samples', str(line)) @@ -1089,6 +1094,14 @@ class RANManagement(): statMsg = nodeB_prefix + 'NB ran with TX Write thread enabled' logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') htmleNBFailureMsg += statMsg + '\n' + if nrRrcRcfgComplete > 0: + statMsg = nodeB_prefix + 'NB showed ' + str(nrRrcRcfgComplete) + ' "Received NR_RRCReconfigurationComplete from UE" message(s)' + logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') + htmleNBFailureMsg += statMsg + '\n' + if harqFeedbackPast > 0: + statMsg = nodeB_prefix + 'NB showed ' + str(harqFeedbackPast) + ' "HARQ feedback is in the past" message(s)' + logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m') + htmleNBFailureMsg += statMsg + '\n' #FR1 NSA test : add new markers to make sure gNB is used if NSA_RAPROC_PUSCH_check: statMsg = '[RAPROC] PUSCH with TC_RNTI message check for ' + nodeB_prefix + 'NB : PASS ' diff --git a/ci-scripts/xml_class_list.yml b/ci-scripts/xml_class_list.yml index 9e33ee468d..d6f75191a8 100755 --- a/ci-scripts/xml_class_list.yml +++ b/ci-scripts/xml_class_list.yml @@ -46,3 +46,4 @@ - UndeployGenObject - PingFromContainer - IperfFromContainer + - StatsFromGenObject diff --git a/ci-scripts/xml_files/container_5g_l2sim_tdd.xml b/ci-scripts/xml_files/container_5g_l2sim_tdd.xml new file mode 100644 index 0000000000..be6b789b6b --- /dev/null +++ b/ci-scripts/xml_files/container_5g_l2sim_tdd.xml @@ -0,0 +1,115 @@ + + + l2sim-5gnr-tdd + Testing 5G NR L2 sim - TDD gNB + wrench + 2 + + 100001 + 000000 + 000001 + 000002 + 000003 + 000011 + 200000 + 020001 + 020002 + 200001 + 100001 + + + + + DeployGenObject + Deploy MySql Database + yaml_files/5g_l2sim_tdd + mysql + 1 + + + + DeployGenObject + Deploy OAI 5G CoreNetwork + yaml_files/5g_l2sim_tdd + oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn + 6 + + + + DeployGenObject + Deploy OAI 5G gNB L2 sim SA + yaml_files/5g_l2sim_tdd + oai-gnb + 7 + + + + DeployGenObject + Deploy OAI 5G NR-UE L2 sim SA and Proxy + yaml_files/5g_l2sim_tdd + proxy oai-nr-ue0 + 9 + + + + IdleSleep + Sleep + 10 + + + + PingFromContainer + Ping ext-dn from NR-UE + l2sim-oai-nr-ue0 + -I oaitun_ue1 -c 20 192.168.72.135 + 5 + + + + PingFromContainer + Ping NR-UE from ext-dn + l2sim-oai-ext-dn + -c 20 12.1.1.2 + 5 + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_l2sim_tdd + + + + StatsFromGenObject + Statistics before Traffic Test + yaml_files/5g_l2sim_tdd + + + + StatsFromGenObject + Statistics after Traffic Test + yaml_files/5g_l2sim_tdd + + + diff --git a/ci-scripts/xml_files/container_5g_l2sim_tdd_down.xml b/ci-scripts/xml_files/container_5g_l2sim_tdd_down.xml new file mode 100644 index 0000000000..d3630cd905 --- /dev/null +++ b/ci-scripts/xml_files/container_5g_l2sim_tdd_down.xml @@ -0,0 +1,38 @@ + + + l2sim-5gnr-down + CleanUp 5G L2 sim - TDD gNB + trash + + 100002 + + + + + UndeployGenObject + Undeploy all OAI 5G stack + yaml_files/5g_l2sim_tdd + + + diff --git a/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml b/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml new file mode 100644 index 0000000000..c899f8cc7e --- /dev/null +++ b/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml @@ -0,0 +1,322 @@ +version: '3.8' +services: + oai-nrf: + container_name: "l2sim-oai-nrf" + image: oai-nrf:latest + environment: + - NRF_INTERFACE_NAME_FOR_SBI=eth0 + - NRF_INTERFACE_PORT_FOR_SBI=80 + - NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - NRF_API_VERSION=v1 + - INSTANCE=0 + - PID_DIRECTORY=/var/run + networks: + public_net: + ipv4_address: 192.168.71.130 + volumes: + - ../5g_rfsimulator/nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + mysql: + container_name: "l2sim-mysql" + image: mysql:5.7 + volumes: + - ../5g_rfsimulator/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql + - ../5g_rfsimulator/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh + environment: + - TZ=Europe/Paris + - MYSQL_DATABASE=oai_db + - MYSQL_USER=test + - MYSQL_PASSWORD=test + - MYSQL_ROOT_PASSWORD=linux + healthcheck: + test: /bin/bash -c "/tmp/mysql-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.131 + oai-amf: + container_name: "l2sim-oai-amf" + image: oai-amf:latest + environment: + - TZ=Europe/paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - MCC=208 + - MNC=99 + - REGION_ID=128 + - AMF_SET_ID=1 + - SERVED_GUAMI_MCC_0=208 + - SERVED_GUAMI_MNC_0=99 + - SERVED_GUAMI_REGION_ID_0=128 + - SERVED_GUAMI_AMF_SET_ID_0=1 + - SERVED_GUAMI_MCC_1=460 + - SERVED_GUAMI_MNC_1=11 + - SERVED_GUAMI_REGION_ID_1=10 + - SERVED_GUAMI_AMF_SET_ID_1=1 + - PLMN_SUPPORT_MCC=208 + - PLMN_SUPPORT_MNC=99 + - PLMN_SUPPORT_TAC=0x0001 + - SST_0=1 + - SD_0=1 + - SST_1=1 + - SD_1=12 + - AMF_INTERFACE_NAME_FOR_NGAP=eth0 + - AMF_INTERFACE_NAME_FOR_N11=eth0 + - SMF_INSTANCE_ID_0=1 + - SMF_FQDN_0=oai-smf + - SMF_IPV4_ADDR_0=0.0.0.0 + - SMF_HTTP_VERSION_0=v1 + - SELECTED_0=true + - SMF_INSTANCE_ID_1=2 + - SMF_FQDN_1=oai-smf + - SMF_IPV4_ADDR_1=0.0.0.0 + - SMF_HTTP_VERSION_1=v1 + - SELECTED_1=false + - MYSQL_SERVER=192.168.71.131 + - MYSQL_USER=root + - MYSQL_PASS=linux + - MYSQL_DB=oai_db + - OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1 + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NF_REGISTRATION=yes + - SMF_SELECTION=yes + - USE_FQDN_DNS=yes + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - EXTERNAL_AUSF=no + - AUSF_IPV4_ADDRESS=0.0.0.0 + - AUSF_PORT=80 + - AUSF_API_VERSION=v1 + - AUSF_FQDN=localhost + depends_on: + - oai-nrf + - mysql + volumes: + - ../5g_rfsimulator/amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh" + interval: 10s + timeout: 15s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.132 + oai-smf: + container_name: "l2sim-oai-smf" + image: oai-smf:latest + environment: + - TZ=Europe/Paris + - INSTANCE=0 + - PID_DIRECTORY=/var/run + - SMF_INTERFACE_NAME_FOR_N4=eth0 + - SMF_INTERFACE_NAME_FOR_SBI=eth0 + - SMF_INTERFACE_PORT_FOR_SBI=80 + - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 + - SMF_API_VERSION=v1 + - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 + - AMF_IPV4_ADDRESS=0.0.0.0 + - AMF_PORT=80 + - AMF_API_VERSION=v1 + - AMF_FQDN=oai-amf + - UDM_IPV4_ADDRESS=127.0.0.1 + - UDM_PORT=80 + - UDM_API_VERSION=v1 + - UDM_FQDN=localhost + - UPF_IPV4_ADDRESS=192.168.71.134 + - UPF_FQDN_0=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - REGISTER_NRF=yes + - DISCOVER_UPF=yes + - USE_FQDN_DNS=yes + - DNN_NI0=oai + - DNN_NI2=oai.ipv4 + depends_on: + - oai-nrf + - oai-amf + volumes: + - ../5g_rfsimulator/smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.133 + oai-spgwu: + container_name: "l2sim-oai-spgwu" + image: oai-spgwu-tiny:latest + environment: + - TZ=Europe/Paris + - PID_DIRECTORY=/var/run + - SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0 + - SGW_INTERFACE_NAME_FOR_SX=eth0 + - PGW_INTERFACE_NAME_FOR_SGI=eth0 + - NETWORK_UE_NAT_OPTION=yes + - NETWORK_UE_IP=12.1.1.0/24 + - SPGWC0_IP_ADDRESS=192.168.71.133 + - BYPASS_UL_PFCP_RULES=no + - MCC=208 + - MNC=99 + - MNC03=099 + - TAC=1 + - GTP_EXTENSION_HEADER_PRESENT=yes + - GW_ID=1 + - REALM=openairinterface.org + - ENABLE_5G_FEATURES=yes + - REGISTER_NRF=yes + - USE_FQDN_NRF=yes + - UPF_FQDN_5G=oai-spgwu + - NRF_IPV4_ADDRESS=192.168.71.130 + - NRF_PORT=80 + - NRF_API_VERSION=v1 + - NRF_FQDN=oai-nrf + - NSSAI_SST_0=1 + - NSSAI_SD_0=1 + - DNN_0=oai + depends_on: + - oai-nrf + - oai-smf + cap_add: + - NET_ADMIN + - SYS_ADMIN + cap_drop: + - ALL + privileged: true + volumes: + - ../5g_rfsimulator/spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh + healthcheck: + test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh" + interval: 10s + timeout: 5s + retries: 5 + networks: + public_net: + ipv4_address: 192.168.71.134 + traffic_net: + ipv4_address: 192.168.72.134 + oai-ext-dn: + image: ubuntu:bionic + privileged: true + container_name: "l2sim-oai-ext-dn" + entrypoint: /bin/bash -c \ + "apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\ + "ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity" + depends_on: + - oai-spgwu + networks: + traffic_net: + ipv4_address: 192.168.72.135 + healthcheck: + test: /bin/bash -c "ping -c 2 192.168.72.134" + interval: 10s + timeout: 5s + retries: 5 + oai-gnb: + image: oai-gnb:develop + privileged: true + container_name: "l2sim-oai-gnb" + network_mode: "host" + environment: + TZ: Europe/Paris + USE_SA_NFAPI_VNF: 'yes' + GNB_NAME: gnb-l2sim-vnf + TAC: 1 + MCC: '208' + MNC: '99' + MNC_LENGTH: 2 + NSSAI_SST: 1 + NSSAI_SD0: 1 + NSSAI_SD1: 112233 + AMF_IP_ADDRESS: 192.168.71.132 + GNB_NGA_IF_NAME: eno1 + GNB_NGA_IP_ADDRESS: 192.168.18.193 + GNB_NGU_IF_NAME: eno1 + GNB_NGU_IP_ADDRESS: 192.168.18.193 + LOCAL_S_IF_NAME: 'lo:' + REMOTE_S_ADDRESS: 127.0.0.1 + LOCAL_S_ADDRESS: 127.0.0.2 + USE_ADDITIONAL_OPTIONS: --sa --nfapi 2 --emulate-l1 --log_config.global_log_options level,time,thread_id,nocolor + depends_on: + - oai-spgwu + - oai-amf + healthcheck: + test: /bin/bash -c "pgrep nr-softmodem" + interval: 10s + timeout: 5s + retries: 5 + + proxy: + image: oai-lte-multi-ue-proxy:latest + privileged: true + container_name: "l2sim-proxy" + network_mode: "host" + environment: + TZ: Europe/Paris + command: "/oai-lte-multi-ue-proxy/bin/proxy 1 --nr" + depends_on: + - oai-gnb + healthcheck: + test: /bin/bash -c "pgrep proxy" + interval: 10s + timeout: 5s + retries: 5 + + oai-nr-ue0: + image: oai-nr-ue:develop + privileged: true + container_name: "l2sim-oai-nr-ue0" + network_mode: "host" + environment: + TZ: Europe/Paris + USE_NFAPI: 'yes' + OPENAIR_DIR: /opt/oai-nr-ue + FULL_IMSI: '208990100001100' + FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f' + OPC: 'C42449363BBAD02B66D16BC975D77CC1' + DNN: oai + NSSAI_SST: 1 + NSSAI_SD: 1 + NR_UE_NFAPI_IF_NAME: eno1 + GNB_IP_ADDRESS: 127.0.0.1 + NR_UE_IP_ADDRESS: 127.0.0.1 + USE_ADDITIONAL_OPTIONS: --nokrnmod 1 --nfapi 5 --node-number 2 --sa --emulate-l1 --log_config.global_log_options level,time,thread_id,nocolor + volumes: + - ../../../openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results:/opt/oai-nr-ue/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results + depends_on: + - oai-gnb + - proxy + healthcheck: + test: /bin/bash -c "pgrep nr-uesoftmodem" + interval: 10s + timeout: 5s + retries: 5 + +networks: + public_net: + driver: bridge + name: l2sim-oai-public-net + ipam: + config: + - subnet: 192.168.71.128/26 + driver_opts: + com.docker.network.bridge.name: "l2sim-public" + traffic_net: + driver: bridge + name: l2sim-oai-traffic-net + ipam: + config: + - subnet: 192.168.72.128/26 + driver_opts: + com.docker.network.bridge.name: "l2sim-traffic" diff --git a/docker/Dockerfile.nrUE.rhel8.2 b/docker/Dockerfile.nrUE.rhel8.2 index d38e81bd71..a9d74dd84e 100644 --- a/docker/Dockerfile.nrUE.rhel8.2 +++ b/docker/Dockerfile.nrUE.rhel8.2 @@ -29,7 +29,8 @@ FROM ran-base:latest AS nr-ue-base FROM ran-build:latest AS nr-ue-build -RUN cp /oai-ran/docker/scripts/nr_ue_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh +RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/nr_ue_parameters.yaml && \ + cp /oai-ran/docker/scripts/nr_ue_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh #start from scratch for target executable FROM registry.access.redhat.com/ubi8/ubi:latest as oai-nr-ue @@ -62,7 +63,10 @@ COPY --from=nr-ue-build \ ./ WORKDIR /opt/oai-nr-ue/etc -COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf . +COPY --from=nr-ue-build \ + /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf \ + /oai-ran/docker/etc/nr-ue.nfapi.conf \ + ./ COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ @@ -118,5 +122,5 @@ WORKDIR /opt/oai-nr-ue/etc COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* . WORKDIR /opt/oai-nr-ue -CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15", "-O", "/opt/oai-nr-ue/etc/nr-ue-sim.conf"] +CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15", "-O", "/opt/oai-nr-ue/etc/nr-ue.conf"] ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"] diff --git a/docker/Dockerfile.nrUE.ubuntu18 b/docker/Dockerfile.nrUE.ubuntu18 index 0fa219296b..29303b312b 100644 --- a/docker/Dockerfile.nrUE.ubuntu18 +++ b/docker/Dockerfile.nrUE.ubuntu18 @@ -29,7 +29,8 @@ FROM ran-base:latest AS nr-ue-base FROM ran-build:latest AS nr-ue-build -RUN cp /oai-ran/docker/scripts/nr_ue_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh +RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/nr_ue_parameters.yaml && \ + cp /oai-ran/docker/scripts/nr_ue_entrypoint.sh /oai-ran/docker/scripts/entrypoint.sh #start from scratch for target executable FROM ubuntu:bionic as oai-nr-ue @@ -67,7 +68,10 @@ COPY --from=nr-ue-build \ ./ WORKDIR /opt/oai-nr-ue/etc -COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf . +COPY --from=nr-ue-build \ + /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf \ + /oai-ran/docker/etc/nr-ue.nfapi.conf \ + ./ COPY --from=nr-ue-build \ /oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \ @@ -106,5 +110,5 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so /usr/local/lib/liboai ldconfig WORKDIR /opt/oai-nr-ue -CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15", "-O", "/opt/oai-nr-ue/etc/nr-ue-sim.conf"] +CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15", "-O", "/opt/oai-nr-ue/etc/nr-ue.conf"] ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"] diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py index 297c202a03..850bb535a5 100644 --- a/docker/scripts/generateTemplate.py +++ b/docker/scripts/generateTemplate.py @@ -23,6 +23,7 @@ #----------------------------------------------------------- # Import #----------------------------------------------------------- +import glob import re import yaml import os @@ -33,7 +34,8 @@ def main(): #read yaml input parameters f = open(f'{sys.argv[1]}',) data = yaml.full_load(f) - dir = os.listdir(f'{data[0]["paths"]["source_dir"]}') + initial_path = f'{data[0]["paths"]["source_dir"]}' + dir = glob.glob(initial_path + '/**/*.conf', recursive=True) #identify configs, read and replace corresponding values for config in data[1]["configurations"]: @@ -42,7 +44,10 @@ def main(): print('================================================') print('filePrefix = ' + filePrefix) print('outputfilename = ' + outputfilename) + found = False for inputfile in dir: + if found: + continue if inputfile.find(filePrefix) >=0: prefix_outputfile = {"cu.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "du.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', @@ -58,10 +63,13 @@ def main(): "gnb.sa.band66.fr1.106PRB.usrpn300.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gNB_SA_CU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "gNB_SA_DU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', + "proxy_nr-ue.nfapi.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}', "ue_sim_ci": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}' } print('inputfile = ' + inputfile) + found = True if filePrefix in prefix_outputfile: outputfile1 = prefix_outputfile[filePrefix] @@ -69,7 +77,7 @@ def main(): if not os.path.exists(directory): os.makedirs(directory, exist_ok=True) - with open(f'{data[0]["paths"]["source_dir"]}{inputfile}', mode='r') as inputfile, \ + with open(f'{inputfile}', mode='r') as inputfile, \ open(outputfile1, mode='w') as outputfile: for line in inputfile: count = 0 diff --git a/docker/scripts/gnb_entrypoint.sh b/docker/scripts/gnb_entrypoint.sh index aec5c48050..dd6256609c 100755 --- a/docker/scripts/gnb_entrypoint.sh +++ b/docker/scripts/gnb_entrypoint.sh @@ -11,8 +11,9 @@ THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD} if [[ -v USE_NSA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_FDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.fdd.conf $PREFIX/etc/gnb.conf; fi -if [[ -v USE_SA_CU ]]; then ln -s $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi +if [[ -v USE_SA_CU ]]; then cp $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi if [[ -v USE_SA_TDD_CU ]]; then cp $PREFIX/etc/gnb.sa.du.tdd.conf $PREFIX/etc/gnb.conf; fi +if [[ -v USE_SA_NFAPI_VNF ]]; then cp $PREFIX/etc/gnb.sa.nfapi.vnf.conf $PREFIX/etc/gnb.conf; fi # Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself. if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/gnb.conf; fi diff --git a/docker/scripts/gnb_parameters.yaml b/docker/scripts/gnb_parameters.yaml index 8547d48e67..d5942f2c9b 100644 --- a/docker/scripts/gnb_parameters.yaml +++ b/docker/scripts/gnb_parameters.yaml @@ -202,3 +202,39 @@ - key: remote_n_portd env: "@F1_CU_D_PORT@" + - filePrefix: proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf + outputfilename: "gnb.sa.nfapi.vnf.conf" + config: + - key: Active_gNBs + env: "@GNB_NAME@" + - key: gNB_name + env: "@GNB_NAME@" + - key: mcc + env: "@MCC@" + - key: mnc + env: "@MNC@" + - key: mnc_length + env: "@MNC_LENGTH@" + - key: tracking_area_code + env: "@TAC@" + - key: sst + env: "@NSSAI_SST@" + - key: ipv4 + env: "@AMF_IP_ADDRESS@" + - key: GNB_INTERFACE_NAME_FOR_NG_AMF + env: "@GNB_NGA_IF_NAME@" + - key: GNB_IPV4_ADDRESS_FOR_NG_AMF + env: "@GNB_NGA_IP_ADDRESS@" + - key: GNB_INTERFACE_NAME_FOR_NGU + env: "@GNB_NGU_IF_NAME@" + - key: GNB_IPV4_ADDRESS_FOR_NGU + env: "@GNB_NGU_IP_ADDRESS@" + - key: parallel_config + env: "@THREAD_PARALLEL_CONFIG@" + - key: local_s_if_name + env: "@LOCAL_S_IF_NAME@" + - key: remote_s_address + env: "@REMOTE_S_ADDRESS@" + - key: local_s_address + env: "@LOCAL_S_ADDRESS@" + diff --git a/docker/scripts/nr_ue_entrypoint.sh b/docker/scripts/nr_ue_entrypoint.sh index af2b8a8333..38b080a41b 100755 --- a/docker/scripts/nr_ue_entrypoint.sh +++ b/docker/scripts/nr_ue_entrypoint.sh @@ -5,12 +5,22 @@ set -euo pipefail PREFIX=/opt/oai-nr-ue # Based another env var, pick one template to use -#if [[ -v USE_NFAPI ]]; then cp $PREFIX/etc/ue.nfapi.conf $PREFIX/etc/ue.conf; fi +if [[ -v USE_NFAPI ]]; then cp $PREFIX/etc/nr-ue.nfapi.conf $PREFIX/etc/nr-ue.conf; fi +# Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself. +if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/nr-ue.conf; fi +# if none, pick the default +if [ ! -f $PREFIX/etc/nr-ue.conf ]; then cp $PREFIX/etc/nr-ue-sim.conf $PREFIX/etc/nr-ue.conf; fi -# Only this template will be manipulated and the USIM one! -CONFIG_FILES=`ls $PREFIX/etc/ue.conf $PREFIX/etc/nr-ue-sim.conf || true` +# Only this template will be manipulated +CONFIG_FILES=`ls $PREFIX/etc/nr-ue.conf || true` for c in ${CONFIG_FILES}; do + # Sometimes templates have no pattern to be replaced. + if ! grep -oP '@[a-zA-Z0-9_]+@' ${c}; then + echo "Configuration is already set" + break + fi + # grep variable names (format: ${VAR}) from template to be rendered VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs) diff --git a/docker/scripts/nr_ue_parameters.yaml b/docker/scripts/nr_ue_parameters.yaml new file mode 100644 index 0000000000..afdba880e1 --- /dev/null +++ b/docker/scripts/nr_ue_parameters.yaml @@ -0,0 +1,49 @@ +#/* +# * 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 +# */ + +--- +- paths: + source_dir: "ci-scripts/conf_files/" + dest_dir: docker/etc + +- configurations: + - filePrefix: proxy_nr-ue.nfapi.conf + outputfilename: "nr-ue.nfapi.conf" + config: + - key: imsi + env: "@FULL_IMSI@" + - key: key + env: "@FULL_KEY@" + - key: opc + env: "@OPC@" + - key: dnn + env: "@DNN@" + - key: nssai_sst + env: "@NSSAI_SST@" + - key: nssai_sd + env: "@NSSAI_SD@" + - key: remote_n_address + env: "@GNB_IP_ADDRESS@" + - key: local_n_address + env: "@NR_UE_IP_ADDRESS@" + - key: local_n_if_name + env: "@NR_UE_NFAPI_IF_NAME@" + From 52ead754c0a33ce2560ea7b6df66e67f6d586a04 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 21 Mar 2022 16:54:00 +0100 Subject: [PATCH 745/883] fix(ci): some little cosmetics fixes * The quectel CM program output is now redirected to a file. Easier to follow when running * I added `-i 1` option to all server iperf commands to have details * module-based iperf logs are also copied to the RAN enb log folder so they are artifacted * iperf3 console output was badly formatted * `docker kill --signal INT` does not stop the container Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 2 + ci-scripts/cls_module_ue.py | 3 +- ci-scripts/cls_oaicitest.py | 62 +++++++++---------- ci-scripts/ran.py | 4 +- .../xml_files/container_nsa_b200_quectel.xml | 36 +++++++++-- 5 files changed, 69 insertions(+), 38 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index fdc2bc1597..d85659568b 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -606,6 +606,8 @@ class Containerize(): if containerToKill: mySSH.command('docker kill --signal INT ' + containerName, '\$', 30) time.sleep(5) + mySSH.command('docker kill --signal KILL ' + containerName, '\$', 30) + time.sleep(5) mySSH.command('docker logs ' + containerName + ' > ' + lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '\$', 30) mySSH.command('docker rm -f ' + containerName, '\$', 30) # Forcing the down now to remove the networks and any artifacts diff --git a/ci-scripts/cls_module_ue.py b/ci-scripts/cls_module_ue.py index cabd0a045d..4e2efaeda5 100644 --- a/ci-scripts/cls_module_ue.py +++ b/ci-scripts/cls_module_ue.py @@ -76,7 +76,8 @@ class Module_UE: logging.debug('Starting ' + self.Process['Name']) mySSH = sshconnection.SSHConnection() mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) - mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S ' + self.Process['Cmd'] + ' ' + self.Process['Apn'][CNType] + ' > /dev/null 2>&1 &','\$',5) + mySSH.command('sudo rm -f /tmp/quectel-cm.log','\$',5) + mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S stdbuf -o0 ' + self.Process['Cmd'] + ' ' + self.Process['Apn'][CNType] + ' > /tmp/quectel-cm.log 2>&1 &','\$',5) mySSH.close() #checking the process time.sleep(5) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 5d89a7b2e0..ec1202cb21 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -122,6 +122,7 @@ def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold): try: mySSH = sshconnection.SSHConnection() mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/') + mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file, RAN.eNBSourceCodePath + '/cmake_targets/') except: logging.debug('\u001B[1;37;41m Ping PNG SCP to eNB FAILED\u001B[0m') @@ -1598,7 +1599,7 @@ class OaiCiTest(): else: if launchfromModule == False: #ping log file is on the python executor - cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 > ping_' + self.testCase_id + '_' + device_id + '.log' + cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' > ping_' + self.testCase_id + '_' + device_id + '.log 2>&1' message = cmd + '\n' logging.debug(cmd) ret = subprocess.run(cmd, shell=True) @@ -1623,7 +1624,7 @@ class OaiCiTest(): else: Target = EPC.IPAddress #ping from module NIC rather than IP address to make sure round trip is over the air - cmd = 'ping -I ' + Module_UE.UENetwork + ' ' + self.ping_args + ' ' + Target + ' 2>&1 > ping_' + self.testCase_id + '_' + self.ue_id + '.log' + cmd = 'ping -I ' + Module_UE.UENetwork + ' ' + self.ping_args + ' ' + Target + ' > ping_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1' SSH.command(cmd,'\$',int(ping_time[0])*1.5) #copy the ping log file to have it locally for analysis (ping stats) SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, 'ping_' + self.testCase_id + '_' + self.ue_id + '.log', '.') @@ -2084,7 +2085,8 @@ class OaiCiTest(): statusQueue.put(UE_IPAddress) statusQueue.put(report_msg) logging.debug('\u001B[1;37;45m TCP Bidir Iperf Result (' + UE_IPAddress + ') \u001B[0m') - logging.debug('\u001B[1;35m ' + report_msg + '\u001B[0m') + for rLine in report_msg.split('\n'): + logging.debug('\u001B[1;35m ' + rLine + '\u001B[0m') lock.release() else: self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from Log file') @@ -2379,10 +2381,12 @@ class OaiCiTest(): SSH.copyout(EPC.IPAddress, EPC.UserName, EPC.Password, 'iperf_' + self.testCase_id + '_' + device_id + '.log', EPC.SourceCodePath + '/scripts') - def Iperf_Module(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue,EPC, Module_UE): + def Iperf_Module(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue,EPC, Module_UE, RAN): + SSH = sshconnection.SSHConnection() + server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' + client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' if (re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE)) or (re.match('OAICN5G', EPC.Type, re.IGNORECASE)): #retrieve trf-gen container IP address - SSH = sshconnection.SSHConnection() SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) SSH.command('docker inspect --format="TRF_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" prod-trf-gen', '\$', 5) result = re.search('TRF_IP_ADDR = (?P[0-9\.]+)', SSH.getBefore()) @@ -2404,20 +2408,18 @@ class OaiCiTest(): if self.iperf_direction=="DL": logging.debug("Iperf for Module in DL mode detected") ##server side UE - server_filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'rm ' + server_filename SSH.command(cmd,'\$',5) - cmd = 'echo $USER; nohup iperf -s -B ' + UE_IPAddress + ' -u 2>&1 > ' + server_filename + ' &' + cmd = 'echo $USER; nohup iperf -s -B ' + UE_IPAddress + ' -u -i 1 > ' + server_filename + ' 2>&1 &' SSH.command(cmd,'\$',5) SSH.close() ##client side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) - client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' #remove old client file in EPC.SourceCodePath cmd = 'rm ' + EPC.SourceCodePath + '/' + client_filename SSH.command(cmd,'\$',5) - iperf_cmd = 'bin/iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename + iperf_cmd = 'bin/iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' > ' + client_filename + ' 2>&1' cmd = 'docker exec -w /iperf-2.0.13 -it prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',int(iperf_time)*5.0) SSH.command('docker cp prod-trf-gen:/iperf-2.0.13/'+ client_filename + ' ' + EPC.SourceCodePath, '\$', 5) @@ -2433,19 +2435,17 @@ class OaiCiTest(): logging.debug("Iperf for Module in UL mode detected") #server side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) - server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' - iperf_cmd = 'echo $USER; nohup bin/iperf -s -u 2>&1 > ' + server_filename + iperf_cmd = 'echo $USER; nohup bin/iperf -s -u -i 1 > ' + server_filename + ' 2>&1' cmd = 'docker exec -d -w /iperf-2.0.13 prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',5) SSH.close() #client side UE SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) - client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' cmd = 'rm '+ client_filename SSH.command(cmd,'\$',5) - SSH.command('iperf -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename, '\$', int(iperf_time)*5.0) + SSH.command('iperf -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' > ' + client_filename + ' 2>&1', '\$', int(iperf_time)*5.0) SSH.close() #once client is done, retrieve the server file from container to EPC Host @@ -2461,12 +2461,10 @@ class OaiCiTest(): elif self.iperf_direction=="BIDIR": logging.debug("Iperf for Module in BIDIR mode detected") - server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' - client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' #server side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) - iperf_cmd = 'echo $USER; nohup /usr/local/bin/iperf3 -s 2>&1 > ' + server_filename + iperf_cmd = 'echo $USER; nohup /usr/local/bin/iperf3 -s -i 1 > ' + server_filename + ' 2>&1' cmd = 'docker exec -d -w /iperf-2.0.13 prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"' SSH.command(cmd,'\$',5) SSH.close() @@ -2475,7 +2473,7 @@ class OaiCiTest(): SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'rm '+ client_filename SSH.command(cmd,'\$',5) - SSH.command('iperf3 -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename, '\$', int(iperf_time)*5.0) + SSH.command('iperf3 -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' > ' + client_filename + ' 2>&1', '\$', int(iperf_time)*5.0) SSH.close() #once client is done, retrieve the server file from container to EPC Host @@ -2499,8 +2497,6 @@ class OaiCiTest(): else: #default is ltebox - SSH = sshconnection.SSHConnection() - #kill iperf processes before (in case there are still some remaining) SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'killall --signal=SIGKILL iperf' @@ -2524,14 +2520,14 @@ class OaiCiTest(): SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'rm iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' SSH.command(cmd,'\$',5) - cmd = 'echo $USER; nohup /opt/iperf-2.0.10/iperf -s -B ' + UE_IPAddress + ' -u 2>&1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log &' + cmd = 'echo $USER; nohup /opt/iperf-2.0.10/iperf -s -B ' + UE_IPAddress + ' -u -i 1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1 &' SSH.command(cmd,'\$',5) SSH.close() #client side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) cmd = 'rm iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' SSH.command(cmd,'\$',5) - cmd = 'iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' + cmd = 'iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1' SSH.command(cmd,'\$',int(iperf_time)*5.0) SSH.close() #copy the 2 resulting files locally @@ -2547,7 +2543,7 @@ class OaiCiTest(): SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) cmd = 'rm iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' SSH.command(cmd,'\$',5) - cmd = 'echo $USER; nohup iperf -s -u 2>&1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log &' + cmd = 'echo $USER; nohup iperf -s -u -i 1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1 &' SSH.command(cmd,'\$',5) SSH.close() @@ -2555,7 +2551,7 @@ class OaiCiTest(): SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'rm iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' SSH.command(cmd,'\$',5) - SSH.command('/opt/iperf-2.0.10/iperf -c 192.172.0.1 ' + self.iperf_args + ' 2>&1 > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log', '\$', int(iperf_time)*5.0) + SSH.command('/opt/iperf-2.0.10/iperf -c 192.172.0.1 ' + self.iperf_args + ' > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1', '\$', int(iperf_time)*5.0) SSH.close() #copy the 2 resulting files locally @@ -2566,15 +2562,13 @@ class OaiCiTest(): self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1) elif self.iperf_direction=="BIDIR": logging.debug("Iperf for Module in BIDIR mode detected") - server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log' - client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log' #server side EPC SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) cmd = 'rm ' + server_filename SSH.command(cmd,'\$',5) - cmd = 'echo $USER; nohup iperf3 -s 2>&1 > '+server_filename+' &' + cmd = 'echo $USER; nohup iperf3 -s -i 1 > '+server_filename+' 2>&1 &' SSH.command(cmd,'\$',5) SSH.close() @@ -2582,7 +2576,7 @@ class OaiCiTest(): SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'rm ' + client_filename SSH.command(cmd,'\$',5) - SSH.command('iperf3 -c 192.172.0.1 ' + self.iperf_args + ' 2>&1 > '+client_filename, '\$', int(iperf_time)*5.0) + SSH.command('iperf3 -c 192.172.0.1 ' + self.iperf_args + ' > '+client_filename + ' 2>&1', '\$', int(iperf_time)*5.0) SSH.close() #copy the 2 resulting files locally @@ -2593,6 +2587,7 @@ class OaiCiTest(): else : logging.debug("Incorrect or missing IPERF direction in XML") + #kill iperf processes after to be clean SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) cmd = 'killall --signal=SIGKILL iperf' @@ -2606,7 +2601,12 @@ class OaiCiTest(): cmd = 'killall --signal=SIGKILL iperf3' SSH.command(cmd,'\$',5) SSH.close() - return + + # Copying to xNB server for Jenkins artifacting + if (os.path.isfile(server_filename)): + SSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, server_filename, RAN.eNBSourceCodePath + '/cmake_targets/') + if (os.path.isfile(client_filename)): + SSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, client_filename, RAN.eNBSourceCodePath + '/cmake_targets/') def Iperf_common(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue,EPC): try: @@ -2804,12 +2804,12 @@ class OaiCiTest(): else: SSH.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, EPC.SourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') # fromdos has to be called on the python executor not on ADB server - cmd = 'fromdos -o iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 > /dev/null' + cmd = 'fromdos -o iperf_server_' + self.testCase_id + '_' + device_id + '.log > /dev/null 2>&1' try: subprocess.run(cmd, shell=True) except: pass - cmd = 'dos2unix -o iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 > /dev/null' + cmd = 'dos2unix -o iperf_server_' + self.testCase_id + '_' + device_id + '.log > /dev/null 2>&1' try: subprocess.run(cmd, shell=True) except: @@ -2995,7 +2995,7 @@ class OaiCiTest(): #special quick and dirty treatment for modules, iperf to be restructured if self.ue_id!="": #is module device_id = Module_UE.ID + "-" + Module_UE.Kind - p = Process(target = self.Iperf_Module ,args = (lock, UE_IPAddress, device_id, i, ue_num, status_queue, EPC, Module_UE,)) + p = Process(target = self.Iperf_Module ,args = (lock, UE_IPAddress, device_id, i, ue_num, status_queue, EPC, Module_UE, RAN, )) else: #legacy code p = Process(target = self.Iperf_common, args = (lock, UE_IPAddress, device_id, i, ue_num, status_queue, EPC, )) p.daemon = True diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 3b32a75542..f95ce90c66 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -756,11 +756,11 @@ class RANManagement(): mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/enb_*.pcap .','\$',20) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/gnb_*.pcap .','\$',20) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm -f enb.log.zip', '\$', 5) - mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log* iperf*.log log/*/*.log log/*/*.pcap', '\$', 60) result = re.search('core.\d+', mySSH.getBefore()) if result is not None: mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip core* ran_build/build/{lte,nr}-softmodem', '\$', 60) # add core and executable to zip - mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15) + mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log* iperf*.log log/*/*.log log/*/*.pcap', '\$', 15) mySSH.close() def AnalyzeLogFile_eNB(self, eNBlogFile, HTML, checkers={}): diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 55f8b8638d..610f0b019a 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -39,8 +39,9 @@ 050001 070001 070000 - 050000 - 050001 + 070002 + 050002 + 050003 010002 000001 030202 @@ -117,10 +118,28 @@ 15 + + Ping + Ping: 20pings in 20sec + idefix + -c 20 + 1 + 15 + + + + Ping + Ping: 100pings in 20sec + idefix + -c 100 -i 0.2 + 1 + 15 + + Iperf iperf (DL/40Mbps/UDP)(60 sec)(single-ue profile) - -u -b 40M -t 60 + -u -b 40M -t 60 -i 1 -fm DL idefix 20 @@ -131,7 +150,7 @@ Iperf iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 + -u -b 3M -t 60 -i 1 -fm UL idefix 1 @@ -139,6 +158,15 @@ single-ue + + Iperf + iperf (BIDIR TCP)(10 sec)(single-ue profile) + -t 10 --bidir + BIDIR + idefix + single-ue + + Undeploy_Object Undeploy eNB From dab954d71d4effbd9e204a6bf81f3657739b581b Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 28 Mar 2022 12:08:26 +0200 Subject: [PATCH 746/883] feat(ci): cppcheck stage updates * using focal instead of xenial (new cppcheck version) * detecting the difference in stats with latest develop stats Signed-off-by: Raphael Defosseux --- ci-scripts/cls_static_code_analysis.py | 85 ++++++++++++++++++++------ 1 file changed, 66 insertions(+), 19 deletions(-) diff --git a/ci-scripts/cls_static_code_analysis.py b/ci-scripts/cls_static_code_analysis.py index c899a9aabd..d6796ad414 100644 --- a/ci-scripts/cls_static_code_analysis.py +++ b/ci-scripts/cls_static_code_analysis.py @@ -35,6 +35,7 @@ import sys # arg import re # reg import logging import os +from pathlib import Path import time #----------------------------------------------------------- @@ -51,7 +52,7 @@ class CppCheckResults(): def __init__(self): - self.variants = ['xenial', 'bionic'] + self.variants = ['bionic', 'focal'] self.versions = ['',''] self.nbErrors = [0,0] self.nbWarnings = [0,0] @@ -116,12 +117,22 @@ class StaticCodeAnalysis(): # if the commit ID is provided use it to point to it if self.ranCommitID != '': mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 30) + # if the branch is not develop, then it is a merge request and we need to do + # the potential merge. Note that merge conflicts should already been checked earlier + if (self.ranAllowMerge): + if self.ranTargetBranch == '': + if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'): + mySSH.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 5) + else: + logging.debug('Merging with the target branch: ' + self.ranTargetBranch) + mySSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 5) - mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 60) - mySSH.command('docker build --tag oai-cppcheck:xenial --file ci-scripts/docker/Dockerfile.cppcheck.xenial . > cmake_targets/log/cppcheck-xenial.txt 2>&1', '\$', 600) + mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:focal || true', '\$', 60) mySSH.command('sed -e "s@xenial@bionic@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.bionic', '\$', 6) mySSH.command('docker build --tag oai-cppcheck:bionic --file ci-scripts/docker/Dockerfile.cppcheck.bionic . > cmake_targets/log/cppcheck-bionic.txt 2>&1', '\$', 600) - mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 30) + mySSH.command('sed -e "s@xenial@focal@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.focal', '\$', 6) + mySSH.command('docker build --tag oai-cppcheck:focal --file ci-scripts/docker/Dockerfile.cppcheck.focal . > cmake_targets/log/cppcheck-focal.txt 2>&1', '\$', 600) + mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:focal || true', '\$', 30) # Analyzing the logs mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5) @@ -131,8 +142,22 @@ class StaticCodeAnalysis(): mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/build_log_' + self.testCase_id + '/*', '.') CCR = CppCheckResults() + CCR_ref = CppCheckResults() vId = 0 for variant in CCR.variants: + refAvailable = False + if self.ranAllowMerge: + refFolder = str(Path.home()) + '/cppcheck-references' + if (os.path.isfile(refFolder + '/cppcheck-'+ variant + '.txt')): + refAvailable = True + with open(refFolder + '/cppcheck-'+ variant + '.txt', 'r') as refFile: + for line in refFile: + ret = re.search(' (?P[0-9\.]+) errors', str(line)) + if ret is not None: + CCR_ref.nbErrors[vId] = int(ret.group('nb_errors')) + ret = re.search(' (?P[0-9\.]+) warnings', str(line)) + if ret is not None: + CCR_ref.nbWarnings[vId] = int(ret.group('nb_warnings')) if (os.path.isfile('./cppcheck-'+ variant + '.txt')): xmlStart = False with open('./cppcheck-'+ variant + '.txt', 'r') as logfile: @@ -167,21 +192,43 @@ class StaticCodeAnalysis(): CCR.nbPtrAddNotNull[vId] += 1 if re.search('id="oppositeInnerCondition"', str(line)) is not None: CCR.nbOppoInnerCondition[vId] += 1 - logging.debug('======== Variant ' + variant + ' - ' + CCR.versions[vId] + ' ========') - logging.debug(' ' + str(CCR.nbErrors[vId]) + ' errors') - logging.debug(' ' + str(CCR.nbWarnings[vId]) + ' warnings') - logging.debug(' -- Details --') - logging.debug(' Memory leak: ' + str(CCR.nbMemLeaks[vId])) - logging.debug(' Possible null pointer deference: ' + str(CCR.nbNullPtrs[vId])) - logging.debug(' Uninitialized variable: ' + str(CCR.nbUninitVars[vId])) - logging.debug(' Undefined behaviour shifting: ' + str(CCR.nbTooManyBitsShift[vId])) - logging.debug(' Signed integer overflow: ' + str(CCR.nbIntegerOverflow[vId])) - logging.debug('') - logging.debug(' Printf formatting issue: ' + str(CCR.nbInvalidPrintf[vId])) - logging.debug(' Modulo result is predetermined: ' + str(CCR.nbModuloAlways[vId])) - logging.debug(' Opposite Condition -> dead code: ' + str(CCR.nbOppoInnerCondition[vId])) - logging.debug(' Wrong Scanf Nb Args: ' + str(CCR.nbWrongScanfArg[vId])) - logging.debug('') + vMsg = '' + vMsg += '======== Variant ' + variant + ' - ' + CCR.versions[vId] + ' ========\n' + vMsg += ' ' + str(CCR.nbErrors[vId]) + ' errors\n' + vMsg += ' ' + str(CCR.nbWarnings[vId]) + ' warnings\n' + vMsg += ' -- Details --\n' + vMsg += ' Memory leak: ' + str(CCR.nbMemLeaks[vId]) + '\n' + vMsg += ' Possible null pointer deference: ' + str(CCR.nbNullPtrs[vId]) + '\n' + vMsg += ' Uninitialized variable: ' + str(CCR.nbUninitVars[vId]) + '\n' + vMsg += ' Undefined behaviour shifting: ' + str(CCR.nbTooManyBitsShift[vId]) + '\n' + vMsg += ' Signed integer overflow: ' + str(CCR.nbIntegerOverflow[vId]) + '\n' + vMsg += '\n' + vMsg += ' Printf formatting issue: ' + str(CCR.nbInvalidPrintf[vId]) + '\n' + vMsg += ' Modulo result is predetermined: ' + str(CCR.nbModuloAlways[vId]) + '\n' + vMsg += ' Opposite Condition -> dead code: ' + str(CCR.nbOppoInnerCondition[vId]) + '\n' + vMsg += ' Wrong Scanf Nb Args: ' + str(CCR.nbWrongScanfArg[vId]) + '\n' + for vLine in vMsg.split('\n'): + logging.debug(vLine) + if self.ranAllowMerge and refAvailable: + if CCR_ref.nbErrors[vId] == CCR.nbErrors[vId]: + logging.debug(' No change in number of errors') + elif CCR_ref.nbErrors[vId] > CCR.nbErrors[vId]: + logging.debug(' Good! Decrease in number of errors') + else: + logging.debug(' Bad! increase in number of errors') + if CCR_ref.nbWarnings[vId] == CCR.nbWarnings[vId]: + logging.debug(' No change in number of warnings') + elif CCR_ref.nbWarnings[vId] > CCR.nbWarnings[vId]: + logging.debug(' Good! Decrease in number of warnings') + else: + logging.debug(' Bad! increase in number of warnings') + # Create new reference file + if not self.ranAllowMerge: + refFolder = str(Path.home()) + '/cppcheck-references' + if not os.path.isdir(refFolder): + os.mkdir(refFolder) + with open(refFolder + '/cppcheck-'+ variant + '.txt', 'w') as refFile: + refFile.write(vMsg) vId += 1 HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) From a02adbdcb482cc85be0253cf68dba20a78d54339 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 28 Mar 2022 12:16:39 +0200 Subject: [PATCH 747/883] feat(ci): mechanism to create multiple unique tags per week -- In case we do multiple merges per week -- Also use the proper week numbering (ISO week number, with Monday as first day of week (01..53)) Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-push-registry | 4 ++- ci-scripts/provideUniqueImageTag.py | 54 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 ci-scripts/provideUniqueImageTag.py diff --git a/ci-scripts/Jenkinsfile-push-registry b/ci-scripts/Jenkinsfile-push-registry index 91d6136e0a..f5847ff0aa 100644 --- a/ci-scripts/Jenkinsfile-push-registry +++ b/ci-scripts/Jenkinsfile-push-registry @@ -55,7 +55,9 @@ pipeline { stage ("Push to DockerHub") { steps { script { - WEEK_TAG = sh returnStdout: true, script: 'date +"%Y.w%U"' + WEEK_REF = sh returnStdout: true, script: 'date +"%Y.w%V"' + WEEK_REF = WEEK_REF.trim() + WEEK_TAG = sh returnStdout: true, script: 'python3 ./ci-scripts/provideUniqueImageTag.py --start_tag ' + WEEK_REF WEEK_TAG = WEEK_TAG.trim() withCredentials([ diff --git a/ci-scripts/provideUniqueImageTag.py b/ci-scripts/provideUniqueImageTag.py new file mode 100644 index 0000000000..ee8306402f --- /dev/null +++ b/ci-scripts/provideUniqueImageTag.py @@ -0,0 +1,54 @@ +import argparse +import os +import re +import subprocess +import sys + +AUTH_SERVICE = 'registry.docker.io' +AUTH_SCOPE = 'repository:rdefosseoai/oai-enb:pull' + +def main() -> None: + args = _parse_args() + + cmd = 'curl -fsSL "https://auth.docker.io/token?service=' + AUTH_SERVICE + '&scope=' + AUTH_SCOPE + '" | jq --raw-output ".token"' + token = subprocess.check_output(cmd, shell=True, universal_newlines=True) + token = str(token).strip() + cmd = 'curl -fsSL -H "Authorization: Bearer ' + token + '" "https://index.docker.io/v2/rdefosseoai/oai-enb/tags/list" | jq .' + listOfTags = subprocess.check_output(cmd, shell=True, universal_newlines=True) + + foundTag = False + for tag in listOfTags.split('\n'): + if re.search('"' + args.start_tag + '"', tag) is not None: + foundTag = True + + if not foundTag: + print (args.start_tag) + sys.exit(0) + + proposedVariants = ['a', 'b', 'c', 'd'] + for variant in proposedVariants: + foundTag = False + currentVariant = variant + for tag in listOfTags.split('\n'): + if re.search('"' + args.start_tag + variant + '"', tag) is not None: + foundTag = True + break + if not foundTag: + break + + if not foundTag: + print (args.start_tag + currentVariant) + +def _parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser(description='Provides an unique new image tag for DockerHub') + + parser.add_argument( + '--start_tag', '-st', + action='store', + required=True, + help='Proposed Starting Tag', + ) + return parser.parse_args() + +if __name__ == '__main__': + main() From 426ded6e31a449e0da30c0656df6c69166b72c8a Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 30 Mar 2022 16:42:12 +0200 Subject: [PATCH 748/883] fix(build): fix warnings on circular dependency Signed-off-by: Raphael Defosseux --- openair2/PHY_INTERFACE/queue_t.h | 5 ++++- openair2/RRC/LTE/MESSAGES/asn1_msg.h | 5 +++++ openair2/RRC/NR/MESSAGES/asn1_msg.h | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openair2/PHY_INTERFACE/queue_t.h b/openair2/PHY_INTERFACE/queue_t.h index 4678e31030..5c644a320c 100644 --- a/openair2/PHY_INTERFACE/queue_t.h +++ b/openair2/PHY_INTERFACE/queue_t.h @@ -24,7 +24,8 @@ } */ -#pragma once +#ifndef __OPENAIR2_PHY_INTERFACE_QUEUE_T__H__ +#define __OPENAIR2_PHY_INTERFACE_QUEUE_T__H__ #include #include @@ -62,3 +63,5 @@ typedef bool queue_matcher_t(void *wanted, void *candidate); Look only at the last `max_depth` items on the queue, at most. Returns the candidate item, or NULL if none matches */ void *unqueue_matching(queue_t *q, size_t max_depth, queue_matcher_t *matcher, void *wanted); + +#endif /* __OPENAIR2_PHY_INTERFACE_QUEUE_T__H__ */ diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg.h b/openair2/RRC/LTE/MESSAGES/asn1_msg.h index d1d1d3febe..8373bb53f3 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg.h @@ -28,6 +28,9 @@ * \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr */ +#ifndef __RRC_LTE_MESSAGES_ASN1_MSG__H__ +#define __RRC_LTE_MESSAGES_ASN1_MSG__H__ + #include #include #include /* for atoi(3) */ @@ -405,3 +408,5 @@ uint8_t do_SecurityModeCommand( const uint8_t Transaction_id, const uint8_t cipheringAlgorithm, const uint8_t integrityProtAlgorithm); + +#endif /* __RRC_LTE_MESSAGES_ASN1_MSG__H__ */ diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index befe83b141..52efba6f45 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -28,7 +28,8 @@ * \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr, kroempa@gmail.com */ -#pragma once +#ifndef __RRC_NR_MESSAGES_ASN1_MSG__H__ +#define __RRC_NR_MESSAGES_ASN1_MSG__H__ #include #include @@ -207,3 +208,4 @@ do_RRCReestablishmentComplete( uint8_t *buffer, size_t buffer_size, int64_t rrc_TransactionIdentifier); +#endif /* __RRC_NR_MESSAGES_ASN1_MSG__H__ */ From aca240e9e31d541ed015189b7be1407fa401e158 Mon Sep 17 00:00:00 2001 From: hardy Date: Wed, 30 Mar 2022 16:56:49 +0200 Subject: [PATCH 749/883] fix ttyUSBx for quectel nrmodule2 --- ci-scripts/ci_ueinfra.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index 51acb75968..91ae36559c 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -27,8 +27,8 @@ nrmodule2_quectel: Apn : OAICN5G : oai OAI-Rel14-Docker : oai.ipv4 - WakeupScript : ci_ctl_qtel.py /dev/ttyUSB7 wup - DetachScript : ci_ctl_qtel.py /dev/ttyUSB7 detach + WakeupScript : ci_ctl_qtel.py /dev/ttyUSB2 wup + DetachScript : ci_ctl_qtel.py /dev/ttyUSB2 detach LogStore : /media/ci_qlogs PLMN : 20897 UENetwork : wwan1 From 665db19ed6d2c1330c6be343486c3e3c0fa14c6a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 30 Mar 2022 17:25:37 +0200 Subject: [PATCH 750/883] Change first SA test to DDSUU 2.5ms TDD period + ping to 10ms --- ...nd78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf | 305 ++++++++++++++++++ ci-scripts/xml_files/fr1_sa_quectel.xml | 8 +- 2 files changed, 309 insertions(+), 4 deletions(-) create mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf new file mode 100644 index 0000000000..6fd04bf569 --- /dev/null +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf @@ -0,0 +1,305 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; + ul_prbblacklist = "51,52,53,54" + do_SRS = 1; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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 = 5; + nrofDownlinkSlots = 2; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; +# pusch_TargetSNRx10 = 200; +# pucch_TargetSNRx10 = 150; + ulsch_max_frame_inactivity = 0; + } +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sl_ahead = 5; + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +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"; + f1ap_log_level ="debug"; + }; diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 8d15015c07..69399597c1 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -22,7 +22,7 @@ --> TEST-SA-FR1-Tab1 - SA Ping DL UL with QUECTEL + SA Ping DL UL with Quectel, 2.5ms TDD tasks 1 @@ -63,7 +63,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 --T_stdout 2 --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 --log_config.global_log_options level,nocolor,time 0 0 nr @@ -92,7 +92,7 @@ nrmodule2_quectel -c 40 1 - 20 + 10 @@ -101,7 +101,7 @@ nrmodule2_quectel -c 100 -i 0,2 1 - 20 + 10 From 1985393d518e1afbc8e32e77dc40b7f5e3b57b2e Mon Sep 17 00:00:00 2001 From: Mario Hudon Date: Wed, 30 Mar 2022 11:38:53 -0400 Subject: [PATCH 751/883] - Fixed NR UE Scope build - Added a double data buffer in the NR UE Scope to reduce the risk of race condition/data corruption between the Scope thread and the Rx thread --- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 7 ++ openair1/PHY/TOOLS/nr_phy_scope.c | 81 +++++++++++++----------- openair1/PHY/TOOLS/phy_scope_interface.h | 2 + 3 files changed, 52 insertions(+), 38 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 293588b978..3add2c7b99 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -42,6 +42,7 @@ #include "PHY/CODING/coding_extern.h" #include "PHY/sse_intrin.h" #include "common/utils/nr/nr_common.h" +#include #include "assertions.h" #include "T.h" @@ -766,6 +767,9 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, s, log2_maxh, n_rb); // log2_maxh+I0_shift + + UEscopeCopy(ue, pdcchRxdataF_comp, rxdataF_comp, sizeof(struct complex16), frame_parms->nb_antennas_rx, rx_size); + if (frame_parms->nb_antennas_rx > 1) { LOG_D(PHY,"we enter nr_pdcch_detection_mrc(frame_parms->nb_antennas_rx=%d)\n", frame_parms->nb_antennas_rx); nr_pdcch_detection_mrc(frame_parms, rx_size, rxdataF_comp,s); @@ -779,6 +783,9 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, llr, s, n_rb); + + UEscopeCopy(ue, pdcchLlr, llr, sizeof(int16_t), 1, llr_size); + #if T_TRACER // T(T_UE_PHY_PDCCH_IQ, T_INT(frame_parms->N_RB_DL), T_INT(frame_parms->N_RB_DL), diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index fe0f785ef4..81ca5bf3dd 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -678,52 +678,42 @@ static void uePbchIQ (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_U static void uePcchLLR (scopeGraphData_t **data, OAIgraph_t *graph, PHY_VARS_NR_UE *phy_vars_ue, int eNB_id, int UE_id) { // PDCCH LLRs - if (!phy_vars_ue->pdcch_vars[0][eNB_id]->llr) + if (!data[pdcchLlr]) return; //int num_re = 4*273*12; // 12*frame_parms->N_RB_DL*num_pdcch_symbols //int Qm = 2; - int coded_bits_per_codeword = 2*4*100*12; //num_re*Qm; + const int sz=data[pdcchLlr]->lineSz; float *llr, *bit; - oai_xygraph_getbuff(graph, &bit, &llr, coded_bits_per_codeword*RX_NB_TH_MAX, 0); - int base=0; + oai_xygraph_getbuff(graph, &bit, &llr, sz, 0); - for (int thr=0 ; thr < RX_NB_TH_MAX ; thr ++ ) { - int16_t *pdcch_llr = (int16_t *) phy_vars_ue->pdcch_vars[thr][eNB_id]->llr; + int16_t *pdcch_llr = (int16_t *)(data[pdcchLlr]+1); - for (int i=0; ipdcch_vars[0][eNB_id]->rxdataF_comp[0]) + if (!data[pdcchRxdataF_comp]) return; - int nb=4*273*12; // 12*frame_parms->N_RB_DL*num_pdcch_symbols + const int sz=data[pdcchRxdataF_comp]->lineSz; + //const int antennas=data[pdcchRxdataF_comp]->colSz; + // We take the first antenna only for now float *I, *Q; - oai_xygraph_getbuff(graph, &I, &Q, nb*RX_NB_TH_MAX, 0); - int base=0; + oai_xygraph_getbuff(graph, &I, &Q, sz, 0); - for (int thr=0 ; thr < RX_NB_TH_MAX ; thr ++ ) { - scopeSample_t *pdcch_comp = (scopeSample_t *) phy_vars_ue->pdcch_vars[thr][eNB_id]->rxdataF_comp[0]; + scopeSample_t *pdcch_comp = (scopeSample_t *) (data[pdcchRxdataF_comp]+1); - for (int i=0; i< nb; i++) { - I[base+i] = pdcch_comp[i].r; - Q[base+i] = pdcch_comp[i].i; - } - - base+=nb; + for (int i=0; iscopeData)->liveData=calloc(sizeof(scopeGraphData_t *), UEdataTypeNumberOfItems); while (!oai_exit) { fl_freeze_form(form_nrue->phy_scope); @@ -925,28 +914,43 @@ static void *nrUEscopeThread(void *arg) { } void UEcopyData(PHY_VARS_NR_UE *ue, enum UEdataType type, void *dataIn, int elementSz, int colSz, int lineSz) { + // Local static copy of the scope data bufs + // The active data buf is alterned to avoid interference between the Scope thread (display) and the Rx thread (data input) + // Index of "2" could be set to the number of Rx threads + 1 + static scopeGraphData_t *copyDataBufs[UEdataTypeNumberOfItems][2] = {0}; + static int copyDataBufsIdx[UEdataTypeNumberOfItems] = {0}; + scopeData_t *tmp=(scopeData_t *)ue->scopeData; if (tmp) { - scopeGraphData_t *live= ((scopeGraphData_t **)tmp->liveData)[type]; + // Begin of critical zone between UE Rx threads that might copy new data at the same time: might require a mutex + int newCopyDataIdx = (copyDataBufsIdx[type]==0)?1:0; + copyDataBufsIdx[type] = newCopyDataIdx; + // End of critical zone between UE Rx threads - if (live == NULL || live->dataSize < elementSz*colSz*lineSz) { - scopeGraphData_t *ptr=realloc(live, sizeof(scopeGraphData_t) + elementSz*colSz*lineSz); + // New data will be copied in a different buffer than the live one + scopeGraphData_t *copyData= copyDataBufs[type][newCopyDataIdx]; + + if (copyData == NULL || copyData->dataSize < elementSz*colSz*lineSz) { + scopeGraphData_t *ptr=realloc(copyData, sizeof(scopeGraphData_t) + elementSz*colSz*lineSz); if (!ptr) { LOG_E(PHY,"can't realloc\n"); return; } else { - live=ptr; + copyData=ptr; } } - live->dataSize=elementSz*colSz*lineSz; - live->elementSz=elementSz; - live->colSz=colSz; - live->lineSz=lineSz; - memcpy(live+1, dataIn, elementSz*colSz*lineSz); - ((scopeGraphData_t **)tmp->liveData)[type]=live; + copyData->dataSize=elementSz*colSz*lineSz; + copyData->elementSz=elementSz; + copyData->colSz=colSz; + copyData->lineSz=lineSz; + memcpy(copyData+1, dataIn, elementSz*colSz*lineSz); + copyDataBufs[type][newCopyDataIdx] = copyData; + + // The new data just copied in the local static buffer becomes live now + ((scopeGraphData_t **)tmp->liveData)[type]=copyData; } } @@ -954,6 +958,7 @@ void nrUEinitScope(PHY_VARS_NR_UE *ue) { AssertFatal(ue->scopeData=malloc(sizeof(scopeData_t)),""); scopeData_t *scope=(scopeData_t *) ue->scopeData; scope->copyData=UEcopyData; + AssertFatal(scope->liveData=calloc(sizeof(scopeGraphData_t *), UEdataTypeNumberOfItems),""); pthread_t forms_thread; threadCreate(&forms_thread, nrUEscopeThread, ue, "scope", -1, OAI_PRIORITY_RT_LOW); } diff --git a/openair1/PHY/TOOLS/phy_scope_interface.h b/openair1/PHY/TOOLS/phy_scope_interface.h index 9cd8e1dc40..6162e1eee5 100644 --- a/openair1/PHY/TOOLS/phy_scope_interface.h +++ b/openair1/PHY/TOOLS/phy_scope_interface.h @@ -45,6 +45,8 @@ enum UEdataType { pbchDlChEstimateTime, pbchLlr, pbchRxdataF_comp, + pdcchLlr, + pdcchRxdataF_comp, UEdataTypeNumberOfItems }; From 100832b111c9e8d35fb12b8769dc2dd99a024eeb Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 31 Mar 2022 09:26:15 +0200 Subject: [PATCH 752/883] fix nrmodule2 network interface --- ci-scripts/ci_ueinfra.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index 91ae36559c..0a915740f2 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -31,7 +31,7 @@ nrmodule2_quectel: DetachScript : ci_ctl_qtel.py /dev/ttyUSB2 detach LogStore : /media/ci_qlogs PLMN : 20897 - UENetwork : wwan1 + UENetwork : wwan0 HostIPAddress : 192.168.18.189 HostUsername : nrmodule2 HostPassword : linux From e0befd2a8f3ffd96e0ad09e23df771f32620e3ef Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 31 Mar 2022 10:15:47 +0200 Subject: [PATCH 753/883] fix(ci): 2 little typos - The GitLab pipeline reporting for the 5G RF sim container was the same as 4G RF - Calling a sudo command without providing password Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 2 +- ci-scripts/cls_module_ue.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index f5852bace5..57738a3183 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -222,7 +222,7 @@ pipeline { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'Test-RF-Sim-Container-4G') + triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'Test-RF-Sim-Container-5G') } } post { diff --git a/ci-scripts/cls_module_ue.py b/ci-scripts/cls_module_ue.py index 4e2efaeda5..fb10700798 100644 --- a/ci-scripts/cls_module_ue.py +++ b/ci-scripts/cls_module_ue.py @@ -76,7 +76,7 @@ class Module_UE: logging.debug('Starting ' + self.Process['Name']) mySSH = sshconnection.SSHConnection() mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) - mySSH.command('sudo rm -f /tmp/quectel-cm.log','\$',5) + mySSH.command('echo ' + self.HostPassword + ' | sudo -S rm -f /tmp/quectel-cm.log','\$',5) mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S stdbuf -o0 ' + self.Process['Cmd'] + ' ' + self.Process['Apn'][CNType] + ' > /tmp/quectel-cm.log 2>&1 &','\$',5) mySSH.close() #checking the process From c832d42eb46e94722156fdd7455a79bf2f34ca72 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 30 Mar 2022 16:15:31 +0200 Subject: [PATCH 754/883] doc(l2sim): adding a light tutorial for L2 sim + proxy using containers Signed-off-by: Raphael Defosseux --- ci-scripts/yaml_files/5g_l2sim_tdd/README.md | 355 +++++++++++++++++++ doc/L2NFAPI.md | 2 + 2 files changed, 357 insertions(+) create mode 100644 ci-scripts/yaml_files/5g_l2sim_tdd/README.md diff --git a/ci-scripts/yaml_files/5g_l2sim_tdd/README.md b/ci-scripts/yaml_files/5g_l2sim_tdd/README.md new file mode 100644 index 0000000000..531f2406ef --- /dev/null +++ b/ci-scripts/yaml_files/5g_l2sim_tdd/README.md @@ -0,0 +1,355 @@ + + + + + +
+ + + + + + OAI Full Stack 5G-NR L2 simulation with containers and a proxy +
+ +This page is only valid for an `Ubuntu18` host. + +This tutorial is only valid once this file is merged into the `develop` branch. + +# 1. Retrieving the images on Docker-Hub # + +Currently the images are hosted under the user account `rdefosseoai`. + +This may change in the future. + +Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`. + +```bash +$ docker login +Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one. +Username: +Password: +``` + +Now pull images. + +```bash +$ docker pull mysql:5.7 +$ docker pull rdefosseoai/oai-amf:latest +$ docker pull rdefosseoai/oai-nrf:latest +$ docker pull rdefosseoai/oai-smf:latest +$ docker pull rdefosseoai/oai-spgwu-tiny:latest + +$ docker pull rdefosseoai/oai-gnb:develop +$ docker pull rdefosseoai/oai-nr-ue:develop +$ docker pull rdefosseoai/proxy:latest +``` + +And **re-tag** them for tutorials' docker-compose file to work. + +```bash +$ docker image tag rdefosseoai/oai-amf:latest oai-amf:latest +$ docker image tag rdefosseoai/oai-nrf:latest oai-nrf:latest +$ docker image tag rdefosseoai/oai-smf:latest oai-smf:latest +$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest + +$ docker image tag rdefosseoai/oai-gnb:develop oai-gnb:develop +$ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop +$ docker image tag rdefosseoai/proxy:latest oai-lte-multi-ue-proxy:latest +``` + +```bash +$ docker logout +``` + +Note that the proxy image is based on the source available at [https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy](https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy). + +At time of writing, the `latest` tag corresponded to `56cfdc046a5f96d5e67d42a2fc2bf6ba2fe58b41` commit. + +# 2. Deploy containers # + +**CAUTION: this SHALL be done in multiple steps.** + +**Just `docker-compose up -d` WILL NOT WORK!** + +All the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_l2sim_tdd` folder. + +The `gNB`, `proxy` and `NR-UE` containers will be deployed in `host`-mode. It will use the host loopback interface to connect. + +```bash +sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up +``` + +## 2.1. Deploy OAI 5G Core Network ## + +```bash +$ cd ci-scripts/yaml_files/5g_l2sim_tdd +$ docker-compose up -d mysql oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn +Creating network "l2sim-oai-public-net" with driver "bridge" +Creating network "l2sim-oai-traffic_net-net" with driver "bridge" +Creating l2sim-oai-nrf ... done +Creating l2sim-mysql ... done +Creating l2sim-oai-spgwu ... done +Creating l2sim-oai-amf ... done +Creating l2sim-oai-smf ... done +Creating l2sim-oai-ext-dn ... done +``` + +Wait for a bit. + +```bash +$ docker-compose ps -a + Name Command State Ports +------------------------------------------------------------------------------------------------- +l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp +l2sim-oai-amf /bin/bash /openair-amf/bin ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp +l2sim-oai-ext-dn /bin/bash -c apt update; ... Up (healthy) +l2sim-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/tcp +l2sim-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp +l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +``` + +At this point, you can prepare a capture on the newly-created public docker bridges: + +```bash +$ ifconfig +... +l2sim-public: flags=4163 mtu 1500 + inet 192.168.71.129 netmask 255.255.255.192 broadcast 192.168.71.191 + inet6 fe80::42:c4ff:fe2b:3d38 prefixlen 64 scopeid 0x20 + ether 02:42:c4:2b:3d:38 txqueuelen 0 (Ethernet) + RX packets 4 bytes 112 (112.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 7 bytes 626 (626.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +l2sim-traffic: flags=4163 mtu 1500 + inet 192.168.72.129 netmask 255.255.255.192 broadcast 192.168.72.191 + inet6 fe80::42:b5ff:fed3:e732 prefixlen 64 scopeid 0x20 + ether 02:42:b5:d3:e7:32 txqueuelen 0 (Ethernet) + RX packets 2652 bytes 142335 (142.3 KB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 3999 bytes 23367972 (23.3 MB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 +... + +$ sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not arp and not port 53 and not port 2152 and not port 2153)" -i l2sim-public -i l2sim-traffic -w /tmp/capture_5g_l2sim_tdd.pcap > /tmp/tshark.log 2>&1 & +``` + +## 2.2. Deploy OAI gNB in Standalone Mode as a VNF ## + +**CAUTION: To execute this 2nd step, the whole `CN5G` SHALL be in `healthy` state (especially the `mysql` container).** + +```bash +$ docker-compose up -d oai-gnb +l2sim-oai-nrf is up-to-date +l2sim-oai-spgwu is up-to-date +l2sim-oai-ext-dn is up-to-date +Creating l2sim-oai-gnb ... done +``` + +Wait for a bit. + +```bash +$ docker-compose ps -a + Name Command State Ports +------------------------------------------------------------------------------------------------- +l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp +l2sim-oai-amf /bin/bash /openair-amf/bin ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp +l2sim-oai-ext-dn /bin/bash -c apt update; ... Up (healthy) +l2sim-oai-gnb /opt/oai-gnb/bin/entrypoin ... Up (healthy) +l2sim-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/tcp +l2sim-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp +l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +``` + +You can verify that the `gNB` is connected with the `AMF`: + +```bagh +$ docker logs rfsim5g-oai-amf +... +[AMF] [amf_app] [info ] |----------------------------------------------------gNBs' information-------------------------------------------| +[AMF] [amf_app] [info ] | Index | Status | Global ID | gNB Name | PLMN | +[AMF] [amf_app] [info ] | 1 | Connected | 0x0 | gnb-l2sim-vnf | 208, 99 | +[AMF] [amf_app] [info ] |----------------------------------------------------------------------------------------------------------------| +... +``` + +## 2.3. Deploy OAI NR-UE and proxy + +```bash +$ docker-compose up -d proxy oai-nr-ue0 +l2sim-mysql is up-to-date +l2sim-oai-nrf is up-to-date +l2sim-oai-amf is up-to-date +l2sim-oai-smf is up-to-date +l2sim-oai-spgwu is up-to-date +l2sim-oai-ext-dn is up-to-date +l2sim-oai-gnb is up-to-date +Creating l2sim-oai-nr-ue ... done +Creating l2sim-proxy ... done +``` + +Wait for a bit. + +```bash +$ docker-compose ps -a + Name Command State Ports +------------------------------------------------------------------------------------------------- +l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp +l2sim-oai-amf /bin/bash /openair-amf/bin ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp +l2sim-oai-ext-dn /bin/bash -c apt update; ... Up (healthy) +l2sim-oai-gnb /opt/oai-gnb/bin/entrypoin ... Up (healthy) +l2sim-oai-nr-ue0 /opt/oai-nr-ue/bin/entrypo ... Up (healthy) +l2sim-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/tcp +l2sim-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp +l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp +l2sim-proxy /oai-lte-multi-ue-proxy/bi ... Up (healthy) + +$ docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}} {{.MemUsage}}\t{{.MemPerc}}" l2sim-mysql l2sim-oai-amf l2sim-oai-ext-dn l2sim-oai-gnb l2sim-oai-nr-ue0 l2sim-oai-nrf l2sim-oai-smf l2sim-oai-spgwu l2sim-proxy +CONTAINER CPU % MEM USAGE / LIMIT MEM % +l2sim-mysql 0.03% 206.7MiB / 62.54GiB 0.32% +l2sim-oai-amf 4.05% 29.49MiB / 62.54GiB 0.05% +l2sim-oai-ext-dn 0.00% 31.27MiB / 62.54GiB 0.05% +l2sim-oai-gnb 1.29% 1.853GiB / 62.54GiB 2.96% +l2sim-oai-nr-ue0 1.43% 350.8MiB / 62.54GiB 0.55% +l2sim-oai-nrf 0.21% 9.105MiB / 62.54GiB 0.01% +l2sim-oai-smf 3.24% 30.23MiB / 62.54GiB 0.05% +l2sim-oai-spgwu 0.00% 11.78MiB / 62.54GiB 0.02% +l2sim-proxy 6.97% 290.4MiB / 62.54GiB 0.45% +``` + +**CAUTION: As you can see the CPU usage is not that important compared to a 5G RF simulator equivalent.** + +But the CPU speed matters; I am running on a fast server: + +```bash +$ lscpu +Architecture: x86_64 +CPU(s): 16 +... +Model name: Intel(R) Xeon(R) Silver 4215R CPU @ 3.20GHz +``` + +I tried on a slower server with more CPUs and it did not work: + +```bash +oaici@orion:~$ lscpu +Architecture: x86_64 +CPU(s): 48 +... +Model name: Intel(R) Xeon(R) CPU E5-2658 v3 @ 2.20GHz +``` + +We will work on this issue. + + +Making sure the OAI UE is connected: + +```bash +$ docker exec -it l2sim-oai-nr-ue /bin/bash +root@bb4d400a832d:/opt/oai-nr-ue# ifconfig +eth0: flags=4163 mtu 1500 + inet 192.168.71.137 netmask 255.255.255.192 broadcast 192.168.71.191 + ether 02:42:c0:a8:47:89 txqueuelen 0 (Ethernet) + RX packets 224259 bytes 5821372018 (5.8 GB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 235916 bytes 7848786376 (7.8 GB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +lo: flags=73 mtu 65536 + inet 127.0.0.1 netmask 255.0.0.0 + loop txqueuelen 1000 (Local Loopback) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 + +oaitun_ue1: flags=4305 mtu 1500 + inet 12.1.1.2 netmask 255.255.255.0 destination 12.1.1.2 + unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 +``` + +# 3. Check traffic # + +## 3.1. Check your Internet connectivity ## + +You can also check with the `ext-dn` container (IP address is `192.168.72.135` in docker-compose) + +```bash +$ docker exec -it l2sim-oai-nr-ue /bin/bash +root@bb4d400a832d# ping -I oaitun_ue1 -c 20 192.168.72.135 +PING 192.168.72.135 (192.168.72.135) from 12.1.1.2 oaitun_ue1: 56(84) bytes of data. +64 bytes from 192.168.72.135: icmp_seq=1 ttl=63 time=65.1 ms +64 bytes from 192.168.72.135: icmp_seq=2 ttl=63 time=74.2 ms +... +64 bytes from 192.168.72.135: icmp_seq=19 ttl=63 time=25.0 ms +64 bytes from 192.168.72.135: icmp_seq=20 ttl=63 time=34.7 ms + +--- 192.168.72.135 ping statistics --- +20 packets transmitted, 20 received, 0% packet loss, time 19025ms +rtt min/avg/max/mdev = 16.413/120.639/209.673/57.159 ms +``` + +# 4. Un-deployment # + +```bash +$ docker-compose down +Stopping l2sim-oai-nr-ue2 ... done +Stopping l2sim-oai-nr-ue ... done +Stopping l2sim-oai-gnb ... done +Stopping l2sim-oai-ext-dn ... done +Stopping l2sim-oai-spgwu ... done +Stopping l2sim-oai-smf ... done +Stopping l2sim-oai-amf ... done +Stopping l2sim-oai-nrf ... done +Stopping l2sim-mysql ... done +Removing l2sim-oai-nr-ue2 ... done +Removing l2sim-oai-nr-ue ... done +Removing l2sim-oai-gnb ... done +Removing l2sim-oai-ext-dn ... done +Removing l2sim-oai-spgwu ... done +Removing l2sim-oai-smf ... done +Removing l2sim-oai-amf ... done +Removing l2sim-oai-nrf ... done +Removing l2sim-mysql ... done +Removing network l2sim-oai-public-net +Removing network l2sim-oai-traffic-net +``` + +# 5. Adapt the `docker-compose` to your environment # + +In the `SMF` section, provide your own DNS IP address: + +```yaml + DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 +``` + +In the `gNB` section, provide your docker-host primary IP address and interface name: in our case `192.168.18.193` and `eno1`. + +```yaml + GNB_NGA_IF_NAME: eno1 + GNB_NGA_IP_ADDRESS: 192.168.18.193 + GNB_NGU_IF_NAME: eno1 + GNB_NGU_IP_ADDRESS: 192.168.18.193 +``` + +Same thing in the `nr-ue` section: + +```yaml + NR_UE_NFAPI_IF_NAME: eno1 +``` + +This tutorial is a first draft. This nFAPI feature and the proxy are still under development. + +At time of writing, we were able to run in `host-mode`, 1 `NR-UE` and just ping traffic. + +Later development will include: + + - deploying `gNB-VNF`, `proxy` and `UE` in isolated containers (with their own IP address) + - more UEs + - more traffic (`UDP` and `TCP`) diff --git a/doc/L2NFAPI.md b/doc/L2NFAPI.md index 5b8c0f546c..77f9e5cb78 100644 --- a/doc/L2NFAPI.md +++ b/doc/L2NFAPI.md @@ -46,6 +46,8 @@ This proxy allows to perform L2 nFAPI simulator for: * 5G-NSA * 5G-SA +Another tutorial for 5G SA mode with 1 User is available [here](../ci-scripts/yaml_files/5g_l2sim_tdd/README.md). + ---- [oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home) From 2c64a0d7574b6d9e24e43baf8648f13855f6768a Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 31 Mar 2022 10:24:39 +0200 Subject: [PATCH 755/883] fix(ci): fix little typo Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index a76323513f..12d235914b 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -242,7 +242,7 @@ pipeline { when { expression {doMandatoryTests} } steps { script { - triggerSlaveJob ('RAN-L2-Sim-Test-5G', 'Test-L2-Sim-Container-4G') + triggerSlaveJob ('RAN-L2-Sim-Test-5G', 'Test-L2-Sim-Container-5G') } } post { From 120194e5e672b89c0e17f3ca83eabe9b075004ae Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 31 Mar 2022 14:16:28 +0200 Subject: [PATCH 756/883] Fix caracal USRP address --- ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index d21cf90cd9..6d05fee692 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -221,8 +221,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sdr_addrs = "addr=192.168.30.2,mgmt_addr=192.168.30.2,second_addr=192.168.50.2"; - clock_src = "external"; + sdr_addrs = "addr=192.168.20.2"; } ); From d91ed6fa80e67345753e3fd5be668f02d7af468a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 31 Mar 2022 15:10:42 +0200 Subject: [PATCH 757/883] Update USRP IP address in CI XML file --- ci-scripts/xml_files/gnb_phytest_usrp_run.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml index f1185c08c9..5705533ab4 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml @@ -35,7 +35,7 @@ Initialize gNB USRP -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test -q -U 787200 -T 106 -t 28 -D 130175 -m 28 -M 106 --log_config.global_log_options level,nocolor,time NR - 192.168.30.2 + 192.168.20.2
From 87c5007970190d9e5c5a13a35e51ae40c714bdd8 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 21 Mar 2022 10:14:02 +0100 Subject: [PATCH 758/883] fix(container): when running in fedora-generic-kerner container, no setting of priority Signed-off-by: Raphael Defosseux --- common/utils/system.c | 7 ++++--- executables/nr-uesoftmodem.c | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/common/utils/system.c b/common/utils/system.c index d897063144..00839b485c 100644 --- a/common/utils/system.c +++ b/common/utils/system.c @@ -234,9 +234,10 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno); - if (system("grep -iq 'ID_LIKE.*fedora' /etc/os-release && uname -a | grep -c rt")==0) - if (system("cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods'")==0) - settingPriority = 0; + if (checkIfFedoraDistribution()) + if (checkIfGenericKernelOnFedora()) + if (checkIfInsideContainer()) + settingPriority = 0; if (settingPriority) { ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 00f019c03a..23615b2c98 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -396,7 +396,14 @@ void *rrc_enb_process_msg(void *notUsed) { int main( int argc, char **argv ) { - set_priority(79); + int set_exe_prio = 1; + if (checkIfFedoraDistribution()) + if (checkIfGenericKernelOnFedora()) + if (checkIfInsideContainer()) + set_exe_prio = 0; + if (set_exe_prio) + set_priority(79); + if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) { fprintf(stderr, "mlockall: %s\n", strerror(errno)); From 790f2802f70908dfa4d2bb1bd845e28a00fd9090 Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 1 Apr 2022 03:48:44 +0000 Subject: [PATCH 759/883] Help Menu and Argument Flag Aligned Signed-off-by: Manish --- cmake_targets/build_oai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 9bb07ef6a4..8270e3989f 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -186,7 +186,7 @@ function main() { until [ -z "$1" ] do case "$1" in - --archnative) + --arch-native) CMAKE_C_FLAGS+=("-march=native") CMAKE_CXX_FLAGS+=("-march=native") shift;; From 1472830d097a55116cfcb0c038e99fae25293aae Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 31 Mar 2022 11:58:17 +0200 Subject: [PATCH 760/883] Correct include directories for oai_usrpdevif --- cmake_targets/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 46e33e8803..721f78eceb 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -53,7 +53,6 @@ include_directories("/usr/local/include/") add_list2_option(RF_BOARD "None" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU" "EXMIMO") if (${RF_BOARD} STREQUAL "OAI_USRP") find_package(Boost REQUIRED) - include_directories(${LIBBOOST_INCLUDE_DIR}) elseif (${RF_BOARD} STREQUAL "OAI_IRIS") include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/") @@ -705,11 +704,14 @@ set (SHLIB_LOADER_SOURCES # include RF devices / transport protocols library modules ###################################################################### -include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/") set(HWLIB_USRP_SOURCE ${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp ) add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} ) +target_include_directories(oai_usrpdevif PRIVATE + "${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/" + ${Boost_INCLUDE_DIR} +) target_link_libraries(oai_usrpdevif uhd) include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/") From 42a6136683aef0e91890a78184a958f9145e9ee8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 1 Apr 2022 08:28:29 +0200 Subject: [PATCH 761/883] Correct caracal's USRP IP addresses --- ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf index 6d05fee692..4953620afa 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf @@ -221,7 +221,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sdr_addrs = "addr=192.168.20.2"; + sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2,mgmt_addr=192.168.18.85"; } ); From cb5e9d90e467b88672df32c9324e3d02f4cede9f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 1 Apr 2022 10:22:30 +0200 Subject: [PATCH 762/883] Create build_oai option to pass cmake params; add boost include dir caracal --- ci-scripts/xml_files/gnb_usrp_build.xml | 2 +- cmake_targets/build_oai | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/gnb_usrp_build.xml b/ci-scripts/xml_files/gnb_usrp_build.xml index e2662180c5..97f85c6a33 100644 --- a/ci-scripts/xml_files/gnb_usrp_build.xml +++ b/ci-scripts/xml_files/gnb_usrp_build.xml @@ -34,7 +34,7 @@ TesteNB Build_eNB Build gNB (USRP) - --gNB -w USRP --ninja + --gNB -w USRP --ninja --cmake-opt -DBoost_INCLUDE_DIR=/usr/include/boost169 True diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index c65728a41d..fe59741456 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -72,6 +72,8 @@ Options Erase all files made by previous compilations, installations --clean-kernel Erase previously installed features in kernel: iptables, drivers, ... +--cmake-opt + Pass the supplied option verbatim to cmake. -d | --build-dir Sets build directory (will be /cmake_targets//build) -I | --install-external-packages @@ -193,6 +195,9 @@ function main() { clean_kernel echo_info "Erased iptables config and removed modules from kernel" shift;; + --cmake-opt) + CMAKE_CMD="$CMAKE_CMD $2" + shift 2;; -d | --build-dir) BUILD_DIR=$2 shift;; From e15002c86c51b629a17c4a389f0ced65a2fe1551 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 1 Apr 2022 10:22:48 +0200 Subject: [PATCH 763/883] Shift correct number of params for build_oai --build-dir --- cmake_targets/build_oai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index fe59741456..71ed803744 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -200,7 +200,7 @@ function main() { shift 2;; -d | --build-dir) BUILD_DIR=$2 - shift;; + shift 2;; -I | --install-external-packages) INSTALL_EXTERNAL=1 echo_info "Will install external packages" From 8eb22e7262d51515f78f2732cf85eca91a6870b7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 1 Apr 2022 11:44:07 +0200 Subject: [PATCH 764/883] Remove duplicate statements --- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 226ba5b66d..7f4f57c359 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2259,8 +2259,6 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in .resource_indicator = -1, .initial_pucch_id = -1 }; - pucch.resource_indicator = -1; - pucch.initial_pucch_id = -1; uint16_t rnti = mac->crnti; //FIXME not sure this is valid for all pucch instances // SR From a826af5839cfd8e40b77702bb22019e3ee77b412 Mon Sep 17 00:00:00 2001 From: athanassopoulos Date: Thu, 13 Jan 2022 21:54:26 +0100 Subject: [PATCH 765/883] SDAP Initial Implementation --- cmake_targets/CMakeLists.txt | 3 +- common/utils/LOG/log.c | 1 + common/utils/LOG/log.h | 1 + common/utils/T/T_messages.txt | 21 + doc/FEATURE_SET.md | 16 + openair2/COMMON/platform_types.h | 9 + openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c | 4 +- openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h | 2 +- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 96 ++-- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h | 3 + openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.c | 4 +- openair2/RRC/NR/rrc_gNB.c | 8 +- openair2/SDAP/nr_sdap/nr_sdap.c | 73 +++ openair2/SDAP/nr_sdap/nr_sdap.h | 59 +++ openair2/SDAP/nr_sdap/nr_sdap_entity.c | 474 +++++++++++++++++++ openair2/SDAP/nr_sdap/nr_sdap_entity.h | 167 +++++++ openair2/SDAP/nr_sdap/nr_sdap_gnb.c | 87 ---- openair2/SDAP/nr_sdap/nr_sdap_gnb.h | 61 --- openair2/SDAP/nr_sdap/sdap_gNB.c | 30 -- openair3/ocp-gtpu/gtp_itf.cpp | 61 ++- 20 files changed, 937 insertions(+), 243 deletions(-) create mode 100644 openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h create mode 100644 openair2/SDAP/nr_sdap/nr_sdap.c create mode 100644 openair2/SDAP/nr_sdap/nr_sdap.h create mode 100644 openair2/SDAP/nr_sdap/nr_sdap_entity.c create mode 100644 openair2/SDAP/nr_sdap/nr_sdap_entity.h delete mode 100644 openair2/SDAP/nr_sdap/nr_sdap_gnb.c delete mode 100644 openair2/SDAP/nr_sdap/nr_sdap_gnb.h delete mode 100644 openair2/SDAP/nr_sdap/sdap_gNB.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 46e33e8803..06ba14965c 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1779,7 +1779,8 @@ set(NR_PDCP_SRC ) set(NR_SDAP_SRC - ${OPENAIR2_DIR}/SDAP/nr_sdap/nr_sdap_gnb.c + ${OPENAIR2_DIR}/SDAP/nr_sdap/nr_sdap.c + ${OPENAIR2_DIR}/SDAP/nr_sdap/nr_sdap_entity.c ) set(L2_SRC diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index 5b047c082d..8be3568034 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -478,6 +478,7 @@ int logInit (void) register_log_component("NAS","log",NAS); register_log_component("UDP","",UDP_); register_log_component("GTPU","",GTPU); + register_log_component("SDAP","",SDAP); register_log_component("S1AP","",S1AP); register_log_component("F1AP","",F1AP); register_log_component("M2AP","",M2AP); diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 1fbf42f62d..89b9c5e94d 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -215,6 +215,7 @@ typedef enum { OCM, UDP_, GTPU, + SDAP, SPGW, S1AP, F1AP, diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index a8b919e525..b3c06d6be8 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -944,6 +944,27 @@ ID = LEGACY_GTPU_TRACE GROUP = ALL:LEGACY_GTPU:LEGACY_GROUP_TRACE:LEGACY FORMAT = string,log +ID = LEGACY_SDAP_INFO + DESC = SDAP legacy logs - info level + GROUP = ALL:LEGACY_SDAP:LEGACY_GROUP_INFO:LEGACY + FORMAT = string,log +ID = LEGACY_SDAP_ERROR + DESC = SDAP legacy logs - error level + GROUP = ALL:LEGACY_SDAP:LEGACY_GROUP_ERROR:LEGACY + FORMAT = string,log +ID = LEGACY_SDAP_WARNING + DESC = SDAP legacy logs - warning level + GROUP = ALL:LEGACY_SDAP:LEGACY_GROUP_WARNING:LEGACY + FORMAT = string,log +ID = LEGACY_SDAP_DEBUG + DESC = SDAP legacy logs - debug level + GROUP = ALL:LEGACY_SDAP:LEGACY_GROUP_DEBUG:LEGACY + FORMAT = string,log +ID = LEGACY_SDAP_TRACE + DESC = SDAP legacy logs - trace level + GROUP = ALL:LEGACY_SDAP:LEGACY_GROUP_TRACE:LEGACY + FORMAT = string,log + ID = LEGACY_TMR_INFO DESC = TMR legacy logs - info level GROUP = ALL:LEGACY_TMR:LEGACY_GROUP_INFO:LEGACY diff --git a/doc/FEATURE_SET.md b/doc/FEATURE_SET.md index eaa691d6ef..a289c6d17e 100644 --- a/doc/FEATURE_SET.md +++ b/doc/FEATURE_SET.md @@ -351,6 +351,14 @@ The following features are valid for the gNB and the 5G-NR UE. - Interfaces with RRC, RLC - Interfaces with gtp-u (data Tx/Rx over N3 and F1-U interfaces) +**gNB SDAP** +- Send/Receive operations according to 37.324 Rel.15 + - Establishment/Handling of SDAP entities. + - Transfer of User Plane Data + - Mapping between a QoS flow and a DRB for both DL and UL + - Marking QoS flow ID in both DL and UL packets + - Reflective QoS flow to DRB mapping for UL SDAP data PDUs + **gNB RRC** - NR RRC (38.331) Rel 16 messages using new asn1c - LTE RRC (36.331) also updated to Rel 15 @@ -400,6 +408,7 @@ The following features are valid for the gNB and the 5G-NR UE. - New gtp-u implementation supporting both N3 and F1-U interfaces according to 29.281 Rel.15 - Interfaces with RRC, F1AP for tunnel creation - Interfaces with PDCP and RLC for data send/receive at the CU and DU respectively (F1-U interface) + - Interface with SDAP for data send/receive, capture of GTP-U Optional Header, GTP-U Extension Header and PDU Session Container. # OpenAirInterface 5G-NR UE Feature Set # @@ -502,6 +511,13 @@ The following features are valid for the gNB and the 5G-NR UE. - Radio bearer establishment/handling and association with PDCP entities - Interfaces with RRC, RLC +**UE SDAP** +* Tx/Rx operations operations according to 37.324 Rel.15 + - Establishment/Handling of SDAP entities. + - Transfer of User Plane Data + - Reflective Mapping + - RRC Signaling Mapping + **UE RRC** * Integration of RRC messages and procedures supporting UE 5G SA connection according to 38.331 Rel.16 - RRCSetupRequest/RRCSetup/RRCSetupComplete diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h index c24291de64..b9a7375b9f 100644 --- a/openair2/COMMON/platform_types.h +++ b/openair2/COMMON/platform_types.h @@ -233,11 +233,20 @@ typedef uint8_t pdusessionid_t; //----------------------------------------------------------------------------- // may be ITTI not enabled, but type instance is useful also for OTG, typedef intptr_t instance_t; + +typedef struct sdap_protocol_ctxt_s { + boolean_t rqi; + uint8_t qfi; + boolean_t dc; + int pdusession_id; +} sdap_protocol_ctxt_t; + typedef struct protocol_ctxt_s { module_id_t module_id; /*!< \brief Virtualized module identifier */ eNB_flag_t enb_flag; /*!< \brief Flag to indicate eNB (1) or UE (0) */ instance_t instance; /*!< \brief ITTI or OTG module identifier */ rnti_t rnti; + sdap_protocol_ctxt_t sdap; frame_t frame; /*!< \brief LTE frame number.*/ sub_frame_t subframe; /*!< \brief LTE sub frame number.*/ eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */ diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c index 62aa101a50..42b9f171ce 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c @@ -368,8 +368,8 @@ nr_pdcp_entity_t *new_nr_pdcp_entity( ret->set_security = nr_pdcp_entity_set_security; ret->set_time = nr_pdcp_entity_set_time; - ret->delete = nr_pdcp_entity_delete; - + ret->delete_entity = nr_pdcp_entity_delete; + ret->deliver_sdu = deliver_sdu; ret->deliver_sdu_data = deliver_sdu_data; diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h index fbcc2b96cd..49e9c4142b 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h @@ -39,7 +39,7 @@ typedef struct nr_pdcp_entity_t { void (*recv_pdu)(struct nr_pdcp_entity_t *entity, char *buffer, int size); void (*recv_sdu)(struct nr_pdcp_entity_t *entity, char *buffer, int size, int sdu_id); - void (*delete)(struct nr_pdcp_entity_t *entity); + void (*delete_entity)(struct nr_pdcp_entity_t *entity); /* set_security: pass -1 to integrity_algorithm / ciphering_algorithm * to keep the current algorithm diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 7d1e2f4931..3c99916169 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -36,7 +36,8 @@ #include "pdcp.h" #include "LAYER2/nr_rlc/nr_rlc_oai_api.h" #include -#include "openair2/SDAP/nr_sdap/nr_sdap_gnb.h" +#include "openair2/SDAP/nr_sdap/nr_sdap.h" +#include "nr_pdcp_oai_api.h" #define TODO do { \ printf("%s:%d:%s: todo\n", __FILE__, __LINE__, __FUNCTION__); \ @@ -438,9 +439,13 @@ static void *enb_tun_read_thread(void *_) ctxt.rnti = rnti; - pdcp_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, - RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, - PDCP_TRANSMISSION_MODE_DATA, NULL, NULL); + ctxt.sdap.qfi = 7; + ctxt.sdap.rqi = 0; + ctxt.sdap.pdusession_id = 10; + + sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, + RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, + PDCP_TRANSMISSION_MODE_DATA, NULL, NULL); } return NULL; @@ -481,9 +486,13 @@ static void *ue_tun_read_thread(void *_) ctxt.rnti = rnti; - pdcp_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, - RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, - PDCP_TRANSMISSION_MODE_DATA, NULL, NULL); + ctxt.sdap.dc = SDAP_HDR_UL_DATA_PDU; + ctxt.sdap.qfi = 7; + ctxt.sdap.pdusession_id = 10; + + sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, + RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, + PDCP_TRANSMISSION_MODE_DATA, NULL, NULL); } return NULL; @@ -607,28 +616,13 @@ uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id) static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, char *buf, int size) { - extern int nas_sock_fd[]; - int len; nr_pdcp_ue_t *ue = _ue; - MessageDef *message_p; - uint8_t *gtpu_buffer_p; int rb_id; int i; if (IS_SOFTMODEM_NOS1 || UE_NAS_USE_TUN) { - LOG_D(PDCP, "IP packet received, to be sent to TUN interface"); - - if(entity->has_sdapDLheader){ - size -= SDAP_HDR_LENGTH; - len = write(nas_sock_fd[0], &buf[SDAP_HDR_LENGTH], size); - } else { - len = write(nas_sock_fd[0], buf, size); - } - - if (len != size) { - LOG_E(PDCP, "%s:%d:%s: fatal error %d: %s\n", __FILE__, __LINE__, __FUNCTION__, errno, strerror(errno)); - } - + LOG_D(PDCP, "IP packet received with size %d, to be sent to SDAP interface, UE rnti: %d\n", size, ue->rnti); + sdap_data_ind(entity, ue->rnti, buf, size); } else{ for (i = 0; i < 5; i++) { @@ -644,31 +638,9 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, rb_found: { - int offset=0; - if (entity->has_sdap == 1 && entity->has_sdapULheader == 1) - offset = 1; // this is the offset of the SDAP header in bytes - - message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0, - GTPV1U_GNB_TUNNEL_DATA_REQ, - sizeof(gtpv1u_gnb_tunnel_data_req_t) + size - + GTPU_HEADER_OVERHEAD_MAX - offset); - AssertFatal(message_p != NULL, "OUT OF MEMORY"); - - gtpv1u_gnb_tunnel_data_req_t *req=>PV1U_GNB_TUNNEL_DATA_REQ(message_p); - gtpu_buffer_p = (uint8_t*)(req+1); - memcpy(gtpu_buffer_p+GTPU_HEADER_OVERHEAD_MAX, buf+offset, size-offset); - req->buffer = gtpu_buffer_p; - req->length = size-offset; - req->offset = GTPU_HEADER_OVERHEAD_MAX; - req->rnti = ue->rnti; - req->pdusession_id = entity->pdusession_id; - if (offset==1) { - LOG_I(PDCP, "%s() (drb %d) SDAP header %2x\n",__func__, rb_id, buf[0]); - sdap_gnb_ul_header_handler(buf[0]); // Handler for the UL gNB SDAP Header - } - LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset); - itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); - } + LOG_D(PDCP, "%s() (drb %d) sending message to SDAP size %d\n", __func__, rb_id, size); + sdap_data_ind(entity, ue->rnti, buf, size); + } } } @@ -967,6 +939,9 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s, int has_sdap = 0; int has_sdapULheader=0; int has_sdapDLheader=0; + boolean_t is_sdap_DefaultDRB = false; + NR_QFI_t *mappedQFIs2Add = NULL; + uint8_t mappedQFIs2AddCount=0; if (s->cnAssociation->present == NR_DRB_ToAddMod__cnAssociation_PR_eps_BearerIdentity) pdusession_id = s->cnAssociation->choice.eps_BearerIdentity; else { @@ -978,6 +953,10 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s, has_sdap = 1; has_sdapULheader = s->cnAssociation->choice.sdap_Config->sdap_HeaderUL == NR_SDAP_Config__sdap_HeaderUL_present ? 1 : 0; has_sdapDLheader = s->cnAssociation->choice.sdap_Config->sdap_HeaderDL == NR_SDAP_Config__sdap_HeaderDL_present ? 1 : 0; + is_sdap_DefaultDRB = s->cnAssociation->choice.sdap_Config->defaultDRB == true ? 1 : 0; + mappedQFIs2Add = (NR_QFI_t*)s->cnAssociation->choice.sdap_Config->mappedQoS_FlowsToAdd->list.array[0]; + mappedQFIs2AddCount = s->cnAssociation->choice.sdap_Config->mappedQoS_FlowsToAdd->list.count; + LOG_D(SDAP, "Captured mappedQoS_FlowsToAdd from RRC: %ld \n", *mappedQFIs2Add); } /* TODO(?): accept different UL and DL SN sizes? */ if (sn_size_ul != sn_size_dl) { @@ -1009,6 +988,14 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s, nr_pdcp_ue_add_drb_pdcp_entity(ue, drb_id, pdcp_drb); LOG_D(PDCP, "%s:%d:%s: added drb %d to ue rnti %x\n", __FILE__, __LINE__, __FUNCTION__, drb_id, rnti); + + new_nr_sdap_entity(rnti, + pdusession_id, + is_sdap_DefaultDRB, + drb_id, + mappedQFIs2Add, + mappedQFIs2AddCount); + LOG_D(SDAP, "Added SDAP entity to ue rnti %x with pdusession_id %d\n", rnti, pdusession_id); } nr_pdcp_manager_unlock(nr_pdcp_ue_manager); } @@ -1140,7 +1127,7 @@ void nr_DRB_preconfiguration(uint16_t crnti) NR_DRB_ToAddMod_t *drb_ToAddMod = calloc(1,sizeof(*drb_ToAddMod)); drb_ToAddMod->cnAssociation = calloc(1,sizeof(*drb_ToAddMod->cnAssociation)); drb_ToAddMod->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_eps_BearerIdentity; - drb_ToAddMod->cnAssociation->choice.eps_BearerIdentity= 5; + drb_ToAddMod->cnAssociation->choice.eps_BearerIdentity= 10; drb_ToAddMod->drb_Identity = 1; drb_ToAddMod->reestablishPDCP = NULL; drb_ToAddMod->recoverPDCP = NULL; @@ -1450,3 +1437,12 @@ void nr_pdcp_tick(int frame, int subframe) nr_pdcp_wakeup_timer_thread(nr_pdcp_current_time); } } + +nr_pdcp_entity_t *nr_pdcp_find_entity_sdap(int rnti, uint8_t sdap_drb_id){ + nr_pdcp_ue_t *ue; + ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti); + if(ue->drb[sdap_drb_id-1]) + return ue->drb[sdap_drb_id-1]; + + return NULL; +} diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h new file mode 100644 index 0000000000..59e366ca46 --- /dev/null +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h @@ -0,0 +1,3 @@ +#include "openair2/COMMON/platform_types.h" + +nr_pdcp_entity_t *nr_pdcp_find_entity_sdap(int rnti, uint8_t sdap_drb_id); diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.c index 160c5ebb22..1f21593c63 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.c @@ -127,11 +127,11 @@ void nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager_t *_m, int rnti) for (j = 0; j < 2; j++) if (ue->srb[j] != NULL) - ue->srb[j]->delete(ue->srb[j]); + ue->srb[j]->delete_entity(ue->srb[j]); for (j = 0; j < 5; j++) if (ue->drb[j] != NULL) - ue->drb[j]->delete(ue->drb[j]); + ue->drb[j]->delete_entity(ue->drb[j]); free(ue); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 86b767f83c..5ea118f64e 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -818,7 +818,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( uint8_t buffer[RRC_BUF_SIZE]; uint16_t size; int qos_flow_index = 0; - NR_QFI_t qfi = 0; int pdu_sessions_done = 0; int i; NR_CellGroupConfig_t *cellGroupConfig; @@ -870,14 +869,15 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( memset(sdap_config, 0, sizeof(NR_SDAP_Config_t)); sdap_config->pdu_Session = ue_context_pP->ue_context.pduSession[i].param.pdusession_id; sdap_config->sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_present; - sdap_config->sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_absent; + sdap_config->sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_present; sdap_config->defaultDRB = TRUE; sdap_config->mappedQoS_FlowsToAdd = calloc(1, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd)); memset(sdap_config->mappedQoS_FlowsToAdd, 0, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd)); for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pduSession[i].param.nb_qos; qos_flow_index++) { - qfi = ue_context_pP->ue_context.pduSession[i].param.qos[qos_flow_index].qfi; - ASN_SEQUENCE_ADD(&sdap_config->mappedQoS_FlowsToAdd->list, &qfi); + NR_QFI_t *qfi = calloc(1, sizeof(NR_QFI_t)); + *qfi = ue_context_pP->ue_context.pduSession[i].param.qos[qos_flow_index].qfi; + ASN_SEQUENCE_ADD(&sdap_config->mappedQoS_FlowsToAdd->list, qfi); } sdap_config->mappedQoS_FlowsToRelease = NULL; DRB_config->cnAssociation->choice.sdap_Config = sdap_config; diff --git a/openair2/SDAP/nr_sdap/nr_sdap.c b/openair2/SDAP/nr_sdap/nr_sdap.c new file mode 100644 index 0000000000..674dd700b1 --- /dev/null +++ b/openair2/SDAP/nr_sdap/nr_sdap.c @@ -0,0 +1,73 @@ +/* + * 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 + */ + +#include "nr_sdap.h" + +boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p, + const srb_flag_t srb_flag, + const rb_id_t rb_id, + const mui_t mui, + const confirm_t confirm, + const sdu_size_t sdu_buffer_size, + unsigned char *const sdu_buffer, + const pdcp_transmission_mode_t pt_mode, + const uint32_t *sourceL2Id, + const uint32_t *destinationL2Id) { + nr_sdap_entity_t *sdap_entity; + sdap_entity = nr_sdap_get_entity(ctxt_p->rnti, ctxt_p->sdap.pdusession_id); + + if(sdap_entity == NULL) { + LOG_E(SDAP, "%s:%d:%s: Entity not found with ue rnti: %x and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ctxt_p->rnti, ctxt_p->sdap.pdusession_id); + return 0; + } + + boolean_t ret = sdap_entity->tx_entity(sdap_entity, + ctxt_p, + srb_flag, + rb_id, + mui, + confirm, + sdu_buffer_size, + sdu_buffer, + pt_mode, + sourceL2Id, + destinationL2Id); + return ret; +} + +void sdap_data_ind(nr_pdcp_entity_t *pdcp_entity, + int rnti, + char *buf, + int size) { + nr_sdap_entity_t *sdap_entity; + sdap_entity = nr_sdap_get_entity(rnti, pdcp_entity->pdusession_id); + + if(sdap_entity == NULL) { + LOG_E(SDAP, "%s:%d:%s: Entity not found\n", __FILE__, __LINE__, __FUNCTION__); + return; + } + + sdap_entity->rx_entity(sdap_entity, + pdcp_entity, + rnti, + buf, + size); +} diff --git a/openair2/SDAP/nr_sdap/nr_sdap.h b/openair2/SDAP/nr_sdap/nr_sdap.h new file mode 100644 index 0000000000..e4e8004e2d --- /dev/null +++ b/openair2/SDAP/nr_sdap/nr_sdap.h @@ -0,0 +1,59 @@ +/* + * 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 + */ + +#ifndef _NR_SDAP_GNB_H_ +#define _NR_SDAP_GNB_H_ + +#include "openair2/COMMON/platform_types.h" +#include "common/utils/LOG/log.h" +#include "nr_sdap_entity.h" + +/* + * TS 37.324 4.4 Functions + * Transfer of user plane data + * Downlink - gNB + * Uplink - nrUE + */ +boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p, + const srb_flag_t srb_flag, + const rb_id_t rb_id, + const mui_t mui, + const confirm_t confirm, + const sdu_size_t sdu_buffer_size, + unsigned char *const sdu_buffer, + const pdcp_transmission_mode_t pt_mode, + const uint32_t *sourceL2Id, + const uint32_t *destinationL2Id + ); + +/* + * TS 37.324 4.4 Functions + * Transfer of user plane data + * Uplink - gNB + * Downlink - nrUE + */ +void sdap_data_ind(nr_pdcp_entity_t *pdcp_entity, + int rnti, + char *buf, + int size + ); + +#endif diff --git a/openair2/SDAP/nr_sdap/nr_sdap_entity.c b/openair2/SDAP/nr_sdap/nr_sdap_entity.c new file mode 100644 index 0000000000..028653372f --- /dev/null +++ b/openair2/SDAP/nr_sdap/nr_sdap_entity.c @@ -0,0 +1,474 @@ +/* + * 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 + */ + +#include "nr_sdap_entity.h" +#include "common/utils/LOG/log.h" +#include +#include +#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h" + +#include +#include +#include + +typedef struct { + nr_sdap_entity_t *sdap_entity_llist; +} nr_sdap_entity_info; + +static nr_sdap_entity_info sdap_info; + +static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity, + protocol_ctxt_t *ctxt_p, + const srb_flag_t srb_flag, + const rb_id_t rb_id, + const mui_t mui, + const confirm_t confirm, + const sdu_size_t sdu_buffer_size, + unsigned char *const sdu_buffer, + const pdcp_transmission_mode_t pt_mode, + const uint32_t *sourceL2Id, + const uint32_t *destinationL2Id + ) { + /* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */ + int offset=0; + boolean_t ret=false; + /*Hardcode DRB ID given from upper layer (ue/enb_tun_read_thread rb_id), it will change if we have SDAP*/ + rb_id_t sdap_drb_id = rb_id; + int pdcp_ent_has_sdap = 0; + + if(sdu_buffer == NULL) { + LOG_E(SDAP, "%s:%d:%s: NULL sdu_buffer \n", __FILE__, __LINE__, __FUNCTION__); + exit(1); + } + + uint8_t sdap_buf[SDAP_MAX_PDU]; + nr_pdcp_entity_t *pdcp_entity = entity->qfi2drb_map(entity, ctxt_p->sdap.qfi, rb_id); + + if(pdcp_entity){ + sdap_drb_id = pdcp_entity->rb_id; + pdcp_ent_has_sdap = pdcp_entity->has_sdap; + } + + if(!pdcp_ent_has_sdap){ + ret = pdcp_data_req(ctxt_p, + srb_flag, + sdap_drb_id, + mui, + confirm, + sdu_buffer_size, + sdu_buffer, + pt_mode, + sourceL2Id, + destinationL2Id); + + if(!ret) + LOG_E(SDAP, "%s:%d:%s: PDCP refused PDU\n", __FILE__, __LINE__, __FUNCTION__); + + return ret; + } + + if(sdu_buffer_size == 0 || sdu_buffer_size > 8999) { + LOG_E(SDAP, "%s:%d:%s: NULL or 0 or exceeded sdu_buffer_size (over max PDCP SDU)\n", __FILE__, __LINE__, __FUNCTION__); + return 0; + } + + if(ctxt_p->enb_flag) { // gNB + offset = SDAP_HDR_LENGTH; + /* + * TS 37.324 4.4 Functions + * marking QoS flow ID in DL packets. + * + * Construct the DL SDAP data PDU. + */ + nr_sdap_dl_hdr_t sdap_hdr; + sdap_hdr.QFI = ctxt_p->sdap.qfi; + sdap_hdr.RQI = ctxt_p->sdap.rqi; + sdap_hdr.RDI = 0; // SDAP Hardcoded Value + /* Add the SDAP DL Header to the buffer */ + memcpy(&sdap_buf[0], &sdap_hdr, SDAP_HDR_LENGTH); + memcpy(&sdap_buf[SDAP_HDR_LENGTH], sdu_buffer, sdu_buffer_size); + LOG_D(SDAP, "TX Entity QFI: %u \n", sdap_hdr.QFI); + LOG_D(SDAP, "TX Entity RQI: %u \n", sdap_hdr.RQI); + LOG_D(SDAP, "TX Entity RDI: %u \n", sdap_hdr.RDI); + } else { // nrUE + offset = SDAP_HDR_LENGTH; + /* + * TS 37.324 4.4 Functions + * marking QoS flow ID in UL packets. + * + * 5.2.1 Uplink + * construct the UL SDAP data PDU as specified in the subclause 6.2.2.3. + */ + nr_sdap_ul_hdr_t sdap_hdr; + sdap_hdr.QFI = ctxt_p->sdap.qfi; + sdap_hdr.R = 0; + sdap_hdr.DC = ctxt_p->sdap.dc; + /* Add the SDAP UL Header to the buffer */ + memcpy(&sdap_buf[0], &sdap_hdr, SDAP_HDR_LENGTH); + memcpy(&sdap_buf[SDAP_HDR_LENGTH], sdu_buffer, sdu_buffer_size); + LOG_D(SDAP, "TX Entity QFI: %u \n", sdap_hdr.QFI); + LOG_D(SDAP, "TX Entity R: %u \n", sdap_hdr.R); + LOG_D(SDAP, "TX Entity DC: %u \n", sdap_hdr.DC); + } + + /* + * TS 37.324 5.2 Data transfer + * 5.2.1 Uplink UE side + * submit the constructed UL SDAP data PDU to the lower layers + * + * Downlink gNB side + */ + ret = pdcp_data_req(ctxt_p, + srb_flag, + sdap_drb_id, + mui, + confirm, + sdu_buffer_size+offset, + sdap_buf, + pt_mode, + sourceL2Id, + destinationL2Id); + + if(!ret) + LOG_E(SDAP, "%s:%d:%s: PDCP refused PDU\n", __FILE__, __LINE__, __FUNCTION__); + + return ret; +} + +static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, + nr_pdcp_entity_t *pdcp_entity, + int rnti, + char *buf, + int size) { + /* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */ + int offset=0; + + if(pdcp_entity->is_gnb) { // gNB + if(pdcp_entity->has_sdap && pdcp_entity->has_sdapULheader ) { // Handling the SDAP Header + offset = SDAP_HDR_LENGTH; + nr_sdap_ul_hdr_t *sdap_hdr = (nr_sdap_ul_hdr_t *)buf; + LOG_D(SDAP, "RX Entity Received QFI : %u\n", sdap_hdr->QFI); + LOG_D(SDAP, "RX Entity Received Reserved bit : %u\n", sdap_hdr->R); + LOG_D(SDAP, "RX Entity Received DC bit : %u\n", sdap_hdr->DC); + + switch (sdap_hdr->DC) { + case SDAP_HDR_UL_DATA_PDU: + LOG_D(SDAP, "RX Entity Received SDAP Data PDU\n"); + break; + + case SDAP_HDR_UL_CTRL_PDU: + LOG_D(SDAP, "RX Entity Received SDAP Control PDU\n"); + break; + } + } + + // Pushing SDAP SDU to GTP-U Layer + MessageDef *message_p; + uint8_t *gtpu_buffer_p; + gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U, size + GTPU_HEADER_OVERHEAD_MAX - offset); + AssertFatal(gtpu_buffer_p != NULL, "OUT OF MEMORY"); + memcpy(>pu_buffer_p[GTPU_HEADER_OVERHEAD_MAX], buf+offset, size-offset); + message_p = itti_alloc_new_message(TASK_PDCP_ENB, 0 , GTPV1U_GNB_TUNNEL_DATA_REQ); + AssertFatal(message_p != NULL, "OUT OF MEMORY"); + GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).buffer = gtpu_buffer_p; + GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).length = size-offset; + GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX; + GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).rnti = rnti; + GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).pdusession_id = pdcp_entity->pdusession_id; + LOG_D(SDAP, "%s() sending message to gtp size %d\n", __func__, size-offset); + itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p); + } else { //nrUE + /* + * TS 37.324 5.2 Data transfer + * 5.2.2 Downlink + * if the DRB from which this SDAP data PDU is received is configured by RRC with the presence of SDAP header. + */ + if(pdcp_entity->has_sdap && pdcp_entity->has_sdapDLheader) { // Handling the SDAP Header + offset = SDAP_HDR_LENGTH; + /* + * TS 37.324 5.2 Data transfer + * 5.2.2 Downlink + * retrieve the SDAP SDU from the DL SDAP data PDU as specified in the subclause 6.2.2.2. + */ + nr_sdap_dl_hdr_t *sdap_hdr = (nr_sdap_dl_hdr_t *)buf; + LOG_D(SDAP, "RX Entity Received QFI : %u\n", sdap_hdr->QFI); + LOG_D(SDAP, "RX Entity Received RQI : %u\n", sdap_hdr->RQI); + LOG_D(SDAP, "RX Entity Received RDI : %u\n", sdap_hdr->RDI); + + /* + * TS 37.324 5.2 Data transfer + * 5.2.2 Downlink + * Perform reflective QoS flow to DRB mapping as specified in the subclause 5.3.2. + */ + if(sdap_hdr->RDI == SDAP_REFLECTIVE_MAPPING) { + /* + * TS 37.324 5.3 QoS flow to DRB Mapping + * 5.3.2 Reflective mapping + * If there is no stored QoS flow to DRB mapping rule for the QoS flow and a default DRB is configured. + */ + if(!entity->qfi2drb_table[sdap_hdr->QFI] && entity->default_drb->rb_id){ + nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI); + nr_pdcp_entity_t *sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, sdap_hdr->QFI); + entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); + } + + /* + * TS 37.324 5.3 QoS flow to DRB mapping + * 5.3.2 Reflective mapping + * if the stored QoS flow to DRB mapping rule for the QoS flow + * is different from the QoS flow to DRB mapping of the DL SDAP data PDU + * and + * the DRB according to the stored QoS flow to DRB mapping rule is configured by RRC + * with the presence of UL SDAP header + */ + if( (pdcp_entity->rb_id != entity->qfi2drb_table[sdap_hdr->QFI]->rb_id) && + pdcp_entity->has_sdapULheader ){ + nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI); + nr_pdcp_entity_t *sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, sdap_hdr->QFI); + entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); + } + + /* + * TS 37.324 5.3 QoS flow to DRB Mapping + * 5.3.2 Reflective mapping + * store the QoS flow to DRB mapping of the DL SDAP data PDU as the QoS flow to DRB mapping rule for the UL. + */ + entity->qfi2drb_table[sdap_hdr->QFI]->rb_id = pdcp_entity->rb_id; + } + + /* + * TS 37.324 5.2 Data transfer + * 5.2.2 Downlink + * perform RQI handling as specified in the subclause 5.4 + */ + if(sdap_hdr->RQI == SDAP_RQI_HANDLING) { + LOG_W(SDAP, "UE - TODD 5.4\n"); + } + } /* else - retrieve the SDAP SDU from the DL SDAP data PDU as specified in the subclause 6.2.2.1 */ + + /* + * TS 37.324 5.2 Data transfer + * 5.2.2 Downlink + * deliver the retrieved SDAP SDU to the upper layer. + */ + extern int nas_sock_fd[]; + int len = write(nas_sock_fd[0], &buf[offset], size-offset); + LOG_D(SDAP, "RX Entity len : %d\n", len); + LOG_D(SDAP, "RX Entity size : %d\n", size); + LOG_D(SDAP, "RX Entity offset : %d\n", offset); + + if (len != size-offset) + LOG_E(SDAP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__); + } +} + +void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, uint8_t drb){ + if(qfi < SDAP_MAX_QFI && + qfi > SDAP_MAP_RULE_EMPTY && + drb > 0 && + drb <= AVLBL_DRB) + { + nr_pdcp_entity_t *pdcp_entity; + pdcp_entity = nr_pdcp_find_entity_sdap(entity->rnti, drb); + + if(!pdcp_entity){ + LOG_D(SDAP, "Map Update failed - PDCP Entity does not exist, should create it\n"); + LOG_D(SDAP, "Map Update failed - Mapping to default DRB\n"); + entity->qfi2drb_table[qfi] = entity->default_drb; + } + + entity->qfi2drb_table[qfi] = pdcp_entity; + LOG_D(SDAP, "Updated QFI to DRB Map: QFI %u -> DRB %d \n", qfi, entity->qfi2drb_table[qfi]->rb_id); + } +} + +void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi){ + entity->qfi2drb_table[qfi] = SDAP_NO_MAPPING_RULE; + LOG_D(SDAP, "Deleted QFI to DRB Map for QFI %u \n", qfi); +} + +nr_pdcp_entity_t *nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, long upper_layer_rb_id){ + nr_pdcp_entity_t *pdcp_entity; + + pdcp_entity = entity->qfi2drb_table[qfi]; + + if(pdcp_entity){ + return pdcp_entity; + } else if(entity->default_drb) { + LOG_D(SDAP, "Mapped QFI %u to Default DRB\n", qfi); + entity->qfi2drb_map_update(entity, qfi, entity->default_drb->rb_id); + return entity->default_drb; + } else { + /* Update map for Hardcode DRB ID given from upper layer (ue/enb_tun_read_thread rb_id)*/ + entity->qfi2drb_map_update(entity, qfi, upper_layer_rb_id); + return SDAP_MAP_RULE_EMPTY; + } + + return pdcp_entity; +} + +nr_sdap_ul_hdr_t nr_sdap_construct_ctrl_pdu(uint8_t qfi){ + nr_sdap_ul_hdr_t sdap_end_marker_hdr; + sdap_end_marker_hdr.QFI = qfi; + sdap_end_marker_hdr.R = 0; + sdap_end_marker_hdr.DC = SDAP_HDR_UL_CTRL_PDU; + LOG_D(SDAP, "Constructed Control PDU with QFI:%u R:%u DC:%u \n", sdap_end_marker_hdr.QFI, + sdap_end_marker_hdr.R, + sdap_end_marker_hdr.DC); + return sdap_end_marker_hdr; +} + +nr_pdcp_entity_t *nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi){ + nr_pdcp_entity_t *drb_of_endmarker = NULL; + if(map_type == SDAP_CTRL_PDU_MAP_DEF_DRB){ + drb_of_endmarker = entity->default_drb; + LOG_D(SDAP, "Mapped Control PDU to default drb\n"); + } + if(map_type == SDAP_CTRL_PDU_MAP_RULE_DRB){ + drb_of_endmarker = entity->qfi2drb_map(entity, dl_qfi, pdcp_entity->rb_id); + LOG_D(SDAP, "Mapped Control PDU according to the mapping rule, qfi %u \n", dl_qfi); + } + return drb_of_endmarker; +} + +void nr_sdap_submit_ctrl_pdu(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){ + if(sdap_ctrl_pdu_drb){ + sdap_ctrl_pdu_drb->recv_sdu(sdap_ctrl_pdu_drb, (char*)&ctrl_pdu, SDAP_HDR_LENGTH, RLC_MUI_UNDEFINED); + LOG_D(SDAP, "Sent Control PDU to PDCP Layer.\n"); + } +} + +void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity, + nr_pdcp_entity_t *pdcp_entity, + uint16_t rnti, + NR_QFI_t *mapped_qfi_2_add, + uint8_t mappedQFIs2AddCount, + uint8_t drb_identity) +{ + uint8_t qfi = 0; + + for(int i = 0; i < mappedQFIs2AddCount; i++){ + qfi = mapped_qfi_2_add[i]; + if(existing_sdap_entity->default_drb && existing_sdap_entity->qfi2drb_table[qfi] == SDAP_NO_MAPPING_RULE){ + nr_sdap_ul_hdr_t sdap_ctrl_pdu = existing_sdap_entity->sdap_construct_ctrl_pdu(qfi); + nr_pdcp_entity_t *sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, qfi); + existing_sdap_entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); + } + if(existing_sdap_entity->qfi2drb_table[qfi]->rb_id != drb_identity && pdcp_entity->has_sdapULheader){ + nr_sdap_ul_hdr_t sdap_ctrl_pdu = existing_sdap_entity->sdap_construct_ctrl_pdu(qfi); + nr_pdcp_entity_t *sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, qfi); + existing_sdap_entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); + } + } +} + +nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti, + int pdusession_id, + boolean_t is_defaultDRB, + uint8_t drb_identity, + NR_QFI_t *mapped_qfi_2_add, + uint8_t mappedQFIs2AddCount) +{ + if(nr_sdap_get_entity(rnti, pdusession_id)) { + LOG_E(SDAP, "SDAP Entity for UE already exists.\n"); + nr_sdap_entity_t *existing_sdap_entity = nr_sdap_get_entity(rnti, pdusession_id); + nr_pdcp_entity_t *pdcp_entity = existing_sdap_entity->default_drb; + nr_sdap_ue_qfi2drb_config(existing_sdap_entity, pdcp_entity, rnti, mapped_qfi_2_add, mappedQFIs2AddCount, drb_identity); + return existing_sdap_entity; + } + + nr_sdap_entity_t *sdap_entity; + sdap_entity = calloc(1, sizeof(nr_sdap_entity_t)); + + if(sdap_entity == NULL) { + LOG_E(SDAP, "SDAP Entity creation failed, out of memory\n"); + exit(1); + } + + sdap_entity->rnti = rnti; + sdap_entity->pdusession_id = pdusession_id; + + sdap_entity->tx_entity = nr_sdap_tx_entity; + sdap_entity->rx_entity = nr_sdap_rx_entity; + + sdap_entity->sdap_construct_ctrl_pdu = nr_sdap_construct_ctrl_pdu; + sdap_entity->sdap_map_ctrl_pdu = nr_sdap_map_ctrl_pdu; + sdap_entity->sdap_submit_ctrl_pdu = nr_sdap_submit_ctrl_pdu; + + sdap_entity->qfi2drb_map_update = nr_sdap_qfi2drb_map_update; + sdap_entity->qfi2drb_map_delete = nr_sdap_qfi2drb_map_del; + sdap_entity->qfi2drb_map = nr_sdap_qfi2drb_map; + + if(is_defaultDRB) { + nr_pdcp_entity_t *pdcp_entity = nr_pdcp_find_entity_sdap(sdap_entity->rnti, drb_identity); + sdap_entity->default_drb = pdcp_entity; + LOG_I(SDAP, "Default DRB for the created SDAP entity: %d \n", sdap_entity->default_drb->rb_id); + + if(mappedQFIs2AddCount) { + for (int i = 0; i < mappedQFIs2AddCount; i++) + { + LOG_D(SDAP, "Mapped QFI to Add : %ld \n", mapped_qfi_2_add[i]); + sdap_entity->qfi2drb_map_update(sdap_entity, mapped_qfi_2_add[i], sdap_entity->default_drb->rb_id); + } + } + } + + sdap_entity->next_entity = sdap_info.sdap_entity_llist; + sdap_info.sdap_entity_llist = sdap_entity; + return sdap_entity; +} + +nr_sdap_entity_t *nr_sdap_get_entity(uint16_t rnti, int pdusession_id) { + nr_sdap_entity_t *sdap_entity; + sdap_entity = sdap_info.sdap_entity_llist; + + if(sdap_entity == NULL) + return NULL; + + while(sdap_entity->rnti != rnti && sdap_entity->next_entity != NULL) { + sdap_entity = sdap_entity->next_entity; + } + + if (sdap_entity->rnti == rnti && sdap_entity->pdusession_id == pdusession_id) + return sdap_entity; + + return NULL; +} + +void delete_nr_sdap_entity(uint16_t rnti) { + nr_sdap_entity_t *entityPtr, *entityPrev = NULL; + entityPtr = sdap_info.sdap_entity_llist; + + if(entityPtr->rnti == rnti) { + sdap_info.sdap_entity_llist = sdap_info.sdap_entity_llist->next_entity; + free(entityPtr); + } else { + while(entityPtr->rnti != rnti && entityPtr->next_entity != NULL) { + entityPrev = entityPtr; + entityPtr = entityPtr->next_entity; + } + + if(entityPtr->rnti != rnti) { + entityPrev->next_entity = entityPtr->next_entity; + free(entityPtr); + } + } +} diff --git a/openair2/SDAP/nr_sdap/nr_sdap_entity.h b/openair2/SDAP/nr_sdap/nr_sdap_entity.h new file mode 100644 index 0000000000..46c9ea3774 --- /dev/null +++ b/openair2/SDAP/nr_sdap/nr_sdap_entity.h @@ -0,0 +1,167 @@ +/* + * 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 + */ + +#ifndef _NR_SDAP_ENTITY_H_ +#define _NR_SDAP_ENTITY_H_ + +#include +#include "openair2/COMMON/platform_types.h" +#include "openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h" +#include "NR_RadioBearerConfig.h" + +#define SDAP_BITMASK_DC (0x80) +#define SDAP_BITMASK_R (0x40) +#define SDAP_BITMASK_QFI (0x3F) +#define SDAP_BITMASK_RQI (0x40) +#define SDAP_HDR_UL_DATA_PDU (1) +#define SDAP_HDR_UL_CTRL_PDU (0) +#define SDAP_HDR_LENGTH (1) +#define SDAP_MAX_QFI (64) +#define SDAP_MAP_RULE_EMPTY (0) +#define AVLBL_DRB (5) +#define SDAP_NO_MAPPING_RULE (0) +#define SDAP_REFLECTIVE_MAPPING (1) +#define SDAP_RQI_HANDLING (1) +#define SDAP_CTRL_PDU_MAP_DEF_DRB (0) +#define SDAP_CTRL_PDU_MAP_RULE_DRB (1) +#define SDAP_MAX_PDU (9000) + +/* + * The values of QoS Flow ID (QFI) and Reflective QoS Indication, + * are located in the PDU Session Container, which is conveyed by + * the GTP-U Extension Header. Inside the DL PDU SESSION INFORMATION frame. + * TS 38.415 Fig. 5.5.2.1-1 + */ +typedef struct nr_sdap_dl_hdr_s { + uint8_t QFI:6; + uint8_t RQI:1; + uint8_t RDI:1; +} __attribute__((packed)) nr_sdap_dl_hdr_t; + +typedef struct nr_sdap_ul_hdr_s { + uint8_t QFI:6; + uint8_t R:1; + uint8_t DC:1; +} __attribute__((packed)) nr_sdap_ul_hdr_t; + +typedef struct nr_sdap_entity_s { + uint16_t rnti; + nr_pdcp_entity_t *default_drb; + int pdusession_id; + nr_pdcp_entity_t *qfi2drb_table[SDAP_MAX_QFI]; + + void (*qfi2drb_map_update)(struct nr_sdap_entity_s *entity, uint8_t qfi, uint8_t drb); + void (*qfi2drb_map_delete)(struct nr_sdap_entity_s *entity, uint8_t qfi); + nr_pdcp_entity_t *(*qfi2drb_map)(struct nr_sdap_entity_s *entity, uint8_t qfi, long upper_layer_rb_id); + + nr_sdap_ul_hdr_t (*sdap_construct_ctrl_pdu)(uint8_t qfi); + nr_pdcp_entity_t *(*sdap_map_ctrl_pdu)(struct nr_sdap_entity_s *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi); + void (*sdap_submit_ctrl_pdu)(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu); + + + boolean_t (*tx_entity)(struct nr_sdap_entity_s *entity, + protocol_ctxt_t *ctxt_p, + const srb_flag_t srb_flag, + const rb_id_t rb_id, + const mui_t mui, + const confirm_t confirm, + const sdu_size_t sdu_buffer_size, + unsigned char *const sdu_buffer, + const pdcp_transmission_mode_t pt_mode, + const uint32_t *sourceL2Id, + const uint32_t *destinationL2Id); + + void (*rx_entity)(struct nr_sdap_entity_s *entity, + nr_pdcp_entity_t *pdcp_entity, + int rnti, + char *buf, + int size); + + /* List of entities */ + struct nr_sdap_entity_s *next_entity; +} nr_sdap_entity_t; + +/* QFI to DRB Mapping Related Function */ +void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, uint8_t drb); + +/* QFI to DRB Mapping Related Function */ +void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi); + +/* + * TS 37.324 + * 4.4 Functions + * Mapping between a QoS flow and a DRB for both DL and UL. + * + * 5.2.1 Uplink + * If there is no stored QoS flow to DRB mapping rule for the QoS flow as specified in the subclause 5.3, map the SDAP SDU to the default DRB + * else, map the SDAP SDU to the DRB according to the stored QoS flow to DRB mapping rule. + */ +nr_pdcp_entity_t *nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, long upper_layer_rb_id); + +/* + * TS 37.324 5.3 QoS flow to DRB Mapping + * construct an end-marker control PDU, as specified in the subclause 6.2.3, for the QoS flow; + */ +nr_sdap_ul_hdr_t nr_sdap_construct_ctrl_pdu(uint8_t qfi); + +/* + * TS 37.324 5.3 QoS flow to DRB Mapping + * map the end-marker control PDU to the + * 1.) default DRB or + * 2.) DRB according to the stored QoS flow to DRB mapping rule + */ +nr_pdcp_entity_t *nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi); + +/* + * TS 37.324 5.3 QoS flow to DRB Mapping + * Submit the end-marker control PDU to the lower layer. + */ +void nr_sdap_submit_ctrl_pdu(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu); + +/* + * TS 37.324 5.3 QoS flow to DRB Mapping + * 5.3.1 Configuration Procedures + */ +void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity, + nr_pdcp_entity_t *pdcp_entity, + uint16_t rnti, + NR_QFI_t *mapped_qfi_2_add, + uint8_t mappedQFIs2AddCount, + uint8_t drb_identity); + +/* + * TS 37.324 4.4 5.1.1 SDAP entity establishment + * Establish an SDAP entity. + */ +nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti, + int pdusession_id, + boolean_t is_defaultDRB, + uint8_t default_DRB, + NR_QFI_t *mapped_qfi_2_add, + uint8_t mappedQFIs2AddCount); + +/* Entity Handling Related Functions */ +nr_sdap_entity_t *nr_sdap_get_entity(uint16_t rnti, int pdusession_id); + +/* Entity Handling Related Functions */ +void delete_nr_sdap_entity(uint16_t rnti); + +#endif diff --git a/openair2/SDAP/nr_sdap/nr_sdap_gnb.c b/openair2/SDAP/nr_sdap/nr_sdap_gnb.c deleted file mode 100644 index 5f0a2640e9..0000000000 --- a/openair2/SDAP/nr_sdap/nr_sdap_gnb.c +++ /dev/null @@ -1,87 +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 - */ - -#include "nr_sdap_gnb.h" -#include - -boolean_t sdap_gnb_data_req(protocol_ctxt_t *ctxt_p, - const srb_flag_t srb_flag, - const rb_id_t rb_id, - const mui_t mui, - const confirm_t confirm, - const sdu_size_t sdu_buffer_size, - unsigned char *const sdu_buffer, - const pdcp_transmission_mode_t pt_mode, - const uint32_t *sourceL2Id, - const uint32_t *destinationL2Id - ) { - if(sdu_buffer == NULL) { - LOG_E(PDCP, "%s:%d:%s: SDAP Layer gNB - NULL sdu_buffer \n", __FILE__, __LINE__, __FUNCTION__); - exit(1); - } - - if(sdu_buffer_size == 0) { - LOG_E(PDCP, "%s:%d:%s: SDAP Layer gNB - NULL or 0 sdu_buffer_size \n", __FILE__, __LINE__, __FUNCTION__); - exit(1); - } - - uint8_t *sdap_buf = (uint8_t *)malloc(sdu_buffer_size+SDAP_HDR_LENGTH); - nr_sdap_dl_hdr_t sdap_hdr; - sdap_hdr.RDI = 0; // SDAP_Hardcoded - - sdap_hdr.RQI = 0; // SDAP_Hardcoded - Should get this info from DL_PDU_SESSION_INFORMATION - sdap_hdr.QFI = 1; // SDAP_Hardcoded - Should get this info from DL_PDU_SESSION_INFORMATION - memcpy(&sdap_buf[0], &sdap_hdr, 1); - memcpy(&sdap_buf[1], sdu_buffer, sdu_buffer_size); - rb_id_t sdap_drb_id = rb_id; // SDAP_Hardcoded - Should get this info from QFI to DRB mapping table - boolean_t ret = pdcp_data_req(ctxt_p, - srb_flag, - sdap_drb_id, - mui, - confirm, - sdu_buffer_size+1, - sdap_buf, - pt_mode, - sourceL2Id, - destinationL2Id); - - if(!ret) { - LOG_E(PDCP, "%s:%d:%s: SDAP Layer gNB - PDCP DL refused PDU\n", __FILE__, __LINE__, __FUNCTION__); - free(sdap_buf); - return 0; - } - - free(sdap_buf); - return 1; -} - -void sdap_gnb_ul_header_handler(char sdap_gnb_ul_hdr) { - nr_sdap_ul_hdr_t *sdap_hdr_ul = (nr_sdap_ul_hdr_t *)&sdap_gnb_ul_hdr; - - switch (sdap_hdr_ul->DC) { - case SDAP_HDR_UL_DATA_PDU: - LOG_I(PDCP, "%s:%d:%s: SDAP Layer gNB - UL Received SDAP Data PDU\n", __FILE__, __LINE__, __FUNCTION__); - break; - - case SDAP_HDR_UL_CTRL_PDU: - LOG_I(PDCP, "%s:%d:%s: SDAP Layer gNB - Received SDAP Control PDU\n", __FILE__, __LINE__, __FUNCTION__); - break; - } -} \ No newline at end of file diff --git a/openair2/SDAP/nr_sdap/nr_sdap_gnb.h b/openair2/SDAP/nr_sdap/nr_sdap_gnb.h deleted file mode 100644 index 243aa89010..0000000000 --- a/openair2/SDAP/nr_sdap/nr_sdap_gnb.h +++ /dev/null @@ -1,61 +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 - */ - -#ifndef _NR_SDAP_GNB_ -#define _NR_SDAP_GNB_ - -#include "openair2/COMMON/platform_types.h" -#include "common/utils/LOG/log.h" - -#define SDAP_BITMASK_DC (0x80) -#define SDAP_BITMASK_R (0x40) -#define SDAP_BITMASK_QFI (0x3F) -#define SDAP_HDR_UL_DATA_PDU (1) -#define SDAP_HDR_UL_CTRL_PDU (0) -#define SDAP_HDR_LENGTH (1) - -typedef struct nr_sdap_dl_hdr_s { - uint8_t QFI:6; - uint8_t RQI:1; - uint8_t RDI:1; -} __attribute__((packed)) nr_sdap_dl_hdr_t; - -typedef struct nr_sdap_ul_hdr_s { - uint8_t QFI:6; - uint8_t R:1; - uint8_t DC:1; -} __attribute__((packed)) nr_sdap_ul_hdr_t; - -boolean_t sdap_gnb_data_req(protocol_ctxt_t *ctxt_p, - const srb_flag_t srb_flag, - const rb_id_t rb_id, - const mui_t mui, - const confirm_t confirm, - const sdu_size_t sdu_buffer_size, - unsigned char *const sdu_buffer, - const pdcp_transmission_mode_t pt_mode, - const uint32_t *sourceL2Id, - const uint32_t *destinationL2Id - ); - -void sdap_gnb_ul_header_handler(char sdap_gnb_ul_hdr); - -#endif \ No newline at end of file diff --git a/openair2/SDAP/nr_sdap/sdap_gNB.c b/openair2/SDAP/nr_sdap/sdap_gNB.c deleted file mode 100644 index ad84e4c273..0000000000 --- a/openair2/SDAP/nr_sdap/sdap_gNB.c +++ /dev/null @@ -1,30 +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 sdap_gNB.c - * \brief sdap tasks for gNB - * \author Konstantinos Alexandris , Cedric Roux , Navid Nikaein - * \date 2018 - * \version 1.0 - */ -#define SDAP_GNB -#define SDAP_GNB_C - diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index cc41de3550..3c6c63c6a4 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -17,7 +17,7 @@ extern "C" { #include #include #include -#include "openair2/SDAP/nr_sdap/nr_sdap_gnb.h" +#include "openair2/SDAP/nr_sdap/nr_sdap.h" //#include #pragma pack(1) @@ -34,8 +34,35 @@ typedef struct Gtpv1uMsgHeader { teid_t teid; } __attribute__((packed)) Gtpv1uMsgHeaderT; +typedef struct Gtpv1uMsgHeaderOptFields { + uint8_t seqNum1Oct; + uint8_t seqNum2Oct; + uint8_t NPDUNum; + uint8_t NextExtHeaderType; +} __attribute__((packed)) Gtpv1uMsgHeaderOptFieldsT; + +typedef struct PDUSessionContainer { + uint8_t spare:4; + uint8_t PDU_type:4; + uint8_t QFI:6; + uint8_t RQI:1; + uint8_t PPP:1; +} __attribute__((packed)) PDUSessionContainerT; + +typedef struct Gtpv1uExtHeader { + uint8_t ExtHeaderLen; + PDUSessionContainerT pdusession_cntr; + //uint8_t NextExtHeaderType; +}__attribute__((packed)) Gtpv1uExtHeaderT; + #pragma pack() +// TS 29.281, fig 5.2.1-3 +#define PDU_SESSION_CONTAINER (0x85) +// TS 29.281, 5.2.1 +#define EXT_HDR_LNTH_OCTET_UNITS (4) +#define NO_MORE_EXT_HDRS (0) + // TS 29.060, table 7.1 defines the possible message types // here are all the possible messages (3GPP R16) #define GTP_ECHO_REQ (1) @@ -65,6 +92,7 @@ typedef struct { rnti_t rnti; ebi_t incoming_rb_id; gtpCallback callBack; + int pdusession_id; } rntiData_t; class gtpEndPoint { @@ -449,6 +477,8 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer inst->te2ue_mapping[incoming_teid].callBack=callBack; + inst->te2ue_mapping[incoming_teid].pdusession_id = (uint8_t)outgoing_bearer_id; + gtpv1u_bearer_t *tmp=&inst->ue2te_mapping[rnti].bearers[outgoing_bearer_id]; int addrs_length_in_bytes = remoteAddr.length / 8; @@ -574,7 +604,7 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance, create_tunnel_req->pdusession_id[i], create_tunnel_req->outgoing_teid[i], create_tunnel_req->dst_addr[i], dstport, - sdap_gnb_data_req); + sdap_data_req); create_tunnel_resp->status=0; create_tunnel_resp->rnti=create_tunnel_req->rnti; create_tunnel_resp->num_tunnels=create_tunnel_req->num_tunnels; @@ -815,10 +845,28 @@ static int Gtpv1uHandleGpdu(int h, return GTPNOK; } - int offset=8; + int offset=sizeof(Gtpv1uMsgHeaderT); - if( msgHdr->E || msgHdr->S ||msgHdr->PN) - offset+=8; + uint8_t qfi = 0; + boolean_t rqi = FALSE; + + if( msgHdr->E || msgHdr->S || msgHdr->PN){ + Gtpv1uMsgHeaderOptFieldsT *msgHdrOpt = (Gtpv1uMsgHeaderOptFieldsT *)(msgBuf+offset); + offset+=sizeof(Gtpv1uMsgHeaderOptFieldsT); + if( msgHdr->E && msgHdrOpt->NextExtHeaderType == PDU_SESSION_CONTAINER){ + Gtpv1uExtHeaderT *msgHdrExt = (Gtpv1uExtHeaderT *)(msgBuf+offset); + offset+=msgHdrExt->ExtHeaderLen*EXT_HDR_LNTH_OCTET_UNITS; + qfi = msgHdrExt->pdusession_cntr.QFI; + rqi = msgHdrExt->pdusession_cntr.RQI; + + /* + * Check if the next extension header type of GTP extension header is set to 0 + * We can not put it in the struct Gtpv1uExtHeaderT because the length is dynamic. + */ + if(*(msgBuf+offset-1) != NO_MORE_EXT_HDRS) + LOG_W(GTPU, "Warning - Next extension header is not zero, handle it \n"); + } + } // This context is not good for gtp // frame, ... has no meaning @@ -828,6 +876,9 @@ static int Gtpv1uHandleGpdu(int h, ctxt.enb_flag = 1; ctxt.instance = inst->addr.originInstance; ctxt.rnti = tunnel->second.rnti; + ctxt.sdap.qfi = qfi; + ctxt.sdap.rqi = rqi; + ctxt.sdap.pdusession_id = tunnel->second.pdusession_id; ctxt.frame = 0; ctxt.subframe = 0; ctxt.eNB_index = 0; From 30f14c7e55e08428c4bd749eeb904418505cd629 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 17 Jan 2022 11:42:52 +0100 Subject: [PATCH 766/883] Rename dummy eNB function to make GTP compile in 4G (no SDAP) --- openair2/F1AP/dummy_enb.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/openair2/F1AP/dummy_enb.c b/openair2/F1AP/dummy_enb.c index d54f9b8df7..5d1c22824d 100644 --- a/openair2/F1AP/dummy_enb.c +++ b/openair2/F1AP/dummy_enb.c @@ -32,16 +32,15 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, abort(); } -boolean_t sdap_gnb_data_req(protocol_ctxt_t *ctxt_p, - const srb_flag_t srb_flag, - const rb_id_t rb_id, - const mui_t mui, - const confirm_t confirm, - const sdu_size_t sdu_buffer_size, - unsigned char *const sdu_buffer, - const pdcp_transmission_mode_t pt_mode, - const uint32_t *sourceL2Id, - const uint32_t *destinationL2Id - ) { +boolean_t sdap_gnb_data(protocol_ctxt_t *ctxt_p, + const srb_flag_t srb_flag, + const rb_id_t rb_id, + const mui_t mui, + const confirm_t confirm, + const sdu_size_t sdu_buffer_size, + unsigned char *const sdu_buffer, + const pdcp_transmission_mode_t pt_mode, + const uint32_t *sourceL2Id, + const uint32_t *destinationL2Id) { abort(); } From cf30f61e656da1de6b6b7bbde212da24b0f6797d Mon Sep 17 00:00:00 2001 From: athanassopoulos Date: Tue, 22 Feb 2022 14:01:41 +0100 Subject: [PATCH 767/883] Changes to SDAP code 1. Removed SDAP struct from protocol context. 2. Added configuration for the SDAP. 3. SDAP doesn't use pdcp_entities, the values come from function arguements. 4. Make nr_pdcp_ue_manager accessible from SDAP. 5. Avoid using the PDCP locking mechanism in SDAP. 6. Removed nr_pdcp_find_entity_sdap function. 7. Rename dummy eNB function to make GTP compile (no SDAP). 8. Fix: Regression issues with LTE 9. Fix: Regression issues with NR CU/DU --- openair2/COMMON/platform_types.h | 8 -- openair2/COMMON/rrc_messages_types.h | 1 + openair2/F1AP/dummy_enb.c | 7 +- openair2/GNB_APP/gnb_config.c | 4 +- openair2/GNB_APP/gnb_paramdef.h | 7 +- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 56 ++++++---- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h | 3 - openair2/RRC/NR/rrc_gNB.c | 9 +- openair2/SDAP/nr_sdap/nr_sdap.c | 25 +++-- openair2/SDAP/nr_sdap/nr_sdap.h | 11 +- openair2/SDAP/nr_sdap/nr_sdap_entity.c | 119 ++++++++++++---------- openair2/SDAP/nr_sdap/nr_sdap_entity.h | 43 +++++--- openair3/ocp-gtpu/gtp_itf.cpp | 51 +++++++--- openair3/ocp-gtpu/gtp_itf.h | 15 +++ 14 files changed, 225 insertions(+), 134 deletions(-) delete mode 100644 openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h index b9a7375b9f..67300da308 100644 --- a/openair2/COMMON/platform_types.h +++ b/openair2/COMMON/platform_types.h @@ -234,19 +234,11 @@ typedef uint8_t pdusessionid_t; // may be ITTI not enabled, but type instance is useful also for OTG, typedef intptr_t instance_t; -typedef struct sdap_protocol_ctxt_s { - boolean_t rqi; - uint8_t qfi; - boolean_t dc; - int pdusession_id; -} sdap_protocol_ctxt_t; - typedef struct protocol_ctxt_s { module_id_t module_id; /*!< \brief Virtualized module identifier */ eNB_flag_t enb_flag; /*!< \brief Flag to indicate eNB (1) or UE (0) */ instance_t instance; /*!< \brief ITTI or OTG module identifier */ rnti_t rnti; - sdap_protocol_ctxt_t sdap; frame_t frame; /*!< \brief LTE frame number.*/ sub_frame_t subframe; /*!< \brief LTE sub frame number.*/ eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */ diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 6b41970735..ac70dee092 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -427,6 +427,7 @@ typedef struct NRRrcConfigurationReq_s { bool force_256qam_off; int pusch_TargetSNRx10; int pucch_TargetSNRx10; + bool enable_sdap; } gNB_RrcConfigurationReq; typedef struct NRDuDlReq_s { diff --git a/openair2/F1AP/dummy_enb.c b/openair2/F1AP/dummy_enb.c index 5d1c22824d..9085fdb57c 100644 --- a/openair2/F1AP/dummy_enb.c +++ b/openair2/F1AP/dummy_enb.c @@ -32,7 +32,7 @@ void apply_macrlc_config(gNB_RRC_INST *rrc, abort(); } -boolean_t sdap_gnb_data(protocol_ctxt_t *ctxt_p, +boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p, const srb_flag_t srb_flag, const rb_id_t rb_id, const mui_t mui, @@ -41,6 +41,9 @@ boolean_t sdap_gnb_data(protocol_ctxt_t *ctxt_p, unsigned char *const sdu_buffer, const pdcp_transmission_mode_t pt_mode, const uint32_t *sourceL2Id, - const uint32_t *destinationL2Id) { + const uint32_t *destinationL2Id, + const uint8_t qfi, + const boolean_t rqi, + const int pdusession_id) { abort(); } diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index e9fcee6622..c38a89b15a 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -1192,7 +1192,9 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { LOG_I(RRC, "256 QAM: %s\n", NRRRC_CONFIGURATION_REQ (msg_p).force_256qam_off ? "force off" : "may be on"); NRRRC_CONFIGURATION_REQ (msg_p).scc = scc; NRRRC_CONFIGURATION_REQ (msg_p).scd = scd; - + NRRRC_CONFIGURATION_REQ (msg_p).enable_sdap = *GNBParamList.paramarray[i][GNB_ENABLE_SDAP_IDX].iptr; + LOG_I(GNB_APP, "SDAP layer is %s\n", NRRRC_CONFIGURATION_REQ (msg_p).enable_sdap ? "enabled" : "disabled"); + }// }//End for (k=0; k configuration, &NRRRC_CONFIGURATION_REQ(msg_p), sizeof(NRRRC_CONFIGURATION_REQ(msg_p))); diff --git a/openair2/GNB_APP/gnb_paramdef.h b/openair2/GNB_APP/gnb_paramdef.h index e1d3d93d0b..eb6b2bdccd 100644 --- a/openair2/GNB_APP/gnb_paramdef.h +++ b/openair2/GNB_APP/gnb_paramdef.h @@ -125,7 +125,8 @@ typedef enum { #define GNB_CONFIG_STRING_MINRXTXTIME "min_rxtxtime" #define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist" #define GNB_CONFIG_STRING_FORCE256QAMOFF "force_256qam_off" - +#define GNB_CONFIG_STRING_ENABLE_SDAP "enable_sdap" +#define GNB_CONFIG_HLP_STRING_ENABLE_SDAP "enable the SDAP layer\n" #define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support" @@ -159,7 +160,8 @@ typedef enum { {GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \ {GNB_CONFIG_STRING_MINRXTXTIME, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \ {GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0}, \ -{GNB_CONFIG_STRING_FORCE256QAMOFF, GNB_CONFIG_HLP_FORCE256QAMOFF, PARAMFLAG_BOOL, iptr:NULL, defintval:0, TYPE_INT, 0} \ +{GNB_CONFIG_STRING_FORCE256QAMOFF, GNB_CONFIG_HLP_FORCE256QAMOFF, PARAMFLAG_BOOL, iptr:NULL, defintval:0, TYPE_INT, 0}, \ +{GNB_CONFIG_STRING_ENABLE_SDAP, GNB_CONFIG_HLP_STRING_ENABLE_SDAP, PARAMFLAG_BOOL, iptr:NULL, defintval:0, TYPE_INT, 0}, \ } #define GNB_GNB_ID_IDX 0 @@ -188,6 +190,7 @@ typedef enum { #define GNB_MINRXTXTIME_IDX 23 #define GNB_ULPRBBLACKLIST_IDX 24 #define GNB_FORCE256QAMOFF_IDX 25 +#define GNB_ENABLE_SDAP_IDX 26 #define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD} #define GNBPARAMS_CHECK { \ diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index 3c99916169..74ca77a9c5 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -37,7 +37,6 @@ #include "LAYER2/nr_rlc/nr_rlc_oai_api.h" #include #include "openair2/SDAP/nr_sdap/nr_sdap.h" -#include "nr_pdcp_oai_api.h" #define TODO do { \ printf("%s:%d:%s: todo\n", __FILE__, __LINE__, __FUNCTION__); \ @@ -439,13 +438,13 @@ static void *enb_tun_read_thread(void *_) ctxt.rnti = rnti; - ctxt.sdap.qfi = 7; - ctxt.sdap.rqi = 0; - ctxt.sdap.pdusession_id = 10; + uint8_t qfi = 7; + boolean_t rqi = 0; + int pdusession_id = 10; sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, - RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, - PDCP_TRANSMISSION_MODE_DATA, NULL, NULL); + RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, + PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, qfi, rqi, pdusession_id); } return NULL; @@ -486,13 +485,13 @@ static void *ue_tun_read_thread(void *_) ctxt.rnti = rnti; - ctxt.sdap.dc = SDAP_HDR_UL_DATA_PDU; - ctxt.sdap.qfi = 7; - ctxt.sdap.pdusession_id = 10; + boolean_t dc = SDAP_HDR_UL_DATA_PDU; + uint8_t qfi = 7; + int pdusession_id = 10; sdap_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED, - RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, - PDCP_TRANSMISSION_MODE_DATA, NULL, NULL); + RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf, + PDCP_TRANSMISSION_MODE_DATA, NULL, NULL, qfi, dc, pdusession_id); } return NULL; @@ -622,7 +621,14 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, if (IS_SOFTMODEM_NOS1 || UE_NAS_USE_TUN) { LOG_D(PDCP, "IP packet received with size %d, to be sent to SDAP interface, UE rnti: %d\n", size, ue->rnti); - sdap_data_ind(entity, ue->rnti, buf, size); + sdap_data_ind(entity->rb_id, + entity->is_gnb, + entity->has_sdap, + entity->has_sdapULheader, + entity->pdusession_id, + ue->rnti, + buf, + size); } else{ for (i = 0; i < 5; i++) { @@ -639,7 +645,14 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity, rb_found: { LOG_D(PDCP, "%s() (drb %d) sending message to SDAP size %d\n", __func__, rb_id, size); - sdap_data_ind(entity, ue->rnti, buf, size); + sdap_data_ind(rb_id, + ue->drb[rb_id-1]->is_gnb, + ue->drb[rb_id-1]->has_sdap, + ue->drb[rb_id-1]->has_sdapULheader, + ue->drb[rb_id-1]->pdusession_id, + ue->rnti, + buf, + size); } } } @@ -950,9 +963,9 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s, exit(-1); } pdusession_id = s->cnAssociation->choice.sdap_Config->pdu_Session; - has_sdap = 1; has_sdapULheader = s->cnAssociation->choice.sdap_Config->sdap_HeaderUL == NR_SDAP_Config__sdap_HeaderUL_present ? 1 : 0; has_sdapDLheader = s->cnAssociation->choice.sdap_Config->sdap_HeaderDL == NR_SDAP_Config__sdap_HeaderDL_present ? 1 : 0; + has_sdap = has_sdapULheader | has_sdapDLheader; is_sdap_DefaultDRB = s->cnAssociation->choice.sdap_Config->defaultDRB == true ? 1 : 0; mappedQFIs2Add = (NR_QFI_t*)s->cnAssociation->choice.sdap_Config->mappedQoS_FlowsToAdd->list.array[0]; mappedQFIs2AddCount = s->cnAssociation->choice.sdap_Config->mappedQoS_FlowsToAdd->list.count; @@ -989,7 +1002,8 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s, LOG_D(PDCP, "%s:%d:%s: added drb %d to ue rnti %x\n", __FILE__, __LINE__, __FUNCTION__, drb_id, rnti); - new_nr_sdap_entity(rnti, + new_nr_sdap_entity(has_sdap, + rnti, pdusession_id, is_sdap_DefaultDRB, drb_id, @@ -1438,11 +1452,9 @@ void nr_pdcp_tick(int frame, int subframe) } } -nr_pdcp_entity_t *nr_pdcp_find_entity_sdap(int rnti, uint8_t sdap_drb_id){ - nr_pdcp_ue_t *ue; - ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti); - if(ue->drb[sdap_drb_id-1]) - return ue->drb[sdap_drb_id-1]; - - return NULL; +/* + * For the SDAP API + */ +nr_pdcp_ue_manager_t *nr_pdcp_sdap_get_ue_manager(){ + return nr_pdcp_ue_manager; } diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h deleted file mode 100644 index 59e366ca46..0000000000 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h +++ /dev/null @@ -1,3 +0,0 @@ -#include "openair2/COMMON/platform_types.h" - -nr_pdcp_entity_t *nr_pdcp_find_entity_sdap(int rnti, uint8_t sdap_drb_id); diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 5ea118f64e..69bff1c7da 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -868,8 +868,13 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( sdap_config = CALLOC(1, sizeof(NR_SDAP_Config_t)); memset(sdap_config, 0, sizeof(NR_SDAP_Config_t)); sdap_config->pdu_Session = ue_context_pP->ue_context.pduSession[i].param.pdusession_id; - sdap_config->sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_present; - sdap_config->sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_present; + if (rrc->configuration.enable_sdap) { + sdap_config->sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_present; + sdap_config->sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_present; + } else { + sdap_config->sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_absent; + sdap_config->sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_absent; + } sdap_config->defaultDRB = TRUE; sdap_config->mappedQoS_FlowsToAdd = calloc(1, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd)); memset(sdap_config->mappedQoS_FlowsToAdd, 0, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd)); diff --git a/openair2/SDAP/nr_sdap/nr_sdap.c b/openair2/SDAP/nr_sdap/nr_sdap.c index 674dd700b1..74ef93aff7 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap.c +++ b/openair2/SDAP/nr_sdap/nr_sdap.c @@ -30,12 +30,15 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p, unsigned char *const sdu_buffer, const pdcp_transmission_mode_t pt_mode, const uint32_t *sourceL2Id, - const uint32_t *destinationL2Id) { + const uint32_t *destinationL2Id, + const uint8_t qfi, + const boolean_t rqi, + const int pdusession_id) { nr_sdap_entity_t *sdap_entity; - sdap_entity = nr_sdap_get_entity(ctxt_p->rnti, ctxt_p->sdap.pdusession_id); + sdap_entity = nr_sdap_get_entity(ctxt_p->rnti, pdusession_id); if(sdap_entity == NULL) { - LOG_E(SDAP, "%s:%d:%s: Entity not found with ue rnti: %x and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ctxt_p->rnti, ctxt_p->sdap.pdusession_id); + LOG_E(SDAP, "%s:%d:%s: Entity not found with ue rnti: %x and pdusession id: %d\n", __FILE__, __LINE__, __FUNCTION__, ctxt_p->rnti, pdusession_id); return 0; } @@ -49,16 +52,22 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p, sdu_buffer, pt_mode, sourceL2Id, - destinationL2Id); + destinationL2Id, + qfi, + rqi); return ret; } -void sdap_data_ind(nr_pdcp_entity_t *pdcp_entity, +void sdap_data_ind(rb_id_t pdcp_entity, + int is_gnb, + int has_sdap, + int has_sdapULheader, + int pdusession_id, int rnti, char *buf, int size) { nr_sdap_entity_t *sdap_entity; - sdap_entity = nr_sdap_get_entity(rnti, pdcp_entity->pdusession_id); + sdap_entity = nr_sdap_get_entity(rnti, pdusession_id); if(sdap_entity == NULL) { LOG_E(SDAP, "%s:%d:%s: Entity not found\n", __FILE__, __LINE__, __FUNCTION__); @@ -67,6 +76,10 @@ void sdap_data_ind(nr_pdcp_entity_t *pdcp_entity, sdap_entity->rx_entity(sdap_entity, pdcp_entity, + is_gnb, + has_sdap, + has_sdapULheader, + pdusession_id, rnti, buf, size); diff --git a/openair2/SDAP/nr_sdap/nr_sdap.h b/openair2/SDAP/nr_sdap/nr_sdap.h index e4e8004e2d..cd702cfd7f 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap.h +++ b/openair2/SDAP/nr_sdap/nr_sdap.h @@ -41,7 +41,10 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p, unsigned char *const sdu_buffer, const pdcp_transmission_mode_t pt_mode, const uint32_t *sourceL2Id, - const uint32_t *destinationL2Id + const uint32_t *destinationL2Id, + const uint8_t qfi, + const boolean_t rqi, + const int pdusession_id ); /* @@ -50,7 +53,11 @@ boolean_t sdap_data_req(protocol_ctxt_t *ctxt_p, * Uplink - gNB * Downlink - nrUE */ -void sdap_data_ind(nr_pdcp_entity_t *pdcp_entity, +void sdap_data_ind(rb_id_t pdcp_entity, + int is_gnb, + int has_sdap, + int has_sdapULheader, + int pdusession_id, int rnti, char *buf, int size diff --git a/openair2/SDAP/nr_sdap/nr_sdap_entity.c b/openair2/SDAP/nr_sdap/nr_sdap_entity.c index 028653372f..c5d1c1d6fe 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap_entity.c +++ b/openair2/SDAP/nr_sdap/nr_sdap_entity.c @@ -23,7 +23,7 @@ #include "common/utils/LOG/log.h" #include #include -#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h" +#include "openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.h" #include #include @@ -35,6 +35,17 @@ typedef struct { static nr_sdap_entity_info sdap_info; +nr_pdcp_ue_manager_t *nr_pdcp_sdap_get_ue_manager(void); + +void nr_pdcp_submit_sdap_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){ + nr_pdcp_ue_t *ue; + nr_pdcp_ue_manager_t *nr_pdcp_ue_manager; + nr_pdcp_ue_manager = nr_pdcp_sdap_get_ue_manager(); + ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti); + ue->drb[sdap_ctrl_pdu_drb-1]->recv_sdu(ue->drb[sdap_ctrl_pdu_drb-1], (char*)&ctrl_pdu, SDAP_HDR_LENGTH, RLC_MUI_UNDEFINED); + return; +} + static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity, protocol_ctxt_t *ctxt_p, const srb_flag_t srb_flag, @@ -45,7 +56,9 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity, unsigned char *const sdu_buffer, const pdcp_transmission_mode_t pt_mode, const uint32_t *sourceL2Id, - const uint32_t *destinationL2Id + const uint32_t *destinationL2Id, + const uint8_t qfi, + const boolean_t rqi ) { /* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */ int offset=0; @@ -60,11 +73,11 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity, } uint8_t sdap_buf[SDAP_MAX_PDU]; - nr_pdcp_entity_t *pdcp_entity = entity->qfi2drb_map(entity, ctxt_p->sdap.qfi, rb_id); + rb_id_t pdcp_entity = entity->qfi2drb_map(entity, qfi, rb_id); if(pdcp_entity){ - sdap_drb_id = pdcp_entity->rb_id; - pdcp_ent_has_sdap = pdcp_entity->has_sdap; + sdap_drb_id = pdcp_entity; + pdcp_ent_has_sdap = entity->qfi2drb_table[qfi].hasSdap; } if(!pdcp_ent_has_sdap){ @@ -99,8 +112,8 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity, * Construct the DL SDAP data PDU. */ nr_sdap_dl_hdr_t sdap_hdr; - sdap_hdr.QFI = ctxt_p->sdap.qfi; - sdap_hdr.RQI = ctxt_p->sdap.rqi; + sdap_hdr.QFI = qfi; + sdap_hdr.RQI = rqi; sdap_hdr.RDI = 0; // SDAP Hardcoded Value /* Add the SDAP DL Header to the buffer */ memcpy(&sdap_buf[0], &sdap_hdr, SDAP_HDR_LENGTH); @@ -118,9 +131,9 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity, * construct the UL SDAP data PDU as specified in the subclause 6.2.2.3. */ nr_sdap_ul_hdr_t sdap_hdr; - sdap_hdr.QFI = ctxt_p->sdap.qfi; + sdap_hdr.QFI = qfi; sdap_hdr.R = 0; - sdap_hdr.DC = ctxt_p->sdap.dc; + sdap_hdr.DC = rqi; /* Add the SDAP UL Header to the buffer */ memcpy(&sdap_buf[0], &sdap_hdr, SDAP_HDR_LENGTH); memcpy(&sdap_buf[SDAP_HDR_LENGTH], sdu_buffer, sdu_buffer_size); @@ -154,15 +167,19 @@ static boolean_t nr_sdap_tx_entity(nr_sdap_entity_t *entity, } static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, - nr_pdcp_entity_t *pdcp_entity, + rb_id_t pdcp_entity, + int is_gnb, + int has_sdap, + int has_sdapHeader, + int pdusession_id, int rnti, char *buf, int size) { /* The offset of the SDAP header, it might be 0 if the has_sdap is not true in the pdcp entity. */ int offset=0; - if(pdcp_entity->is_gnb) { // gNB - if(pdcp_entity->has_sdap && pdcp_entity->has_sdapULheader ) { // Handling the SDAP Header + if(is_gnb) { // gNB + if(has_sdap && has_sdapHeader ) { // Handling the SDAP Header offset = SDAP_HDR_LENGTH; nr_sdap_ul_hdr_t *sdap_hdr = (nr_sdap_ul_hdr_t *)buf; LOG_D(SDAP, "RX Entity Received QFI : %u\n", sdap_hdr->QFI); @@ -192,16 +209,16 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).length = size-offset; GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX; GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).rnti = rnti; - GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).pdusession_id = pdcp_entity->pdusession_id; + GTPV1U_GNB_TUNNEL_DATA_REQ(message_p).pdusession_id = pdusession_id; LOG_D(SDAP, "%s() sending message to gtp size %d\n", __func__, size-offset); - itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p); } else { //nrUE /* * TS 37.324 5.2 Data transfer * 5.2.2 Downlink * if the DRB from which this SDAP data PDU is received is configured by RRC with the presence of SDAP header. */ - if(pdcp_entity->has_sdap && pdcp_entity->has_sdapDLheader) { // Handling the SDAP Header + if(has_sdap && has_sdapHeader) { // Handling the SDAP Header offset = SDAP_HDR_LENGTH; /* * TS 37.324 5.2 Data transfer @@ -224,9 +241,9 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, * 5.3.2 Reflective mapping * If there is no stored QoS flow to DRB mapping rule for the QoS flow and a default DRB is configured. */ - if(!entity->qfi2drb_table[sdap_hdr->QFI] && entity->default_drb->rb_id){ + if(!entity->qfi2drb_table[sdap_hdr->QFI].drb_id && entity->default_drb){ nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI); - nr_pdcp_entity_t *sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, sdap_hdr->QFI); + rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, sdap_hdr->QFI); entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); } @@ -239,10 +256,10 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, * the DRB according to the stored QoS flow to DRB mapping rule is configured by RRC * with the presence of UL SDAP header */ - if( (pdcp_entity->rb_id != entity->qfi2drb_table[sdap_hdr->QFI]->rb_id) && - pdcp_entity->has_sdapULheader ){ + if( (pdcp_entity != entity->qfi2drb_table[sdap_hdr->QFI].drb_id) && + has_sdapHeader ){ nr_sdap_ul_hdr_t sdap_ctrl_pdu = entity->sdap_construct_ctrl_pdu(sdap_hdr->QFI); - nr_pdcp_entity_t *sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, sdap_hdr->QFI); + rb_id_t sdap_ctrl_pdu_drb = entity->sdap_map_ctrl_pdu(entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, sdap_hdr->QFI); entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); } @@ -251,7 +268,7 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, * 5.3.2 Reflective mapping * store the QoS flow to DRB mapping of the DL SDAP data PDU as the QoS flow to DRB mapping rule for the UL. */ - entity->qfi2drb_table[sdap_hdr->QFI]->rb_id = pdcp_entity->rb_id; + entity->qfi2drb_table[sdap_hdr->QFI].drb_id = pdcp_entity; } /* @@ -280,45 +297,35 @@ static void nr_sdap_rx_entity(nr_sdap_entity_t *entity, } } -void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, uint8_t drb){ +void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap){ if(qfi < SDAP_MAX_QFI && qfi > SDAP_MAP_RULE_EMPTY && drb > 0 && drb <= AVLBL_DRB) { - nr_pdcp_entity_t *pdcp_entity; - pdcp_entity = nr_pdcp_find_entity_sdap(entity->rnti, drb); - - if(!pdcp_entity){ - LOG_D(SDAP, "Map Update failed - PDCP Entity does not exist, should create it\n"); - LOG_D(SDAP, "Map Update failed - Mapping to default DRB\n"); - entity->qfi2drb_table[qfi] = entity->default_drb; - } - - entity->qfi2drb_table[qfi] = pdcp_entity; - LOG_D(SDAP, "Updated QFI to DRB Map: QFI %u -> DRB %d \n", qfi, entity->qfi2drb_table[qfi]->rb_id); + entity->qfi2drb_table[qfi].drb_id = drb; + entity->qfi2drb_table[qfi].hasSdap = hasSdap; + LOG_D(SDAP, "Updated QFI to DRB Map: QFI %u -> DRB %ld \n", qfi, entity->qfi2drb_table[qfi].drb_id); + LOG_D(SDAP, "DRB %ld %s\n", entity->qfi2drb_table[qfi].drb_id, hasSdap ? "has SDAP" : "does not have SDAP"); } } void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi){ - entity->qfi2drb_table[qfi] = SDAP_NO_MAPPING_RULE; + entity->qfi2drb_table[qfi].drb_id = SDAP_NO_MAPPING_RULE; LOG_D(SDAP, "Deleted QFI to DRB Map for QFI %u \n", qfi); } -nr_pdcp_entity_t *nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, long upper_layer_rb_id){ - nr_pdcp_entity_t *pdcp_entity; +rb_id_t nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t upper_layer_rb_id){ + rb_id_t pdcp_entity; - pdcp_entity = entity->qfi2drb_table[qfi]; + pdcp_entity = entity->qfi2drb_table[qfi].drb_id; if(pdcp_entity){ return pdcp_entity; } else if(entity->default_drb) { LOG_D(SDAP, "Mapped QFI %u to Default DRB\n", qfi); - entity->qfi2drb_map_update(entity, qfi, entity->default_drb->rb_id); return entity->default_drb; } else { - /* Update map for Hardcode DRB ID given from upper layer (ue/enb_tun_read_thread rb_id)*/ - entity->qfi2drb_map_update(entity, qfi, upper_layer_rb_id); return SDAP_MAP_RULE_EMPTY; } @@ -336,28 +343,28 @@ nr_sdap_ul_hdr_t nr_sdap_construct_ctrl_pdu(uint8_t qfi){ return sdap_end_marker_hdr; } -nr_pdcp_entity_t *nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi){ - nr_pdcp_entity_t *drb_of_endmarker = NULL; +rb_id_t nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, rb_id_t pdcp_entity, int map_type, uint8_t dl_qfi){ + rb_id_t drb_of_endmarker = 0; if(map_type == SDAP_CTRL_PDU_MAP_DEF_DRB){ drb_of_endmarker = entity->default_drb; LOG_D(SDAP, "Mapped Control PDU to default drb\n"); } if(map_type == SDAP_CTRL_PDU_MAP_RULE_DRB){ - drb_of_endmarker = entity->qfi2drb_map(entity, dl_qfi, pdcp_entity->rb_id); + drb_of_endmarker = entity->qfi2drb_map(entity, dl_qfi, pdcp_entity); LOG_D(SDAP, "Mapped Control PDU according to the mapping rule, qfi %u \n", dl_qfi); } return drb_of_endmarker; } -void nr_sdap_submit_ctrl_pdu(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){ +void nr_sdap_submit_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu){ if(sdap_ctrl_pdu_drb){ - sdap_ctrl_pdu_drb->recv_sdu(sdap_ctrl_pdu_drb, (char*)&ctrl_pdu, SDAP_HDR_LENGTH, RLC_MUI_UNDEFINED); + nr_pdcp_submit_sdap_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, ctrl_pdu); LOG_D(SDAP, "Sent Control PDU to PDCP Layer.\n"); } } void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity, - nr_pdcp_entity_t *pdcp_entity, + rb_id_t pdcp_entity, uint16_t rnti, NR_QFI_t *mapped_qfi_2_add, uint8_t mappedQFIs2AddCount, @@ -367,20 +374,21 @@ void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity, for(int i = 0; i < mappedQFIs2AddCount; i++){ qfi = mapped_qfi_2_add[i]; - if(existing_sdap_entity->default_drb && existing_sdap_entity->qfi2drb_table[qfi] == SDAP_NO_MAPPING_RULE){ + if(existing_sdap_entity->default_drb && existing_sdap_entity->qfi2drb_table[qfi].drb_id == SDAP_NO_MAPPING_RULE){ nr_sdap_ul_hdr_t sdap_ctrl_pdu = existing_sdap_entity->sdap_construct_ctrl_pdu(qfi); - nr_pdcp_entity_t *sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, qfi); + rb_id_t sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_DEF_DRB, qfi); existing_sdap_entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); } - if(existing_sdap_entity->qfi2drb_table[qfi]->rb_id != drb_identity && pdcp_entity->has_sdapULheader){ + if(existing_sdap_entity->qfi2drb_table[qfi].drb_id != drb_identity && existing_sdap_entity->qfi2drb_table[qfi].hasSdap){ nr_sdap_ul_hdr_t sdap_ctrl_pdu = existing_sdap_entity->sdap_construct_ctrl_pdu(qfi); - nr_pdcp_entity_t *sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, qfi); + rb_id_t sdap_ctrl_pdu_drb = existing_sdap_entity->sdap_map_ctrl_pdu(existing_sdap_entity, pdcp_entity, SDAP_CTRL_PDU_MAP_RULE_DRB, qfi); existing_sdap_entity->sdap_submit_ctrl_pdu(rnti, sdap_ctrl_pdu_drb, sdap_ctrl_pdu); } } } -nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti, +nr_sdap_entity_t *new_nr_sdap_entity(int has_sdap, + uint16_t rnti, int pdusession_id, boolean_t is_defaultDRB, uint8_t drb_identity, @@ -390,7 +398,7 @@ nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti, if(nr_sdap_get_entity(rnti, pdusession_id)) { LOG_E(SDAP, "SDAP Entity for UE already exists.\n"); nr_sdap_entity_t *existing_sdap_entity = nr_sdap_get_entity(rnti, pdusession_id); - nr_pdcp_entity_t *pdcp_entity = existing_sdap_entity->default_drb; + rb_id_t pdcp_entity = existing_sdap_entity->default_drb; nr_sdap_ue_qfi2drb_config(existing_sdap_entity, pdcp_entity, rnti, mapped_qfi_2_add, mappedQFIs2AddCount, drb_identity); return existing_sdap_entity; } @@ -418,15 +426,14 @@ nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti, sdap_entity->qfi2drb_map = nr_sdap_qfi2drb_map; if(is_defaultDRB) { - nr_pdcp_entity_t *pdcp_entity = nr_pdcp_find_entity_sdap(sdap_entity->rnti, drb_identity); - sdap_entity->default_drb = pdcp_entity; - LOG_I(SDAP, "Default DRB for the created SDAP entity: %d \n", sdap_entity->default_drb->rb_id); + sdap_entity->default_drb = drb_identity; + LOG_I(SDAP, "Default DRB for the created SDAP entity: %ld \n", sdap_entity->default_drb); if(mappedQFIs2AddCount) { for (int i = 0; i < mappedQFIs2AddCount; i++) { LOG_D(SDAP, "Mapped QFI to Add : %ld \n", mapped_qfi_2_add[i]); - sdap_entity->qfi2drb_map_update(sdap_entity, mapped_qfi_2_add[i], sdap_entity->default_drb->rb_id); + sdap_entity->qfi2drb_map_update(sdap_entity, mapped_qfi_2_add[i], sdap_entity->default_drb, has_sdap); } } } diff --git a/openair2/SDAP/nr_sdap/nr_sdap_entity.h b/openair2/SDAP/nr_sdap/nr_sdap_entity.h index 46c9ea3774..b46e5bf4e3 100644 --- a/openair2/SDAP/nr_sdap/nr_sdap_entity.h +++ b/openair2/SDAP/nr_sdap/nr_sdap_entity.h @@ -62,19 +62,26 @@ typedef struct nr_sdap_ul_hdr_s { uint8_t DC:1; } __attribute__((packed)) nr_sdap_ul_hdr_t; +typedef struct qfi2drb_s { + rb_id_t drb_id; + boolean_t hasSdap; +} qfi2drb_t; + +void nr_pdcp_submit_sdap_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu); + typedef struct nr_sdap_entity_s { uint16_t rnti; - nr_pdcp_entity_t *default_drb; + rb_id_t default_drb; int pdusession_id; - nr_pdcp_entity_t *qfi2drb_table[SDAP_MAX_QFI]; + qfi2drb_t qfi2drb_table[SDAP_MAX_QFI]; - void (*qfi2drb_map_update)(struct nr_sdap_entity_s *entity, uint8_t qfi, uint8_t drb); + void (*qfi2drb_map_update)(struct nr_sdap_entity_s *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap); void (*qfi2drb_map_delete)(struct nr_sdap_entity_s *entity, uint8_t qfi); - nr_pdcp_entity_t *(*qfi2drb_map)(struct nr_sdap_entity_s *entity, uint8_t qfi, long upper_layer_rb_id); + rb_id_t (*qfi2drb_map)(struct nr_sdap_entity_s *entity, uint8_t qfi, rb_id_t upper_layer_rb_id); nr_sdap_ul_hdr_t (*sdap_construct_ctrl_pdu)(uint8_t qfi); - nr_pdcp_entity_t *(*sdap_map_ctrl_pdu)(struct nr_sdap_entity_s *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi); - void (*sdap_submit_ctrl_pdu)(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu); + rb_id_t (*sdap_map_ctrl_pdu)(struct nr_sdap_entity_s *entity, rb_id_t pdcp_entity, int map_type, uint8_t dl_qfi); + void (*sdap_submit_ctrl_pdu)(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu); boolean_t (*tx_entity)(struct nr_sdap_entity_s *entity, @@ -87,10 +94,17 @@ typedef struct nr_sdap_entity_s { unsigned char *const sdu_buffer, const pdcp_transmission_mode_t pt_mode, const uint32_t *sourceL2Id, - const uint32_t *destinationL2Id); + const uint32_t *destinationL2Id, + const uint8_t qfi, + const boolean_t rqi + ); void (*rx_entity)(struct nr_sdap_entity_s *entity, - nr_pdcp_entity_t *pdcp_entity, + rb_id_t pdcp_entity, + int is_gnb, + int has_sdap, + int has_sdapULheader, + int pdusession_id, int rnti, char *buf, int size); @@ -100,7 +114,7 @@ typedef struct nr_sdap_entity_s { } nr_sdap_entity_t; /* QFI to DRB Mapping Related Function */ -void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, uint8_t drb); +void nr_sdap_qfi2drb_map_update(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t drb, boolean_t hasSdap); /* QFI to DRB Mapping Related Function */ void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi); @@ -114,7 +128,7 @@ void nr_sdap_qfi2drb_map_del(nr_sdap_entity_t *entity, uint8_t qfi); * If there is no stored QoS flow to DRB mapping rule for the QoS flow as specified in the subclause 5.3, map the SDAP SDU to the default DRB * else, map the SDAP SDU to the DRB according to the stored QoS flow to DRB mapping rule. */ -nr_pdcp_entity_t *nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, long upper_layer_rb_id); +rb_id_t nr_sdap_qfi2drb_map(nr_sdap_entity_t *entity, uint8_t qfi, rb_id_t upper_layer_rb_id); /* * TS 37.324 5.3 QoS flow to DRB Mapping @@ -128,20 +142,20 @@ nr_sdap_ul_hdr_t nr_sdap_construct_ctrl_pdu(uint8_t qfi); * 1.) default DRB or * 2.) DRB according to the stored QoS flow to DRB mapping rule */ -nr_pdcp_entity_t *nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, nr_pdcp_entity_t *pdcp_entity, int map_type, uint8_t dl_qfi); +rb_id_t nr_sdap_map_ctrl_pdu(nr_sdap_entity_t *entity, rb_id_t pdcp_entity, int map_type, uint8_t dl_qfi); /* * TS 37.324 5.3 QoS flow to DRB Mapping * Submit the end-marker control PDU to the lower layer. */ -void nr_sdap_submit_ctrl_pdu(int rnti, nr_pdcp_entity_t *sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu); +void nr_sdap_submit_ctrl_pdu(int rnti, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu); /* * TS 37.324 5.3 QoS flow to DRB Mapping * 5.3.1 Configuration Procedures */ void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity, - nr_pdcp_entity_t *pdcp_entity, + rb_id_t pdcp_entity, uint16_t rnti, NR_QFI_t *mapped_qfi_2_add, uint8_t mappedQFIs2AddCount, @@ -151,7 +165,8 @@ void nr_sdap_ue_qfi2drb_config(nr_sdap_entity_t *existing_sdap_entity, * TS 37.324 4.4 5.1.1 SDAP entity establishment * Establish an SDAP entity. */ -nr_sdap_entity_t *new_nr_sdap_entity(uint16_t rnti, +nr_sdap_entity_t *new_nr_sdap_entity(int has_sdap, + uint16_t rnti, int pdusession_id, boolean_t is_defaultDRB, uint8_t default_DRB, diff --git a/openair3/ocp-gtpu/gtp_itf.cpp b/openair3/ocp-gtpu/gtp_itf.cpp index 3c6c63c6a4..7b8ba308bf 100644 --- a/openair3/ocp-gtpu/gtp_itf.cpp +++ b/openair3/ocp-gtpu/gtp_itf.cpp @@ -20,6 +20,8 @@ extern "C" { #include "openair2/SDAP/nr_sdap/nr_sdap.h" //#include +static boolean_t is_gnb = false; + #pragma pack(1) typedef struct Gtpv1uMsgHeader { @@ -92,6 +94,7 @@ typedef struct { rnti_t rnti; ebi_t incoming_rb_id; gtpCallback callBack; + gtpCallbackSDAP callBackSDAP; int pdusession_id; } rntiData_t; @@ -476,6 +479,8 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer inst->te2ue_mapping[incoming_teid].incoming_rb_id= incoming_bearer_id; inst->te2ue_mapping[incoming_teid].callBack=callBack; + + inst->te2ue_mapping[incoming_teid].callBackSDAP = sdap_data_req; inst->te2ue_mapping[incoming_teid].pdusession_id = (uint8_t)outgoing_bearer_id; @@ -597,14 +602,14 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance, create_tunnel_req->num_tunnels, create_tunnel_req->outgoing_teid[0]); tcp_udp_port_t dstport=globGtp.instances[compatInst(instance)].get_dstport(); - + is_gnb = true; for (int i = 0; i < create_tunnel_req->num_tunnels; i++) { teid_t teid=newGtpuCreateTunnel(instance, create_tunnel_req->rnti, create_tunnel_req->incoming_rb_id[i], create_tunnel_req->pdusession_id[i], create_tunnel_req->outgoing_teid[i], create_tunnel_req->dst_addr[i], dstport, - sdap_data_req); + pdcp_data_req); create_tunnel_resp->status=0; create_tunnel_resp->rnti=create_tunnel_req->rnti; create_tunnel_resp->num_tunnels=create_tunnel_req->num_tunnels; @@ -876,9 +881,6 @@ static int Gtpv1uHandleGpdu(int h, ctxt.enb_flag = 1; ctxt.instance = inst->addr.originInstance; ctxt.rnti = tunnel->second.rnti; - ctxt.sdap.qfi = qfi; - ctxt.sdap.rqi = rqi; - ctxt.sdap.pdusession_id = tunnel->second.pdusession_id; ctxt.frame = 0; ctxt.subframe = 0; ctxt.eNB_index = 0; @@ -894,17 +896,34 @@ static int Gtpv1uHandleGpdu(int h, const uint32_t destinationL2Id=0; pthread_mutex_unlock(&globGtp.gtp_lock); - if ( !tunnel->second.callBack(&ctxt, - srb_flag, - rb_id, - mui, - confirm, - sdu_buffer_size, - sdu_buffer, - mode, - &sourceL2Id, - &destinationL2Id) ) - LOG_E(GTPU,"[%d] down layer refused incoming packet\n", h); + if(is_gnb && qfi){ + if ( !tunnel->second.callBackSDAP(&ctxt, + srb_flag, + rb_id, + mui, + confirm, + sdu_buffer_size, + sdu_buffer, + mode, + &sourceL2Id, + &destinationL2Id, + qfi, + rqi, + tunnel->second.pdusession_id) ) + LOG_E(GTPU,"[%d] down layer refused incoming packet\n", h); + } else { + if ( !tunnel->second.callBack(&ctxt, + srb_flag, + rb_id, + mui, + confirm, + sdu_buffer_size, + sdu_buffer, + mode, + &sourceL2Id, + &destinationL2Id) ) + LOG_E(GTPU,"[%d] down layer refused incoming packet\n", h); + } LOG_D(GTPU,"[%d] Received a %d bytes packet for: teid:%x\n", h, msgBufLen-offset, diff --git a/openair3/ocp-gtpu/gtp_itf.h b/openair3/ocp-gtpu/gtp_itf.h index ba6cf0f8bb..17882ebf1e 100644 --- a/openair3/ocp-gtpu/gtp_itf.h +++ b/openair3/ocp-gtpu/gtp_itf.h @@ -20,6 +20,21 @@ typedef boolean_t (*gtpCallback)( const uint32_t *sourceL2Id, const uint32_t *destinationL2Id); +typedef boolean_t (*gtpCallbackSDAP)( + protocol_ctxt_t *ctxt_pP, + const srb_flag_t srb_flagP, + const rb_id_t rb_idP, + const mui_t muiP, + const confirm_t confirmP, + const sdu_size_t sdu_buffer_sizeP, + unsigned char *const sdu_buffer_pP, + const pdcp_transmission_mode_t modeP, + const uint32_t *sourceL2Id, + const uint32_t *destinationL2Id, + const uint8_t qfi, + const boolean_t rqi, + const int pdusession_id); + typedef struct openAddr_s { char originHost[HOST_NAME_MAX]; char originService[HOST_NAME_MAX]; From db00707e66b38a987f848b27043d4c57cbda3ef5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sat, 2 Apr 2022 20:45:43 +0200 Subject: [PATCH 768/883] CI scripts: correct asterix USRP IP address --- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 2 +- ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_b200.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_x300.xml | 2 +- ci-scripts/xml_files/fr1_sa_quectel.xml | 2 +- ci-scripts/xml_files/fr1_sa_quectel_162prb.xml | 2 +- ci-scripts/xml_files/fr1_sa_quectel_stages.xml | 2 +- ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 5dbd36f00d..56694920ba 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -81,7 +81,7 @@ nr yes datalog_rt_stats.2x2.yaml - 192.168.18.240 + 192.168.18.252
diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 02544f273b..840521481e 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -100,7 +100,7 @@ nr yes datalog_rt_stats.2x2.yaml - 192.168.18.240 + 192.168.18.252 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml b/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml index 774d5751c5..55268b909d 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml @@ -60,7 +60,7 @@ nr yes yes - 192.168.18.240 + 192.168.18.252 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index bfa2208d3d..53b696c6eb 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -60,7 +60,7 @@ nr yes yes - 192.168.18.240 + 192.168.18.252 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml index c43bdd2a7c..8c2f7052e4 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml @@ -60,7 +60,7 @@ nr yes yes - 192.168.18.240 + 192.168.18.252 diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 8d15015c07..576456ebc9 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -70,7 +70,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.240 + 192.168.18.252 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml index f756083ea6..c5f2ddad5f 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -68,7 +68,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.240 + 192.168.18.252 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index 0ab8bf6b08..2707fd4ebf 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -74,7 +74,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.240 + 192.168.18.252 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml index 5feed75586..661bcb32fe 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml @@ -74,7 +74,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.240 + 192.168.18.252 From ec82ddea38fe302f6a88e0c5e5d027fbfa2fff21 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 3 Apr 2022 19:16:29 +0200 Subject: [PATCH 769/883] Don't call calculate_preferred_dl_tda() in do-ra mode In --do-ra mode, calculate_preferred_dl_tda() would be called without a BWP. Then, get_searchspace() would search in the scc, leading to a segfault. Therefore, don't call calculate_preferred_dl_tda() in do-ra mode. --- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 04ee5f3385..9ffec4a13b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -574,7 +574,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, if (CellGroup) { - if (!get_softmodem_params()->phy_test) { + if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra) { calculate_preferred_dl_tda(Mod_idP, NULL); } From b7360eee047114881cbefb642c2d7e7aebad24c9 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 4 Apr 2022 11:47:49 +0200 Subject: [PATCH 770/883] fix(ci): when running modems, forcing fast write to stdout and files Signed-off-by: Raphael Defosseux --- ci-scripts/cls_oaicitest.py | 2 +- ci-scripts/ran.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index ec1202cb21..0865d4efb5 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -535,7 +535,7 @@ class OaiCiTest(): while (doOutterLoop): SSH.command('cd ' + self.UESourceCodePath + '/cmake_targets/ran_build/build', '\$', 5) SSH.command('echo ' + self.UEPassword + ' | sudo -S rm -Rf ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log', '\$', 5) - SSH.command('echo $USER; nohup sudo -E ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh' + ' > ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log ' + ' 2>&1 &', self.UEUserName, 5) + SSH.command('echo $USER; nohup sudo -E stdbuf -o0 ./my-lte-uesoftmodem-run' + str(self.UE_instance) + '.sh' + ' > ' + self.UESourceCodePath + '/cmake_targets/ue_' + self.testCase_id + '.log ' + ' 2>&1 &', self.UEUserName, 5) time.sleep(6) SSH.command('cd ../..', '\$', 5) doLoop = True diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index f95ce90c66..beb89370d2 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -485,7 +485,7 @@ class RANManagement(): 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) - mySSH.command('echo $USER; nohup sudo -E ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh > ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '.log 2>&1 &', lUserName, 10) + mySSH.command('echo $USER; nohup sudo -E stdbuf -o0 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh > ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '.log 2>&1 &', lUserName, 10) #stats monitoring during runtime From 29f47c49c1898b6a4c745bc822c139060c76b3e2 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 4 Apr 2022 11:05:52 +0100 Subject: [PATCH 771/883] Fix segmentation fault for NSA --- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 9ffec4a13b..6ba8629718 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -574,7 +574,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, if (CellGroup) { - if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra) { + if (get_softmodem_params()->sa) { calculate_preferred_dl_tda(Mod_idP, NULL); } From 0c431d969f50d0a4f9eccd97a4443b6eb48504d1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 4 Apr 2022 17:25:40 +0200 Subject: [PATCH 772/883] Further tune LTE 2x2 gains --- ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf | 4 ++-- .../conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index 24c35dedbf..2a82181f4c 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -231,8 +231,8 @@ RUs = ( local_rf = "yes" nb_tx = 2 nb_rx = 2 - att_tx = 0 - att_rx = 0; + att_tx = 10 + att_rx = 10; bands = [38]; max_pdschReferenceSignalPower = -27; max_rxgain = 75; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf index 4a16a64105..b1b58651e0 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -231,8 +231,8 @@ RUs = ( local_rf = "yes" nb_tx = 2 nb_rx = 2 - att_tx = 0 - att_rx = 0; + att_tx = 10 + att_rx = 10; bands = [38]; max_pdschReferenceSignalPower = -27; max_rxgain = 75; From b98f10b73643840200e9f952d2ecb286cad15800 Mon Sep 17 00:00:00 2001 From: Mario Hudon Date: Mon, 4 Apr 2022 14:32:27 -0400 Subject: [PATCH 773/883] - Fixed failing CI tests - Memory leak - Seg fault in dlsim tests --- openair1/PHY/INIT/nr_init_ue.c | 4 ++++ openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index ca18b7509b..67c5605f2b 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -526,6 +526,10 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->pdsch_vars[th_id][gNB_id]); } + for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { + free_and_zero(ue->pdcch_vars[th_id][gNB_id]); + } + for (int i = 0; i < fp->nb_antennas_rx; i++) { free_and_zero(ue->nr_srs_info->srs_received_signal[i]); free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 2f643866e5..20c9b7a1ac 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1478,8 +1478,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, } // Hold the channel estimates in frequency domain. - int32_t pdcch_est_size = fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH); - int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size]; + int32_t pdcch_est_size = ((((fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH))+15)/16)*16); + __attribute__ ((aligned(16))) int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size]; dci_cnt = 0; for(int n_ss = 0; n_ssnb_search_space; n_ss++) { From 2e99d33f2701282393a73aea547f894ef9d1633b Mon Sep 17 00:00:00 2001 From: Mario Hudon Date: Mon, 4 Apr 2022 15:41:36 -0400 Subject: [PATCH 774/883] Fixed compile warning --- openair1/PHY/INIT/nr_init_ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index b8b89209a1..2c4835136c 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -159,7 +159,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) NR_UE_COMMON *const common_vars = &ue->common_vars; NR_UE_PBCH **const pbch_vars = ue->pbch_vars; NR_UE_PRACH **const prach_vars = ue->prach_vars; - int i,j,slot,symb, gNB_id, th_id; + int i,slot,symb, gNB_id, th_id; NR_UE_SRS **const srs_vars = ue->srs_vars; From 76c0335a8b0b01827a473990b8c00cfdaa9f1842 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 24 Feb 2022 17:04:20 +0100 Subject: [PATCH 775/883] initial work for amarisoft ue --- ci-scripts/as_ue/oai_ext_app.sh | 18 + .../as_ue/oaicicd-3xue-noPing-SATest.cfg | 172 ++++++++++ .../as_ue/oaicicd-multi-ue-1xPing-SATest.cfg | 142 ++++++++ .../as_ue/oaicicd-multi-ue-2xPing-SATest.cfg | 150 +++++++++ .../oaicicd-multi-ue-2xPingSeq-SATest.cfg | 150 +++++++++ ci-scripts/as_ue/oaicicd-ue-Ping-SATest.cfg | 113 +++++++ ci-scripts/as_ue/oaicicd-ue-iperf-SATest.cfg | 109 +++++++ ci-scripts/ci_ueinfra.yaml | 40 +++ ci-scripts/cls_amarisoft_ue.py | 75 +++++ ci-scripts/cls_oaicitest.py | 210 +++++++----- ...and78.sa.fr1.106PRB.2x2.usrpn310.asue.conf | 308 ++++++++++++++++++ ci-scripts/epc.py | 10 +- ci-scripts/main.py | 10 + ci-scripts/sshconnection.py | 9 +- .../xml_files/fr1_sa_amarisoft_ue_1x.xml | 87 +++++ ci-scripts/xml_files/sa_cn5g_asue_closure.xml | 38 +++ ci-scripts/xml_files/sa_cn5g_asue_start.xml | 39 +++ 17 files changed, 1595 insertions(+), 85 deletions(-) create mode 100755 ci-scripts/as_ue/oai_ext_app.sh create mode 100644 ci-scripts/as_ue/oaicicd-3xue-noPing-SATest.cfg create mode 100644 ci-scripts/as_ue/oaicicd-multi-ue-1xPing-SATest.cfg create mode 100644 ci-scripts/as_ue/oaicicd-multi-ue-2xPing-SATest.cfg create mode 100644 ci-scripts/as_ue/oaicicd-multi-ue-2xPingSeq-SATest.cfg create mode 100644 ci-scripts/as_ue/oaicicd-ue-Ping-SATest.cfg create mode 100644 ci-scripts/as_ue/oaicicd-ue-iperf-SATest.cfg create mode 100644 ci-scripts/cls_amarisoft_ue.py create mode 100644 ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf create mode 100644 ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml create mode 100644 ci-scripts/xml_files/sa_cn5g_asue_closure.xml create mode 100644 ci-scripts/xml_files/sa_cn5g_asue_start.xml diff --git a/ci-scripts/as_ue/oai_ext_app.sh b/ci-scripts/as_ue/oai_ext_app.sh new file mode 100755 index 0000000000..727e2b5db2 --- /dev/null +++ b/ci-scripts/as_ue/oai_ext_app.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +ue_id="$1" # UE id +duration="$2" # Sim duration + +shift +shift + +function end +{ + exit 0 +} +trap end INT TERM + +echo "ip netns exec $ue_id $@ > /tmp/test_${ue_id}.log" +ip netns exec $ue_id $@ > /tmp/test_$ue_id.log + + diff --git a/ci-scripts/as_ue/oaicicd-3xue-noPing-SATest.cfg b/ci-scripts/as_ue/oaicicd-3xue-noPing-SATest.cfg new file mode 100644 index 0000000000..a9299b67e3 --- /dev/null +++ b/ci-scripts/as_ue/oaicicd-3xue-noPing-SATest.cfg @@ -0,0 +1,172 @@ +/* UE simulator configuration */ + + +/* UE simulator configuration file version 2021-06-17 + * LTE / 5G Non StandAlone + * Copyright (C) 2019-2021 Amarisoft + */ +{ +#define N_ANTENNA_DL 1 +#define TDD 1 +#define CELL_BANDWIDTH 40 +#define UE_COUNT 3 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129 + + +log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1", +log_filename: "/tmp/ue0.log", + +/* Enable remote API and Web interface */ +com_addr: "0.0.0.0:9002", + +include "rf_driver/1chan.cfg", + +/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */ + +cell_groups: [{ + group_type: "nr", + multi_ue: true, + cells: [{ + rf_port: 0, + bandwidth: CELL_BANDWIDTH, +#if TDD == 1 + band: 78, + dl_nr_arfcn:621312, + ssb_nr_arfcn:621312, + + //band: 41, + //dl_nr_arfcn:517020, + //ssb_nr_arfcn:516990, +#else + band: 7, + dl_nr_arfcn: 536020, + ssb_nr_arfcn: 535930, + ssb_subcarrier_spacing: 15, +#endif + subcarrier_spacing: 30, + n_antenna_dl: N_ANTENNA_DL, + n_antenna_ul: 1, + rx_to_tx_latency:2, + }], +}], + + +/* Enable it to allow sim_events to be handled remotely */ +//rue_bind_addr: "127.0.10.11", + + + +ue_list: [ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 0, + "imsi": "208970100001127", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + event: "power_off", + start_time: 30, + } + ] /*end sim events */ + }, /*end UE object 0*/ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 1, + "imsi": "208970100001128", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + event: "power_off", + start_time: 30, + } + ] /*end sim events */ + }, /*end UE object 1*/ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 2, + "imsi": "208970100001129", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + event: "power_off", + start_time: 30, + } + ] /*end sim events */ + } /*end UE object 2*/ + ],/*end UE list*/ +}/*end json*/ + diff --git a/ci-scripts/as_ue/oaicicd-multi-ue-1xPing-SATest.cfg b/ci-scripts/as_ue/oaicicd-multi-ue-1xPing-SATest.cfg new file mode 100644 index 0000000000..3405f99a59 --- /dev/null +++ b/ci-scripts/as_ue/oaicicd-multi-ue-1xPing-SATest.cfg @@ -0,0 +1,142 @@ +/* UE simulator configuration */ + + +/* UE simulator configuration file version 2021-06-17 + * LTE / 5G Non StandAlone + * Copyright (C) 2019-2021 Amarisoft + */ +{ +#define N_ANTENNA_DL 1 +#define TDD 1 +#define CELL_BANDWIDTH 40 +#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129 + + +log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1", +log_filename: "/tmp/ue0.log", + +/* Enable remote API and Web interface */ +com_addr: "0.0.0.0:9002", + +include "rf_driver/1chan.cfg", + +/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */ + +cell_groups: [{ + group_type: "nr", + multi_ue: true, + cells: [{ + rf_port: 0, + bandwidth: CELL_BANDWIDTH, +#if TDD == 1 + band: 78, + dl_nr_arfcn:621312, + ssb_nr_arfcn:621312, + + //band: 41, + //dl_nr_arfcn:517020, + //ssb_nr_arfcn:516990, +#else + band: 7, + dl_nr_arfcn: 536020, + ssb_nr_arfcn: 535930, + ssb_subcarrier_spacing: 15, +#endif + subcarrier_spacing: 30, + n_antenna_dl: N_ANTENNA_DL, + n_antenna_ul: 1, + rx_to_tx_latency:2, + }], +}], + + +/* Enable it to allow sim_events to be handled remotely */ +//rue_bind_addr: "127.0.10.11", + + + +ue_list: [ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 1, + "imsi": "208970100001127", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + event: "power_off", + start_time: 30, + } + ] /*end sim events */ + }, /*end UE object 0*/ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 2, + "imsi": "208970100001128", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + "tag": "ping", + "prog":"oai_ext_app.sh", + start_time: 15, + end_time: 25, + "args":["ping 192.168.70.136"], + "event":"ext_app" + }, + { + event: "power_off", + start_time: 30, + } + ] /*end sim events */ + } /*end UE object 1*/ + ],/*end UE list*/ +}/*end json*/ diff --git a/ci-scripts/as_ue/oaicicd-multi-ue-2xPing-SATest.cfg b/ci-scripts/as_ue/oaicicd-multi-ue-2xPing-SATest.cfg new file mode 100644 index 0000000000..eaa9b894fc --- /dev/null +++ b/ci-scripts/as_ue/oaicicd-multi-ue-2xPing-SATest.cfg @@ -0,0 +1,150 @@ +/* UE simulator configuration */ + + +/* UE simulator configuration file version 2021-06-17 + * LTE / 5G Non StandAlone + * Copyright (C) 2019-2021 Amarisoft + */ +{ +#define N_ANTENNA_DL 1 +#define TDD 1 +#define CELL_BANDWIDTH 40 +#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129 + + +log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1", +log_filename: "/tmp/ue0.log", + +/* Enable remote API and Web interface */ +com_addr: "0.0.0.0:9002", + +include "rf_driver/1chan.cfg", + +/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */ + +cell_groups: [{ + group_type: "nr", + multi_ue: true, + cells: [{ + rf_port: 0, + bandwidth: CELL_BANDWIDTH, +#if TDD == 1 + band: 78, + dl_nr_arfcn:621312, + ssb_nr_arfcn:621312, + + //band: 41, + //dl_nr_arfcn:517020, + //ssb_nr_arfcn:516990, +#else + band: 7, + dl_nr_arfcn: 536020, + ssb_nr_arfcn: 535930, + ssb_subcarrier_spacing: 15, +#endif + subcarrier_spacing: 30, + n_antenna_dl: N_ANTENNA_DL, + n_antenna_ul: 1, + rx_to_tx_latency:2, + }], +}], + + +/* Enable it to allow sim_events to be handled remotely */ +//rue_bind_addr: "127.0.10.11", + + + +ue_list: [ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 1, + "imsi": "208970100001127", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + "tag": "ping", + "prog":"oai_ext_app.sh", + start_time: 15, + end_time: 25, + "args":["ping 192.168.70.136"], + "event":"ext_app" + }, + { + event: "power_off", + start_time: 30, + } + ] /*end sim events */ + }, /*end UE object 0*/ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 2, + "imsi": "208970100001128", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + "tag": "ping", + "prog":"oai_ext_app.sh", + start_time: 15, + end_time: 25, + "args":["ping 192.168.70.136"], + "event":"ext_app" + }, + { + event: "power_off", + start_time: 30, + } + ] /*end sim events */ + } /*end UE object 1*/ + ],/*end UE list*/ +}/*end json*/ diff --git a/ci-scripts/as_ue/oaicicd-multi-ue-2xPingSeq-SATest.cfg b/ci-scripts/as_ue/oaicicd-multi-ue-2xPingSeq-SATest.cfg new file mode 100644 index 0000000000..9ebb3e01c5 --- /dev/null +++ b/ci-scripts/as_ue/oaicicd-multi-ue-2xPingSeq-SATest.cfg @@ -0,0 +1,150 @@ +/* UE simulator configuration */ + + +/* UE simulator configuration file version 2021-06-17 + * LTE / 5G Non StandAlone + * Copyright (C) 2019-2021 Amarisoft + */ +{ +#define N_ANTENNA_DL 1 +#define TDD 1 +#define CELL_BANDWIDTH 40 +#define UE_COUNT 2 // number of simulated UEs 208970100001127, 208970100001128, 208970100001129 + + +log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1", +log_filename: "/tmp/ue0.log", + +/* Enable remote API and Web interface */ +com_addr: "0.0.0.0:9002", + +include "rf_driver/1chan.cfg", + +/* If true, allow the simulation of several UEs at the same time and allow dynamic UE creation from remote API */ + +cell_groups: [{ + group_type: "nr", + multi_ue: true, + cells: [{ + rf_port: 0, + bandwidth: CELL_BANDWIDTH, +#if TDD == 1 + band: 78, + dl_nr_arfcn:621312, + ssb_nr_arfcn:621312, + + //band: 41, + //dl_nr_arfcn:517020, + //ssb_nr_arfcn:516990, +#else + band: 7, + dl_nr_arfcn: 536020, + ssb_nr_arfcn: 535930, + ssb_subcarrier_spacing: 15, +#endif + subcarrier_spacing: 30, + n_antenna_dl: N_ANTENNA_DL, + n_antenna_ul: 1, + rx_to_tx_latency:2, + }], +}], + + +/* Enable it to allow sim_events to be handled remotely */ +//rue_bind_addr: "127.0.10.11", + + + +ue_list: [ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 1, + "imsi": "208970100001127", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + "tag": "ping", + "prog":"oai_ext_app.sh", + start_time: 20, + end_time: 30, + "args":["ping 192.168.70.136"], + "event":"ext_app" + }, + { + event: "power_off", + start_time: 60, + } + ] /*end sim events */ + }, /*end UE object 0*/ + { + /* UE capabilities */ + /* USIM data */ + "ue_id" : 2, + "imsi": "208970100001128", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + sim_events: [ + { + event: "power_on", + start_time: 5, + }, + { + "tag": "ping", + "prog":"oai_ext_app.sh", + start_time: 40, + end_time: 50, + "args":["ping 192.168.70.136"], + "event":"ext_app" + }, + { + event: "power_off", + start_time: 60, + } + ] /*end sim events */ + } /*end UE object 1*/ + ],/*end UE list*/ +}/*end json*/ diff --git a/ci-scripts/as_ue/oaicicd-ue-Ping-SATest.cfg b/ci-scripts/as_ue/oaicicd-ue-Ping-SATest.cfg new file mode 100644 index 0000000000..ba22cbb233 --- /dev/null +++ b/ci-scripts/as_ue/oaicicd-ue-Ping-SATest.cfg @@ -0,0 +1,113 @@ +/* UE simulator configuration */ + + + +/* UE simulator configuration file version 2021-06-17 + * LTE / 5G Non StandAlone + * Copyright (C) 2019-2021 Amarisoft + */ +{ +#define N_ANTENNA_DL 1 +#define TDD 1 +#define CELL_BANDWIDTH 40 + + + log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1", + log_filename: "/tmp/ue1.log", + + /* Enable remote API and Web interface */ + com_addr: "0.0.0.0:9002", + + include "rf_driver/1chan.cfg", + + /* If true, allow the simulation of several UEs at the same time and + allow dynamic UE creation from remote API */ + +cell_groups: [{ + group_type: "nr", + multi_ue: false, + cells: [{ + rf_port: 0, + bandwidth: CELL_BANDWIDTH, +#if TDD == 1 + band: 78, + dl_nr_arfcn:621312, + ssb_nr_arfcn:621312, + + //band: 41, + //dl_nr_arfcn:517020, + //ssb_nr_arfcn:516990, +#else + band: 7, + dl_nr_arfcn: 536020, + ssb_nr_arfcn: 535930, + ssb_subcarrier_spacing: 15, +#endif + subcarrier_spacing: 30, + n_antenna_dl: N_ANTENNA_DL, + n_antenna_ul: 1, + rx_to_tx_latency:2, + }], + }], + + + + + /* Enable it to allow sim_events to be handled remotely */ + //rue_bind_addr: "127.0.10.11", + + ue_list: [ + { + /* UE capabilities */ + + /* USIM data */ + + + "imsi": "208970100001127", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + + + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 66051, + }, + ], + + default_pdu_session_snssai: { + sst: 1, + sd: 66051, + }, + + + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + + sim_events: [{ + event: "power_on", + start_time: 5, + }, { + "tag": "ping", + "prog":"oai_ext_app.sh", + start_time: 15, + end_time: 25, + "args":["ping 192.168.70.136"], + "event":"ext_app" + + }, + { + event: "power_off", + start_time: 30, + }] + } + ], +} diff --git a/ci-scripts/as_ue/oaicicd-ue-iperf-SATest.cfg b/ci-scripts/as_ue/oaicicd-ue-iperf-SATest.cfg new file mode 100644 index 0000000000..841dafb746 --- /dev/null +++ b/ci-scripts/as_ue/oaicicd-ue-iperf-SATest.cfg @@ -0,0 +1,109 @@ +/* UE simulator configuration */ + + + +/* UE simulator configuration file version 2021-06-17 + * LTE / 5G Non StandAlone + * Copyright (C) 2019-2021 Amarisoft + */ +{ +#define N_ANTENNA_DL 1 +#define TDD 1 +#define CELL_BANDWIDTH 20 + + + log_options: "all.level=error,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1", + log_filename: "/tmp/ue0.log", + + /* Enable remote API and Web interface */ + com_addr: "0.0.0.0:9002", + + include "rf_driver/1chan.cfg", + + /* If true, allow the simulation of several UEs at the same time and + allow dynamic UE creation from remote API */ + +cell_groups: [{ + group_type: "nr", + multi_ue: false, + cells: [{ + rf_port: 0, + bandwidth: CELL_BANDWIDTH, +#if TDD == 1 + // band: 78, + // dl_nr_arfcn:621312, + // ssb_nr_arfcn:621312,*/ + + band: 41, + dl_nr_arfcn:517020, + ssb_nr_arfcn:516990, +#else + band: 7, + dl_nr_arfcn: 536020, + ssb_nr_arfcn: 535930, + ssb_subcarrier_spacing: 15, +#endif + subcarrier_spacing: 30, + n_antenna_dl: N_ANTENNA_DL, + n_antenna_ul: 1, + rx_to_tx_latency:2, + }], + }], + + + + + /* Enable it to allow sim_events to be handled remotely */ + //rue_bind_addr: "127.0.10.11", + + ue_list: [ + { + /* UE capabilities */ + + /* USIM data */ + + "imsi": "208970100001127", + "K": "fec86ba6eb707ed08905757b1bb44b8f", + "sim_algo":"milenage", + "op": "1006020f0a478bf6b699f15c062e42b3", + + + as_release: 15, + ue_category: "nr", + apn:"oai", + attach_pdn_type:"ipv4", + default_nssai: [ + { + sst: 1, + sd: 1, + }, + ], + + default_pdu_session_snssai: { + sst: 1, + sd: 1, + }, + + + /* Enable it to allow sim_events to be handled remotely */ + //rue_addr: "127.1.0.0", + + /* Enable it to create a TUN interface for each UE PDN */ + tun_setup_script: "ue-ifup", + + sim_events: [{ + event: "power_on", + start_time: 5, + }, { + event: "ext_app", + start_time: 15, + end_time: 25, + prog: "ext_app.sh", + args: ["iperf", " -c 172.21.10.5", " -u"," -b 1M"," -i 1"," -t 10"] + }, { + event: "power_off", + start_time: 30, + }] + } + ], +} diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index 51acb75968..e06b0e39b6 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -39,6 +39,46 @@ nrmodule2_quectel: StartCommands : - sudo -S ip link set dev wwan1 mtu 1500 MTU : 1500 + +#single UE single ping +amarisoft_ue_1: + ID: amarisoft_ue_1 + State : enabled + Kind : amarisoft + #not required for AS config but needed for py script + WakeupScript : none + DetachScript : none + #end + Cmd : /root/NV17-12-21/ue/lteue + Config : /root/NV17-12-21/ue/config/oaicicd-ue-Ping-SATest.cfg + Duration : 60 + Ping : /tmp/test_ue1.log + HostIPAddress : 192.168.18.89 + HostUsername : root + HostPassword : toor + HostSourceCodePath : /tmp + + +#an other scenario example +amarisoft_ue_2: + ID: amarisoft_ue_2 + State : enabled + Kind : amarisoft + #not required for AS config but needed for py script + WakeupScript : none + DetachScript : none + #end + Cmd : /root/NV17-12-21/ue/lteue + Config : /root/NV17-12-21/ue/config/xxxxxxx.cfg #to be updated for an other scenario + Duration : 60 + Ping : /tmp/test_ue1.log #to be updated fo an other scenario + HostIPAddress : 192.168.18.89 + HostUsername : root + HostPassword : toor + HostSourceCodePath : /tmp + + +#do not remove dummy: ID: '' State : '' diff --git a/ci-scripts/cls_amarisoft_ue.py b/ci-scripts/cls_amarisoft_ue.py new file mode 100644 index 0000000000..3407ec9046 --- /dev/null +++ b/ci-scripts/cls_amarisoft_ue.py @@ -0,0 +1,75 @@ +# * 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 +# */ +#--------------------------------------------------------------------- +# +# Required Python Version +# Python 3.x +# +#--------------------------------------------------------------------- + +#to use isfile +import os +import sys +import logging +#to create a SSH object locally in the methods +import sshconnection +#time.sleep +import time + + +import re +import subprocess + +from datetime import datetime + + +class AS_UE: + + def __init__(self,Module): + #create attributes as in the UE dictionary + for k, v in Module.items(): + setattr(self, k, v) + + + + +#-----------------$ +#PUBLIC Methods$ +#-----------------$ + + def WaitEndScenario(self): + logging.debug('waiting for scenario duration') + time.sleep(int(self.Duration)) + + def KillASUE(self): + mySSH = sshconnection.SSHConnection() + mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) + mySSH.command('killall --signal SIGKILL lteue-avx2', '#', 5) + mySSH.close() + + def RunScenario(self): + mySSH = sshconnection.SSHConnection() + mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) + cmd='echo $USER; nohup '+self.Cmd + ' ' + self.Config + ' &' + mySSH.command(cmd,'#',5) + mySSH.close() + + + diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 5d89a7b2e0..ae6a26fc18 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -55,6 +55,7 @@ import constants as CONST import sshconnection import cls_module_ue +import cls_amarisoft_ue import cls_ci_ueinfra #class defining the multi Ue infrastrucure logging.getLogger("matplotlib").setLevel(logging.WARNING) @@ -418,49 +419,62 @@ class OaiCiTest(): for job in multi_jobs: job.join() HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) - else: #if an ID is specified, it is a module from the yaml infrastructure file - #RH - Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) - Module_UE.ue_trace=ue_trace - is_module=Module_UE.CheckCMProcess(EPC.Type) - if is_module: - Module_UE.EnableTrace() - time.sleep(5) + else: #if an ID is specified, it is a UE from the yaml infrastructure file + ue_kind = InfraUE.ci_ue_infra[self.ue_id]['Kind'] + logging.debug("Detected UE Kind : " + ue_kind) - # Looping attach / detach / wait to be successful at least once - cnt = 0 - status = -1 - while cnt < 4: - Module_UE.Command("wup") - logging.debug("Waiting for IP address to be assigned") - time.sleep(20) - logging.debug("Retrieve IP address") - status=Module_UE.GetModuleIPAddress() - if status==0: - cnt = 10 - else: - cnt += 1 - Module_UE.Command("detach") + #case it is a quectel module (only 1 at a time supported at the moment) + if ue_kind == 'quectel': + Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) + Module_UE.ue_trace=ue_trace + is_module=Module_UE.CheckCMProcess(EPC.Type) + if is_module: + Module_UE.EnableTrace() + time.sleep(5) + + # Looping attach / detach / wait to be successful at least once + cnt = 0 + status = -1 + while cnt < 4: + Module_UE.Command("wup") + logging.debug("Waiting for IP address to be assigned") time.sleep(20) + logging.debug("Retrieve IP address") + status=Module_UE.GetModuleIPAddress() + if status==0: + cnt = 10 + else: + cnt += 1 + Module_UE.Command("detach") + time.sleep(20) - if cnt == 10 and status == 0: - HTML.CreateHtmlTestRow(Module_UE.UEIPAddress, 'OK', CONST.ALL_PROCESSES_OK) - logging.debug('UE IP addresss : '+ Module_UE.UEIPAddress) - #execute additional commands from yaml file after UE attach - SSH = sshconnection.SSHConnection() - SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) - if hasattr(Module_UE,'StartCommands'): - for startcommand in Module_UE.StartCommands: - cmd = 'echo ' + Module_UE.HostPassword + ' | ' + startcommand - SSH.command(cmd,'\$',5) - SSH.close() - #check that the MTU is as expected / requested - Module_UE.CheckModuleMTU() - else: #status==-1 failed to retrieve IP address - HTML.CreateHtmlTestRow('N/A', 'KO', CONST.UE_IP_ADDRESS_ISSUE) - self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS) - return - + if cnt == 10 and status == 0: + HTML.CreateHtmlTestRow(Module_UE.UEIPAddress, 'OK', CONST.ALL_PROCESSES_OK) + logging.debug('UE IP addresss : '+ Module_UE.UEIPAddress) + #execute additional commands from yaml file after UE attach + SSH = sshconnection.SSHConnection() + SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) + if hasattr(Module_UE,'StartCommands'): + for startcommand in Module_UE.StartCommands: + cmd = 'echo ' + Module_UE.HostPassword + ' | ' + startcommand + SSH.command(cmd,'\$',5) + SSH.close() + #check that the MTU is as expected / requested + Module_UE.CheckModuleMTU() + else: #status==-1 failed to retrieve IP address + HTML.CreateHtmlTestRow('N/A', 'KO', CONST.UE_IP_ADDRESS_ISSUE) + self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS) + return + + #case it is a amarisoft ue (only 1 at a time supported at the moment) + elif ue_kind == 'amarisoft': + AS_UE = cls_amarisoft_ue.AS_UE(InfraUE.ci_ue_infra[self.ue_id]) + AS_UE.RunScenario() + AS_UE.WaitEndScenario() + AS_UE.KillASUE() + + else: + logging.debug("Incorrect UE Kind was detected") def InitializeOAIUE(self,HTML,RAN,EPC,COTS_UE,InfraUE,CONTAINERS): @@ -1569,16 +1583,24 @@ class OaiCiTest(): SSH = sshconnection.SSHConnection() # Launch ping on the EPC side (true for ltebox and old open-air-cn) # But for OAI-Rel14-CUPS, we launch from python executor + ping_status = 0 launchFromEpc = True launchFromModule = False + launchFromASUE = False if re.match('OAI-Rel14-CUPS', EPC.Type, re.IGNORECASE): launchFromEpc = False #if module, ping from module to EPC if self.ue_id!='': - launchFromEpc = False - launchfromModule = True - - ping_time = re.findall("-c (\d+)",str(self.ping_args)) + if (re.match('amarisoft', self.ue_id, re.IGNORECASE)): + logging.debug("Ping analysis from amarisoft scenario") + launchFromEpc = False + launchFromASUE = True + else: + launchFromEpc = False + launchFromModule = True + #no ping args for ASUE + if self.ping_args!='': + ping_time = re.findall("-c (\d+)",str(self.ping_args)) if launchFromEpc: SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) @@ -1596,14 +1618,14 @@ class OaiCiTest(): #copy the ping log file to have it locally for analysis (ping stats) SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '.') else: - if launchfromModule == False: + if (launchFromModule == False) and (launchFromASUE == False): #ping log file is on the python executor cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 > ping_' + self.testCase_id + '_' + device_id + '.log' message = cmd + '\n' logging.debug(cmd) ret = subprocess.run(cmd, shell=True) ping_status = ret.returncode - #copy the ping log file to an other folder for log collection (source and destination are EPC) + #copy the ping log file to an other folder for log collection (source and desti elif (launchfromModule == True) and (launchfromASUE == False): #launch from Modulenation are EPC) SSH.copyout(EPC.IPAddress, EPC.UserName, EPC.Password, 'ping_' + self.testCase_id + '_' + device_id + '.log', EPC.SourceCodePath + '/scripts') #copy the ping log file to have it locally for analysis (ping stats) logging.debug(EPC.SourceCodePath + 'ping_' + self.testCase_id + '_' + device_id + '.log') @@ -1613,7 +1635,8 @@ class OaiCiTest(): #cat is executed on EPC SSH.command('cat ' + EPC.SourceCodePath + '/scripts/ping_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) ping_log_file='/scripts/ping_' + self.testCase_id + '_' + device_id + '.log' - else: #launch from Module + + elif (launchFromModule == True) and (launchFromASUE == False): #launch from Module SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) #target address is different depending on EPC type if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE): @@ -1625,13 +1648,25 @@ class OaiCiTest(): #ping from module NIC rather than IP address to make sure round trip is over the air cmd = 'ping -I ' + Module_UE.UENetwork + ' ' + self.ping_args + ' ' + Target + ' 2>&1 > ping_' + self.testCase_id + '_' + self.ue_id + '.log' SSH.command(cmd,'\$',int(ping_time[0])*1.5) + #copy the ping log file to have it locally for analysis (ping stats) SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, 'ping_' + self.testCase_id + '_' + self.ue_id + '.log', '.') #cat is executed locally SSH.command('cat ping_' + self.testCase_id + '_' + self.ue_id + '.log', '\$', 5) ping_log_file='ping_' + self.testCase_id + '_' + self.ue_id + '.log' - ping_status=0 + + elif (launchFromASUE == True): + #ping was already executed when running scenario + #we only need to retrieve ping log file, whose location is in the ci_ueinfra.yaml + logging.debug("Get Ping log from AS server : " + Module_UE.Ping) + SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, Module_UE.Ping, '.') + path,ping_log_file = os.path.split(Module_UE.Ping) + SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) + SSH.command('cat ' + Module_UE.Ping, '\#', 5) + + else: + ping_status=-1 # TIMEOUT CASE if ping_status < 0: @@ -1679,28 +1714,30 @@ class OaiCiTest(): #adding extra ping stats from local file #ping_log_file variable is defined above in this function, depending on device/ue - logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file) - ping_stat=GetPingTimeAnalysis(RAN,ping_log_file,self.ping_rttavg_threshold) ping_stat_msg='' - if (ping_stat!=-1) and (len(ping_stat)!=0): - ping_stat_msg+='Ping stats before removing largest value : \n' - ping_stat_msg+='RTT(Min) : ' + str("{:.2f}".format(ping_stat['min_0'])) + 'ms \n' - ping_stat_msg+='RTT(Mean) : ' + str("{:.2f}".format(ping_stat['mean_0'])) + 'ms \n' - ping_stat_msg+='RTT(Median) : ' + str("{:.2f}".format(ping_stat['median_0'])) + 'ms \n' - ping_stat_msg+='RTT(Max) : ' + str("{:.2f}".format(ping_stat['max_0'])) + 'ms \n' - ping_stat_msg+='Max Index : ' + str(ping_stat['max_loc']) + '\n' - ping_stat_msg+='Ping stats after removing largest value : \n' - ping_stat_msg+='RTT(Min) : ' + str("{:.2f}".format(ping_stat['min_1'])) + 'ms \n' - ping_stat_msg+='RTT(Mean) : ' + str("{:.2f}".format(ping_stat['mean_1'])) + 'ms \n' - ping_stat_msg+='RTT(Median) : ' + str("{:.2f}".format(ping_stat['median_1'])) + 'ms \n' - ping_stat_msg+='RTT(Max) : ' + str("{:.2f}".format(ping_stat['max_1'])) + 'ms \n' + if launchFromASUE == False : #skip in case of AS UE (for the moment) + logging.debug('Analyzing Ping log file : ' + os.getcwd() + '/' + ping_log_file) + ping_stat=GetPingTimeAnalysis(RAN,ping_log_file,self.ping_rttavg_threshold) + + if (ping_stat!=-1) and (len(ping_stat)!=0): + ping_stat_msg+='Ping stats before removing largest value : \n' + ping_stat_msg+='RTT(Min) : ' + str("{:.2f}".format(ping_stat['min_0'])) + 'ms \n' + ping_stat_msg+='RTT(Mean) : ' + str("{:.2f}".format(ping_stat['mean_0'])) + 'ms \n' + ping_stat_msg+='RTT(Median) : ' + str("{:.2f}".format(ping_stat['median_0'])) + 'ms \n' + ping_stat_msg+='RTT(Max) : ' + str("{:.2f}".format(ping_stat['max_0'])) + 'ms \n' + ping_stat_msg+='Max Index : ' + str(ping_stat['max_loc']) + '\n' + ping_stat_msg+='Ping stats after removing largest value : \n' + ping_stat_msg+='RTT(Min) : ' + str("{:.2f}".format(ping_stat['min_1'])) + 'ms \n' + ping_stat_msg+='RTT(Mean) : ' + str("{:.2f}".format(ping_stat['mean_1'])) + 'ms \n' + ping_stat_msg+='RTT(Median) : ' + str("{:.2f}".format(ping_stat['median_1'])) + 'ms \n' + ping_stat_msg+='RTT(Max) : ' + str("{:.2f}".format(ping_stat['max_1'])) + 'ms \n' #building html message qMsg = pal_msg + '\n' + min_msg + '\n' + avg_msg + '\n' + max_msg + '\n' + ping_stat_msg #checking packet loss compliance packetLossOK = True - if packetloss is not None: + if (packetloss is not None) : if float(packetloss) > float(self.ping_packetloss_threshold): qMsg += '\nPacket Loss too high' logging.debug('\u001B[1;37;41m Packet Loss too high; Target: '+ self.ping_packetloss_threshold + '%\u001B[0m') @@ -1728,6 +1765,7 @@ class OaiCiTest(): lock.release() SSH.close() except: + logging.debug('exit from Ping_Common except') os.kill(os.getppid(),signal.SIGUSR1) def PingNoS1_wrong_exit(self, qMsg,HTML): @@ -1855,11 +1893,21 @@ class OaiCiTest(): HTML.CreateHtmlTestRow(self.ping_args, 'KO', CONST.UE_IP_ADDRESS_ISSUE) self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS) return - else: - self.UEIPAddresses=[] - Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) - Module_UE.GetModuleIPAddress() - self.UEIPAddresses.append(Module_UE.UEIPAddress) + else: #if an ID is specified, it is a UE from the yaml infrastructure file + ue_kind = InfraUE.ci_ue_infra[self.ue_id]['Kind'] + logging.debug("Detected UE Kind : " + ue_kind) + + if ue_kind == 'quectel': + self.UEIPAddresses=[] + Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) + Module_UE.GetModuleIPAddress() + self.UEIPAddresses.append(Module_UE.UEIPAddress) + elif ue_kind == 'amarisoft': + self.UEIPAddresses=['AS UE IP'] + Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) + else: + logging.debug("Incorrect UE Kind was detected") + logging.debug(self.UEIPAddresses) multi_jobs = [] i = 0 @@ -1870,6 +1918,7 @@ class OaiCiTest(): device_id = self.UEDevices[i] else: device_id = Module_UE.ID + "-" + Module_UE.Kind + logging.debug(device_id) p = Process(target = self.Ping_common, args = (lock,UE_IPAddress,device_id,status_queue,EPC,Module_UE,RAN,)) p.daemon = True p.start() @@ -3447,16 +3496,23 @@ class OaiCiTest(): job.join() HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK) else: #if an ID is specified, it is a module from the yaml infrastructure file - Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) - Module_UE.ue_trace=ue_trace - Module_UE.Command("detach") - Module_UE.DisableTrace() - Module_UE.DisableCM() - archive_destination=Module_UE.LogCollect() - if Module_UE.ue_trace=='yes': - HTML.CreateHtmlTestRow('QLog at : '+archive_destination, 'OK', CONST.ALL_PROCESSES_OK) + ue_kind = InfraUE.ci_ue_infra[self.ue_id]['Kind'] + logging.debug("Detected UE Kind : " + ue_kind) + if ue_kind == 'quectel': + Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id]) + Module_UE.ue_trace=ue_trace + Module_UE.Command("detach") + Module_UE.DisableTrace() + Module_UE.DisableCM() + archive_destination=Module_UE.LogCollect() + if Module_UE.ue_trace=='yes': + HTML.CreateHtmlTestRow('QLog at : '+archive_destination, 'OK', CONST.ALL_PROCESSES_OK) + else: + HTML.CreateHtmlTestRow('QLog trace is disabled', 'OK', CONST.ALL_PROCESSES_OK) + elif ue_kind == 'amarisoft': + HTML.CreateHtmlTestRow('AS UE is already terminated', 'OK', CONST.ALL_PROCESSES_OK) else: - HTML.CreateHtmlTestRow('QLog trace is disabled', 'OK', CONST.ALL_PROCESSES_OK) + logging.debug("Incorrect UE Kind was detected") def TerminateOAIUE(self,HTML,RAN,COTS_UE,EPC,InfraUE,CONTAINERS): SSH = sshconnection.SSHConnection() diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf new file mode 100644 index 0000000000..0feb0bb811 --- /dev/null +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf @@ -0,0 +1,308 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_CU_ID = 0xe00; + +# cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({ + mcc = 208; + mnc = 97; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x010203; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + }); + + nr_cellid = 12345678L + +# tr_s_preference = "local_mac" + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 2; + ul_prbblacklist = "51,52,53,54" + do_SRS = 1; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 11; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6 + #absoluteFrequencySSB = 620640; + # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68 + absoluteFrequencySSB = 621312; + # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2 + #absoluteFrequencySSB = 634080; + # this is 3600.48 MHz + #absoluteFrequencySSB = 640032; + #dl_frequencyBand = 78; + # this is 3301.68 MHz + #dl_absoluteFrequencyPointA = 620112; + # this is 3300.60 MHz + dl_absoluteFrequencyPointA = 620040; + # this is 3502.56 MHz + #dl_absoluteFrequencyPointA = 633552; + # this is 3600.48 MHz + #dl_absoluteFrequencyPointA = 640032; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 11; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 12; + preambleReceivedTargetPower = -104; +#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 = 3; +#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; + }; + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR"; + GNB_INTERFACE_NAME_FOR_NGU = "em1"; + GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; +# pusch_TargetSNRx10 = 200; +# pucch_TargetSNRx10 = 150; + ulsch_max_frame_inactivity = 0; + } +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + thread_pool_size = 8; + prach_dtx_threshold = 120; +# pucch0_dtx_threshold = 150; +} +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 2 + nb_rx = 2 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + ##beamforming 1x4 matrix: 1 layer x 4 antennas + #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000]; + ## beamforming 2x2 matrix: + # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff]; + ## beamforming 4x4 matrix: + #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; + sf_extension = 0 + sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +#security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 +# ciphering_algorithms = ( "nea2" ); + + # 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"; + f1ap_log_level ="debug"; + }; diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py index 9ed9f06d8e..0fc37d4ead 100644 --- a/ci-scripts/epc.py +++ b/ci-scripts/epc.py @@ -66,6 +66,8 @@ class EPCManagement(): self.mmeConfFile = 'mme.conf' self.yamlPath = '' self.isMagmaUsed = False + self.cfgDeploy = '--type start-mini --fqdn yes --scenario 1 --capture /tmp/oai-cn5g-v1.3.pcap' #from xml, 'mini' is default normal for docker-network.py + self.cfgUnDeploy = '--type stop-mini --fqdn yes --scenario 1' #from xml, 'mini' is default normal for docker-network.py #----------------------------------------------------------- @@ -251,8 +253,8 @@ class EPCManagement(): logging.debug('Starting OAI CN5G') mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5) mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) - mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5) - mySSH.command('./core-network.sh start nrf spgwu', '\$', 60) + mySSH.command('cd /opt/oai-cn5g-fed-v1.3/docker-compose', '\$', 5) + mySSH.command('python3 ./core-network.py '+self.cfgDeploy, '\$', 60) time.sleep(2) mySSH.command('docker-compose -p 5gcn ps -a', '\$', 60) if mySSH.getBefore().count('Up (healthy)') != 6: @@ -530,8 +532,8 @@ class EPCManagement(): mySSH.command('docker logs ' + c + ' > ' + self.SourceCodePath + '/logs/' + c + '.log', '\$', 5) logging.debug('Terminating OAI CN5G') - mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5) - mySSH.command('./core-network.sh stop nrf spgwu', '\$', 60) + mySSH.command('cd /opt/oai-cn5g-fed-v1.3/docker-compose', '\$', 5) + mySSH.command('python3 ./core-network.py '+self.cfgUnDeploy, '\$', 60) mySSH.command('docker volume prune --force || true', '\$', 60) time.sleep(2) mySSH.command('tshark -r /tmp/oai-cn5g.pcap | egrep --colour=never "Tracking area update" ','\$', 30) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 5357a90a3d..ad9d97b787 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -376,6 +376,16 @@ def GetParametersFromXML(action): if (string_field is not None): EPC.yamlPath = string_field + elif action == 'Initialize_5GCN': + string_field = test.findtext('args') + if (string_field is not None): + EPC.cfgDeploy = string_field + + elif action == 'Terminate_5GCN': + string_field = test.findtext('args') + if (string_field is not None): + EPC.cfgUnDeploy = string_field + elif action == 'Deploy_Object' or action == 'Undeploy_Object': eNB_instance=test.findtext('eNB_instance') if (eNB_instance is None): diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py index d5b4a4c83e..dca3daa817 100644 --- a/ci-scripts/sshconnection.py +++ b/ci-scripts/sshconnection.py @@ -56,6 +56,7 @@ class SSHConnection(): self.picocom_closure = True def open(self, ipaddress, username, password): + prompt = "#" if username == "root" else "\$" count = 0 connect_status = False while count < 4: @@ -68,7 +69,7 @@ class SSHConnection(): self.sshresponse = self.ssh.expect(['password:', username + '@']) if self.sshresponse == 0: self.ssh.sendline(password) - self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) + self.sshresponse = self.ssh.expect([prompt, 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) if self.sshresponse == 0: count = 10 connect_status = True @@ -76,7 +77,7 @@ class SSHConnection(): logging.debug('self.sshresponse = ' + str(self.sshresponse)) elif self.sshresponse == 1: self.ssh.sendline(password) - self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) + self.sshresponse = self.ssh.expect([prompt, 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT]) if self.sshresponse == 0: count = 10 connect_status = True @@ -84,7 +85,7 @@ class SSHConnection(): logging.debug('self.sshresponse = ' + str(self.sshresponse)) elif self.sshresponse == 2: # Checking if we are really on the remote client defined by its IP address - self.command('stdbuf -o0 ifconfig | egrep --color=never "inet addr:|inet "', '\$', 5) + self.command('stdbuf -o0 ifconfig | egrep --color=never "inet addr:|inet "', prompt, 5) result = re.search(str(ipaddress), str(self.ssh.before)) if result is None: self.close() @@ -100,7 +101,7 @@ class SSHConnection(): time.sleep(1) count += 1 if connect_status: - self.command('unset HISTFILE', '\$', 5, silent=True) + self.command('unset HISTFILE', prompt, 5, silent=True) else: sys.exit('SSH Connection Failed') self.ipaddress = ipaddress diff --git a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml new file mode 100644 index 0000000000..68df2873d9 --- /dev/null +++ b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml @@ -0,0 +1,87 @@ + + + TEST-SA-FR1-Tab1 + SA Ping DL UL with 1 AS UE + tasks + 1 + + 040000 + 000001 + 010000 + 000002 + 050000 + 080000 + + + + + Initialize_UE + Initialize Amarisoft UE 1x + amarisoft_ue_1 + + + + + Initialize_eNB + Initialize gNB + -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf --sa -q --usrp-tx-thread-config 1 --T_stdout 2 --log_config.global_log_options level,nocolor,time + 0 + 0 + nr + yes + yes + datalog_rt_stats.2x2.yaml + 192.168.18.252 + + + + Ping + Ping from AS UEc + amarisoft_ue_1 + 1 + + + + IdleSleep + Sleep + 60 + + + + IdleSleep + Sleep + 20 + + + + + Terminate_eNB + Terminate gNB + 0 + 0 + nr + + + + diff --git a/ci-scripts/xml_files/sa_cn5g_asue_closure.xml b/ci-scripts/xml_files/sa_cn5g_asue_closure.xml new file mode 100644 index 0000000000..b856134e36 --- /dev/null +++ b/ci-scripts/xml_files/sa_cn5g_asue_closure.xml @@ -0,0 +1,38 @@ + + + cn5g-closure + CN5G-Closure + log-out + +060000 + + + + + Terminate_5GCN + Terminate 5G Core + --type stop-mini-as-ue --fqdn yes --scenario 1 + + + diff --git a/ci-scripts/xml_files/sa_cn5g_asue_start.xml b/ci-scripts/xml_files/sa_cn5g_asue_start.xml new file mode 100644 index 0000000000..740022b1c9 --- /dev/null +++ b/ci-scripts/xml_files/sa_cn5g_asue_start.xml @@ -0,0 +1,39 @@ + + + cn5g-start-tab + CN5G-Start + log-in + + 000100 + + + + + + Initialize_5GCN + Initialize 5G Core + --type start-mini-as-ue --fqdn yes --scenario 1 --capture /tmp/oai-cn5g-v1.3.pcap + + + From a4c8fe029a1c0fedbf10514704f517bc63ece048 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Tue, 5 Apr 2022 15:28:23 +0530 Subject: [PATCH 776/883] Fixing bad memory allocation and initialization This (sometimes) corrupts PBCH channel estimates leading to false time synchronization of received samples. --- .../PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c | 3 ++- .../nr_dl_channel_estimation.c | 22 ++++++++++--------- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 13 ++++++----- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 10 +++++---- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c index f4f183793f..045197adc1 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c @@ -36,7 +36,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms, PHY_VARS_NR_UE *ue, module_id_t gNB_id, - const int estimateSz, struct complex16 dl_ch_estimates_time[][estimateSz], + const int estimateSz, + struct complex16 dl_ch_estimates_time[][estimateSz], uint8_t frame, uint8_t subframe, unsigned char clear, diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 96709b91a1..7a6309c5ca 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -197,9 +197,9 @@ int nr_pbch_dmrs_correlation(PHY_VARS_NR_UE *ue, int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, - int estimateSz, - struct complex16 dl_ch_estimates [][estimateSz], - struct complex16 dl_ch_estimates_time [][estimateSz], + int estimateSz, + struct complex16 dl_ch_estimates [][estimateSz], + struct complex16 dl_ch_estimates_time [][ue->frame_parms.ofdm_symbol_size], UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, unsigned char Ns, @@ -320,7 +320,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset]; - memset(dl_ch,0,sizeof(*dl_ch)*(ue->frame_parms.ofdm_symbol_size)); + memset(dl_ch,0,sizeof(struct complex16)*(ue->frame_parms.ofdm_symbol_size)); #ifdef DEBUG_CH printf("pbch ch est pilot addr %p RB_DL %d\n",&pilot[0], ue->frame_parms.N_RB_DL); @@ -387,10 +387,10 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, // in 2nd symbol, skip middle REs (48 with DMRS, 144 for SSS, and another 48 with DMRS) if (dmrss == 1 && pilot_cnt == 12) { - pilot_cnt=48; - re_offset = (re_offset+144) % ue->frame_parms.ofdm_symbol_size; - rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; - dl_ch += 288; + pilot_cnt=48; + re_offset = (re_offset+144) % ue->frame_parms.ofdm_symbol_size; + rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+re_offset)]; + dl_ch += 288; } ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); @@ -452,10 +452,12 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue, (int16_t*) &dl_ch_estimates[aarx][ch_offset], (int16_t*) dl_ch_estimates_time[aarx], 1); -} -} + } + } + if (dmrss == 2) UEscopeCopy(ue, pbchDlChEstimateTime, (void*)dl_ch_estimates_time, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx, idftsizeidx); + return(0); } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index ac918b4f3e..a48bc1b58d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -146,23 +146,26 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini start_meas(&ue->dlsch_channel_estimation_stats); // computing channel estimation for selected best ssb - const int estimateSz=7*2*frame_parms->ofdm_symbol_size; + const int estimateSz = frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size; __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[frame_parms->nb_antennas_rx][estimateSz]; - __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[frame_parms->nb_antennas_rx][frame_parms->ofdm_symbol_size]; + for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf); + stop_meas(&ue->dlsch_channel_estimation_stats); fapiPbch_t result; ret = nr_rx_pbch(ue, proc, - estimateSz, dl_ch_estimates, - ue->pbch_vars[0], + estimateSz, + dl_ch_estimates, + ue->pbch_vars[0], frame_parms, 0, temp_ptr->i_ssb, SISO, - &result); + &result); temp_ptr=temp_ptr->next_ssb; } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index ddddcd09e2..d8b866d8ee 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1405,9 +1405,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, if (slot_ssb) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_IN); LOG_D(PHY," ------ PBCH ChannelComp/LLR: frame.slot %d.%d ------ \n", frame_rx%1024, nr_slot_rx); - const int estimateSz=7*2*sizeof(int)*fp->ofdm_symbol_size; + + const int estimateSz = fp->symbols_per_slot * fp->ofdm_symbol_size; __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates[fp->nb_antennas_rx][estimateSz]; - __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][estimateSz]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_time[fp->nb_antennas_rx][fp->ofdm_symbol_size]; + for (int i=1; i<4; i++) { nr_slot_fep(ue, @@ -1415,7 +1417,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, (ue->symbol_offset+i)%(fp->symbols_per_slot), nr_slot_rx); - start_meas(&ue->dlsch_channel_estimation_stats); nr_pbch_channel_estimation(ue, estimateSz, dl_ch_estimates, dl_ch_estimates_time,proc,gNB_id,nr_slot_rx,(ue->symbol_offset+i)%(fp->symbols_per_slot),i-1,(fp->ssb_index)&7,fp->half_frame_bit); stop_meas(&ue->dlsch_channel_estimation_stats); @@ -1433,7 +1434,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, nr_adjust_synch_ue(fp, ue, gNB_id, - estimateSz, dl_ch_estimates_time, + fp->ofdm_symbol_size, + dl_ch_estimates_time, frame_rx, nr_slot_rx, 0, From b245b3b1b65ba70e84b6d9b00fe7319d7d6668b1 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 5 Apr 2022 15:18:55 +0200 Subject: [PATCH 777/883] more logging, copy logs, create HTML row --- ci-scripts/ci_ueinfra.yaml | 9 ++++++++- ci-scripts/cls_amarisoft_ue.py | 6 ++++++ ci-scripts/cls_oaicitest.py | 6 ++++-- ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index e06b0e39b6..9934e57c08 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -53,6 +53,7 @@ amarisoft_ue_1: Config : /root/NV17-12-21/ue/config/oaicicd-ue-Ping-SATest.cfg Duration : 60 Ping : /tmp/test_ue1.log + UELog : /tmp/ue1.log HostIPAddress : 192.168.18.89 HostUsername : root HostPassword : toor @@ -60,6 +61,7 @@ amarisoft_ue_1: #an other scenario example +#notice : this will not work as such, only suggestion for multi ue scenario amarisoft_ue_2: ID: amarisoft_ue_2 State : enabled @@ -71,7 +73,12 @@ amarisoft_ue_2: Cmd : /root/NV17-12-21/ue/lteue Config : /root/NV17-12-21/ue/config/xxxxxxx.cfg #to be updated for an other scenario Duration : 60 - Ping : /tmp/test_ue1.log #to be updated fo an other scenario + Ping : + - /tmp/test_ue1.log #to be updated fo an other scenario + - /tmp/test_ue2.log #could be a list for a multi ue scenario + UELog : + - /tmp/ue1.log + - /tmp/ue1.log HostIPAddress : 192.168.18.89 HostUsername : root HostPassword : toor diff --git a/ci-scripts/cls_amarisoft_ue.py b/ci-scripts/cls_amarisoft_ue.py index 3407ec9046..367bfaac3f 100644 --- a/ci-scripts/cls_amarisoft_ue.py +++ b/ci-scripts/cls_amarisoft_ue.py @@ -67,8 +67,14 @@ class AS_UE: def RunScenario(self): mySSH = sshconnection.SSHConnection() mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword) + + logging.debug("Deleting old artifacts :") + cmd='rm -rf ' + self.Ping + ' ' + self.UELog + mySSH.command(cmd,'#',5) + logging.debug("Running scenario :") cmd='echo $USER; nohup '+self.Cmd + ' ' + self.Config + ' &' mySSH.command(cmd,'#',5) + mySSH.close() diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index ae6a26fc18..ec3455222f 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -469,6 +469,7 @@ class OaiCiTest(): #case it is a amarisoft ue (only 1 at a time supported at the moment) elif ue_kind == 'amarisoft': AS_UE = cls_amarisoft_ue.AS_UE(InfraUE.ci_ue_infra[self.ue_id]) + HTML.CreateHtmlTestRow(AS_UE.Config, 'OK', CONST.ALL_PROCESSES_OK) AS_UE.RunScenario() AS_UE.WaitEndScenario() AS_UE.KillASUE() @@ -1592,7 +1593,6 @@ class OaiCiTest(): #if module, ping from module to EPC if self.ue_id!='': if (re.match('amarisoft', self.ue_id, re.IGNORECASE)): - logging.debug("Ping analysis from amarisoft scenario") launchFromEpc = False launchFromASUE = True else: @@ -1659,8 +1659,10 @@ class OaiCiTest(): elif (launchFromASUE == True): #ping was already executed when running scenario #we only need to retrieve ping log file, whose location is in the ci_ueinfra.yaml - logging.debug("Get Ping log from AS server : " + Module_UE.Ping) + logging.debug("Get logs from AS server : " + Module_UE.Ping + ", " + Module_UE.UELog) SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, Module_UE.Ping, '.') + SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, Module_UE.UELog, '.') + logging.debug("Ping analysis from Amarisoft scenario") path,ping_log_file = os.path.split(Module_UE.Ping) SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword) SSH.command('cat ' + Module_UE.Ping, '\#', 5) diff --git a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml index 68df2873d9..12ed977bb1 100644 --- a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml +++ b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml @@ -37,7 +37,7 @@ Initialize_UE - Initialize Amarisoft UE 1x + Run AS UE Scenario amarisoft_ue_1 From 906b4b9c1e0745a29cb832d5a97d8db7ec984450 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 5 Apr 2022 17:31:56 +0200 Subject: [PATCH 778/883] Tune configs LTE-2x2, NSA-2x2 --- .../conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf | 6 +++--- .../conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 6 +++--- .../conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf | 6 +++--- .../conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 5 +---- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index 2a82181f4c..fe2e031acb 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -211,8 +211,8 @@ MACRLCs = ( bler_target_upper = 20.0; bler_target_lower = 10.0; max_ul_rb_index = 27; - puSch10xSnr = 200; - puCch10xSnr = 150; + puSch10xSnr = 190; + puCch10xSnr = 160; } ); @@ -232,7 +232,7 @@ RUs = ( nb_tx = 2 nb_rx = 2 att_tx = 10 - att_rx = 10; + att_rx = 5; bands = [38]; max_pdschReferenceSignalPower = -27; max_rxgain = 75; diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf index b1b58651e0..a0742c57a6 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -211,8 +211,8 @@ MACRLCs = ( bler_target_upper = 20.0; bler_target_lower = 10.0; max_ul_rb_index = 27; - puSch10xSnr = 200; - puCch10xSnr = 150; + puSch10xSnr = 190; + puCch10xSnr = 160; } ); @@ -232,7 +232,7 @@ RUs = ( nb_tx = 2 nb_rx = 2 att_tx = 10 - att_rx = 10; + att_rx = 5; bands = [38]; max_pdschReferenceSignalPower = -27; max_rxgain = 75; diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index bccd37abe9..480ba3952a 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -211,8 +211,8 @@ MACRLCs = ( bler_target_upper = 20.0; bler_target_lower = 10.0; max_ul_rb_index = 27; - puSch10xSnr = 200; - puCch10xSnr = 150; + puSch10xSnr = 190; + puCch10xSnr = 160; } ); @@ -232,7 +232,7 @@ RUs = ( nb_tx = 2 nb_rx = 2 att_tx = 0 - att_rx = 0; + att_rx = 5; bands = [38]; max_pdschReferenceSignalPower = -27; max_rxgain = 75; diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index 55b1bdb24d..21863dcfc7 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -22,8 +22,6 @@ gNBs = ssb_SubcarrierOffset = 31; //0; pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; - pusch_TargetSNRx10 = 200; - pucch_TargetSNRx10 = 200; ul_prbblacklist = "51,52,53,54" servingCellConfigCommon = ( @@ -239,8 +237,7 @@ RUs = ( 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"; - //parallel_config = "PARALLEL_SINGLE_THREAD"; + parallel_config = "PARALLEL_SINGLE_THREAD"; #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" worker_config = "WORKER_ENABLE"; } From 402b9abb8cd5133e5153b8be557c2e1b6acef1a8 Mon Sep 17 00:00:00 2001 From: hardy Date: Tue, 5 Apr 2022 19:00:48 +0200 Subject: [PATCH 779/883] change ping stage description in xml --- ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml index 12ed977bb1..194ed4e453 100644 --- a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml +++ b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml @@ -57,7 +57,7 @@ Ping - Ping from AS UEc + Ping Log Analysis amarisoft_ue_1 1 From 0a03755f9df6fc43d30fb562fb36a516513048a9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Sun, 3 Apr 2022 19:19:54 +0200 Subject: [PATCH 780/883] Correct gNB fail detection when running in VM --- ci-scripts/runTestOnVM.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 31ffa9d727..74a19de3cd 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -1899,7 +1899,7 @@ function run_test_on_vm { CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log #last argument = 2 is to enable --sa for SA test for 106PRB start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 2 - if [ $NR_UE_SYNC -eq 0 ] + if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] then echo "Problem w/ gNB and NR-UE not syncing" terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 @@ -1982,7 +1982,7 @@ function run_test_on_vm { CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log #last argument = 3 is to enable --sa for SA test for 24PRB start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 3 - if [ $NR_UE_SYNC -eq 0 ] + if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] then echo "Problem w/ gNB and NR-UE not syncing" terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 @@ -2070,7 +2070,7 @@ function run_test_on_vm { CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_ra_fr2_test.log #last argument = 1 is to enable --do-ra for RA test start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1 - if [ $NR_UE_SYNC -eq 0 ] + if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] then echo "Problem w/ gNB and NR-UE not syncing" terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 @@ -2172,7 +2172,7 @@ function run_test_on_vm { CURRENT_NR_UE_LOG_FILE=${TMODE}_${PRB}prb_${CN_CONFIG}_ue_ra_test.log #last argument = 1 is to enable --do-ra for RA test start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1 - if [ $NR_UE_SYNC -eq 0 ] + if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] then echo "Problem w/ gNB and NR-UE not syncing" terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 @@ -2253,7 +2253,7 @@ function run_test_on_vm { echo "############################################################" CURRENT_NR_UE_LOG_FILE=${TMODE}_${PRB}prb_${CN_CONFIG}_ue.log start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 0 - if [ $NR_UE_SYNC -eq 0 ] + if [ $GNB_SYNC -eq 0 ] || [ $NR_UE_SYNC -eq 0 ] then echo "Problem w/ gNB and NR-UE not syncing" terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2 From 276c7be575c7ba75f1ba195581f966df9cf37b4f Mon Sep 17 00:00:00 2001 From: hardy Date: Mon, 4 Apr 2022 13:39:33 +0200 Subject: [PATCH 781/883] fix SYNC_STATUS flag mgt to get the final status correct --- ci-scripts/runTestOnVM.sh | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index 74a19de3cd..2472ffe3bc 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -1939,6 +1939,12 @@ function run_test_on_vm { SA_106PRB_STATUS=0 fi done + #manage SYNC issue after try_cnt + if [ $SYNC_STATUS -ne 0 ] + then + echo "SA 106PRB test NOT OK, NOT SYNC'ED" + SA_106PRB_STATUS=-1 + fi ########### end SA test sleep 30 @@ -2022,6 +2028,12 @@ function run_test_on_vm { SA_24PRB_STATUS=0 fi done + #manage SYNC issue after try_cnt + if [ $SYNC_STATUS -ne 0 ] + then + echo "SA 24PRB test NOT OK, NOT SYNC'ED" + SA_24PRB_STATUS=-1 + fi ########### end SA test sleep 30 @@ -2110,6 +2122,12 @@ function run_test_on_vm { try_cnt=$((try_cnt+10)) fi done + #manage SYNC issue after try_cnt + if [ $SYNC_STATUS -ne 0 ] + then + echo "RA FR2 test NOT OK, NOT SYNC'ED" + RA_FR2_STATUS=-1 + fi ########### end RA FR2 test sleep 30 @@ -2212,6 +2230,13 @@ function run_test_on_vm { try_cnt=$((try_cnt+10)) fi done + #manage SYNC issue after try_cnt + if [ $SYNC_STATUS -ne 0 ] + then + echo "RA FR1 test NOT OK, NOT SYNC'ED" + RA_FR1_STATUS=-1 + fi + done ########### end RA test @@ -2332,6 +2357,13 @@ function run_test_on_vm { try_cnt=$((try_cnt+10)) fi done + #manage SYNC issue after try_cnt + if [ $SYNC_STATUS -ne 0 ] + then + echo "PHY test NOT OK, NOT SYNC'ED" + IPERF_STATUS=-1 + fi + done ######### end of loop full_l2_sim_destroy @@ -2345,7 +2377,6 @@ function run_test_on_vm { if [ $SA_24PRB_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $RA_FR2_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $RA_FR1_STATUS -ne 0 ]; then NR_STATUS=-1; fi - if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $PING_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $IPERF_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $NR_STATUS -eq 0 ] From 1485caa97ef6c6a625d0c4aa6df2a16139e83aeb Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 7 Apr 2022 14:00:19 +0200 Subject: [PATCH 782/883] cleanup of episci config files --- ...pisci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 16 ---------------- .../episci_rcc.band78.tm1.106PRB.nfapi.conf | 15 --------------- ...proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 16 ---------------- .../proxy_rcc.band78.tm1.106PRB.nfapi.conf | 17 ----------------- 4 files changed, 64 deletions(-) diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index e498e2a5c8..40f6f911b1 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -33,9 +33,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - ul_prbblacklist = "51,52,53,54" min_rxtxtime = 6; pdcch_ConfigSIB1 = ( { @@ -127,19 +124,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf index f7e14591a0..eac0b74633 100644 --- a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf @@ -22,10 +22,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 31; //0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { @@ -116,18 +113,6 @@ gNBs = # restrictedSetConfig # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 93835f6a1c..edcd4f06ff 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -33,9 +33,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; - ul_prbblacklist = "51,52,53,54" min_rxtxtime = 6; pdcch_ConfigSIB1 = ( @@ -128,19 +125,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; # used for UL slot - initialULBWPmappingType_0 = 1 - initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 - - initialULBWPk2_1 = 6; # used for mixed slot - initialULBWPmappingType_1 = 1; - initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 - - initialULBWPk2_2 = 7; # used for Msg.3 during RA - initialULBWPmappingType_2 = 1; - initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf index 32248559ce..f61039ff17 100644 --- a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf +++ b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf @@ -22,7 +22,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; min_rxtxtime = 6; servingCellConfigCommon = ( @@ -108,22 +107,6 @@ gNBs = # 0=unrestricted, 1=restricted type A, 2=restricted type B restrictedSetConfig = 0, - # pusch-ConfigCommon (up to 16 elements) - initialULBWPk2_0 = 6; - initialULBWPmappingType_0 = 1 - # this is SS=0 L=11 - initialULBWPstartSymbolAndLength_0 = 55; - - initialULBWPk2_1 = 6; - initialULBWPmappingType_1 = 1; - # this is SS=0 L=12 - initialULBWPstartSymbolAndLength_1 = 69; - - initialULBWPk2_2 = 7; - initialULBWPmappingType_2 = 1; - # this is SS=10 L=4 - initialULBWPstartSymbolAndLength_2 = 52; - msg3_DeltaPreamble = 1; p0_NominalWithGrant =-90; From 5669269ca98ef0f0184fbf8ecb17961f0b5db0b9 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 7 Apr 2022 21:11:56 +0200 Subject: [PATCH 783/883] Harmonize NSA 2x2 and LTE 2x2 eNB configs --- ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index 480ba3952a..dfc9beda71 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -231,7 +231,7 @@ RUs = ( local_rf = "yes" nb_tx = 2 nb_rx = 2 - att_tx = 0 + att_tx = 10 att_rx = 5; bands = [38]; max_pdschReferenceSignalPower = -27; From 4869b109844974c1c2ceccfbfb5a94e2be7b7252 Mon Sep 17 00:00:00 2001 From: Manish Date: Wed, 6 Apr 2022 04:08:13 +0000 Subject: [PATCH 784/883] Second OAI UE added in CI docker validation Signed-off-by: Manish --- ci-scripts/xml_files/container_5g_rfsim.xml | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index bab7f9637a..e0d0bb38a6 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -31,8 +31,11 @@ 000001 000002 000003 + 000004 020001 020002 + 020003 + 020004 030001 030002 100001 @@ -71,6 +74,14 @@ 8 + + DeployGenObject + Deploy Second OAI 5G NR-UE RF sim SA + yaml_files/5g_rfsimulator + oai-nr-ue2 + 8 + + PingFromContainer Ping ext-dn from NR-UE @@ -87,6 +98,22 @@ 5 + + PingFromContainer + Ping ext-dn from Second NR-UE + rfsim5g-oai-nr-ue2 + -I oaitun_ue1 -c 20 192.168.72.135 + 5 + + + + PingFromContainer + Ping Second NR-UE from ext-dn + rfsim5g-oai-ext-dn + -c 20 12.1.1.3 + 5 + + IperfFromContainer Iperf UDP Downlink From 5e1e27699d242e542054c2a44a3e020e2e7f7686 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 8 Apr 2022 10:59:24 +0200 Subject: [PATCH 785/883] fix(ci): the PCAP file was getting too big -- Excluded the 2nd UE container IP address from capture -- Also added support for multiple UEs for dlsch_ulsch_stats Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 50 ++++++++++++--------- ci-scripts/ran.py | 12 ++++- ci-scripts/xml_files/container_5g_rfsim.xml | 2 +- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index d85659568b..e24a0325c3 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -723,9 +723,13 @@ class Containerize(): cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"' networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) if re.search('4g.*rfsimulator', self.yamlPath[0]) is not None: + # Excluding any traffic from LTE-UE container (192.168.61.30) + # From the trf-gen, keeping only PING traffic cmd = 'sudo nohup tshark -f "(host 192.168.61.11 and icmp) or (not host 192.168.61.11 and not host 192.168.61.30 and not arp and not port 53 and not port 2152)"' elif re.search('5g.*rfsimulator', self.yamlPath[0]) is not None: - cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not arp and not port 53 and not port 2152 and not port 2153)"' + # Excluding any traffic from NR-UE containers (192.168.71.150 and 192.168.71.151) + # From the ext-dn, keeping only PING traffic + cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not host 192.168.71.151 and not arp and not port 53 and not port 2152 and not port 2153)"' else: return for name in networkNames.split('\n'): @@ -781,46 +785,48 @@ class Containerize(): # Analyzing log file(s)! listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du'] for container in listOfPossibleRanContainers: - filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' - cmd = 'ls ' + filename + filenames = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' + cmd = 'ls ' + filenames containerStatus = True try: lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - filename = str(lsStatus).strip() + filenames = str(lsStatus).strip() except: containerStatus = False if not containerStatus: continue - logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') - logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers) - if (logStatus < 0): - fullStatus = False - self.exitStatus = 1 - HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) - else: - HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) + for filename in filenames.split('\n'): + logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') + logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers) + if (logStatus < 0): + fullStatus = False + self.exitStatus = 1 + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) + else: + HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) listOfPossibleUeContainers = ['lte-ue*', 'nr-ue*'] for container in listOfPossibleUeContainers: - filename = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' - cmd = 'ls ' + filename + filenames = self.yamlPath[0] + '/rfsim?g-oai-' + container + '.log' + cmd = 'ls ' + filenames containerStatus = True try: lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) - filename = str(lsStatus).strip() + filenames = str(lsStatus).strip() except: containerStatus = False if not containerStatus: continue - logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m') - logStatus = UE.AnalyzeLogFile_UE(filename, HTML, RAN) - if (logStatus < 0): - fullStatus = False - HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus) - else: - HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK) + for filename in filenames.split('\n'): + logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m') + logStatus = UE.AnalyzeLogFile_UE(filename, HTML, RAN) + if (logStatus < 0): + fullStatus = False + HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus) + else: + HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK) cmd = 'rm ' + self.yamlPath[0] + '/*.log' logging.debug(cmd) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index beb89370d2..f29ac405c2 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -999,8 +999,18 @@ class RANManagement(): for k in keys: result = re.search(k, line) if result is not None: + ue_prefix = 'ue0' + ue_res = re.search('UE ID 1|UE 1:', line) + if ue_res is not None: + ue_prefix = 'ue1' + ue_res = re.search('UE ID 2|UE 2:', line) + if ue_res is not None: + ue_prefix = 'ue2' + ue_res = re.search('UE ID 3|UE 3:', line) + if ue_res is not None: + ue_prefix = 'ue3' #remove 1- all useless char before relevant info (ulsch or dlsch) 2- trailing char - dlsch_ulsch_stats[k]=re.sub(r'^.*\]\s+', r'' , line.rstrip()) + dlsch_ulsch_stats[ue_prefix+k]=re.sub(r'^.*\]\s+', r'' , line.rstrip()) #count "problem receiving samples" msg diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml index e0d0bb38a6..a1f50948a5 100644 --- a/ci-scripts/xml_files/container_5g_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_rfsim.xml @@ -79,7 +79,7 @@ Deploy Second OAI 5G NR-UE RF sim SA yaml_files/5g_rfsimulator oai-nr-ue2 - 8 + 9 From 6ad71e290a6e8ae53e436b86c4ce13b06de0f7d3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 8 Apr 2022 11:30:19 +0200 Subject: [PATCH 786/883] Comment unused function that have been introduced in this integration branch --- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 7abc1d33d9..26c60fbb9b 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -68,10 +68,10 @@ queue_t nr_ul_tti_req_queue; static slot_rnti_mcs_s slot_rnti_mcs[NUM_NFAPI_SLOT]; -static int get_mcs_from_sinr(float sinr); -static int get_cqi_from_mcs(void); +//static int get_mcs_from_sinr(float sinr); +//static int get_cqi_from_mcs(void); static void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int sf, int index); -static bool did_drop_transport_block(int slot, uint16_t rnti); +//static bool did_drop_transport_block(int slot, uint16_t rnti); static float get_bler_val(uint8_t mcs, int sinr); static bool should_drop_transport_block(int slot, uint16_t rnti); static void save_pdsch_pdu_for_crnti(nfapi_nr_dl_tti_request_t *dl_tti_request); @@ -1341,6 +1341,7 @@ void RCconfig_nr_ue_L1(void) { } } +/* static int get_mcs_from_sinr(float sinr) { if (sinr < (nr_bler_data[0].bler_table[0][0])) @@ -1369,7 +1370,9 @@ static int get_mcs_from_sinr(float sinr) LOG_E(NR_MAC, "Unable to get an MCS value.\n"); abort(); } +*/ +/* static int get_cqi_from_mcs(void) { static const int mcs_to_cqi[] = {0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, @@ -1399,6 +1402,7 @@ static int get_cqi_from_mcs(void) LOG_E(NR_MAC, "Unable to get CQI value because no MCS found\n"); abort(); } +*/ static void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, int slot, int index) { @@ -1431,6 +1435,7 @@ static void read_channel_param(const nfapi_nr_dl_tti_pdsch_pdu_rel15_t * pdu, in return; } +/* static bool did_drop_transport_block(int slot, uint16_t rnti) { int num_pdus = slot_rnti_mcs[slot].num_pdus; @@ -1450,6 +1455,7 @@ static bool did_drop_transport_block(int slot, uint16_t rnti) } return false; } +*/ static float get_bler_val(uint8_t mcs, int sinr) { From e1b9881c7815f6e4de929b1cb56da939878877bb Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 5 Apr 2022 19:26:05 +0200 Subject: [PATCH 787/883] fix memory errors --- openair1/PHY/INIT/nr_init_ue.c | 32 ++-- openair1/PHY/NR_UE_TRANSPORT/sss_nr.c | 3 + openair1/PHY/TOOLS/oai_dfts.c | 27 ++- openair1/PHY/TOOLS/tools_defs.h | 245 +++++++++++++------------- 4 files changed, 158 insertions(+), 149 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 142ef9b1d9..1417a16819 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -311,11 +311,26 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } // DLSCH - for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { + for (gNB_id = 0; gNB_id < ue->n_connected_gNB+1; gNB_id++) { for (th_id=0; th_idpdsch_vars[th_id][gNB_id] = (NR_UE_PDSCH *)malloc16_clear(sizeof(NR_UE_PDSCH)); } + for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); + } + int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; + for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448 + } + for (i=0; ipdsch_vars[th_id][gNB_id]->layer_llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448 + } + } + } + + for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { for (th_id=0; th_idpdcch_vars[th_id][gNB_id] = (NR_UE_PDCCH *)malloc16_clear(sizeof(NR_UE_PDCCH)); } @@ -342,21 +357,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t)); } - - for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp ); - } - - int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1; - for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448 - } - for (i=0; ipdsch_vars[th_id][gNB_id]->layer_llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448 - } - } - // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); diff --git a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c index dc73fe0add..88585e6094 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c @@ -558,6 +558,9 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, } //#endif + if (Nid1==N_ID_1_NUMBER) + return -1; + int re = 0; int im = 0; d = (int16_t *)&d_sss[Nid2][Nid1]; diff --git a/openair1/PHY/TOOLS/oai_dfts.c b/openair1/PHY/TOOLS/oai_dfts.c index 83207426fd..c266a7f82b 100644 --- a/openair1/PHY/TOOLS/oai_dfts.c +++ b/openair1/PHY/TOOLS/oai_dfts.c @@ -10606,15 +10606,30 @@ int dfts_autoinit(void) #ifndef MR_MAIN -void dft(uint8_t sizeidx, int16_t *sigF,int16_t *sig,unsigned char scale_flag){ - AssertFatal((sizeidx>=0 && sizeidx<(int)DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx); - dft_ftab[sizeidx](sigF,sig,scale_flag); +void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){ + AssertFatal((sizeidx>=0 && sizeidx=0 && sizeidx<(int)IDFT_SIZE_IDXTABLESIZE),"Invalid idft size index %i\n",sizeidx); - idft_ftab[sizeidx](sigF,sig,scale_flag); +void idft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){ + AssertFatal((sizeidx>=0 && sizeidx Date: Fri, 8 Apr 2022 18:22:38 +0200 Subject: [PATCH 788/883] fix code review remarks --- openair1/PHY/INIT/nr_init_ue.c | 6 ++- openair1/PHY/TOOLS/tools_defs.h | 62 ++++++++++++++------------ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 3 ++ 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 1417a16819..fe4eabb34e 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -468,16 +468,18 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } free_and_zero(ue->nr_gold_pdsch[0]); - for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { + for (int gNB_id = 0; gNB_id < ue->n_connected_gNB+1; gNB_id++) { // PDSCH for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { - free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts); free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream); phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp); free_and_zero(ue->pdsch_vars[th_id][gNB_id]); } + } + + for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) { for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { for (int i = 0; i < fp->nb_antennas_rx; i++) { diff --git a/openair1/PHY/TOOLS/tools_defs.h b/openair1/PHY/TOOLS/tools_defs.h index 30327cf689..7cee04fc59 100644 --- a/openair1/PHY/TOOLS/tools_defs.h +++ b/openair1/PHY/TOOLS/tools_defs.h @@ -272,58 +272,64 @@ This function performs optimized fixed-point radix-2 FFT/IFFT. SZ_DEF(36864) \ SZ_DEF(49152) \ SZ_DEF(73728) \ - SZ_DEF(98304) + SZ_DEF(98304) #ifdef OAIDFTS_MAIN -typedef void(*adftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag); -typedef void(*aidftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag); +typedef void(*adftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag); +typedef void(*aidftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag); #define SZ_FUNC(Sz) void dft ## Sz(int16_t *x,int16_t *y,uint8_t scale_flag); - FOREACH_DFTSZ(SZ_FUNC) +FOREACH_DFTSZ(SZ_FUNC) #define SZ_iFUNC(Sz) void idft ## Sz(int16_t *x,int16_t *y,uint8_t scale_flag); - FOREACH_IDFTSZ(SZ_iFUNC) +FOREACH_IDFTSZ(SZ_iFUNC) #else - typedef void(*dftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag); - typedef void(*idftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag); +typedef void(*dftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag); +typedef void(*idftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag); # ifdef OAIDFTS_LOADER - dftfunc_t dft; - idftfunc_t idft; +dftfunc_t dft; +idftfunc_t idft; # else - extern dftfunc_t dft; - extern idftfunc_t idft; - extern int load_dftslib(void); +extern dftfunc_t dft; +extern idftfunc_t idft; +extern int load_dftslib(void); # endif #endif - + #define SZ_ENUM(Sz) DFT_ ## Sz, - typedef enum dft_size_idx { - FOREACH_DFTSZ(SZ_ENUM) - DFT_SIZE_IDXTABLESIZE +typedef enum dft_size_idx { + FOREACH_DFTSZ(SZ_ENUM) + DFT_SIZE_IDXTABLESIZE } dft_size_idx_t; - + #define SZ_iENUM(Sz) IDFT_ ## Sz, - typedef enum idft_size_idx { +typedef enum idft_size_idx { FOREACH_IDFTSZ(SZ_iENUM) IDFT_SIZE_IDXTABLESIZE } idft_size_idx_t; - + #ifdef OAIDFTS_MAIN - + #define SZ_PTR(Sz) {dft ## Sz,Sz}, - struct {adftfunc_t func; int size;} dft_ftab[]={ - FOREACH_DFTSZ(SZ_PTR) - }; +struct { + adftfunc_t func; + int size; +} dft_ftab[]= { + FOREACH_DFTSZ(SZ_PTR) +}; #define SZ_iPTR(Sz) {idft ## Sz,Sz}, - struct {adftfunc_t func; int size;} idft_ftab[]={ - FOREACH_IDFTSZ(SZ_iPTR) - }; +struct { + adftfunc_t func; + int size; +} idft_ftab[]= { + FOREACH_IDFTSZ(SZ_iPTR) +}; #endif @@ -378,7 +384,7 @@ int32_t add_real_vector64(int16_t *x, uint32_t N); int32_t sub_real_vector64(int16_t *x, - int16_t* y, + int16_t *y, int16_t *z, uint32_t N); @@ -435,7 +441,7 @@ int32_t signal_energy_amp_shift(int32_t *input, uint32_t length); /*!\fn int32_t signal_energy(int *,uint32_t); \brief Computes the signal energy per subcarrier */ -int32_t subcarrier_energy(int32_t *,uint32_t, int32_t* subcarrier_energy, uint16_t rx_power_correction); +int32_t subcarrier_energy(int32_t *,uint32_t, int32_t *subcarrier_energy, uint16_t rx_power_correction); #endif /*!\fn int32_t signal_energy_nodc(int32_t *,uint32_t); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 784a71f23f..399033abd0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -519,4 +519,7 @@ bool nr_find_nb_rb(uint16_t Qm, void nr_sr_reporting(int Mod_idP, frame_t frameP, sub_frame_t slotP); void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rsrp); + +void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl); + #endif /*__LAYER2_NR_MAC_PROTO_H__*/ From 1a2be8fc892c3b2f2826ff3fc5c8835f6eec24e8 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Wed, 6 Apr 2022 21:48:01 +0200 Subject: [PATCH 789/883] fix dft modifications related to alignment --- openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h | 2 - .../PHY/LTE_UE_TRANSPORT/ulsch_modulation.c | 45 +++++------ openair1/PHY/MODULATION/slot_fep.c | 2 +- openair1/PHY/TOOLS/oai_dfts.c | 78 +++++++++++-------- openair1/PHY/TOOLS/tools_defs.h | 2 +- 5 files changed, 69 insertions(+), 60 deletions(-) diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h index 6b84a5f969..b4ae44f6ea 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h @@ -155,8 +155,6 @@ typedef struct { uint8_t h[MAX_NUM_CHANNEL_BITS]; /// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14) uint8_t b_tilde[MAX_NUM_CHANNEL_BITS]; - /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14) - int32_t d[MAX_NUM_RE]; /// Transform-coded "z"-sequences (for definition see 36-211 V8.6 2009-03, p.14-15) int32_t z[MAX_NUM_RE]; /// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27) diff --git a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c index 7ec3e7bfb6..6a663e8940 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c @@ -42,7 +42,7 @@ //#define DEBUG_ULSCH_MODULATION -void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb) +void dft_lte(int32_t *z,struct complex16 *input, int32_t Msc_PUSCH, uint8_t Nsymb) { #if defined(__x86_64__) || defined(__i386__) @@ -66,7 +66,7 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb) #endif // printf("Doing lte_dft for Msc_PUSCH %d\n",Msc_PUSCH); - d0 = (uint32_t *)d; + d0 = (uint32_t *)input; d1 = d0+Msc_PUSCH; d2 = d1+Msc_PUSCH; d3 = d2+Msc_PUSCH; @@ -476,7 +476,8 @@ void ulsch_modulation(int32_t **txdataF, // Modulation ulsch_Msymb = G/Q_m; - + /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14) + struct complex16 d[MAX_NUM_RE] __attribute__((aligned(32))); if(ulsch->cooperation_flag == 2) // For Distributed Alamouti Scheme in Collabrative Communication { @@ -488,14 +489,14 @@ void ulsch_modulation(int32_t **txdataF, //UE1, -x1* - ((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (gain_lin_QPSK) : -gain_lin_QPSK; - ((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK; + d[i].r = (ulsch->b_tilde[j] == 1) ? (gain_lin_QPSK) : -gain_lin_QPSK; + d[i].i = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK; // if (id[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]); // UE1, x0* - ((int16_t*)&ulsch->d[i+1])[0] = (ulsch->b_tilde[j-2] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK; - ((int16_t*)&ulsch->d[i+1])[1] = (ulsch->b_tilde[j-1] == 1)? (gain_lin_QPSK) : -gain_lin_QPSK; + d[i+1].r = (ulsch->b_tilde[j-2] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK; + d[i+1].i = (ulsch->b_tilde[j-1] == 1)? (gain_lin_QPSK) : -gain_lin_QPSK; break; @@ -521,8 +522,8 @@ void ulsch_modulation(int32_t **txdataF, qam16_table_offset_im+=1; - ((int16_t*)&ulsch->d[i])[0]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15); - ((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15); + d[i].r =-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15); + d[i].i =(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15); //UE1,x0* qam16_table_offset_re = 0; @@ -544,8 +545,8 @@ void ulsch_modulation(int32_t **txdataF, // ((int16_t*)&ulsch->d[i+1])[0]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15); // ((int16_t*)&ulsch->d[i+1])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15); - ((int16_t*)&ulsch->d[i+1])[0]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15); - ((int16_t*)&ulsch->d[i+1])[1]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15); + d[i+1].r=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15); + d[i+1].i=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15); break; @@ -578,8 +579,8 @@ void ulsch_modulation(int32_t **txdataF, qam64_table_offset_im+=1; - ((int16_t*)&ulsch->d[i])[0]=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15); - ((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15); + d[i].r=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15); + d[i].i=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15); //UE1,x0* qam64_table_offset_re = 0; @@ -605,8 +606,8 @@ void ulsch_modulation(int32_t **txdataF, qam64_table_offset_im+=1; - ((int16_t*)&ulsch->d[i+1])[0]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15); - ((int16_t*)&ulsch->d[i+1])[1]=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15); + d[i+1].r=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15); + d[i+1].i=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15); break; @@ -621,8 +622,8 @@ void ulsch_modulation(int32_t **txdataF, case 2: // TODO: this has to be updated!!! - ((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK; - ((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK; + d[i].r = (ulsch->b_tilde[j] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK; + d[i].i = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK; // if (id[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]); @@ -646,8 +647,8 @@ void ulsch_modulation(int32_t **txdataF, qam16_table_offset_im+=1; - ((int16_t*)&ulsch->d[i])[0]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15); - ((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15); + d[i].r=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15); + d[i].i=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15); // printf("input(16qam) %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]); break; @@ -676,8 +677,8 @@ void ulsch_modulation(int32_t **txdataF, qam64_table_offset_im+=1; - ((int16_t*)&ulsch->d[i])[0]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15); - ((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15); + d[i].r=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15); + d[i].i=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15); break; @@ -688,7 +689,7 @@ void ulsch_modulation(int32_t **txdataF, // Transform Precoding - dft_lte(ulsch->z,ulsch->d,Msc_PUSCH,ulsch->Nsymb_pusch); + dft_lte(ulsch->z,d,Msc_PUSCH,ulsch->Nsymb_pusch); DevAssert(txdataF); diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c index 8f41735f10..b2c7d934c6 100644 --- a/openair1/PHY/MODULATION/slot_fep.c +++ b/openair1/PHY/MODULATION/slot_fep.c @@ -91,7 +91,7 @@ int slot_fep(PHY_VARS_UE *ue, } // subframe_offset_F = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1); - + if (l<0 || l>=7-frame_parms->Ncp) { printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp); return(-1); diff --git a/openair1/PHY/TOOLS/oai_dfts.c b/openair1/PHY/TOOLS/oai_dfts.c index c266a7f82b..c2b6a55210 100644 --- a/openair1/PHY/TOOLS/oai_dfts.c +++ b/openair1/PHY/TOOLS/oai_dfts.c @@ -7082,43 +7082,40 @@ static inline void dft12f(simd_q15_t *x0, simd_q15_t tmp_dft12[12]; - simd_q15_t *tmp_dft12_ptr = &tmp_dft12[0]; - // msg("dft12\n"); bfly4_tw1(x0, x3, x6, x9, - tmp_dft12_ptr, - tmp_dft12_ptr+3, - tmp_dft12_ptr+6, - tmp_dft12_ptr+9); - + tmp_dft12, + tmp_dft12+3, + tmp_dft12+6, + tmp_dft12+9); bfly4_tw1(x1, x4, x7, x10, - tmp_dft12_ptr+1, - tmp_dft12_ptr+4, - tmp_dft12_ptr+7, - tmp_dft12_ptr+10); + tmp_dft12+1, + tmp_dft12+4, + tmp_dft12+7, + tmp_dft12+10); bfly4_tw1(x2, x5, x8, x11, - tmp_dft12_ptr+2, - tmp_dft12_ptr+5, - tmp_dft12_ptr+8, - tmp_dft12_ptr+11); + tmp_dft12+2, + tmp_dft12+5, + tmp_dft12+8, + tmp_dft12+11); // k2=0; - bfly3_tw1(tmp_dft12_ptr, - tmp_dft12_ptr+1, - tmp_dft12_ptr+2, + bfly3_tw1(tmp_dft12, + tmp_dft12+1, + tmp_dft12+2, y0, y4, y8); @@ -7126,9 +7123,9 @@ static inline void dft12f(simd_q15_t *x0, // k2=1; - bfly3(tmp_dft12_ptr+3, - tmp_dft12_ptr+4, - tmp_dft12_ptr+5, + bfly3(tmp_dft12+3, + tmp_dft12+4, + tmp_dft12+5, y1, y5, y9, @@ -7138,9 +7135,9 @@ static inline void dft12f(simd_q15_t *x0, // k2=2; - bfly3(tmp_dft12_ptr+6, - tmp_dft12_ptr+7, - tmp_dft12_ptr+8, + bfly3(tmp_dft12+6, + tmp_dft12+7, + tmp_dft12+8, y2, y6, y10, @@ -7148,9 +7145,9 @@ static inline void dft12f(simd_q15_t *x0, W4_12); // k2=3; - bfly3(tmp_dft12_ptr+9, - tmp_dft12_ptr+10, - tmp_dft12_ptr+11, + bfly3(tmp_dft12+9, + tmp_dft12+10, + tmp_dft12+11, y3, y7, y11, @@ -10607,11 +10604,19 @@ int dfts_autoinit(void) #ifndef MR_MAIN void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){ - AssertFatal((sizeidx>=0 && sizeidx= 0 && sizeidx=0 && sizeidx Date: Thu, 7 Apr 2022 12:05:50 +0200 Subject: [PATCH 790/883] a small out of buffer access, likely only santize addr detection --- openair1/PHY/NR_TRANSPORT/nr_dlsch.c | 81 ++++++++++++++-------------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 47d6c48373..e242f989ea 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -98,7 +98,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers; uint8_t Qm = rel15->qamModOrder[0]; uint32_t encoded_length = nb_re*Qm; - uint32_t scrambled_output[rel15->NrOfCodewords][(encoded_length>>5)+1]; int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16))); /* PTRS */ @@ -147,63 +146,61 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, printf("\n"); #endif - /// scrambling - start_meas(dlsch_scrambling_stats); for (int q=0; qNrOfCodewords; q++) { - memset((void*)scrambled_output[q], 0, ((encoded_length>>5)+1)*sizeof(uint32_t)); + /// scrambling + start_meas(dlsch_scrambling_stats); + uint32_t scrambled_output[(encoded_length>>5)+4]; // modulator acces by 4 bytes in some cases + memset(scrambled_output, 0, sizeof(scrambled_output)); + if ( encoded_length > rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers) abort(); nr_pdsch_codeword_scrambling(output, encoded_length, q, rel15->dataScramblingId, rel15->rnti, - scrambled_output[q]); - } - - stop_meas(dlsch_scrambling_stats); + scrambled_output); #ifdef DEBUG_DLSCH - printf("PDSCH scrambling:\n"); - for (int i=0; i>8; i++) { - for (int j=0; j<8; j++) - printf("0x%08x\t", scrambled_output[0][(i<<3)+j]); - printf("\n"); - } -#endif - - /// Modulation - start_meas(dlsch_modulation_stats); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 1); - for (int q=0; qNrOfCodewords; q++) - nr_modulation(scrambled_output[q], - encoded_length, - Qm, - mod_symbs[q]); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 0); - stop_meas(dlsch_modulation_stats); -#ifdef DEBUG_DLSCH - printf("PDSCH Modulation: Qm %d(%d)\n", Qm, nb_re); - for (int i=0; i>3; i++) { - for (int j=0; j<8; j++) { - printf("%d %d\t", mod_symbs[0][((i<<3)+j)<<1], mod_symbs[0][(((i<<3)+j)<<1)+1]); + printf("PDSCH scrambling:\n"); + for (int i=0; i>8; i++) { + for (int j=0; j<8; j++) + printf("0x%08x\t", scrambled_output[(i<<3)+j]); + printf("\n"); } - printf("\n"); - } #endif + stop_meas(dlsch_scrambling_stats); + /// Modulation + start_meas(dlsch_modulation_stats); + nr_modulation(scrambled_output, + encoded_length, + Qm, + mod_symbs[q]); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 0); + stop_meas(dlsch_modulation_stats); +#ifdef DEBUG_DLSCH + printf("PDSCH Modulation: Qm %d(%d)\n", Qm, nb_re); + for (int i=0; i>3; i++) { + for (int j=0; j<8; j++) { + printf("%d %d\t", mod_symbs[0][((i<<3)+j)<<1], mod_symbs[0][(((i<<3)+j)<<1)+1]); + } + printf("\n"); + } +#endif + } start_meas(&gNB->dlsch_layer_mapping_stats); /// Layer mapping nr_layer_mapping(mod_symbs, - rel15->nrOfLayers, - nb_re, - tx_layers); + rel15->nrOfLayers, + nb_re, + tx_layers); #ifdef DEBUG_DLSCH printf("Layer mapping (%d layers):\n", rel15->nrOfLayers); for (int l=0; lnrOfLayers; l++) for (int i=0; i<(nb_re/rel15->nrOfLayers)>>3; i++) { - printf("layer %d, Re %d..%d : ",l,i<<3,(i<<3)+7); - for (int j=0; j<8; j++) { - printf("l%d %d\t", tx_layers[l][((i<<3)+j)<<1], tx_layers[l][(((i<<3)+j)<<1)+1]); - } - printf("\n"); + printf("layer %d, Re %d..%d : ",l,i<<3,(i<<3)+7); + for (int j=0; j<8; j++) { + printf("l%d %d\t", tx_layers[l][((i<<3)+j)<<1], tx_layers[l][(((i<<3)+j)<<1)+1]); + } + printf("\n"); } #endif @@ -222,7 +219,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, #ifdef DEBUG_DLSCH_MAPPING printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n", - start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); + start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers); #endif start_meas(&gNB->dlsch_resource_mapping_stats); From f2e6537195b2bb553f291c914923da0f7a9f8ecf Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Sun, 10 Apr 2022 22:11:37 +0200 Subject: [PATCH 791/883] roolback regression --- openair1/PHY/defs_UE.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h index a634a0d585..4f9bc076ff 100644 --- a/openair1/PHY/defs_UE.h +++ b/openair1/PHY/defs_UE.h @@ -168,6 +168,19 @@ typedef struct { struct sched_param sched_param_ue; /// pthread descriptor main UE thread pthread_t pthread_ue; + /// \brief Instance count for synch thread. + /// \internal This variable is protected by \ref mutex_synch. + int instance_cnt_synch; + /// pthread attributes for synch processing thread + pthread_attr_t attr_synch; + /// scheduling parameters for synch thread + struct sched_param sched_param_synch; + /// pthread descriptor synch thread + pthread_t pthread_synch; + /// condition variable for UE synch thread; + pthread_cond_t cond_synch; + /// mutex for UE synch thread + pthread_mutex_t mutex_synch; /// instance count for eNBs int instance_cnt_eNBs; /// set of scheduling variables RXn-TXnp4 threads From b860d76cd62ecdb1dba5d8743482cd92c3a2f09e Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 11 Apr 2022 09:39:16 +0200 Subject: [PATCH 792/883] fix lte-ue.c main loop with 5G common vars --- targets/RT/USER/lte-ue.c | 1003 ++++++++++++++++++-------------------- 1 file changed, 482 insertions(+), 521 deletions(-) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 9010a40bf9..8565e36e87 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -87,7 +87,7 @@ extern void multicast_link_start(void (*rx_handlerP) (unsigned int, char *), extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP); -int tx_req_num_elems; +int tx_req_num_elems; extern uint16_t sf_ahead; //extern int tx_req_UE_MAC1(); @@ -176,6 +176,7 @@ PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, { PHY_VARS_UE *ue = (PHY_VARS_UE *)calloc(1,sizeof(PHY_VARS_UE)); AssertFatal(ue,""); + if (frame_parms!=(LTE_DL_FRAME_PARMS *)NULL) { // if we want to give initial frame parms, allocate the PHY_VARS_UE structure and put them in memcpy(&(ue->frame_parms), frame_parms, sizeof(LTE_DL_FRAME_PARMS)); } @@ -204,8 +205,7 @@ void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, - char *name) -{ + char *name) { #ifdef DEADLINE_SCHEDULER if (sched_runtime!=0) { @@ -266,8 +266,7 @@ void init_UE(int nb_inst, runmode_t mode, int rxgain, int txpowermax, - LTE_DL_FRAME_PARMS *fp0) -{ + LTE_DL_FRAME_PARMS *fp0) { PHY_VARS_UE *UE; int inst; int ret; @@ -283,9 +282,7 @@ void init_UE(int nb_inst, if (PHY_vars_UE_g[inst]==NULL) PHY_vars_UE_g[inst] = (PHY_VARS_UE **)calloc(1+MAX_NUM_CCs,sizeof(PHY_VARS_UE *)); LOG_I(PHY,"Allocating UE context %d\n",inst); - PHY_vars_UE_g[inst][0] = init_ue_vars(fp0,inst,0); - // turn off timing control loop in UE PHY_vars_UE_g[inst][0]->no_timing_correction = timing_correction; UE = PHY_vars_UE_g[inst][0]; @@ -362,7 +359,6 @@ void init_UE(int nb_inst, LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); init_UE_threads(inst); - ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]); if (ret !=0) { @@ -385,8 +381,7 @@ void init_UE(int nb_inst, void init_UE_stub_single_thread(int nb_inst, int eMBMS_active, int uecap_xer_in, - char *emul_iface) -{ + char *emul_iface) { int inst; LOG_I(PHY,"UE : Calling Layer 2 for initialization, nb_inst: %d \n", nb_inst); l2_init_ue(eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL, @@ -411,24 +406,23 @@ void init_UE_stub_single_thread(int nb_inst, } } -void init_UE_standalone_thread(int ue_idx) -{ +void init_UE_standalone_thread(int ue_idx) { int standalone_tx_port = 3211 + ue_idx * 2; int standalone_rx_port = 3212 + ue_idx * 2; ue_init_standalone_socket(standalone_tx_port, standalone_rx_port); - pthread_t thread; + if (pthread_create(&thread, NULL, ue_standalone_pnf_task, NULL) != 0) { LOG_E(MAC, "pthread_create failed for calling ue_standalone_pnf_task"); } + pthread_setname_np(thread, "oai:ue-stand"); } void init_UE_stub(int nb_inst, int eMBMS_active, int uecap_xer_in, - char *emul_iface) -{ + char *emul_iface) { int inst; LOG_I(PHY,"UE : Calling Layer 2 for initialization\n"); l2_init_ue(eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL, @@ -462,8 +456,7 @@ void init_UE_stub(int nb_inst, * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ -static void *UE_thread_synch(void *arg) -{ +static void *UE_thread_synch(void *arg) { static int UE_thread_synch_retval; int i ; PHY_VARS_UE *UE = (PHY_VARS_UE *) arg; @@ -478,6 +471,7 @@ static void *UE_thread_synch(void *arg) printf("UE_thread_sync in with PHY_vars_UE %p\n",arg); cpu_set_t cpuset; CPU_ZERO(&cpuset); + if ( threads.sync != -1 ) CPU_SET(threads.sync, &cpuset); @@ -757,8 +751,7 @@ static void *UE_thread_synch(void *arg) * \param arg is a pointer to a \ref PHY_VARS_UE structure. * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ -const char *get_connectionloss_errstr(int errcode) -{ +const char *get_connectionloss_errstr(int errcode) { switch (errcode) { case CONNECTION_LOST: return "RRC Connection lost, returning to PRACH"; @@ -773,8 +766,7 @@ const char *get_connectionloss_errstr(int errcode) return "UNKNOWN RETURN CODE"; } -static void *UE_thread_rxn_txnp4(void *arg) -{ +static void *UE_thread_rxn_txnp4(void *arg) { static __thread int UE_thread_rxtx_retval; struct rx_tx_thread_data *rtd = arg; UE_rxtx_proc_t *proc = rtd->proc; @@ -867,13 +859,11 @@ static void *UE_thread_rxn_txnp4(void *arg) if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) || (UE->frame_parms.frame_type == FDD) ) - if (UE->mode != loop_through_memory) - phy_procedures_UE_TX(UE,proc,0,0,UE->mode); + phy_procedures_UE_TX(UE,proc,0,0,UE->mode); if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) && (UE->frame_parms.frame_type == TDD)) - if (UE->mode != loop_through_memory) - phy_procedures_UE_S_TX(UE,0,0); + phy_procedures_UE_S_TX(UE,0,0); proc->instance_cnt_rxtx--; @@ -895,8 +885,7 @@ static void *UE_thread_rxn_txnp4(void *arg) unsigned int emulator_absSF; void ue_stub_rx_handler(unsigned int num_bytes, - char *rx_buffer) -{ + char *rx_buffer) { PHY_VARS_UE *UE; UE = PHY_vars_UE_g[0][0]; UE_tport_t *pdu = (UE_tport_t *)rx_buffer; @@ -951,14 +940,14 @@ void ue_stub_rx_handler(unsigned int num_bytes, } } -uint64_t clock_usec(void) -{ - struct timespec t; - if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) - { - abort(); - } - return (uint64_t)t.tv_sec * 1000000 + (t.tv_nsec / 1000); +uint64_t clock_usec(void) { + struct timespec t; + + if (clock_gettime(CLOCK_MONOTONIC, &t) == -1) { + abort(); + } + + return (uint64_t)t.tv_sec * 1000000 + (t.tv_nsec / 1000); } /*! * \brief This is the UE thread for RX subframe n and TX subframe n+4. @@ -968,23 +957,21 @@ uint64_t clock_usec(void) * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ -static void *UE_phy_stub_standalone_pnf_task(void *arg) -{ +static void *UE_phy_stub_standalone_pnf_task(void *arg) { #if 1 { struct sched_param sparam = { .sched_priority = 79, }; - if (pthread_setschedparam(pthread_self(), SCHED_RR, &sparam) != 0) - { + + if (pthread_setschedparam(pthread_self(), SCHED_RR, &sparam) != 0) { LOG_E(PHY,"pthread_setschedparam: %s\n", strerror(errno)); } } #else thread_top_init("UE_phy_stub_thread_rxn_txnp4", 1, 870000L, 1000000L, 1000000L); #endif - // for multipule UE's L2-emulator //module_id_t Mod_id = 0; //int init_ra_UE = -1; // This counter is used to initiate the RA of each UE in different SFrames @@ -1004,9 +991,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) PHY_VARS_UE *UE = NULL; int ret; proc = &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0]; - UE = rtd->UE; - UL_INFO = (UL_IND_t *)calloc(1, sizeof(UL_IND_t)); UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = calloc(NFAPI_RX_IND_MAX_PDU, sizeof(nfapi_rx_indication_pdu_t)); UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0; @@ -1019,19 +1004,15 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = calloc(NFAPI_CQI_IND_MAX_PDU, sizeof(nfapi_cqi_indication_pdu_t)); UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = calloc(NFAPI_CQI_IND_MAX_PDU, sizeof(nfapi_cqi_indication_raw_pdu_t)); UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis = 0; - proc->subframe_rx = proc->sub_frame_start; proc->subframe_tx = -1; proc->frame_rx = -1; proc->frame_tx = -1; // Initializations for nfapi-L2-emulator mode sync_var = 0; - //PANOS: CAREFUL HERE! wait_sync("UE_phy_stub_standalone_pnf_task"); - int last_sfn_sf = -1; - LOG_I(MAC, "Clearing Queues\n"); reset_queue(&dl_config_req_tx_req_queue); reset_queue(&ul_config_req_queue); @@ -1039,72 +1020,77 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) while (!oai_exit) { bool sent_any = false; + if (sem_wait(&sfn_semaphore) != 0) { LOG_E(MAC, "sem_wait() error\n"); abort(); } int sfn_sf = current_sfn_sf; - if (sfn_sf == last_sfn_sf) - { + + if (sfn_sf == last_sfn_sf) { LOG_W(MAC, "repeated sfn_sf = %d.%d\n", sfn_sf >> 4, sfn_sf & 15); continue; } - last_sfn_sf = sfn_sf; + last_sfn_sf = sfn_sf; nfapi_dl_config_req_tx_req_t *dl_config_req_tx_req = get_queue(&dl_config_req_tx_req_queue); nfapi_ul_config_request_t *ul_config_req = get_queue(&ul_config_req_queue); nfapi_hi_dci0_request_t *hi_dci0_req = get_queue(&hi_dci0_req_queue); - LOG_I(MAC, "received from proxy frame %d subframe %d\n", NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)); if (ul_config_req != NULL) { uint8_t ul_num_pdus = ul_config_req->ul_config_request_body.number_of_pdus; + if (ul_num_pdus > 0) { char *ul_str = nfapi_ul_config_req_to_string(ul_config_req); LOG_I(MAC, "ul_config_req: %s\n", ul_str); free(ul_str); } } + if (hi_dci0_req != NULL) { LOG_D(MAC, "hi_dci0_req pdus: %u Frame: %d Subframe: %d\n", - hi_dci0_req->hi_dci0_request_body.number_of_dci, - NFAPI_SFNSF2SFN(hi_dci0_req->sfn_sf), NFAPI_SFNSF2SF(hi_dci0_req->sfn_sf)); + hi_dci0_req->hi_dci0_request_body.number_of_dci, + NFAPI_SFNSF2SFN(hi_dci0_req->sfn_sf), NFAPI_SFNSF2SF(hi_dci0_req->sfn_sf)); } if (dl_config_req_tx_req != NULL) { - nfapi_tx_req_pdu_list_t *tx_req_pdu_list = dl_config_req_tx_req->tx_req_pdu_list; nfapi_dl_config_request_t *dl_config_req = dl_config_req_tx_req->dl_config_req; - uint16_t dl_num_pdus = dl_config_req->dl_config_request_body.number_pdu; LOG_I(MAC, "(OAI UE) Received dl_config_req from proxy at Frame: %d, Subframe: %d," " with number of PDUs: %u\n", NFAPI_SFNSF2SFN(dl_config_req->sfn_sf), NFAPI_SFNSF2SF(dl_config_req->sfn_sf), dl_num_pdus); + if (dl_num_pdus > 0) { char *dl_str = nfapi_dl_config_req_to_string(dl_config_req); LOG_I(MAC, "dl_config_req: %s\n", dl_str); free(dl_str); } - LOG_D(MAC, "tx_req pdus: %d\n", tx_req_pdu_list->num_pdus); + LOG_D(MAC, "tx_req pdus: %d\n", tx_req_pdu_list->num_pdus); // Handling dl_config_req and tx_req: nfapi_dl_config_request_body_t *dl_config_req_body = &dl_config_req->dl_config_request_body; + for (int i = 0; i < dl_config_req_body->number_pdu; ++i) { nfapi_dl_config_request_pdu_t *pdu = &dl_config_req_body->dl_config_pdu_list[i]; + if (pdu->pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) { i += 1; AssertFatal(i < dl_config_req->dl_config_request_body.number_pdu, "Need PDU following DCI at index %d, but not found\n", i); nfapi_dl_config_request_pdu_t *dlsch = &dl_config_req_body->dl_config_pdu_list[i]; + if (dlsch->pdu_type != NFAPI_DL_CONFIG_DLSCH_PDU_TYPE) { LOG_E(MAC, "expected DLSCH PDU at index %d\n", i); continue; } + dl_config_req_UE_MAC_dci(NFAPI_SFNSF2SFN(dl_config_req->sfn_sf), NFAPI_SFNSF2SF(dl_config_req->sfn_sf), pdu, @@ -1125,8 +1111,10 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) } } } + if (hi_dci0_req) { nfapi_hi_dci0_request_body_t *hi_dci0_body = &hi_dci0_req->hi_dci0_request_body; + for (int i = 0; i < hi_dci0_body->number_of_dci + hi_dci0_body->number_of_hi; i++) { nfapi_hi_dci0_request_pdu_t *pdu = &hi_dci0_body->hi_dci0_pdu_list[i]; hi_dci0_req_UE_MAC(NFAPI_SFNSF2SFN(hi_dci0_req->sfn_sf), @@ -1139,13 +1127,13 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) for (ue_index = 0; ue_index < ue_num; ue_index++) { ue_Mod_id = ue_thread_id + NB_THREAD_INST * ue_index; // Always 0 in standalone pnf mode UE = PHY_vars_UE_g[ue_Mod_id][0]; - #if UE_TIMING_TRACE start_meas(&UE->generic_stat); #endif int rx_frame = NFAPI_SFNSF2SF(sfn_sf) < 4 ? (NFAPI_SFNSF2SFN(sfn_sf) + 1023) % 1024 : NFAPI_SFNSF2SFN(sfn_sf); // subtracting 4 from subframe_tx int rx_subframe = NFAPI_SFNSF2SF(sfn_sf) < 4 ? NFAPI_SFNSF2SF(sfn_sf) + 6 : NFAPI_SFNSF2SF(sfn_sf) - 4; LOG_D(MAC, "rx_frame %d rx_subframe %d\n", rx_frame, rx_subframe); + if (UE->mac_enabled == 1) { ret = ue_scheduler(ue_Mod_id, rx_frame, @@ -1168,178 +1156,171 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) // Prepare the future Tx data if ((subframe_select(&UE->frame_parms, NFAPI_SFNSF2SF(sfn_sf)) == SF_UL) || - (UE->frame_parms.frame_type == FDD)) - { - if (UE->mode != loop_through_memory) - { - // We make the start of RA between consecutive UEs differ by 20 frames - //if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id == 0) || (UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id>0 && rx_frame >= UE_mac_inst[Mod_id-1].ra_frame + 20) ) { - if (UE_mac_inst[ue_Mod_id].UE_mode[0] == RA_RESPONSE && - is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf))) - { - UE_mac_inst[ue_Mod_id].UE_mode[0] = PRACH; - } - LOG_D(MAC, "UE_mode: %d\n", UE_mac_inst[ue_Mod_id].UE_mode[0]); - if (UE_mac_inst[ue_Mod_id].UE_mode[0] == PRACH) - { //&& ue_Mod_id == next_Mod_id) { - next_ra_frame++; - if (next_ra_frame > 500) - { - // check if we have PRACH opportunity - if (is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) - { - // The one working strangely... - //if (is_prach_subframe(&UE->frame_parms,NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf) && Mod_id == (module_id_t) init_ra_UE) ) { - PRACH_RESOURCES_t *prach_resources = ue_get_rach(ue_Mod_id, 0, NFAPI_SFNSF2SFN(sfn_sf), 0, NFAPI_SFNSF2SF(sfn_sf)); - if (prach_resources != NULL) - { - LOG_I(MAC, "preamble_received_tar_power: %d\n", - prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER); - UE_mac_inst[ue_Mod_id].ra_frame = NFAPI_SFNSF2SFN(sfn_sf); - LOG_D(MAC, "UE_phy_stub_thread_rxn_txnp4 before RACH, Mod_id: %d frame %d subframe %d\n", ue_Mod_id, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)); - fill_rach_indication_UE_MAC(ue_Mod_id, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf), UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI); - sent_any = true; - Msg1_transmitted(ue_Mod_id, 0, NFAPI_SFNSF2SFN(sfn_sf), 0); - UE_mac_inst[ue_Mod_id].UE_mode[0] = RA_RESPONSE; - next_Mod_id = ue_Mod_id + 1; - //next_ra_frame = (rx_frame + 20)%1000; - next_ra_frame = 0; - } - //ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode); + (UE->frame_parms.frame_type == FDD)) { + // We make the start of RA between consecutive UEs differ by 20 frames + //if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id == 0) || (UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id>0 && rx_frame >= UE_mac_inst[Mod_id-1].ra_frame + 20) ) { + if (UE_mac_inst[ue_Mod_id].UE_mode[0] == RA_RESPONSE && + is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf))) { + UE_mac_inst[ue_Mod_id].UE_mode[0] = PRACH; + } + + LOG_D(MAC, "UE_mode: %d\n", UE_mac_inst[ue_Mod_id].UE_mode[0]); + + if (UE_mac_inst[ue_Mod_id].UE_mode[0] == PRACH) { + //&& ue_Mod_id == next_Mod_id) { + next_ra_frame++; + + if (next_ra_frame > 500) { + // check if we have PRACH opportunity + if (is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) { + // The one working strangely... + //if (is_prach_subframe(&UE->frame_parms,NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf) && Mod_id == (module_id_t) init_ra_UE) ) { + PRACH_RESOURCES_t *prach_resources = ue_get_rach(ue_Mod_id, 0, NFAPI_SFNSF2SFN(sfn_sf), 0, NFAPI_SFNSF2SF(sfn_sf)); + + if (prach_resources != NULL) { + LOG_I(MAC, "preamble_received_tar_power: %d\n", + prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER); + UE_mac_inst[ue_Mod_id].ra_frame = NFAPI_SFNSF2SFN(sfn_sf); + LOG_D(MAC, "UE_phy_stub_thread_rxn_txnp4 before RACH, Mod_id: %d frame %d subframe %d\n", ue_Mod_id, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)); + fill_rach_indication_UE_MAC(ue_Mod_id, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf), UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI); + sent_any = true; + Msg1_transmitted(ue_Mod_id, 0, NFAPI_SFNSF2SFN(sfn_sf), 0); + UE_mac_inst[ue_Mod_id].UE_mode[0] = RA_RESPONSE; + next_Mod_id = ue_Mod_id + 1; + //next_ra_frame = (rx_frame + 20)%1000; + next_ra_frame = 0; } + + //ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode); } - } // mode is PRACH - - // Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger - // UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB). - // Generate UL_indications which correspond to UL traffic. - if (ul_config_req != NULL) - { //&& UE_mac_inst[Mod_id].ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL){ - ul_config_req_UE_MAC(ul_config_req, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf), ue_Mod_id); } - } + } // mode is PRACH - phy_procedures_UE_SL_RX(UE, proc); - } - else - { - LOG_I(MAC, "Skipping subframe select statement proxy SFN.SF: %d.%d\n", - NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)); - if (ul_config_req != NULL) - { - LOG_I(MAC, "Skipping subframe select statement ul_config_req SFN.SF: %d.%d\n", - NFAPI_SFNSF2SFN(ul_config_req->sfn_sf), NFAPI_SFNSF2SF(ul_config_req->sfn_sf)); + // Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger + // UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB). + // Generate UL_indications which correspond to UL traffic. + if (ul_config_req != NULL) { + //&& UE_mac_inst[Mod_id].ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL){ + ul_config_req_UE_MAC(ul_config_req, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf), ue_Mod_id); } } - } //for (Mod_id=0; Mod_idcrc_ind.crc_indication_body.number_of_crcs > 0) { - //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf)); - //LOG_I(MAC, "ul_config_req_UE_MAC 2.2, SFN/SF of PNF counter:%d.%d, number_of_crcs: %d \n", timer_frame, timer_subframe, UL_INFO->crc_ind.crc_indication_body.number_of_crcs); - send_standalone_msg(UL_INFO, UL_INFO->crc_ind.header.message_id); - sent_any = true; - //LOG_I(MAC, "ul_config_req_UE_MAC 2.21 \n"); - UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0; - } + phy_procedures_UE_SL_RX(UE, proc); + } else { + LOG_I(MAC, "Skipping subframe select statement proxy SFN.SF: %d.%d\n", + NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)); - if (UL_INFO->rx_ind.rx_indication_body.number_of_pdus > 0) { - - //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf)); - //LOG_I(MAC, "ul_config_req_UE_MAC 2.3, SFN/SF of PNF counter:%d.%d, number_of_pdus: %d \n", timer_frame, timer_subframe, UL_INFO->rx_ind.rx_indication_body.number_of_pdus); - send_standalone_msg(UL_INFO, UL_INFO->rx_ind.header.message_id); - sent_any = true; - - //LOG_I(MAC, "ul_config_req_UE_MAC 2.31 \n"); - UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0; - } - - if (UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis > 0) { - send_standalone_msg(UL_INFO, UL_INFO->cqi_ind.header.message_id); - sent_any = true; - UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis = 0; - } - - if (UL_INFO->harq_ind.harq_indication_body.number_of_harqs > 0) { - //LOG_D(MAC, "ul_config_req_UE_MAC 2.4, SFN/SF of PNF counter:%d.%d, number_of_harqs: %d \n", timer_frame, timer_subframe, UL_INFO->harq_ind.harq_indication_body.number_of_harqs); - send_standalone_msg(UL_INFO, UL_INFO->harq_ind.header.message_id); - sent_any = true; - //LOG_I(MAC, "ul_config_req_UE_MAC 2.41 \n"); - UL_INFO->harq_ind.harq_indication_body.number_of_harqs = 0; - } - - if (UL_INFO->sr_ind.sr_indication_body.number_of_srs > 0) { - //LOG_I(MAC, "ul_config_req_UE_MAC 2.5, SFN/SF of PNF counter:%d.%d, number_of_srs: %d \n", timer_frame, timer_subframe, UL_INFO->sr_ind.sr_indication_body.number_of_srs); - send_standalone_msg(UL_INFO, UL_INFO->sr_ind.header.message_id); - sent_any = true; - //LOG_I(MAC, "ul_config_req_UE_MAC 2.51 \n"); - UL_INFO->sr_ind.sr_indication_body.number_of_srs = 0; - } - - // De-allocate memory of nfapi requests copies before next subframe round - if (dl_config_req_tx_req != NULL) { - if (dl_config_req_tx_req->dl_config_req->vendor_extension != NULL) { - free(dl_config_req_tx_req->dl_config_req->vendor_extension); - dl_config_req_tx_req->dl_config_req->vendor_extension = NULL; + if (ul_config_req != NULL) { + LOG_I(MAC, "Skipping subframe select statement ul_config_req SFN.SF: %d.%d\n", + NFAPI_SFNSF2SFN(ul_config_req->sfn_sf), NFAPI_SFNSF2SF(ul_config_req->sfn_sf)); } - - if (dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list != NULL) { - free(dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list); - dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list = NULL; - } - nfapi_free_tx_req_pdu_list(dl_config_req_tx_req->tx_req_pdu_list); - dl_config_req_tx_req->tx_req_pdu_list = NULL; - - free(dl_config_req_tx_req->dl_config_req); - dl_config_req_tx_req->dl_config_req = NULL; - - free(dl_config_req_tx_req); - dl_config_req_tx_req = NULL; } + } //for (Mod_id=0; Mod_idul_config_request_body.ul_config_pdu_list != NULL) { - free(ul_config_req->ul_config_request_body.ul_config_pdu_list); - ul_config_req->ul_config_request_body.ul_config_pdu_list = NULL; - } - - free(ul_config_req); - ul_config_req = NULL; - } - - if (hi_dci0_req != NULL) { - if (hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list != NULL) { - free(hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list); - hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list = NULL; - } - - free(hi_dci0_req); - hi_dci0_req = NULL; - } - if (!sent_any) - { - send_standalone_dummy(); - } + if (UL_INFO->crc_ind.crc_indication_body.number_of_crcs > 0) { + //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf)); + //LOG_I(MAC, "ul_config_req_UE_MAC 2.2, SFN/SF of PNF counter:%d.%d, number_of_crcs: %d \n", timer_frame, timer_subframe, UL_INFO->crc_ind.crc_indication_body.number_of_crcs); + send_standalone_msg(UL_INFO, UL_INFO->crc_ind.header.message_id); + sent_any = true; + //LOG_I(MAC, "ul_config_req_UE_MAC 2.21 \n"); + UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0; } - // Free UL_INFO messages - free(UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list); - UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = NULL; - free(UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list); - UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = NULL; - free(UL_INFO->sr_ind.sr_indication_body.sr_pdu_list); - UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = NULL; - free(UL_INFO->harq_ind.harq_indication_body.harq_pdu_list); - UL_INFO->harq_ind.harq_indication_body.harq_pdu_list = NULL; - free(UL_INFO->crc_ind.crc_indication_body.crc_pdu_list); - UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = NULL; - free(UL_INFO->rx_ind.rx_indication_body.rx_pdu_list); - UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = NULL; - free(UL_INFO); - UL_INFO = NULL; + if (UL_INFO->rx_ind.rx_indication_body.number_of_pdus > 0) { + //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf)); + //LOG_I(MAC, "ul_config_req_UE_MAC 2.3, SFN/SF of PNF counter:%d.%d, number_of_pdus: %d \n", timer_frame, timer_subframe, UL_INFO->rx_ind.rx_indication_body.number_of_pdus); + send_standalone_msg(UL_INFO, UL_INFO->rx_ind.header.message_id); + sent_any = true; + //LOG_I(MAC, "ul_config_req_UE_MAC 2.31 \n"); + UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0; + } - // thread finished - free(arg); - return NULL; + if (UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis > 0) { + send_standalone_msg(UL_INFO, UL_INFO->cqi_ind.header.message_id); + sent_any = true; + UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis = 0; + } + + if (UL_INFO->harq_ind.harq_indication_body.number_of_harqs > 0) { + //LOG_D(MAC, "ul_config_req_UE_MAC 2.4, SFN/SF of PNF counter:%d.%d, number_of_harqs: %d \n", timer_frame, timer_subframe, UL_INFO->harq_ind.harq_indication_body.number_of_harqs); + send_standalone_msg(UL_INFO, UL_INFO->harq_ind.header.message_id); + sent_any = true; + //LOG_I(MAC, "ul_config_req_UE_MAC 2.41 \n"); + UL_INFO->harq_ind.harq_indication_body.number_of_harqs = 0; + } + + if (UL_INFO->sr_ind.sr_indication_body.number_of_srs > 0) { + //LOG_I(MAC, "ul_config_req_UE_MAC 2.5, SFN/SF of PNF counter:%d.%d, number_of_srs: %d \n", timer_frame, timer_subframe, UL_INFO->sr_ind.sr_indication_body.number_of_srs); + send_standalone_msg(UL_INFO, UL_INFO->sr_ind.header.message_id); + sent_any = true; + //LOG_I(MAC, "ul_config_req_UE_MAC 2.51 \n"); + UL_INFO->sr_ind.sr_indication_body.number_of_srs = 0; + } + + // De-allocate memory of nfapi requests copies before next subframe round + if (dl_config_req_tx_req != NULL) { + if (dl_config_req_tx_req->dl_config_req->vendor_extension != NULL) { + free(dl_config_req_tx_req->dl_config_req->vendor_extension); + dl_config_req_tx_req->dl_config_req->vendor_extension = NULL; + } + + if (dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list != NULL) { + free(dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list); + dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list = NULL; + } + + nfapi_free_tx_req_pdu_list(dl_config_req_tx_req->tx_req_pdu_list); + dl_config_req_tx_req->tx_req_pdu_list = NULL; + free(dl_config_req_tx_req->dl_config_req); + dl_config_req_tx_req->dl_config_req = NULL; + free(dl_config_req_tx_req); + dl_config_req_tx_req = NULL; + } + + if (ul_config_req != NULL) { + if (ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) { + free(ul_config_req->ul_config_request_body.ul_config_pdu_list); + ul_config_req->ul_config_request_body.ul_config_pdu_list = NULL; + } + + free(ul_config_req); + ul_config_req = NULL; + } + + if (hi_dci0_req != NULL) { + if (hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list != NULL) { + free(hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list); + hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list = NULL; + } + + free(hi_dci0_req); + hi_dci0_req = NULL; + } + + if (!sent_any) { + send_standalone_dummy(); + } +} + +// Free UL_INFO messages +free(UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list); +UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = NULL; +free(UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list); +UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = NULL; +free(UL_INFO->sr_ind.sr_indication_body.sr_pdu_list); +UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = NULL; +free(UL_INFO->harq_ind.harq_indication_body.harq_pdu_list); +UL_INFO->harq_ind.harq_indication_body.harq_pdu_list = NULL; +free(UL_INFO->crc_ind.crc_indication_body.crc_pdu_list); +UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = NULL; +free(UL_INFO->rx_ind.rx_indication_body.rx_pdu_list); +UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = NULL; +free(UL_INFO); +UL_INFO = NULL; + +// thread finished +free(arg); +return NULL; } /*! @@ -1350,8 +1331,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ -static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) -{ +static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) { #if 0 // TODO: doesn't currently compile, obviated by multi-ue proxy thread_top_init("UE_phy_stub_thread_rxn_txnp4",1,870000L,1000000L,1000000L); // for multipule UE's L2-emulator @@ -1377,7 +1357,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) proc = &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0]; phy_stub_ticking->num_single_thread[ue_thread_id] = -1; UE = rtd->UE; - UL_INFO = (UL_IND_t *)malloc(sizeof(UL_IND_t)); UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = calloc(NB_UE_INST, sizeof(nfapi_rx_indication_pdu_t)); UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0; @@ -1489,19 +1468,23 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) } if (dl_config_req && tx_req_pdu_list) { - nfapi_dl_config_request_body_t* dl_config_req_body = &dl_config_req->dl_config_request_body; + nfapi_dl_config_request_body_t *dl_config_req_body = &dl_config_req->dl_config_request_body; + for (int i = 0; i < dl_config_req_body->number_pdu; ++i) { - nfapi_dl_config_request_pdu_t* pdu = &dl_config_req_body->dl_config_pdu_list[i]; + nfapi_dl_config_request_pdu_t *pdu = &dl_config_req_body->dl_config_pdu_list[i]; + if (pdu->pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) { i += 1; AssertFatal(i < dl_config_req->dl_config_request_body.number_pdu, "Need PDU following DCI at index %d, but not found\n", i); nfapi_dl_config_request_pdu_t *dlsch = &dl_config_req_body->dl_config_pdu_list[i]; + if (dlsch->pdu_type != NFAPI_DL_CONFIG_DLSCH_PDU_TYPE) { LOG_E(MAC, "expected DLSCH PDU at index %d\n", i); continue; } + dl_config_req_UE_MAC_dci(NFAPI_SFNSF2SFN(dl_config_req->sfn_sf), NFAPI_SFNSF2SF(dl_config_req->sfn_sf), pdu, @@ -1523,8 +1506,9 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) if (hi_dci0_req) { nfapi_hi_dci0_request_body_t *hi_dci0_body = &hi_dci0_req->hi_dci0_request_body; + for (int i = 0; i < hi_dci0_body->number_of_dci + hi_dci0_body->number_of_hi; i++) { - nfapi_hi_dci0_request_pdu_t* pdu = &hi_dci0_body->hi_dci0_pdu_list[i]; + nfapi_hi_dci0_request_pdu_t *pdu = &hi_dci0_body->hi_dci0_pdu_list[i]; hi_dci0_req_UE_MAC(NFAPI_SFNSF2SFN(hi_dci0_req->sfn_sf), NFAPI_SFNSF2SF(hi_dci0_req->sfn_sf), pdu, @@ -1592,44 +1576,41 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) || (UE->frame_parms.frame_type == FDD) ) - if (UE->mode != loop_through_memory) { - // We make the start of RA between consecutive UEs differ by 20 frames - //if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id == 0) || (UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id>0 && proc->frame_rx >= UE_mac_inst[Mod_id-1].ra_frame + 20) ) { - if (UE_mac_inst[ue_Mod_id].UE_mode[0] == PRACH && ue_Mod_id == next_Mod_id) { - next_ra_frame++; - if(next_ra_frame > 500) { - // check if we have PRACH opportunity - if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) { - // The one working strangely... - //if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx && Mod_id == (module_id_t) init_ra_UE) ) { - PRACH_RESOURCES_t *prach_resources = ue_get_rach(ue_Mod_id, 0, proc->frame_tx, 0, proc->subframe_tx); + // We make the start of RA between consecutive UEs differ by 20 frames + //if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id == 0) || (UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id>0 && proc->frame_rx >= UE_mac_inst[Mod_id-1].ra_frame + 20) ) { + if (UE_mac_inst[ue_Mod_id].UE_mode[0] == PRACH && ue_Mod_id == next_Mod_id) { + next_ra_frame++; - if(prach_resources!=NULL ) { - UE_mac_inst[ue_Mod_id].ra_frame = proc->frame_rx; - LOG_D(MAC, "UE_phy_stub_thread_rxn_txnp4 before RACH, Mod_id: %d frame %d subframe %d\n", ue_Mod_id,proc->frame_tx, proc->subframe_tx); - fill_rach_indication_UE_MAC(ue_Mod_id, proc->frame_tx,proc->subframe_tx, UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI); - Msg1_transmitted(ue_Mod_id, 0, proc->frame_tx, 0); - UE_mac_inst[ue_Mod_id].UE_mode[0] = RA_RESPONSE; - next_Mod_id = ue_Mod_id + 1; - //next_ra_frame = (proc->frame_rx + 20)%1000; - next_ra_frame = 0; - } + if(next_ra_frame > 500) { + // check if we have PRACH opportunity + if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) { + // The one working strangely... + //if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx && Mod_id == (module_id_t) init_ra_UE) ) { + PRACH_RESOURCES_t *prach_resources = ue_get_rach(ue_Mod_id, 0, proc->frame_tx, 0, proc->subframe_tx); - //ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode); + if(prach_resources!=NULL ) { + UE_mac_inst[ue_Mod_id].ra_frame = proc->frame_rx; + LOG_D(MAC, "UE_phy_stub_thread_rxn_txnp4 before RACH, Mod_id: %d frame %d subframe %d\n", ue_Mod_id,proc->frame_tx, proc->subframe_tx); + fill_rach_indication_UE_MAC(ue_Mod_id, proc->frame_tx,proc->subframe_tx, UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI); + Msg1_transmitted(ue_Mod_id, 0, proc->frame_tx, 0); + UE_mac_inst[ue_Mod_id].UE_mode[0] = RA_RESPONSE; + next_Mod_id = ue_Mod_id + 1; + //next_ra_frame = (proc->frame_rx + 20)%1000; + next_ra_frame = 0; } + + //ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode); } - } // mode is PRACH - - // Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger - // UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB). - // Generate UL_indications which correspond to UL traffic. - if(ul_config_req!=NULL) { //&& UE_mac_inst[Mod_id].ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL){ - ul_config_req_UE_MAC(ul_config_req, timer_frame, timer_subframe, ue_Mod_id); } - } + } // mode is PRACH - phy_procedures_UE_SL_RX(UE,proc); + // Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger + // UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB). + // Generate UL_indications which correspond to UL traffic. + if(ul_config_req!=NULL) { //&& UE_mac_inst[Mod_id].ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL){ + ul_config_req_UE_MAC(ul_config_req, timer_frame, timer_subframe, ue_Mod_id); + } } //for (Mod_id=0; Mod_idnum_single_thread[ue_thread_id] = -1; @@ -1709,6 +1690,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) tx_req_pdu_list[i].segments[j].segment_data = NULL; } } + tx_req_num_elems = 0; free(tx_req_pdu_list); tx_req_pdu_list = NULL; @@ -1752,7 +1734,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) free(UL_INFO); UL_INFO = NULL; #endif // disabled UE_phy_stub_single_thread_rxn_txnp4 - // thread finished free(arg); return NULL; @@ -1767,9 +1748,8 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) * \returns a pointer to an int. The storage is not on the heap and must not be freed. */ -static void *UE_phy_stub_thread_rxn_txnp4(void *arg) -{ - #if 0 +static void *UE_phy_stub_thread_rxn_txnp4(void *arg) { +#if 0 thread_top_init("UE_phy_stub_thread_rxn_txnp4",1,870000L,1000000L,1000000L); module_id_t Mod_id = 0; static __thread int UE_thread_rxtx_retval; @@ -1880,45 +1860,42 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) || (UE->frame_parms.frame_type == FDD) ) - if (UE->mode != loop_through_memory) { - if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH) ) { - // check if we have PRACH opportunity - if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx)) { - PRACH_RESOURCES_t *prach_resources = ue_get_rach(Mod_id, 0, proc->frame_tx, 0, proc->subframe_tx); + if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH) ) { + // check if we have PRACH opportunity + if (is_prach_subframe(&UE->frame_parms,proc->frame_tx, proc->subframe_tx)) { + PRACH_RESOURCES_t *prach_resources = ue_get_rach(Mod_id, 0, proc->frame_tx, 0, proc->subframe_tx); - if(prach_resources!=NULL) { - fill_rach_indication_UE_MAC(Mod_id, proc->frame_tx,proc->subframe_tx, UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI); - Msg1_transmitted(Mod_id, 0, proc->frame_tx, 0); - UE_mac_inst[Mod_id].UE_mode[0] = RA_RESPONSE; - } - - //ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode); - } - } // mode is PRACH - - // Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger - // UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB). - // Generate UL_indications which correspond to UL traffic. - if(ul_config_req!= NULL && ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) { - //LOG_I(MAC, "UE_phy_stub_thread_rxn_txnp4 ul_config_req is not NULL \n"); - ul_config_req_UE_MAC(ul_config_req, timer_frame, timer_subframe, Mod_id); - - if(ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) { - free(ul_config_req->ul_config_request_body.ul_config_pdu_list); - ul_config_req->ul_config_request_body.ul_config_pdu_list = NULL; + if(prach_resources!=NULL) { + fill_rach_indication_UE_MAC(Mod_id, proc->frame_tx,proc->subframe_tx, UL_INFO, prach_resources->ra_PreambleIndex, prach_resources->ra_RNTI); + Msg1_transmitted(Mod_id, 0, proc->frame_tx, 0); + UE_mac_inst[Mod_id].UE_mode[0] = RA_RESPONSE; } - free(ul_config_req); - ul_config_req = NULL; - } else if(ul_config_req!=NULL) { - free(ul_config_req); - ul_config_req = NULL; + //ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode); } + } // mode is PRACH + + // Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger + // UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB). + // Generate UL_indications which correspond to UL traffic. + if(ul_config_req!= NULL && ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) { + //LOG_I(MAC, "UE_phy_stub_thread_rxn_txnp4 ul_config_req is not NULL \n"); + ul_config_req_UE_MAC(ul_config_req, timer_frame, timer_subframe, Mod_id); + + if(ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) { + free(ul_config_req->ul_config_request_body.ul_config_pdu_list); + ul_config_req->ul_config_request_body.ul_config_pdu_list = NULL; } - phy_procedures_UE_SL_RX(UE,proc); + free(ul_config_req); + ul_config_req = NULL; + } else if(ul_config_req!=NULL) { + free(ul_config_req); + ul_config_req = NULL; + } } - #endif // disabled + +#endif // disabled // thread finished free(arg); return NULL; //return &UE_thread_rxtx_retval; @@ -1940,20 +1917,19 @@ void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) { // struct complex16 v= {0}; void *samplesVoid[UE->frame_parms.nb_antennas_tx]; - + for ( int i=0; i < UE->frame_parms.nb_antennas_tx; i++) samplesVoid[i]=(void *)&v; - + AssertFatal( 1 == UE->rfdevice.trx_write_func(&UE->rfdevice, - timestamp+2*UE->frame_parms.samples_per_tti, - samplesVoid, - 1, - UE->frame_parms.nb_antennas_tx, - 1),""); + timestamp+2*UE->frame_parms.samples_per_tti, + samplesVoid, + 1, + UE->frame_parms.nb_antennas_tx, + 1),""); } -void *UE_thread(void *arg) -{ +void *UE_thread(void *arg) { PHY_VARS_UE *UE = (PHY_VARS_UE *) arg; // int tx_enabled = 0; int dummy_rx[UE->frame_parms.nb_antennas_rx][UE->frame_parms.samples_per_tti] __attribute__((aligned(32))); @@ -1966,10 +1942,11 @@ void *UE_thread(void *arg) int ret; cpu_set_t cpuset; CPU_ZERO(&cpuset); + if ( threads.main != -1 ) CPU_SET(threads.main, &cpuset); - init_thread(100000, 500000, FIFO_PRIORITY, &cpuset, "UHD Threads"); + init_thread(100000, 500000, FIFO_PRIORITY, &cpuset, "UHD Threads"); /* while (sync_var<0) pthread_cond_wait(&sync_cond, &sync_mutex); @@ -1996,46 +1973,45 @@ void *UE_thread(void *arg) int instance_cnt_synch = UE->proc.instance_cnt_synch; int is_synchronized = UE->is_synchronized; AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), ""); - + if (is_synchronized == 0) { if (instance_cnt_synch < 0) { // we can invoke the synch - // we shift in time flow because the UE doesn't detect sync when frame alignment is not easy - for (int i=0; iframe_parms.nb_antennas_rx; i++) - rxp[i] = (void *)&dummy_rx[i][0]; - UE->rfdevice.trx_read_func(&UE->rfdevice, - ×tamp, - rxp, - UE->frame_parms.samples_per_tti/2, - UE->frame_parms.nb_antennas_rx); - + // we shift in time flow because the UE doesn't detect sync when frame alignment is not easy + for (int i=0; iframe_parms.nb_antennas_rx; i++) + rxp[i] = (void *)&dummy_rx[i][0]; + + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + rxp, + UE->frame_parms.samples_per_tti/2, + UE->frame_parms.nb_antennas_rx); + // grab 10 ms of signal and wakeup synch thread - - if (UE->mode != loop_through_memory) { - if (IS_SOFTMODEM_RFSIM ) { - for(int sf=0; sf<10; sf++) { - for (int i=0; iframe_parms.nb_antennas_rx; i++) - rxp[i] = (void *)&UE->common_vars.rxdata[i][UE->frame_parms.samples_per_tti*sf]; - - AssertFatal(UE->frame_parms.samples_per_tti == UE->rfdevice.trx_read_func(&UE->rfdevice, - ×tamp, - rxp, - UE->frame_parms.samples_per_tti, - UE->frame_parms.nb_antennas_rx), ""); - write_dummy(UE, timestamp); - } - } else { - for (int i=0; iframe_parms.nb_antennas_rx; i++) - rxp[i] = (void *)&UE->common_vars.rxdata[i][0]; - - AssertFatal( UE->frame_parms.samples_per_tti*10 == - UE->rfdevice.trx_read_func(&UE->rfdevice, - ×tamp, - rxp, - UE->frame_parms.samples_per_tti*10, - UE->frame_parms.nb_antennas_rx), ""); - } - } + + if (IS_SOFTMODEM_RFSIM ) { + for(int sf=0; sf<10; sf++) { + for (int i=0; iframe_parms.nb_antennas_rx; i++) + rxp[i] = (void *)&UE->common_vars.rxdata[i][UE->frame_parms.samples_per_tti*sf]; + + AssertFatal(UE->frame_parms.samples_per_tti == UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + rxp, + UE->frame_parms.samples_per_tti, + UE->frame_parms.nb_antennas_rx), ""); + write_dummy(UE, timestamp); + } + } else { + for (int i=0; iframe_parms.nb_antennas_rx; i++) + rxp[i] = (void *)&UE->common_vars.rxdata[i][0]; + + AssertFatal( UE->frame_parms.samples_per_tti*10 == + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + rxp, + UE->frame_parms.samples_per_tti*10, + UE->frame_parms.nb_antennas_rx), ""); + } AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), ""); instance_cnt_synch = ++UE->proc.instance_cnt_synch; @@ -2049,69 +2025,62 @@ void *UE_thread(void *arg) AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), ""); } else { -#if OAISIM - (void)dummy_rx; /* avoid gcc warnings */ - usleep(500); -#else // grab 10 ms of signal into dummy buffer - if (UE->mode != loop_through_memory) { - for (int i=0; iframe_parms.nb_antennas_rx; i++) - rxp[i] = (void *)&dummy_rx[i][0]; + for (int i=0; iframe_parms.nb_antennas_rx; i++) + rxp[i] = (void *)&dummy_rx[i][0]; - for (int sf=0; sf<10; sf++) { - // printf("Reading dummy sf %d\n",sf); - UE->rfdevice.trx_read_func(&UE->rfdevice, - ×tamp, - rxp, - UE->frame_parms.samples_per_tti, - UE->frame_parms.nb_antennas_rx); - if (IS_SOFTMODEM_RFSIM ) - write_dummy(UE, timestamp); - } - } -#endif + for (int sf=0; sf<10; sf++) { + // printf("Reading dummy sf %d\n",sf); + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + rxp, + UE->frame_parms.samples_per_tti, + UE->frame_parms.nb_antennas_rx); + + if (IS_SOFTMODEM_RFSIM ) + write_dummy(UE, timestamp); + } } } // UE->is_synchronized==0 else { if (start_rx_stream==0) { start_rx_stream=1; - if (UE->mode != loop_through_memory) { - if (UE->no_timing_correction==0) { - LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode); - while ( UE->rx_offset ) { - size_t s=min(UE->rx_offset,UE->frame_parms.samples_per_tti); - AssertFatal(s == UE->rfdevice.trx_read_func(&UE->rfdevice, - ×tamp, - (void **)UE->common_vars.rxdata, - s, - UE->frame_parms.nb_antennas_rx),""); - if (IS_SOFTMODEM_RFSIM ) - write_dummy(UE, timestamp); - UE->rx_offset-=s; - } + if (UE->no_timing_correction==0) { + LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode); + + while ( UE->rx_offset ) { + size_t s=min(UE->rx_offset,UE->frame_parms.samples_per_tti); + AssertFatal(s == UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + (void **)UE->common_vars.rxdata, + s, + UE->frame_parms.nb_antennas_rx),""); + + if (IS_SOFTMODEM_RFSIM ) + write_dummy(UE, timestamp); + + UE->rx_offset-=s; } + } - UE->rx_offset=0; - UE->time_sync_cell=0; + UE->rx_offset=0; + UE->time_sync_cell=0; - //UE->proc.proc_rxtx[0].frame_rx++; - //UE->proc.proc_rxtx[1].frame_rx++; - for (th_id=0; th_id < RX_NB_TH; th_id++) { - UE->proc.proc_rxtx[th_id].frame_rx++; - } + //UE->proc.proc_rxtx[0].frame_rx++; + //UE->proc.proc_rxtx[1].frame_rx++; + for (th_id=0; th_id < RX_NB_TH; th_id++) { + UE->proc.proc_rxtx[th_id].frame_rx++; + } - // read in first symbol - AssertFatal (UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0 == - UE->rfdevice.trx_read_func(&UE->rfdevice, - ×tamp, - (void **)UE->common_vars.rxdata, - UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0, - UE->frame_parms.nb_antennas_rx),""); - slot_fep(UE,0, 0, 0, 0, 0); - } //UE->mode != loop_through_memory - else - rt_sleep_ns(1000*1000); + // read in first symbol + AssertFatal (UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0 == + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + (void **)UE->common_vars.rxdata, + UE->frame_parms.ofdm_symbol_size+UE->frame_parms.nb_prefix_samples0, + UE->frame_parms.nb_antennas_rx),""); + slot_fep(UE,0, 0, 0, 0, 0); } else { sub_frame++; sub_frame%=10; @@ -2130,7 +2099,8 @@ void *UE_thread(void *arg) pthread_mutex_unlock(&proc->mutex_rxtx); } - usleep(300); + + usleep(300); } LOG_D(PHY,"Process Subframe %d thread Idx %d \n", sub_frame, UE->current_thread_id[sub_frame]); @@ -2139,130 +2109,129 @@ void *UE_thread(void *arg) if(thread_idx>=RX_NB_TH) thread_idx = 0; - if (UE->mode != loop_through_memory) { - for (i=0; iframe_parms.nb_antennas_rx; i++) - rxp[i] = (void *)&UE->common_vars.rxdata[i][UE->frame_parms.ofdm_symbol_size+ - UE->frame_parms.nb_prefix_samples0+ - sub_frame*UE->frame_parms.samples_per_tti]; + for (i=0; iframe_parms.nb_antennas_rx; i++) + rxp[i] = (void *)&UE->common_vars.rxdata[i][UE->frame_parms.ofdm_symbol_size+ + UE->frame_parms.nb_prefix_samples0+ + sub_frame*UE->frame_parms.samples_per_tti]; - for (i=0; iframe_parms.nb_antennas_tx; i++) - txp[i] = (void *)&UE->common_vars.txdata[i][((sub_frame+2)%10)*UE->frame_parms.samples_per_tti]; + for (i=0; iframe_parms.nb_antennas_tx; i++) + txp[i] = (void *)&UE->common_vars.txdata[i][((sub_frame+2)%10)*UE->frame_parms.samples_per_tti]; - int readBlockSize, writeBlockSize; + int readBlockSize, writeBlockSize; - if (sub_frame<9) { - readBlockSize=UE->frame_parms.samples_per_tti; - writeBlockSize=UE->frame_parms.samples_per_tti; - } else { - // set TO compensation to zero - UE->rx_offset_diff = 0; - - // compute TO compensation that should be applied for this frame - - if (UE->no_timing_correction == 0) { - if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti && - UE->rx_offset > 0 ) - UE->rx_offset_diff = -1 ; - - if ( UE->rx_offset > 5*UE->frame_parms.samples_per_tti && - UE->rx_offset < 10*UE->frame_parms.samples_per_tti ) - UE->rx_offset_diff = 1; - } - - LOG_D(PHY,"AbsSubframe %d.%d SET rx_off_diff to %d rx_offset %d \n",proc->frame_rx,sub_frame,UE->rx_offset_diff,UE->rx_offset); - readBlockSize=UE->frame_parms.samples_per_tti - - UE->frame_parms.ofdm_symbol_size - - UE->frame_parms.nb_prefix_samples0 - - UE->rx_offset_diff; - writeBlockSize=UE->frame_parms.samples_per_tti - - UE->rx_offset_diff; - } - - AssertFatal(readBlockSize == - UE->rfdevice.trx_read_func(&UE->rfdevice, - ×tamp, - rxp, - readBlockSize, - UE->frame_parms.nb_antennas_rx),""); - AssertFatal( writeBlockSize == - UE->rfdevice.trx_write_func(&UE->rfdevice, - timestamp+ - (2*UE->frame_parms.samples_per_tti) - - UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 - - openair0_cfg[0].tx_sample_advance, - txp, - writeBlockSize, - UE->frame_parms.nb_antennas_tx, - 1),""); - - if( sub_frame==9) { - // read in first symbol of next frame and adjust for timing drift - int first_symbols=writeBlockSize-readBlockSize; - - if ( first_symbols > 0 ) - AssertFatal(first_symbols == - UE->rfdevice.trx_read_func(&UE->rfdevice, - ×tamp1, - (void **)UE->common_vars.rxdata, - first_symbols, - UE->frame_parms.nb_antennas_rx),""); - - if ( first_symbols <0 ) - LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols); - } - - /* no timeout in IS_SOFTMODEM_RFSIM mode */ - if (IS_SOFTMODEM_RFSIM) { - ret = pthread_mutex_lock(&proc->mutex_rxtx); - } else { - struct timespec tv; - if (clock_gettime(CLOCK_REALTIME, &tv) != 0) { - perror("clock_gettime"); - exit(1); - } - tv.tv_nsec += 10*1000; - if (tv.tv_nsec >= 1000 * 1000 * 1000) { - tv.tv_sec++; - tv.tv_nsec -= 1000 * 1000 * 1000; - } - ret = pthread_mutex_timedlock(&proc->mutex_rxtx, &tv); - } - - // operate on thread sf mod 2 - if (ret != 0) { - if (ret == ETIMEDOUT) { - LOG_E(PHY,"Missed real time\n"); - continue; - } else { - LOG_E(PHY,"System error %s (%d)\n",strerror(errno),errno); - abort(); - } - } - - // usleep(3000); - if(sub_frame == 0) { - //UE->proc.proc_rxtx[0].frame_rx++; - //UE->proc.proc_rxtx[1].frame_rx++; - for (th_id=0; th_id < RX_NB_TH; th_id++) { - UE->proc.proc_rxtx[th_id].frame_rx++; - } - } - - proc->subframe_rx=sub_frame; - proc->subframe_tx=(sub_frame+4)%10; - proc->frame_tx = proc->frame_rx + (proc->subframe_rx>5?1:0); - proc->timestamp_tx = timestamp+ - (4*UE->frame_parms.samples_per_tti)- - UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0; - proc->instance_cnt_rxtx++; - LOG_D( PHY, "[SCHED][UE %d] UE RX instance_cnt_rxtx %d subframe %d !!\n", UE->Mod_id, proc->instance_cnt_rxtx,proc->subframe_rx); - T(T_UE_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx)); - AssertFatal (pthread_cond_signal(&proc->cond_rxtx) ==0,""); - AssertFatal(pthread_mutex_unlock(&proc->mutex_rxtx) ==0,""); + if (sub_frame<9) { + readBlockSize=UE->frame_parms.samples_per_tti; + writeBlockSize=UE->frame_parms.samples_per_tti; } else { - printf("Processing subframe %d",proc->subframe_rx); - getchar(); + // set TO compensation to zero + UE->rx_offset_diff = 0; + + // compute TO compensation that should be applied for this frame + + if (UE->no_timing_correction == 0) { + if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti && + UE->rx_offset > 0 ) + UE->rx_offset_diff = -1 ; + + if ( UE->rx_offset > 5*UE->frame_parms.samples_per_tti && + UE->rx_offset < 10*UE->frame_parms.samples_per_tti ) + UE->rx_offset_diff = 1; + } + + LOG_D(PHY,"AbsSubframe %d.%d SET rx_off_diff to %d rx_offset %d \n",proc->frame_rx,sub_frame,UE->rx_offset_diff,UE->rx_offset); + readBlockSize=UE->frame_parms.samples_per_tti - + UE->frame_parms.ofdm_symbol_size - + UE->frame_parms.nb_prefix_samples0 - + UE->rx_offset_diff; + writeBlockSize=UE->frame_parms.samples_per_tti - + UE->rx_offset_diff; } + + AssertFatal(readBlockSize == + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp, + rxp, + readBlockSize, + UE->frame_parms.nb_antennas_rx),""); + AssertFatal( writeBlockSize == + UE->rfdevice.trx_write_func(&UE->rfdevice, + timestamp+ + (2*UE->frame_parms.samples_per_tti) - + UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 - + openair0_cfg[0].tx_sample_advance, + txp, + writeBlockSize, + UE->frame_parms.nb_antennas_tx, + 1),""); + + if( sub_frame==9) { + // read in first symbol of next frame and adjust for timing drift + int first_symbols=writeBlockSize-readBlockSize; + + if ( first_symbols > 0 ) + AssertFatal(first_symbols == + UE->rfdevice.trx_read_func(&UE->rfdevice, + ×tamp1, + (void **)UE->common_vars.rxdata, + first_symbols, + UE->frame_parms.nb_antennas_rx),""); + + if ( first_symbols <0 ) + LOG_E(PHY,"can't compensate: diff =%d\n", first_symbols); + } + + /* no timeout in IS_SOFTMODEM_RFSIM mode */ + if (IS_SOFTMODEM_RFSIM) { + ret = pthread_mutex_lock(&proc->mutex_rxtx); + } else { + struct timespec tv; + + if (clock_gettime(CLOCK_REALTIME, &tv) != 0) { + perror("clock_gettime"); + exit(1); + } + + tv.tv_nsec += 10*1000; + + if (tv.tv_nsec >= 1000 * 1000 * 1000) { + tv.tv_sec++; + tv.tv_nsec -= 1000 * 1000 * 1000; + } + + ret = pthread_mutex_timedlock(&proc->mutex_rxtx, &tv); + } + + // operate on thread sf mod 2 + if (ret != 0) { + if (ret == ETIMEDOUT) { + LOG_E(PHY,"Missed real time\n"); + continue; + } else { + LOG_E(PHY,"System error %s (%d)\n",strerror(errno),errno); + abort(); + } + } + + // usleep(3000); + if(sub_frame == 0) { + //UE->proc.proc_rxtx[0].frame_rx++; + //UE->proc.proc_rxtx[1].frame_rx++; + for (th_id=0; th_id < RX_NB_TH; th_id++) { + UE->proc.proc_rxtx[th_id].frame_rx++; + } + } + + proc->subframe_rx=sub_frame; + proc->subframe_tx=(sub_frame+4)%10; + proc->frame_tx = proc->frame_rx + (proc->subframe_rx>5?1:0); + proc->timestamp_tx = timestamp+ + (4*UE->frame_parms.samples_per_tti)- + UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0; + proc->instance_cnt_rxtx++; + LOG_D( PHY, "[SCHED][UE %d] UE RX instance_cnt_rxtx %d subframe %d !!\n", UE->Mod_id, proc->instance_cnt_rxtx,proc->subframe_rx); + T(T_UE_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx%1024), T_INT(proc->subframe_rx)); + AssertFatal (pthread_cond_signal(&proc->cond_rxtx) ==0,""); + AssertFatal(pthread_mutex_unlock(&proc->mutex_rxtx) ==0,""); } // start_rx_stream==1 } // UE->is_synchronized==1 } // while !oai_exit @@ -2283,8 +2252,7 @@ void *UE_thread(void *arg) * - UE_thread_dlsch_proc_slot1 * and the locking between them. */ -void init_UE_threads(int inst) -{ +void init_UE_threads(int inst) { struct rx_tx_thread_data *rtd; PHY_VARS_UE *UE; AssertFatal(PHY_vars_UE_g!=NULL,"PHY_vars_UE_g is NULL\n"); @@ -2339,8 +2307,7 @@ void init_UE_threads(int inst) * - UE_thread_dlsch_proc_slot1 * and the locking between them. */ -void init_UE_single_thread_stub(int nb_inst) -{ +void init_UE_single_thread_stub(int nb_inst) { struct rx_tx_thread_data *rtd; PHY_VARS_UE *UE; @@ -2368,8 +2335,8 @@ void init_UE_single_thread_stub(int nb_inst) // In phy_stub_UE mode due to less heavy processing operations we don't need two threads //int nb_threads=RX_NB_TH; int nb_threads=1; + void *(*task_func)(void *); - void* (*task_func)(void*); if (NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) { task_func = UE_phy_stub_standalone_pnf_task; } else { @@ -2413,8 +2380,7 @@ void init_UE_single_thread_stub(int nb_inst) * - UE_thread_dlsch_proc_slot1 * and the locking between them. */ -void init_UE_threads_stub(int inst) -{ +void init_UE_threads_stub(int inst) { struct rx_tx_thread_data *rtd; PHY_VARS_UE *UE; AssertFatal(PHY_vars_UE_g!=NULL,"PHY_vars_UE_g is NULL\n"); @@ -2451,8 +2417,7 @@ void init_UE_threads_stub(int inst) } -void fill_ue_band_info(void) -{ +void fill_ue_band_info(void) { LTE_UE_EUTRA_Capability_t *UE_EUTRA_Capability = UE_rrc_inst[0].UECap->UE_EUTRA_Capability; int i,j; bands_to_scan.nbands = UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.count; @@ -2477,8 +2442,7 @@ void fill_ue_band_info(void) } int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, - openair0_config_t *openair0_cfg) -{ + openair0_config_t *openair0_cfg) { int i, CC_id; LTE_DL_FRAME_PARMS *frame_parms; @@ -2520,8 +2484,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, // playing the role of nfapi-pnf. //02/02/2018 -static void *timer_thread( void *param ) -{ +static void *timer_thread( void *param ) { thread_top_init("timer_thread",1,870000L,1000000L,1000000L); timer_subframe =9; timer_frame =1023; @@ -2647,8 +2610,7 @@ static void *timer_thread( void *param ) } -int init_timer_thread(void) -{ +int init_timer_thread(void) { //PHY_VARS_UE *UE=PHY_vars_UE_g[0]; PHY_VARS_UE *UE=PHY_vars_UE_g[0][0]; phy_stub_ticking = (SF_ticking *)malloc(sizeof(SF_ticking)); @@ -2670,8 +2632,7 @@ int init_timer_thread(void) */ int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB, - find_type_t type) -{ + find_type_t type) { printf("you cannot read this\n"); abort(); } From 9bf8c0e00985bf9f595c16125595c59fa388f1c6 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 11 Apr 2022 10:00:49 +0200 Subject: [PATCH 793/883] config file cleanup --- ci-scripts/conf_files/gNB_SA_CU.conf | 2 -- .../conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf | 1 - ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf | 2 -- 3 files changed, 5 deletions(-) diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf index 33cc3a51a7..9d64ae1976 100644 --- a/ci-scripts/conf_files/gNB_SA_CU.conf +++ b/ci-scripts/conf_files/gNB_SA_CU.conf @@ -45,8 +45,6 @@ gNBs = remote_s_portc = 500; remote_s_portd = 2152; ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; pdcch_ConfigSIB1 = ( diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf index 0feb0bb811..60fb16318f 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf @@ -42,7 +42,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; ul_prbblacklist = "51,52,53,54" do_SRS = 1; diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf index f667959f15..e26fc3030d 100644 --- a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -33,8 +33,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; pdcch_ConfigSIB1 = ( From 421603534c7db096fd7b4c21da302bfb28b712a2 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 11 Apr 2022 10:52:53 +0200 Subject: [PATCH 794/883] fix regression --- targets/RT/USER/lte-ue.c | 204 +++++++++++++++++++-------------------- 1 file changed, 100 insertions(+), 104 deletions(-) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 8565e36e87..2b3a680713 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1203,124 +1203,120 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) { //&& UE_mac_inst[Mod_id].ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL){ ul_config_req_UE_MAC(ul_config_req, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf), ue_Mod_id); } + } else { + LOG_I(MAC, "Skipping subframe select statement proxy SFN.SF: %d.%d\n", + NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)); + + if (ul_config_req != NULL) { + LOG_I(MAC, "Skipping subframe select statement ul_config_req SFN.SF: %d.%d\n", + NFAPI_SFNSF2SFN(ul_config_req->sfn_sf), NFAPI_SFNSF2SF(ul_config_req->sfn_sf)); + } + } + } //for (Mod_id=0; Mod_idcrc_ind.crc_indication_body.number_of_crcs > 0) { + //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf)); + //LOG_I(MAC, "ul_config_req_UE_MAC 2.2, SFN/SF of PNF counter:%d.%d, number_of_crcs: %d \n", timer_frame, timer_subframe, UL_INFO->crc_ind.crc_indication_body.number_of_crcs); + send_standalone_msg(UL_INFO, UL_INFO->crc_ind.header.message_id); + sent_any = true; + //LOG_I(MAC, "ul_config_req_UE_MAC 2.21 \n"); + UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0; + } + + if (UL_INFO->rx_ind.rx_indication_body.number_of_pdus > 0) { + //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf)); + //LOG_I(MAC, "ul_config_req_UE_MAC 2.3, SFN/SF of PNF counter:%d.%d, number_of_pdus: %d \n", timer_frame, timer_subframe, UL_INFO->rx_ind.rx_indication_body.number_of_pdus); + send_standalone_msg(UL_INFO, UL_INFO->rx_ind.header.message_id); + sent_any = true; + //LOG_I(MAC, "ul_config_req_UE_MAC 2.31 \n"); + UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0; + } + + if (UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis > 0) { + send_standalone_msg(UL_INFO, UL_INFO->cqi_ind.header.message_id); + sent_any = true; + UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis = 0; + } + + if (UL_INFO->harq_ind.harq_indication_body.number_of_harqs > 0) { + //LOG_D(MAC, "ul_config_req_UE_MAC 2.4, SFN/SF of PNF counter:%d.%d, number_of_harqs: %d \n", timer_frame, timer_subframe, UL_INFO->harq_ind.harq_indication_body.number_of_harqs); + send_standalone_msg(UL_INFO, UL_INFO->harq_ind.header.message_id); + sent_any = true; + //LOG_I(MAC, "ul_config_req_UE_MAC 2.41 \n"); + UL_INFO->harq_ind.harq_indication_body.number_of_harqs = 0; + } + + if (UL_INFO->sr_ind.sr_indication_body.number_of_srs > 0) { + //LOG_I(MAC, "ul_config_req_UE_MAC 2.5, SFN/SF of PNF counter:%d.%d, number_of_srs: %d \n", timer_frame, timer_subframe, UL_INFO->sr_ind.sr_indication_body.number_of_srs); + send_standalone_msg(UL_INFO, UL_INFO->sr_ind.header.message_id); + sent_any = true; + //LOG_I(MAC, "ul_config_req_UE_MAC 2.51 \n"); + UL_INFO->sr_ind.sr_indication_body.number_of_srs = 0; + } + + // De-allocate memory of nfapi requests copies before next subframe round + if (dl_config_req_tx_req != NULL) { + if (dl_config_req_tx_req->dl_config_req->vendor_extension != NULL) { + free(dl_config_req_tx_req->dl_config_req->vendor_extension); + dl_config_req_tx_req->dl_config_req->vendor_extension = NULL; } - phy_procedures_UE_SL_RX(UE, proc); - } else { - LOG_I(MAC, "Skipping subframe select statement proxy SFN.SF: %d.%d\n", - NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)); - - if (ul_config_req != NULL) { - LOG_I(MAC, "Skipping subframe select statement ul_config_req SFN.SF: %d.%d\n", - NFAPI_SFNSF2SFN(ul_config_req->sfn_sf), NFAPI_SFNSF2SF(ul_config_req->sfn_sf)); + if (dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list != NULL) { + free(dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list); + dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list = NULL; } - } - } //for (Mod_id=0; Mod_idcrc_ind.crc_indication_body.number_of_crcs > 0) { - //LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf)); - //LOG_I(MAC, "ul_config_req_UE_MAC 2.2, SFN/SF of PNF counter:%d.%d, number_of_crcs: %d \n", timer_frame, timer_subframe, UL_INFO->crc_ind.crc_indication_body.number_of_crcs); - send_standalone_msg(UL_INFO, UL_INFO->crc_ind.header.message_id); - sent_any = true; - //LOG_I(MAC, "ul_config_req_UE_MAC 2.21 \n"); - UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0; - } - - if (UL_INFO->rx_ind.rx_indication_body.number_of_pdus > 0) { - //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf)); - //LOG_I(MAC, "ul_config_req_UE_MAC 2.3, SFN/SF of PNF counter:%d.%d, number_of_pdus: %d \n", timer_frame, timer_subframe, UL_INFO->rx_ind.rx_indication_body.number_of_pdus); - send_standalone_msg(UL_INFO, UL_INFO->rx_ind.header.message_id); - sent_any = true; - //LOG_I(MAC, "ul_config_req_UE_MAC 2.31 \n"); - UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0; - } - - if (UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis > 0) { - send_standalone_msg(UL_INFO, UL_INFO->cqi_ind.header.message_id); - sent_any = true; - UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis = 0; - } - - if (UL_INFO->harq_ind.harq_indication_body.number_of_harqs > 0) { - //LOG_D(MAC, "ul_config_req_UE_MAC 2.4, SFN/SF of PNF counter:%d.%d, number_of_harqs: %d \n", timer_frame, timer_subframe, UL_INFO->harq_ind.harq_indication_body.number_of_harqs); - send_standalone_msg(UL_INFO, UL_INFO->harq_ind.header.message_id); - sent_any = true; - //LOG_I(MAC, "ul_config_req_UE_MAC 2.41 \n"); - UL_INFO->harq_ind.harq_indication_body.number_of_harqs = 0; - } - - if (UL_INFO->sr_ind.sr_indication_body.number_of_srs > 0) { - //LOG_I(MAC, "ul_config_req_UE_MAC 2.5, SFN/SF of PNF counter:%d.%d, number_of_srs: %d \n", timer_frame, timer_subframe, UL_INFO->sr_ind.sr_indication_body.number_of_srs); - send_standalone_msg(UL_INFO, UL_INFO->sr_ind.header.message_id); - sent_any = true; - //LOG_I(MAC, "ul_config_req_UE_MAC 2.51 \n"); - UL_INFO->sr_ind.sr_indication_body.number_of_srs = 0; - } - - // De-allocate memory of nfapi requests copies before next subframe round - if (dl_config_req_tx_req != NULL) { - if (dl_config_req_tx_req->dl_config_req->vendor_extension != NULL) { - free(dl_config_req_tx_req->dl_config_req->vendor_extension); - dl_config_req_tx_req->dl_config_req->vendor_extension = NULL; + nfapi_free_tx_req_pdu_list(dl_config_req_tx_req->tx_req_pdu_list); + dl_config_req_tx_req->tx_req_pdu_list = NULL; + free(dl_config_req_tx_req->dl_config_req); + dl_config_req_tx_req->dl_config_req = NULL; + free(dl_config_req_tx_req); + dl_config_req_tx_req = NULL; } - if (dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list != NULL) { - free(dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list); - dl_config_req_tx_req->dl_config_req->dl_config_request_body.dl_config_pdu_list = NULL; + if (ul_config_req != NULL) { + if (ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) { + free(ul_config_req->ul_config_request_body.ul_config_pdu_list); + ul_config_req->ul_config_request_body.ul_config_pdu_list = NULL; + } + + free(ul_config_req); + ul_config_req = NULL; } - nfapi_free_tx_req_pdu_list(dl_config_req_tx_req->tx_req_pdu_list); - dl_config_req_tx_req->tx_req_pdu_list = NULL; - free(dl_config_req_tx_req->dl_config_req); - dl_config_req_tx_req->dl_config_req = NULL; - free(dl_config_req_tx_req); - dl_config_req_tx_req = NULL; - } + if (hi_dci0_req != NULL) { + if (hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list != NULL) { + free(hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list); + hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list = NULL; + } - if (ul_config_req != NULL) { - if (ul_config_req->ul_config_request_body.ul_config_pdu_list != NULL) { - free(ul_config_req->ul_config_request_body.ul_config_pdu_list); - ul_config_req->ul_config_request_body.ul_config_pdu_list = NULL; + free(hi_dci0_req); + hi_dci0_req = NULL; } - free(ul_config_req); - ul_config_req = NULL; - } - - if (hi_dci0_req != NULL) { - if (hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list != NULL) { - free(hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list); - hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list = NULL; + if (!sent_any) { + send_standalone_dummy(); } - - free(hi_dci0_req); - hi_dci0_req = NULL; } - if (!sent_any) { - send_standalone_dummy(); - } -} - -// Free UL_INFO messages -free(UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list); -UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = NULL; -free(UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list); -UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = NULL; -free(UL_INFO->sr_ind.sr_indication_body.sr_pdu_list); -UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = NULL; -free(UL_INFO->harq_ind.harq_indication_body.harq_pdu_list); -UL_INFO->harq_ind.harq_indication_body.harq_pdu_list = NULL; -free(UL_INFO->crc_ind.crc_indication_body.crc_pdu_list); -UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = NULL; -free(UL_INFO->rx_ind.rx_indication_body.rx_pdu_list); -UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = NULL; -free(UL_INFO); -UL_INFO = NULL; - -// thread finished -free(arg); -return NULL; + // Free UL_INFO messages + free(UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list); + UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list = NULL; + free(UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list); + UL_INFO->cqi_ind.cqi_indication_body.cqi_pdu_list = NULL; + free(UL_INFO->sr_ind.sr_indication_body.sr_pdu_list); + UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = NULL; + free(UL_INFO->harq_ind.harq_indication_body.harq_pdu_list); + UL_INFO->harq_ind.harq_indication_body.harq_pdu_list = NULL; + free(UL_INFO->crc_ind.crc_indication_body.crc_pdu_list); + UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = NULL; + free(UL_INFO->rx_ind.rx_indication_body.rx_pdu_list); + UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = NULL; + free(UL_INFO); + UL_INFO = NULL; + // thread finished + free(arg); + return NULL; } /*! From b738f8a6a98976c04c01b8f7a230193523a341fd Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 11 Apr 2022 17:27:11 +0200 Subject: [PATCH 795/883] tackle code review remarks --- executables/nr-softmodem-common.h | 1 - executables/nr-ue.c | 14 ++------------ executables/softmodem-common.h | 1 - targets/RT/USER/lte-ru.c | 5 ++--- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index 47fd816db5..6e36dcf6c7 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -51,7 +51,6 @@ #define CONFIG_HLP_UEFO "set UE to enable estimation and compensation of frequency offset\n" #define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n" #define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n" -#define CONFIG_HLP_UELOOP "get softmodem (UE) to loop through memory instead of acquiring from HW\n" #define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n" #define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n" #define CONFIG_HLP_DMAMAP "sets flag for improved EXMIMO UE performance\n" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index aef0370e53..02e92cbe0b 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -655,14 +655,6 @@ static void UE_synch(void *arg) { openair0_cfg[UE->rf_map.card].tx_freq[0]); UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); - //UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]); - //UE->rfdevice.trx_stop_func(&UE->rfdevice); - // sleep(1); - /*if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { - LOG_E(HW,"Could not start the device\n"); - oai_exit=1; - }*/ - if (UE->UE_scan_carrier == 1) { UE->UE_scan_carrier = 0; } else { @@ -815,9 +807,9 @@ void processSlotRX(void *arg) { void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockSize) { void *dummy_tx[UE->frame_parms.nb_antennas_tx]; - + int16_t dummy_tx_data[UE->frame_parms.nb_antennas_tx][2*writeBlockSize]; // 2 because the function we call use pairs of int16_t implicitly as complex numbers for (int i=0; iframe_parms.nb_antennas_tx; i++) - dummy_tx[i]=malloc16_clear(writeBlockSize*4); + dummy_tx[i]=dummy_tx_data[i]; AssertFatal( writeBlockSize == UE->rfdevice.trx_write_func(&UE->rfdevice, @@ -827,8 +819,6 @@ void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockS UE->frame_parms.nb_antennas_tx, 4),""); - for (int i=0; iframe_parms.nb_antennas_tx; i++) - free(dummy_tx[i]); } void readFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp, bool toTrash) { diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h index 48ce73149f..eb0c1a54f7 100644 --- a/executables/softmodem-common.h +++ b/executables/softmodem-common.h @@ -53,7 +53,6 @@ extern "C" #define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n" -#define CONFIG_HLP_UELOOP "get softmodem (UE) to loop through memory instead of acquiring from HW\n" #define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n" #define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n" #define CONFIG_HLP_SA "run gNB in standalone mode\n" diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index f6cf51f101..c1ffd7a292 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -835,8 +835,9 @@ void tx_rf(RU_t *ru, // in case of rfsim, we always enable tx because we need to feed rx of the opposite side // we write 1 single I/Q sample to trigger Rx (rfsim will fill gaps with 0 I/Q) void *dummy_tx[ru->frame_parms->nb_antennas_tx]; + int16_t dummy_tx_data[ru->frame_parms->nb_antennas_tx][2]; // 2 because the function we call use pairs of int16_t implicitly as complex numbers for (int i=0; iframe_parms->nb_antennas_tx; i++) - dummy_tx[i]=malloc16_clear(4); + dummy_tx[i]= dummy_tx_data[i]; AssertFatal( 1 == ru->rfdevice.trx_write_func(&ru->rfdevice, @@ -846,8 +847,6 @@ void tx_rf(RU_t *ru, ru->frame_parms->nb_antennas_tx, 4),""); - for (int i=0; iframe_parms->nb_antennas_tx; i++) - free(dummy_tx[i]); } } From 4ad71064b8a51176ec4c9536c2173ffda71df708 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 11 Apr 2022 19:29:45 +0200 Subject: [PATCH 796/883] review comments --- openair1/PHY/CODING/nr_rate_matching.c | 8 +-- .../PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 2 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 7 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 13 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 66 ++++--------------- targets/ARCH/rfsimulator/apply_channelmod.c | 3 +- targets/ARCH/rfsimulator/rfsimulator.h | 2 +- 8 files changed, 31 insertions(+), 72 deletions(-) diff --git a/openair1/PHY/CODING/nr_rate_matching.c b/openair1/PHY/CODING/nr_rate_matching.c index fbad79cad7..8c105c37e6 100644 --- a/openair1/PHY/CODING/nr_rate_matching.c +++ b/openair1/PHY/CODING/nr_rate_matching.c @@ -313,14 +313,12 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) switch(Qm) { case 2: { - AssertFatal(E%4==0,""); + AssertFatal(E%2==0,""); int16_t *e1=e+(E/2); - int16_t *end=f+E-3; + int16_t *end=f+E-1; while( fF && pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) + return false; if (s->F) { *mac_subheader_len = sizeof(*l); *mac_ce_len = ntohs(l->L); @@ -128,6 +132,7 @@ static inline void getMacLen(uint8_t* pdu, uint16_t *mac_ce_len, uint16_t *mac_s *mac_subheader_len = sizeof(*s); *mac_ce_len = s->L; } + return true; } // BSR MAC CEs diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 47a6682f63..ab63303629 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3364,13 +3364,14 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, uint8_t rx_lcid = ((NR_MAC_SUBHEADER_FIXED *)pduP)->LCID; LOG_D(MAC, "[UE] LCID %d, PDU length %d\n", rx_lcid, pdu_len); + bool ret; switch(rx_lcid){ // MAC CE case DL_SCH_LCID_CCCH: // MSG4 RRC Setup 38.331 // variable length - getMacLen(pduP, &mac_len, &mac_subheader_len); - AssertFatal(pdu_len > mac_len, "The mac_len (%d) has an invalid size. PDU len = %d! \n", + ret=get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len); + AssertFatal(ret, "The mac_len (%d) has an invalid size. PDU len = %d! \n", mac_len, pdu_len); // Check if it is a valid CCCH message, we get all 00's messages very often @@ -3404,7 +3405,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, // 38.321 Ch6.1.3.14 // varialbe length - getMacLen(pduP, &mac_len, &mac_subheader_len); + get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len); break; case DL_SCH_LCID_RECOMMENDED_BITRATE: @@ -3508,10 +3509,8 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, // check if LCID is valid at current time. default: { - // check if LCID is valid at current time. - if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) - return; - getMacLen(pduP, &mac_len, &mac_subheader_len); + if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) + return; LOG_D(NR_MAC, "[UE %d] %4d.%2d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, slot, rx_lcid, gNB_index, mac_len); #if defined(ENABLE_MAC_PAYLOAD_DEBUG) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 422e40af7e..7e3f6c857a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1426,7 +1426,7 @@ void nr_schedule_ue_spec(module_id_t module_id, /* limit requested number of bytes to what preprocessor specified, or * such that TBS is full */ const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, - bufEnd-buf-+sizeof(NR_MAC_SUBHEADER_LONG)); + bufEnd-buf-sizeof(NR_MAC_SUBHEADER_LONG)); tbs_size_t len = mac_rlc_data_req(module_id, rnti, module_id, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 67ab8aacc5..1955d91af6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -213,6 +213,7 @@ int nr_process_mac_pdu(module_id_t module_idP, int pdu_len) { + uint8_t done = 0; NR_UE_info_t *UE_info = &RC.nrmac[module_idP]->UE_info; @@ -279,16 +280,8 @@ int nr_process_mac_pdu(module_id_t module_idP, to be a partial PDU at the end of this buffer, so here we gracefully ignore that by returning 0. See: https://gitlab.eurecom.fr/oai/openairinterface5g/-/issues/534 */ - if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) - return 0; - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) - return 0; - mac_ce_len= ntohs((NR_MAC_SUBHEADER_LONG *)pduP)->L); - mac_subheader_len = 3; - } + if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) + return 0; /* Extract long BSR value */ ce_ptr = &pduP[mac_subheader_len]; NR_BSR_LONG *bsr_l = (NR_BSR_LONG *) ce_ptr; @@ -362,32 +355,16 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_MULTI_ENTRY_PHR_1_OCT: //38.321 section 6.1.3.9 // varialbe length - if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) - return 0; - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) - return 0; - mac_ce_len = ntohs((NR_MAC_SUBHEADER_LONG *)pduP)->L); - mac_subheader_len = 3; - } + 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: //38.321 section 6.1.3.9 // varialbe length - if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) - return 0; - mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) - return 0; - mac_ce_len = ntohs((NR_MAC_SUBHEADER_LONG *)pduP)->L); - mac_subheader_len = 3; - } + 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 */ break; @@ -398,18 +375,8 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_SRB1: case UL_SCH_LCID_SRB2: - if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) - return 0; - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - //mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) - return 0; - mac_subheader_len = 3; - mac_sdu_len = ntohs(NR_MAC_SUBHEADER_LONG *) pduP)->L); - } else { - mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - } + if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) + return 0; rnti_t crnti = UE_info->rnti[UE_id]; int UE_idx = UE_id; @@ -486,19 +453,8 @@ int nr_process_mac_pdu(module_id_t module_idP, case UL_SCH_LCID_DTCH: // check if LCID is valid at current time. - if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) - return 0; - if (((NR_MAC_SUBHEADER_SHORT *)pduP)->F) { - // mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG)) - return 0; - mac_subheader_len = 3; - mac_sdu_len = ntohs((NR_MAC_SUBHEADER_LONG *)pduP)->L); - - } else { - mac_sdu_len = (NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - } + if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) + return 0; LOG_D(NR_MAC, "In %s: [UE %d] %d.%d : ULSCH -> UL-%s %d (gNB %d, %d bytes)\n", __func__, diff --git a/targets/ARCH/rfsimulator/apply_channelmod.c b/targets/ARCH/rfsimulator/apply_channelmod.c index 6e26120e29..4ff5321e4d 100644 --- a/targets/ARCH/rfsimulator/apply_channelmod.c +++ b/targets/ARCH/rfsimulator/apply_channelmod.c @@ -52,7 +52,8 @@ either we regenerate the channel (call again random_channel(desc,0)), or we keep it over subframes legacy: we regenerate each sub frame in UL, and each frame only in DL */ -void rxAddInput( c16_t *input_sig, c16_t *after_channel_sig, +void rxAddInput( const c16_t *input_sig, + c16_t *after_channel_sig, int rxAnt, channel_desc_t *channelDesc, int nbSamples, diff --git a/targets/ARCH/rfsimulator/rfsimulator.h b/targets/ARCH/rfsimulator/rfsimulator.h index 33583f2d32..e69d41fa6c 100644 --- a/targets/ARCH/rfsimulator/rfsimulator.h +++ b/targets/ARCH/rfsimulator/rfsimulator.h @@ -25,7 +25,7 @@ #define __RFSIMULATOR_H double gaussZiggurat(double mean, double variance); void tableNor(unsigned long seed); -void rxAddInput( c16_t *input_sig, +void rxAddInput( const c16_t *input_sig, c16_t *after_channel_sig, int rxAnt, channel_desc_t *channelDesc, From d642c74b66325b8d655c40044cbe081b4da7179a Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 12 Apr 2022 11:26:20 +0200 Subject: [PATCH 797/883] reintroducing RA logs to avoid CI test failure --- .../gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf | 1 - openair1/SCHED_NR/nr_prach_procedures.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 10 +++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf index 6fd04bf569..7b0e3eea22 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf @@ -38,7 +38,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; pusch_AntennaPorts = 2; ul_prbblacklist = "51,52,53,54" do_SRS = 1; diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 7b5b6d22ff..b0f59d5f47 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -173,7 +173,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) { if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) { - LOG_D(NR_PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n", + LOG_I(NR_PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n", gNB->Mod_id, frame, slot, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index f297af27bb..7c8c8d12d7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -678,7 +678,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ra->preamble_index = preamble_index; ra->beam_id = beam_index; - LOG_D(NR_MAC, + LOG_I(NR_MAC, "[gNB %d][RAPROC] CC_id %d Frame %d Activating Msg2 generation in frame %d, slot %d using RA rnti %x SSB " "index %u RA index %d\n", module_idP, @@ -795,7 +795,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t return; } - LOG_D(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d Scheduling retransmission of Msg3 in (%d,%d)\n", + LOG_I(NR_MAC, "[gNB %d][RAPROC] Frame %d, Slot %d : CC_id %d Scheduling retransmission of Msg3 in (%d,%d)\n", module_idP, frame, slot, CC_id, sched_frame, sched_slot); nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_idP]->UL_tti_req_ahead[CC_id][sched_slot]; @@ -1920,7 +1920,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra if(ra->msg3_dcch_dtch) { // If the UE used MSG3 to transfer a DCCH or DTCH message, then contention resolution is successful upon transmission of PDCCH - LOG_D(NR_MAC, "(ue %i, rnti 0x%04x) CBRA procedure succeeded!\n", UE_id, ra->rnti); + LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) CBRA procedure succeeded!\n", UE_id, ra->rnti); nr_clear_ra_proc(module_idP, CC_id, frameP, ra); UE_info->active[UE_id] = true; UE_info->Msg4_ACKed[UE_id] = true; @@ -1953,12 +1953,12 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram if (harq->is_waiting == 0) { if (harq->round == 0) { if (stats->dlsch_errors == 0) { - LOG_D(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti); + LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti); UE_info->active[UE_id] = true; UE_info->Msg4_ACKed[UE_id] = true; } else { - LOG_D(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti); + LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti); } nr_clear_ra_proc(module_id, CC_id, frame, ra); From ef6ea331cf137afbadd42dc8eda947560d72cc62 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Tue, 12 Apr 2022 11:48:42 +0000 Subject: [PATCH 798/883] Update TESTING_5GSA_setup.md --- doc/TESTING_5GSA_setup.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md index f8c85bf2ca..9b27549df4 100644 --- a/doc/TESTING_5GSA_setup.md +++ b/doc/TESTING_5GSA_setup.md @@ -36,6 +36,8 @@ At the moment of writing this document interoperability with the following COTS - [Quectel RM500Q-GL](https://www.quectel.com/product/5g-rm500q-gl/) - [Simcom SIMCOM8200EA](https://www.simcom.com/product/SIM8200EA_M2.html) - Huawei Mate 30 Pro + - Oneplus 8 + - Google Pixel 5 End-to-end control plane signaling to achieve a 5G SA connection, UE registration and PDU session establishment with the CN, as well as some basic user-plane traffic tests have been validated so far using SIMCOM/Quectel modules and Huawei Mate 30 pro. In terms of interoperability with different 5G Core Networks, so far this setup has been tested with: From 2373b0215011357aa853bb9d53804a536977d226 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Tue, 12 Apr 2022 20:52:40 +0200 Subject: [PATCH 799/883] review remarks --- executables/nr-ue.c | 1 + targets/RT/USER/lte-ru.c | 1 + 2 files changed, 2 insertions(+) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 02e92cbe0b..aff56f583a 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -808,6 +808,7 @@ void processSlotRX(void *arg) { void dummyWrite(PHY_VARS_NR_UE *UE,openair0_timestamp timestamp, int writeBlockSize) { void *dummy_tx[UE->frame_parms.nb_antennas_tx]; int16_t dummy_tx_data[UE->frame_parms.nb_antennas_tx][2*writeBlockSize]; // 2 because the function we call use pairs of int16_t implicitly as complex numbers + memset(dummy_tx_data, 0, sizeof(dummy_tx_data)); for (int i=0; iframe_parms.nb_antennas_tx; i++) dummy_tx[i]=dummy_tx_data[i]; diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index c1ffd7a292..cee15ef48b 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -836,6 +836,7 @@ void tx_rf(RU_t *ru, // we write 1 single I/Q sample to trigger Rx (rfsim will fill gaps with 0 I/Q) void *dummy_tx[ru->frame_parms->nb_antennas_tx]; int16_t dummy_tx_data[ru->frame_parms->nb_antennas_tx][2]; // 2 because the function we call use pairs of int16_t implicitly as complex numbers + memset(dummy_tx_data,0,sizeof(dummy_tx_data)); for (int i=0; iframe_parms->nb_antennas_tx; i++) dummy_tx[i]= dummy_tx_data[i]; From 31319e80635065fe789560b88cee54a269a98f2f Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 13 Apr 2022 16:54:09 +0100 Subject: [PATCH 800/883] Fix pdcch_est_size --- openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c index a1e2b1ee7c..3e710c7c33 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c @@ -539,8 +539,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, int coreset_start_rb=0; // Hold the channel estimates in frequency domain. - int32_t pdcch_est_size = fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH); - int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size]; + int32_t pdcch_est_size = ((((fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH))+15)/16)*16); + __attribute__ ((aligned(16))) int32_t pdcch_dl_ch_estimates[4*fp->nb_antennas_rx][pdcch_est_size]; for(int n_ss = 0; n_ss Date: Thu, 14 Apr 2022 17:43:02 +0200 Subject: [PATCH 801/883] fixes for SR in pucch0 --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 20 ++++++++++++++------ openair1/PHY/defs_gNB.h | 2 -- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 50c3b62f50..d1f7ff7c6c 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -298,7 +298,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, xr[aa][l][n2+1]+=(int16_t)(((int32_t)x_re[l][n]*r[n2+1]-(int32_t)x_im[l][n]*r[n2])>>15); #ifdef DEBUG_NR_PUCCH_RX printf("x (%d,%d), r%d.%d (%d,%d), xr (%d,%d)\n", - x_re[l][n],x_im[l][n],l2,re_offset[l],r[n2],r[n2+1],xr[aa][l][n2],xr[aa][l][n2+1]); + x_re[l][n],x_im[l][n],l2,re_offset[l],r[n2],r[n2+1],xr[aa][l][n2],xr[aa][l][n2+1]); #endif } } @@ -390,7 +390,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, index=maxpos; uci_stats->pucch0_n00 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]]; uci_stats->pucch0_n01 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]; - LOG_D(PHY,"n00[%d] = %d, n01[%d] = %d\n",prb_offset[0],uci_stats->pucch0_n00,prb_offset[1],uci_stats->pucch0_n01); + LOG_I(PHY,"n00[%d] = %d, n01[%d] = %d\n",prb_offset[0],uci_stats->pucch0_n00,prb_offset[1],uci_stats->pucch0_n01); // estimate CQI for MAC (from antenna port 0 only) int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01; int SNRtimes10,sigenergy=0; @@ -422,11 +422,12 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (pucch_pdu->bit_len_harq==0) { uci_pdu->harq = NULL; uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); - uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0; + uci_pdu->sr->sr_confidence_level = (SNRtimes10 > uci_stats->pucch0_thres) ? 1 : 0; uci_stats->pucch0_sr_trials++; - if (xrtmag_dBtimes10>(10*gNB->measurements.n0_power_tot_dB)) { + if (xrtmag_dBtimes10>10*max_n0) { uci_pdu->sr->sr_indication = 1; uci_stats->pucch0_positive_SR++; + LOG_D(PHY,"PUCCH0 got positive SR. Cumulative number of positive SR %d\n", uci_stats->pucch0_positive_SR); } else { uci_pdu->sr->sr_indication = 0; } @@ -445,7 +446,10 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>1) ? 1 : 0; uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0; - uci_stats->pucch0_positive_SR++; + if(uci_pdu->sr->sr_indication == 1 && uci_pdu->sr->sr_confidence_level == 0) { + uci_stats->pucch0_positive_SR++; + LOG_D(PHY,"PUCCH0 got positive SR. Cumulative number of positive SR %d\n", uci_stats->pucch0_positive_SR); + } } uci_stats->pucch01_trials++; } @@ -463,6 +467,10 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>3) ? 1 : 0; uci_pdu->sr->sr_confidence_level = (no_conf) ? 1 : 0; + if(uci_pdu->sr->sr_indication == 1 && uci_pdu->sr->sr_confidence_level == 0) { + uci_stats->pucch0_positive_SR++; + LOG_D(PHY,"PUCCH0 got positive SR. Cumulative number of positive SR %d\n", uci_stats->pucch0_positive_SR); + } } } } @@ -1671,7 +1679,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, LOG_D(PHY,"metric %d dB\n",corr_dB); } - // estimate CQI for MAC (from antenna port 0 only) + // estimate CQI for MAC (from antenna port 0 only) int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[0]], 12*pucch_pdu->prb_size)) - (10*gNB->measurements.n0_power_tot_dB); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 7b655c023a..f382de73aa 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -661,8 +661,6 @@ typedef struct { unsigned int n0_power_tot; //! estimated avg noise power (dB) unsigned int n0_power_tot_dB; - //! estimated avg noise power (dB) - int n0_power_tot_dBm; //! estimated avg noise power per RB per RX ant (lin) unsigned int n0_subband_power[MAX_NUM_RU_PER_gNB][275]; //! estimated avg noise power per RB per RX ant (dB) From ca51ba7d3f860df32b256df2a4b5c2b55d14b929 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 14 Apr 2022 19:30:22 +0200 Subject: [PATCH 802/883] ignoring PUCCH2 TPC for now --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 3 ++- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index d1f7ff7c6c..bcf743b560 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -390,7 +390,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, index=maxpos; uci_stats->pucch0_n00 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]]; uci_stats->pucch0_n01 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]]; - LOG_I(PHY,"n00[%d] = %d, n01[%d] = %d\n",prb_offset[0],uci_stats->pucch0_n00,prb_offset[1],uci_stats->pucch0_n01); + LOG_D(PHY,"n00[%d] = %d, n01[%d] = %d\n",prb_offset[0],uci_stats->pucch0_n00,prb_offset[1],uci_stats->pucch0_n01); // estimate CQI for MAC (from antenna port 0 only) int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01; int SNRtimes10,sigenergy=0; @@ -1680,6 +1680,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, } // estimate CQI for MAC (from antenna port 0 only) + // TODO this computation is wrong -> to be ignored at MAC for now int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[0]], 12*pucch_pdu->prb_size)) - (10*gNB->measurements.n0_power_tot_dB); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index e21d1e50f7..3eda061959 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1493,10 +1493,11 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; // tpc (power control) - sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, - uci_234->ul_cqi, - 30); - sched_ctrl->pucch_snrx10 = uci_234->ul_cqi * 5 - 640; + // TODO PUCCH2 SNR computation is not correct -> ignore the following + //sched_ctrl->tpc1 = nr_get_tpc(RC.nrmac[mod_id]->pucch_target_snrx10, + // uci_234->ul_cqi, + // 30); + //sched_ctrl->pucch_snrx10 = uci_234->ul_cqi * 5 - 640; if ((uci_234->pduBitmap >> 1) & 0x01) { // iterate over received harq bits From 8b0be9cf87708f9f5976ff239daa8d719d17dae4 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 20 Jan 2022 15:45:43 +0100 Subject: [PATCH 803/883] nr rlc: speedup ack/nack reception The code completely changed, expect problems. --- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 850 +++++++++++---------- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.h | 3 - openair2/LAYER2/nr_rlc/nr_rlc_sdu.c | 11 +- openair2/LAYER2/nr_rlc/nr_rlc_sdu.h | 7 +- openair2/LAYER2/nr_rlc/tests/test14.txt.gz | Bin 792 -> 799 bytes openair2/LAYER2/nr_rlc/tests/test15.txt.gz | Bin 546 -> 554 bytes 6 files changed, 441 insertions(+), 430 deletions(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index af8cb5715a..e86e7c7d05 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -103,36 +103,6 @@ static int segment_already_received(nr_rlc_entity_am_t *entity, return size <= 0; } -static void consider_retransmission(nr_rlc_entity_am_t *entity, - nr_rlc_sdu_segment_t *cur, int update_retx) -{ - if (update_retx) - cur->sdu->retx_count++; - - /* let's report max RETX reached for all retx_count >= max_retx_threshold - * (specs say to report if retx_count == max_retx_threshold). - * Upper layers should react (radio link failure), so no big deal actually. - */ - if (update_retx && cur->sdu->retx_count >= entity->max_retx_threshold) { - entity->common.max_retx_reached(entity->common.max_retx_reached_data, - (nr_rlc_entity_t *)entity); - } - - /* let's put in retransmit list even if we are over max_retx_threshold. - * upper layers should deal with this condition, internally it's better - * for the RLC code to keep going with this segment (we only remove - * a segment that was ACKed) - */ - LOG_D(RLC, "RLC segment to be added at the ReTx list \n"); - nr_rlc_sdu_segment_list_append(&entity->retransmit_list, - &entity->retransmit_end, - cur); - - /* update buffer status */ - entity->common.bstatus.retx_size += compute_pdu_header_size(entity, cur) - + cur->size; -} - /* checks that all the bytes of the SDU sn have been received (but SDU * has not been already processed) */ @@ -315,81 +285,6 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu) } } -static void process_received_ack(nr_rlc_entity_am_t *entity, int ack_sn) -{ - nr_rlc_sdu_segment_t head; - nr_rlc_sdu_segment_t *cur; - nr_rlc_sdu_segment_t *prev; - unsigned char sn_set[32768]; /* used to dec retx_count only once per sdu */ - - memset(sn_set, 0, 32768); - -#define IS_SN_SET(b) (sn_set[(b)/8] & (1 << ((b) % 8))) -#define SET_SN(b) do { sn_set[(b)/8] |= (1 << ((b) % 8)); } while (0) - - /* put SDUs from wait and retransmit lists with SN < 'ack_sn' to ack_list */ - - /* process wait list */ - head.next = entity->wait_list; - prev = &head; - cur = entity->wait_list; - while (cur != NULL) { - if (sn_compare_tx(entity, cur->sdu->sn, ack_sn) < 0) { - /* remove from wait list */ - prev->next = cur->next; - /* put the PDU in the ack list */ - entity->ack_list = nr_rlc_sdu_segment_list_add(sn_compare_tx, entity, - entity->ack_list, cur); - entity->wait_end = prev; - cur = prev->next; - } else { - entity->wait_end = cur; - prev = cur; - cur = cur->next; - } - } - entity->wait_list = head.next; - if (entity->wait_list == NULL) - entity->wait_end = NULL; - - /* process retransmit list */ - head.next = entity->retransmit_list; - prev = &head; - cur = entity->retransmit_list; - while (cur != NULL) { - if (sn_compare_tx(entity, cur->sdu->sn, ack_sn) < 0) { - /* dec. retx_count in case we put this segment back in retransmit list - * in 'process_received_nack' - * do it only once per SDU - */ - if (!IS_SN_SET(cur->sdu->sn)) { - cur->sdu->retx_count--; - SET_SN(cur->sdu->sn); - } - /* remove from retransmit list */ - prev->next = cur->next; - /* update buffer status */ - entity->common.bstatus.retx_size -= compute_pdu_header_size(entity, cur) - + cur->size; - /* put the PDU in the ack list */ - entity->ack_list = nr_rlc_sdu_segment_list_add(sn_compare_tx, entity, - entity->ack_list, cur); - entity->retransmit_end = prev; - cur = prev->next; - } else { - entity->retransmit_end = cur; - prev = cur; - cur = cur->next; - } - } - entity->retransmit_list = head.next; - if (entity->retransmit_list == NULL) - entity->retransmit_end = NULL; - -#undef IS_BIT_SET -#undef SET_BIT -} - static int so_overlap(int s1, int e1, int s2, int e2) { if (s1 < s2) { @@ -402,136 +297,375 @@ static int so_overlap(int s1, int e1, int s2, int e2) return 0; } -static void process_nack_sn(nr_rlc_entity_am_t *entity, int nack_sn, - int so_start, int so_end, unsigned char *sn_set) -{ - /* put all SDU segments with SN == 'sn' and with an overlapping so start/end - * to the retransmit list - * source lists are ack list and wait list. - * Not sure if we should consider wait list, isn't the other end supposed - * to only NACK SNs lower than the ACK SN sent in the status PDU, in which - * case all potential SDU segments should all be in ack list when calling - * the current function? in doubt let's accept anything and thus process - * also wait list. - */ - nr_rlc_sdu_segment_t head; - nr_rlc_sdu_segment_t *cur; - nr_rlc_sdu_segment_t *prev; - -#define IS_SN_SET(b) (sn_set[(b)/8] & (1 << ((b) % 8))) -#define SET_SN(b) do { sn_set[(b)/8] |= (1 << ((b) % 8)); } while (0) - - /* check that tx_next_ack <= sn < tx_next */ - if (!(sn_compare_tx(entity, entity->tx_next_ack, nack_sn) <= 0 && - sn_compare_tx(entity, nack_sn, entity->tx_next) < 0)) - return; - - /* process wait list */ - head.next = entity->wait_list; - prev = &head; - cur = entity->wait_list; - while (cur != NULL) { - if (cur->sdu->sn == nack_sn && - so_overlap(so_start, so_end, cur->so, cur->so + cur->size - 1)) { - /* remove from wait list */ - prev->next = cur->next; - cur->next = NULL; - /* consider the SDU segment for retransmission */ - consider_retransmission(entity, cur, !IS_SN_SET(cur->sdu->sn)); - SET_SN(cur->sdu->sn); - entity->wait_end = prev; - cur = prev->next; - } else { - entity->wait_end = cur; - prev = cur; - cur = cur->next; - } - } - entity->wait_list = head.next; - if (entity->wait_list == NULL) - entity->wait_end = NULL; - - /* process ack list */ - head.next = entity->ack_list; - prev = &head; - cur = entity->ack_list; - while (cur != NULL) { - if (cur->sdu->sn == nack_sn && - so_overlap(so_start, so_end, cur->so, cur->so + cur->size - 1)) { - /* remove from ack list */ - prev->next = cur->next; - cur->next = NULL; - /* consider the SDU segment for retransmission */ - consider_retransmission(entity, cur, !IS_SN_SET(cur->sdu->sn)); - SET_SN(cur->sdu->sn); - cur = prev->next; - } else { - prev = cur; - cur = cur->next; - } - } - entity->ack_list = head.next; - -#undef IS_BIT_SET -#undef SET_BIT -} - -static void process_received_nack(nr_rlc_entity_am_t *entity, int nack_sn, - int so_start, int so_end, int range, - unsigned char *sn_set) +static void process_control_pdu(nr_rlc_entity_am_t *entity, + char *buffer, int size) { +#define R(d) do { if (nr_rlc_pdu_decoder_in_error(&d)) goto err; } while (0) + nr_rlc_pdu_decoder_t decoder; int i; + int cpt; + int ack_sn; + int nack_sn; + int e1; + int e2; + int e3; + int so_start; + int so_end; + int range; + int prev_nack_sn = -1; + int prev_so_start; + int prev_so_end; + int tx_next_ack; + nr_rlc_sdu_segment_t *cur_wait_list; + nr_rlc_sdu_segment_t *prev_wait_list; + nr_rlc_sdu_segment_t *end_wait_list = NULL; + nr_rlc_sdu_segment_t head_wait_list; + nr_rlc_sdu_segment_t *cur_retransmit_list; + nr_rlc_sdu_segment_t *new_retransmit_list; + nr_rlc_sdu_segment_t head_retransmit_list; - for (i = 0; i < range; i++) - process_nack_sn(entity, (nack_sn + i) % entity->sn_modulus, - i == 0 ? so_start : 0, - i == range - 1 ? so_end : -1, - sn_set); -} + head_wait_list.next = entity->wait_list; + cur_wait_list = entity->wait_list; + prev_wait_list = &head_wait_list; -static int sdu_segment_in_ack_list_full(nr_rlc_sdu_segment_t *sdu) -{ - int target_count = sdu->sdu->ref_count; - int actual_count = 0; - int sn = sdu->sdu->sn; + head_retransmit_list.next = NULL; + cur_retransmit_list = entity->retransmit_list; + new_retransmit_list = &head_retransmit_list; - while (sdu != NULL && sdu->sdu->sn == sn) { - actual_count++; - sdu = sdu->next; + nr_rlc_pdu_decoder_init(&decoder, buffer, size); + nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); /* dc */ + + cpt = nr_rlc_pdu_decoder_get_bits(&decoder, 3); R(decoder); + if (cpt != 0) { + LOG_E(RLC, "%s:%d:%s: warning: discard PDU, CPT not 0 (%d)\n", + __FILE__, __LINE__, __FUNCTION__, cpt); + goto err; + } + ack_sn = nr_rlc_pdu_decoder_get_bits(&decoder, entity->sn_field_length); R(decoder); + e1 = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); + /* r bits */ + if (entity->sn_field_length == 18) { + nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); + } else { + nr_rlc_pdu_decoder_get_bits(&decoder, 7); R(decoder); } - return actual_count == target_count; -} - -static void finalize_ack_nack_processing(nr_rlc_entity_am_t *entity) -{ - nr_rlc_sdu_segment_t *cur = entity->ack_list; - int sn; - - /* - send indication of successful delivery for all consecutive acked SDUs - * starting from tx_next_ack. Also free them. - * - update tx_next_ack to the next SN not acked yet + /* 38.322 5.3.3.3 says to stop t_poll_retransmit if a ACK or NACK is + * received for the SN 'poll_sn' - check ACK case (NACK done below) */ - /* todo: send indication of successful delivery as soon as possible as - * the specs say (38.322 5.2.3.1.1). As the code is, if we receive - * ack for SN+2 we won't indicate successful delivery before - * SN+1 has been indicated. + if (sn_compare_tx(entity, entity->poll_sn, ack_sn) < 0) + entity->t_poll_retransmit_start = 0; + + while (e1) { + nack_sn = nr_rlc_pdu_decoder_get_bits(&decoder, entity->sn_field_length); R(decoder); + e1 = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); + e2 = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); + e3 = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); + /* r bits */ + if (entity->sn_field_length == 18) { + nr_rlc_pdu_decoder_get_bits(&decoder, 3); R(decoder); + } else { + nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); + } + if (e2) { + so_start = nr_rlc_pdu_decoder_get_bits(&decoder, 16); R(decoder); + so_end = nr_rlc_pdu_decoder_get_bits(&decoder, 16); R(decoder); + } else { + so_start = 0; + so_end = 0xffff; + } + if (e3) { + range = nr_rlc_pdu_decoder_get_bits(&decoder, 8); R(decoder); + } else { + range = 1; + } + /* special value 0xffff indicates 'all bytes to the end' */ + if (so_end == 0xffff) + so_end = -1; + + /* process nacks */ + for (i = 0; i < range; i++) { + int cur_nack_sn = (nack_sn + i) % entity->sn_modulus; + int cur_so_start = i == 0 ? so_start : 0; + int cur_so_end = i == range - 1 ? so_end : -1; + + /* check that current nack is > previous nack and <= ack + * if not then skip it and all following nacks, and + * do not touch t_poll_retransmit + */ + if (prev_nack_sn != -1) { + int cmp = sn_compare_tx(entity, cur_nack_sn, prev_nack_sn); + if (cmp < 0 + || (cmp == 0 + && (prev_so_end == -1 + || cur_so_start <= prev_so_end))) { + LOG_E(RLC, "%s:%d:%s: bad NACK (nack sn %d so start/end %d/%d, previous nack sn %d so start/end %d/%d), skip it and all following NACKs\n", + __FILE__, __LINE__, __FUNCTION__, + cur_nack_sn, cur_so_start, cur_so_end, + prev_nack_sn, prev_so_start, prev_so_end); + goto nacks_done; + } + } + if (sn_compare_tx(entity, cur_nack_sn, ack_sn) > 0) { + LOG_E(RLC, "%s:%d:%s: bad NACK (nack %d ack %d), skip it and all following NACKs\n", + __FILE__, __LINE__, __FUNCTION__, + cur_nack_sn, ack_sn); + goto nacks_done; + } + +process_next_pdu: + /* process smallest SN either from wait_list or retransmit list */ + if (cur_wait_list == NULL && cur_retransmit_list == NULL) + goto lists_over; + if (cur_wait_list == NULL) + goto process_retransmit_list_head; + if (cur_retransmit_list == NULL) + goto process_wait_list_head; + if (cur_wait_list->sdu->sn < cur_retransmit_list->sdu->sn + || (cur_wait_list->sdu->sn == cur_retransmit_list->sdu->sn && + cur_wait_list->so < cur_retransmit_list->so)) + goto process_wait_list_head; + goto process_retransmit_list_head; + +process_wait_list_head: + /* if nack overlaps with current segment, put it in retransmit list */ + if (cur_wait_list->sdu->sn == cur_nack_sn + && so_overlap(cur_so_start, cur_so_end, + cur_wait_list->so, + cur_wait_list->so + cur_wait_list->size - 1)) { + prev_wait_list->next = cur_wait_list->next; + if (cur_wait_list == entity->wait_end) + end_wait_list = prev_wait_list; + cur_wait_list->next = NULL; + new_retransmit_list->next = cur_wait_list; + new_retransmit_list = cur_wait_list; + /* increase retx count. Don't care about segmentation, so maybe we + * increase too much. + */ + cur_wait_list->sdu->retx_count++; + /* report max RETX reached for all retx_count >= max_retx_threshold + * (specs say to report if retx_count == max_retx_threshold). + * Upper layers should react (radio link failure), so no big deal. + * We deal with segmentation by requiring + * retx_count >= max_retx_threshold * number of segments. + * We may report max RETX reached too late/early. To be refined if + * this is a problem. + */ + if (cur_wait_list->sdu->retx_count + >= entity->max_retx_threshold * cur_wait_list->sdu->ref_count) + entity->common.max_retx_reached(entity->common.max_retx_reached_data, + (nr_rlc_entity_t *)entity); + /* update buffer status */ + entity->common.bstatus.retx_size += compute_pdu_header_size(entity, cur_wait_list) + + cur_wait_list->size; + /* and go process the next pdu, still for the current nack */ + cur_wait_list = prev_wait_list->next; + goto process_next_pdu; + } + + /* if current segment SN > current NACK, we can't classify it yet */ + if (sn_compare_tx(entity, cur_wait_list->sdu->sn, cur_nack_sn) > 0 + || (cur_wait_list->sdu->sn == cur_nack_sn + && cur_wait_list->so > cur_so_start)) + goto done_nack; + + /* if current segment is acked, free it, indicate successful delivery + * if fully acked + */ + if (sn_compare_tx(entity, cur_wait_list->sdu->sn, ack_sn) < 0) { + nr_rlc_sdu_segment_t *cur = cur_wait_list; + int upper_layer_id = cur->sdu->upper_layer_id; + int sdu_size = cur->sdu->size; + cur_wait_list = cur_wait_list->next; + prev_wait_list->next = cur_wait_list; + if (cur_wait_list == entity->wait_end) + end_wait_list = prev_wait_list; + if (nr_rlc_free_sdu_segment(cur)) { + entity->tx_size -= sdu_size; + entity->common.sdu_successful_delivery( + entity->common.sdu_successful_delivery_data, + (nr_rlc_entity_t *)entity, upper_layer_id); + } + goto process_next_pdu; + } + + /* if current segment SN > ack_sn, we're done with this list */ + if (sn_compare_tx(entity, cur_wait_list->sdu->sn, ack_sn) > 0) { + cur_wait_list = NULL; + goto process_next_pdu; + } + + /* current segment SN == ack_sn, skip this segment and move to the next. + * Not sure if correct, can we get a nack_sn == ack_sn? 38.322 5.3.4 says + * "set the ACK_SN to the SN of the next not received RLC SDU which is + * not indicated as missing in the resulting STATUS PDU." Is it okay to + * receive some NACK for a given SN and an ACK == this SN? I can see a + * case where it's possible (only parts of an SN were received and the + * TB is too small to report the several NACKs for this SN, then we + * can't set ACK = SN+1 but in this case, shouldn't we skip sending + * NACKs for this SN and only send ACK = SN? our current implementation + * does send both NACKs and ACK, see function generate_status()). + */ + prev_wait_list = cur_wait_list; + cur_wait_list = cur_wait_list->next; + goto process_next_pdu; + +process_retransmit_list_head: + /* if nack overlaps with current segment, leave it in retransmit list */ + if (cur_retransmit_list->sdu->sn == cur_nack_sn + && so_overlap(cur_so_start, cur_so_end, + cur_retransmit_list->so, + cur_retransmit_list->so + cur_retransmit_list->size - 1)) { + new_retransmit_list->next = cur_retransmit_list; + cur_retransmit_list = cur_retransmit_list->next; + new_retransmit_list = new_retransmit_list->next; + new_retransmit_list->next = NULL; + /* go process the next pdu, still for the current nack */ + goto process_next_pdu; + } + + /* if current segment SN > current NACK, we can't classify it yet */ + if (sn_compare_tx(entity, cur_retransmit_list->sdu->sn, cur_nack_sn) > 0 + || (cur_retransmit_list->sdu->sn == cur_nack_sn + && cur_retransmit_list->so > cur_so_start)) + goto done_nack; + + /* if current segment is acked, free it, indicate successful delivery + * if fully acked + */ + if (sn_compare_tx(entity, cur_retransmit_list->sdu->sn, ack_sn) < 0) { + nr_rlc_sdu_segment_t *cur = cur_retransmit_list; + int upper_layer_id = cur->sdu->upper_layer_id; + int sdu_size = cur->sdu->size; + cur_retransmit_list = cur_retransmit_list->next; + /* update buffer status */ + entity->common.bstatus.retx_size -= compute_pdu_header_size(entity, cur) + + cur->size; + if (nr_rlc_free_sdu_segment(cur)) { + entity->tx_size -= sdu_size; + entity->common.sdu_successful_delivery( + entity->common.sdu_successful_delivery_data, + (nr_rlc_entity_t *)entity, upper_layer_id); + } + goto process_next_pdu; + } + + /* current segment SN >= ack_sn + * if the wait list is empty, then put the remaining retransmit list at + * the end of the new retransmit list (just a speedup) + * if not, put only this segment + */ + if (cur_wait_list == NULL) { + new_retransmit_list->next = cur_retransmit_list; + cur_retransmit_list = NULL; + goto lists_over; + } + new_retransmit_list->next = cur_retransmit_list; + cur_retransmit_list = cur_retransmit_list->next; + new_retransmit_list = new_retransmit_list->next; + new_retransmit_list->next = NULL; + goto process_next_pdu; + +done_nack: + prev_nack_sn = cur_nack_sn; + prev_so_start = cur_so_start; + prev_so_end = cur_so_end; + } /* for (i = 0; i < range; i++) */ + +lists_over: + /* 38.322 5.3.3.3 says to stop t_poll_retransmit if a ACK or NACK is + * received for the SN 'poll_sn' - check NACK case (ACK done above) + */ + if (sn_compare_tx(entity, nack_sn, entity->poll_sn) <= 0 && + sn_compare_tx(entity, entity->poll_sn, (nack_sn + range) % entity->sn_modulus) < 0) + entity->t_poll_retransmit_start = 0; + } /* while (e1) */ + +nacks_done: + /* nacks done, finish with ack */ + /* we may report successful delivery out of order, if it's a problem + * then we can have a single loop and deal with the smallest sn of + * the current head of wait list and the current head of retransmit list. + * (It's simpler to process those two lists the one after the other.) */ - while (cur != NULL && cur->sdu->sn == entity->tx_next_ack && - sdu_segment_in_ack_list_full(cur)) { - entity->tx_size -= cur->sdu->size; - sn = cur->sdu->sn; - entity->common.sdu_successful_delivery( - entity->common.sdu_successful_delivery_data, - (nr_rlc_entity_t *)entity, cur->sdu->upper_layer_id); - while (cur != NULL && cur->sdu->sn == sn) { - nr_rlc_sdu_segment_t *s = cur; - cur = cur->next; - nr_rlc_free_sdu_segment(s); + /* deal with wait list */ + while (cur_wait_list != NULL + && sn_compare_tx(entity, cur_wait_list->sdu->sn, ack_sn) < 0) { + /* current segment is acked, free it, indicate successful delivery + * if fully acked + */ + nr_rlc_sdu_segment_t *cur = cur_wait_list; + int upper_layer_id = cur->sdu->upper_layer_id; + int sdu_size = cur->sdu->size; + prev_wait_list->next = cur_wait_list->next; + if (cur_wait_list == entity->wait_end) + end_wait_list = prev_wait_list; + cur_wait_list = cur_wait_list->next; + if (nr_rlc_free_sdu_segment(cur)) { + entity->tx_size -= sdu_size; + entity->common.sdu_successful_delivery( + entity->common.sdu_successful_delivery_data, + (nr_rlc_entity_t *)entity, upper_layer_id); } - entity->ack_list = cur; - entity->tx_next_ack = (entity->tx_next_ack + 1) % entity->sn_modulus; } + /* deal with retransmit list */ + while (cur_retransmit_list != NULL + && sn_compare_tx(entity, cur_retransmit_list->sdu->sn, ack_sn) < 0) { + /* current segment is acked, free it, indicate successful delivery + * if fully acked + */ + nr_rlc_sdu_segment_t *cur = cur_retransmit_list; + int upper_layer_id = cur->sdu->upper_layer_id; + int sdu_size = cur->sdu->size; + cur_retransmit_list = cur_retransmit_list->next; + /* update buffer status */ + entity->common.bstatus.retx_size -= compute_pdu_header_size(entity, cur) + + cur->size; + if (nr_rlc_free_sdu_segment(cur)) { + entity->tx_size -= sdu_size; + entity->common.sdu_successful_delivery( + entity->common.sdu_successful_delivery_data, + (nr_rlc_entity_t *)entity, upper_layer_id); + } + } + + new_retransmit_list->next = cur_retransmit_list; + + entity->wait_list = head_wait_list.next; + entity->retransmit_list = head_retransmit_list.next; + + if (end_wait_list != NULL) { + if (end_wait_list == &head_wait_list) + entity->wait_end = NULL; + else + entity->wait_end = end_wait_list; + } + + /* update tx_next_ack */ + /* 38.322 5.2.3.1.1 says "set TX_Next_Ack equal to the SN of the RLC SDU + * with the smallest SN, whose SN falls within the range + * TX_Next_Ack <= SN <= TX_Next and for which a positive acknowledgment + * has not been received yet. + */ + /* let's start from highest possible value and go down as needed */ + tx_next_ack = entity->tx_next; + if (entity->wait_list != NULL + && sn_compare_tx(entity, entity->wait_list->sdu->sn, tx_next_ack) < 0) + tx_next_ack = entity->wait_list->sdu->sn; + if (entity->retransmit_list != NULL + && sn_compare_tx(entity, entity->retransmit_list->sdu->sn, tx_next_ack) < 0) + tx_next_ack = entity->retransmit_list->sdu->sn; + if (sn_compare_tx(entity, ack_sn, tx_next_ack) < 0) + tx_next_ack = ack_sn; + entity->tx_next_ack = tx_next_ack; + + return; + +err: + LOG_E(RLC, "%s:%d:%s: error decoding PDU, NR RLC entity in inconsistent state\n", + __FILE__, __LINE__, __FUNCTION__); + +#undef R } void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, @@ -540,7 +674,6 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, #define R(d) do { if (nr_rlc_pdu_decoder_in_error(&d)) goto err; } while (0) nr_rlc_entity_am_t *entity = (nr_rlc_entity_am_t *)_entity; nr_rlc_pdu_decoder_t decoder; - nr_rlc_pdu_decoder_t control_decoder; nr_rlc_pdu_t *pdu; int dc; int p = 0; @@ -551,23 +684,11 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, int is_first; int is_last; - int cpt; - int e1; - int e2; - int e3; - int ack_sn; - int nack_sn; - int so_start; - int so_end; - int range; - int control_e1; - int control_e2; - int control_e3; - unsigned char sn_set[32768]; /* used to dec retx_count only once per sdu */ - nr_rlc_pdu_decoder_init(&decoder, buffer, size); dc = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); - if (dc == 0) goto control; + + if (dc == 0) + return process_control_pdu(entity, buffer, size); /* data PDU */ p = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); @@ -596,20 +717,20 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, /* dicard PDU if no data */ if (data_size <= 0) { - LOG_W(RLC, "%s:%d:%s: warning: discard PDU, no data\n", + LOG_D(RLC, "%s:%d:%s: warning: discard PDU, no data\n", __FILE__, __LINE__, __FUNCTION__); goto discard; } /* dicard PDU if rx buffer is full */ if (entity->rx_size + data_size > entity->rx_maxsize) { - LOG_W(RLC, "%s:%d:%s: warning: discard PDU, RX buffer full\n", + LOG_D(RLC, "%s:%d:%s: warning: discard PDU, RX buffer full\n", __FILE__, __LINE__, __FUNCTION__); goto discard; } if (!sn_in_recv_window(entity, sn)) { - LOG_W(RLC, "%s:%d:%s: warning: discard PDU, sn out of window (sn %d rx_next %d)\n", + LOG_D(RLC, "%s:%d:%s: warning: discard PDU, sn out of window (sn %d rx_next %d)\n", __FILE__, __LINE__, __FUNCTION__, sn, entity->rx_next); goto discard; @@ -617,7 +738,7 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, /* discard segment if all the bytes of the segment are already there */ if (segment_already_received(entity, sn, so, data_size)) { - LOG_W(RLC, "%s:%d:%s: warning: discard PDU, already received\n", + LOG_D(RLC, "%s:%d:%s: warning: discard PDU, already received\n", __FILE__, __LINE__, __FUNCTION__); goto discard; } @@ -650,118 +771,6 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity, return; -control: - cpt = nr_rlc_pdu_decoder_get_bits(&decoder, 3); R(decoder); - if (cpt != 0) { - LOG_W(RLC, "%s:%d:%s: warning: discard PDU, CPT not 0 (%d)\n", - __FILE__, __LINE__, __FUNCTION__, cpt); - goto discard; - } - ack_sn = nr_rlc_pdu_decoder_get_bits(&decoder, entity->sn_field_length); R(decoder); - e1 = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); - /* r bits */ - if (entity->sn_field_length == 18) { - nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); - } else { - nr_rlc_pdu_decoder_get_bits(&decoder, 7); R(decoder); - } - - /* let's try to parse the control PDU once to check consistency */ - control_decoder = decoder; - control_e1 = e1; - while (control_e1) { - nack_sn = nr_rlc_pdu_decoder_get_bits(&control_decoder, entity->sn_field_length); R(control_decoder); - control_e1 = nr_rlc_pdu_decoder_get_bits(&control_decoder, 1); R(control_decoder); - control_e2 = nr_rlc_pdu_decoder_get_bits(&control_decoder, 1); R(control_decoder); - control_e3 = nr_rlc_pdu_decoder_get_bits(&control_decoder, 1); R(control_decoder); - /* r bits */ - if (entity->sn_field_length == 18) { - nr_rlc_pdu_decoder_get_bits(&control_decoder, 3); R(control_decoder); - } else { - nr_rlc_pdu_decoder_get_bits(&control_decoder, 1); R(control_decoder); - } - /* check range and so_start/so_end consistency */ - if (control_e2) { - so_start = nr_rlc_pdu_decoder_get_bits(&control_decoder, 16); R(control_decoder); - so_end = nr_rlc_pdu_decoder_get_bits(&control_decoder, 16); R(control_decoder); - } else { - so_start = 0; - so_end = 0xffff; - } - if (control_e3) { - range = nr_rlc_pdu_decoder_get_bits(&control_decoder, 8); R(control_decoder); - } else { - range = 1; - } - if (range < 1) { - LOG_E(RLC, "%s:%d:%s: error, bad 'range' in RLC NACK (sn %d)\n", - __FILE__, __LINE__, __FUNCTION__, nack_sn); - goto err; - } - /* so_start can be > so_end if more than one range; they don't refer - * to the same PDU then - */ - if (range == 1 && so_end < so_start) { - LOG_E(RLC, "%s:%d:%s: error, bad so start/end (sn %d)\n", - __FILE__, __LINE__, __FUNCTION__, nack_sn); - goto err; - } - } - - /* 38.322 5.3.3.3 says to stop t_poll_retransmit if a ACK or NACK is - * received for the SN 'poll_sn' - check ACK case (NACK done below) - */ - if (sn_compare_tx(entity, entity->poll_sn, ack_sn) < 0) - entity->t_poll_retransmit_start = 0; - - /* at this point, accept the PDU even if the actual values - * may be incorrect (eg. if so_start > so_end) - */ - process_received_ack(entity, ack_sn); - - if (e1) - memset(sn_set, 0, 32768); - - while (e1) { - nack_sn = nr_rlc_pdu_decoder_get_bits(&decoder, entity->sn_field_length); R(decoder); - e1 = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); - e2 = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); - e3 = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); - /* r bits */ - if (entity->sn_field_length == 18) { - nr_rlc_pdu_decoder_get_bits(&decoder, 3); R(decoder); - } else { - nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder); - } - if (e2) { - so_start = nr_rlc_pdu_decoder_get_bits(&decoder, 16); R(decoder); - so_end = nr_rlc_pdu_decoder_get_bits(&decoder, 16); R(decoder); - } else { - so_start = 0; - so_end = 0xffff; - } - if (e3) { - range = nr_rlc_pdu_decoder_get_bits(&decoder, 8); R(decoder); - } else { - range = 1; - } - /* special value 0xffff indicates 'all bytes to the end' */ - if (so_end == 0xffff) - so_end = -1; - process_received_nack(entity, nack_sn, so_start, so_end, range, sn_set); - - /* 38.322 5.3.3.3 says to stop t_poll_retransmit if a ACK or NACK is - * received for the SN 'poll_sn' - check NACK case (ACK done above) - */ - if (sn_compare_tx(entity, nack_sn, entity->poll_sn) <= 0 && - sn_compare_tx(entity, entity->poll_sn, (nack_sn + range) % entity->sn_modulus) < 0) - entity->t_poll_retransmit_start = 0; - } - - finalize_ack_nack_processing(entity); - - return; - err: LOG_W(RLC, "%s:%d:%s: error decoding PDU, discarding\n", __FILE__, __LINE__, __FUNCTION__); goto discard; @@ -1225,7 +1234,7 @@ static int generate_missing(nr_rlc_entity_am_t *entity, static int generate_status(nr_rlc_entity_am_t *entity, char *buffer, int size) { int ack_sn = entity->rx_next; - missing_data_t m; + missing_data_t m; nr_rlc_pdu_t *cur; int nack_count = 0; nr_rlc_pdu_encoder_t encoder; @@ -1427,8 +1436,6 @@ static int generate_retx_pdu(nr_rlc_entity_am_t *entity, char *buffer, return 0; entity->retransmit_list = entity->retransmit_list->next; - if (entity->retransmit_list == NULL) - entity->retransmit_end = NULL; sdu->next = NULL; @@ -1444,15 +1451,24 @@ static int generate_retx_pdu(nr_rlc_entity_am_t *entity, char *buffer, /* put the second SDU back at the head of the retransmit list */ next_sdu->next = entity->retransmit_list; entity->retransmit_list = next_sdu; - if (entity->retransmit_end == NULL) - entity->retransmit_end = entity->retransmit_list; /* update buffer status */ entity->common.bstatus.retx_size += compute_pdu_header_size(entity, next_sdu) + next_sdu->size; } /* put SDU/SDU segment in the wait list */ - nr_rlc_sdu_segment_list_append(&entity->wait_list, &entity->wait_end, sdu); + /* speedup: check end of wait list, maybe the new sdu comes after */ + if (entity->wait_end == NULL + || sn_compare_tx(entity, sdu->sdu->sn, entity->wait_end->sdu->sn) > 0 + || (sn_compare_tx(entity, sdu->sdu->sn, entity->wait_end->sdu->sn) == 0 + && sdu->so > entity->wait_end->so)) + nr_rlc_sdu_segment_list_append(&entity->wait_list, &entity->wait_end, sdu); + else { + entity->wait_list = nr_rlc_sdu_segment_list_add(sn_compare_tx, entity, + entity->wait_list, sdu); + if (entity->wait_list->next == NULL) + entity->wait_end = entity->wait_list; + } p = check_poll_after_pdu_assembly(entity); @@ -1519,7 +1535,18 @@ static int generate_tx_pdu(nr_rlc_entity_am_t *entity, char *buffer, int size) entity->tx_next = (entity->tx_next + 1) % entity->sn_modulus; /* put SDU/SDU segment in the wait list */ - nr_rlc_sdu_segment_list_append(&entity->wait_list, &entity->wait_end, sdu); + /* speedup: check end of wait list, probably the new sdu comes after */ + if (entity->wait_end == NULL + || sn_compare_tx(entity, sdu->sdu->sn, entity->wait_end->sdu->sn) > 0 + || (sn_compare_tx(entity, sdu->sdu->sn, entity->wait_end->sdu->sn) == 0 + && sdu->so > entity->wait_end->so)) + nr_rlc_sdu_segment_list_append(&entity->wait_list, &entity->wait_end, sdu); + else { + entity->wait_list = nr_rlc_sdu_segment_list_add(sn_compare_tx, entity, + entity->wait_list, sdu); + if (entity->wait_list->next == NULL) + entity->wait_end = entity->wait_list; + } /* polling actions for a new PDU */ entity->pdu_without_poll++; @@ -1629,11 +1656,7 @@ void nr_rlc_entity_am_recv_sdu(nr_rlc_entity_t *_entity, static void check_t_poll_retransmit(nr_rlc_entity_am_t *entity) { - nr_rlc_sdu_segment_t head; nr_rlc_sdu_segment_t *cur; - nr_rlc_sdu_segment_t *prev; - int sn; - int old_retx_count; /* 38.322 5.3.3.4 */ /* did t_poll_retransmit expire? */ @@ -1659,74 +1682,58 @@ static void check_t_poll_retransmit(nr_rlc_entity_am_t *entity) */ entity->force_poll = 1; - LOG_W(RLC, "%s:%d:%s: warning: t_poll_retransmit expired\n", + LOG_D(RLC, "%s:%d:%s: warning: t_poll_retransmit expired\n", __FILE__, __LINE__, __FUNCTION__); /* do we meet conditions of 38.322 5.3.3.4? */ if (!check_poll_after_pdu_assembly(entity)) return; - /* search wait list for SDU with highest SN */ - /* this code may be incorrect: in LTE we had to look for PDU - * with SN = VT(S) - 1, but for NR the specs say "highest SN among the - * ones submitted to lower layers" not 'tx_next - 1'. So we should look - * for the highest SN in the wait list. But that's no big deal. If the - * program runs this code, then the connection is in a bad state and we - * can retransmit whatever we want. At some point we will receive a status - * report and retransmit what we really have to. Actually we could just - * retransmit the head of wait list (the specs have this 'or'). - * (Actually, maybe this interpretation is not correct and what the code - * does is correct. The specs are confusing.) + /* retransmit the head of wait list, this is the case + * "consider any RLC SDU which has not been positively acknowledged for + * retransmission" of 36.322 5.3.3.4. + * We don't search for the highest SN, it's simpler to just take the head + * of wait list. This can be changed if needed. */ - sn = (entity->tx_next - 1 + entity->sn_modulus) % entity->sn_modulus; - - head.next = entity->wait_list; cur = entity->wait_list; - prev = &head; - - while (cur != NULL) { - if (cur->sdu->sn == sn) - break; - prev = cur; - cur = cur->next; - } - - /* SDU with highest SN not found? take the head of wait list */ - if (cur == NULL) { - cur = entity->wait_list; - prev = &head; - sn = cur->sdu->sn; - } /* todo: do we need to for check cur == NULL? * It seems that no, the wait list should not be empty here, but not sure. */ - old_retx_count = cur->sdu->retx_count; + entity->wait_list = cur->next; + if (entity->wait_list == NULL) + entity->wait_end = NULL; - /* 38.322 says "SDU", not "SDU segment", so let's retransmit all - * SDU segments with this SN + /* 38.322 says "SDU", not "SDU segment", but let's retransmit only + * the 'cur' SDU segment. To be changed if needed. (Maybe we have + * to retransmit all SDU segments with the same SN that are in the + * wait list.) */ - /* todo: maybe we could simply retransmit the current SDU segment, - * so that we don't have to run through the full wait list. + + /* increase retx count. Don't care about segmentation, so maybe we + * increase too much. */ - while (cur != NULL) { - if (cur->sdu->sn == sn) { - prev->next = cur->next; - cur->next = NULL; - /* put in retransmit list */ - consider_retransmission(entity, cur, - old_retx_count == cur->sdu->retx_count); - } else { - prev = cur; - } - cur = prev->next; - } - entity->wait_list = head.next; - /* reset wait_end (todo: optimize?) */ - entity->wait_end = entity->wait_list; - while (entity->wait_end != NULL && entity->wait_end->next != NULL) - entity->wait_end = entity->wait_end->next; + cur->sdu->retx_count++; + /* report max RETX reached for all retx_count >= max_retx_threshold + * (specs say to report if retx_count == max_retx_threshold). + * Upper layers should react (radio link failure), so no big deal. + * We deal with segmentation by requiring + * retx_count >= max_retx_threshold * number of segments. + * We may report max RETX reached too late/early. To be refined if + * this is a problem. + */ + if (cur->sdu->retx_count + >= entity->max_retx_threshold * cur->sdu->ref_count) + entity->common.max_retx_reached(entity->common.max_retx_reached_data, + (nr_rlc_entity_t *)entity); + /* update buffer status */ + entity->common.bstatus.retx_size += compute_pdu_header_size(entity, cur) + + cur->size; + + /* put in retransmit list */ + entity->retransmit_list = nr_rlc_sdu_segment_list_add(sn_compare_tx, entity, + entity->retransmit_list, cur); } static void check_t_reassembly(nr_rlc_entity_am_t *entity) @@ -1815,6 +1822,7 @@ void nr_rlc_entity_am_discard_sdu(nr_rlc_entity_t *_entity, int sdu_id) entity->common.bstatus.tx_size -= compute_pdu_header_size(entity, cur) + cur->size; + entity->tx_size -= cur->sdu->size; nr_rlc_free_sdu_segment(cur); } @@ -1857,7 +1865,6 @@ static void clear_entity(nr_rlc_entity_am_t *entity) nr_rlc_free_sdu_segment_list(entity->tx_list); nr_rlc_free_sdu_segment_list(entity->wait_list); nr_rlc_free_sdu_segment_list(entity->retransmit_list); - nr_rlc_free_sdu_segment_list(entity->ack_list); entity->tx_list = NULL; entity->tx_end = NULL; @@ -1867,9 +1874,6 @@ static void clear_entity(nr_rlc_entity_am_t *entity) entity->wait_end = NULL; entity->retransmit_list = NULL; - entity->retransmit_end = NULL; - - entity->ack_list = NULL; entity->common.bstatus.tx_size = 0; entity->common.bstatus.retx_size = 0; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.h b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.h index 453fe87026..57ae1a3485 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.h +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.h @@ -84,9 +84,6 @@ typedef struct { nr_rlc_sdu_segment_t *wait_end; nr_rlc_sdu_segment_t *retransmit_list; - nr_rlc_sdu_segment_t *retransmit_end; - - nr_rlc_sdu_segment_t *ack_list; } nr_rlc_entity_am_t; void nr_rlc_entity_am_recv_sdu(nr_rlc_entity_t *entity, diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_sdu.c b/openair2/LAYER2/nr_rlc/nr_rlc_sdu.c index ef0d52558a..ef64389ac5 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_sdu.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_sdu.c @@ -58,14 +58,19 @@ oom: exit(1); } -void nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu) +int nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu) { - sdu->sdu->ref_count--; - if (sdu->sdu->ref_count == 0) { + int ret = 0; + + sdu->sdu->free_count++; + if (sdu->sdu->free_count == sdu->sdu->ref_count) { free(sdu->sdu->data); free(sdu->sdu); + ret = 1; } free(sdu); + + return ret; } void nr_rlc_sdu_segment_list_append(nr_rlc_sdu_segment_t **list, diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_sdu.h b/openair2/LAYER2/nr_rlc/nr_rlc_sdu.h index f4585fb7d6..20cc90f185 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_sdu.h +++ b/openair2/LAYER2/nr_rlc/nr_rlc_sdu.h @@ -30,6 +30,10 @@ typedef struct nr_rlc_sdu_t { int retx_count; int ref_count; /* incremented each time the SDU is segmented */ + int free_count; /* incremented each time a segment is freed + * when it equals ref_count we can free the SDU + * completely + */ } nr_rlc_sdu_t; typedef struct nr_rlc_sdu_segment_t { @@ -44,7 +48,8 @@ typedef struct nr_rlc_sdu_segment_t { nr_rlc_sdu_segment_t *nr_rlc_new_sdu( char *buffer, int size, int upper_layer_id); -void nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu); +/* return 1 if the SDU has been freed too, 0 if not (more segments to free) */ +int nr_rlc_free_sdu_segment(nr_rlc_sdu_segment_t *sdu); void nr_rlc_sdu_segment_list_append(nr_rlc_sdu_segment_t **list, nr_rlc_sdu_segment_t **end, nr_rlc_sdu_segment_t *sdu); diff --git a/openair2/LAYER2/nr_rlc/tests/test14.txt.gz b/openair2/LAYER2/nr_rlc/tests/test14.txt.gz index 53616dae3d10b71375cea41ca9061d4304f64dcf..45e54651eb317c3b7695cfcab7428fe43172227b 100644 GIT binary patch delta 727 zcmV;|0x12M2A>9hABzYGOnK#D0t0kqb96B@E_8Tw0Ns{LYhyM4NCCm^MOEKZ=bSpax9>mP-mu=3)#kg~ z{rThj8|)3M(LUX+`va@j9?Uh<1qmfF$t3~1yeB%vosFO z#2T!{I;>z7>#+eFu?d^81zWKV+pz;XaRz5`4ktLpd0fCnT*75s!Bt$tb=<&B#31&! zL;SywKgOzT#@(NN`vhKg;G5awH34cl-io5)8o-96^ro zpHsnJ_7p$=^5cGtJ|6BrjTIk$`uLMT0at$vP`7iA)!mX%o9%j^RLk>jKZUUQ`|)I! zIsZ8yU2wvJ@)Tmb-w|Qw9P6%ww$qNiXy`iu^vJPt=-3>{k(|hxT*#H&$eldMlVT{A z;wVBZySmsfn7Yg<7eN+Npy&cMfQl=4gLH zQ<|p*T0Ed$-|AR>on!U9W92$%JMGxZhwk61xPQ6g`}*+g3(d1H+*#%={g3gIP9hHf zB3?d{PR8rfxRclNS6Q>(wl>!5xqW!}{G|Tq?@rXaSJulb>i-AdiJFg6Qx8+KC0eEx zTBS8wrw!Vq8@i=Cy3m#G>46^UiJpJygt< zMrRDhWE!SrI;Jp{>6w8UnTeT?2RNsLUiKJ|DVDz#W0#M8XO(ASA-o{R%-L87Cu3pP zxT8y7xVC4Yo=z|?M>kyg;_oR>{y$RwjmE1a;Pl2_0rqh2kKgKnX5n#7%(Dw?@)b>e JEYZ;s0009vZy5jp delta 720 zcmV;>0x$ia2ABqaABzYG$u*{70t0kqb96B@E_8Tw0Ns{5ZyZMugmeFjFSHY5X1eFa zP>|rviKxghhZ@~X5=8Fzp5?Gt#}fp2Dy-&}qd?nniDsDd~|5Jfx^kccECBL%5QLpm~$i5k?R z4i!{Uj|MbCq6y7tK`YwOjt+D#=i@EjEsWt6@9_a2@d=;t1z+(E-|-8WNiYOUa0EHR ze@+E^*zjQWeLUQM9xL9z{qU1O0at%CP`7iA)!mX%o9%j^RLlEr--WRG>v3h4 zKL1%C9dN>e@)Tmb=ZLU#j&;{T+iAyMH1wSSdgNF+bZidfNKWKTF62sXuXU`x%&~gjv2q=>op$WyL-(&$+<(8~`}*+gh344{cb0k0{>OMpClQB# z5idVUC*w8!FaFCkAElHYrc_I`Oe?fXYqU-qv`IH~OLugkE8WurJ<=0B(+j=Q8@(^H zK%Wf5unfl#hB7=OFd`!{GNUjmqcMLvV=yMuFfG$Dg{e%>49v((%zWIyIUV$}+jvZk z{H@ryeC#``JTr#jJ95LE9m8;P49{GBIsv>Kop9xYyr(ev|489CHeMwGrzhwNu!nOW zPOAr+E%mz|4S$w3>uqaey`I~Lhc8bQjQ;b9di%n9_riL4VZA?BT%gc&;HC?*=-Ux2N2b{wRPH`S*xPXhegv+>s>u^18z)gh>HzE!ZL=le| z5|D@_BqIgskRBP3iZo=W>c_jtnx ze8eYw#ut2t@9_h^;v0U%9444z9y2Up5ldLc3f5sgHeeNN*f{kk2tf&+V1z)3gha@M zLg)xRVIWk(1ZE^Uq7aqn4-(LQ0?~+p7>S9PiG|n^d*VQ>#6}!RjwB={d6JO=DUuQ? zlM1OL^`wDRNsTm;9a+dq_GBXmawI2mCKqx??#TnWk{fxXIEqk|;weT6zY_S=KDT9e z-7db=^%lKt&`*`_=XyFL?cvjV@kyTXb$9U1=6k&V{Bid3#4g;!XUEygmi=FtHymfL zPi)~meDMJLw!?SJ{&CJfKiM>|?dtNTEjfLAz6;&{nH)eRcJ1CuOUz_X^}+rFTP29vb2E|M*M~ sWUv0;muI7`KBVol{*!mmkK|+cZ5A^}_s6#07RbSZA0L&&0<;ML09iH+!vFvP literal 546 zcmV+-0^R)|iwFqSHKt(#19W9`bTKt9ba-?C&6P`QlR*@Q_x_4!sT-MdnOl}(ap$J( zN~C<3`J_-plBS}+-Xu+=(U?%dS{Q~|%o(2d%=^w85xL?J5Ch)#^eM9joOti+Dk z69?i*T)|AFKoXLY?5F_U7m%D3Nr{w6g;Yr$sV5Djk<>^NIgo{{WFtE{k`pmKl}&G&f!*=hCi#4g<9^V8~OtNt&{8&9j(C${h& zUpk_`?fCB1KhF7=XPd*vc5{8#=A6I1+=ceJXLd_|pe?q0@z>+w_Vs-pYNI?TXxqgq zp!fY;&#R#8z8mFVg>l0vf4Y(9|BtyIiPHFgACgUP^-sNh)?e%n{e<0z-|k|qG4Qop kuviX5TP&vK&CR!63)=YlP=P$QK#vyu0JKzLn6wE10El1~J^%m! From 33663e68b093ffdb28ff5e31f9dd3f360eb9dbf7 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 19 Apr 2022 18:37:14 +0200 Subject: [PATCH 804/883] rename frame_type --- common/utils/nr/nr_common.c | 4 ++-- common/utils/nr/nr_common.h | 2 +- openair1/PHY/LTE_TRANSPORT/prach.c | 2 +- openair1/PHY/LTE_TRANSPORT/prach_common.c | 2 +- openair1/PHY/LTE_TRANSPORT/prach_extern.h | 2 +- openair1/PHY/LTE_TRANSPORT/transport_common_proto.h | 4 ++-- openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c | 10 +++++----- openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c | 2 +- openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h | 4 ++-- openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h | 4 ++-- openair1/PHY/defs_common.h | 4 ++-- openair1/PHY/defs_nr_common.h | 2 +- openair1/SCHED/phy_procedures_lte_common.c | 2 +- openair1/SCHED/sched_common.h | 2 +- openair1/SCHED/sched_eNB.h | 2 +- openair1/SCHED_UE/phy_procedures_lte_ue.c | 2 +- openair1/SCHED_UE/sched_UE.h | 2 +- openair1/SIMULATION/LTE_PHY/pdcchsim.c | 2 +- openair2/COMMON/m2ap_messages_types.h | 4 ++-- openair2/COMMON/m3ap_messages_types.h | 2 +- openair2/COMMON/phy_messages_types.h | 2 +- openair2/COMMON/rrc_messages_types.h | 4 ++-- openair2/COMMON/x2ap_messages_types.h | 2 +- openair2/ENB_APP/RRC_config_tools.h | 2 +- openair2/ENB_APP/flexran_agent_ran_api.c | 2 +- openair2/ENB_APP/flexran_agent_ran_api.h | 2 +- openair2/GNB_APP/gnb_config.c | 2 +- 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/config_ue.c | 2 +- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 2 +- openair2/LAYER2/NR_MAC_gNB/config.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 6 +++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 +- openair2/M2AP/m2ap_MCE_defs.h | 2 +- openair2/M2AP/m2ap_eNB_defs.h | 2 +- openair2/RRC/LTE/rrc_eNB_S1AP.c | 2 +- openair2/RRC/NR/nr_rrc_config.c | 4 ++-- openair2/UTIL/OCG/OCG.h | 2 +- openair2/X2AP/x2ap_eNB_defs.h | 2 +- openair3/M3AP/m3ap_MCE_defs.h | 2 +- openair3/M3AP/m3ap_MME_defs.h | 2 +- targets/RT/USER/lte-ue.c | 2 +- 45 files changed, 59 insertions(+), 59 deletions(-) diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c index 49743b3bdc..0aeeaf3afd 100644 --- a/common/utils/nr/nr_common.c +++ b/common/utils/nr/nr_common.c @@ -336,9 +336,9 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) { return p; } -lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index) +frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index) { - lte_frame_type_t current_type; + frame_type_t current_type; int32_t delta_duplex = get_delta_duplex(current_band, scs_index); if (delta_duplex == 0) diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h index 0150cf59f8..a09532a565 100644 --- a/common/utils/nr/nr_common.h +++ b/common/utils/nr/nr_common.h @@ -63,7 +63,7 @@ void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset); uint16_t config_bandwidth(int mu, int nb_rb, int nr_band); int get_nr_table_idx(int nr_bandP, uint8_t scs_index); int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index); -lte_frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index); +frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index); uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex); int NRRIV2BW(int locationAndBandwidth,int N_RB); int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB); diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index eb46a8d663..91c419ebe3 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -56,7 +56,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, uint8_t ce_level ) { int i; - lte_frame_type_t frame_type; + frame_type_t frame_type; uint16_t rootSequenceIndex; uint8_t prach_ConfigIndex; uint8_t Ncs_config; diff --git a/openair1/PHY/LTE_TRANSPORT/prach_common.c b/openair1/PHY/LTE_TRANSPORT/prach_common.c index e366e8edbc..f3409a90e3 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach_common.c +++ b/openair1/PHY/LTE_TRANSPORT/prach_common.c @@ -399,7 +399,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex, uint8_t prach_ConfigIndex, uint8_t zeroCorrelationZoneConfig, uint8_t highSpeedFlag, - lte_frame_type_t frame_type, + frame_type_t frame_type, uint32_t X_u[64][839]) { // Compute DFT of x_u => X_u[k] = x_u(inv(u)*k)^* X_u[k] = exp(j\pi u*inv(u)*k*(inv(u)*k+1)/N_ZC) unsigned int k,inv_u,i,NCS=0,num_preambles; diff --git a/openair1/PHY/LTE_TRANSPORT/prach_extern.h b/openair1/PHY/LTE_TRANSPORT/prach_extern.h index 3404646923..3403861011 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach_extern.h +++ b/openair1/PHY/LTE_TRANSPORT/prach_extern.h @@ -81,7 +81,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex, uint8_t prach_ConfigIndex, uint8_t zeroCorrelationZoneConfig, uint8_t highSpeedFlag, - lte_frame_type_t frame_type, + frame_type_t frame_type, uint32_t X_u[64][839]); #endif diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h index af8e63c3ed..74a38e58db 100644 --- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h +++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h @@ -224,7 +224,7 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id); @returns 0-1 accordingly */ /* -uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type); +uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,frame_type_t frame_type); */ /*! @@ -247,7 +247,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex, uint8_t prach_ConfigIndex, uint8_t zeroCorrelationZoneConfig, uint8_t highSpeedFlag, - lte_frame_type_t frame_type, + frame_type_t frame_type, uint32_t X_u[64][839]); diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c index efde277203..088e2c0a5e 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dci_tools_ue.c @@ -64,7 +64,7 @@ extern uint16_t beta_cqi[16]; extern uint16_t beta_ri[16]; extern uint16_t beta_ack[16]; -void extract_dci1A_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) +void extract_dci1A_info(uint8_t N_RB_DL, frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) { uint8_t harq_pid=0; uint32_t rballoc=0; @@ -182,7 +182,7 @@ void extract_dci1A_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_ pdci_info_extarcted->dai = dai; } -void extract_dci1C_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) +void extract_dci1C_info(uint8_t N_RB_DL, frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) { uint32_t rballoc=0; @@ -222,7 +222,7 @@ void extract_dci1C_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_ pdci_info_extarcted->Ngap = Ngap; } -void extract_dci1_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) +void extract_dci1_info(uint8_t N_RB_DL, frame_type_t frame_type, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) { uint32_t rballoc=0; @@ -329,7 +329,7 @@ void extract_dci1_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, void *dci_p } -void extract_dci2_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, uint8_t nb_antenna_ports_eNB, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) +void extract_dci2_info(uint8_t N_RB_DL, frame_type_t frame_type, uint8_t nb_antenna_ports_eNB, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) { uint32_t rballoc=0; @@ -615,7 +615,7 @@ void extract_dci2_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, uint8_t nb_ } -void extract_dci2A_info(uint8_t N_RB_DL, lte_frame_type_t frame_type, uint8_t nb_antenna_ports_eNB, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) +void extract_dci2A_info(uint8_t N_RB_DL, frame_type_t frame_type, uint8_t nb_antenna_ports_eNB, void *dci_pdu, DCI_INFO_EXTRACTED_t *pdci_info_extarcted) { uint32_t rballoc=0; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c index 82120dc3c3..4faa8367c3 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c @@ -46,7 +46,7 @@ //#define PRACH_DEBUG 1 int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf ) { - lte_frame_type_t frame_type = ue->frame_parms.frame_type; + frame_type_t frame_type = ue->frame_parms.frame_type; //uint8_t tdd_config = ue->frame_parms.tdd_config; uint16_t rootSequenceIndex = ue->frame_parms.prach_config_common.rootSequenceIndex; uint8_t prach_ConfigIndex = ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex; diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h index c5d096ceb7..05a5904971 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h +++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h @@ -1669,7 +1669,7 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id); @param frame_type 0-FDD, 1-TDD @returns 0-1 accordingly */ -uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type); +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 @@ -1691,7 +1691,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex, uint8_t prach_ConfigIndex, uint8_t zeroCorrelationZoneConfig, uint8_t highSpeedFlag, - lte_frame_type_t frame_type, + frame_type_t frame_type, uint32_t X_u[64][839]); 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 dc0f38f096..65c0ec9381 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -1567,7 +1567,7 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id); @param frame_type 0-FDD, 1-TDD @returns 0-1 accordingly */ -uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type); +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 @@ -1589,7 +1589,7 @@ void compute_prach_seq(uint16_t rootSequenceIndex, uint8_t prach_ConfigIndex, uint8_t zeroCorrelationZoneConfig, uint8_t highSpeedFlag, - lte_frame_type_t frame_type, + frame_type_t frame_type, uint32_t X_u[64][839]); diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h index 86df85db5c..d13fe260de 100644 --- a/openair1/PHY/defs_common.h +++ b/openair1/PHY/defs_common.h @@ -99,7 +99,7 @@ #define NB_RX_ANTENNAS_MAX 64 -typedef enum {TDD=1,FDD=0} lte_frame_type_t; +typedef enum {TDD=1,FDD=0} frame_type_t; typedef enum {EXTENDED=1,NORMAL=0} lte_prefix_type_t; @@ -597,7 +597,7 @@ typedef struct LTE_DL_FRAME_PARMS { /// shift of pilot position in one RB uint8_t nushift; /// Frame type (0 FDD, 1 TDD) - lte_frame_type_t frame_type; + frame_type_t frame_type; /// TDD subframe assignment (0-7) (default = 3) (254=RX only, 255=TX only) uint8_t tdd_config; /// TDD S-subframe configuration (0-9) diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index 7c78d20ae5..756e6b7210 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -280,7 +280,7 @@ struct NR_DL_FRAME_PARMS { uint32_t att_rx; /// total Number of Resource Block Groups: this is ceil(N_PRB/P) /// Frame type (0 FDD, 1 TDD) - lte_frame_type_t frame_type; + frame_type_t frame_type; uint8_t tdd_config; /// Cell ID uint16_t Nid_cell; diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index 7033c52701..9de453da94 100644 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -994,7 +994,7 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf return(isSubframeSRS); } -void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset) +void compute_srs_pos(frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset) { if(TDD == frameType) { diff --git a/openair1/SCHED/sched_common.h b/openair1/SCHED/sched_common.h index c9fc338686..9f3e6695b6 100644 --- a/openair1/SCHED/sched_common.h +++ b/openair1/SCHED/sched_common.h @@ -339,7 +339,7 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, unsig int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx); -void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); +void compute_srs_pos(frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); /* from here: prototype added to remove compilation warnings, doc to be written by the author of the function */ diff --git a/openair1/SCHED/sched_eNB.h b/openair1/SCHED/sched_eNB.h index de987b0ac7..efdb1bd199 100644 --- a/openair1/SCHED/sched_eNB.h +++ b/openair1/SCHED/sched_eNB.h @@ -215,7 +215,7 @@ int16_t get_target_pucch_rx_power(module_id_t module_idP, uint8_t CC_id); int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx); -void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); +void compute_srs_pos(frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); void release_rnti_of_phy(module_id_t mod_id); /*@}*/ diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index b02f24e04e..67513b9c59 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -574,7 +574,7 @@ void get_cqipmiri_params(PHY_VARS_UE *ue, } } -PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type, +PUCCH_FMT_t get_pucch_format(frame_type_t frame_type, lte_prefix_type_t cyclic_prefix_type, uint8_t SR_payload, uint8_t nb_cw, diff --git a/openair1/SCHED_UE/sched_UE.h b/openair1/SCHED_UE/sched_UE.h index 32702b1148..0dbb779630 100644 --- a/openair1/SCHED_UE/sched_UE.h +++ b/openair1/SCHED_UE/sched_UE.h @@ -278,7 +278,7 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe, unsig int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx); -void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); +void compute_srs_pos(frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); /*@}*/ diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c index bd2c2d66b9..50910290c3 100644 --- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c +++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c @@ -415,7 +415,7 @@ int main(int argc, char **argv) { uint8_t harq_pid; uint8_t phich_ACK; uint8_t num_phich_interf = 0; - lte_frame_type_t frame_type=TDD; + frame_type_t frame_type=TDD; // int re_offset; // uint32_t *txptr; int aarx; diff --git a/openair2/COMMON/m2ap_messages_types.h b/openair2/COMMON/m2ap_messages_types.h index c70c50fc64..460dbfc4bb 100644 --- a/openair2/COMMON/m2ap_messages_types.h +++ b/openair2/COMMON/m2ap_messages_types.h @@ -354,7 +354,7 @@ typedef struct m2ap_register_mce_req_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; int num_cc; @@ -427,7 +427,7 @@ typedef struct m2ap_register_enb_req_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; int num_cc; diff --git a/openair2/COMMON/m3ap_messages_types.h b/openair2/COMMON/m3ap_messages_types.h index 21e24dd449..36ac8fcc9a 100644 --- a/openair2/COMMON/m3ap_messages_types.h +++ b/openair2/COMMON/m3ap_messages_types.h @@ -123,7 +123,7 @@ typedef struct m3ap_register_mce_req_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; int num_cc; diff --git a/openair2/COMMON/phy_messages_types.h b/openair2/COMMON/phy_messages_types.h index 1f040a0a77..40e4678228 100644 --- a/openair2/COMMON/phy_messages_types.h +++ b/openair2/COMMON/phy_messages_types.h @@ -70,7 +70,7 @@ typedef struct CellInfo_s { //-------------------------------------------------------------------------------------------// // eNB: ENB_APP -> PHY messages typedef struct PhyConfigurationReq_s { - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; lte_prefix_type_t prefix_type[MAX_NUM_CCs]; uint32_t downlink_frequency[MAX_NUM_CCs]; int32_t uplink_frequency_offset[MAX_NUM_CCs]; diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index ac70dee092..5b214cf95a 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -188,7 +188,7 @@ typedef struct RrcConfigurationReq_s { uint32_t rrc_inactivity_timer_thres; // for testing, maybe change later paging_drx_t default_drx; int16_t nb_cc; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint8_t tdd_config[MAX_NUM_CCs]; uint8_t tdd_config_s[MAX_NUM_CCs]; lte_prefix_type_t prefix_type[MAX_NUM_CCs]; @@ -339,7 +339,7 @@ typedef struct NbIoTRrcConfigurationReq_s { uint16_t mcc; uint16_t mnc; uint8_t mnc_digit_length; - lte_frame_type_t frame_type; + frame_type_t frame_type; uint8_t tdd_config; uint8_t tdd_config_s; lte_prefix_type_t prefix_type; diff --git a/openair2/COMMON/x2ap_messages_types.h b/openair2/COMMON/x2ap_messages_types.h index 9339ab12f3..cd092b6ca8 100644 --- a/openair2/COMMON/x2ap_messages_types.h +++ b/openair2/COMMON/x2ap_messages_types.h @@ -138,7 +138,7 @@ typedef struct x2ap_register_enb_req_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; uint32_t subframeAssignment[MAX_NUM_CCs]; diff --git a/openair2/ENB_APP/RRC_config_tools.h b/openair2/ENB_APP/RRC_config_tools.h index 488441ff59..89cefeaa1f 100644 --- a/openair2/ENB_APP/RRC_config_tools.h +++ b/openair2/ENB_APP/RRC_config_tools.h @@ -38,7 +38,7 @@ typedef struct eutra_band_s { uint32_t ul_max; uint32_t dl_min; uint32_t dl_max; - lte_frame_type_t frame_type; + frame_type_t frame_type; } eutra_band_t; diff --git a/openair2/ENB_APP/flexran_agent_ran_api.c b/openair2/ENB_APP/flexran_agent_ran_api.c index 68d1f3311f..9926ec9e20 100644 --- a/openair2/ENB_APP/flexran_agent_ran_api.c +++ b/openair2/ENB_APP/flexran_agent_ran_api.c @@ -1352,7 +1352,7 @@ void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t } } -void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, lte_frame_type_t frame_type) { +void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, frame_type_t frame_type) { if (phy_is_present(mod_id, cc_id)) { RC.eNB[mod_id][cc_id]->frame_parms.frame_type = frame_type; } else { diff --git a/openair2/ENB_APP/flexran_agent_ran_api.h b/openair2/ENB_APP/flexran_agent_ran_api.h index 79115b0a16..c15865ccfd 100644 --- a/openair2/ENB_APP/flexran_agent_ran_api.h +++ b/openair2/ENB_APP/flexran_agent_ran_api.h @@ -433,7 +433,7 @@ void flexran_agent_set_operating_eutra_band(mid_t mod_id, uint8_t cc_id, uint8_t void flexran_agent_set_operating_bandwidth(mid_t mod_id, uint8_t cc_id, uint8_t N_RB); /*set frame type*/ -void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, lte_frame_type_t frame_type); +void flexran_agent_set_operating_frame_type(mid_t mod_id, uint8_t cc_id, frame_type_t frame_type); /*RRC status flexRAN*/ uint8_t flexran_get_rrc_status(mid_t mod_id, rnti_t rnti); diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 434a2896de..2c486ec832 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -346,7 +346,7 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { // prepare DL Allocation lists nr_rrc_config_dl_tda(scc); - lte_frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); if (frame_type == FDD) { ASN_STRUCT_FREE(asn_DEF_NR_TDD_UL_DL_ConfigCommon, scc->tdd_UL_DL_ConfigurationCommon); scc->tdd_UL_DL_ConfigurationCommon = NULL; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index b25efbb5d8..581930b83d 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -3092,7 +3092,7 @@ int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slo else return(slot_in_period <= slots1+tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0); } -int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slot, lte_frame_type_t frame_type) { +int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slot, frame_type_t frame_type) { int period,period1,period2=0; diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 0f2cb42b88..e8a3af2498 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -45,7 +45,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slot_t slotP); -int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slotP, lte_frame_type_t frame_type); +int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, slot_t slotP, frame_type_t frame_type); uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDLBWP, const NR_BWP_UplinkCommon_t *initialULBWP, diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 3b10167e03..bd693e4d88 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -323,7 +323,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, uint32_t band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; mac->frequency_range = band<100?FR1:FR2; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); // cell config diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index fc2c2d2c8b..99cbdf3292 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -369,7 +369,7 @@ typedef struct { NR_ControlResourceSet_t *coreset[MAX_NUM_BWP][FAPI_NR_MAX_CORESET_PER_BWP]; NR_SearchSpace_t *SSpace[MAX_NUM_BWP][FAPI_NR_MAX_SS]; - lte_frame_type_t frame_type; + frame_type_t frame_type; /*BWP*/ // dedicated active DL BWP diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 6ba8629718..a2cbd4807f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -233,7 +233,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, rrc_pdsch_AntennaPorts uint32_t band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; frequency_range_t frequency_range = band<100?FR1:FR2; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); RC.nrmac[Mod_idP]->common_channels[0].frame_type = frame_type; // Cell configuration diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index ca197b224d..3d17e966a9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -399,7 +399,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, uint16_t *msg2_frame, uint16_t *msg2_slot, NR_ServingCellConfigCommon_t *scc, - lte_frame_type_t frame_type, + frame_type_t frame_type, uint16_t monitoring_slot_period, uint16_t monitoring_offset,uint8_t beam_index, uint8_t num_active_ssb, @@ -525,7 +525,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, gNB_MAC_INST *nr_mac = RC.nrmac[module_idP]; NR_COMMON_channels_t *cc = &nr_mac->common_channels[CC_id]; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; - lte_frame_type_t frame_type = cc->frame_type; + frame_type_t frame_type = cc->frame_type; uint8_t total_RApreambles = MAX_NUM_NR_PRACH_PREAMBLES; uint8_t num_ssb_per_RO = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present; @@ -933,7 +933,7 @@ void nr_get_Msg3alloc(module_id_t module_id, uint16_t msg3_nb_rb = 8; // sdu has 6 or 8 bytes - lte_frame_type_t frame_type = RC.nrmac[module_id]->common_channels->frame_type; + frame_type_t frame_type = RC.nrmac[module_id]->common_channels->frame_type; int mu = ubwp ? ubwp->bwp_Common->genericParameters.subcarrierSpacing : diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 5aace1d0dc..7806d6011d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -62,7 +62,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * /* there is a mixed slot only when in TDD */ NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon; - lte_frame_type_t frame_type = nrmac->common_channels->frame_type; + frame_type_t frame_type = nrmac->common_channels->frame_type; const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 9273c38de3..7342864763 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -55,7 +55,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub /* there is a mixed slot only when in TDD */ NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon; - lte_frame_type_t frame_type = nrmac->common_channels->frame_type; + frame_type_t frame_type = nrmac->common_channels->frame_type; const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; NR_ServingCellConfigCommonSIB_t *scc_sib1 = get_softmodem_params()->sa ? diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 0f538131dd..0ed70444b1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -202,7 +202,7 @@ typedef struct { int p_gNB; int Ncp; int nr_band; - lte_frame_type_t frame_type; + frame_type_t frame_type; uint64_t dl_CarrierFreq; NR_BCCH_BCH_Message_t *mib; NR_BCCH_DL_SCH_Message_t *sib1; diff --git a/openair2/M2AP/m2ap_MCE_defs.h b/openair2/M2AP/m2ap_MCE_defs.h index 5267232d69..73183e89c2 100644 --- a/openair2/M2AP/m2ap_MCE_defs.h +++ b/openair2/M2AP/m2ap_MCE_defs.h @@ -170,7 +170,7 @@ typedef struct m2ap_MCE_instance_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; int num_cc; diff --git a/openair2/M2AP/m2ap_eNB_defs.h b/openair2/M2AP/m2ap_eNB_defs.h index b8f7e4b3c6..0b30c33d80 100644 --- a/openair2/M2AP/m2ap_eNB_defs.h +++ b/openair2/M2AP/m2ap_eNB_defs.h @@ -181,7 +181,7 @@ typedef struct m2ap_eNB_instance_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; int num_cc; diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index 9b9e267828..f24c9ab1b6 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -1757,7 +1757,7 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance && RC.rrc[instance]->configuration.mnc[j] == S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mnc && RC.rrc[instance]->configuration.tac == S1AP_PAGING_IND(msg_p).tac[tai_size]) { for (uint8_t CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { - lte_frame_type_t frame_type = RC.eNB[instance][CC_id]->frame_parms.frame_type; + frame_type_t frame_type = RC.eNB[instance][CC_id]->frame_parms.frame_type; /* get nB from configuration */ /* get default DRX cycle from configuration */ Tc = (uint8_t)RC.rrc[instance]->configuration.radioresourceconfig[CC_id].pcch_defaultPagingCycle; diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index bb2a180146..54fb5a168b 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -216,7 +216,7 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; // coreset duration setting to be improved in the framework of RRC harmonization, potentially using a common function int len_coreset = 1; @@ -253,7 +253,7 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){ uint8_t DELTA[4]= {2,3,4,6}; // Delta parameter for Msg3 int mu = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing; - lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); + frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); struct NR_PUSCH_TimeDomainResourceAllocation *pusch_timedomainresourceallocation = CALLOC(1,sizeof(struct NR_PUSCH_TimeDomainResourceAllocation)); pusch_timedomainresourceallocation->k2 = CALLOC(1,sizeof(long)); diff --git a/openair2/UTIL/OCG/OCG.h b/openair2/UTIL/OCG/OCG.h index 58cc7184e7..452581bb17 100644 --- a/openair2/UTIL/OCG/OCG.h +++ b/openair2/UTIL/OCG/OCG.h @@ -700,7 +700,7 @@ typedef struct { unsigned int n_frames_flag; // if set, then let the emulation goes to infinity node_function_t node_function[MAX_NUM_CCs]; node_timing_t node_timing[MAX_NUM_CCs]; - unsigned char frame_type[MAX_NUM_CCs]; //! LTE frame type (TDD=1, FDD=0). \note this should be converted to \ref lte_frame_type_t (header file reorganization needed) + unsigned char frame_type[MAX_NUM_CCs]; //! LTE frame type (TDD=1, FDD=0). \note this should be converted to \ref frame_type_t (header file reorganization needed) char *frame_type_name[MAX_NUM_CCs]; unsigned char tdd_config[MAX_NUM_CCs]; unsigned char tdd_config_S[MAX_NUM_CCs]; diff --git a/openair2/X2AP/x2ap_eNB_defs.h b/openair2/X2AP/x2ap_eNB_defs.h index 063302d03a..bd6092e0cb 100644 --- a/openair2/X2AP/x2ap_eNB_defs.h +++ b/openair2/X2AP/x2ap_eNB_defs.h @@ -172,7 +172,7 @@ typedef struct x2ap_eNB_instance_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; uint32_t subframeAssignment[MAX_NUM_CCs]; diff --git a/openair3/M3AP/m3ap_MCE_defs.h b/openair3/M3AP/m3ap_MCE_defs.h index 18ad70a408..4dcb2b4db0 100644 --- a/openair3/M3AP/m3ap_MCE_defs.h +++ b/openair3/M3AP/m3ap_MCE_defs.h @@ -170,7 +170,7 @@ typedef struct m3ap_MCE_instance_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; int num_cc; diff --git a/openair3/M3AP/m3ap_MME_defs.h b/openair3/M3AP/m3ap_MME_defs.h index 3b5725655d..6608587cc3 100644 --- a/openair3/M3AP/m3ap_MME_defs.h +++ b/openair3/M3AP/m3ap_MME_defs.h @@ -170,7 +170,7 @@ typedef struct m3ap_MME_instance_s { int32_t uplink_frequency_offset[MAX_NUM_CCs]; uint32_t Nid_cell[MAX_NUM_CCs]; int16_t N_RB_DL[MAX_NUM_CCs]; - lte_frame_type_t frame_type[MAX_NUM_CCs]; + frame_type_t frame_type[MAX_NUM_CCs]; uint32_t fdd_earfcn_DL[MAX_NUM_CCs]; uint32_t fdd_earfcn_UL[MAX_NUM_CCs]; int num_cc; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 9010a40bf9..eaeb22d096 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -111,7 +111,7 @@ typedef struct eutra_band_s { uint32_t ul_max; uint32_t dl_min; uint32_t dl_max; - lte_frame_type_t frame_type; + frame_type_t frame_type; } eutra_band_t; typedef struct band_info_s { From 32b2f76c578ae6f2443d6cb9f3aac6f63a9a6625 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 20 Apr 2022 14:30:13 +0200 Subject: [PATCH 805/883] fix(ci): first port to the new Eurecom infrastructure: * Proxy no longer required for git cloning * Most of the IP addresses have been changed - Remaining --> 192.168.18.89 for amariue Signed-off-by: Raphael Defosseux --- ci-scripts/build_fr1_template.yaml | 2 +- ci-scripts/ci_ueinfra.yaml | 6 +-- ci-scripts/cls_containerize.py | 46 +++++++++---------- .../enb.band38.lte_2x2.100PRB.usrpn310.conf | 2 +- ...nb.band38.lte_2x2_tm2.100PRB.usrpn310.conf | 2 +- .../enb.band38.nsa_2x2.100PRB.usrpn310.conf | 2 +- ...sci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- ...oxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- .../gNB_SA_n78_106PRB.2x2_usrpn310.conf | 6 +-- .../gNB_SA_n78_133PRB.2x2_usrpn310.conf | 6 +-- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 2 +- ...and78.sa.fr1.106PRB.2x2.usrpn310.asue.conf | 2 +- ...gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf | 2 +- .../gnb.band78.sa.fr1.106PRB.usrpn310.conf | 2 +- ...gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf | 2 +- ci-scripts/main.py | 14 +++--- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 4 +- .../fr1_nsa_2x2_quectel_attach_detach.xml | 4 +- .../xml_files/fr1_sa_amarisoft_ue_1x.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_b200.xml | 2 +- ci-scripts/xml_files/fr1_sa_oaiue_n310.xml | 4 +- ci-scripts/xml_files/fr1_sa_oaiue_x300.xml | 2 +- ci-scripts/xml_files/fr1_sa_quectel.xml | 2 +- .../xml_files/fr1_sa_quectel_162prb.xml | 2 +- .../xml_files/fr1_sa_quectel_stages.xml | 2 +- .../fr1_sa_quectel_stages_162prb.xml | 2 +- ci-scripts/xml_files/lte_2x2_tm1_quectel.xml | 2 +- ci-scripts/xml_files/lte_2x2_tm2_quectel.xml | 2 +- .../4g_rfsimulator_fdd_05MHz/README.md | 2 +- .../docker-compose.yml | 2 +- .../docker-compose.yml | 2 +- .../docker-compose.yml | 2 +- .../docker-compose.yml | 2 +- .../5g_f1_rfsimulator/docker-compose.yaml | 2 +- .../5g_fdd_rfsimulator/docker-compose.yaml | 2 +- ci-scripts/yaml_files/5g_l2sim_tdd/README.md | 8 ++-- .../5g_l2sim_tdd/docker-compose.yaml | 6 +-- .../5g_rfsimulator/docker-compose.yaml | 2 +- .../fr1_epc_20897/docker-compose.yml | 2 +- .../magma_nsa_20897/docker-compose.yml | 2 +- .../nsa_b200_enb/docker-compose.yml | 4 +- .../nsa_b200_gnb/docker-compose.yml | 4 +- 42 files changed, 86 insertions(+), 86 deletions(-) diff --git a/ci-scripts/build_fr1_template.yaml b/ci-scripts/build_fr1_template.yaml index 02e49bc4b5..5c7b2fc6f4 100755 --- a/ci-scripts/build_fr1_template.yaml +++ b/ci-scripts/build_fr1_template.yaml @@ -14,7 +14,7 @@ steps: ADB: #on Caracal - ADBIPAddress : 192.168.18.196 + ADBIPAddress : 172.21.16.132 ADBUserName : oaici ADBPassword : KkexF6CErOi1fNuebCPsuIVK diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index 89bda5fa92..b58e14ff6a 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -12,7 +12,7 @@ idefix: LogStore : /media/usb-drive/ci_qlogs PLMN : 22201 UENetwork : wwan0 - HostIPAddress : 192.168.18.188 + HostIPAddress : 172.21.16.135 HostUsername : oaicicd HostPassword : oaicicd HostSourceCodePath : none @@ -32,7 +32,7 @@ nrmodule2_quectel: LogStore : /media/ci_qlogs PLMN : 20897 UENetwork : wwan0 - HostIPAddress : 192.168.18.189 + HostIPAddress : 172.21.16.139 HostUsername : nrmodule2 HostPassword : linux HostSourceCodePath : none @@ -97,7 +97,7 @@ dummy: DetachScript : '' PLMN : 22201 UENetwork : wwan0 - HostIPAddress : 192.168.18.188 + HostIPAddress : 172.21.16.135 HostUsername : oaicicd HostPassword : oaicicd HostSourceCodePath : none diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 8092febe39..89a3ac586d 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -243,7 +243,7 @@ class Containerize(): # Build the base image only on Push Events (not on Merge Requests) # On when the base image docker file is being modified. if forceBaseImageBuild: - mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target ' + baseImage + ' --tag ' + baseImage + ':' + baseTag + ' --file docker/Dockerfile.base' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-base.log 2>&1', '\$', 1600) + mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target ' + baseImage + ' --tag ' + baseImage + ':' + baseTag + ' --file docker/Dockerfile.base' + self.dockerfileprefix + ' . > cmake_targets/log/ran-base.log 2>&1', '\$', 1600) # First verify if the base image was properly created. status = True mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + baseImage + ':' + baseTag, '\$', 5) @@ -1146,19 +1146,19 @@ class Containerize(): mySSH.open(ipAddr, userName, password) # Check if route to asterix gnb exists mySSH.command('ip route | grep --colour=never "192.168.68.64/26"', '\$', 10) - result = re.search('192.168.18.194', mySSH.getBefore()) + result = re.search('172.21.16.127', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.64/26 via 192.168.18.194 dev eno1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.64/26 via 172.21.16.127 dev eno1', '\$', 10) # Check if route to obelix enb exists mySSH.command('ip route | grep --colour=never "192.168.68.128/26"', '\$', 10) - result = re.search('192.168.18.193', mySSH.getBefore()) + result = re.search('172.21.16.128', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev eno1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 172.21.16.128 dev eno1', '\$', 10) # Check if route to nepes gnb exists mySSH.command('ip route | grep --colour=never "192.168.68.192/26"', '\$', 10) - result = re.search('192.168.18.209', mySSH.getBefore()) + result = re.search('172.21.16.137', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.192/26 via 192.168.18.209 dev eno1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.192/26 via 172.21.16.137 dev eno1', '\$', 10) # Check if forwarding is enabled mySSH.command('sysctl net.ipv4.conf.all.forwarding', '\$', 10) result = re.search('net.ipv4.conf.all.forwarding = 1', mySSH.getBefore()) @@ -1174,19 +1174,19 @@ class Containerize(): mySSH.open(ipAddr, userName, password) # Check if route to porcepix epc exists mySSH.command('ip route | grep --colour=never "192.168.61.192/26"', '\$', 10) - result = re.search('192.168.18.210', mySSH.getBefore()) + result = re.search('172.21.16.136', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev em1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 172.21.16.136 dev em1', '\$', 10) # Check if route to porcepix cn5g exists mySSH.command('ip route | grep --colour=never "192.168.70.128/26"', '\$', 10) - result = re.search('192.168.18.210', mySSH.getBefore()) + result = re.search('172.21.16.136', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.70.128/26 via 192.168.18.210 dev em1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.70.128/26 via 172.21.16.136 dev em1', '\$', 10) # Check if X2 route to obelix enb exists mySSH.command('ip route | grep --colour=never "192.168.68.128/26"', '\$', 10) - result = re.search('192.168.18.193', mySSH.getBefore()) + result = re.search('172.21.16.128', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev em1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 172.21.16.128 dev em1', '\$', 10) # Check if forwarding is enabled mySSH.command('sysctl net.ipv4.conf.all.forwarding', '\$', 10) result = re.search('net.ipv4.conf.all.forwarding = 1', mySSH.getBefore()) @@ -1202,19 +1202,19 @@ class Containerize(): mySSH.open(ipAddr, userName, password) # Check if route to porcepix epc exists mySSH.command('ip route | grep --colour=never "192.168.61.192/26"', '\$', 10) - result = re.search('192.168.18.210', mySSH.getBefore()) + result = re.search('172.21.16.136', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev eno1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 172.21.16.136 dev eno1', '\$', 10) # Check if X2 route to asterix gnb exists mySSH.command('ip route | grep --colour=never "192.168.68.64/26"', '\$', 10) - result = re.search('192.168.18.194', mySSH.getBefore()) + result = re.search('172.21.16.127', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.64/26 via 192.168.18.194 dev eno1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.64/26 via 172.21.16.127 dev eno1', '\$', 10) # Check if X2 route to nepes gnb exists mySSH.command('ip route | grep --colour=never "192.168.68.192/26"', '\$', 10) - result = re.search('192.168.18.209', mySSH.getBefore()) + result = re.search('172.21.16.137', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.192/26 via 192.168.18.209 dev eno1', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.192/26 via 172.21.16.137 dev eno1', '\$', 10) # Check if forwarding is enabled mySSH.command('sysctl net.ipv4.conf.all.forwarding', '\$', 10) result = re.search('net.ipv4.conf.all.forwarding = 1', mySSH.getBefore()) @@ -1230,14 +1230,14 @@ class Containerize(): mySSH.open(ipAddr, userName, password) # Check if route to porcepix epc exists mySSH.command('ip route | grep --colour=never "192.168.61.192/26"', '\$', 10) - result = re.search('192.168.18.210', mySSH.getBefore()) + result = re.search('172.21.16.136', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev enp0s31f6', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 172.21.16.136 dev enp0s31f6', '\$', 10) # Check if X2 route to obelix enb exists mySSH.command('ip route | grep --colour=never "192.168.68.128/26"', '\$', 10) - result = re.search('192.168.18.193', mySSH.getBefore()) + result = re.search('172.21.16.128', mySSH.getBefore()) if result is None: - mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev enp0s31f6', '\$', 10) + mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 172.21.16.128 dev enp0s31f6', '\$', 10) # Check if forwarding is enabled mySSH.command('sysctl net.ipv4.conf.all.forwarding', '\$', 10) result = re.search('net.ipv4.conf.all.forwarding = 1', mySSH.getBefore()) diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf index fe2e031acb..a7100a97e3 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=172.21.19.13,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf index a0742c57a6..1f358c1571 100644 --- a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=172.21.19.13,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf index dfc9beda71..f7088aee52 100644 --- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf +++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf @@ -237,7 +237,7 @@ RUs = ( max_pdschReferenceSignalPower = -27; max_rxgain = 75; eNB_instances = [0]; - sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2"; + sdr_addrs = "mgmt_addr=172.21.19.13,addr=192.168.20.2,second_addr=192.168.10.2"; } ); diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index 40f6f911b1..51ffb1d5cd 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -239,7 +239,7 @@ RUs = ( #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "external"; - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf index edcd4f06ff..f80ce3751a 100644 --- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -240,7 +240,7 @@ RUs = ( #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "external"; - sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf index 33ab30887f..d6edc09286 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf @@ -209,9 +209,9 @@ gNBs = { GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.194/24"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.127/24"; GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.194/24"; + GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.127/24"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; @@ -258,7 +258,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf index 4a5eaec89b..7f4b11c35d 100644 --- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf +++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf @@ -206,9 +206,9 @@ gNBs = { GNB_INTERFACE_NAME_FOR_NG_AMF = "em1"; - GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.194/24"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.127/24"; GNB_INTERFACE_NAME_FOR_NGU = "em1"; - GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.194/24"; + GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.127/24"; GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; @@ -254,7 +254,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; - sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index 21863dcfc7..e3bd49e7fc 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -230,7 +230,7 @@ RUs = ( bf_weights = [0x00007fff, 0x00007fff]; #clock_src = "external"; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf index 60fb16318f..5e6b3fb217 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf @@ -264,7 +264,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf index 1d7c4b57f0..8489008300 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf @@ -261,7 +261,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index e2b331939b..9e1f499f03 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -263,7 +263,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf index 324b3d2ce1..ce63578dd3 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf @@ -262,7 +262,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" } ); diff --git a/ci-scripts/main.py b/ci-scripts/main.py index c838c3740d..65f9fbb0da 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -779,19 +779,19 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re HTML.CreateHtmlTabHeader() # On CI bench w/ containers, we need to validate if IP routes are set - if EPC.IPAddress == '192.168.18.210': + if EPC.IPAddress == '172.21.16.136': CONTAINERS.CheckAndAddRoute('porcepix', EPC.IPAddress, EPC.UserName, EPC.Password) - if CONTAINERS.eNBIPAddress == '192.168.18.194': + if CONTAINERS.eNBIPAddress == '172.21.16.127': CONTAINERS.CheckAndAddRoute('asterix', CONTAINERS.eNBIPAddress, CONTAINERS.eNBUserName, CONTAINERS.eNBPassword) - if CONTAINERS.eNB1IPAddress == '192.168.18.194': + if CONTAINERS.eNB1IPAddress == '172.21.16.127': CONTAINERS.CheckAndAddRoute('asterix', CONTAINERS.eNB1IPAddress, CONTAINERS.eNB1UserName, CONTAINERS.eNB1Password) - if CONTAINERS.eNBIPAddress == '192.168.18.193': + if CONTAINERS.eNBIPAddress == '172.21.16.128': CONTAINERS.CheckAndAddRoute('obelix', CONTAINERS.eNBIPAddress, CONTAINERS.eNBUserName, CONTAINERS.eNBPassword) - if CONTAINERS.eNB1IPAddress == '192.168.18.193': + if CONTAINERS.eNB1IPAddress == '172.21.16.128': CONTAINERS.CheckAndAddRoute('obelix', CONTAINERS.eNB1IPAddress, CONTAINERS.eNB1UserName, CONTAINERS.eNB1Password) - if CONTAINERS.eNBIPAddress == '192.168.18.209': + if CONTAINERS.eNBIPAddress == '172.21.16.137': CONTAINERS.CheckAndAddRoute('nepes', CONTAINERS.eNBIPAddress, CONTAINERS.eNBUserName, CONTAINERS.eNBPassword) - if CONTAINERS.eNB1IPAddress == '192.168.18.209': + if CONTAINERS.eNB1IPAddress == '172.21.16.137': CONTAINERS.CheckAndAddRoute('nepes', CONTAINERS.eNB1IPAddress, CONTAINERS.eNB1UserName, CONTAINERS.eNB1Password) CiTestObj.FailReportCnt = 0 diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 56694920ba..a4dcb58e8b 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -68,7 +68,7 @@ lte yes yes - 192.168.18.241 + 172.21.19.13 @@ -81,7 +81,7 @@ nr yes datalog_rt_stats.2x2.yaml - 192.168.18.252 + 172.21.19.14
diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml index 840521481e..335fe873a1 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml @@ -87,7 +87,7 @@ lte yes yes - 192.168.18.241 + 172.21.19.13 @@ -100,7 +100,7 @@ nr yes datalog_rt_stats.2x2.yaml - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml index 194ed4e453..ea031a0174 100644 --- a/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml +++ b/ci-scripts/xml_files/fr1_sa_amarisoft_ue_1x.xml @@ -52,7 +52,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml b/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml index 55268b909d..5995f75a64 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_b200.xml @@ -60,7 +60,7 @@ nr yes yes - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml index 53b696c6eb..468005f54f 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_n310.xml @@ -42,7 +42,7 @@ Initialize_OAI_UE Initialize OAI UE (N310) nr - --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=192.168.18.241,addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation --log_config.global_log_options level,nocolor,time + --sa -O ../../../ci-scripts/conf_files/ue.sa.conf --usrp-args "mgmt_addr=172.21.19.13,addr=192.168.10.2" --numerology 1 -r 106 --band 78 -C 3319680000 --nokrnmod 1 --ue-txgain 0 --ue-rxgain 70 --ue-fo-compensation --log_config.global_log_options level,nocolor,time @@ -60,7 +60,7 @@ nr yes yes - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml index 8c2f7052e4..ef001a7518 100644 --- a/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml +++ b/ci-scripts/xml_files/fr1_sa_oaiue_x300.xml @@ -60,7 +60,7 @@ nr yes yes - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index 576456ebc9..4d4edab56b 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -70,7 +70,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml index c5f2ddad5f..23eaccfcfd 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -68,7 +68,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index 2707fd4ebf..603f3f919b 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -74,7 +74,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml index 661bcb32fe..9371e46ec9 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml @@ -74,7 +74,7 @@ yes yes datalog_rt_stats.2x2.yaml - 192.168.18.252 + 172.21.19.14 diff --git a/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml index 11c4abce1b..6aa53200c8 100644 --- a/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm1_quectel.xml @@ -65,7 +65,7 @@ lte yes yes - 192.168.18.241 + 172.21.19.13 diff --git a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml index 714cf51a9b..84aa87aa23 100644 --- a/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml +++ b/ci-scripts/xml_files/lte_2x2_tm2_quectel.xml @@ -65,7 +65,7 @@ lte yes yes - 192.168.18.241 + 172.21.19.13 diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md index 400559d269..be0d63838b 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md @@ -505,7 +505,7 @@ In my traffic test, I was able to ping outside of my local network. in SPGW-C config: ```yaml - DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_IPV4_ADDRESS: 172.21.3.100 DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 PUSH_PROTOCOL_OPTION: 'true' ``` diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml index b15e794c10..a260857a34 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml @@ -115,7 +115,7 @@ services: TZ: Europe/Paris SGW_INTERFACE_NAME_FOR_S11: eth0 PGW_INTERFACE_NAME_FOR_SX: eth0 - DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_IPV4_ADDRESS: 172.21.3.100 DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 PUSH_PROTOCOL_OPTION: 'true' APN_NI_1: oai.ipv4 diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml index e1e992c94c..3f63953b0e 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml @@ -115,7 +115,7 @@ services: TZ: Europe/Paris SGW_INTERFACE_NAME_FOR_S11: eth0 PGW_INTERFACE_NAME_FOR_SX: eth0 - DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_IPV4_ADDRESS: 172.21.3.100 DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 PUSH_PROTOCOL_OPTION: 'true' APN_NI_1: oai.ipv4 diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml index ad665813f2..1165400273 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml @@ -115,7 +115,7 @@ services: TZ: Europe/Paris SGW_INTERFACE_NAME_FOR_S11: eth0 PGW_INTERFACE_NAME_FOR_SX: eth0 - DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_IPV4_ADDRESS: 172.21.3.100 DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 PUSH_PROTOCOL_OPTION: 'true' APN_NI_1: oai.ipv4 diff --git a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml index ffa92bac49..86f6c80b59 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml +++ b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml @@ -115,7 +115,7 @@ services: TZ: Europe/Paris SGW_INTERFACE_NAME_FOR_S11: eth0 PGW_INTERFACE_NAME_FOR_SX: eth0 - DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_IPV4_ADDRESS: 172.21.3.100 DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 PUSH_PROTOCOL_OPTION: 'true' APN_NI_1: oai.ipv4 diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml index 74a23905f0..d52b228ec6 100644 --- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml @@ -120,7 +120,7 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 - AMF_IPV4_ADDRESS=0.0.0.0 - AMF_PORT=80 diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml index 3e46adb9e7..7758c39592 100644 --- a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml @@ -120,7 +120,7 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 - AMF_IPV4_ADDRESS=0.0.0.0 - AMF_PORT=80 diff --git a/ci-scripts/yaml_files/5g_l2sim_tdd/README.md b/ci-scripts/yaml_files/5g_l2sim_tdd/README.md index 531f2406ef..f1e1287995 100644 --- a/ci-scripts/yaml_files/5g_l2sim_tdd/README.md +++ b/ci-scripts/yaml_files/5g_l2sim_tdd/README.md @@ -326,16 +326,16 @@ Removing network l2sim-oai-traffic-net In the `SMF` section, provide your own DNS IP address: ```yaml - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 + DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 ``` -In the `gNB` section, provide your docker-host primary IP address and interface name: in our case `192.168.18.193` and `eno1`. +In the `gNB` section, provide your docker-host primary IP address and interface name: in our case `172.21.16.128` and `eno1`. ```yaml GNB_NGA_IF_NAME: eno1 - GNB_NGA_IP_ADDRESS: 192.168.18.193 + GNB_NGA_IP_ADDRESS: 172.21.16.128 GNB_NGU_IF_NAME: eno1 - GNB_NGU_IP_ADDRESS: 192.168.18.193 + GNB_NGU_IP_ADDRESS: 172.21.16.128 ``` Same thing in the `nr-ue` section: diff --git a/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml b/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml index c899f8cc7e..a28b640e1a 100644 --- a/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_l2sim_tdd/docker-compose.yaml @@ -120,7 +120,7 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 - AMF_IPV4_ADDRESS=0.0.0.0 - AMF_PORT=80 @@ -241,9 +241,9 @@ services: NSSAI_SD1: 112233 AMF_IP_ADDRESS: 192.168.71.132 GNB_NGA_IF_NAME: eno1 - GNB_NGA_IP_ADDRESS: 192.168.18.193 + GNB_NGA_IP_ADDRESS: 172.21.16.128 GNB_NGU_IF_NAME: eno1 - GNB_NGU_IP_ADDRESS: 192.168.18.193 + GNB_NGU_IP_ADDRESS: 172.21.16.128 LOCAL_S_IF_NAME: 'lo:' REMOTE_S_ADDRESS: 127.0.0.1 LOCAL_S_ADDRESS: 127.0.0.2 diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml index f27ec3050d..696d8c6698 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml +++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml @@ -120,7 +120,7 @@ services: - SMF_INTERFACE_PORT_FOR_SBI=80 - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090 - SMF_API_VERSION=v1 - - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129 + - DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100 - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4 - AMF_IPV4_ADDRESS=0.0.0.0 - AMF_PORT=80 diff --git a/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml b/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml index a3675dc78e..91d15b5251 100644 --- a/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml +++ b/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml @@ -132,7 +132,7 @@ services: TZ: Europe/Paris SGW_INTERFACE_NAME_FOR_S11: eth0 PGW_INTERFACE_NAME_FOR_SX: eth0 - DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_IPV4_ADDRESS: 172.21.3.100 DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 PUSH_PROTOCOL_OPTION: 'true' APN_NI_1: oai.ipv4 diff --git a/ci-scripts/yaml_files/magma_nsa_20897/docker-compose.yml b/ci-scripts/yaml_files/magma_nsa_20897/docker-compose.yml index df14e900e7..f320e7e3df 100644 --- a/ci-scripts/yaml_files/magma_nsa_20897/docker-compose.yml +++ b/ci-scripts/yaml_files/magma_nsa_20897/docker-compose.yml @@ -116,7 +116,7 @@ services: TZ: Europe/Paris SGW_INTERFACE_NAME_FOR_S11: eth0 PGW_INTERFACE_NAME_FOR_SX: eth0 - DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129 + DEFAULT_DNS_IPV4_ADDRESS: 172.21.3.100 DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4 PUSH_PROTOCOL_OPTION: 'true' APN_NI_1: oai.ipv4 diff --git a/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml b/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml index 92ccdf8a0a..2df5eac61b 100644 --- a/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml +++ b/ci-scripts/yaml_files/nsa_b200_enb/docker-compose.yml @@ -20,7 +20,7 @@ services: NB_PRB: 25 ENABLE_MEASUREMENT_REPORTS: 'yes' ENABLE_X2: 'yes' - MME_S1C_IP_ADDRESS: 192.168.18.210 + MME_S1C_IP_ADDRESS: 172.21.16.136 ENB_S1C_IF_NAME: eth0 ENB_S1C_IP_ADDRESS: 192.168.68.130 ENB_S1U_IF_NAME: eth0 @@ -29,7 +29,7 @@ services: RRC_INACTIVITY_THRESHOLD: 0 FLEXRAN_ENABLED: 'no' FLEXRAN_INTERFACE_NAME: eth0 - FLEXRAN_IPV4_ADDRESS: 192.168.18.210 + FLEXRAN_IPV4_ADDRESS: 172.21.16.136 THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time,line_num,function volumes: diff --git a/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml index c6096956a8..61266aa2b1 100644 --- a/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml @@ -15,7 +15,7 @@ services: TAC: 1 ENABLE_X2: 'yes' ENB_X2_IP_ADDRESS: 192.168.68.130 - MME_S1C_IP_ADDRESS: 192.168.18.210 + MME_S1C_IP_ADDRESS: 172.21.16.136 GNB_S1C_IF_NAME: eth0 GNB_S1C_IP_ADDRESS: 192.168.68.194 GNB_S1U_IF_NAME: eth0 @@ -24,7 +24,7 @@ services: RRC_INACTIVITY_THRESHOLD: 0 FLEXRAN_ENABLED: 'no' FLEXRAN_INTERFACE_NAME: eth0 - FLEXRAN_IPV4_ADDRESS: 192.168.18.210 + FLEXRAN_IPV4_ADDRESS: 172.21.16.136 THREAD_PARALLEL_CONFIG: PARALLEL_RU_L1_TRX_SPLIT USE_ADDITIONAL_OPTIONS: -E -q --RUs.[0].sdr_addrs serial=30C51D4 --log_config.global_log_options level,nocolor,time,line_num,function volumes: From d592b1ff5bcb8743129006bb43a5a2501b5a14ec Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 20 Apr 2022 17:56:25 +0200 Subject: [PATCH 806/883] fix(ci): dummy commit to re-trigger Signed-off-by: Raphael Defosseux --- ci-scripts/ci_ueinfra.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml index b58e14ff6a..b888f6bb59 100644 --- a/ci-scripts/ci_ueinfra.yaml +++ b/ci-scripts/ci_ueinfra.yaml @@ -40,6 +40,7 @@ nrmodule2_quectel: - sudo -S ip link set dev wwan1 mtu 1500 MTU : 1500 +# CAUTION: 192.168.18.89 address has to be changed when the server is moved #single UE single ping amarisoft_ue_1: ID: amarisoft_ue_1 From b8ac9d5db9a171424000ae9015abb500f89ae853 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 21 Apr 2022 12:30:08 +0200 Subject: [PATCH 807/883] fix(ci): fix helm charts for phy-sim testing on cluster new infra Signed-off-by: Raphael Defosseux --- charts/physims/charts/dlsim/values.yaml | 4 +-- charts/physims/charts/ldpctest/values.yaml | 4 +-- charts/physims/charts/nr-dlschsim/values.yaml | 4 +-- charts/physims/charts/nr-dlsim/values.yaml | 4 +-- charts/physims/charts/nr-pbchsim/values.yaml | 4 +-- charts/physims/charts/nr-prachsim/values.yaml | 4 +-- charts/physims/charts/nr-pucchsim/values.yaml | 4 +-- charts/physims/charts/nr-ulschsim/values.yaml | 4 +-- charts/physims/charts/nr-ulsim/values.yaml | 4 +-- charts/physims/charts/polartest/values.yaml | 4 +-- .../physims/charts/smallblocktest/values.yaml | 4 +-- charts/physims/charts/ulsim/values.yaml | 4 +-- charts/physims/templates/rbac.yaml | 30 ++++++++++++++----- charts/physims/values.yaml | 4 +-- ci-scripts/cls_physim1.py | 30 +++++++++++++------ 15 files changed, 69 insertions(+), 43 deletions(-) diff --git a/charts/physims/charts/dlsim/values.yaml b/charts/physims/charts/dlsim/values.yaml index d78fbb7409..7f45b42f72 100644 --- a/charts/physims/charts/dlsim/values.yaml +++ b/charts/physims/charts/dlsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/ldpctest/values.yaml b/charts/physims/charts/ldpctest/values.yaml index e2e6467923..b3cc476cf8 100644 --- a/charts/physims/charts/ldpctest/values.yaml +++ b/charts/physims/charts/ldpctest/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/nr-dlschsim/values.yaml b/charts/physims/charts/nr-dlschsim/values.yaml index 8944e7e724..b7ef28f47a 100644 --- a/charts/physims/charts/nr-dlschsim/values.yaml +++ b/charts/physims/charts/nr-dlschsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/nr-dlsim/values.yaml b/charts/physims/charts/nr-dlsim/values.yaml index 573e8630de..2a35912fee 100644 --- a/charts/physims/charts/nr-dlsim/values.yaml +++ b/charts/physims/charts/nr-dlsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/nr-pbchsim/values.yaml b/charts/physims/charts/nr-pbchsim/values.yaml index 28c4678334..9a25d2810d 100644 --- a/charts/physims/charts/nr-pbchsim/values.yaml +++ b/charts/physims/charts/nr-pbchsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/nr-prachsim/values.yaml b/charts/physims/charts/nr-prachsim/values.yaml index 9e3c68b54d..dba6cc16c0 100644 --- a/charts/physims/charts/nr-prachsim/values.yaml +++ b/charts/physims/charts/nr-prachsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/nr-pucchsim/values.yaml b/charts/physims/charts/nr-pucchsim/values.yaml index 449670f713..77fe0963ac 100644 --- a/charts/physims/charts/nr-pucchsim/values.yaml +++ b/charts/physims/charts/nr-pucchsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/nr-ulschsim/values.yaml b/charts/physims/charts/nr-ulschsim/values.yaml index a3afc090e8..efb011a7f6 100644 --- a/charts/physims/charts/nr-ulschsim/values.yaml +++ b/charts/physims/charts/nr-ulschsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/nr-ulsim/values.yaml b/charts/physims/charts/nr-ulsim/values.yaml index 2bf96498e8..71c455b69c 100644 --- a/charts/physims/charts/nr-ulsim/values.yaml +++ b/charts/physims/charts/nr-ulsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/polartest/values.yaml b/charts/physims/charts/polartest/values.yaml index e0a532fdd8..e0751e8ec4 100644 --- a/charts/physims/charts/polartest/values.yaml +++ b/charts/physims/charts/polartest/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/smallblocktest/values.yaml b/charts/physims/charts/smallblocktest/values.yaml index f2f113d9b6..f933a978fd 100644 --- a/charts/physims/charts/smallblocktest/values.yaml +++ b/charts/physims/charts/smallblocktest/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/charts/ulsim/values.yaml b/charts/physims/charts/ulsim/values.yaml index 35dc14d596..d25b6fc2a5 100644 --- a/charts/physims/charts/ulsim/values.yaml +++ b/charts/physims/charts/ulsim/values.yaml @@ -4,11 +4,11 @@ replicaCount: 1 -namespace: "oaicicd-ran-tmp" +namespace: "OAICICD_PROJECT" image: registry: local - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: temp # pullPolicy: IfNotPresent or Never or Always pullPolicy: Always diff --git a/charts/physims/templates/rbac.yaml b/charts/physims/templates/rbac.yaml index 35f956a203..b341744796 100644 --- a/charts/physims/templates/rbac.yaml +++ b/charts/physims/templates/rbac.yaml @@ -1,12 +1,26 @@ -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role metadata: - name: {{ .Chart.Name }}-{{ .Values.global.namespace }}-rbac -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-admin + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role +rules: +- apiGroups: + - security.openshift.io + resourceNames: + - privileged + resources: + - securitycontextconstraints + verbs: + - use +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-binding subjects: - kind: ServiceAccount name: {{ .Values.global.serviceAccountName }} - namespace: {{ .Values.global.namespace }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: Role + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-role + apiGroup: rbac.authorization.k8s.io diff --git a/charts/physims/values.yaml b/charts/physims/values.yaml index b348e822bb..d5253c7812 100644 --- a/charts/physims/values.yaml +++ b/charts/physims/values.yaml @@ -4,9 +4,9 @@ global: serviceAccountName: oai-physim-sa - namespace: "oaicicd-ran-tmp" + namespace: "OAICICD_PROJECT" image: - repository: image-registry.openshift-image-registry.svc:5000/oaicicd-ran-tmp/oai-physim + repository: image-registry.openshift-image-registry.svc:5000/OAICICD_PROJECT/oai-physim version: TAG ## Declaring values specific to coressponding physim to overwrite diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index 83fb74b7cb..54329790cd 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -153,6 +153,7 @@ class PhySim: mySSH.command(f'oc project {ocProjectName}', '\$', 30) if mySSH.getBefore().count(f'Already on project "{ocProjectName}"') == 0 and mySSH.getBefore().count(f'Now using project "{self.OCProjectName}"') == 0: logging.error(f'\u001B[1m Unable to access OC project {ocProjectName}\u001B[0m') + mySSH.command('oc logout', '\$', 30) mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PROJECT_FAIL) RAN.prematureExit = True @@ -161,9 +162,10 @@ class PhySim: logging.debug(f'\u001B[1m Now using project {ocProjectName}\u001B[0m') # Tag the image and push to the OC cluster - mySSH.command('oc whoami -t | sudo podman login -u ' + ocUserName + ' --password-stdin https://default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/ --tls-verify=false', '\$', 30) + mySSH.command('oc whoami -t | sudo podman login -u ' + ocUserName + ' --password-stdin https://default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/ --tls-verify=false', '\$', 30) if mySSH.getBefore().count('Login Succeeded!') == 0: logging.error('\u001B[1m Podman Login to OC Cluster Registry Failed\u001B[0m') + mySSH.command('oc logout', '\$', 30) mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_LOGIN_FAIL) RAN.prematureExit = True @@ -171,9 +173,11 @@ class PhySim: else: logging.debug('\u001B[1m Podman Login to OC Cluster Registry Successfully\u001B[0m') time.sleep(2) - mySSH.command('oc create -f openshift/oai-physim-image-stream.yml', '\$', 30) + mySSH.command('oc create -f openshift/oai-physim-image-stream.yml || true', '\$', 30) if mySSH.getBefore().count('(AlreadyExists):') == 0 and mySSH.getBefore().count('created') == 0: logging.error(f'\u001B[1m Image Stream "oai-physim" Creation Failed on OC Cluster {ocProjectName}\u001B[0m') + mySSH.command('sudo podman logout https://default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/', '\$', 6) + mySSH.command('oc logout', '\$', 30) mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_IS_FAIL) RAN.prematureExit = True @@ -181,11 +185,13 @@ class PhySim: else: logging.debug(f'\u001B[1m Image Stream "oai-physim" created on OC project {ocProjectName}\u001B[0m') time.sleep(2) - mySSH.command(f'sudo podman tag oai-physim:{imageTag} default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 30) + mySSH.command(f'sudo podman tag oai-physim:{imageTag} default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 30) time.sleep(2) - mySSH.command(f'sudo podman push default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag} --tls-verify=false', '\$', 180) + mySSH.command(f'sudo podman push default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag} --tls-verify=false', '\$', 180) if mySSH.getBefore().count('Storing signatures') == 0: logging.error('\u001B[1m Image "oai-physim" push to OC Cluster Registry Failed\u001B[0m') + mySSH.command('sudo podman logout https://default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/', '\$', 6) + mySSH.command('oc logout', '\$', 30) mySSH.close() HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_IS_FAIL) RAN.prematureExit = True @@ -195,8 +201,9 @@ class PhySim: # Using helm charts deployment time.sleep(5) + mySSH.command(f'grep -rl OAICICD_PROJECT ./charts/ | xargs sed -i -e "s#OAICICD_PROJECT#{ocProjectName}#"', '\$', 30) mySSH.command(f'sed -i -e "s#TAG#{imageTag}#g" ./charts/physims/values.yaml', '\$', 6) - mySSH.command('helm install physim ./charts/physims/ | tee -a cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 30) + mySSH.command('helm install physim ./charts/physims/ 2>&1 | tee -a cmake_targets/log/physim_helm_summary.txt', '\$', 30) if mySSH.getBefore().count('STATUS: deployed') == 0: logging.error('\u001B[1m Deploying PhySim Failed using helm chart on OC Cluster\u001B[0m') mySSH.command('helm uninstall physim >> cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 30) @@ -206,8 +213,10 @@ class PhySim: mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6, resync=True) if re.search('No resources found', mySSH.getBefore()): isFinished1 = True - mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 30) + mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 30) mySSH.command('oc delete is oai-physim', '\$', 30) + mySSH.command('sudo podman logout https://default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/', '\$', 6) + mySSH.command('oc logout', '\$', 30) mySSH.close() self.AnalyzeLogFile_phySim(HTML) RAN.prematureExit = True @@ -227,7 +236,7 @@ class PhySim: 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('helm uninstall physim >> cmake_targets/log/physim_helm_summary.txt 2>&1', '\$', 6) + mySSH.command('helm uninstall physim 2>&1 >> cmake_targets/log/physim_helm_summary.txt', '\$', 6) self.AnalyzeLogFile_phySim(HTML) isFinished1 = False while(isFinished1 == False): @@ -235,8 +244,10 @@ class PhySim: mySSH.command('oc get pods -l app.kubernetes.io/instance=physim', '\$', 6, resync=True) if re.search('No resources found', mySSH.getBefore()): isFinished1 = True - mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6) + mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6) mySSH.command('oc delete is oai-physim', '\$', 6) + mySSH.command('sudo podman logout https://default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/', '\$', 6) + mySSH.command('oc logout', '\$', 30) HTML.CreateHtmlTestRow('N/A', 'KO', CONST.OC_PHYSIM_DEPLOY_FAIL) HTML.CreateHtmlTestRowPhySimTestResult(self.testSummary,self.testResult) RAN.prematureExit = True @@ -293,9 +304,10 @@ class PhySim: isFinished1 = True if isFinished1 == True: logging.debug('\u001B[1m UnDeployed PhySim Successfully on OC Cluster\u001B[0m') - mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.5glab.nsa.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6) + mySSH.command(f'sudo podman rmi default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/{self.OCProjectName}/oai-physim:{imageTag}', '\$', 6) mySSH.command('oc delete is oai-physim', '\$', 6) logging.debug('\u001B[1m Deleted the Image and ImageStream\u001B[0m') + mySSH.command('sudo podman logout https://default-route-openshift-image-registry.apps.oai.cs.eurecom.fr/', '\$', 6) mySSH.command('oc logout', '\$', 6) mySSH.close() self.AnalyzeLogFile_phySim(HTML) From 9327e9915210ee6480b66bcf88567b4bea501948 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 21 Apr 2022 16:29:22 +0200 Subject: [PATCH 808/883] additional fixes for SR --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index bcf743b560..5026354afd 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -422,9 +422,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (pucch_pdu->bit_len_harq==0) { uci_pdu->harq = NULL; uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); - uci_pdu->sr->sr_confidence_level = (SNRtimes10 > uci_stats->pucch0_thres) ? 1 : 0; + uci_pdu->sr->sr_confidence_level = (SNRtimes10 < uci_stats->pucch0_thres); uci_stats->pucch0_sr_trials++; - if (xrtmag_dBtimes10>10*max_n0) { + if (xrtmag_dBtimes10>(10*max_n0+100)) { uci_pdu->sr->sr_indication = 1; uci_stats->pucch0_positive_SR++; LOG_D(PHY,"PUCCH0 got positive SR. Cumulative number of positive SR %d\n", uci_stats->pucch0_positive_SR); From 4b4e419aba60c857ca4f9ecaee4eba87ef283c85 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 14 Apr 2022 16:42:38 +0200 Subject: [PATCH 809/883] nr rlc: fix NR RLC AM status generation Several problems were found and fixed. --- openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c | 107 +++++++++++++--------- 1 file changed, 63 insertions(+), 44 deletions(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c index af8cb5715a..bfc8abbf73 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c @@ -908,8 +908,6 @@ typedef struct { int so_start; int sn_end; int so_end; - /* data for maximum ack */ - int ack_sn; /* -1 if not to be used */ /* pdu to use for next call to 'next_missing' */ nr_rlc_pdu_t *next; } missing_data_t; @@ -924,13 +922,12 @@ static missing_data_t next_missing(nr_rlc_entity_am_t *entity, int max_so = 0; int last_reached = 0; - ret.ack_sn = -1; - /* special case: missing part before the head of RX list */ if (check_head) { if (cur->sn != entity->rx_next || !cur->is_first) { /* don't report if out of reporting window */ - if (sn_compare_rx(entity, entity->rx_highest_status, cur->sn) <= 0) { + if (sn_compare_rx(entity, entity->rx_highest_status, + entity->rx_next) <= 0) { ret.sn_start = -1; return ret; } @@ -954,10 +951,6 @@ next_pdu: max_so = cur_max_so; last_reached = last_reached | cur->is_last; - /* if cur already processed, it can be the acked SDU */ - if (cur->data == NULL) - ret.ack_sn = (cur->sn + 1) % entity->sn_modulus; - /* no next? */ if (cur->next == NULL) { /* inform the caller that work is over */ @@ -1033,32 +1026,36 @@ next_pdu: } /* discontinuity between different SDUs */ - ret.sn_start = sn; + if (last_reached) { + ret.sn_start = (sn + 1) % entity->sn_modulus; + ret.so_start = 0; + } else { + ret.sn_start = sn; + ret.so_start = max_so + 1; + } /* don't report if out of reporting window */ if (sn_compare_rx(entity, entity->rx_highest_status, ret.sn_start) <= 0) { ret.sn_start = -1; return ret; } - ret.so_start = max_so + 1; set_end_different_sdu: - /* don't go more than rx_highest_status - 1 */ - if (sn_compare_rx(entity, entity->rx_highest_status, cur->sn) <= 0) { - ret.sn_end = (entity->rx_highest_status - 1 + entity->sn_modulus) % - entity->sn_modulus; - ret.so_end = 0xffff; - return ret; - } - /* if cur is the head of a SDU, then use cur-1 */ if (cur->is_first) { ret.sn_end = (cur->sn - 1 + entity->sn_modulus) % entity->sn_modulus; ret.so_end = 0xffff; - return ret; + } else { + ret.sn_end = cur->sn; + ret.so_end = cur->so - 1; + } + /* don't go more than rx_highest_status - 1 */ + if (sn_compare_rx(entity, entity->rx_highest_status, ret.sn_end) <= 0) { + ret.sn_end = (entity->rx_highest_status - 1 + entity->sn_modulus) % + entity->sn_modulus; + ret.so_end = 0xffff; + ret.next = NULL; } - ret.sn_end = cur->sn; - ret.so_end = cur->so - 1; return ret; } @@ -1098,21 +1095,20 @@ static void get_e1_position(nr_rlc_entity_am_t *entity, } } -/* returns the number of nacks serialized. - * In most cases it is 1, it can be more if the - * missing data consists of a range that is more - * than 255 SNs in which case it has to be cut in - * smaller ranges. +/* returns the last nack SN generated, -1 if nothing generated. * If there is no more room in the status buffer, * will set m->next = NULL (and may serialize - * less nacks than required by 'm'). + * less nacks than required by 'm'), also + * sets *generation_truncated to 1. */ static int generate_missing(nr_rlc_entity_am_t *entity, nr_rlc_pdu_encoder_t *encoder, - missing_data_t *m, int *e1_byte, int *e1_bit) + missing_data_t *m, int *e1_byte, int *e1_bit, + int *generation_truncated, + unsigned char **so_end_address) { int r_bits = entity->sn_field_length == 18 ? 3 : 1; - int range_count = 0; + int last_nack_generated = -1; int sn_start; int so_start; int sn_end; @@ -1164,6 +1160,7 @@ static int generate_missing(nr_rlc_entity_am_t *entity, m_nack.so_end = so_end; if (encoder->byte + nack_size(entity, &m_nack) > encoder->size) { m->next = NULL; + *generation_truncated = 1; break; } @@ -1197,6 +1194,7 @@ static int generate_missing(nr_rlc_entity_am_t *entity, /* nack_sn */ nr_rlc_pdu_encoder_put_bits(encoder, sn_start, entity->sn_field_length); + last_nack_generated = sn_start; /* e1 = 0 (set later if needed) */ nr_rlc_pdu_encoder_put_bits(encoder, 0, 1); /* e2 */ @@ -1208,34 +1206,44 @@ static int generate_missing(nr_rlc_entity_am_t *entity, /* so_start/so_end */ if (e2) { nr_rlc_pdu_encoder_put_bits(encoder, so_start, 16); + *so_end_address = (unsigned char *)encoder->buffer + encoder->byte; nr_rlc_pdu_encoder_put_bits(encoder, so_end, 16); - } + } else + *so_end_address = NULL; /* nack range */ - if (e3) + if (e3) { nr_rlc_pdu_encoder_put_bits(encoder, cur_sn_count, 8); + last_nack_generated += cur_sn_count - 1; + } sn_count -= cur_sn_count; sn_start = (sn_start + cur_sn_count) % entity->sn_modulus; - range_count++; } - return range_count; + return last_nack_generated; } static int generate_status(nr_rlc_entity_am_t *entity, char *buffer, int size) { - int ack_sn = entity->rx_next; - missing_data_t m; + int last_nack; + int ack_sn; + missing_data_t m; nr_rlc_pdu_t *cur; - int nack_count = 0; + int check_head = 1; nr_rlc_pdu_encoder_t encoder; int e1_byte; int e1_bit; + int generation_truncated; + int ln; + unsigned char *so_end_address = NULL; /* if not enough room, do nothing */ if (size < 3) return 0; + /* initial last_nack is rx_next - 1 */ + last_nack = (entity->rx_next - 1 + entity->sn_modulus) % entity->sn_modulus; + nr_rlc_pdu_encoder_init(&encoder, buffer, size); /* first 3 bytes, ack_sn and e1 will be set later */ @@ -1250,22 +1258,33 @@ static int generate_status(nr_rlc_entity_am_t *entity, char *buffer, int size) e1_bit = entity->sn_field_length == 18 ? 1 : 7; while (cur != NULL) { - m = next_missing(entity, cur, nack_count == 0); - - /* update ack_sn if the returned value is valid */ - if (m.ack_sn != -1) - ack_sn = m.ack_sn; + m = next_missing(entity, cur, check_head); + check_head = 0; /* stop here if no more nack to report */ if (m.sn_start == -1) break; - nack_count += generate_missing(entity, &encoder, &m, &e1_byte, &e1_bit); + generation_truncated = 0; + ln = generate_missing(entity, &encoder, &m, &e1_byte, &e1_bit, + &generation_truncated, &so_end_address); + /* remember the last nack put, if any */ + if (ln != -1) + last_nack = ln; + /* if generation was truncated and so_end was put, we force its value to + * 0xffff (end of SDU) because we don't know what missing nack information + * was supposed to be put, so we nack until the end of the PDU to be sure + */ + if (generation_truncated && so_end_address != NULL) { + so_end_address[0] = 0xff; + so_end_address[1] = 0xff; + } cur = m.next; } - /* put ack_sn */ + /* put ack_sn, which is last_nack + 1 */ + ack_sn = (last_nack + 1) % entity->sn_modulus; if (entity->sn_field_length == 12) { buffer[0] = ack_sn >> 8; buffer[1] = ack_sn & 255; From 4c4cbc963b99080682ea10c00c31cd7540e8ebd2 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 22 Apr 2022 12:28:04 +0200 Subject: [PATCH 810/883] fix(ci): little fixes after migration to new infra: - Better mechanism for qlog cleaning - Faster attachment check - html.py is confusing for some python3 installation -- renaming it Signed-off-by: Raphael Defosseux --- ci-scripts/cls_log_mgt.py | 23 ++++++++++++++--------- ci-scripts/cls_module_ue.py | 7 ++++--- ci-scripts/{html.py => cls_oai_html.py} | 0 ci-scripts/cls_oaicitest.py | 4 ++-- ci-scripts/cls_physim.py | 2 +- ci-scripts/cls_physim1.py | 2 +- ci-scripts/main.py | 4 ++-- 7 files changed, 24 insertions(+), 18 deletions(-) rename ci-scripts/{html.py => cls_oai_html.py} (100%) diff --git a/ci-scripts/cls_log_mgt.py b/ci-scripts/cls_log_mgt.py index 905a105512..e29e9168b7 100644 --- a/ci-scripts/cls_log_mgt.py +++ b/ci-scripts/cls_log_mgt.py @@ -64,10 +64,10 @@ class Log_Mgt: if m is not None: return int(m.group(1)) - def __RemoveOldest(self): + def __RemoveOldest(self, days): mySSH = sshconnection.SSHConnection() mySSH.open(self.IPAddress, self.Username, self.Password) - COMMAND='echo ' + self.Password + ' | sudo -S find ' + self.path + ' -type f -mtime +14 -delete' + COMMAND='echo ' + self.Password + ' | sudo -S find ' + self.path + ' -type f -mtime +' + str(days) + ' -delete' mySSH.command(COMMAND,'\$',20) mySSH.close() @@ -79,13 +79,18 @@ class Log_Mgt: def LogRotation(self): - used_space = self.__CheckUsedSpace() #avail space in target folder - if used_space > 80 : - logging.debug('\u001B[1;37;41m Used Disk > 80%, on ' + self.Username+'@'+self.IPAddress + '\u001B[0m') - logging.debug('\u001B[1;37;41m Removing Artifacts older than 14 days \u001B[0m') - self.__RemoveOldest() - else: - logging.debug('Used Disk < 80%, on ' + self.Username+'@'+self.IPAddress +', no cleaning required') + doLoop = True + nbDays = 14 + while doLoop and nbDays > 2: + used_space = self.__CheckUsedSpace() #avail space in target folder + if used_space > 80 : + logging.debug('\u001B[1;37;41m Used Disk (' + str(used_space) + '%) > 80%, on ' + self.Username+'@'+self.IPAddress + '\u001B[0m') + logging.debug('\u001B[1;37;41m Removing Artifacts older than ' + nbDays + ' days \u001B[0m') + self.__RemoveOldest(nbDays) + nbDays -= 1 + else: + logging.debug('Used Disk (' + str(used_space) + '%) < 80%, on ' + self.Username+'@'+self.IPAddress +', no cleaning required') + doLoop = False diff --git a/ci-scripts/cls_module_ue.py b/ci-scripts/cls_module_ue.py index fb10700798..dcf75a34fc 100644 --- a/ci-scripts/cls_module_ue.py +++ b/ci-scripts/cls_module_ue.py @@ -107,14 +107,15 @@ class Module_UE: def GetModuleIPAddress(self): HOST=self.HostUsername+'@'+self.HostIPAddress response= [] - tentative = 3 + tentative = 8 while (len(response)==0) and (tentative>0): COMMAND="ip a show dev " + self.UENetwork + " | grep --colour=never inet | grep " + self.UENetwork - logging.debug(COMMAND) + if tentative == 8: + logging.debug(COMMAND) ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) response = ssh.stdout.readlines() tentative-=1 - time.sleep(10) + time.sleep(2) if (tentative==0) and (len(response)==0): logging.debug('\u001B[1;37;41m Module IP Address Not Found! Time expired \u001B[0m') return -1 diff --git a/ci-scripts/html.py b/ci-scripts/cls_oai_html.py similarity index 100% rename from ci-scripts/html.py rename to ci-scripts/cls_oai_html.py diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index 33910f1f9b..9d5ae84038 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -439,7 +439,7 @@ class OaiCiTest(): while cnt < 4: Module_UE.Command("wup") logging.debug("Waiting for IP address to be assigned") - time.sleep(20) + time.sleep(5) logging.debug("Retrieve IP address") status=Module_UE.GetModuleIPAddress() if status==0: @@ -1111,7 +1111,7 @@ class OaiCiTest(): while cnt < 4: Module_UE.Command("wup") logging.debug("Waiting for IP address to be assigned") - time.sleep(20) + time.sleep(5) logging.debug("Retrieve IP address") status=Module_UE.GetModuleIPAddress() if status==0: diff --git a/ci-scripts/cls_physim.py b/ci-scripts/cls_physim.py index 33792f6ca4..ecd8f63af1 100644 --- a/ci-scripts/cls_physim.py +++ b/ci-scripts/cls_physim.py @@ -32,7 +32,7 @@ import logging #to create a SSH object locally in the methods import sshconnection #to update the HTML object -import html +import cls_oai_html from multiprocessing import SimpleQueue #for log folder maintenance import os diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index 54329790cd..3907fc2a34 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -33,7 +33,7 @@ #----------------------------------------------------------- import logging import sshconnection as SSH -import html +import cls_oai_html import os import re import time diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 65f9fbb0da..03947bdfc9 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -49,7 +49,7 @@ import cls_physim1 #class PhySim for physical simulators deploy and run import sshconnection import epc import ran -import html +import cls_oai_html #----------------------------------------------------------- @@ -518,7 +518,7 @@ CiTestObj = cls_oaicitest.OaiCiTest() SSH = sshconnection.SSHConnection() EPC = epc.EPCManagement() RAN = ran.RANManagement() -HTML = html.HTMLManagement() +HTML = cls_oai_html.HTMLManagement() CONTAINERS = cls_containerize.Containerize() SCA = cls_static_code_analysis.StaticCodeAnalysis() PHYSIM = cls_physim1.PhySim() From 998452e679864ed8d50729736bd6639b6359fc90 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Fri, 22 Apr 2022 16:53:34 +0200 Subject: [PATCH 811/883] feat(ci): add script to properly flatten the target images Signed-off-by: Raphael Defosseux --- ci-scripts/cls_containerize.py | 3 + ci-scripts/flatten_image.py | 116 +++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 ci-scripts/flatten_image.py diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py index 89a3ac586d..259db7bffe 100644 --- a/ci-scripts/cls_containerize.py +++ b/ci-scripts/cls_containerize.py @@ -294,6 +294,9 @@ class Containerize(): if image != 'ran-build': mySSH.command('sed -i -e "s#' + "ran-build" + ':latest#' + "ran-build" + ':' + imageTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5) mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200) + # Flatten Image + if image != 'ran-build': + mySSH.command('python3 ./ci-scripts/flatten_image.py --tag ' + image + ':' + imageTag, '\$', 300) # split the log mySSH.command('mkdir -p cmake_targets/log/' + image, '\$', 5) mySSH.command('python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/' + image + '.log', '\$', 5) diff --git a/ci-scripts/flatten_image.py b/ci-scripts/flatten_image.py new file mode 100644 index 0000000000..aef5bfccad --- /dev/null +++ b/ci-scripts/flatten_image.py @@ -0,0 +1,116 @@ +""" + 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 +""" + +import argparse +import re +import subprocess +import sys + +def main() -> None: + args = _parse_args() + status = perform_flattening(args.tag) + sys.exit(status) + +def _parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser(description='Flattening Image') + + parser.add_argument( + '--tag', '-t', + action='store', + required=True, + help='Image Tag in image-name:image tag format', + ) + return parser.parse_args() + +def perform_flattening(tag): + # First detect which docker/podman command to use + cli = '' + image_prefix = '' + cmd = 'which podman || true' + podman_check = subprocess.check_output(cmd, shell=True, universal_newlines=True) + if re.search('podman', podman_check.strip()): + cli = 'sudo podman' + image_prefix = 'localhost/' + if cli == '': + cmd = 'which docker || true' + docker_check = subprocess.check_output(cmd, shell=True, universal_newlines=True) + if re.search('docker', docker_check.strip()): + cli = 'docker' + image_prefix = '' + if cli == '': + print ('No docker / podman installed: quitting') + return -1 + print (f'Flattening {tag}') + + # Creating a container + cmd = cli + ' run --name test-flatten --entrypoint /bin/true -d ' + tag + print (cmd) + subprocess.check_output(cmd, shell=True, universal_newlines=True) + + # Export / Import trick + cmd = cli + ' export test-flatten | ' + cli + ' import ' + # Bizarro syntax issue with podman + if cli == 'docker': + cmd += ' --change "ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ' + else: + cmd += ' --change "ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ' + if re.search('oai-enb', tag): + cmd += ' --change "WORKDIR /opt/oai-enb" ' + cmd += ' --change "EXPOSE 2152/udp" ' + cmd += ' --change "EXPOSE 36412/udp" ' + cmd += ' --change "EXPOSE 36422/udp" ' + cmd += ' --change "CMD [\\"/opt/oai-enb/bin/lte-softmodem.Rel15\\", \\"-O\\", \\"/opt/oai-enb/etc/enb.conf\\"]" ' + cmd += ' --change "ENTRYPOINT [\\"/opt/oai-enb/bin/entrypoint.sh\\"]" ' + if re.search('oai-gnb', tag): + cmd += ' --change "WORKDIR /opt/oai-gnb" ' + cmd += ' --change "EXPOSE 2152/udp" ' + cmd += ' --change "EXPOSE 36422/udp" ' + cmd += ' --change "CMD [\\"/opt/oai-gnb/bin/nr-softmodem.Rel15\\", \\"-O\\", \\"/opt/oai-gnb/etc/gnb.conf\\"]" ' + cmd += ' --change "ENTRYPOINT [\\"/opt/oai-gnb/bin/entrypoint.sh\\"]" ' + if re.search('oai-lte-ue', tag): + cmd += ' --change "WORKDIR /opt/oai-lte-ue" ' + cmd += ' --change "CMD [\\"/opt/oai-lte-ue/bin/lte-uesoftmodem.Rel15\\"]" ' + cmd += ' --change "ENTRYPOINT [\\"/opt/oai-lte-ue/bin/entrypoint.sh\\"]" ' + if re.search('oai-nr-ue', tag): + cmd += ' --change "WORKDIR /opt/oai-nr-ue" ' + cmd += ' --change "CMD [\\"/opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15\\", \\"-O\\", \\"/opt/oai-nr-ue/etc/nr-ue.conf\\"]" ' + cmd += ' --change "ENTRYPOINT [\\"/opt/oai-nr-ue/bin/entrypoint.sh\\"]" ' + if re.search('oai-lte-ru', tag): + cmd += ' --change "WORKDIR /opt/oai-lte-ru" ' + cmd += ' --change "CMD [\\"/opt/oai-lte-ru/bin/oairu.Rel15\\", \\"-O\\", \\"/opt/oai-lte-ru/etc/rru.conf\\"]" ' + cmd += ' --change "ENTRYPOINT [\\"/opt/oai-lte-ru/bin/entrypoint.sh\\"]" ' + if re.search('oai-physim', tag): + cmd += ' --change "WORKDIR /opt/oai-physim" ' + cmd += ' - ' + image_prefix + tag + print (cmd) + subprocess.check_output(cmd, shell=True, universal_newlines=True) + + # Remove container + cmd = cli + ' rm -f test-flatten' + print (cmd) + subprocess.check_output(cmd, shell=True, universal_newlines=True) + + # At this point the original image is a dangling image. + # CI pipeline will clean up (`image prune --force`) + return 0 + +if __name__ == '__main__': + main() From 532bb0da965417617e4e7ed2612b1208814bae3c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 22 Apr 2022 17:54:41 +0200 Subject: [PATCH 812/883] Remove useless comments --- openair2/LAYER2/NR_MAC_COMMON/nr_mac.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h index 63f21ec382..9123afd324 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac.h @@ -107,10 +107,10 @@ typedef struct { } __attribute__ ((__packed__)) NR_MAC_SUBHEADER_SHORT; typedef struct { - uint8_t LCID: 6; // octet 1 [5:0] - uint8_t F: 1; // octet 1 [6] - uint8_t R: 1; // octet 1 [7] - uint16_t L: 16; // octet 2 [7:0] + uint8_t LCID: 6; + uint8_t F: 1; + uint8_t R: 1; + uint16_t L: 16; } __attribute__ ((__packed__)) NR_MAC_SUBHEADER_LONG; typedef struct { From 3c6a628b747cd6e78ae2b30072f19b9fbabbe202 Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Mon, 25 Apr 2022 23:34:48 +0200 Subject: [PATCH 813/883] fix 2 bugs: one new introduced by merge develop, one introduced by extra change asked in code review --- openair1/PHY/CODING/nr_segmentation.c | 2 +- openair1/SCHED_NR_UE/harq_nr.c | 4 +++- openair1/SIMULATION/NR_PHY/dlschsim.c | 7 +------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/CODING/nr_segmentation.c b/openair1/PHY/CODING/nr_segmentation.c index 281e61cda5..f43813a6ca 100644 --- a/openair1/PHY/CODING/nr_segmentation.c +++ b/openair1/PHY/CODING/nr_segmentation.c @@ -87,7 +87,7 @@ if ((Kprime%Kb) > 0) else Z = (Kprime/Kb); - LOG_D(PHY,"nr segmetation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z); + LOG_D(PHY,"nr segmentation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z); if (Z <= 2) { *K = 2; diff --git a/openair1/SCHED_NR_UE/harq_nr.c b/openair1/SCHED_NR_UE/harq_nr.c index c0f7c08771..a9ff01d78a 100644 --- a/openair1/SCHED_NR_UE/harq_nr.c +++ b/openair1/SCHED_NR_UE/harq_nr.c @@ -357,8 +357,10 @@ void downlink_harq_process(NR_DL_UE_HARQ_t *dl_harq, int harq_pid, int ndi, int if (ndi!=dl_harq->DCINdi) { dl_harq->first_rx = true; dl_harq->DLround = 0; - } else + } else { + dl_harq->first_rx = false; dl_harq->DLround++; + } dl_harq->status = ACTIVE; diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 64e377b896..6f747b36a6 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -478,13 +478,10 @@ int main(int argc, char **argv) harq_process->n_dmrs_cdm_groups = 1; printf("harq process ue mcs = %d Qm = %d, symb %d\n", harq_process->mcs, harq_process->Qm, nb_symb_sch); - unsigned char *test_input; - test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8); + unsigned char *test_input=dlsch->harq_process.pdu; //unsigned char test_input[TBS / 8] __attribute__ ((aligned(16))); for (i = 0; i < TBS / 8; i++) test_input[i] = (unsigned char) rand(); - dlsch->harq_process.pdu=test_input; - //estimated_output = harq_process->b; #ifdef DEBUG_NR_DLSCHSIM for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]); @@ -618,8 +615,6 @@ int main(int argc, char **argv) } }*/ - //free(test_input); it must not be free as it is in DLSCH_struct -> free_gNB_dlsch () -> free(harq->pdu) with no checks or control - free_channel_desc_scm(gNB2UE); reset_DLSCH_struct(gNB, &msgDataTx); From 05567b59f17e650d372c6e4c973d02f51a9e2ffa Mon Sep 17 00:00:00 2001 From: Vijay Chadachan Date: Tue, 26 Apr 2022 10:59:42 +0200 Subject: [PATCH 814/883] Fix for OAI UE AUTH_REQ processing additional check for RAND value It was observed in simulation test the OAI UE always sends the sucessful AUTH_RES when the AUTH_REQ has the RAND value "0". This opens a back door in the authentication process. The code is modified to fix this issue in OAI UE. --- openair3/NAS/UE/EMM/Authentication.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openair3/NAS/UE/EMM/Authentication.c b/openair3/NAS/UE/EMM/Authentication.c index 850f97150a..97c7082be0 100644 --- a/openair3/NAS/UE/EMM/Authentication.c +++ b/openair3/NAS/UE/EMM/Authentication.c @@ -149,7 +149,8 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi, int rc = RETURNerror; authentication_data_t *authentication_data = user->authentication_data; emm_timers_t *emm_timers = user->emm_data->emm_timers; - + uint8_t nullRand[AUTH_CK_SIZE]; + memset(nullRand, 0, AUTH_CK_SIZE); LOG_TRACE(INFO, "EMM-PROC - Authentication requested ksi type = %s, ksi = %d", native_ksi ? "native" : "mapped", ksi); /* 3GPP TS 24.301, section 5.4.2.1 @@ -178,11 +179,13 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi, OctetString ik = {AUTH_IK_SIZE, authentication_data->ik}; OctetString res = {AUTH_RES_SIZE, authentication_data->res}; - if (memcmp(authentication_data->rand, rand->value, AUTH_CK_SIZE) != 0) { + if ((memcmp(authentication_data->rand, rand->value, AUTH_CK_SIZE) != 0) || + (memcmp(nullRand,authentication_data->rand, AUTH_CK_SIZE) == 0)) { /* * There is no valid stored RAND in the ME or the stored RAND is * different from the new received value in the AUTHENTICATION - * REQUEST message + * REQUEST message OR the received RAND is all "0" or "NULL" + * process the new received AUTHENTICATIOn REQUEST message */ OctetString auts; auts.length = 0; From b805e6db47bbb42dd97a735984e75860ddd8274e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 26 Apr 2022 17:40:42 +0200 Subject: [PATCH 815/883] Use --continuous-tx for B210-based gNB (TDD) --- ci-scripts/xml_files/fr1_nsa_quectel.xml | 2 +- ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 55f6f4376e..44aab6e892 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -74,7 +74,7 @@ Initialize_eNB Initialize gNB - -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --RUs.[0].sdr_addrs "serial=30C51D4" --log_config.global_log_options level,nocolor,time,line_num,function + -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q --RUs.[0].sdr_addrs "serial=30C51D4" --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function 1 1 nr diff --git a/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml b/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml index 61266aa2b1..208e1564cd 100644 --- a/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml +++ b/ci-scripts/yaml_files/nsa_b200_gnb/docker-compose.yml @@ -26,7 +26,7 @@ services: FLEXRAN_INTERFACE_NAME: eth0 FLEXRAN_IPV4_ADDRESS: 172.21.16.136 THREAD_PARALLEL_CONFIG: PARALLEL_RU_L1_TRX_SPLIT - USE_ADDITIONAL_OPTIONS: -E -q --RUs.[0].sdr_addrs serial=30C51D4 --log_config.global_log_options level,nocolor,time,line_num,function + USE_ADDITIONAL_OPTIONS: -E -q --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function volumes: - /dev:/dev networks: From 57d1b22ca4296ba3e92a990ad41432e895f83ceb Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 26 Apr 2022 17:48:23 +0200 Subject: [PATCH 816/883] Improve B210 gNB configuration --- .../conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index af58145322..f2bf69d2f7 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -203,7 +203,7 @@ MACRLCs = ( tr_n_preference = "local_RRC"; pusch_TargetSNRx10 = 200; pucch_TargetSNRx10 = 200; - ulsch_max_frame_inactivity = 1; + ulsch_max_frame_inactivity = 0; } ); @@ -221,11 +221,11 @@ RUs = ( local_rf = "yes" nb_tx = 1 nb_rx = 1 - att_tx = 3 - att_rx = 0; + att_tx = 16 + att_rx = 16; bands = [7]; max_pdschReferenceSignalPower = -27; - max_rxgain = 111; + max_rxgain = 114; eNB_instances = [0]; # sdr_addrs = "serial=30C51D4"; # clock_src = "external"; From 4389fdea4ef82dba502271235ab65d5b446d5432 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 26 Apr 2022 18:16:19 +0200 Subject: [PATCH 817/883] Harmonize NSA DMRS AdditionalPosition with SA --- openair2/RRC/NR/rrc_gNB_reconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index 36113fb7ee..4e9245cf46 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -223,7 +223,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS=NULL; secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition)); - *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0; + *secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1; secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config->choice.setup->tci_StatesToAddModList)); @@ -572,7 +572,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS=NULL; } bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition)); - *bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos0; + *bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NR_DMRS_DownlinkConfig__dmrs_AdditionalPosition_pos1; bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList=calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->tci_StatesToAddModList)); From 89e7923652c0f28ce1dd2538c3cb562ffc6dc962 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 26 Apr 2022 17:56:50 +0200 Subject: [PATCH 818/883] Increase NSA B210 throughput requirements --- .../xml_files/container_nsa_b200_quectel.xml | 8 ++++---- ci-scripts/xml_files/fr1_nsa_quectel.xml | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 610f0b019a..80ed3f5cfc 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -138,12 +138,12 @@ Iperf - iperf (DL/40Mbps/UDP)(60 sec)(single-ue profile) - -u -b 40M -t 60 -i 1 -fm + iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile) + -u -b 125M -t 60 -i 1 -fm DL idefix - 20 - 85 + 1 + 95 single-ue diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index 44aab6e892..f8ecaae0fd 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -117,29 +117,29 @@ -u -b 30M -t 30 DL idefix - 5 + 1 95 single-ue Iperf - iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile) - -u -b 40M -t 30 + iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile) + -u -b 90M -t 30 DL idefix - 5 + 1 95 single-ue Iperf - iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) - -u -b 60M -t 60 + iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile) + -u -b 125M -t 60 DL idefix - 5 + 1 95 single-ue From a4f3d431f5a52e876c26f61ea7159c039250b145 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 27 Apr 2022 16:31:35 +0200 Subject: [PATCH 819/883] Further improve B210/NSA gNB configuration file --- ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf index f2bf69d2f7..f3515d3882 100644 --- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf +++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf @@ -221,8 +221,8 @@ RUs = ( local_rf = "yes" nb_tx = 1 nb_rx = 1 - att_tx = 16 - att_rx = 16; + att_tx = 12 + att_rx = 12; bands = [7]; max_pdschReferenceSignalPower = -27; max_rxgain = 114; From c265cbda8a272dd245dd7635cce12a70f62409e0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 27 Apr 2022 16:36:16 +0200 Subject: [PATCH 820/883] NSA-B200(-Container) test: increase UL traffic requirements --- ci-scripts/xml_files/container_nsa_b200_quectel.xml | 4 ++-- ci-scripts/xml_files/fr1_nsa_quectel.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/xml_files/container_nsa_b200_quectel.xml b/ci-scripts/xml_files/container_nsa_b200_quectel.xml index 80ed3f5cfc..47a939f63c 100644 --- a/ci-scripts/xml_files/container_nsa_b200_quectel.xml +++ b/ci-scripts/xml_files/container_nsa_b200_quectel.xml @@ -149,8 +149,8 @@ Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 -i 1 -fm + iperf (UL/8Mbps/UDP)(60 sec)(single-ue profile) + -u -b 8M -t 60 -i 1 -fm UL idefix 1 diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml index f8ecaae0fd..0f8c90abdf 100644 --- a/ci-scripts/xml_files/fr1_nsa_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml @@ -146,8 +146,8 @@ Iperf - iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile) - -u -b 3M -t 60 + iperf (UL/8Mbps/UDP)(60 sec)(single-ue profile) + -u -b 8M -t 60 UL idefix 1 From 629b04dc80800af8ec7351a88e88547a126488ba Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 27 Apr 2022 15:25:43 +0200 Subject: [PATCH 821/883] fix(ci): typo when printing Signed-off-by: Raphael Defosseux --- ci-scripts/cls_log_mgt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/cls_log_mgt.py b/ci-scripts/cls_log_mgt.py index e29e9168b7..f1dbf6b8ec 100644 --- a/ci-scripts/cls_log_mgt.py +++ b/ci-scripts/cls_log_mgt.py @@ -81,11 +81,11 @@ class Log_Mgt: def LogRotation(self): doLoop = True nbDays = 14 - while doLoop and nbDays > 2: + while doLoop and nbDays > 1: used_space = self.__CheckUsedSpace() #avail space in target folder if used_space > 80 : logging.debug('\u001B[1;37;41m Used Disk (' + str(used_space) + '%) > 80%, on ' + self.Username+'@'+self.IPAddress + '\u001B[0m') - logging.debug('\u001B[1;37;41m Removing Artifacts older than ' + nbDays + ' days \u001B[0m') + logging.debug('\u001B[1;37;41m Removing Artifacts older than ' + str(nbDays) + ' days \u001B[0m') self.__RemoveOldest(nbDays) nbDays -= 1 else: From e98afec56753f15427c29866626dbeb3c6e7a914 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 27 Apr 2022 17:40:53 +0200 Subject: [PATCH 822/883] NSA-2x2 test: improve gNB configuration --- .../gnb.band78.nsa_2x2.106PRB.usrpn310.conf | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf index e3bd49e7fc..fa7c190538 100644 --- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf @@ -199,12 +199,12 @@ gNBs = ); MACRLCs = ( - { - num_cc = 1; - tr_s_preference = "local_L1"; - tr_n_preference = "local_RRC"; - ulsch_max_frame_inactivity = 1; - } +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + ulsch_max_frame_inactivity = 0; +} ); L1s = ( @@ -213,6 +213,7 @@ L1s = ( tr_n_preference = "local_mac"; thread_pool_size = 8; prach_dtx_threshold = 120; + pucch0_dtx_threshold = 80; } ); From 730fa472ae361b5e3e7ab973c5c763b0cd74c046 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 27 Apr 2022 17:46:17 +0200 Subject: [PATCH 823/883] NSA-2x2 test: increase DL traffic requirements --- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index a4dcb58e8b..332af80d22 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -115,11 +115,11 @@ Iperf - iperf (DL/60Mbps/UDP)(60 sec)(single-ue profile) - -u -b 60M -t 60 + iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile) + -u -b 125M -t 60 DL nrmodule2_quectel - 5 + 15 single-ue From b089469935673c3101db6eb26edc74290a2491d3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 27 Apr 2022 18:15:46 +0200 Subject: [PATCH 824/883] Reduce nr_dlsim 256QAM MCS 27 test case to MCS 26, see #543 --- cmake_targets/autotests/test_case_list.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index ce1b9dcdf4..b55228bdc9 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1093,7 +1093,7 @@ (Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset), (Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27), (Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16), - (Test11: 106 MCS-TABLE 256 QAM MCS Index 27), + (Test11: 106 MCS-TABLE 256 QAM MCS Index 26), (Test12: HARQ test 25% TP 4 rounds), (Test13: HARQ test 33% TP 3 rounds), (Test14: HARQ test 50% TP 2 rounds), @@ -1121,7 +1121,7 @@ -n100 -R217 -a110 -s5 -b100 -n100 -e27 -s30 -n100 -e16 -s10 - -n100 -q1 -e27 -s30 + -n100 -q1 -e26 -s30 -n100 -s1 -t25 -n100 -s1 -t33 -n100 -s1 -t50 From ced2a66f6e57e3afd77a7d547f0fc32e96fb2eaf Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 27 Apr 2022 18:36:01 +0200 Subject: [PATCH 825/883] fix(ci): changing the Docker Hub account to push to Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-push-registry | 13 +++++--- ci-scripts/provideUniqueImageTag.py | 6 ++-- .../4g_rfsimulator_fdd_05MHz/README.md | 28 ++++++++-------- ci-scripts/yaml_files/5g_l2sim_tdd/README.md | 32 +++++++++---------- .../yaml_files/5g_rfsimulator/README.md | 28 ++++++++-------- 5 files changed, 52 insertions(+), 55 deletions(-) diff --git a/ci-scripts/Jenkinsfile-push-registry b/ci-scripts/Jenkinsfile-push-registry index f5847ff0aa..bc1a80ba61 100644 --- a/ci-scripts/Jenkinsfile-push-registry +++ b/ci-scripts/Jenkinsfile-push-registry @@ -26,6 +26,9 @@ def nodeExecutor = params.nodeExecutor // Name of the phone resource def ciServerResource = params.serverResource +// Docker Hub account to push to +def DH_Account = "oaisoftwarealliance" + pipeline { agent { label nodeExecutor @@ -66,11 +69,11 @@ pipeline { def listOfImages = ["oai-enb", "oai-gnb", "oai-lte-ue", "oai-nr-ue"] sh "docker login -u ${DH_Username} -p ${DH_Password} > /dev/null 2>&1" listOfImages.eachWithIndex { item, iindex -> - sh "docker image tag ${item}:develop ${DH_Username}/${item}:develop" - sh "docker image tag ${item}:develop ${DH_Username}/${item}:${WEEK_TAG}" - sh "docker push --quiet ${DH_Username}/${item}:${WEEK_TAG}" - sh "docker push --quiet ${DH_Username}/${item}:develop" - sh "docker rmi ${DH_Username}/${item}:${WEEK_TAG} ${DH_Username}/${item}:develop" + sh "docker image tag ${item}:develop ${DH_Account}/${item}:develop" + sh "docker image tag ${item}:develop ${DH_Account}/${item}:${WEEK_TAG}" + sh "docker push --quiet ${DH_Account}/${item}:${WEEK_TAG}" + sh "docker push --quiet ${DH_Account}/${item}:develop" + sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop" } sh "docker logout > /dev/null 2>&1" } diff --git a/ci-scripts/provideUniqueImageTag.py b/ci-scripts/provideUniqueImageTag.py index ee8306402f..88d51ca6f8 100644 --- a/ci-scripts/provideUniqueImageTag.py +++ b/ci-scripts/provideUniqueImageTag.py @@ -5,15 +5,15 @@ import subprocess import sys AUTH_SERVICE = 'registry.docker.io' -AUTH_SCOPE = 'repository:rdefosseoai/oai-enb:pull' +AUTH_SCOPE = 'repository:oaisoftwarealliance/oai-enb:pull' def main() -> None: args = _parse_args() - cmd = 'curl -fsSL "https://auth.docker.io/token?service=' + AUTH_SERVICE + '&scope=' + AUTH_SCOPE + '" | jq --raw-output ".token"' + cmd = 'curl -fsSL "https://auth.docker.io/token?service=' + AUTH_SERVICE + '&scope=' + AUTH_SCOPE + '" 2>/dev/null | jq --raw-output ".token"' token = subprocess.check_output(cmd, shell=True, universal_newlines=True) token = str(token).strip() - cmd = 'curl -fsSL -H "Authorization: Bearer ' + token + '" "https://index.docker.io/v2/rdefosseoai/oai-enb/tags/list" | jq .' + cmd = 'curl -fsSL -H "Authorization: Bearer ' + token + '" "https://index.docker.io/v2/oaisoftwarealliance/oai-enb/tags/list" 2>/dev/null | jq .' listOfTags = subprocess.check_output(cmd, shell=True, universal_newlines=True) foundTag = False diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md index be0d63838b..1a947d0389 100644 --- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md +++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md @@ -31,9 +31,7 @@ This page is only valid for an `Ubuntu18` host. # 1. Retrieving the images on Docker-Hub # -Currently the images are hosted under the user account `rdefosseoai`. - -This may change in the future. +Currently the images are hosted under the team account `oaisoftwarealliance`. They were previously hosted under the user account `rdefosseoai`. Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`. @@ -49,13 +47,13 @@ Now pull images. ```bash $ docker pull cassandra:2.1 $ docker pull redis:6.0.5 -$ docker pull rdefosseoai/oai-hss:latest -$ docker pull rdefosseoai/magma-mme:latest -$ docker pull rdefosseoai/oai-spgwc:latest -$ docker pull rdefosseoai/oai-spgwu-tiny:latest +$ docker pull oaisoftwarealliance/oai-hss:latest +$ docker pull oaisoftwarealliance/magma-mme:latest +$ docker pull oaisoftwarealliance/oai-spgwc:latest +$ docker pull oaisoftwarealliance/oai-spgwu-tiny:latest -$ docker pull rdefosseoai/oai-enb:develop -$ docker pull rdefosseoai/oai-lte-ue:develop +$ docker pull oaisoftwarealliance/oai-enb:develop +$ docker pull oaisoftwarealliance/oai-lte-ue:develop ``` If the `redis` tag is not available, pick the newest available `6.0.x` tag at [Docker Hub Redis Tags](https://hub.docker.com/_/redis?tab=tags). @@ -63,13 +61,13 @@ If the `redis` tag is not available, pick the newest available `6.0.x` tag at [D And **re-tag** them for tutorials' docker-compose file to work. ```bash -$ docker image tag rdefosseoai/oai-spgwc:latest oai-spgwc:latest -$ docker image tag rdefosseoai/oai-hss:latest oai-hss:latest -$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest -$ docker image tag rdefosseoai/magma-mme:latest magma-mme:latest +$ docker image tag oaisoftwarealliance/oai-spgwc:latest oai-spgwc:latest +$ docker image tag oaisoftwarealliance/oai-hss:latest oai-hss:latest +$ docker image tag oaisoftwarealliance/oai-spgwu-tiny:latest oai-spgwu-tiny:latest +$ docker image tag oaisoftwarealliance/magma-mme:latest magma-mme:latest -$ docker image tag rdefosseoai/oai-enb:develop oai-enb:develop -$ docker image tag rdefosseoai/oai-lte-ue:develop oai-lte-ue:develop +$ docker image tag oaisoftwarealliance/oai-enb:develop oai-enb:develop +$ docker image tag oaisoftwarealliance/oai-lte-ue:develop oai-lte-ue:develop ``` ```bash diff --git a/ci-scripts/yaml_files/5g_l2sim_tdd/README.md b/ci-scripts/yaml_files/5g_l2sim_tdd/README.md index f1e1287995..c3f631cf76 100644 --- a/ci-scripts/yaml_files/5g_l2sim_tdd/README.md +++ b/ci-scripts/yaml_files/5g_l2sim_tdd/README.md @@ -18,9 +18,7 @@ This tutorial is only valid once this file is merged into the `develop` branch. # 1. Retrieving the images on Docker-Hub # -Currently the images are hosted under the user account `rdefosseoai`. - -This may change in the future. +Currently the images are hosted under the team account `oaisoftwarealliance`. They were previously hosted under the user account `rdefosseoai`. Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`. @@ -35,27 +33,27 @@ Now pull images. ```bash $ docker pull mysql:5.7 -$ docker pull rdefosseoai/oai-amf:latest -$ docker pull rdefosseoai/oai-nrf:latest -$ docker pull rdefosseoai/oai-smf:latest -$ docker pull rdefosseoai/oai-spgwu-tiny:latest +$ docker pull oaisoftwarealliance/oai-amf:latest +$ docker pull oaisoftwarealliance/oai-nrf:latest +$ docker pull oaisoftwarealliance/oai-smf:latest +$ docker pull oaisoftwarealliance/oai-spgwu-tiny:latest -$ docker pull rdefosseoai/oai-gnb:develop -$ docker pull rdefosseoai/oai-nr-ue:develop -$ docker pull rdefosseoai/proxy:latest +$ docker pull oaisoftwarealliance/oai-gnb:develop +$ docker pull oaisoftwarealliance/oai-nr-ue:develop +$ docker pull oaisoftwarealliance/proxy:latest ``` And **re-tag** them for tutorials' docker-compose file to work. ```bash -$ docker image tag rdefosseoai/oai-amf:latest oai-amf:latest -$ docker image tag rdefosseoai/oai-nrf:latest oai-nrf:latest -$ docker image tag rdefosseoai/oai-smf:latest oai-smf:latest -$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest +$ docker image tag oaisoftwarealliance/oai-amf:latest oai-amf:latest +$ docker image tag oaisoftwarealliance/oai-nrf:latest oai-nrf:latest +$ docker image tag oaisoftwarealliance/oai-smf:latest oai-smf:latest +$ docker image tag oaisoftwarealliance/oai-spgwu-tiny:latest oai-spgwu-tiny:latest -$ docker image tag rdefosseoai/oai-gnb:develop oai-gnb:develop -$ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop -$ docker image tag rdefosseoai/proxy:latest oai-lte-multi-ue-proxy:latest +$ docker image tag oaisoftwarealliance/oai-gnb:develop oai-gnb:develop +$ docker image tag oaisoftwarealliance/oai-nr-ue:develop oai-nr-ue:develop +$ docker image tag oaisoftwarealliance/proxy:latest oai-lte-multi-ue-proxy:latest ``` ```bash diff --git a/ci-scripts/yaml_files/5g_rfsimulator/README.md b/ci-scripts/yaml_files/5g_rfsimulator/README.md index 64c9084500..aa18571776 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator/README.md +++ b/ci-scripts/yaml_files/5g_rfsimulator/README.md @@ -35,9 +35,7 @@ This page is only valid for an `Ubuntu18` host. # 1. Retrieving the images on Docker-Hub # -Currently the images are hosted under the user account `rdefosseoai`. - -This may change in the future. +Currently the images are hosted under the team account `oaisoftwarealliance`. They were previously hosted under the user account `rdefosseoai`. Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`. @@ -52,25 +50,25 @@ Now pull images. ```bash $ docker pull mysql:5.7 -$ docker pull rdefosseoai/oai-amf:latest -$ docker pull rdefosseoai/oai-nrf:latest -$ docker pull rdefosseoai/oai-smf:latest -$ docker pull rdefosseoai/oai-spgwu-tiny:latest +$ docker pull oaisoftwarealliance/oai-amf:latest +$ docker pull oaisoftwarealliance/oai-nrf:latest +$ docker pull oaisoftwarealliance/oai-smf:latest +$ docker pull oaisoftwarealliance/oai-spgwu-tiny:latest -$ docker pull rdefosseoai/oai-gnb:develop -$ docker pull rdefosseoai/oai-nr-ue:develop +$ docker pull oaisoftwarealliance/oai-gnb:develop +$ docker pull oaisoftwarealliance/oai-nr-ue:develop ``` And **re-tag** them for tutorials' docker-compose file to work. ```bash -$ docker image tag rdefosseoai/oai-amf:latest oai-amf:latest -$ docker image tag rdefosseoai/oai-nrf:latest oai-nrf:latest -$ docker image tag rdefosseoai/oai-smf:latest oai-smf:latest -$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest +$ docker image tag oaisoftwarealliance/oai-amf:latest oai-amf:latest +$ docker image tag oaisoftwarealliance/oai-nrf:latest oai-nrf:latest +$ docker image tag oaisoftwarealliance/oai-smf:latest oai-smf:latest +$ docker image tag oaisoftwarealliance/oai-spgwu-tiny:latest oai-spgwu-tiny:latest -$ docker image tag rdefosseoai/oai-gnb:develop oai-gnb:develop -$ docker image tag rdefosseoai/oai-nr-ue:develop oai-nr-ue:develop +$ docker image tag oaisoftwarealliance/oai-gnb:develop oai-gnb:develop +$ docker image tag oaisoftwarealliance/oai-nr-ue:develop oai-nr-ue:develop ``` ```bash From e946ddbe47e4f1a22fbcfda5604e5fda3a00fbdc Mon Sep 17 00:00:00 2001 From: Eurecom Date: Wed, 27 Apr 2022 21:34:06 +0200 Subject: [PATCH 826/883] bugfix in if5_tools.c --- openair1/PHY/LTE_TRANSPORT/if5_tools.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c index e71b1e31f6..76d62f34a2 100644 --- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c @@ -1052,7 +1052,7 @@ static inline int64_t clock_difftime_ns(struct timespec start, struct timespec e void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seqno, uint16_t packet_type) { LTE_DL_FRAME_PARMS *fp=ru->frame_parms; - int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx]; + int32_t *txp[ru->nb_tx], *rxp[ru->nb_rx]; int32_t *tx_buffer=NULL; uint16_t packet_id=0, i=0; @@ -1131,6 +1131,7 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq //VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id ); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 ); clock_gettime( CLOCK_MONOTONIC, &start_comp); + ru->ifdevice.trx_write_func2(&ru->ifdevice, (proc_timestamp + packet_id*spp_eth-600)*factor, (void*)txp[aid], From 8d43b9c4770b64b47f9f1fc89bf923e630c4741c Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 28 Apr 2022 09:47:05 +0200 Subject: [PATCH 827/883] NSA 2x2: Set bitrate threshold to mark test green (setup problem) --- ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml index 332af80d22..2ef2b7d7ce 100644 --- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml +++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml @@ -120,6 +120,7 @@ DL nrmodule2_quectel 15 + 85 single-ue From 4df04fc48ca599901bd54e43478cc555955c37ef Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 11 Apr 2022 12:55:34 +0100 Subject: [PATCH 828/883] Avoid gNB to exit when UE release or becomes out of coverage --- openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index baae1fa436..0a8e03fc1e 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -385,7 +385,6 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP, rb->recv_sdu(rb, (char *)sdu_pP->data, sdu_sizeP, muiP); } else { LOG_E(RLC, "%s:%d:%s: fatal: SDU sent to unknown RB\n", __FILE__, __LINE__, __FUNCTION__); - exit(1); } nr_rlc_manager_unlock(nr_rlc_ue_manager); From dda9077708ef7197d71c15e993ad976d71098b3c Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 26 Apr 2022 09:46:11 +0100 Subject: [PATCH 829/883] Remove all GTPU tunnels for a specific RNTI after UEContextRelease --- openair2/RRC/NR/rrc_gNB.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 1715677c6d..35c7b487d3 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -3481,6 +3481,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { mac_remove_nr_ue(ctxt_pP->module_id, ctxt_pP->rnti); rrc_rlc_remove_ue(ctxt_pP); pdcp_remove_UE(ctxt_pP); + newGtpuDeleteAllTunnels(ctxt_pP->instance, ctxt_pP->rnti); /* remove RRC UE Context */ ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[ctxt_pP->module_id], ctxt_pP->rnti); From 3bdc709243142929545d334d3253b089aefbdde2 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 26 Apr 2022 18:37:25 +0100 Subject: [PATCH 830/883] Fix build of phy_simulators --- openair1/SIMULATION/NR_PHY/dlsim.c | 4 ++++ openair1/SIMULATION/NR_PHY/prachsim.c | 4 ++++ openair1/SIMULATION/NR_PHY/ulsim.c | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 00262149c9..eff65fa606 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -105,6 +105,10 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer return 0; } +int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { + return 0; +} + // dummy functions int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); } diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index f255ab5337..325cbb1ecc 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -97,6 +97,10 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer return 0; } +int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { + return 0; +} + void rrc_data_ind( const protocol_ctxt_t *const ctxt_pP, diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 09499248b2..e70d08bdb3 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -100,6 +100,11 @@ teid_t newGtpuCreateTunnel(instance_t instance, rnti_t rnti, int incoming_bearer transport_layer_addr_t remoteAddr, int port, gtpCallback callBack) { return 0; } + +int newGtpuDeleteAllTunnels(instance_t instance, rnti_t rnti) { + return 0; +} + extern void fix_scd(NR_ServingCellConfig_t *scd);// forward declaration int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, From 3571769bef1384596e8dd446e5bd851abf84c7c0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 11 Apr 2022 18:22:10 +0200 Subject: [PATCH 831/883] Correctly initialize RLC when using phy-test mode When using phy-test mode, the RNTI for PDCP/RLC initialization would be 0, incorrectly initializing these layers, fixed in this commit. Additionally, in this commit, we only trigger the initialization in cases where the UE context is initialized (before, the RNTI might be 0 in other cases as well). --- openair2/RRC/NR/rrc_gNB_nsa.c | 47 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index bb66d1513b..3f41c69d72 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -339,8 +339,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ sizeof(X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer)); X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = (enc_rval.encoded+7)>>3; itti_send_msg_to_task(TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(0), msg); //Check right id instead of hardcoding - } else if (get_softmodem_params()->do_ra || get_softmodem_params()->sa) { - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0,rrc->module_id); } rrc->Nb_ue++; @@ -374,36 +372,37 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ } if(m == NULL){ + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0, rrc->module_id); LOG_W(RRC, "Calling RRC PDCP/RLC ASN1 request functions for protocol context %p with module_id %d, rnti %x, frame %d, subframe %d eNB_index %d \n", &ctxt, ctxt.module_id, ctxt.rnti, ctxt.frame, ctxt.subframe, ctxt.eNB_index); + + nr_rrc_pdcp_config_asn1_req(&ctxt, + get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL, + ue_context_p->ue_context.rb_config->drb_ToAddModList , + ue_context_p->ue_context.rb_config->drb_ToReleaseList, + (ue_context_p->ue_context.integrity_algorithm << 4) | ue_context_p->ue_context.ciphering_algorithm, + NULL, /* kRRCenc - unused */ + NULL, /* kRRCint - unused */ + kUPenc, /* kUPenc */ + kUPint, /* kUPint */ + NULL, + NULL, + ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); + + nr_rrc_rlc_config_asn1_req (&ctxt, + get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL, + ue_context_p->ue_context.rb_config->drb_ToAddModList, + ue_context_p->ue_context.rb_config->drb_ToReleaseList, + (LTE_PMCH_InfoList_r9_t *) NULL, + ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); + + LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti); } - nr_rrc_pdcp_config_asn1_req(&ctxt, - get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL, - ue_context_p->ue_context.rb_config->drb_ToAddModList , - ue_context_p->ue_context.rb_config->drb_ToReleaseList, - (ue_context_p->ue_context.integrity_algorithm << 4) | ue_context_p->ue_context.ciphering_algorithm, - NULL, /* kRRCenc - unused */ - NULL, /* kRRCint - unused */ - kUPenc, /* kUPenc */ - kUPint, /* kUPint */ - NULL, - NULL, - ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); - - nr_rrc_rlc_config_asn1_req (&ctxt, - get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL, - ue_context_p->ue_context.rb_config->drb_ToAddModList, - ue_context_p->ue_context.rb_config->drb_ToReleaseList, - (LTE_PMCH_InfoList_r9_t *) NULL, - ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); - - LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti); - } void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) { From e4e08925ecb621af0a85ec24f039efdad8103a44 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 12 Apr 2022 18:25:41 +0200 Subject: [PATCH 832/883] Speed up random TB filling in phy-test mode --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 53485886c0..03b35a17a5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -1478,6 +1478,10 @@ void nr_schedule_ue_spec(module_id_t module_id, header->L = htons(bufEnd-buf); dlsch_total_bytes += bufEnd-buf; + for (; buf < bufEnd - 3; buf += 4) { + uint32_t *buf32 = (uint32_t *)buf; + *buf32 = lrand48(); + } for (; buf < bufEnd; buf++) *buf = lrand48() & 0xff; } From 3054102200af4ad66589eccd8d568b66cbfbe2c2 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 13 Apr 2022 17:51:05 +0200 Subject: [PATCH 833/883] targets config file cleanup --- targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf | 3 --- targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 1 - .../CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 2 +- .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf | 1 - .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 - 7 files changed, 1 insertion(+), 9 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf index c07a0db649..6aacd98c7f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf @@ -45,10 +45,7 @@ gNBs = remote_s_portc = 500; remote_s_portd = 2152; ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts = 1; - pusch_AntennaPorts = 1; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 256d724f3f..f95bdf91ae 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -38,7 +38,6 @@ gNBs = ssb_SubcarrierOffset = 0; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index 726e43d7ad..f91683897f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -37,7 +37,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - sib1_tda = 0; + servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 7e2db64aaa..d124c5692f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -34,7 +34,6 @@ gNBs = ssb_SubcarrierOffset = 0; min_rxtxtime = 6; - sib1_tda = 0; do_SRS = 1; pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf index cab801525b..ff64fe718a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -36,7 +36,6 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 950e9c1d38..1bc6de3bfe 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -35,7 +35,6 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; - sib1_tda = 0; do_SRS = 1; ul_prbblacklist = "51,52,53,54" diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 1dc903b811..a0cee6f9ca 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -34,7 +34,6 @@ gNBs = ssb_SubcarrierOffset = 0; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { From 40b0ce997835a37e4a5f404689d201fa0b661580 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 19 Apr 2022 15:47:12 +0200 Subject: [PATCH 834/883] vrb map fixes --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 9a651293b2..ede66f4b38 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -391,7 +391,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP const int16_t N_RA_RB = get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, mu_pusch); uint16_t *vrb_map_UL = &cc->vrb_map_UL[slotP * MAX_BWP_SIZE]; for (int i = 0; i < N_RA_RB * fdm; ++i) - vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] = SL_to_bitmap(start_symbol, N_t_slot*N_dur); + vrb_map_UL[bwp_start + rach_ConfigGeneric->msg1_FrequencyStart + i] |= SL_to_bitmap(start_symbol, N_t_slot*N_dur); } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 4b654e2ad1..f631f9bfd5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -426,7 +426,7 @@ uint32_t schedule_control_sib1(module_id_t module_id, gNB_mac->sched_ctrlCommon->cce_index, gNB_mac->sched_ctrlCommon->aggregation_level); for (int rb = 0; rb < gNB_mac->sched_ctrlCommon->sched_pdsch.rbSize; rb++) { - vrb_map[rb + rbStart] = SL_to_bitmap(startSymbolIndex, nrOfSymbols); + vrb_map[rb + rbStart] |= SL_to_bitmap(startSymbolIndex, nrOfSymbols); } return TBS; } From 4be054b8ba201be69542a8b23ec191b3728cf4fa Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 19 Apr 2022 17:24:48 +0200 Subject: [PATCH 835/883] Fix band66 CI config file locationAndBandwidth --- .../conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf index e26fc3030d..b78ca916f3 100644 --- a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -63,8 +63,8 @@ gNBs = dl_carrierBandwidth = 106; #initialDownlinkBWP #genericParameters - # this is RBstart=27,L=48 (275*(L-1))+RBstart - initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952 + # this is RBstart=0,L=106 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialDLBWPsubcarrierSpacing = 1; @@ -85,7 +85,7 @@ gNBs = pMax = 20; #initialUplinkBWP #genericParameters - initialULBWPlocationAndBandwidth = 13475; + initialULBWPlocationAndBandwidth = 28875; # subcarrierSpacing # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 initialULBWPsubcarrierSpacing = 1; From 1060de4c323aa774060f62ae504925ea0f09be10 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 20 Apr 2022 12:29:16 +0200 Subject: [PATCH 836/883] Correct frame calculation in UL scheduler --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 72061bb9ba..0d61c639ed 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1479,7 +1479,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t if (tda < 0) return false; int K2 = get_K2(scc, scc_sib1, sched_ctrl->active_ubwp, tda, mu); - const int sched_frame = frame + (slot + K2 >= nr_slots_per_frame[mu]); + const int sched_frame = (frame + (slot + K2 >= nr_slots_per_frame[mu])) % 1024; const int sched_slot = (slot + K2) % nr_slots_per_frame[mu]; if (!is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot)) From db0a9f60c1990d90e7bcfafc2bbd3abe2dd9d0d3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 20 Apr 2022 12:32:24 +0200 Subject: [PATCH 837/883] Correct slot calculation in nr_acknack_scheduling() --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 43822d0cd0..0e87af56f5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1598,11 +1598,11 @@ 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; // initializing the values for FDD int nr_slots_period = n_slots_frame; - int first_ul_slot_tdd = slot + minfbtime; + int next_ul_slot = slot + minfbtime; int first_ul_slot_period = 0; if(tdd){ nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); - first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); + next_ul_slot = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); first_ul_slot_period = tdd->nrofDownlinkSlots; } else @@ -1746,8 +1746,8 @@ int nr_acknack_scheduling(int mod_id, AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); - const int s = first_ul_slot_tdd; - pucch->frame = (s < n_slots_frame - 1) ? frame : (frame + 1) % 1024; + const int s = next_ul_slot; + pucch->frame = s < n_slots_frame ? frame : (frame + 1) % 1024; pucch->ul_slot = s % n_slots_frame; } From 9fcc94313c17f42fb0e87c2875e47750e4bfd5dc Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 21 Apr 2022 15:51:10 +0200 Subject: [PATCH 838/883] Make variables in nr_acknack_scheduling() const --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 0e87af56f5..bf9ca4d26d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1596,18 +1596,10 @@ int nr_acknack_scheduling(int mod_id, const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels[CC_id].ServingCellConfigCommon; const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - // initializing the values for FDD - int nr_slots_period = n_slots_frame; - int next_ul_slot = slot + minfbtime; - int first_ul_slot_period = 0; - if(tdd){ - nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity); - next_ul_slot = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period); - first_ul_slot_period = tdd->nrofDownlinkSlots; - } - else - // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration - AssertFatal(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD,"Dynamic TDD not handled yet\n"); + 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; NR_sched_pucch_t *csi_pucch; From d5419a27f2ab14f3d93354bcd46ccb37fe05c333 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 21 Apr 2022 16:38:06 +0200 Subject: [PATCH 839/883] Correct check for free symbols for PUSCH/PDSCH allocation --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 19 ++++++-------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 26 +++++++++---------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 03b35a17a5..4dd098162c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -571,8 +571,8 @@ bool allocate_dl_retransmission(module_id_t module_id, rbStart += rbSize; /* last iteration rbSize was not enough, skip it */ rbSize = 0; - while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + const int slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) rbStart++; if (rbStart >= bwpSize) { @@ -581,7 +581,7 @@ bool allocate_dl_retransmission(module_id_t module_id, } while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols)) && + (rballoc_mask[rbStart + rbSize] & slbitmap) == slbitmap && rbSize < retInfo->rbSize) rbSize++; } @@ -614,12 +614,11 @@ bool allocate_dl_retransmission(module_id_t module_id, ps->nrOfLayers, sched_ctrl, &temp_ps); - while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) + const uint16_t slbitmap = SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols); + while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) rbStart++; - while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) + while (rbStart + rbSize < bwpSize && (rballoc_mask[rbStart + rbSize] & slbitmap) == slbitmap) rbSize++; uint32_t new_tbs; @@ -929,14 +928,12 @@ void pf_dl(module_id_t module_id, const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); // Freq-demain allocation - while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&slbitmap)) + while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) rbStart++; uint16_t max_rbSize = 1; - while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&slbitmap)) + while (rbStart + max_rbSize < bwpSize && (rballoc_mask[rbStart + max_rbSize] & slbitmap) == slbitmap) max_rbSize++; sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 0d61c639ed..e62ac993b4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1002,8 +1002,8 @@ bool allocate_ul_retransmission(module_id_t module_id, } /* Check the resource is enough for retransmission */ - while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) rbStart++; if (rbStart + retInfo->rbSize > bwpSize) { LOG_W(NR_MAC, "cannot allocate retransmission of UE %d/RNTI %04x: no resources (rbStart %d, retInfo->rbSize %d, bwpSize %d\n", UE_id, UE_info->rnti[UE_id], rbStart, retInfo->rbSize, bwpSize); @@ -1023,12 +1023,11 @@ bool allocate_ul_retransmission(module_id_t module_id, &temp_ps); /* the retransmission will use a different time domain allocation, check * that we have enough resources */ - while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) + const uint16_t slbitmap = SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols); + while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) rbStart++; int rbSize = 0; - while (rbStart + rbSize < bwpSize && - (rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) + while (rbStart + rbSize < bwpSize && (rballoc_mask[rbStart + rbSize] & slbitmap) == slbitmap) rbSize++; uint32_t new_tbs; uint16_t new_rbSize; @@ -1260,8 +1259,8 @@ void pf_ul(module_id_t module_id, } LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart); - while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) rbStart++; if (rbStart + min_rb >= bwpSize) { LOG_W(NR_MAC, "cannot allocate continuous UL data for UE %d/RNTI %04x: no resources (rbStart %d, min_rb %d, bwpSize %d\n", @@ -1294,7 +1293,7 @@ void pf_ul(module_id_t module_id, /* Mark the corresponding RBs as used */ n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= slbitmap; continue; } @@ -1398,13 +1397,12 @@ void pf_ul(module_id_t module_id, } update_ul_ue_R_Qm(sched_pusch, ps); - while (rbStart < bwpSize && - !(rballoc_mask[rbStart]&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + while (rbStart < bwpSize && (rballoc_mask[rbStart] & slbitmap) != slbitmap) rbStart++; sched_pusch->rbStart = rbStart; uint16_t max_rbSize = 1; - while (rbStart + max_rbSize < bwpSize && - (rballoc_mask[rbStart + max_rbSize]&&SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols))) + while (rbStart + max_rbSize < bwpSize && (rballoc_mask[rbStart + max_rbSize] & slbitmap) == slbitmap) max_rbSize++; if (rbStart + min_rb >= bwpSize) { @@ -1445,7 +1443,7 @@ void pf_ul(module_id_t module_id, n_rb_sched -= sched_pusch->rbSize; for (int rb = 0; rb < sched_ctrl->sched_pusch.rbSize; rb++) - rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); + rballoc_mask[rb + sched_ctrl->sched_pusch.rbStart] ^= slbitmap; } } From 00609ed15a8f52332e78783b34f1fb16e73000a4 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 21 Apr 2022 17:11:02 +0200 Subject: [PATCH 840/883] Enable UDP traffic test in 5G FDD RFsim test --- ci-scripts/xml_files/container_5g_fdd_rfsim.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml index 61a2af9e54..b41dafb767 100644 --- a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml @@ -33,12 +33,10 @@ 000013 020011 020012 - 100011 - - + 100011 + @@ -104,7 +102,7 @@ rfsim5g-oai-ext-dn rfsim5g-oai-nr-ue -u -i 1 -s - -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M + -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 3M From 85eb5926dd6d6c3446cf9a823ad71ddf9a85fc7f Mon Sep 17 00:00:00 2001 From: Laurent Thomas Date: Thu, 28 Apr 2022 14:36:03 +0200 Subject: [PATCH 841/883] x2 nsa bug --- ci-scripts/ran.py | 72 +++++++++++++++-------------------- openair2/X2AP/x2ap_eNB.c | 19 ++++----- openair3/SCTP/sctp_common.h | 2 +- openair3/SCTP/sctp_eNB_task.c | 18 ++++----- 4 files changed, 45 insertions(+), 66 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 287a0a3c09..97c5b9696e 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -372,36 +372,28 @@ class RANManagement(): else: pcapfile_prefix="gnb_" mySSH.open(lIpAddr, lUserName, lPassWord) - mySSH.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep -v "lo|tun"', '\$', 5) - result = re.search('interfaceToUse=(?P[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) - if result is not None: - eth_interface = result.group('eth_interface') - fltr = 'port 38412 or port 36412 or port 36422' # NGAP, S1AP, X2AP - logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') - pcapfile = pcapfile_prefix + self.testCase_id + '_log.pcap' - mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5) - mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5) + eth_interface = 'any' + fltr = 'sctp' + logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') + pcapfile = pcapfile_prefix + self.testCase_id + '_log.pcap' + mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5) + mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5) mySSH.close() # If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB - result = re.search('T_stdout', str(self.Initialize_eNB_args)) - if (result is not None): - localEpcIpAddr = EPC.IPAddress - localEpcUserName = EPC.UserName - localEpcPassword = EPC.Password - mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) - mySSH.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep -v "lo|tun"', '\$', 5) - result = re.search('interfaceToUse=(?P[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) - if result is not None: - eth_interface = result.group('eth_interface') - fltr = 'port 38412 or port 36412 or port 36422' # NGAP, S1AP, X2AP - logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') - self.epcPcapFile = 'enb_' + self.testCase_id + '_s1log.pcap' - mySSH.command('echo ' + localEpcPassword + ' | sudo -S rm -f /tmp/' + self.epcPcapFile , '\$', 5) - mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5) - mySSH.close() + localEpcIpAddr = EPC.IPAddress + localEpcUserName = EPC.UserName + localEpcPassword = EPC.Password + mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) + eth_interface = 'any' + fltr = 'sctp' + logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') + self.epcPcapFile = 'enb_' + self.testCase_id + '_s1log.pcap' + mySSH.command('echo ' + localEpcPassword + ' | sudo -S rm -f /tmp/' + self.epcPcapFile , '\$', 5) + mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5) + mySSH.close() mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.command('cd ' + lSourcePath, '\$', 5) # Initialize_eNB_args usually start with -O and followed by the location in repository @@ -519,23 +511,19 @@ class RANManagement(): logging.error('\u001B[1;37;41m eNB/gNB/ocp-eNB logging system did not show got sync! \u001B[0m') HTML.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' -O ' + config_file + extra_options, 'KO', CONST.ALL_PROCESSES_OK) # In case of T tracer recording, we need to kill tshark on EPC side - result = re.search('T_stdout', str(self.Initialize_eNB_args)) - if (result is not None): - localEpcIpAddr = EPC.IPAddress - localEpcUserName = EPC.UserName - localEpcPassword = EPC.Password - mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) - logging.debug('\u001B[1m Stopping tshark \u001B[0m') - mySSH.command('echo ' + localEpcPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) - if self.epcPcapFile != '': - time.sleep(0.5) - mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5) - mySSH.close() - time.sleep(1) - if self.epcPcapFile != '': - copyin_res = mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.') - if (copyin_res == 0): - mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.') + localEpcIpAddr = EPC.IPAddress + localEpcUserName = EPC.UserName + localEpcPassword = EPC.Password + mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) + logging.debug('\u001B[1m Stopping tshark \u001B[0m') + mySSH.command('echo ' + localEpcPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) + if self.epcPcapFile != '': + mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5) + mySSH.close() + if self.epcPcapFile != '': + copyin_res = mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.') + if (copyin_res == 0): + mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.') self.prematureExit = True return else: diff --git a/openair2/X2AP/x2ap_eNB.c b/openair2/X2AP/x2ap_eNB.c index 2b1d19001a..a73bc0a640 100644 --- a/openair2/X2AP/x2ap_eNB.c +++ b/openair2/X2AP/x2ap_eNB.c @@ -70,8 +70,7 @@ void x2ap_eNB_register_eNB(x2ap_eNB_instance_t *instance_p, net_ip_address_t *local_ip_addr, uint16_t in_streams, uint16_t out_streams, - uint32_t enb_port_for_X2C, - int multi_sd); + uint32_t enb_port_for_X2C); static void x2ap_eNB_handle_handover_req(instance_t instance, @@ -249,20 +248,17 @@ static void x2ap_eNB_register_eNB(x2ap_eNB_instance_t *instance_p, net_ip_address_t *local_ip_addr, uint16_t in_streams, uint16_t out_streams, - uint32_t enb_port_for_X2C, - int multi_sd) { + uint32_t enb_port_for_X2C) { MessageDef *message = NULL; - sctp_new_association_req_multi_t *sctp_new_association_req = NULL; x2ap_eNB_data_t *x2ap_enb_data = NULL; DevAssert(instance_p != NULL); DevAssert(target_eNB_ip_address != NULL); - message = itti_alloc_new_message(TASK_X2AP, 0, SCTP_NEW_ASSOCIATION_REQ_MULTI); - sctp_new_association_req = &message->ittiMsg.sctp_new_association_req_multi; + message = itti_alloc_new_message(TASK_X2AP, 0, SCTP_NEW_ASSOCIATION_REQ); + sctp_new_association_req_t *sctp_new_association_req = &message->ittiMsg.sctp_new_association_req; sctp_new_association_req->port = enb_port_for_X2C; sctp_new_association_req->ppid = X2AP_SCTP_PPID; sctp_new_association_req->in_streams = in_streams; sctp_new_association_req->out_streams = out_streams; - sctp_new_association_req->multi_sd = multi_sd; memcpy(&sctp_new_association_req->remote_address, target_eNB_ip_address, sizeof(*target_eNB_ip_address)); @@ -399,8 +395,7 @@ void x2ap_eNB_handle_sctp_init_msg_multi_cnf( &instance->enb_x2_ip_address, instance->sctp_in_streams, instance->sctp_out_streams, - instance->enb_port_for_X2C, - instance->multi_sd); + instance->enb_port_for_X2C); } } @@ -645,7 +640,8 @@ void *x2ap_task(void *arg) { while (1) { itti_receive_msg(TASK_X2AP, &received_msg); - + LOG_D(X2AP, "Received message %d:%s\n", + ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); switch (ITTI_MSG_ID(received_msg)) { case TERMINATE_MESSAGE: X2AP_WARN(" *** Exiting X2AP thread\n"); @@ -684,7 +680,6 @@ void *x2ap_task(void *arg) { case X2AP_ENDC_SGNB_ADDITION_REQ_ACK: x2ap_gNB_trigger_sgNB_add_req_ack(ITTI_MSG_DESTINATION_INSTANCE(received_msg), &X2AP_ENDC_SGNB_ADDITION_REQ_ACK(received_msg)); - LOG_I(X2AP, "Received elements for X2AP_ENDC_SGNB_ADDITION_REQ_ACK \n"); break; case X2AP_ENDC_SGNB_RECONF_COMPLETE: diff --git a/openair3/SCTP/sctp_common.h b/openair3/SCTP/sctp_common.h index ecaeebd090..024feb8b09 100644 --- a/openair3/SCTP/sctp_common.h +++ b/openair3/SCTP/sctp_common.h @@ -37,7 +37,7 @@ #if defined(ENB_MODE) # include "common/utils/LOG/log.h" # define SCTP_ERROR(x, args...) LOG_E(SCTP, x, ##args) -# define SCTP_DEBUG(x, args...) LOG_I(SCTP, x, ##args) +# define SCTP_DEBUG(x, args...) LOG_D(SCTP, x, ##args) # define SCTP_WARN(x, args...) LOG_W(SCTP, x, ##args) #else # define SCTP_ERROR(x, args...) do { fprintf(stderr, "[SCTP][E]"x, ##args); } while(0) diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index ab49125856..06e606e36b 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -318,7 +318,8 @@ sctp_handle_new_association_req_multi( assoc_id, used_address); } } else { - SCTP_DEBUG("sctp_connectx SUCCESS, used %d addresses assoc_id %d\n", + SCTP_DEBUG("sctp_connectx SUCCESS, socket %d used %d addresses assoc_id %d\n", + sd, used_address, assoc_id); } @@ -750,7 +751,7 @@ static int sctp_create_new_listener( } if (server_type) { - if ((sd = socket(PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP)) < 0) { + if ((sd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP)) < 0) { SCTP_ERROR("socket: %s:%d\n", strerror(errno), errno); free(addr); return -1; @@ -822,7 +823,7 @@ static int sctp_create_new_listener( sctp_cnx = NULL; return -1; } - + SCTP_DEBUG("Created listen socket: %d\n", sd); /* Insert new element at end of list */ STAILQ_INSERT_TAIL(&sctp_cnx_list, sctp_cnx, entries); sctp_nb_cnx++; @@ -1110,11 +1111,10 @@ void *sctp_eNB_process_itti_msg(void *notUsed) /* Check if there is a packet to handle */ if (received_msg != NULL) { + LOG_D(SCTP,"Received message %d:%s\n", + ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg)); switch (ITTI_MSG_ID(received_msg)) { case SCTP_INIT_MSG: { - SCTP_DEBUG("Received SCTP_INIT_MSG\n"); - - /* We received a new connection request */ if (sctp_create_new_listener( ITTI_MSG_DESTINATION_INSTANCE(received_msg), ITTI_MSG_ORIGIN_ID(received_msg), @@ -1126,11 +1126,7 @@ void *sctp_eNB_process_itti_msg(void *notUsed) break; case SCTP_INIT_MSG_MULTI_REQ: { - int multi_sd; - - SCTP_DEBUG("Received SCTP_INIT_MSG_MULTI_REQ\n"); - - multi_sd = sctp_create_new_listener( + int multi_sd = sctp_create_new_listener( ITTI_MSG_DESTINATION_INSTANCE(received_msg), ITTI_MSG_ORIGIN_ID(received_msg), &received_msg->ittiMsg.sctp_init_multi,1); From 454dc0cfab3d378ee3e488b5b64f3e92232c4f55 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 31 Mar 2022 12:19:00 +0530 Subject: [PATCH 842/883] Fixed memory leaks identified by address san There is still a leak that needs to be fixed in rrc_UE.c Should properly free NR_BCCH_BCH_Message_t *bcch_message after asn decoder using ASN_STRUCT_FREE() --- openair2/RRC/NR_UE/rrc_UE.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 6a678d0e18..7dca9b2774 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -359,7 +359,8 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, return; } nr_rrc_ue_process_rrcReconfiguration(module_id,RRCReconfiguration); - } + ASN_STRUCT_FREE(asn_DEF_NR_RRCReconfiguration, RRCReconfiguration); + } break; case nr_RadioBearerConfigX_r15: @@ -392,6 +393,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, else if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig); } + ASN_STRUCT_FREE(asn_DEF_NR_RadioBearerConfig, RadioBearerConfig); } break; From a8f879ea128639048179ca34b98bcec763b55cd2 Mon Sep 17 00:00:00 2001 From: Vijay Chadachan Date: Thu, 28 Apr 2022 18:08:20 +0200 Subject: [PATCH 843/883] Update for the code review comment. Instead of NULL RAND value check, added the flag to indicate if the AUTH process started. The flag is used manage the timer handling for authentication process when stored RAND values is same as received RAND value in AUTH_REQ. --- openair3/NAS/UE/EMM/Authentication.c | 7 ++++--- openair3/NAS/UE/EMM/Authentication.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openair3/NAS/UE/EMM/Authentication.c b/openair3/NAS/UE/EMM/Authentication.c index 97c7082be0..36c90c4ab0 100644 --- a/openair3/NAS/UE/EMM/Authentication.c +++ b/openair3/NAS/UE/EMM/Authentication.c @@ -180,13 +180,14 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi, OctetString res = {AUTH_RES_SIZE, authentication_data->res}; if ((memcmp(authentication_data->rand, rand->value, AUTH_CK_SIZE) != 0) || - (memcmp(nullRand,authentication_data->rand, AUTH_CK_SIZE) == 0)) { + (authentication_data->auth_process_started == FALSE)) { /* * There is no valid stored RAND in the ME or the stored RAND is * different from the new received value in the AUTHENTICATION - * REQUEST message OR the received RAND is all "0" or "NULL" - * process the new received AUTHENTICATIOn REQUEST message + * REQUEST message OR if this is first time UE starting the + * Authentication process */ + authentication_data->auth_process_started = TRUE; OctetString auts; auts.length = 0; auts.value = (uint8_t *)malloc(AUTH_AUTS_SIZE); diff --git a/openair3/NAS/UE/EMM/Authentication.h b/openair3/NAS/UE/EMM/Authentication.h index 50b2d990aa..466d3256f3 100644 --- a/openair3/NAS/UE/EMM/Authentication.h +++ b/openair3/NAS/UE/EMM/Authentication.h @@ -18,6 +18,8 @@ typedef struct { unsigned char mac_count:2; /* MAC failure counter (#20) */ unsigned char umts_count:2; /* UMTS challenge failure counter (#26) */ unsigned char sync_count:2; /* Sync failure counter (#21) */ + unsigned char auth_process_started:1; /* Authentication started */ + unsigned char reserve:1; /* For future use, byte aligned */ } authentication_data_t; #endif From ca0666868239ed0b5d2abe6f8c4abb728230ef99 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 21 Mar 2022 14:35:41 +0000 Subject: [PATCH 844/883] Handle RRC processing time at gNB --- openair2/GNB_APP/gnb_config.c | 3 +- openair2/LAYER2/NR_MAC_gNB/config.c | 23 ++++++++-- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 3 ++ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 7 +++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 23 ++++++---- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 22 ++++++++++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 4 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 3 +- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 9 ++++ openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 3 +- openair2/RRC/NR/nr_rrc_defs.h | 6 ++- openair2/RRC/NR/rrc_gNB.c | 43 +++++++++++++++++-- openair2/RRC/NR/rrc_gNB_nsa.c | 5 +-- 14 files changed, 130 insertions(+), 26 deletions(-) diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 2c486ec832..0648249122 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -2066,8 +2066,7 @@ void configure_gnb_du_mac(int inst) { NULL, 0, 0, // rnti - (NR_CellGroupConfig_t *)NULL - ); + NULL); } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index a2cbd4807f..ca709666eb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -449,6 +449,25 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, rrc_pdsch_AntennaPorts } +int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, rnti_t rnti, NR_SubcarrierSpacing_t subcarrierSpacing, uint32_t rrc_reconfiguration_delay) { + if (rrc_reconfiguration_delay > 0) { + const int UE_id = find_nr_UE_id(Mod_idP,rnti); + if (UE_id >= 0) { + NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + if (sched_ctrl->rrc_processing_timer == 0) { + const uint16_t sf_ahead = (uint16_t) ceil(6.0/(float)(0x01<rrc_processing_timer = (rrc_reconfiguration_delay<rnti); UE_info->active[UE_id] = true; UE_info->Msg4_ACKed[UE_id] = true; + + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; + NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp, + RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon, + sib1); + // 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs + sched_ctrl->rrc_processing_timer = (NR_RRC_SETUP_DELAY_MS << genericParameters->subcarrierSpacing); // RRCSetup 10 ms } else { LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) RA Procedure failed at Msg4!\n", UE_id, ra->rnti); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 53485886c0..ef6dfef45b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -488,17 +488,22 @@ void nr_store_dlsch_buffer(module_id_t module_id, const int lcid = sched_ctrl->dl_lc_ids[i]; const uint16_t rnti = UE_info->rnti[UE_id]; LOG_D(NR_MAC, "In %s: UE %d/%x: LCID %d\n", __FUNCTION__, UE_id, rnti, lcid); + + if (lcid == DL_SCH_LCID_DTCH && sched_ctrl->rrc_processing_timer > 0) { + continue; + } + start_meas(&RC.nrmac[module_id]->rlc_status_ind); sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id, - rnti, - module_id, - frame, - slot, - ENB_FLAG_YES, - MBMS_FLAG_NO, - lcid, - 0, - 0); + rnti, + module_id, + frame, + slot, + ENB_FLAG_YES, + MBMS_FLAG_NO, + lcid, + 0, + 0); stop_meas(&RC.nrmac[module_id]->rlc_status_ind); if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 6f17556c91..b58e3280c3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2604,6 +2604,11 @@ void nr_csirs_scheduling(int Mod_idP, for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + + if (sched_ctrl->rrc_processing_timer > 0) { + continue; + } + NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id]; if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || @@ -2791,6 +2796,23 @@ void nr_csirs_scheduling(int Mod_idP, } } +void nr_mac_update_timers(module_id_t module_id, + frame_t frame, + sub_frame_t slot) { + NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; + const NR_list_t *UE_list = &UE_info->list; + for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + if (sched_ctrl->rrc_processing_timer > 0) { + sched_ctrl->rrc_processing_timer--; + if (sched_ctrl->rrc_processing_timer == 0) { + LOG_I(NR_MAC, "(%d.%d) De-activating RRC processing timer for UE %d\n", frame, slot, UE_id); + sched_ctrl->update_pdsch_ps = true; + sched_ctrl->update_pusch_ps = true; + } + } + } +} /*void fill_nfapi_coresets_and_searchspaces(NR_CellGroupConfig_t *cg, nfapi_nr_coreset_t *coreset, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c index bf2af3b388..8680cc25d1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c @@ -125,7 +125,7 @@ void nr_schedule_srs(int module_id, frame_t frame) { sched_ctrl->sched_srs.slot = -1; sched_ctrl->sched_srs.srs_scheduled = false; - if(!UE_info->Msg4_ACKed[UE_id]) { + if(!UE_info->Msg4_ACKed[UE_id] || sched_ctrl->rrc_processing_timer > 0) { continue; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 43822d0cd0..ae9c2d97a3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -702,7 +702,9 @@ void nr_csi_meas_reporting(int Mod_idP, for (int UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) { const NR_CellGroupConfig_t *CellGroup = UE_info->CellGroup[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - if (sched_ctrl->ul_failure==1 && get_softmodem_params()->phy_test==0) continue; + if ((sched_ctrl->rrc_processing_timer > 0) || (sched_ctrl->ul_failure==1 && get_softmodem_params()->phy_test==0)) { + continue; + } if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) continue; const NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 72061bb9ba..bbe135413b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1201,8 +1201,9 @@ void pf_ul(module_id_t module_id, const bool do_sched = nr_UE_is_to_be_scheduled(module_id, 0, UE_id, sched_pusch->frame, sched_pusch->slot); LOG_D(NR_MAC,"pf_ul: do_sched UE %d => %s\n",UE_id,do_sched ? "yes" : "no"); - if (B == 0 && !do_sched) + if ((B == 0 && !do_sched) || (sched_ctrl->rrc_processing_timer > 0)) { continue; + } /* Schedule UE on SR or UL inactivity and no data (otherwise, will be scheduled * based on data to transmit) */ diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 399033abd0..54abee888b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -46,6 +46,11 @@ void config_common(int Mod_idP, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc); +int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, + rnti_t rnti, + NR_SubcarrierSpacing_t subcarrierSpacing, + uint32_t rrc_reconfiguration_delay); + int rrc_mac_config_req_gNB(module_id_t Mod_idP, int ssb_SubcarrierOffset, rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, @@ -64,6 +69,10 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, frame_t frameP, sub_frame_t subframeP); +void nr_mac_update_timers(module_id_t module_id, + frame_t frame, + sub_frame_t slot); + void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame_rxP, sub_frame_t slot_rxP); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index e32e63a778..31cdd96af0 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -646,12 +646,13 @@ typedef struct { /// UL HARQ processes that await retransmission NR_list_t retrans_ul_harq; NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl;// MAC CE related information - /// number of active DL LCs uint8_t dl_lc_num; /// order in which DLSCH scheduler should allocate LCs uint8_t dl_lc_ids[NR_MAX_NUM_LCID]; + /// Timer for RRC processing procedures + uint32_t rrc_processing_timer; } NR_UE_sched_ctrl_t; typedef struct { diff --git a/openair2/RRC/NR/nr_rrc_defs.h b/openair2/RRC/NR/nr_rrc_defs.h index b26f8243a0..5cc3157bce 100644 --- a/openair2/RRC/NR/nr_rrc_defs.h +++ b/openair2/RRC/NR/nr_rrc_defs.h @@ -96,6 +96,10 @@ typedef struct nr_uid_linear_allocator_s { #define PROTOCOL_NR_RRC_CTXT_FMT PROTOCOL_CTXT_FMT #define PROTOCOL_NR_RRC_CTXT_ARGS(CTXT_Pp) PROTOCOL_NR_CTXT_ARGS(CTXT_Pp) +// 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs +#define NR_RRC_SETUP_DELAY_MS 10 +#define NR_RRC_RECONFIGURATION_DELAY_MS 10 +#define NR_RRC_BWP_SWITCHING_DELAY_MS 6 #define NR_UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! #define NR_UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1 @@ -372,7 +376,7 @@ typedef struct gNB_RRC_UE_s { rb_id_t gnb_gtp_ebi[S1AP_MAX_E_RAB]; rb_id_t gnb_gtp_psi[S1AP_MAX_E_RAB]; //GTPV1 F1-U TUNNELS - uint32_t incoming_teid[S1AP_MAX_E_RAB]; + uint32_t incoming_teid[S1AP_MAX_E_RAB]; uint32_t ul_failure_timer; uint32_t ue_release_timer; diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 1715677c6d..4be59273c1 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -729,6 +729,13 @@ rrc_gNB_generate_defaultRRCReconfiguration( LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Reconfiguration\n"); + if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } + /* Free all NAS PDUs */ for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) { @@ -995,6 +1002,13 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( cellGroupConfig); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n"); + if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } + /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) { @@ -1168,6 +1182,13 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( NULL); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); + if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } + /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) { if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) { @@ -1269,8 +1290,15 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL); ue_context_pP->ue_context.pdu_session_release_command_flag = 1; - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, - "[MSG] RRC Reconfiguration\n"); + + LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); + + if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } /* Free all NAS PDUs */ if (nas_length > 0) { @@ -1819,8 +1847,15 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, NULL, NULL); - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, - "[MSG] RRC Reconfiguration\n"); + + LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); + + if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index bb66d1513b..fb8de46953 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -241,9 +241,8 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ cipher_algo, NR_SecurityConfig__keyToUse_secondary); } - NR_ServingCellConfig_t *scc = ue_context_p->ue_context.spCellConfig - ? ue_context_p->ue_context.spCellConfig->spCellConfigDedicated - : NULL; + NR_ServingCellConfig_t *scc = ue_context_p->ue_context.spCellConfig ? + ue_context_p->ue_context.spCellConfig->spCellConfigDedicated : NULL; fill_default_reconfig(carrier->servingcellconfigcommon, scc, reconfig_ies, From d8a127810c0a0a34f938b45414b5b7d7a08f006c Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 2 May 2022 11:35:36 +0100 Subject: [PATCH 845/883] Fix mcs table update during RRCReconfiguration --- openair2/LAYER2/NR_MAC_gNB/config.c | 2 -- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 +--- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 23 +++++++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index ca709666eb..b12454735d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -676,8 +676,6 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, LOG_I(NR_MAC,"Modified UE_id %d/%x with CellGroup\n",UE_id,rnti); process_CellGroup(CellGroup,&UE_info->UE_sched_ctrl[UE_id]); NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - sched_ctrl->update_pdsch_ps = true; - sched_ctrl->update_pusch_ps = true; const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL; if (get_softmodem_params()->sa) { // add all available DL HARQ processes for this UE in SA diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index ef6dfef45b..7250bf4fcc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -593,7 +593,7 @@ bool allocate_dl_retransmission(module_id_t module_id, /* check whether we need to switch the TDA allocation since the last * (re-)transmission */ - if (ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) { + if (ps->time_domain_allocation != tda) { nr_set_pdsch_semi_static(sib1, scc, cg, @@ -603,7 +603,6 @@ bool allocate_dl_retransmission(module_id_t module_id, ps->nrOfLayers, sched_ctrl, ps); - sched_ctrl->update_pdsch_ps = false; } } else { /* the retransmission will use a different time domain allocation, check @@ -928,7 +927,6 @@ void pf_dl(module_id_t module_id, layers[UE_id], sched_ctrl, ps); - sched_ctrl->update_pdsch_ps = false; } const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index b58e3280c3..d7478474b1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -579,16 +579,21 @@ void nr_set_pdsch_semi_static(const NR_SIB1_t *sib1, bwpd = (NR_BWP_DownlinkDedicated_t*)bwpd0; } - if (bwpd && - bwpd->pdsch_Config && - bwpd->pdsch_Config->choice.setup && - bwpd->pdsch_Config->choice.setup->mcs_Table) { - if (*bwpd->pdsch_Config->choice.setup->mcs_Table == 0) - ps->mcsTableIdx = 1; - else - ps->mcsTableIdx = 2; + if (sched_ctrl->update_pdsch_ps == true) { + if (bwpd && + bwpd->pdsch_Config && + bwpd->pdsch_Config->choice.setup && + bwpd->pdsch_Config->choice.setup->mcs_Table) { + if (*bwpd->pdsch_Config->choice.setup->mcs_Table == 0) { + ps->mcsTableIdx = 1; + } else { + ps->mcsTableIdx = 2; + } + } else { + ps->mcsTableIdx = 0; + } + sched_ctrl->update_pdsch_ps = false; } - else ps->mcsTableIdx = 0; LOG_D(NR_MAC,"MCS Table Index: %d\n",ps->mcsTableIdx); NR_PDSCH_Config_t *pdsch_Config; From 8569a47bc62bda9a9b21815f6ea5a7750813fba3 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 2 May 2022 11:37:19 +0100 Subject: [PATCH 846/883] Remove sib1_tda from configuration files to use default value --- targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf | 1 - targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf | 1 - .../CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf | 1 - .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 1 - .../GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 1 - 7 files changed, 7 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf index c07a0db649..92d1ce432c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf @@ -48,7 +48,6 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf index 256d724f3f..f95bdf91ae 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf @@ -38,7 +38,6 @@ gNBs = ssb_SubcarrierOffset = 0; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf index 726e43d7ad..74f6c34f57 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf @@ -37,7 +37,6 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - sib1_tda = 0; servingCellConfigCommon = ( { #spCellConfigCommon diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index 7e2db64aaa..d124c5692f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -34,7 +34,6 @@ gNBs = ssb_SubcarrierOffset = 0; min_rxtxtime = 6; - sib1_tda = 0; do_SRS = 1; pdcch_ConfigSIB1 = ( diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf index cab801525b..ff64fe718a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -36,7 +36,6 @@ gNBs = pdsch_AntennaPorts = 1; pusch_AntennaPorts = 1; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 950e9c1d38..1bc6de3bfe 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -35,7 +35,6 @@ gNBs = ssb_SubcarrierOffset = 0; pdsch_AntennaPorts_N1 = 2; pusch_AntennaPorts = 2; - sib1_tda = 0; do_SRS = 1; ul_prbblacklist = "51,52,53,54" diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 1dc903b811..a0cee6f9ca 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -34,7 +34,6 @@ gNBs = ssb_SubcarrierOffset = 0; min_rxtxtime = 6; - sib1_tda = 0; pdcch_ConfigSIB1 = ( { From 4b7b621f00bc9c31e7fe35914df06f542d848659 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 2 May 2022 11:43:03 +0100 Subject: [PATCH 847/883] Minor improvements and cleanup in 5G NR SA configuration files --- .../CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf | 13 ++++--------- .../CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf | 7 +------ .../CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf | 13 ++++--------- .../CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf | 13 ++++--------- 4 files changed, 13 insertions(+), 33 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf index d124c5692f..e645094e8b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf @@ -19,10 +19,6 @@ gNBs = { sst = 1; sd = 0x1; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true } ); @@ -33,7 +29,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - min_rxtxtime = 6; + min_rxtxtime = 2; do_SRS = 1; pdcch_ConfigSIB1 = ( @@ -218,7 +214,7 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; + pucch0_dtx_threshold = 100; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); @@ -228,12 +224,11 @@ RUs = ( local_rf = "yes" nb_tx = 1 nb_rx = 1 - att_tx = 0 - att_rx = 0; + att_tx = 6; + att_rx = 6; bands = [41]; max_pdschReferenceSignalPower = -27; max_rxgain = 114; - sf_extension = 0; eNB_instances = [0]; #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf index 1bc6de3bfe..2881a77d48 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf @@ -19,10 +19,6 @@ gNBs = { sst = 1; sd = 0x1; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true } ); @@ -40,7 +36,7 @@ gNBs = pdcch_ConfigSIB1 = ( { - controlResourceSetZero = 11; + controlResourceSetZero = 12; searchSpaceZero = 0; } ); @@ -234,7 +230,6 @@ RUs = ( bands = [78]; max_pdschReferenceSignalPower = -27; max_rxgain = 75; - sf_extension = 0; eNB_instances = [0]; ##beamforming 1x2 matrix: 1 layer x 2 antennas bf_weights = [0x00007fff, 0x0000]; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index a0cee6f9ca..e3024737ee 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -19,10 +19,6 @@ gNBs = { sst = 1; sd = 0x1; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true } ); @@ -33,7 +29,7 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - min_rxtxtime = 6; + min_rxtxtime = 2; pdcch_ConfigSIB1 = ( { @@ -217,7 +213,7 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; - pucch0_dtx_threshold = 150; + pucch0_dtx_threshold = 100; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); @@ -227,12 +223,11 @@ RUs = ( local_rf = "yes" nb_tx = 1 nb_rx = 1 - att_tx = 0 - att_rx = 0; + att_tx = 6; + att_rx = 6; bands = [78]; max_pdschReferenceSignalPower = -27; max_rxgain = 114; - sf_extension = 0; eNB_instances = [0]; #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf index 74f8f2cb3b..b8d71015c1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.162PRB.2x2.usrpn300.conf @@ -19,10 +19,6 @@ gNBs = { sst = 1; sd = 0x1; // 0 false, else true - }, - { - sst = 1; - sd = 0x112233; // 0 false, else true } ); @@ -33,12 +29,12 @@ gNBs = ////////// Physical parameters: ssb_SubcarrierOffset = 0; - pdsch_AntennaPorts_N1 = 2; + pdsch_AntennaPorts_N1 = 1; pusch_AntennaPorts = 2; ul_prbblacklist = "79,80,81,82" pdcch_ConfigSIB1 = ( { - controlResourceSetZero = 11; + controlResourceSetZero = 12; searchSpaceZero = 10; } ); @@ -236,7 +232,7 @@ MACRLCs = ( num_cc = 1; tr_s_preference = "local_L1"; tr_n_preference = "local_RRC"; - pusch_TargetSNRx10 = 200; + pusch_TargetSNRx10 = 150; pucch_TargetSNRx10 = 200; ulsch_max_frame_inactivity = 0; } @@ -247,7 +243,7 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; prach_dtx_threshold = 120; - pucch0_dtx_threshold = 120; + pucch0_dtx_threshold = 100; } ); @@ -261,7 +257,6 @@ RUs = ( bands = [78]; max_pdschReferenceSignalPower = -27; max_rxgain = 75; - sf_extension = 0; eNB_instances = [0]; ##beamforming 1x2 matrix: 1 layer x 2 antennas bf_weights = [0x00007fff, 0x0000]; From 79d9c2e8dc266ac61af188182f43f3a5af46cb38 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 2 May 2022 11:50:08 +0100 Subject: [PATCH 848/883] Address review comments --- openair2/RRC/NR/rrc_gNB.c | 78 +++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 4be59273c1..74e7997fba 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -729,13 +729,6 @@ rrc_gNB_generate_defaultRRCReconfiguration( LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)buffer, size, "[MSG] RRC Reconfiguration\n"); - if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { - nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP->ue_context.rnti, - *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, - NR_RRC_RECONFIGURATION_DELAY_MS); - } - /* Free all NAS PDUs */ for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) { @@ -804,6 +797,13 @@ rrc_gNB_generate_defaultRRCReconfiguration( default : LOG_W(NR_RRC, "Unknown node type %d\n", RC.nrrrc[ctxt_pP->module_id]->node_type); } + + if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } } //----------------------------------------------------------------------------- @@ -1002,13 +1002,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( cellGroupConfig); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n"); - if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { - nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP->ue_context.rnti, - *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, - NR_RRC_RECONFIGURATION_DELAY_MS); - } - /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) { @@ -1045,6 +1038,13 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( buffer, PDCP_TRANSMISSION_MODE_CONTROL); #endif + + if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } } //----------------------------------------------------------------------------- @@ -1182,13 +1182,6 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( NULL); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); - if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { - nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP->ue_context.rnti, - *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, - NR_RRC_RECONFIGURATION_DELAY_MS); - } - /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) { if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) { @@ -1225,6 +1218,13 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( buffer, PDCP_TRANSMISSION_MODE_CONTROL); #endif + + if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } } //----------------------------------------------------------------------------- @@ -1290,15 +1290,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( NULL); ue_context_pP->ue_context.pdu_session_release_command_flag = 1; - - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); - - if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { - nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP->ue_context.rnti, - *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, - NR_RRC_RECONFIGURATION_DELAY_MS); - } + LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, + "[MSG] RRC Reconfiguration\n"); /* Free all NAS PDUs */ if (nas_length > 0) { @@ -1332,6 +1325,13 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( buffer, PDCP_TRANSMISSION_MODE_CONTROL); #endif + + if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } } //----------------------------------------------------------------------------- @@ -1847,15 +1847,8 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( NULL, NULL, NULL); - - LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); - - if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { - nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, - ue_context_pP->ue_context.rnti, - *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, - NR_RRC_RECONFIGURATION_DELAY_MS); - } + LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, + "[MSG] RRC Reconfiguration\n"); /* Free all NAS PDUs */ for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { @@ -1897,6 +1890,13 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( PDCP_TRANSMISSION_MODE_CONTROL); #endif } + + if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) { + nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, + ue_context_pP->ue_context.rnti, + *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, + NR_RRC_RECONFIGURATION_DELAY_MS); + } } //----------------------------------------------------------------------------- From 305347af9ae820c865968aa7683c3fcc5dc65591 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 2 May 2022 14:13:01 +0100 Subject: [PATCH 849/883] Fix indentation and improve function nr_mac_enable_ue_rrc_processing_timer --- openair2/LAYER2/NR_MAC_gNB/config.c | 31 ++++++++--------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 33 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index b12454735d..9f7493e581 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -450,22 +450,23 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, rrc_pdsch_AntennaPorts } int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, rnti_t rnti, NR_SubcarrierSpacing_t subcarrierSpacing, uint32_t rrc_reconfiguration_delay) { - if (rrc_reconfiguration_delay > 0) { - const int UE_id = find_nr_UE_id(Mod_idP,rnti); - if (UE_id >= 0) { - NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info; - NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; - if (sched_ctrl->rrc_processing_timer == 0) { - const uint16_t sf_ahead = (uint16_t) ceil(6.0/(float)(0x01<rrc_processing_timer = (rrc_reconfiguration_delay<UE_info; + NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; + const uint16_t sf_ahead = 6/(0x01<0); + const uint16_t sl_ahead = sf_ahead * (0x01<rrc_processing_timer = (rrc_reconfiguration_delay<> 3; + R, + 1, /* rbSize */ + 10, /* hypothetical number of slots */ + 0, /* N_PRB_DMRS * N_DMRS_SLOT */ + 0 /* N_PRB_oh, 0 for initialBWP */, + 0 /* tb_scaling */, + 1 /* nrOfLayers */) >> 3; } } @@ -1274,15 +1273,15 @@ void nr_schedule_ue_spec(module_id_t module_id, if (phaseTrackingRS) { bool valid_ptrs_setup = set_dl_ptrs_values(phaseTrackingRS->choice.setup, - pdsch_pdu->rbSize, - pdsch_pdu->mcsIndex[0], - pdsch_pdu->mcsTable[0], - &pdsch_pdu->PTRSFreqDensity, - &pdsch_pdu->PTRSTimeDensity, - &pdsch_pdu->PTRSPortIndex, - &pdsch_pdu->nEpreRatioOfPDSCHToPTRS, - &pdsch_pdu->PTRSReOffset, - pdsch_pdu->NrOfSymbols); + pdsch_pdu->rbSize, + pdsch_pdu->mcsIndex[0], + pdsch_pdu->mcsTable[0], + &pdsch_pdu->PTRSFreqDensity, + &pdsch_pdu->PTRSTimeDensity, + &pdsch_pdu->PTRSPortIndex, + &pdsch_pdu->nEpreRatioOfPDSCHToPTRS, + &pdsch_pdu->PTRSReOffset, + pdsch_pdu->NrOfSymbols); if (valid_ptrs_setup) pdsch_pdu->pduBitmap |= 0x1; // Bit 0: pdschPtrs - Indicates PTRS included (FR2) From be3498ddd282c7b6ba6cc05d594040415f11874a Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 2 May 2022 14:26:17 +0100 Subject: [PATCH 850/883] Update documentation to be able to run OAI gNB with OAI UE and COTS UE with the same configuration file --- doc/RUNMODEM.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index 919bbc2dc0..119027f169 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -165,7 +165,7 @@ From the `cmake_targets/ran_build/build` folder: gNB on machine 1: -`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --sa` +`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --sa` UE on machine 2: @@ -173,7 +173,7 @@ UE on machine 2: With the RF simulator (on the same machine): -`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa` +`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --sa` `sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 -s 516 --rfsim --sa` From 299642344ad98273f6622c729550a852ff152ee8 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 2 May 2022 19:08:10 +0200 Subject: [PATCH 851/883] fix for ssb offset scaling issue --- openair1/PHY/INIT/nr_parms.c | 6 ++++-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 6 ++++-- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 7 ++++++- openair2/LAYER2/NR_MAC_gNB/config.c | 13 ++++++++----- .../LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 2 +- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 11 +++++++++-- 7 files changed, 33 insertions(+), 14 deletions(-) diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 757a8d965f..458c8b3403 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -366,8 +366,10 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, uint8_t sco = 0; if (((fp->freq_range == nr_FR1) && (config->ssb_table.ssb_subcarrier_offset<24)) || - ((fp->freq_range == nr_FR2) && (config->ssb_table.ssb_subcarrier_offset<12)) ) - sco = config->ssb_table.ssb_subcarrier_offset; + ((fp->freq_range == nr_FR2) && (config->ssb_table.ssb_subcarrier_offset<12)) ) { + if (fp->freq_range == nr_FR1) + sco = config->ssb_table.ssb_subcarrier_offset>>config->ssb_config.scs_common; + } fp->ssb_start_subcarrier = (12 * config->ssb_table.ssb_offset_point_a + sco); set_Lmax(fp); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 22db636966..dca97bddf0 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -54,8 +54,10 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME uint8_t sco = 0; if (((fp->freq_range == nr_FR1) && (cfg->ssb_table.ssb_subcarrier_offset.value<24)) || - ((fp->freq_range == nr_FR2) && (cfg->ssb_table.ssb_subcarrier_offset.value<12)) ) - sco = cfg->ssb_table.ssb_subcarrier_offset.value; + ((fp->freq_range == nr_FR2) && (cfg->ssb_table.ssb_subcarrier_offset.value<12)) ) { + if (fp->freq_range == nr_FR1) + sco = cfg->ssb_table.ssb_subcarrier_offset.value>>cfg->ssb_config.scs_common.value; + } fp->ssb_start_subcarrier = (12 * cfg->ssb_table.ssb_offset_point_a.value + sco); LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,sco); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 79ebaea70a..8e9442d00c 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -354,13 +354,18 @@ int8_t nr_ue_decode_mib(module_id_t module_id, scs_ssb = get_softmodem_params()->numerology; band = mac->nr_band; ssb_start_symbol = get_ssb_start_symbol(band,scs_ssb,ssb_index); + int ssb_sc_offset_norm; + if (ssb_subcarrier_offset<24 && mac->frequency_range == FR1) + ssb_sc_offset_norm = ssb_subcarrier_offset>>scs_ssb; + else + ssb_sc_offset_norm = ssb_subcarrier_offset; if (mac->common_configuration_complete == 0) nr_ue_sib1_scheduler(module_id, cc_id, ssb_start_symbol, frame, - ssb_subcarrier_offset, + ssb_sc_offset_norm, ssb_index, ssb_start_subcarrier, mac->frequency_range, diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 5e99c2d0e1..ff4ec396e7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -344,21 +344,24 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, rrc_pdsch_AntennaPorts uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA); uint16_t sco = absolute_diff%(12*scs_scaling); // values of subcarrier offset larger than the limit only indicates CORESET for Type0-PDCCH CSS set is not present - uint8_t ssb_SubcarrierOffset_limit = 0; + int ssb_SubcarrierOffset_limit = 0; + int offset_scaling = 0; //15kHz if(frequency_range == FR1) { ssb_SubcarrierOffset_limit = 24; - } else { + if (ssb_SubcarrierOffsetssb_config.scs_common.value; + } else ssb_SubcarrierOffset_limit = 12; - } if (ssb_SubcarrierOffset>(cfg->ssb_config.scs_common.value))),"absoluteFrequencySSB has a subcarrier offset of %d while it should be %d\n",sco/scs_scaling,ssb_SubcarrierOffset); + AssertFatal(sco==(scs_scaling * ssb_SubcarrierOffset), + "absoluteFrequencySSB has a subcarrier offset of %d while it should be %d\n",sco/scs_scaling,ssb_SubcarrierOffset); cfg->ssb_table.ssb_offset_point_a.value = absolute_diff/(12*scs_scaling) - 10; //absoluteFrequencySSB is the central frequency of SSB which is made by 20RBs in total cfg->ssb_table.ssb_offset_point_a.tl.tag = NFAPI_NR_CONFIG_SSB_OFFSET_POINT_A_TAG; cfg->num_tlv++; cfg->ssb_table.ssb_period.value = *scc->ssb_periodicityServingCell; cfg->ssb_table.ssb_period.tl.tag = NFAPI_NR_CONFIG_SSB_PERIOD_TAG; cfg->num_tlv++; - cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset>>(cfg->ssb_config.scs_common.value); + cfg->ssb_table.ssb_subcarrier_offset.value = ssb_SubcarrierOffset<ssb_table.ssb_subcarrier_offset.tl.tag = NFAPI_NR_CONFIG_SSB_SUBCARRIER_OFFSET_TAG; cfg->num_tlv++; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index be33e4f688..44cdcef9fa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -737,7 +737,7 @@ void nr_set_pusch_semi_static(const NR_SIB1_t *sib1, void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, nr_scs_e scs_common, nr_scs_e pdcch_scs, - nr_frequency_range_e freq_range, + frequency_range_t freq_range, uint8_t rmsi_pdcch_config, uint8_t ssb_idx, uint8_t k_ssb, diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 399033abd0..27527edbcd 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -222,7 +222,7 @@ void get_pdsch_to_harq_feedback(int Mod_idP, void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, nr_scs_e scs_common, nr_scs_e pdcch_scs, - nr_frequency_range_e freq_range, + frequency_range_t freq_range, uint8_t rmsi_pdcch_config, uint8_t ssb_idx, uint8_t k_ssb, diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index f516fc2219..8e8959c597 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -222,7 +222,15 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) { mib->message.choice.mib->spare.size = 1; mib->message.choice.mib->spare.bits_unused = 7; // This makes a spare of 1 bits - mib->message.choice.mib->ssb_SubcarrierOffset = (configuration->ssb_SubcarrierOffset)&15; + AssertFatal(scc->ssbSubcarrierSpacing != NULL, "scc->ssbSubcarrierSpacing is null\n"); + int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; + frequency_range_t frequency_range = band<100?FR1:FR2; + int ssb_subcarrier_offset; + if(frequency_range == FR1) + ssb_subcarrier_offset = (configuration->ssb_SubcarrierOffset<24) ? (configuration->ssb_SubcarrierOffset<<*scc->ssbSubcarrierSpacing) : configuration->ssb_SubcarrierOffset; + else + ssb_subcarrier_offset = configuration->ssb_SubcarrierOffset; + mib->message.choice.mib->ssb_SubcarrierOffset = ssb_subcarrier_offset&15; /* * The SIB1 will be sent in this allocation (Type0-PDCCH) : 38.213, 13-4 Table and 38.213 13-11 to 13-14 tables @@ -236,7 +244,6 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) { mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero = *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero; } - AssertFatal(scc->ssbSubcarrierSpacing != NULL, "scc->ssbSubcarrierSpacing is null\n"); switch (*scc->ssbSubcarrierSpacing) { case NR_SubcarrierSpacing_kHz15: mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60; From 6db761692d56e56a137bb3ca9341b8130e84e8e0 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 3 May 2022 08:55:25 +0100 Subject: [PATCH 852/883] Remove update_pdsch_ps and update_pusch_ps flags to use_rrc_processing_timer instead --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 48 +++++++++++++++++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 12 ++--- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 2 - 5 files changed, 49 insertions(+), 16 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 271d7c7f2a..e8230bc344 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -917,7 +917,7 @@ void pf_dl(module_id_t module_id, NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; - if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda || sched_ctrl->update_pdsch_ps) { + if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda) { nr_set_pdsch_semi_static(sib1, scc, UE_info->CellGroup[UE_id], diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index d7478474b1..764c97e66f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -579,7 +579,11 @@ void nr_set_pdsch_semi_static(const NR_SIB1_t *sib1, bwpd = (NR_BWP_DownlinkDedicated_t*)bwpd0; } - if (sched_ctrl->update_pdsch_ps == true) { + // Prevent gNB to enable 256QAM table while the RRCProcessing timer is running. + // For example, after the RRC created RRC Reconfiguration message we need to prevent gNB to apply another MCS table + // before the RRC Reconfiguration being received by the UE, otherwise UE will not be able to decode PDSCH + // and the connection will drop. + if (sched_ctrl->rrc_processing_timer == 0) { if (bwpd && bwpd->pdsch_Config && bwpd->pdsch_Config->choice.setup && @@ -592,7 +596,6 @@ void nr_set_pdsch_semi_static(const NR_SIB1_t *sib1, } else { ps->mcsTableIdx = 0; } - sched_ctrl->update_pdsch_ps = false; } LOG_D(NR_MAC,"MCS Table Index: %d\n",ps->mcsTableIdx); @@ -2812,8 +2815,45 @@ void nr_mac_update_timers(module_id_t module_id, sched_ctrl->rrc_processing_timer--; if (sched_ctrl->rrc_processing_timer == 0) { LOG_I(NR_MAC, "(%d.%d) De-activating RRC processing timer for UE %d\n", frame, slot, UE_id); - sched_ctrl->update_pdsch_ps = true; - sched_ctrl->update_pusch_ps = true; + + const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; + NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; + + NR_BWP_DownlinkDedicated_t *bwpd = UE_info->CellGroup[UE_id] && + UE_info->CellGroup[UE_id]->spCellConfig && + UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated ? + UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; + + const uint8_t layers = set_dl_nrOfLayers(sched_ctrl); + const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; + nr_set_pdsch_semi_static(sib1, + scc, + UE_info->CellGroup[UE_id], + sched_ctrl->active_bwp, + bwpd, + tda >= 0 ? tda : sched_ctrl->pdsch_semi_static.time_domain_allocation, + layers, + sched_ctrl, + &sched_ctrl->pdsch_semi_static); + + NR_BWP_UplinkDedicated_t *ubwpd = UE_info->CellGroup[UE_id] && + UE_info->CellGroup[UE_id]->spCellConfig && + UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated && + UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig ? + UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + + const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2; + int dci_format = get_dci_format(sched_ctrl); + const int utda = sched_ctrl->active_ubwp ? RC.nrmac[module_id]->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; + nr_set_pusch_semi_static(sib1, + scc, + sched_ctrl->active_ubwp, + ubwpd, + dci_format, + utda >= 0 ? utda : sched_ctrl->pusch_semi_static.time_domain_allocation, + num_dmrs_cdm_grps_no_data, + &sched_ctrl->pusch_semi_static); + } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bbe135413b..5b2d9293f2 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -988,8 +988,7 @@ bool allocate_ul_retransmission(module_id_t module_id, if (ps->time_domain_allocation != tda || ps->dci_format != dci_format - || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data - || sched_ctrl->update_pusch_ps) { + || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) { nr_set_pusch_semi_static(sib1, scc, sched_ctrl->active_ubwp, @@ -998,7 +997,6 @@ bool allocate_ul_retransmission(module_id_t module_id, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_pusch_ps = false; } /* Check the resource is enough for retransmission */ @@ -1247,8 +1245,7 @@ void pf_ul(module_id_t module_id, const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; if (ps->time_domain_allocation != tda || ps->dci_format != dci_format - || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data - || sched_ctrl->update_pusch_ps) { + || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) { nr_set_pusch_semi_static(sib1, scc, sched_ctrl->active_ubwp, @@ -1257,7 +1254,6 @@ void pf_ul(module_id_t module_id, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_pusch_ps = false; } LOG_D(NR_MAC,"Looking for min_rb %d RBs, starting at %d\n", min_rb, rbStart); @@ -1385,8 +1381,7 @@ void pf_ul(module_id_t module_id, const int tda = sched_ctrl->active_ubwp ? nrmac->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; if (ps->time_domain_allocation != tda || ps->dci_format != dci_format - || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data - || sched_ctrl->update_pusch_ps) { + || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) { nr_set_pusch_semi_static(sib1, scc, sched_ctrl->active_ubwp, @@ -1395,7 +1390,6 @@ void pf_ul(module_id_t module_id, tda, num_dmrs_cdm_grps_no_data, ps); - sched_ctrl->update_pusch_ps = false; } update_ul_ue_R_Qm(sched_pusch, ps); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 54abee888b..fcc1e4c789 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -509,6 +509,7 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl); +int get_dci_format(NR_UE_sched_ctrl_t *sched_ctrl); void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 31cdd96af0..f93090c3c1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -626,8 +626,6 @@ typedef struct { int ul_failure; struct CSI_Report CSI_report; bool SR; - bool update_pdsch_ps; - bool update_pusch_ps; bool set_mcs; /// information about every HARQ process NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES]; From 114dcc6a084224333c24e26628ea4b7753d7d949 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 3 May 2022 08:57:02 +0100 Subject: [PATCH 853/883] Remove irrelevant comment --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 1 - 1 file changed, 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ecc2ef0cff..7027e0336f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -346,7 +346,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, LOG_I(NR_MAC,"Frame.Slot %d.%d\n%s\n",frame,slot,stats_output); } - // This updates the timers running at MAC layer nr_mac_update_timers(module_idP, frame, slot); // This schedules MIB From 139d20a9ba68595338bc8ce353e3339c74aade50 Mon Sep 17 00:00:00 2001 From: Vijay Chadachan Date: Tue, 3 May 2022 11:58:15 +0200 Subject: [PATCH 854/883] Removing unused variables --- openair3/NAS/UE/EMM/Authentication.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair3/NAS/UE/EMM/Authentication.c b/openair3/NAS/UE/EMM/Authentication.c index 36c90c4ab0..a2762d08e8 100644 --- a/openair3/NAS/UE/EMM/Authentication.c +++ b/openair3/NAS/UE/EMM/Authentication.c @@ -149,8 +149,7 @@ int emm_proc_authentication_request(nas_user_t *user, int native_ksi, int ksi, int rc = RETURNerror; authentication_data_t *authentication_data = user->authentication_data; emm_timers_t *emm_timers = user->emm_data->emm_timers; - uint8_t nullRand[AUTH_CK_SIZE]; - memset(nullRand, 0, AUTH_CK_SIZE); + LOG_TRACE(INFO, "EMM-PROC - Authentication requested ksi type = %s, ksi = %d", native_ksi ? "native" : "mapped", ksi); /* 3GPP TS 24.301, section 5.4.2.1 From cc6469c77d5766ac52c5116535cd6427fa3aa0e2 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 2 May 2022 11:02:50 +0200 Subject: [PATCH 855/883] Upgrade SA test USRP IP address after CI migration --- .../conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf index 7b0e3eea22..18ca7b5d1e 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf @@ -260,7 +260,7 @@ RUs = ( ## beamforming 4x4 matrix: #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff]; sf_extension = 0 - sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "mgmt_addr=172.21.19.14,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" sl_ahead = 5; } ); From 6d35883b2afca34e5b43743abfd922ab1855a960 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 4 May 2022 10:38:41 +0200 Subject: [PATCH 856/883] Add help strings for new config options --- openair2/ENB_APP/enb_paramdef.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 21e2e1b703..e6e97069fa 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -104,6 +104,11 @@ typedef enum { #define CONFIG_STRING_RU_NR_FLAG "nr_flag" #define CONFIG_STRING_RU_NR_SCS_FOR_RASTER "nr_scs_for_raster" +#define HLP_RU_SF_AHEAD "LTE TX processing advance" +#define HLP_RU_SL_AHEAD "NR TX processing advance" +#define HLP_RU_NR_FLAG "Use NR numerology (for AW2SORI)" +#define HLP_RU_NR_SCS_FOR_RASTER "NR SCS for raster (for AW2SORI)" + #define RU_LOCAL_IF_NAME_IDX 0 #define RU_LOCAL_ADDRESS_IDX 1 #define RU_REMOTE_ADDRESS_IDX 2 @@ -171,10 +176,10 @@ typedef enum { {CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \ {CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ - {CONFIG_STRING_RU_SF_AHEAD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \ - {CONFIG_STRING_RU_SL_AHEAD, NULL, 0, iptr:NULL, defintval:6, TYPE_INT, 0}, \ - {CONFIG_STRING_RU_NR_FLAG, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ - {CONFIG_STRING_RU_NR_SCS_FOR_RASTER, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_SF_AHEAD, HLP_RU_SF_AHEAD, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_SL_AHEAD, HLP_RU_SL_AHEAD, 0, iptr:NULL, defintval:6, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_NR_FLAG, HLP_RU_NR_FLAG, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_NR_SCS_FOR_RASTER, HLP_RU_NR_SCS_FOR_RASTER, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ From ada4be081caa14db2a9f83feea06324ac397ab67 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 4 May 2022 10:43:15 +0200 Subject: [PATCH 857/883] Remove clock_gettime() introduced in this branch --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 6 +----- openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c | 8 ++------ openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 9 ++------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 7e4710ccda..f1eebfc026 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -456,14 +456,10 @@ int nr_process_mac_pdu(module_id_t module_idP, if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) return 0; - struct timespec time_request; - clock_gettime(CLOCK_REALTIME, &time_request); - LOG_D(NR_MAC, "[UE %04x] %d.%d : Time %lu.%lu ULSCH -> UL-%s %d (gNB %d, %d bytes)\n", + LOG_D(NR_MAC, "[UE %x] %d.%d: ULSCH -> UL-%s %d (gNB %d, %d bytes)\n", UE_info->rnti[UE_id], frameP, slot, - time_request.tv_sec, - time_request.tv_nsec, rx_lcid<4?"DCCH":"DTCH", rx_lcid, module_idP, diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c index ac7da5412b..b5cea6bdb9 100644 --- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c +++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c @@ -711,9 +711,7 @@ rb_found: memblock = get_free_mem_block(size, __FUNCTION__); memcpy(memblock->data, buf, size); - struct timespec time_request; - clock_gettime(CLOCK_REALTIME, &time_request); - LOG_D(PDCP, "%s(): (rb %d) calling enqueue_rlc_data_req size %d at time %lu.%lu\n", __func__, rb_id, size,time_request.tv_sec,time_request.tv_nsec); + LOG_D(PDCP, "%s(): (srb %d) calling rlc_data_req size %d\n", __func__, rb_id, size); //for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]); //printf("\n"); enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock); @@ -1338,9 +1336,7 @@ static boolean_t pdcp_data_req_drb( const sdu_size_t sdu_buffer_size, unsigned char *const sdu_buffer) { - struct timespec time_request; - clock_gettime(CLOCK_REALTIME, &time_request); - LOG_D(PDCP, "%s() called at time %lu.%lu, size %d\n", __func__, time_request.tv_sec,time_request.tv_nsec,sdu_buffer_size); + LOG_D(PDCP, "%s() called, size %d\n", __func__, sdu_buffer_size); nr_pdcp_ue_t *ue; nr_pdcp_entity_t *rb; int rnti = ctxt_pP->rnti; diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 18ee7da8e2..baae1fa436 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -460,14 +460,9 @@ static void deliver_sdu(void *_ue, nr_rlc_entity_t *entity, char *buf, int size) exit(1); rb_found: - if (is_srb==0) { - struct timespec time_request; - clock_gettime(CLOCK_REALTIME, &time_request); + LOG_D(RLC, "%s:%d:%s: delivering SDU (rnti %d is_srb %d rb_id %d) size %d\n", + __FILE__, __LINE__, __FUNCTION__, ue->rnti, is_srb, rb_id, size); - LOG_D(RLC, "%s:%d:%s: delivering SDU Time %lu.%lu (rnti %d is_srb %d rb_id %d) size %d\n", - __FILE__, __LINE__, __FUNCTION__, time_request.tv_sec,time_request.tv_nsec, - ue->rnti, is_srb, rb_id, size); - } /* unused fields? */ ctx.instance = 0; ctx.frame = 0; From 602fb113392b98f98fccbb99ccc37998a592c9c2 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 5 May 2022 13:39:04 +0100 Subject: [PATCH 858/883] Avoid usage of preferred_dl_tda and preferred_ul_tda before their computation and improve code readability --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 50 +++++++++++-------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 555c41a752..3f7a908395 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2829,42 +2829,52 @@ void nr_mac_update_timers(module_id_t module_id, const NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL; NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon; + NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; - NR_BWP_DownlinkDedicated_t *bwpd = UE_info->CellGroup[UE_id] && - UE_info->CellGroup[UE_id]->spCellConfig && - UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated ? - UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; + NR_BWP_Downlink_t *bwp = sched_ctrl->active_bwp; + NR_BWP_DownlinkDedicated_t *bwpd = cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated ? + cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP : NULL; + int **preferred_dl_tda = RC.nrmac[module_id]->preferred_dl_tda; + NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; const uint8_t layers = set_dl_nrOfLayers(sched_ctrl); - const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot]; + const int tda = bwp && preferred_dl_tda[bwp->bwp_Id][slot] >= 0 ? + preferred_dl_tda[bwp->bwp_Id][slot] : (ps->time_domain_allocation >= 0 ? ps->time_domain_allocation : 0); + nr_set_pdsch_semi_static(sib1, scc, - UE_info->CellGroup[UE_id], - sched_ctrl->active_bwp, + cg, + bwp, bwpd, - tda >= 0 ? tda : sched_ctrl->pdsch_semi_static.time_domain_allocation, + tda, layers, sched_ctrl, - &sched_ctrl->pdsch_semi_static); + ps); - NR_BWP_UplinkDedicated_t *ubwpd = UE_info->CellGroup[UE_id] && - UE_info->CellGroup[UE_id]->spCellConfig && - UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated && - UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig ? - UE_info->CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + NR_BWP_Uplink_t *ubwp = sched_ctrl->active_ubwp; + NR_BWP_UplinkDedicated_t *ubwpd = cg && + cg->spCellConfig && + cg->spCellConfig->spCellConfigDedicated && + cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? + cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; + int **preferred_ul_tda = RC.nrmac[module_id]->preferred_ul_tda; + NR_pusch_semi_static_t *ups = &sched_ctrl->pusch_semi_static; - const uint8_t num_dmrs_cdm_grps_no_data = (sched_ctrl->active_ubwp || ubwpd) ? 1 : 2; int dci_format = get_dci_format(sched_ctrl); - const int utda = sched_ctrl->active_ubwp ? RC.nrmac[module_id]->preferred_ul_tda[sched_ctrl->active_ubwp->bwp_Id][slot] : 0; + const uint8_t num_dmrs_cdm_grps_no_data = (ubwp || ubwpd) ? 1 : 2; + const int utda = ubwp && preferred_ul_tda[ubwp->bwp_Id][slot] >= 0 ? + preferred_ul_tda[ubwp->bwp_Id][slot] : (ups->time_domain_allocation >= 0 ? ups->time_domain_allocation : 0); + nr_set_pusch_semi_static(sib1, scc, - sched_ctrl->active_ubwp, + ubwp, ubwpd, dci_format, - utda >= 0 ? utda : sched_ctrl->pusch_semi_static.time_domain_allocation, + utda, num_dmrs_cdm_grps_no_data, - &sched_ctrl->pusch_semi_static); - + ups); } } } From e1e8a49b763d313370a4499d92a100d540f81cce Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 5 May 2022 19:02:19 +0200 Subject: [PATCH 859/883] Fix UP traffic in NSA --- openair2/RRC/NR/rrc_gNB_nsa.c | 57 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index 00e11278a2..b482637dfd 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -370,38 +370,37 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ue_context_p->ue_context.secondaryCellGroup); } - if(m == NULL){ - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0, rrc->module_id); - LOG_W(RRC, "Calling RRC PDCP/RLC ASN1 request functions for protocol context %p with module_id %d, rnti %x, frame %d, subframe %d eNB_index %d \n", &ctxt, - ctxt.module_id, - ctxt.rnti, - ctxt.frame, - ctxt.subframe, - ctxt.eNB_index); + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0, rrc->module_id); + LOG_W(RRC, + "Calling RRC PDCP/RLC ASN1 request functions for protocol context %p with module_id %d, rnti %x, frame %d, subframe %d eNB_index %d \n", + &ctxt, + ctxt.module_id, + ctxt.rnti, + ctxt.frame, + ctxt.subframe, + ctxt.eNB_index); - nr_rrc_pdcp_config_asn1_req(&ctxt, - get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL, - ue_context_p->ue_context.rb_config->drb_ToAddModList , - ue_context_p->ue_context.rb_config->drb_ToReleaseList, - (ue_context_p->ue_context.integrity_algorithm << 4) | ue_context_p->ue_context.ciphering_algorithm, - NULL, /* kRRCenc - unused */ - NULL, /* kRRCint - unused */ - kUPenc, /* kUPenc */ - kUPint, /* kUPint */ - NULL, - NULL, - ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); + nr_rrc_pdcp_config_asn1_req(&ctxt, + get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL, + ue_context_p->ue_context.rb_config->drb_ToAddModList , + ue_context_p->ue_context.rb_config->drb_ToReleaseList, + (ue_context_p->ue_context.integrity_algorithm << 4) | ue_context_p->ue_context.ciphering_algorithm, + NULL, /* kRRCenc - unused */ + NULL, /* kRRCint - unused */ + kUPenc, /* kUPenc */ + kUPint, /* kUPint */ + NULL, + NULL, + ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); - nr_rrc_rlc_config_asn1_req (&ctxt, - get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL, - ue_context_p->ue_context.rb_config->drb_ToAddModList, - ue_context_p->ue_context.rb_config->drb_ToReleaseList, - (LTE_PMCH_InfoList_r9_t *) NULL, - ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); - - LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti); - } + nr_rrc_rlc_config_asn1_req(&ctxt, + get_softmodem_params()->sa ? ue_context_p->ue_context.rb_config->srb_ToAddModList : (NR_SRB_ToAddModList_t *) NULL, + ue_context_p->ue_context.rb_config->drb_ToAddModList, + ue_context_p->ue_context.rb_config->drb_ToReleaseList, + (LTE_PMCH_InfoList_r9_t *) NULL, + ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList); + LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti); } void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) { From b6e2f0e0c9e57e28bc28af9703dd6c578c102460 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Wed, 18 May 2022 16:50:35 +0200 Subject: [PATCH 860/883] gps time sync improvements --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 5d5e6820ff..b4d7ba0410 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -201,10 +201,21 @@ static int sync_to_gps(openair0_device *device) { LOG_W(HW,"WARNING: GPS not locked - time will not be accurate until locked\n"); } + //wait for next pps + uhd::time_spec_t last = s->usrp->get_time_last_pps(); + uhd::time_spec_t next = s->usrp->get_time_last_pps(); + while(next == last) { + boost::this_thread::sleep(boost::posix_time::milliseconds(50)); + last = next; + next = s->usrp->get_time_last_pps(); + } + boost::this_thread::sleep(boost::posix_time::milliseconds(200)); + //Set to GPS time uhd::time_spec_t gps_time = uhd::time_spec_t(time_t(s->usrp->get_mboard_sensor("gps_time", mboard).to_int())); s->usrp->set_time_next_pps(gps_time+1.0, mboard); //s->usrp->set_time_next_pps(uhd::time_spec_t(0.0)); + //Wait for it to apply //The wait is 2 seconds because N-Series has a known issue where //the time at the last PPS does not properly update at the PPS edge From 68dd4fa20b61d713a03cf083347ab537a00cd5fb Mon Sep 17 00:00:00 2001 From: rakesh mundlamuri Date: Thu, 19 May 2022 12:41:20 +0200 Subject: [PATCH 861/883] introducing the selection of tx and rx subdev --- executables/nr-ru.c | 10 ++++++++++ openair2/ENB_APP/enb_paramdef.h | 6 ++++++ targets/ARCH/COMMON/common_lib.h | 4 ++++ targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 10 +++++++++- 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index cac5b5d66a..1cad34145a 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -2057,6 +2057,16 @@ static void NRRCconfig_RU(void) { RC.ru[j]->openair0_cfg.sdr_addrs = strdup(*(RUParamList.paramarray[j][RU_SDR_ADDRS].strptr)); } + if (config_isparamset(RUParamList.paramarray[j], RU_TX_SUBDEV)) { + RC.ru[j]->openair0_cfg.tx_subdev = strdup(*(RUParamList.paramarray[j][RU_TX_SUBDEV].strptr)); + LOG_I(PHY, "RU USRP tx subdev == %s\n", RC.ru[j]->openair0_cfg.tx_subdev); + } + + if (config_isparamset(RUParamList.paramarray[j], RU_RX_SUBDEV)) { + RC.ru[j]->openair0_cfg.rx_subdev = strdup(*(RUParamList.paramarray[j][RU_RX_SUBDEV].strptr)); + LOG_I(PHY, "RU USRP rx subdev == %s\n", RC.ru[j]->openair0_cfg.rx_subdev); + } + if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) { if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) { RC.ru[j]->openair0_cfg.clock_source = internal; diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index e6e97069fa..50ee4341ee 100644 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -103,6 +103,8 @@ typedef enum { #define CONFIG_STRING_RU_SL_AHEAD "sl_ahead" #define CONFIG_STRING_RU_NR_FLAG "nr_flag" #define CONFIG_STRING_RU_NR_SCS_FOR_RASTER "nr_scs_for_raster" +#define CONFIG_STRING_RU_TX_SUBDEV "tx_subdev" +#define CONFIG_STRING_RU_RX_SUBDEV "rx_subdev" #define HLP_RU_SF_AHEAD "LTE TX processing advance" #define HLP_RU_SL_AHEAD "NR TX processing advance" @@ -142,6 +144,8 @@ typedef enum { #define RU_SL_AHEAD 30 #define RU_NR_FLAG 31 #define RU_NR_SCS_FOR_RASTER 32 +#define RU_TX_SUBDEV 33 +#define RU_RX_SUBDEV 34 /*-----------------------------------------------------------------------------------------------------------------------------------------*/ /* RU configuration parameters */ /* optname helpstr paramflags XXXptr defXXXval type numelt */ @@ -180,6 +184,8 @@ typedef enum { {CONFIG_STRING_RU_SL_AHEAD, HLP_RU_SL_AHEAD, 0, iptr:NULL, defintval:6, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_FLAG, HLP_RU_NR_FLAG, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \ {CONFIG_STRING_RU_NR_SCS_FOR_RASTER, HLP_RU_NR_SCS_FOR_RASTER, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \ + {CONFIG_STRING_RU_TX_SUBDEV, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0}, \ + {CONFIG_STRING_RU_RX_SUBDEV, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0}, \ } /*---------------------------------------------------------------------------------------------------------------------------------------*/ diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 95e5e3ed03..fecc4abb63 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -178,6 +178,10 @@ typedef struct { int rx_num_channels; //! number of TX channels (=TX antennas) int tx_num_channels; + //! rx daughter card + char* rx_subdev; + //! tx daughter card + char* tx_subdev; //! \brief RX base addresses for mmapped_dma int32_t *rxbase[4]; //! \brief TX base addresses for mmapped_dma diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index b4d7ba0410..07162415d2 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -1021,7 +1021,7 @@ extern "C" { sscanf(uhd::get_version_string().c_str(),"%d.%d.%d",&vers,&subvers,&subsubvers); LOG_I(HW,"UHD version %s (%d.%d.%d)\n", uhd::get_version_string().c_str(),vers,subvers,subsubvers); - std::string args; + std::string args,tx_subdev,rx_subdev; if (openair0_cfg[0].sdr_addrs == NULL) { args = "type=b200"; @@ -1347,6 +1347,13 @@ extern "C" { LOG_D(HW, "usrp->get_tx_num_channels() == %zd\n", s->usrp->get_tx_num_channels()); LOG_D(HW, "openair0_cfg[0].tx_num_channels == %d\n", openair0_cfg[0].tx_num_channels); + LOG_I(HW, "openair0_cfg[0].tx_subdev == %s\n", openair0_cfg[0].tx_subdev); + LOG_I(HW, "openair0_cfg[0].rx_subdev == %s\n", openair0_cfg[0].rx_subdev); + + tx_subdev = openair0_cfg[0].tx_subdev; + rx_subdev = openair0_cfg[0].rx_subdev; + s->usrp->set_tx_subdev_spec(tx_subdev); + s->usrp->set_rx_subdev_spec(rx_subdev); for(int i=0; i<((int) s->usrp->get_tx_num_channels()); i++) { ::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(i); @@ -1419,6 +1426,7 @@ extern "C" { LOG_I(HW," Actual TX packet size: %lu\n",s->tx_stream->get_max_num_samps()); } + std::cout << boost::format("Using Device: %s") % s->usrp->get_pp_string() << std::endl; LOG_I(HW,"Device timestamp: %f...\n", s->usrp->get_time_now().get_real_secs()); device->trx_write_func = trx_usrp_write; device->trx_read_func = trx_usrp_read; From f2e1a4a1a8489de221fed92139c1896bf7b82199 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Thu, 19 May 2022 16:27:09 +0200 Subject: [PATCH 862/883] bug fix for subdev selection --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 07162415d2..f21d71ba45 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -1324,6 +1324,18 @@ extern "C" { openair0_cfg[0].iq_txshift = 4;//shift openair0_cfg[0].iq_rxrescale = 15;//rescale iqs + if(openair0_cfg[0].tx_subdev!=NULL){ + LOG_I(HW, "openair0_cfg[0].tx_subdev == %s\n", openair0_cfg[0].tx_subdev); + tx_subdev = openair0_cfg[0].tx_subdev; + s->usrp->set_tx_subdev_spec(tx_subdev); + } + + if(openair0_cfg[0].rx_subdev!=NULL){ + LOG_I(HW, "openair0_cfg[0].rx_subdev == %s\n", openair0_cfg[0].rx_subdev); + rx_subdev = openair0_cfg[0].rx_subdev; + s->usrp->set_rx_subdev_spec(rx_subdev); + } + for(int i=0; i<((int) s->usrp->get_rx_num_channels()); i++) { if (iusrp->set_rx_rate(openair0_cfg[0].sample_rate,i+choffset); @@ -1347,13 +1359,6 @@ extern "C" { LOG_D(HW, "usrp->get_tx_num_channels() == %zd\n", s->usrp->get_tx_num_channels()); LOG_D(HW, "openair0_cfg[0].tx_num_channels == %d\n", openair0_cfg[0].tx_num_channels); - LOG_I(HW, "openair0_cfg[0].tx_subdev == %s\n", openair0_cfg[0].tx_subdev); - LOG_I(HW, "openair0_cfg[0].rx_subdev == %s\n", openair0_cfg[0].rx_subdev); - - tx_subdev = openair0_cfg[0].tx_subdev; - rx_subdev = openair0_cfg[0].rx_subdev; - s->usrp->set_tx_subdev_spec(tx_subdev); - s->usrp->set_rx_subdev_spec(rx_subdev); for(int i=0; i<((int) s->usrp->get_tx_num_channels()); i++) { ::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(i); From 09f50edc88deea71f0ae490773e31c9f496be566 Mon Sep 17 00:00:00 2001 From: rakesh mundlamuri Date: Fri, 20 May 2022 09:59:46 +0200 Subject: [PATCH 863/883] adding subdev selection for nrUE --- executables/nr-uesoftmodem.c | 4 ++++ executables/nr-uesoftmodem.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 1612480ffd..62ce0e176e 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -117,6 +117,8 @@ int vcdflag = 0; double rx_gain_off = 0.0; char *usrp_args = NULL; +char *tx_subdev = NULL; +char *rx_subdev = NULL; char *rrc_config_path = NULL; char *uecap_file = NULL; int dumpframe = 0; @@ -372,6 +374,8 @@ void init_openair0(void) { openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file; if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args; + if (tx_subdev) openair0_cfg[card].tx_subdev = tx_subdev; + if (rx_subdev) openair0_cfg[card].rx_subdev = rx_subdev; } } diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 95914678e5..927d619c42 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -29,6 +29,8 @@ /*------------------------------------------------------------------------------------------------------------------------------------------*/ #define CMDLINE_NRUEPARAMS_DESC { \ {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \ + {"tx_subdev", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&tx_subdev, defstrval:"", TYPE_STRING, 0}, \ + {"rx_subdev", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&rx_subdev, defstrval:"", TYPE_STRING, 0}, \ {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ {"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, iptr:(int32_t *)&nrUE_params.nr_dlsch_parallel, defintval:0, TYPE_UINT8, 0}, \ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \ From b30e6733489cea5be6fe6254bebe417d2bcbe926 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Mon, 23 May 2022 16:38:42 +0200 Subject: [PATCH 864/883] Added T trader dump for Tx signal in gNB --- common/utils/T/T_messages.txt | 4 ++++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 12c6a03d51..30982b57aa 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -105,6 +105,10 @@ ID = GNB_PHY_PRACH_INPUT_SIGNAL DESC = gNodeB input data in the time domain for slots with PRACH detection GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB FORMAT = int,frame : int,slot : int,antenna : buffer,rxdata +ID = GNB_PHY_DL_OUTPUT_SIGNAL + DESC = gNodeB output data in the freq domain for slots + GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB + FORMAT = int,gNB_ID : int,frame : int,slot : int,antenna : buffer,txdata #MAC logs ID = ENB_MAC_UE_DL_SDU diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index f0177cbf28..e33021897a 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -213,6 +213,10 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, //apply the OFDM symbol rotation here for (aa=0; aacarrier_config.num_tx_ant.value; aa++) { apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size); + + T(T_GNB_PHY_DL_OUTPUT_SIGNAL, T_INT(0), + T_INT(frame), T_INT(slot), + T_INT(aa), T_BUFFER(&gNB->common_vars.txdataF[aa][txdataF_offset], fp->samples_per_slot_wCP*sizeof(int32_t))); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); From e141b2083664152205e41edfda454e3c30cc992d Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Sun, 29 May 2022 21:41:18 +0200 Subject: [PATCH 865/883] GPS sync improvements --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 23 +++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index f21d71ba45..04a9aae132 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -201,16 +201,6 @@ static int sync_to_gps(openair0_device *device) { LOG_W(HW,"WARNING: GPS not locked - time will not be accurate until locked\n"); } - //wait for next pps - uhd::time_spec_t last = s->usrp->get_time_last_pps(); - uhd::time_spec_t next = s->usrp->get_time_last_pps(); - while(next == last) { - boost::this_thread::sleep(boost::posix_time::milliseconds(50)); - last = next; - next = s->usrp->get_time_last_pps(); - } - boost::this_thread::sleep(boost::posix_time::milliseconds(200)); - //Set to GPS time uhd::time_spec_t gps_time = uhd::time_spec_t(time_t(s->usrp->get_mboard_sensor("gps_time", mboard).to_int())); s->usrp->set_time_next_pps(gps_time+1.0, mboard); @@ -306,11 +296,18 @@ static int trx_usrp_start(openair0_device *device) { //s->first_rx = 1; s->rx_timestamp = 0; - uhd::time_spec_t time_last_pps = s->usrp->get_time_last_pps(); - LOG_I(HW,"last pps at %f, starting streaming at %f\n",time_last_pps.get_real_secs(),time_last_pps.get_real_secs()+1.0); + //wait for next pps + uhd::time_spec_t last_pps = s->usrp->get_time_last_pps(); + uhd::time_spec_t current_pps = s->usrp->get_time_last_pps(); + while(current_pps == last_pps) { + boost::this_thread::sleep(boost::posix_time::milliseconds(1)); + current_pps = s->usrp->get_time_last_pps(); + } + + LOG_I(HW,"current pps at %f, starting streaming at %f\n",current_pps.get_real_secs(),current_pps.get_real_secs()+1.0); uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); - cmd.time_spec = uhd::time_spec_t(time_last_pps+1.0); + cmd.time_spec = uhd::time_spec_t(current_pps+1.0); cmd.stream_now = false; // start at constant delay s->rx_stream->issue_stream_cmd(cmd); From fab75b4af8b77e8cc1385b91491a3cd2d6d169c0 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Tue, 31 May 2022 11:24:00 +0200 Subject: [PATCH 866/883] aligning some internal memory to avoid segfaults --- openair1/PHY/NR_UE_TRANSPORT/dci_nr.c | 6 +++--- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c index 336d388d40..308d033fbe 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c @@ -686,9 +686,9 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, // Pointers to extracted PDCCH symbols in frequency-domain. int32_t rx_size = 4*273*12; - int32_t rxdataF_ext[4*frame_parms->nb_antennas_rx][rx_size]; - int32_t rxdataF_comp[4*frame_parms->nb_antennas_rx][rx_size]; - int32_t pdcch_dl_ch_estimates_ext[4*frame_parms->nb_antennas_rx][rx_size]; + __attribute__ ((aligned(32))) int32_t rxdataF_ext[4*frame_parms->nb_antennas_rx][rx_size]; + __attribute__ ((aligned(32))) int32_t rxdataF_comp[4*frame_parms->nb_antennas_rx][rx_size]; + __attribute__ ((aligned(32))) int32_t pdcch_dl_ch_estimates_ext[4*frame_parms->nb_antennas_rx][rx_size]; // Pointer to llrs, 4-bit resolution. int32_t llr_size = 2*4*100*12; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 48b08d761e..78e4a8a4e8 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -430,8 +430,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, for (symbol=1; symbol<4; symbol++) { const uint16_t nb_re=symbol == 2 ? 72 : 180; - struct complex16 rxdataF_ext[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; - struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; + __attribute__ ((aligned(32))) struct complex16 rxdataF_ext[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; + __attribute__ ((aligned(32))) struct complex16 dl_ch_estimates_ext[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; memset(dl_ch_estimates_ext,0, sizeof dl_ch_estimates_ext); nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, estimateSz, @@ -456,7 +456,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, #ifdef DEBUG_PBCH LOG_I(PHY,"[PHY] PBCH log2_maxh = %d (%d)\n",nr_ue_pbch_vars->log2_maxh,max_h); #endif - struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; + __attribute__ ((aligned(32))) struct complex16 rxdataF_comp[frame_parms->nb_antennas_rx][PBCH_MAX_RE_PER_SYMBOL]; nr_pbch_channel_compensation(rxdataF_ext, dl_ch_estimates_ext, nb_re, From 4704af4874277db39d501cca285e73d416d101b6 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Tue, 31 May 2022 11:26:03 +0200 Subject: [PATCH 867/883] not calling ue scheduler in phy_test mode --- executables/nr-ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 92c20626c0..620e21ec14 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -666,7 +666,7 @@ void processSlotRX(void *arg) { if (rx_slot_type == NR_DOWNLINK_SLOT || rx_slot_type == NR_MIXED_SLOT){ - if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL) { + if(UE->if_inst != NULL && UE->if_inst->dl_indication != NULL && get_softmodem_params()->phy_test == 0) { nr_downlink_indication_t dl_indication; nr_fill_dl_indication(&dl_indication, NULL, NULL, proc, UE, gNB_id, &phy_pdcch_config); UE->if_inst->dl_indication(&dl_indication, NULL); From e8451eb892015ef417ff1db93d6f841979908f45 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Tue, 31 May 2022 16:49:53 +0200 Subject: [PATCH 868/883] Added 2gNB PRS working config 106PRBs --- ...gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf | 6 +- ...nb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 | 322 ++++++++++++++++++ 2 files changed, 325 insertions(+), 3 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf index c0912cd19d..aa7a94565d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf @@ -218,9 +218,9 @@ MACRLCs = ( prs_config = ( { NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; + PRSResourceSetPeriod = [20, 2]; SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSSymbols = [6]; NumRB = 106; RBOffset = 0; CombSize = 4; @@ -261,7 +261,7 @@ RUs = ( #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "internal"; - sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 new file mode 100644 index 0000000000..dc73a39f05 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 650000; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 648728; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 2; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [1]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.20.2,clock_source=gpsdo,time_source=gpsdo" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + From 4d44eef9f37c7aaf5c0eca34e4517678a422108b Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 1 Jun 2022 09:19:44 +0200 Subject: [PATCH 869/883] fixing time domain signal in T tracer --- executables/nr-ru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 1cad34145a..78d02e8849 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -712,7 +712,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { unsigned int txs; int i; T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot), - T_INT(0), T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot,fp,0)], fp->samples_per_subframe * 4)); + T_INT(0), T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot,fp,0)], fp->get_samples_per_slot(slot,fp) * 4)); int sf_extension = 0; int siglen=fp->get_samples_per_slot(slot,fp); int flags = 0; From 2a3414725ae115cc1d585569de9d37c48e4c72a0 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Wed, 1 Jun 2022 14:15:40 +0200 Subject: [PATCH 870/883] NR PRS scheduling for generalised slot periodicity --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 8 ++++---- openair1/SCHED_NR/sched_nr.h | 2 +- openair1/SCHED_NR_UE/defs.h | 2 +- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 7 ++++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index e33021897a..4ee10ea472 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -63,12 +63,12 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,sco); } -uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, int nr_slot_tx) +uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, NR_DL_FRAME_PARMS *fp, int frame_tx, int nr_slot_tx) { uint8_t is_prs_slot = 0, rsc_id = 0; for(rsc_id = 0; rsc_id < prs_vars->NumPRSResources; rsc_id++) { - if((prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[1] + prs_vars->prs_cfg[rsc_id].PRSResourceOffset) == nr_slot_tx) + if((prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[1] + prs_vars->prs_cfg[rsc_id].PRSResourceOffset) == ((frame_tx*fp->slots_per_frame+nr_slot_tx)%prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[0])) { is_prs_slot = 1; *prs_rsc_id = rsc_id; @@ -159,10 +159,10 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, } // Check for PRS slot - is_prs_slot = check_prs_slot_gNB(&rsc_id, &gNB->prs_vars, slot); + is_prs_slot = check_prs_slot_gNB(&rsc_id, &gNB->prs_vars, fp, frame, slot); if(is_prs_slot) { - LOG_D(PHY,"gNB_TX: frame %d, slot %d, slots_per_frame %d, PRS Resource ID %d\n",frame,slot, fp->slots_per_frame, rsc_id); + LOG_D(PHY,"gNB_TX: frame %d, slot %d, PRS Resource ID %d\n",frame, slot, rsc_id); nr_generate_prs(gNB->nr_gold_prs[slot],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); } diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index 5ef848506d..033ce2061f 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -54,7 +54,7 @@ void nr_fep_full(RU_t *ru, int slot); void nr_fep_full_2thread(RU_t *ru, int slot); void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); int nr_phy_init_RU(RU_t *ru); -uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, int nr_slot_tx); +uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, NR_DL_FRAME_PARMS *fp, int frame_tx, int nr_slot_tx); void nr_phy_free_RU(RU_t *ru); #endif diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index c744a968aa..b0767e42d2 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -373,7 +373,7 @@ int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx); int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp); int is_ssb_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp); -uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, uint8_t *prs_gNB_id, uint8_t *prs_rsc_id, int nr_slot_rx); +uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *fp, uint8_t *prs_gNB_id, uint8_t *prs_rsc_id, int frame_rx, int nr_slot_rx); /*! \brief This function prepares the dl indication to pass to the MAC @param diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 5e5d304786..7ff7d18505 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1374,14 +1374,15 @@ int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL } } -uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, uint8_t *prs_gNB_id, uint8_t *prs_rsc_id, int nr_slot_rx) +uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *fp, uint8_t *prs_gNB_id, uint8_t *prs_rsc_id, int frame_rx, int nr_slot_rx) { uint8_t is_prs_slot = 0, rsc_id = 0, gNB_id = 0; for(gNB_id = 0; gNB_id < ue->prs_active_gNBs; gNB_id++) { for(rsc_id = 0; rsc_id < ue->prs_vars[gNB_id]->NumPRSResources; rsc_id++) { - if((ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset) == nr_slot_rx) + if((ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset) == + ((frame_rx*fp->slots_per_frame + nr_slot_rx)%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0])) { is_prs_slot = 1; *prs_rsc_id = rsc_id; @@ -1481,7 +1482,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, } // Check for PRS slot - is_prs_slot = check_prs_slot_nrUE(ue, &prs_gNB_id, &rsc_id, nr_slot_rx); + is_prs_slot = check_prs_slot_nrUE(ue, fp, &prs_gNB_id, &rsc_id, frame_rx, nr_slot_rx); if (is_prs_slot) { for(int j = ue->prs_start_symb; j < ue->prs_end_symb; j++) From c62ddbe23192b2b1ef88431ccc0bf34a51d4190f Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Wed, 1 Jun 2022 14:37:35 +0200 Subject: [PATCH 871/883] Updated NRPRS UE config for 106PRB, 2gNBs --- .../GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf index 04912424f2..6a5fbc3785 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf @@ -1,14 +1,14 @@ PRSs = ( { - Active_gNBs = 1; + Active_gNBs = 2; prs_config0 = ( { gNB_id = 0; NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; + PRSResourceSetPeriod = [20, 2]; SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSSymbols = [6]; NumRB = 106; RBOffset = 0; CombSize = 4; @@ -27,14 +27,14 @@ PRSs = { gNB_id = 1; NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; + PRSResourceSetPeriod = [20, 2]; SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSSymbols = [6]; NumRB = 106; RBOffset = 0; CombSize = 4; - REOffset = [1]; - PRSResourceOffset = [0]; + REOffset = [0]; + PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; NPRS_ID = [0]; From 0c14b5fc757c4b927365748acab682078424d0d5 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Mon, 13 Jun 2022 15:45:56 +0200 Subject: [PATCH 872/883] Added NPRS-ID based PRS sequence generation for OAI gNB and UE --- openair1/PHY/INIT/nr_init.c | 21 ++++---- openair1/PHY/INIT/nr_init_ue.c | 34 +++++++----- openair1/PHY/NR_REFSIG/nr_gold.c | 42 +++++++-------- openair1/PHY/NR_REFSIG/nr_gold_ue.c | 53 ++++++++++--------- openair1/PHY/NR_REFSIG/refsig_defs_ue.h | 2 +- openair1/PHY/NR_TRANSPORT/nr_prs.c | 25 ++++----- .../nr_dl_channel_estimation.c | 6 +-- openair1/PHY/defs_gNB.h | 2 +- openair1/PHY/defs_nr_UE.h | 4 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 10 files changed, 99 insertions(+), 92 deletions(-) diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index 75070021ec..680d3684ef 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -615,20 +615,23 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value); //PRS init - gNB->nr_gold_prs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); - uint32_t ***prs = gNB->nr_gold_prs; + gNB->nr_gold_prs = (uint32_t ****)malloc16(gNB->prs_vars.NumPRSResources*sizeof(uint32_t ***)); + uint32_t ****prs = gNB->nr_gold_prs; AssertFatal(prs!=NULL, "NR init: positioning reference signal malloc failed\n"); + for (int rsc=0; rsc < gNB->prs_vars.NumPRSResources; rsc++) { + prs[rsc] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); + AssertFatal(prs[rsc]!=NULL, "NR init: positioning reference signal for rsc %d - malloc failed\n", rsc); - for (int slot=0; slotslots_per_frame; slot++) { - prs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); - AssertFatal(prs[slot]!=NULL, "NR init: positioning reference signal for slot %d - malloc failed\n", slot); + for (int slot=0; slotslots_per_frame; slot++) { + prs[rsc][slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); + AssertFatal(prs[rsc][slot]!=NULL, "NR init: positioning reference signal for slot %d - malloc failed\n", slot); - for (int symb=0; symbsymbols_per_slot; symb++) { - prs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); - AssertFatal(prs[slot][symb]!=NULL, "NR init: positioning reference signal for slot %d symbol %d - malloc failed\n", slot, symb); + for (int symb=0; symbsymbols_per_slot; symb++) { + prs[rsc][slot][symb] = (uint32_t *)malloc16(NR_MAX_PRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + AssertFatal(prs[rsc][slot][symb]!=NULL, "NR init: positioning reference signal for rsc %d slot %d symbol %d - malloc failed\n", rsc, slot, symb); + } } } - nr_init_prs(gNB); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 846a474cdd..7a1c4d1ef5 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -160,9 +160,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) NR_UE_PBCH **const pbch_vars = ue->pbch_vars; NR_UE_PRS **const prs_vars = ue->prs_vars; NR_UE_PRACH **const prach_vars = ue->prach_vars; - int i,slot,symb, gNB_id, th_id; - NR_UE_SRS **const srs_vars = ue->srs_vars; + int i,slot,symb, gNB_id, th_id; LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx); @@ -207,20 +206,29 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) //////////////////////////////////////////////////////////////////////////////////////////// //PRS init - ue->nr_gold_prs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); - uint32_t ***prs = ue->nr_gold_prs; + ue->nr_gold_prs = (uint32_t *****)malloc16(ue->prs_active_gNBs*sizeof(uint32_t ****)); + uint32_t *****prs = ue->nr_gold_prs; AssertFatal(prs!=NULL, "NR UE init: positioning reference signal malloc failed\n"); + for (int gnb = 0; gnb < ue->prs_active_gNBs; gnb++) { + prs[gnb] = (uint32_t ****)malloc16(ue->prs_vars[gnb]->NumPRSResources*sizeof(uint32_t ***)); + AssertFatal(prs[gnb]!=NULL, "NR UE init: positioning reference signal for gnb %d - malloc failed\n", gnb); + + for (int rsc = 0; rsc < ue->prs_vars[gnb]->NumPRSResources; rsc++) { + prs[gnb][rsc] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); + AssertFatal(prs[gnb][rsc]!=NULL, "NR UE init: positioning reference signal for gnb %d rsc %d- malloc failed\n", gnb, rsc); - for (int slot=0; slotslots_per_frame; slot++) { - prs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); - AssertFatal(prs[slot]!=NULL, "NR UE init: positioning reference signal for slot %d - malloc failed\n", slot); + for (int slot=0; slotslots_per_frame; slot++) { + prs[gnb][rsc][slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); + AssertFatal(prs[gnb][rsc][slot]!=NULL, "NR UE init: positioning reference signal for gnb %d rsc %d slot %d - malloc failed\n", gnb, rsc, slot); - for (int symb=0; symbsymbols_per_slot; symb++) { - prs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); - AssertFatal(prs[slot][symb]!=NULL, "NR UE init: positioning reference signal for slot %d symbol %d - malloc failed\n", slot, symb); - } - } - nr_gold_prs(ue); + for (int symb=0; symbsymbols_per_slot; symb++) { + prs[gnb][rsc][slot][symb] = (uint32_t *)malloc16(NR_MAX_PRS_INIT_LENGTH_DWORD*sizeof(uint32_t)); + AssertFatal(prs[gnb][rsc][slot][symb]!=NULL, "NR UE init: positioning reference signal for gnb %d rsc %d slot %d symbol %d - malloc failed\n", gnb, rsc, slot, symb); + } // for symb + } // for slot + } // for rsc + } // for gnb + init_nr_gold_prs(ue); /////////////////////////PUSCH DMRS init///////////////////////// /////////// diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c index a80fbfde68..1073982909 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold.c +++ b/openair1/PHY/NR_REFSIG/nr_gold.c @@ -156,34 +156,32 @@ void nr_init_prs(PHY_VARS_gNB* gNB) unsigned int x1, x2; uint16_t Nid; - nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; uint8_t reset; - uint8_t slotNum, symNum; + uint8_t slotNum, symNum, rsc_id; - Nid = cfg->cell_config.phy_cell_id.value; + for (rsc_id = 0; rsc_id < gNB->prs_vars.NumPRSResources; rsc_id++) { + Nid = gNB->prs_vars.prs_cfg[rsc_id].NPRSID; // seed value + LOG_I(PHY, "Initiaized NR-PRS sequence with PRS_ID %d\n", Nid); + for (slotNum = 0; slotNum < fp->slots_per_frame; slotNum++) { + for (symNum = 0; symNum < fp->symbols_per_slot ; symNum++) { + reset = 1; + // initial x2 for prs as ts138.211 + uint32_t c_init1, c_init2, c_init3; + uint32_t pow22=1<<22; + uint32_t pow10=1<<10; + c_init1 = pow22*ceil(Nid/1024); + c_init2 = pow10*(slotNum+symNum+1)*(2*(Nid%1024)+1); + c_init3 = Nid%1024; + x2 = c_init1 + c_init2 + c_init3; - for (slotNum = 0; slotNum < fp->slots_per_frame; slotNum++) { - for (symNum = 0; symNum < fp->symbols_per_slot ; symNum++) { - reset = 1; - // initial x2 for prs as ts138.211 - uint32_t c_init1, c_init2, c_init3; - uint32_t pow22=1<<22; - uint32_t pow10=1<<10; - c_init1 = pow22*ceil(Nid/1024); - c_init2 = pow10*(slotNum+symNum+1)*(2*(Nid%1024)+1); - c_init3 = Nid%1024; - x2 = c_init1 + c_init2 + c_init3; - - - for (uint8_t n=0; nnr_gold_prs[slotNum][symNum][n] = lte_gold_generic(&x1, &x2, reset); - reset = 0; - //printf("%d \n",gNB->nr_gold_prs[slotNum][symNum][n]); - + for (uint8_t n=0; nnr_gold_prs[rsc_id][slotNum][symNum][n] = lte_gold_generic(&x1, &x2, reset); + reset = 0; + //printf("%d \n",gNB->nr_gold_prs[slotNum][symNum][n]); + } } } } - } diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index abe28dcc5e..8c222c4bc6 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -125,38 +125,39 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, } } -void nr_gold_prs(PHY_VARS_NR_UE* ue) +void init_nr_gold_prs(PHY_VARS_NR_UE* ue) { unsigned int x1, x2; uint16_t Nid; - fapi_nr_config_request_t *cfg = &ue->nrUE_config; NR_DL_FRAME_PARMS *fp = &ue->frame_parms; uint8_t reset; - uint8_t slotNum, symNum; + uint8_t slotNum, symNum, gnb, rsc; + + for(gnb = 0; gnb < ue->prs_active_gNBs; gnb++) { + for(rsc = 0; rsc < ue->prs_vars[gnb]->NumPRSResources; rsc++) { + Nid = ue->prs_vars[gnb]->prs_resource[rsc].prs_cfg.NPRSID; // seed value + LOG_I(PHY,"Initialised NR-PRS sequence with PRS_ID %d\n",Nid); + for (slotNum = 0; slotNum < fp->slots_per_frame; slotNum++) { + for (symNum = 0; symNum < fp->symbols_per_slot ; symNum++) { + reset = 1; + // initial x2 for prs as ts138.211 + uint32_t c_init1, c_init2, c_init3; + uint32_t pow22=1<<22; + uint32_t pow10=1<<10; + c_init1 = pow22*ceil(Nid/1024); + c_init2 = pow10*(slotNum+symNum+1)*(2*(Nid%1024)+1); + c_init3 = Nid%1024; + x2 = c_init1 + c_init2 + c_init3; - Nid = cfg->cell_config.phy_cell_id; - - for (slotNum = 0; slotNum < fp->slots_per_frame; slotNum++) { - for (symNum = 0; symNum < fp->symbols_per_slot ; symNum++) { - reset = 1; - // initial x2 for prs as ts138.211 - uint32_t c_init1, c_init2, c_init3; - uint32_t pow22=1<<22; - uint32_t pow10=1<<10; - c_init1 = pow22*ceil(Nid/1024); - c_init2 = pow10*(slotNum+symNum+1)*(2*(Nid%1024)+1); - c_init3 = Nid%1024; - x2 = c_init1 + c_init2 + c_init3; - - - for (uint8_t n=0; nnr_gold_prs[slotNum][symNum][n] = lte_gold_generic(&x1, &x2, reset); - reset = 0; - //printf("%d \n",gNB->nr_gold_prs[slotNum][symNum][n]); - + for (uint8_t n=0; nnr_gold_prs[gnb][rsc][slotNum][symNum][n] = lte_gold_generic(&x1, &x2, reset); + reset = 0; + //printf("%d \n",gNB->nr_gold_prs[slotNum][symNum][n]); + + } + } } - } - } - + } // for rsc + } // for gnb } diff --git a/openair1/PHY/NR_REFSIG/refsig_defs_ue.h b/openair1/PHY/NR_REFSIG/refsig_defs_ue.h index dd51c09943..3033ee488e 100644 --- a/openair1/PHY/NR_REFSIG/refsig_defs_ue.h +++ b/openair1/PHY/NR_REFSIG/refsig_defs_ue.h @@ -68,6 +68,6 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue, uint16_t N_n_scid, uint8_t n_scid); -void nr_gold_prs(PHY_VARS_NR_UE* ue); +void init_nr_gold_prs(PHY_VARS_NR_UE* ue); #endif diff --git a/openair1/PHY/NR_TRANSPORT/nr_prs.c b/openair1/PHY/NR_TRANSPORT/nr_prs.c index 711399d501..bc9aa92ab3 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_prs.c +++ b/openair1/PHY/NR_TRANSPORT/nr_prs.c @@ -8,29 +8,26 @@ //#define DEBUG_PRS_MAP extern short nr_qpsk_mod_table[8]; +int k_prime_table[4][12] = { + {0,1,0,1,0,1,0,1,0,1,0,1}, + {0,2,1,3,0,2,1,3,0,2,1,3}, + {0,3,1,4,2,5,0,3,1,4,2,5}, + {0,6,3,9,1,7,4,10,2,8,5,11}}; int nr_generate_prs(uint32_t **nr_gold_prs, int32_t *txdataF, int16_t amp, prs_data_t *prs_data, nfapi_nr_config_request_scf_t *config, - NR_DL_FRAME_PARMS *frame_parms) { + NR_DL_FRAME_PARMS *frame_parms) +{ - - // Get K_Prime from the table for the length of PRS or LPRS - int k_prime_table[4][12] = { - {0,1,0,1,0,1,0,1,0,1,0,1}, - {0,2,1,3,0,2,1,3,0,2,1,3}, - {0,3,1,4,2,5,0,3,1,4,2,5}, - {0,6,3,9,1,7,4,10,2,8,5,11}}; - - int k_prime = 0; - int k=0; + int k_prime = 0, k = 0; int16_t mod_prs[NR_MAX_PRS_LENGTH<<1]; - uint8_t idx=prs_data->NPRSID; + uint8_t idx; - // PRS resource mapping with combsize=k which means PRS symbols exist in every k-th subcarrier in frequency domain - // According to ts138.211 sec.7.4.1.7.2 + // PRS resource mapping with combsize=k which means PRS symbols exist in every k-th subcarrier in frequency domain + // According to ts138.211 sec.7.4.1.7.2 for (int l = prs_data->SymbolStart; l < prs_data->SymbolStart + prs_data->NumPRSSymbols; l++) { int symInd = l-prs_data->SymbolStart; diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 045052fe6e..0ca22b96d9 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -57,13 +57,13 @@ int nr_prs_channel_estimation(uint8_t gNB_id, NR_DL_FRAME_PARMS *frame_params) { int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; - uint32_t **nr_gold_prs = ue->nr_gold_prs[proc->nr_slot_rx]; + uint32_t **nr_gold_prs = ue->nr_gold_prs[gNB_id][rsc_id][proc->nr_slot_rx]; prs_data_t *prs_cfg = &ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg; prs_meas_t **prs_meas = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_meas; int32_t **prs_chestF = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates; int32_t **prs_chestT = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates_time; - uint8_t rxAnt = 0, idx = prs_cfg->NPRSID; + uint8_t rxAnt = 0, idx = 0; int16_t *rxF, *pil, *fl, *fm, *fmm, *fml, *fmr, *fr, mod_prs[NR_MAX_PRS_LENGTH<<1]; int16_t ch[2] = {0}, noiseFig[2] = {0}; int16_t k_prime = 0, k = 0, re_offset = 0, first_half = 0, second_half = 0; @@ -492,7 +492,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id, prs_meas[rxAnt]->slot = proc->nr_slot_rx; prs_meas[rxAnt]->rxAnt_idx = rxAnt; prs_meas[rxAnt]->dl_aoa = 0; - LOG_I(PHY, "[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] DL PRS ToA ==> %d / %d samples, peak channel power %.1f dB, SNR %+2d dB\n", gNB_id, rsc_id, rxAnt, proc->frame_rx, proc->nr_slot_rx, prs_meas[rxAnt]->dl_toa, frame_params->ofdm_symbol_size, 10*log10(ch_pwr), prs_meas[rxAnt]->snr); + LOG_I(PHY, "[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] DL PRS ToA ==> %d / %d samples, peak channel power %.1f dBm, SNR %+2d dB\n", gNB_id, rsc_id, rxAnt, proc->frame_rx, proc->nr_slot_rx, prs_meas[rxAnt]->dl_toa, frame_params->ofdm_symbol_size, 10*log10(ch_pwr/frame_params->ofdm_symbol_size)-30, prs_meas[rxAnt]->snr); #ifdef DEBUG_PRS_CHEST sprintf(filename, "%s%i%s", "PRSpilot_", rxAnt, ".m"); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 65bb1500b7..0b9fd8564e 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -817,7 +817,7 @@ typedef struct PHY_VARS_gNB_s { uint32_t ***nr_gold_csi_rs; /// PRS sequence - uint32_t ***nr_gold_prs; + uint32_t ****nr_gold_prs; /// Indicator set to 0 after first SR uint8_t first_sr[NUMBER_OF_NR_SR_MAX]; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index ee61a76f83..68130d9037 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -780,8 +780,8 @@ typedef struct { /// PUSCH DMRS sequence uint32_t ****nr_gold_pusch_dmrs; - // PRS sequence - uint32_t ***nr_gold_prs; + // PRS sequence per gNB, per resource + uint32_t *****nr_gold_prs; uint32_t X_u[64][839]; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 4ee10ea472..06180c4096 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -163,7 +163,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, if(is_prs_slot) { LOG_D(PHY,"gNB_TX: frame %d, slot %d, PRS Resource ID %d\n",frame, slot, rsc_id); - nr_generate_prs(gNB->nr_gold_prs[slot],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); + nr_generate_prs(gNB->nr_gold_prs[rsc_id][slot],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,1); From de65d0bdd618d08f3cc7ed15ab2faeef19838fb1 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Mon, 13 Jun 2022 16:36:07 +0200 Subject: [PATCH 873/883] Fixed prs_vars initialization issue in OAI UE --- executables/nr-uesoftmodem.c | 1 - openair1/PHY/INIT/nr_init_ue.c | 50 ++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 62ce0e176e..b418fc9e90 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -525,7 +525,6 @@ int main( int argc, char **argv ) { init_symbol_rotation(&UE[CC_id]->frame_parms); init_timeshift_rotation(&UE[CC_id]->frame_parms); init_nr_ue_vars(UE[CC_id], 0, abstraction_flag); - RCconfig_nrUE_prs(UE[CC_id]); } init_openair0(); diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 7a1c4d1ef5..05375c46ce 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -205,7 +205,32 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) /////////// //////////////////////////////////////////////////////////////////////////////////////////// - //PRS init + // PRS vars + for(int idx = 0; idx < NR_MAX_PRS_COMB_SIZE; idx++) + { + prs_vars[idx] = (NR_UE_PRS *)malloc16_clear(sizeof(NR_UE_PRS)); + for(int k = 0; k < NR_MAX_PRS_RESOURCES_PER_SET; k++) + { + // PRS channel estimates + prs_vars[idx]->prs_resource[k].prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); + prs_vars[idx]->prs_resource[k].prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); + AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed for gNB_id %d\n", idx); + prs_vars[idx]->prs_resource[k].prs_meas = (prs_meas_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(prs_meas_t *) ); + AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas!=NULL), "NR UE init: PRS measurements malloc failed for gNB_id %d\n", idx); + + for (i=0; inb_antennas_rx; i++) { + prs_vars[idx]->prs_resource[k].prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); + prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); + AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed for rx_ant %d\n", i); + prs_vars[idx]->prs_resource[k].prs_meas[i] = (prs_meas_t *)malloc16_clear(sizeof(prs_meas_t) ); + AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas[i]!=NULL), "NR UE init: PRS measurements malloc failed for rx_ant %d\n", i); + } + } + } + // load the config file params + RCconfig_nrUE_prs(ue); + + //PRS sequence init ue->nr_gold_prs = (uint32_t *****)malloc16(ue->prs_active_gNBs*sizeof(uint32_t ****)); uint32_t *****prs = ue->nr_gold_prs; AssertFatal(prs!=NULL, "NR UE init: positioning reference signal malloc failed\n"); @@ -337,29 +362,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } } - // PRS vars - for(int idx = 0; idx < NR_MAX_PRS_COMB_SIZE; idx++) - { - prs_vars[idx] = (NR_UE_PRS *)malloc16_clear(sizeof(NR_UE_PRS)); - for(int k = 0; k < NR_MAX_PRS_RESOURCES_PER_SET; k++) - { - // PRS channel estimates - prs_vars[idx]->prs_resource[k].prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); - prs_vars[idx]->prs_resource[k].prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); - AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed for gNB_id %d\n", idx); - prs_vars[idx]->prs_resource[k].prs_meas = (prs_meas_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(prs_meas_t *) ); - AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas!=NULL), "NR UE init: PRS measurements malloc failed for gNB_id %d\n", idx); - - for (i=0; inb_antennas_rx; i++) { - prs_vars[idx]->prs_resource[k].prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); - prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); - AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed for rx_ant %d\n", i); - prs_vars[idx]->prs_resource[k].prs_meas[i] = (prs_meas_t *)malloc16_clear(sizeof(prs_meas_t) ); - AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas[i]!=NULL), "NR UE init: PRS measurements malloc failed for rx_ant %d\n", i); - } - } - } - // DLSCH for (gNB_id = 0; gNB_id < ue->n_connected_gNB+1; gNB_id++) { for (th_id=0; th_id Date: Tue, 14 Jun 2022 10:48:00 +0200 Subject: [PATCH 874/883] Added PRS resource repetition capability in OAI gNB and UE --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 11 +++++++---- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 14 ++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 06180c4096..573fefbcc7 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -68,11 +68,14 @@ uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, NR_DL_FRAM uint8_t is_prs_slot = 0, rsc_id = 0; for(rsc_id = 0; rsc_id < prs_vars->NumPRSResources; rsc_id++) { - if((prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[1] + prs_vars->prs_cfg[rsc_id].PRSResourceOffset) == ((frame_tx*fp->slots_per_frame+nr_slot_tx)%prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[0])) + for (int i = 0; i < prs_vars->prs_cfg[rsc_id].PRSResourceRepetition; i++) { - is_prs_slot = 1; - *prs_rsc_id = rsc_id; - break; + if( (((frame_tx*fp->slots_per_frame + nr_slot_tx) - (prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[1] + prs_vars->prs_cfg[rsc_id].PRSResourceOffset))%prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[0]) == i*prs_vars->prs_cfg[rsc_id].PRSResourceTimeGap ) + { + is_prs_slot = 1; + *prs_rsc_id = rsc_id; + break; + } } } return is_prs_slot; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 7ff7d18505..5294d1980a 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1381,13 +1381,15 @@ uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *fp, uint8_t * { for(rsc_id = 0; rsc_id < ue->prs_vars[gNB_id]->NumPRSResources; rsc_id++) { - if((ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset) == - ((frame_rx*fp->slots_per_frame + nr_slot_rx)%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0])) + for (int i = 0; i < ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceRepetition; i++) { - is_prs_slot = 1; - *prs_rsc_id = rsc_id; - *prs_gNB_id = gNB_id; - return is_prs_slot; + if( (((frame_rx*fp->slots_per_frame + nr_slot_rx) - (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset))%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0]) == i*ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceTimeGap) + { + is_prs_slot = 1; + *prs_rsc_id = rsc_id; + *prs_gNB_id = gNB_id; + return is_prs_slot; + } } } } From e4ef9d3ac1db331dbfff938d107c3c88f641cf58 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Sat, 25 Jun 2022 13:25:53 +0200 Subject: [PATCH 875/883] Added same slot scheduling for multiple gNB and PRS resources --- .../nr_dl_channel_estimation.c | 8 +++- openair1/PHY/defs_nr_UE.h | 2 - openair1/SCHED_NR/phy_procedures_nr_gNB.c | 39 ++++++---------- openair1/SCHED_NR/sched_nr.h | 1 - openair1/SCHED_NR_UE/defs.h | 1 - openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 46 +++++++------------ openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 17 +------ 7 files changed, 39 insertions(+), 75 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 0ca22b96d9..da8d206343 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -57,11 +57,17 @@ int nr_prs_channel_estimation(uint8_t gNB_id, NR_DL_FRAME_PARMS *frame_params) { int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; - uint32_t **nr_gold_prs = ue->nr_gold_prs[gNB_id][rsc_id][proc->nr_slot_rx]; prs_data_t *prs_cfg = &ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg; prs_meas_t **prs_meas = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_meas; int32_t **prs_chestF = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates; int32_t **prs_chestT = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates_time; + int slot_prs; + if(prs_cfg->PRSResourceRepetition > 1) + slot_prs = proc->nr_slot_rx - prs_cfg->PRSResourceTimeGap; + else + slot_prs = proc->nr_slot_rx; + + uint32_t **nr_gold_prs = ue->nr_gold_prs[gNB_id][rsc_id][slot_prs]; uint8_t rxAnt = 0, idx = 0; int16_t *rxF, *pil, *fl, *fm, *fmm, *fml, *fmr, *fr, mod_prs[NR_MAX_PRS_LENGTH<<1]; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 68130d9037..2991a4b956 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -734,8 +734,6 @@ typedef struct { NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PRS *prs_vars[NR_MAX_PRS_COMB_SIZE]; uint8_t prs_active_gNBs; - uint8_t prs_start_symb; - uint8_t prs_end_symb; //Paging parameters uint32_t IMSImod1024; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 573fefbcc7..bb3224e42e 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -63,24 +63,6 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,sco); } -uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, NR_DL_FRAME_PARMS *fp, int frame_tx, int nr_slot_tx) -{ - uint8_t is_prs_slot = 0, rsc_id = 0; - for(rsc_id = 0; rsc_id < prs_vars->NumPRSResources; rsc_id++) - { - for (int i = 0; i < prs_vars->prs_cfg[rsc_id].PRSResourceRepetition; i++) - { - if( (((frame_tx*fp->slots_per_frame + nr_slot_tx) - (prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[1] + prs_vars->prs_cfg[rsc_id].PRSResourceOffset))%prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[0]) == i*prs_vars->prs_cfg[rsc_id].PRSResourceTimeGap ) - { - is_prs_slot = 1; - *prs_rsc_id = rsc_id; - break; - } - } - } - return is_prs_slot; -} - void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_dl_tti_ssb_pdu ssb_pdu) { NR_DL_FRAME_PARMS *fp=&gNB->frame_parms; @@ -146,8 +128,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, PHY_VARS_gNB *gNB = msgTx->gNB; NR_DL_FRAME_PARMS *fp=&gNB->frame_parms; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; - int offset = gNB->CC_id; - uint8_t rsc_id = 0, is_prs_slot = 0; + int offset = gNB->CC_id, slot_prs; int txdataF_offset = slot*fp->samples_per_slot_wCP; if ((cfg->cell_config.frame_duplex_type.value == TDD) && @@ -162,11 +143,21 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, } // Check for PRS slot - is_prs_slot = check_prs_slot_gNB(&rsc_id, &gNB->prs_vars, fp, frame, slot); - if(is_prs_slot) + for(int rsc_id = 0; rsc_id < gNB->prs_vars.NumPRSResources; rsc_id++) { - LOG_D(PHY,"gNB_TX: frame %d, slot %d, PRS Resource ID %d\n",frame, slot, rsc_id); - nr_generate_prs(gNB->nr_gold_prs[rsc_id][slot],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); + for (int i = 0; i < gNB->prs_vars.prs_cfg[rsc_id].PRSResourceRepetition; i++) + { + if( (((frame*fp->slots_per_frame + slot) - (gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[1] + gNB->prs_vars.prs_cfg[rsc_id].PRSResourceOffset))%gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[0]) == i*gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap ) + { + if (gNB->prs_vars.prs_cfg[rsc_id].PRSResourceRepetition > 1) + slot_prs = slot - gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap; + else + slot_prs = slot; + + LOG_D(PHY,"gNB_TX: frame %d, slot %d, PRS Resource ID %d\n",frame, slot, rsc_id); + nr_generate_prs(gNB->nr_gold_prs[rsc_id][slot_prs],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); + } + } } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,1); diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index 033ce2061f..2124397c47 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -54,7 +54,6 @@ void nr_fep_full(RU_t *ru, int slot); void nr_fep_full_2thread(RU_t *ru, int slot); void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); int nr_phy_init_RU(RU_t *ru); -uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, NR_DL_FRAME_PARMS *fp, int frame_tx, int nr_slot_tx); void nr_phy_free_RU(RU_t *ru); #endif diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index b0767e42d2..9bcf659eac 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -373,7 +373,6 @@ int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx); int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp); int is_ssb_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp); -uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *fp, uint8_t *prs_gNB_id, uint8_t *prs_rsc_id, int frame_rx, int nr_slot_rx); /*! \brief This function prepares the dl indication to pass to the MAC @param diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 5294d1980a..f334ee4f08 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1374,28 +1374,6 @@ int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL } } -uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *fp, uint8_t *prs_gNB_id, uint8_t *prs_rsc_id, int frame_rx, int nr_slot_rx) -{ - uint8_t is_prs_slot = 0, rsc_id = 0, gNB_id = 0; - for(gNB_id = 0; gNB_id < ue->prs_active_gNBs; gNB_id++) - { - for(rsc_id = 0; rsc_id < ue->prs_vars[gNB_id]->NumPRSResources; rsc_id++) - { - for (int i = 0; i < ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceRepetition; i++) - { - if( (((frame_rx*fp->slots_per_frame + nr_slot_rx) - (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset))%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0]) == i*ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceTimeGap) - { - is_prs_slot = 1; - *prs_rsc_id = rsc_id; - *prs_gNB_id = gNB_id; - return is_prs_slot; - } - } - } - } - return is_prs_slot; -} - int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, @@ -1409,7 +1387,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int slot_pbch; int slot_ssb; fapi_nr_config_request_t *cfg = &ue->nrUE_config; - uint8_t rsc_id = 0, is_prs_slot = 0, prs_gNB_id = 0; + int num_prs = 0; uint8_t nb_symb_pdcch = phy_pdcch_config->nb_search_space > 0 ? phy_pdcch_config->pdcch_config[0].coreset.duration : 0; uint8_t dci_cnt = 0; @@ -1484,19 +1462,27 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, } // Check for PRS slot - is_prs_slot = check_prs_slot_nrUE(ue, fp, &prs_gNB_id, &rsc_id, frame_rx, nr_slot_rx); - if (is_prs_slot) + for(int gNB_id = 0; gNB_id < ue->prs_active_gNBs; gNB_id++) { - for(int j = ue->prs_start_symb; j < ue->prs_end_symb; j++) + for(int rsc_id = 0; rsc_id < ue->prs_vars[gNB_id]->NumPRSResources; rsc_id++) { + for (int i = 0; i < ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceRepetition; i++) + { + if( (((frame_rx*fp->slots_per_frame + nr_slot_rx) - (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset))%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0]) == i*ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceTimeGap) + { + for(int j = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart; (j < (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.NumPRSSymbols)); j++) + { nr_slot_fep(ue, proc, (j%fp->symbols_per_slot), nr_slot_rx); - } - - nr_prs_channel_estimation(prs_gNB_id,rsc_id,ue,proc,fp); - } + } + nr_prs_channel_estimation(gNB_id,rsc_id,ue,proc,fp); + num_prs++; + } + } // for i + } // for rsc_id + } // for gNB_id if ((frame_rx%64 == 0) && (nr_slot_rx==0)) { LOG_I(NR_PHY,"============================================\n"); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 481545874c..958786df8b 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1347,7 +1347,7 @@ void RCconfig_nr_ue_L1(void) { void RCconfig_nrUE_prs(void *cfg) { - int j = 0, k = 0, gNB_id = 0, prs_start = 0, prs_end = 0; + int j = 0, k = 0, gNB_id = 0; char aprefix[MAX_OPTNAME_SIZE*2 + 8]; PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)cfg; @@ -1393,17 +1393,6 @@ void RCconfig_nrUE_prs(void *cfg) ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern1[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].uptr[l]; for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++) ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern2[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].uptr[l]; - - if(gNB_id==0 && k==0) - { - prs_start = ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart; - prs_end = ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumPRSSymbols; - } - else - { - prs_start = MIN((prs_start), (ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart)); - prs_end = MAX((prs_end), (ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumPRSSymbols)); - } } // for k k = 0; @@ -1454,10 +1443,6 @@ void RCconfig_nrUE_prs(void *cfg) LOG_I(NR_PHY,"No %s configuration found\n", PRS_ParamList.listname); } } - ue->prs_start_symb = prs_start; - ue->prs_end_symb = prs_end; - LOG_I(PHY, "prs_active_gNBs %d, prs_start_symb %d, prs_end_symb %d\n", ue->prs_active_gNBs, ue->prs_start_symb, ue->prs_end_symb); - AssertFatal((prs_start <= prs_end) || (prs_end > NR_SYMBOLS_PER_SLOT), "Invalid PRS symbol allocation, please check the start and end symbols\n"); } /* From f2de1eb4eb139cc0081b7bb3e128ec686945a444 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Sat, 25 Jun 2022 13:27:36 +0200 Subject: [PATCH 876/883] T tracer dumps per PRS resources --- common/utils/T/T_messages.txt | 4 ++-- openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c | 2 +- openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 30982b57aa..8ec3538c10 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -1288,11 +1288,11 @@ ID = UE_PHY_INPUT_SIGNAL ID = UE_PHY_DL_CHANNEL_ESTIMATE DESC = UE channel estimation in the time domain GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,chest_t + FORMAT = int,eNB_ID : int,rsc_id : int,frame : int,subframe : int,antenna : buffer,chest_t ID = UE_PHY_DL_CHANNEL_ESTIMATE_FREQ DESC = UE channel estimation in the frequency domain GROUP = ALL:PHY:GRAPHIC:HEAVY:UE - FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,chestF_t + FORMAT = int,eNB_ID : int,rsc_id : int,frame : int,subframe : int,antenna : buffer,chestF_t ID = UE_PHY_PDCCH_IQ DESC = UE PDCCH received IQ data GROUP = ALL:PHY:GRAPHIC:HEAVY:UE diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c index d221348b44..fc77d4ae18 100644 --- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c +++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c @@ -701,7 +701,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue, } } - T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), + T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(0), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].frame_rx%1024), T_INT(ue->proc.proc_rxtx[ue->current_thread_id[Ns>>1]].subframe_rx), T_INT(0), T_BUFFER(&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates_time[eNB_offset][0][0], 512 * 4)); return(0); diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index da8d206343..81c0d75fc7 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -519,11 +519,11 @@ int nr_prs_channel_estimation(uint8_t gNB_id, T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx), T_INT(rxAnt), T_BUFFER(&rxdataF[rxAnt][0], frame_params->samples_per_slot_wCP*sizeof(int32_t))); - T(T_UE_PHY_DL_CHANNEL_ESTIMATE_FREQ, T_INT(gNB_id), + T(T_UE_PHY_DL_CHANNEL_ESTIMATE_FREQ, T_INT(gNB_id), T_INT(rsc_id), T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx), T_INT(rxAnt), T_BUFFER(&prs_chestF[rxAnt][0], frame_params->ofdm_symbol_size*sizeof(int32_t))); - T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(gNB_id), + T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(gNB_id), T_INT(rsc_id), T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx), T_INT(rxAnt), T_BUFFER(&prs_chestT[rxAnt][0], frame_params->ofdm_symbol_size*sizeof(int32_t))); } From 605a44233bf387e2aa7a1e707d6f8798fc695f0b Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Sat, 25 Jun 2022 16:23:43 +0200 Subject: [PATCH 877/883] Fixing PRS resource repetition handling --- openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c | 5 +++-- openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 1 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 8 ++++---- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 ++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 81c0d75fc7..591d4d037b 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -52,6 +52,7 @@ static inline int abs32(int x) int nr_prs_channel_estimation(uint8_t gNB_id, uint8_t rsc_id, + uint8_t rep_num, PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, NR_DL_FRAME_PARMS *frame_params) @@ -62,8 +63,8 @@ int nr_prs_channel_estimation(uint8_t gNB_id, int32_t **prs_chestF = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates; int32_t **prs_chestT = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates_time; int slot_prs; - if(prs_cfg->PRSResourceRepetition > 1) - slot_prs = proc->nr_slot_rx - prs_cfg->PRSResourceTimeGap; + if(rep_num > 0) + slot_prs = (proc->nr_slot_rx - prs_cfg->PRSResourceTimeGap)%frame_params->slots_per_frame; else slot_prs = proc->nr_slot_rx; diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index 839c8f5680..a5c568c22a 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -35,6 +35,7 @@ /* A function to perform the channel estimation of DL PRS signal */ int nr_prs_channel_estimation(uint8_t gNB_id, uint8_t rsc_id, + uint8_t rep_num, PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, NR_DL_FRAME_PARMS *frame_params); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index bb3224e42e..3fbd0e654d 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -147,14 +147,14 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, { for (int i = 0; i < gNB->prs_vars.prs_cfg[rsc_id].PRSResourceRepetition; i++) { - if( (((frame*fp->slots_per_frame + slot) - (gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[1] + gNB->prs_vars.prs_cfg[rsc_id].PRSResourceOffset))%gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[0]) == i*gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap ) + if( (((frame*fp->slots_per_frame + slot) - (gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[1] + gNB->prs_vars.prs_cfg[rsc_id].PRSResourceOffset)+gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[0])%gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[0]) == i*gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap ) { - if (gNB->prs_vars.prs_cfg[rsc_id].PRSResourceRepetition > 1) - slot_prs = slot - gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap; + if (i > 0) + slot_prs = (slot - gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap + fp->slots_per_frame)%fp->slots_per_frame; else slot_prs = slot; - LOG_D(PHY,"gNB_TX: frame %d, slot %d, PRS Resource ID %d\n",frame, slot, rsc_id); + LOG_D(PHY,"gNB_TX: frame %d, slot %d, slot_prs %d, PRS Resource ID %d\n",frame, slot, slot_prs, rsc_id); nr_generate_prs(gNB->nr_gold_prs[rsc_id][slot_prs],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); } } diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index f334ee4f08..020a32439b 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1387,7 +1387,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int slot_pbch; int slot_ssb; fapi_nr_config_request_t *cfg = &ue->nrUE_config; - int num_prs = 0; uint8_t nb_symb_pdcch = phy_pdcch_config->nb_search_space > 0 ? phy_pdcch_config->pdcch_config[0].coreset.duration : 0; uint8_t dci_cnt = 0; @@ -1470,15 +1469,14 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, { if( (((frame_rx*fp->slots_per_frame + nr_slot_rx) - (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset))%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0]) == i*ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceTimeGap) { - for(int j = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart; (j < (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.NumPRSSymbols)); j++) + for(int j = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart; j < (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.NumPRSSymbols); j++) { nr_slot_fep(ue, proc, (j%fp->symbols_per_slot), nr_slot_rx); } - nr_prs_channel_estimation(gNB_id,rsc_id,ue,proc,fp); - num_prs++; + nr_prs_channel_estimation(gNB_id,rsc_id,i,ue,proc,fp); } } // for i } // for rsc_id From 63b94b742a30ff66094c24b9777aceba7510ad8b Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Tue, 28 Jun 2022 16:11:58 +0200 Subject: [PATCH 878/883] Adding PRS multiple gNB and UE configs --- ...nb.sa.band257.fr2.128PRB.prs.usrpx310.conf | 18 +- ...b.sa.band257.fr2.128PRB.prs.usrpx310.conf2 | 322 ++++++++++++++++++ ...gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf | 20 +- ...nb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 | 322 ++++++++++++++++++ .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 12 +- ...gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf | 6 +- ...nb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 | 322 ++++++++++++++++++ ...gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf | 6 +- ...nb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 | 14 +- .../CONF/ue.nr.prs.fr1.217prb.conf | 12 +- .../CONF/ue.nr.prs.fr1.273prb.conf | 36 +- .../CONF/ue.nr.prs.fr2.128prb.conf | 28 +- .../CONF/ue.nr.prs.fr2.64prb.conf | 28 +- 13 files changed, 1060 insertions(+), 86 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf2 create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf index 10f77dcef5..2769689bcc 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf @@ -143,7 +143,7 @@ gNBs = # ssb_periodicityServingCell # 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 - ssb_periodicityServingCell = 2; + ssb_periodicityServingCell = 1; # dmrs_TypeA_position # 0 = pos2, 1 = pos3 @@ -216,18 +216,18 @@ MACRLCs = ( prs_config = ( { - NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; - SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSResources = 8; + PRSResourceSetPeriod = [80, 0]; + SymbolStart = [7,7,7,7,7,7,7,7]; + NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 128; RBOffset = 0; CombSize = 4; - REOffset = [0]; - PRSResourceOffset = [0]; + REOffset = [0,0,0,0,0,0,0,0]; + PRSResourceOffset = [0,10,20,30,40,50,60,70]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [0]; + NPRS_ID = [0,1,2,3,4,5,6,7]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; @@ -260,7 +260,7 @@ RUs = ( ##beamforming 1x2 matrix: 1 layer x 2 antennas bf_weights = [0x00007fff, 0x0000]; #clock_src = "internal"; - sdr_addrs = "addr=192.168.50.2,second_addr=192.168.60.2,clock_source=internal,time_source=internal" + sdr_addrs = "addr=192.168.50.2,clock_source=gpsdo,time_source=gpsdo" if_freq = 50000000L; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf2 new file mode 100644 index 0000000000..738280ad30 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf2 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is pointA + 23 PRBs@120kHz SCS (same as initial BWP) + absoluteFrequencySSB = 2078315; + dl_frequencyBand = 257; + # this is 27.900 GHz + dl_absoluteFrequencyPointA = 2077499; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 3; + dl_carrierBandwidth = 128; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 3; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 257; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 3; + ul_carrierBandwidth = 128; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 13475; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 3; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 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 = 3, +# 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 = 3; + ssb_PositionsInBurst_Bitmap = 0x0010001000100010L; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 1; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 3; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 3; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 3; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 8; + PRSResourceSetPeriod = [80, 0]; + SymbolStart = [7,7,7,7,7,7,7,7]; + NumPRSSymbols = [6,6,6,6,6,6,6,6]; + NumRB = 128; + RBOffset = 0; + CombSize = 4; + REOffset = [1,1,1,1,1,1,1,1]; + PRSResourceOffset = [0,10,20,30,40,50,60,70]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [10,11,12,13,14,15,16,17]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [257]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + ##beamforming 1x2 matrix: 1 layer x 2 antennas + bf_weights = [0x00007fff, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.50.2,clock_source=gpsdo,time_source=gpsdo" + if_freq = 50000000L; +} +); + +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"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = ("saviq"); #or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf index 56bbc23ef0..b4006409e0 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf @@ -143,7 +143,7 @@ gNBs = # ssb_periodicityServingCell # 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 - ssb_periodicityServingCell = 2; + ssb_periodicityServingCell = 1; # dmrs_TypeA_position # 0 = pos2, 1 = pos3 @@ -216,18 +216,18 @@ MACRLCs = ( prs_config = ( { - NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; - SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSResources = 8; + PRSResourceSetPeriod = [80, 0]; + SymbolStart = [7,7,7,7,7,7,7,7]; + NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 64; RBOffset = 0; CombSize = 4; - REOffset = [0]; - PRSResourceOffset = [0]; + REOffset = [0,0,0,0,0,0,0,0]; + PRSResourceOffset = [0,10,20,30,40,50,60,70]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [0]; + NPRS_ID = [0,1,2,3,4,5,6,7]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; @@ -259,7 +259,9 @@ RUs = ( eNB_instances = [0]; #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; - clock_src = "internal"; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" + if_freq = 50000000L; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 new file mode 100644 index 0000000000..42d8fbc203 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is pointA + 23 PRBs@120kHz SCS (same as initial BWP) + absoluteFrequencySSB = 2078315; + dl_frequencyBand = 257; + # this is 27.900 GHz + dl_absoluteFrequencyPointA = 2077499; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 3; + dl_carrierBandwidth = 64; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 3; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 257; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 3; + ul_carrierBandwidth = 64; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 13475; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 3; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 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 = 3, +# 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 = 3; + ssb_PositionsInBurst_Bitmap = 0x0010001000100010L; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 1; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 3; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 3; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 3; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 8; + PRSResourceSetPeriod = [80, 0]; + SymbolStart = [7,7,7,7,7,7,7,7]; + NumPRSSymbols = [6,6,6,6,6,6,6,6]; + NumRB = 64; + RBOffset = 0; + CombSize = 4; + REOffset = [1,1,1,1,1,1,1,1]; + PRSResourceOffset = [0,10,20,30,40,50,60,70]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [10,11,12,13,14,15,16,17]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [257]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" + if_freq = 50000000L; +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 0b4ac6556f..451079edf1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -212,17 +212,17 @@ MACRLCs = ( prs_config = ( { NumPRSResources = 2; - PRSResourceSetPeriod = [20, 5]; - SymbolStart = [7, 8]; - NumPRSSymbols = [5, 5]; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7, 7]; + NumPRSSymbols = [6, 6]; NumRB = 106; RBOffset = 0; CombSize = 4; REOffset = [0, 1]; - PRSResourceOffset = [0, 1]; - PRSResourceRepetition = 1; + PRSResourceOffset = [0, 0]; + PRSResourceRepetition = 2; PRSResourceTimeGap = 1; - NPRS_ID = [0, 5]; + NPRS_ID = [10, 5]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf index c0642afba5..91b614a13e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf @@ -218,9 +218,9 @@ MACRLCs = ( prs_config = ( { NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; + PRSResourceSetPeriod = [20, 2]; SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSSymbols = [6]; NumRB = 216; RBOffset = 0; CombSize = 4; @@ -261,7 +261,7 @@ RUs = ( #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "internal"; - sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2,clock_source=external,time_source=external" + sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 new file mode 100644 index 0000000000..d5567d564a --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 650000; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 647408; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 217; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 217; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 2; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 216; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [1]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [5]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf index 605a4afdb2..b8703915a5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf @@ -218,10 +218,10 @@ MACRLCs = ( prs_config = ( { NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; + PRSResourceSetPeriod = [20, 2]; SymbolStart = [7]; - NumPRSSymbols = [7]; - NumRB = 240; + NumPRSSymbols = [6]; + NumRB = 272; RBOffset = 0; CombSize = 4; REOffset = [0]; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 index ef3b6fca6e..318e57609e 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 @@ -49,7 +49,7 @@ gNBs = { #spCellConfigCommon - physCellId = 1; + physCellId = 0; # downlinkConfigCommon #frequencyInfoDL @@ -218,17 +218,17 @@ MACRLCs = ( prs_config = ( { NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; + PRSResourceSetPeriod = [20, 2]; SymbolStart = [7]; - NumPRSSymbols = [7]; - NumRB = 240; + NumPRSSymbols = [6]; + NumRB = 272; RBOffset = 0; CombSize = 4; - REOffset = [1]; - PRSResourceOffset = [0]; + REOffset = [0]; + PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [1]; + NPRS_ID = [5]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf index 3c76026015..21ac9c53c5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf @@ -6,9 +6,9 @@ PRSs = { gNB_id = 0; NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; + PRSResourceSetPeriod = [20, 2]; SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSSymbols = [6]; NumRB = 216; RBOffset = 0; CombSize = 4; @@ -27,14 +27,14 @@ PRSs = { gNB_id = 1; NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; + PRSResourceSetPeriod = [20, 2]; SymbolStart = [7]; - NumPRSSymbols = [4]; + NumPRSSymbols = [6]; NumRB = 216; RBOffset = 0; CombSize = 4; - REOffset = [1]; - PRSResourceOffset = [0]; + REOffset = [0]; + PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; NPRS_ID = [5]; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.273prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.273prb.conf index f2c3902d5d..3ef45b3f7d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.273prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.273prb.conf @@ -5,36 +5,42 @@ PRSs = prs_config0 = ( { gNB_id = 0; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; NumRB = 272; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); prs_config1 = ( { gNB_id = 1; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; - NumRB = 106; + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 272; RBOffset = 0; CombSize = 4; - REOffset = 1; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [5]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.128prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.128prb.conf index 8619eca5f4..4e5e7eeb42 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.128prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.128prb.conf @@ -5,18 +5,18 @@ PRSs = prs_config0 = ( { gNB_id = 0; - NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; - SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSResources = 8; + PRSResourceSetPeriod = [80, 0]; + SymbolStart = [7,7,7,7,7,7,7,7]; + NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 128; RBOffset = 0; CombSize = 4; - REOffset = [0]; - PRSResourceOffset = [0]; + REOffset = [0,0,0,0,0,0,0,0]; + PRSResourceOffset = [0,10,20,30,40,50,60,70]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [0]; + NPRS_ID = [0,1,2,3,4,5,6,7]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; @@ -26,18 +26,18 @@ PRSs = prs_config1 = ( { gNB_id = 1; - NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; - SymbolStart = [7]; - NumPRSSymbols = [4]; + NumPRSResources = 8; + PRSResourceSetPeriod = [80, 0]; + SymbolStart = [7,7,7,7,7,7,7,7]; + NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 128; RBOffset = 0; CombSize = 4; - REOffset = [1]; - PRSResourceOffset = [0]; + REOffset = [1,1,1,1,1,1,1,1]; + PRSResourceOffset = [0,10,20,30,40,50,60,70]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [5]; + NPRS_ID = [10,11,12,13,14,15,16,17]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf index 2d04955726..5f33a03e6d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf @@ -5,18 +5,18 @@ PRSs = prs_config0 = ( { gNB_id = 0; - NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; - SymbolStart = [7]; - NumPRSSymbols = [7]; + NumPRSResources = 8; + PRSResourceSetPeriod = [80, 0]; + SymbolStart = [7,7,7,7,7,7,7,7]; + NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 64; RBOffset = 0; CombSize = 4; - REOffset = [0]; - PRSResourceOffset = [0]; + REOffset = [0,0,0,0,0,0,0,0]; + PRSResourceOffset = [0,10,20,30,40,50,60,70]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [0]; + NPRS_ID = [0,1,2,3,4,5,6,7]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; @@ -26,18 +26,18 @@ PRSs = prs_config1 = ( { gNB_id = 1; - NumPRSResources = 1; - PRSResourceSetPeriod = [40, 0]; - SymbolStart = [7]; - NumPRSSymbols = [4]; + NumPRSResources = 8; + PRSResourceSetPeriod = [80, 0]; + SymbolStart = [7,7,7,7,7,7,7,7]; + NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 64; RBOffset = 0; CombSize = 4; - REOffset = [1]; - PRSResourceOffset = [0]; + REOffset = [1,1,1,1,1,1,1,1]; + PRSResourceOffset = [0,10,20,30,40,50,60,70]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [5]; + NPRS_ID = [10,11,12,13,14,15,16,17]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; From 431d28e00d0576e8b5dc60b16b1b8b9030d96bbc Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Thu, 30 Jun 2022 16:40:41 +0200 Subject: [PATCH 879/883] FR2 64PRBs working configs for 2gNB schenario --- .../CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf | 6 +++--- .../CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 | 10 +++++----- .../CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf | 6 +++--- .../GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf index b4006409e0..cd07d57685 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf @@ -217,8 +217,8 @@ MACRLCs = ( prs_config = ( { NumPRSResources = 8; - PRSResourceSetPeriod = [80, 0]; - SymbolStart = [7,7,7,7,7,7,7,7]; + PRSResourceSetPeriod = [80, 1]; + SymbolStart = [8,8,8,8,8,8,8,8]; NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 64; RBOffset = 0; @@ -261,7 +261,7 @@ RUs = ( bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "internal"; sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" - if_freq = 50000000L; + if_freq = 3329760000L; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 index 42d8fbc203..82f975e10b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf2 @@ -139,7 +139,7 @@ gNBs = # ssb_PositionsInBurs_BitmapPR # 1=short, 2=medium, 3=long ssb_PositionsInBurst_PR = 3; - ssb_PositionsInBurst_Bitmap = 0x0010001000100010L; + ssb_PositionsInBurst_Bitmap = 0x002000200020002L; # ssb_periodicityServingCell # 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 @@ -217,8 +217,8 @@ MACRLCs = ( prs_config = ( { NumPRSResources = 8; - PRSResourceSetPeriod = [80, 0]; - SymbolStart = [7,7,7,7,7,7,7,7]; + PRSResourceSetPeriod = [80, 1]; + SymbolStart = [0,0,0,0,0,0,0,0]; NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 64; RBOffset = 0; @@ -260,8 +260,8 @@ RUs = ( #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "internal"; - sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" - if_freq = 50000000L; + sdr_addrs = "addr=192.168.20.2,clock_source=gpsdo,time_source=gpsdo" + if_freq = 3329760000L; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf index aa7a94565d..e08dfd0848 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf @@ -54,10 +54,10 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) - absoluteFrequencySSB = 650000; + absoluteFrequencySSB = 621984; dl_frequencyBand = 78; # this is 3600 MHz - dl_absoluteFrequencyPointA = 648728; + dl_absoluteFrequencyPointA = 620712; #scs-SpecificCarrierList dl_offstToCarrier = 0; # subcarrierSpacing @@ -261,7 +261,7 @@ RUs = ( #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "internal"; - sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" + sdr_addrs = "addr=192.168.50.2,second_addr=192.168.60.2,clock_source=external,time_source=external" } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf index 5f33a03e6d..563404231c 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf @@ -6,8 +6,8 @@ PRSs = { gNB_id = 0; NumPRSResources = 8; - PRSResourceSetPeriod = [80, 0]; - SymbolStart = [7,7,7,7,7,7,7,7]; + PRSResourceSetPeriod = [80, 1]; + SymbolStart = [8,8,8,8,8,8,8,8]; NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 64; RBOffset = 0; @@ -27,8 +27,8 @@ PRSs = { gNB_id = 1; NumPRSResources = 8; - PRSResourceSetPeriod = [80, 0]; - SymbolStart = [7,7,7,7,7,7,7,7]; + PRSResourceSetPeriod = [80, 1]; + SymbolStart = [0,0,0,0,0,0,0,0]; NumPRSSymbols = [6,6,6,6,6,6,6,6]; NumRB = 64; RBOffset = 0; From 8bc011b76d41ce94ef1f277f541dd92cfe3e07ca Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Mon, 4 Jul 2022 16:48:41 +0200 Subject: [PATCH 880/883] Fixed USRP lib alignment issue in trx_usrp_read() function --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 04a9aae132..ed17d7eefd 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -711,13 +711,6 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp ((__m64 *)buff[i])[4*j+3] = _mm_srai_pi16 (((__m64 *)buff_tmp[i])[4*j+3],rxshift); } } - if ((((uintptr_t) buff[i])&0x1F)==0) { - for (int j=0; j Date: Tue, 5 Jul 2022 14:30:29 +0200 Subject: [PATCH 881/883] Adding 3 and 4gNB PRS configs for FR1 40/80MHz --- ...nb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 | 2 +- ...nb.sa.band78.fr1.106PRB.prs.usrpn310.conf3 | 322 ++++++++++++++++++ ...nb.sa.band78.fr1.106PRB.prs.usrpn310.conf4 | 322 ++++++++++++++++++ ...gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf | 6 +- ...nb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 | 2 +- ...nb.sa.band78.fr1.217PRB.prs.usrpx310.conf3 | 322 ++++++++++++++++++ ...nb.sa.band78.fr1.217PRB.prs.usrpx310.conf4 | 322 ++++++++++++++++++ .../CONF/ue.nr.prs.fr1.106prb.conf | 46 ++- .../CONF/ue.nr.prs.fr1.217prb.conf | 44 ++- 9 files changed, 1380 insertions(+), 8 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf3 create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf4 create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf3 create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf4 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 index dc73a39f05..f13b865fcb 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf2 @@ -228,7 +228,7 @@ prs_config = ( PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [0]; + NPRS_ID = [1]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf3 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf3 new file mode 100644 index 0000000000..361884eb73 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf3 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 621984; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 620712; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 4; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [2]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [2]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.50.2,second_addr=192.168.60.2,clock_source=external,time_source=external"; +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf4 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf4 new file mode 100644 index 0000000000..4d92d9e5fd --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf4 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 621984; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 620712; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 8; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [3]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [3]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.50.2,second_addr=192.168.60.2,clock_source=external,time_source=external" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf index 91b614a13e..be96fa43f1 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf @@ -54,10 +54,10 @@ gNBs = # downlinkConfigCommon #frequencyInfoDL # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) - absoluteFrequencySSB = 650000; + absoluteFrequencySSB = 621984; dl_frequencyBand = 78; # this is 3600 MHz - dl_absoluteFrequencyPointA = 647408; + dl_absoluteFrequencyPointA = 620712; #scs-SpecificCarrierList dl_offstToCarrier = 0; # subcarrierSpacing @@ -261,7 +261,7 @@ RUs = ( #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "internal"; - sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" + sdr_addrs = "addr=192.168.50.2,second_addr=192.168.60.2,clock_source=external,time_source=external" } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 index d5567d564a..250353e29f 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf2 @@ -228,7 +228,7 @@ prs_config = ( PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [5]; + NPRS_ID = [1]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf3 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf3 new file mode 100644 index 0000000000..1df62d949d --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf3 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 621984; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 620712; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 217; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 217; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 4; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 216; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [2]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [2]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.50.2,second_addr=192.168.60.2,clock_source=external,time_source=external" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf4 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf4 new file mode 100644 index 0000000000..086052095d --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf4 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 621984; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 620712; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 217; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 217; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 8; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 216; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [3]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [3]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.50.2,second_addr=192.168.60.2,clock_source=external,time_source=external" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf index 6a5fbc3785..32790b93e7 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf @@ -1,7 +1,7 @@ PRSs = ( { - Active_gNBs = 2; + Active_gNBs = 1; prs_config0 = ( { gNB_id = 0; @@ -37,7 +37,49 @@ PRSs = PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [0]; + NPRS_ID = [1]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; + } + ); + + prs_config2 = ( + { + gNB_id = 2; + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [2]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [2]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; + } + ); + + prs_config3 = ( + { + gNB_id = 3; + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [3]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [3]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf index 21ac9c53c5..c2fd316524 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf @@ -37,7 +37,49 @@ PRSs = PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = [5]; + NPRS_ID = [1]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; + } + ); + + prs_config2 = ( + { + gNB_id = 2; + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 216; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [2]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [2]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; + } + ); + + prs_config3 = ( + { + gNB_id = 3; + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 2]; + SymbolStart = [7]; + NumPRSSymbols = [6]; + NumRB = 216; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [3]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [3]; MutingPattern1 = []; MutingPattern2 = []; MutingBitRepetition = 1; From daa8484670c74f9d48ca6664208324bf6fc7a56a Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Tue, 5 Jul 2022 15:45:30 +0200 Subject: [PATCH 882/883] Fixing PRS resource scheduling in UE --- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 020a32439b..4a8abe83e9 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1467,7 +1467,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, { for (int i = 0; i < ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceRepetition; i++) { - if( (((frame_rx*fp->slots_per_frame + nr_slot_rx) - (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset))%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0]) == i*ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceTimeGap) + if( (((frame_rx*fp->slots_per_frame + nr_slot_rx) - (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset) + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0])%ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[0]) == i*ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceTimeGap) { for(int j = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart; j < (ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.NumPRSSymbols); j++) { From cd7f8333f73f2a043e5124bbdcb396ae76ee9759 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Mon, 25 Jul 2022 13:57:56 +0200 Subject: [PATCH 883/883] Adding 16x IDFT interpolation for PRS peak estimation --- .../nr_dl_channel_estimation.c | 60 +++++++-- openair1/PHY/TOOLS/oai_dfts.c | 119 +++++++++++++++++- openair1/PHY/TOOLS/tools_defs.h | 3 + openair1/SCHED_NR/phy_procedures_nr_gNB.c | 6 +- 4 files changed, 169 insertions(+), 19 deletions(-) diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 591d4d037b..9756f1105f 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -38,6 +38,7 @@ //#define DEBUG_CH //#define DEBUG_PRS_CHEST //#define DEBUG_PRS_PRINTS +#define IDFT_INTERPOL_FACTOR 1 extern short nr_qpsk_mod_table[8]; int k_prime_table[4][12] = { {0,1,0,1,0,1,0,1,0,1,0,1}, @@ -62,12 +63,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id, prs_meas_t **prs_meas = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_meas; int32_t **prs_chestF = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates; int32_t **prs_chestT = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates_time; - int slot_prs; - if(rep_num > 0) - slot_prs = (proc->nr_slot_rx - prs_cfg->PRSResourceTimeGap)%frame_params->slots_per_frame; - else - slot_prs = proc->nr_slot_rx; - + int slot_prs = (proc->nr_slot_rx - rep_num*prs_cfg->PRSResourceTimeGap + frame_params->slots_per_frame)%frame_params->slots_per_frame; uint32_t **nr_gold_prs = ue->nr_gold_prs[gNB_id][rsc_id][slot_prs]; uint8_t rxAnt = 0, idx = 0; @@ -76,13 +72,18 @@ int nr_prs_channel_estimation(uint8_t gNB_id, int16_t k_prime = 0, k = 0, re_offset = 0, first_half = 0, second_half = 0; int16_t *ch_tmp = (int16_t *)malloc16_clear(frame_params->ofdm_symbol_size*sizeof(int32_t)); AssertFatal((ch_tmp != NULL), "[%s] channel estimate buffer initialization failed!!", __FUNCTION__); + int16_t *chF_interpol = (int16_t *)malloc16_clear(IDFT_INTERPOL_FACTOR*frame_params->ofdm_symbol_size*sizeof(int32_t)); + AssertFatal((chF_interpol != NULL), "[%s] channel estimate buffer initialization failed!!", __FUNCTION__); + int16_t *chT_interpol = (int16_t *)malloc16_clear(IDFT_INTERPOL_FACTOR*frame_params->ofdm_symbol_size*sizeof(int32_t)); + AssertFatal((chT_interpol != NULL), "[%s] channel estimate buffer initialization failed!!", __FUNCTION__); int32_t ch_pwr = 0, snr = 0; #ifdef DEBUG_PRS_CHEST char filename[64] = {0}, varname[64] = {0}; #endif - int16_t *ch_init = ch_tmp; + int16_t *ch_init = ch_tmp; int16_t scale_factor = (1.0f/(float)(prs_cfg->NumPRSSymbols))*(1<<15); - int16_t num_pilots = (12/prs_cfg->CombSize)*prs_cfg->NumRB; + int16_t num_pilots = (12/prs_cfg->CombSize)*prs_cfg->NumRB; + int16_t start_offset = (IDFT_INTERPOL_FACTOR-1)*frame_params->ofdm_symbol_size>>1; for(int l = prs_cfg->SymbolStart; l < prs_cfg->SymbolStart+prs_cfg->NumPRSSymbols; l++) { @@ -434,9 +435,12 @@ int nr_prs_channel_estimation(uint8_t gNB_id, if(second_half > 0) memcpy((int16_t *)&prs_chestF[rxAnt][0], &ch_tmp[(first_half<<1)], second_half*sizeof(int32_t)); + memcpy((int16_t *)&chF_interpol[start_offset+re_offset], &ch_tmp[0], first_half*sizeof(int32_t)); + memcpy((int16_t *)&chF_interpol[start_offset], &ch_tmp[(first_half<<1)], second_half*sizeof(int32_t)); + // Time domain IMPULSE response idft_size_idx_t idftsizeidx; - switch (frame_params->ofdm_symbol_size) { + switch (IDFT_INTERPOL_FACTOR*frame_params->ofdm_symbol_size) { case 128: idftsizeidx = IDFT_128; break; @@ -473,18 +477,46 @@ int nr_prs_channel_estimation(uint8_t gNB_id, idftsizeidx = IDFT_4096; break; + case 8192: + idftsizeidx = IDFT_8192; + break; + + case 12288: + idftsizeidx = IDFT_12288; + break; + + case 16384: + idftsizeidx = IDFT_16384; + break; + + case 24576: + idftsizeidx = IDFT_24576; + break; + + case 32768: + idftsizeidx = IDFT_32768; + break; + + case 49152: + idftsizeidx = IDFT_49152; + break; + + case 65536: + idftsizeidx = IDFT_65536; + break; + default: LOG_I(PHY, "%s: unsupported ofdm symbol size \n", __FUNCTION__); assert(0); } idft(idftsizeidx, - (int16_t *)&prs_chestF[rxAnt][0], - (int16_t *)&ch_tmp[0],1); + (int16_t *)&chF_interpol[0], + (int16_t *)&chT_interpol[0],1); // rearrange impulse response - memcpy((int16_t *)&prs_chestT[rxAnt][0], &ch_tmp[frame_params->ofdm_symbol_size], (frame_params->ofdm_symbol_size>>1)*sizeof(int32_t)); - memcpy((int16_t *)&prs_chestT[rxAnt][(frame_params->ofdm_symbol_size>>1)], &ch_tmp[0], (frame_params->ofdm_symbol_size>>1)*sizeof(int32_t)); + memcpy((int16_t *)&prs_chestT[rxAnt][0], &chT_interpol[IDFT_INTERPOL_FACTOR*frame_params->ofdm_symbol_size], (frame_params->ofdm_symbol_size>>1)*sizeof(int32_t)); + memcpy((int16_t *)&prs_chestT[rxAnt][(frame_params->ofdm_symbol_size>>1)], &chT_interpol[start_offset], (frame_params->ofdm_symbol_size>>1)*sizeof(int32_t)); // peak estimator peak_estimator(&prs_chestT[rxAnt][0], @@ -530,6 +562,8 @@ int nr_prs_channel_estimation(uint8_t gNB_id, } free(ch_tmp); + free(chF_interpol); + free(chT_interpol); return(0); } diff --git a/openair1/PHY/TOOLS/oai_dfts.c b/openair1/PHY/TOOLS/oai_dfts.c index 5e8622bb24..014199831f 100644 --- a/openair1/PHY/TOOLS/oai_dfts.c +++ b/openair1/PHY/TOOLS/oai_dfts.c @@ -5363,7 +5363,7 @@ void idft8192(int16_t *x,int16_t *y,unsigned char scale) #endif -int16_t tw16384[3*2*4096]; +int16_t tw16384[3*2*4096] __attribute__((aligned(32))); #ifndef __AVX2__ void dft16384(int16_t *x,int16_t *y,unsigned char scale) @@ -7013,6 +7013,122 @@ void idft49152(int16_t *input, int16_t *output,uint8_t scale) { _m_empty(); } +int16_t tw65536[3*2*4096] __attribute__((aligned(32))); + +#ifndef __AVX2__ +void idft65536(int16_t *x,int16_t *y,unsigned char scale) +{ + + simd_q15_t xtmp[16384],ytmp[16384],*tw65536_128p=(simd_q15_t *)tw65536,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y; + simd_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<16384; i+=4,j++) { + transpose16_ooff(x128+i,xtmp+j,4096); + } + + + idft16384((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft16384((int16_t*)(xtmp+4096),(int16_t*)(ytmp+4096),1); + idft16384((int16_t*)(xtmp+8192),(int16_t*)(ytmp+8192),1); + idft16384((int16_t*)(xtmp+12288),(int16_t*)(ytmp+12288),1); + + for (i=0; i<4096; i++) { + ibfly4(ytmpp,ytmpp+4096,ytmpp+8192,ytmpp+12288, + y128p,y128p+4096,y128p+8192,y128p+12288, + tw65536_128p,tw63536_128p+4096,tw65536_128p+8192); + tw65536_128p++; + y128p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<1024; i++) { + y128[0] = shiftright_int16(y128[0],scale); + y128[1] = shiftright_int16(y128[1],scale); + y128[2] = shiftright_int16(y128[2],scale); + y128[3] = shiftright_int16(y128[3],scale); + y128[4] = shiftright_int16(y128[4],scale); + y128[5] = shiftright_int16(y128[5],scale); + y128[6] = shiftright_int16(y128[6],scale); + y128[7] = shiftright_int16(y128[7],scale); + y128[8] = shiftright_int16(y128[8],scale); + y128[9] = shiftright_int16(y128[9],scale); + y128[10] = shiftright_int16(y128[10],scale); + y128[11] = shiftright_int16(y128[11],scale); + y128[12] = shiftright_int16(y128[12],scale); + y128[13] = shiftright_int16(y128[13],scale); + y128[14] = shiftright_int16(y128[14],scale); + y128[15] = shiftright_int16(y128[15],scale); + + y128+=16; + } + + } + + _mm_empty(); + _m_empty(); +} + +#else // __AVX2__ +void idft65536(int16_t *x,int16_t *y,unsigned char scale) +{ + + simd256_q15_t xtmp[8192],ytmp[8192],*tw65536_256p=(simd256_q15_t *)tw65536,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y; + simd256_q15_t *ytmpp = &ytmp[0]; + int i,j; + + for (i=0,j=0; i<8192; i+=4,j++) { + transpose16_ooff_simd256(x256+i,xtmp+j,2048); + } + + + idft16384((int16_t*)(xtmp),(int16_t*)(ytmp),1); + idft16384((int16_t*)(xtmp+2048),(int16_t*)(ytmp+2048),1); + idft16384((int16_t*)(xtmp+4096),(int16_t*)(ytmp+4096),1); + idft16384((int16_t*)(xtmp+6144),(int16_t*)(ytmp+6144),1); + + for (i=0; i<2048; i++) { + ibfly4_256(ytmpp,ytmpp+2048,ytmpp+4096,ytmpp+6144, + y256p,y256p+2048,y256p+4096,y256p+6144, + tw65536_256p,tw65536_256p+4096,tw65536_256p+8192); + tw65536_256p++; + y256p++; + ytmpp++; + } + + if (scale>0) { + + for (i=0; i<512; i++) { + y256[0] = shiftright_int16_simd256(y256[0],scale); + y256[1] = shiftright_int16_simd256(y256[1],scale); + y256[2] = shiftright_int16_simd256(y256[2],scale); + y256[3] = shiftright_int16_simd256(y256[3],scale); + y256[4] = shiftright_int16_simd256(y256[4],scale); + y256[5] = shiftright_int16_simd256(y256[5],scale); + y256[6] = shiftright_int16_simd256(y256[6],scale); + y256[7] = shiftright_int16_simd256(y256[7],scale); + y256[8] = shiftright_int16_simd256(y256[8],scale); + y256[9] = shiftright_int16_simd256(y256[9],scale); + y256[10] = shiftright_int16_simd256(y256[10],scale); + y256[11] = shiftright_int16_simd256(y256[11],scale); + y256[12] = shiftright_int16_simd256(y256[12],scale); + y256[13] = shiftright_int16_simd256(y256[13],scale); + y256[14] = shiftright_int16_simd256(y256[14],scale); + y256[15] = shiftright_int16_simd256(y256[15],scale); + + y256+=16; + } + + } + + _mm_empty(); + _m_empty(); +} + +#endif //__AVX2__ + int16_t twa73728[49152] __attribute__((aligned(32))); int16_t twb73728[49152] __attribute__((aligned(32))); // 24576 x 3 @@ -10708,6 +10824,7 @@ int dfts_autoinit(void) init_rad2(8192,tw8192); init_rad4(16384,tw16384); init_rad2(32768,tw32768); + init_rad4(65536,tw65536); init_rad3(768,twa768,twb768); init_rad3(1536,twa1536,twb1536); diff --git a/openair1/PHY/TOOLS/tools_defs.h b/openair1/PHY/TOOLS/tools_defs.h index 8303e088b4..f272e513c2 100644 --- a/openair1/PHY/TOOLS/tools_defs.h +++ b/openair1/PHY/TOOLS/tools_defs.h @@ -275,10 +275,13 @@ This function performs optimized fixed-point radix-2 FFT/IFFT. SZ_DEF(8192) \ SZ_DEF(9216) \ SZ_DEF(12288) \ + SZ_DEF(16384) \ SZ_DEF(18432) \ SZ_DEF(24576) \ + SZ_DEF(32768) \ SZ_DEF(36864) \ SZ_DEF(49152) \ + SZ_DEF(65536) \ SZ_DEF(73728) \ SZ_DEF(98304) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 3fbd0e654d..ffbedf3da7 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -149,11 +149,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, { if( (((frame*fp->slots_per_frame + slot) - (gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[1] + gNB->prs_vars.prs_cfg[rsc_id].PRSResourceOffset)+gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[0])%gNB->prs_vars.prs_cfg[rsc_id].PRSResourceSetPeriod[0]) == i*gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap ) { - if (i > 0) - slot_prs = (slot - gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap + fp->slots_per_frame)%fp->slots_per_frame; - else - slot_prs = slot; - + slot_prs = (slot - i*gNB->prs_vars.prs_cfg[rsc_id].PRSResourceTimeGap + fp->slots_per_frame)%fp->slots_per_frame; LOG_D(PHY,"gNB_TX: frame %d, slot %d, slot_prs %d, PRS Resource ID %d\n",frame, slot, slot_prs, rsc_id); nr_generate_prs(gNB->nr_gold_prs[rsc_id][slot_prs],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); }