Merge remote-tracking branch 'origin/count_bits_with_mask' into integration_2025_w30 (!3532)
Count bits in variable with mask Adding a function to count bit using a mask to set starting and ending point in the variable
This commit is contained in:
@@ -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 number_of_symbols = pusch_config_pdu->nr_of_symbols;
|
||||
int number_dmrs_symbols = 0;
|
||||
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 number_dmrs_symbols = count_bits64_with_mask(pusch_config_pdu->ul_dmrs_symb_pos, start_symbol, number_of_symbols);
|
||||
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;
|
||||
|
||||
|
||||
@@ -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->qam_mod_order = nr_get_Qm_dl(pusch_pdu->mcs_index, pusch_pdu->mcs_table);
|
||||
|
||||
int num_dmrs_symb = 0;
|
||||
for (int i = 10; i < 10 + 3; i++)
|
||||
num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1;
|
||||
int num_dmrs_symb = count_bits64_with_mask(pusch_pdu->ul_dmrs_symb_pos, 10, 3);
|
||||
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);
|
||||
pusch_pdu->target_code_rate = R;
|
||||
@@ -820,9 +818,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];
|
||||
|
||||
NR_pusch_dmrs_t dmrs_info = get_ul_dmrs_params(scc, ul_bwp, &tda_info, 1);
|
||||
int num_dmrs_symb = 0;
|
||||
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 num_dmrs_symb = count_bits64_with_mask(dmrs_info.ul_dmrs_symb_pos, tda_info.startSymbolIndex, tda_info.nrOfSymbols);
|
||||
int TBS = 0, mcsindex = 0, R = 0, Qm = 0;
|
||||
while(TBS < 7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented)
|
||||
mcsindex++;
|
||||
@@ -1157,9 +1153,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_pusch_dmrs_t dmrs_info = get_ul_dmrs_params(scc, ul_bwp, &tda_info, 1);
|
||||
int num_dmrs_symb = 0;
|
||||
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 num_dmrs_symb = count_bits64_with_mask(dmrs_info.ul_dmrs_symb_pos, tda_info.startSymbolIndex, tda_info.nrOfSymbols);
|
||||
int TBS = 0, mcsindex = 0, R = 0, Qm = 0;
|
||||
while(TBS < 7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented)
|
||||
mcsindex++;
|
||||
|
||||
@@ -762,10 +762,7 @@ NR_pusch_dmrs_t get_ul_dmrs_params(const NR_ServingCellConfigCommon_t *scc,
|
||||
tda_info->startSymbolIndex,
|
||||
scc->dmrs_TypeA_Position);
|
||||
|
||||
uint8_t num_dmrs_symb = 0;
|
||||
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.num_dmrs_symb = count_bits64_with_mask(dmrs.ul_dmrs_symb_pos, tda_info->startSymbolIndex, tda_info->nrOfSymbols);
|
||||
dmrs.N_PRB_DMRS = dmrs.num_dmrs_cdm_grps_no_data * (dmrs.dmrs_config_type == 0 ? 6 : 4);
|
||||
return dmrs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user