From 7dbda3a470568d2effbb08d3a39ae6f3ee52a94a Mon Sep 17 00:00:00 2001 From: Francesco Mani Date: Fri, 3 Jan 2020 17:52:18 +0100 Subject: [PATCH] a couple of bugfixes in physical simulators --- openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c | 3 +-- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 2 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c index 0b205bd813..611b20fa8b 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c @@ -252,9 +252,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, uint16_t nb_rb;// = 30; double Coderate;// = 0.0; - uint8_t dmrs_Type = harq_process->dmrsConfigType; - AssertFatal(dmrs_Type == 1 || dmrs_Type == 2,"Illegal dmrs_type %d\n",dmrs_Type); + AssertFatal(dmrs_Type == NFAPI_NR_DMRS_TYPE1 || dmrs_Type == NFAPI_NR_DMRS_TYPE2,"Illegal dmrs_type %d\n",dmrs_Type); uint8_t nb_re_dmrs = (dmrs_Type==1)?6:4; uint16_t dmrs_length = get_num_dmrs(harq_process->dlDmrsSymbPos); AssertFatal(dmrs_length == 1 || dmrs_length == 2,"Illegal dmrs_length %d\n",dmrs_length); diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index d23d230255..dd04104edd 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -538,7 +538,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue, uint32_t unscrambling_mask = (Lmax==64)?0x100006D:0x1000041; nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0); //polar decoding de-rate matching - const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,ue->polarList); + const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList); decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,currentPtr); if(decoderState) return(decoderState); diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index fbe6a12149..50b9c0ff06 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -452,6 +452,7 @@ int main(int argc, char **argv) rel15->TBSize[0] = TBS; rel15->targetCodeRate[0] = rate; rel15->NrOfCodewords = 1; + rel15->dmrsConfigType = NFAPI_NR_DMRS_TYPE1; double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384); short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384); @@ -472,6 +473,7 @@ int main(int argc, char **argv) harq_process->Qm = mod_order; harq_process->rvidx = rvidx; harq_process->R = rate; + harq_process->dmrsConfigType = NFAPI_NR_DMRS_TYPE1; printf("harq process ue mcs = %d Qm = %d, symb %d\n", harq_process->mcs, harq_process->Qm, nb_symb_sch); unsigned char *test_input; test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8);