Remove second useless loop iteration in nr_ulsch_procedures()

Set the FAPI message in nr_ulschsim correctly in line with what
nr_ulsch_procedures() expected. Add an AssertFatal() to verify that the
assumed length of DMRS in the simulator and what is actually set in the
FAPI message matches. Finally, the internal nr_get_G() code (looping
over all PUSCH) does not double the DMRS because Nl == 3 || Nl == 4, so
harmonize in the simulator.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
This commit is contained in:
Robert Schmidt
2026-04-16 11:53:19 +02:00
parent a2f8f2ead3
commit c0a2dc9006
4 changed files with 23 additions and 58 deletions
+7 -5
View File
@@ -414,7 +414,7 @@ int main(int argc, char **argv)
unsigned int TBS = 8424;
unsigned int available_bits;
uint8_t nb_re_dmrs = 6;
uint8_t length_dmrs = 1;
uint8_t length_dmrs = 2;
uint8_t N_PRB_oh;
uint16_t N_RE_prime,code_rate;
unsigned char mod_order;
@@ -429,9 +429,6 @@ int main(int argc, char **argv)
nr_phy_data_tx_t phy_data = {0};
NR_UE_ULSCH_t *ulsch_ue = &phy_data.ulsch;
if ((Nl==4)||(Nl==3))
nb_re_dmrs = nb_re_dmrs*2;
mod_order = nr_get_Qm_ul(Imcs, mcs_table);
code_rate = nr_get_code_rate_ul(Imcs, mcs_table);
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, 0, mod_order, Nl);
@@ -445,10 +442,15 @@ int main(int argc, char **argv)
rel15_ul->qam_mod_order = mod_order;
rel15_ul->mcs_index = Imcs;
rel15_ul->pusch_data.rv_index = rvidx;
rel15_ul->ul_dmrs_symb_pos = nb_re_dmrs;
rel15_ul->dmrs_config_type = pusch_dmrs_type1;
rel15_ul->num_dmrs_cdm_grps_no_data = 1;
rel15_ul->nrOfLayers = Nl;
rel15_ul->target_code_rate = code_rate;
rel15_ul->pusch_data.tb_size = TBS>>3;
rel15_ul->maintenance_parms_v3.ldpcBaseGraph = get_BG(TBS, code_rate);
int bits = count_bits64_with_mask(rel15_ul->ul_dmrs_symb_pos, rel15_ul->start_symbol_index, rel15_ul->nr_of_symbols);
AssertFatal(length_dmrs == bits, "length_dmrs %d bits %d\n", length_dmrs, bits);
///////////////////////////////////////////////////
double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc
@@ -558,7 +560,7 @@ int main(int argc, char **argv)
printf("\n");
exit(-1);
#endif
nr_ulsch_decoding(gNB, frame_parms, frame, subframe, &G, &UE_id, 1);
nr_ulsch_decoding(gNB, frame_parms, frame, subframe, &UE_id, 1);
if (harq_process_gNB->processedSegments == harq_process_gNB->C) {
bool crc_valid = check_crc(harq_process_gNB->b, lenWithCrc(1, (harq_process_gNB->TBS) << 3), crcType(1, (harq_process_gNB->TBS) << 3));
if (!crc_valid) {