Commit 334bf336 authored by Parminder Singh's avatar Parminder Singh Committed by Thomas Schlichter

Updated TBS calculation for multiple DMRS positions in a slot

- TBS calculation was done wothout considering mulilple DMRS symbols in
  a slot, which is corrected now.
parent d7d2faa0
...@@ -2122,6 +2122,10 @@ int get_num_dmrs(uint16_t dmrs_mask ) { ...@@ -2122,6 +2122,10 @@ int get_num_dmrs(uint16_t dmrs_mask ) {
for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1); for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1);
return(num_dmrs); return(num_dmrs);
} }
/* returns the total DMRS symbols in a slot*/
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols){
return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols));
}
// Table 5.1.2.2.1-1 38.214 // Table 5.1.2.2.1-1 38.214
uint8_t getRBGSize(uint16_t bwp_size, long rbg_size_config) { uint8_t getRBGSize(uint16_t bwp_size, long rbg_size_config) {
......
...@@ -185,4 +185,7 @@ bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config, ...@@ -185,4 +185,7 @@ bool set_dl_ptrs_values(NR_PTRS_DownlinkConfig_t *ptrs_config,
uint8_t *K_ptrs, uint8_t *L_ptrs,uint8_t *portIndex, uint8_t *K_ptrs, uint8_t *L_ptrs,uint8_t *portIndex,
uint8_t *nERatio,uint8_t *reOffset, uint8_t *nERatio,uint8_t *reOffset,
uint8_t NrOfSymbols); uint8_t NrOfSymbols);
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
#endif #endif
...@@ -504,6 +504,9 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id, ...@@ -504,6 +504,9 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData); getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData);
int nrOfSymbols = getNrOfSymbols(sched_ctrl->active_bwp, int nrOfSymbols = getNrOfSymbols(sched_ctrl->active_bwp,
sched_ctrl->time_domain_allocation); sched_ctrl->time_domain_allocation);
uint8_t N_DMRS_SLOT = get_num_dmrs_symbols(sched_ctrl->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup,
RC.nrmac[module_id]->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position ,
nrOfSymbols);
int rbSize = 0; int rbSize = 0;
const int oh = 2 + (sched_ctrl->num_total_bytes >= 256) const int oh = 2 + (sched_ctrl->num_total_bytes >= 256)
...@@ -515,8 +518,7 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id, ...@@ -515,8 +518,7 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx), nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
rbSize, rbSize,
nrOfSymbols, nrOfSymbols,
N_PRB_DMRS, // FIXME // This should be multiplied by the N_PRB_DMRS * N_DMRS_SLOT,
// number of dmrs symbols
0 /* N_PRB_oh, 0 for initialBWP */, 0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */, 0 /* tb_scaling */,
1 /* nrOfLayers */) 1 /* nrOfLayers */)
...@@ -574,13 +576,16 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -574,13 +576,16 @@ void nr_schedule_ue_spec(module_id_t module_id,
uint8_t N_PRB_DMRS = uint8_t N_PRB_DMRS =
getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData); getN_PRB_DMRS(sched_ctrl->active_bwp, sched_ctrl->numDmrsCdmGrpsNoData);
uint8_t N_DMRS_SLOT = get_num_dmrs_symbols(sched_ctrl->active_bwp->bwp_Dedicated->pdsch_Config->choice.setup,
RC.nrmac[module_id]->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position ,
nrOfSymbols);
const uint32_t TBS = const uint32_t TBS =
nr_compute_tbs(nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx), nr_compute_tbs(nr_get_Qm_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx), nr_get_code_rate_dl(sched_ctrl->mcs, sched_ctrl->mcsTableIdx),
sched_ctrl->rbSize, sched_ctrl->rbSize,
nrOfSymbols, nrOfSymbols,
N_PRB_DMRS, // FIXME // This should be multiplied by the N_PRB_DMRS * N_DMRS_SLOT,
// number of dmrs symbols
0 /* N_PRB_oh, 0 for initialBWP */, 0 /* N_PRB_oh, 0 for initialBWP */,
0 /* tb_scaling */, 0 /* tb_scaling */,
1 /* nrOfLayers */) 1 /* nrOfLayers */)
......
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