From 0517b97382dd609e10d51946408d21932e10c653 Mon Sep 17 00:00:00 2001 From: sfn Date: Mon, 2 Aug 2021 15:38:46 +0200 Subject: [PATCH 001/166] 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 002/166] 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 003/166] 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 a778f69a7642e4e6dfc5a02dc2cda27662f485a9 Mon Sep 17 00:00:00 2001 From: sfn Date: Thu, 9 Dec 2021 10:36:01 +0100 Subject: [PATCH 004/166] 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 005/166] 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 b942851a4ccbc46d0aaea380c39fde03ba50a5d3 Mon Sep 17 00:00:00 2001 From: sfn Date: Fri, 10 Dec 2021 15:50:04 +0100 Subject: [PATCH 006/166] 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 223ad6aabe2093de896163beff981a2ebf0b8758 Mon Sep 17 00:00:00 2001 From: sfn Date: Wed, 15 Dec 2021 12:55:27 +0100 Subject: [PATCH 007/166] 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 008/166] 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 a8a5897a986ae5de561e85521c68e8718317fc2b Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 20 Jan 2022 21:08:44 +0530 Subject: [PATCH 009/166] 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 aa4db6057b18fe2273c5ea04cc44a8ec860e29cb Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Tue, 4 Jan 2022 18:39:45 +0530 Subject: [PATCH 010/166] 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 1d7569b4af5fd53640ed4b0dd9b8246d1d4e3a49 Mon Sep 17 00:00:00 2001 From: sfn Date: Tue, 21 Dec 2021 12:48:21 +0100 Subject: [PATCH 011/166] 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 012/166] 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 013/166] 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 015/166] 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 016/166] 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 017/166] 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 018/166] 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 019/166] 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 0e17edc16526c146fe79165fa798f94c1e02c07c Mon Sep 17 00:00:00 2001 From: sfn Date: Wed, 26 Jan 2022 03:34:29 +0100 Subject: [PATCH 020/166] 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 aa9e30691b50d4c831d617ba3c8c2d238ff19375 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 14:53:36 +0000 Subject: [PATCH 021/166] 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 022/166] 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 023/166] 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 024/166] 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 025/166] 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 026/166] 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 b069dcd3c88d2095a5e1af18a4143f3af7026e4b Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 2 Feb 2022 20:22:57 +0000 Subject: [PATCH 027/166] 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 a37240197c1dd815131598b4c41ed9edd05147ee Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 3 Feb 2022 18:57:22 +0100 Subject: [PATCH 028/166] 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 e39ad834c0b5d5934de9057b173b52d7997f2882 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 4 Feb 2022 15:20:24 +0000 Subject: [PATCH 029/166] 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 62b525c579a756451ff9ae8258fe942f27e70933 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 8 Feb 2022 11:59:54 -0800 Subject: [PATCH 030/166] 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 031/166] 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 032/166] 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 033/166] 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 034/166] 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 035/166] 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 036/166] 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 037/166] 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 3dce1171d56a1df74697bf429170072d55dcb18d Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Tue, 8 Feb 2022 19:04:43 +0000 Subject: [PATCH 038/166] 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 039/166] 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 040/166] 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 041/166] 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 042/166] 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 043/166] 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 044/166] 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 ba891206e52598dc70bac5c4cc8cb03c9cff3183 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 14 Feb 2022 09:47:34 +0530 Subject: [PATCH 045/166] 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 046/166] 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 047/166] 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 048/166] 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 ec4ae32af0c8aad9a7101d6a74a647125a32d4a5 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 10 Feb 2022 16:59:09 +0100 Subject: [PATCH 049/166] 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 050/166] 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 051/166] 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 052/166] 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 5e7de1cdfc36c8826c70ca8a12f85de7e2caacc2 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 14 Feb 2022 11:41:22 -0800 Subject: [PATCH 053/166] 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 054/166] 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 055/166] 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 84eb7763bda9cae3dc4dc64ab017261e34a88116 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 15 Feb 2022 09:46:13 +0100 Subject: [PATCH 056/166] 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 9a78b58927e0e8f68e6ebc8296ab747e89bf46e4 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 16 Feb 2022 13:12:12 -0800 Subject: [PATCH 057/166] 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 058/166] 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 059/166] 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 060/166] 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 061/166] 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 062/166] 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 2208abfedd776adbc90f07a27b10c71693bc0555 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 17 Feb 2022 08:48:26 -0800 Subject: [PATCH 063/166] 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 064/166] 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 cc22ec9978f484355fd4ab23e5e674865c4be38b Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 09:29:00 -0800 Subject: [PATCH 065/166] 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 bf3d7959bd6db261f5d58795058a4db828e568ff Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 09:39:06 -0800 Subject: [PATCH 066/166] 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 b7c767147e3ffb5d035927a64de6bedaf41bb9c0 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Fri, 18 Feb 2022 09:48:38 -0800 Subject: [PATCH 067/166] 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 068/166] 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 069/166] 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 070/166] 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 071/166] 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 9b4a7526ad457623eff1e0924665b8f7442ebd59 Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Mon, 21 Feb 2022 15:26:00 +0530 Subject: [PATCH 072/166] 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 073/166] 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 074/166] 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 77c8439ba337b6f338eecea96e97a6fbf14bf000 Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 21 Feb 2022 15:24:17 +0100 Subject: [PATCH 075/166] 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 4fbf9ea10e4d105f15d8998e44c6913055e2dace Mon Sep 17 00:00:00 2001 From: francescomani Date: Mon, 21 Feb 2022 18:35:08 +0100 Subject: [PATCH 076/166] 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 774b750cb10f2759f2010c8f087972c6ed7e1bae Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 22 Feb 2022 17:27:42 +0100 Subject: [PATCH 077/166] 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 dc4a82934dead240379968cc1148060c6152a5a2 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 23 Feb 2022 11:53:57 +0000 Subject: [PATCH 078/166] 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 bfebc0cb1828326a820305b3d8f5c5ed0928765e Mon Sep 17 00:00:00 2001 From: "Deokseong \"David\" Kim" Date: Wed, 23 Feb 2022 22:59:45 +0000 Subject: [PATCH 079/166] 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 5f7f56f056e928909d189562a4d6b01642d06142 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 24 Feb 2022 09:03:00 -0800 Subject: [PATCH 080/166] 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 081/166] 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 ce12e8270bb66d1419bc0d0d2ebe631814e39c56 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 24 Feb 2022 14:58:50 -0800 Subject: [PATCH 082/166] 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 083/166] 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 7681feee071b49949c638fa4fb2efae1bd9965f0 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 1 Mar 2022 07:23:14 -0800 Subject: [PATCH 084/166] 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 085/166] 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 086/166] 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 dcbc60df6b07671436b37e68ec36ed1154fdbf72 Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Mar 2022 11:57:01 +0100 Subject: [PATCH 087/166] 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 c36c8ccae05f04067c2d795f0161bec64d21f06e Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 2 Mar 2022 18:54:35 +0100 Subject: [PATCH 088/166] 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 089/166] 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 7e0757fb488ebad535ae350acf7ab827194deec7 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 3 Mar 2022 15:46:54 -0800 Subject: [PATCH 090/166] 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 0e85b51f7628551c524600a84fb618609a142d74 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 4 Mar 2022 14:15:58 +0000 Subject: [PATCH 091/166] 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 092/166] 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 093/166] 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 094/166] 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 095/166] 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 a6049bcddf06e4bdedea9738ff096fedba34b281 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Mon, 7 Mar 2022 11:59:23 -0800 Subject: [PATCH 096/166] 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 097/166] 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 d1cd5b771b9b8aebe036904d7a2e6e986db0f8aa Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 8 Mar 2022 07:47:44 -0800 Subject: [PATCH 098/166] 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 0c28328986a2b3a6fdb0d7fed4412a26aef1783b Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Thu, 10 Mar 2022 15:19:42 +0530 Subject: [PATCH 099/166] 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 9b737d0985025395cbd2e3f3ee59cd011e631ad8 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 14 Mar 2022 11:48:09 +0000 Subject: [PATCH 100/166] 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 101/166] 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 102/166] 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 91d42fd5ec9062c47eae149dde88d2758eb7c941 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Thu, 17 Mar 2022 12:44:30 -0700 Subject: [PATCH 103/166] 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 f646b9a57c7f8f227de10443ca447fab0eb9e903 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Mar 2022 07:57:39 +0100 Subject: [PATCH 104/166] 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 105/166] 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 70265d9c64fdea6ed164fad20f4f2b7bffcd81f0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 18 Mar 2022 18:45:14 +0100 Subject: [PATCH 106/166] 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 f5e143ec78aa34e6051692a8c4700ae0d8c3619a Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 22 Mar 2022 14:49:23 -0700 Subject: [PATCH 107/166] 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 3e6f957a63ace3cabae6142ca41172faf8ac4157 Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Tue, 22 Mar 2022 14:50:03 -0700 Subject: [PATCH 108/166] 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 408c9ec7c2aeae0cd806e4a17d47dff7d4ae4bb9 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Wed, 23 Mar 2022 22:17:03 +0000 Subject: [PATCH 109/166] 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 154c5d587c8009616cb6a6af41eed002c363e4b6 Mon Sep 17 00:00:00 2001 From: Manish Date: Thu, 24 Mar 2022 08:05:53 +0000 Subject: [PATCH 110/166] 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 111/166] 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 112/166] 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 ed4cc7c2570ab76e2057e0fe10de318822ad07e1 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 24 Mar 2022 15:37:26 +0000 Subject: [PATCH 113/166] 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 a020c51772714988919eab6d50e43de571a140c7 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Mon, 28 Mar 2022 10:31:50 +0100 Subject: [PATCH 114/166] 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 a87741cedadf6a4928eef15d60f35bd557596e03 Mon Sep 17 00:00:00 2001 From: Manish Date: Fri, 25 Mar 2022 10:48:15 +0000 Subject: [PATCH 115/166] 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 116/166] 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 117/166] 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 118/166] 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 119/166] 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 120/166] 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 121/166] 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 122/166] 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 123/166] 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 124/166] 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 125/166] 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 126/166] 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 127/166] 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 8df0cc3aa93c59f6d5d6e6fd91073934babeed83 Mon Sep 17 00:00:00 2001 From: Manish Date: Tue, 29 Mar 2022 04:13:45 +0000 Subject: [PATCH 128/166] 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 129/166] 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 130/166] 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 131/166] 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 132/166] 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 133/166] 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 134/166] 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 135/166] 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 100832b111c9e8d35fb12b8769dc2dd99a024eeb Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 31 Mar 2022 09:26:15 +0200 Subject: [PATCH 136/166] 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 137/166] 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 138/166] 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 139/166] 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 140/166] 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 141/166] 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 142/166] 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 143/166] 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 144/166] 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 145/166] 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 146/166] 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 147/166] 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 148/166] 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 149/166] 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 150/166] 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 151/166] 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 152/166] 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 153/166] 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 154/166] 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 155/166] 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 156/166] 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 76c0335a8b0b01827a473990b8c00cfdaa9f1842 Mon Sep 17 00:00:00 2001 From: hardy Date: Thu, 24 Feb 2022 17:04:20 +0100 Subject: [PATCH 157/166] 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 158/166] 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 159/166] 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 160/166] 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 161/166] 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 162/166] 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 163/166] 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 164/166] 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 165/166] 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 6ad71e290a6e8ae53e436b86c4ce13b06de0f7d3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 8 Apr 2022 11:30:19 +0200 Subject: [PATCH 166/166] 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) {