Commit c5bce98b authored by dir's avatar dir

RRC, MAC changes to enable RFSIM testing of feature transform precoding.

- Enable -Z option to test Transform precoding on ULSIM.
- Set msg3_transformPrecoder to 0 in uplinkcommonconfig params in conf file to test on RFSIM.
parent a17f0078
......@@ -1579,6 +1579,44 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
ulcfg_pdu->pusch_config_pdu.pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS
}
/* TRANSFORM PRECODING ------------------------------------------------------------------------------------------*/
if (ulcfg_pdu->pusch_config_pdu.transform_precoding == transform_precoder_enabled) {
uint32_t n_RS_Id = 0;
NR_PUSCH_Config_t *pusch_config=mac->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup;
NR_DMRS_UplinkConfig_t *NR_DMRS_ulconfig = NULL;
ulcfg_pdu->pusch_config_pdu.num_dmrs_cdm_grps_no_data = 2;
if(pusch_config->dmrs_UplinkForPUSCH_MappingTypeA != NULL)
NR_DMRS_ulconfig = pusch_config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup;
else
NR_DMRS_ulconfig = pusch_config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
if (NR_DMRS_ulconfig->transformPrecodingEnabled->nPUSCH_Identity != NULL)
n_RS_Id = *NR_DMRS_ulconfig->transformPrecodingEnabled->nPUSCH_Identity;
else
n_RS_Id = *mac->scc->physCellId;
// U as specified in section 6.4.1.1.1.2 in 38.211, if sequence hopping and group hopping are disabled
ulcfg_pdu->pusch_config_pdu.dfts_ofdm.low_papr_group_number = n_RS_Id % 30;
// V as specified in section 6.4.1.1.1.2 in 38.211 V = 0 if sequence hopping and group hopping are disabled
if ((NR_DMRS_ulconfig->transformPrecodingEnabled->sequenceGroupHopping == NULL) &&
(NR_DMRS_ulconfig->transformPrecodingEnabled->sequenceHopping == NULL))
ulcfg_pdu->pusch_config_pdu.dfts_ofdm.low_papr_sequence_number = 0;
else
AssertFatal(1==0,"SequenceGroupHopping or sequenceHopping are NOT Supported\n");
LOG_D(MAC,"TRANSFORM PRECODING IS ENABLED. CDM groups: %d, U: %d \n", ulcfg_pdu->pusch_config_pdu.num_dmrs_cdm_grps_no_data,
ulcfg_pdu->pusch_config_pdu.dfts_ofdm.low_papr_group_number);
}
/* TRANSFORM PRECODING --------------------------------------------------------------------------------------------------------*/
get_num_re_dmrs(&ulcfg_pdu->pusch_config_pdu,
&nb_dmrs_re_per_rb,
&number_dmrs_symbols);
......@@ -3220,9 +3258,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
/* MCS TABLE */
if (mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL)
pusch_config_pdu_0_0->transform_precoding = 1;
pusch_config_pdu_0_0->transform_precoding = transform_precoder_disabled;
else
pusch_config_pdu_0_0->transform_precoding = 0;
pusch_config_pdu_0_0->transform_precoding = transform_precoder_enabled;
if (pusch_config_pdu_0_0->transform_precoding == transform_precoder_disabled)
pusch_config_pdu_0_0->mcs_table = get_pusch_mcs_table(pusch_config->mcs_Table, 0,
......@@ -3340,9 +3378,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
/* MCS TABLE */
if (pusch_config->transformPrecoder == NULL) {
if (mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL)
pusch_config_pdu_0_1->transform_precoding = 1;
pusch_config_pdu_0_1->transform_precoding = transform_precoder_disabled;
else
pusch_config_pdu_0_1->transform_precoding = 0;
pusch_config_pdu_0_1->transform_precoding = transform_precoder_enabled;
}
else
pusch_config_pdu_0_1->transform_precoding = *pusch_config->transformPrecoder;
......@@ -3456,14 +3494,58 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
}
}
}
/*-------------------- Changed to enable Transform precoding in RF SIM------------------------------------------------*/
NR_DMRS_UplinkConfig_t *NR_DMRS_ulconfig = NULL;
if (pusch_config_pdu_0_1->transform_precoding == transform_precoder_enabled) {
mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.transform_precoder = transform_precoder_enabled;
if(pusch_config->dmrs_UplinkForPUSCH_MappingTypeA != NULL) {
NR_DMRS_ulconfig = pusch_config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup;
if (NR_DMRS_ulconfig->dmrs_Type == NULL)
mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_a.dmrs_type = 1;
if (NR_DMRS_ulconfig->maxLength == NULL)
mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_a.max_length = 1;
} else if(pusch_config->dmrs_UplinkForPUSCH_MappingTypeB != NULL) {
NR_DMRS_ulconfig = pusch_config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
if (NR_DMRS_ulconfig->dmrs_Type == NULL)
mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_b.dmrs_type = 1;
if (NR_DMRS_ulconfig->maxLength == NULL)
mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_b.max_length = 1;
}
} else
mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.transform_precoder = transform_precoder_disabled;
// mapping type b configured from RRC. TBD: Mapping type b is not handled in this function.
if ((mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.transform_precoder == transform_precoder_enabled) &&
(mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_b.dmrs_type == 1) &&
(mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_b.max_length == 1)) { // tables 7.3.1.1.2-6
pusch_config_pdu_0_1->num_dmrs_cdm_grps_no_data = 2;
pusch_config_pdu_0_1->dmrs_ports = dci->antenna_ports.val;
}
/*-------------------- ---------------------------------------------------------------------------------------------------------------*/
/* ANTENNA_PORTS */
uint8_t rank=0; // We need to initialize rank FIXME!!!
if ((mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.transform_precoder == transform_precoder_enabled) &&
(mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_a.dmrs_type == 1) &&
(mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_a.max_length == 1)) { // tables 7.3.1.1.2-6
pusch_config_pdu_0_1->num_dmrs_cdm_grps_no_data = 2; //TBC
pusch_config_pdu_0_1->dmrs_ports = dci->antenna_ports.val; //TBC
}
if ((mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.transform_precoder == transform_precoder_enabled) &&
(mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_a.dmrs_type == 1) &&
(mac->phy_config.config_req.ul_bwp_dedicated.pusch_config_dedicated.dmrs_ul_for_pusch_mapping_type_a.max_length == 2)) { // tables 7.3.1.1.2-7
......
......@@ -218,7 +218,6 @@ void nr_save_pusch_fields(const NR_ServingCellConfigCommon_t *scc,
{
ps->dci_format = dci_format;
ps->time_domain_allocation = tda;
ps->num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data;
const struct NR_PUSCH_TimeDomainResourceAllocationList *tdaList =
ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
......@@ -240,13 +239,17 @@ void nr_save_pusch_fields(const NR_ServingCellConfigCommon_t *scc,
NR_RNTI_C,
target_ss,
false);
else
else {
ps->mcs_table = get_pusch_mcs_table(ps->pusch_Config->mcs_TableTransformPrecoder,
1,
ps->dci_format,
NR_RNTI_C,
target_ss,
false);
num_dmrs_cdm_grps_no_data = 2; // in case of transform precoding - no Data sent in DMRS symbol
}
ps->num_dmrs_cdm_grps_no_data = num_dmrs_cdm_grps_no_data;
/* DMRS calculations */
ps->mapping_type = tdaList->list.array[tda]->mappingType;
......
......@@ -742,6 +742,25 @@ void nr_schedule_ulsch(module_id_t module_id,
pusch_pdu->pusch_data.tb_size = sched_pusch->tb_size;
pusch_pdu->pusch_data.num_cb = 0; //CBG not supported
/* TRANSFORM PRECODING --------------------------------------------------------*/
if (pusch_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled){
// U as specified in section 6.4.1.1.1.2 in 38.211, if sequence hopping and group hopping are disabled
pusch_pdu->dfts_ofdm.low_papr_group_number = pusch_pdu->pusch_identity % 30;
// V as specified in section 6.4.1.1.1.2 in 38.211 V = 0 if sequence hopping and group hopping are disabled
if ((ps->NR_DMRS_UplinkConfig->transformPrecodingEnabled->sequenceGroupHopping == NULL) &&
(ps->NR_DMRS_UplinkConfig->transformPrecodingEnabled->sequenceHopping == NULL))
pusch_pdu->dfts_ofdm.low_papr_sequence_number = 0;
else
AssertFatal(1==0,"SequenceGroupHopping or sequenceHopping are NOT Supported\n");
LOG_D(NR_MAC,"TRANSFORM PRECODING IS ENABLED. CDM groups: %d, U: %d MCS table: %d\n", pusch_pdu->num_dmrs_cdm_grps_no_data, pusch_pdu->dfts_ofdm.low_papr_group_number, ps->mcs_table);
}
/*-----------------------------------------------------------------------------*/
/* PUSCH PTRS */
if (ps->NR_DMRS_UplinkConfig->phaseTrackingRS != NULL) {
// TODO to be fixed from RRC config
......
......@@ -794,8 +794,12 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
pusch_Config->pusch_AggregationFactor=NULL;
pusch_Config->mcs_Table=NULL;
pusch_Config->mcs_TableTransformPrecoder=NULL;
pusch_Config->transformPrecoder=calloc(1,sizeof(*pusch_Config->transformPrecoder));
*pusch_Config->transformPrecoder = NR_PUSCH_Config__transformPrecoder_disabled;
pusch_Config->transformPrecoder= NULL;
/* if msg3_transformprecoding is set in conf file - pusch config should not disable it */
if (servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) {
pusch_Config->transformPrecoder=calloc(1,sizeof(*pusch_Config->transformPrecoder));
*pusch_Config->transformPrecoder = NR_PUSCH_Config__transformPrecoder_disabled;
}
pusch_Config->codebookSubset=calloc(1,sizeof(*pusch_Config->codebookSubset));
*pusch_Config->codebookSubset = NR_PUSCH_Config__codebookSubset_nonCoherent;
pusch_Config->maxRank=calloc(1,sizeof(*pusch_Config->maxRank));
......@@ -804,6 +808,39 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
pusch_Config->uci_OnPUSCH=NULL;
pusch_Config->tp_pi2BPSK=NULL;
/*------------------------------TRANSFORM PRECODING- -----------------------------------------------------------------------*/
uint8_t transform_precoding = NR_PUSCH_Config__transformPrecoder_disabled;
// TBD: configure this from .conf file, Dedicated params cannot yet be configured in .conf file.
// Enable this to test transform precoding enabled from dedicated config.
/*if (pusch_Config->transformPrecoder == NULL)
pusch_Config->transformPrecoder=calloc(1,sizeof(*pusch_Config->transformPrecoder));
*pusch_Config->transformPrecoder = NR_PUSCH_Config__transformPrecoder_enabled; */
// END -------
if (pusch_Config->transformPrecoder == NULL) {
if (servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder != NULL)
transform_precoding = NR_PUSCH_Config__transformPrecoder_enabled;
}
else
transform_precoding = *pusch_Config->transformPrecoder;
if (transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled ) {
/* Enable DMRS uplink config for transform precoding enabled */
NR_DMRS_UplinkConfig->transformPrecodingEnabled = calloc(1,sizeof(*NR_DMRS_UplinkConfig->transformPrecodingEnabled));
NR_DMRS_UplinkConfig->transformPrecodingEnabled->nPUSCH_Identity = NULL;
NR_DMRS_UplinkConfig->transformPrecodingEnabled->sequenceGroupHopping = NULL;
NR_DMRS_UplinkConfig->transformPrecodingEnabled->sequenceHopping = NULL;
NR_DMRS_UplinkConfig->transformPrecodingEnabled->ext1 = NULL;
LOG_I(RRC,"TRANSFORM PRECODING ENABLED......\n");
}
/*----------------------------------------------------------------------------------------------------------------------------*/
initialUplinkBWP->srs_Config = calloc(1,sizeof(*initialUplinkBWP->srs_Config));
initialUplinkBWP->srs_Config->present = NR_SetupRelease_SRS_Config_PR_setup;
NR_SRS_Config_t *srs_Config = calloc(1,sizeof(*srs_Config));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment