Commit 7db8dce5 authored by francescomani's avatar francescomani

fixes for allowing softmodem to schedule PUSCH with transform precoding

parent bf03abae
......@@ -602,7 +602,7 @@ typedef struct NR_UE_UL_BWP {
NR_CSI_MeasConfig_t *csi_MeasConfig;
NR_SRS_Config_t *srs_Config;
long *msg3_DeltaPreamble;
uint8_t transform_precoding;
long *transform_precoding;
uint8_t mcs_table;
nr_dci_format_t dci_format;
int max_fb_time;
......
......@@ -1016,9 +1016,14 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
pusch_pdu->cyclic_prefix = 0;
pusch_pdu->mcs_table = 0;
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL)
pusch_pdu->transform_precoding = 1;
else
pusch_pdu->transform_precoding = 0;
pusch_pdu->transform_precoding = 1; // disabled
else {
pusch_pdu->transform_precoding = 0; // enabled
pusch_pdu->dfts_ofdm.low_papr_group_number = *scc->physCellId % 30;
pusch_pdu->dfts_ofdm.low_papr_sequence_number = 0;
if (scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding)
AssertFatal(1==0,"Hopping mode is not supported in transform precoding\n");
}
pusch_pdu->data_scrambling_id = *scc->physCellId;
pusch_pdu->nrOfLayers = 1;
pusch_pdu->ul_dmrs_symb_pos = get_l_prime(nr_of_symbols,mappingtype,pusch_dmrs_pos2,pusch_len1,start_symbol_index, scc->dmrs_TypeA_Position);
......
......@@ -2173,11 +2173,6 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
UL_BWP->initial_BWPSize = NRRIV2BW(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
UL_BWP->initial_BWPStart = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
if (UL_BWP->pusch_Config == NULL || !UL_BWP->pusch_Config->transformPrecoder)
UL_BWP->transform_precoding = !scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder;
else
UL_BWP->transform_precoding = *UL_BWP->pusch_Config->transformPrecoder;
if (UL_BWP->bwp_id > 0) {
UL_BWP->pucch_ConfigCommon = ul_bwp->bwp_Common->pucch_ConfigCommon ? ul_bwp->bwp_Common->pucch_ConfigCommon->choice.setup : NULL;
UL_BWP->rach_ConfigCommon = ul_bwp->bwp_Common->rach_ConfigCommon ? ul_bwp->bwp_Common->rach_ConfigCommon->choice.setup : NULL;
......@@ -2263,14 +2258,23 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
long *dl_mcs_Table = DL_BWP->pdsch_Config ? DL_BWP->pdsch_Config->mcs_Table : NULL;
DL_BWP->mcsTableIdx = get_pdsch_mcs_table(dl_mcs_Table, DL_BWP->dci_format, NR_RNTI_C, target_ss);
long *ul_mcs_Table = NULL;
// 0 precoding enabled 1 precoding disabled
if (UL_BWP->dci_format == NR_UL_DCI_FORMAT_0_0 ||
UL_BWP->pusch_Config == NULL || UL_BWP->pusch_Config->transformPrecoder == NULL)
UL_BWP->transform_precoding = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder;
else
UL_BWP->transform_precoding = UL_BWP->pusch_Config->transformPrecoder;
// Set uplink MCS table
long *mcs_Table = NULL;
bool not_tp = (UL_BWP->transform_precoding == NULL || *UL_BWP->transform_precoding == 1);
if (UL_BWP->pusch_Config)
ul_mcs_Table = UL_BWP->transform_precoding ?
UL_BWP->pusch_Config->mcs_Table :
UL_BWP->pusch_Config->mcs_TableTransformPrecoder;
mcs_Table = not_tp ?
UL_BWP->pusch_Config->mcs_Table :
UL_BWP->pusch_Config->mcs_TableTransformPrecoder;
UL_BWP->mcs_table = get_pusch_mcs_table(ul_mcs_Table,
UL_BWP->transform_precoding ? 0 : 1,
UL_BWP->mcs_table = get_pusch_mcs_table(mcs_Table,
!not_tp,
UL_BWP->dci_format,
NR_RNTI_C,
target_ss,
......
......@@ -1041,7 +1041,7 @@ uint8_t get_max_tpmi(const NR_PUSCH_Config_t *pusch_Config,
void get_precoder_matrix_coef(char *w,
const uint8_t ul_ri,
const uint16_t num_ue_srs_ports,
const uint8_t transform_precoding,
const long *transform_precoding,
const uint8_t tpmi,
const uint8_t uI,
int layer_idx)
......@@ -1050,7 +1050,7 @@ void get_precoder_matrix_coef(char *w,
if (num_ue_srs_ports == 2) {
*w = table_38211_6_3_1_5_1[tpmi][uI][layer_idx];
} else {
if (transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled) {
if (transform_precoding && *transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled) {
*w = table_38211_6_3_1_5_2[tpmi][uI][layer_idx];
} else {
*w = table_38211_6_3_1_5_3[tpmi][uI][layer_idx];
......@@ -1068,7 +1068,7 @@ void get_precoder_matrix_coef(char *w,
}
int nr_srs_tpmi_estimation(const NR_PUSCH_Config_t *pusch_Config,
const uint8_t transform_precoding,
const long *transform_precoding,
const uint8_t *channel_matrix,
const uint8_t normalized_iq_representation,
const uint16_t num_gnb_antenna_elements,
......@@ -2149,7 +2149,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
pusch_pdu->qam_mod_order = sched_pusch->Qm;
pusch_pdu->mcs_index = sched_pusch->mcs;
pusch_pdu->mcs_table = current_BWP->mcs_table;
pusch_pdu->transform_precoding = current_BWP->transform_precoding;
pusch_pdu->transform_precoding = current_BWP->transform_precoding ? *current_BWP->transform_precoding : 1;
if (current_BWP->pusch_Config && current_BWP->pusch_Config->dataScramblingIdentityPUSCH)
pusch_pdu->data_scrambling_id = *current_BWP->pusch_Config->dataScramblingIdentityPUSCH;
else
......@@ -2174,7 +2174,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
}
else {
pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId;
if (NR_DMRS_UplinkConfig && NR_DMRS_UplinkConfig->transformPrecodingEnabled->nPUSCH_Identity != NULL)
if (NR_DMRS_UplinkConfig &&
NR_DMRS_UplinkConfig->transformPrecodingEnabled &&
NR_DMRS_UplinkConfig->transformPrecodingEnabled->nPUSCH_Identity != NULL)
pusch_pdu->pusch_identity = *NR_DMRS_UplinkConfig->transformPrecodingEnabled->nPUSCH_Identity;
else if (NR_DMRS_UplinkConfig)
pusch_pdu->pusch_identity = *scc->physCellId;
......@@ -2231,13 +2233,15 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
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 ((NR_DMRS_UplinkConfig==NULL) || ((NR_DMRS_UplinkConfig->transformPrecodingEnabled->sequenceGroupHopping == NULL) &&
(NR_DMRS_UplinkConfig->transformPrecodingEnabled->sequenceHopping == NULL)))
if ((!NR_DMRS_UplinkConfig ||
!NR_DMRS_UplinkConfig->transformPrecodingEnabled ||
(!NR_DMRS_UplinkConfig->transformPrecodingEnabled->sequenceGroupHopping && !NR_DMRS_UplinkConfig->transformPrecodingEnabled->sequenceHopping)) &&
!scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding)
pusch_pdu->dfts_ofdm.low_papr_sequence_number = 0;
else
AssertFatal(1==0,"SequenceGroupHopping or sequenceHopping are NOT Supported\n");
AssertFatal(1==0,"Hopping mode is not supported in transform precoding\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, current_BWP->mcs_table);
LOG_I(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, current_BWP->mcs_table);
}
/*-----------------------------------------------------------------------------*/
......
......@@ -1048,10 +1048,6 @@ struct NR_SetupRelease_PUSCH_Config *config_pusch(NR_PUSCH_Config_t *pusch_Confi
pusch_Config->mcs_Table = NULL;
pusch_Config->mcs_TableTransformPrecoder = NULL;
pusch_Config->transformPrecoder = NULL;
if (scc->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;
asn1cCallocOne(pusch_Config->maxRank, 1);
......
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