diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c index 1202774798..758743da4e 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c @@ -93,7 +93,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot) harq->unav_res = ptrsSymbPerSlot * n_ptrs; /// CRC, coding, interleaving and rate matching - AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n"); + AssertFatal(harq->pdu != NULL, "%4d.%2d no HARQ PDU for PDSCH generation\n", msgTx->frame, msgTx->slot); /* output and its parts for each dlsch should be aligned on 64 bytes * => size_output is a sum of parts sizes rounded up to a multiple of 64 diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h index 89b496ba5c..15f48825f5 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h @@ -56,8 +56,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB, time_stats_t *dlsch_interleaving_stats, time_stats_t *dlsch_segmentation_stats); -void nr_emulate_dlsch_payload(uint8_t* payload, uint16_t size); - void dump_pdsch_stats(FILE *fd,PHY_VARS_gNB *gNB); #endif diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c index 33ecfb3737..76955fd259 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c @@ -66,7 +66,6 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch, uint16_t N_RB, const NR_DL_FRAME_PARM harq->c[r] = NULL; } free(harq->c); - free(harq->pdu); } NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB) @@ -87,10 +86,6 @@ NR_gNB_DLSCH_t new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms, uint16_t N_RB) bzero(harq, sizeof(NR_DL_gNB_HARQ_t)); harq->b = malloc16(dlsch_bytes); AssertFatal(harq->b, "cannot allocate memory for harq->b\n"); - harq->pdu = malloc16(dlsch_bytes); - AssertFatal(harq->pdu, "cannot allocate memory for harq->pdu\n"); - bzero(harq->pdu, dlsch_bytes); - nr_emulate_dlsch_payload(harq->pdu, (dlsch_bytes) >> 3); bzero(harq->b, dlsch_bytes); harq->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *)); diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c index e6a03f1d59..0a3717ec70 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c @@ -36,14 +36,6 @@ extern void set_taus_seed(unsigned int seed_type); - -/// Payload emulation -void nr_emulate_dlsch_payload(uint8_t* pdu, uint16_t size) { - set_taus_seed(0); - for (int i=0; idlsch[msgTx->num_pdsch_slot][0]; diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index e2371e82ee..33f80ea318 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -497,7 +497,8 @@ int main(int argc, char **argv) dlsch0_ue->dlsch_config.tbslbrm = Tbslbrm; printf("harq process ue mcs = %d Qm = %d, symb %d\n", dlsch0_ue->dlsch_config.mcs, dlsch0_ue->dlsch_config.qamModOrder, nb_symb_sch); - unsigned char *test_input=dlsch->harq_process.pdu; + uint8_t test_input[TBS / 8 + 4]; // + 3 for CRC + 1 additional byte, see nr_dlsch_encoding() + dlsch->harq_process.pdu = test_input; //unsigned char test_input[TBS / 8] __attribute__ ((aligned(16))); for (i = 0; i < TBS / 8; i++) test_input[i] = (unsigned char) rand();