use function to count number of dmrs symbols
This commit is contained in:
@@ -821,10 +821,8 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
|||||||
AssertFatal(ulsch_harq != NULL, "harq_pid %d is not allocated\n", ulsch->harq_pid);
|
AssertFatal(ulsch_harq != NULL, "harq_pid %d is not allocated\n", ulsch->harq_pid);
|
||||||
if ((ulsch->active == true) && (ulsch->frame == frame_rx) && (ulsch->slot == slot_rx) && (ulsch->handled == 0)) {
|
if ((ulsch->active == true) && (ulsch->frame == frame_rx) && (ulsch->slot == slot_rx) && (ulsch->handled == 0)) {
|
||||||
LOG_D(PHY, "PUSCH ID %d with RNTI %x detection started in frame %d slot %d\n", ULSCH_id, ulsch->rnti, frame_rx, slot_rx);
|
LOG_D(PHY, "PUSCH ID %d with RNTI %x detection started in frame %d slot %d\n", ULSCH_id, ulsch->rnti, frame_rx, slot_rx);
|
||||||
|
nfapi_nr_pusch_pdu_t *pdu = &ulsch_harq->ulsch_pdu;
|
||||||
int num_dmrs = 0;
|
int num_dmrs = count_bits64_with_mask(pdu->ul_dmrs_symb_pos, 0, NR_NUMBER_OF_SYMBOLS_PER_SLOT);
|
||||||
for (int s = 0; s < NR_NUMBER_OF_SYMBOLS_PER_SLOT; s++)
|
|
||||||
num_dmrs += (ulsch_harq->ulsch_pdu.ul_dmrs_symb_pos >> s) & 1;
|
|
||||||
|
|
||||||
#ifdef DEBUG_RXDATA
|
#ifdef DEBUG_RXDATA
|
||||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||||
@@ -832,7 +830,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
|||||||
int slot_offset = frame_parms->get_samples_slot_timestamp(slot_rx, frame_parms, 0);
|
int slot_offset = frame_parms->get_samples_slot_timestamp(slot_rx, frame_parms, 0);
|
||||||
slot_offset -= ru->N_TA_offset;
|
slot_offset -= ru->N_TA_offset;
|
||||||
int32_t sample_offset = gNB->common_vars.debugBuff_sample_offset;
|
int32_t sample_offset = gNB->common_vars.debugBuff_sample_offset;
|
||||||
nfapi_nr_pusch_pdu_t *pdu = &ulsch_harq->ulsch_pdu;
|
|
||||||
int16_t *buf = (int16_t *)&gNB->common_vars.debugBuff[offset];
|
int16_t *buf = (int16_t *)&gNB->common_vars.debugBuff[offset];
|
||||||
buf[0] = (int16_t)ulsch->rnti;
|
buf[0] = (int16_t)ulsch->rnti;
|
||||||
buf[1] = (int16_t)pdu->rb_size;
|
buf[1] = (int16_t)pdu->rb_size;
|
||||||
|
|||||||
@@ -797,12 +797,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
|
|||||||
|
|
||||||
int start_symbol = pusch_config_pdu->start_symbol_index;
|
int start_symbol = pusch_config_pdu->start_symbol_index;
|
||||||
int number_of_symbols = pusch_config_pdu->nr_of_symbols;
|
int number_of_symbols = pusch_config_pdu->nr_of_symbols;
|
||||||
int number_dmrs_symbols = 0;
|
int number_dmrs_symbols = count_bits64_with_mask(pusch_config_pdu->ul_dmrs_symb_pos, start_symbol, number_of_symbols);
|
||||||
for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) {
|
|
||||||
if ((pusch_config_pdu->ul_dmrs_symb_pos >> i) & 0x01)
|
|
||||||
number_dmrs_symbols += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int nb_dmrs_re_per_rb =
|
int nb_dmrs_re_per_rb =
|
||||||
((pusch_config_pdu->dmrs_config_type == pusch_dmrs_type1) ? 6 : 4) * pusch_config_pdu->num_dmrs_cdm_grps_no_data;
|
((pusch_config_pdu->dmrs_config_type == pusch_dmrs_type1) ? 6 : 4) * pusch_config_pdu->num_dmrs_cdm_grps_no_data;
|
||||||
|
|
||||||
|
|||||||
@@ -293,9 +293,7 @@ static void schedule_nr_MsgA_pusch(NR_UplinkConfigCommon_t *uplinkConfigCommon,
|
|||||||
pusch_pdu->mcs_index = msgA_PUSCH_Resource->msgA_MCS_r16;
|
pusch_pdu->mcs_index = msgA_PUSCH_Resource->msgA_MCS_r16;
|
||||||
pusch_pdu->qam_mod_order = nr_get_Qm_dl(pusch_pdu->mcs_index, pusch_pdu->mcs_table);
|
pusch_pdu->qam_mod_order = nr_get_Qm_dl(pusch_pdu->mcs_index, pusch_pdu->mcs_table);
|
||||||
|
|
||||||
int num_dmrs_symb = 0;
|
int num_dmrs_symb = count_bits64_with_mask(pusch_pdu->ul_dmrs_symb_pos, 10, 3);
|
||||||
for (int i = 10; i < 10 + 3; i++)
|
|
||||||
num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1;
|
|
||||||
AssertFatal(pusch_pdu->mcs_index <= 28, "Exceeding MCS limit for MsgA PUSCH\n");
|
AssertFatal(pusch_pdu->mcs_index <= 28, "Exceeding MCS limit for MsgA PUSCH\n");
|
||||||
int R = nr_get_code_rate_ul(pusch_pdu->mcs_index, pusch_pdu->mcs_table);
|
int R = nr_get_code_rate_ul(pusch_pdu->mcs_index, pusch_pdu->mcs_table);
|
||||||
pusch_pdu->target_code_rate = R;
|
pusch_pdu->target_code_rate = R;
|
||||||
@@ -825,9 +823,7 @@ static void nr_generate_Msg3_retransmission(module_id_t module_idP,
|
|||||||
uint16_t *vrb_map_UL = &nr_mac->common_channels[CC_id].vrb_map_UL[beam_ul.idx][buffer_index * MAX_BWP_SIZE];
|
uint16_t *vrb_map_UL = &nr_mac->common_channels[CC_id].vrb_map_UL[beam_ul.idx][buffer_index * MAX_BWP_SIZE];
|
||||||
|
|
||||||
NR_pusch_dmrs_t dmrs_info = get_ul_dmrs_params(scc, ul_bwp, &tda_info, 1);
|
NR_pusch_dmrs_t dmrs_info = get_ul_dmrs_params(scc, ul_bwp, &tda_info, 1);
|
||||||
int num_dmrs_symb = 0;
|
int num_dmrs_symb = count_bits64_with_mask(dmrs_info.ul_dmrs_symb_pos, tda_info.startSymbolIndex, tda_info.nrOfSymbols);
|
||||||
for(int i = tda_info.startSymbolIndex; i < tda_info.startSymbolIndex + tda_info.nrOfSymbols; i++)
|
|
||||||
num_dmrs_symb += (dmrs_info.ul_dmrs_symb_pos >> i) & 1;
|
|
||||||
int TBS = 0, mcsindex = 0, R = 0, Qm = 0;
|
int TBS = 0, mcsindex = 0, R = 0, Qm = 0;
|
||||||
while(TBS < 7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented)
|
while(TBS < 7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented)
|
||||||
mcsindex++;
|
mcsindex++;
|
||||||
@@ -1162,9 +1158,7 @@ static void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, slot_
|
|||||||
|
|
||||||
NR_tda_info_t tda_info = get_ul_tda_info(ul_bwp, 0, NR_SearchSpace__searchSpaceType_PR_common, TYPE_TC_RNTI_, ra->Msg3_tda_id);
|
NR_tda_info_t tda_info = get_ul_tda_info(ul_bwp, 0, NR_SearchSpace__searchSpaceType_PR_common, TYPE_TC_RNTI_, ra->Msg3_tda_id);
|
||||||
NR_pusch_dmrs_t dmrs_info = get_ul_dmrs_params(scc, ul_bwp, &tda_info, 1);
|
NR_pusch_dmrs_t dmrs_info = get_ul_dmrs_params(scc, ul_bwp, &tda_info, 1);
|
||||||
int num_dmrs_symb = 0;
|
int num_dmrs_symb = count_bits64_with_mask(dmrs_info.ul_dmrs_symb_pos, tda_info.startSymbolIndex, tda_info.nrOfSymbols);
|
||||||
for(int i = tda_info.startSymbolIndex; i < tda_info.startSymbolIndex + tda_info.nrOfSymbols; i++)
|
|
||||||
num_dmrs_symb += (dmrs_info.ul_dmrs_symb_pos >> i) & 1;
|
|
||||||
int TBS = 0, mcsindex = 0, R = 0, Qm = 0;
|
int TBS = 0, mcsindex = 0, R = 0, Qm = 0;
|
||||||
while(TBS < 7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented)
|
while(TBS < 7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented)
|
||||||
mcsindex++;
|
mcsindex++;
|
||||||
|
|||||||
@@ -762,10 +762,7 @@ NR_pusch_dmrs_t get_ul_dmrs_params(const NR_ServingCellConfigCommon_t *scc,
|
|||||||
tda_info->startSymbolIndex,
|
tda_info->startSymbolIndex,
|
||||||
scc->dmrs_TypeA_Position);
|
scc->dmrs_TypeA_Position);
|
||||||
|
|
||||||
uint8_t num_dmrs_symb = 0;
|
dmrs.num_dmrs_symb = count_bits64_with_mask(dmrs.ul_dmrs_symb_pos, tda_info->startSymbolIndex, tda_info->nrOfSymbols);
|
||||||
for(int i = tda_info->startSymbolIndex; i < tda_info->startSymbolIndex + tda_info->nrOfSymbols; i++)
|
|
||||||
num_dmrs_symb += (dmrs.ul_dmrs_symb_pos >> i) & 1;
|
|
||||||
dmrs.num_dmrs_symb = num_dmrs_symb;
|
|
||||||
dmrs.N_PRB_DMRS = dmrs.num_dmrs_cdm_grps_no_data * (dmrs.dmrs_config_type == 0 ? 6 : 4);
|
dmrs.N_PRB_DMRS = dmrs.num_dmrs_cdm_grps_no_data * (dmrs.dmrs_config_type == 0 ? 6 : 4);
|
||||||
return dmrs;
|
return dmrs;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user