From a0b207fe6b1314320889ae828ecb392fba4efe51 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 29 Apr 2022 17:25:51 +0200 Subject: [PATCH] adding options for 256QAM in UL simulators --- openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c | 2 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 12 +++++++++--- openair1/SIMULATION/NR_PHY/ulsim.c | 7 ++++++- openair2/RRC/NR/nr_rrc_config.c | 12 +++++++++--- openair2/RRC/NR/nr_rrc_config.h | 4 ++-- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c index 42fc1820ac..fc08255631 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c @@ -387,7 +387,7 @@ void nr_ulsch_compute_llr(int32_t *rxdataF_comp, symbol); break; default: - LOG_E(PHY,"nr_ulsch_compute_llr: invalid Qm value, symbol = %d, Qm = %d\n",symbol, mod_order); + AssertFatal(1==0,"nr_ulsch_compute_llr: invalid Qm value, symbol = %d, Qm = %d\n",symbol, mod_order); break; } } diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 4cdc6e1882..dbdc768784 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -707,7 +707,7 @@ int main(int argc, char **argv) NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); prepare_sim_uecap(UE_Capability_nr,scc,mu, - N_RB_DL,g_mcsTableIdx); + N_RB_DL,g_mcsTableIdx,0); // TODO do a UECAP for phy-sim const gNB_RrcConfigurationReq conf = { diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 69b12e78ee..9b973d2926 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -169,6 +169,7 @@ int main(int argc, char **argv) uint8_t Imcs = 9; uint8_t Nl = 1; uint8_t max_ldpc_iterations = 5; + uint8_t mcs_table = 0; double DS_TDL = .03; @@ -182,7 +183,7 @@ int main(int argc, char **argv) randominit(0); //while ((c = getopt(argc, argv, "df:hpg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:")) != -1) { - while ((c = getopt(argc, argv, "hg:n:s:S:py:z:M:N:R:F:m:l:r:W:")) != -1) { + while ((c = getopt(argc, argv, "hg:n:s:S:py:z:M:N:R:F:m:l:q:r:W:")) != -1) { switch (c) { /*case 'f': write_output_file = 1; @@ -346,6 +347,10 @@ int main(int argc, char **argv) nb_symb_sch = atoi(optarg); break; + case 'q': + mcs_table = atoi(optarg); + break; + case 'r': nb_rb = atoi(optarg); break; @@ -476,8 +481,8 @@ int main(int argc, char **argv) if ((Nl==4)||(Nl==3)) nb_re_dmrs = nb_re_dmrs*2; - mod_order = nr_get_Qm_ul(Imcs, 0); - code_rate = nr_get_code_rate_ul(Imcs, 0); + mod_order = nr_get_Qm_ul(Imcs, mcs_table); + code_rate = nr_get_code_rate_ul(Imcs, mcs_table); available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, Nl); TBS = nr_compute_tbs(mod_order,code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, Nl); @@ -513,6 +518,7 @@ int main(int argc, char **argv) N_RE_prime = NR_NB_SC_PER_RB*nb_symb_sch - nb_re_dmrs - N_PRB_oh; ulsch_ue->pusch_pdu.rnti = n_rnti; + ulsch_ue->pusch_pdu.mcs_table = mcs_table; ulsch_ue->pusch_pdu.mcs_index = Imcs; ulsch_ue->pusch_pdu.nrOfLayers = Nl; ulsch_ue->pusch_pdu.rb_size = nb_rb; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index f660e9559c..c2670330ff 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -631,6 +631,10 @@ int main(int argc, char **argv) NR_ServingCellConfig_t *scd = calloc(1,sizeof(NR_ServingCellConfig_t)); prepare_scd(scd); + NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); + prepare_sim_uecap(UE_Capability_nr,scc,mu, + N_RB_UL,0,mcs_table); + // TODO do a UECAP for phy-sim const gNB_RrcConfigurationReq conf = { .pdsch_AntennaPorts = { .N1 = 1, .N2 = 1, .XP = 1 }, @@ -640,7 +644,8 @@ int main(int argc, char **argv) .do_SRS = 0, .force_256qam_off = false }; - NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, NULL, 0, 1, &conf, 0); + + NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, 0); /* RRC parameter validation for secondaryCellGroup */ fix_scd(scd); diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 20b1dc0d71..6f9a42f7ac 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -619,7 +619,8 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, NR_ServingCellConfigCommon_t *scc, int numerology, int rbsize, - int mcs_table) { + int mcs_table_dl, + int mcs_table_ul) { NR_Phy_Parameters_t *phy_Parameters = &cap->phy_Parameters; int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; @@ -627,10 +628,15 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, nr_bandnr->bandNR = band; asn1cSeqAdd(&cap->rf_Parameters.supportedBandListNR.list, nr_bandnr); - if (mcs_table == 1) { + NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[0]; + + if (mcs_table_ul == 1) { + bandNRinfo->pusch_256QAM = CALLOC(1,sizeof(*bandNRinfo->pusch_256QAM)); + *bandNRinfo->pusch_256QAM = NR_BandNR__pusch_256QAM_supported; + } + if (mcs_table_dl == 1) { int bw = get_supported_band_index(numerology, band, rbsize); if (band>256) { - NR_BandNR_t *bandNRinfo = cap->rf_Parameters.supportedBandListNR.list.array[0]; bandNRinfo->pdsch_256QAM_FR2 = CALLOC(1,sizeof(*bandNRinfo->pdsch_256QAM_FR2)); *bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported; } diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index 8e596ca4b1..592d14bf01 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -44,7 +44,8 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap, NR_ServingCellConfigCommon_t *scc, int numerology, int rbsize, - int mcs_table); + int mcs_table_dl, + int mcs_table_ul); NR_BCCH_BCH_Message_t *get_new_MIB_NR(const NR_ServingCellConfigCommon_t *scc); void free_MIB_NR(NR_BCCH_BCH_Message_t *mib); @@ -79,5 +80,4 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC const gNB_RrcConfigurationReq *configuration, int uid); - #endif