[GITLAB] - UPGRADE TO v12 on Wednesday the 18th of December at 11.30AM

Commit 459913de authored by Elena Lukashova's avatar Elena Lukashova

changes are mostly related to:

1. Introducing dlsch_16qam_llr_SIC.
2. New writing files format in file_output.c
3. Some comments addded.
parent f5c798e4
......@@ -1127,15 +1127,16 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
}
const size_t num = 7*2*frame_parms->N_RB_DL*12+4;
for (k=0;k<8;k++) { //harq_pid
for (l=0;l<8;l++) { //round
ue_pdsch_vars[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
// ue_pdsch_vars[eNB_id]->clean_x1[k][l] = (int16_t*)malloc16_clear( sizeof(int32_t) * num);
for (int i=0; i<frame_parms->nb_antennas_rx; i++)
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
const int idx = (j<<1)+i;
const size_t num = 7*2*frame_parms->N_RB_DL*12+4;
ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
ue_pdsch_vars[eNB_id]->rxdataF_comp1[k][l][idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
}
......
......@@ -5897,7 +5897,7 @@ uint16_t quantize_subband_pmi(PHY_MEASUREMENTS *meas,uint8_t eNB_id,int nb_rb)
pmi_im += meas->subband_pmi_im[eNB_id][i][aarx];
//printf("meas->subband_pmi_im[eNB_id][i][%d]=%d\n",aarx, meas->subband_pmi_im[eNB_id][i][aarx]);
}
if (((pmi_re >= pmi_im) && (pmi_re >= -pmi_im)) || ((pmi_re >= pmi_im) && (pmi_re <= -pmi_im)))
if (((pmi_re >= pmi_im) && (pmi_re >= -pmi_im)) || ((pmi_re <= pmi_im) && (pmi_re >= -pmi_im)))
pmiq = PMI_2A_R1_11;
else
pmiq = PMI_2A_R1_1j;
......
......@@ -299,7 +299,7 @@ int dlsch_encoding(unsigned char *a,
printf("\n");
*/
// Add 24-bit crc (polynomial A) to payload
crc = crc24a(a,
crc = crc24a(a, //input bits for computation, A is a size of a
A)>>8;
a[A>>3] = ((uint8_t*)&crc)[2];
a[1+(A>>3)] = ((uint8_t*)&crc)[1];
......@@ -310,15 +310,15 @@ int dlsch_encoding(unsigned char *a,
// dlsch->harq_processes[harq_pid]->b = a;
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4);
if (lte_segmentation(dlsch->harq_processes[harq_pid]->b,
dlsch->harq_processes[harq_pid]->c,
dlsch->harq_processes[harq_pid]->B,
&dlsch->harq_processes[harq_pid]->C,
&dlsch->harq_processes[harq_pid]->Cplus,
&dlsch->harq_processes[harq_pid]->Cminus,
&dlsch->harq_processes[harq_pid]->Kplus,
&dlsch->harq_processes[harq_pid]->Kminus,
&dlsch->harq_processes[harq_pid]->F)<0)
if (lte_segmentation(dlsch->harq_processes[harq_pid]->b, // bits after CRC attachement
dlsch->harq_processes[harq_pid]->c, // output from segmentation
dlsch->harq_processes[harq_pid]->B, //size of B=L+A
&dlsch->harq_processes[harq_pid]->C, //number of codeblocks
&dlsch->harq_processes[harq_pid]->Cplus, //Number of segments of size K+
&dlsch->harq_processes[harq_pid]->Cminus,//Number of segments of size K_
&dlsch->harq_processes[harq_pid]->Kplus, //First segmentation size
&dlsch->harq_processes[harq_pid]->Kminus, //Second segmentation size
&dlsch->harq_processes[harq_pid]->F)<0) //Number of filler bits
return(-1);
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
......@@ -399,7 +399,7 @@ int dlsch_encoding(unsigned char *a,
r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r],
G, //G
dlsch->harq_processes[harq_pid]->w[r],
dlsch->harq_processes[harq_pid]->e+r_offset,
dlsch->harq_processes[harq_pid]->e+r_offset, // sequence of bits for transmission
dlsch->harq_processes[harq_pid]->C, // C
dlsch->Nsoft, // Nsoft,
dlsch->Mdlharq,
......
......@@ -58,8 +58,8 @@
//#define DEBUG_DLSCH_DEMOD 1
int avg[4];
int avg_0[4];
int avg_1[4];
int avg_0[2];
int avg_1[2];
// [MCS][i_mod (0,1,2) = (2,4,6)]
unsigned char offset_mumimo_llr_drange_fix=0;
......@@ -329,9 +329,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
// avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2) + interf_unaw_shift_tm1_mcs[dlsch0_harq->mcs];
lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2); //+ interf_unaw_shift_tm1_mcs[dlsch0_harq->mcs];
// printf("TM4 I-A log2_maxh0 = %d\n", lte_ue_pdsch_vars[eNB_id]->log2_maxh);
}
......@@ -349,9 +348,9 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
lte_ue_pdsch_vars[eNB_id]->log2_maxh,
phy_measurements); // log2_maxh+I0_shift
if (symbol == 5) {
/*if (symbol == 5) {
write_output("rxF_comp_d.m","rxF_c_d",&lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);
}
} */
if ((rx_type==rx_IC_single_stream) &&
(eNB_id_i<phy_vars_ue->n_connected_eNB)) {
......@@ -413,6 +412,10 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
symbol,
nb_rb,
dlsch0_harq->mimo_mode);
// write_output("dlsch0_r0_aver_chan_1.m","dl_aver_ch1_r0_0",&avg_1[0],1,1,2);
if (rx_type>rx_standard) {
......@@ -438,7 +441,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
//printf("TM4 I-UA log2_maxh1 = %d\n", lte_ue_pdsch_vars[eNB_id]->log2_maxh1);
}
}
dlsch_channel_compensation_TM34(frame_parms,
lte_ue_pdsch_vars[eNB_id],
phy_measurements,
......@@ -2961,7 +2964,7 @@ void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
int **rxdataF_comp0 =lte_ue_pdsch_vars->rxdataF_comp0;
int **rxdataF_comp1 =lte_ue_pdsch_vars->rxdataF_comp1[harq_pid][round];
int **dl_ch_rho_ext =lte_ue_pdsch_vars->dl_ch_rho_ext[harq_pid][round]; //for first stream
int **dl_ch_rho_ext =lte_ue_pdsch_vars->dl_ch_rho_ext[harq_pid][round]; //for second stream
int **dl_ch_rho2_ext =lte_ue_pdsch_vars->dl_ch_rho2_ext;
int **dl_ch_mag0 = lte_ue_pdsch_vars->dl_ch_mag0;
int **dl_ch_mag1 = lte_ue_pdsch_vars->dl_ch_mag1;
......@@ -2990,8 +2993,8 @@ void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
} }
// if (rho) {
rho128_0 = (__m128i *) &dl_ch_rho_ext[0][symbol*frame_parms->N_RB_DL*12];
rho128_1 = (__m128i *) &dl_ch_rho_ext[1][symbol*frame_parms->N_RB_DL*12];
rho128_0 = (__m128i *) &dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12];
rho128_1 = (__m128i *) &dl_ch_rho2_ext[1][symbol*frame_parms->N_RB_DL*12];
for (i=0;i<nb_rb*3;i++) {
// print_shorts("mrc rho0:",&rho128_0[i]);
// print_shorts("mrc rho1:",&rho128_1[i]);
......@@ -3001,8 +3004,8 @@ void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
if (dual_stream_UE == 1) {
rho128_i0 = (__m128i *) &dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12];
rho128_i1 = (__m128i *) &dl_ch_rho2_ext[1][symbol*frame_parms->N_RB_DL*12];
rho128_i0 = (__m128i *) &dl_ch_rho_ext[0][symbol*frame_parms->N_RB_DL*12];
rho128_i1 = (__m128i *) &dl_ch_rho_ext[1][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128_i0 = (__m128i *)&rxdataF_comp1[0][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128_i1 = (__m128i *)&rxdataF_comp1[1][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128_i0 = (__m128i *)&dl_ch_mag1[0][symbol*frame_parms->N_RB_DL*12];
......@@ -3056,6 +3059,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a));
LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
// printf("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13
......@@ -3147,7 +3151,7 @@ void dlsch_channel_level(int **dl_ch_estimates_ext,
((int*)&avg128D)[2] +
((int*)&avg128D)[3])/(nb_rb*nre);
// printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
// printf("Channel level : %d\n",avg[(aatx<<1)+aarx]);
}
_mm_empty();
......@@ -3313,14 +3317,15 @@ void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
prec2A_TM4_128(pmi_ext[rb],&dl_ch0_128_tmp,&dl_ch1_128_tmp);
// mmtmpD2 = _mm_madd_epi16(dl_ch0_128_tmp,dl_ch0_128_tmp);
avg_0_128D = _mm_add_epi32(avg_0_128D,_mm_madd_epi16(dl_ch0_128_tmp,dl_ch0_128_tmp));
avg_1_128D = _mm_add_epi32(avg_1_128D,_mm_madd_epi16(dl_ch1_128_tmp,dl_ch1_128_tmp));
avg_0_128D = _mm_add_epi32(avg_0_128D,_mm_madd_epi16(dl_ch0_128_tmp,dl_ch0_128_tmp));
dl_ch0_128+=3;
dl_ch1_128+=3;
}
}
avg_0[aarx] = (((int*)&avg_0_128D)[0])/(nb_rb*nre) +
(((int*)&avg_0_128D)[1])/(nb_rb*nre) +
......@@ -3332,17 +3337,19 @@ void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
(((int*)&avg_1_128D)[1])/(nb_rb*nre) +
(((int*)&avg_1_128D)[2])/(nb_rb*nre) +
(((int*)&avg_1_128D)[3])/(nb_rb*nre);
// printf("From Chan_level aver stream 1 %d =%d\n", aarx, avg_1[aarx]);
// printf("From Chan_level aver stream 1 %d =%d\n", aarx, avg_1[aarx]);
}
//avg_0[0] = max(avg_0[0],avg_0[1]);
//avg_1[0] = max(avg_1[0],avg_1[1]);
//avg_0[0]= max(avg_0[0], avg_1[0]);
avg_0[0] = avg_0[0] + avg_0[1];
// printf("From Chan_level aver stream 0 final =%d\n", avg_0[0]);
avg_1[0] = avg_1[0] + avg_1[1];
avg_0[0] = max (avg_0[0], avg_1[0]);
avg_1[0] = avg_0[0];
// printf("From Chan_level aver stream 1 final =%d\n", avg_1[0]);
avg_0[0] = min (avg_0[0], avg_1[0]);
avg_1[0] = avg_0[0];
_mm_empty();
_m_empty();
......@@ -4735,6 +4742,10 @@ void dump_dlsch2(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1);
// sprintf(fname,"dlsch%d_r%d_aver_chan_1.m",eNB_id,round);
// sprintf(vname,"dl_aver_ch1_r%d_%d",eNB_id,round);
// write_output(fname,vname,&avg_1[0],1,1,1);
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
......
......@@ -803,7 +803,9 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
((int16_t*)&txdataF[0][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample1)[0]*ONE_OVER_2_Q15)>>15);
((int16_t*)&txdataF[0][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample1)[1]*ONE_OVER_2_Q15)>>15);
if (frame_parms->nb_antennas_tx == 2) {
// printf("%d,%d\n",((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
if (frame_parms->nb_antennas_tx == 2) {
layer1prec2A(&tmp_sample1,&tmp_sample2,precoder_index0);
((int16_t*)&txdataF[1][tti_offset])[0] += (int16_t)((((int16_t*)&tmp_sample2)[0]*ONE_OVER_2_Q15)>>15);
((int16_t*)&txdataF[1][tti_offset])[1] += (int16_t)((((int16_t*)&tmp_sample2)[1]*ONE_OVER_2_Q15)>>15);
......@@ -1643,6 +1645,7 @@ int dlsch_modulation_SIC(mod_sym_t **sic_buffer,
amp=1; //we do full scale here for SIC
gain_lin_QPSK = (int16_t)((ONE_OVER_SQRT2_Q15));
// printf("gain=%d\n", gain_lin_QPSK);
jj = 0;
i = 0;
......@@ -1663,7 +1666,7 @@ int dlsch_modulation_SIC(mod_sym_t **sic_buffer,
jj = jj + 1;
// printf("%d,%d\n",((int16_t*)&sic_buffer[0][i])[0],((int16_t*)&sic_buffer[0][i])[1]);
// printf("recon %d,%d\n",((int16_t*)&sic_buffer[0][i])[0],((int16_t*)&sic_buffer[0][i])[1]);
i++;
......
......@@ -725,7 +725,8 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
short *dlsch_llr,
uint8_t num_pdcch_symbols,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
uint8_t subframe,
uint32_t rb_alloc,
LTE_UE_DLSCH_t *dlsch0);
void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
......@@ -749,15 +750,17 @@ void dlsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
@param nb_rb number of RBs for this allocation
@param pbch_pss_sss_adjust PBCH/PSS/SSS RE adjustment (in REs)
*/
void dlsch_16qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
int32_t **dl_ch_mag,
uint8_t symbol,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
int16_t **llr128p);
void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
mod_sym_t **sic_buffer, //Q15
int32_t **rho_i,
int16_t *dlsch_llr,
uint8_t num_pdcch_symbols,
int32_t **dl_ch_mag,
uint16_t nb_rb,
uint8_t subframe,
uint32_t rb_alloc,
LTE_UE_DLSCH_t *dlsch0);
void dlsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
......
......@@ -189,7 +189,9 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l);
#endif
start_meas(&phy_vars_ue->dlsch_channel_estimation_stats);
lte_dl_channel_estimation(phy_vars_ue,eNB_id,0,
lte_dl_channel_estimation(phy_vars_ue,
eNB_id,
0,
Ns,
aa,
l,
......@@ -197,7 +199,9 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
stop_meas(&phy_vars_ue->dlsch_channel_estimation_stats);
for (i=0; i<phy_vars_ue->PHY_measurements.n_adj_cells; i++) {
lte_dl_channel_estimation(phy_vars_ue,eNB_id,i+1,
lte_dl_channel_estimation(phy_vars_ue,
eNB_id,
i+1,
Ns,
aa,
l,
......
......@@ -66,10 +66,10 @@ void multadd_complex_vector_real_scalar(int16_t *x,
if (zero_flag == 1)
for (n=0; n<N>>2; n++) {
//print_shorts("x_128[n]=", &x_128[n]);
//print_shorts("alpha_128", &alpha_128);
// print_shorts("x_128[n]=", &x_128[n]);
// print_shorts("alpha_128", &alpha_128);
y_128[n] = mulhi_int16(x_128[n],alpha_128);
//print_shorts("y_128[n]=", &y_128[n]); //Q2.13
// print_shorts("y_128[n]=", &y_128[n]);
}
else
......
......@@ -137,8 +137,8 @@ int mult_cpx_conj_vector(int16_t *x1,
}
int mult_cpx_vector(int16_t *x1,
int16_t *x2,
int mult_cpx_vector(int16_t *x1, //Q15
int16_t *x2,//Q13
int16_t *y,
uint32_t N,
int output_shift)
......@@ -174,26 +174,26 @@ int mult_cpx_vector(int16_t *x1,
//right shift by 13 while p_a * x0 and 15 while
// we compute 4 cpx multiply for each loop
for(i=0; i<(N>>2); i++) {
tmp_re = _mm_sign_epi16(*x1_128,*(__m128i*)&conjug2[0]);
tmp_re = _mm_sign_epi16(*x1_128,*(__m128i*)&conjug2[0]);// Q15
//print_shorts("tmp_re1:",&tmp_re[i]);
tmp_re = _mm_madd_epi16(tmp_re,*x2_128);
tmp_re = _mm_madd_epi16(tmp_re,*x2_128); //Q28
//print_ints("tmp_re2:",&tmp_re[i]);
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1));
tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1)); //Q15
//print_shorts("tmp_im1:",&tmp_im[i]);
tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1));
tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1)); //Q15
//print_shorts("tmp_im2:",&tmp_im[i]);
tmp_im = _mm_madd_epi16(tmp_im, *x2_128);
tmp_im = _mm_madd_epi16(tmp_im, *x2_128); //Q28
//print_ints("tmp_im3:",&tmp_im[i]);
tmp_re = _mm_srai_epi32(tmp_re,output_shift);
tmp_re = _mm_srai_epi32(tmp_re,output_shift);//Q(28-shift)
//print_ints("tmp_re shifted:",&tmp_re[i]);
tmp_im = _mm_srai_epi32(tmp_im,output_shift);
tmp_im = _mm_srai_epi32(tmp_im,output_shift); //Q(28-shift)
//print_ints("tmp_im shifted:",&tmp_im[i]);
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im);
tmpy0 = _mm_unpacklo_epi32(tmp_re,tmp_im); //Q(28-shift)
//print_ints("unpack lo :",&tmpy0[i]);
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im);
tmpy1 = _mm_unpackhi_epi32(tmp_re,tmp_im); //Q(28-shift)
//print_ints("mrc rho0:",&tmpy1[i]);
*y_128 = _mm_packs_epi32(tmpy0,tmpy1);
*y_128 = _mm_packs_epi32(tmpy0,tmpy1); //must be Q15
//print_shorts("*y_128:",&y_128[i]);
x1_128++;
......
......@@ -43,9 +43,9 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
printf("Writing %d elements of type %d to %s\n",length,format,fname);
if (format == 10 || format ==11 || format == 12 ) {
if (format == 10 || format ==11 || format == 12 || format == 13 || format == 14) {
fp = fopen(fname,"a+");
} else if (format != 10 && format !=11 && format != 12 ) {
} else if (format != 10 && format !=11 && format != 12 && format != 13 && format != 14) {
fp = fopen(fname,"w+");
}
......@@ -56,7 +56,7 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
return(-1);
}
if (format != 10 && format !=11 && format != 12 )
if (format != 10 && format !=11 && format != 12 && format != 13 && format != 14)
fprintf(fp,"%s = [",vname);
......@@ -70,7 +70,9 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
break;
case 1: // complex 16-bit
case 13:
case 14:
case 15:
for (i=0; i<length<<1; i+=(2*dec)) {
fprintf(fp,"%d + j*(%d)\n",((short *)data)[i],((short *)data)[i+1]);
......@@ -172,14 +174,13 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
fprintf(fp,"%d \n",((unsigned char *)&data)[0]);
break;
}
if (format != 10 && format !=11 && format !=12 ) {
if (format != 10 && format !=11 && format !=12 && format != 13 && format != 15) {
fprintf(fp,"];\n");
fclose(fp);
return(0);
} else if (format == 10 || format ==11 || format == 12 ) {
} else if (format == 10 || format ==11 || format == 12 || format == 13 || format == 15) {
fclose(fp);
return(0);
}
......
......@@ -523,7 +523,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int16_t *pbch_comp;
float Re,Im,ymax=1;
int num_pdcch_symbols=3;
float *llr, *bit, *chest_f_abs, llr_pbch[1920], bit_pbch[1920], *llr_pdcch, *bit_pdcch;
float *llr0, *bit0, *llr1, *bit1, *chest_f_abs, llr_pbch[1920], bit_pbch[1920], *llr_pdcch, *bit_pdcch;
float *I, *Q;
float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES];
float **chest_t_abs;
......@@ -602,8 +602,10 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
chest_t_abs[arx] = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
}
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
llr = (float*) calloc(coded_bits_per_codeword0,sizeof(float)); // init to zero
bit = malloc(coded_bits_per_codeword0*sizeof(float));
llr0 = (float*) calloc(coded_bits_per_codeword0,sizeof(float)); // init to zero
bit0 = malloc(coded_bits_per_codeword0*sizeof(float));
llr1 = (float*) calloc(coded_bits_per_codeword1,sizeof(float)); // init to zero
bit1 = malloc(coded_bits_per_codeword1*sizeof(float));
llr_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
......@@ -769,12 +771,12 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
// PDSCH LLRs CW0
if (pdsch_llr != NULL) {
for (i=0; i<coded_bits_per_codeword0; i++) {
llr[i] = (float) pdsch_llr[i];
bit[i] = (float) i;
llr0[i] = (float) pdsch_llr[i];
bit0[i] = (float) i;
}
fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword0);
fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword0,"","","");
fl_set_xyplot_data(form->pdsch_llr,bit0,llr0,coded_bits_per_codeword0,"","","");
}
......@@ -838,12 +840,12 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
// PDSCH LLRs CW1
if (pdsch_llr1 != NULL) {
for (i=0; i<coded_bits_per_codeword1; i++) {
llr[i] = (float) pdsch_llr1[i];
bit[i] = (float) i;
llr1[i] = (float) pdsch_llr1[i];
bit1[i] = (float) i;
}
fl_set_xyplot_xbounds(form->pdsch_llr1,0,coded_bits_per_codeword1);
fl_set_xyplot_data(form->pdsch_llr1,bit,llr,coded_bits_per_codeword1,"","","");
fl_set_xyplot_data(form->pdsch_llr1,bit1,llr1,coded_bits_per_codeword1,"","","");
}
// PDSCH I/Q of MF Output
......@@ -926,8 +928,10 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
free(I);
free(Q);
free(chest_f_abs);
free(llr);
free(bit);
free(llr0);
free(bit0);
free(llr1);
free(bit1);
free(bit_pdcch);
free(llr_pdcch);
for (arx=0;arx<nb_antennas_rx;arx++) {
......
......@@ -2120,7 +2120,9 @@ n(tikz_fname,"w");
// printf("Trial %d\n",trials);
fflush(stdout);
round=0;
for (i=0; i<frame_parms->nb_antennas_tx; i++) {
memset(sic_buffer[i], 0, FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
}
//if (trials%100==0)
eNB2UE[0]->first_run = 1;
......@@ -2774,6 +2776,9 @@ n(tikz_fname,"w");
&PHY_vars_eNB->dlsch_interleaving_stats
)<0)
exit(-1);
/*
if (transmission_mode == 3) {
if (dlsch_encoding(input_buffer1[k],
......@@ -3465,7 +3470,7 @@ n(tikz_fname,"w");
0,subframe);
PHY_vars_UE->dlsch_ue[0][cw_non_sic]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw_non_sic]->current_harq_pid]->G = coded_bits_per_codeword;
PHY_vars_UE->dlsch_ue[0][cw_non_sic]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw_non_sic]->current_harq_pid]->Qm = get_Qm(PHY_vars_eNB->dlsch_eNB[0][cw_non_sic]->harq_processes[0]->mcs);
if (n_frames==1) {
if (n_frames==2) {
printf("Kmimo=%d, cw=%d, G=%d, TBS=%d\n",Kmimo,cw_non_sic,coded_bits_per_codeword,
PHY_vars_UE->dlsch_ue[0][cw_non_sic]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw_non_sic]->current_harq_pid]->TBS);
......@@ -3476,9 +3481,10 @@ n(tikz_fname,"w");
sprintf(vname,"dl%d_r%d_cw%d_llr",eNB_id,round, cw_non_sic);
write_output(fname,vname, PHY_vars_UE->lte_ue_pdsch_vars[0]->llr[cw_non_sic],coded_bits_per_codeword,1,0);
sprintf(fname,"dlsch_cw%d_e.m", cw_non_sic);
sprintf(vname,"dlsch_cw%d_e", cw_non_sic);
sprintf(vname,"dlschcw%d_e", cw_non_sic);
write_output(fname, vname,PHY_vars_eNB->dlsch_eNB[0][cw_non_sic]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
uncoded_ber=0;
printf("trials=%d\n", trials);
for (i=0;i<coded_bits_per_codeword;i++)
if (PHY_vars_eNB->dlsch_eNB[0][cw_non_sic]->harq_processes[0]->e[i] != (PHY_vars_UE->lte_ue_pdsch_vars[0]->llr[cw_non_sic][i]<0)) {
uncoded_ber_bit[i] = 1;
......@@ -3529,7 +3535,7 @@ n(tikz_fname,"w");
iter_trials[0]++;
}
if (n_frames==1) {
if (n_frames==2) {
printf("cw non sic %d, round %d: No DLSCH errors found, uncoded ber %f\n",cw_non_sic,round,uncoded_ber);
#ifdef PRINT_BYTES
for (s=0;s<PHY_vars_UE->dlsch_ue[0][cw_non_sic]->harq_processes[0]->C;s++) {
......@@ -3651,6 +3657,7 @@ n(tikz_fname,"w");
if ((PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->mimo_mode >=DUALSTREAM_UNIFORM_PRECODING1) &&
(PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->mimo_mode <=DUALSTREAM_PUSCH_PRECODING) &&
rx_type==rx_SIC_dual_stream) {
remove("rho_rho_in_llr.m");
// for (round = 0 ; round < 1 ; round++) {
dlsch0_ue_harq = PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid];
......@@ -3670,7 +3677,7 @@ n(tikz_fname,"w");
PHY_vars_UE->dlsch_eNB[eNB_id]->active = PHY_vars_UE->dlsch_ue[eNB_id][0]->active;
PHY_vars_UE->dlsch_eNB[eNB_id]->rnti = PHY_vars_UE->dlsch_ue[eNB_id][0]->rnti;
PHY_vars_UE->dlsch_eNB[eNB_id]->current_harq_pid = PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid;
dlsch_encoding(PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->b,
dlsch_encoding(input_buffer0[0], //PHY_vars_UE->dlsch_ue[eNB_id][0]->harq_processes[PHY_vars_UE->dlsch_ue[eNB_id][0]->current_harq_pid]->b,
&PHY_vars_UE->lte_frame_parms,
num_pdcch_symbols,
PHY_vars_UE->dlsch_eNB[eNB_id],
......@@ -3710,16 +3717,33 @@ n(tikz_fname,"w");
// write_output("rxdataF_comp1.m","rxF_comp1", *PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid][round],14*12*25,1,1);
// write_output("rxdataF_rho.m","rho", *PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid][round],14*12*25,1,1);
dlsch_qpsk_llr_SIC(&PHY_vars_UE->lte_frame_parms,
switch (get_Qm(PHY_vars_eNB->dlsch_eNB[0][1]->harq_processes[0]->mcs)){
case 2:
dlsch_qpsk_llr_SIC(&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid][round],
sic_buffer,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid][round],
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[1],
num_pdcch_symbols,
dlsch0_eNB_harq->nb_rb,
adjust_G2(&PHY_vars_UE->lte_frame_parms,&dlsch0_eNB_harq->rb_alloc[0],2,subframe,num_pdcch_symbols),
subframe,
dlsch0_eNB_harq->rb_alloc[0],
PHY_vars_UE->dlsch_ue[eNB_id][0]);
break;
case 4:
dlsch_16qam_llr_SIC(&PHY_vars_UE->lte_frame_parms,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp1[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid][round],
sic_buffer,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->dl_ch_rho_ext[PHY_vars_UE->dlsch_ue[0][0]->current_harq_pid][round],
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[1],
num_pdcch_symbols,
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->dl_ch_mag1,
dlsch0_eNB_harq->nb_rb,
subframe,
dlsch0_eNB_harq->rb_alloc[0],
PHY_vars_UE->dlsch_ue[eNB_id][0]);
break;
}
// }// round
// write_output("rxdata_llr1.m","llr1", PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[1],re_allocated*2,1,0);
......@@ -3738,10 +3762,10 @@ n(tikz_fname,"w");
PHY_vars_UE->dlsch_ue[0][cw_sic]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw_sic]->current_harq_pid]->G = coded_bits_per_codeword;
PHY_vars_UE->dlsch_ue[0][cw_sic]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw_sic]->current_harq_pid]->Qm = get_Qm(PHY_vars_eNB->dlsch_eNB[0][cw_sic]->harq_processes[0]->mcs);
if (n_frames==1) {
if (n_frames==2) {
printf("Kmimo=%d, cw=%d, G=%d, TBS=%d\n",Kmimo,cw_sic,coded_bits_per_codeword,
PHY_vars_UE->dlsch_ue[0][cw_sic]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw_sic]->current_harq_pid]->TBS);
// calculate uncoded BER
uncoded_ber_bit = (short*) malloc(sizeof(short)*coded_bits_per_codeword);
AssertFatal(uncoded_ber_bit, "uncoded_ber_bit==NULL");
......@@ -3749,9 +3773,10 @@ n(tikz_fname,"w");
sprintf(vname,"dl%d_r%d_cw%d_llr",eNB_id,round, cw_sic);
write_output(fname,vname, PHY_vars_UE->lte_ue_pdsch_vars[0]->llr[cw_sic],coded_bits_per_codeword,1,0);
sprintf(fname,"dlsch_cw%d_e.m", cw_sic);
sprintf(vname,"dlsch_cw%d_e", cw_sic);
sprintf(vname,"dlschcw%d_e", cw_sic);
write_output(fname, vname,PHY_vars_eNB->dlsch_eNB[0][cw_sic]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
uncoded_ber=0;
printf("trials=%d\n", trials);
for (i=0;i<coded_bits_per_codeword;i++)
if (PHY_vars_eNB->dlsch_eNB[0][cw_sic]->harq_processes[0]->e[i] != (PHY_vars_UE->lte_ue_pdsch_vars[0]->llr[cw_sic][i]<0)) {
uncoded_ber_bit[i] = 1;
......@@ -3797,7 +3822,7 @@ n(tikz_fname,"w");
iter_trials[1]++;
if (n_frames==1) {
if (n_frames==2) {
printf("cw sic %d, round %d: No DLSCH errors found, uncoded ber %f\n",cw_sic,round,uncoded_ber);
#ifdef PRINT_BYTES
for (s=0;s<PHY_vars_UE->dlsch_ue[0][cw_sic]->harq_processes[0]->C;s++) {
......@@ -3821,13 +3846,14 @@ n(tikz_fname,"w");
else {
errs[cw_sic][round]++;
// exit(0);
if (cw_sic==1) {
avg_iter[1] += ret[1]-1;
iter_trials[1]++;
}
if (n_frames==1) {
if (n_frames==2) {
//if ((n_frames==1) || (SNR>=30)) {
printf("cw sic %d, round %d: DLSCH errors found, uncoded ber %f\n",cw_sic,round,uncoded_ber);
#ifdef PRINT_BYTES
......@@ -3846,6 +3872,7 @@ n(tikz_fname,"w");
}
#endif
} //n_frames==1
// exit(0);
} //if (ret > PHY_vars_UE->dlsch_ue[0][cw_sic]->max_turbo_iterations )
} //for (int cw_1=cw_to_decode_interf_free; cw_1<cw_to_decode_interf_free+1;cw_1++)
......@@ -3872,7 +3899,7 @@ n(tikz_fname,"w");
}
if (n_frames==1) {
if (n_frames==2) {
//if ((n_frames==1) || (SNR>=30)) {
printf("cw %d, round %d: DLSCH errors found, uncoded ber %f\n",cw_non_sic,round,uncoded_ber);
#ifdef PRINT_BYTES
......@@ -3896,7 +3923,7 @@ n(tikz_fname,"w");
stop_meas(&PHY_vars_UE->phy_proc_rx);
if (n_frames==1) {
if (n_frames==2) {
//rxsig
sprintf(fname,"rxsig0_r%d.m",round);
......@@ -4520,7 +4547,7 @@ n(tikz_fname,"w");
}
else {
if ((rx_type==rx_IC_dual_stream) || (rx_type==rx_standard)) {
if ((rx_type==rx_IC_dual_stream) || (rx_type==rx_standard) || (rx_type==rx_SIC_dual_stream)) {
if (((double)errs[0][0]/(round_trials[0]))<1e-3 && ((double)errs[1][0]/(round_trials[0]))<1e-3)
break;
}
......
......@@ -932,7 +932,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
maxDoppler,
channel_offset,
path_loss_dB,
0);
1);
break;
case Rayleigh1_orth_eff_ch_TM4_prec_imag:
......
......@@ -68,8 +68,35 @@ void randominit(unsigned seed_init)
ir[i]= seed; /* initialize the shuffle table */
}