Commit c4448a2f authored by Thomas Schlichter's avatar Thomas Schlichter

fix warnings and indentation

parent 9f841634
......@@ -250,7 +250,6 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
//to be moved to init phase potentially, for now tx_layers 1-8 are mapped on antenna ports 1000-1007
/// DMRS QPSK modulation
for (int l=rel15->StartSymbolIndex; l<rel15->StartSymbolIndex+rel15->NrOfSymbols; l++) {
if (rel15->dlDmrsSymbPos & (1 << l))
nr_modulation(pdsch_dmrs[l][0], n_dmrs, DMRS_MOD_ORDER, mod_dmrs[l]); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
......@@ -287,8 +286,8 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
delta = get_delta(ap, dmrs_Type);
l_prime = 0; // single symbol ap 0
l0 = get_l0(rel15->dlDmrsSymbPos);
uint8_t dmrs_symbol = l0+l_prime;
#ifdef DEBUG_DLSCH_MAPPING
uint8_t dmrs_symbol = l0+l_prime;
printf("DMRS Type %d params for ap %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n",
1+dmrs_Type,ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime, l0, dmrs_symbol);
#endif
......@@ -311,7 +310,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
if (l==(l0+1)) //take into account the double DMRS symbols
l_prime = 1;
else if (l>(l0+1)){//new DMRS pair
else if (l>(l0+1)) {//new DMRS pair
l0 = l;
l_prime = 0;
}
......@@ -327,9 +326,9 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
k_prime++;
k_prime&=1;
n+=(k_prime)?0:1;
}
else {
} else {
if( (!(rel15->dlDmrsSymbPos & (1 << l))) || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) {
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15;
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15;
......
......@@ -721,7 +721,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
default:
msg("pdsch_channel_estimation: nushift=%d -> ERROR\n",nushift);
return(-1);
return -1;
break;
}
} else {//pdsch_dmrs_type2
......@@ -741,7 +741,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
fdcr = filt8_dcr1;
fdclh = filt8_dcl1_h;
fdcrh = filt8_dcr1_h;
break;
case 2://port2,3
......@@ -757,12 +756,11 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
fdcr = NULL;
fdclh = NULL;
fdcrh = NULL;
break;
default:
msg("pdsch_channel_estimation: nushift=%d -> ERROR\n",nushift);
return(-1);
return -1;
break;
}
}
......@@ -1039,7 +1037,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
ch_l[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
#ifdef DEBUG_PDSCH
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch_l[0],ch_l[1],pil[0],pil[1]);
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch_l[0],ch_l[1],pil[0],pil[1]);
#endif
pil+=2;
......@@ -1052,7 +1050,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
ch[1] = (ch_l[1]+ch_r[1])>>1;
#ifdef DEBUG_PDSCH
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch_r[0],ch_r[1],pil[0],pil[1]);
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch_r[0],ch_r[1],pil[0],pil[1]);
#endif
multadd_real_vector_complex_scalar(fmr,
......@@ -1084,7 +1082,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
ch_r[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
#ifdef DEBUG_PDSCH
printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch_r[0],ch_r[1],pil[0],pil[1]);
printf("pilot %u : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch_r[0],ch_r[1],pil[0],pil[1]);
#endif
ch[0] = (ch_l[0]+ch_r[0])>>1;
......
......@@ -2412,9 +2412,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
} else {//the symbol contains DMRS
j=0;
if (config_type==pdsch_dmrs_type1){
for (i = (1-frame_parms->nushift);
i<12;
i+=2) {
for (i = (1-frame_parms->nushift); i<12; i+=2) {
rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
j++;
......@@ -2422,16 +2420,12 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
dl_ch0_ext+=6;
rxF_ext+=6;
} else {
for (i = (2+frame_parms->nushift);
i<6;
i++) {
for (i = (2+frame_parms->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+frame_parms->nushift); i<12; i++) {
rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i];
j++;
......@@ -2445,7 +2439,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
rxF+=12;
k+=12;
if (k>=frame_parms->ofdm_symbol_size) {
k=k-(frame_parms->ofdm_symbol_size);
k = k-(frame_parms->ofdm_symbol_size);
rxF = &rxdataF[aarx][k+(symbol*(frame_parms->ofdm_symbol_size))];
}
}
......
......@@ -715,8 +715,6 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_id, PDSCH_t pdsch, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1) {
int nr_tti_rx = proc->nr_tti_rx;
int nr_frame_rx = proc->frame_rx;//LOG_M
char filename[100];//LOG_M
int m;
int i_mod,eNB_id_i,dual_stream_UE;
int first_symbol_flag=0;
......@@ -748,13 +746,17 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_
m,
ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12,
pdsch_nb_rb);
///LOG_M: the channel estimation
LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_tti_rx,m);
#if 0
///LOG_M: the channel estimation
int nr_frame_rx = proc->frame_rx;
char filename[100];
for (uint8_t aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
sprintf(filename,"PDSCH_CHANNEL_frame%d_slot%d_sym%d_port%d_rx%d.m", nr_frame_rx, nr_tti_rx, m, aatx,aarx);//LOG_M
sprintf(filename,"PDSCH_CHANNEL_frame%d_slot%d_sym%d_port%d_rx%d.m", nr_frame_rx, nr_tti_rx, m, aatx,aarx);
int **dl_ch_estimates = ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][0]->dl_ch_estimates;
//LOG_M(filename,"channel_F",&dl_ch_estimates[aatx*ue->frame_parms.nb_antennas_rx+aarx][ue->frame_parms.ofdm_symbol_size*m],ue->frame_parms.ofdm_symbol_size, 1, 1);
LOG_M(filename,"channel_F",&dl_ch_estimates[aatx*ue->frame_parms.nb_antennas_rx+aarx][ue->frame_parms.ofdm_symbol_size*m],ue->frame_parms.ofdm_symbol_size, 1, 1);
}
#endif
}
break;
}
......
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