diff --git a/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c b/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c index 941853388f..a47bee2944 100644 --- a/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c +++ b/openair1/PHY/NR_REFSIG/nr_dmrs_rx.c @@ -53,7 +53,7 @@ int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1 short nr_rx_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,23170,-23170,-23170,-23170,23170}; -int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, +/*int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, uint8_t eNB_offset, unsigned int Ns, unsigned int nr_gold_pdcch[7][20][3][10], @@ -65,8 +65,6 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, int32_t qpsk[4],n; int w,ind,l,ind_dword,ind_qpsk_symb,kp,k; short pamp; - - // Compute the correct pilot amplitude, sqrt_rho_b = Q3.13 pamp = ONE_OVER_SQRT2_Q15; // This includes complex conjugate for channel estimation @@ -80,7 +78,6 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, ((short *)&qpsk[3])[1] = pamp; if (p==2000) { - // r_n from 38.211 7.4.1.3 for (n=0; nframe_parms.ssb_start_subcarrier/12)+pdcch_rb_offset)*3/32; + + if (p==2000) { + for (int i=0; i<((nb_rb_coreset*6)>>1); i++) { + idx = ((((nr_gold_pdcch[(i<<1)>>5])>>((i<<1)&0x1f))&1)<<1) ^ (((nr_gold_pdcch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1); + ((int16_t*)output)[i<<1] = nr_rx_mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1]; + ((int16_t*)output)[(i<<1)+1] = nr_rx_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1]; +#ifdef DEBUG_PDCCH + printf("i %d idx %d pdcch gold %d b0-b1 %d-%d mod_dmrs %d %d\n", i, idx, nr_gold_pdcch[(i<<1)>>5], (((nr_gold_pdcch[(i<<1)>>5])>>((i<<1)&0x1f))&1), + (((nr_gold_pdcch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(m<<1)+1],&output[0]); +#endif + } + } + + return(0); +} + int nr_pbch_dmrs_rx(unsigned int *nr_gold_pbch, int32_t *output ) { diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c index d43d7235ed..59e14a1e76 100644 --- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c +++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c @@ -64,7 +64,7 @@ void nr_gold_pbch(PHY_VARS_NR_UE* ue) } -void nr_gold_pdcch(PHY_VARS_NR_UE* ue,unsigned int Nid_cell, unsigned short n_idDMRS, unsigned short length_dmrs) +void nr_gold_pdcch(PHY_VARS_NR_UE* ue,unsigned short n_idDMRS, unsigned short length_dmrs) { unsigned char ns,l; @@ -74,7 +74,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,unsigned int Nid_cell, unsigned short n_id if (n_idDMRS) nid = n_idDMRS; else - nid = Nid_cell; + nid = ue->frame_parms.Nid_cell; for (ns=0; ns<20; ns++) { @@ -95,7 +95,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,unsigned int Nid_cell, unsigned short n_id //printf("x1 : %x, x2 : %x\n",x1,x2); } - for (n=0; n<10; n++) { + for (n=0; n<52; n++) { x1 = (x1>>1) ^ (x1>>4); x1 = x1 ^ (x1<<31) ^ (x1<<28); x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); @@ -107,7 +107,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,unsigned int Nid_cell, unsigned short n_id } } -void nr_gold_pdsch(PHY_VARS_NR_UE* ue,unsigned short lbar,unsigned int Nid_cell, unsigned short *n_idDMRS, unsigned short length_dmrs) +void nr_gold_pdsch(PHY_VARS_NR_UE* ue,unsigned short lbar,unsigned short *n_idDMRS, unsigned short length_dmrs) { unsigned char ns,l; @@ -122,7 +122,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue,unsigned short lbar,unsigned int Nid_cell, if (n_idDMRS) nid = n_idDMRS[nscid]; else - nid = Nid_cell; + nid = ue->frame_parms.Nid_cell; for (ns=0; ns<20; ns++) { diff --git a/openair1/PHY/NR_REFSIG/refsig_defs_ue.h b/openair1/PHY/NR_REFSIG/refsig_defs_ue.h index ba2b7e69d9..0da7bb154f 100644 --- a/openair1/PHY/NR_REFSIG/refsig_defs_ue.h +++ b/openair1/PHY/NR_REFSIG/refsig_defs_ue.h @@ -37,10 +37,9 @@ int nr_pbch_dmrs_rx(unsigned int *nr_gold_pbch, int32_t *output ); int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue, uint8_t eNB_offset, unsigned int Ns, - unsigned int nr_gold_pdcch[7][20][3][10], + unsigned int *nr_gold_pdcch, int32_t *output, unsigned short p, - int length_dmrs, unsigned short nb_rb_corset); int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue, @@ -55,13 +54,11 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue, void nr_gold_pbch(PHY_VARS_NR_UE* ue); void nr_gold_pdcch(PHY_VARS_NR_UE* ue, - unsigned int Nid_cell, unsigned short n_idDMRS, unsigned short length_dmrs); void nr_gold_pdsch(PHY_VARS_NR_UE* ue, unsigned short lbar, - unsigned int Nid_cell, unsigned short *n_idDMRS, unsigned short length_dmrs); diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index a0cf54d569..871e0d21b8 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -266,7 +266,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue, fr = filt16a_r1; // generate pilot - nr_pdcch_dmrs_rx(ue,eNB_offset,Ns,ue->nr_gold_pdcch[eNB_offset][Ns][symbol], &pilot[p][0],2000,symbol, nb_rb_coreset); + nr_pdcch_dmrs_rx(ue,eNB_offset,Ns,ue->nr_gold_pdcch[eNB_offset][Ns][symbol], &pilot[p][0],2000,nb_rb_coreset); for (aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index fea1f3220c..4654564a26 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -1093,7 +1093,7 @@ typedef struct { uint32_t nr_gold_pdsch[2][20][2][21]; /// PDCCH DMRS - uint32_t nr_gold_pdcch[7][20][3][10]; + uint32_t nr_gold_pdcch[7][20][3][52]; uint32_t X_u[64][839]; diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 98a6d178df..db477d7920 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -5931,7 +5931,7 @@ int phy_procedures_UE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_ LOG_D(PHY," ------ --> FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx); - nr_gold_pdcch(ue,ue->frame_parms.Nid_cell, 0, 3); + nr_gold_pdcch(ue,0, 3); for (; l<=3; l++) { if (abstraction_flag == 0) {