Commit ee207981 authored by francescomani's avatar francescomani

handling dl dmrs ports at mac and other modifications for semi static parameters for dlsch

parent ed54f598
...@@ -273,8 +273,8 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -273,8 +273,8 @@ void nr_dlsim_preprocessor(module_id_t module_id,
/* the following might override the table that is mandated by RRC /* the following might override the table that is mandated by RRC
* configuration */ * configuration */
ps->mcsTableIdx = g_mcsTableIdx; ps->mcsTableIdx = g_mcsTableIdx;
ps->nrOfLayers = g_nrOfLayers;
sched_pdsch->nrOfLayers = g_nrOfLayers;
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); 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->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm, sched_pdsch->tb_size = nr_compute_tbs(sched_pdsch->Qm,
......
...@@ -453,8 +453,6 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -453,8 +453,6 @@ bool allocate_dl_retransmission(module_id_t module_id,
int rbStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); int rbStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2);
int rbSize = 0; int rbSize = 0;
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
...@@ -474,9 +472,8 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -474,9 +472,8 @@ bool allocate_dl_retransmission(module_id_t module_id,
} }
/* check whether we need to switch the TDA allocation since the last /* check whether we need to switch the TDA allocation since the last
* (re-)transmission */ * (re-)transmission */
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) if (ps->time_domain_allocation != tda || ps->nrOfLayers != UE_info->layers[UE_id])
nr_set_pdsch_semi_static( nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps);
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
} else { } else {
/* the retransmission will use a different time domain allocation, check /* the retransmission will use a different time domain allocation, check
* that we have enough resources */ * that we have enough resources */
...@@ -485,13 +482,12 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -485,13 +482,12 @@ bool allocate_dl_retransmission(module_id_t module_id,
while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize]) while (rbStart + rbSize < bwpSize && rballoc_mask[rbStart + rbSize])
rbSize++; rbSize++;
NR_pdsch_semi_static_t temp_ps; NR_pdsch_semi_static_t temp_ps;
nr_set_pdsch_semi_static( nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, &temp_ps);
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, &temp_ps);
uint32_t new_tbs; uint32_t new_tbs;
uint16_t new_rbSize; uint16_t new_rbSize;
bool success = nr_find_nb_rb(retInfo->Qm, bool success = nr_find_nb_rb(retInfo->Qm,
retInfo->R, retInfo->R,
retInfo->nrOfLayers, temp_ps.nrOfLayers,
temp_ps.nrOfSymbols, temp_ps.nrOfSymbols,
temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT, temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT,
retInfo->tb_size, retInfo->tb_size,
...@@ -603,7 +599,7 @@ void pf_dl(module_id_t module_id, ...@@ -603,7 +599,7 @@ void pf_dl(module_id_t module_id,
/* Calculate coeff */ /* Calculate coeff */
set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx); set_dl_mcs(sched_pdsch,sched_ctrl,ps->mcsTableIdx);
set_dl_nrOfLayers(sched_pdsch,sched_ctrl); UE_info->layers[UE_id] = set_dl_nrOfLayers(sched_ctrl);
const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
uint32_t tbs = nr_compute_tbs(Qm, uint32_t tbs = nr_compute_tbs(Qm,
...@@ -613,7 +609,7 @@ void pf_dl(module_id_t module_id, ...@@ -613,7 +609,7 @@ void pf_dl(module_id_t module_id,
0, /* N_PRB_DMRS * N_DMRS_SLOT */ 0, /* N_PRB_DMRS * N_DMRS_SLOT */
0 /* N_PRB_oh, 0 for initialBWP */, 0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */, 0 /* tb_scaling */,
sched_pdsch->nrOfLayers) >> 3; UE_info->layers[UE_id]) >> 3;
coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id]; coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id];
LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n", LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n",
b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]); b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]);
...@@ -691,10 +687,9 @@ void pf_dl(module_id_t module_id, ...@@ -691,10 +687,9 @@ void pf_dl(module_id_t module_id,
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1; const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch; NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats; if (ps->nrOfLayers != UE_info->layers[UE_id] ||
const uint8_t num_dmrs_cdm_grps_no_data = sched_ctrl->active_bwp ? (f ? 1 : (ps->nrOfSymbols == 2 ? 1 : 2)) : (ps->nrOfSymbols == 2 ? 1 : 2); ps->time_domain_allocation != tda)
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, UE_info->layers[UE_id], sched_ctrl, ps);
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); 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->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
sched_pdsch->pucch_allocation = alloc; sched_pdsch->pucch_allocation = alloc;
...@@ -704,7 +699,7 @@ void pf_dl(module_id_t module_id, ...@@ -704,7 +699,7 @@ void pf_dl(module_id_t module_id,
+ 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024); + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024);
nr_find_nb_rb(sched_pdsch->Qm, nr_find_nb_rb(sched_pdsch->Qm,
sched_pdsch->R, sched_pdsch->R,
sched_pdsch->nrOfLayers, ps->nrOfLayers,
ps->nrOfSymbols, ps->nrOfSymbols,
ps->N_PRB_DMRS * ps->N_DMRS_SLOT, ps->N_PRB_DMRS * ps->N_DMRS_SLOT,
sched_ctrl->num_total_bytes + oh, sched_ctrl->num_total_bytes + oh,
...@@ -829,17 +824,17 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -829,17 +824,17 @@ void nr_schedule_ue_spec(module_id_t module_id,
const rnti_t rnti = UE_info->rnti[UE_id]; const rnti_t rnti = UE_info->rnti[UE_id];
/* POST processing */
const uint8_t nrOfLayers = sched_pdsch->nrOfLayers;
const uint16_t R = sched_pdsch->R;
const uint8_t Qm = sched_pdsch->Qm;
const uint32_t TBS = sched_pdsch->tb_size;
/* pre-computed PDSCH values that only change if time domain /* pre-computed PDSCH values that only change if time domain
* allocation/DMRS parameters change. Updated in the preprocessor through * allocation/DMRS parameters change. Updated in the preprocessor through
* nr_set_pdsch_semi_static() */ * nr_set_pdsch_semi_static() */
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
/* POST processing */
const uint8_t nrOfLayers = ps->nrOfLayers;
const uint16_t R = sched_pdsch->R;
const uint8_t Qm = sched_pdsch->Qm;
const uint32_t TBS = sched_pdsch->tb_size;
int8_t current_harq_pid = sched_pdsch->dl_harq_pid; int8_t current_harq_pid = sched_pdsch->dl_harq_pid;
if (current_harq_pid < 0) { if (current_harq_pid < 0) {
/* PP has not selected a specific HARQ Process, get a new one */ /* PP has not selected a specific HARQ Process, get a new one */
...@@ -949,7 +944,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -949,7 +944,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
pdsch_pdu->dlDmrsScramblingId = *scc->physCellId; pdsch_pdu->dlDmrsScramblingId = *scc->physCellId;
pdsch_pdu->SCID = 0; pdsch_pdu->SCID = 0;
pdsch_pdu->numDmrsCdmGrpsNoData = ps->numDmrsCdmGrpsNoData; pdsch_pdu->numDmrsCdmGrpsNoData = ps->numDmrsCdmGrpsNoData;
pdsch_pdu->dmrsPorts = 1; pdsch_pdu->dmrsPorts = (1<<nrOfLayers)-1; // FIXME with a better implementation
// Pdsch Allocation in frequency domain // Pdsch Allocation in frequency domain
pdsch_pdu->resourceAlloc = 1; pdsch_pdu->resourceAlloc = 1;
...@@ -1031,7 +1026,7 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1031,7 +1026,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
dci_payload.tpc = sched_ctrl->tpc1; // TPC for PUCCH: table 7.2.1-1 in 38.213 dci_payload.tpc = sched_ctrl->tpc1; // TPC for PUCCH: table 7.2.1-1 in 38.213
dci_payload.pucch_resource_indicator = pucch->resource_indicator; dci_payload.pucch_resource_indicator = pucch->resource_indicator;
dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI dci_payload.pdsch_to_harq_feedback_timing_indicator.val = pucch->timing_indicator; // PDSCH to HARQ TI
dci_payload.antenna_ports.val = 0; // nb of cdm groups w/o data 1 and dmrs port 0 dci_payload.antenna_ports.val = ps->dmrs_ports_id;
dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID; dci_payload.dmrs_sequence_initialization.val = pdsch_pdu->SCID;
LOG_D(NR_MAC, LOG_D(NR_MAC,
"%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), " "%4d.%2d DCI type 1 payload: freq_alloc %d (%d,%d,%d), "
......
...@@ -365,12 +365,10 @@ void nr_preprocessor_phytest(module_id_t module_id, ...@@ -365,12 +365,10 @@ void nr_preprocessor_phytest(module_id_t module_id,
sched_pdsch->rbStart = rbStart; sched_pdsch->rbStart = rbStart;
sched_pdsch->rbSize = rbSize; 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 int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
const uint8_t num_dmrs_cdm_grps_no_data = 1; int nrOfLayers = 1;
if (ps->time_domain_allocation != tda || ps->numDmrsCdmGrpsNoData != num_dmrs_cdm_grps_no_data) if (ps->time_domain_allocation != tda || ps->nrOfLayers != nrOfLayers)
nr_set_pdsch_semi_static( nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, nrOfLayers, sched_ctrl, ps);
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, tda, num_dmrs_cdm_grps_no_data, ps);
sched_pdsch->nrOfLayers = 1;
sched_pdsch->mcs = target_dl_mcs; sched_pdsch->mcs = target_dl_mcs;
sched_pdsch->Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx); 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->R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
...@@ -381,7 +379,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ...@@ -381,7 +379,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
ps->N_PRB_DMRS * ps->N_DMRS_SLOT, ps->N_PRB_DMRS * ps->N_DMRS_SLOT,
0 /* N_PRB_oh, 0 for initialBWP */, 0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */, 0 /* tb_scaling */,
sched_pdsch->nrOfLayers) ps->nrOfLayers)
>> 3; >> 3;
/* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */ /* get the PID of a HARQ process awaiting retransmission, or -1 otherwise */
......
...@@ -137,12 +137,11 @@ static inline uint8_t get_max_cces(uint8_t scs) { ...@@ -137,12 +137,11 @@ static inline uint8_t get_max_cces(uint8_t scs) {
} }
void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl) {
NR_UE_sched_ctrl_t *sched_ctrl) {
// for now this should be enough // TODO check this but it should be enough for now
// if there is not csi report RI is 0 from initialization // if there is not csi report RI is 0 from initialization
sched_pdsch->nrOfLayers = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1; return (sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1);
} }
...@@ -193,6 +192,36 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, ...@@ -193,6 +192,36 @@ void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch,
} }
} }
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
//TODO first basic implementation of dmrs port selection
// only vaild for a single codeword
// for now it assumes a selection of Nl consecutive dmrs ports
// and a single front loaded symbol
// dmrs_ports_id is the index of Tables 7.3.1.2.2-1/2/3/4
switch (ps->nrOfLayers) {
case 1:
ps->dmrs_ports_id = 0;
ps->numDmrsCdmGrpsNoData = 1;
break;
case 2:
ps->dmrs_ports_id = 2;
ps->numDmrsCdmGrpsNoData = 1;
break;
case 3:
ps->dmrs_ports_id = 9;
ps->numDmrsCdmGrpsNoData = 2;
break;
case 4:
ps->dmrs_ports_id = 10;
ps->numDmrsCdmGrpsNoData = 2;
break;
default:
AssertFatal(1==0,"Number of layers %d\n not supported or not valid\n",ps->nrOfLayers);
}
}
NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc, NR_ControlResourceSet_t *get_coreset(NR_ServingCellConfigCommon_t *scc,
NR_BWP_Downlink_t *bwp, NR_BWP_Downlink_t *bwp,
NR_SearchSpace_t *ss, NR_SearchSpace_t *ss,
...@@ -341,20 +370,11 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -341,20 +370,11 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
const NR_CellGroupConfig_t *secondaryCellGroup, const NR_CellGroupConfig_t *secondaryCellGroup,
const NR_BWP_Downlink_t *bwp, const NR_BWP_Downlink_t *bwp,
int tda, int tda,
uint8_t num_dmrs_cdm_grps_no_data, uint8_t layers,
NR_UE_sched_ctrl_t *sched_ctrl,
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;
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;
SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
ps->mcsTableIdx = 0;
if (bwp && if (bwp &&
bwp->bwp_Dedicated && bwp->bwp_Dedicated &&
bwp->bwp_Dedicated->pdsch_Config && bwp->bwp_Dedicated->pdsch_Config &&
...@@ -367,14 +387,57 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -367,14 +387,57 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
} }
else ps->mcsTableIdx = 0; else ps->mcsTableIdx = 0;
ps->numDmrsCdmGrpsNoData = num_dmrs_cdm_grps_no_data; NR_PDSCH_Config_t *pdsch_Config;
ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0; if (bwp &&
bwp->bwp_Dedicated &&
bwp->bwp_Dedicated->pdsch_Config &&
bwp->bwp_Dedicated->pdsch_Config->choice.setup)
pdsch_Config = bwp->bwp_Dedicated->pdsch_Config->choice.setup;
else
pdsch_Config = NULL;
// if no data in dmrs cdm group is 1 only even REs have no data if (ps->time_domain_allocation != tda) {
// if no data in dmrs cdm group is 2 both odd and even REs have no data ps->time_domain_allocation = tda;
ps->N_PRB_DMRS = num_dmrs_cdm_grps_no_data * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4); const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ?
ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwp ? bwp->bwp_Dedicated->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type); bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList :
scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
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) {
if (ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB)
ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type == NULL ? 0 : 1;
else
ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
}
else
ps->dmrsConfigType = NFAPI_NR_DMRS_TYPE1;
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
ps->dl_dmrs_symb_pos = fill_dmrs_mask(pdsch_Config, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type);
ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos); ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos);
}
const long dci_format = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
if (dci_format == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0 ||
pdsch_Config == NULL) {
if (ps->nrOfSymbols == 2 && ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB)
ps->numDmrsCdmGrpsNoData = 1;
else {
if (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1)
ps->numDmrsCdmGrpsNoData = 2;
else
ps->numDmrsCdmGrpsNoData = 3;
}
ps->dmrs_ports_id = 0;
}
else {
if (ps->nrOfLayers != layers) {
ps->nrOfLayers = layers;
set_dl_dmrs_ports(ps);
}
}
ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
} }
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
......
...@@ -273,7 +273,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc, ...@@ -273,7 +273,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
const NR_CellGroupConfig_t *secondaryCellGroup, const NR_CellGroupConfig_t *secondaryCellGroup,
const NR_BWP_Downlink_t *bwp, const NR_BWP_Downlink_t *bwp,
int tda, int tda,
uint8_t num_dmrs_cdm_grps_no_data, uint8_t layers,
NR_UE_sched_ctrl_t *sched_ctrl,
NR_pdsch_semi_static_t *ps); NR_pdsch_semi_static_t *ps);
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc, void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
...@@ -415,12 +416,13 @@ int16_t ssb_index_from_prach(module_id_t module_idP, ...@@ -415,12 +416,13 @@ int16_t ssb_index_from_prach(module_id_t module_idP,
void find_SSB_and_RO_available(module_id_t module_idP); void find_SSB_and_RO_available(module_id_t module_idP);
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps);
void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch, void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch,
NR_UE_sched_ctrl_t *sched_ctrl, NR_UE_sched_ctrl_t *sched_ctrl,
uint8_t mcs_table_idx); uint8_t mcs_table_idx);
void set_dl_nrOfLayers(NR_sched_pdsch_t *sched_pdsch, uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl);
NR_UE_sched_ctrl_t *sched_ctrl);
void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp); void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp);
void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp); void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp);
......
...@@ -362,12 +362,12 @@ typedef struct NR_sched_pusch { ...@@ -362,12 +362,12 @@ typedef struct NR_sched_pusch {
typedef struct NR_pdsch_semi_static { typedef struct NR_pdsch_semi_static {
int time_domain_allocation; int time_domain_allocation;
uint8_t numDmrsCdmGrpsNoData; uint8_t numDmrsCdmGrpsNoData;
int mapping_type;
int startSymbolIndex; int startSymbolIndex;
int nrOfSymbols; int nrOfSymbols;
uint8_t nrOfLayers;
uint8_t mcsTableIdx; uint8_t mcsTableIdx;
uint8_t dmrs_ports_id;
uint8_t N_PRB_DMRS; uint8_t N_PRB_DMRS;
uint8_t N_DMRS_SLOT; uint8_t N_DMRS_SLOT;
uint16_t dl_dmrs_symb_pos; uint16_t dl_dmrs_symb_pos;
...@@ -383,7 +383,6 @@ typedef struct NR_sched_pdsch { ...@@ -383,7 +383,6 @@ typedef struct NR_sched_pdsch {
uint8_t mcs; uint8_t mcs;
/// TBS-related info /// TBS-related info
uint8_t nrOfLayers;
uint16_t R; uint16_t R;
uint8_t Qm; uint8_t Qm;
uint32_t tb_size; uint32_t tb_size;
...@@ -626,7 +625,7 @@ typedef struct { ...@@ -626,7 +625,7 @@ typedef struct {
NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB]; NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB];
NR_list_t list; NR_list_t list;
int num_UEs; int num_UEs;
int layers[MAX_MOBILES_PER_GNB];
bool active[MAX_MOBILES_PER_GNB]; bool active[MAX_MOBILES_PER_GNB];
rnti_t rnti[MAX_MOBILES_PER_GNB]; rnti_t rnti[MAX_MOBILES_PER_GNB];
NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB]; NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB];
......
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