From de9158eeaf606828a016352d73ecdd811a1ae495 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 3 May 2021 18:13:55 +0200 Subject: [PATCH] Enable NR RRC MCS table selection --- lib/include/srsran/phy/phch/phch_cfg_nr.h | 1 + lib/src/phy/phch/ra_nr.c | 30 ++++++++++---------- srsue/src/stack/rrc/rrc_nr.cc | 34 +++++++++++++++++++++++ 3 files changed, 51 insertions(+), 14 deletions(-) diff --git a/lib/include/srsran/phy/phch/phch_cfg_nr.h b/lib/include/srsran/phy/phch/phch_cfg_nr.h index 57a02f21b..a8e8d337c 100644 --- a/lib/include/srsran/phy/phch/phch_cfg_nr.h +++ b/lib/include/srsran/phy/phch/phch_cfg_nr.h @@ -184,6 +184,7 @@ typedef struct SRSRAN_API { bool scrambling_id_present; uint32_t scambling_id; // Identifier used to initialize data scrambling (0-1023) + srsran_mcs_table_t mcs_table; srsran_dmrs_sch_type_t dmrs_type; srsran_dmrs_sch_len_t dmrs_max_length; struct { diff --git a/lib/src/phy/phch/ra_nr.c b/lib/src/phy/phch/ra_nr.c index 0f4a87f04..5581c03ec 100644 --- a/lib/src/phy/phch/ra_nr.c +++ b/lib/src/phy/phch/ra_nr.c @@ -670,13 +670,14 @@ int srsran_ra_dl_dci_to_grant_nr(const srsran_carrier_nr_t* carrier, // 5.1.2.3 Physical resource block (PRB) bundling // ... - pdsch_grant->nof_layers = 1; - pdsch_grant->dci_format = dci_dl->ctx.format; - pdsch_grant->rnti = dci_dl->ctx.rnti; - pdsch_grant->rnti_type = dci_dl->ctx.rnti_type; - pdsch_grant->tb[0].rv = dci_dl->rv; - pdsch_grant->tb[0].mcs = dci_dl->mcs; - pdsch_grant->tb[0].ndi = dci_dl->ndi; + pdsch_grant->nof_layers = 1; + pdsch_grant->dci_format = dci_dl->ctx.format; + pdsch_grant->rnti = dci_dl->ctx.rnti; + pdsch_grant->rnti_type = dci_dl->ctx.rnti_type; + pdsch_grant->tb[0].rv = dci_dl->rv; + pdsch_grant->tb[0].mcs = dci_dl->mcs; + pdsch_grant->tb[0].ndi = dci_dl->ndi; + pdsch_cfg->sch_cfg.mcs_table = pdsch_hl_cfg->mcs_table; // 5.1.4 PDSCH resource mapping if (ra_dl_resource_mapping(carrier, slot, pdsch_hl_cfg, pdsch_cfg) < SRSRAN_SUCCESS) { @@ -783,13 +784,14 @@ int srsran_ra_ul_dci_to_grant_nr(const srsran_carrier_nr_t* carrier, // 5.1.2.3 Physical resource block (PRB) bundling // ... - pusch_grant->nof_layers = 1; - pusch_grant->dci_format = dci_ul->ctx.format; - pusch_grant->rnti = dci_ul->ctx.rnti; - pusch_grant->rnti_type = dci_ul->ctx.rnti_type; - pusch_grant->tb[0].rv = dci_ul->rv; - pusch_grant->tb[0].mcs = dci_ul->mcs; - pusch_grant->tb[0].ndi = dci_ul->ndi; + pusch_grant->nof_layers = 1; + pusch_grant->dci_format = dci_ul->ctx.format; + pusch_grant->rnti = dci_ul->ctx.rnti; + pusch_grant->rnti_type = dci_ul->ctx.rnti_type; + pusch_grant->tb[0].rv = dci_ul->rv; + pusch_grant->tb[0].mcs = dci_ul->mcs; + pusch_grant->tb[0].ndi = dci_ul->ndi; + pusch_cfg->sch_cfg.mcs_table = pusch_hl_cfg->mcs_table; // 5.1.6.2 DM-RS reception procedure if (ra_ul_dmrs(pusch_hl_cfg, dci_ul, pusch_cfg) < SRSRAN_SUCCESS) { diff --git a/srsue/src/stack/rrc/rrc_nr.cc b/srsue/src/stack/rrc/rrc_nr.cc index cf8443c35..8c518a64c 100644 --- a/srsue/src/stack/rrc/rrc_nr.cc +++ b/srsue/src/stack/rrc/rrc_nr.cc @@ -606,6 +606,23 @@ bool rrc_nr::apply_sp_cell_init_dl_pdcch(const asn1::rrc_nr::pdcch_cfg_s& pdcch_ bool rrc_nr::apply_sp_cell_init_dl_pdsch(const asn1::rrc_nr::pdsch_cfg_s& pdsch_cfg) { + if (pdsch_cfg.mcs_table_present) { + switch (pdsch_cfg.mcs_table) { + case pdsch_cfg_s::mcs_table_opts::qam256: + phy_cfg.pdsch.mcs_table = srsran_mcs_table_256qam; + break; + case pdsch_cfg_s::mcs_table_opts::qam64_low_se: + phy_cfg.pdsch.mcs_table = srsran_mcs_table_qam64LowSE; + break; + case pdsch_cfg_s::mcs_table_opts::nulltype: + logger.warning("Warning while selecting pdsch mcs_table"); + return false; + } + } else { + // If the field is absent the UE applies the value 64QAM. + phy_cfg.pdsch.mcs_table = srsran_mcs_table_64qam; + } + if (pdsch_cfg.dmrs_dl_for_pdsch_map_type_a_present) { if (pdsch_cfg.dmrs_dl_for_pdsch_map_type_a.type() == setup_release_c::types_opts::setup) { srsran_dmrs_sch_add_pos_t srsran_dmrs_sch_add_pos; @@ -1016,6 +1033,23 @@ bool rrc_nr::apply_sp_cell_ded_ul_pucch(const asn1::rrc_nr::pucch_cfg_s& pucch_c bool rrc_nr::apply_sp_cell_ded_ul_pusch(const asn1::rrc_nr::pusch_cfg_s& pusch_cfg) { + if (pusch_cfg.mcs_table_present) { + switch (pusch_cfg.mcs_table) { + case pusch_cfg_s::mcs_table_opts::qam256: + phy_cfg.pusch.mcs_table = srsran_mcs_table_256qam; + break; + case pusch_cfg_s::mcs_table_opts::qam64_low_se: + phy_cfg.pusch.mcs_table = srsran_mcs_table_qam64LowSE; + break; + case pusch_cfg_s::mcs_table_opts::nulltype: + logger.warning("Warning while selecting pdsch mcs_table"); + return false; + } + } else { + // If the field is absent the UE applies the value 64QAM. + phy_cfg.pusch.mcs_table = srsran_mcs_table_64qam; + } + srsran_resource_alloc_t resource_alloc; if (make_phy_pusch_alloc_type(pusch_cfg, &resource_alloc) == true) { phy_cfg.pusch.alloc = resource_alloc;