Commit 88f293d3 authored by Khodr Saaifan's avatar Khodr Saaifan Committed by Thomas Schlichter

clean up nr_dlsch_demodulation, solve bug in nr_rb_extract to consider...

clean up nr_dlsch_demodulation, solve bug in nr_rb_extract to consider data/dmrs multiplexing/no data, and remove ra_pdsch hack in phy_procedures_nr_ue
parent 3fdb5509
......@@ -183,7 +183,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
//int16_t *pllr_symbol_cw1_deint;
//uint16_t bundle_L = 2;
uint8_t pilots=0;
uint8_t config_type = ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
uint8_t config_type;// We should not use ue->dmrs_DownlinkConfig.pdsch_dmrs_type;
uint16_t n_tx=1, n_rx=1;
int32_t median[16];
uint32_t len;
......@@ -341,6 +341,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
#endif
pilots = ((1<<symbol)&dlsch0_harq->dlDmrsSymbPos)>0 ? 1 : 0;
config_type = dlsch0_harq->dmrsConfigType;
if (beamforming_mode==0) {//No beamforming
#if UE_TIMING_TRACE
......@@ -356,7 +357,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
config_type,
start_rb,
nb_rb_pdsch,
ue->high_speed_flag,
dlsch0_harq->n_dmrs_cdm_groups,
dlsch0_harq->Nl,
frame_parms,
dlsch0_harq->dlDmrsSymbPos);
......@@ -371,7 +372,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
config_type,
start_rb + dlsch0_harq->BWPStart,
nb_rb_pdsch,
ue->high_speed_flag,
dlsch0_harq->n_dmrs_cdm_groups,
frame_parms,
dlsch0_harq->dlDmrsSymbPos);
......@@ -459,7 +460,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
avgs = cmax(avgs, median[aatx*n_rx + aarx]);
}
}
pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2) + 1;}
pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2) + 1;
}
}
LOG_D(PHY,"[DLSCH] AbsSubframe %d.%d log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n",
frame%1024,nr_slot_rx, pdsch_vars[eNB_id]->log2_maxh,
......@@ -507,12 +509,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nb_rb,
pdsch_vars[eNB_id]->log2_maxh,
measurements); // log2_maxh+I0_shift
/*if (symbol == 5) {
write_output("rxF_comp_d.m","rxF_c_d",&pdsch_vars[eNB_id]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
} */
}
else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM){
} else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM){
nr_dlsch_channel_compensation_core(pdsch_vars[eNB_id]->rxdataF_ext,
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
pdsch_vars[eNB_id]->dl_ch_mag0,
......@@ -525,12 +522,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
pdsch_vars[eNB_id]->log2_maxh,
2*len, // subcarriers Re Im
0); // we start from the beginning of the vector
/* if (symbol == 5) {
write_output("rxF_comp_d00.m","rxF_c_d00",&pdsch_vars[eNB_id]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);// should be QAM
write_output("rxF_comp_d01.m","rxF_c_d01",&pdsch_vars[eNB_id]->rxdataF_comp0[1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
write_output("rxF_comp_d10.m","rxF_c_d10",&pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
write_output("rxF_comp_d11.m","rxF_c_d11",&pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be QAM
} */
// compute correlation between signal and interference channels (rho12 and rho21)
nr_dlsch_dual_stream_correlation_core(pdsch_vars[eNB_id]->dl_ch_estimates_ext,
&(pdsch_vars[eNB_id]->dl_ch_estimates_ext[2]),
......@@ -540,23 +531,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
pdsch_vars[eNB_id]->log2_maxh,
2*len,
0);
//printf("rho stream1 =%d\n", &pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round] );
nr_dlsch_dual_stream_correlation_core(&(pdsch_vars[eNB_id]->dl_ch_estimates_ext[2]),
pdsch_vars[eNB_id]->dl_ch_estimates_ext,
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
n_tx,
n_rx,
pdsch_vars[eNB_id]->log2_maxh,
2*len,
0);
// printf("rho stream2 =%d\n",&pdsch_vars[eNB_id]->dl_ch_rho2_ext );
//printf("TM3 log2_maxh : %d\n",pdsch_vars[eNB_id]->log2_maxh);
/* if (symbol == 5) {
write_output("rho0_0.m","rho0_0",&pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round][0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);// should be QAM
write_output("rho2_0.m","rho2_0",&pdsch_vars[eNB_id]->dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
write_output("rho0_1.m.m","rho0_1",&pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round][1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
write_output("rho2_1.m","rho2_1",&pdsch_vars[eNB_id]->dl_ch_rho2_ext[1][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be QAM
} */
}
#if UE_TIMING_TRACE
......@@ -607,10 +581,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
n_rx,
2*len,
0);
/* if (symbol == 5) {
write_output("rho0_mrc.m","rho0_0",&pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round][0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);// should be QAM
write_output("rho2_mrc.m","rho2_0",&pdsch_vars[eNB_id]->dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
} */
}
}
//printf("start compute LLR\n");
......@@ -817,17 +787,23 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
unsigned short rb;
unsigned char aatx,aarx;
__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b;
__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*dl_ch_mag128r,*rxdataF128,*rxdataF_comp128,*rho128;
__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128,QAM_amp128b,QAM_amp128r;
QAM_amp128b = _mm_setzero_si128();
for (aatx=0; aatx<nb_aatx; aatx++) {
if (mod_order == 4) {
QAM_amp128 = _mm_set1_epi16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = _mm_setzero_si128();
QAM_amp128r = _mm_setzero_si128();
} else if (mod_order == 6) {
QAM_amp128 = _mm_set1_epi16(QAM64_n1); //
QAM_amp128b = _mm_set1_epi16(QAM64_n2);
QAM_amp128r = _mm_setzero_si128();
} else if (mod_order == 8) {
QAM_amp128 = _mm_set1_epi16(QAM256_n1);
QAM_amp128b = _mm_set1_epi16(QAM256_n2);
QAM_amp128r = _mm_set1_epi16(QAM256_n3);
}
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
......@@ -837,10 +813,10 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[(aatx*frame_parms->nb_antennas_rx)+aarx][symbol*nb_rb*12];
dl_ch_mag128 = (__m128i *)&dl_ch_mag[(aatx*frame_parms->nb_antennas_rx)+aarx][symbol*nb_rb*12];
dl_ch_mag128b = (__m128i *)&dl_ch_magb[(aatx*frame_parms->nb_antennas_rx)+aarx][symbol*nb_rb*12];
dl_ch_mag128r = (__m128i *)&dl_ch_magr[(aatx*frame_parms->nb_antennas_rx)+aarx][symbol*nb_rb*12];
rxdataF128 = (__m128i *)&rxdataF_ext[aarx][symbol*nb_rb*12];
rxdataF_comp128 = (__m128i *)&rxdataF_comp[(aatx*frame_parms->nb_antennas_rx)+aarx][symbol*nb_rb*12];
for (rb=0; rb<nb_rb; rb++) {
if (mod_order>2) {
// get channel amplitude if not QPSK
......@@ -857,6 +833,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
dl_ch_mag128[0] = _mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
dl_ch_mag128b[0] = dl_ch_mag128[0];
dl_ch_mag128r[0] = dl_ch_mag128[0];
dl_ch_mag128[0] = _mm_mulhi_epi16(dl_ch_mag128[0],QAM_amp128);
dl_ch_mag128[0] = _mm_slli_epi16(dl_ch_mag128[0],1);
//print_ints("Re(ch):",(int16_t*)&mmtmpD0);
......@@ -864,6 +841,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
//print_shorts("mag:",(int16_t*)&dl_ch_mag128[0]);
dl_ch_mag128[1] = _mm_unpackhi_epi16(mmtmpD0,mmtmpD0);
dl_ch_mag128b[1] = dl_ch_mag128[1];
dl_ch_mag128r[1] = dl_ch_mag128[1];
dl_ch_mag128[1] = _mm_mulhi_epi16(dl_ch_mag128[1],QAM_amp128);
dl_ch_mag128[1] = _mm_slli_epi16(dl_ch_mag128[1],1);
......@@ -874,6 +852,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
dl_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpD1,mmtmpD1);
dl_ch_mag128b[2] = dl_ch_mag128[2];
dl_ch_mag128r[2] = dl_ch_mag128[2];
dl_ch_mag128[2] = _mm_mulhi_epi16(dl_ch_mag128[2],QAM_amp128);
dl_ch_mag128[2] = _mm_slli_epi16(dl_ch_mag128[2],1);
......@@ -882,13 +861,21 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
dl_ch_mag128b[0] = _mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b);
dl_ch_mag128b[0] = _mm_slli_epi16(dl_ch_mag128b[0],1);
dl_ch_mag128b[1] = _mm_mulhi_epi16(dl_ch_mag128b[1],QAM_amp128b);
dl_ch_mag128b[1] = _mm_slli_epi16(dl_ch_mag128b[1],1);
dl_ch_mag128r[0] = _mm_mulhi_epi16(dl_ch_mag128r[0],QAM_amp128r);
dl_ch_mag128r[0] = _mm_slli_epi16(dl_ch_mag128r[0],1);
dl_ch_mag128r[1] = _mm_mulhi_epi16(dl_ch_mag128r[1],QAM_amp128r);
dl_ch_mag128r[1] = _mm_slli_epi16(dl_ch_mag128r[1],1);
if (pilots==0) {
dl_ch_mag128b[2] = _mm_mulhi_epi16(dl_ch_mag128b[2],QAM_amp128b);
dl_ch_mag128b[2] = _mm_slli_epi16(dl_ch_mag128b[2],1);
dl_ch_mag128r[2] = _mm_mulhi_epi16(dl_ch_mag128r[2],QAM_amp128r);
dl_ch_mag128r[2] = _mm_slli_epi16(dl_ch_mag128r[2],1);
}
}
......@@ -913,12 +900,10 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
// print_ints("c1",&mmtmpD3);
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
/*if (rb==0) {
printf("arx%d atx%d rb_index %d SC 0 symbol%d\n",aarx,aatx,rb,symbol);//
printf("rx_F_re: %d rx_F_im: %d \n",((int16_t*)&rxdataF128[0])[0],((int16_t*)&rxdataF128[0])[1]);
printf("ch_re = %d ch_im = %d \n",((int16_t*)&dl_ch128[0])[0],((int16_t*)&dl_ch128[0])[1]);//
printf("rx_Fcomp_re: %d rx_Fcomp_im: %d \n",((int16_t*)&rxdataF_comp128[0])[0],((int16_t*)&rxdataF_comp128[0])[1]);
}*/
//printf("arx%d atx%d rb_index %d symbol%d\n",aarx,aatx,rb,symbol);
//print_shorts("rx:",(int16_t*)&rxdataF128[0]);
//print_shorts("ch:",(int16_t*)&dl_ch128[0]);
//print_shorts("pack:",(int16_t*)&rxdataF_comp128[0]);
// multiply by conjugated channel
mmtmpD0 = _mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
......@@ -933,9 +918,9 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
rxdataF_comp128[1] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
// print_shorts("rx:",rxdataF128+1);
// print_shorts("ch:",dl_ch128+1);
// print_shorts("pack:",rxdataF_comp128+1);
//print_shorts("rx:",(int16_t*)&rxdataF128[1]);
//print_shorts("ch:",(int16_t*)&dl_ch128[1]);
//print_shorts("pack:",(int16_t*)&rxdataF_comp128[1]);
if (pilots==0) {
// multiply by conjugated channel
......@@ -952,26 +937,27 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
rxdataF_comp128[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
// print_shorts("rx:",rxdataF128+2);
// print_shorts("ch:",dl_ch128+2);
// print_shorts("pack:",rxdataF_comp128+2);
//print_shorts("rx:",(int16_t*)&rxdataF128[2]);
//print_shorts("ch:",(int16_t*)&dl_ch128[2]);
//print_shorts("pack:",(int16_t*)&rxdataF_comp128[2]);
dl_ch128+=3;
dl_ch_mag128+=3;
dl_ch_mag128b+=3;
dl_ch_mag128r+=3;
rxdataF128+=3;
rxdataF_comp128+=3;
} else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less
dl_ch128+=2;
dl_ch_mag128+=2;
dl_ch_mag128b+=2;
dl_ch_mag128r+=2;
rxdataF128+=2;
rxdataF_comp128+=2;
}
}
}
}
if (rho) {
//rho[aatx*n_rx+0] = Cov(H_0,0,H*_0,aatx), aatx=0,...n_tx-1
//rho[aatx*n_rx+1] = Cov(H_1,1,H*_1,aatx), aatx=0,...n_tx-1
......@@ -979,15 +965,16 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
int avg_rho_re[nb_aatx][frame_parms->nb_antennas_rx];
int avg_rho_im[nb_aatx][frame_parms->nb_antennas_rx];
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
dl_ch128 = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*nb_rb*12];//H_{aarx,0}
for (aatx=1; aatx<nb_aatx; aatx++) {
avg_rho_re[aatx][aarx] = 0;
avg_rho_im[aatx][aarx] = 0;
rho128 = (__m128i *)&rho[aatx*frame_parms->nb_antennas_rx+aarx][symbol*nb_rb*12];//(aatx*frame_parms->nb_antennas_rx)+
rho128 = (__m128i *)&rho[aatx*frame_parms->nb_antennas_rx+aarx][symbol*nb_rb*12];
dl_ch128_2 = (__m128i *)&dl_ch_estimates_ext[aatx*frame_parms->nb_antennas_rx+aarx][symbol*nb_rb*12];
for (rb=0; rb<nb_rb; rb++) {
// multiply by conjugated channel
mmtmpD0 = _mm_madd_epi16(dl_ch128[0],dl_ch128_2[0]);
......@@ -1034,11 +1021,11 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
mmtmpD1 = _mm_srai_epi32(mmtmpD1,output_shift);
mmtmpD2 = _mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
rho128[1] =_mm_packs_epi32(mmtmpD2,mmtmpD3);
//print_shorts("rx:",dl_ch128_2+1);
//print_shorts("ch:",dl_ch128+1);
//print_shorts("pack:",rho128+1);
// multiply by conjugated channel
avg_rho_re[aatx][aarx] +=(((int16_t*)&rho128[1])[0]+
......@@ -1083,21 +1070,19 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
rho128+=3;
}
/*if (first_symbol_flag==1) {
//measurements->rx_correlation[0][0][aarx] = signal_energy(&rho[aarx][symbol*nb_rb*12],rb*12);
avg_rho_re[aatx][aarx] = 16*avg_rho_re[aatx][aarx]/(nb_rb*12);
avg_rho_im[aatx][aarx] = 16*avg_rho_im[aatx][aarx]/(nb_rb*12);
printf("rho_rx%d tx%d= Re: %d Im: %d\n",aarx, aatx, avg_rho_re[aatx][aarx], avg_rho_im[aatx][aarx]);
}*/
* //measurements->rx_correlation[0][0][aarx] = signal_energy(&rho[aarx][symbol*nb_rb*12],rb*12);
* avg_rho_re[aatx][aarx] = 16*avg_rho_re[aatx][aarx]/(nb_rb*12);
* avg_rho_im[aatx][aarx] = 16*avg_rho_im[aatx][aarx]/(nb_rb*12);
* printf("rho_rx%d tx%d= Re: %d Im: %d\n",aarx, aatx, avg_rho_re[aatx][aarx], avg_rho_im[aatx][aarx]);
* }*/
}
}
}
_mm_empty();
_m_empty();
#elif defined(__arm__)
unsigned short rb;
unsigned char aatx,aarx,symbol_mod,pilots=0;
......@@ -2063,24 +2048,29 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
uint8_t config_type,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
uint32_t high_speed_flag,
uint8_t n_dmrs_cdm_groups,
NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos) {
uint16_t dlDmrsSymbPos)
{
unsigned short k,rb;
unsigned char i,aarx;
unsigned char nushift,i,aarx;
int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
int8_t validDmrsEst = 0; //store last DMRS Symbol index
unsigned char j=0;
if (config_type==pdsch_dmrs_type1)
AssertFatal(frame_parms->nushift ==0 || frame_parms->nushift == 1,
"nushift %d is illegal\n",frame_parms->nushift);
else
AssertFatal(frame_parms->nushift ==0 || frame_parms->nushift == 2 || frame_parms->nushift == 4,
"nushift %d is illegal\n",frame_parms->nushift);
if (config_type==pdsch_dmrs_type1){
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2,
"n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups);
nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1
} else {
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2 || n_dmrs_cdm_groups == 3,
"n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups);
nushift = (n_dmrs_cdm_groups -1)<<1;//delta in Table 7.4.1.1.2-2
}
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
......@@ -2108,8 +2098,8 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
} else {//the symbol contains DMRS
j=0;
if (config_type==pdsch_dmrs_type1){
if (frame_parms->nushift == 0) {//data is multiplexed
for (i = (1-frame_parms->nushift); i<12; i+=2) {
if (nushift == 0) {//data is multiplexed
for (i = (1-nushift); i<12; i+=2) {
rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
j++;
......@@ -2118,12 +2108,12 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
rxF_ext+=6;
}
} else {//pdsch_dmrs_type2
for (i = (2+frame_parms->nushift); i<6; i++) {
for (i = (2+nushift); i<6; i++) {
rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
j++;
}
for (i = (8+frame_parms->nushift); i<12; i++) {
for (i = (8+nushift); i<12; i++) {
rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
j++;
......@@ -2155,22 +2145,27 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
uint8_t config_type,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
uint32_t high_speed_flag,
uint8_t n_dmrs_cdm_groups,
uint8_t Nl,
NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos) {
uint16_t dlDmrsSymbPos)
{
unsigned short k,rb;
unsigned char j,i,aarx,aatx;
unsigned char nushift,j,i,aarx,aatx;
int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
int8_t validDmrsEst = 0; //store last DMRS Symbol index
if (config_type==pdsch_dmrs_type1)
AssertFatal(frame_parms->nushift ==0 || frame_parms->nushift == 1,
"nushift %d is illegal\n",frame_parms->nushift);
else
AssertFatal(frame_parms->nushift ==0 || frame_parms->nushift == 2 || frame_parms->nushift == 4,
"nushift %d is illegal\n",frame_parms->nushift);
if (config_type==pdsch_dmrs_type1){
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2,
"n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups);
nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1
} else {
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2 || n_dmrs_cdm_groups == 3,
"n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups);
nushift = (n_dmrs_cdm_groups -1)<<1;//delta in Table 7.4.1.1.2-2
}
validDmrsEst = get_valid_dmrs_idx_for_channel_est(dlDmrsSymbPos,symbol);
......@@ -2200,8 +2195,8 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
} else {//the symbol contains DMRS
j=0;
if (config_type==pdsch_dmrs_type1) {
if (frame_parms->nushift == 0) {//data is multiplexed
for (i = (1-frame_parms->nushift); i<12; i+=2) {
if (nushift == 0) {//data is multiplexed
for (i = (1-nushift); i<12; i+=2) {
if (aatx==0) rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
j++;
......@@ -2210,12 +2205,12 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
if (aatx==0) rxF_ext+=6;
}
} else {//pdsch_dmrs_type2
for (i = (2+frame_parms->nushift); i<6; i++) {
for (i = (2+nushift); i<6; i++) {
if (aatx==0) rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
j++;
}
for (i = (8+frame_parms->nushift); i<12; i++) {
for (i = (8+nushift); i<12; i++) {
if (aatx==0) rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
j++;
......
......@@ -697,7 +697,7 @@ void dlsch_detection_mrc_TM34(NR_DL_FRAME_PARMS *frame_parms,
@param dl_ch_estimates_ext Channel estimates for RBs in this allocation
@param rb_alloc RB allocation vector
@param symbol Symbol to extract
@param high_speed_flag
@param n_dmrs_cdm_groups
@param frame_parms Pointer to frame descriptor
*/
unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
......@@ -709,7 +709,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
uint8_t config_type,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
uint32_t high_speed_flag,
uint8_t n_dmrs_cdm_groups,
NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos);
......@@ -722,7 +722,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
uint8_t config_type,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
uint32_t high_speed_flag,
uint8_t n_dmrs_cdm_groups,
uint8_t Nl,
NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos)
......@@ -734,7 +734,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
@param dl_ch_estimates_ext Channel estimates for RBs in this allocation
@param Nl nb of antenna layers
@param symbol Symbol to extract
@param high_speed_flag
@param n_dmrs_cdm_groups
@param frame_parms Pointer to frame descriptor
*/
unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
......@@ -746,7 +746,7 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
uint8_t config_type,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
uint32_t high_speed_flag,
uint8_t n_dmrs_cdm_groups,
uint8_t Nl,
NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos);
......
......@@ -796,9 +796,9 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_
slot = 1;
start_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]);
#endif
// process DLSCH received in first slot
// skip DMRS symbols (will have to check later if PDSCH/DMRS are multiplexed
if (((1<<m)&dlsch0->harq_processes[harq_pid]->dlDmrsSymbPos) == 0) {
// process DLSCH received symbols in the slot
// symbol by symbol processing (if data/DMRS are multiplexed is checked inside the function)
if (pdsch == PDSCH || pdsch == SI_PDSCH || pdsch == RA_PDSCH) {
if (nr_rx_pdsch(ue,
proc,
pdsch,
......@@ -812,27 +812,8 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_
i_mod,
dlsch0->current_harq_pid) < 0)
return -1;
}
else { // This is to adjust the llr offset in the case of skipping over a dmrs symbol (i.e. in case of no PDSCH REs in DMRS)
if (pdsch == RA_PDSCH) ue->pdsch_vars[proc->thread_id][eNB_id]->llr_offset[m]=ue->pdsch_vars[proc->thread_id][eNB_id]->llr_offset[m-1];
else if (pdsch == PDSCH || pdsch == SI_PDSCH) {
if (nr_rx_pdsch(ue,
proc,
pdsch,
eNB_id,
eNB_id_i,
frame_rx,
nr_slot_rx,
m,
first_symbol_flag,
dual_stream_UE,
i_mod,
dlsch0->current_harq_pid) < 0)
return -1;
}
else AssertFatal(1==0,"Not RA_PDSCH, SI_PDSCH or PDSCH\n");
}
if (pdsch == PDSCH) LOG_D(PHY,"Done processing symbol %d : llr_offset %d\n",m,ue->pdsch_vars[proc->thread_id][eNB_id]->llr_offset[m]);
} else AssertFatal(1==0,"Not RA_PDSCH, SI_PDSCH or PDSCH\n");
#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]);
#if DISABLE_LOG_X
......@@ -842,8 +823,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_
#endif
#endif
if(first_symbol_flag)
{
if(first_symbol_flag) {
proc->first_symbol_available = 1;
}
} // CRNTI active
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment